diff --git a/sequencer/src/block/payload.rs b/sequencer/src/block/payload.rs index 1be5a563b..af15460b3 100644 --- a/sequencer/src/block/payload.rs +++ b/sequencer/src/block/payload.rs @@ -160,7 +160,13 @@ impl Payload { raw_payload: vec![], ns_table: NameSpaceTable::default(), }; + let mut block_size = 0u64; for tx in txs.into_iter() { + block_size += tx.payload().len() as u64; + // TODO max_block_size will be passed in + if block_size >= crate::ChainConfig::default().max_block_size() { + break; + } Payload::::update_namespace_with_tx(&mut namespaces, tx); }