Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5.8.0 hotfix 4 #1866

Merged
merged 12 commits into from
Sep 24, 2024
5 changes: 0 additions & 5 deletions evmrpc/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,12 @@ func (f *LogFetcher) FindLogsByBloom(height int64, filters [][]bloomIndexes) (re
ctx.Logger().Error(fmt.Sprintf("FindLogsByBloom: unable to find receipt for hash %s", hash.Hex()))
continue
}
// fmt.Println("JEREMYDEBUG: in find logs by bloom, receipt: ", receipt)
// fmt.Println("JEREMYDEBUG: in find logs by bloom, receipt.EffectiveGasPrice: ", receipt.EffectiveGasPrice)
if !f.includeSynthetic && len(receipt.Logs) > 0 && receipt.Logs[0].Synthetic {
// fmt.Println("JEREMYDEBUG: in find logs by bloom: skipping synthetic log")
continue
}
if !f.includeSynthetic && receipt.EffectiveGasPrice == 0 {
// fmt.Println("JEREMYDEBUG: in find logs by bloom: skipping zero gas price")
return
}
// fmt.Println("JEREMYDEBUG: in find logs by bloom: checking logs bloom")
if len(receipt.LogsBloom) > 0 && MatchFilters(ethtypes.Bloom(receipt.LogsBloom), filters) {
res = append(res, keeper.GetLogsForTx(receipt)...)
}
Expand Down
44 changes: 1 addition & 43 deletions proto/evm/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "evm/config.proto";

option go_package = "github.com/sei-protocol/sei-chain/x/evm/types";

// Params defines the parameters for the module.
// Params defines the parameters for the module
message Params {
option (gogoproto.goproto_stringer) = false;

Expand Down Expand Up @@ -49,46 +49,4 @@ string minimum_fee_per_gas = 4 [
];

uint64 deliver_tx_hook_wasm_gas_limit = 9;
}

message ParamsPreV580 {
option (gogoproto.goproto_stringer) = false;

// string base_denom = 1 [
// (gogoproto.moretags) = "yaml:\"base_denom\"",
// (gogoproto.jsontag) = "base_denom"
// ];
string priority_normalizer = 2 [
(gogoproto.moretags) = "yaml:\"priority_normalizer\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "priority_normalizer"
];
string base_fee_per_gas = 3 [
(gogoproto.moretags) = "yaml:\"base_fee_per_gas\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "base_fee_per_gas"
];
string minimum_fee_per_gas = 4 [
(gogoproto.moretags) = "yaml:\"minimum_fee_per_gas\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "minimum_fee_per_gas"
];
// ChainConfig chain_config = 5 [(gogoproto.moretags) = "yaml:\"chain_config\"", (gogoproto.nullable) = false];
// string chain_id = 6 [
// (gogoproto.moretags) = "yaml:\"chain_id\"",
// (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
// (gogoproto.nullable) = false,
// (gogoproto.jsontag) = "chain_id"
// ];
// repeated string whitelisted_codehashes_bank_send = 7 [
// (gogoproto.moretags) = "yaml:\"whitelisted_codehashes_bank_send\"",
// (gogoproto.jsontag) = "whitelisted_codehashes_bank_send"
// ];
repeated bytes whitelisted_cw_code_hashes_for_delegate_call = 8 [
(gogoproto.moretags) = "yaml:\"whitelisted_cw_code_hashes_for_delegate_call\"",
(gogoproto.jsontag) = "whitelisted_cw_code_hashes_for_delegate_call"
];
}
23 changes: 1 addition & 22 deletions x/evm/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,7 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
}

func (k *Keeper) GetParams(ctx sdk.Context) (params types.Params) {
params = types.Params{}
defer func() {
if r := recover(); r != nil {
// If panic occurs, try to get paramsPreV580
params = k.GetParamsPreV580(ctx)
}
}()
k.Paramstore.GetParamSet(ctx, &params)
return params
}

func (k *Keeper) GetParamsPreV580(ctx sdk.Context) types.Params {
paramsPreV580 := types.ParamsPreV580{}
k.Paramstore.GetParamSet(ctx, &paramsPreV580)
// Convert paramsPreV580 to params
return types.Params{
PriorityNormalizer: paramsPreV580.PriorityNormalizer,
BaseFeePerGas: paramsPreV580.BaseFeePerGas,
MinimumFeePerGas: paramsPreV580.MinimumFeePerGas,
WhitelistedCwCodeHashesForDelegateCall: paramsPreV580.WhitelistedCwCodeHashesForDelegateCall,
DeliverTxHookWasmGasLimit: uint64(300000),
}
return k.GetParamsIfExists(ctx)
}

func (k *Keeper) GetParamsIfExists(ctx sdk.Context) types.Params {
Expand Down
14 changes: 0 additions & 14 deletions x/evm/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,6 @@ func (p Params) String() string {
return string(out)
}

func (p *ParamsPreV580) ParamSetPairs() paramtypes.ParamSetPairs {
return paramtypes.ParamSetPairs{
paramtypes.NewParamSetPair(KeyPriorityNormalizer, &p.PriorityNormalizer, validatePriorityNormalizer),
paramtypes.NewParamSetPair(KeyBaseFeePerGas, &p.BaseFeePerGas, validateBaseFeePerGas),
paramtypes.NewParamSetPair(KeyMinFeePerGas, &p.MinimumFeePerGas, validateMinFeePerGas),
paramtypes.NewParamSetPair(KeyWhitelistedCwCodeHashesForDelegateCall, &p.WhitelistedCwCodeHashesForDelegateCall, validateWhitelistedCwHashesForDelegateCall),
}
}

func (p ParamsPreV580) String() string {
out, _ := yaml.Marshal(p)
return string(out)
}

func validatePriorityNormalizer(i interface{}) error {
v, ok := i.(sdk.Dec)
if !ok {
Expand Down
Loading
Loading