Skip to content

Commit

Permalink
Enforce max_block_size
Browse files Browse the repository at this point in the history
Omit transactions that exceed max_block_size from payload. Use mocked
`max_block_size` for now.
  • Loading branch information
tbro committed Apr 24, 2024
1 parent 270393c commit 382e4e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sequencer/src/block/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,13 @@ impl<TableWord: TableWordTraits> Payload<TableWord> {
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::<TableWord>::update_namespace_with_tx(&mut namespaces, tx);
}

Expand Down

0 comments on commit 382e4e6

Please sign in to comment.