Skip to content

Commit

Permalink
refactor(blockifier_reexecution): add chain ID to SerializableOffline…
Browse files Browse the repository at this point in the history
…ReexecutionData
  • Loading branch information
dorimedini-starkware committed Nov 13, 2024
1 parent 76e86ad commit 0c076ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pub struct SerializableDataPrevBlock {
pub struct SerializableOfflineReexecutionData {
pub serializable_data_prev_block: SerializableDataPrevBlock,
pub serializable_data_next_block: SerializableDataNextBlock,
pub chain_id: ChainId,
pub old_block_hash: BlockHash,
}

Expand Down Expand Up @@ -119,6 +120,7 @@ impl From<SerializableOfflineReexecutionData> for OfflineReexecutionData {
state_diff_next_block,
declared_classes,
},
chain_id,
old_block_hash,
} = value;

Expand All @@ -138,7 +140,7 @@ impl From<SerializableOfflineReexecutionData> for OfflineReexecutionData {
offline_state_reader_prev_block,
block_context_next_block: BlockContext::new(
block_info_next_block,
get_chain_info(&ChainId::Mainnet),
get_chain_info(&chain_id),
VersionedConstants::get(&starknet_version).unwrap().clone(),
BouncerConfig::max(),
),
Expand Down
3 changes: 2 additions & 1 deletion crates/blockifier_reexecution/src/state_reader/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ pub fn write_block_reexecution_data_to_file(
let consecutive_state_readers = ConsecutiveTestStateReaders::new(
block_number.prev().expect("Should not run with block 0"),
Some(config),
chain_id,
chain_id.clone(),
true,
);

Expand All @@ -267,6 +267,7 @@ pub fn write_block_reexecution_data_to_file(
SerializableOfflineReexecutionData {
serializable_data_prev_block,
serializable_data_next_block,
chain_id,
old_block_hash,
}
.write_to_file(full_file_path)
Expand Down

0 comments on commit 0c076ba

Please sign in to comment.