diff --git a/Cargo.lock b/Cargo.lock index 0f1e242e..51e835c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,9 +68,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a205d0cbb7bfdf9f4fd4b0ec842bc4c5f926e8c14ec3072d3fd75dd363baf1e0" +checksum = "d802a6d579d924a2926d181bce43231aaab4699a7c206197e88fbc6b9dda846f" dependencies = [ "alloy-eips", "alloy-primitives", @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993c34090a3f281cb746fd1604520cf21f8407ffbeb006aaa34c0556bffa718e" +checksum = "24b1bcb3e4810bff7e2a62ac0d741c70a7b5560e57b76eb0f0d33e1070735c60" dependencies = [ "alloy-consensus", "alloy-eips", @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "alloy-contract" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aec7945dff98ba68489aa6da455bf66f6c0fee8157df06747fbae7cb03c368e2" +checksum = "8e56bc4dc06ab205dc4106348c44b92e0d979148f8db751994c11caabf5ebbef" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -158,14 +158,26 @@ dependencies = [ "serde", ] +[[package]] +name = "alloy-eip7702" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cabf647eb4650c91a9d38cb6f972bb320009e7e9d61765fb688a86f1563b33e8" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "derive_more", + "serde", +] + [[package]] name = "alloy-eips" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1d9907c29ce622946759bf4fd3418166bfeae76c1c544b8081c7be3acd9b4be" +checksum = "938bc1cf2ec42579e187834efc254e76dd3fa19f526b57872713e6b95f411305" dependencies = [ "alloy-eip2930", - "alloy-eip7702", + "alloy-eip7702 0.5.0", "alloy-primitives", "alloy-rlp", "alloy-serde", @@ -190,9 +202,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39a786ce6bc7539dc30cabac6b7875644247c9e7d780e71a9f254d42ebdc013c" +checksum = "a1a38b4b49667a84ecad7cdaf431b8bd3f14ca496e5a021df1c26d5c4595dca6" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -204,9 +216,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99051f82f77159d5bee06108f33cffee02849e2861fc500bf74213aa2ae8a26e" +checksum = "4fb5dc326960e88eec6b5e9add221a071f15cb8fa93b9e88ee9c76cd0e4e1009" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -229,9 +241,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2aff127863f8279921397be8af0ac3f05a8757d5c4c972b491c278518fa07c7" +checksum = "1535c89ae0648f2c15c0bf9b8b92670f6b3b8515b645425c8b46462563c0eae4" dependencies = [ "alloy-consensus", "alloy-eips", @@ -271,9 +283,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0280a4f68e0cefde9449ee989a248230efbe3f95255299d2a7a92009e154629d" +checksum = "a9a9d6ef38d75e4b0dce6737463099698f9b839d1c3f7c8883bfdfce8954374b" dependencies = [ "alloy-chains", "alloy-consensus", @@ -330,9 +342,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fc8b0f68619cfab3a2e15dca7b80ab266f78430bb4353dec546528e04b7449" +checksum = "f5ed1e9957edfc8d155e2610e2ff3e10b059b89a6103de9f01579f40d8926d47" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -353,9 +365,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "986f23fe42ac95832901a24b93c20f7ed2b9644394c02b86222801230da60041" +checksum = "206749723862bd27d5468270e30fc987c5b4376240aefee728d7e64282c9d146" dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", @@ -366,9 +378,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-any" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e3aa433d3657b42e98e257ee6fa201f5c853245648a33da8fbb7497a5008bf" +checksum = "5e6ff23d7bde6ddeea4c1ca98e7a5a728326d543bd7133735c04ea83ebde41d0" dependencies = [ "alloy-consensus-any", "alloy-rpc-types-eth", @@ -377,9 +389,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30814f8b9ac10219fb77fe42c277a0ffa1c369fbc3961f14d159f51fb221966e" +checksum = "ee96e9793d3ec528ead6e8580f24e9acc71f5c2bc35feefba24465044bb77d76" dependencies = [ "alloy-consensus", "alloy-eips", @@ -395,9 +407,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0643cc497a71941f526454fe4fecb47e9307d3a7b6c05f70718a0341643bcc79" +checksum = "319a0ca31863bd6fb9aafeaa16425d0a2f1228da44bc24fd2f997ba50afe7e18" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -407,17 +419,17 @@ dependencies = [ "alloy-rlp", "alloy-serde", "alloy-sol-types", - "derive_more", "itertools 0.13.0", "serde", "serde_json", + "thiserror 2.0.9", ] [[package]] name = "alloy-serde" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61b049d7ecc66a29f107970dae493d0908e366048f7484a1ca9b02c85f9b2b" +checksum = "81537867986734e5867a9131145bdc56301f5b37ef9c9fb4654d7f7691a4015d" dependencies = [ "alloy-primitives", "serde", @@ -426,9 +438,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93461b0e79c2ddd791fec5f369ab5c2686a33bbb03530144972edf5248f8a2c7" +checksum = "0fdcbfe7079c877b3cb6ec43017e94f66432480f1c1779f736c064e6a8d422cc" dependencies = [ "alloy-primitives", "async-trait", @@ -440,9 +452,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f08ec1bfa433f9e9f7c5af05af07e5cf86d27d93170de76b760e63b925f1c9c" +checksum = "3f5175bd063463e25f1ffc6daaa223db15baf4b18e3d83d0d31fb95756aab6cc" dependencies = [ "alloy-consensus", "alloy-network", @@ -529,9 +541,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf656f983e14812df65b5aee37e7b37535f68a848295e6ed736b2054a405cb7" +checksum = "6121c7a8791d7984bd3e1a487aae55c62358b0bd94330126db41d795d942e24e" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -549,9 +561,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec938d51a47b7953b1c0fd8ddeb89a29eb113cd4908dfc4e01c7893b252d669f" +checksum = "15487cd2d7f2bfd8546e851d80db470603c2a1de82f7c39403078356b20d9a21" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -564,9 +576,9 @@ dependencies = [ [[package]] name = "alloy-trie" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a5fd8fea044cc9a8c8a50bb6f28e31f0385d820f116c5b98f6f4e55d6e5590b" +checksum = "6917c79e837aa7b77b7a6dae9f89cbe15313ac161c4d3cfaf8909ef21f3d22d8" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -3189,9 +3201,9 @@ dependencies = [ [[package]] name = "nybbles" -version = "0.2.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f06be0417d97f81fe4e5c86d7d01b392655a9cac9c19a848aa033e18937b23" +checksum = "a3409fc85ac27b27d971ea7cd1aabafd2eefa6de7e481c8d4f707225c117e81a" dependencies = [ "const-hex", "serde", @@ -3913,7 +3925,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3702f132bb484f4f0d0ca4f6fbde3c82cfd745041abbedd6eda67730e1868ef0" dependencies = [ "alloy-eip2930", - "alloy-eip7702", + "alloy-eip7702 0.4.2", "alloy-primitives", "auto_impl", "bitflags 2.6.0", diff --git a/Cargo.toml b/Cargo.toml index 2b7558c0..a25db027 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,17 +12,17 @@ categories = ["cryptography"] repository = "https://github.com/Cardinal-Cryptography/zkOS-monorepo" [workspace.dependencies] -alloy-contract = { version = "0.8.1" } -alloy-eips = { version = "0.8.1" } -alloy-network = { version = "0.8.1" } -alloy-primitives = { version = "0.8.5" } -alloy-provider = { version = "0.8.1" } -alloy-rpc-types = { version = "0.8.1" } -alloy-rpc-types-eth = { version = "0.8.1" } -alloy-signer = { version = "0.8.1" } -alloy-signer-local = { version = "0.8.1" } -alloy-sol-types = { version = "0.8.5" } -alloy-transport = { version = "0.8.1" } +alloy-contract = { version = "0.9.1" } +alloy-eips = { version = "0.9.1" } +alloy-network = { version = "0.9.1" } +alloy-primitives = { version = "0.8.15" } +alloy-provider = { version = "0.9.1" } +alloy-rpc-types = { version = "0.9.1" } +alloy-rpc-types-eth = { version = "0.9.1" } +alloy-signer = { version = "0.9.1" } +alloy-signer-local = { version = "0.9.1" } +alloy-sol-types = { version = "0.8.15" } +alloy-transport = { version = "0.9.1" } anyhow = { version = "1.0.86", default-features = false } askama = { version = "0.12.0", default-features = false } async-channel = { version = "2.3.1" } diff --git a/crates/shielder-cli/src/recovery.rs b/crates/shielder-cli/src/recovery.rs index 1a486135..4c55de0e 100644 --- a/crates/shielder-cli/src/recovery.rs +++ b/crates/shielder-cli/src/recovery.rs @@ -1,4 +1,3 @@ -use alloy_eips::BlockNumberOrTag; use alloy_primitives::{BlockHash, BlockNumber, U256}; use alloy_provider::{ network::{primitives::BlockTransactionsKind, TransactionResponse}, @@ -80,23 +79,23 @@ async fn find_shielder_transaction( block_number: BlockNumber, account: &ShielderAccount, ) -> Result { + let block_number = block_number.into(); let block = provider - .get_block_by_number( - BlockNumberOrTag::Number(block_number), - BlockTransactionsKind::Full, - ) + .get_block_by_number(block_number, BlockTransactionsKind::Hashes) .await? .ok_or(anyhow!("Block not found"))?; - let txs = block - .transactions - .as_transactions() - .expect("We should get full transactions"); - for tx in txs { - let event = match try_get_shielder_event_for_tx(provider, tx, block.header.hash).await? { + for tx_hash in block.transactions.as_hashes().expect("We have hashes") { + let tx = match provider.get_transaction_by_hash(*tx_hash).await { + Ok(Some(tx)) => tx, + _ => continue, + }; + + let event = match try_get_shielder_event_for_tx(provider, &tx, block.header.hash).await? { Some(event) => event, _ => continue, }; + event.check_version().map_err(|_| anyhow!("Bad version"))?; let event_note = event.note(); let action = ShielderAction::from((tx.tx_hash(), event));