Skip to content

Commit

Permalink
Problem: opBlockhash broke after sdk50 (#534)
Browse files Browse the repository at this point in the history
* Problem: opBlockhash broke after sdk50

* cleanup

* Apply suggestions from code review

* DeleteHeaderHash

* add header_hash_num in param

* Apply suggestions from code review

Signed-off-by: yihuang <[email protected]>

* Apply suggestions from code review

Signed-off-by: yihuang <[email protected]>

* Update x/evm/types/key.go

Signed-off-by: yihuang <[email protected]>

* Apply suggestions from code review

* fix build

* lint

---------

Signed-off-by: yihuang <[email protected]>
Co-authored-by: yihuang <[email protected]>
  • Loading branch information
mmsqe and yihuang authored Oct 4, 2024
1 parent 617eac9 commit 853e1e5
Show file tree
Hide file tree
Showing 16 changed files with 310 additions and 159 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (rpc) [#516](https://github.com/crypto-org-chain/ethermint/pull/516) Avoid method eth_chainId crashed due to nil pointer on IsEIP155 check.
* (cli) [#524](https://github.com/crypto-org-chain/ethermint/pull/524) Allow tx evm raw run for generate only when offline with evm-denom flag.
* (rpc) [#527](https://github.com/crypto-org-chain/ethermint/pull/527) Fix balance consistency between trace-block and state machine.
* (rpc) [#534](https://github.com/crypto-org-chain/ethermint/pull/534) Fix opBlockhash when no block header in abci request.
* (rpc) [#536](https://github.com/crypto-org-chain/ethermint/pull/536) Fix validate basic after transaction conversion with raw field.
* (cli) [#537](https://github.com/crypto-org-chain/ethermint/pull/537) Fix unsuppored sign mode SIGN_MODE_TEXTUAL for bank transfer.

Expand Down
16 changes: 15 additions & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,28 @@ import (
"context"

upgradetypes "cosmossdk.io/x/upgrade/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
evmtypes "github.com/evmos/ethermint/x/evm/types"
)

func (app *EthermintApp) RegisterUpgradeHandlers() {
planName := "sdk50"
app.UpgradeKeeper.SetUpgradeHandler(planName,
func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM)
m, err := app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM)
if err != nil {
return m, err
}
sdkCtx := sdk.UnwrapSDKContext(ctx)
{
params := app.EvmKeeper.GetParams(sdkCtx)
params.HeaderHashNum = evmtypes.DefaultHeaderHashNum
if err := app.EvmKeeper.SetParams(sdkCtx, params); err != nil {
return m, err
}
}
return m, nil
},
)
}
Loading

0 comments on commit 853e1e5

Please sign in to comment.