diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38161a0f..a8efedd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,7 +99,7 @@ jobs: run: rustup install - name: Install nextest - run: cargo install cargo-nextest + run: cargo install --locked cargo-nextest - name: Run tests env: diff --git a/Cargo.lock b/Cargo.lock index 4733c31d..b71a3f2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,7 +69,7 @@ dependencies = [ "actix-rt", "actix-service", "actix-utils", - "base64 0.22.1", + "base64", "bitflags 2.10.0", "bytes", "bytestring", @@ -77,7 +77,7 @@ dependencies = [ "encoding_rs", "foldhash", "futures-core", - "h2", + "h2 0.3.27", "http 0.2.12", "httparse", "httpdate", @@ -236,7 +236,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -367,16 +367,54 @@ version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +[[package]] +name = "archery" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e0a5f99dfebb87bb342d0f53bb92c81842e100bbb915223e38349580e5441d" +dependencies = [ + "triomphe", +] + +[[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", - "ark-ff", + "ark-ec 0.5.0", + "ark-ff 0.5.0", "ark-r1cs-std", - "ark-std", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-crypto-primitives" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-relations 0.4.0", + "ark-serialize 0.4.2", + "ark-snark 0.4.0", + "ark-std 0.4.0", + "blake2", + "derivative", + "digest", + "sha2", ] [[package]] @@ -387,12 +425,12 @@ checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" dependencies = [ "ahash 0.8.12", "ark-crypto-primitives-macros", - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-relations 0.5.1", + "ark-serialize 0.5.0", + "ark-snark 0.5.1", + "ark-std 0.5.0", "blake2", "derivative", "digest", @@ -412,6 +450,23 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +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", +] + [[package]] name = "ark-ec" version = "0.5.0" @@ -419,10 +474,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ "ahash 0.8.12", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", "educe", "fnv", "hashbrown 0.15.5", @@ -433,16 +488,36 @@ 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", - "ark-ff-macros", - "ark-serialize", - "ark-std", + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", "arrayvec", "digest", "educe", @@ -453,6 +528,16 @@ 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" @@ -463,6 +548,19 @@ dependencies = [ "syn 2.0.111", ] +[[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" @@ -476,19 +574,47 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "ark-groth16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +dependencies = [ + "ark-crypto-primitives 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-relations 0.4.0", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + [[package]] name = "ark-groth16" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", + "ark-crypto-primitives 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-relations 0.5.1", + "ark-serialize 0.5.0", + "ark-std 0.5.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", ] [[package]] @@ -498,9 +624,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" dependencies = [ "ahash 0.8.12", - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", "educe", "fnv", "hashbrown 0.15.5", @@ -512,10 +638,10 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-std", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-relations 0.5.1", + "ark-std 0.5.0", "educe", "num-bigint", "num-integer", @@ -523,31 +649,66 @@ dependencies = [ "tracing", ] +[[package]] +name = "ark-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff 0.4.2", + "ark-std 0.4.0", + "tracing", + "tracing-subscriber", +] + [[package]] name = "ark-relations" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" dependencies = [ - "ark-ff", - "ark-std", + "ark-ff 0.5.0", + "ark-std 0.5.0", "tracing", "tracing-subscriber", ] +[[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", - "ark-std", + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", "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" @@ -559,16 +720,38 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "ark-snark" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +dependencies = [ + "ark-ff 0.4.2", + "ark-relations 0.4.0", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + [[package]] name = "ark-snark" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", + "ark-ff 0.5.0", + "ark-relations 0.5.1", + "ark-serialize 0.5.0", + "ark-std 0.5.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", ] [[package]] @@ -587,6 +770,12 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + [[package]] name = "arrayvec" version = "0.7.6" @@ -615,6 +804,17 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -627,24 +827,89 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http 1.4.0", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower 0.5.2", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.4.0", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + [[package]] name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base256emoji" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e9430d9a245a77c92176e649af6e275f20839a48389859d1661e9a128d077c" +dependencies = [ + "const-str", + "match-lookup", +] + [[package]] name = "base58" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -657,6 +922,16 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e050f626429857a27ddccb31e0aca21356bfa709c04041aefddac081a8f068a" +[[package]] +name = "bedrock_client" +version = "0.1.0" +dependencies = [ + "anyhow", + "logos-blockchain-common-http-client", + "logos-blockchain-core", + "reqwest", +] + [[package]] name = "bincode" version = "1.3.3" @@ -750,7 +1025,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -761,9 +1036,9 @@ checksum = "21055e2f49cbbdbfe9f8f96d597c5527b0c6ab7933341fdc2f147180e48a988e" dependencies = [ "duplicate", "maybe-async", - "reqwest 0.12.26", + "reqwest", "serde", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -789,6 +1064,15 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + [[package]] name = "bumpalo" version = "3.19.1" @@ -878,7 +1162,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -893,13 +1177,19 @@ dependencies = [ "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cexpr" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom", + "nom 7.1.3", ] [[package]] @@ -914,6 +1204,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "cfg_eval" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "chacha20" version = "0.9.1" @@ -1006,7 +1307,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" dependencies = [ - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -1015,22 +1316,32 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "common" version = "0.1.0" dependencies = [ "anyhow", - "base64 0.22.1", + "base64", "borsh", "hex", "log", "nssa", "nssa_core", - "reqwest 0.11.27", + "reqwest", "serde", "serde_json", "sha2", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -1046,18 +1357,45 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "const-hex" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bb320cac8a0750d7f25280aa97b09c26edfe161164238ecbbb31092b079e735" +dependencies = [ + "cfg-if", + "cpufeatures", + "proptest", + "serde_core", +] + [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-str" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f421161cb492475f1661ddc9815a745a1c894592070661180fdec3d4872e9c3" + [[package]] name = "convert_case" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "convert_case" version = "0.10.0" @@ -1077,6 +1415,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1090,10 +1438,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "libc", ] +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -1118,13 +1475,19 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + [[package]] name = "crypto-bigint" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", "zeroize", @@ -1136,7 +1499,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", "typenum", ] @@ -1150,6 +1513,34 @@ dependencies = [ "cipher", ] +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "darling" version = "0.20.11" @@ -1220,6 +1611,45 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + +[[package]] +name = "data-encoding-macro" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47ce6c96ea0102f01122a185683611bd5ac8d99e62bc59dd12e6bda344ee673d" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d162beedaa69905488a8da94f5ac3edb4dd4788b732fadb7bd120b2625c1976" +dependencies = [ + "data-encoding", + "syn 2.0.111", +] + [[package]] name = "der" version = "0.7.10" @@ -1407,6 +1837,31 @@ dependencies = [ "spki", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "serde", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core 0.6.4", + "serde", + "sha2", + "subtle", + "zeroize", +] + [[package]] name = "educe" version = "0.6.0" @@ -1441,7 +1896,7 @@ dependencies = [ "crypto-bigint", "digest", "ff", - "generic-array", + "generic-array 0.14.7", "group", "pem-rfc7468", "pkcs8", @@ -1561,6 +2016,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "find-msvc-tools" version = "0.1.5" @@ -1630,6 +2091,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "forwarded-header-value" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" +dependencies = [ + "nonempty", + "thiserror 1.0.69", +] + [[package]] name = "futures" version = "0.3.31" @@ -1701,6 +2172,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +dependencies = [ + "gloo-timers", + "send_wrapper", +] + [[package]] name = "futures-util" version = "0.3.31" @@ -1730,6 +2211,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "generic-array" +version = "1.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf57c49a95fd1fe24b90b3033bee6dc7e8f1288d51494cb44e627c295e38542" +dependencies = [ + "rustversion", + "serde_core", + "typenum", +] + [[package]] name = "getrandom" version = "0.2.16" @@ -1773,6 +2265,72 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" +[[package]] +name = "gloo-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06f627b1a58ca3d42b45d6104bf1e1a03799df472df00988b6ba21accc10580" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "http 1.4.0", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror 1.0.69", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "gloo-utils" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "governor" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +dependencies = [ + "cfg-if", + "dashmap", + "futures", + "futures-timer", + "no-std-compat", + "nonzero_ext", + "parking_lot", + "portable-atomic", + "quanta", + "rand 0.8.5", + "smallvec", + "spinning_top", +] + [[package]] name = "group" version = "0.13.0" @@ -1803,12 +2361,46 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.4.0", + "indexmap 2.12.1", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.12", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + [[package]] name = "hashbrown" version = "0.15.5" @@ -1873,6 +2465,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e712f64ec3850b98572bffac52e2c6f282b29fe6c5fa6d42334b30be438d95c1" +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" version = "0.12.1" @@ -1909,17 +2510,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.1" @@ -1939,7 +2529,7 @@ dependencies = [ "bytes", "futures-core", "http 1.4.0", - "http-body 1.0.1", + "http-body", "pin-project-lite", ] @@ -1961,30 +2551,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" -[[package]] -name = "hyper" -version = "0.14.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.10", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.8.1" @@ -1995,9 +2561,11 @@ dependencies = [ "bytes", "futures-channel", "futures-core", + "h2 0.4.13", "http 1.4.0", - "http-body 1.0.1", + "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", "pin-utils", @@ -2013,8 +2581,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ "http 1.4.0", - "hyper 1.8.1", + "hyper", "hyper-util", + "log", "rustls", "rustls-pki-types", "tokio", @@ -2025,15 +2594,18 @@ dependencies = [ [[package]] name = "hyper-tls" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", - "hyper 0.14.32", + "http-body-util", + "hyper", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", ] [[package]] @@ -2042,22 +2614,24 @@ version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "futures-channel", "futures-core", "futures-util", "http 1.4.0", - "http-body 1.0.1", - "hyper 1.8.1", + "http-body", + "hyper", "ipnet", "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.1", + "socket2 0.5.10", + "system-configuration", "tokio", "tower-service", "tracing", + "windows-registry", ] [[package]] @@ -2198,6 +2772,45 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee796ad498c8d9a1d68e477df8f754ed784ef875de1414ebdaf169f70a6a784" +[[package]] +name = "indexer_service" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-trait", + "clap", + "env_logger", + "indexer_service_protocol", + "indexer_service_rpc", + "jsonrpsee", + "log", + "tokio", + "tokio-util", +] + +[[package]] +name = "indexer_service_protocol" +version = "0.1.0" +dependencies = [ + "base64", + "borsh", + "common", + "nssa", + "nssa_core", + "schemars 1.2.0", + "serde", +] + +[[package]] +name = "indexer_service_rpc" +version = "0.1.0" +dependencies = [ + "indexer_service_protocol", + "jsonrpsee", + "schemars 1.2.0", + "serde_json", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -2241,7 +2854,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -2250,7 +2863,7 @@ version = "0.1.0" dependencies = [ "actix-web", "anyhow", - "base64 0.22.1", + "base64", "borsh", "common", "env_logger", @@ -2300,6 +2913,15 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -2324,6 +2946,53 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +[[package]] +name = "jf-crhf" +version = "0.1.1" +source = "git+https://github.com/EspressoSystems/jellyfish?tag=jf-crhf-v0.1.1#8f3dce0bc2bd161b4648f6ac029dcc1a23aaf4c5" +dependencies = [ + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "jf-poseidon2" +version = "0.1.0" +source = "git+https://github.com/EspressoSystems/jellyfish.git?rev=dc166cf0f803c3e5067f9dfcc21e3dade986a447#dc166cf0f803c3e5067f9dfcc21e3dade986a447" +dependencies = [ + "ark-bn254 0.4.0", + "ark-ff 0.4.2", + "ark-std 0.4.0", + "displaydoc", + "hex", + "jf-crhf", + "lazy_static", + "nimue", + "zeroize", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "jobserver" version = "0.1.34" @@ -2344,6 +3013,178 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpsee" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3f48dc3e6b8bd21e15436c1ddd0bc22a6a54e8ec46fedd6adf3425f396ec6a" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-http-client", + "jsonrpsee-proc-macros", + "jsonrpsee-server", + "jsonrpsee-types", + "jsonrpsee-wasm-client", + "jsonrpsee-ws-client", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf36eb27f8e13fa93dcb50ccb44c417e25b818cfa1a481b5470cd07b19c60b98" +dependencies = [ + "base64", + "futures-channel", + "futures-util", + "gloo-net", + "http 1.4.0", + "jsonrpsee-core", + "pin-project", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "soketto", + "thiserror 2.0.17", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "316c96719901f05d1137f19ba598b5fe9c9bc39f4335f67f6be8613921946480" +dependencies = [ + "async-trait", + "bytes", + "futures-timer", + "futures-util", + "http 1.4.0", + "http-body", + "http-body-util", + "jsonrpsee-types", + "parking_lot", + "pin-project", + "rand 0.9.2", + "rustc-hash", + "serde", + "serde_json", + "thiserror 2.0.17", + "tokio", + "tokio-stream", + "tower 0.5.2", + "tracing", + "wasm-bindgen-futures", +] + +[[package]] +name = "jsonrpsee-http-client" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790bedefcec85321e007ff3af84b4e417540d5c87b3c9779b9e247d1bcc3dab8" +dependencies = [ + "base64", + "http-body", + "hyper", + "hyper-rustls", + "hyper-util", + "jsonrpsee-core", + "jsonrpsee-types", + "rustls", + "rustls-platform-verifier", + "serde", + "serde_json", + "thiserror 2.0.17", + "tokio", + "tower 0.5.2", + "url", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da3f8ab5ce1bb124b6d082e62dffe997578ceaf0aeb9f3174a214589dc00f07" +dependencies = [ + "heck", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "jsonrpsee-server" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c51b7c290bb68ce3af2d029648148403863b982f138484a73f02a9dd52dbd7f" +dependencies = [ + "futures-util", + "http 1.4.0", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "route-recognizer", + "serde", + "serde_json", + "soketto", + "thiserror 2.0.17", + "tokio", + "tokio-stream", + "tokio-util", + "tower 0.5.2", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc88ff4688e43cc3fa9883a8a95c6fa27aa2e76c96e610b737b6554d650d7fd5" +dependencies = [ + "http 1.4.0", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "jsonrpsee-wasm-client" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7902885de4779f711a95d82c8da2d7e5f9f3a7c7cfa44d51c067fd1c29d72a3c" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", + "tower 0.5.2", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b6fceceeb05301cc4c065ab3bd2fa990d41ff4eb44e4ca1b30fa99c057c3e79" +dependencies = [ + "http 1.4.0", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", + "tower 0.5.2", + "url", +] + [[package]] name = "k256" version = "0.13.4" @@ -2386,7 +3227,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -2449,6 +3290,20 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" +[[package]] +name = "libp2p-identity" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c7892c221730ba55f7196e98b0b8ba5e04b4155651736036628e9f73ed6fc3" +dependencies = [ + "bs58", + "hkdf", + "multihash", + "sha2", + "thiserror 2.0.17", + "tracing", +] + [[package]] name = "libredox" version = "0.1.11" @@ -2483,6 +3338,18 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "light-poseidon" +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", + "num-bigint", + "thiserror 1.0.69", +] + [[package]] name = "linux-raw-sys" version = "0.11.0" @@ -2527,6 +3394,483 @@ version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +[[package]] +name = "logos-blockchain-blend-crypto" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "blake2", + "logos-blockchain-groth16", + "logos-blockchain-poq", + "logos-blockchain-poseidon2", + "logos-blockchain-utils", + "rs-merkle-tree", + "thiserror 1.0.69", +] + +[[package]] +name = "logos-blockchain-blend-message" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "blake2", + "derivative", + "itertools 0.14.0", + "logos-blockchain-blend-crypto", + "logos-blockchain-blend-proofs", + "logos-blockchain-core", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-utils", + "serde", + "serde-big-array", + "serde_with", + "thiserror 1.0.69", + "tracing", + "zeroize", +] + +[[package]] +name = "logos-blockchain-blend-proofs" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "ed25519-dalek", + "generic-array 1.3.5", + "logos-blockchain-blend-crypto", + "logos-blockchain-groth16", + "logos-blockchain-poq", + "num-bigint", + "serde", + "thiserror 1.0.69", +] + +[[package]] +name = "logos-blockchain-chain-broadcast-service" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "async-trait", + "derivative", + "futures", + "logos-blockchain-core", + "overwatch", + "serde", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-chain-service" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "async-trait", + "bytes", + "futures", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-cryptarchia-sync", + "logos-blockchain-groth16", + "logos-blockchain-ledger", + "logos-blockchain-network-service", + "logos-blockchain-services-utils", + "logos-blockchain-storage-service", + "logos-blockchain-time-service", + "logos-blockchain-utils", + "num-bigint", + "overwatch", + "serde", + "serde_with", + "strum", + "thiserror 1.0.69", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "logos-blockchain-circuits-prover" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "logos-blockchain-circuits-utils", + "tempfile", +] + +[[package]] +name = "logos-blockchain-circuits-utils" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "dirs", +] + +[[package]] +name = "logos-blockchain-common-http-client" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "futures", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-chain-service", + "logos-blockchain-core", + "logos-blockchain-http-api-common", + "reqwest", + "serde", + "serde_json", + "thiserror 1.0.69", + "url", +] + +[[package]] +name = "logos-blockchain-core" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "ark-ff 0.4.2", + "bincode", + "blake2", + "bytes", + "const-hex", + "futures", + "generic-array 1.3.5", + "hex", + "logos-blockchain-blend-proofs", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-pol", + "logos-blockchain-poseidon2", + "logos-blockchain-utils", + "multiaddr", + "nom 8.0.0", + "num-bigint", + "serde", + "strum", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "logos-blockchain-cryptarchia-engine" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "cfg_eval", + "logos-blockchain-utils", + "serde", + "serde_with", + "thiserror 1.0.69", + "time", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-cryptarchia-sync" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "bytes", + "futures", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "rand 0.8.5", + "serde", + "serde_with", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-groth16" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "ark-bn254 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-groth16 0.4.0", + "ark-serialize 0.4.2", + "generic-array 1.3.5", + "hex", + "num-bigint", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "logos-blockchain-http-api-common" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "axum", + "governor", + "logos-blockchain-core", + "logos-blockchain-key-management-system-keys", + "serde", + "serde_json", + "serde_with", + "tower_governor", +] + +[[package]] +name = "logos-blockchain-key-management-system-keys" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "async-trait", + "bytes", + "ed25519-dalek", + "generic-array 1.3.5", + "logos-blockchain-blend-proofs", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-macros", + "logos-blockchain-poseidon2", + "logos-blockchain-utils", + "logos-blockchain-zksign", + "num-bigint", + "rand_core 0.6.4", + "serde", + "subtle", + "thiserror 2.0.17", + "tokio", + "tracing", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "logos-blockchain-key-management-system-macros" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "logos-blockchain-key-management-system-service" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "async-trait", + "log", + "logos-blockchain-key-management-system-keys", + "overwatch", + "serde", + "thiserror 2.0.17", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-ledger" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "derivative", + "logos-blockchain-blend-crypto", + "logos-blockchain-blend-message", + "logos-blockchain-blend-proofs", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-mmr", + "logos-blockchain-utils", + "logos-blockchain-utxotree", + "num-bigint", + "rand 0.8.5", + "rpds", + "serde", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "logos-blockchain-mmr" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "ark-ff 0.4.2", + "logos-blockchain-groth16", + "logos-blockchain-poseidon2", + "rpds", + "serde", +] + +[[package]] +name = "logos-blockchain-network-service" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "async-trait", + "futures", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-sync", + "overwatch", + "serde", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-pol" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "logos-blockchain-circuits-prover", + "logos-blockchain-circuits-utils", + "logos-blockchain-groth16", + "logos-blockchain-witness-generator", + "num-bigint", + "num-traits", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "logos-blockchain-poq" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "logos-blockchain-circuits-prover", + "logos-blockchain-circuits-utils", + "logos-blockchain-groth16", + "logos-blockchain-pol", + "logos-blockchain-witness-generator", + "num-bigint", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "logos-blockchain-poseidon2" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "ark-bn254 0.4.0", + "ark-ff 0.4.2", + "jf-poseidon2", + "num-bigint", +] + +[[package]] +name = "logos-blockchain-services-utils" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "async-trait", + "futures", + "log", + "overwatch", + "serde", + "serde_json", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "logos-blockchain-storage-service" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "async-trait", + "bytes", + "futures", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "overwatch", + "serde", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-time-service" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "async-trait", + "futures", + "log", + "logos-blockchain-cryptarchia-engine", + "overwatch", + "sntpc", + "thiserror 2.0.17", + "time", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-utils" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "async-trait", + "blake2", + "cipher", + "const-hex", + "humantime", + "overwatch", + "rand 0.8.5", + "serde", + "serde_with", + "time", +] + +[[package]] +name = "logos-blockchain-utxotree" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "ark-ff 0.4.2", + "logos-blockchain-core", + "logos-blockchain-groth16", + "logos-blockchain-poseidon2", + "num-bigint", + "rpds", + "serde", + "thiserror 1.0.69", +] + +[[package]] +name = "logos-blockchain-witness-generator" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "tempfile", +] + +[[package]] +name = "logos-blockchain-zksign" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#451df112f8574aea2840d04fffb7e16e76d24f42" +dependencies = [ + "logos-blockchain-circuits-prover", + "logos-blockchain-circuits-utils", + "logos-blockchain-groth16", + "logos-blockchain-poseidon2", + "logos-blockchain-witness-generator", + "num-bigint", + "serde", + "serde_json", + "thiserror 2.0.17", +] + [[package]] name = "lru-slab" version = "0.1.2" @@ -2542,6 +3886,23 @@ dependencies = [ "libc", ] +[[package]] +name = "match-lookup" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1265724d8cb29dbbc2b0f06fffb8bf1a8c0cf73a78eede9ba73a4a66c52a981e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "maybe-async" version = "0.2.10" @@ -2617,6 +3978,46 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "multiaddr" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6351f60b488e04c1d21bc69e56b89cb3f5e8f5d22557d6e8031bdfd79b6961" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "libp2p-identity", + "multibase", + "multihash", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint", +] + +[[package]] +name = "multibase" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8694bb4835f452b0e3bb06dbebb1d6fc5385b6ca1caf2e55fd165c042390ec77" +dependencies = [ + "base-x", + "base256emoji", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b430e7953c29dd6a09afc29ff0bb69c6e306329ee6794700aee27b76a1aea8d" +dependencies = [ + "core2", + "unsigned-varint", +] + [[package]] name = "native-tls" version = "0.2.14" @@ -2626,14 +4027,38 @@ dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.1.6", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] +[[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 = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "no_std_strings" version = "0.1.3" @@ -2650,6 +4075,27 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + +[[package]] +name = "nonempty" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" + +[[package]] +name = "nonzero_ext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" + [[package]] name = "nssa" version = "0.1.0" @@ -2670,7 +4116,7 @@ dependencies = [ "sha2", "test-case", "test_program_methods", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -2686,7 +4132,7 @@ dependencies = [ "risc0-zkvm", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -2831,6 +4277,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + [[package]] name = "openssl-sys" version = "0.9.111" @@ -2860,6 +4312,33 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "overwatch" +version = "0.1.0" +source = "git+https://github.com/logos-co/Overwatch?rev=f5a9902#f5a99022f389d65adbd55e51f1e3f9eead62432a" +dependencies = [ + "async-trait", + "futures", + "overwatch-derive", + "thiserror 2.0.17", + "tokio", + "tokio-stream", + "tokio-util", + "tracing", +] + +[[package]] +name = "overwatch-derive" +version = "0.1.0" +source = "git+https://github.com/logos-co/Overwatch?rev=f5a9902#f5a99022f389d65adbd55e51f1e3f9eead62432a" +dependencies = [ + "convert_case 0.8.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "parking_lot" version = "0.12.5" @@ -2904,6 +4383,26 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -3006,6 +4505,28 @@ dependencies = [ "toml_edit 0.23.10+spec-1.0.0", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "proc-macro2" version = "1.0.103" @@ -3091,6 +4612,21 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "quanta" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi", + "web-sys", + "winapi", +] + [[package]] name = "quinn" version = "0.11.9" @@ -3105,7 +4641,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2 0.6.1", - "thiserror", + "thiserror 2.0.17", "tokio", "tracing", "web-time", @@ -3126,7 +4662,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.17", "tinyvec", "tracing", "web-time", @@ -3141,7 +4677,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.1", + "socket2 0.5.10", "tracing", "windows-sys 0.60.2", ] @@ -3229,6 +4765,15 @@ dependencies = [ "rand_core 0.9.3", ] +[[package]] +name = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags 2.10.0", +] + [[package]] name = "redox_syscall" version = "0.5.18" @@ -3246,7 +4791,7 @@ checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ "getrandom 0.2.16", "libredox", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -3304,65 +4849,30 @@ version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - [[package]] name = "reqwest" version = "0.12.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" dependencies = [ - "base64 0.22.1", + "base64", "bytes", + "encoding_rs", "futures-channel", "futures-core", "futures-util", + "h2 0.4.13", "http 1.4.0", - "http-body 1.0.1", + "http-body", "http-body-util", - "hyper 1.8.1", + "hyper", "hyper-rustls", + "hyper-tls", "hyper-util", "js-sys", "log", + "mime", + "native-tls", "percent-encoding", "pin-project-lite", "quinn", @@ -3371,11 +4881,12 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.2", + "sync_wrapper", "tokio", + "tokio-native-tls", "tokio-rustls", "tokio-util", - "tower", + "tower 0.5.2", "tower-http", "tower-service", "url", @@ -3522,11 +5033,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73ff13f9b427254c5264e01aaa32e33f355525299b6829449295905778f3b1e8" dependencies = [ "anyhow", - "ark-bn254", - "ark-ec", - "ark-ff", - "ark-groth16", - "ark-serialize", + "ark-bn254 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-groth16 0.5.0", + "ark-serialize 0.5.0", "bytemuck", "hex", "num-bigint", @@ -3634,6 +5145,22 @@ dependencies = [ "librocksdb-sys", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + +[[package]] +name = "rpds" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e75f485e819d4d3015e6c0d55d02a4fd3db47c1993d9e603e0361fba2bffb34" +dependencies = [ + "archery", + "serde", +] + [[package]] name = "rrs-lib" version = "0.1.0" @@ -3644,6 +5171,25 @@ dependencies = [ "paste", ] +[[package]] +name = "rs-merkle-tree" +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", + "byteorder", + "futures", + "light-poseidon", + "quote", + "rand 0.9.2", + "syn 1.0.109", + "thiserror 2.0.17", + "tiny-keccak", + "tokio", +] + [[package]] name = "rsa" version = "0.9.9" @@ -3720,6 +5266,7 @@ version = "0.23.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", @@ -3729,12 +5276,15 @@ dependencies = [ ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "rustls-native-certs" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" dependencies = [ - "base64 0.21.7", + "openssl-probe 0.2.1", + "rustls-pki-types", + "schannel", + "security-framework 3.5.1", ] [[package]] @@ -3747,6 +5297,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19787cda76408ec5404443dc8b31795c87cd8fec49762dc75fa727740d34acc1" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework 3.5.1", + "security-framework-sys", + "webpki-root-certs 0.26.11", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.103.8" @@ -3784,11 +5361,20 @@ dependencies = [ "sha2", "strum", "tempfile", - "thiserror", + "thiserror 2.0.17", "toml", "yaml-rust2", ] +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.28" @@ -3812,16 +5398,29 @@ dependencies = [ [[package]] name = "schemars" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" +checksum = "54e910108742c57a770f492731f99be216a52fadd361b06c8fb59d74ccc267d2" dependencies = [ "dyn-clone", "ref-cast", + "schemars_derive", "serde", "serde_json", ] +[[package]] +name = "schemars_derive" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4908ad288c5035a8eb12cfdf0d49270def0a268ee162b75eeee0f85d155a7c45" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.111", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -3836,7 +5435,7 @@ checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", - "generic-array", + "generic-array 0.14.7", "pkcs8", "serdect", "subtle", @@ -3870,7 +5469,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.10.0", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +dependencies = [ + "bitflags 2.10.0", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -3896,19 +5508,31 @@ dependencies = [ "serde_core", ] +[[package]] +name = "send_wrapper" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" + [[package]] name = "sequencer_core" version = "0.1.0" dependencies = [ "anyhow", "base58", + "bedrock_client", + "borsh", "chrono", "common", "futures", "log", + "logos-blockchain-core", + "logos-blockchain-key-management-system-service", "mempool", "nssa", "nssa_core", + "rand 0.8.5", + "reqwest", "serde", "serde_json", "storage", @@ -3924,7 +5548,7 @@ dependencies = [ "actix-web", "anyhow", "base58", - "base64 0.22.1", + "base64", "borsh", "common", "futures", @@ -3966,6 +5590,15 @@ 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_core" version = "1.0.228" @@ -3986,6 +5619,17 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "serde_json" version = "1.0.145" @@ -3999,6 +5643,17 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + [[package]] name = "serde_spanned" version = "0.6.9" @@ -4026,13 +5681,13 @@ version = "3.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fa237f2807440d238e0364a218270b98f767a00d3dada77b1c53ae88940e2e7" dependencies = [ - "base64 0.22.1", + "base64", "chrono", "hex", "indexmap 1.9.3", "indexmap 2.12.1", "schemars 0.9.0", - "schemars 1.1.0", + "schemars 1.2.0", "serde_core", "serde_json", "serde_with_macros", @@ -4120,6 +5775,16 @@ version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +[[package]] +name = "sntpc" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78f778a0f82b3cf5d75f858eceee38e84d5292f1d03415e88cc4ec45ca6ba8a2" +dependencies = [ + "cfg-if", + "tokio", +] + [[package]] name = "socket2" version = "0.4.10" @@ -4150,12 +5815,37 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "soketto" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e859df029d160cb88608f5d7df7fb4753fd20fdfb4de5644f3d8b8440841721" +dependencies = [ + "base64", + "bytes", + "futures", + "http 1.4.0", + "httparse", + "log", + "rand 0.8.5", + "sha1", +] + [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spinning_top" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" +dependencies = [ + "lock_api", +] + [[package]] name = "spki" version = "0.7.3" @@ -4182,6 +5872,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "storage" version = "0.1.0" @@ -4189,7 +5885,7 @@ dependencies = [ "borsh", "common", "rocksdb", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -4247,12 +5943,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.2" @@ -4280,7 +5970,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -4364,13 +6054,33 @@ dependencies = [ "risc0-zkvm", ] +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + [[package]] name = "thiserror" version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.17", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", ] [[package]] @@ -4415,6 +6125,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinystr" version = "0.8.2" @@ -4489,13 +6208,26 @@ dependencies = [ ] [[package]] -name = "tokio-util" -version = "0.7.17" +name = "tokio-stream" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -4572,6 +6304,17 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower" version = "0.5.2" @@ -4581,10 +6324,11 @@ dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 1.0.2", + "sync_wrapper", "tokio", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -4597,10 +6341,10 @@ dependencies = [ "bytes", "futures-util", "http 1.4.0", - "http-body 1.0.1", + "http-body", "iri-string", "pin-project-lite", - "tower", + "tower 0.5.2", "tower-layer", "tower-service", ] @@ -4617,6 +6361,22 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" +[[package]] +name = "tower_governor" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3790eac6ad3fb8d9d96c2b040ae06e2517aa24b067545d1078b96ae72f7bb9a7" +dependencies = [ + "axum", + "forwarded-header-value", + "governor", + "http 1.4.0", + "pin-project", + "thiserror 1.0.69", + "tower 0.4.13", + "tracing", +] + [[package]] name = "tracing" version = "0.1.43" @@ -4650,6 +6410,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-subscriber" version = "0.2.25" @@ -4659,6 +6429,12 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "triomphe" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd69c5aa8f924c7519d6372789a74eac5b94fb0f8fcf0d4a97eb0bfc3e785f39" + [[package]] name = "try-lock" version = "0.2.5" @@ -4726,6 +6502,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsigned-varint" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" + [[package]] name = "untrusted" version = "0.9.0" @@ -4774,6 +6556,16 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wallet" version = "0.1.0" @@ -4781,7 +6573,7 @@ dependencies = [ "anyhow", "async-stream", "base58", - "base64 0.22.1", + "base64", "borsh", "bytemuck", "clap", @@ -4919,6 +6711,24 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-root-certs" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e" +dependencies = [ + "webpki-root-certs 1.0.5", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36a29fc0408b113f68cf32637857ab740edfafdf460c326cd2afaa2d84cc05dc" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "1.0.4" @@ -5000,6 +6810,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + [[package]] name = "windows-result" version = "0.4.1" @@ -5020,11 +6841,11 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.42.2", ] [[package]] @@ -5056,17 +6877,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -5104,9 +6925,9 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" @@ -5122,9 +6943,9 @@ checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" @@ -5140,9 +6961,9 @@ checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" @@ -5170,9 +6991,9 @@ checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" @@ -5188,9 +7009,9 @@ checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" @@ -5206,9 +7027,9 @@ checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" @@ -5224,9 +7045,9 @@ checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" @@ -5249,16 +7070,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "wit-bindgen" version = "0.46.0" @@ -5271,6 +7082,18 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" +[[package]] +name = "x25519-dalek" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +dependencies = [ + "curve25519-dalek", + "rand_core 0.6.4", + "serde", + "zeroize", +] + [[package]] name = "yaml-rust2" version = "0.10.4" diff --git a/Cargo.toml b/Cargo.toml index ef1b881d..3b1c9f12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,16 +2,19 @@ resolver = "3" members = [ "integration_tests", - "sequencer_runner", "storage", "key_protocol", - "sequencer_rpc", "mempool", "wallet", - "sequencer_core", "common", "nssa", "nssa/core", + "sequencer_core", + "sequencer_rpc", + "sequencer_runner", + "indexer_service", + "indexer_service/protocol", + "indexer_service/rpc", "program_methods", "program_methods/guest", "test_program_methods", @@ -19,6 +22,7 @@ members = [ "examples/program_deployment", "examples/program_deployment/methods", "examples/program_deployment/methods/guest", + "bedrock_client", ] [workspace.dependencies] @@ -31,8 +35,12 @@ key_protocol = { path = "key_protocol" } sequencer_core = { path = "sequencer_core" } sequencer_rpc = { path = "sequencer_rpc" } sequencer_runner = { path = "sequencer_runner" } +indexer_service = { path = "indexer_service" } +indexer_service_protocol = { path = "indexer_service/protocol" } +indexer_service_rpc = { path = "indexer_service/rpc" } wallet = { path = "wallet" } test_program_methods = { path = "test_program_methods" } +bedrock_client = { path = "bedrock_client" } tokio = { version = "1.28.2", features = [ "net", @@ -40,6 +48,7 @@ tokio = { version = "1.28.2", features = [ "sync", "fs", ] } +tokio-util = "0.7.18" risc0-zkvm = { version = "3.0.3", features = ['std'] } risc0-build = "3.0.3" anyhow = "1.0.98" @@ -50,6 +59,7 @@ serde = { version = "1.0.60", default-features = false, features = ["derive"] } serde_json = "1.0.81" actix = "0.13.0" actix-cors = "0.6.1" +jsonrpsee = "0.26.0" futures = "0.3" actix-rt = "*" lazy_static = "1.5.0" @@ -75,6 +85,12 @@ chrono = "0.4.41" borsh = "1.5.7" base58 = "0.2.0" itertools = "0.14.0" +url = "2.5.4" +schemars = "1.2.0" + +logos-blockchain-common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git" } +logos-blockchain-key-management-system-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git" } +logos-blockchain-core = { git = "https://github.com/logos-blockchain/logos-blockchain.git" } rocksdb = { version = "0.24.0", default-features = false, features = [ "snappy", @@ -93,4 +109,4 @@ actix-web = { version = "=4.1.0", default-features = false, features = [ "macros", ] } clap = { version = "4.5.42", features = ["derive", "env"] } -reqwest = { version = "0.11.16", features = ["json"] } +reqwest = { version = "0.12", features = ["json", "rustls-tls", "stream"] } diff --git a/bedrock_client/Cargo.toml b/bedrock_client/Cargo.toml new file mode 100644 index 00000000..50a54815 --- /dev/null +++ b/bedrock_client/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "bedrock_client" +version = "0.1.0" +edition = "2024" + +[dependencies] +reqwest.workspace = true +anyhow.workspace = true +logos-blockchain-common-http-client.workspace = true +logos-blockchain-core.workspace = true diff --git a/bedrock_client/src/lib.rs b/bedrock_client/src/lib.rs new file mode 100644 index 00000000..530fdfc2 --- /dev/null +++ b/bedrock_client/src/lib.rs @@ -0,0 +1,32 @@ +use anyhow::Result; +pub use logos_blockchain_common_http_client::{BasicAuthCredentials, CommonHttpClient, Error}; +use logos_blockchain_core::mantle::SignedMantleTx; +use reqwest::{Client, Url}; + +// Simple wrapper +// maybe extend in the future for our purposes +pub struct BedrockClient { + http_client: CommonHttpClient, + node_url: Url, +} + +impl BedrockClient { + pub fn new(auth: Option, node_url: Url) -> Result { + let client = Client::builder() + //Add more fields if needed + .timeout(std::time::Duration::from_secs(60)) + .build()?; + + let http_client = CommonHttpClient::new_with_client(client, auth); + Ok(Self { + http_client, + node_url, + }) + } + + pub async fn post_transaction(&self, tx: SignedMantleTx) -> Result<(), Error> { + self.http_client + .post_transaction(self.node_url.clone(), tx) + .await + } +} diff --git a/ci_scripts/deploy.sh b/ci_scripts/deploy.sh index 7615df03..e84cac72 100644 --- a/ci_scripts/deploy.sh +++ b/ci_scripts/deploy.sh @@ -52,7 +52,7 @@ if [ -d ".git" ]; then git reset --hard origin/main else echo "Cloning repository..." - git clone https://github.com/vacp2p/nescience-testnet.git . + git clone https://github.com/logos-blockchain/lssa.git . git checkout main fi diff --git a/common/src/block.rs b/common/src/block.rs index baba1e42..84b7a419 100644 --- a/common/src/block.rs +++ b/common/src/block.rs @@ -23,7 +23,7 @@ pub type BlockHash = [u8; 32]; pub type BlockId = u64; pub type TimeStamp = u64; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] pub struct BlockHeader { pub block_id: BlockId, pub prev_block_hash: BlockHash, @@ -32,18 +32,26 @@ pub struct BlockHeader { pub signature: nssa::Signature, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] pub struct BlockBody { pub transactions: Vec, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] +pub enum BedrockStatus { + Pending, + Safe, + Finalized, +} + +#[derive(Debug, BorshSerialize, BorshDeserialize)] pub struct Block { pub header: BlockHeader, pub body: BlockBody, + pub bedrock_status: BedrockStatus, } -#[derive(Debug, PartialEq, Eq, BorshSerialize, BorshDeserialize)] +#[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] pub struct HashableBlockData { pub block_id: BlockId, pub prev_block_hash: BlockHash, @@ -52,7 +60,7 @@ pub struct HashableBlockData { } impl HashableBlockData { - pub fn into_block(self, signing_key: &nssa::PrivateKey) -> Block { + pub fn into_pending_block(self, signing_key: &nssa::PrivateKey) -> Block { let data_bytes = borsh::to_vec(&self).unwrap(); let signature = nssa::Signature::new(signing_key, &data_bytes); let hash = OwnHasher::hash(&data_bytes); @@ -67,6 +75,7 @@ impl HashableBlockData { body: BlockBody { transactions: self.transactions, }, + bedrock_status: BedrockStatus::Pending, } } } diff --git a/common/src/test_utils.rs b/common/src/test_utils.rs index 7e3c0ba8..1125b86e 100644 --- a/common/src/test_utils.rs +++ b/common/src/test_utils.rs @@ -30,7 +30,7 @@ pub fn produce_dummy_block( transactions, }; - block_data.into_block(&sequencer_sign_key_for_testing()) + block_data.into_pending_block(&sequencer_sign_key_for_testing()) } pub fn produce_dummy_empty_transaction() -> EncodedTransaction { diff --git a/indexer_service/Cargo.toml b/indexer_service/Cargo.toml new file mode 100644 index 00000000..d3f31de8 --- /dev/null +++ b/indexer_service/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "indexer_service" +version = "0.1.0" +edition = "2024" + +[dependencies] +indexer_service_protocol.workspace = true +indexer_service_rpc = { workspace = true, features = ["server"] } + +clap = { workspace = true, features = ["derive"] } +anyhow.workspace = true +tokio.workspace = true +tokio-util.workspace = true +env_logger.workspace = true +log.workspace = true +jsonrpsee.workspace = true +async-trait = "0.1.89" diff --git a/indexer_service/Dockerfile b/indexer_service/Dockerfile new file mode 100644 index 00000000..b283e2ec --- /dev/null +++ b/indexer_service/Dockerfile @@ -0,0 +1,64 @@ +# Chef stage - uses pre-built cargo-chef image +FROM lukemathwalker/cargo-chef:latest-rust-1.91.1-slim-trixie AS chef + +# Install build dependencies +RUN apt-get update && apt-get install -y \ + pkg-config \ + libssl-dev \ + libclang-dev \ + clang \ + curl \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /indexer_service + +# Planner stage - generates dependency recipe +FROM chef AS planner +COPY . . +RUN cargo chef prepare --bin indexer_service --recipe-path recipe.json + +# Builder stage - builds dependencies and application +FROM chef AS builder +COPY --from=planner /indexer_service/recipe.json recipe.json +# Build dependencies only (this layer will be cached) +RUN cargo chef cook --bin indexer_service --release --recipe-path recipe.json + +# Copy source code +COPY . . + +# Build the actual application +RUN cargo build --release --bin indexer_service + +# Strip debug symbols to reduce binary size +RUN strip /indexer_service/target/release/indexer_service + +# Runtime stage - minimal image +FROM debian:trixie-slim + +# Create non-root user for security +RUN useradd -m -u 1000 -s /bin/bash indexer_service_user + +# Copy binary from builder +COPY --from=builder --chown=indexer_service_user:indexer_service_user /indexer_service/target/release/indexer_service /usr/local/bin/indexer_service + +# Expose default port +EXPOSE 8779 + +# Health check +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD curl http://localhost:8779 \ + -H "Content-Type: application/json" \ + -d "{ \ + \"jsonrpc\": \"2.0\", \ + \"method\": \"get_schema\", \ + \"params\": {}, \ + \"id\": 1 \ + }" || exit 1 + +# Run the application +ENV RUST_LOG=info + +USER indexer_service_user + +WORKDIR /indexer_service +CMD ["indexer_service"] diff --git a/indexer_service/docker-compose.yml b/indexer_service/docker-compose.yml new file mode 100644 index 00000000..81e68cfa --- /dev/null +++ b/indexer_service/docker-compose.yml @@ -0,0 +1,9 @@ +services: + indexer_service: + image: lssa/indexer_service + build: + context: .. + dockerfile: indexer_service/Dockerfile + container_name: indexer_service + ports: + - "8779:8779" diff --git a/indexer_service/protocol/Cargo.toml b/indexer_service/protocol/Cargo.toml new file mode 100644 index 00000000..08add00e --- /dev/null +++ b/indexer_service/protocol/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "indexer_service_protocol" +version = "0.1.0" +edition = "2024" + +[dependencies] +nssa_core = { workspace = true, optional = true, features = ["host"] } +nssa = { workspace = true, optional = true } +common = { workspace = true, optional = true } + +serde = { workspace = true, features = ["derive"] } +schemars.workspace = true +base64.workspace = true +borsh = { workspace = true, optional = true } + +[features] +# Enable conversion to/from NSSA core types +convert = ["dep:nssa_core", "dep:nssa", "dep:common", "dep:borsh"] diff --git a/indexer_service/protocol/src/convert.rs b/indexer_service/protocol/src/convert.rs new file mode 100644 index 00000000..46c8811d --- /dev/null +++ b/indexer_service/protocol/src/convert.rs @@ -0,0 +1,648 @@ +//! Conversions between indexer_service_protocol types and nssa/nssa_core types + +use crate::*; + +// ============================================================================ +// Account-related conversions +// ============================================================================ + +impl From for AccountId { + fn from(value: nssa_core::account::AccountId) -> Self { + Self { + value: value.into_value(), + } + } +} + +impl From for nssa_core::account::AccountId { + fn from(value: AccountId) -> Self { + let AccountId { value } = value; + nssa_core::account::AccountId::new(value) + } +} + +impl From for Account { + fn from(value: nssa_core::account::Account) -> Self { + let nssa_core::account::Account { + program_owner, + balance, + data, + nonce, + } = value; + + Self { + program_owner, + balance, + data: data.into(), + nonce, + } + } +} + +impl TryFrom for nssa_core::account::Account { + type Error = nssa_core::account::data::DataTooBigError; + + fn try_from(value: Account) -> Result { + let Account { + program_owner, + balance, + data, + nonce, + } = value; + + Ok(nssa_core::account::Account { + program_owner, + balance, + data: data.try_into()?, + nonce, + }) + } +} + +impl From for Data { + fn from(value: nssa_core::account::Data) -> Self { + Self(value.into_inner()) + } +} + +impl TryFrom for nssa_core::account::Data { + type Error = nssa_core::account::data::DataTooBigError; + + fn try_from(value: Data) -> Result { + nssa_core::account::Data::try_from(value.0) + } +} + +// ============================================================================ +// Commitment and Nullifier conversions +// ============================================================================ + +impl From for Commitment { + fn from(value: nssa_core::Commitment) -> Self { + Self(value.to_byte_array()) + } +} + +impl From for nssa_core::Commitment { + fn from(value: Commitment) -> Self { + nssa_core::Commitment::from_byte_array(value.0) + } +} + +impl From for Nullifier { + fn from(value: nssa_core::Nullifier) -> Self { + Self(value.to_byte_array()) + } +} + +impl From for nssa_core::Nullifier { + fn from(value: Nullifier) -> Self { + nssa_core::Nullifier::from_byte_array(value.0) + } +} + +impl From for CommitmentSetDigest { + fn from(value: nssa_core::CommitmentSetDigest) -> Self { + Self(value) + } +} + +impl From for nssa_core::CommitmentSetDigest { + fn from(value: CommitmentSetDigest) -> Self { + value.0 + } +} + +// ============================================================================ +// Encryption-related conversions +// ============================================================================ + +impl From for Ciphertext { + fn from(value: nssa_core::encryption::Ciphertext) -> Self { + Self(value.into_inner()) + } +} + +impl From for nssa_core::encryption::Ciphertext { + fn from(value: Ciphertext) -> Self { + nssa_core::encryption::Ciphertext::from_inner(value.0) + } +} + +impl From for EphemeralPublicKey { + fn from(value: nssa_core::encryption::EphemeralPublicKey) -> Self { + Self(value.0) + } +} + +impl From for nssa_core::encryption::EphemeralPublicKey { + fn from(value: EphemeralPublicKey) -> Self { + nssa_core::encryption::shared_key_derivation::Secp256k1Point(value.0) + } +} + +// ============================================================================ +// Signature and PublicKey conversions +// ============================================================================ + +impl From for Signature { + fn from(value: nssa::Signature) -> Self { + let nssa::Signature { value } = value; + Self(value) + } +} + +impl From for nssa::Signature { + fn from(value: Signature) -> Self { + let Signature(sig_value) = value; + nssa::Signature { value: sig_value } + } +} + +impl From for PublicKey { + fn from(value: nssa::PublicKey) -> Self { + Self(*value.value()) + } +} + +impl TryFrom for nssa::PublicKey { + type Error = nssa::error::NssaError; + + fn try_from(value: PublicKey) -> Result { + nssa::PublicKey::try_new(value.0) + } +} + +// ============================================================================ +// Proof conversions +// ============================================================================ + +impl From for Proof { + fn from(value: nssa::privacy_preserving_transaction::circuit::Proof) -> Self { + Self(value.into_inner()) + } +} + +impl From for nssa::privacy_preserving_transaction::circuit::Proof { + fn from(value: Proof) -> Self { + nssa::privacy_preserving_transaction::circuit::Proof::from_inner(value.0) + } +} + +// ============================================================================ +// EncryptedAccountData conversions +// ============================================================================ + +impl From + for EncryptedAccountData +{ + fn from(value: nssa::privacy_preserving_transaction::message::EncryptedAccountData) -> Self { + Self { + ciphertext: value.ciphertext.into(), + epk: value.epk.into(), + view_tag: value.view_tag, + } + } +} + +impl From + for nssa::privacy_preserving_transaction::message::EncryptedAccountData +{ + fn from(value: EncryptedAccountData) -> Self { + Self { + ciphertext: value.ciphertext.into(), + epk: value.epk.into(), + view_tag: value.view_tag, + } + } +} + +// ============================================================================ +// Transaction Message conversions +// ============================================================================ + +impl From for PublicMessage { + fn from(value: nssa::public_transaction::Message) -> Self { + let nssa::public_transaction::Message { + program_id, + account_ids, + nonces, + instruction_data, + } = value; + Self { + program_id, + account_ids: account_ids.into_iter().map(Into::into).collect(), + nonces, + instruction_data, + } + } +} + +impl From for nssa::public_transaction::Message { + fn from(value: PublicMessage) -> Self { + let PublicMessage { + program_id, + account_ids, + nonces, + instruction_data, + } = value; + Self::new_preserialized( + program_id, + account_ids.into_iter().map(Into::into).collect(), + nonces, + instruction_data, + ) + } +} + +impl From for PrivacyPreservingMessage { + fn from(value: nssa::privacy_preserving_transaction::message::Message) -> Self { + let nssa::privacy_preserving_transaction::message::Message { + public_account_ids, + nonces, + public_post_states, + encrypted_private_post_states, + new_commitments, + new_nullifiers, + } = value; + Self { + public_account_ids: public_account_ids.into_iter().map(Into::into).collect(), + nonces, + public_post_states: public_post_states.into_iter().map(Into::into).collect(), + encrypted_private_post_states: encrypted_private_post_states + .into_iter() + .map(Into::into) + .collect(), + new_commitments: new_commitments.into_iter().map(Into::into).collect(), + new_nullifiers: new_nullifiers + .into_iter() + .map(|(n, d)| (n.into(), d.into())) + .collect(), + } + } +} + +impl TryFrom for nssa::privacy_preserving_transaction::message::Message { + type Error = nssa_core::account::data::DataTooBigError; + + fn try_from(value: PrivacyPreservingMessage) -> Result { + let PrivacyPreservingMessage { + public_account_ids, + nonces, + public_post_states, + encrypted_private_post_states, + new_commitments, + new_nullifiers, + } = value; + Ok(Self { + public_account_ids: public_account_ids.into_iter().map(Into::into).collect(), + nonces, + public_post_states: public_post_states + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, + encrypted_private_post_states: encrypted_private_post_states + .into_iter() + .map(Into::into) + .collect(), + new_commitments: new_commitments.into_iter().map(Into::into).collect(), + new_nullifiers: new_nullifiers + .into_iter() + .map(|(n, d)| (n.into(), d.into())) + .collect(), + }) + } +} + +impl From for ProgramDeploymentMessage { + fn from(value: nssa::program_deployment_transaction::Message) -> Self { + Self { + bytecode: value.into_bytecode(), + } + } +} + +impl From for nssa::program_deployment_transaction::Message { + fn from(value: ProgramDeploymentMessage) -> Self { + let ProgramDeploymentMessage { bytecode } = value; + Self::new(bytecode) + } +} + +// ============================================================================ +// WitnessSet conversions +// ============================================================================ + +impl TryFrom for WitnessSet { + type Error = (); + + fn try_from(_value: nssa::public_transaction::WitnessSet) -> Result { + // Public transaction witness sets don't have proofs, so we can't convert them directly + Err(()) + } +} + +impl From for WitnessSet { + fn from(value: nssa::privacy_preserving_transaction::witness_set::WitnessSet) -> Self { + let (sigs_and_pks, proof) = value.into_raw_parts(); + Self { + signatures_and_public_keys: sigs_and_pks + .into_iter() + .map(|(sig, pk)| (sig.into(), pk.into())) + .collect(), + proof: proof.into(), + } + } +} + +impl TryFrom for nssa::privacy_preserving_transaction::witness_set::WitnessSet { + type Error = nssa::error::NssaError; + + fn try_from(value: WitnessSet) -> Result { + let WitnessSet { + signatures_and_public_keys, + proof, + } = value; + let signatures_and_public_keys = signatures_and_public_keys + .into_iter() + .map(|(sig, pk)| Ok((sig.into(), pk.try_into()?))) + .collect::, Self::Error>>()?; + + Ok(Self::from_raw_parts( + signatures_and_public_keys, + proof.into(), + )) + } +} + +// ============================================================================ +// Transaction conversions +// ============================================================================ + +impl From for PublicTransaction { + fn from(value: nssa::PublicTransaction) -> Self { + Self { + message: value.message().clone().into(), + witness_set: WitnessSet { + signatures_and_public_keys: value + .witness_set() + .signatures_and_public_keys() + .iter() + .map(|(sig, pk)| (sig.clone().into(), pk.clone().into())) + .collect(), + proof: Proof(vec![]), // Public transactions don't have proofs + }, + } + } +} + +impl TryFrom for nssa::PublicTransaction { + type Error = nssa::error::NssaError; + + fn try_from(value: PublicTransaction) -> Result { + let PublicTransaction { + message, + witness_set, + } = value; + let WitnessSet { + signatures_and_public_keys, + proof: _, + } = witness_set; + Ok(Self::new( + message.into(), + nssa::public_transaction::WitnessSet::from_raw_parts( + signatures_and_public_keys + .into_iter() + .map(|(sig, pk)| Ok((sig.into(), pk.try_into()?))) + .collect::, Self::Error>>()?, + ), + )) + } +} + +impl From for PrivacyPreservingTransaction { + fn from(value: nssa::PrivacyPreservingTransaction) -> Self { + Self { + message: value.message().clone().into(), + witness_set: value.witness_set().clone().into(), + } + } +} + +impl TryFrom for nssa::PrivacyPreservingTransaction { + type Error = nssa::error::NssaError; + + fn try_from(value: PrivacyPreservingTransaction) -> Result { + let PrivacyPreservingTransaction { + message, + witness_set, + } = value; + Ok(Self::new( + message.try_into().map_err(|_| { + nssa::error::NssaError::InvalidInput("Data too big error".to_string()) + })?, + witness_set.try_into()?, + )) + } +} + +impl From for ProgramDeploymentTransaction { + fn from(value: nssa::ProgramDeploymentTransaction) -> Self { + Self { + message: value.into_message().into(), + } + } +} + +impl From for nssa::ProgramDeploymentTransaction { + fn from(value: ProgramDeploymentTransaction) -> Self { + let ProgramDeploymentTransaction { message } = value; + Self::new(message.into()) + } +} + +impl From for Transaction { + fn from(value: common::transaction::NSSATransaction) -> Self { + match value { + common::transaction::NSSATransaction::Public(tx) => Transaction::Public(tx.into()), + common::transaction::NSSATransaction::PrivacyPreserving(tx) => { + Transaction::PrivacyPreserving(tx.into()) + } + common::transaction::NSSATransaction::ProgramDeployment(tx) => { + Transaction::ProgramDeployment(tx.into()) + } + } + } +} + +impl TryFrom for common::transaction::NSSATransaction { + type Error = nssa::error::NssaError; + + fn try_from(value: Transaction) -> Result { + match value { + Transaction::Public(tx) => { + Ok(common::transaction::NSSATransaction::Public(tx.try_into()?)) + } + Transaction::PrivacyPreserving(tx) => Ok( + common::transaction::NSSATransaction::PrivacyPreserving(tx.try_into()?), + ), + Transaction::ProgramDeployment(tx) => Ok( + common::transaction::NSSATransaction::ProgramDeployment(tx.into()), + ), + } + } +} + +// ============================================================================ +// Block conversions +// ============================================================================ + +impl From for BlockHeader { + fn from(value: common::block::BlockHeader) -> Self { + let common::block::BlockHeader { + block_id, + prev_block_hash, + hash, + timestamp, + signature, + } = value; + Self { + block_id, + prev_block_hash: Hash(prev_block_hash), + hash: Hash(hash), + timestamp, + signature: signature.into(), + } + } +} + +impl TryFrom for common::block::BlockHeader { + type Error = nssa::error::NssaError; + + fn try_from(value: BlockHeader) -> Result { + let BlockHeader { + block_id, + prev_block_hash, + hash, + timestamp, + signature, + } = value; + Ok(Self { + block_id, + prev_block_hash: prev_block_hash.0, + hash: hash.0, + timestamp, + signature: signature.into(), + }) + } +} + +impl TryFrom for BlockBody { + type Error = std::io::Error; + + fn try_from(value: common::block::BlockBody) -> Result { + // Note: EncodedTransaction doesn't have a direct conversion to NSSATransaction + // This conversion will decode and re-encode the transactions + use borsh::BorshDeserialize as _; + + let common::block::BlockBody { transactions } = value; + + let transactions = transactions + .into_iter() + .map(|encoded_tx| match encoded_tx.tx_kind { + common::transaction::TxKind::Public => { + nssa::PublicTransaction::try_from_slice(&encoded_tx.encoded_transaction_data) + .map(|tx| Transaction::Public(tx.into())) + } + common::transaction::TxKind::PrivacyPreserving => { + nssa::PrivacyPreservingTransaction::try_from_slice( + &encoded_tx.encoded_transaction_data, + ) + .map(|tx| Transaction::PrivacyPreserving(tx.into())) + } + common::transaction::TxKind::ProgramDeployment => { + nssa::ProgramDeploymentTransaction::try_from_slice( + &encoded_tx.encoded_transaction_data, + ) + .map(|tx| Transaction::ProgramDeployment(tx.into())) + } + }) + .collect::, _>>()?; + + Ok(Self { transactions }) + } +} + +impl TryFrom for common::block::BlockBody { + type Error = nssa::error::NssaError; + + fn try_from(value: BlockBody) -> Result { + let BlockBody { transactions } = value; + + let transactions = transactions + .into_iter() + .map(|tx| { + let nssa_tx: common::transaction::NSSATransaction = tx.try_into()?; + Ok::<_, nssa::error::NssaError>(nssa_tx.into()) + }) + .collect::, _>>()?; + + Ok(Self { transactions }) + } +} + +impl TryFrom for Block { + type Error = std::io::Error; + + fn try_from(value: common::block::Block) -> Result { + let common::block::Block { + header, + body, + bedrock_status, + } = value; + + Ok(Self { + header: header.into(), + body: body.try_into()?, + bedrock_status: bedrock_status.into(), + }) + } +} + +impl TryFrom for common::block::Block { + type Error = nssa::error::NssaError; + + fn try_from(value: Block) -> Result { + let Block { + header, + body, + bedrock_status, + } = value; + + Ok(Self { + header: header.try_into()?, + body: body.try_into()?, + bedrock_status: bedrock_status.into(), + }) + } +} + +impl From for BedrockStatus { + fn from(value: common::block::BedrockStatus) -> Self { + match value { + common::block::BedrockStatus::Pending => Self::Pending, + common::block::BedrockStatus::Safe => Self::Safe, + common::block::BedrockStatus::Finalized => Self::Finalized, + } + } +} + +impl From for common::block::BedrockStatus { + fn from(value: BedrockStatus) -> Self { + match value { + BedrockStatus::Pending => Self::Pending, + BedrockStatus::Safe => Self::Safe, + BedrockStatus::Finalized => Self::Finalized, + } + } +} diff --git a/indexer_service/protocol/src/lib.rs b/indexer_service/protocol/src/lib.rs new file mode 100644 index 00000000..8189f7d8 --- /dev/null +++ b/indexer_service/protocol/src/lib.rs @@ -0,0 +1,230 @@ +//! This crate defines the protocol types used by the indexer service. +//! +//! Currently it mostly mimics types from `nssa_core`, but it's important to have a separate crate +//! to define a stable interface for the indexer service RPCs which evolves in its own way. + +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +#[cfg(feature = "convert")] +mod convert; + +pub type Nonce = u128; + +pub type ProgramId = [u32; 8]; + +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct AccountId { + #[serde(with = "base64::arr")] + #[schemars(with = "String", description = "base64-encoded account ID")] + pub value: [u8; 32], +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct Account { + pub program_owner: ProgramId, + pub balance: u128, + pub data: Data, + pub nonce: Nonce, +} + +pub type BlockId = u64; +pub type TimeStamp = u64; + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct Block { + pub header: BlockHeader, + pub body: BlockBody, + pub bedrock_status: BedrockStatus, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct BlockHeader { + pub block_id: BlockId, + pub prev_block_hash: Hash, + pub hash: Hash, + pub timestamp: TimeStamp, + pub signature: Signature, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct Signature( + #[serde(with = "base64::arr")] + #[schemars(with = "String", description = "base64-encoded signature")] + pub [u8; 64], +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct BlockBody { + pub transactions: Vec, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub enum Transaction { + Public(PublicTransaction), + PrivacyPreserving(PrivacyPreservingTransaction), + ProgramDeployment(ProgramDeploymentTransaction), +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct PublicTransaction { + pub message: PublicMessage, + pub witness_set: WitnessSet, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct PrivacyPreservingTransaction { + pub message: PrivacyPreservingMessage, + pub witness_set: WitnessSet, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct PublicMessage { + pub program_id: ProgramId, + pub account_ids: Vec, + pub nonces: Vec, + pub instruction_data: InstructionData, +} + +pub type InstructionData = Vec; + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct PrivacyPreservingMessage { + pub public_account_ids: Vec, + pub nonces: Vec, + pub public_post_states: Vec, + pub encrypted_private_post_states: Vec, + pub new_commitments: Vec, + pub new_nullifiers: Vec<(Nullifier, CommitmentSetDigest)>, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct WitnessSet { + pub signatures_and_public_keys: Vec<(Signature, PublicKey)>, + pub proof: Proof, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct Proof( + #[serde(with = "base64")] + #[schemars(with = "String", description = "base64-encoded proof")] + pub Vec, +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct EncryptedAccountData { + pub ciphertext: Ciphertext, + pub epk: EphemeralPublicKey, + pub view_tag: ViewTag, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct ProgramDeploymentTransaction { + pub message: ProgramDeploymentMessage, +} + +pub type ViewTag = u8; + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct Ciphertext( + #[serde(with = "base64")] + #[schemars(with = "String", description = "base64-encoded ciphertext")] + pub Vec, +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct PublicKey( + #[serde(with = "base64::arr")] + #[schemars(with = "String", description = "base64-encoded public key")] + pub [u8; 32], +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct EphemeralPublicKey( + #[serde(with = "base64")] + #[schemars(with = "String", description = "base64-encoded ephemeral public key")] + pub Vec, +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct Commitment( + #[serde(with = "base64::arr")] + #[schemars(with = "String", description = "base64-encoded commitment")] + pub [u8; 32], +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct Nullifier( + #[serde(with = "base64::arr")] + #[schemars(with = "String", description = "base64-encoded nullifier")] + pub [u8; 32], +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct CommitmentSetDigest( + #[serde(with = "base64::arr")] + #[schemars(with = "String", description = "base64-encoded commitment set digest")] + pub [u8; 32], +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct ProgramDeploymentMessage { + #[serde(with = "base64")] + #[schemars(with = "String", description = "base64-encoded program bytecode")] + pub bytecode: Vec, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct Data( + #[serde(with = "base64")] + #[schemars(with = "String", description = "base64-encoded account data")] + pub Vec, +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub struct Hash( + #[serde(with = "base64::arr")] + #[schemars(with = "String", description = "base64-encoded hash")] + pub [u8; 32], +); + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)] +pub enum BedrockStatus { + Pending, + Safe, + Finalized, +} + +mod base64 { + use base64::prelude::{BASE64_STANDARD, Engine as _}; + use serde::{Deserialize, Deserializer, Serialize, Serializer}; + + pub mod arr { + use super::*; + + pub fn serialize(v: &[u8], s: S) -> Result { + super::serialize(v, s) + } + + pub fn deserialize<'de, const N: usize, D: Deserializer<'de>>( + d: D, + ) -> Result<[u8; N], D::Error> { + let vec = super::deserialize(d)?; + vec.try_into().map_err(|_| { + serde::de::Error::custom(format!("Invalid length, expected {N} bytes")) + }) + } + } + + pub fn serialize(v: &[u8], s: S) -> Result { + let base64 = BASE64_STANDARD.encode(v); + String::serialize(&base64, s) + } + + pub fn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result, D::Error> { + let base64 = String::deserialize(d)?; + BASE64_STANDARD + .decode(base64.as_bytes()) + .map_err(serde::de::Error::custom) + } +} diff --git a/indexer_service/rpc/Cargo.toml b/indexer_service/rpc/Cargo.toml new file mode 100644 index 00000000..f77c5abf --- /dev/null +++ b/indexer_service/rpc/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "indexer_service_rpc" +version = "0.1.0" +edition = "2024" + +[dependencies] +indexer_service_protocol = { workspace = true } + +jsonrpsee = { workspace = true, features = ["macros"] } +serde_json.workspace = true +schemars.workspace = true + +[features] +client = ["jsonrpsee/client"] +server = ["jsonrpsee/server"] diff --git a/indexer_service/rpc/src/lib.rs b/indexer_service/rpc/src/lib.rs new file mode 100644 index 00000000..c1c4a560 --- /dev/null +++ b/indexer_service/rpc/src/lib.rs @@ -0,0 +1,40 @@ +use indexer_service_protocol::{Account, AccountId, Block, BlockId, Hash, Transaction}; +use jsonrpsee::{core::SubscriptionResult, proc_macros::rpc, types::ErrorObjectOwned}; + +#[cfg(all(not(feature = "server"), not(feature = "client")))] +compile_error!("At least one of `server` or `client` features must be enabled."); + +#[cfg_attr(feature = "server", rpc(server))] +#[cfg_attr(feature = "client", rpc(client))] +pub trait Rpc { + #[method(name = "get_schema")] + fn get_schema(&self) -> Result { + // TODO: Canonical solution would be to provide `describe` method returning OpenRPC spec, + // But for now it's painful to implement, although can be done if really needed. + // Currently we can wait until we can auto-generated it: https://github.com/paritytech/jsonrpsee/issues/737 + // and just return JSON schema. + + // Block schema contains all other types used in the protocol, so it's sufficient to return + // its schema. + let block_schema = schemars::schema_for!(Block); + Ok(serde_json::to_value(block_schema).expect("Schema serialization should not fail")) + } + + #[subscription(name = "subscribeToBlocks", item = Vec)] + async fn subscribe_to_blocks(&self, from: BlockId) -> SubscriptionResult; + + #[method(name = "getBlockById")] + async fn get_block_by_id(&self, block_id: BlockId) -> Result; + + #[method(name = "getBlockByHash")] + async fn get_block_by_hash(&self, block_hash: Hash) -> Result; + + #[method(name = "getLastBlockId")] + async fn get_last_block_id(&self) -> Result; + + #[method(name = "getAccount")] + async fn get_account(&self, account_id: AccountId) -> Result; + + #[method(name = "getTransaction")] + async fn get_transaction(&self, tx_hash: Hash) -> Result; +} diff --git a/indexer_service/src/lib.rs b/indexer_service/src/lib.rs new file mode 100644 index 00000000..1f278a4d --- /dev/null +++ b/indexer_service/src/lib.rs @@ -0,0 +1 @@ +pub mod service; diff --git a/indexer_service/src/main.rs b/indexer_service/src/main.rs new file mode 100644 index 00000000..bfdd3259 --- /dev/null +++ b/indexer_service/src/main.rs @@ -0,0 +1,72 @@ +use std::net::SocketAddr; + +use anyhow::{Context as _, Result}; +use clap::Parser; +use indexer_service_rpc::RpcServer as _; +use jsonrpsee::server::Server; +use log::{error, info}; +use tokio_util::sync::CancellationToken; + +#[derive(Debug, Parser)] +#[clap(version)] +struct Args { + #[clap(short, long, default_value = "8779")] + port: u16, +} + +#[tokio::main] +async fn main() -> Result<()> { + env_logger::init(); + + let args = Args::parse(); + + let cancellation_token = listen_for_shutdown_signal(); + + let handle = run_server(args.port).await?; + let handle_clone = handle.clone(); + + tokio::select! { + _ = cancellation_token.cancelled() => { + info!("Shutting down server..."); + } + _ = handle_clone.stopped() => { + error!("Server stopped unexpectedly"); + } + } + + info!("Server shutdown complete"); + + Ok(()) +} + +async fn run_server(port: u16) -> Result { + let server = Server::builder() + .build(SocketAddr::from(([0, 0, 0, 0], port))) + .await + .context("Failed to build RPC server")?; + + let addr = server + .local_addr() + .context("Failed to get local address of RPC server")?; + + info!("Starting Indexer Service RPC server on {addr}"); + + let handle = server.start(indexer_service::service::IndexerService.into_rpc()); + Ok(handle) +} + +fn listen_for_shutdown_signal() -> CancellationToken { + let cancellation_token = CancellationToken::new(); + let cancellation_token_clone = cancellation_token.clone(); + + tokio::spawn(async move { + if let Err(err) = tokio::signal::ctrl_c().await { + error!("Failed to listen for Ctrl-C signal: {err}"); + return; + } + info!("Received Ctrl-C signal"); + cancellation_token_clone.cancel(); + }); + + cancellation_token +} diff --git a/indexer_service/src/service.rs b/indexer_service/src/service.rs new file mode 100644 index 00000000..46c5fb2d --- /dev/null +++ b/indexer_service/src/service.rs @@ -0,0 +1,36 @@ +use indexer_service_protocol::{Account, AccountId, Block, BlockId, Hash, Transaction}; +use jsonrpsee::{core::SubscriptionResult, types::ErrorObjectOwned}; + +pub struct IndexerService; + +// `async_trait` is required by `jsonrpsee` +#[async_trait::async_trait] +impl indexer_service_rpc::RpcServer for IndexerService { + async fn subscribe_to_blocks( + &self, + _subscription_sink: jsonrpsee::PendingSubscriptionSink, + _from: BlockId, + ) -> SubscriptionResult { + todo!() + } + + async fn get_block_by_id(&self, _block_id: BlockId) -> Result { + todo!() + } + + async fn get_block_by_hash(&self, _block_hash: Hash) -> Result { + todo!() + } + + async fn get_last_block_id(&self) -> Result { + todo!() + } + + async fn get_account(&self, _account_id: AccountId) -> Result { + todo!() + } + + async fn get_transaction(&self, _tx_hash: Hash) -> Result { + todo!() + } +} diff --git a/integration_tests/tests/tps.rs b/integration_tests/tests/tps.rs index 3fd44a79..b3b7e4b7 100644 --- a/integration_tests/tests/tps.rs +++ b/integration_tests/tests/tps.rs @@ -185,6 +185,7 @@ impl TpsTestManager { initial_accounts: initial_public_accounts, initial_commitments: vec![initial_commitment], signing_key: [37; 32], + bedrock_config: None, } } } diff --git a/nssa/core/src/account.rs b/nssa/core/src/account.rs index 55ab0ded..b1f41b65 100644 --- a/nssa/core/src/account.rs +++ b/nssa/core/src/account.rs @@ -68,6 +68,10 @@ impl AccountId { pub fn value(&self) -> &[u8; 32] { &self.value } + + pub fn into_value(self) -> [u8; 32] { + self.value + } } impl AsRef<[u8]> for AccountId { diff --git a/nssa/core/src/encoding.rs b/nssa/core/src/encoding.rs index 24ac050c..34be3782 100644 --- a/nssa/core/src/encoding.rs +++ b/nssa/core/src/encoding.rs @@ -69,6 +69,11 @@ impl Commitment { self.0 } + #[cfg(feature = "host")] + pub fn from_byte_array(bytes: [u8; 32]) -> Self { + Self(bytes) + } + #[cfg(feature = "host")] pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { let mut bytes = [0u8; 32]; @@ -89,6 +94,11 @@ impl Nullifier { self.0 } + #[cfg(feature = "host")] + pub fn from_byte_array(bytes: [u8; 32]) -> Self { + Self(bytes) + } + pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { let mut bytes = [0u8; 32]; cursor.read_exact(&mut bytes)?; @@ -106,6 +116,16 @@ impl Ciphertext { bytes } + #[cfg(feature = "host")] + pub fn into_inner(self) -> Vec { + self.0 + } + + #[cfg(feature = "host")] + pub fn from_inner(inner: Vec) -> Self { + Self(inner) + } + #[cfg(feature = "host")] pub fn from_cursor(cursor: &mut Cursor<&[u8]>) -> Result { let mut u32_bytes = [0; 4]; diff --git a/nssa/src/privacy_preserving_transaction/circuit.rs b/nssa/src/privacy_preserving_transaction/circuit.rs index ccc03f9b..9a28badd 100644 --- a/nssa/src/privacy_preserving_transaction/circuit.rs +++ b/nssa/src/privacy_preserving_transaction/circuit.rs @@ -20,6 +20,16 @@ use crate::{ #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] pub struct Proof(pub(crate) Vec); +impl Proof { + pub fn into_inner(self) -> Vec { + self.0 + } + + pub fn from_inner(inner: Vec) -> Self { + Self(inner) + } +} + #[derive(Clone)] pub struct ProgramWithDependencies { pub program: Program, diff --git a/nssa/src/privacy_preserving_transaction/message.rs b/nssa/src/privacy_preserving_transaction/message.rs index a9e3128c..47b0aa42 100644 --- a/nssa/src/privacy_preserving_transaction/message.rs +++ b/nssa/src/privacy_preserving_transaction/message.rs @@ -45,12 +45,12 @@ impl EncryptedAccountData { #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] pub struct Message { - pub(crate) public_account_ids: Vec, - pub(crate) nonces: Vec, - pub(crate) public_post_states: Vec, + pub public_account_ids: Vec, + pub nonces: Vec, + pub public_post_states: Vec, pub encrypted_private_post_states: Vec, pub new_commitments: Vec, - pub(crate) new_nullifiers: Vec<(Nullifier, CommitmentSetDigest)>, + pub new_nullifiers: Vec<(Nullifier, CommitmentSetDigest)>, } impl Message { diff --git a/nssa/src/privacy_preserving_transaction/transaction.rs b/nssa/src/privacy_preserving_transaction/transaction.rs index 2cb0889b..34649d2d 100644 --- a/nssa/src/privacy_preserving_transaction/transaction.rs +++ b/nssa/src/privacy_preserving_transaction/transaction.rs @@ -16,7 +16,7 @@ use crate::{ #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] pub struct PrivacyPreservingTransaction { pub message: Message, - witness_set: WitnessSet, + pub witness_set: WitnessSet, } impl PrivacyPreservingTransaction { diff --git a/nssa/src/privacy_preserving_transaction/witness_set.rs b/nssa/src/privacy_preserving_transaction/witness_set.rs index b38b0fb9..365b61b9 100644 --- a/nssa/src/privacy_preserving_transaction/witness_set.rs +++ b/nssa/src/privacy_preserving_transaction/witness_set.rs @@ -46,4 +46,18 @@ impl WitnessSet { pub fn proof(&self) -> &Proof { &self.proof } + + pub fn into_raw_parts(self) -> (Vec<(Signature, PublicKey)>, Proof) { + (self.signatures_and_public_keys, self.proof) + } + + pub fn from_raw_parts( + signatures_and_public_keys: Vec<(Signature, PublicKey)>, + proof: Proof, + ) -> Self { + Self { + signatures_and_public_keys, + proof, + } + } } diff --git a/nssa/src/program_deployment_transaction/message.rs b/nssa/src/program_deployment_transaction/message.rs index 65e9ec27..41c4e10a 100644 --- a/nssa/src/program_deployment_transaction/message.rs +++ b/nssa/src/program_deployment_transaction/message.rs @@ -9,4 +9,8 @@ impl Message { pub fn new(bytecode: Vec) -> Self { Self { bytecode } } + + pub fn into_bytecode(self) -> Vec { + self.bytecode + } } diff --git a/nssa/src/program_deployment_transaction/transaction.rs b/nssa/src/program_deployment_transaction/transaction.rs index c5f31a1c..6002aded 100644 --- a/nssa/src/program_deployment_transaction/transaction.rs +++ b/nssa/src/program_deployment_transaction/transaction.rs @@ -14,6 +14,10 @@ impl ProgramDeploymentTransaction { Self { message } } + pub fn into_message(self) -> Message { + self.message + } + pub(crate) fn validate_and_produce_public_state_diff( &self, state: &V02State, diff --git a/nssa/src/public_transaction/message.rs b/nssa/src/public_transaction/message.rs index d8bd2da0..36a20fbb 100644 --- a/nssa/src/public_transaction/message.rs +++ b/nssa/src/public_transaction/message.rs @@ -9,10 +9,10 @@ use crate::{AccountId, error::NssaError, program::Program}; #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] pub struct Message { - pub(crate) program_id: ProgramId, - pub(crate) account_ids: Vec, - pub(crate) nonces: Vec, - pub(crate) instruction_data: InstructionData, + pub program_id: ProgramId, + pub account_ids: Vec, + pub nonces: Vec, + pub instruction_data: InstructionData, } impl Message { diff --git a/nssa/src/public_transaction/witness_set.rs b/nssa/src/public_transaction/witness_set.rs index 09a35a4e..9b9cd290 100644 --- a/nssa/src/public_transaction/witness_set.rs +++ b/nssa/src/public_transaction/witness_set.rs @@ -37,6 +37,16 @@ impl WitnessSet { pub fn signatures_and_public_keys(&self) -> &[(Signature, PublicKey)] { &self.signatures_and_public_keys } + + pub fn into_raw_parts(self) -> Vec<(Signature, PublicKey)> { + self.signatures_and_public_keys + } + + pub fn from_raw_parts(signatures_and_public_keys: Vec<(Signature, PublicKey)>) -> Self { + Self { + signatures_and_public_keys, + } + } } #[cfg(test)] diff --git a/nssa/src/signature/mod.rs b/nssa/src/signature/mod.rs index 780ad634..f76c480a 100644 --- a/nssa/src/signature/mod.rs +++ b/nssa/src/signature/mod.rs @@ -8,7 +8,7 @@ use rand::{RngCore, rngs::OsRng}; #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] pub struct Signature { - value: [u8; 64], + pub value: [u8; 64], } impl Signature { diff --git a/sequencer_core/Cargo.toml b/sequencer_core/Cargo.toml index a844c524..8d2886ce 100644 --- a/sequencer_core/Cargo.toml +++ b/sequencer_core/Cargo.toml @@ -17,6 +17,12 @@ serde_json.workspace = true tempfile.workspace = true chrono.workspace = true log.workspace = true +bedrock_client.workspace = true +logos-blockchain-key-management-system-service.workspace = true +logos-blockchain-core.workspace = true +rand.workspace = true +reqwest.workspace = true +borsh.workspace = true [features] default = [] diff --git a/sequencer_core/src/block_settlement_client.rs b/sequencer_core/src/block_settlement_client.rs new file mode 100644 index 00000000..0aa22420 --- /dev/null +++ b/sequencer_core/src/block_settlement_client.rs @@ -0,0 +1,117 @@ +use std::{fs, path::Path}; + +use anyhow::{Context, Result, anyhow}; +use bedrock_client::BedrockClient; +use common::block::HashableBlockData; +use logos_blockchain_core::mantle::{ + MantleTx, Op, OpProof, SignedMantleTx, Transaction, TxHash, ledger, + ops::channel::{ChannelId, MsgId, inscribe::InscriptionOp}, +}; +use logos_blockchain_key_management_system_service::keys::{ + ED25519_SECRET_KEY_SIZE, Ed25519Key, Ed25519PublicKey, +}; + +use crate::config::BedrockConfig; + +/// A component that posts block data to logos blockchain +pub struct BlockSettlementClient { + bedrock_client: BedrockClient, + bedrock_signing_key: Ed25519Key, + bedrock_channel_id: ChannelId, + last_message_id: MsgId, +} + +impl BlockSettlementClient { + pub fn try_new(home: &Path, config: &BedrockConfig) -> Result { + let bedrock_signing_key = load_or_create_signing_key(&home.join("bedrock_signing_key")) + .context("Failed to load or create signing key")?; + let bedrock_channel_id = ChannelId::from(config.channel_id); + let bedrock_client = BedrockClient::new(None, config.node_url.clone()) + .context("Failed to initialize bedrock client")?; + let channel_genesis_msg = MsgId::from([0; 32]); + Ok(Self { + bedrock_client, + bedrock_signing_key, + bedrock_channel_id, + last_message_id: channel_genesis_msg, + }) + } + + /// Create and sign a transaction for inscribing data + pub fn create_inscribe_tx(&self, data: Vec) -> (SignedMantleTx, MsgId) { + let verifying_key_bytes = self.bedrock_signing_key.public_key().to_bytes(); + let verifying_key = + Ed25519PublicKey::from_bytes(&verifying_key_bytes).expect("valid ed25519 public key"); + + let inscribe_op = InscriptionOp { + channel_id: self.bedrock_channel_id, + inscription: data, + parent: self.last_message_id, + signer: verifying_key, + }; + let inscribe_op_id = inscribe_op.id(); + + let ledger_tx = ledger::Tx::new(vec![], vec![]); + + let inscribe_tx = MantleTx { + ops: vec![Op::ChannelInscribe(inscribe_op)], + ledger_tx, + // Altruistic test config + storage_gas_price: 0, + execution_gas_price: 0, + }; + + let tx_hash = inscribe_tx.hash(); + let signature_bytes = self + .bedrock_signing_key + .sign_payload(tx_hash.as_signing_bytes().as_ref()) + .to_bytes(); + let signature = + logos_blockchain_key_management_system_service::keys::Ed25519Signature::from_bytes( + &signature_bytes, + ); + + let signed_mantle_tx = SignedMantleTx { + ops_proofs: vec![OpProof::Ed25519Sig(signature)], + ledger_tx_proof: empty_ledger_signature(&tx_hash), + mantle_tx: inscribe_tx, + }; + (signed_mantle_tx, inscribe_op_id) + } + + /// Post a transaction to the node and wait for inclusion + pub async fn post_and_wait(&mut self, block_data: &HashableBlockData) -> Result { + let inscription_data = borsh::to_vec(&block_data)?; + let (tx, new_msg_id) = self.create_inscribe_tx(inscription_data); + + // Post the transaction + self.bedrock_client.post_transaction(tx).await?; + + self.last_message_id = new_msg_id; + + Ok(block_data.block_id) + } +} + +/// Load signing key from file or generate a new one if it doesn't exist +fn load_or_create_signing_key(path: &Path) -> Result { + if path.exists() { + let key_bytes = fs::read(path)?; + let key_array: [u8; ED25519_SECRET_KEY_SIZE] = key_bytes + .try_into() + .map_err(|_| anyhow!("Found key with incorrect length"))?; + Ok(Ed25519Key::from_bytes(&key_array)) + } else { + let mut key_bytes = [0u8; ED25519_SECRET_KEY_SIZE]; + rand::RngCore::fill_bytes(&mut rand::thread_rng(), &mut key_bytes); + fs::write(path, key_bytes)?; + Ok(Ed25519Key::from_bytes(&key_bytes)) + } +} + +fn empty_ledger_signature( + tx_hash: &TxHash, +) -> logos_blockchain_key_management_system_service::keys::ZkSignature { + logos_blockchain_key_management_system_service::keys::ZkKey::multi_sign(&[], tx_hash.as_ref()) + .expect("multi-sign with empty key set works") +} diff --git a/sequencer_core/src/block_store.rs b/sequencer_core/src/block_store.rs index 67535022..cd9aa194 100644 --- a/sequencer_core/src/block_store.rs +++ b/sequencer_core/src/block_store.rs @@ -46,7 +46,7 @@ impl SequencerBlockStore { } pub fn get_block_at_id(&self, id: u64) -> Result { - Ok(self.dbio.get_block(id)?.into_block(&self.signing_key)) + Ok(self.dbio.get_block(id)?) } pub fn put_block_at_id(&mut self, block: Block) -> Result<()> { @@ -113,7 +113,7 @@ mod tests { transactions: vec![], }; - let genesis_block = genesis_block_hashable_data.into_block(&signing_key); + let genesis_block = genesis_block_hashable_data.into_pending_block(&signing_key); // Start an empty node store let mut node_store = SequencerBlockStore::open_db_with_genesis(path, Some(genesis_block), signing_key) diff --git a/sequencer_core/src/config.rs b/sequencer_core/src/config.rs index 4ef08803..5911cc52 100644 --- a/sequencer_core/src/config.rs +++ b/sequencer_core/src/config.rs @@ -5,6 +5,7 @@ use std::{ }; use anyhow::Result; +use reqwest::Url; use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, Clone)] @@ -47,6 +48,16 @@ pub struct SequencerConfig { pub initial_commitments: Vec, /// Sequencer own signing key pub signing_key: [u8; 32], + /// Bedrock configuration options + pub bedrock_config: Option, +} + +#[derive(Clone, Serialize, Deserialize)] +pub struct BedrockConfig { + /// Bedrock channel ID + pub channel_id: [u8; 32], + /// Bedrock Url + pub node_url: Url, } impl SequencerConfig { diff --git a/sequencer_core/src/lib.rs b/sequencer_core/src/lib.rs index 8e193ff6..89cafc4c 100644 --- a/sequencer_core/src/lib.rs +++ b/sequencer_core/src/lib.rs @@ -13,8 +13,9 @@ use log::warn; use mempool::{MemPool, MemPoolHandle}; use serde::{Deserialize, Serialize}; -use crate::block_store::SequencerBlockStore; +use crate::{block_settlement_client::BlockSettlementClient, block_store::SequencerBlockStore}; +mod block_settlement_client; pub mod block_store; pub mod config; @@ -24,6 +25,7 @@ pub struct SequencerCore { mempool: MemPool, sequencer_config: SequencerConfig, chain_height: u64, + block_settlement_client: Option, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] @@ -51,7 +53,7 @@ impl SequencerCore { }; let signing_key = nssa::PrivateKey::try_new(config.signing_key).unwrap(); - let genesis_block = hashable_data.into_block(&signing_key); + let genesis_block = hashable_data.into_pending_block(&signing_key); // Sequencer should panic if unable to open db, // as fixing this issue may require actions non-native to program scope @@ -87,12 +89,18 @@ impl SequencerCore { state.add_pinata_program(PINATA_BASE58.parse().unwrap()); let (mempool, mempool_handle) = MemPool::new(config.mempool_max_size); + let block_settlement_client = config.bedrock_config.as_ref().map(|bedrock_config| { + BlockSettlementClient::try_new(&config.home, bedrock_config) + .expect("Block settlement client should be constructible") + }); + let mut this = Self { state, block_store, mempool, chain_height: config.genesis_id, sequencer_config: config, + block_settlement_client, }; this.sync_state_with_stored_blocks(); @@ -137,9 +145,21 @@ impl SequencerCore { Ok(tx) } + pub async fn produce_new_block_and_post_to_settlement_layer(&mut self) -> Result { + let block_data = self.produce_new_block_with_mempool_transactions()?; + + if let Some(block_settlement) = self.block_settlement_client.as_mut() { + block_settlement.post_and_wait(&block_data).await?; + log::info!("Posted block data to Bedrock"); + } + + Ok(self.chain_height) + } + /// Produces new block from transactions in mempool - pub fn produce_new_block_with_mempool_transactions(&mut self) -> Result { + pub fn produce_new_block_with_mempool_transactions(&mut self) -> Result { let now = Instant::now(); + let new_block_height = self.chain_height + 1; let mut valid_transactions = vec![]; @@ -167,8 +187,6 @@ impl SequencerCore { let curr_time = chrono::Utc::now().timestamp_millis() as u64; - let num_txs_in_block = valid_transactions.len(); - let hashable_data = HashableBlockData { block_id: new_block_height, transactions: valid_transactions, @@ -176,7 +194,9 @@ impl SequencerCore { timestamp: curr_time, }; - let block = hashable_data.into_block(self.block_store.signing_key()); + let block = hashable_data + .clone() + .into_pending_block(self.block_store.signing_key()); self.block_store.put_block_at_id(block)?; @@ -194,11 +214,10 @@ impl SequencerCore { // ``` log::info!( "Created block with {} transactions in {} seconds", - num_txs_in_block, + hashable_data.transactions.len(), now.elapsed().as_secs() ); - - Ok(self.chain_height) + Ok(hashable_data) } pub fn state(&self) -> &nssa::V02State { @@ -277,6 +296,7 @@ mod tests { initial_accounts, initial_commitments: vec![], signing_key: *sequencer_sign_key_for_testing().value(), + bedrock_config: None, } } @@ -619,9 +639,9 @@ mod tests { let tx = common::test_utils::produce_dummy_empty_transaction(); mempool_handle.push(tx).await.unwrap(); - let block_id = sequencer.produce_new_block_with_mempool_transactions(); - assert!(block_id.is_ok()); - assert_eq!(block_id.unwrap(), genesis_height + 1); + let block = sequencer.produce_new_block_with_mempool_transactions(); + assert!(block.is_ok()); + assert_eq!(block.unwrap().block_id, genesis_height + 1); } #[tokio::test] @@ -658,7 +678,8 @@ mod tests { // Create block let current_height = sequencer .produce_new_block_with_mempool_transactions() - .unwrap(); + .unwrap() + .block_id; let block = sequencer .block_store .get_block_at_id(current_height) @@ -697,7 +718,8 @@ mod tests { mempool_handle.push(tx.clone()).await.unwrap(); let current_height = sequencer .produce_new_block_with_mempool_transactions() - .unwrap(); + .unwrap() + .block_id; let block = sequencer .block_store .get_block_at_id(current_height) @@ -708,7 +730,8 @@ mod tests { mempool_handle.push(tx.clone()).await.unwrap(); let current_height = sequencer .produce_new_block_with_mempool_transactions() - .unwrap(); + .unwrap() + .block_id; let block = sequencer .block_store .get_block_at_id(current_height) @@ -743,7 +766,8 @@ mod tests { mempool_handle.push(tx.clone()).await.unwrap(); let current_height = sequencer .produce_new_block_with_mempool_transactions() - .unwrap(); + .unwrap() + .block_id; let block = sequencer .block_store .get_block_at_id(current_height) diff --git a/sequencer_rpc/src/process.rs b/sequencer_rpc/src/process.rs index 387abf28..b89993f9 100644 --- a/sequencer_rpc/src/process.rs +++ b/sequencer_rpc/src/process.rs @@ -388,6 +388,7 @@ mod tests { initial_accounts, initial_commitments: vec![], signing_key: *sequencer_sign_key_for_testing().value(), + bedrock_config: None, } } diff --git a/sequencer_runner/configs/debug/sequencer_config.json b/sequencer_runner/configs/debug/sequencer_config.json index 58348f68..ad43ba65 100644 --- a/sequencer_runner/configs/debug/sequencer_config.json +++ b/sequencer_runner/configs/debug/sequencer_config.json @@ -154,5 +154,9 @@ 37, 37, 37 - ] -} \ No newline at end of file + ], + "bedrock_config": { + "channel_id": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], + "node_url": "http://localhost:8080" + } +} diff --git a/sequencer_runner/src/lib.rs b/sequencer_runner/src/lib.rs index 5c1ab920..fd4a6c08 100644 --- a/sequencer_runner/src/lib.rs +++ b/sequencer_runner/src/lib.rs @@ -50,7 +50,9 @@ pub async fn startup_sequencer( let id = { let mut state = seq_core_wrapped.lock().await; - state.produce_new_block_with_mempool_transactions()? + state + .produce_new_block_and_post_to_settlement_layer() + .await? }; info!("Block with id {id} created"); diff --git a/storage/src/lib.rs b/storage/src/lib.rs index 87b78705..883684c2 100644 --- a/storage/src/lib.rs +++ b/storage/src/lib.rs @@ -1,6 +1,6 @@ use std::{path::Path, sync::Arc}; -use common::block::{Block, HashableBlockData}; +use common::block::Block; use error::DbError; use rocksdb::{ BoundColumnFamily, ColumnFamilyDescriptor, DBWithThreadMode, MultiThreaded, Options, @@ -26,6 +26,8 @@ pub const DB_META_FIRST_BLOCK_IN_DB_KEY: &str = "first_block_in_db"; pub const DB_META_LAST_BLOCK_IN_DB_KEY: &str = "last_block_in_db"; /// Key base for storing metainformation which describe if first block has been set pub const DB_META_FIRST_BLOCK_SET_KEY: &str = "first_block_set"; +/// Key base for storing metainformation about the last finalized block on Bedrock +pub const DB_META_LAST_FINALIZED_BLOCK_ID: &str = "last_finalized_block_id"; /// Key base for storing snapshot which describe block id pub const DB_SNAPSHOT_BLOCK_ID_KEY: &str = "block_id"; @@ -75,6 +77,7 @@ impl RocksDBIO { dbio.put_meta_first_block_in_db(block)?; dbio.put_meta_is_first_block_set()?; dbio.put_meta_last_block_in_db(block_id)?; + dbio.put_meta_last_finalized_block_id(None)?; Ok(dbio) } else { @@ -232,6 +235,28 @@ impl RocksDBIO { Ok(()) } + pub fn put_meta_last_finalized_block_id(&self, block_id: Option) -> DbResult<()> { + let cf_meta = self.meta_column(); + self.db + .put_cf( + &cf_meta, + borsh::to_vec(&DB_META_LAST_FINALIZED_BLOCK_ID).map_err(|err| { + DbError::borsh_cast_message( + err, + Some("Failed to serialize DB_META_LAST_FINALIZED_BLOCK_ID".to_string()), + ) + })?, + borsh::to_vec(&block_id).map_err(|err| { + DbError::borsh_cast_message( + err, + Some("Failed to serialize last block id".to_string()), + ) + })?, + ) + .map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))?; + Ok(()) + } + pub fn put_meta_is_first_block_set(&self) -> DbResult<()> { let cf_meta = self.meta_column(); self.db @@ -269,7 +294,7 @@ impl RocksDBIO { Some("Failed to serialize block id".to_string()), ) })?, - borsh::to_vec(&HashableBlockData::from(block)).map_err(|err| { + borsh::to_vec(&block).map_err(|err| { DbError::borsh_cast_message( err, Some("Failed to serialize block data".to_string()), @@ -280,7 +305,7 @@ impl RocksDBIO { Ok(()) } - pub fn get_block(&self, block_id: u64) -> DbResult { + pub fn get_block(&self, block_id: u64) -> DbResult { let cf_block = self.block_column(); let res = self .db @@ -296,14 +321,12 @@ impl RocksDBIO { .map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))?; if let Some(data) = res { - Ok( - borsh::from_slice::(&data).map_err(|serr| { - DbError::borsh_cast_message( - serr, - Some("Failed to deserialize block data".to_string()), - ) - })?, - ) + Ok(borsh::from_slice::(&data).map_err(|serr| { + DbError::borsh_cast_message( + serr, + Some("Failed to deserialize block data".to_string()), + ) + })?) } else { Err(DbError::db_interaction_error( "Block on this id not found".to_string(), diff --git a/wallet/src/cli/chain.rs b/wallet/src/cli/chain.rs index 419fa5e2..17ecd020 100644 --- a/wallet/src/cli/chain.rs +++ b/wallet/src/cli/chain.rs @@ -19,7 +19,7 @@ pub enum ChainSubcommand { /// Get transaction at hash from sequencer Transaction { /// hash - valid 32 byte hex string - #[arg(short, long)] + #[arg(short = 't', long)] hash: String, }, }