From ce09c5ba0ecfcba7866b66ccc2be529452d9a5a7 Mon Sep 17 00:00:00 2001 From: kashepavadan Date: Fri, 19 Jun 2026 17:04:12 -0400 Subject: [PATCH] updated to work with latest zone-sdk --- Cargo.lock | 615 ++++++++++++++++++++++--------------- Cargo.toml | 19 +- common/src/state.rs | 2 +- indexer/src/indexer.rs | 2 +- sequencer/src/sequencer.rs | 70 +++-- 5 files changed, 422 insertions(+), 286 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 403ae56..87390f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,7 +115,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -126,7 +126,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -195,61 +195,48 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ark-bn254" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" -dependencies = [ - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-std 0.4.0", -] - [[package]] name = "ark-bn254" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" dependencies = [ - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-std 0.5.0", + "ark-ec", + "ark-ff", + "ark-std", ] [[package]] name = "ark-crypto-primitives" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" dependencies = [ - "ark-ec 0.4.2", - "ark-ff 0.4.2", + "ahash", + "ark-crypto-primitives-macros", + "ark-ec", + "ark-ff", "ark-relations", - "ark-serialize 0.4.2", + "ark-serialize", "ark-snark", - "ark-std 0.4.0", + "ark-std", "blake2", "derivative", "digest", + "fnv", + "merlin", "sha2", ] [[package]] -name = "ark-ec" -version = "0.4.2" +name = "ark-crypto-primitives-macros" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +checksum = "e7e89fe77d1f0f4fe5b96dfc940923d88d17b6a773808124f21e764dfb063c6a" dependencies = [ - "ark-ff 0.4.2", - "ark-poly 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "hashbrown 0.13.2", - "itertools 0.10.5", - "num-traits", - "zeroize", + "proc-macro2", + "quote", + "syn 2.0.117", ] [[package]] @@ -259,10 +246,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ "ahash", - "ark-ff 0.5.0", - "ark-poly 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", "educe", "fnv", "hashbrown 0.15.5", @@ -273,36 +260,16 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ark-ff" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" -dependencies = [ - "ark-ff-asm 0.4.2", - "ark-ff-macros 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "digest", - "itertools 0.10.5", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - [[package]] name = "ark-ff" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" dependencies = [ - "ark-ff-asm 0.5.0", - "ark-ff-macros 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", "arrayvec", "digest", "educe", @@ -313,16 +280,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "ark-ff-asm" version = "0.5.0" @@ -333,19 +290,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "ark-ff-macros" version = "0.5.0" @@ -361,30 +305,17 @@ dependencies = [ [[package]] name = "ark-groth16" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" dependencies = [ "ark-crypto-primitives", - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-poly 0.4.2", + "ark-ec", + "ark-ff", + "ark-poly", "ark-relations", - "ark-serialize 0.4.2", - "ark-std 0.4.0", -] - -[[package]] -name = "ark-poly" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" -dependencies = [ - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "hashbrown 0.13.2", + "ark-serialize", + "ark-std", ] [[package]] @@ -394,9 +325,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" dependencies = [ "ahash", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", + "ark-ff", + "ark-serialize", + "ark-std", "educe", "fnv", "hashbrown 0.15.5", @@ -404,52 +335,29 @@ dependencies = [ [[package]] name = "ark-relations" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" dependencies = [ - "ark-ff 0.4.2", - "ark-std 0.4.0", + "ark-ff", + "ark-std", "tracing", "tracing-subscriber 0.2.25", ] -[[package]] -name = "ark-serialize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-serialize-derive 0.4.2", - "ark-std 0.4.0", - "digest", - "num-bigint", -] - [[package]] name = "ark-serialize" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ - "ark-serialize-derive 0.5.0", - "ark-std 0.5.0", + "ark-serialize-derive", + "ark-std", "arrayvec", "digest", "num-bigint", ] -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "ark-serialize-derive" version = "0.5.0" @@ -463,24 +371,14 @@ dependencies = [ [[package]] name = "ark-snark" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" dependencies = [ - "ark-ff 0.4.2", + "ark-ff", "ark-relations", - "ark-serialize 0.4.2", - "ark-std 0.4.0", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand 0.8.5", + "ark-serialize", + "ark-std", ] [[package]] @@ -1008,6 +906,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "chkstk_stub" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "047f6ab2f3b9bcaf23b593d1580898e4244d27eadf1a1fae99212ee5735d3d1c" +dependencies = [ + "cc", +] + [[package]] name = "chrono" version = "0.4.44" @@ -1485,7 +1392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab67060fc6b8ef687992d439ca0fa36e7ed17e9a0b16b25b601e8757df720de" dependencies = [ "data-encoding", - "syn 1.0.109", + "syn 2.0.117", ] [[package]] @@ -1731,7 +1638,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1939,7 +1846,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2018,6 +1925,17 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "fd-lock" +version = "4.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78" +dependencies = [ + "cfg-if", + "rustix 1.1.4", + "windows-sys 0.59.0", +] + [[package]] name = "fdeflate" version = "0.3.7" @@ -2043,6 +1961,16 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +[[package]] +name = "filetime" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" +dependencies = [ + "cfg-if", + "libc", +] + [[package]] name = "find-msvc-tools" version = "0.1.9" @@ -2353,15 +2281,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.14.5" @@ -2996,7 +2915,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3040,26 +2959,26 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jf-crhf" -version = "0.1.1" -source = "git+https://github.com/EspressoSystems/jellyfish?tag=jf-crhf-v0.1.1#8f3dce0bc2bd161b4648f6ac029dcc1a23aaf4c5" +version = "0.2.0" +source = "git+https://github.com/EspressoSystems/jellyfish?tag=jf-crhf-v0.2.0#f1538793f7f0e391495cb17bbb0c8703ec5f689d" dependencies = [ - "ark-serialize 0.4.2", - "ark-std 0.4.0", + "ark-serialize", + "ark-std", ] [[package]] name = "jf-poseidon2" -version = "0.1.0" -source = "git+https://github.com/EspressoSystems/jellyfish.git?rev=dc166cf0f803c3e5067f9dfcc21e3dade986a447#dc166cf0f803c3e5067f9dfcc21e3dade986a447" +version = "0.2.0" +source = "git+https://github.com/EspressoSystems/jellyfish.git?rev=8d80230358e900f8d63765a937f63f4978ca1daa#8d80230358e900f8d63765a937f63f4978ca1daa" dependencies = [ - "ark-bn254 0.4.0", - "ark-ff 0.4.2", - "ark-std 0.4.0", + "ark-bn254", + "ark-ff", + "ark-std", "displaydoc", "hex", "jf-crhf", "lazy_static", - "nimue", + "spongefish", "zeroize", ] @@ -3638,8 +3557,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47a1ccadd0bb5a32c196da536fd72c59183de24a055f6bf0513bf845fefab862" dependencies = [ - "ark-bn254 0.5.0", - "ark-ff 0.5.0", + "ark-bn254", + "ark-ff", "num-bigint", "thiserror 1.0.69", ] @@ -3702,12 +3621,12 @@ dependencies = [ "logos-blockchain-blend-crypto", "logos-blockchain-blend-proofs", "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", "logos-blockchain-groth16", "logos-blockchain-key-management-system-keys", "logos-blockchain-log-targets", "logos-blockchain-utils", "serde", - "serde-big-array", "serde_with", "test-log", "thiserror 2.0.18", @@ -3743,12 +3662,10 @@ version = "0.2.1" dependencies = [ "async-trait", "derivative", - "futures", "logos-blockchain-core", "overwatch", "serde", "tokio", - "tokio-stream", "tracing", ] @@ -3778,7 +3695,6 @@ dependencies = [ "rand 0.8.5", "serde", "serde_with", - "strum 0.27.2", "tempfile", "thiserror 2.0.18", "time", @@ -3789,18 +3705,79 @@ dependencies = [ ] [[package]] -name = "logos-blockchain-circuits-prover" -version = "0.2.1" +name = "logos-blockchain-circuits-build" +version = "0.5.3" +source = "git+https://github.com/logos-blockchain/logos-blockchain-circuits.git?tag=v0.5.3#127626881faa975aa8e9868422cf6bbb08fcb512" dependencies = [ - "logos-blockchain-circuits-utils", - "tempfile", + "dirs", + "fd-lock", + "flate2", + "tar", + "ureq", ] [[package]] -name = "logos-blockchain-circuits-utils" +name = "logos-blockchain-circuits-common" +version = "0.5.3" +source = "git+https://github.com/logos-blockchain/logos-blockchain-circuits.git?tag=v0.5.3#127626881faa975aa8e9868422cf6bbb08fcb512" +dependencies = [ + "logos-blockchain-circuits-types", +] + +[[package]] +name = "logos-blockchain-circuits-poc-sys" +version = "0.5.3" +source = "git+https://github.com/logos-blockchain/logos-blockchain-circuits.git?tag=v0.5.3#127626881faa975aa8e9868422cf6bbb08fcb512" +dependencies = [ + "logos-blockchain-circuits-build", + "logos-blockchain-circuits-common", + "logos-blockchain-circuits-types", +] + +[[package]] +name = "logos-blockchain-circuits-pol-sys" +version = "0.5.3" +source = "git+https://github.com/logos-blockchain/logos-blockchain-circuits.git?tag=v0.5.3#127626881faa975aa8e9868422cf6bbb08fcb512" +dependencies = [ + "logos-blockchain-circuits-build", + "logos-blockchain-circuits-common", + "logos-blockchain-circuits-types", +] + +[[package]] +name = "logos-blockchain-circuits-poq-sys" +version = "0.5.3" +source = "git+https://github.com/logos-blockchain/logos-blockchain-circuits.git?tag=v0.5.3#127626881faa975aa8e9868422cf6bbb08fcb512" +dependencies = [ + "logos-blockchain-circuits-build", + "logos-blockchain-circuits-common", + "logos-blockchain-circuits-types", +] + +[[package]] +name = "logos-blockchain-circuits-prover" version = "0.2.1" dependencies = [ - "dirs", + "rust-rapidsnark", +] + +[[package]] +name = "logos-blockchain-circuits-signature-sys" +version = "0.5.3" +source = "git+https://github.com/logos-blockchain/logos-blockchain-circuits.git?tag=v0.5.3#127626881faa975aa8e9868422cf6bbb08fcb512" +dependencies = [ + "logos-blockchain-circuits-build", + "logos-blockchain-circuits-common", + "logos-blockchain-circuits-types", +] + +[[package]] +name = "logos-blockchain-circuits-types" +version = "0.5.3" +source = "git+https://github.com/logos-blockchain/logos-blockchain-circuits.git?tag=v0.5.3#127626881faa975aa8e9868422cf6bbb08fcb512" +dependencies = [ + "bytes", + "libc", ] [[package]] @@ -3816,6 +3793,7 @@ dependencies = [ "logos-blockchain-groth16", "logos-blockchain-http-api-common", "logos-blockchain-key-management-system-keys", + "logos-blockchain-log-targets", "reqwest", "serde", "serde_json", @@ -3828,7 +3806,7 @@ dependencies = [ name = "logos-blockchain-core" version = "0.2.1" dependencies = [ - "ark-ff 0.4.2", + "ark-ff", "bincode", "blake2", "bytes", @@ -3841,6 +3819,7 @@ dependencies = [ "logos-blockchain-cryptarchia-engine", "logos-blockchain-groth16", "logos-blockchain-key-management-system-keys", + "logos-blockchain-log-targets", "logos-blockchain-mmr", "logos-blockchain-poc", "logos-blockchain-pol", @@ -3867,6 +3846,7 @@ version = "0.2.1" dependencies = [ "logos-blockchain-pol", "logos-blockchain-utils", + "rpds", "serde", "serde_with", "thiserror 2.0.18", @@ -3898,11 +3878,11 @@ dependencies = [ name = "logos-blockchain-groth16" version = "0.2.1" dependencies = [ - "ark-bn254 0.4.0", - "ark-ec 0.4.2", - "ark-ff 0.4.2", + "ark-bn254", + "ark-ec", + "ark-ff", "ark-groth16", - "ark-serialize 0.4.2", + "ark-serialize", "bincode", "generic-array 1.3.5", "hex", @@ -3919,13 +3899,19 @@ dependencies = [ "axum", "logos-blockchain-core", "logos-blockchain-key-management-system-keys", + "logos-blockchain-log-targets", "logos-blockchain-tracing", "pprof", "serde", "serde_json", + "serde_urlencoded", "serde_with", + "time", "tokio", "tracing", + "url", + "utoipa", + "validator", ] [[package]] @@ -3939,6 +3925,7 @@ dependencies = [ "hex", "logos-blockchain-groth16", "logos-blockchain-key-management-system-macros", + "logos-blockchain-log-targets", "logos-blockchain-poseidon2", "logos-blockchain-utils", "logos-blockchain-zksign", @@ -3974,6 +3961,7 @@ dependencies = [ "logos-blockchain-core", "logos-blockchain-groth16", "logos-blockchain-key-management-system-keys", + "logos-blockchain-log-targets", "logos-blockchain-poseidon2", "logos-blockchain-utxotree", "tokio", @@ -3986,9 +3974,9 @@ version = "0.2.1" dependencies = [ "async-trait", "bytes", - "log", "logos-blockchain-key-management-system-keys", "logos-blockchain-key-management-system-operators", + "logos-blockchain-log-targets", "logos-blockchain-tracing", "num-bigint", "overwatch", @@ -4039,6 +4027,7 @@ dependencies = [ "libp2p", "libp2p-swarm-test", "logos-blockchain-cryptarchia-sync", + "logos-blockchain-log-targets", "logos-blockchain-utils", "multiaddr", "natpmp", @@ -4075,7 +4064,7 @@ dependencies = [ name = "logos-blockchain-mmr" version = "0.2.1" dependencies = [ - "ark-ff 0.4.2", + "ark-ff", "logos-blockchain-groth16", "logos-blockchain-poseidon2", "proptest", @@ -4095,6 +4084,7 @@ dependencies = [ "logos-blockchain-core", "logos-blockchain-cryptarchia-sync", "logos-blockchain-libp2p", + "logos-blockchain-log-targets", "logos-blockchain-tracing", "logos-blockchain-utils", "overwatch", @@ -4112,11 +4102,13 @@ dependencies = [ name = "logos-blockchain-poc" version = "0.2.1" dependencies = [ + "divan", + "logos-blockchain-circuits-poc-sys", "logos-blockchain-circuits-prover", - "logos-blockchain-circuits-utils", + "logos-blockchain-circuits-types", "logos-blockchain-groth16", + "logos-blockchain-log-targets", "logos-blockchain-proofs-error", - "logos-blockchain-witness-generator", "num-bigint", "serde", "serde_json", @@ -4128,12 +4120,14 @@ name = "logos-blockchain-pol" version = "0.2.1" dependencies = [ "astro-float", + "divan", + "logos-blockchain-circuits-pol-sys", "logos-blockchain-circuits-prover", - "logos-blockchain-circuits-utils", + "logos-blockchain-circuits-types", "logos-blockchain-groth16", + "logos-blockchain-log-targets", "logos-blockchain-proofs-error", "logos-blockchain-utils", - "logos-blockchain-witness-generator", "num-bigint", "num-traits", "serde", @@ -4145,13 +4139,15 @@ dependencies = [ name = "logos-blockchain-poq" version = "0.2.1" dependencies = [ + "divan", + "logos-blockchain-circuits-poq-sys", "logos-blockchain-circuits-prover", - "logos-blockchain-circuits-utils", + "logos-blockchain-circuits-types", "logos-blockchain-groth16", + "logos-blockchain-log-targets", "logos-blockchain-pol", "logos-blockchain-proofs-error", "logos-blockchain-utils", - "logos-blockchain-witness-generator", "num-bigint", "serde", "serde_json", @@ -4163,8 +4159,8 @@ dependencies = [ name = "logos-blockchain-poseidon2" version = "0.2.1" dependencies = [ - "ark-bn254 0.4.0", - "ark-ff 0.4.2", + "ark-bn254", + "ark-ff", "jf-poseidon2", "num-bigint", ] @@ -4173,6 +4169,7 @@ dependencies = [ name = "logos-blockchain-proofs-error" version = "0.2.1" dependencies = [ + "logos-blockchain-circuits-types", "logos-blockchain-groth16", "serde_json", "thiserror 2.0.18", @@ -4185,6 +4182,7 @@ dependencies = [ "async-trait", "futures", "log", + "logos-blockchain-log-targets", "overwatch", "overwatch-derive", "serde", @@ -4203,6 +4201,7 @@ dependencies = [ "futures", "logos-blockchain-core", "logos-blockchain-cryptarchia-engine", + "logos-blockchain-log-targets", "logos-blockchain-tracing", "overwatch", "rocksdb", @@ -4221,6 +4220,7 @@ dependencies = [ "futures", "log", "logos-blockchain-cryptarchia-engine", + "logos-blockchain-log-targets", "logos-blockchain-tracing", "logos-blockchain-utils", "overwatch", @@ -4264,16 +4264,19 @@ name = "logos-blockchain-utils" version = "0.2.1" dependencies = [ "async-trait", + "bincode", "blake2", "cipher", "const-hex", "futures", "humantime", + "logos-blockchain-log-targets", "nistrs", "overwatch", "rand 0.8.5", "rand_chacha 0.3.1", "serde", + "serde_ignored", "serde_json", "serde_with", "serde_yaml", @@ -4281,13 +4284,14 @@ dependencies = [ "thiserror 2.0.18", "time", "tokio", + "tracing", ] [[package]] name = "logos-blockchain-utxotree" version = "0.2.1" dependencies = [ - "ark-ff 0.4.2", + "ark-ff", "logos-blockchain-groth16", "logos-blockchain-poseidon2", "num-bigint", @@ -4299,23 +4303,18 @@ dependencies = [ "thiserror 2.0.18", ] -[[package]] -name = "logos-blockchain-witness-generator" -version = "0.2.1" -dependencies = [ - "tempfile", -] - [[package]] name = "logos-blockchain-zksign" version = "0.2.1" dependencies = [ + "divan", "logos-blockchain-circuits-prover", - "logos-blockchain-circuits-utils", + "logos-blockchain-circuits-signature-sys", + "logos-blockchain-circuits-types", "logos-blockchain-groth16", + "logos-blockchain-log-targets", "logos-blockchain-poseidon2", "logos-blockchain-proofs-error", - "logos-blockchain-witness-generator", "num-bigint", "rand 0.8.5", "serde", @@ -4334,7 +4333,9 @@ dependencies = [ "logos-blockchain-common-http-client", "logos-blockchain-core", "logos-blockchain-groth16", + "logos-blockchain-http-api-common", "logos-blockchain-key-management-system-service", + "logos-blockchain-log-targets", "num-bigint", "rand 0.8.5", "reqwest", @@ -4427,6 +4428,18 @@ dependencies = [ "libc", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "mime" version = "0.3.17" @@ -4713,24 +4726,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "nimue" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0dc7d3b2b7bd112c0cecf7d6f4f16a174ee7a98e27615b1d08256d0176588f2" -dependencies = [ - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "digest", - "generic-array 0.14.7", - "hex", - "keccak", - "log", - "rand 0.8.5", - "zeroize", -] - [[package]] name = "nistrs" version = "0.1.2" @@ -4798,7 +4793,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -6078,8 +6073,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7a3ef170810c387d31b64c0b59734abb0839dac2a8d137909e271bfdec9b1e0" dependencies = [ - "ark-bn254 0.5.0", - "ark-ff 0.5.0", + "ark-bn254", + "ark-ff", "byteorder", "futures", "light-poseidon", @@ -6124,6 +6119,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "rust-rapidsnark" +version = "0.1.3" +source = "git+https://github.com/logos-blockchain/logos-blockchain-rust-rapidsnark.git?rev=e91187f8ccb5bbfc7bb00dac88169112428da78f#e91187f8ccb5bbfc7bb00dac88169112428da78f" +dependencies = [ + "anyhow", + "cc", + "chkstk_stub", + "num-bigint", + "num-traits", +] + [[package]] name = "rustc-demangle" version = "0.1.27" @@ -6191,7 +6198,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -6200,6 +6207,7 @@ version = "0.23.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", @@ -6297,15 +6305,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-big-array" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" -dependencies = [ - "serde", -] - [[package]] name = "serde_arrays" version = "0.2.0" @@ -6335,6 +6334,16 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "serde_ignored" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115dffd5f3853e06e746965a20dcbae6ee747ae30b543d91b0e089668bb07798" +dependencies = [ + "serde", + "serde_core", +] + [[package]] name = "serde_json" version = "1.0.149" @@ -6422,6 +6431,16 @@ dependencies = [ "digest", ] +[[package]] +name = "sha3" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77fd7028345d415a4034cf8777cd4f8ab1851274233b45f84e3d955502d93874" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -6541,7 +6560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -6563,6 +6582,24 @@ dependencies = [ "der", ] +[[package]] +name = "spongefish" +version = "0.2.0" +source = "git+https://github.com/arkworks-rs/spongefish.git?rev=3ded547f7f56d7f8a1fc4c9a5c0ce965310bba5f#3ded547f7f56d7f8a1fc4c9a5c0ce965310bba5f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "digest", + "hex", + "keccak", + "rand 0.8.5", + "sha3", + "thiserror 2.0.18", + "zerocopy", + "zeroize", +] + [[package]] name = "sqlparser" version = "0.54.0" @@ -6792,6 +6829,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" +[[package]] +name = "tar" +version = "0.4.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "tempfile" version = "3.27.0" @@ -6802,7 +6850,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix 1.1.4", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -7420,6 +7468,35 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "ureq" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0" +dependencies = [ + "base64", + "flate2", + "log", + "percent-encoding", + "rustls", + "rustls-pki-types", + "ureq-proto", + "utf8-zero", + "webpki-roots", +] + +[[package]] +name = "ureq-proto" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e994ba84b0bd1b1b0cf92878b7ef898a5c1760108fe7b6010327e274917a808c" +dependencies = [ + "base64", + "http 1.4.0", + "httparse", + "log", +] + [[package]] name = "url" version = "2.5.8" @@ -7433,6 +7510,12 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "utf8-zero" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" + [[package]] name = "utf8_iter" version = "1.0.4" @@ -7481,6 +7564,36 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "validator" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43fb22e1a008ece370ce08a3e9e4447a910e92621bb49b85d6e48a45397e7cfa" +dependencies = [ + "idna", + "once_cell", + "regex", + "serde", + "serde_derive", + "serde_json", + "url", + "validator_derive", +] + +[[package]] +name = "validator_derive" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7df16e474ef958526d1205f6dda359fdfab79d9aa6d54bafcb92dcd07673dca" +dependencies = [ + "darling 0.20.11", + "once_cell", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "valuable" version = "0.1.1" @@ -7719,7 +7832,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -8163,6 +8276,16 @@ dependencies = [ "time", ] +[[package]] +name = "xattr" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" +dependencies = [ + "libc", + "rustix 1.1.4", +] + [[package]] name = "xml-rs" version = "0.8.28" diff --git a/Cargo.toml b/Cargo.toml index 02671c6..695f7c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,6 +90,11 @@ lb-tools = { default-features = false, package = "logo lb-tui-zone = { default-features = false, package = "logos-blockchain-tui-zone", path = "./logos-blockchain/testnet/tui-zone" } lbp-error = { default-features = false, package = "logos-blockchain-proofs-error", path = "./logos-blockchain/zk/proofs/error" } lb_network = { default-features = false, package = "logos-blockchain-network-service", path = "./logos-blockchain/services/network" } +lbc-poc-sys = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-circuits.git", package = "logos-blockchain-circuits-poc-sys", tag = "v0.5.3" } +lbc-pol-sys = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-circuits.git", package = "logos-blockchain-circuits-pol-sys", tag = "v0.5.3" } +lbc-poq-sys = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-circuits.git", package = "logos-blockchain-circuits-poq-sys", tag = "v0.5.3" } +lbc-signature-sys = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-circuits.git", package = "logos-blockchain-circuits-signature-sys", tag = "v0.5.3" } +lbc-types = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-circuits.git", package = "logos-blockchain-circuits-types", tag = "v0.5.3" } testing-framework-core = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-testing.git", rev = "f731791" } testing-framework-runner-compose = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-testing.git", rev = "f731791" } testing-framework-runner-k8s = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-testing.git", rev = "f731791" } @@ -114,11 +119,11 @@ log = { default-features = false, version = "0.4" } overwatch = { default-features = false, git = "https://github.com/logos-co/Overwatch", rev = "448c192" } overwatch-derive = { default-features = false, git = "https://github.com/logos-co/Overwatch", rev = "448c192" } anyhow = { default-features = false, version = "1" } -ark-bn254 = { default-features = false, version = "0.4" } -ark-ec = { default-features = false, version = "0.4" } -ark-ff = { default-features = false, version = "0.4" } -ark-groth16 = { default-features = false, version = "0.4" } -ark-serialize = { default-features = false, version = "0.4.2" } +ark-bn254 = { default-features = false, version = "0.5" } +ark-ec = { default-features = false, version = "0.5" } +ark-ff = { default-features = false, version = "0.5" } +ark-groth16 = { default-features = false, version = "0.5" } +ark-serialize = { default-features = false, version = "0.5" } astro-float = { default-features = false, version = "0.9" } async-ctrlc = { default-features = false, version = "1.2" } async-stream = { default-features = false, version = "0.3.6" } @@ -146,7 +151,8 @@ humantime = { default-features = false, version = "2.1" hyper = { default-features = false, version = "1.0" } igd-next = { default-features = false, version = "0.16.1" } itertools = { default-features = false, version = "0.14" } -jf-poseidon2 = { default-features = false, git = "https://github.com/EspressoSystems/jellyfish.git", rev = "dc166cf0f803c3e5067f9dfcc21e3dade986a447" } +jf-poseidon2 = { default-features = false, git = "https://github.com/EspressoSystems/jellyfish.git", rev = "8d80230358e900f8d63765a937f63f4978ca1daa" } +rust-rapidsnark = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-rust-rapidsnark.git", rev = "e91187f8ccb5bbfc7bb00dac88169112428da78f" } libp2p-swarm-test = { default-features = false, version = "0.5" } multiaddr = { default-features = false, version = "0.18" } natpmp = { default-features = false, version = "0.5" } @@ -178,6 +184,7 @@ rs-merkle-tree = { default-features = false, version = "0.1" serde_arrays = { default-features = false, version = "0.2.0" } serde_path_to_error = { default-features = false, version = "0.1" } serde_yml = { default-features = false, version = "0.0.12" } +serde_urlencoded = { default-features = false, version = "0.7.1" } serial_test = { default-features = false, version = "3.1.1" } sntpc = { default-features = false, version = "0.5" } strum = { default-features = false, version = "0.27" } diff --git a/common/src/state.rs b/common/src/state.rs index b273b87..e902523 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -1,5 +1,5 @@ use lb_core::mantle::ops::channel::MsgId; -use lb_zone_sdk::state::InscriptionInfo; +use lb_zone_sdk::sequencer::InscriptionInfo; use crate::message::Msg; diff --git a/indexer/src/indexer.rs b/indexer/src/indexer.rs index 1150af5..e5eb49e 100644 --- a/indexer/src/indexer.rs +++ b/indexer/src/indexer.rs @@ -85,7 +85,7 @@ impl Indexer { let logos_blockchain_zone_sdk::ZoneMessage::Block(zone_block) = zone_msg else { continue; }; - let sql_text = match String::from_utf8(zone_block.data) { + let sql_text = match String::from_utf8(Vec::from(zone_block.data)) { Ok(s) => s, Err(e) => { error!("Zone block data is not valid UTF-8: {e}"); diff --git a/sequencer/src/sequencer.rs b/sequencer/src/sequencer.rs index 34532f5..5a93a62 100644 --- a/sequencer/src/sequencer.rs +++ b/sequencer/src/sequencer.rs @@ -10,11 +10,11 @@ use std::{ use demo_sqlite_common::state::{InMemoryZoneState, ZoneState as _}; use fs2::FileExt as _; use lb_common_http_client::{BasicAuthCredentials, CommonHttpClient}; -use lb_core::mantle::ops::channel::ChannelId; +use lb_core::mantle::ops::channel::{ChannelId, inscribe::Inscription}; use lb_key_management_system_service::keys::{ED25519_SECRET_KEY_SIZE, Ed25519Key}; use logos_blockchain_zone_sdk::{ adapter::NodeHttpClient, - sequencer::{Event, SequencerCheckpoint, SequencerHandle, ZoneSequencer}, + sequencer::{Event, FinalizedOp, OrphanedTx, SequencerCheckpoint, SequencerClient, ZoneSequencer}, }; use reqwest::Url; use thiserror::Error; @@ -26,13 +26,15 @@ pub enum SequencerError { Url(String), #[error("IO error: {0}")] Io(#[from] io::Error), + #[error("Inscription too large: {0}")] + InscriptionTooLarge(String), } pub type Result = std::result::Result; pub struct Sequencer { sequencer: ZoneSequencer, - handle: SequencerHandle, + client: SequencerClient, state: InMemoryZoneState, queue_file: String, checkpoint_path: String, @@ -103,11 +105,12 @@ impl Sequencer { .expect("failed to write channel id"); let node = NodeHttpClient::new(CommonHttpClient::new(basic_auth), node_url); - let (sequencer, handle) = ZoneSequencer::init(channel_id, signing_key, node, checkpoint); + let sequencer = ZoneSequencer::init(channel_id, signing_key, node, checkpoint); + let client = sequencer.client(); Ok(Self { sequencer, - handle, + client, state: InMemoryZoneState::default(), queue_file: queue_file.to_owned(), checkpoint_path: checkpoint_path.to_owned(), @@ -115,30 +118,33 @@ impl Sequencer { } pub async fn run(self) { - let Self { mut sequencer, handle, mut state, queue_file, checkpoint_path } = self; + let Self { mut sequencer, client, mut state, queue_file, checkpoint_path } = self; - let mut batch_handle = handle.clone(); + let batch_client = client; tokio::spawn(async move { + // Wait until the sequencer completes cold-start backfill before publishing. + let mut ready_rx = batch_client.subscribe_ready(); + let _ = ready_rx.wait_for(|r| *r).await; + let mut interval = tokio::time::interval(Duration::from_millis(100)); loop { interval.tick().await; - batch_handle.wait_ready().await; - if let Err(e) = process_pending_batch(&queue_file, &batch_handle).await { + if let Err(e) = process_pending_batch(&queue_file, &batch_client).await { error!("Batch processing failed: {e}"); } } }); loop { - let Some(event) = sequencer.next_event().await else { continue; }; - handle_event(event, &handle, &mut state, &checkpoint_path).await; + let event = sequencer.next_event().await; + handle_event(event, &mut sequencer, &mut state, &checkpoint_path); } } } -async fn handle_event( +fn handle_event( event: Event, - handle: &SequencerHandle, + sequencer: &mut ZoneSequencer, state: &mut InMemoryZoneState, checkpoint_path: &str, ) { @@ -146,34 +152,32 @@ async fn handle_event( Event::Ready => { info!("Sequencer ready"); } - Event::ChannelUpdate { orphaned, adopted } => { - state.on_adopted(&adopted); - for info in &orphaned { + Event::BlocksProcessed { checkpoint, channel_update, finalized } => { + state.on_adopted(&channel_update.adopted); + for orphan in &channel_update.orphaned { + let OrphanedTx::Inscription(info) = orphan else { continue }; state.on_orphaned(&info.this_msg); debug!(msg_id = %hex::encode(info.this_msg.as_ref()), "Auto-republishing orphan"); - if let Err(e) = handle.publish_message(info.payload.clone()).await { + if let Err(e) = sequencer.handle().publish(info.payload.clone()) { error!("failed to auto-republish: {e}"); } } - } - Event::TxsFinalized { inscriptions, .. } => { + let inscriptions: Vec<_> = finalized + .into_iter() + .flat_map(|tx| tx.ops.into_iter()) + .filter_map(|op| match op { + FinalizedOp::Inscription(info) => Some(info), + _ => None, + }) + .collect(); state.on_finalized(&inscriptions); - } - Event::Published { info, checkpoint } => { - debug!(msg_id = %hex::encode(info.this_msg.as_ref()), "Published"); - state.on_published(&info); save_checkpoint(Path::new(checkpoint_path), &checkpoint); } - Event::FinalizedInscriptions { inscriptions } => { - state.on_finalized(&inscriptions); - } + Event::MempoolPending(_) | Event::TurnNotification { .. } => {} } } -async fn process_pending_batch( - queue_file: &str, - handle: &SequencerHandle, -) -> Result<()> { +async fn process_pending_batch(queue_file: &str, client: &SequencerClient) -> Result<()> { let pending = queue_drain(queue_file)?; if pending.is_empty() { return Ok(()); @@ -182,8 +186,10 @@ async fn process_pending_batch( let count = pending.len(); debug!("Processing batch of {} queries", count); - let sql_text = pending.join("\n").as_bytes().to_vec(); - if let Err(e) = handle.publish_message(sql_text).await { + let sql_bytes = pending.join("\n").into_bytes(); + let inscription = Inscription::try_from(sql_bytes) + .map_err(|e| SequencerError::InscriptionTooLarge(e.to_string()))?; + if let Err(e) = client.publish(inscription).await { error!("failed to publish batch: {e}"); } else { info!("Submitted batch of {} statement(s)", count);