Skip to content

Commit

Permalink
Avoid cloning whole l2 block
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosNicolau committed Sep 4, 2024
1 parent d89a9f5 commit 963149e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/lib/multivm/src/versions/era_vm/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,19 @@ impl<S: ReadStorage + 'static> Vm<S> {
let tx_data: &TransactionData = &tx.clone().into();
self.update_l2_block(tx_data);
self.insert_bytecodes(tx_data.factory_deps.iter().map(|dep| &dep[..]));
let l2_block = self.bootloader_state.last_l2_block();
self.transaction_to_execute.push(ParallelTransaction::new(
tx,
refund,
with_compression,
BootloaderL2Block {
txs: vec![],
first_tx_index: 0,
..self.bootloader_state.last_l2_block().clone()
number: l2_block.number,
max_virtual_blocks_to_create: l2_block.max_virtual_blocks_to_create,
prev_block_hash: l2_block.prev_block_hash,
timestamp: l2_block.timestamp,
txs_rolling_hash: l2_block.txs_rolling_hash,
},
));
}
Expand Down

0 comments on commit 963149e

Please sign in to comment.