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

fix: increase max block size #515

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading