Skip to content

Commit

Permalink
feat: remove os input from execution helper (keep-starknet-strange#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
GMKrieger authored Jan 13, 2025
1 parent 6e0514d commit b67bd2d
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion crates/bin/prove_block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ pub async fn prove_block(
contract_storages,
tx_execution_infos,
&block_context,
Some(os_input.clone()),
(old_block_number, old_block_hash),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ mod test {
ContractStorageMap::default(),
execution_infos,
&block_context,
None,
old_block_number_and_hash,
);

Expand Down
4 changes: 0 additions & 4 deletions crates/starknet-os/src/execution/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use tokio::sync::RwLock;

use super::secp_handler::SecpSyscallProcessor;
use crate::config::STORED_BLOCK_HASH_BUFFER;
use crate::io::input::StarknetOsInput;
use crate::starknet::core::os::kzg_manager::KzgManager;
use crate::starknet::starknet_storage::{CommitmentInfo, CommitmentInfoError, PerContractStorage};
use crate::storage::storage::StorageError;
Expand All @@ -29,7 +28,6 @@ where
PCS: PerContractStorage,
{
pub _prev_block_context: Option<BlockContext>,
pub os_input: Option<Rc<StarknetOsInput>>,
pub kzg_manager: KzgManager,
// Pointer tx execution info
pub tx_execution_info_iter: IntoIter<TransactionExecutionInfo>,
Expand Down Expand Up @@ -114,7 +112,6 @@ where
contract_storage_map: ContractStorageMap<PCS>,
tx_execution_infos: Vec<TransactionExecutionInfo>,
block_context: &BlockContext,
os_input: Option<Rc<StarknetOsInput>>,
old_block_number_and_hash: (Felt252, Felt252),
) -> Self {
// Block number and block hash (current_block_number - buffer) block buffer=STORED_BLOCK_HASH_BUFFER
Expand All @@ -129,7 +126,6 @@ where
Self {
execution_helper: Rc::new(RwLock::new(ExecutionHelper {
_prev_block_context: prev_block_context,
os_input,
kzg_manager: Default::default(),
tx_execution_info_iter: tx_execution_infos.into_iter(),
tx_execution_info: None,
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet-os/src/hints/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ mod tests {

#[fixture]
fn execution_helper(block_context: BlockContext, old_block_number_and_hash: (Felt252, Felt252)) -> EHW {
EHW::new(ContractStorageMap::default(), vec![], &block_context, None, old_block_number_and_hash)
EHW::new(ContractStorageMap::default(), vec![], &block_context, old_block_number_and_hash)
}

#[fixture]
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet-os/src/hints/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ mod tests {
fn exec_scopes(block_context: BlockContext, old_block_number_and_hash: (Felt252, Felt252)) -> ExecutionScopes {
let execution_infos = vec![];
let exec_helper =
EHW::new(ContractStorageMap::default(), execution_infos, &block_context, None, old_block_number_and_hash);
EHW::new(ContractStorageMap::default(), execution_infos, &block_context, old_block_number_and_hash);
let syscall_handler = OsSyscallHandlerWrapper::new(exec_helper);

let mut exec_scopes = ExecutionScopes::new();
Expand Down
7 changes: 3 additions & 4 deletions crates/starknet-os/src/hints/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ pub mod tests {
ContractStorageMap::default(),
execution_infos,
&block_context,
None,
old_block_number_and_hash,
);
exec_helper.start_tx(None).await;
Expand Down Expand Up @@ -168,7 +167,7 @@ pub mod tests {
// we need an execution info in order to start a tx
let execution_infos = vec![transaction_execution_info];
let exec_helper =
EHW::new(ContractStorageMap::default(), execution_infos, &block_context, None, old_block_number_and_hash);
EHW::new(ContractStorageMap::default(), execution_infos, &block_context, old_block_number_and_hash);
let exec_helper_box = Box::new(exec_helper);
exec_scopes.insert_box(vars::scopes::EXECUTION_HELPER, exec_helper_box.clone());

Expand Down Expand Up @@ -203,7 +202,7 @@ pub mod tests {
// execution info to chew through
let execution_infos = vec![transaction_execution_info];
let exec_helper =
EHW::new(ContractStorageMap::default(), execution_infos, &block_context, None, old_block_number_and_hash);
EHW::new(ContractStorageMap::default(), execution_infos, &block_context, old_block_number_and_hash);
let exec_helper_box = Box::new(exec_helper);
exec_scopes.insert_box(vars::scopes::EXECUTION_HELPER, exec_helper_box.clone());

Expand Down Expand Up @@ -247,7 +246,7 @@ pub mod tests {

let execution_infos = vec![transaction_execution_info];
let exec_helper =
EHW::new(ContractStorageMap::default(), execution_infos, &block_context, None, old_block_number_and_hash);
EHW::new(ContractStorageMap::default(), execution_infos, &block_context, old_block_number_and_hash);
let exec_helper_box = Box::new(exec_helper);
exec_scopes.insert_box(vars::scopes::EXECUTION_HELPER, exec_helper_box.clone());

Expand Down
1 change: 0 additions & 1 deletion tests/integration/common/block_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ where
contract_storage_map,
tx_execution_infos,
block_context,
Some(os_input.clone()),
(Felt252::from(block_context.block_info().block_number.0 - STORED_BLOCK_HASH_BUFFER), Felt252::from(66_u64)),
);

Expand Down

0 comments on commit b67bd2d

Please sign in to comment.