Skip to content

Commit

Permalink
Merge pull request #3 from apoorvsadana/with_sps_feat
Browse files Browse the repository at this point in the history
add sps feature flag
  • Loading branch information
Angel-Petrov authored Apr 15, 2024
2 parents 33d2ed2 + 9958b4f commit e644429
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ rand = { version = "0.8.5", features = ["rand_chacha"] }
lazy_static = "1.4.0"
sysinfo = "0.30.5"
crossbeam-queue = "0.3.11"

[features]
default = []
with_sps = []
2 changes: 1 addition & 1 deletion config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ setup:

fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
num_accounts: 1
chain_id: "SN_GOERLI"
chain_id: "MADARA"

run:
concurrency: 5
Expand Down
17 changes: 16 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub async fn wait_for_tx(
Err(err) => {
return Err(eyre!(err).wrap_err(format!(
"Error while waiting for transaction {tx_hash:#064x}"
)))
)));
}
}
}
Expand Down Expand Up @@ -207,6 +207,7 @@ pub async fn get_blocks_with_txs(

let mut resources = Vec::with_capacity(block_with_txs.transactions.len());

#[cfg(with_sps)]
for tx in block_with_txs.transactions.iter() {
let maybe_receipt = starknet_rpc
.get_transaction_receipt(tx.transaction_hash())
Expand All @@ -229,6 +230,20 @@ pub async fn get_blocks_with_txs(

resources.push(resource);
}
#[cfg(not(with_sps))]
for _ in block_with_txs.transactions.iter() {
resources.push(ExecutionResources {
steps: 0,
memory_holes: Some(0),
range_check_builtin_applications: 0,
pedersen_builtin_applications: 0,
poseidon_builtin_applications: 0,
ec_op_builtin_applications: 0,
ecdsa_builtin_applications: 0,
bitwise_builtin_applications: 0,
keccak_builtin_applications: 0,
});
}

Ok((block_with_txs, resources))
}
Expand Down

0 comments on commit e644429

Please sign in to comment.