Skip to content

Commit

Permalink
V5.8.0 hotfix 4 (#1866)
Browse files Browse the repository at this point in the history
* Release oom hotfix

* Revert showing wasm transactions in EVM rpc (#1861)

* fix proto order for deliver_tx_hook_wasm_gas_limit

* add log debug

* Add log

* Fix log

* remove synthetic events from eth_ endpoints & fix param reading

* remove GetParam fallback mechanism & always use GetParamsIfExists

* revert block.go to v.5.8.0-hot-fix-2

* lint fix

---------

Co-authored-by: yzang2019 <zymfrank@gmail.com>
Co-authored-by: codchen <codchen03@gmail.com>
  • Loading branch information
3 people authored Sep 24, 2024
1 parent 2500929 commit 6c8b336
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 453 deletions.
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

0 comments on commit 6c8b336

Please sign in to comment.