Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/proofs-docs' into proofs-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id committed Apr 2, 2024
2 parents c440d0a + 70773d3 commit 620862f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 42 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
22 changes: 0 additions & 22 deletions app/test/prepare_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,3 @@ func queryAccountInfo(capp *app.App, accs []string, kr keyring.Keyring) []blobfa
}
return infos
}

func TestPrepareProposalZeroTxsInFirstBlock(t *testing.T) {
accounts := testfactory.GenerateAccounts(6)
testApp, _, kr := testutil.NewTestAppWithGenesisSet(app.DefaultConsensusParams(), accounts...)
require.Equal(t, int64(0), testApp.LastBlockHeight())
encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...)
sendTxs := coretypes.Txs{testutil.SendTxWithManualSequence(
t,
encCfg.TxConfig,
kr,
accounts[0],
accounts[1],
1000,
testutil.ChainID,
1,
1,
)}.ToSliceOfBytes()
resp := testApp.PrepareProposal(abci.RequestPrepareProposal{
BlockData: &tmproto.Data{Txs: sendTxs},
})
require.Len(t, resp.BlockData.Txs, 0)
}
1 change: 1 addition & 0 deletions test/e2e/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func (n *Node) GenesisValidator() genesis.Validator {
},
ConsensusKey: n.SignerKey,
NetworkKey: n.NetworkKey,
Stake: n.SelfDelegation / 2,
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/blocktime/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`blocktime` is a simple tool to analyze block production rates of a chain. It scrapes the latest headers through the RPC endpoint of a provided node and calculates the average, min, max and standard deviation of the intervals between the last `n` blocks (default: 100).

To read up on starting a node and exposing the RPC endpoint go to the docs [here](https://docs.celestia.org/nodes/consensus-node)
To read up on starting a node and exposing the RPC endpoint go to the docs [here](https://docs.celestia.org/nodes/full-consensus-node)

## Usage

Expand Down

0 comments on commit 620862f

Please sign in to comment.