From a49e209167f8bdb6116dbb694fe132674c1db26b Mon Sep 17 00:00:00 2001 From: Arun Jangra Date: Fri, 20 Dec 2024 21:55:00 +0530 Subject: [PATCH] feat : added tests for starknet client --- .github/workflows/rust-test.yml | 4 + .gitignore | 3 + Cargo.lock | 4 + crates/client/settlement_client/Cargo.toml | 4 + .../settlement_client/src/starknet/mod.rs | 218 +++++++++++++++++- .../test_contracts/appchain_test.cairo | 53 +++++ .../test_contracts/appchain_test.casm.json | 1 + .../test_contracts/appchain_test.sierra.json | 1 + .../settlement_client/src/starknet/utils.rs | 210 +++++++++++++++++ test-artifacts/devnet.yaml | 34 +++ 10 files changed, 523 insertions(+), 9 deletions(-) create mode 100644 crates/client/settlement_client/src/starknet/test_contracts/appchain_test.cairo create mode 100644 crates/client/settlement_client/src/starknet/test_contracts/appchain_test.casm.json create mode 100644 crates/client/settlement_client/src/starknet/test_contracts/appchain_test.sierra.json create mode 100644 crates/client/settlement_client/src/starknet/utils.rs create mode 100644 test-artifacts/devnet.yaml diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 3a76b05d1..b414b8370 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -30,6 +30,10 @@ jobs: while ! nc -z localhost 8545; do sleep 1 done + - name: Download madara binary for l2 client testing + run: | + curl -L https://madara-test-binary.s3.us-west-1.amazonaws.com/madara -o ./test-artifacts/madara + chmod +x ./test-artifacts/madara - name: Run unit tests run: | diff --git a/.gitignore b/.gitignore index a256a077c..8acd8c1d9 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,6 @@ tmp/ # Running madara with make and docker compose .secrets image.tar.gz + +# madara test artifacts for testing l2 clients for appchains +test-artifacts/madara \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 42f125cba..62f13049e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5817,6 +5817,7 @@ version = "0.7.0" dependencies = [ "alloy", "anyhow", + "assert_matches", "async-trait", "bigdecimal", "bitvec", @@ -5843,8 +5844,11 @@ dependencies = [ "serde", "serde_json", "serial_test", + "starknet-accounts", + "starknet-contract", "starknet-core", "starknet-providers", + "starknet-signers", "starknet-types-core 0.1.7 (git+https://github.com/kasarlabs/types-rs.git?branch=feat-deserialize-v0.1.7)", "starknet_api", "tempfile", diff --git a/crates/client/settlement_client/Cargo.toml b/crates/client/settlement_client/Cargo.toml index 4a7327e90..7123e4b9b 100644 --- a/crates/client/settlement_client/Cargo.toml +++ b/crates/client/settlement_client/Cargo.toml @@ -33,6 +33,7 @@ starknet_api.workspace = true # Other +assert_matches = "1.5.0" alloy.workspace = true anyhow.workspace = true bigdecimal.workspace = true @@ -44,6 +45,9 @@ serde = { workspace = true, default-features = true } serde_json = "1" starknet-providers = { workspace = true } starknet-core = { workspace = true } +starknet-accounts = "0.11.0" +starknet-signers = { workspace = true } +starknet-contract = "0.11.0" thiserror.workspace = true time = "0.3.36" tokio = { workspace = true, features = [ diff --git a/crates/client/settlement_client/src/starknet/mod.rs b/crates/client/settlement_client/src/starknet/mod.rs index 333bb0bbf..6ea535edb 100644 --- a/crates/client/settlement_client/src/starknet/mod.rs +++ b/crates/client/settlement_client/src/starknet/mod.rs @@ -18,6 +18,10 @@ use tokio::time::sleep; use tracing::{error, trace}; use url::Url; +#[cfg(test)] +mod utils; + +#[derive(Debug)] pub struct StarknetClient { pub provider: Arc>, pub l2_core_contract: Felt, @@ -66,6 +70,9 @@ impl ClientTrait for StarknetClient { Self: Sized, { let provider = JsonRpcClient::new(HttpTransport::new(config.url)); + // Check if l2 contract exists : + // If contract is not there this will error out. + provider.get_class_at(BlockId::Tag(BlockTag::Latest), config.l2_contract_address).await?; Ok(Self { provider: Arc::new(provider), l2_core_contract: config.l2_contract_address, @@ -80,9 +87,11 @@ impl ClientTrait for StarknetClient { async fn get_last_event_block_number(&self) -> anyhow::Result { let latest_block = self.get_latest_block_number().await?; + // If block on l2 is not greater than or equal to 6000 we will consider the last block to 0. + let last_block = if latest_block <= 6000 { 0 } else { 6000 }; let last_events = self .get_events( - BlockId::Number(latest_block - 6000), + BlockId::Number(last_block), BlockId::Number(latest_block), self.l2_core_contract, // taken from : https://github.com/keep-starknet-strange/piltover/blob/main/src/appchain.cairo#L102 @@ -94,7 +103,7 @@ impl ClientTrait for StarknetClient { match last_update_state_event { Some(event) => { /* - Github Ref : https://github.com/keep-starknet-strange/piltover/blob/main/src/appchain.cairo#L101 + GitHub Ref : https://github.com/keep-starknet-strange/piltover/blob/main/src/appchain.cairo#L101 Event description : ------------------ #[derive(Drop, starknet::Event)] @@ -105,7 +114,11 @@ impl ClientTrait for StarknetClient { } */ assert_eq!(event.data.len(), 3, "Event response invalid !!"); - Ok(event.data[1].to_u64().unwrap()) + // Block number management in case of pending block number events. + match event.block_number { + Some(block_number) => Ok(block_number), + None => Ok(self.get_latest_block_number().await? + 1), + } } None => { bail!("No event found") @@ -120,13 +133,13 @@ impl ClientTrait for StarknetClient { FunctionCall { contract_address: self.l2_core_contract, /* - Github Ref : https://github.com/keep-starknet-strange/piltover/blob/main/src/state/component.cairo#L59 + GitHub Ref : https://github.com/keep-starknet-strange/piltover/blob/main/src/state/component.cairo#L59 Function Call response : (StateRoot, BlockNumber, BlockHash) */ entry_point_selector: get_selector_from_name("get_state")?, calldata: vec![], }, - BlockId::Tag(BlockTag::Latest), + BlockId::Tag(BlockTag::Pending), ) .await?; assert_eq!(call_res.len(), 3, "Call response invalid !!"); @@ -141,13 +154,13 @@ impl ClientTrait for StarknetClient { FunctionCall { contract_address: self.l2_core_contract, /* - Github Ref : https://github.com/keep-starknet-strange/piltover/blob/main/src/state/component.cairo#L59 + GitHub Ref : https://github.com/keep-starknet-strange/piltover/blob/main/src/state/component.cairo#L59 Function Call response : (StateRoot, BlockNumber, BlockHash) */ entry_point_selector: get_selector_from_name("get_state")?, calldata: vec![], }, - BlockId::Tag(BlockTag::Latest), + BlockId::Tag(BlockTag::Pending), ) .await?; assert_eq!(call_res.len(), 3, "Call response invalid !!"); @@ -162,13 +175,13 @@ impl ClientTrait for StarknetClient { FunctionCall { contract_address: self.l2_core_contract, /* - Github Ref : https://github.com/keep-starknet-strange/piltover/blob/main/src/state/component.cairo#L59 + GitHub Ref : https://github.com/keep-starknet-strange/piltover/blob/main/src/state/component.cairo#L59 Function Call response : (StateRoot, BlockNumber, BlockHash) */ entry_point_selector: get_selector_from_name("get_state")?, calldata: vec![], }, - BlockId::Tag(BlockTag::Latest), + BlockId::Tag(BlockTag::Pending), ) .await?; assert_eq!(call_res.len(), 3, "Call response invalid !!"); @@ -268,3 +281,190 @@ impl StarknetClient { Ok(event_vec) } } + +#[cfg(test)] +pub mod starknet_client_tests { + use crate::client::ClientTrait; + use crate::gas_price::L1BlockMetrics; + use crate::starknet::utils::{prepare_starknet_client_test, send_state_update, MADARA_PORT}; + use crate::starknet::{StarknetClient, StarknetClientConfig}; + use crate::state_update::StateUpdate; + use serial_test::serial; + use starknet_types_core::felt::Felt; + use std::str::FromStr; + use std::time::Duration; + use tokio::time::sleep; + use url::Url; + + #[serial] + #[tokio::test] + async fn fail_create_new_client_contract_does_not_exists() -> anyhow::Result<()> { + prepare_starknet_client_test().await?; + let l1_block_metrics = L1BlockMetrics::register()?; + let starknet_client = StarknetClient::new(StarknetClientConfig { + url: Url::parse(format!("http://127.0.0.1:{}", MADARA_PORT).as_str())?, + l2_contract_address: Felt::from_str("0xdeadbeef")?, + l1_block_metrics, + }) + .await; + assert!(starknet_client.is_err(), "Should fail to create a new client"); + Ok(()) + } + + #[serial] + #[tokio::test] + async fn create_new_client_contract_exists_starknet_client() -> anyhow::Result<()> { + // Here we need to have madara variable otherwise it will + // get dropped and will kill the madara. + #[allow(unused_variables)] + let (_, deployed_address, madara) = prepare_starknet_client_test().await?; + let l1_block_metrics = L1BlockMetrics::register()?; + let starknet_client = StarknetClient::new(StarknetClientConfig { + url: Url::parse(format!("http://127.0.0.1:{}", MADARA_PORT).as_str())?, + l2_contract_address: deployed_address, + l1_block_metrics, + }) + .await; + assert!(starknet_client.is_ok(), "Should not fail to create a new client"); + Ok(()) + } + + #[serial] + #[tokio::test] + async fn get_last_event_block_number_works_starknet_client() -> anyhow::Result<()> { + // Here we need to have madara variable otherwise it will + // get dropped and will kill the madara. + #[allow(unused_variables)] + let (account, deployed_address, madara) = prepare_starknet_client_test().await?; + let l1_block_metrics = L1BlockMetrics::register()?; + let starknet_client = StarknetClient::new(StarknetClientConfig { + url: Url::parse(format!("http://127.0.0.1:{}", MADARA_PORT).as_str())?, + l2_contract_address: deployed_address, + l1_block_metrics, + }) + .await?; + + // sending state updates : + send_state_update( + &account, + deployed_address, + StateUpdate { + block_number: 99, + global_root: Felt::from_hex("0xdeadbeef")?, + block_hash: Felt::from_hex("0xdeadbeef")?, + }, + ) + .await?; + let last_event_block_number = send_state_update( + &account, + deployed_address, + StateUpdate { + block_number: 100, + global_root: Felt::from_hex("0xdeadbeef")?, + block_hash: Felt::from_hex("0xdeadbeef")?, + }, + ) + .await?; + + // It takes time on madara for events to be stored + sleep(Duration::from_secs(10)).await; + + let latest_event_block_number = starknet_client.get_last_event_block_number().await?; + assert_eq!(latest_event_block_number, last_event_block_number, "Latest event should have block number 100"); + Ok(()) + } + + #[serial] + #[tokio::test] + async fn get_last_verified_block_hash_works_starknet_client() -> anyhow::Result<()> { + // Here we need to have madara variable otherwise it will + // get dropped and will kill the madara. + #[allow(unused_variables)] + let (account, deployed_address, madara) = prepare_starknet_client_test().await?; + let l1_block_metrics = L1BlockMetrics::register()?; + let starknet_client = StarknetClient::new(StarknetClientConfig { + url: Url::parse(format!("http://127.0.0.1:{}", MADARA_PORT).as_str())?, + l2_contract_address: deployed_address, + l1_block_metrics, + }) + .await?; + + // sending state updates : + let data_felt = Felt::from_hex("0xdeadbeef")?; + send_state_update( + &account, + deployed_address, + StateUpdate { block_number: 100, global_root: data_felt, block_hash: data_felt }, + ) + .await?; + sleep(Duration::from_secs(5)).await; + + let last_verified_block_hash = starknet_client.get_last_verified_block_hash().await?; + assert_eq!(last_verified_block_hash, data_felt, "Block hash should match"); + + Ok(()) + } + + #[serial] + #[tokio::test] + async fn get_last_state_root_works_starknet_client() -> anyhow::Result<()> { + // Here we need to have madara variable otherwise it will + // get dropped and will kill the madara. + #[allow(unused_variables)] + let (account, deployed_address, madara) = prepare_starknet_client_test().await?; + let l1_block_metrics = L1BlockMetrics::register()?; + let starknet_client = StarknetClient::new(StarknetClientConfig { + url: Url::parse(format!("http://127.0.0.1:{}", MADARA_PORT).as_str())?, + l2_contract_address: deployed_address, + l1_block_metrics, + }) + .await?; + + // sending state updates : + let data_felt = Felt::from_hex("0xdeadbeef")?; + send_state_update( + &account, + deployed_address, + StateUpdate { block_number: 100, global_root: data_felt, block_hash: data_felt }, + ) + .await?; + sleep(Duration::from_secs(5)).await; + + let last_verified_state_root = starknet_client.get_last_state_root().await?; + assert_eq!(last_verified_state_root, data_felt, "Last state root should match"); + + Ok(()) + } + + #[serial] + #[tokio::test] + async fn get_last_verified_block_number_works_starknet_client() -> anyhow::Result<()> { + // Here we need to have madara variable otherwise it will + // get dropped and will kill the madara. + #[allow(unused_variables)] + let (account, deployed_address, madara) = prepare_starknet_client_test().await?; + let l1_block_metrics = L1BlockMetrics::register()?; + let starknet_client = StarknetClient::new(StarknetClientConfig { + url: Url::parse(format!("http://127.0.0.1:{}", MADARA_PORT).as_str())?, + l2_contract_address: deployed_address, + l1_block_metrics, + }) + .await?; + + // sending state updates : + let data_felt = Felt::from_hex("0xdeadbeef")?; + let block_number = 100; + send_state_update( + &account, + deployed_address, + StateUpdate { block_number, global_root: data_felt, block_hash: data_felt }, + ) + .await?; + sleep(Duration::from_secs(5)).await; + + let last_verified_block_number = starknet_client.get_last_verified_block_number().await?; + assert_eq!(last_verified_block_number, block_number, "Last verified block should match"); + + Ok(()) + } +} diff --git a/crates/client/settlement_client/src/starknet/test_contracts/appchain_test.cairo b/crates/client/settlement_client/src/starknet/test_contracts/appchain_test.cairo new file mode 100644 index 000000000..78ea72bfa --- /dev/null +++ b/crates/client/settlement_client/src/starknet/test_contracts/appchain_test.cairo @@ -0,0 +1,53 @@ +#[starknet::contract] +mod StateUpdateContract { + type StateRoot = felt252; + type BlockNumber = felt252; + type BlockHash = felt252; + + #[storage] + struct Storage { + state_root: StateRoot, + block_number: BlockNumber, + block_hash: BlockHash, + } + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + LogStateUpdate: LogStateUpdate + } + + #[derive(Drop, starknet::Event)] + struct LogStateUpdate { + state_root: felt252, + block_number: felt252, + block_hash: felt252, + } + + #[constructor] + fn constructor(ref self: ContractState) { + // Initialize with default values + self.state_root.write(0); + self.block_number.write(0); + self.block_hash.write(0); + } + + #[external(v0)] + fn update_state( + ref self: ContractState, + block_number: BlockNumber, + state_root: StateRoot, + block_hash: BlockHash + ) { + self.state_root.write(state_root); + self.block_number.write(block_number); + self.block_hash.write(block_hash); + + self.emit(LogStateUpdate { state_root, block_number, block_hash, }); + } + + #[external(v0)] + fn get_state(self: @ContractState) -> (StateRoot, BlockNumber, BlockHash) { + (self.state_root.read(), self.block_number.read(), self.block_hash.read()) + } +} diff --git a/crates/client/settlement_client/src/starknet/test_contracts/appchain_test.casm.json b/crates/client/settlement_client/src/starknet/test_contracts/appchain_test.casm.json new file mode 100644 index 000000000..c613f4cff --- /dev/null +++ b/crates/client/settlement_client/src/starknet/test_contracts/appchain_test.casm.json @@ -0,0 +1 @@ +{"prime":"0x800000000000011000000000000000000000000000000000000000000000001","compiler_version":"2.8.0","bytecode":["0xa0680017fff8000","0x7","0x482680017ffa8000","0x100000000000000000000000000000000","0x400280007ff97fff","0x10780017fff7fff","0xc0","0x4825800180007ffa","0x0","0x400280007ff97fff","0x482680017ff98000","0x1","0x48297ffc80007ffd","0x20680017fff7fff","0x4","0x10780017fff7fff","0xa","0x482680017ffc8000","0x1","0x480a7ffd7fff8000","0x480680017fff8000","0x0","0x480280007ffc8000","0x10780017fff7fff","0x8","0x480a7ffc7fff8000","0x480a7ffd7fff8000","0x480680017fff8000","0x1","0x480680017fff8000","0x0","0x20680017fff7ffe","0x98","0x48307ffc80007ffd","0x20680017fff7fff","0x4","0x10780017fff7fff","0xa","0x482480017ffb8000","0x1","0x48127ffb7fff8000","0x480680017fff8000","0x0","0x480080007ff88000","0x10780017fff7fff","0x8","0x48127ffb7fff8000","0x48127ffb7fff8000","0x480680017fff8000","0x1","0x480680017fff8000","0x0","0x20680017fff7ffe","0x75","0x48307ffc80007ffd","0x20680017fff7fff","0x4","0x10780017fff7fff","0xa","0x482480017ffb8000","0x1","0x48127ffb7fff8000","0x480680017fff8000","0x0","0x480080007ff88000","0x10780017fff7fff","0x8","0x48127ffb7fff8000","0x48127ffb7fff8000","0x480680017fff8000","0x1","0x480680017fff8000","0x0","0x20680017fff7ffe","0x52","0x48307ffc80007ffd","0x20680017fff7fff","0x4","0x10780017fff7fff","0x10","0x40780017fff7fff","0x1","0x480680017fff8000","0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473","0x400080007ffe7fff","0x48127fed7fff8000","0x48127feb7fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x1104800180018000","0x250","0x482480017fff8000","0x24f","0x480080007fff8000","0xa0680017fff8000","0x9","0x4824800180007fe9","0xa370","0x482480017fff8000","0x100000000000000000000000000000000","0x400080007fe87fff","0x10780017fff7fff","0x22","0x4824800180007fe9","0xa370","0x400080007fe97fff","0x482480017fe98000","0x1","0x48127ffe7fff8000","0x480a7ffb7fff8000","0x48127feb7fff8000","0x48127fef7fff8000","0x48127ff37fff8000","0x1104800180018000","0x1b6","0x20680017fff7ffd","0xc","0x40780017fff7fff","0x1","0x48127ff97fff8000","0x48127ff97fff8000","0x48127ff97fff8000","0x480680017fff8000","0x0","0x48127ffb7fff8000","0x48127ffa7fff8000","0x208b7fff7fff7ffe","0x48127ffa7fff8000","0x48127ffa7fff8000","0x48127ffa7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x48127ffa7fff8000","0x208b7fff7fff7ffe","0x40780017fff7fff","0x1","0x480680017fff8000","0x4f7574206f6620676173","0x400080007ffe7fff","0x482480017fe68000","0x1","0x48127fe47fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x40780017fff7fff","0x1","0x480680017fff8000","0x4661696c656420746f20646573657269616c697a6520706172616d202333","0x400080007ffe7fff","0x48127fee7fff8000","0x48127fec7fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x40780017fff7fff","0x1","0x480680017fff8000","0x4661696c656420746f20646573657269616c697a6520706172616d202332","0x400080007ffe7fff","0x48127ff37fff8000","0x48127ff17fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x40780017fff7fff","0x1","0x480680017fff8000","0x4661696c656420746f20646573657269616c697a6520706172616d202331","0x400080007ffe7fff","0x48127ff87fff8000","0x48127ff67fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x40780017fff7fff","0x1","0x480680017fff8000","0x4f7574206f6620676173","0x400080007ffe7fff","0x482680017ff98000","0x1","0x480a7ffa7fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0xa0680017fff8000","0x7","0x482680017ffa8000","0x100000000000000000000000000000000","0x400280007ff97fff","0x10780017fff7fff","0x98","0x4825800180007ffa","0x0","0x400280007ff97fff","0x482680017ff98000","0x1","0x48297ffc80007ffd","0x20680017fff7fff","0x4","0x10780017fff7fff","0x10","0x40780017fff7fff","0x1","0x480680017fff8000","0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473","0x400080007ffe7fff","0x48127ffc7fff8000","0x48127ffa7fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x1104800180018000","0x1bb","0x482480017fff8000","0x1ba","0x480080007fff8000","0xa0680017fff8000","0x9","0x4824800180007ff8","0x65b8","0x482480017fff8000","0x100000000000000000000000000000000","0x400080007ff77fff","0x10780017fff7fff","0x63","0x4824800180007ff8","0x65b8","0x400080007ff87fff","0x480680017fff8000","0x0","0x480680017fff8000","0xa3e35b50432cd1669313bd75e434458dd8bc8d21437d2aa29d6c256f7b13d1","0x482480017ff68000","0x1","0x480680017fff8000","0x53746f7261676552656164","0x400280007ffb7fff","0x400280017ffb7ffb","0x400280027ffb7ffc","0x400280037ffb7ffd","0x480280057ffb8000","0x20680017fff7fff","0x42","0x480280047ffb8000","0x480680017fff8000","0x0","0x480680017fff8000","0x27f5e07830ee1ad079cf8c8462d2edc585bda982dbded162e761eb7fd71d84a","0x480280067ffb8000","0x480680017fff8000","0x53746f7261676552656164","0x400280077ffb7fff","0x400280087ffb7ffb","0x400280097ffb7ffc","0x4002800a7ffb7ffd","0x4802800c7ffb8000","0x20680017fff7fff","0x2a","0x4802800b7ffb8000","0x480680017fff8000","0x0","0x480680017fff8000","0x3fd94528f836b27f28ba8d7c354705dfc5827b048ca48870ac47c9d5b9aa181","0x4802800d7ffb8000","0x480680017fff8000","0x53746f7261676552656164","0x4002800e7ffb7fff","0x4002800f7ffb7ffb","0x400280107ffb7ffc","0x400280117ffb7ffd","0x480280137ffb8000","0x20680017fff7fff","0x14","0x40780017fff7fff","0x1","0x48127ff67fff8000","0x400080007ffe7fff","0x48127ffb7fff8000","0x400080017ffd7fff","0x480280147ffb8000","0x400080027ffc7fff","0x48127fed7fff8000","0x480280127ffb8000","0x482680017ffb8000","0x15","0x480680017fff8000","0x0","0x48127ff87fff8000","0x482480017ff78000","0x3","0x208b7fff7fff7ffe","0x480280127ffb8000","0x482680017ffb8000","0x16","0x480280147ffb8000","0x480280157ffb8000","0x10780017fff7fff","0x12","0x40780017fff7fff","0x6","0x4802800b7ffb8000","0x482680017ffb8000","0xf","0x4802800d7ffb8000","0x4802800e7ffb8000","0x10780017fff7fff","0x9","0x40780017fff7fff","0xc","0x480280047ffb8000","0x482680017ffb8000","0x8","0x480280067ffb8000","0x480280077ffb8000","0x48127fed7fff8000","0x48127ffb7fff8000","0x48127ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x48127ffa7fff8000","0x208b7fff7fff7ffe","0x40780017fff7fff","0x1","0x480680017fff8000","0x4f7574206f6620676173","0x400080007ffe7fff","0x482480017ff58000","0x1","0x48127ff37fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x40780017fff7fff","0x1","0x480680017fff8000","0x4f7574206f6620676173","0x400080007ffe7fff","0x482680017ff98000","0x1","0x480a7ffa7fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0xa0680017fff8000","0x7","0x482680017ffa8000","0x100000000000000000000000000000000","0x400280007ff97fff","0x10780017fff7fff","0x98","0x4825800180007ffa","0x0","0x400280007ff97fff","0x482680017ff98000","0x1","0x48297ffc80007ffd","0x20680017fff7fff","0x4","0x10780017fff7fff","0x10","0x40780017fff7fff","0x1","0x480680017fff8000","0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473","0x400080007ffe7fff","0x48127ffc7fff8000","0x48127ffa7fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x1104800180018000","0x10f","0x482480017fff8000","0x10e","0x480080007fff8000","0xa0680017fff8000","0x9","0x4824800180007ff8","0x6680","0x482480017fff8000","0x100000000000000000000000000000000","0x400080007ff77fff","0x10780017fff7fff","0x63","0x4824800180007ff8","0x6680","0x400080007ff87fff","0x480680017fff8000","0x0","0x480680017fff8000","0xa3e35b50432cd1669313bd75e434458dd8bc8d21437d2aa29d6c256f7b13d1","0x480680017fff8000","0x0","0x482480017ff58000","0x1","0x480680017fff8000","0x53746f726167655772697465","0x400280007ffb7fff","0x400280017ffb7ffa","0x400280027ffb7ffb","0x400280037ffb7ffc","0x400280047ffb7ffd","0x480280067ffb8000","0x20680017fff7fff","0x3f","0x480280057ffb8000","0x480680017fff8000","0x0","0x480680017fff8000","0x27f5e07830ee1ad079cf8c8462d2edc585bda982dbded162e761eb7fd71d84a","0x480680017fff8000","0x0","0x480680017fff8000","0x53746f726167655772697465","0x400280077ffb7fff","0x400280087ffb7ffb","0x400280097ffb7ffc","0x4002800a7ffb7ffd","0x4002800b7ffb7ffe","0x4802800d7ffb8000","0x20680017fff7fff","0x25","0x4802800c7ffb8000","0x480680017fff8000","0x0","0x480680017fff8000","0x3fd94528f836b27f28ba8d7c354705dfc5827b048ca48870ac47c9d5b9aa181","0x480680017fff8000","0x0","0x480680017fff8000","0x53746f726167655772697465","0x4002800e7ffb7fff","0x4002800f7ffb7ffb","0x400280107ffb7ffc","0x400280117ffb7ffd","0x400280127ffb7ffe","0x480280147ffb8000","0x20680017fff7fff","0xd","0x40780017fff7fff","0x1","0x48127ff07fff8000","0x480280137ffb8000","0x482680017ffb8000","0x15","0x480680017fff8000","0x0","0x48127ffb7fff8000","0x48127ffa7fff8000","0x208b7fff7fff7ffe","0x480280137ffb8000","0x482680017ffb8000","0x17","0x480280157ffb8000","0x480280167ffb8000","0x10780017fff7fff","0x12","0x40780017fff7fff","0x6","0x4802800c7ffb8000","0x482680017ffb8000","0x10","0x4802800e7ffb8000","0x4802800f7ffb8000","0x10780017fff7fff","0x9","0x40780017fff7fff","0xc","0x480280057ffb8000","0x482680017ffb8000","0x9","0x480280077ffb8000","0x480280087ffb8000","0x48127fed7fff8000","0x48127ffb7fff8000","0x48127ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x48127ffa7fff8000","0x208b7fff7fff7ffe","0x40780017fff7fff","0x1","0x480680017fff8000","0x4f7574206f6620676173","0x400080007ffe7fff","0x482480017ff58000","0x1","0x48127ff37fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x40780017fff7fff","0x1","0x480680017fff8000","0x4f7574206f6620676173","0x400080007ffe7fff","0x482680017ff98000","0x1","0x480a7ffa7fff8000","0x480a7ffb7fff8000","0x480680017fff8000","0x1","0x48127ffa7fff8000","0x482480017ff98000","0x1","0x208b7fff7fff7ffe","0x480680017fff8000","0x0","0x480680017fff8000","0xa3e35b50432cd1669313bd75e434458dd8bc8d21437d2aa29d6c256f7b13d1","0x480680017fff8000","0x53746f726167655772697465","0x400280007ffa7fff","0x400380017ffa7ff9","0x400280027ffa7ffd","0x400280037ffa7ffe","0x400380047ffa7ffc","0x480280067ffa8000","0x20680017fff7fff","0x6b","0x480280057ffa8000","0x480680017fff8000","0x0","0x480680017fff8000","0x27f5e07830ee1ad079cf8c8462d2edc585bda982dbded162e761eb7fd71d84a","0x480680017fff8000","0x53746f726167655772697465","0x400280077ffa7fff","0x400280087ffa7ffc","0x400280097ffa7ffd","0x4002800a7ffa7ffe","0x4003800b7ffa7ffb","0x4802800d7ffa8000","0x20680017fff7fff","0x51","0x4802800c7ffa8000","0x480680017fff8000","0x0","0x480680017fff8000","0x3fd94528f836b27f28ba8d7c354705dfc5827b048ca48870ac47c9d5b9aa181","0x480680017fff8000","0x53746f726167655772697465","0x4002800e7ffa7fff","0x4002800f7ffa7ffc","0x400280107ffa7ffd","0x400280117ffa7ffe","0x400380127ffa7ffd","0x480280147ffa8000","0x20680017fff7fff","0x37","0x40780017fff7fff","0x1","0x40780017fff7fff","0x1","0x480680017fff8000","0x0","0x480a7ffc7fff8000","0x480a7ffb7fff8000","0x480a7ffd7fff8000","0x480680017fff8000","0x281848a2ead29305005a1178671c6a7d7780cb656c57678566ea8033dbfa001","0x400080007ff97fff","0x400080007ffa7ffc","0x400080017ffa7ffd","0x400080027ffa7ffe","0x480280137ffa8000","0x48127ff87fff8000","0x482480017ff78000","0x1","0x48127ff77fff8000","0x482480017ff68000","0x3","0x480680017fff8000","0x456d69744576656e74","0x400280157ffa7fff","0x400280167ffa7ffa","0x400280177ffa7ffb","0x400280187ffa7ffc","0x400280197ffa7ffd","0x4002801a7ffa7ffe","0x4802801c7ffa8000","0x20680017fff7fff","0xd","0x480a7ff87fff8000","0x4802801b7ffa8000","0x482680017ffa8000","0x1d","0x480680017fff8000","0x0","0x480680017fff8000","0x0","0x480680017fff8000","0x0","0x208b7fff7fff7ffe","0x480a7ff87fff8000","0x4802801b7ffa8000","0x482680017ffa8000","0x1f","0x480680017fff8000","0x1","0x4802801d7ffa8000","0x4802801e7ffa8000","0x208b7fff7fff7ffe","0x40780017fff7fff","0xe","0x480a7ff87fff8000","0x480280137ffa8000","0x482680017ffa8000","0x17","0x480680017fff8000","0x1","0x480280157ffa8000","0x480280167ffa8000","0x208b7fff7fff7ffe","0x40780017fff7fff","0x13","0x480a7ff87fff8000","0x4802800c7ffa8000","0x482680017ffa8000","0x10","0x480680017fff8000","0x1","0x4802800e7ffa8000","0x4802800f7ffa8000","0x208b7fff7fff7ffe","0x40780017fff7fff","0x18","0x480a7ff87fff8000","0x480280057ffa8000","0x482680017ffa8000","0x9","0x480680017fff8000","0x1","0x480280077ffa8000","0x480280087ffa8000","0x208b7fff7fff7ffe"],"bytecode_segment_lengths":[212,172,172,130],"hints":[[0,[{"TestLessThanOrEqual":{"lhs":{"Immediate":"0x0"},"rhs":{"Deref":{"register":"FP","offset":-6}},"dst":{"register":"AP","offset":0}}}]],[80,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[99,[{"TestLessThanOrEqual":{"lhs":{"Immediate":"0xa370"},"rhs":{"Deref":{"register":"AP","offset":-22}},"dst":{"register":"AP","offset":0}}}]],[122,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[140,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[155,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[169,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[183,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[197,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[212,[{"TestLessThanOrEqual":{"lhs":{"Immediate":"0x0"},"rhs":{"Deref":{"register":"FP","offset":-6}},"dst":{"register":"AP","offset":0}}}]],[229,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[248,[{"TestLessThanOrEqual":{"lhs":{"Immediate":"0x65b8"},"rhs":{"Deref":{"register":"AP","offset":-7}},"dst":{"register":"AP","offset":0}}}]],[272,[{"SystemCall":{"system":{"Deref":{"register":"FP","offset":-5}}}}]],[287,[{"SystemCall":{"system":{"BinOp":{"op":"Add","a":{"register":"FP","offset":-5},"b":{"Immediate":"0x7"}}}}}]],[302,[{"SystemCall":{"system":{"BinOp":{"op":"Add","a":{"register":"FP","offset":-5},"b":{"Immediate":"0xe"}}}}}]],[305,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[354,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[369,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[384,[{"TestLessThanOrEqual":{"lhs":{"Immediate":"0x0"},"rhs":{"Deref":{"register":"FP","offset":-6}},"dst":{"register":"AP","offset":0}}}]],[401,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[420,[{"TestLessThanOrEqual":{"lhs":{"Immediate":"0x6680"},"rhs":{"Deref":{"register":"AP","offset":-7}},"dst":{"register":"AP","offset":0}}}]],[447,[{"SystemCall":{"system":{"Deref":{"register":"FP","offset":-5}}}}]],[464,[{"SystemCall":{"system":{"BinOp":{"op":"Add","a":{"register":"FP","offset":-5},"b":{"Immediate":"0x7"}}}}}]],[481,[{"SystemCall":{"system":{"BinOp":{"op":"Add","a":{"register":"FP","offset":-5},"b":{"Immediate":"0xe"}}}}}]],[484,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[526,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[541,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[567,[{"SystemCall":{"system":{"Deref":{"register":"FP","offset":-6}}}}]],[582,[{"SystemCall":{"system":{"BinOp":{"op":"Add","a":{"register":"FP","offset":-6},"b":{"Immediate":"0x7"}}}}}]],[597,[{"SystemCall":{"system":{"BinOp":{"op":"Add","a":{"register":"FP","offset":-6},"b":{"Immediate":"0xe"}}}}}]],[600,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[602,[{"AllocSegment":{"dst":{"register":"AP","offset":0}}}]],[630,[{"SystemCall":{"system":{"BinOp":{"op":"Add","a":{"register":"FP","offset":-6},"b":{"Immediate":"0x15"}}}}}]]],"entry_points_by_type":{"EXTERNAL":[{"selector":"0x196a5f000a6df3bde4c611e5561aa002ac6cc04b4149c1f02f473b2ef445c76","offset":0,"builtins":["range_check"]},{"selector":"0x3593f537ca0121e22c58378d40e0f5e2ba89b1c6d92a6990ab3066b68088f9c","offset":212,"builtins":["range_check"]}],"L1_HANDLER":[],"CONSTRUCTOR":[{"selector":"0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194","offset":384,"builtins":["range_check"]}]}} \ No newline at end of file diff --git a/crates/client/settlement_client/src/starknet/test_contracts/appchain_test.sierra.json b/crates/client/settlement_client/src/starknet/test_contracts/appchain_test.sierra.json new file mode 100644 index 000000000..299172666 --- /dev/null +++ b/crates/client/settlement_client/src/starknet/test_contracts/appchain_test.sierra.json @@ -0,0 +1 @@ +{"sierra_program":["0x1","0x6","0x0","0x2","0x8","0x0","0xcb","0x35","0x21","0x52616e6765436865636b","0x800000000000000100000000000000000000000000000000","0x436f6e7374","0x800000000000000000000000000000000000000000000002","0x1","0x2","0x281848a2ead29305005a1178671c6a7d7780cb656c57678566ea8033dbfa001","0x66656c74323532","0x800000000000000700000000000000000000000000000000","0x537472756374","0x800000000000000700000000000000000000000000000004","0x0","0x325aa8c5392af856b0b76eb1e9c925ca4854a32ad80c458af6e005fb4b6c83f","0x456e756d","0x800000000000000700000000000000000000000000000002","0x191f49c01d9820fa9a814bc69ef6cc6a88af08a0a74fd50c7687dab2294b39d","0x3","0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3","0x8","0x753332","0x53746f7261676541646472657373","0x53746f726167654261736541646472657373","0x145cc613954179acf89d43c94ed0e091828cbddcca83f5b408785785036d36d","0xa","0x4661696c656420746f20646573657269616c697a6520706172616d202331","0x4661696c656420746f20646573657269616c697a6520706172616d202332","0x4661696c656420746f20646573657269616c697a6520706172616d202333","0x4f7574206f6620676173","0x4172726179","0x800000000000000300000000000000000000000000000001","0x536e617073686f74","0x800000000000000700000000000000000000000000000001","0x10","0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62","0x11","0x12","0x800000000000000f00000000000000000000000000000001","0x36a29999818984cbedaf89ff3c5e77aa63ec49bdb2cf356962e80a4ce228308","0x800000000000000f00000000000000000000000000000003","0x14","0x15","0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672","0x800000000000000300000000000000000000000000000003","0x17","0x9e3a3a7f22220fe7534a6b09e607514c317ae36494e57214a99c6b1b05c29a","0x16","0x18","0x4275696c74696e436f737473","0x53797374656d","0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6","0x13","0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473","0x800000000000000700000000000000000000000000000003","0x11c6d8087e00642489f92d2821ad6ebd6532ad1a3b6d12833da6d6810391511","0x426f78","0x4761734275696c74696e","0x55","0x7265766f6b655f61705f747261636b696e67","0x77697468647261775f676173","0x6272616e63685f616c69676e","0x7374727563745f6465636f6e737472756374","0x656e61626c655f61705f747261636b696e67","0x73746f72655f74656d70","0x61727261795f736e617073686f745f706f705f66726f6e74","0x756e626f78","0x72656e616d65","0x656e756d5f696e6974","0x1e","0x6a756d70","0x7374727563745f636f6e737472756374","0x656e756d5f6d61746368","0x64697361626c655f61705f747261636b696e67","0x64726f70","0x1f","0x61727261795f6e6577","0x636f6e73745f61735f696d6d656469617465","0x1d","0x61727261795f617070656e64","0x1c","0x20","0x1b","0x6765745f6275696c74696e5f636f737473","0x1a","0x77697468647261775f6761735f616c6c","0x66756e6374696f6e5f63616c6c","0x19","0x736e617073686f745f74616b65","0xf","0xe","0xd","0xc","0x73746f726167655f626173655f616464726573735f636f6e7374","0xa3e35b50432cd1669313bd75e434458dd8bc8d21437d2aa29d6c256f7b13d1","0xb","0x73746f726167655f616464726573735f66726f6d5f62617365","0x7","0x9","0x73746f726167655f726561645f73797363616c6c","0x27f5e07830ee1ad079cf8c8462d2edc585bda982dbded162e761eb7fd71d84a","0x3fd94528f836b27f28ba8d7c354705dfc5827b048ca48870ac47c9d5b9aa181","0x6","0x5","0x73746f726167655f77726974655f73797363616c6c","0x647570","0x4","0x656d69745f6576656e745f73797363616c6c","0x243","0xffffffffffffffff","0xaf","0x9f","0x22","0x8e","0x2c","0x23","0x24","0x25","0x26","0x27","0x28","0x31","0x29","0x2a","0x2b","0x7c","0x2d","0x2e","0x47","0x2f","0x30","0x32","0x33","0x34","0x35","0x36","0x37","0x38","0x6b","0x39","0x3a","0x3b","0x3c","0x3d","0x3e","0x3f","0x40","0x64","0x41","0x42","0x43","0x44","0x45","0x46","0x48","0x49","0x4a","0x4b","0x4c","0x4d","0x4e","0x4f","0x50","0x51","0x52","0x53","0x54","0x56","0x57","0x58","0x59","0x5a","0x5b","0x5c","0x5d","0x5e","0x5f","0x60","0x61","0x62","0x63","0x65","0x66","0x142","0xd2","0x135","0x128","0x122","0x11b","0x12c","0x1ba","0x165","0x1ad","0x1a0","0x19b","0x196","0x1a4","0x236","0x229","0x21c","0x212","0xbd","0x150","0x1c8","0x13fd","0x60504031105100c0f0e0605060506050d0c0b0a0908070606050403020100","0x31805170c0f0a0916091509140c0613050403060506050605120c0b0a0c06","0x2105201f06051e1d1c06060504031b06060504031a06060504031906060504","0xc250a29052805120c270a120c250a260c250a2405120c0f0a2305220c0f0a","0x4032f053305320c2b0e023109302f052e052d0c2b0e21052c05120c2b0a2a","0xc3e2405053d0c3c0c3b0c3a3902380605203729050605360c350e34060605","0x454405053f2305053f0c06440506430605054206050541060505400c05053f","0x54b060505494a050549230505490c4844050547050644050643290505460c","0x5053f05064f0506432f0505462c0505460605054e0605053f4d05054c0605","0x5495605054711110555280505460c545305053f0c524f05053f5105053f50","0x505495805054c0c064f050643330505462405054621050549210505572e05","0x5495e0505575e0505465d06055c240505495b05054c5a05054c5905054c29","0x5c6306055c0c626105053f1305053f6005054c0c5f180505425e05053d5e05","0x5680c676605054c2105053f6505053d650505496505055765050546640605","0x5054c690505476905053f69050549690505570c0669050643110505460605","0x5495605053f0c06560506432e0505460c6a2405053f1105053d1105056805","0x60c6065066d6669066c06050c06050c0c6c050c0c0c6b0506560506432805","0x61305650c69056c056905660c0c6c050c690c13056c051105110c0c6c050c","0x610c5a056c055b05130c5b056c051805600c0c6c050c060c5e05591861066c","0xc060c0c33050c5b0c21056c0559055e0c58056c056105180c59056c055a05","0x524055e0c58056c055e05180c24056c052305590c23056c050c5a0c0c6c05","0x54d2e29066c065805650c0c6c050c060c28056e33056c062105580c21056c","0x53056c055605610c56056c052f05130c2f056c052e05600c0c6c050c060c2c","0xc5a0c0c6c050c060c0c6f050c5b0c4f056c0553055e0c51056c052905180c","0x5580c4f056c0544055e0c51056c052c05180c44056c054d05590c4d056c05","0x6c050c060c7205716f00066c065105650c0c6c050c060c5005704a056c064f","0x6c050005180c75056c057405610c74056c057305130c73056c056f05600c0c","0x590c79056c050c5a0c0c6c050c060c0c78050c5b0c77056c0575055e0c7605","0x7c7b056c067705580c77056c057a055e0c76056c057205180c7a056c057905","0x6c050c210c0c6c050c060c80057f7e7d066c067605650c0c6c050c060c7105","0x330c0c6c054a05330c0c6c057b05330c0c6c057e05240c0c6c057d05230c0c","0x81062c0c78056c0578052e0c78056c050c290c81056c050c280c0c6c053305","0x660c85056c058405530c84056c05828306560c83056c050c2f0c82056c0578","0x585056c0585054d0c06056c0506054f0c66056c056605510c69056c056905","0x6c0586054a0c86056c050c440c0c6c058005230c0c6c050c060c8506666969","0xc0c6c050c210c0c6c050c060c8b8a06898887066c0686666911500c8605","0x2e0c06056c0506054f0c88056c058805510c87056c058705660c8c056c050c","0x4a338c068887606f0c7b056c057b052e0c4a056c054a052e0c33056c053305","0x6c059105730c0c6c050c060c93059291056c069005720c908f8e8d696c057b","0x56c059605760c0c6c059505750c9695066c059405740c94056c050c280c0c","0x6c058e05510c8d056c058d05660c7f056c059805790c98056c059705770c97","0xc0c6c050c060c7f8f8e8d69057f056c057f054d0c8f056c058f054f0c8e05","0x8f056c058f054f0c8e056c058e05510c8d056c058d05660c99056c05930553","0x57b05330c0c6c050c210c0c6c050c060c998f8e8d690599056c0599054d0c","0xc9b056c050c7a0c9a056c050c280c0c6c053305330c0c6c054a05330c0c6c","0x56c059c9d06560c9d056c050c2f0c9c056c059b9a062c0c9b056c059b052e","0x6c0506054f0c8b056c058b05510c8a056c058a05660c9f056c059e05530c9e","0x57b0c0c6c050c210c0c6c050c060c9f068b8a69059f056c059f054d0c0605","0x56c050c280c0c6c053305330c0c6c054a05330c0c6c057605230c0c6c0571","0x56c050c2f0ca2056c05a1a0062c0ca1056c05a1052e0ca1056c050c710ca0","0x56605510c69056c056905660ca5056c05a405530ca4056c05a2a306560ca3","0xc6c050c060ca50666696905a5056c05a5054d0c06056c0506054f0c66056c","0x50c280c0c6c055105230c0c6c053305330c0c6c0550057b0c0c6c050c210c","0x50c2f0ca7056c05a639062c0ca6056c05a6052e0ca6056c050c7d0c39056c","0x5510c69056c056905660caa056c05a905530ca9056c05a7a806560ca8056c","0x50c060caa0666696905aa056c05aa054d0c06056c0506054f0c66056c0566","0x7e0cab056c050c280c0c6c055805230c0c6c0528057b0c0c6c050c210c0c6c","0x560cae056c050c2f0cad056c05acab062c0cac056c05ac052e0cac056c050c","0x66056c056605510c69056c056905660cb0056c05af05530caf056c05adae06","0x5800c0c6c050c060cb00666696905b0056c05b0054d0c06056c0506054f0c","0xb2b1062c0cb2056c05b2052e0cb2056c050c7a0cb1056c050c280c0c6c0511","0x5660cb5056c05b405530cb4056c05b39206560c92056c050c2f0cb3056c05","0x6905b5056c05b5054d0c06056c0506054f0c60056c056005510c65056c0565","0xc0c6c050c060c606506b66669066c06050c06050c0c6c050c0c0cb5066065","0x50c060c5e05b71861066c061305650c69056c056905660c13056c05110511","0xc5a056c050c290c5b056c050c280c0c6c051805240c0c6c056105230c0c6c","0x56c05595806560c58056c050c2f0c59056c055a5b062c0c5a056c055a052e","0x6c0506054f0c66056c056605510c69056c056905660c23056c052105530c21","0x440c0c6c055e05230c0c6c050c060c23066669690523056c0523054d0c0605","0xc060c2e2906b82833066c0624666911500c24056c0524054a0c24056c050c","0x5605830c5356066c052f05820c2f056c052c05780c2c056c050c810c0c6c05","0x50c870c4d056c054f05860c4f056c055105850c51056c055305840c0c6c05","0x6c053305660c4d056c054d058a0c44056c054405880c0c6c050c690c44056c","0x6c050c8c0c0c6c050c060c73726f11b900504a116c064d440628698b0c3305","0x57705840c0c6c057605830c7776066c057505820c75056c057405780c7405","0x54a05510c71056c050c870c7b056c057a05860c7a056c057905850c79056c","0x4a698b0c00056c0500052e0c7b056c057b058a0c71056c057105880c4a056c","0x8305780c83056c050c8d0c0c6c050c060c82788111ba807e7d116c067b7150","0x5850c87056c058605840c0c6c058505830c8685066c058405820c84056c05","0x5880c7d056c057d05510c8b056c050c870c8a056c058805860c88056c0587","0x116c068a8b7e7d698b0c80056c0580052e0c8a056c058a058a0c8b056c058b","0x118e0c93056c050c280c0c6c050c210c0c6c050c060c91908f11bb8e8d8c","0x9897116c059605910c0c6c059505900c9695066c0594058f0c94056c058e80","0x59805130c9a056c059993062c0c99056c0599052e0c99056c059705130c7f","0x52e0c9d056c057f05130c9c056c059b9a062c0c9b056c059b052e0c9b056c","0xc0c6c059f05750ca09f066c059e05740c9e056c059d9c062c0c9d056c059d","0x33056c053305660ca3056c05a205790ca2056c05a105770ca1056c05a00576","0xca38d8c336905a3056c05a3054d0c8d056c058d054f0c8c056c058c05510c","0x90054f0ca4056c058f05510c0c6c058005330c0c6c050005330c0c6c050c06","0xc6c050005330c0c6c050c060c0cbc050c5b0c39056c059105930ca5056c05","0xc0cbc050c5b0c39056c058205930ca5056c0578054f0ca4056c058105510c","0x210c39056c057305930ca5056c0572054f0ca4056c056f05510c0c6c050c06","0x5660ca8056c05a705530ca7056c0539a606560ca6056c050c2f0c0c6c050c","0x6905a8056c05a8054d0ca5056c05a5054f0ca4056c05a405510c33056c0533","0x56c05aa052e0caa056c050c7a0ca9056c050c280c0c6c050c060ca8a5a433","0x5ad05530cad056c05abac06560cac056c050c2f0cab056c05aaa9062c0caa","0xae054d0c06056c0506054f0c2e056c052e05510c29056c052905660cae056c","0xcaf056c050c280c0c6c051105800c0c6c050c060cae062e296905ae056c05","0xcb2056c050c2f0cb1056c05b0af062c0cb0056c05b0052e0cb0056c050c7a","0x56c056005510c65056c056505660c92056c05b305530cb3056c05b1b20656","0x50c0c6c050c0c0c92066065690592056c0592054d0c06056c0506054f0c60","0x56905660c13056c051105110c0c6c050c060c606506bd6669066c06050c06","0x5240c0c6c056105230c0c6c050c060c5e05be1861066c061305650c69056c","0x5a5b062c0c5a056c055a052e0c5a056c050c290c5b056c050c280c0c6c0518","0x5660c23056c052105530c21056c05595806560c58056c050c2f0c59056c05","0x690523056c0523054d0c06056c0506054f0c66056c056605510c69056c0569","0x56c0524054a0c24056c050c440c0c6c055e05230c0c6c050c060c23066669","0x860c2c056c050c810c0c6c050c060c2e2906bf2833066c0624666911500c24","0x55305880c0c6c050c690c53056c050c870c56056c050c940c2f056c052c05","0x2866950c33056c053305660c56056c0556052e0c2f056c052f058a0c53056c","0x5005860c50056c050c8c0c0c6c050c060c4a444d11c04f51066c06562f5306","0x57205880c51056c055105510c72056c050c870c6f056c050c940c00056c05","0x73066c066f00724f5166950c6f056c056f052e0c00056c0500058a0c72056c","0x50c940c7a056c057905860c79056c050c8d0c0c6c050c060c77767511c174","0x57a058a0c71056c057105880c73056c057305510c71056c050c870c7b056c","0x60c78818011c27e7d066c067b7a71747366950c7b056c057b052e0c7a056c","0x58305750c8483066c058205740c82056c050c280c0c6c050c210c0c6c050c","0x53305660c87056c058605790c86056c058505770c85056c058405760c0c6c","0x7d33690587056c0587054d0c7e056c057e054f0c7d056c057d05510c33056c","0x56c057805930c8a056c0581054f0c88056c058005510c0c6c050c060c877e","0x930c8a056c0576054f0c88056c057505510c0c6c050c060c0cc3050c5b0c8b","0x544054f0c88056c054d05510c0c6c050c060c0cc3050c5b0c8b056c057705","0x6c058b8c06560c8c056c050c2f0c0c6c050c210c8b056c054a05930c8a056c","0x58a054f0c88056c058805510c33056c053305660c8e056c058d05530c8d05","0xc8f056c050c280c0c6c050c060c8e8a883369058e056c058e054d0c8a056c","0xc93056c050c2f0c91056c05908f062c0c90056c0590052e0c90056c050c7a","0x56c052e05510c29056c052905660c95056c059405530c94056c0591930656","0x800c0c6c050c060c95062e29690595056c0595054d0c06056c0506054f0c2e","0x96062c0c97056c0597052e0c97056c050c7a0c96056c050c280c0c6c051105","0x660c9a056c059905530c99056c05987f06560c7f056c050c2f0c98056c0597","0x59a056c059a054d0c06056c0506054f0c60056c056005510c65056c056505","0x6605960c61056c050c870c13056c056005860c60056c050c810c9a06606569","0x6c06181361060566950c13056c0513058a0c61056c056105880c1866066c05","0x870c23056c052105860c21056c050c8c0c0c6c050c060c58595a11c45b5e06","0xc24056c052405880c5e056c055e05510c3369066c056905960c24056c050c","0xc6c050c060c2f2c2e11c52928066c063323245b5e66950c23056c0523058a","0x4f65066c056505960c51056c050c870c53056c055605860c56056c050c8d0c","0x5351292866950c53056c0553058a0c51056c055105880c28056c052805510c","0x72056c050c280c6f056c050c280c0c6c050c060c00504a11c6444d066c064f","0x7505990c7675066c0574057f0c74056c057305980c73056c0565696611970c","0x56c050c9c0c0c6c050c060c77056c0576059b0c76056c0576059a0c0c6c05","0x7b059e0c7b77066c0577059d0c7a056c05796f062c0c79056c0579052e0c79","0x62c0c80056c057105130c0c6c057e05330c0c6c057d05330c7e7d71116c05","0x6c058205330c848382116c0578059e0c7877066c0577059d0c81056c058072","0x6c0577059e0c86056c058581062c0c85056c058305130c0c6c058405330c0c","0x8b86062c0c8b056c058a05130c0c6c058805330c0c6c058705330c8a888711","0x750c908f066c058c05740c0c6c058d05750c8e8d066c057a05740c8c056c05","0x9f0c4d056c054d05510c93056c059005760c91056c058e05760c0c6c058f05","0x98979611c79594066c069391444d69a00c93056c0593059f0c91056c059105","0xc9a056c059905a20c99056c057f1106a10c7f056c050c5a0c0c6c050c060c","0x9a056c059a05a30c95056c0595054f0c94056c059405510c0c056c050c0566","0x989b06560c9b056c050c2f0c0c6c051105a40c0c6c050c060c9a95940c6905","0x54f0c96056c059605510c0c056c050c05660c9d056c059c05a50c9c056c05","0x6c051105a40c0c6c050c060c9d97960c69059d056c059d05a30c97056c0597","0x560c9e056c050c2f0c0c6c056905330c0c6c056605330c0c6c056505330c0c","0x4a056c054a05510c0c056c050c05660ca0056c059f05a50c9f056c05009e06","0x5a40c0c6c050c060ca0504a0c6905a0056c05a005a30c50056c0550054f0c","0x56c050c2f0c0c6c056905330c0c6c056605330c0c6c056505330c0c6c0511","0x52e05510c0c056c050c05660ca3056c05a205a50ca2056c052fa106560ca1","0xc6c050c060ca32c2e0c6905a3056c05a305a30c2c056c052c054f0c2e056c","0xc2f0c0c6c056905330c0c6c056605330c0c6c056505330c0c6c051105a40c","0x510c0c056c050c05660c39056c05a505a50ca5056c0558a406560ca4056c05","0xc696939595a0c690539056c053905a30c59056c0559054f0c5a056c055a05","0x500c69c81106050c4f51500c692451500c690c1106050c4f51500c69245150","0x66691106050c5651500c690606062851500c60c91106050c4f51500c692451","0xca65"],"sierra_program_debug_info":{"type_names":[[0,"RangeCheck"],[1,"Const"],[2,"felt252"],[3,"temp_cairo::StateUpdateContract::LogStateUpdate"],[4,"temp_cairo::StateUpdateContract::Event"],[5,"Const"],[6,"Tuple"],[7,"Const"],[8,"u32"],[9,"StorageAddress"],[10,"StorageBaseAddress"],[11,"core::starknet::storage::StoragePointer0Offset::"],[12,"Const"],[13,"Const"],[14,"Const"],[15,"Const"],[16,"Array"],[17,"Snapshot>"],[18,"core::array::Span::"],[19,"Tuple>"],[20,"temp_cairo::StateUpdateContract::ContractState"],[21,"Unit"],[22,"Tuple"],[23,"core::panics::Panic"],[24,"Tuple>"],[25,"core::panics::PanicResult::<(temp_cairo::StateUpdateContract::ContractState, ())>"],[26,"BuiltinCosts"],[27,"System"],[28,"core::panics::PanicResult::<(core::array::Span::,)>"],[29,"Const"],[30,"core::option::Option::"],[31,"Box"],[32,"GasBuiltin"]],"libfunc_names":[[0,"revoke_ap_tracking"],[1,"withdraw_gas"],[2,"branch_align"],[3,"struct_deconstruct>"],[4,"enable_ap_tracking"],[5,"store_temp"],[6,"array_snapshot_pop_front"],[7,"unbox"],[8,"rename"],[9,"enum_init, 0>"],[10,"store_temp>>"],[11,"store_temp>"],[12,"jump"],[13,"struct_construct"],[14,"enum_init, 1>"],[15,"enum_match>"],[16,"disable_ap_tracking"],[17,"drop>>"],[18,"drop>"],[19,"drop"],[20,"array_new"],[21,"const_as_immediate>"],[22,"store_temp"],[23,"array_append"],[24,"struct_construct"],[25,"struct_construct>>"],[26,"enum_init,)>, 1>"],[27,"store_temp"],[28,"store_temp"],[29,"store_temp,)>>"],[30,"get_builtin_costs"],[31,"store_temp"],[32,"withdraw_gas_all"],[33,"struct_construct"],[34,"function_call"],[35,"enum_match>"],[36,"drop>"],[37,"snapshot_take>"],[38,"drop>"],[39,"struct_construct>"],[40,"struct_construct>>"],[41,"enum_init,)>, 0>"],[42,"const_as_immediate>"],[43,"drop"],[44,"const_as_immediate>"],[45,"const_as_immediate>"],[46,"const_as_immediate>"],[47,"drop>"],[48,"storage_base_address_const<289565229787362368933081636443797405535488074065834425092593015835915391953>"],[49,"struct_construct>"],[50,"snapshot_take>"],[51,"drop>"],[52,"struct_deconstruct>"],[53,"rename"],[54,"storage_address_from_base"],[55,"const_as_immediate>"],[56,"store_temp"],[57,"store_temp"],[58,"storage_read_syscall"],[59,"storage_base_address_const<1129664241071644691371073118594794953592340198277473102285062464307545102410>"],[60,"storage_base_address_const<1804974537427402286278400303388660593172206410421526189703894999503593972097>"],[61,"struct_construct>"],[62,"snapshot_take>"],[63,"drop>"],[64,"struct_deconstruct>"],[65,"store_temp>"],[66,"const_as_immediate>"],[67,"storage_write_syscall"],[68,"dup"],[69,"struct_construct"],[70,"enum_init"],[71,"snapshot_take"],[72,"drop"],[73,"store_temp"],[74,"enum_match"],[75,"const_as_immediate>"],[76,"dup"],[77,"struct_deconstruct"],[78,"store_temp>"],[79,"emit_event_syscall"],[80,"struct_construct>"],[81,"enum_init, 0>"],[82,"store_temp>"],[83,"drop"],[84,"enum_init, 1>"]],"user_func_names":[[0,"temp_cairo::StateUpdateContract::__wrapper__update_state"],[1,"temp_cairo::StateUpdateContract::__wrapper__get_state"],[2,"temp_cairo::StateUpdateContract::__wrapper__constructor"],[3,"temp_cairo::StateUpdateContract::update_state"]]},"contract_class_version":"0.1.0","entry_points_by_type":{"EXTERNAL":[{"selector":"0x196a5f000a6df3bde4c611e5561aa002ac6cc04b4149c1f02f473b2ef445c76","function_idx":0},{"selector":"0x3593f537ca0121e22c58378d40e0f5e2ba89b1c6d92a6990ab3066b68088f9c","function_idx":1}],"L1_HANDLER":[],"CONSTRUCTOR":[{"selector":"0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194","function_idx":2}]},"abi":[{"type":"constructor","name":"constructor","inputs":[]},{"type":"function","name":"update_state","inputs":[{"name":"block_number","type":"core::felt252"},{"name":"state_root","type":"core::felt252"},{"name":"block_hash","type":"core::felt252"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_state","inputs":[],"outputs":[{"type":"(core::felt252, core::felt252, core::felt252)"}],"state_mutability":"view"},{"type":"event","name":"temp_cairo::StateUpdateContract::LogStateUpdate","kind":"struct","members":[{"name":"state_root","type":"core::felt252","kind":"data"},{"name":"block_number","type":"core::felt252","kind":"data"},{"name":"block_hash","type":"core::felt252","kind":"data"}]},{"type":"event","name":"temp_cairo::StateUpdateContract::Event","kind":"enum","variants":[{"name":"LogStateUpdate","type":"temp_cairo::StateUpdateContract::LogStateUpdate","kind":"nested"}]}]} \ No newline at end of file diff --git a/crates/client/settlement_client/src/starknet/utils.rs b/crates/client/settlement_client/src/starknet/utils.rs new file mode 100644 index 000000000..3c2c90a03 --- /dev/null +++ b/crates/client/settlement_client/src/starknet/utils.rs @@ -0,0 +1,210 @@ +use crate::state_update::StateUpdate; +use assert_matches::assert_matches; +use starknet_accounts::{Account, ConnectedAccount, ExecutionEncoding, SingleOwnerAccount}; +use starknet_core::types::contract::SierraClass; +use starknet_core::types::{BlockId, BlockTag, Call, TransactionReceipt, TransactionReceiptWithBlockInfo}; +use starknet_core::utils::get_selector_from_name; +use starknet_providers::jsonrpc::HttpTransport; +use starknet_providers::{JsonRpcClient, Provider, ProviderError}; +use starknet_signers::{LocalWallet, SigningKey}; +use starknet_types_core::felt::Felt; +use std::future::Future; +use std::net::TcpStream; +use std::path::PathBuf; +use std::process::{Child, Command}; +use std::str::FromStr; +use std::sync::Arc; +use std::thread; + +use std::time::Duration; +use url::Url; + +pub const DEPLOYER_ADDRESS: &str = "0x055be462e718c4166d656d11f89e341115b8bc82389c3762a10eade04fcb225d"; +pub const DEPLOYER_PRIVATE_KEY: &str = "0x077e56c6dc32d40a67f6f7e6625c8dc5e570abe49c0a24e9202e4ae906abcc07"; +pub const UDC_ADDRESS: &str = "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf"; +pub const MADARA_PORT: &str = "19944"; +pub const MADARA_BINARY_PATH: &str = "../../../test-artifacts/madara"; +pub const MADARA_CONFIG_PATH: &str = "../../../test-artifacts/devnet.yaml"; +pub const APPCHAIN_CONTRACT_SIERRA_PATH: &str = "src/starknet/test_contracts/appchain_test.sierra.json"; + +// starkli class-hash crates/client/settlement_client/src/starknet/test_contracts/appchain_test.casm.json +pub const APPCHAIN_CONTRACT_CASM_HASH: &str = "0x07f36e830605ddeb7c4c094639b628de297cbf61f45385b1fc3231029922b30b"; + +pub type StarknetAccount = SingleOwnerAccount, LocalWallet>; +pub type TransactionReceiptResult = Result; + +pub struct MadaraProcess { + pub process: Child, + #[allow(dead_code)] + pub binary_path: PathBuf, +} + +impl MadaraProcess { + pub fn new(binary_path: PathBuf) -> Result { + let process = Command::new(&binary_path) + .arg("--name") + .arg("madara") + .arg("--base-path") + .arg("../madara-db33") + .arg("--rpc-port") + .arg(MADARA_PORT) + .arg("--rpc-cors") + .arg("*") + .arg("--rpc-external") + .arg("--devnet") + .arg("--chain-config-path") + .arg(MADARA_CONFIG_PATH) + .arg("--feeder-gateway-enable") + .arg("--gateway-enable") + .arg("--gateway-external") + .arg("--gateway-port") + .arg("8080") + .arg("--no-l1-sync") + .spawn()?; + + wait_for_port(MADARA_PORT.parse().unwrap(), 2, 10); + + Ok(Self { process, binary_path }) + } +} + +impl Drop for MadaraProcess { + fn drop(&mut self) { + if let Err(e) = self.process.kill() { + eprintln!("Failed to kill Madara process: {}", e); + } else { + Command::new("rm").arg("-rf").arg("../madara-db33").status().expect("Failed to delete the madara db"); + println!("Madara process killed successfully"); + } + } +} + +pub async fn prepare_starknet_client_test() -> anyhow::Result<(StarknetAccount, Felt, MadaraProcess)> { + let madara = MadaraProcess::new(PathBuf::from(MADARA_BINARY_PATH))?; + let account = starknet_account()?; + let deployed_appchain_contract_address = deploy_contract(&account).await?; + Ok((account, deployed_appchain_contract_address, madara)) +} + +pub async fn send_state_update( + account: &StarknetAccount, + appchain_contract_address: Felt, + update: StateUpdate, +) -> anyhow::Result { + let call = account + .execute_v1(vec![Call { + to: appchain_contract_address, + selector: get_selector_from_name("update_state")?, + calldata: vec![Felt::from(update.block_number), update.global_root, update.block_hash], + }]) + .send() + .await?; + let receipt = get_transaction_receipt(account.provider(), call.transaction_hash).await?; + + let latest_block_number_recorded = account.provider().block_number().await?; + + match receipt.block.block_number() { + Some(block_number) => Ok(block_number), + None => Ok(latest_block_number_recorded + 1), + } +} + +pub fn starknet_account() -> anyhow::Result { + let provider = + JsonRpcClient::new(HttpTransport::new(Url::parse(format!("http://127.0.0.1:{}", MADARA_PORT).as_str())?)); + let signer = LocalWallet::from(SigningKey::from_secret_scalar(Felt::from_str(DEPLOYER_PRIVATE_KEY)?)); + let mut account = SingleOwnerAccount::new( + provider, + signer, + Felt::from_str(DEPLOYER_ADDRESS)?, + // MADARA_DEVNET + Felt::from_str("0x4D41444152415F4445564E4554")?, + ExecutionEncoding::New, + ); + account.set_block_id(BlockId::Tag(BlockTag::Pending)); + Ok(account) +} + +pub async fn deploy_contract(account: &StarknetAccount) -> anyhow::Result { + let contract_artifact: SierraClass = serde_json::from_reader(std::fs::File::open(APPCHAIN_CONTRACT_SIERRA_PATH)?)?; + let flattened_class = contract_artifact.flatten()?; + let result = + account.declare_v2(Arc::new(flattened_class), Felt::from_str(APPCHAIN_CONTRACT_CASM_HASH)?).send().await?; + tokio::time::sleep(Duration::from_secs(5)).await; + let deployment = account + .execute_v3(vec![Call { + to: Felt::from_str(UDC_ADDRESS)?, + selector: get_selector_from_name("deployContract")?, + calldata: vec![result.class_hash, Felt::ZERO, Felt::ZERO, Felt::ZERO], + }]) + .send() + .await?; + let deployed_contract_address = + get_deployed_contract_address(deployment.transaction_hash, account.provider()).await?; + tokio::time::sleep(Duration::from_secs(5)).await; + Ok(deployed_contract_address) +} + +pub async fn get_deployed_contract_address( + txn_hash: Felt, + provider: &JsonRpcClient, +) -> anyhow::Result { + let deploy_tx_receipt = get_transaction_receipt(provider, txn_hash).await?; + let contract_address = assert_matches!( + deploy_tx_receipt, + TransactionReceiptWithBlockInfo { receipt: TransactionReceipt::Invoke(receipt), .. } => { + receipt.events.iter().find(|e| e.keys[0] == get_selector_from_name("ContractDeployed").unwrap()).unwrap().data[0] + } + ); + Ok(contract_address) +} + +pub async fn get_transaction_receipt( + rpc: &JsonRpcClient, + transaction_hash: Felt, +) -> TransactionReceiptResult { + // there is a delay between the transaction being available at the client + // and the sealing of the block, hence sleeping for 500ms + assert_poll(|| async { rpc.get_transaction_receipt(transaction_hash).await.is_ok() }, 500, 20).await; + rpc.get_transaction_receipt(transaction_hash).await +} + +pub async fn assert_poll(f: F, polling_time_ms: u64, max_poll_count: u32) +where + F: Fn() -> Fut, + Fut: Future, +{ + for _poll_count in 0..max_poll_count { + if f().await { + return; + } + tokio::time::sleep(Duration::from_millis(polling_time_ms)).await; + } + panic!("Max poll count exceeded."); +} + +fn wait_for_port(port: u16, timeout_secs: u64, max_retries: u32) -> bool { + let mut attempts = 0; + println!("Waiting for port {} to be available...", port); + + while attempts < max_retries { + if check_port(port, timeout_secs) { + println!("Port {} is now available! (attempt {}/{})", port, attempts + 1, max_retries); + return true; + } + + attempts += 1; + if attempts < max_retries { + println!("Port {} not available, retrying... (attempt {}/{})", port, attempts, max_retries); + thread::sleep(Duration::from_secs(timeout_secs)); + } + } + + println!("Port {} not available after {} attempts", port, max_retries); + false +} + +fn check_port(port: u16, timeout_secs: u64) -> bool { + TcpStream::connect_timeout(&std::net::SocketAddr::from(([127, 0, 0, 1], port)), Duration::from_secs(timeout_secs)) + .is_ok() +} diff --git a/test-artifacts/devnet.yaml b/test-artifacts/devnet.yaml new file mode 100644 index 000000000..8cb18c3fe --- /dev/null +++ b/test-artifacts/devnet.yaml @@ -0,0 +1,34 @@ +chain_name: "Madara" +chain_id: "MADARA_DEVNET" +feeder_gateway_url: "http://localhost:8080/feeder_gateway/" +gateway_url: "http://localhost:8080/gateway/" +native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d" +parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" +latest_protocol_version: "0.13.2" +block_time: "5s" +pending_block_update_time: "1s" +execution_batch_size: 16 +bouncer_config: + block_max_capacity: + builtin_count: + add_mod: 18446744073709551615 + bitwise: 18446744073709551615 + ecdsa: 18446744073709551615 + ec_op: 18446744073709551615 + keccak: 18446744073709551615 + mul_mod: 18446744073709551615 + pedersen: 18446744073709551615 + poseidon: 18446744073709551615 + range_check: 18446744073709551615 + range_check96: 18446744073709551615 + gas: 5000000 + n_steps: 40000000 + message_segment_length: 18446744073709551615 + n_events: 18446744073709551615 + state_diff_size: 131072 +sequencer_address: "0x123" +eth_core_contract_address: "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512" +eth_gps_statement_verifier: "0xf294781D719D2F4169cE54469C28908E6FA752C1" +mempool_tx_limit: 10000 +mempool_declare_tx_limit: 20 +mempool_tx_max_age: null