From 548e4b2c91595ede7e3e650c17d3612aa475d863 Mon Sep 17 00:00:00 2001 From: Jon Chappelow Date: Thu, 13 Feb 2025 10:51:43 -0600 Subject: [PATCH] raise max tx count in block for leader proposal creation --- node/consensus/engine.go | 7 ++++--- node/consensus/leader.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/node/consensus/engine.go b/node/consensus/engine.go index 10005956c..e415be930 100644 --- a/node/consensus/engine.go +++ b/node/consensus/engine.go @@ -23,9 +23,10 @@ import ( ) const ( - // Use these accordingly - MaxBlockSize = 4 * 1024 * 1024 // 1 MB - blockTxCount = 50 + // maxNumTxnsInBlock is the maximum number of transactions we will put in a + // block proposal. Currently set to a billion, which is basically no limit + // since block size in bytes will hit first. + maxNumTxnsInBlock = 1 << 30 defaultProposeTimeout = 1 * time.Second ) diff --git a/node/consensus/leader.go b/node/consensus/leader.go index b9645fa25..ca1eba0cd 100644 --- a/node/consensus/leader.go +++ b/node/consensus/leader.go @@ -191,7 +191,7 @@ func (ce *ConsensusEngine) proposeBlock(ctx context.Context) error { // does basic gas and balance checks and enforces the block size limits. func (ce *ConsensusEngine) createBlockProposal(ctx context.Context) (*blockProposal, error) { totalTxSizeLimit := ce.ConsensusParams().MaxBlockSize - nTxs := ce.mempool.PeekN(blockTxCount, int(totalTxSizeLimit)) + nTxs := ce.mempool.PeekN(maxNumTxnsInBlock, int(totalTxSizeLimit)) txns := make([]*ktypes.Transaction, len(nTxs)) for i, ntx := range nTxs { txns[i] = ntx.Tx