From f7e1786be7b4122666ecc12628578b30794584b9 Mon Sep 17 00:00:00 2001 From: Michael Zaikin Date: Fri, 5 Jan 2024 15:23:34 +0200 Subject: [PATCH] Connect sequencer to worker and primary gRPC --- .github/workflows/kernel.yml | 2 +- Cargo.lock | 1752 +++-------------- Makefile | 37 +- crates/pre-block/Cargo.toml | 3 - crates/pre-block/src/conversion.rs | 65 - docker/sequencer/Dockerfile | 2 +- docker/sequencer/entrypoint.sh | 10 +- docker/sequencer/local.dockerfile | 6 + docker/setup/dsn-min-4-1/README.md | 2 + docker/setup/dsn-min-4-1/committee.json | 41 + docker/setup/dsn-min-4-1/docker-compose.yml | 53 + docker/setup/dsn-min-4-1/workers.json | 33 + docker/setup/keys/primary-1.key | 1 + docker/setup/keys/primary-2.key | 1 + docker/setup/keys/primary-3.key | 1 + docker/setup/keys/primary-4.key | 1 + docker/setup/keys/primary-5.key | 1 + docker/setup/keys/primary-6.key | 1 + docker/setup/keys/primary-7.key | 1 + docker/setup/keys/primary-network-1.key | 1 + docker/setup/keys/primary-network-2.key | 1 + docker/setup/keys/primary-network-3.key | 1 + docker/setup/keys/primary-network-4.key | 1 + docker/setup/keys/primary-network-5.key | 1 + docker/setup/keys/primary-network-6.key | 1 + docker/setup/keys/primary-network-7.key | 1 + docker/setup/keys/worker-network-1.key | 1 + docker/setup/keys/worker-network-2.key | 1 + docker/setup/keys/worker-network-3.key | 1 + docker/setup/keys/worker-network-4.key | 1 + docker/setup/keys/worker-network-5.key | 1 + docker/setup/keys/worker-network-6.key | 1 + docker/setup/keys/worker-network-7.key | 1 + docker/setup/single-operator/README.md | 2 - .../setup/single-operator/docker-compose.yml | 0 sequencer/Cargo.toml | 14 +- sequencer/build.rs | 4 + sequencer/src/consensus_client.rs | 129 +- sequencer/src/da_batcher.rs | 13 +- sequencer/src/main.rs | 105 +- sequencer/src/rollup_client.rs | 54 +- 41 files changed, 743 insertions(+), 1605 deletions(-) create mode 100644 docker/sequencer/local.dockerfile create mode 100644 docker/setup/dsn-min-4-1/README.md create mode 100644 docker/setup/dsn-min-4-1/committee.json create mode 100644 docker/setup/dsn-min-4-1/docker-compose.yml create mode 100644 docker/setup/dsn-min-4-1/workers.json create mode 100644 docker/setup/keys/primary-1.key create mode 100644 docker/setup/keys/primary-2.key create mode 100644 docker/setup/keys/primary-3.key create mode 100644 docker/setup/keys/primary-4.key create mode 100644 docker/setup/keys/primary-5.key create mode 100644 docker/setup/keys/primary-6.key create mode 100644 docker/setup/keys/primary-7.key create mode 100644 docker/setup/keys/primary-network-1.key create mode 100644 docker/setup/keys/primary-network-2.key create mode 100644 docker/setup/keys/primary-network-3.key create mode 100644 docker/setup/keys/primary-network-4.key create mode 100644 docker/setup/keys/primary-network-5.key create mode 100644 docker/setup/keys/primary-network-6.key create mode 100644 docker/setup/keys/primary-network-7.key create mode 100644 docker/setup/keys/worker-network-1.key create mode 100644 docker/setup/keys/worker-network-2.key create mode 100644 docker/setup/keys/worker-network-3.key create mode 100644 docker/setup/keys/worker-network-4.key create mode 100644 docker/setup/keys/worker-network-5.key create mode 100644 docker/setup/keys/worker-network-6.key create mode 100644 docker/setup/keys/worker-network-7.key delete mode 100644 docker/setup/single-operator/README.md delete mode 100644 docker/setup/single-operator/docker-compose.yml create mode 100644 sequencer/build.rs diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 973aa79..5c6ecfb 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -12,7 +12,7 @@ on: jobs: build: - name: Build and push docker images + name: Build and push docker image runs-on: ubuntu-latest env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true diff --git a/Cargo.lock b/Cargo.lock index d0bb108..bb43be0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,15 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array", -] - [[package]] name = "aead" version = "0.5.2" @@ -36,83 +27,38 @@ dependencies = [ "generic-array", ] -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", -] - [[package]] name = "aes" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ - "cfg-if 1.0.0", - "cipher 0.4.4", + "cfg-if", + "cipher", "cpufeatures", ] -[[package]] -name = "aes-gcm" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" -dependencies = [ - "aead 0.3.2", - "aes 0.6.0", - "cipher 0.2.5", - "ctr 0.6.0", - "ghash 0.3.1", - "subtle", -] - [[package]] name = "aes-gcm" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead 0.5.2", - "aes 0.8.3", - "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", + "aead", + "aes", + "cipher", + "ctr", + "ghash", "subtle", ] -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug", -] - [[package]] name = "ahash" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", "zerocopy", @@ -171,13 +117,13 @@ dependencies = [ "anyhow", "async-trait", "bincode", - "bytes 1.5.0", + "bytes", "ed25519 1.5.3", "futures", "hex", - "http", + "http 0.2.11", "matchit 0.5.0", - "pin-project-lite 0.2.13", + "pin-project-lite", "pkcs8 0.9.0", "quinn", "quinn-proto", @@ -188,7 +134,7 @@ dependencies = [ "rustls-webpki", "serde", "serde_json", - "socket2 0.5.5", + "socket2", "tap", "thiserror", "tokio", @@ -215,12 +161,12 @@ version = "0.0.0" source = "git+https://github.com/mystenlabs/anemo.git?rev=1169850e6af127397068cd86764c29b1d49dbe35#1169850e6af127397068cd86764c29b1d49dbe35" dependencies = [ "anemo", - "bytes 1.5.0", + "bytes", "dashmap", "futures", "governor", "nonzero_ext", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", "tower", "tracing", @@ -323,7 +269,7 @@ dependencies = [ "num-bigint 0.4.4", "num-traits", "paste", - "rustc_version 0.4.0", + "rustc_version", "zeroize", ] @@ -413,12 +359,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.4" @@ -438,7 +378,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.31", + "time", ] [[package]] @@ -464,30 +404,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" -dependencies = [ - "concurrent-queue", - "event-listener 4.0.2", - "event-listener-strategy", - "futures-core", - "pin-project-lite 0.2.13", -] - [[package]] name = "async-compression" version = "0.3.15" @@ -498,222 +414,10 @@ dependencies = [ "flate2", "futures-core", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", ] -[[package]] -name = "async-dup" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2886ab563af5038f79ec016dd7b87947ed138b794e8dd64992962c9cca0411" -dependencies = [ - "async-lock 3.2.0", - "futures-io", -] - -[[package]] -name = "async-executor" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" -dependencies = [ - "async-lock 3.2.0", - "async-task", - "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.1.0", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.1.1", - "async-executor", - "async-io 2.2.2", - "async-lock 3.2.0", - "blocking", - "futures-lite 2.1.0", - "once_cell", -] - -[[package]] -name = "async-h1" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1d1dae8cb2c4258a79d6ed088b7fb9b4763bf4e9b22d040779761e046a2971" -dependencies = [ - "async-channel 1.9.0", - "async-dup", - "async-global-executor", - "async-io 1.13.0", - "futures-lite 1.13.0", - "http-types", - "httparse", - "log", - "pin-project", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if 1.0.0", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" -dependencies = [ - "async-lock 3.2.0", - "cfg-if 1.0.0", - "concurrent-queue", - "futures-io", - "futures-lite 2.1.0", - "parking", - "polling 3.3.1", - "rustix 0.38.28", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" -dependencies = [ - "event-listener 4.0.2", - "event-listener-strategy", - "pin-project-lite 0.2.13", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if 1.0.0", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.28", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-session" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345022a2eed092cd105cc1b26fd61c341e100bd5fcbbd792df4baf31c2cc631f" -dependencies = [ - "anyhow", - "async-std", - "async-trait", - "base64 0.12.3", - "bincode", - "blake3 0.3.8", - "chrono", - "hmac 0.8.1", - "kv-log-macro", - "rand 0.7.3", - "serde", - "serde_json", - "sha2 0.9.9", -] - -[[package]] -name = "async-signal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" -dependencies = [ - "async-io 2.2.2", - "async-lock 2.8.0", - "atomic-waker", - "cfg-if 1.0.0", - "futures-core", - "futures-io", - "rustix 0.38.28", - "signal-hook-registry", - "slab", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-sse" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53bba003996b8fd22245cd0c59b869ba764188ed435392cf2796d03b805ade10" -dependencies = [ - "async-channel 1.9.0", - "async-std", - "http-types", - "log", - "memchr", - "pin-project-lite 0.1.12", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite 0.2.13", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - [[package]] name = "async-stream" version = "0.3.5" @@ -722,7 +426,7 @@ checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] @@ -736,12 +440,6 @@ dependencies = [ "syn 2.0.42", ] -[[package]] -name = "async-task" -version = "4.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" - [[package]] name = "async-trait" version = "0.1.75" @@ -753,12 +451,6 @@ dependencies = [ "syn 2.0.42", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "auto_ops" version = "0.3.0" @@ -787,27 +479,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.3.4", "base64 0.21.5", "bitflags 1.3.2", - "bytes 1.5.0", + "bytes", "futures-util", "headers", - "http", - "http-body", - "hyper", + "http 0.2.11", + "http-body 0.4.6", + "hyper 0.14.28", "itoa", "matchit 0.7.3", "memchr", "mime", "percent-encoding", - "pin-project-lite 0.2.13", + "pin-project-lite", "rustversion", "serde", "serde_json", "serde_path_to_error", "serde_urlencoded", - "sha1 0.10.6", + "sha1", "sync_wrapper", "tokio", "tokio-tungstenite", @@ -816,6 +508,40 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d09dbe0e490df5da9d69b36dca48a76635288a82f92eca90024883a56202026d" +dependencies = [ + "async-trait", + "axum-core 0.4.2", + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.1.0", + "hyper-util", + "itoa", + "matchit 0.7.3", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "axum-core" version = "0.3.4" @@ -823,16 +549,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" dependencies = [ "async-trait", - "bytes 1.5.0", + "bytes", "futures-util", - "http", - "http-body", + "http 0.2.11", + "http-body 0.4.6", "mime", "rustversion", "tower-layer", "tower-service", ] +[[package]] +name = "axum-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c8503f93e6d144ee5690907ba22db7ba79ab001a932ab99034f0fe836b3df" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "axum-server" version = "0.5.1" @@ -840,12 +587,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447f28c85900215cc1bea282f32d4a2f22d55c5a300afdfbc661c8d6a632e063" dependencies = [ "arc-swap", - "bytes 1.5.0", + "bytes", "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite 0.2.13", + "http 0.2.11", + "http-body 0.4.6", + "hyper 0.14.28", + "pin-project-lite", "rustls", "rustls-pemfile", "tokio", @@ -860,9 +607,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ "futures-core", - "getrandom 0.2.11", + "getrandom", "instant", - "pin-project-lite 0.2.13", + "pin-project-lite", "rand 0.8.5", "tokio", ] @@ -875,7 +622,7 @@ checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -900,12 +647,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - [[package]] name = "base64" version = "0.13.1" @@ -1027,21 +768,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "blake3" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "cc", - "cfg-if 0.1.10", - "constant_time_eq 0.1.5", - "crypto-mac 0.8.0", - "digest 0.9.0", -] - [[package]] name = "blake3" version = "1.5.0" @@ -1049,10 +775,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec", "cc", - "cfg-if 1.0.0", - "constant_time_eq 0.3.0", + "cfg-if", + "constant_time_eq", ] [[package]] @@ -1089,22 +815,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "blocking" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" -dependencies = [ - "async-channel 2.1.1", - "async-lock 3.2.0", - "async-task", - "fastrand 2.0.1", - "futures-io", - "futures-lite 2.1.0", - "piper", - "tracing", -] - [[package]] name = "blst" version = "0.3.10" @@ -1183,12 +893,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.5.0" @@ -1215,7 +919,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" dependencies = [ - "cipher 0.4.4", + "cipher", ] [[package]] @@ -1237,12 +941,6 @@ dependencies = [ "nom", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -1257,22 +955,11 @@ checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", - "js-sys", "num-traits", "serde", - "wasm-bindgen", "windows-targets 0.48.5", ] -[[package]] -name = "cipher" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" -dependencies = [ - "generic-array", -] - [[package]] name = "cipher" version = "0.4.4" @@ -1350,33 +1037,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "concurrent-queue" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "const_fn" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1398,23 +1064,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "cookie" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" -dependencies = [ - "aes-gcm 0.8.0", - "base64 0.13.1", - "hkdf 0.10.0", - "hmac 0.10.1", - "percent-encoding", - "rand 0.8.5", - "sha2 0.9.9", - "time 0.2.27", - "version_check", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -1449,19 +1098,13 @@ dependencies = [ "libc", ] -[[package]] -name = "cpuid-bool" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" - [[package]] name = "crc32fast" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1470,7 +1113,7 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -1480,7 +1123,7 @@ version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1549,26 +1192,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "crypto-mac" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "crypto-mac" version = "0.11.0" @@ -1585,53 +1208,13 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "382ce8820a5bb815055d3553a610e8cb542b2d767bbacea99038afda96cd760d" -[[package]] -name = "ctr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" -dependencies = [ - "cipher 0.2.5", -] - [[package]] name = "ctr" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher 0.4.4", -] - -[[package]] -name = "curl" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" -dependencies = [ - "curl-sys", - "libc", - "openssl-probe", - "openssl-sys", - "schannel", - "socket2 0.4.10", - "winapi", -] - -[[package]] -name = "curl-sys" -version = "0.4.70+curl-8.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0333d8849afe78a4c8102a429a446bfdd055832af071945520e835ae2d841e" -dependencies = [ - "cc", - "libc", - "libnghttp2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", - "windows-sys 0.48.0", + "cipher", ] [[package]] @@ -1640,13 +1223,13 @@ version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", "platforms", - "rustc_version 0.4.0", + "rustc_version", "subtle", ] @@ -1751,7 +1334,7 @@ version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown 0.14.3", "lock_api", "once_cell", @@ -1887,7 +1470,7 @@ dependencies = [ "convert_case 0.4.0", "proc-macro2 1.0.71", "quote 1.0.33", - "rustc_version 0.4.0", + "rustc_version", "syn 1.0.109", ] @@ -1924,12 +1507,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - [[package]] name = "displaydoc" version = "0.2.4" @@ -2101,7 +1678,7 @@ version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -2135,15 +1712,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "erased-serde" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" -dependencies = [ - "serde", -] - [[package]] name = "errno" version = "0.3.8" @@ -2154,44 +1722,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite 0.2.13", -] - -[[package]] -name = "event-listener" -version = "4.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "218a870470cce1469024e9fb66b901aa983929d81304a1cdb299f28118e550d5" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite 0.2.13", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.2", - "pin-project-lite 0.2.13", -] - [[package]] name = "eyre" version = "0.6.11" @@ -2207,8 +1737,8 @@ name = "fastcrypto" version = "0.1.7" source = "git+https://github.com/MystenLabs/fastcrypto?rev=69180dc7275f5f0efb69e11e9d03f6db338d1dd6#69180dc7275f5f0efb69e11e9d03f6db338d1dd6" dependencies = [ - "aes 0.8.3", - "aes-gcm 0.10.3", + "aes", + "aes-gcm", "ark-ec", "ark-ff", "ark-secp256r1", @@ -2217,12 +1747,12 @@ dependencies = [ "base64ct", "bincode", "blake2", - "blake3 1.5.0", + "blake3", "blst", "bs58", "bulletproofs", "cbc", - "ctr 0.9.2", + "ctr", "curve25519-dalek-ng", "derive_more", "digest 0.10.7", @@ -2233,7 +1763,7 @@ dependencies = [ "fastcrypto-derive", "generic-array", "hex", - "hkdf 0.12.4", + "hkdf", "lazy_static", "merlin", "once_cell", @@ -2290,15 +1820,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.0.1" @@ -2314,22 +1835,6 @@ dependencies = [ "libc", ] -[[package]] -name = "femme" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc04871e5ae3aa2952d552dae6b291b3099723bf779a8054281c1366a54613ef" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "ff" version = "0.10.1" @@ -2381,17 +1886,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "flume" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bebadab126f8120d410b677ed95eee4ba6eb7c6dd8e34a5ec88a08050e26132" -dependencies = [ - "futures-core", - "futures-sink", - "spinning_top", -] - [[package]] name = "fnv" version = "1.0.7" @@ -2467,34 +1961,6 @@ version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite 0.2.13", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" -dependencies = [ - "fastrand 2.0.1", - "futures-core", - "futures-io", - "parking", - "pin-project-lite 0.2.13", -] - [[package]] name = "futures-macro" version = "0.3.29" @@ -2537,7 +2003,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", "pin-utils", "slab", ] @@ -2550,19 +2016,8 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "serde", "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "version_check", + "zeroize", ] [[package]] @@ -2571,19 +2026,9 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "ghash" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" -dependencies = [ - "opaque-debug", - "polyval 0.4.5", + "wasi", ] [[package]] @@ -2593,7 +2038,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ "opaque-debug", - "polyval 0.6.1", + "polyval", ] [[package]] @@ -2608,25 +2053,13 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "governor" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dashmap", "futures", "futures-timer", @@ -2666,12 +2099,31 @@ version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ - "bytes 1.5.0", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.11", + "indexmap 2.1.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d308f63daf4181410c242d34c11f928dcb3aa105852019e043c9d1f4e4368a" +dependencies = [ + "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", + "http 1.0.0", "indexmap 2.1.0", "slab", "tokio", @@ -2721,12 +2173,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ "base64 0.21.5", - "bytes 1.5.0", + "bytes", "headers-core", - "http", + "http 0.2.11", "httpdate", "mime", - "sha1 0.10.6", + "sha1", ] [[package]] @@ -2735,7 +2187,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http", + "http 0.2.11", ] [[package]] @@ -2765,16 +2217,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hkdf" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" -dependencies = [ - "digest 0.9.0", - "hmac 0.10.1", -] - [[package]] name = "hkdf" version = "0.12.4" @@ -2784,33 +2226,13 @@ dependencies = [ "hmac 0.12.1", ] -[[package]] -name = "hmac" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" -dependencies = [ - "crypto-mac 0.10.0", - "digest 0.9.0", -] - [[package]] name = "hmac" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.0", + "crypto-mac", "digest 0.9.0", ] @@ -2838,7 +2260,18 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ - "bytes 1.5.0", + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", "fnv", "itoa", ] @@ -2849,52 +2282,39 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes 1.5.0", - "http", - "pin-project-lite 0.2.13", + "bytes", + "http 0.2.11", + "pin-project-lite", ] [[package]] -name = "http-client" -version = "6.5.3" +name = "http-body" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1947510dc91e2bf586ea5ffb412caad7673264e14bb39fb9078da114a94ce1a5" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ - "async-std", - "async-trait", - "cfg-if 1.0.0", - "http-types", - "isahc", - "log", + "bytes", + "http 1.0.0", ] [[package]] -name = "http-range-header" -version = "0.3.1" +name = "http-body-util" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +dependencies = [ + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "pin-project-lite", +] [[package]] -name = "http-types" -version = "2.12.0" +name = "http-range-header" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" -dependencies = [ - "anyhow", - "async-channel 1.9.0", - "async-std", - "base64 0.13.1", - "cookie", - "futures-lite 1.13.0", - "infer", - "pin-project-lite 0.2.13", - "rand 0.7.3", - "serde", - "serde_json", - "serde_qs", - "serde_urlencoded", - "url", -] +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" @@ -2920,24 +2340,43 @@ version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ - "bytes 1.5.0", + "bytes", "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.3.22", + "http 0.2.11", + "http-body 0.4.6", "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.13", - "socket2 0.5.5", + "pin-project-lite", + "socket2", "tokio", "tower-service", "tracing", "want", ] +[[package]] +name = "hyper" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.0", + "http 1.0.0", + "http-body 1.0.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "tokio", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -2945,8 +2384,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", - "hyper", + "http 0.2.11", + "hyper 0.14.28", "rustls", "tokio", "tokio-rustls", @@ -2958,12 +2397,30 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper", - "pin-project-lite 0.2.13", + "hyper 0.14.28", + "pin-project-lite", "tokio", "tokio-io-timeout", ] +[[package]] +name = "hyper-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdea9aac0dbe5a9240d68cfd9501e2db94222c6dc06843e06640b9e07f0fdc67" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "hyper 1.1.0", + "pin-project-lite", + "socket2", + "tokio", + "tracing", +] + [[package]] name = "iana-time-zone" version = "0.1.58" @@ -3030,12 +2487,6 @@ dependencies = [ "hashbrown 0.14.3", ] -[[package]] -name = "infer" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" - [[package]] name = "inout" version = "0.1.3" @@ -3052,18 +2503,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", + "cfg-if", ] [[package]] @@ -3088,33 +2528,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.28", + "rustix", "windows-sys 0.48.0", ] -[[package]] -name = "isahc" -version = "0.9.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2948a0ce43e2c2ef11d7edf6816508998d99e13badd1150be0914205df9388a" -dependencies = [ - "bytes 0.5.6", - "crossbeam-utils", - "curl", - "curl-sys", - "flume", - "futures-lite 1.13.0", - "http", - "log", - "once_cell", - "slab", - "sluice", - "tracing", - "tracing-futures", - "url", - "waker-fn", -] - [[package]] name = "itertools" version = "0.10.5" @@ -3166,15 +2583,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "launcher" version = "0.1.0" @@ -3210,7 +2618,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] @@ -3220,16 +2628,6 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" -[[package]] -name = "libnghttp2-sys" -version = "0.1.9+1.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b57e858af2798e167e709b9d969325b6d8e9d50232fcbc494d7d54f976854a64" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -3298,7 +2696,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ "cc", - "libc", "pkg-config", "vcpkg", ] @@ -3309,12 +2706,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.12" @@ -3336,10 +2727,6 @@ name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -dependencies = [ - "serde", - "value-bag", -] [[package]] name = "lru" @@ -3453,7 +2840,7 @@ checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -3463,7 +2850,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "downcast", "fragile", "lazy_static", @@ -3478,7 +2865,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "proc-macro2 1.0.71", "quote 1.0.33", "syn 1.0.109", @@ -3589,7 +2976,7 @@ dependencies = [ "async-trait", "bcs", "bincode", - "bytes 1.5.0", + "bytes", "fastcrypto", "futures", "indexmap 1.9.3", @@ -3655,11 +3042,11 @@ dependencies = [ "anemo-tower", "anyhow", "async-trait", - "axum", + "axum 0.6.20", "axum-server", "backoff", "bincode", - "bytes 1.5.0", + "bytes", "dashmap", "futures", "narwhal-crypto", @@ -3682,9 +3069,9 @@ dependencies = [ "anemo", "arc-swap", "async-trait", - "axum", - "bytes 1.5.0", - "cfg-if 1.0.0", + "axum 0.6.20", + "bytes", + "cfg-if", "clap", "eyre", "fastcrypto", @@ -3726,8 +3113,8 @@ dependencies = [ "backoff", "bcs", "bincode", - "bytes 1.5.0", - "cfg-if 1.0.0", + "bytes", + "cfg-if", "dashmap", "fastcrypto", "fastcrypto-tbls", @@ -3845,7 +3232,7 @@ dependencies = [ "anyhow", "base64 0.21.5", "bcs", - "bytes 1.5.0", + "bytes", "derive_builder", "enum_dispatch", "fastcrypto", @@ -3885,7 +3272,7 @@ version = "0.1.0" dependencies = [ "anemo", "async-trait", - "axum", + "axum 0.6.20", "clap", "crossterm", "dashmap", @@ -3918,7 +3305,7 @@ dependencies = [ "arc-swap", "async-trait", "byteorder", - "bytes 1.5.0", + "bytes", "eyre", "fastcrypto", "futures", @@ -4100,24 +3487,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "ouroboros" version = "0.17.2" @@ -4171,12 +3540,6 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - [[package]] name = "parking_lot" version = "0.12.1" @@ -4193,7 +3556,7 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -4300,12 +3663,6 @@ dependencies = [ "syn 2.0.42", ] -[[package]] -name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - [[package]] name = "pin-project-lite" version = "0.2.13" @@ -4318,17 +3675,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand 2.0.1", - "futures-io", -] - [[package]] name = "pkcs1" version = "0.4.1" @@ -4378,7 +3724,7 @@ name = "playground" version = "0.1.0" dependencies = [ "bcs", - "bytes 1.5.0", + "bytes", "fastcrypto", "narwhal-config", "narwhal-crypto", @@ -4394,57 +3740,16 @@ dependencies = [ "tokio", ] -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if 1.0.0", - "concurrent-queue", - "libc", - "log", - "pin-project-lite 0.2.13", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" -dependencies = [ - "cfg-if 1.0.0", - "concurrent-queue", - "pin-project-lite 0.2.13", - "rustix 0.38.28", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "polyval" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" -dependencies = [ - "cpuid-bool", - "opaque-debug", - "universal-hash 0.4.0", -] - [[package]] name = "polyval" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug", - "universal-hash 0.5.1", + "universal-hash", ] [[package]] @@ -4471,7 +3776,6 @@ dependencies = [ "indexmap 1.9.3", "narwhal-config", "narwhal-crypto", - "narwhal-exporter", "narwhal-test-utils", "narwhal-types", "narwhal-utils", @@ -4583,12 +3887,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" version = "0.4.30" @@ -4613,7 +3911,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static", "memchr", @@ -4659,7 +3957,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ - "bytes 1.5.0", + "bytes", "prost-derive", ] @@ -4669,7 +3967,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ - "bytes 1.5.0", + "bytes", "heck 0.4.1", "itertools 0.11.0", "log", @@ -4733,7 +4031,7 @@ dependencies = [ "mach2", "once_cell", "raw-cpuid", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "web-sys", "winapi", ] @@ -4750,9 +4048,9 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ - "bytes 1.5.0", + "bytes", "futures-io", - "pin-project-lite 0.2.13", + "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", @@ -4768,7 +4066,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" dependencies = [ - "bytes 1.5.0", + "bytes", "rand 0.8.5", "ring 0.16.20", "rustc-hash", @@ -4785,9 +4083,9 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ - "bytes 1.5.0", + "bytes", "libc", - "socket2 0.5.5", + "socket2", "tracing", "windows-sys 0.48.0", ] @@ -4822,8 +4120,6 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.16", - "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc", @@ -4865,9 +4161,6 @@ name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] [[package]] name = "rand_core" @@ -4875,7 +4168,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", + "getrandom", ] [[package]] @@ -4913,7 +4206,7 @@ checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ "pem", "ring 0.16.20", - "time 0.3.31", + "time", "yasna", ] @@ -4988,14 +4281,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64 0.21.5", - "bytes 1.5.0", + "bytes", "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", + "h2 0.3.22", + "http 0.2.11", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-rustls", "ipnet", "js-sys", @@ -5003,7 +4296,7 @@ dependencies = [ "mime", "once_cell", "percent-encoding", - "pin-project-lite 0.2.13", + "pin-project-lite", "rustls", "rustls-pemfile", "serde", @@ -5059,7 +4352,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.11", + "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -5087,12 +4380,6 @@ dependencies = [ "librocksdb-sys", ] -[[package]] -name = "route-recognizer" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56770675ebc04927ded3e60633437841581c285dc6236109ea25fbf3beb7b59e" - [[package]] name = "rsa" version = "0.8.2" @@ -5126,22 +4413,13 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.20", + "semver", ] [[package]] @@ -5153,20 +4431,6 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.28" @@ -5176,7 +4440,7 @@ dependencies = [ "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.12", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -5230,21 +4494,12 @@ dependencies = [ ] [[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] name = "schemars" version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5319,53 +4574,36 @@ dependencies = [ "cc", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "sequencer" version = "0.1.0" dependencies = [ "anyhow", + "axum 0.7.3", "bcs", - "bytes 1.5.0", + "bytes", "clap", "env_logger", - "fastcrypto", "hex", "log", - "narwhal-crypto", - "narwhal-test-utils", "narwhal-types", - "narwhal-utils", "pre-block", - "rand 0.8.5", + "prost", + "protobuf-src", + "reqwest", "serde", "serde_json", - "surf", "tezos-smart-rollup-encoding", "tezos_data_encoding", - "tide", "tokio", "tonic", + "tonic-build", ] [[package]] @@ -5419,15 +4657,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "serde_fmt" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" -dependencies = [ - "serde", -] - [[package]] name = "serde_json" version = "1.0.108" @@ -5450,17 +4679,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_qs" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" -dependencies = [ - "percent-encoding", - "serde", - "thiserror", -] - [[package]] name = "serde_repr" version = "0.1.17" @@ -5506,7 +4724,7 @@ dependencies = [ "serde", "serde_json", "serde_with_macros", - "time 0.3.31", + "time", ] [[package]] @@ -5546,32 +4764,17 @@ dependencies = [ "unsafe-libyaml", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - [[package]] name = "sha1" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - [[package]] name = "sha2" version = "0.9.9" @@ -5579,7 +4782,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -5591,7 +4794,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -5729,17 +4932,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "sluice" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5" -dependencies = [ - "async-channel 1.9.0", - "futures-core", - "futures-io", -] - [[package]] name = "smallvec" version = "1.11.2" @@ -5752,16 +4944,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -5784,15 +4966,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spinning_top" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9eb1a2f4c41445a3a0ff9abc5221c5fcd28e1f13cd7c0397706f9ac938ddb0" -dependencies = [ - "lock_api", -] - [[package]] name = "spki" version = "0.6.0" @@ -5813,70 +4986,12 @@ dependencies = [ "der 0.7.8", ] -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check", -] - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version 0.2.3", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2 1.0.71", - "quote 1.0.33", - "serde", - "serde_derive", - "syn 1.0.109", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2 1.0.71", - "quote 1.0.33", - "serde", - "serde_derive", - "serde_json", - "sha1 0.6.1", - "syn 1.0.109", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "strsim" version = "0.10.0" @@ -5913,107 +5028,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" -[[package]] -name = "surf" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718b1ae6b50351982dedff021db0def601677f2120938b070eadb10ba4038dd7" -dependencies = [ - "async-std", - "async-trait", - "cfg-if 1.0.0", - "encoding_rs", - "futures-util", - "getrandom 0.2.11", - "http-client", - "http-types", - "log", - "mime_guess", - "once_cell", - "pin-project-lite 0.2.13", - "serde", - "serde_json", - "web-sys", -] - -[[package]] -name = "sval" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1604e9ab506f4805bc62d2868c6d20f23fa6ced4c7cfe695a1d20589ba5c63d0" - -[[package]] -name = "sval_buffer" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2831b6451148d344f612016d4277348f7721b78a0869a145fd34ef8b06b3fa2e" -dependencies = [ - "sval", - "sval_ref", -] - -[[package]] -name = "sval_dynamic" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238ac5832a23099a413ffd22e66f7e6248b9af4581b64c758ca591074be059fc" -dependencies = [ - "sval", -] - -[[package]] -name = "sval_fmt" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8474862431bac5ac7aee8a12597798e944df33f489c340e17e886767bda0c4e" -dependencies = [ - "itoa", - "ryu", - "sval", -] - -[[package]] -name = "sval_json" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f348030cc3d2a11eb534145600601f080cf16bf9ec0783efecd2883f14c21e" -dependencies = [ - "itoa", - "ryu", - "sval", -] - -[[package]] -name = "sval_nested" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6659c3f6be1e5e99dc7c518877f48a8a39088ace2504b046db789bd78ce5969d" -dependencies = [ - "sval", - "sval_buffer", - "sval_ref", -] - -[[package]] -name = "sval_ref" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829ad319bd82d0da77be6f3d547623686c453502f8eebdeb466cfa987972bd28" -dependencies = [ - "sval", -] - -[[package]] -name = "sval_serde" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9da6c3efaedf8b8c0861ec5343e8e8c51d838f326478623328bd8728b79bca" -dependencies = [ - "serde", - "sval", - "sval_nested", -] - [[package]] name = "syn" version = "0.15.44" @@ -6098,10 +5112,10 @@ version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ - "cfg-if 1.0.0", - "fastrand 2.0.1", + "cfg-if", + "fastrand", "redox_syscall", - "rustix 0.38.28", + "rustix", "windows-sys 0.48.0", ] @@ -6120,7 +5134,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.28", + "rustix", "windows-sys 0.48.0", ] @@ -6162,7 +5176,7 @@ dependencies = [ "tezos_data_encoding", "tezos_data_encoding_derive", "thiserror", - "time 0.3.31", + "time", ] [[package]] @@ -6296,7 +5310,7 @@ version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -6309,44 +5323,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "tide" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c459573f0dd2cc734b539047f57489ea875af8ee950860ded20cf93a79a1dee0" -dependencies = [ - "async-h1", - "async-session", - "async-sse", - "async-std", - "async-trait", - "femme", - "futures-util", - "http-client", - "http-types", - "kv-log-macro", - "log", - "pin-project-lite 0.2.13", - "route-recognizer", - "serde", - "serde_json", -] - -[[package]] -name = "time" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb", - "time-macros 0.1.1", - "version_check", - "winapi", -] - [[package]] name = "time" version = "0.3.31" @@ -6358,7 +5334,7 @@ dependencies = [ "powerfmt", "serde", "time-core", - "time-macros 0.2.16", + "time-macros", ] [[package]] @@ -6367,16 +5343,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - [[package]] name = "time-macros" version = "0.2.16" @@ -6386,19 +5352,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "time-macros-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" -dependencies = [ - "proc-macro-hack", - "proc-macro2 1.0.71", - "quote 1.0.33", - "standback", - "syn 1.0.109", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -6421,14 +5374,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", - "bytes 1.5.0", + "bytes", "libc", "mio", "num_cpus", "parking_lot", - "pin-project-lite 0.2.13", + "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -6439,7 +5392,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" dependencies = [ - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", ] @@ -6471,7 +5424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", "tokio-util", ] @@ -6494,10 +5447,10 @@ version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ - "bytes 1.5.0", + "bytes", "futures-core", "futures-sink", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", "tracing", ] @@ -6519,13 +5472,13 @@ checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.6.20", "base64 0.21.5", - "bytes 1.5.0", - "h2", - "http", - "http-body", - "hyper", + "bytes", + "h2 0.3.22", + "http 0.2.11", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-timeout", "percent-encoding", "pin-project", @@ -6578,7 +5531,7 @@ dependencies = [ "hdrhistogram", "indexmap 1.9.3", "pin-project", - "pin-project-lite 0.2.13", + "pin-project-lite", "rand 0.8.5", "slab", "tokio", @@ -6597,18 +5550,18 @@ dependencies = [ "async-compression", "base64 0.13.1", "bitflags 1.3.2", - "bytes 1.5.0", + "bytes", "futures-core", "futures-util", - "http", - "http-body", + "http 0.2.11", + "http-body 0.4.6", "http-range-header", "httpdate", "iri-string", "mime", "mime_guess", "percent-encoding", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", "tokio-util", "tower", @@ -6637,7 +5590,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", - "pin-project-lite 0.2.13", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -6650,7 +5603,7 @@ checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", "thiserror", - "time 0.3.31", + "time", "tracing-subscriber", ] @@ -6675,16 +5628,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "tracing-serde" version = "0.1.3" @@ -6710,7 +5653,7 @@ dependencies = [ "sharded-slab", "smallvec", "thread_local", - "time 0.3.31", + "time", "tracing", "tracing-core", "tracing-serde", @@ -6729,13 +5672,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ "byteorder", - "bytes 1.5.0", + "bytes", "data-encoding", - "http", + "http 0.2.11", "httparse", "log", "rand 0.8.5", - "sha1 0.10.6", + "sha1", "thiserror", "url", "utf-8", @@ -6801,16 +5744,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "universal-hash" version = "0.5.1" @@ -6854,7 +5787,6 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", - "serde", ] [[package]] @@ -6875,7 +5807,7 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ - "getrandom 0.2.11", + "getrandom", "rand 0.8.5", ] @@ -6885,42 +5817,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "value-bag" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" -dependencies = [ - "value-bag-serde1", - "value-bag-sval2", -] - -[[package]] -name = "value-bag-serde1" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ba39dc791ecb35baad371a3fc04c6eab688c04937d2e0ac6c22b612c0357bf" -dependencies = [ - "erased-serde", - "serde", - "serde_fmt", -] - -[[package]] -name = "value-bag-sval2" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e06c10810a57bbf45778d023d432a50a1daa7d185991ae06bcfb6c654d0945" -dependencies = [ - "sval", - "sval_buffer", - "sval_dynamic", - "sval_fmt", - "sval_json", - "sval_ref", - "sval_serde", -] - [[package]] name = "vcpkg" version = "0.2.15" @@ -6942,12 +5838,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - [[package]] name = "want" version = "0.3.1" @@ -6957,12 +5847,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -6975,9 +5859,7 @@ version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ - "cfg-if 1.0.0", - "serde", - "serde_json", + "cfg-if", "wasm-bindgen-macro", ] @@ -7002,7 +5884,7 @@ version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -7062,7 +5944,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.28", + "rustix", ] [[package]] @@ -7243,7 +6125,7 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -7271,7 +6153,7 @@ dependencies = [ "oid-registry", "rusticata-macros", "thiserror", - "time 0.3.31", + "time", ] [[package]] @@ -7295,7 +6177,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.31", + "time", ] [[package]] diff --git a/Makefile b/Makefile index 0903ea1..ee2bf60 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,11 @@ build-operator: $(MAKE) build-installer build-sequencer: - cargo build --package sequencer + cargo build --bin sequencer + +build-narwhal: + cargo build --bin narwhal-node + cp ./target/debug/narwhal-node ./bin/ image-operator: docker build -t dsn/operator:$(OCTEZ_TAG) --file ./docker/operator/local.dockerfile \ @@ -45,8 +49,8 @@ image-operator: --build-arg OCTEZ_PROTO=$(OCTEZ_PROTO) \ . -image-sequencer: - docker build -t dsn/sequencer --file ./docker/sequencer/Dockerfile . +image-narwhal: + docker build -t dsn/narwhal:latest --file ./docker/sequencer/local.dockerfile . run-operator: $(MAKE) build-operator @@ -63,8 +67,27 @@ run-operator: run-sequencer: $(MAKE) build-sequencer - RUST_LOG=info ./target/debug/sequencer + RUST_LOG=debug ./target/debug/sequencer + +run-dsn: + ./target/debug/launcher --id 1 --log-level 3 & + ./target/debug/launcher --id 2 --log-level 0 & + ./target/debug/launcher --id 3 --log-level 0 & + ./target/debug/launcher --id 4 --log-level 0 & + ./target/debug/launcher --id 5 --log-level 0 & + ./target/debug/launcher --id 6 --log-level 0 & + ./target/debug/launcher --id 7 --log-level 0 & + +kill-dsn: + killall narwhal-node + +start-dsn-min: + $(MAKE) build-narwhal + $(MAKE) image-narwhal + cd docker/setup/dsn-min-4-1 && docker-compose up -d + +stop-dsn-min: + cd docker/setup/dsn-min-4-1 && docker-compose down -v -run-consensus: - cargo build --package launcher - ./target/debug/launcher \ No newline at end of file +broadcast: + curl -d '{"data":"deadbeef"}' -H "Content-Type: application/json" -X POST http://localhost:8080/broadcast \ No newline at end of file diff --git a/crates/pre-block/Cargo.toml b/crates/pre-block/Cargo.toml index b08bfda..9b84fcc 100644 --- a/crates/pre-block/Cargo.toml +++ b/crates/pre-block/Cargo.toml @@ -21,12 +21,10 @@ narwhal-types = { workspace = true, optional = true } narwhal-utils = { workspace = true, optional = true } narwhal-test-utils = { workspace = true, optional = true } rand = { workspace = true, optional = true } -narwhal-exporter = { workspace = true, optional = true } [dev-dependencies] narwhal-types.workspace = true narwhal-crypto.workspace = true -narwhal-exporter.workspace = true narwhal-utils.workspace = true narwhal-test-utils.workspace = true narwhal-config.workspace = true @@ -39,7 +37,6 @@ rand.workspace = true default = [] conversions = [ "dep:rand", - "dep:narwhal-exporter", "dep:narwhal-types", "dep:narwhal-utils", "dep:narwhal-test-utils" diff --git a/crates/pre-block/src/conversion.rs b/crates/pre-block/src/conversion.rs index 455fece..2a9e442 100644 --- a/crates/pre-block/src/conversion.rs +++ b/crates/pre-block/src/conversion.rs @@ -4,75 +4,10 @@ use std::collections::BTreeSet; -use narwhal_exporter::proto as exporter; use narwhal_types::{CertificateAPI, CertificateV2, HeaderV2}; use crate::{Batch, Certificate, CertificateHeader, PreBlock}; -impl From for CertificateHeader { - fn from(header: exporter::Header) -> Self { - assert!(header.system_messages.is_empty()); - Self { - author: header.author as u16, - round: header.round, - epoch: header.epoch, - created_at: header.created_at, - payload: header - .payload_info - .into_iter() - .map(|info| { - ( - info.digest.try_into().unwrap(), - (info.worker_id, info.created_at), - ) - }) - .collect(), - system_messages: vec![], - parents: BTreeSet::from_iter( - header - .parents - .into_iter() - .map(|digest| digest.try_into().unwrap()), - ), - } - } -} - -impl From for Certificate { - fn from(cert: exporter::Certificate) -> Self { - Self { - header: cert.header.unwrap().into(), - signers: cert.signers, - signature: cert.signature, - } - } -} - -impl From for PreBlock { - fn from(sub_dag: exporter::SubDag) -> Self { - Self { - batches: sub_dag - .payloads - .into_iter() - .map(|payload| payload.batches) - .map(|batches| { - batches - .into_iter() - .map(|batch| batch.transactions) - .collect() - }) - .collect(), - index: sub_dag.id, - leader: sub_dag.leader.unwrap().into(), - certificates: sub_dag - .certificates - .into_iter() - .map(|cert| cert.into()) - .collect(), - } - } -} - impl From for CertificateHeader { fn from(narwhal_header: HeaderV2) -> Self { CertificateHeader { diff --git a/docker/sequencer/Dockerfile b/docker/sequencer/Dockerfile index d153448..1b5d5f0 100644 --- a/docker/sequencer/Dockerfile +++ b/docker/sequencer/Dockerfile @@ -13,7 +13,7 @@ ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so ARG PROFILE=release COPY --from=builder build/target/${PROFILE}/narwhal-node /usr/bin/narwhal-node COPY --from=builder build/target/${PROFILE}/sequencer /usr/bin/sequencer -COPY ./launcher/defaults/* /narwhal/ +COPY ./docker/setup/keys /keys COPY ./docker/sequencer/entrypoint.sh . RUN chmod +x entrypoint.sh && ln ./entrypoint.sh /usr/bin/narwhal ENTRYPOINT [ "./entrypoint.sh" ] \ No newline at end of file diff --git a/docker/sequencer/entrypoint.sh b/docker/sequencer/entrypoint.sh index ff92e44..0095d36 100644 --- a/docker/sequencer/entrypoint.sh +++ b/docker/sequencer/entrypoint.sh @@ -14,11 +14,11 @@ if [ -z "$VALIDATOR_ID" ]; then fi LOG_LEVEL=${LOG_LEVEL:="-v"} -PRIMARY_KEYS_PATH=${KEYS_PATH:="/narwhal/primary-$VALIDATOR_ID.key"} -PRIMARY_NETWORK_KEYS_PATH=${KEYS_PATH:="/narwhal/primary-network-$VALIDATOR_ID.key"} -WORKER_NETWORK_KEYS_PATH=${KEYS_PATH:="/narwhal/worker-network-$VALIDATOR_ID.key"} -COMMITTEE_PATH=${COMMITTEE_PATH:="/narwhal/committee.json"} -WORKERS_PATH=${WORKERS_PATH:="/narwhal/workers.json"} +PRIMARY_KEYS_PATH=${KEYS_PATH:="/keys/primary-$VALIDATOR_ID.key"} +PRIMARY_NETWORK_KEYS_PATH=${KEYS_PATH:="/keys/primary-network-$VALIDATOR_ID.key"} +WORKER_NETWORK_KEYS_PATH=${KEYS_PATH:="/keys/worker-network-$VALIDATOR_ID.key"} +COMMITTEE_PATH=${COMMITTEE_PATH:="/config/committee.json"} +WORKERS_PATH=${WORKERS_PATH:="/config/workers.json"} DATA_PATH=${DATA_PATH:="/data"} $NARWHAL_NODE_BIN $LOG_LEVEL run-comb \ diff --git a/docker/sequencer/local.dockerfile b/docker/sequencer/local.dockerfile new file mode 100644 index 0000000..ed472c5 --- /dev/null +++ b/docker/sequencer/local.dockerfile @@ -0,0 +1,6 @@ +FROM debian:bullseye-slim +COPY ./bin/narwhal-node /usr/bin/narwhal-node +COPY ./docker/setup/keys /keys +COPY ./docker/sequencer/entrypoint.sh . +RUN chmod +x entrypoint.sh && ln ./entrypoint.sh /usr/bin/narwhal +ENTRYPOINT [ "./entrypoint.sh" ] diff --git a/docker/setup/dsn-min-4-1/README.md b/docker/setup/dsn-min-4-1/README.md new file mode 100644 index 0000000..54cb081 --- /dev/null +++ b/docker/setup/dsn-min-4-1/README.md @@ -0,0 +1,2 @@ +# DSN minimal setup: 4 validators, 1 operator + diff --git a/docker/setup/dsn-min-4-1/committee.json b/docker/setup/dsn-min-4-1/committee.json new file mode 100644 index 0000000..aab9ca6 --- /dev/null +++ b/docker/setup/dsn-min-4-1/committee.json @@ -0,0 +1,41 @@ +{ + "authorities": { + "j2E78yYevoGYOlTLu3WhL688vkH2intlhq1QANSiIoy4Z1KMwV/tZXOvQjWaCDa7CKrADeu/DUB06CMBoc+RTnj9wT2AhSs52IskxL6ad/vXOw+Lz/XkTmSJZpHjO8Gv": { + "protocol_key": "j2E78yYevoGYOlTLu3WhL688vkH2intlhq1QANSiIoy4Z1KMwV/tZXOvQjWaCDa7CKrADeu/DUB06CMBoc+RTnj9wT2AhSs52IskxL6ad/vXOw+Lz/XkTmSJZpHjO8Gv", + "protocol_key_bytes": "j2E78yYevoGYOlTLu3WhL688vkH2intlhq1QANSiIoy4Z1KMwV/tZXOvQjWaCDa7CKrADeu/DUB06CMBoc+RTnj9wT2AhSs52IskxL6ad/vXOw+Lz/XkTmSJZpHjO8Gv", + "network_key": "S3/y4Anx/eyjrG2PtI67P50YQnhA9mcdKY6+lOD3QJc=", + "primary_address": "/dns/validator_1/udp/64010", + "grpc_address": "/ip4/127.0.0.1/tcp/64011", + "hostname": "/dns/validator_1/udp/64010", + "stake": 1000 + }, + "ghfvsNGcuZYPhWMZ0lw9V8aClmFTP0icfbfjPRWgGVASCFovOHS5HkPtkQ+yl11pGNs9Yxk785r0DGnOV1nK2XlPpktV98nQkkmKr0+BunpLhl6PUc1pppZpyM2OkwTK": { + "protocol_key": "ghfvsNGcuZYPhWMZ0lw9V8aClmFTP0icfbfjPRWgGVASCFovOHS5HkPtkQ+yl11pGNs9Yxk785r0DGnOV1nK2XlPpktV98nQkkmKr0+BunpLhl6PUc1pppZpyM2OkwTK", + "protocol_key_bytes": "ghfvsNGcuZYPhWMZ0lw9V8aClmFTP0icfbfjPRWgGVASCFovOHS5HkPtkQ+yl11pGNs9Yxk785r0DGnOV1nK2XlPpktV98nQkkmKr0+BunpLhl6PUc1pppZpyM2OkwTK", + "network_key": "AGCg+dafe69vI1RmNBOWPBd7Tey9IefFq2VfxBYiL2s=", + "primary_address": "/dns/validator_2/udp/64020", + "grpc_address": "/ip4/127.0.0.1/tcp/64021", + "hostname": "/dns/validator_2/udp/64020", + "stake": 1000 + }, + "lRQGsoVv2rvg5r3HLFt6rHd7fST8kCK1vAB4vrpbXYpOe1THFtlI2wLtaGG4jU4gGXBBXG46VRLaiVwuyT/WhuyfO/GQ/pv/XIc5RGtANtfsi8866ZN6HpVKuNf76gXZ": { + "protocol_key": "lRQGsoVv2rvg5r3HLFt6rHd7fST8kCK1vAB4vrpbXYpOe1THFtlI2wLtaGG4jU4gGXBBXG46VRLaiVwuyT/WhuyfO/GQ/pv/XIc5RGtANtfsi8866ZN6HpVKuNf76gXZ", + "protocol_key_bytes": "lRQGsoVv2rvg5r3HLFt6rHd7fST8kCK1vAB4vrpbXYpOe1THFtlI2wLtaGG4jU4gGXBBXG46VRLaiVwuyT/WhuyfO/GQ/pv/XIc5RGtANtfsi8866ZN6HpVKuNf76gXZ", + "network_key": "W3Hy6rvEQvBvbyRTGJMVapWfLqy2UEsp0LS0bsMgDr8=", + "primary_address": "/dns/validator_3/udp/64030", + "grpc_address": "/ip4/127.0.0.1/tcp/64031", + "hostname": "/dns/validator_3/udp/64030", + "stake": 1000 + }, + "tsm6p0wJ54S5Vw9jZS5CuST7du38DXltxDJrIA6/O+qQw3Omj7c7dhvzemuLvFgpAWImyKIXZ+63tiWwOQkz2lKweSwCCb1zahViUWjqe3WvcwrhzUUta4bcDCUpsThI": { + "protocol_key": "tsm6p0wJ54S5Vw9jZS5CuST7du38DXltxDJrIA6/O+qQw3Omj7c7dhvzemuLvFgpAWImyKIXZ+63tiWwOQkz2lKweSwCCb1zahViUWjqe3WvcwrhzUUta4bcDCUpsThI", + "protocol_key_bytes": "tsm6p0wJ54S5Vw9jZS5CuST7du38DXltxDJrIA6/O+qQw3Omj7c7dhvzemuLvFgpAWImyKIXZ+63tiWwOQkz2lKweSwCCb1zahViUWjqe3WvcwrhzUUta4bcDCUpsThI", + "network_key": "Hm5RXTIZIOmqHdFaXSfxUdt5353L3UkGAHdWkFbId5I=", + "primary_address": "/dns/validator_4/udp/64040", + "grpc_address": "/ip4/127.0.0.1/tcp/64041", + "hostname": "/dns/validator_4/udp/64040", + "stake": 1000 + } + }, + "epoch": 0 +} \ No newline at end of file diff --git a/docker/setup/dsn-min-4-1/docker-compose.yml b/docker/setup/dsn-min-4-1/docker-compose.yml new file mode 100644 index 0000000..dec567e --- /dev/null +++ b/docker/setup/dsn-min-4-1/docker-compose.yml @@ -0,0 +1,53 @@ +version: "3.9" + +services: + validator_1: + image: dsn/narwhal:latest + environment: + - VALIDATOR_ID=1 + - LOG_LEVEL=-vvv + expose: + - "64010" # Port to listen on messages from other primary nodes + - "64012" # Port to listen on messages from our worker nodes + ports: + - "127.0.0.1:64011:64011" # gRPC server serving pre-blocks (primary) + - "127.0.0.1:64013:64013" # gRPC server accepting transactions (worker) + volumes: + - ./committee.json:/config/committee.json + - ./workers.json:/config/workers.json + + validator_2: + image: dsn/narwhal:latest + environment: + - VALIDATOR_ID=2 + - LOG_LEVEL=-vvv + expose: + - "64020" # Port to listen on messages from other primary nodes + - "64022" # Port to listen on messages from our worker nodes + volumes: + - ./committee.json:/config/committee.json + - ./workers.json:/config/workers.json + + validator_3: + image: dsn/narwhal:latest + environment: + - VALIDATOR_ID=3 + - LOG_LEVEL=-vvv + expose: + - "64030" # Port to listen on messages from other primary nodes + - "64032" # Port to listen on messages from our worker nodes + volumes: + - ./committee.json:/config/committee.json + - ./workers.json:/config/workers.json + + validator_4: + image: dsn/narwhal:latest + environment: + - VALIDATOR_ID=4 + - LOG_LEVEL=-vvv + expose: + - "64040" # Port to listen on messages from other primary nodes + - "64042" # Port to listen on messages from our worker nodes + volumes: + - ./committee.json:/config/committee.json + - ./workers.json:/config/workers.json diff --git a/docker/setup/dsn-min-4-1/workers.json b/docker/setup/dsn-min-4-1/workers.json new file mode 100644 index 0000000..287b2eb --- /dev/null +++ b/docker/setup/dsn-min-4-1/workers.json @@ -0,0 +1,33 @@ +{ + "workers": { + "j2E78yYevoGYOlTLu3WhL688vkH2intlhq1QANSiIoy4Z1KMwV/tZXOvQjWaCDa7CKrADeu/DUB06CMBoc+RTnj9wT2AhSs52IskxL6ad/vXOw+Lz/XkTmSJZpHjO8Gv": { + "0": { + "name": "MjSbc/NbT4TG5IoHwhKABltnxhwB48dHY1qro68besw=", + "worker_address": "/dns/validator_1/udp/64012", + "transactions": "/dns/validator_1/tcp/64013/http" + } + }, + "ghfvsNGcuZYPhWMZ0lw9V8aClmFTP0icfbfjPRWgGVASCFovOHS5HkPtkQ+yl11pGNs9Yxk785r0DGnOV1nK2XlPpktV98nQkkmKr0+BunpLhl6PUc1pppZpyM2OkwTK": { + "0": { + "name": "wvQ+r+dG1Y7RWEwftMRjje5KaWb1KEMuWr8j3wWlNK0=", + "worker_address": "/dns/validator_2/udp/64022", + "transactions": "/dns/validator_2/tcp/64023/http" + } + }, + "lRQGsoVv2rvg5r3HLFt6rHd7fST8kCK1vAB4vrpbXYpOe1THFtlI2wLtaGG4jU4gGXBBXG46VRLaiVwuyT/WhuyfO/GQ/pv/XIc5RGtANtfsi8866ZN6HpVKuNf76gXZ": { + "0": { + "name": "N1kMsGhS5+/kxsnhrG8hHxXaIbkhn7c9t5fh6s3L/8w=", + "worker_address": "/dns/validator_3/udp/64032", + "transactions": "/dns/validator_3/tcp/64033/http" + } + }, + "tsm6p0wJ54S5Vw9jZS5CuST7du38DXltxDJrIA6/O+qQw3Omj7c7dhvzemuLvFgpAWImyKIXZ+63tiWwOQkz2lKweSwCCb1zahViUWjqe3WvcwrhzUUta4bcDCUpsThI": { + "0": { + "name": "PLZG683Oo6UA/UgkG7oieXe0LVucFsYOd/fBUg/RALk=", + "worker_address": "/dns/validator_4/udp/64042", + "transactions": "/dns/validator_4/tcp/64043/http" + } + } + }, + "epoch": 0 +} \ No newline at end of file diff --git a/docker/setup/keys/primary-1.key b/docker/setup/keys/primary-1.key new file mode 100644 index 0000000..72cb755 --- /dev/null +++ b/docker/setup/keys/primary-1.key @@ -0,0 +1 @@ +OBh2zFI6QKCFlobv3kL7/Yi+li5HCRVca7TzfpKmoK4= \ No newline at end of file diff --git a/docker/setup/keys/primary-2.key b/docker/setup/keys/primary-2.key new file mode 100644 index 0000000..f731941 --- /dev/null +++ b/docker/setup/keys/primary-2.key @@ -0,0 +1 @@ +bmxCBeu9brlLSMHIHYYiXeWMWEjUXpg5na0WMAVscKc= \ No newline at end of file diff --git a/docker/setup/keys/primary-3.key b/docker/setup/keys/primary-3.key new file mode 100644 index 0000000..de41eb1 --- /dev/null +++ b/docker/setup/keys/primary-3.key @@ -0,0 +1 @@ +MIIEw/v/s1AxUVLdu+HsJHcXEEy2yVBqqwCdcA/431c= \ No newline at end of file diff --git a/docker/setup/keys/primary-4.key b/docker/setup/keys/primary-4.key new file mode 100644 index 0000000..ab7a24d --- /dev/null +++ b/docker/setup/keys/primary-4.key @@ -0,0 +1 @@ +UwHVOf61ieaJdl2tOTNgvyWHbFslUnjlmbjNO534hxg= \ No newline at end of file diff --git a/docker/setup/keys/primary-5.key b/docker/setup/keys/primary-5.key new file mode 100644 index 0000000..50ff678 --- /dev/null +++ b/docker/setup/keys/primary-5.key @@ -0,0 +1 @@ +SjjXgmLMNwf3x/fogF0DoZCehf9LkCCXOTLBLzCczGI= \ No newline at end of file diff --git a/docker/setup/keys/primary-6.key b/docker/setup/keys/primary-6.key new file mode 100644 index 0000000..e448aae --- /dev/null +++ b/docker/setup/keys/primary-6.key @@ -0,0 +1 @@ +RbybgkK6Z1imy2iTEvA2Rq0a9NYkCd8lwxyZlcQffgM= \ No newline at end of file diff --git a/docker/setup/keys/primary-7.key b/docker/setup/keys/primary-7.key new file mode 100644 index 0000000..a1123fe --- /dev/null +++ b/docker/setup/keys/primary-7.key @@ -0,0 +1 @@ +bobI7JoCfln5WpXZ44AR1WWlSwG7Y6D+T7mH6xFdIrk= \ No newline at end of file diff --git a/docker/setup/keys/primary-network-1.key b/docker/setup/keys/primary-network-1.key new file mode 100644 index 0000000..0851528 --- /dev/null +++ b/docker/setup/keys/primary-network-1.key @@ -0,0 +1 @@ +fUG5WFpfXMH/4X3efg6xKJtprOUXubFirPclp7Qkfl4= \ No newline at end of file diff --git a/docker/setup/keys/primary-network-2.key b/docker/setup/keys/primary-network-2.key new file mode 100644 index 0000000..effd2c0 --- /dev/null +++ b/docker/setup/keys/primary-network-2.key @@ -0,0 +1 @@ +5eQePG0mSXbuVQ8j2Ys1B/+LXxeQ3RfaNQ+lPXXPLN0= \ No newline at end of file diff --git a/docker/setup/keys/primary-network-3.key b/docker/setup/keys/primary-network-3.key new file mode 100644 index 0000000..ba6a17c --- /dev/null +++ b/docker/setup/keys/primary-network-3.key @@ -0,0 +1 @@ +SSOCTkffhNhOQwuiSsuRre3etRRM1BznZnZWLFqXUEE= \ No newline at end of file diff --git a/docker/setup/keys/primary-network-4.key b/docker/setup/keys/primary-network-4.key new file mode 100644 index 0000000..b450b1a --- /dev/null +++ b/docker/setup/keys/primary-network-4.key @@ -0,0 +1 @@ +LNMHsTkvcVS5Ykb8q7gu8Ru8KVsy8G2W4QbA2Gp3jgQ= \ No newline at end of file diff --git a/docker/setup/keys/primary-network-5.key b/docker/setup/keys/primary-network-5.key new file mode 100644 index 0000000..b73daa3 --- /dev/null +++ b/docker/setup/keys/primary-network-5.key @@ -0,0 +1 @@ +sP8AnRQlyUjL9lRbNzZjNe8ExybzevBuOvrGHHKswP8= \ No newline at end of file diff --git a/docker/setup/keys/primary-network-6.key b/docker/setup/keys/primary-network-6.key new file mode 100644 index 0000000..0a5089e --- /dev/null +++ b/docker/setup/keys/primary-network-6.key @@ -0,0 +1 @@ +BbsHgVk+sCmOHpsPrYmoR9ivgRuTnrug3AdZEcr3JHQ= \ No newline at end of file diff --git a/docker/setup/keys/primary-network-7.key b/docker/setup/keys/primary-network-7.key new file mode 100644 index 0000000..eed9f54 --- /dev/null +++ b/docker/setup/keys/primary-network-7.key @@ -0,0 +1 @@ +8gRFmMmQeIquaipaNVXnqZoAH0dRjslyvr7ypvz97ko= \ No newline at end of file diff --git a/docker/setup/keys/worker-network-1.key b/docker/setup/keys/worker-network-1.key new file mode 100644 index 0000000..1b8ca6c --- /dev/null +++ b/docker/setup/keys/worker-network-1.key @@ -0,0 +1 @@ +yi2Ss/H/AZylIc+NNl+4a+9Mh1OggRPneb+jAWcLwmY= \ No newline at end of file diff --git a/docker/setup/keys/worker-network-2.key b/docker/setup/keys/worker-network-2.key new file mode 100644 index 0000000..37bb2c4 --- /dev/null +++ b/docker/setup/keys/worker-network-2.key @@ -0,0 +1 @@ +6iCynnk95+Lw7hgPipLAQvdbhY7IQ4c0Qtbes659gT8= \ No newline at end of file diff --git a/docker/setup/keys/worker-network-3.key b/docker/setup/keys/worker-network-3.key new file mode 100644 index 0000000..70bbd76 --- /dev/null +++ b/docker/setup/keys/worker-network-3.key @@ -0,0 +1 @@ +z+0jMXg2WFQFcgZ2omfKsywaTfOk2EUMqfkB7KnSdEA= \ No newline at end of file diff --git a/docker/setup/keys/worker-network-4.key b/docker/setup/keys/worker-network-4.key new file mode 100644 index 0000000..4e6af61 --- /dev/null +++ b/docker/setup/keys/worker-network-4.key @@ -0,0 +1 @@ +FWPUS3RXgZ0vVKKesZJgUast+sDyh8EhKI0t5mFhCds= \ No newline at end of file diff --git a/docker/setup/keys/worker-network-5.key b/docker/setup/keys/worker-network-5.key new file mode 100644 index 0000000..ea700ad --- /dev/null +++ b/docker/setup/keys/worker-network-5.key @@ -0,0 +1 @@ +tqGHrwrkVFjh/dQorsZ7z8JLxnrdVzmrVi0luo6UGbc= \ No newline at end of file diff --git a/docker/setup/keys/worker-network-6.key b/docker/setup/keys/worker-network-6.key new file mode 100644 index 0000000..66a6a79 --- /dev/null +++ b/docker/setup/keys/worker-network-6.key @@ -0,0 +1 @@ +0zdU8GnrJjvgxRlmeSxkJUkTXZ7W4SSnegywRIon4ts= \ No newline at end of file diff --git a/docker/setup/keys/worker-network-7.key b/docker/setup/keys/worker-network-7.key new file mode 100644 index 0000000..74479f4 --- /dev/null +++ b/docker/setup/keys/worker-network-7.key @@ -0,0 +1 @@ ++yb7jWio5xZr8CDkulX2hYxvrI1skKQ7p8b3elCro2c= \ No newline at end of file diff --git a/docker/setup/single-operator/README.md b/docker/setup/single-operator/README.md deleted file mode 100644 index 9f1dfda..0000000 --- a/docker/setup/single-operator/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# DSN setup: 4 validators + 1 operator - diff --git a/docker/setup/single-operator/docker-compose.yml b/docker/setup/single-operator/docker-compose.yml deleted file mode 100644 index e69de29..0000000 diff --git a/sequencer/Cargo.toml b/sequencer/Cargo.toml index 3577601..01168dd 100644 --- a/sequencer/Cargo.toml +++ b/sequencer/Cargo.toml @@ -8,32 +8,32 @@ edition = "2021" version.workspace = true [dependencies] +reqwest.workspace = true anyhow.workspace = true serde.workspace = true serde_json.workspace = true tokio = { workspace = true, features = ["rt-multi-thread"] } -fastcrypto.workspace = true clap.workspace = true tonic.workspace = true bytes.workspace = true bcs.workspace = true -rand.workspace = true +prost.workspace = true tezos_data_encoding = { version = "0.5.2" } tezos-smart-rollup-encoding = { version = "0.2.2", default_features = false, features = ["alloc", "tezos-encoding" ] } hex = "*" -tide = "0.16" env_logger = "0.10.0" log = "0.4" -surf = "2.3.2" +axum = "0.7.3" narwhal-types.workspace = true -narwhal-crypto.workspace = true -narwhal-utils.workspace = true -narwhal-test-utils.workspace = true pre-block = { workspace = true, features = ["conversions"] } +[build-dependencies] +tonic-build.workspace = true +protobuf-src.workspace = true + [[bin]] name = "sequencer" path = "src/main.rs" diff --git a/sequencer/build.rs b/sequencer/build.rs new file mode 100644 index 0000000..dd38b08 --- /dev/null +++ b/sequencer/build.rs @@ -0,0 +1,4 @@ +fn main() -> Result<(), Box> { + tonic_build::compile_protos("../crates/exporter/proto/exporter.proto")?; + Ok(()) +} diff --git a/sequencer/src/consensus_client.rs b/sequencer/src/consensus_client.rs index 77ab9b8..517a818 100644 --- a/sequencer/src/consensus_client.rs +++ b/sequencer/src/consensus_client.rs @@ -3,9 +3,17 @@ // SPDX-License-Identifier: MIT use bytes::Bytes; +use log::{info, debug}; +use std::{sync::mpsc, collections::BTreeSet}; use narwhal_types::{TransactionProto, TransactionsClient}; +use pre_block::{PreBlock, Certificate, CertificateHeader}; use tonic::transport::Channel; +mod exporter { + tonic::include_proto!("exporter"); +} +use exporter::exporter_client::ExporterClient; + #[derive(Clone, Debug)] pub struct WorkerClient { pub endpoint: String, @@ -22,18 +30,135 @@ impl WorkerClient { async fn client(&mut self) -> anyhow::Result<&mut TransactionsClient> { if self.client.is_none() { + info!("[Worker client] connecting to gRPC ..."); self.client = Some(TransactionsClient::connect(self.endpoint.clone()).await?); } + info!("[Worker client] connected to {}", self.endpoint); self.client .as_mut() - .ok_or_else(|| anyhow::anyhow!("Failed to initialize gRPC client")) + .ok_or_else(|| anyhow::anyhow!("[Worker client] Failed to initialize gRPC client")) } pub async fn send_transaction(&mut self, payload: Vec) -> anyhow::Result<()> { let tx = TransactionProto { transaction: Bytes::from(payload), }; - self.client().await?.submit_transaction(tx).await?; + let res = self.client() + .await? + .submit_transaction(tx) + .await?; + debug!("[Worker client] Response {:#?}", res.metadata()); Ok(()) } } + +#[derive(Clone, Debug)] +pub struct PrimaryClient { + pub endpoint: String, + client: Option>, +} + +impl PrimaryClient { + pub fn new(endpoint: String) -> Self { + Self { + endpoint, + client: None, + } + } + + async fn client(&mut self) -> anyhow::Result<&mut ExporterClient> { + if self.client.is_none() { + info!("[Primary client] connecting to gRPC ..."); + self.client = Some(ExporterClient::connect(self.endpoint.clone()).await?); + } + info!("[Primary client] connected to {}", self.endpoint); + self.client + .as_mut() + .ok_or_else(|| anyhow::anyhow!("[Primary client] Failed to initialize gRPC client")) + } + + pub async fn subscribe_pre_blocks( + &mut self, + from_id: u64, + pre_blocks_tx: mpsc::Sender + ) -> anyhow::Result<()> { + let mut stream = self.client() + .await? + .export(exporter::ExportRequest { from_id }) + .await? + .into_inner(); + + while let Some(subdag) = stream.message().await? { + let pre_block: PreBlock = subdag.into(); + info!("[Primary client] Pre-block #{} received", pre_block.index()); + + pre_blocks_tx.send(pre_block)?; + } + + Ok(()) + } +} + +impl From for CertificateHeader { + fn from(header: exporter::Header) -> Self { + assert!(header.system_messages.is_empty()); + Self { + author: header.author as u16, + round: header.round, + epoch: header.epoch, + created_at: header.created_at, + payload: header + .payload_info + .into_iter() + .map(|info| { + ( + info.digest.try_into().unwrap(), + (info.worker_id, info.created_at), + ) + }) + .collect(), + system_messages: vec![], + parents: BTreeSet::from_iter( + header + .parents + .into_iter() + .map(|digest| digest.try_into().unwrap()), + ), + } + } +} + +impl From for Certificate { + fn from(cert: exporter::Certificate) -> Self { + Self { + header: cert.header.unwrap().into(), + signers: cert.signers, + signature: cert.signature, + } + } +} + +impl From for PreBlock { + fn from(sub_dag: exporter::SubDag) -> Self { + Self { + batches: sub_dag + .payloads + .into_iter() + .map(|payload| payload.batches) + .map(|batches| { + batches + .into_iter() + .map(|batch| batch.transactions) + .collect() + }) + .collect(), + index: sub_dag.id, + leader: sub_dag.leader.unwrap().into(), + certificates: sub_dag + .certificates + .into_iter() + .map(|cert| cert.into()) + .collect(), + } + } +} diff --git a/sequencer/src/da_batcher.rs b/sequencer/src/da_batcher.rs index aebb59d..a99727e 100644 --- a/sequencer/src/da_batcher.rs +++ b/sequencer/src/da_batcher.rs @@ -47,16 +47,13 @@ pub fn batch_encode_to( Ok(()) } -pub async fn fetch_pre_blocks( +pub async fn generate_pre_blocks( prev_index: u64, pre_blocks_tx: mpsc::Sender, ) -> anyhow::Result<()> { let mut index = prev_index; let mut fixture = NarwhalFixture::default(); - // let stream = primary_client.get_sub_dag_stream(sub_dag_index); - // while let Some(pre_block) = stream.next().await { - loop { let pre_block = fixture.next_pre_block(1); if pre_block.index() == index { @@ -67,8 +64,6 @@ pub async fn fetch_pre_blocks( tokio::time::sleep(Duration::from_secs(1)).await; } } - - //} } pub fn is_leader(level: u32, node_id: u8) -> bool { @@ -118,8 +113,10 @@ pub async fn publish_pre_blocks( } } - info!("[DA publish] Sending inbox messages"); - rollup_client.inject_batch(batch).await?; + if !batch.is_empty() { + info!("[DA publish] Sending inbox messages"); + rollup_client.inject_batch(batch).await?; + } } } diff --git a/sequencer/src/main.rs b/sequencer/src/main.rs index d80601b..c71f894 100644 --- a/sequencer/src/main.rs +++ b/sequencer/src/main.rs @@ -4,7 +4,6 @@ use clap::Parser; use consensus_client::WorkerClient; -use fastcrypto::hash::{HashFunction, Keccak256}; use log::{error, info, warn}; use rollup_client::RollupClient; use std::sync::mpsc; @@ -12,8 +11,15 @@ use std::sync::Arc; use std::time::Duration; use tokio::signal; use tokio::task::JoinHandle; - -use crate::da_batcher::fetch_pre_blocks; +use serde::{Serialize, Deserialize}; +use axum::{ + extract::{Path, State}, + http::StatusCode, + routing::{get, post}, + Json, Router, +}; + +use crate::consensus_client::PrimaryClient; use crate::da_batcher::publish_pre_blocks; mod consensus_client; @@ -21,12 +27,12 @@ mod da_batcher; mod rollup_client; #[derive(Clone)] -struct State { +struct AppState { pub rollup_client: Arc, pub worker_client: Arc, } -impl State { +impl AppState { pub fn new(rollup_node_url: String, worker_node_url: String) -> Self { Self { rollup_client: Arc::new(RollupClient::new(rollup_node_url)), @@ -35,43 +41,68 @@ impl State { } } -async fn broadcast_transaction(mut req: tide::Request) -> tide::Result { - let tx_payload = hex::decode(req.body_string().await?)?; - let tx_digest = Keccak256::digest(&tx_payload); - req.state() - .worker_client +#[derive(Debug, Clone, Serialize, Deserialize)] +struct Transaction { + pub data: String +} + +async fn broadcast_transaction( + State(state): State, + Json(tx): Json, +) -> Result, StatusCode> { + info!("Broadcasting tx `{}`", tx.data); + let tx_payload = hex::decode(tx.data) + .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; + + state.worker_client .as_ref() .clone() // cloning channel is cheap and encouraged .send_transaction(tx_payload) - .await?; - Ok(hex::encode(tx_digest)) + .await + .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; + + Ok(Json(format!("OK"))) } -async fn get_block_by_level(req: tide::Request) -> tide::Result { - let level: u32 = req.param("level")?.parse().unwrap_or(0); - let block = req.state().rollup_client.get_block_by_level(level).await?; +async fn get_block_by_level( + State(state): State, + Path(level): Path, +) -> Result>, StatusCode> { + let block = state.rollup_client + .get_block_by_level(level) + .await + .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; if let Some(txs) = block { let res: Vec = txs.iter().map(|tx_digest| hex::encode(tx_digest)).collect(); - Ok(serde_json::to_string(&res)?) + Ok(Json(res)) } else { - Err(tide::Error::new(404, anyhow::anyhow!("Block not found"))) + Err(StatusCode::NOT_FOUND) } } -async fn get_head(req: tide::Request) -> tide::Result { - let head = req.state().rollup_client.get_head().await?; - Ok(head.to_string()) +async fn get_head(State(state): State) -> Result, StatusCode> { + let head = state.rollup_client + .get_head() + .await + .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; + Ok(Json(head)) } -async fn get_authorities(req: tide::Request) -> tide::Result { - let epoch: u64 = req.param("epoch")?.parse().unwrap_or(0); - let authorities = req.state().rollup_client.get_authorities(epoch).await?; +async fn get_authorities( + State(state): State, + Path(epoch): Path, +) -> Result>, StatusCode> { + let authorities = state.rollup_client + .get_authorities(epoch) + .await + .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; + let res: Vec = authorities .into_iter() .map(|a| hex::encode(a)) .collect(); - Ok(serde_json::to_string(&res)?) + Ok(Json(res)) } async fn run_api_server( @@ -82,13 +113,17 @@ async fn run_api_server( ) -> anyhow::Result<()> { info!("[RPC server] Starting..."); - let rpc_host = format!("http://{}:{}", rpc_addr, rpc_port); - let mut app = tide::with_state(State::new(rollup_node_url, worker_node_url)); - app.at("/broadcast").post(broadcast_transaction); - app.at("/blocks/:level").get(get_block_by_level); - app.at("/authorities/:epoch").get(get_authorities); - app.at("/head").get(get_head); - app.listen(rpc_host).await?; + let rpc_host = format!("{}:{}", rpc_addr, rpc_port); + + let app = Router::new() + .route("/broadcast", post(broadcast_transaction)) + .route("/blocks/:level", get(get_block_by_level)) + .route("/authorities/:epoch", get(get_authorities)) + .route("/head", get(get_head)) + .with_state(AppState::new(rollup_node_url, worker_node_url)); + + let listener = tokio::net::TcpListener::bind(rpc_host).await?; + axum::serve(listener, app).await?; Ok(()) } @@ -122,15 +157,15 @@ async fn run_da_task( smart_rollup_address, rollup_node_url ); - // let primary_client = PrimaryClient::new(primary_node_url); + let mut primary_client = PrimaryClient::new(primary_node_url); loop { - let index = rollup_client.get_next_index().await?; + let from_id = rollup_client.get_next_index().await?; let (tx, rx) = mpsc::channel(); - info!("[DA task] Starting from index #{}", index); + info!("[DA task] Starting from index #{}", from_id); tokio::select! { - res = fetch_pre_blocks(index, tx) => { + res = primary_client.subscribe_pre_blocks(from_id, tx) => { if let Err(err) = res { error!("[DA fetch] Failed with: {}", err); } diff --git a/sequencer/src/rollup_client.rs b/sequencer/src/rollup_client.rs index 9dde36e..b5652ac 100644 --- a/sequencer/src/rollup_client.rs +++ b/sequencer/src/rollup_client.rs @@ -37,78 +37,65 @@ pub enum DurableStorageResponse { #[derive(Clone, Debug)] pub struct RollupClient { pub base_url: String, - client: surf::Client, + client: reqwest::Client, } impl RollupClient { pub fn new(base_url: String) -> Self { Self { base_url, - client: surf::Client::new(), + client: reqwest::Client::new(), } } pub async fn get_rollup_address(&self) -> anyhow::Result { - let mut res = self + let res = self .client .get(format!("{}/global/smart_rollup_address", self.base_url)) .send() - .await - .map_err(|e| anyhow::anyhow!("{}", e))?; + .await?; if res.status() == 200 { - let value: String = res - .body_json() - .await - .map_err(|e| anyhow::anyhow!("{}", e))?; + let value: String = res.json().await?; Ok(SmartRollupAddress::from_b58check(&value)?) } else { Err(anyhow::anyhow!( "Get rollup address: response status {}", - res.status() + res.status().as_u16() )) } } pub async fn get_inbox_level(&self) -> anyhow::Result { - let mut res = self + let res = self .client .get(format!("{}/global/block/head/level", self.base_url)) .send() - .await - .map_err(|e| anyhow::anyhow!("{}", e))?; + .await?; if res.status() == 200 { - let value: u32 = res - .body_json() - .await - .map_err(|e| anyhow::anyhow!("{}", e))?; + let value: u32 = res.json().await?; Ok(value) } else { Err(anyhow::anyhow!( "Get inbox level: response status {}", - res.status() + res.status().as_u16() )) } } pub async fn store_get(&self, key: String) -> anyhow::Result>> { - let mut res = self + let res = self .client .get(format!( "{}/global/block/head/durable/wasm_2_0_0/value?key={}", self.base_url, key )) .send() - .await - .map_err(|e| anyhow::anyhow!("{}", e))?; + .await?; if res.status() == 200 || res.status() == 500 { - let content: Option = res - .body_json() - .await - .map_err(|e| anyhow::anyhow!("{}", e))?; - + let content: Option = res.json().await?; match content { Some(DurableStorageResponse::Value(value)) => { let payload = hex::decode(value)?; @@ -124,7 +111,7 @@ impl RollupClient { } else { Err(anyhow::anyhow!( "Store get: response status {}", - res.status() + res.status().as_u16() )) } } @@ -132,21 +119,20 @@ impl RollupClient { pub async fn inject_batch(&self, batch: DaBatch) -> anyhow::Result<()> { let messages: Vec = batch.into_iter().map(|msg| hex::encode(msg)).collect(); - let mut res = self + let res = self .client .post(format!("{}/local/batcher/injection", self.base_url)) - .body_json(&messages) - .map_err(|e| anyhow::anyhow!("{}", e))? - .await - .map_err(|e| anyhow::anyhow!("{}", e))?; + .json(&messages) + .send() + .await?; if res.status() == 200 { Ok(()) } else { Err(anyhow::anyhow!( "Inject batch: response status {} - {}", - res.status(), - res.body_string().await.unwrap() + res.status().as_u16(), + res.text().await? )) } }