Skip to content

Commit 2c4e54d

Browse files
blockifier: add l3 field to ChainInfo
1 parent 791a8aa commit 2c4e54d

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
@@ -144,6 +144,7 @@ impl ChainInfo {
144144
eth_fee_token_address: contract_address!(TEST_ERC20_CONTRACT_ADDRESS),
145145
strk_fee_token_address: contract_address!(TEST_ERC20_CONTRACT_ADDRESS2),
146146
},
147+
is_l3: false,
147148
}
148149
}
149150
}

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
@@ -454,6 +454,7 @@ impl TryFrom<PyOsConfig> for ChainInfo {
454454
py_os_config.fee_token_address.0,
455455
)?,
456456
},
457+
is_l3: false,
457458
})
458459
}
459460
}

0 commit comments

Comments
 (0)