Skip to content

Commit

Permalink
chore: set max block gas in initChainer
Browse files Browse the repository at this point in the history
  • Loading branch information
jim380 committed Dec 27, 2023
1 parent aecd1fb commit 1286863
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ import (
)

const (
Name = "seda-chain"
Name = "seda-chain"
DefaultMaxGas = 100000000
)

var (
Expand Down Expand Up @@ -920,6 +921,13 @@ func (app *App) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
// override block max gas
if req.ConsensusParams.Block.MaxGas != DefaultMaxGas {
req.ConsensusParams.Block.MaxGas = DefaultMaxGas
}
if err := app.StoreConsensusParams(ctx, *req.ConsensusParams); err != nil {
return nil, fmt.Errorf("failed to store consensus params: %w", err)
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
}
Expand Down

0 comments on commit 1286863

Please sign in to comment.