Skip to content

Commit

Permalink
fix: increase max block size
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond committed May 22, 2024
1 parent 80dce32 commit cce029f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,38 @@ func (app *ElysApp) Name() string { return app.BaseApp.Name() }

// BeginBlocker application updates every begin block
func (app *ElysApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
// check that the block height is greater than 7669107 and less than 7669110
if ctx.BlockHeight() > 7669107 && ctx.BlockHeight() < 7669110 {
app.Logger().Info("Block height is greater than 7669107 and less than 7669110, checking version and commit hash")

// check that the version is v0.31.0
if version.Version != "v0.31.0" {
panic(fmt.Sprintf("expected version v0.31.0, got %s", version.Version))
}

// check that the commit hash is 21a1f670e80b0c3ce2a879a86508c6118df29d44
if version.Commit != "21a1f670e80b0c3ce2a879a86508c6118df29d44" {
panic(fmt.Sprintf("expected commit 21a1f670e80b0c3ce2a879a86508c6118df29d44, got %s", version.Commit))
}
}

// check that the block height is 7669110
if ctx.BlockHeight() == 7669110 {
// check that the version is v0.31.0
if version.Version != "v0.31.0" {
panic(fmt.Sprintf("expected version v0.31.0, got %s", version.Version))
}

app.Logger().Info("Block height is 7669110, setting max block size to 10MB")

consensusParams, err := app.ConsensusParamsKeeper.Get(ctx)
if err != nil {
panic(fmt.Errorf("failed to get consensus params: %s", err))
}
consensusParams.Block.MaxBytes = int64(10485760)
app.ConsensusParamsKeeper.Set(ctx, consensusParams)
}

return app.mm.BeginBlock(ctx, req)
}

Expand Down

0 comments on commit cce029f

Please sign in to comment.