Skip to content

Commit

Permalink
revert: last block height == 0 check
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Apr 1, 2024
1 parent c7bef58 commit ac7bebf
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions app/prepare_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,7 @@ func (app *App) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePr
app.ParamsKeeper,
app.MsgGateKeeper,
)

var txs [][]byte
// This if statement verifies whether the preparation of the proposal
// pertains to the first block. If it does, the block is constructed using
// an empty set of transactions. However, even without this validation,
// the initial block is anticipated to be devoid of transactions, as
// established by the findings presented in
// https://github.com/celestiaorg/celestia-app/issues/1899;
// The inclusion of this check is out of an abundance of caution.
// The rationale behind having an empty first block revolves around the fact
// that no transactions can enter the mempool since no committed state exists
// until after the first block is committed (at which point the Genesis state
// gets committed too). Consequently, the prepare proposal request for the
// first block is expected to contain no transaction, so is the first block.
if app.LastBlockHeight() == 0 {
txs = make([][]byte, 0)
} else {
txs = FilterTxs(app.Logger(), sdkCtx, handler, app.txConfig, req.BlockData.Txs)
}
txs := FilterTxs(app.Logger(), sdkCtx, handler, app.txConfig, req.BlockData.Txs)

// build the square from the set of valid and prioritised transactions.
// The txs returned are the ones used in the square and block
Expand Down

0 comments on commit ac7bebf

Please sign in to comment.