Skip to content

Commit 9d4edbf

Browse files
blockifier: add l3 field to ChainInfo
1 parent 0131283 commit 9d4edbf

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

crates/apollo_rpc_execution/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ fn create_block_context(
394394
strk_fee_token_address: execution_config.strk_fee_contract_address,
395395
eth_fee_token_address: execution_config.eth_fee_contract_address,
396396
},
397+
is_l3: false,
397398
};
398399
let starknet_version = storage_reader
399400
.begin_ro_txn()?

crates/blockifier/src/context.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ impl BlockContext {
200200
pub struct ChainInfo {
201201
pub chain_id: ChainId,
202202
pub fee_token_addresses: FeeTokenAddresses,
203+
#[serde(default)]
204+
pub is_l3: bool,
203205
}
204206

205207
impl ChainInfo {
@@ -217,6 +219,7 @@ impl Default for ChainInfo {
217219
// TODO(guyn): should we remove the default value for chain_id?
218220
chain_id: ChainId::Other("0x0".to_string()),
219221
fee_token_addresses: FeeTokenAddresses::default(),
222+
is_l3: false,
220223
}
221224
}
222225
}

crates/blockifier/src/test_utils/struct_impls.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ impl ChainInfo {
168168
eth_fee_token_address: contract_address!(TEST_ERC20_CONTRACT_ADDRESS),
169169
strk_fee_token_address: contract_address!(TEST_ERC20_CONTRACT_ADDRESS2),
170170
},
171+
is_l3: false,
171172
}
172173
}
173174
}

crates/blockifier_reexecution/src/state_reader/utils.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ pub fn get_rpc_state_reader_config() -> RpcStateReaderConfig {
6767

6868
/// Returns the chain info of mainnet.
6969
pub fn get_chain_info(chain_id: &ChainId) -> ChainInfo {
70-
ChainInfo { chain_id: chain_id.clone(), fee_token_addresses: get_fee_token_addresses(chain_id) }
70+
ChainInfo {
71+
chain_id: chain_id.clone(),
72+
fee_token_addresses: get_fee_token_addresses(chain_id),
73+
is_l3: false,
74+
}
7175
}
7276

7377
// TODO(Aner): import the following functions instead, to reduce code duplication.

crates/native_blockifier/src/py_block_executor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ impl TryFrom<PyOsConfig> for ChainInfo {
453453
py_os_config.fee_token_address.0,
454454
)?,
455455
},
456+
is_l3: false,
456457
})
457458
}
458459
}

0 commit comments

Comments
 (0)