diff --git a/.gitignore b/.gitignore index a224bf8d2..0957182bf 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,6 @@ profile.json *.log venv *.pem -*.jot \ No newline at end of file +*.jot.* +*.jot +*.env \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index de5203065..ff1897ea3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -175,10 +175,11 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.34" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8158b4878c67837e5413721cc44298e6a2d88d39203175ea025e51892a16ba4c" +checksum = "742b81ecb16cc5e9c029d55257cc8d9d5f9409f6384b65d996e583ad62a8c831" dependencies = [ + "alloy-primitives 0.8.8", "num_enum", "strum 0.26.3", ] @@ -189,7 +190,7 @@ version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "c-kzg", @@ -204,7 +205,7 @@ dependencies = [ "alloy-dyn-abi", "alloy-json-abi", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-provider", "alloy-pubsub", "alloy-rpc-types-eth", @@ -223,7 +224,7 @@ checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-sol-types", ] @@ -235,7 +236,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413902aa18a97569e60f679c23f46a18db1656d87ab4d4e49d0e1e52042f66df" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-type-parser", "alloy-sol-types", "const-hex", @@ -250,11 +251,11 @@ name = "alloy-eips" version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "c-kzg", - "derive_more", + "derive_more 0.99.18", "once_cell", "serde", "sha2 0.10.8", @@ -265,7 +266,7 @@ name = "alloy-genesis" version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-serde", "serde", ] @@ -276,7 +277,7 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc05b04ac331a9f07e3a4036ef7926e49a8bf84a99a1ccfc7e2ab55a5fcbb372" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-type-parser", "serde", "serde_json", @@ -287,7 +288,7 @@ name = "alloy-json-rpc" version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "serde", "serde_json", "thiserror", @@ -302,7 +303,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -319,7 +320,7 @@ version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.7.7", "k256", "serde_json", "tempfile", @@ -338,7 +339,7 @@ dependencies = [ "bytes 1.7.2", "cfg-if", "const-hex", - "derive_more", + "derive_more 0.99.18", "hex-literal", "itoa", "k256", @@ -350,6 +351,23 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "alloy-primitives" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f35429a652765189c1c5092870d8360ee7b7769b09b06d89ebaefd34676446" +dependencies = [ + "bytes 1.7.2", + "cfg-if", + "const-hex", + "derive_more 1.0.0", + "hex-literal", + "itoa", + "paste", + "ruint", + "tiny-keccak", +] + [[package]] name = "alloy-provider" version = "0.1.4" @@ -361,7 +379,7 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-node-bindings", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-anvil", @@ -378,8 +396,8 @@ dependencies = [ "dashmap 5.5.3", "futures", "futures-utils-wasm", - "lru 0.12.4", - "pin-project 1.1.5", + "lru 0.12.5", + "pin-project 1.1.6", "reqwest 0.12.8", "serde", "serde_json", @@ -394,7 +412,7 @@ version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-transport", "bimap", "futures", @@ -434,14 +452,14 @@ version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-pubsub", "alloy-transport", "alloy-transport-http", "alloy-transport-ipc", "alloy-transport-ws", "futures", - "pin-project 1.1.5", + "pin-project 1.1.6", "reqwest 0.12.8", "serde", "serde_json", @@ -468,7 +486,7 @@ name = "alloy-rpc-types-anvil" version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-serde", "serde", ] @@ -480,7 +498,7 @@ source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-rpc-types-eth", "alloy-serde", @@ -497,7 +515,7 @@ source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "alloy-sol-types", @@ -512,7 +530,7 @@ name = "alloy-rpc-types-trace" version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rpc-types-eth", "alloy-serde", "serde", @@ -525,7 +543,7 @@ name = "alloy-serde" version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "serde", "serde_json", ] @@ -535,7 +553,7 @@ name = "alloy-signer" version = "0.1.4" source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104b4d1421f58cbf9a2#83343b172585fe4e040fb104b4d1421f58cbf9a2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "async-trait", "auto_impl", "elliptic-curve 0.13.8", @@ -550,7 +568,7 @@ source = "git+https://github.com/alloy-rs/alloy.git?rev=83343b172585fe4e040fb104 dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-signer", "async-trait", "elliptic-curve 0.13.8", @@ -627,7 +645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-macro", "const-hex", "serde", @@ -676,7 +694,7 @@ dependencies = [ "bytes 1.7.2", "futures", "interprocess", - "pin-project 1.1.5", + "pin-project 1.1.6", "serde_json", "tokio", "tokio-util", @@ -692,7 +710,7 @@ dependencies = [ "alloy-transport", "futures", "http 1.1.0", - "rustls 0.23.13", + "rustls 0.23.15", "serde_json", "tokio", "tokio-tungstenite 0.23.1", @@ -854,7 +872,7 @@ dependencies = [ "fail", "futures", "hex", - "hyper 0.14.30", + "hyper 0.14.31", "itertools 0.12.1", "mime", "mini-moka", @@ -963,7 +981,7 @@ dependencies = [ "aptos-metrics-core", "aptos-types", "bcs 0.1.4", - "clap 4.5.19", + "clap 4.5.20", "dashmap 5.5.3", "itertools 0.12.1", "jemallocator", @@ -1340,7 +1358,7 @@ dependencies = [ "aptos-types", "aptos-vm", "bcs 0.1.4", - "clap 4.5.19", + "clap 4.5.20", "crossbeam-channel", "ctrlc", "dashmap 5.5.3", @@ -1420,7 +1438,7 @@ dependencies = [ "aptos-sdk", "async-trait", "captcha", - "clap 4.5.19", + "clap 4.5.20", "deadpool-redis", "enum_dispatch", "futures", @@ -1481,7 +1499,7 @@ dependencies = [ "blake2-rfc", "bulletproofs", "byteorder", - "clap 4.5.19", + "clap 4.5.20", "codespan-reporting", "curve25519-dalek-ng", "either", @@ -1646,7 +1664,7 @@ dependencies = [ "chrono", "futures", "hex", - "hyper 0.14.30", + "hyper 0.14.31", "itertools 0.12.1", "move-binary-format", "move-core-types", @@ -1681,7 +1699,7 @@ dependencies = [ "flate2", "futures", "google-cloud-storage", - "hyper 0.14.30", + "hyper 0.14.31", "serde", "serde_json", "tar", @@ -1969,7 +1987,7 @@ dependencies = [ [[package]] name = "aptos-moving-average" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-indexer-processors#b5e05c12e6e6a353989a370dce1773255f7caca4" +source = "git+https://github.com/movementlabsxyz/aptos-indexer-processors#8e83cde3cb75fabdade9485e0af680cc4b73ca8e" dependencies = [ "chrono", ] @@ -2022,7 +2040,7 @@ dependencies = [ "aptos-types", "bytes 1.7.2", "futures", - "pin-project 1.1.5", + "pin-project 1.1.6", "serde", "tokio", "tokio-util", @@ -2061,7 +2079,7 @@ dependencies = [ "maplit", "once_cell", "ordered-float 3.9.2", - "pin-project 1.1.5", + "pin-project 1.1.6", "rand 0.7.3", "rand 0.8.5", "serde", @@ -2336,7 +2354,7 @@ dependencies = [ "anyhow", "aptos-types", "bcs 0.1.4", - "clap 4.5.19", + "clap 4.5.20", "heck 0.4.1", "move-core-types", "once_cell", @@ -2444,7 +2462,7 @@ dependencies = [ "aptos-profiler", "async-mutex", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "lazy_static", "mime", "pprof", @@ -2490,7 +2508,7 @@ dependencies = [ "aptos-infallible", "enum_dispatch", "futures", - "pin-project 1.1.5", + "pin-project 1.1.6", "thiserror", "tokio", ] @@ -2607,7 +2625,7 @@ dependencies = [ "bytes 1.7.2", "claims", "crossbeam-channel", - "derive_more", + "derive_more 0.99.18", "fail", "futures", "hex", @@ -3152,9 +3170,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.7" +version = "1.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8191fb3091fa0561d1379ef80333c3c7191c6f0435d986e85821bcf7acbd1126" +checksum = "7198e6f03240fdceba36656d8be440297b6b82270325908c7381f37d826a74f6" dependencies = [ "aws-credential-types", "aws-runtime", @@ -3220,9 +3238,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.53.0" +version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43fad71130014e11f42fadbdcce5df12ee61866f8ab9bad773b138d4b3c11087" +checksum = "8888c238bf93c77c5df8274b3999fd7fc1bb3fb658616f40dfde9e4fcd9efd94" dependencies = [ "ahash 0.8.11", "aws-credential-types", @@ -3244,7 +3262,7 @@ dependencies = [ "hmac 0.12.1", "http 0.2.12", "http-body 0.4.6", - "lru 0.12.4", + "lru 0.12.5", "once_cell", "percent-encoding", "regex-lite", @@ -3255,9 +3273,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.44.0" +version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b90cfe6504115e13c41d3ea90286ede5aa14da294f3fe077027a6e83850843c" +checksum = "0dc2faec3205d496c7e57eff685dd944203df7ce16a4116d0281c44021788a7b" dependencies = [ "aws-credential-types", "aws-runtime", @@ -3277,9 +3295,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.45.0" +version = "1.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167c0fad1f212952084137308359e8e4c4724d1c643038ce163f06de9662c1d0" +checksum = "c93c241f52bc5e0476e259c953234dab7e2a35ee207ee202e86c0095ec4951dc" dependencies = [ "aws-credential-types", "aws-runtime", @@ -3299,9 +3317,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.44.0" +version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb5f98188ec1435b68097daa2a37d74b9d17c9caa799466338a8d1544e71b9d" +checksum = "b259429be94a3459fa1b00c5684faee118d74f9577cc50aebadc36e507c63b5f" dependencies = [ "aws-credential-types", "aws-runtime", @@ -3434,9 +3452,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1ce695746394772e7000b39fe073095db6d45a862d0767dd5ad0ac0d7f8eb87" +checksum = "a065c0fe6fdbdf9f11817eb68582b2ab4aff9e9c39e986ae48f7ec576c6322db" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -3449,7 +3467,7 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", @@ -3538,7 +3556,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "itoa", "matchit", "memchr", @@ -3665,9 +3683,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bb8" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10cf871f3ff2ce56432fddc2615ac7acc3aa22ca321f8fea800846fbb32f188" +checksum = "d89aabfae550a5c44b43ab941844ffcd2e993cb6900b342debf59e9ea74acdb8" dependencies = [ "async-trait", "futures-util", @@ -3784,9 +3802,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.69.4" +version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ "bitflags 2.6.0", "cexpr", @@ -4142,7 +4160,7 @@ dependencies = [ "bridge-grpc", "delegate", "derive-new", - "derive_more", + "derive_more 0.99.18", "dot-movement", "futures", "futures-time", @@ -4172,7 +4190,7 @@ name = "bridge-setup" version = "0.0.2" dependencies = [ "alloy", - "alloy-primitives", + "alloy-primitives 0.7.7", "anyhow", "aptos-sdk", "bridge-config", @@ -4279,9 +4297,9 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" [[package]] name = "byteorder" @@ -4427,9 +4445,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.24" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "jobserver", "libc", @@ -4459,7 +4477,7 @@ dependencies = [ "async-trait", "celestia-types", "http 1.1.0", - "jsonrpsee 0.24.5", + "jsonrpsee 0.24.7", "serde", "thiserror", "tracing", @@ -4697,9 +4715,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -4707,9 +4725,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -5670,6 +5688,27 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", + "unicode-xid", +] + [[package]] name = "deunicode" version = "1.6.0" @@ -6344,6 +6383,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -6409,9 +6454,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -6424,9 +6469,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -6434,15 +6479,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -6451,9 +6496,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -6472,9 +6517,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -6483,15 +6528,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-time" @@ -6513,9 +6558,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -6633,9 +6678,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git2" @@ -6951,6 +6996,11 @@ name = "hashbrown" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "hdrhistogram" @@ -7249,9 +7299,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes 1.7.2", "futures-channel", @@ -7273,9 +7323,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes 1.7.2", "futures-channel", @@ -7299,7 +7349,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -7315,10 +7365,10 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "log", - "rustls 0.23.13", + "rustls 0.23.15", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -7331,7 +7381,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.30", + "hyper 0.14.31", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -7344,7 +7394,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes 1.7.2", - "hyper 0.14.30", + "hyper 0.14.31", "native-tls", "tokio", "tokio-native-tls", @@ -7358,7 +7408,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes 1.7.2", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "native-tls", "tokio", @@ -7377,7 +7427,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2 0.5.7", "tokio", @@ -7580,7 +7630,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232929e1d75fe899576a3d5c7416ad0d88dbfbb3c3d6aa00873a7408a50ddb88" dependencies = [ "ahash 0.8.11", - "clap 4.5.19", + "clap 4.5.20", "crossbeam-channel", "crossbeam-utils", "dashmap 6.1.0", @@ -7662,9 +7712,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "iprange" @@ -7782,9 +7832,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -7800,30 +7850,30 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.24.5" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126b48a5acc3c52fbd5381a77898cb60e145123179588a29e7ac48f9c06e401b" +checksum = "c5c71d8c1a731cc4227c2f698d377e7848ca12c8a48866fc5e6951c43a4db843" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-client", "jsonrpsee-proc-macros", - "jsonrpsee-types 0.24.5", + "jsonrpsee-types 0.24.7", "jsonrpsee-ws-client", "tracing", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.24.5" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf679a8e0e083c77997f7c4bb4ca826577105906027ae462aac70ff348d02c6a" +checksum = "548125b159ba1314104f5bb5f38519e03a41862786aa3925cf349aae9cdd546e" dependencies = [ "base64 0.22.1", "futures-util", "http 1.1.0", "jsonrpsee-core", - "pin-project 1.1.5", - "rustls 0.23.13", + "pin-project 1.1.6", + "rustls 0.23.15", "rustls-pki-types", "rustls-platform-verifier", "soketto", @@ -7837,9 +7887,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.24.5" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e503369a76e195b65af35058add0e6900b794a4e9a9316900ddd3a87a80477" +checksum = "f2882f6f8acb9fdaec7cefc4fd607119a9bd709831df7d7672a1d3b644628280" dependencies = [ "async-trait", "bytes 1.7.2", @@ -7848,8 +7898,8 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "jsonrpsee-types 0.24.5", - "pin-project 1.1.5", + "jsonrpsee-types 0.24.7", + "pin-project 1.1.6", "rustc-hash 2.0.0", "serde", "serde_json", @@ -7861,19 +7911,19 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.24.5" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2c0caba4a6a8efbafeec9baa986aa22a75a96c29d3e4b0091b0098d6470efb5" +checksum = "b3638bc4617f96675973253b3a45006933bde93c2fd8a6170b33c777cc389e5b" dependencies = [ "async-trait", "base64 0.22.1", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls 0.27.3", "hyper-util", "jsonrpsee-core", - "jsonrpsee-types 0.24.5", - "rustls 0.23.13", + "jsonrpsee-types 0.24.7", + "rustls 0.23.15", "rustls-platform-verifier", "serde", "serde_json", @@ -7886,9 +7936,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.24.5" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc660a9389e2748e794a40673a4155d501f32db667757cdb80edeff0306b489b" +checksum = "c06c01ae0007548e73412c08e2285ffe5d723195bf268bce67b1b77c3bb2a14d" dependencies = [ "heck 0.5.0", "proc-macro-crate 3.2.0", @@ -7913,9 +7963,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.24.5" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8fb16314327cbc94fdf7965ef7e4422509cd5597f76d137bd104eb34aeede67" +checksum = "a178c60086f24cc35bb82f57c651d0d25d99c4742b4d335de04e97fa1f08a8a1" dependencies = [ "http 1.1.0", "serde", @@ -7925,14 +7975,14 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.24.5" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39aabf5d6c6f22da8d5b808eea1fab0736059f11fb42f71f141b14f404e5046a" +checksum = "0fe322e0896d0955a3ebdd5bf813571c53fea29edd713bc315b76620b327e86d" dependencies = [ "http 1.1.0", "jsonrpsee-client-transport", "jsonrpsee-core", - "jsonrpsee-types 0.24.5", + "jsonrpsee-types 0.24.7", "url", ] @@ -8097,9 +8147,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libgit2-sys" @@ -8318,11 +8368,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -8364,9 +8414,11 @@ dependencies = [ "celestia-types", "chrono", "dot-movement", + "ecdsa 0.16.9", "futures", "godfig", "hex", + "k256", "m1-da-light-node-grpc", "m1-da-light-node-util", "m1-da-light-node-verifier", @@ -8391,11 +8443,13 @@ name = "m1-da-light-node-client" version = "0.0.2" dependencies = [ "anyhow", + "ecdsa 0.16.9", "m1-da-light-node-grpc", "movement-types", "serde_json", "tokio", "tokio-stream", + "tonic 0.11.0", ] [[package]] @@ -8457,17 +8511,22 @@ dependencies = [ name = "m1-da-light-node-util" version = "0.0.2" dependencies = [ + "alloy", "anyhow", "async-stream", + "bcs 0.1.4", "celestia-rpc", "celestia-types", "dot-movement", + "ecdsa 0.16.9", "godfig", "hex", "jsonrpsee 0.20.4", + "k256", "m1-da-light-node-grpc", "memseq-util", "prost 0.12.6", + "rand 0.8.5", "serde", "serde_derive", "serde_json", @@ -8478,6 +8537,7 @@ dependencies = [ "tonic 0.11.0", "tracing", "tracing-subscriber 0.3.18", + "zstd 0.13.2", ] [[package]] @@ -8489,15 +8549,20 @@ dependencies = [ "celestia-rpc", "celestia-types", "dot-movement", + "ecdsa 0.16.9", "hex", + "k256", "m1-da-light-node-grpc", "m1-da-light-node-setup", "m1-da-light-node-util", "prost 0.12.6", + "rand 0.7.3", "serde_json", + "thiserror", "tokio", "tokio-stream", "tonic 0.11.0", + "tracing", ] [[package]] @@ -8612,8 +8677,8 @@ dependencies = [ "borsh 0.10.4", "bytes 1.7.2", "chrono", - "clap 4.5.19", - "derive_more", + "clap 4.5.20", + "derive_more 0.99.18", "dirs", "fail", "futures", @@ -8665,7 +8730,7 @@ dependencies = [ "alloy", "alloy-contract", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-provider", "alloy-rpc-types", "alloy-signer", @@ -8719,7 +8784,7 @@ dependencies = [ name = "mcr-settlement-runner" version = "0.0.2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "anyhow", "commander", "dot-movement", @@ -8740,7 +8805,7 @@ name = "mcr-settlement-setup" version = "0.0.2" dependencies = [ "alloy", - "alloy-primitives", + "alloy-primitives 0.7.7", "anyhow", "commander", "dot-movement", @@ -9032,7 +9097,7 @@ version = "0.1.0" source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81c378568eba2b467a7ef6a56e#7a0e210fe29e2c81c378568eba2b467a7ef6a56e" dependencies = [ "anyhow", - "clap 4.5.19", + "clap 4.5.20", "crossterm 0.26.1", "move-binary-format", "move-bytecode-source-map", @@ -9047,7 +9112,7 @@ version = "0.1.0" source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81c378568eba2b467a7ef6a56e#7a0e210fe29e2c81c378568eba2b467a7ef6a56e" dependencies = [ "anyhow", - "clap 4.5.19", + "clap 4.5.20", "codespan-reporting", "colored", "move-binary-format", @@ -9095,7 +9160,7 @@ source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81 dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.5.19", + "clap 4.5.20", "codespan-reporting", "hex", "move-binary-format", @@ -9122,7 +9187,7 @@ dependencies = [ "abstract-domain-derive", "anyhow", "bcs 0.1.4", - "clap 4.5.19", + "clap 4.5.20", "codespan-reporting", "ethnum", "flexi_logger", @@ -9177,7 +9242,7 @@ source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81 dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.5.19", + "clap 4.5.20", "codespan", "colored", "move-binary-format", @@ -9195,7 +9260,7 @@ version = "0.1.0" source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81c378568eba2b467a7ef6a56e#7a0e210fe29e2c81c378568eba2b467a7ef6a56e" dependencies = [ "anyhow", - "clap 4.5.19", + "clap 4.5.20", "colored", "move-binary-format", "move-bytecode-source-map", @@ -9212,7 +9277,7 @@ version = "0.1.0" source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81c378568eba2b467a7ef6a56e#7a0e210fe29e2c81c378568eba2b467a7ef6a56e" dependencies = [ "anyhow", - "clap 4.5.19", + "clap 4.5.20", "codespan", "codespan-reporting", "itertools 0.12.1", @@ -9244,7 +9309,7 @@ source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81 dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.5.19", + "clap 4.5.20", "move-binary-format", "move-bytecode-source-map", "move-bytecode-verifier", @@ -9329,7 +9394,7 @@ version = "0.1.0" source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81c378568eba2b467a7ef6a56e#7a0e210fe29e2c81c378568eba2b467a7ef6a56e" dependencies = [ "anyhow", - "clap 4.5.19", + "clap 4.5.20", "colored", "itertools 0.12.1", "move-abigen", @@ -9364,7 +9429,7 @@ source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81 dependencies = [ "anyhow", "atty", - "clap 4.5.19", + "clap 4.5.20", "codespan-reporting", "itertools 0.12.1", "log", @@ -9530,7 +9595,7 @@ source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7a0e210fe29e2c81 dependencies = [ "anyhow", "better_any", - "clap 4.5.19", + "clap 4.5.20", "codespan-reporting", "colored", "itertools 0.12.1", @@ -10055,21 +10120,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" @@ -10085,9 +10147,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -10117,9 +10179,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -10475,9 +10537,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", "thiserror", @@ -10486,9 +10548,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" dependencies = [ "pest", "pest_generator", @@ -10496,9 +10558,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" dependencies = [ "pest", "pest_meta", @@ -10509,9 +10571,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" dependencies = [ "once_cell", "pest", @@ -10597,11 +10659,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ - "pin-project-internal 1.1.5", + "pin-project-internal 1.1.6", ] [[package]] @@ -10617,9 +10679,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", @@ -10752,7 +10814,7 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "mime", "multer", "nix 0.27.1", @@ -10800,7 +10862,7 @@ checksum = "e69c569eb0671cc85e65cfb6bd960d0168d24732ff58825227b4d2a10167ba91" dependencies = [ "base64 0.13.1", "bytes 1.7.2", - "derive_more", + "derive_more 0.99.18", "futures-util", "mime", "num-traits", @@ -10863,12 +10925,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "poseidon-ark" version = "0.0.1" @@ -11095,9 +11151,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -11119,7 +11175,7 @@ dependencies = [ "bitflags 2.6.0", "canonical_json", "chrono", - "clap 4.5.19", + "clap 4.5.20", "diesel", "diesel-async", "diesel_migrations", @@ -11131,7 +11187,7 @@ dependencies = [ "google-cloud-pubsub", "google-cloud-storage", "hex", - "hyper 0.14.30", + "hyper 0.14.31", "itertools 0.12.1", "jemallocator", "kanal", @@ -11718,7 +11774,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", @@ -11766,7 +11822,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls 0.27.3", "hyper-tls 0.6.0", "hyper-util", @@ -12117,9 +12173,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "log", "once_cell", @@ -12175,9 +12231,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-platform-verifier" @@ -12190,7 +12246,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.13", + "rustls 0.23.15", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", @@ -12239,9 +12295,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "rusty-fork" @@ -12272,9 +12328,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -12543,9 +12599,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2" dependencies = [ "indexmap 2.6.0", "itoa", @@ -12599,9 +12655,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9720086b3357bcb44fce40117d769a4d068c70ecfa190850a980a71755f66fcc" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", @@ -12617,9 +12673,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f1abbfe725f27678f4663bcacb75a83e829fd464c25d78dd038a3a29e307cec" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling 0.20.10", "proc-macro2", @@ -12661,7 +12717,7 @@ dependencies = [ "aptos-system-utils", "async-trait", "backtrace", - "clap 4.5.19", + "clap 4.5.20", "prometheus", "serde", "serde_yaml 0.8.26", @@ -13294,7 +13350,7 @@ dependencies = [ "aptos-faucet-core", "aptos-logger", "aptos-sdk", - "clap 4.5.19", + "clap 4.5.20", "dot-movement", "suzuka-config", "tokio", @@ -13311,6 +13367,7 @@ dependencies = [ "dot-movement", "futures", "godfig", + "hex", "m1-da-light-node-client", "m1-da-light-node-util", "maptos-dof-execution", @@ -13366,7 +13423,7 @@ name = "suzuka-indexer-service" version = "0.0.2" dependencies = [ "anyhow", - "clap 4.5.19", + "clap 4.5.20", "dot-movement", "maptos-execution-util", "num_cpus", @@ -13474,7 +13531,7 @@ dependencies = [ "aws-config", "aws-sdk-s3", "aws-types", - "clap 4.5.19", + "clap 4.5.20", "flate2", "flocks", "futures", @@ -13877,7 +13934,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" dependencies = [ - "pin-project 1.1.5", + "pin-project 1.1.6", "rand 0.8.5", "tokio", ] @@ -13909,7 +13966,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.13", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] @@ -13946,7 +14003,7 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.13", + "rustls 0.23.15", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -14064,10 +14121,10 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-timeout", "percent-encoding", - "pin-project 1.1.5", + "pin-project 1.1.6", "prost 0.11.9", "rustls-pemfile 1.0.4", "tokio", @@ -14095,10 +14152,10 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-timeout", "percent-encoding", - "pin-project 1.1.5", + "pin-project 1.1.6", "prost 0.12.6", "rustls-native-certs 0.7.3", "rustls-pemfile 2.2.0", @@ -14148,7 +14205,7 @@ dependencies = [ "futures-core", "futures-util", "indexmap 1.9.3", - "pin-project 1.1.5", + "pin-project 1.1.6", "pin-project-lite", "rand 0.8.5", "slab", @@ -14301,9 +14358,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" +checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" dependencies = [ "serde", "stable_deref_trait", @@ -14360,7 +14417,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.23.13", + "rustls 0.23.15", "rustls-pki-types", "sha1", "thiserror", @@ -14695,9 +14752,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom 0.2.15", "serde", @@ -14788,13 +14845,13 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "mime", "mime_guess", "multer", "percent-encoding", - "pin-project 1.1.5", + "pin-project 1.1.6", "rustls-pemfile 2.2.0", "scoped-tls", "serde", @@ -14828,9 +14885,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -14839,9 +14896,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -14854,9 +14911,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -14866,9 +14923,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -14876,9 +14933,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -14889,9 +14946,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" @@ -14908,9 +14965,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index cb017079a..28f188d74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -299,6 +299,7 @@ uuid = { version = "1.10.0", features = ["v4"] } tar = "0.4.41" flate2 = "1.0.31" blake-3 = "1.4.0" +ecdsa = { version = "0.16.9", features = ["signing", "verifying", "der", "pem", "pkcs8"] } regex = "1.10.6" globset = "0.4.15" glob = "0.3.1" diff --git a/docker/README.md b/docker/README.md old mode 100755 new mode 100644 diff --git a/docker/build/bridge-service/Dockerfile b/docker/build/bridge-service/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/bridge-setup/Dockerfile b/docker/build/bridge-setup/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/helios/Dockerfile b/docker/build/helios/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/m1-da-light-node-celestia-appd/Dockerfile b/docker/build/m1-da-light-node-celestia-appd/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/m1-da-light-node-celestia-bridge/Dockerfile b/docker/build/m1-da-light-node-celestia-bridge/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/m1-da-light-node/Dockerfile b/docker/build/m1-da-light-node/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/suzuka-client-e2e-followers-consistent/Dockerfile b/docker/build/suzuka-client-e2e-followers-consistent/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/suzuka-client-e2e-simple-interaction/Dockerfile b/docker/build/suzuka-client-e2e-simple-interaction/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/suzuka-config/Dockerfile b/docker/build/suzuka-config/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/suzuka-faucet-service/Dockerfile b/docker/build/suzuka-faucet-service/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/suzuka-full-node-setup/Dockerfile b/docker/build/suzuka-full-node-setup/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/suzuka-full-node/Dockerfile b/docker/build/suzuka-full-node/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/suzuka-indexer/Dockerfile b/docker/build/suzuka-indexer/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/build/wait-for-celestia-light-node/Dockerfile b/docker/build/wait-for-celestia-light-node/Dockerfile old mode 100755 new mode 100644 diff --git a/docker/compose/bridge/docker-compose.helios.yml b/docker/compose/bridge/docker-compose.helios.yml old mode 100755 new mode 100644 diff --git a/docker/compose/bridge/docker-compose.mvt-remote.yml b/docker/compose/bridge/docker-compose.mvt-remote.yml old mode 100755 new mode 100644 diff --git a/docker/compose/bridge/docker-compose.setup.yml b/docker/compose/bridge/docker-compose.setup.yml old mode 100755 new mode 100644 diff --git a/docker/compose/bridge/docker-compose.yml b/docker/compose/bridge/docker-compose.yml old mode 100755 new mode 100644 diff --git a/docker/compose/grafana-alloy/README.md b/docker/compose/grafana-alloy/README.md old mode 100755 new mode 100644 diff --git a/docker/compose/grafana-alloy/config.alloy b/docker/compose/grafana-alloy/config.alloy old mode 100755 new mode 100644 diff --git a/docker/compose/grafana-alloy/docker-compose.yml b/docker/compose/grafana-alloy/docker-compose.yml old mode 100755 new mode 100644 diff --git a/docker/compose/grafana-alloy/img/1.png b/docker/compose/grafana-alloy/img/1.png old mode 100755 new mode 100644 diff --git a/docker/compose/grafana-alloy/img/2.png b/docker/compose/grafana-alloy/img/2.png old mode 100755 new mode 100644 diff --git a/docker/compose/grafana-alloy/img/3.png b/docker/compose/grafana-alloy/img/3.png old mode 100755 new mode 100644 diff --git a/docker/compose/grafana-alloy/img/4.png b/docker/compose/grafana-alloy/img/4.png old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-full-node/docker-compose.faucet-replicas.yml b/docker/compose/suzuka-full-node/docker-compose.faucet-replicas.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-full-node/docker-compose.follower.yml b/docker/compose/suzuka-full-node/docker-compose.follower.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-full-node/docker-compose.leader.yml b/docker/compose/suzuka-full-node/docker-compose.leader.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-full-node/docker-compose.local.yml b/docker/compose/suzuka-full-node/docker-compose.local.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-full-node/docker-compose.test-followers.yml b/docker/compose/suzuka-full-node/docker-compose.test-followers.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-full-node/docker-compose.test.yml b/docker/compose/suzuka-full-node/docker-compose.test.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-full-node/docker-compose.yml b/docker/compose/suzuka-full-node/docker-compose.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-indexer/.remote-suzuka-node.env b/docker/compose/suzuka-indexer/.remote-suzuka-node.env old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-indexer/README.md b/docker/compose/suzuka-indexer/README.md old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-indexer/docker-compose.hasura.yml b/docker/compose/suzuka-indexer/docker-compose.hasura.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-indexer/docker-compose.indexer.yml b/docker/compose/suzuka-indexer/docker-compose.indexer.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-indexer/docker-compose.local-development.indexer.yml b/docker/compose/suzuka-indexer/docker-compose.local-development.indexer.yml old mode 100755 new mode 100644 diff --git a/docker/compose/suzuka-indexer/indexer-config.json b/docker/compose/suzuka-indexer/indexer-config.json old mode 100755 new mode 100644 diff --git a/networks/suzuka/suzuka-full-node/Cargo.toml b/networks/suzuka/suzuka-full-node/Cargo.toml index 27ce49fa2..8eef0f219 100644 --- a/networks/suzuka/suzuka-full-node/Cargo.toml +++ b/networks/suzuka/suzuka-full-node/Cargo.toml @@ -36,6 +36,7 @@ rocksdb = { workspace = true } tracing = { workspace = true } bcs = { workspace = true } zstd = { workspace = true } +hex = { workspace = true } [features] default = [] diff --git a/networks/suzuka/suzuka-full-node/src/da_db.rs b/networks/suzuka/suzuka-full-node/src/da_db.rs index 38c057406..9dd13f05d 100644 --- a/networks/suzuka/suzuka-full-node/src/da_db.rs +++ b/networks/suzuka/suzuka-full-node/src/da_db.rs @@ -32,7 +32,7 @@ impl DaDB { Ok(Self { inner: Arc::new(db) }) } - pub async fn add_executed_block(&self, id: String) -> Result<(), anyhow::Error> { + pub async fn add_executed_block(&self, id: Vec) -> Result<(), anyhow::Error> { let da_db = self.inner.clone(); tokio::task::spawn_blocking(move || { let cf = da_db @@ -46,7 +46,7 @@ impl DaDB { Ok(()) } - pub async fn has_executed_block(&self, id: String) -> Result { + pub async fn has_executed_block(&self, id: Vec) -> Result { let da_db = self.inner.clone(); let id = tokio::task::spawn_blocking(move || { let cf = da_db diff --git a/networks/suzuka/suzuka-full-node/src/tasks/execute_settle.rs b/networks/suzuka/suzuka-full-node/src/tasks/execute_settle.rs index e8a00da48..db3437dd5 100644 --- a/networks/suzuka/suzuka-full-node/src/tasks/execute_settle.rs +++ b/networks/suzuka/suzuka-full-node/src/tasks/execute_settle.rs @@ -114,8 +114,9 @@ where }; info!( - block_id = %block_id, + block_id = %hex::encode(block_id.clone()), da_height = da_height, + time = block_timestamp, "Processing block from DA" ); @@ -130,17 +131,11 @@ where anyhow::bail!("Invalid DA height: {:?}", da_height); } - // decompress the block bytes - let block = tokio::task::spawn_blocking(move || { - let decompressed_block_bytes = zstd::decode_all(&block_bytes[..])?; - let block: Block = bcs::from_bytes(&decompressed_block_bytes)?; - Ok::(block) - }) - .await??; + let block: Block = bcs::from_bytes(&block_bytes[..])?; // get the transactions let transactions_count = block.transactions().len(); - let span = info_span!(target: "movement_timing", "execute_block", id = %block_id); + let span = info_span!(target: "movement_timing", "execute_block", id = ?block_id); let commitment = self.execute_block_with_retries(block, block_timestamp).instrument(span).await?; @@ -152,7 +147,7 @@ where self.da_db.set_synced_height(da_height - 1).await?; // set the block as executed - self.da_db.add_executed_block(block_id.to_string()).await?; + self.da_db.add_executed_block(block_id.clone()).await?; // todo: this needs defaults if self.settlement_enabled() { @@ -164,7 +159,7 @@ where } } } else { - info!(block_id = %block_id, "Skipping settlement"); + info!(block_id = ?block_id, "Skipping settlement"); } Ok(()) diff --git a/process-compose/suzuka-full-node/README.md b/process-compose/suzuka-full-node/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/proto/movementlabs/protocol_units/da/m1/light_node/v1beta1.proto b/proto/movementlabs/protocol_units/da/m1/light_node/v1beta1.proto index 759253046..30d53a780 100644 --- a/proto/movementlabs/protocol_units/da/m1/light_node/v1beta1.proto +++ b/proto/movementlabs/protocol_units/da/m1/light_node/v1beta1.proto @@ -4,17 +4,12 @@ package movementlabs.protocol_units.da.m1.light_node.v1beta1; // Request and response messages message Blob { - string blob_id = 1; + bytes blob_id = 1; bytes data = 2; uint64 height = 3; - // bytes signature = 4; // at some point a signature will be added here + bytes signature = 4; uint64 timestamp = 5; -} - -enum VerificationMode { - COWBOY = 0; - VALIDATOR_IN = 1; - M_OF_N = 2; + bytes signer = 6; } message BlobResponse { @@ -82,16 +77,7 @@ message BatchWriteResponse { repeated BlobResponse blobs = 1; } -message UpdateVerificationParametersRequest { - VerificationMode mode = 1; - repeated string signers = 2; - uint32 m = 3; - uint32 n = 4; -} - -message UpdateVerificationParametersResponse { - VerificationMode mode = 1; -} + // LightNode service definition service LightNodeService { @@ -109,7 +95,4 @@ service LightNodeService { rpc BatchRead (BatchReadRequest) returns (BatchReadResponse); rpc BatchWrite (BatchWriteRequest) returns (BatchWriteResponse); - // Update and manage verification parameters. - rpc UpdateVerificationParameters (UpdateVerificationParametersRequest) returns (UpdateVerificationParametersResponse); - } diff --git a/protocol-units/da/m1/light-node-client/Cargo.toml b/protocol-units/da/m1/light-node-client/Cargo.toml index d4f04db91..f2170938f 100644 --- a/protocol-units/da/m1/light-node-client/Cargo.toml +++ b/protocol-units/da/m1/light-node-client/Cargo.toml @@ -18,6 +18,8 @@ anyhow = { workspace = true } tokio-stream = { workspace = true } movement-types = { workspace = true } serde_json = { workspace = true } +ecdsa = { workspace = true } +tonic = { workspace = true } [features] sequencer = [] diff --git a/protocol-units/da/m1/light-node-verifier/Cargo.toml b/protocol-units/da/m1/light-node-verifier/Cargo.toml index cf2bb3349..d8a476253 100644 --- a/protocol-units/da/m1/light-node-verifier/Cargo.toml +++ b/protocol-units/da/m1/light-node-verifier/Cargo.toml @@ -24,11 +24,16 @@ celestia-types = { workspace = true } anyhow = { workspace = true } hex = { workspace = true } async-stream = { workspace = true } +thiserror = { workspace = true } serde_json = { workspace = true } +ecdsa = { workspace = true, features = [ "signing", "verifying", "der"] } +tracing = { workspace = true } [dev-dependencies] m1-da-light-node-setup = { workspace = true } dot-movement = { workspace = true } +k256 = { workspace = true } +rand = { workspace = true } [lints] workspace = true diff --git a/protocol-units/da/m1/light-node-verifier/src/celestia/mod.rs b/protocol-units/da/m1/light-node-verifier/src/celestia/mod.rs new file mode 100644 index 000000000..423748bc2 --- /dev/null +++ b/protocol-units/da/m1/light-node-verifier/src/celestia/mod.rs @@ -0,0 +1,121 @@ +use crate::{Error, Verified, VerifierOperations}; +use celestia_rpc::Client; +use celestia_types::{nmt::Namespace, Blob}; +use m1_da_light_node_util::ir_blob::IntermediateBlobRepresentation; +use std::sync::Arc; + +#[derive(Clone)] +pub struct Verifier { + /// The Celestia RPC client + pub client: Arc, + /// The namespace of the Celestia Blob + pub namespace: Namespace, +} + +impl Verifier { + pub fn new(client: Arc, namespace: Namespace) -> Self { + Self { client, namespace } + } +} + +#[tonic::async_trait] +impl VerifierOperations for Verifier { + /// Verifies a Celestia Blob as a Valid IntermediateBlobRepresentation + async fn verify(&self, blob: Blob, _height: u64) -> Result, Error> { + // Only assert that we can indeed get an IntermediateBlobRepresentation from the Blob + let ir_blob = IntermediateBlobRepresentation::try_from(blob).map_err(|e| Error::Internal(e.to_string()))?; + + Ok(Verified::new(ir_blob)) + } +} + +pub mod pessimistic; +#[cfg(all(test, feature = "integration-tests"))] +mod tests { + use super::*; + use celestia_types::blob::GasPrice; + + /// todo: Investigate why this test sporadically fails. + #[tokio::test] + pub async fn test_valid_verifies() -> Result<(), anyhow::Error> { + let dot_movement = dot_movement::DotMovement::try_from_env()?; + let config = dot_movement + .try_get_config_from_json::()?; + + let data = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + let blob = Blob::new(celestia_namespace.clone(), data.clone())?; + + let height = client.blob_submit(&[blob], GasPrice::default()).await?; + + let included = verifier.verify(VerificationMode::Cowboy, &data, height).await?; + + assert!(included); + + Ok(()) + } + + #[tokio::test] + pub async fn test_absent_does_not_verify() -> Result<(), anyhow::Error> { + let dot_movement = dot_movement::DotMovement::try_from_env()?; + let config = dot_movement + .try_get_config_from_json::()?; + let client = Arc::new(config.connect_celestia().await?); + let celestia_namespace = config.celestia_namespace(); + + let verifier = Verifier { client: client.clone(), namespace: celestia_namespace.clone() }; + + let data = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + let blob = Blob::new(celestia_namespace.clone(), data.clone())?; + + let height = client.blob_submit(&[blob], GasPrice::default()).await?; + + let included = verifier.verify(VerificationMode::Cowboy, &data, height).await?; + + assert!(included); + + let absent_data = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 7]; + + let absent_included = verifier.verify(VerificationMode::Cowboy, &absent_data, height).await; + + match absent_included { + Ok(_) => { + assert!(false, "Should not have verified") + } + Err(_) => {} + } + + Ok(()) + } + + #[tokio::test] + pub async fn test_wrong_height_does_not_verify() -> Result<(), anyhow::Error> { + let dot_movement = dot_movement::DotMovement::try_from_env()?; + let config = dot_movement + .try_get_config_from_json::()?; + let client = Arc::new(config.connect_celestia().await?); + let celestia_namespace = config.celestia_namespace(); + + let verifier = Verifier { client: client.clone(), namespace: celestia_namespace.clone() }; + + let data = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + let blob = Blob::new(celestia_namespace.clone(), data.clone())?; + + let height = client.blob_submit(&[blob], GasPrice::default()).await?; + + let included = verifier.verify(VerificationMode::Cowboy, &data, height).await?; + + assert!(included); + + let wrong_height_included = + verifier.verify(VerificationMode::Cowboy, &data, height + 1).await; + + match wrong_height_included { + Ok(_) => { + assert!(false, "Should not have verified") + } + Err(_) => {} + } + + Ok(()) + } +} diff --git a/protocol-units/da/m1/light-node-verifier/src/celestia/pessimistic.rs b/protocol-units/da/m1/light-node-verifier/src/celestia/pessimistic.rs new file mode 100644 index 000000000..944c700ab --- /dev/null +++ b/protocol-units/da/m1/light-node-verifier/src/celestia/pessimistic.rs @@ -0,0 +1,68 @@ +use crate::{Error, Verified, VerifierOperations}; +use celestia_rpc::Client; +use celestia_rpc::{BlobClient, HeaderClient}; +use celestia_types::{nmt::Namespace, Blob}; +use m1_da_light_node_util::ir_blob::IntermediateBlobRepresentation; +use std::sync::Arc; + +#[derive(Clone)] +pub struct Verifier { + /// The Celestia RPC client + pub client: Arc, + /// The namespace of the Celestia Blob + pub namespace: Namespace, +} + +impl Verifier { + pub fn new(client: Arc, namespace: Namespace) -> Self { + Self { client, namespace } + } +} + +#[tonic::async_trait] +impl VerifierOperations for Verifier { + /// Verifies a Celestia Blob as a Valid IntermediateBlobRepresentation + async fn verify(&self, blob: Blob, height: u64) -> Result, Error> { + //@l-monninger: the light node itself does most of the work of verify blobs. The verification under the feature flag below is useful in zero-trust environments. + + blob.validate().map_err(|e| Error::Validation(e.to_string()))?; + + // wait for the header to be at the correct height + self.client + .header_wait_for_height(height) + .await + .map_err(|e| Error::Internal(e.to_string()))?; + + // get the root + let dah = self + .client + .header_get_by_height(height) + .await + .map_err(|e| Error::Internal(e.to_string()))? + .dah; + let root_hash = dah.row_root(0).ok_or(Error::Validation("No root hash".to_string()))?; + + // get the proof + let proofs = self + .client + .blob_get_proof(height, self.namespace.clone(), blob.commitment) + .await + .map_err(|e| Error::Internal(e.to_string()))?; + + // get the leaves + let leaves = blob.to_shares().map_err(|e| Error::Internal(e.to_string()))?; + + // check if included + for proof in proofs.iter() { + proof + .verify_complete_namespace(&root_hash, &leaves, self.namespace.into()) + .map_err(|_e| { + Error::Validation("failed to verify complete namespace".to_string()) + })?; + } + + let ir_blob = IntermediateBlobRepresentation::try_from(blob).map_err(|e| Error::Internal(e.to_string()))?; + + Ok(Verified::new(ir_blob)) + } +} diff --git a/protocol-units/da/m1/light-node-verifier/src/lib.rs b/protocol-units/da/m1/light-node-verifier/src/lib.rs index 212d4975d..7b4da14ee 100644 --- a/protocol-units/da/m1/light-node-verifier/src/lib.rs +++ b/protocol-units/da/m1/light-node-verifier/src/lib.rs @@ -1,44 +1,44 @@ -pub mod v1; +pub mod celestia; +pub mod permissioned_signers; +pub mod signed; pub use m1_da_light_node_grpc::*; +use thiserror::Error; -#[tonic::async_trait] -pub trait Verifier { - async fn verify( - &self, - verification_mode: VerificationMode, - blob: &[u8], - height: u64, - ) -> Result { - match verification_mode { - VerificationMode::Cowboy => self.verify_cowboy(verification_mode, blob, height).await, - VerificationMode::ValidatorIn => { - self.verifiy_validator_in(verification_mode, blob, height).await - } - VerificationMode::MOfN => self.verify_m_of_n(verification_mode, blob, height).await, - } +/// Domain error for the transaction pipe task +#[derive(Debug, Error)] +pub enum Error { + #[error("verifier internal error: {0}")] + Internal(String), + #[error("verifier validation error: {0}")] + Validation(String), +} + +/// thiserror for validation and internal errors +#[derive(thiserror::Error, Debug)] + +/// A verified outcome. Indicates that input of A (from the trait [VerifierOperations]) is verified as valid instance of B, or else invalid instance. +pub struct Verified(B); + +impl Verified { + pub fn new(blob: B) -> Self { + Self(blob) } - async fn verify_cowboy( - &self, - _verification_mode: VerificationMode, - _blob: &[u8], - _height: u64, - ) -> Result { - Ok(true) + pub fn inner(&self) -> &B { + &self.0 } - async fn verifiy_validator_in( - &self, - _verification_mode: VerificationMode, - _blob: &[u8], - _height: u64, - ) -> Result; - - async fn verify_m_of_n( - &self, - _verification_mode: VerificationMode, - _blob: &[u8], - _height: u64, - ) -> Result; + pub fn into_inner(self) -> B { + self.0 + } +} + +#[tonic::async_trait] +pub trait VerifierOperations +where + A: Send + Sync + 'static, + B: Send + Sync + 'static, +{ + async fn verify(&self, blob: A, height: u64) -> Result, Error>; } diff --git a/protocol-units/da/m1/light-node-verifier/src/permissioned_signers/mod.rs b/protocol-units/da/m1/light-node-verifier/src/permissioned_signers/mod.rs new file mode 100644 index 000000000..d6536148e --- /dev/null +++ b/protocol-units/da/m1/light-node-verifier/src/permissioned_signers/mod.rs @@ -0,0 +1,76 @@ +use crate::{ + celestia::Verifier as CelestiaVerifier, signed::InKnownSignersVerifier, Error, Verified, + VerifierOperations, +}; +use celestia_rpc::Client; +use celestia_types::nmt::Namespace; +use celestia_types::Blob as CelestiaBlob; +use ecdsa::{ + elliptic_curve::{ + generic_array::ArrayLength, + ops::Invert, + point::PointCompression, + sec1::{FromEncodedPoint, ModulusSize, ToEncodedPoint}, + subtle::CtOption, + AffinePoint, CurveArithmetic, FieldBytesSize, PrimeCurve, Scalar, + }, + hazmat::{DigestPrimitive, SignPrimitive, VerifyPrimitive}, + SignatureSize, +}; +use m1_da_light_node_util::ir_blob::IntermediateBlobRepresentation; +use std::sync::Arc; + +/// A verifier of Celestia blobs for permissioned signers +#[derive(Clone)] +pub struct Verifier +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + /// The Celestia veifier + pub celestia: CelestiaVerifier, + /// The verifier for known signers + pub known_signers: InKnownSignersVerifier, +} + +impl Verifier +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + pub fn new( + celestia_client: Arc, + celestia_namespace: Namespace, + known_signers_sec1_bytes: T, + ) -> Self + where + T: IntoIterator, + T::Item: Into, + { + Self { + celestia: CelestiaVerifier::new(celestia_client, celestia_namespace), + known_signers: InKnownSignersVerifier::new(known_signers_sec1_bytes), + } + } +} + +#[tonic::async_trait] +impl VerifierOperations for Verifier +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + async fn verify(&self, blob: CelestiaBlob, height: u64) -> Result, Error> { + let verified_blob = self.celestia.verify(blob, height).await?; + self.known_signers.verify(verified_blob.into_inner(), height).await + } +} diff --git a/protocol-units/da/m1/light-node-verifier/src/signed/mod.rs b/protocol-units/da/m1/light-node-verifier/src/signed/mod.rs new file mode 100644 index 000000000..7ddb96e22 --- /dev/null +++ b/protocol-units/da/m1/light-node-verifier/src/signed/mod.rs @@ -0,0 +1,133 @@ +use crate::{Error, Verified, VerifierOperations}; +use ecdsa::{ + elliptic_curve::{ + generic_array::ArrayLength, + ops::Invert, + point::PointCompression, + sec1::{FromEncodedPoint, ModulusSize, ToEncodedPoint}, + subtle::CtOption, + AffinePoint, CurveArithmetic, FieldBytesSize, PrimeCurve, Scalar, + }, + hazmat::{DigestPrimitive, SignPrimitive, VerifyPrimitive}, + SignatureSize, +}; +use m1_da_light_node_util::ir_blob::IntermediateBlobRepresentation; +use std::collections::HashSet; +use tracing::info; + +/// A verifier that checks the signature of the inner blob. +#[derive(Clone)] +pub struct Verifier +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + pub _curve_marker: std::marker::PhantomData, +} + +impl Verifier +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + pub fn new() -> Self { + Self { _curve_marker: std::marker::PhantomData } + } +} + +#[tonic::async_trait] +impl VerifierOperations + for Verifier +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + async fn verify( + &self, + blob: IntermediateBlobRepresentation, + _height: u64, + ) -> Result, Error> { + blob.verify_signature::().map_err(|e| Error::Validation(e.to_string()))?; + + Ok(Verified::new(blob)) + } +} + +/// Verifies that the signer of the inner blob is in the known signers set. +/// This is built around an inner signer because we should always check the signature first. That is, this composition prevents unsafe usage. +#[derive(Clone)] +pub struct InKnownSignersVerifier +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + pub inner_verifier: Verifier, + /// The set of known signers in sec1 bytes hex format. + pub known_signers_sec1_bytes_hex: HashSet, +} + +impl InKnownSignersVerifier +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + pub fn new(known_signers_sec1_bytes_hex: T) -> Self + where + T: IntoIterator, + T::Item: Into, + { + Self { + inner_verifier: Verifier::new(), + known_signers_sec1_bytes_hex: known_signers_sec1_bytes_hex + .into_iter() + .map(Into::into) + .collect(), + } + } +} + +#[tonic::async_trait] +impl VerifierOperations + for InKnownSignersVerifier +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + async fn verify( + &self, + blob: IntermediateBlobRepresentation, + height: u64, + ) -> Result, Error> { + let ir_blob = self.inner_verifier.verify(blob, height).await?; + info!("Verified inner blob"); + let signer = ir_blob.inner().signer_hex(); + if !self.known_signers_sec1_bytes_hex.contains(&signer) { + return Err(Error::Validation("signer not in known signers".to_string())); + } + + Ok(ir_blob) + } +} + +#[cfg(test)] +pub mod tests { + // TODO: we need to recreate the signed verifier tests +} diff --git a/protocol-units/da/m1/light-node/Cargo.toml b/protocol-units/da/m1/light-node/Cargo.toml index 64d6b2f07..a439a7936 100644 --- a/protocol-units/da/m1/light-node/Cargo.toml +++ b/protocol-units/da/m1/light-node/Cargo.toml @@ -38,6 +38,8 @@ movement-tracing = { workspace = true } futures = { workspace = true } bcs = { workspace = true } zstd = { workspace = true } +ecdsa = { workspace = true } +k256 = { workspace = true } # sequencer memseq = { workspace = true, optional = true } diff --git a/protocol-units/da/m1/light-node/src/main.rs b/protocol-units/da/m1/light-node/src/main.rs index e9a8cb7f5..4d8037ca8 100644 --- a/protocol-units/da/m1/light-node/src/main.rs +++ b/protocol-units/da/m1/light-node/src/main.rs @@ -1,3 +1,4 @@ +use k256::Secp256k1; use m1_da_light_node::v1::{LightNodeV1, Manager}; use std::env; @@ -13,7 +14,8 @@ async fn main() -> Result<(), Box> { let dot_movement = dot_movement::DotMovement::try_from_env()?; let config_path = dot_movement.get_config_json_path(); let config_file = tokio::fs::File::open(config_path).await?; - let manager = Manager::::new(config_file).await?; + // todo: consider whether LightNode implementation should encapsulate signing type + let manager = Manager::>::new(config_file).await?; manager.try_run().await?; Ok(()) diff --git a/protocol-units/da/m1/light-node/src/v1/manager.rs b/protocol-units/da/m1/light-node/src/v1/manager.rs index 25c4d2f92..1d2027adf 100644 --- a/protocol-units/da/m1/light-node/src/v1/manager.rs +++ b/protocol-units/da/m1/light-node/src/v1/manager.rs @@ -1,4 +1,16 @@ use super::{LightNodeV1, LightNodeV1Operations}; +use ecdsa::{ + elliptic_curve::{ + generic_array::ArrayLength, + ops::Invert, + point::PointCompression, + sec1::{FromEncodedPoint, ModulusSize, ToEncodedPoint}, + subtle::CtOption, + AffinePoint, CurveArithmetic, FieldBytesSize, PrimeCurve, Scalar, + }, + hazmat::{DigestPrimitive, SignPrimitive, VerifyPrimitive}, + SignatureSize, +}; use godfig::{backend::config_file::ConfigFile, Godfig}; use m1_da_light_node_util::config::Config; @@ -12,7 +24,14 @@ where } // Implements a very simple manager using a marker strategy pattern. -impl Manager { +impl Manager> +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ pub async fn new(file: tokio::fs::File) -> Result { let godfig = Godfig::new( ConfigFile::new(file), @@ -23,7 +42,14 @@ impl Manager { Ok(Self { godfig, _marker: std::marker::PhantomData }) } - pub async fn try_light_node(&self) -> Result { + pub async fn try_light_node(&self) -> Result, anyhow::Error> + where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint, + FieldBytesSize: ModulusSize, + { let config = self.godfig.try_wait_for_ready().await?; LightNodeV1::try_from_config(config).await } diff --git a/protocol-units/da/m1/light-node/src/v1/passthrough.rs b/protocol-units/da/m1/light-node/src/v1/passthrough.rs index c8d1cc3e9..cad3829f2 100644 --- a/protocol-units/da/m1/light-node/src/v1/passthrough.rs +++ b/protocol-units/da/m1/light-node/src/v1/passthrough.rs @@ -1,10 +1,8 @@ -use anyhow::Context; +use m1_da_light_node_util::ir_blob::IntermediateBlobRepresentation; use std::fmt::{self, Debug, Formatter}; use std::sync::Arc; - -use tokio::sync::RwLock; use tokio_stream::{Stream, StreamExt}; -use tracing::debug; +use tracing::{error, info}; use celestia_rpc::{BlobClient, Client, HeaderClient}; use celestia_types::{blob::GasPrice, nmt::Namespace, Blob as CelestiaBlob}; @@ -12,21 +10,52 @@ use celestia_types::{blob::GasPrice, nmt::Namespace, Blob as CelestiaBlob}; // FIXME: glob imports are bad style use m1_da_light_node_grpc::light_node_service_server::LightNodeService; use m1_da_light_node_grpc::*; -use m1_da_light_node_util::config::Config; -use m1_da_light_node_verifier::{v1::V1Verifier, Verifier}; +use m1_da_light_node_util::{ + config::Config, + ir_blob::{celestia::CelestiaIntermediateBlobRepresentation, InnerSignedBlobV1Data}, +}; +use m1_da_light_node_verifier::{permissioned_signers::Verifier, VerifierOperations}; use crate::v1::LightNodeV1Operations; +use ecdsa::{ + elliptic_curve::{ + generic_array::ArrayLength, + ops::Invert, + point::PointCompression, + sec1::{FromEncodedPoint, ModulusSize, ToEncodedPoint}, + subtle::CtOption, + AffinePoint, CurveArithmetic, FieldBytesSize, PrimeCurve, Scalar, + }, + hazmat::{DigestPrimitive, SignPrimitive, VerifyPrimitive}, + SignatureSize, SigningKey, +}; #[derive(Clone)] -pub struct LightNodeV1 { +pub struct LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ pub config: Config, pub celestia_namespace: Namespace, pub default_client: Arc, - pub verification_mode: Arc>, - pub verifier: Arc>, + pub verifier: Arc< + Box + Send + Sync>, + >, + pub signing_key: SigningKey, } -impl Debug for LightNodeV1 { +impl Debug for LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { f.debug_struct("LightNodeV1") .field("celestia_namespace", &self.config.celestia_namespace()) @@ -34,23 +63,34 @@ impl Debug for LightNodeV1 { } } -impl LightNodeV1Operations for LightNodeV1 { +impl LightNodeV1Operations for LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ /// Tries to create a new LightNodeV1 instance from the toml config file. async fn try_from_config(config: Config) -> Result { let client = Arc::new(config.connect_celestia().await?); + let signing_key_str = config.da_signing_key(); + let hex_bytes = hex::decode(signing_key_str)?; + + let signing_key = SigningKey::from_bytes(hex_bytes.as_slice().try_into()?) + .map_err(|e| anyhow::anyhow!("Failed to create signing key: {}", e))?; + Ok(Self { config: config.clone(), celestia_namespace: config.celestia_namespace(), default_client: client.clone(), - verification_mode: Arc::new(RwLock::new( - VerificationMode::from_str_name("M_OF_N") - .context("Failed to parse verification mode")?, - )), - verifier: Arc::new(Box::new(V1Verifier { + verifier: Arc::new(Box::new(Verifier::::new( client, - namespace: config.celestia_namespace(), - })), + config.celestia_namespace(), + config.da_signers_sec1_keys(), + ))), + signing_key, }) } @@ -64,14 +104,28 @@ impl LightNodeV1Operations for LightNodeV1 { } } -impl LightNodeV1 { - /// Creates a new blob instance with the provided data. +impl LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + /// Creates a new signed blob instance with the provided data. pub fn create_new_celestia_blob(&self, data: Vec) -> Result { - CelestiaBlob::new(self.celestia_namespace, data) - .map_err(|e| anyhow::anyhow!("Failed to create a blob: {}", e)) + // mark the timestamp as now in milliseconds + let timestamp = chrono::Utc::now().timestamp_micros() as u64; + + // sign the blob data and the timestamp + let data = InnerSignedBlobV1Data::new(data, timestamp).try_to_sign(&self.signing_key)?; + + // create the celestia blob + CelestiaIntermediateBlobRepresentation(data.into(), self.celestia_namespace.clone()) + .try_into() } - /// Submits a CelestiaNlob to the Celestia node. + /// Submits a CelestiaBlob to the Celestia node. pub async fn submit_celestia_blob(&self, blob: CelestiaBlob) -> Result { let height = self .default_client @@ -104,42 +158,29 @@ impl LightNodeV1 { } /// Gets the blobs at a given height. - pub async fn get_celestia_blobs_at_height( + pub async fn get_ir_blobs_at_height( &self, height: u64, - ) -> Result, anyhow::Error> { + ) -> Result, anyhow::Error> { let blobs = self.default_client.blob_get_all(height, &[self.celestia_namespace]).await; if let Err(e) = &blobs { - debug!("Error getting blobs: {:?}", e); + error!("Error getting blobs: {:?}", e); } let blobs = blobs.unwrap_or_default(); let mut verified_blobs = Vec::new(); for blob in blobs { - debug!("Verifying blob"); - - let blob_data = blob.data.clone(); - - // todo: improve error boundary here to detect crashes - let verified = self - .verifier - .verify(*self.verification_mode.read().await, &blob_data, height) - .await; - - if let Err(e) = &verified { - debug!("Error verifying blob: {:?}", e); - } - - // FIXME: check the implications of treating errors as verification success. - // @l-monninger: under the assumption we are running a light node in the same - // trusted setup and have not experience a highly intrusive(?), the vulnerability here - // is fairly low. The light node should take care of verification on its own. - let verified = verified.unwrap_or(true); - - if verified { - verified_blobs.push(blob); + match self.verifier.verify(blob, height).await { + Ok(verified_blob) => { + let blob = verified_blob.into_inner(); + info!("Verified blob at height: {} {:?}", height, blob.id()); + verified_blobs.push(blob); + } + Err(e) => { + error!("Failed to verify blob: {:?}", e,); + } } } @@ -148,11 +189,11 @@ impl LightNodeV1 { #[tracing::instrument(target = "movement_timing", level = "debug")] async fn get_blobs_at_height(&self, height: u64) -> Result, anyhow::Error> { - let celestia_blobs = self.get_celestia_blobs_at_height(height).await?; + let ir_blobs = self.get_ir_blobs_at_height(height).await?; let mut blobs = Vec::new(); - for celestia_blob in celestia_blobs { - let blob = Self::celestia_blob_to_blob(celestia_blob, height)?; - debug!(blob_id = %blob.blob_id, "got blob"); + for ir_blob in ir_blobs { + let blob = Self::ir_blob_to_blob(ir_blob, height)?; + // todo: update logging here blobs.push(blob); } Ok(blobs) @@ -208,7 +249,7 @@ impl LightNodeV1 { let header = header_res?; let height = header.height().into(); - debug!("Stream got header: {:?}", header.height()); + info!("Stream got header: {:?}", header.height()); // back fetch the blobs if first_flag && (height > start_height) { @@ -217,7 +258,7 @@ impl LightNodeV1 { while let Some(blob) = blob_stream.next().await { - debug!("Stream got blob: {:?}", blob); + info!("Stream got blob: {:?}", blob); yield blob?; } @@ -228,7 +269,7 @@ impl LightNodeV1 { let blobs = me.get_blobs_at_height(height).await?; for blob in blobs { - debug!("Stream got blob: {:?}", blob); + info!("Stream got blob: {:?}", blob); yield blob; } @@ -239,15 +280,30 @@ impl LightNodeV1 { as std::pin::Pin> + Send>>) } + pub fn ir_blob_to_blob( + ir_blob: IntermediateBlobRepresentation, + height: u64, + ) -> Result { + Ok(Blob { + data: ir_blob.blob().to_vec(), + signature: ir_blob.signature().to_vec(), + timestamp: ir_blob.timestamp(), + signer: ir_blob.signer().to_vec(), + blob_id: ir_blob.id().to_vec(), + height, + }) + } + pub fn celestia_blob_to_blob(blob: CelestiaBlob, height: u64) -> Result { - let timestamp = chrono::Utc::now().timestamp_micros() as u64; + let ir_blob: IntermediateBlobRepresentation = blob.try_into()?; Ok(Blob { - data: blob.data, - blob_id: serde_json::to_string(&blob.commitment) - .map_err(|e| anyhow::anyhow!("Failed to serialize commitment: {}", e))?, + data: ir_blob.blob().to_vec(), + signature: ir_blob.signature().to_vec(), + timestamp: ir_blob.timestamp(), + signer: ir_blob.signer().to_vec(), + blob_id: ir_blob.id().to_vec(), height, - timestamp, }) } @@ -269,7 +325,14 @@ impl LightNodeV1 { } #[tonic::async_trait] -impl LightNodeService for LightNodeV1 { +impl LightNodeService for LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ /// Server streaming response type for the StreamReadFromHeight method. type StreamReadFromHeightStream = std::pin::Pin< Box< @@ -444,17 +507,4 @@ impl LightNodeService for LightNodeV1 { Ok(tonic::Response::new(BatchWriteResponse { blobs: blob_responses })) } - /// Update and manage verification parameters. - async fn update_verification_parameters( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status> { - let verification_mode = request.into_inner().mode(); - let mut mode = self.verification_mode.write().await; - *mode = verification_mode; - - Ok(tonic::Response::new(UpdateVerificationParametersResponse { - mode: verification_mode.into(), - })) - } } diff --git a/protocol-units/da/m1/light-node/src/v1/sequencer.rs b/protocol-units/da/m1/light-node/src/v1/sequencer.rs index 55f03bd7c..152111c61 100644 --- a/protocol-units/da/m1/light-node/src/v1/sequencer.rs +++ b/protocol-units/da/m1/light-node/src/v1/sequencer.rs @@ -1,5 +1,18 @@ +use block::WrappedBlock; +use ecdsa::{ + elliptic_curve::{ + generic_array::ArrayLength, + ops::Invert, + point::PointCompression, + sec1::{FromEncodedPoint, ModulusSize, ToEncodedPoint}, + subtle::CtOption, + AffinePoint, CurveArithmetic, FieldBytesSize, PrimeCurve, Scalar, + }, + hazmat::{DigestPrimitive, SignPrimitive, VerifyPrimitive}, + SignatureSize, +}; use std::boxed::Box; -use std::fmt; +use std::fmt::Debug; use std::path::PathBuf; use std::pin::Pin; use std::sync::{atomic::AtomicU64, Arc}; @@ -29,18 +42,39 @@ use crate::v1::{passthrough::LightNodeV1 as LightNodeV1PassThrough, LightNodeV1O const LOGGING_UID: AtomicU64 = AtomicU64::new(0); #[derive(Clone)] -pub struct LightNodeV1 { - pub pass_through: LightNodeV1PassThrough, +pub struct LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + pub pass_through: LightNodeV1PassThrough, pub memseq: Arc>, } -impl fmt::Debug for LightNodeV1 { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +impl Debug for LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("LightNodeV1").field("pass_through", &self.pass_through).finish() } } -impl LightNodeV1Operations for LightNodeV1 { +impl LightNodeV1Operations for LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ async fn try_from_config(config: Config) -> Result { info!("Initializing LightNodeV1 in sequencer mode from environment."); @@ -72,7 +106,14 @@ impl LightNodeV1Operations for LightNodeV1 { } } -impl LightNodeV1 { +impl LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ async fn tick_build_blocks(&self, sender: Sender) -> Result<(), anyhow::Error> { let memseq = self.memseq.clone(); @@ -120,12 +161,16 @@ impl LightNodeV1 { // wrap the blocks in a struct that can be split and compressed // spawn blocking because the compression is blocking and could be slow - let namespace = self.pass_through.celestia_namespace.clone(); + let pass_through = self.pass_through.clone(); let blocks = tokio::task::spawn_blocking(move || { - blocks - .into_iter() - .map(|block| block::WrappedBlock::try_new(block, namespace)) - .collect::, anyhow::Error>>() + let mut wrapped_blocks = Vec::new(); + for block in blocks { + let block_bytes = bcs::to_bytes(&block)?; + let celestia_blob = pass_through.create_new_celestia_blob(block_bytes)?; + let wrapped_block = block::WrappedBlock::new(block, celestia_blob); + wrapped_blocks.push(wrapped_block); + } + Ok::, anyhow::Error>(wrapped_blocks) }) .await??; @@ -306,8 +351,11 @@ impl LightNodeV1 { Ok(grpc::BlobResponse { blob_type: Some(BlobType::SequencedBlobIntent(grpc::Blob { data, - blob_id: "".to_string(), + blob_id: vec![], height, + // todo: at some point it would be good to sign these intents, as they can then be used as pre-confirmations against which we can slash + signature: vec![], + signer: vec![], timestamp: 0, })), }) @@ -315,7 +363,14 @@ impl LightNodeV1 { } #[tonic::async_trait] -impl LightNodeService for LightNodeV1 { +impl LightNodeService for LightNodeV1 +where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, +{ /// Server streaming response type for the StreamReadFromHeight method. type StreamReadFromHeightStream = Pin< Box< @@ -420,24 +475,15 @@ impl LightNodeService for LightNodeV1 { Ok(tonic::Response::new(grpc::BatchWriteResponse { blobs: intents })) } - /// Update and manage verification parameters. - async fn update_verification_parameters( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.pass_through.update_verification_parameters(request).await - } } -mod block { +pub mod block { use celestia_types::{nmt::Namespace, Blob}; use movement_algs::grouping_heuristic::{binpacking::BinpackingWeighted, splitting::Splitable}; use movement_types::block::Block; + /// A wrapped block that can be used with the binpacking heuristic #[derive(Debug)] pub struct WrappedBlock { pub block: Block, @@ -445,6 +491,12 @@ mod block { } impl WrappedBlock { + /// Create a new wrapped block from a blob and block + pub fn new(block: Block, blob: Blob) -> Self { + Self { block, blob } + } + + /// Create a new wrapped block from a block and a namespace pub fn try_new(block: Block, namespace: Namespace) -> Result { // first serialize the block let block_bytes = bcs::to_bytes(&block)?; diff --git a/protocol-units/da/m1/util/Cargo.toml b/protocol-units/da/m1/util/Cargo.toml index e49b574b5..13454454f 100644 --- a/protocol-units/da/m1/util/Cargo.toml +++ b/protocol-units/da/m1/util/Cargo.toml @@ -36,6 +36,13 @@ memseq-util = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } godfig = { workspace = true } +alloy = { workspace = true } +zstd = { workspace = true } +bcs = { workspace = true } +ecdsa = { workspace = true, features = [ "signing", "verifying", "der"] } +k256 = { workspace = true } +# rand usage conflicts with Aptos. Aptos is on 0.7; ecdsa is on 0.8. +rand = { version = "0.8.5" } [dev-dependencies] tempfile = { workspace = true } diff --git a/protocol-units/da/m1/util/src/config/local/m1_da_light_node.rs b/protocol-units/da/m1/util/src/config/local/m1_da_light_node.rs index 867ce5c58..c11bfff46 100644 --- a/protocol-units/da/m1/util/src/config/local/m1_da_light_node.rs +++ b/protocol-units/da/m1/util/src/config/local/m1_da_light_node.rs @@ -5,7 +5,88 @@ use crate::config::common::{ default_m1_da_light_node_connection_port, default_m1_da_light_node_listen_hostname, default_m1_da_light_node_listen_port, }; +use ecdsa::SigningKey; +use k256::Secp256k1; use serde::{Deserialize, Serialize}; +use std::collections::HashSet; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct DaSigners { + pub private_key_hex: String, + pub public_keys_hex: HashSet, +} + +/// The default da signing private key +pub fn default_da_signing_private_key() -> SigningKey { + match std::env::var("DA_SIGNING_PRIVATE_KEY") { + Ok(val) => { + // decode from hex to bytes 32 + let hex_bytes = hex::decode(val).expect("Invalid hex string"); + + // todo: maybe remove the unwrap and catch for a random signing key + let signing_key_bytes: &[u8; 32] = + hex_bytes.as_slice().try_into().expect("Slice with incorrect length"); + SigningKey::from_bytes(signing_key_bytes.into()).unwrap() + } + Err(std::env::VarError::NotPresent) => SigningKey::random( + // rand_core + &mut rand::rngs::OsRng, + ), + Err(_) => panic!("Invalid DA_SIGNING_PRIVATE_KEY"), + } +} + +pub fn default_da_signers_sec1_keys() -> HashSet { + match std::env::var("DA_SIGNERS_SEC1_KEYS") { + Ok(val) => val.split(',').map(|s| s.to_string()).collect(), + Err(std::env::VarError::NotPresent) => HashSet::new(), + Err(_) => panic!("Invalid DA_SIGNERS_SEC1_KEYS"), + } +} + +pub fn default_da_signers() -> DaSigners { + let da_signer = default_da_signing_private_key(); + + // always trust yourself + let mut trusted_signers = HashSet::new(); + let sec1_hex = hex::encode(da_signer.verifying_key().to_sec1_bytes().to_vec()); + trusted_signers.insert(sec1_hex); + + // add the other specified signers + let additional_signers = default_da_signers_sec1_keys(); + trusted_signers.extend(additional_signers); + + DaSigners { + private_key_hex: hex::encode(da_signer.to_bytes().as_slice()), + public_keys_hex: trusted_signers, + } +} + +#[cfg(test)] +pub mod signers_serialization_test { + + use super::*; + + #[test] + fn test_signing_key() -> Result<(), anyhow::Error> { + let signing_key = SigningKey::::random( + // rand_core + &mut rand::rngs::OsRng, + ); + + let signing_bytes = signing_key.to_bytes(); + + let signing_key_fixed_bytes: &[u8; 32] = + signing_bytes.as_slice().try_into().expect("Slice with incorrect length"); + + let from_bytes = + SigningKey::::from_bytes(&signing_key_fixed_bytes.clone().into())?; + + assert_eq!(signing_key, from_bytes); + + Ok(()) + } +} /// The inner configuration for the local Celestia Appd Runner #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] @@ -45,6 +126,10 @@ pub struct Config { /// The port for m1-da-light-node connection #[serde(default = "default_m1_da_light_node_connection_port")] pub m1_da_light_node_connection_port: u16, + + /// The DA signers + #[serde(default = "default_da_signers")] + pub da_signers: DaSigners, } impl Default for Config { @@ -60,6 +145,7 @@ impl Default for Config { m1_da_light_node_listen_port: default_m1_da_light_node_listen_port(), m1_da_light_node_connection_hostname: default_m1_da_light_node_connection_hostname(), m1_da_light_node_connection_port: default_m1_da_light_node_connection_port(), + da_signers: default_da_signers(), } } } diff --git a/protocol-units/da/m1/util/src/config/mod.rs b/protocol-units/da/m1/util/src/config/mod.rs index 25d472da4..48e8cc964 100644 --- a/protocol-units/da/m1/util/src/config/mod.rs +++ b/protocol-units/da/m1/util/src/config/mod.rs @@ -2,6 +2,7 @@ use anyhow::Context; use celestia_rpc::Client; use celestia_types::nmt::Namespace; use serde::{Deserialize, Serialize}; +use std::collections::HashSet; pub mod common; pub mod local; @@ -179,6 +180,24 @@ impl Config { } } + /// Gets the da signing key as a string + pub fn da_signing_key(&self) -> String { + match self { + Config::Local(local) => local.m1_da_light_node.da_signers.private_key_hex.clone(), + Config::Arabica(local) => local.m1_da_light_node.da_signers.private_key_hex.clone(), + Config::Mocha(local) => local.m1_da_light_node.da_signers.private_key_hex.clone(), + } + } + + /// Gets the da signers sec1 keys + pub fn da_signers_sec1_keys(&self) -> HashSet { + match self { + Config::Local(local) => local.m1_da_light_node.da_signers.public_keys_hex.clone(), + Config::Arabica(local) => local.m1_da_light_node.da_signers.public_keys_hex.clone(), + Config::Mocha(local) => local.m1_da_light_node.da_signers.public_keys_hex.clone(), + } + } + pub fn try_block_building_parameters(&self) -> Result<(u32, u64), anyhow::Error> { match self { Config::Local(local) => { diff --git a/protocol-units/da/m1/util/src/ir_blob.rs b/protocol-units/da/m1/util/src/ir_blob.rs new file mode 100644 index 000000000..3226569ed --- /dev/null +++ b/protocol-units/da/m1/util/src/ir_blob.rs @@ -0,0 +1,208 @@ +use ecdsa::{ + elliptic_curve::{ + generic_array::ArrayLength, + ops::Invert, + point::PointCompression, + sec1::{FromEncodedPoint, ModulusSize, ToEncodedPoint}, + subtle::CtOption, + AffinePoint, CurveArithmetic, FieldBytesSize, PrimeCurve, Scalar, + }, + hazmat::{DigestPrimitive, SignPrimitive, VerifyPrimitive}, + signature::{digest::Digest, DigestVerifier}, + SignatureSize, SigningKey, VerifyingKey, +}; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InnerSignedBlobV1Data { + pub blob: Vec, + pub timestamp: u64, +} + +impl InnerSignedBlobV1Data { + pub fn new(blob: Vec, timestamp: u64) -> Self { + Self { blob, timestamp } + } + + pub fn try_to_sign( + self, + signing_key: &SigningKey, + ) -> Result + where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, + { + let mut hasher = C::Digest::new(); + hasher.update(self.blob.as_slice()); + hasher.update(&self.timestamp.to_be_bytes()); + let prehash = hasher.finalize(); + let prehash_bytes = prehash.as_slice(); + + let (signature, _recovery_id) = signing_key.sign_prehash_recoverable(prehash_bytes)?; + + Ok(InnerSignedBlobV1 { + data: self, + signature: signature.to_vec(), + signer: signing_key.verifying_key().to_sec1_bytes().to_vec(), + id: prehash_bytes.to_vec(), + }) + } + + pub fn try_verify(&self, signature: &[u8], signer: &[u8]) -> Result<(), anyhow::Error> + where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, + { + let mut hasher = C::Digest::new(); + hasher.update(self.blob.as_slice()); + hasher.update(&self.timestamp.to_be_bytes()); + + let verifying_key = VerifyingKey::::from_sec1_bytes(signer)?; + let signature = ecdsa::Signature::from_bytes(signature.into())?; + + match verifying_key.verify_digest(hasher, &signature) { + Ok(_) => Ok(()), + Err(_) => Err(anyhow::anyhow!("Failed to verify signature")), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InnerSignedBlobV1 { + pub data: InnerSignedBlobV1Data, + pub signature: Vec, + pub signer: Vec, + pub id: Vec, +} + +impl InnerSignedBlobV1 { + pub fn try_verify(&self) -> Result<(), anyhow::Error> + where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, + { + self.data.try_verify::(self.signature.as_slice(), self.signer.as_slice()) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum IntermediateBlobRepresentation { + SignedV1(InnerSignedBlobV1), +} + +impl From for IntermediateBlobRepresentation { + fn from(inner: InnerSignedBlobV1) -> Self { + IntermediateBlobRepresentation::SignedV1(inner) + } +} + +impl IntermediateBlobRepresentation { + pub fn blob(&self) -> &[u8] { + match self { + IntermediateBlobRepresentation::SignedV1(inner) => inner.data.blob.as_slice(), + } + } + + pub fn signature(&self) -> &[u8] { + match self { + IntermediateBlobRepresentation::SignedV1(inner) => inner.signature.as_slice(), + } + } + + pub fn timestamp(&self) -> u64 { + match self { + IntermediateBlobRepresentation::SignedV1(inner) => inner.data.timestamp, + } + } + + pub fn signer(&self) -> &[u8] { + match self { + IntermediateBlobRepresentation::SignedV1(inner) => inner.signer.as_slice(), + } + } + + pub fn signer_hex(&self) -> String { + hex::encode(self.signer()) + } + + pub fn id(&self) -> &[u8] { + match self { + IntermediateBlobRepresentation::SignedV1(inner) => inner.id.as_slice(), + } + } + + pub fn verify_signature(&self) -> Result<(), anyhow::Error> + where + C: PrimeCurve + CurveArithmetic + DigestPrimitive + PointCompression, + Scalar: Invert>> + SignPrimitive, + SignatureSize: ArrayLength, + AffinePoint: FromEncodedPoint + ToEncodedPoint + VerifyPrimitive, + FieldBytesSize: ModulusSize, + { + match self { + IntermediateBlobRepresentation::SignedV1(inner) => inner.try_verify::(), + } + } +} + +pub mod celestia { + + use super::IntermediateBlobRepresentation; + use anyhow::Context; + use celestia_types::{nmt::Namespace, Blob as CelestiaBlob}; + use tracing::info; + + impl TryFrom for IntermediateBlobRepresentation { + type Error = anyhow::Error; + + // todo: it would be nice to have this be self describing over the compression and serialization format + fn try_from(blob: CelestiaBlob) -> Result { + // decompress blob.data with zstd + let decompressed = + zstd::decode_all(blob.data.as_slice()).context("failed to decompress blob")?; + + // deserialize the decompressed data with bcs + let blob = + bcs::from_bytes(decompressed.as_slice()).context("failed to deserialize blob")?; + + Ok(blob) + } + } + + pub struct CelestiaIntermediateBlobRepresentation( + pub IntermediateBlobRepresentation, + pub Namespace, + ); + + /// Tries to form a CelestiaBlob from a CelestiaIntermediateBlobRepresentation + impl TryFrom for CelestiaBlob { + type Error = anyhow::Error; + + fn try_from(ir_blob: CelestiaIntermediateBlobRepresentation) -> Result { + info!("converting CelestiaIntermediateBlobRepresentation to CelestiaBlob"); + + // Extract the inner blob and namespace + let CelestiaIntermediateBlobRepresentation(ir_blob, namespace) = ir_blob; + + // Serialize the inner blob with bcs + let serialized_blob = bcs::to_bytes(&ir_blob).context("failed to serialize blob")?; + + // Compress the serialized data with zstd + let compressed_blob = zstd::encode_all(serialized_blob.as_slice(), 0) + .context("failed to compress blob")?; + + // Construct the final CelestiaBlob by assigning the compressed data + // and associating it with the provided namespace + Ok(CelestiaBlob::new(namespace, compressed_blob).map_err(|e| anyhow::anyhow!(e))?) + } + } +} diff --git a/protocol-units/da/m1/util/src/lib.rs b/protocol-units/da/m1/util/src/lib.rs index a4337c175..32171cd10 100644 --- a/protocol-units/da/m1/util/src/lib.rs +++ b/protocol-units/da/m1/util/src/lib.rs @@ -1,2 +1,3 @@ pub mod config; pub use config::*; +pub mod ir_blob; diff --git a/protocol-units/execution/opt-executor/src/executor/execution.rs b/protocol-units/execution/opt-executor/src/executor/execution.rs index d99f61323..c8d24f105 100644 --- a/protocol-units/execution/opt-executor/src/executor/execution.rs +++ b/protocol-units/execution/opt-executor/src/executor/execution.rs @@ -16,9 +16,10 @@ use aptos_types::{ validator_verifier::{ValidatorConsensusInfo, ValidatorVerifier}, }; use movement_types::block::{BlockCommitment, Commitment, Id}; -use tracing::{debug, info, warn}; +use tracing::{info, warn}; impl Executor { + /// Executes a block and commits it to the storage layer. pub async fn execute_block( &self, block: ExecutableBlock, @@ -64,10 +65,9 @@ impl Executor { }) .await??; - warn!("Block execution compute the following state: {:?}", state_compute); - + info!("Block execution compute the following state: {:?}", state_compute); let version = state_compute.version(); - debug!("Block execution computed the following version: {:?}", version); + info!("Block execution computed the following version: {:?}", version); let (epoch, round) = (block_metadata.epoch(), block_metadata.round()); let ledger_info_with_sigs = self.ledger_info_with_sigs( @@ -366,7 +366,7 @@ mod tests { Transaction::UserTransaction(user_account_creation_tx), Transaction::UserTransaction(mint_tx), ])); - debug!("Number of transactions: {}", transactions.num_transactions()); + info!("Number of transactions: {}", transactions.num_transactions()); let block = ExecutableBlock::new(block_id.clone(), transactions); let block_commitment = executor.execute_block(block).await?; diff --git a/protocol-units/settlement/mcr/runner/src/main.rs b/protocol-units/settlement/mcr/runner/src/main.rs index 9b1d3dd58..f8176d0c1 100644 --- a/protocol-units/settlement/mcr/runner/src/main.rs +++ b/protocol-units/settlement/mcr/runner/src/main.rs @@ -14,7 +14,7 @@ async fn main() -> Result<(), anyhow::Error> { // get the config file let dot_movement = dot_movement::DotMovement::try_from_env()?; - let mut config_file = dot_movement.try_get_or_create_config_file().await?; + let config_file = dot_movement.try_get_or_create_config_file().await?; // get a matching godfig object let godfig: Godfig =