Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(blockifier_reexecution): add chain ID to SerializableOfflineReexecutionData #1972

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -252,7 +252,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 @@ -272,6 +272,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
Loading