Skip to content

Commit

Permalink
raise max tx count in block for leader proposal creation
Browse files Browse the repository at this point in the history
  • Loading branch information
jchappelow committed Feb 13, 2025
1 parent acb1b4d commit 548e4b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions node/consensus/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion node/consensus/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 548e4b2

Please sign in to comment.