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

Problem: opBlockhash broke after sdk50 #534

Merged
merged 15 commits into from
Oct 4, 2024
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 @@
"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

Check warning on line 33 in app/upgrades.go

View check run for this annotation

Codecov / codecov/patch

app/upgrades.go#L31-L33

Added lines #L31 - L33 were not covered by tests
}
sdkCtx := sdk.UnwrapSDKContext(ctx)

Check warning on line 35 in app/upgrades.go

View check run for this annotation

Codecov / codecov/patch

app/upgrades.go#L35

Added line #L35 was not covered by tests
{
params := app.EvmKeeper.GetParams(sdkCtx)
params.HeaderHashNum = evmtypes.DefaultHeaderHashNum
if err := app.EvmKeeper.SetParams(sdkCtx, params); err != nil {
return m, err

Check warning on line 40 in app/upgrades.go

View check run for this annotation

Codecov / codecov/patch

app/upgrades.go#L37-L40

Added lines #L37 - L40 were not covered by tests
}
}
return m, nil

Check warning on line 43 in app/upgrades.go

View check run for this annotation

Codecov / codecov/patch

app/upgrades.go#L43

Added line #L43 was not covered by tests
},
)
}
Loading
Loading