From 891db4eb60aa58add7f3ec6b6db76b18db88ca99 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 25 Dec 2024 18:23:04 +0100 Subject: [PATCH] docs & example & concurrent fetcher --- .gitignore | 30 +- .nvmrc | 1 - Cargo.lock | 163 +-- Cargo.toml | 9 +- README.md | 22 +- crates/fetcher/Cargo.toml | 1 + crates/fetcher/src/main.rs | 54 +- crates/fetcher/src/proof_keys.rs | 38 +- examples/hdp_input.json | 2272 ++++++++++++++++++++++++++++++ tools/js/merkle.js | 24 - tools/js/package.json | 15 - 11 files changed, 2428 insertions(+), 201 deletions(-) delete mode 100644 .nvmrc create mode 100644 examples/hdp_input.json delete mode 100644 tools/js/merkle.js delete mode 100644 tools/js/package.json diff --git a/.gitignore b/.gitignore index ab714bcf..0b9f7a1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Virtual Environment venv/ -.profiling/ # Python Artifacts __pycache__/ @@ -11,10 +10,6 @@ __pycache__/ build/ dist/ -# Data Files -/src/single_chunk_processor/data/*.json -/src/single_chunk_processor/data/*.zip - # Environment Files *.env @@ -30,35 +25,16 @@ out/ .gas-snapshot .encryptedKey broadcast/ - -# Node.js -node_modules/ -package-lock.json - -# System Files -.DS_Store -src/.DS_Store - -# Solidity Verifier -solidity-verifier/lib/* - -# Cairo VM -cairo-vm - -# HDP -hdp-test/ -hdp/ - *.memory *.trace # Whitelist - these files should not be ignored -!tests/cairo_programs/fixtures/*.json -!tools/js/package.json !*_contract.json !packages/cairo-lang-0.13.1.zip # Scarb & snfoundry target .snfoundry_cache/ -.cargo \ No newline at end of file +.cargo + +!examples/*.json \ No newline at end of file diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 8d2a4516..00000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -18.16.1 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 9603ea21..8bfa2fd0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.48" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0161082e0edd9013d23083465cc04b20e44b7a15646d36ba7b0cdb7cd6fe18f" +checksum = "d4e0f0136c085132939da6b753452ebed4efaa73fe523bb855b10c199c2ebfaf" dependencies = [ "alloy-primitives", "num_enum", @@ -131,7 +131,7 @@ dependencies = [ "alloy-transport", "futures", "futures-util", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -240,7 +240,7 @@ dependencies = [ "alloy-sol-types", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.9", "tracing", ] @@ -266,7 +266,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -343,7 +343,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", "url", @@ -388,7 +388,7 @@ checksum = "5a833d97bf8a5f0f878daf2c8451fff7de7f9de38baa5a45d936ec718d81255a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -499,7 +499,7 @@ dependencies = [ "auto_impl", "elliptic-curve", "k256", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -515,7 +515,7 @@ dependencies = [ "async-trait", "k256", "rand", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -529,7 +529,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -546,7 +546,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "syn-solidity", "tiny-keccak", ] @@ -564,7 +564,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.90", + "syn 2.0.91", "syn-solidity", ] @@ -603,7 +603,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tower", "tracing", @@ -665,9 +665,9 @@ dependencies = [ [[package]] name = "alloy-trie" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a5fd8fea044cc9a8c8a50bb6f28e31f0385d820f116c5b98f6f4e55d6e5590b" +checksum = "1e428104b2445a4f929030891b3dbf8c94433a8349ba6480946bf6af7975c2f6" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -745,9 +745,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "ark-ff" @@ -916,7 +916,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -927,7 +927,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -955,7 +955,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1332,7 +1332,7 @@ checksum = "b3c4a161868276ce022c44ac500afbfa0d7d8371106feb40dfca34ea7be97503" dependencies = [ "cairo-lang-debug", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1600,11 +1600,11 @@ dependencies = [ [[package]] name = "cairo-type-derive" version = "0.1.0" -source = "git+https://github.com/keep-starknet-strange/snos.git#35a300a10d2107482ada440b5025ee2f651afbd4" +source = "git+https://github.com/keep-starknet-strange/snos.git?rev=35a300a10d2107482ada440b5025ee2f651afbd4#35a300a10d2107482ada440b5025ee2f651afbd4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1646,9 +1646,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.4" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" dependencies = [ "shlex", ] @@ -1703,7 +1703,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1890,7 +1890,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1901,7 +1901,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1972,7 +1972,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "unicode-xid", ] @@ -2041,7 +2041,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2219,6 +2219,7 @@ dependencies = [ "alloy", "clap", "dry_hint_processor", + "futures", "indexer", "serde_json", "thiserror 1.0.69", @@ -2272,9 +2273,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" [[package]] name = "foreign-types" @@ -2362,7 +2363,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2420,7 +2421,7 @@ checksum = "43eaff6bbc0b3a878361aced5ec6a2818ee7c541c5b33b5880dfa9a86c23e9e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2680,9 +2681,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http", @@ -2868,7 +2869,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2937,7 +2938,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3161,9 +3162,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.168" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libm" @@ -3236,9 +3237,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "microlp" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e0c5664f9959f1c3970d523a22f0319024282cb754358c2afc7e1d45280ae3" +checksum = "a4d5845c04529928925fd1abd6776813710ad57ef41cb31958b1d35622a7d8e9" dependencies = [ "log", "sprs", @@ -3434,14 +3435,14 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] name = "nybbles" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f06be0417d97f81fe4e5c86d7d01b392655a9cac9c19a848aa033e18937b23" +checksum = "55a62e678a89501192cc5ebf47dcbc656b608ae5e1c61c9251fe35230f119fe3" dependencies = [ "alloy-rlp", "const-hex", @@ -3452,9 +3453,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -3494,7 +3495,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3595,7 +3596,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.8", + "thiserror 2.0.9", "ucd-trie", ] @@ -3651,7 +3652,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3767,7 +3768,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4083,7 +4084,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4255,7 +4256,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4362,7 +4363,7 @@ checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4373,14 +4374,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", @@ -4462,7 +4463,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4474,7 +4475,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4715,7 +4716,7 @@ checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ "starknet-curve 0.4.2", "starknet-ff", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4807,7 +4808,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4829,9 +4830,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" dependencies = [ "proc-macro2", "quote", @@ -4847,7 +4848,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4867,7 +4868,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4941,11 +4942,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.8" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.8", + "thiserror-impl 2.0.9", ] [[package]] @@ -4956,18 +4957,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] name = "thiserror-impl" -version = "2.0.8" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5075,7 +5076,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5218,7 +5219,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5454,7 +5455,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "wasm-bindgen-shared", ] @@ -5488,7 +5489,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5780,7 +5781,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "synstructure", ] @@ -5802,7 +5803,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5822,7 +5823,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "synstructure", ] @@ -5843,7 +5844,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5865,7 +5866,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 67e56992..a6fc87d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,9 +19,10 @@ alloy-rlp = { version = "0.3.5", features = ["derive"] } bincode = { version = "2.0.0-rc.3", default-features = false, features = ["serde"] } cairo-lang-casm = { version = "2.9.0-dev.0", default-features = false } cairo-lang-starknet-classes = { version = "2.9.0-dev.0" } -cairo-type-derive = { git = "https://github.com/keep-starknet-strange/snos.git" } +cairo-type-derive = { git = "https://github.com/keep-starknet-strange/snos.git", rev = "35a300a10d2107482ada440b5025ee2f651afbd4" } cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "388a4e51001377717b7e4c902c35f8e271c92ad7", features = ["extensive_hints", "clap", "cairo-1-hints"] } clap = { version = "4.3.10", features = ["derive"] } +futures = "0.3.31" hex = "0.4.3" num-bigint = "0.4.6" num-traits = "0.2.19" @@ -40,9 +41,9 @@ tiny-keccak = { version = "2.0.2", features = ["keccak"] } tokio = { version = "1.41.1", features = ["full"] } dry_hint_processor = { path = "crates/dry_hint_processor" } -sound_hint_processor = { path = "crates/sound_hint_processor" } +eth_essentials_cairo_vm_hints = { path = "packages/eth_essentials/cairo_vm_hints"} hints = { path = "crates/hints" } indexer = { path = "crates/indexer" } +sound_hint_processor = { path = "crates/sound_hint_processor" } syscall_handler = { path = "crates/syscall_handler" } -types = { path = "crates/types" } -eth_essentials_cairo_vm_hints = { path = "packages/eth_essentials/cairo_vm_hints"} \ No newline at end of file +types = { path = "crates/types" } \ No newline at end of file diff --git a/README.md b/README.md index c7e0816a..1231fc8a 100644 --- a/README.md +++ b/README.md @@ -18,24 +18,30 @@ source venv/bin/activate ## Running -Before running the program, prepare the input data. The inputs are provided via the `hdp_input.json` file located in the root directory of the HDP project. These inputs can be generated using the [HDP CLI](https://github.com/HerodotusDev/hdp). Example inputs are available in `tests/hdp/fixtures`. +Before running the program, prepare the input data. The inputs are provided via the `hdp_input.json` file located in the root directory of the HDP project. -To run the program, use: +To run the program, execute following steps: +Simulate Cairo1 module and collect info about proofs to fetch ```bash -cargo run --bin dry_run -- build/compiled_cairo_files/contract_dry_run.json --program_input rust_input.json --program_output a.json --layout all_cairo +cargo run --release --bin dry_run -- --program_input examples/hdp_input.json --program_output hdp_keys.json --layout starknet_with_keccak +``` + +Fetch the on-chain proofs needed for the HDP run: +```bash +cargo run --release --bin fetcher -- hdp_keys.json --program_output hdp_proofs.json +``` -cargo run --bin fetcher -- a.json --program_output b.json +Run Cairo1 module with verified onchain data +```bash +cargo run --release --bin sound_run -- --program_input examples/hdp_input.json --program_proofs hdp_proofs.json --program_output hdp_output.json --layout starknet_with_keccak ``` The program will output the results root and tasks root. These roots can be used to extract the results from the on-chain contract. ## How It Works -HDP Cairo is the repository containing the logic for verifying on-chain state via storage proofs, and then making that state available to custom Cairo1 contract modules. To enable this functionality, a custom syscall was designed, enabling dynamic access to the verified state. The syscalls are defined in `cairo1_syscall_binding` where we have some examples. - -### Architecture -The overall program is split into two main parts: +HDP Cairo is the repository containing the logic for verifying on-chain state via storage proofs, and then making that state available to custom Cairo1 contract modules. To enable this functionality, a custom syscall was designed, enabling dynamic access to the verified state. The syscalls are defined in `cairo1` where we have some examples. ### Architecture The overall program is split into two main parts: diff --git a/crates/fetcher/Cargo.toml b/crates/fetcher/Cargo.toml index fd166648..a3bca172 100644 --- a/crates/fetcher/Cargo.toml +++ b/crates/fetcher/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" alloy.workspace = true clap.workspace = true dry_hint_processor.workspace = true +futures.workspace = true serde_json.workspace = true thiserror.workspace = true tokio.workspace = true diff --git a/crates/fetcher/src/main.rs b/crates/fetcher/src/main.rs index dfc2f529..75741f8c 100644 --- a/crates/fetcher/src/main.rs +++ b/crates/fetcher/src/main.rs @@ -6,6 +6,7 @@ use alloy::hex::FromHexError; use clap::{Parser, ValueHint}; use dry_hint_processor::syscall_handler::evm::{self, SyscallHandler}; +use futures::{FutureExt, StreamExt}; use indexer::types::IndexerError; use proof_keys::ProofKeys; use std::{collections::HashSet, fs, num::ParseIntError, path::PathBuf}; @@ -14,6 +15,8 @@ use types::proofs::{account::Account, storage::Storage, HeaderMmrMeta, Proofs}; pub mod proof_keys; +const BUFFER_UNORDERED: usize = 10; + #[derive(Parser, Debug)] #[clap(author, version, about, long_about = None)] struct Args { @@ -23,7 +26,8 @@ struct Args { program_output: PathBuf, } -fn main() -> Result<(), FetcherError> { +#[tokio::main] +async fn main() -> Result<(), FetcherError> { let args = Args::try_parse_from(std::env::args()).map_err(FetcherError::Args)?; let input_file = fs::read(args.filename)?; @@ -44,20 +48,28 @@ fn main() -> Result<(), FetcherError> { } } - let mut headers_with_mmr = proof_keys - .header_keys - .iter() - .map(ProofKeys::fetch_header_proof) - .collect::, FetcherError>>()?; + let mut headers_with_mmr: HashSet = HashSet::default(); + + while let Some(Ok(item)) = futures::stream::iter(proof_keys.header_keys.iter().map(ProofKeys::fetch_header_proof).map(|f| f.boxed_local())) + .buffer_unordered(BUFFER_UNORDERED) + .next() + .await + { + headers_with_mmr.insert(item); + } let mut accounts: HashSet = HashSet::default(); - for (header_with_mmr, account) in proof_keys - .account_keys - .iter() - .map(ProofKeys::fetch_account_proof) - .collect::, FetcherError>>()? - .into_iter() + while let Some(Ok((header_with_mmr, account))) = futures::stream::iter( + proof_keys + .account_keys + .iter() + .map(ProofKeys::fetch_account_proof) + .map(|f| f.boxed_local()), + ) + .buffer_unordered(BUFFER_UNORDERED) + .next() + .await { headers_with_mmr.insert(header_with_mmr); accounts.insert(account); @@ -65,14 +77,18 @@ fn main() -> Result<(), FetcherError> { let mut storages: HashSet = HashSet::default(); - for (header_with_mmr, account, storage) in proof_keys - .storage_keys - .iter() - .map(ProofKeys::fetch_storage_proof) - .collect::, FetcherError>>()? - .into_iter() + while let Some(Ok((header_with_mmr, account, storage))) = futures::stream::iter( + proof_keys + .storage_keys + .iter() + .map(ProofKeys::fetch_storage_proof) + .map(|f| f.boxed_local()), + ) + .buffer_unordered(BUFFER_UNORDERED) + .next() + .await { - headers_with_mmr.insert(header_with_mmr); + headers_with_mmr.insert(header_with_mmr.clone()); accounts.insert(account); storages.insert(storage); } diff --git a/crates/fetcher/src/proof_keys.rs b/crates/fetcher/src/proof_keys.rs index b5882d5c..895f2910 100644 --- a/crates/fetcher/src/proof_keys.rs +++ b/crates/fetcher/src/proof_keys.rs @@ -37,16 +37,13 @@ impl ProofKeys { format!("{:0>width$}", hex_str, width = (hex_str.len() + 1) / 2 * 2) } - pub fn fetch_header_proof(key: &keys::header::Key) -> Result { + pub async fn fetch_header_proof(key: &keys::header::Key) -> Result { let provider = Indexer::default(); - let runtime = tokio::runtime::Runtime::new().unwrap(); // Fetch proof response - let response = runtime.block_on(async { - provider - .get_headers_proof(IndexerQuery::new(key.chain_id, key.block_number, key.block_number)) - .await - })?; + let response = provider + .get_headers_proof(IndexerQuery::new(key.chain_id, key.block_number, key.block_number)) + .await?; // Extract MMR metadata let mmr_meta = MmrMeta { @@ -99,31 +96,28 @@ impl ProofKeys { }) } - pub fn fetch_account_proof(key: &keys::account::Key) -> Result<(HeaderMmrMeta, Account), FetcherError> { - let runtime = tokio::runtime::Runtime::new().unwrap(); + pub async fn fetch_account_proof(key: &keys::account::Key) -> Result<(HeaderMmrMeta, Account), FetcherError> { let provider = RootProvider::>::new_http(Url::parse(&env::var(RPC).unwrap()).unwrap()); - let value = runtime - .block_on(async { provider.get_proof(key.address, vec![]).block_id(key.block_number.into()).await }) + let value = provider + .get_proof(key.address, vec![]) + .block_id(key.block_number.into()) + .await .map_err(|e| FetcherError::InternalError(e.to_string()))?; Ok(( - Self::fetch_header_proof(&key.to_owned().into())?, + Self::fetch_header_proof(&key.to_owned().into()).await?, Account::new(value.address, vec![MPTProof::new(key.block_number, value.account_proof)]), )) } - pub fn fetch_storage_proof(key: &keys::storage::Key) -> Result<(HeaderMmrMeta, Account, Storage), FetcherError> { - let runtime = tokio::runtime::Runtime::new().unwrap(); + pub async fn fetch_storage_proof(key: &keys::storage::Key) -> Result<(HeaderMmrMeta, Account, Storage), FetcherError> { let provider = RootProvider::>::new_http(Url::parse(&env::var(RPC).unwrap()).unwrap()); - let value = runtime - .block_on(async { - provider - .get_proof(key.address, vec![key.storage_slot]) - .block_id(key.block_number.into()) - .await - }) + let value = provider + .get_proof(key.address, vec![key.storage_slot]) + .block_id(key.block_number.into()) + .await .map_err(|e| FetcherError::InternalError(e.to_string()))?; Ok(( - Self::fetch_header_proof(&key.to_owned().into())?, + Self::fetch_header_proof(&key.to_owned().into()).await?, Account::new(value.address, vec![MPTProof::new(key.block_number, value.account_proof)]), Storage::new( value.address, diff --git a/examples/hdp_input.json b/examples/hdp_input.json new file mode 100644 index 00000000..0d2d8f0b --- /dev/null +++ b/examples/hdp_input.json @@ -0,0 +1,2272 @@ +{ + "params": [ + { + "visibility": "public", + "value": "0x5222A4" + }, + { + "visibility": "public", + "value": "0x5249B4" + }, + { + "visibility": "public", + "value": "0x75cec1db9dceb703200eaa6595f66885c962b920" + }, + { + "visibility": "public", + "value": "0x1" + }, + { + "visibility": "public", + "value": "0x0" + } + ], + "compiled_class": { + "prime": "0x800000000000011000000000000000000000000000000000000000000000001", + "compiler_version": "2.8.4", + "bytecode": [ + "0xa0680017fff8000", + "0x7", + "0x482680017ffa8000", + "0xffffffffffffffffffffffffffffe5d4", + "0x400280007ff97fff", + "0x10780017fff7fff", + "0x1b9", + "0x4825800180007ffa", + "0x1a2c", + "0x400280007ff97fff", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x1c1", + "0x482680017ff98000", + "0x1", + "0x20680017fff7ffa", + "0x1a0", + "0x48307ff880007ff9", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482480017ff78000", + "0x1", + "0x48127ff77fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ff47fff8000", + "0x10780017fff7fff", + "0x8", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0x17a", + "0x480080007fff8000", + "0xa0680017fff8000", + "0x12", + "0x4824800180007ffe", + "0x100000000", + "0x4844800180008002", + "0x8000000000000110000000000000000", + "0x4830800080017ffe", + "0x480080007ff57fff", + "0x482480017ffe8000", + "0xefffffffffffffde00000000ffffffff", + "0x480080017ff37fff", + "0x400080027ff27ffb", + "0x402480017fff7ffb", + "0xffffffffffffffffffffffffffffffff", + "0x20680017fff7fff", + "0x165", + "0x402780017fff7fff", + "0x1", + "0x400080007ff87ffe", + "0x482480017ffe8000", + "0xffffffffffffffffffffffff00000000", + "0x400080017ff77fff", + "0x482480017ff78000", + "0x2", + "0x48307ff880007ff9", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482480017ff78000", + "0x1", + "0x48127ff77fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ff47fff8000", + "0x10780017fff7fff", + "0x8", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0x137", + "0x480080007fff8000", + "0xa0680017fff8000", + "0x12", + "0x4824800180007ffe", + "0x100000000", + "0x4844800180008002", + "0x8000000000000110000000000000000", + "0x4830800080017ffe", + "0x480080007ff57fff", + "0x482480017ffe8000", + "0xefffffffffffffde00000000ffffffff", + "0x480080017ff37fff", + "0x400080027ff27ffb", + "0x402480017fff7ffb", + "0xffffffffffffffffffffffffffffffff", + "0x20680017fff7fff", + "0x122", + "0x402780017fff7fff", + "0x1", + "0x400080007ff87ffe", + "0x482480017ffe8000", + "0xffffffffffffffffffffffff00000000", + "0x400080017ff77fff", + "0x482480017ff78000", + "0x2", + "0x48307ff880007ff9", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482480017ff78000", + "0x1", + "0x48127ff77fff8000", + "0x480680017fff8000", + "0x0", + "0x480080007ff48000", + "0x10780017fff7fff", + "0x8", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0xf7", + "0x48307ffc80007ffd", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482480017ffb8000", + "0x1", + "0x48127ffb7fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ff87fff8000", + "0x10780017fff7fff", + "0x8", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0x6c", + "0x480080007fff8000", + "0xa0680017fff8000", + "0x16", + "0x480080007ff38003", + "0x480080017ff28003", + "0x4844800180017ffe", + "0x100000000000000000000000000000000", + "0x483080017ffd7ffb", + "0x482480017fff7ffd", + "0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001", + "0x20680017fff7ffc", + "0x6", + "0x402480017fff7ffd", + "0xffffffffffffffffffffffffffffffff", + "0x10780017fff7fff", + "0x4", + "0x402480017ffe7ffd", + "0xf7ffffffffffffef0000000000000000", + "0x400080027fee7ffd", + "0x20680017fff7ffe", + "0x51", + "0x402780017fff7fff", + "0x1", + "0x400080007ff37ffe", + "0x482480017ff38000", + "0x1", + "0x48307ff980007ffa", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482480017ff88000", + "0x1", + "0x48127ff87fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ff57fff8000", + "0x10780017fff7fff", + "0x8", + "0x48127ff87fff8000", + "0x48127ff87fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0x2a", + "0x480080007fff8000", + "0xa0680017fff8000", + "0x16", + "0x480080007ff88003", + "0x480080017ff78003", + "0x4844800180017ffe", + "0x100000000000000000000000000000000", + "0x483080017ffd7ffb", + "0x482480017fff7ffd", + "0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001", + "0x20680017fff7ffc", + "0x6", + "0x402480017fff7ffd", + "0xffffffffffffffffffffffffffffffff", + "0x10780017fff7fff", + "0x4", + "0x402480017ffe7ffd", + "0xf7ffffffffffffef0000000000000000", + "0x400080027ff37ffd", + "0x20680017fff7ffe", + "0x11", + "0x402780017fff7fff", + "0x1", + "0x400080007ff87ffe", + "0x40780017fff7fff", + "0x5", + "0x482480017ff38000", + "0x1", + "0x48127ff47fff8000", + "0x48127ff47fff8000", + "0x480680017fff8000", + "0x0", + "0x48127fed7fff8000", + "0x48127ff47fff8000", + "0x10780017fff7fff", + "0x24", + "0x482480017ff38000", + "0x3", + "0x10780017fff7fff", + "0x5", + "0x40780017fff7fff", + "0x7", + "0x48127ff37fff8000", + "0x48127ff47fff8000", + "0x48127ff47fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x10780017fff7fff", + "0x13", + "0x40780017fff7fff", + "0x8", + "0x482480017fe68000", + "0x3", + "0x10780017fff7fff", + "0x5", + "0x40780017fff7fff", + "0xf", + "0x48127fe67fff8000", + "0x48127fec7fff8000", + "0x48127fec7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffd", + "0x5d", + "0x48307ffb80007ffc", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0x10", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473", + "0x400080007ffe7fff", + "0x48127ff77fff8000", + "0x48127fa07fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x31b", + "0x482480017fff8000", + "0x31a", + "0x480080007fff8000", + "0xa0680017fff8000", + "0x9", + "0x4824800180007f9e", + "0xad2", + "0x482480017fff8000", + "0x100000000000000000000000000000000", + "0x400080007ff27fff", + "0x10780017fff7fff", + "0x2d", + "0x4824800180007f9e", + "0xad2", + "0x400080007ff37fff", + "0x482480017ff38000", + "0x1", + "0x48127ffe7fff8000", + "0x480a7ffb7fff8000", + "0x48127fca7fff8000", + "0x48127fd27fff8000", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x48127fd77fff8000", + "0x48127fef7fff8000", + "0x48127fef7fff8000", + "0x48127fb97fff8000", + "0x48127fb97fff8000", + "0x1104800180018000", + "0x140", + "0x20680017fff7ffc", + "0xf", + "0x40780017fff7fff", + "0x1", + "0x400080007fff7ffc", + "0x400080017fff7ffd", + "0x48127ff87fff8000", + "0x48127ff87fff8000", + "0x48127ff87fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ffb7fff8000", + "0x482480017ffa8000", + "0x2", + "0x208b7fff7fff7ffe", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x48127ffa7fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4f7574206f6620676173", + "0x400080007ffe7fff", + "0x482480017ff08000", + "0x1", + "0x48127f997fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4661696c656420746f20646573657269616c697a6520706172616d202335", + "0x400080007ffe7fff", + "0x48127ff87fff8000", + "0x48127fa17fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4661696c656420746f20646573657269616c697a6520706172616d202334", + "0x400080007ffe7fff", + "0x48127ff87fff8000", + "0x48127fbb7fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x482480017ff28000", + "0x3", + "0x10780017fff7fff", + "0x5", + "0x40780017fff7fff", + "0x8", + "0x48127ff27fff8000", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4661696c656420746f20646573657269616c697a6520706172616d202333", + "0x400080007ffe7fff", + "0x48127ffd7fff8000", + "0x48127fbb7fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x482480017ff28000", + "0x3", + "0x10780017fff7fff", + "0x5", + "0x40780017fff7fff", + "0x8", + "0x48127ff27fff8000", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4661696c656420746f20646573657269616c697a6520706172616d202332", + "0x400080007ffe7fff", + "0x48127ffd7fff8000", + "0x48127fc47fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4661696c656420746f20646573657269616c697a6520706172616d202331", + "0x400080007ffe7fff", + "0x48127ffd7fff8000", + "0x48127fd27fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4f7574206f6620676173", + "0x400080007ffe7fff", + "0x482680017ff98000", + "0x1", + "0x480a7ffa7fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x48297ffc80007ffd", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482680017ffc8000", + "0x1", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x0", + "0x480280007ffc8000", + "0x10780017fff7fff", + "0x8", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0x29", + "0x48307ffc80007ffd", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482480017ffb8000", + "0x1", + "0x48127ffb7fff8000", + "0x480680017fff8000", + "0x0", + "0x480080007ff88000", + "0x10780017fff7fff", + "0x8", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0xa", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ff77fff8000", + "0x48127ffb7fff8000", + "0x10780017fff7fff", + "0x16", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x10780017fff7fff", + "0xc", + "0x40780017fff7fff", + "0x5", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffd", + "0x60", + "0x48307ffb80007ffc", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482480017ffa8000", + "0x1", + "0x48127ffa7fff8000", + "0x480680017fff8000", + "0x0", + "0x480080007ff78000", + "0x10780017fff7fff", + "0x8", + "0x48127ffa7fff8000", + "0x48127ffa7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0x29", + "0x48307ffc80007ffd", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482480017ffb8000", + "0x1", + "0x48127ffb7fff8000", + "0x480680017fff8000", + "0x0", + "0x480080007ff88000", + "0x10780017fff7fff", + "0x8", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0xa", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ff77fff8000", + "0x48127ffb7fff8000", + "0x10780017fff7fff", + "0x16", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x10780017fff7fff", + "0xc", + "0x40780017fff7fff", + "0x5", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffd", + "0xb", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x480680017fff8000", + "0x0", + "0x48127fec7fff8000", + "0x48127fec7fff8000", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0xf", + "0x48127fec7fff8000", + "0x48127fec7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x208b7fff7fff7ffe", + "0xa0680017fff8000", + "0x7", + "0x482680017ff38000", + "0xffffffffffffffffffffffffffff9f3e", + "0x400280007ff27fff", + "0x10780017fff7fff", + "0xb6", + "0x4825800180007ff3", + "0x60c2", + "0x400280007ff27fff", + "0x48297ff680017ff5", + "0xa0680017fff7fff", + "0x7", + "0x482480017fff8000", + "0x100000000000000000000000000000000", + "0x400280017ff27fff", + "0x10780017fff7fff", + "0xd", + "0x400280017ff27fff", + "0x482680017ff28000", + "0x2", + "0x48127ffc7fff8000", + "0x480a7ff47fff8000", + "0x480680017fff8000", + "0x0", + "0x480a7ff77fff8000", + "0x480a7ff87fff8000", + "0x480a7ff57fff8000", + "0x208b7fff7fff7ffe", + "0x482680017ff28000", + "0x2", + "0x48127ffb7fff8000", + "0x480a7ff47fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0xaa36a7", + "0x480a7ff57fff8000", + "0x480a7ff97fff8000", + "0x480a7ffa7fff8000", + "0x480a7ffb7fff8000", + "0x1104800180018000", + "0xa3", + "0x20680017fff7ffd", + "0x86", + "0x48327fff7ff88001", + "0xa0680017fff7fff", + "0x7", + "0x4824800180007fff", + "0x100000000000000000000000000000000", + "0x400080007ff77fff", + "0x10780017fff7fff", + "0xc", + "0x400080007ff87fff", + "0x40780017fff7fff", + "0x1", + "0x482480017ff78000", + "0x1", + "0x48127ffd7fff8000", + "0x480680017fff8000", + "0x0", + "0x10780017fff7fff", + "0x7", + "0x482480017ff78000", + "0x1", + "0x48127ffe7fff8000", + "0x480680017fff8000", + "0x1", + "0x48327ff87ff78001", + "0xa0680017fff7fff", + "0x7", + "0x4824800180007fff", + "0x100000000000000000000000000000000", + "0x400080007ffa7fff", + "0x10780017fff7fff", + "0xc", + "0x400080007ffb7fff", + "0x40780017fff7fff", + "0x5", + "0x482480017ff68000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff57fff8000", + "0x48127ff57fff8000", + "0x10780017fff7fff", + "0x1c", + "0x480680017fff8000", + "0x1", + "0x48307fff7ffa8001", + "0xa0680017fff7fff", + "0x7", + "0x4824800180007fff", + "0x100000000000000000000000000000000", + "0x400080017ff67fff", + "0x10780017fff7fff", + "0xc", + "0x400080017ff77fff", + "0x40780017fff7fff", + "0x1", + "0x482480017ff68000", + "0x2", + "0x48127ffa7fff8000", + "0x48127ffc7fff8000", + "0x48127ff57fff8000", + "0x10780017fff7fff", + "0x8", + "0x482480017ff68000", + "0x2", + "0x48127ffa7fff8000", + "0x48127ffd7fff8000", + "0x480680017fff8000", + "0x1", + "0x20680017fff7fff", + "0x31", + "0x480680017fff8000", + "0x1", + "0xa0680017fff8000", + "0x8", + "0x48327ffe7ff58000", + "0x4824800180007fff", + "0x100000000", + "0x400080007ff87fff", + "0x10780017fff7fff", + "0x16", + "0x48327ffe7ff58001", + "0x4824800180007fff", + "0xffffffffffffffffffffffff00000000", + "0x400080007ff87ffe", + "0x482480017ff88000", + "0x1", + "0x48127fe57fff8000", + "0x48127fe57fff8000", + "0x48127ffc7fff8000", + "0x480a7ff67fff8000", + "0x48127ff47fff8000", + "0x48127ff47fff8000", + "0x480a7ff97fff8000", + "0x480a7ffa7fff8000", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff74", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x7533325f616464204f766572666c6f77", + "0x400080007ffe7fff", + "0x482480017ff68000", + "0x1", + "0x48127fe37fff8000", + "0x48127fe37fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x48127ff97fff8000", + "0x482480017ff88000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x753235365f616464204f766572666c6f77", + "0x400080007ffe7fff", + "0x48127ffa7fff8000", + "0x48127fe77fff8000", + "0x48127fe77fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x48127ff97fff8000", + "0x482480017ff88000", + "0x1", + "0x208b7fff7fff7ffe", + "0x48127ffa7fff8000", + "0x48127ffa7fff8000", + "0x48127ffa7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4f7574206f6620676173", + "0x400080007ffe7fff", + "0x482680017ff28000", + "0x1", + "0x480a7ff37fff8000", + "0x480a7ff47fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x48127ff97fff8000", + "0x482480017ff88000", + "0x1", + "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x2", + "0xa0680017fff8004", + "0xe", + "0x4824800180047ffe", + "0x800000000000000000000000000000000000000000000000000000000000000", + "0x484480017ffe8000", + "0x110000000000000000", + "0x48307ffe7fff8002", + "0x480280007ff47ffc", + "0x480280017ff47ffc", + "0x402480017ffb7ffd", + "0xffffffffffffffeeffffffffffffffff", + "0x400280027ff47ffd", + "0x10780017fff7fff", + "0xd0", + "0x484480017fff8001", + "0x8000000000000000000000000000000", + "0x48307fff80007ffd", + "0x480280007ff47ffd", + "0x480280017ff47ffd", + "0x402480017ffc7ffe", + "0xf8000000000000000000000000000000", + "0x400280027ff47ffe", + "0x40780017fff7fff", + "0x1", + "0x400180007fff7ff7", + "0x400180017fff7ff8", + "0x400180027fff7ff9", + "0x400180037fff7ffa", + "0x400180047fff7ffb", + "0x400180057fff7ffd", + "0x400180067fff7ffc", + "0x480680017fff8000", + "0x0", + "0x48127ffe7fff8000", + "0x482480017ffd8000", + "0x7", + "0x482680017ff48000", + "0x3", + "0x480680017fff8000", + "0x43616c6c436f6e7472616374", + "0x400280007ff67fff", + "0x400380017ff67ff5", + "0x400280027ff67ff4", + "0x400280037ff67ffb", + "0x400280047ff67ffc", + "0x400280057ff67ffd", + "0x480280077ff68000", + "0x20680017fff7fff", + "0xa2", + "0x480280087ff68000", + "0x480280097ff68000", + "0x480680017fff8000", + "0x0", + "0x480280067ff68000", + "0x482680017ff68000", + "0xa", + "0x480280087ff68000", + "0x480280097ff68000", + "0x48307ff980007ffa", + "0xa0680017fff8000", + "0x6", + "0x48307ffe80007ff9", + "0x400080007ff37fff", + "0x10780017fff7fff", + "0x81", + "0x482480017ff98000", + "0x1", + "0x48307fff80007ffd", + "0x400080007ff27fff", + "0x48307ff77ff58000", + "0x480080007fff8000", + "0xa0680017fff8000", + "0x16", + "0x480080017fef8003", + "0x480080027fee8003", + "0x4844800180017ffe", + "0x100000000000000000000000000000000", + "0x483080017ffd7ffb", + "0x482480017fff7ffd", + "0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001", + "0x20680017fff7ffc", + "0x6", + "0x402480017fff7ffd", + "0xffffffffffffffffffffffffffffffff", + "0x10780017fff7fff", + "0x4", + "0x402480017ffe7ffd", + "0xf7ffffffffffffef0000000000000000", + "0x400080037fea7ffd", + "0x20680017fff7ffe", + "0x56", + "0x402780017fff7fff", + "0x1", + "0x400080017fef7ffe", + "0x480680017fff8000", + "0x1", + "0x48307ff680007ff7", + "0xa0680017fff8000", + "0x6", + "0x48307ffe80007ffd", + "0x400080027feb7fff", + "0x10780017fff7fff", + "0x39", + "0x482480017ffd8000", + "0x1", + "0x48307fff80007ffd", + "0x400080027fea7fff", + "0x48307ffb7ff28000", + "0x480080007fff8000", + "0xa0680017fff8000", + "0x16", + "0x480080037fe78003", + "0x480080047fe68003", + "0x4844800180017ffe", + "0x100000000000000000000000000000000", + "0x483080017ffd7ffb", + "0x482480017fff7ffd", + "0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001", + "0x20680017fff7ffc", + "0x6", + "0x402480017fff7ffd", + "0xffffffffffffffffffffffffffffffff", + "0x10780017fff7fff", + "0x4", + "0x402480017ffe7ffd", + "0xf7ffffffffffffef0000000000000000", + "0x400080057fe27ffd", + "0x20680017fff7ffe", + "0x10", + "0x402780017fff7fff", + "0x1", + "0x400080037fe77ffe", + "0x40780017fff7fff", + "0x7", + "0x482480017fe08000", + "0x4", + "0x48127fe57fff8000", + "0x48127fe57fff8000", + "0x480680017fff8000", + "0x0", + "0x48127feb7fff8000", + "0x48127ff27fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4f7074696f6e3a3a756e77726170206661696c65642e", + "0x400080007ffe7fff", + "0x482480017fe08000", + "0x6", + "0x48127fe57fff8000", + "0x48127fe57fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x9", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x496e646578206f7574206f6620626f756e6473", + "0x400080007ffe7fff", + "0x482480017fe08000", + "0x3", + "0x48127fe57fff8000", + "0x48127fe57fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x8", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4f7074696f6e3a3a756e77726170206661696c65642e", + "0x400080007ffe7fff", + "0x482480017fe08000", + "0x4", + "0x48127fe57fff8000", + "0x48127fe57fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x11", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x496e646578206f7574206f6620626f756e6473", + "0x400080007ffe7fff", + "0x482480017fe08000", + "0x1", + "0x48127fe57fff8000", + "0x48127fe57fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1d", + "0x48127fe07fff8000", + "0x480280067ff68000", + "0x482680017ff68000", + "0xa", + "0x480680017fff8000", + "0x1", + "0x480280087ff68000", + "0x480280097ff68000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x21", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4f7074696f6e3a3a756e77726170206661696c65642e", + "0x400080007ffe7fff", + "0x482680017ff48000", + "0x3", + "0x480a7ff57fff8000", + "0x480a7ff67fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe" + ], + "bytecode_segment_lengths": [ + 461, + 181, + 204, + 239 + ], + "hints": [ + [ + 0, + [ + { + "TestLessThanOrEqual": { + "lhs": { + "Immediate": "0x1a2c" + }, + "rhs": { + "Deref": { + "register": "FP", + "offset": -6 + } + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 40, + [ + { + "TestLessThan": { + "lhs": { + "BinOp": { + "op": "Add", + "a": { + "register": "AP", + "offset": -1 + }, + "b": { + "Immediate": "0x0" + } + } + }, + "rhs": { + "Immediate": "0x100000000" + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 44, + [ + { + "LinearSplit": { + "value": { + "Deref": { + "register": "AP", + "offset": -1 + } + }, + "scalar": { + "Immediate": "0x8000000000000110000000000000000" + }, + "max_x": { + "Immediate": "0xfffffffffffffffffffffffffffffffe" + }, + "x": { + "register": "AP", + "offset": 0 + }, + "y": { + "register": "AP", + "offset": 1 + } + } + } + ] + ], + [ + 86, + [ + { + "TestLessThan": { + "lhs": { + "BinOp": { + "op": "Add", + "a": { + "register": "AP", + "offset": -1 + }, + "b": { + "Immediate": "0x0" + } + } + }, + "rhs": { + "Immediate": "0x100000000" + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 90, + [ + { + "LinearSplit": { + "value": { + "Deref": { + "register": "AP", + "offset": -1 + } + }, + "scalar": { + "Immediate": "0x8000000000000110000000000000000" + }, + "max_x": { + "Immediate": "0xfffffffffffffffffffffffffffffffe" + }, + "x": { + "register": "AP", + "offset": 0 + }, + "y": { + "register": "AP", + "offset": 1 + } + } + } + ] + ], + [ + 153, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -1 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 155, + [ + { + "DivMod": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -2 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "quotient": { + "register": "AP", + "offset": 3 + }, + "remainder": { + "register": "AP", + "offset": 4 + } + } + } + ] + ], + [ + 200, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -1 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 202, + [ + { + "DivMod": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -2 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "quotient": { + "register": "AP", + "offset": 3 + }, + "remainder": { + "register": "AP", + "offset": 4 + } + } + } + ] + ], + [ + 276, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 295, + [ + { + "TestLessThanOrEqual": { + "lhs": { + "Immediate": "0xad2" + }, + "rhs": { + "Deref": { + "register": "AP", + "offset": -97 + } + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 326, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 347, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 362, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 376, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 397, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 418, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 432, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 446, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 642, + [ + { + "TestLessThanOrEqual": { + "lhs": { + "Immediate": "0x60c2" + }, + "rhs": { + "Deref": { + "register": "FP", + "offset": -13 + } + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 653, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": 0 + } + }, + "rhs": { + "Immediate": "0x100000000" + }, + "dst": { + "register": "AP", + "offset": -1 + } + } + } + ] + ], + [ + 688, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": 0 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "dst": { + "register": "AP", + "offset": -1 + } + } + } + ] + ], + [ + 711, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": 0 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "dst": { + "register": "AP", + "offset": -1 + } + } + } + ] + ], + [ + 731, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": 0 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "dst": { + "register": "AP", + "offset": -1 + } + } + } + ] + ], + [ + 758, + [ + { + "TestLessThan": { + "lhs": { + "BinOp": { + "op": "Add", + "a": { + "register": "FP", + "offset": -11 + }, + "b": { + "Deref": { + "register": "AP", + "offset": -1 + } + } + } + }, + "rhs": { + "Immediate": "0x100000000" + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 786, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 803, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 829, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 848, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -1 + } + }, + "rhs": { + "Immediate": "0x800000000000000000000000000000000000000000000000000000000000000" + }, + "dst": { + "register": "AP", + "offset": 4 + } + } + } + ] + ], + [ + 852, + [ + { + "LinearSplit": { + "value": { + "Deref": { + "register": "AP", + "offset": 3 + } + }, + "scalar": { + "Immediate": "0x110000000000000000" + }, + "max_x": { + "Immediate": "0xffffffffffffffffffffffffffffffff" + }, + "x": { + "register": "AP", + "offset": -2 + }, + "y": { + "register": "AP", + "offset": -1 + } + } + } + ] + ], + [ + 862, + [ + { + "LinearSplit": { + "value": { + "Deref": { + "register": "AP", + "offset": -2 + } + }, + "scalar": { + "Immediate": "0x8000000000000000000000000000000" + }, + "max_x": { + "Immediate": "0xffffffffffffffffffffffffffffffff" + }, + "x": { + "register": "AP", + "offset": -1 + }, + "y": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 870, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 894, + [ + { + "SystemCall": { + "system": { + "Deref": { + "register": "FP", + "offset": -10 + } + } + } + } + ] + ], + [ + 907, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -6 + } + }, + "rhs": { + "Deref": { + "register": "AP", + "offset": -1 + } + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 919, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -1 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 921, + [ + { + "DivMod": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -2 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "quotient": { + "register": "AP", + "offset": 3 + }, + "remainder": { + "register": "AP", + "offset": 4 + } + } + } + ] + ], + [ + 945, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -2 + } + }, + "rhs": { + "Deref": { + "register": "AP", + "offset": -1 + } + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 957, + [ + { + "TestLessThan": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -1 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 959, + [ + { + "DivMod": { + "lhs": { + "Deref": { + "register": "AP", + "offset": -2 + } + }, + "rhs": { + "Immediate": "0x100000000000000000000000000000000" + }, + "quotient": { + "register": "AP", + "offset": 3 + }, + "remainder": { + "register": "AP", + "offset": 4 + } + } + } + ] + ], + [ + 991, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 1008, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 1025, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 1042, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 1070, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ] + ], + "pythonic_hints": [ + [ + 0, + [ + "memory[ap + 0] = 6700 <= memory[fp + -6]" + ] + ], + [ + 40, + [ + "memory[ap + 0] = (memory[ap + -1] + 0) % PRIME < 4294967296" + ] + ], + [ + 44, + [ + "\n(value, scalar) = (memory[ap + -1], 10633823966279327296825105735305134080)\nx = min(value // scalar, 340282366920938463463374607431768211454)\ny = value - x * scalar\nmemory[ap + 0] = x\nmemory[ap + 1] = y\n" + ] + ], + [ + 86, + [ + "memory[ap + 0] = (memory[ap + -1] + 0) % PRIME < 4294967296" + ] + ], + [ + 90, + [ + "\n(value, scalar) = (memory[ap + -1], 10633823966279327296825105735305134080)\nx = min(value // scalar, 340282366920938463463374607431768211454)\ny = value - x * scalar\nmemory[ap + 0] = x\nmemory[ap + 1] = y\n" + ] + ], + [ + 153, + [ + "memory[ap + 0] = memory[ap + -1] < 340282366920938463463374607431768211456" + ] + ], + [ + 155, + [ + "(memory[ap + 3], memory[ap + 4]) = divmod(memory[ap + -2], 340282366920938463463374607431768211456)" + ] + ], + [ + 200, + [ + "memory[ap + 0] = memory[ap + -1] < 340282366920938463463374607431768211456" + ] + ], + [ + 202, + [ + "(memory[ap + 3], memory[ap + 4]) = divmod(memory[ap + -2], 340282366920938463463374607431768211456)" + ] + ], + [ + 276, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 295, + [ + "memory[ap + 0] = 2770 <= memory[ap + -97]" + ] + ], + [ + 326, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 347, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 362, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 376, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 397, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 418, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 432, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 446, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 642, + [ + "memory[ap + 0] = 24770 <= memory[fp + -13]" + ] + ], + [ + 653, + [ + "memory[ap + -1] = memory[ap + 0] < 4294967296" + ] + ], + [ + 688, + [ + "memory[ap + -1] = memory[ap + 0] < 340282366920938463463374607431768211456" + ] + ], + [ + 711, + [ + "memory[ap + -1] = memory[ap + 0] < 340282366920938463463374607431768211456" + ] + ], + [ + 731, + [ + "memory[ap + -1] = memory[ap + 0] < 340282366920938463463374607431768211456" + ] + ], + [ + 758, + [ + "memory[ap + 0] = (memory[fp + -11] + memory[ap + -1]) % PRIME < 4294967296" + ] + ], + [ + 786, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 803, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 829, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 848, + [ + "memory[ap + 4] = memory[ap + -1] < 3618502788666131106986593281521497120414687020801267626233049500247285301248" + ] + ], + [ + 852, + [ + "\n(value, scalar) = (memory[ap + 3], 313594649253062377472)\nx = min(value // scalar, 340282366920938463463374607431768211455)\ny = value - x * scalar\nmemory[ap + -2] = x\nmemory[ap + -1] = y\n" + ] + ], + [ + 862, + [ + "\n(value, scalar) = (memory[ap + -2], 10633823966279326983230456482242756608)\nx = min(value // scalar, 340282366920938463463374607431768211455)\ny = value - x * scalar\nmemory[ap + -1] = x\nmemory[ap + 0] = y\n" + ] + ], + [ + 870, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 894, + [ + "syscall_handler.syscall(syscall_ptr=memory[fp + -10])" + ] + ], + [ + 907, + [ + "memory[ap + 0] = memory[ap + -6] < memory[ap + -1]" + ] + ], + [ + 919, + [ + "memory[ap + 0] = memory[ap + -1] < 340282366920938463463374607431768211456" + ] + ], + [ + 921, + [ + "(memory[ap + 3], memory[ap + 4]) = divmod(memory[ap + -2], 340282366920938463463374607431768211456)" + ] + ], + [ + 945, + [ + "memory[ap + 0] = memory[ap + -2] < memory[ap + -1]" + ] + ], + [ + 957, + [ + "memory[ap + 0] = memory[ap + -1] < 340282366920938463463374607431768211456" + ] + ], + [ + 959, + [ + "(memory[ap + 3], memory[ap + 4]) = divmod(memory[ap + -2], 340282366920938463463374607431768211456)" + ] + ], + [ + 991, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 1008, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 1025, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 1042, + [ + "memory[ap + 0] = segments.add()" + ] + ], + [ + 1070, + [ + "memory[ap + 0] = segments.add()" + ] + ] + ], + "entry_points_by_type": { + "EXTERNAL": [ + { + "selector": "0xe2054f8a912367e38a22ce773328ff8aabf8082c4120bad9ef085e1dbf29a7", + "offset": 0, + "builtins": [ + "range_check" + ] + } + ], + "L1_HANDLER": [], + "CONSTRUCTOR": [] + } + } +} \ No newline at end of file diff --git a/tools/js/merkle.js b/tools/js/merkle.js deleted file mode 100644 index 46cf6ba7..00000000 --- a/tools/js/merkle.js +++ /dev/null @@ -1,24 +0,0 @@ -import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; -import { create } from "domain"; -import fs from "fs"; - -function createMerkleTreeValues() { - const values = [ - ["0x0000000000000000000000000000000000000000000000000000000000000001"], - ["0x0000000000000000000000000000000000000000000000000000000000000002"], - ["0x000000000000000000000000000000000000000000000000000000000000007a"], - ["0x0000000000000000000000000000000000000000000000000000000000000004"], - ["0x0000000000000000000000000000000000000000000000000000000000000001"], - ]; - - let roots = []; - for(let i = 0; i < values.length; i++) { - const subset = values.slice(0, i + 1); - const tree = StandardMerkleTree.of(subset, ["bytes32"], {sortLeaves: false}); - roots.push(tree.root); - } - - console.log(roots); -} - -// createMerkleTreeValues(); \ No newline at end of file diff --git a/tools/js/package.json b/tools/js/package.json deleted file mode 100644 index 00df4053..00000000 --- a/tools/js/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "tools", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "type": "module", - "keywords": [], - "author": "", - "dependencies": { - "@openzeppelin/merkle-tree": "^1.0.6" - } -}