From a294f7429bcf0cc45dba777966e229f95c80391b Mon Sep 17 00:00:00 2001 From: Noah Citron Date: Tue, 24 Sep 2024 11:57:53 -0400 Subject: [PATCH 01/10] feat: generic networks (#373) * generic execution client * feat: generic consensus * wip * crate refactor * fmt * cleanup redundant modules * clean up reexports * clean up ethereum lib exports * fix rpc socket handling * fix tests * ci * remove unused clone * fix transaction builder * remove stub directories --- .github/workflows/test.yml | 1 + Cargo.lock | 1065 ++++++++--------- Cargo.toml | 22 +- cli/Cargo.toml | 9 +- cli/src/main.rs | 15 +- client/Cargo.toml | 30 - client/src/errors.rs | 64 - client/src/lib.rs | 9 - common/Cargo.toml | 15 - common/src/errors.rs | 44 - common/src/lib.rs | 2 - config/Cargo.toml | 26 - config/src/lib.rs | 23 - consensus/src/lib.rs | 7 - {execution => core}/Cargo.toml | 14 +- core/src/client/mod.rs | 202 ++++ {client/src => core/src/client}/node.rs | 94 +- {client/src => core/src/client}/rpc.rs | 105 +- core/src/consensus.rs | 14 + core/src/errors.rs | 54 + .../src => core/src/execution}/constants.rs | 0 .../src => core/src/execution}/errors.rs | 25 +- {execution/src => core/src/execution}/evm.rs | 159 ++- .../execution.rs => core/src/execution/mod.rs | 95 +- .../src => core/src/execution}/proof.rs | 2 +- .../src/execution}/rpc/http_rpc.rs | 26 +- .../src/execution}/rpc/mock_rpc.rs | 16 +- .../src => core/src/execution}/rpc/mod.rs | 19 +- .../src => core/src/execution}/state.rs | 41 +- .../src => core/src/execution}/types.rs | 0 core/src/lib.rs | 7 + core/src/network_spec.rs | 12 + {common => core}/src/types.rs | 18 +- {execution => core}/testdata/code.json | 0 {execution => core}/testdata/fee_history.json | 0 {execution => core}/testdata/logs.json | 0 {execution => core}/testdata/proof.json | 0 {execution => core}/testdata/receipt.json | 0 {execution => core}/testdata/transaction.json | 0 {execution => core}/tests/execution.rs | 196 +-- {consensus => ethereum}/Cargo.toml | 16 +- .../consensus-core}/Cargo.toml | 4 +- .../consensus-core}/src/consensus_core.rs | 0 .../consensus-core}/src/errors.rs | 0 .../consensus-core}/src/lib.rs | 0 .../consensus-core}/src/proof.rs | 0 .../consensus-core}/src/types/bls.rs | 0 .../consensus-core}/src/types/bytes.rs | 0 .../consensus-core}/src/types/mod.rs | 0 .../consensus-core}/src/types/serde_utils.rs | 0 .../consensus-core}/src/utils.rs | 0 .../src/client.rs => ethereum/src/builder.rs | 224 +--- {config/src => ethereum/src/config}/base.rs | 5 +- .../src/config}/checkpoints.rs | 17 +- {config/src => ethereum/src/config}/cli.rs | 0 .../config.rs => ethereum/src/config/mod.rs | 17 +- .../src => ethereum/src/config}/networks.rs | 6 +- {config/src => ethereum/src/config}/types.rs | 0 {consensus => ethereum}/src/consensus.rs | 91 +- {consensus => ethereum}/src/constants.rs | 0 {consensus => ethereum}/src/database.rs | 3 +- ethereum/src/lib.rs | 16 + .../src/rpc/http_rpc.rs | 13 +- {consensus => ethereum}/src/rpc/mock_rpc.rs | 4 +- {consensus => ethereum}/src/rpc/mod.rs | 8 +- ethereum/src/spec.rs | 292 +++++ .../testdata/blocks/7109344.json | 0 .../testdata/blocks/7109431.json | 0 .../testdata/bootstrap.json | 0 .../testdata/finality.json | 0 .../testdata/optimistic.json | 0 {consensus => ethereum}/testdata/updates.json | 0 {config => ethereum}/tests/checkpoints.rs | 12 +- {consensus => ethereum}/tests/sync.rs | 4 +- examples/basic.rs | 7 +- examples/call.rs | 9 +- examples/checkpoints.rs | 2 +- examples/client.rs | 10 +- examples/config.rs | 3 +- execution/src/lib.rs | 11 - src/lib.rs | 74 +- tests/rpc_equivalence.rs | 13 +- 82 files changed, 1657 insertions(+), 1635 deletions(-) delete mode 100644 client/Cargo.toml delete mode 100644 client/src/errors.rs delete mode 100644 client/src/lib.rs delete mode 100644 common/Cargo.toml delete mode 100644 common/src/errors.rs delete mode 100644 common/src/lib.rs delete mode 100644 config/Cargo.toml delete mode 100644 config/src/lib.rs delete mode 100644 consensus/src/lib.rs rename {execution => core}/Cargo.toml (71%) create mode 100644 core/src/client/mod.rs rename {client/src => core/src/client}/node.rs (75%) rename {client/src => core/src/client}/rpc.rs (78%) create mode 100644 core/src/consensus.rs create mode 100644 core/src/errors.rs rename {execution/src => core/src/execution}/constants.rs (100%) rename {execution/src => core/src/execution}/errors.rs (61%) rename {execution/src => core/src/execution}/evm.rs (70%) rename execution/src/execution.rs => core/src/execution/mod.rs (80%) rename {execution/src => core/src/execution}/proof.rs (99%) rename {execution/src => core/src/execution}/rpc/http_rpc.rs (89%) rename {execution/src => core/src/execution}/rpc/mock_rpc.rs (89%) rename {execution/src => core/src/execution}/rpc/mod.rs (81%) rename {execution/src => core/src/execution}/state.rs (83%) rename {execution/src => core/src/execution}/types.rs (100%) create mode 100644 core/src/lib.rs create mode 100644 core/src/network_spec.rs rename {common => core}/src/types.rs (87%) rename {execution => core}/testdata/code.json (100%) rename {execution => core}/testdata/fee_history.json (100%) rename {execution => core}/testdata/logs.json (100%) rename {execution => core}/testdata/proof.json (100%) rename {execution => core}/testdata/receipt.json (100%) rename {execution => core}/testdata/transaction.json (100%) rename {execution => core}/tests/execution.rs (67%) rename {consensus => ethereum}/Cargo.toml (71%) rename {consensus-core => ethereum/consensus-core}/Cargo.toml (94%) rename {consensus-core => ethereum/consensus-core}/src/consensus_core.rs (100%) rename {consensus-core => ethereum/consensus-core}/src/errors.rs (100%) rename {consensus-core => ethereum/consensus-core}/src/lib.rs (100%) rename {consensus-core => ethereum/consensus-core}/src/proof.rs (100%) rename {consensus-core => ethereum/consensus-core}/src/types/bls.rs (100%) rename {consensus-core => ethereum/consensus-core}/src/types/bytes.rs (100%) rename {consensus-core => ethereum/consensus-core}/src/types/mod.rs (100%) rename {consensus-core => ethereum/consensus-core}/src/types/serde_utils.rs (100%) rename {consensus-core => ethereum/consensus-core}/src/utils.rs (100%) rename client/src/client.rs => ethereum/src/builder.rs (50%) rename {config/src => ethereum/src/config}/base.rs (92%) rename {config/src => ethereum/src/config}/checkpoints.rs (95%) rename {config/src => ethereum/src/config}/cli.rs (100%) rename config/src/config.rs => ethereum/src/config/mod.rs (92%) rename {config/src => ethereum/src/config}/networks.rs (98%) rename {config/src => ethereum/src/config}/types.rs (100%) rename {consensus => ethereum}/src/consensus.rs (95%) rename {consensus => ethereum}/src/constants.rs (100%) rename {consensus => ethereum}/src/database.rs (98%) create mode 100644 ethereum/src/lib.rs rename consensus/src/rpc/nimbus_rpc.rs => ethereum/src/rpc/http_rpc.rs (94%) rename {consensus => ethereum}/src/rpc/mock_rpc.rs (95%) rename {consensus => ethereum}/src/rpc/mod.rs (78%) create mode 100644 ethereum/src/spec.rs rename {consensus => ethereum}/testdata/blocks/7109344.json (100%) rename {consensus => ethereum}/testdata/blocks/7109431.json (100%) rename {consensus => ethereum}/testdata/bootstrap.json (100%) rename {consensus => ethereum}/testdata/finality.json (100%) rename {consensus => ethereum}/testdata/optimistic.json (100%) rename {consensus => ethereum}/testdata/updates.json (100%) rename {config => ethereum}/tests/checkpoints.rs (89%) rename {consensus => ethereum}/tests/sync.rs (84%) delete mode 100644 execution/src/lib.rs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fe225c28..5a209709 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,7 @@ on: branches: ["master"] pull_request: branches: ["master"] + workflow_dispatch: env: MAINNET_EXECUTION_RPC: ${{ secrets.MAINNET_EXECUTION_RPC }} diff --git a/Cargo.lock b/Cargo.lock index ab9df7b1..3f7b0377 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] @@ -17,6 +17,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" version = "0.8.11" @@ -55,6 +61,7 @@ dependencies = [ "alloy-core", "alloy-eips", "alloy-genesis", + "alloy-json-rpc", "alloy-network", "alloy-provider", "alloy-pubsub", @@ -71,9 +78,9 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.24" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47ff94ce0f141c2671c23d02c7b88990dd432856639595c5d010663d017c2c58" +checksum = "805f7a974de5804f5c053edc6ca43b20883bdd3a733b3691200ae3a4b454a2db" dependencies = [ "num_enum", "strum", @@ -141,7 +148,7 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.15", + "winnow 0.6.18", ] [[package]] @@ -312,24 +319,24 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "alloy-rlp-derive", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bytes", ] [[package]] name = "alloy-rlp-derive" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" +checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -477,7 +484,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -490,11 +497,11 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck 0.5.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "syn-solidity", "tiny-keccak 2.0.2", ] @@ -512,7 +519,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.72", + "syn 2.0.77", "syn-solidity", ] @@ -523,7 +530,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ "serde", - "winnow 0.6.15", + "winnow 0.6.18", ] [[package]] @@ -602,7 +609,7 @@ dependencies = [ "alloy-transport", "futures", "http 1.1.0", - "rustls 0.23.12", + "rustls 0.23.13", "serde_json", "tokio", "tokio-tungstenite", @@ -633,9 +640,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -648,33 +655,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -682,9 +689,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "ark-ff" @@ -720,7 +727,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "zeroize", ] @@ -818,9 +825,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-lock" @@ -850,18 +857,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -872,7 +879,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -908,7 +915,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -919,17 +926,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.8.0", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -1064,9 +1071,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" dependencies = [ "cc", "glob", @@ -1076,9 +1083,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", "serde", @@ -1104,9 +1111,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.16.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" @@ -1116,24 +1123,25 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" dependencies = [ "serde", ] [[package]] name = "c-kzg" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" dependencies = [ "blst", "cc", "glob", "hex", "libc", + "once_cell", "serde", ] @@ -1145,9 +1153,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.6" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -1157,9 +1168,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfg_aliases" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" @@ -1205,9 +1216,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.10" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6b81fb3c84f5563d509c59b5a48d935f689e993afa90fe39047f05adef9142" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -1215,9 +1226,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.10" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca6706fd5224857d9ac5eb9355f6683563cc0541c7cd9d014043b57cbec78ac" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -1227,63 +1238,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.8" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" - -[[package]] -name = "cli" -version = "0.6.0" -dependencies = [ - "alloy", - "clap", - "client", - "common", - "config", - "consensus", - "ctrlc", - "dirs", - "eyre", - "futures", - "tokio", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "client" -version = "0.6.0" -dependencies = [ - "alloy", - "common", - "config", - "consensus", - "execution", - "eyre", - "futures", - "gloo-timers 0.3.0", - "hex", - "jsonrpsee", - "parking_lot", - "serde", - "thiserror", - "tokio", - "tracing", - "wasm-bindgen-futures", - "zduny-wasm-timer", -] +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "color_quant" @@ -1293,107 +1262,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "colorchoice" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" - -[[package]] -name = "common" -version = "0.6.0" -dependencies = [ - "alloy", - "eyre", - "hex", - "serde", - "serde_json", - "superstruct", - "thiserror", - "tracing", - "zduny-wasm-timer", -] - -[[package]] -name = "config" -version = "0.6.0" -dependencies = [ - "alloy", - "common", - "consensus-core", - "dirs", - "eyre", - "figment", - "futures", - "hex", - "reqwest", - "retri", - "serde", - "serde_yaml", - "strum", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "consensus" -version = "0.6.0" -dependencies = [ - "alloy", - "async-trait", - "chrono", - "common", - "config", - "consensus-core", - "eyre", - "futures", - "getrandom 0.2.15", - "hex", - "openssl", - "parking_lot", - "reqwest", - "retri", - "serde", - "serde_json", - "superstruct", - "thiserror", - "tokio", - "tracing", - "tree_hash", - "wasm-bindgen-futures", - "zduny-wasm-timer", -] - -[[package]] -name = "consensus-core" -version = "0.6.0" -dependencies = [ - "alloy", - "bls12_381", - "ethereum_ssz 0.6.0", - "ethereum_ssz_derive 0.6.0", - "eyre", - "getrandom 0.2.15", - "serde", - "sha2 0.9.9", - "ssz_types", - "superstruct", - "thiserror", - "tracing", - "tree_hash", - "tree_hash_derive", - "typenum", - "zduny-wasm-timer", -] - -[[package]] -name = "console_error_panic_hook" -version = "0.1.7" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" -dependencies = [ - "cfg-if", - "wasm-bindgen", -] +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "const-hex" @@ -1432,9 +1303,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core-graphics" @@ -1474,9 +1345,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1581,24 +1452,14 @@ dependencies = [ "typenum", ] -[[package]] -name = "cstr" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68523903c8ae5aacfa32a0d9ae60cadeb764e1da14ee0d26b1f3089f13a54636" -dependencies = [ - "proc-macro2", - "quote", -] - [[package]] name = "ctrlc" -version = "3.4.4" +version = "3.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" +checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" dependencies = [ "nix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1646,7 +1507,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1668,7 +1529,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1730,8 +1591,8 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 2.0.72", + "rustc_version 0.4.1", + "syn 2.0.77", ] [[package]] @@ -1770,16 +1631,6 @@ dependencies = [ "dirs-sys", ] -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - [[package]] name = "dirs-sys" version = "0.4.1" @@ -1792,17 +1643,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dlib" version = "0.5.2" @@ -1826,15 +1666,15 @@ checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dwrote" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" +checksum = "2da3498378ed373237bdef1eddcc64e7be2d3ba4841f4c22a998e81cadeea83c" dependencies = [ "lazy_static", "libc", @@ -1898,13 +1738,13 @@ dependencies = [ [[package]] name = "enumn" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2042,7 +1882,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2051,29 +1891,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "execution" -version = "0.6.0" -dependencies = [ - "alloy", - "async-trait", - "common", - "consensus", - "eyre", - "futures", - "hex", - "openssl", - "reqwest", - "revm", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "triehash-ethereum", - "wasm-bindgen-futures", -] - [[package]] name = "eyre" version = "0.6.12" @@ -2086,9 +1903,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fastrlp" @@ -2096,7 +1913,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "auto_impl", "bytes", ] @@ -2161,12 +1978,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -2183,16 +2000,16 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "font-kit" -version = "0.13.2" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2845a73bbd781e691ab7c2a028c579727cd254942e8ced57ff73e0eafd60de87" +checksum = "b64b34f4efd515f905952d91bc185039863705592c0c53ae6d979805dd154520" dependencies = [ "bitflags 2.6.0", "byteorder", "core-foundation", "core-graphics", "core-text", - "dirs-next", + "dirs", "dwrote", "float-ord", "freetype-sys", @@ -2233,7 +2050,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2330,7 +2147,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2426,9 +2243,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "glob" @@ -2438,9 +2255,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", @@ -2528,7 +2345,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2537,9 +2354,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", "bytes", @@ -2547,7 +2364,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2601,19 +2418,15 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "helios" -version = "0.6.0" +version = "0.7.0" dependencies = [ "alloy", - "client", - "common", - "config", - "consensus", - "consensus-core", "criterion", "dirs", "dotenv", - "execution", "eyre", + "helios-core", + "helios-ethereum", "hex", "plotters", "pretty_assertions", @@ -2627,25 +2440,99 @@ dependencies = [ ] [[package]] -name = "helios-ts" -version = "0.1.0" +name = "helios-cli" +version = "0.7.0" dependencies = [ "alloy", - "client", - "common", - "config", - "consensus", - "console_error_panic_hook", - "execution", + "clap", + "ctrlc", + "dirs", "eyre", + "futures", + "helios-ethereum", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "helios-consensus-core" +version = "0.7.0" +dependencies = [ + "alloy", + "bls12_381", + "ethereum_ssz 0.6.0", + "ethereum_ssz_derive 0.6.0", + "eyre", + "getrandom 0.2.15", + "serde", + "sha2 0.9.9", + "ssz_types", + "superstruct", + "thiserror", + "tracing", + "tree_hash", + "tree_hash_derive", + "typenum", + "zduny-wasm-timer", +] + +[[package]] +name = "helios-core" +version = "0.7.0" +dependencies = [ + "alloy", + "async-trait", + "eyre", + "futures", + "gloo-timers 0.3.0", "hex", + "jsonrpsee", + "openssl", + "parking_lot", + "reqwest", + "revm", "serde", - "serde-wasm-bindgen", "serde_json", - "wasm-bindgen", + "thiserror", + "tokio", + "tracing", + "triehash-ethereum", "wasm-bindgen-futures", - "wasm-bindgen-test", - "web-sys", + "zduny-wasm-timer", +] + +[[package]] +name = "helios-ethereum" +version = "0.7.0" +dependencies = [ + "alloy", + "async-trait", + "chrono", + "dirs", + "eyre", + "figment", + "futures", + "getrandom 0.2.15", + "helios-consensus-core", + "helios-core", + "hex", + "openssl", + "parking_lot", + "reqwest", + "retri", + "revm", + "serde", + "serde_json", + "serde_yaml", + "strum", + "superstruct", + "thiserror", + "tokio", + "tracing", + "tree_hash", + "wasm-bindgen-futures", + "zduny-wasm-timer", ] [[package]] @@ -2654,6 +2541,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -2779,7 +2672,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "httparse", @@ -2808,15 +2701,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -2841,9 +2734,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", @@ -2861,9 +2754,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3005,9 +2898,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -3037,26 +2930,26 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -3090,9 +2983,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -3270,9 +3163,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", @@ -3283,9 +3176,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -3328,9 +3221,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -3420,13 +3313,22 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", @@ -3451,9 +3353,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -3557,35 +3459,35 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "object" -version = "0.36.1" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -3631,7 +3533,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3642,9 +3544,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.1+3.3.1" +version = "300.3.2+3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" dependencies = [ "cc", ] @@ -3701,7 +3603,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitvec 1.0.1", "byte-slice-cast 1.2.2", "impl-trait-for-tuples", @@ -3715,7 +3617,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3766,7 +3668,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cf07ef4804cfa9aea3b04a7bbdd5a40031dbb6b4f2cbaf2b011666c80c5b4f2" dependencies = [ - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -3777,7 +3679,7 @@ checksum = "bdeeaa00ce488657faba8ebf44ab9361f9365a97bd39ffb8a60663f57ff4b467" dependencies = [ "inlinable_string", "pear_codegen", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -3789,7 +3691,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3810,9 +3712,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" dependencies = [ "memchr", "thiserror", @@ -3826,7 +3728,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -3846,7 +3748,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3873,9 +3775,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plain_hasher" @@ -3888,9 +3790,9 @@ dependencies = [ [[package]] name = "plotters" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "chrono", "font-kit", @@ -3908,15 +3810,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-bitmap" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e7f6fb8302456d7c264a94dada86f76d76e1a03e2294ee86ca7da92983b0a6" +checksum = "72ce181e3f6bf82d6c1dc569103ca7b1bd964c60ba03d7e6cdfbb3e3eb7f7405" dependencies = [ "gif", "image", @@ -3925,9 +3827,9 @@ dependencies = [ [[package]] name = "plotters-svg" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] @@ -3942,7 +3844,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.7.4", ] [[package]] @@ -3953,18 +3855,21 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "pretty_assertions" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ "diff", - "yansi 0.5.1", + "yansi", ] [[package]] @@ -4005,11 +3910,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.21", ] [[package]] @@ -4053,9 +3958,9 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "version_check", - "yansi 1.0.1", + "yansi", ] [[package]] @@ -4086,9 +3991,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -4213,18 +4118,18 @@ checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.15", "libredox", @@ -4233,9 +4138,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -4277,21 +4182,21 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2 0.4.5", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "http-body-util", "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper-rustls 0.27.3", "hyper-tls", "hyper-util", "ipnet", @@ -4302,7 +4207,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "serde", "serde_json", "serde_urlencoded", @@ -4315,7 +4220,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "windows-registry", ] [[package]] @@ -4504,18 +4409,18 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver 1.0.23", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -4538,14 +4443,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -4573,9 +4478,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64 0.22.1", "rustls-pki-types", @@ -4583,9 +4488,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" @@ -4599,9 +4504,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -4643,19 +4548,13 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.2.0" @@ -4688,9 +4587,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.2" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ "rand 0.8.5", "secp256k1-sys", @@ -4698,9 +4597,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.9.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" dependencies = [ "cc", ] @@ -4720,9 +4619,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -4766,52 +4665,42 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-wasm-bindgen" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -4838,7 +4727,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_derive", "serde_json", @@ -4855,7 +4744,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4864,7 +4753,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "itoa", "ryu", "serde", @@ -4921,9 +4810,9 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" dependencies = [ "cc", "cfg-if", @@ -4938,6 +4827,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -5086,7 +4981,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5135,9 +5030,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -5153,7 +5048,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5161,23 +5056,26 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -5191,34 +5089,35 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5316,9 +5215,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.1" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -5340,7 +5239,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5369,16 +5268,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -5394,19 +5293,19 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tungstenite", - "webpki-roots 0.26.3", + "webpki-roots 0.26.6", ] [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -5418,21 +5317,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.16", + "toml_edit 0.22.21", ] [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -5443,33 +5342,22 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.16" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.15", + "winnow 0.6.18", ] [[package]] @@ -5490,15 +5378,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -5520,7 +5408,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5580,7 +5468,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5603,7 +5491,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5651,7 +5539,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "sha1", "thiserror", @@ -5717,15 +5605,15 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] @@ -5779,9 +5667,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" @@ -5825,34 +5713,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -5862,9 +5751,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5872,53 +5761,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "wasm-bindgen-test" -version = "0.3.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" -dependencies = [ - "console_error_panic_hook", - "js-sys", - "scoped-tls", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test-macro", -] - -[[package]] -name = "wasm-bindgen-test-macro" -version = "0.3.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -5935,9 +5799,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] @@ -5972,11 +5836,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5994,6 +5858,36 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -6012,6 +5906,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -6144,23 +6047,13 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "wio" version = "0.2.2" @@ -6181,7 +6074,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", @@ -6198,12 +6091,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "yansi" version = "1.0.1" @@ -6212,11 +6099,10 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yeslogic-fontconfig-sys" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb6b23999a8b1a997bf47c7bb4d19ad4029c3327bb3386ebe0a5ff584b33c7a" +checksum = "503a066b4c037c440169d995b869046827dbc71263f6e8f3be6d77d4f3229dbd" dependencies = [ - "cstr", "dlib", "once_cell", "pkg-config", @@ -6243,6 +6129,7 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] @@ -6254,7 +6141,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -6274,5 +6161,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] diff --git a/Cargo.toml b/Cargo.toml index 670916d4..8ea70d19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "helios" -version = "0.6.0" +version = "0.7.0" edition = "2021" autobenches = false exclude = ["benches"] @@ -8,13 +8,10 @@ exclude = ["benches"] [workspace] members = [ "cli", - "client", - "common", - "config", - "consensus", - "execution", - "helios-ts", - "consensus-core", + "core", + "ethereum", + "ethereum/consensus-core", + #"helios-ts", ] default-members = ["cli"] @@ -43,6 +40,7 @@ alloy = { version = "0.2.1", features = [ "sol-types", "network", "ssz", + "json-rpc", ]} revm = { version = "12.1.0", default-features = false, features = [ "std", @@ -81,12 +79,8 @@ typenum = "1.17.0" ###################################### [dependencies] -client = { path = "./client" } -config = { path = "./config" } -common = { path = "./common" } -consensus = { path = "./consensus" } -execution = { path = "./execution" } -consensus-core = { path = "./consensus-core" } +helios-core = { path = "./core" } +helios-ethereum = { path = "./ethereum" } [dev-dependencies] tokio = { version = "1", features = ["full"] } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index f369922f..de0d86b3 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "cli" -version = "0.6.0" +name = "helios-cli" +version = "0.7.0" edition = "2021" [[bin]] @@ -19,7 +19,4 @@ tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } dirs = "5.0.1" ctrlc = "3.2.3" -client = { path = "../client" } -config = { path = "../config" } -consensus = { path = "../consensus" } -common = { path = "../common" } +helios-ethereum = { path = "../ethereum" } diff --git a/cli/src/main.rs b/cli/src/main.rs index b7b83f72..305f0f2f 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -15,9 +15,9 @@ use tracing::{error, info}; use tracing_subscriber::filter::{EnvFilter, LevelFilter}; use tracing_subscriber::FmtSubscriber; -use client::{Client, ClientBuilder}; -use config::{CliConfig, Config}; -use consensus::database::FileDB; +use helios_ethereum::config::{cli::CliConfig, Config}; +use helios_ethereum::database::FileDB; +use helios_ethereum::{EthereumClient, EthereumClientBuilder}; #[tokio::main] async fn main() -> Result<()> { @@ -33,7 +33,10 @@ async fn main() -> Result<()> { tracing::subscriber::set_global_default(subscriber).expect("subscriber set failed"); let config = get_config(); - let mut client = match ClientBuilder::new().config(config).build::() { + let mut client = match EthereumClientBuilder::new() + .config(config) + .build::() + { Ok(client) => client, Err(err) => { error!(target: "helios::runner", error = %err); @@ -50,7 +53,7 @@ async fn main() -> Result<()> { std::future::pending().await } -fn register_shutdown_handler(client: Client) { +fn register_shutdown_handler(client: EthereumClient) { let client = Arc::new(client); let shutdown_counter = Arc::new(Mutex::new(0)); @@ -84,9 +87,7 @@ fn register_shutdown_handler(client: Client) { fn get_config() -> Config { let cli = Cli::parse(); - let config_path = home_dir().unwrap().join(".helios/helios.toml"); - let cli_config = cli.as_cli_config(); Config::from_file(&config_path, &cli.network, &cli_config) diff --git a/client/Cargo.toml b/client/Cargo.toml deleted file mode 100644 index 52a01f43..00000000 --- a/client/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "client" -version = "0.6.0" -edition = "2021" - -[dependencies] -alloy.workspace = true -eyre.workspace = true -serde.workspace = true -hex.workspace = true -futures.workspace = true -tracing.workspace = true -thiserror.workspace = true -tokio.workspace = true -zduny-wasm-timer.workspace = true - -consensus = { path = "../consensus" } -execution = { path = "../execution" } -config = { path = "../config" } -common = { path = "../common" } - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -jsonrpsee = { version = "0.19.0", features = ["full"] } - -[target.'cfg(target_arch = "wasm32")'.dependencies] -gloo-timers = "0.3.0" -wasm-bindgen-futures = "0.4.33" - -[target.wasm32-unknown-unknown.dependencies] -parking_lot = { version = "0.12.2" } diff --git a/client/src/errors.rs b/client/src/errors.rs deleted file mode 100644 index 6b129f38..00000000 --- a/client/src/errors.rs +++ /dev/null @@ -1,64 +0,0 @@ -use eyre::Report; -use thiserror::Error; - -use common::errors::BlockNotFoundError; -use execution::errors::EvmError; - -/// Errors that can occur during Node calls -#[derive(Debug, Error)] -pub enum NodeError { - #[error(transparent)] - ExecutionEvmError(#[from] EvmError), - - #[error("execution error: {0}")] - ExecutionError(Report), - - #[error("out of sync: {0} seconds behind")] - OutOfSync(u64), - - #[error("consensus payload error: {0}")] - ConsensusPayloadError(Report), - - #[error("execution payload error: {0}")] - ExecutionPayloadError(Report), - - #[error("consensus client creation error: {0}")] - ConsensusClientCreationError(Report), - - #[error("execution client creation error: {0}")] - ExecutionClientCreationError(Report), - - #[error("consensus advance error: {0}")] - ConsensusAdvanceError(Report), - - #[error("consensus sync error: {0}")] - ConsensusSyncError(Report), - - #[error(transparent)] - BlockNotFoundError(#[from] BlockNotFoundError), -} - -#[cfg(not(target_arch = "wasm32"))] -impl NodeError { - pub fn to_json_rpsee_error(self) -> jsonrpsee::types::error::ErrorObjectOwned { - match self { - NodeError::ExecutionEvmError(evm_err) => match evm_err { - EvmError::Revert(data) => { - let mut msg = "execution reverted".to_string(); - if let Some(reason) = data.as_ref().and_then(EvmError::decode_revert_reason) { - msg = format!("{msg}: {reason}") - } - jsonrpsee::types::error::ErrorObject::owned( - 3, - msg, - data.map(|data| format!("0x{}", hex::encode(data))), - ) - } - _ => { - jsonrpsee::types::error::ErrorObject::owned(1, evm_err.to_string(), None::<()>) - } - }, - _ => jsonrpsee::types::error::ErrorObject::owned(1, self.to_string(), None::<()>), - } - } -} diff --git a/client/src/lib.rs b/client/src/lib.rs deleted file mode 100644 index a64fd91c..00000000 --- a/client/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod client; -pub use crate::client::*; - -pub mod errors; - -#[cfg(not(target_arch = "wasm32"))] -pub mod rpc; - -pub mod node; diff --git a/common/Cargo.toml b/common/Cargo.toml deleted file mode 100644 index 44ca75eb..00000000 --- a/common/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "common" -version = "0.6.0" -edition = "2021" - -[dependencies] -alloy = { version = "0.2.1", features = ["rpc-types"] } -eyre.workspace = true -serde.workspace = true -hex.workspace = true -serde_json.workspace = true -superstruct.workspace = true -thiserror.workspace = true -tracing.workspace = true -zduny-wasm-timer.workspace = true diff --git a/common/src/errors.rs b/common/src/errors.rs deleted file mode 100644 index 5ab5c971..00000000 --- a/common/src/errors.rs +++ /dev/null @@ -1,44 +0,0 @@ -use alloy::primitives::B256; -use thiserror::Error; - -use crate::types::BlockTag; - -#[derive(Debug, Error)] -#[error("block not available: {block}")] -pub struct BlockNotFoundError { - block: BlockTag, -} - -impl BlockNotFoundError { - pub fn new(block: BlockTag) -> Self { - Self { block } - } -} - -#[derive(Debug, Error)] -#[error("slot not found: {slot:?}")] -pub struct SlotNotFoundError { - slot: B256, -} - -impl SlotNotFoundError { - pub fn new(slot: B256) -> Self { - Self { slot } - } -} - -#[derive(Debug, Error)] -#[error("rpc error on method: {method}, message: {error}")] -pub struct RpcError { - method: String, - error: E, -} - -impl RpcError { - pub fn new(method: &str, err: E) -> Self { - Self { - method: method.to_string(), - error: err, - } - } -} diff --git a/common/src/lib.rs b/common/src/lib.rs deleted file mode 100644 index 422d6694..00000000 --- a/common/src/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod errors; -pub mod types; diff --git a/config/Cargo.toml b/config/Cargo.toml deleted file mode 100644 index 29360404..00000000 --- a/config/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "config" -version = "0.6.0" -edition = "2021" - -[dependencies] -alloy.workspace = true -eyre.workspace = true -serde.workspace = true -hex.workspace = true -thiserror.workspace = true -tracing.workspace = true -reqwest.workspace = true -futures.workspace = true -retri.workspace = true - -figment = { version = "0.10.7", features = ["toml", "env"] } -serde_yaml = "0.9.14" -strum = { version = "0.26.2", features = ["derive"] } - -common = { path = "../common" } -consensus-core = { path = "../consensus-core" } - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tokio.workspace = true -dirs = "5.0.1" diff --git a/config/src/lib.rs b/config/src/lib.rs deleted file mode 100644 index 56d649e2..00000000 --- a/config/src/lib.rs +++ /dev/null @@ -1,23 +0,0 @@ -/// Base Config -pub mod base; -pub use base::*; - -/// Core Config -pub mod config; -pub use crate::config::*; - -/// Checkpoint Config -pub mod checkpoints; -pub use checkpoints::*; - -/// Cli Config -pub mod cli; -pub use cli::*; - -/// Network Configuration -pub mod networks; -pub use networks::*; - -/// Generic Config Types -pub mod types; -pub use types::*; diff --git a/consensus/src/lib.rs b/consensus/src/lib.rs deleted file mode 100644 index ba02993a..00000000 --- a/consensus/src/lib.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub mod database; -pub mod rpc; - -mod consensus; -pub use crate::consensus::*; - -pub mod constants; diff --git a/execution/Cargo.toml b/core/Cargo.toml similarity index 71% rename from execution/Cargo.toml rename to core/Cargo.toml index a5f5ad4a..dfaf0c80 100644 --- a/execution/Cargo.toml +++ b/core/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "execution" -version = "0.6.0" +name = "helios-core" +version = "0.7.0" edition = "2021" [dependencies] @@ -24,13 +24,15 @@ eyre.workspace = true hex.workspace = true tracing.workspace = true thiserror.workspace = true -#hyper.workspace = true - -consensus = { path = "../consensus" } -common = { path = "../common" } +zduny-wasm-timer.workspace = true [target.'cfg(not(target_arch = "wasm32"))'.dependencies] +jsonrpsee = { version = "0.19.0", features = ["full"] } openssl.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen-futures = "0.4.33" +gloo-timers = "0.3.0" + +[target.wasm32-unknown-unknown.dependencies] +parking_lot = { version = "0.12.2" } diff --git a/core/src/client/mod.rs b/core/src/client/mod.rs new file mode 100644 index 00000000..3a1216ac --- /dev/null +++ b/core/src/client/mod.rs @@ -0,0 +1,202 @@ +use std::net::SocketAddr; +use std::sync::Arc; +use std::time::Duration; + +use alloy::primitives::{Address, Bytes, B256, U256}; +use alloy::rpc::types::{Filter, Log, SyncStatus}; +use eyre::Result; +use tracing::{info, warn}; +use zduny_wasm_timer::Delay; + +use crate::client::node::Node; +use crate::client::rpc::Rpc; +use crate::consensus::Consensus; +use crate::network_spec::NetworkSpec; +use crate::types::{Block, BlockTag}; + +pub mod node; +#[cfg(not(target_arch = "wasm32"))] +pub mod rpc; + +pub struct Client> { + node: Arc>, + #[cfg(not(target_arch = "wasm32"))] + rpc: Option>, +} + +impl> Client { + pub fn new( + execution_rpc: &str, + consensus: C, + #[cfg(not(target_arch = "wasm32"))] rpc_address: Option, + ) -> Result { + let node = Node::new(execution_rpc, consensus)?; + let node = Arc::new(node); + + #[cfg(not(target_arch = "wasm32"))] + let mut rpc: Option> = None; + + #[cfg(not(target_arch = "wasm32"))] + if let Some(rpc_address) = rpc_address { + rpc = Some(Rpc::new(node.clone(), rpc_address)); + } + + Ok(Client { + node, + #[cfg(not(target_arch = "wasm32"))] + rpc, + }) + } + + pub async fn start(&mut self) -> Result<()> { + #[cfg(not(target_arch = "wasm32"))] + if let Some(rpc) = &mut self.rpc { + rpc.start().await?; + } + + Ok(()) + } + + pub async fn shutdown(&self) { + info!(target: "helios::client","shutting down"); + if let Err(err) = self.node.consensus.shutdown() { + warn!(target: "helios::client", error = %err, "graceful shutdown failed"); + } + } + + pub async fn call(&self, tx: &N::TransactionRequest, block: BlockTag) -> Result { + self.node.call(tx, block).await.map_err(|err| err.into()) + } + + pub async fn estimate_gas(&self, tx: &N::TransactionRequest) -> Result { + self.node.estimate_gas(tx).await.map_err(|err| err.into()) + } + + pub async fn get_balance(&self, address: Address, block: BlockTag) -> Result { + self.node.get_balance(address, block).await + } + + pub async fn get_nonce(&self, address: Address, block: BlockTag) -> Result { + self.node.get_nonce(address, block).await + } + + pub async fn get_block_transaction_count_by_hash(&self, hash: B256) -> Result { + self.node.get_block_transaction_count_by_hash(hash).await + } + + pub async fn get_block_transaction_count_by_number(&self, block: BlockTag) -> Result { + self.node.get_block_transaction_count_by_number(block).await + } + + pub async fn get_code(&self, address: Address, block: BlockTag) -> Result { + self.node.get_code(address, block).await + } + + pub async fn get_storage_at( + &self, + address: Address, + slot: B256, + block: BlockTag, + ) -> Result { + self.node.get_storage_at(address, slot, block).await + } + + pub async fn send_raw_transaction(&self, bytes: &[u8]) -> Result { + self.node.send_raw_transaction(bytes).await + } + + pub async fn get_transaction_receipt( + &self, + tx_hash: B256, + ) -> Result> { + self.node.get_transaction_receipt(tx_hash).await + } + + pub async fn get_transaction_by_hash(&self, tx_hash: B256) -> Option { + self.node.get_transaction_by_hash(tx_hash).await + } + + pub async fn get_logs(&self, filter: &Filter) -> Result> { + self.node.get_logs(filter).await + } + + pub async fn get_filter_changes(&self, filter_id: U256) -> Result { + self.node.uninstall_filter(filter_id).await + } + + pub async fn uninstall_filter(&self, filter_id: U256) -> Result { + self.node.uninstall_filter(filter_id).await + } + + pub async fn get_new_filter(&self, filter: &Filter) -> Result { + self.node.get_new_filter(filter).await + } + + pub async fn get_new_block_filter(&self) -> Result { + self.node.get_new_block_filter().await + } + + pub async fn get_new_pending_transaction_filter(&self) -> Result { + self.node.get_new_pending_transaction_filter().await + } + + pub async fn get_gas_price(&self) -> Result { + self.node.get_gas_price().await + } + + pub async fn get_priority_fee(&self) -> Result { + self.node.get_priority_fee() + } + + pub async fn get_block_number(&self) -> Result { + self.node.get_block_number().await + } + + pub async fn get_block_by_number( + &self, + block: BlockTag, + full_tx: bool, + ) -> Result>> { + self.node.get_block_by_number(block, full_tx).await + } + + pub async fn get_block_by_hash( + &self, + hash: B256, + full_tx: bool, + ) -> Result>> { + self.node.get_block_by_hash(hash, full_tx).await + } + + pub async fn get_transaction_by_block_hash_and_index( + &self, + block_hash: B256, + index: u64, + ) -> Option { + self.node + .get_transaction_by_block_hash_and_index(block_hash, index) + .await + } + + pub async fn chain_id(&self) -> u64 { + self.node.chain_id() + } + + pub async fn syncing(&self) -> Result { + self.node.syncing().await + } + + pub async fn get_coinbase(&self) -> Result
{ + self.node.get_coinbase().await + } + + pub async fn wait_synced(&self) { + loop { + if let Ok(SyncStatus::None) = self.syncing().await { + break; + } + + Delay::new(Duration::from_millis(100)).await.unwrap(); + } + } +} diff --git a/client/src/node.rs b/core/src/client/node.rs similarity index 75% rename from client/src/node.rs rename to core/src/client/node.rs index a835838d..2c17287c 100644 --- a/client/src/node.rs +++ b/core/src/client/node.rs @@ -1,71 +1,59 @@ use std::sync::Arc; use alloy::primitives::{Address, Bytes, B256, U256}; -use alloy::rpc::types::{ - Filter, Log, SyncInfo, SyncStatus, Transaction, TransactionReceipt, TransactionRequest, -}; +use alloy::rpc::types::{Filter, Log, SyncInfo, SyncStatus}; use eyre::{eyre, Result}; use zduny_wasm_timer::{SystemTime, UNIX_EPOCH}; -use common::types::{Block, BlockTag}; -use config::Config; -use consensus::database::Database; -use consensus::rpc::nimbus_rpc::NimbusRpc; -use consensus::ConsensusClient; -use execution::evm::Evm; -use execution::rpc::http_rpc::HttpRpc; -use execution::state::State; -use execution::ExecutionClient; - -use crate::errors::NodeError; - -pub struct Node { - pub consensus: ConsensusClient, - pub execution: Arc>, - pub config: Arc, +use crate::consensus::Consensus; +use crate::errors::ClientError; +use crate::execution::evm::Evm; +use crate::execution::rpc::http_rpc::HttpRpc; +use crate::execution::state::State; +use crate::execution::ExecutionClient; +use crate::network_spec::NetworkSpec; +use crate::types::{Block, BlockTag}; + +pub struct Node> { + pub consensus: C, + pub execution: Arc>>, pub history_size: usize, } -impl Node { - pub fn new(config: Arc) -> Result { - let consensus_rpc = &config.consensus_rpc; - let execution_rpc = &config.execution_rpc; - - let mut consensus = ConsensusClient::new(consensus_rpc, config.clone()) - .map_err(NodeError::ConsensusClientCreationError)?; - - let block_recv = consensus.block_recv.take().unwrap(); - let finalized_block_recv = consensus.finalized_block_recv.take().unwrap(); +impl> Node { + pub fn new(execution_rpc: &str, mut consensus: C) -> Result { + let block_recv = consensus.block_recv().take().unwrap(); + let finalized_block_recv = consensus.finalized_block_recv().take().unwrap(); let state = State::new(block_recv, finalized_block_recv, 256); let execution = Arc::new( - ExecutionClient::new(execution_rpc, state) - .map_err(NodeError::ExecutionClientCreationError)?, + ExecutionClient::new(execution_rpc, state).map_err(ClientError::InternalError)?, ); Ok(Node { consensus, execution, - config, history_size: 64, }) } - pub async fn call(&self, tx: &TransactionRequest, block: BlockTag) -> Result { + pub async fn call( + &self, + tx: &N::TransactionRequest, + block: BlockTag, + ) -> Result { self.check_blocktag_age(&block).await?; let mut evm = Evm::new(self.execution.clone(), self.chain_id(), block); - evm.call(tx).await.map_err(NodeError::ExecutionEvmError) + evm.call(tx).await.map_err(ClientError::EvmError) } - pub async fn estimate_gas(&self, tx: &TransactionRequest) -> Result { + pub async fn estimate_gas(&self, tx: &N::TransactionRequest) -> Result { self.check_head_age().await?; let mut evm = Evm::new(self.execution.clone(), self.chain_id(), BlockTag::Latest); - evm.estimate_gas(tx) - .await - .map_err(NodeError::ExecutionEvmError) + evm.estimate_gas(tx).await.map_err(ClientError::EvmError) } pub async fn get_balance(&self, address: Address, tag: BlockTag) -> Result { @@ -130,11 +118,11 @@ impl Node { pub async fn get_transaction_receipt( &self, tx_hash: B256, - ) -> Result> { + ) -> Result> { self.execution.get_transaction_receipt(tx_hash).await } - pub async fn get_transaction_by_hash(&self, tx_hash: B256) -> Option { + pub async fn get_transaction_by_hash(&self, tx_hash: B256) -> Option { self.execution.get_transaction(tx_hash).await } @@ -142,7 +130,7 @@ impl Node { &self, hash: B256, index: u64, - ) -> Option { + ) -> Option { self.execution .get_transaction_by_block_hash_and_index(hash, index) .await @@ -195,7 +183,11 @@ impl Node { Ok(block.number.to()) } - pub async fn get_block_by_number(&self, tag: BlockTag, full_tx: bool) -> Result> { + pub async fn get_block_by_number( + &self, + tag: BlockTag, + full_tx: bool, + ) -> Result>> { self.check_blocktag_age(&tag).await?; match self.execution.get_block(tag, full_tx).await { @@ -204,7 +196,11 @@ impl Node { } } - pub async fn get_block_by_hash(&self, hash: B256, full_tx: bool) -> Result> { + pub async fn get_block_by_hash( + &self, + hash: B256, + full_tx: bool, + ) -> Result>> { let block = self.execution.get_block_by_hash(hash, full_tx).await; match block { @@ -214,7 +210,7 @@ impl Node { } pub fn chain_id(&self) -> u64 { - self.config.chain.chain_id + self.consensus.chain_id() } pub async fn syncing(&self) -> Result { @@ -222,7 +218,7 @@ impl Node { Ok(SyncStatus::None) } else { let latest_synced_block = self.get_block_number().await.unwrap_or(U256::ZERO); - let highest_block = self.consensus.expected_current_slot(); + let highest_block = self.consensus.expected_highest_block(); Ok(SyncStatus::Info(Box::new(SyncInfo { current_block: latest_synced_block, @@ -240,7 +236,7 @@ impl Node { Ok(block.miner) } - async fn check_head_age(&self) -> Result<(), NodeError> { + async fn check_head_age(&self) -> Result<(), ClientError> { let timestamp = SystemTime::now() .duration_since(UNIX_EPOCH) .unwrap() @@ -250,19 +246,19 @@ impl Node { .execution .get_block(BlockTag::Latest, false) .await - .map_err(|_| NodeError::OutOfSync(timestamp))? + .map_err(|_| ClientError::OutOfSync(timestamp))? .timestamp .to(); let delay = timestamp.checked_sub(block_timestamp).unwrap_or_default(); if delay > 60 { - return Err(NodeError::OutOfSync(delay)); + return Err(ClientError::OutOfSync(delay)); } Ok(()) } - async fn check_blocktag_age(&self, block: &BlockTag) -> Result<(), NodeError> { + async fn check_blocktag_age(&self, block: &BlockTag) -> Result<(), ClientError> { match block { BlockTag::Latest => self.check_head_age().await, BlockTag::Finalized => Ok(()), diff --git a/client/src/rpc.rs b/core/src/client/rpc.rs similarity index 78% rename from client/src/rpc.rs rename to core/src/client/rpc.rs index 2a9f16ae..42aee77b 100644 --- a/client/src/rpc.rs +++ b/core/src/client/rpc.rs @@ -1,10 +1,9 @@ -use std::net::{IpAddr, Ipv4Addr}; use std::{fmt::Display, net::SocketAddr, sync::Arc}; +use alloy::network::{ReceiptResponse, TransactionResponse}; use alloy::primitives::{Address, Bytes, B256, U256, U64}; -use alloy::rpc::types::{ - Filter, Log, SyncStatus, Transaction, TransactionReceipt, TransactionRequest, -}; +use alloy::rpc::json_rpc::RpcObject; +use alloy::rpc::types::{Filter, Log, SyncStatus}; use eyre::Result; use jsonrpsee::{ core::{async_trait, server::Methods}, @@ -14,23 +13,19 @@ use jsonrpsee::{ }; use tracing::info; -use common::types::{Block, BlockTag}; -use consensus::database::Database; - -use crate::{errors::NodeError, node::Node}; +use crate::client::node::Node; +use crate::consensus::Consensus; +use crate::network_spec::NetworkSpec; +use crate::types::{Block, BlockTag}; -pub struct Rpc { - node: Arc>, +pub struct Rpc> { + node: Arc>, handle: Option, address: SocketAddr, } -impl Rpc { - pub fn new(node: Arc>, ip: Option, port: Option) -> Self { - let address = SocketAddr::new( - ip.unwrap_or(IpAddr::V4(Ipv4Addr::LOCALHOST)), - port.unwrap_or(0), - ); +impl> Rpc { + pub fn new(node: Arc>, address: SocketAddr) -> Self { Rpc { node, handle: None, @@ -54,7 +49,7 @@ impl Rpc { } #[rpc(server, namespace = "eth")] -trait EthRpc { +trait EthRpc { #[method(name = "getBalance")] async fn get_balance( &self, @@ -80,13 +75,9 @@ trait EthRpc { #[method(name = "getCode")] async fn get_code(&self, address: Address, block: BlockTag) -> Result; #[method(name = "call")] - async fn call( - &self, - tx: TransactionRequest, - block: BlockTag, - ) -> Result; + async fn call(&self, tx: TXR, block: BlockTag) -> Result; #[method(name = "estimateGas")] - async fn estimate_gas(&self, tx: TransactionRequest) -> Result; + async fn estimate_gas(&self, tx: TXR) -> Result; #[method(name = "chainId")] async fn chain_id(&self) -> Result; #[method(name = "gasPrice")] @@ -100,31 +91,25 @@ trait EthRpc { &self, block: BlockTag, full_tx: bool, - ) -> Result, ErrorObjectOwned>; + ) -> Result>, ErrorObjectOwned>; #[method(name = "getBlockByHash")] async fn get_block_by_hash( &self, hash: B256, full_tx: bool, - ) -> Result, ErrorObjectOwned>; + ) -> Result>, ErrorObjectOwned>; #[method(name = "sendRawTransaction")] async fn send_raw_transaction(&self, bytes: Bytes) -> Result; #[method(name = "getTransactionReceipt")] - async fn get_transaction_receipt( - &self, - hash: B256, - ) -> Result, ErrorObjectOwned>; + async fn get_transaction_receipt(&self, hash: B256) -> Result, ErrorObjectOwned>; #[method(name = "getTransactionByHash")] - async fn get_transaction_by_hash( - &self, - hash: B256, - ) -> Result, ErrorObjectOwned>; + async fn get_transaction_by_hash(&self, hash: B256) -> Result, ErrorObjectOwned>; #[method(name = "getTransactionByBlockHashAndIndex")] async fn get_transaction_by_block_hash_and_index( &self, hash: B256, index: U64, - ) -> Result, ErrorObjectOwned>; + ) -> Result, ErrorObjectOwned>; #[method(name = "getLogs")] async fn get_logs(&self, filter: Filter) -> Result, ErrorObjectOwned>; #[method(name = "getFilterChanges")] @@ -156,14 +141,25 @@ trait NetRpc { async fn version(&self) -> Result; } -#[derive(Clone)] -struct RpcInner { - node: Arc>, +struct RpcInner> { + node: Arc>, address: SocketAddr, } +impl> Clone for RpcInner { + fn clone(&self) -> Self { + Self { + node: self.node.clone(), + address: self.address, + } + } +} + #[async_trait] -impl EthRpcServer for RpcInner { +impl> + EthRpcServer + for RpcInner +{ async fn get_balance( &self, address: Address, @@ -200,21 +196,16 @@ impl EthRpcServer for RpcInner { async fn call( &self, - tx: TransactionRequest, + tx: N::TransactionRequest, block: BlockTag, ) -> Result { - self.node - .call(&tx, block) - .await - .map_err(NodeError::to_json_rpsee_error) + convert_err(self.node.call(&tx, block).await) } - async fn estimate_gas(&self, tx: TransactionRequest) -> Result { - self.node - .estimate_gas(&tx) - .await - .map_err(NodeError::to_json_rpsee_error) - .map(U64::from) + async fn estimate_gas(&self, tx: N::TransactionRequest) -> Result { + let res = self.node.estimate_gas(&tx).await.map(U64::from); + + convert_err(res) } async fn chain_id(&self) -> Result { @@ -237,7 +228,7 @@ impl EthRpcServer for RpcInner { &self, block: BlockTag, full_tx: bool, - ) -> Result, ErrorObjectOwned> { + ) -> Result>, ErrorObjectOwned> { convert_err(self.node.get_block_by_number(block, full_tx).await) } @@ -245,7 +236,7 @@ impl EthRpcServer for RpcInner { &self, hash: B256, full_tx: bool, - ) -> Result, ErrorObjectOwned> { + ) -> Result>, ErrorObjectOwned> { convert_err(self.node.get_block_by_hash(hash, full_tx).await) } @@ -256,14 +247,14 @@ impl EthRpcServer for RpcInner { async fn get_transaction_receipt( &self, hash: B256, - ) -> Result, ErrorObjectOwned> { + ) -> Result, ErrorObjectOwned> { convert_err(self.node.get_transaction_receipt(hash).await) } async fn get_transaction_by_hash( &self, hash: B256, - ) -> Result, ErrorObjectOwned> { + ) -> Result, ErrorObjectOwned> { Ok(self.node.get_transaction_by_hash(hash).await) } @@ -271,7 +262,7 @@ impl EthRpcServer for RpcInner { &self, hash: B256, index: U64, - ) -> Result, ErrorObjectOwned> { + ) -> Result, ErrorObjectOwned> { Ok(self .node .get_transaction_by_block_hash_and_index(hash, index.to()) @@ -321,13 +312,15 @@ impl EthRpcServer for RpcInner { } #[async_trait] -impl NetRpcServer for RpcInner { +impl> NetRpcServer for RpcInner { async fn version(&self) -> Result { Ok(self.node.chain_id()) } } -async fn start(rpc: RpcInner) -> Result<(ServerHandle, SocketAddr)> { +async fn start>( + rpc: RpcInner, +) -> Result<(ServerHandle, SocketAddr)> { let server = ServerBuilder::default().build(rpc.address).await?; let addr = server.local_addr()?; diff --git a/core/src/consensus.rs b/core/src/consensus.rs new file mode 100644 index 00000000..25d0ad6c --- /dev/null +++ b/core/src/consensus.rs @@ -0,0 +1,14 @@ +use alloy::network::TransactionResponse; +use eyre::Result; +use serde::Serialize; +use tokio::sync::{mpsc, watch}; + +use crate::types::Block; + +pub trait Consensus: Sync + Send + 'static { + fn block_recv(&mut self) -> Option>>; + fn finalized_block_recv(&mut self) -> Option>>>; + fn expected_highest_block(&self) -> u64; + fn chain_id(&self) -> u64; + fn shutdown(&self) -> Result<()>; +} diff --git a/core/src/errors.rs b/core/src/errors.rs new file mode 100644 index 00000000..ab832897 --- /dev/null +++ b/core/src/errors.rs @@ -0,0 +1,54 @@ +use eyre::Report; +use thiserror::Error; + +use crate::{ + execution::errors::{EvmError, ExecutionError}, + types::BlockTag, +}; + +#[derive(Debug, Error)] +pub enum ClientError { + #[error("block not found: {0}")] + BlockNotFound(BlockTag), + #[error("out of sync: {0} seconds behind")] + OutOfSync(u64), + #[error("execution error: {0}")] + ExecutionError(ExecutionError), + #[error("evm error: {0}")] + EvmError(EvmError), + #[error("consensus error: {0}")] + ConsensusError(Report), + #[error("internal error: {0}")] + InternalError(Report), +} + +impl From for ClientError { + fn from(value: ExecutionError) -> Self { + match value { + ExecutionError::BlockNotFound(tag) => ClientError::BlockNotFound(tag), + err => ClientError::ExecutionError(err), + } + } +} + +impl From for jsonrpsee::core::Error { + fn from(value: ClientError) -> Self { + jsonrpsee::core::Error::Custom(value.to_string()) + } +} + +#[derive(Debug, Error)] +#[error("rpc error on method: {method}, message: {error}")] +pub struct RpcError { + method: String, + error: E, +} + +impl RpcError { + pub fn new(method: &str, err: E) -> Self { + Self { + method: method.to_string(), + error: err, + } + } +} diff --git a/execution/src/constants.rs b/core/src/execution/constants.rs similarity index 100% rename from execution/src/constants.rs rename to core/src/execution/constants.rs diff --git a/execution/src/errors.rs b/core/src/execution/errors.rs similarity index 61% rename from execution/src/errors.rs rename to core/src/execution/errors.rs index a1dbbeb6..913ce22f 100644 --- a/execution/src/errors.rs +++ b/core/src/execution/errors.rs @@ -3,6 +3,8 @@ use alloy::sol_types::decode_revert_reason; use eyre::Report; use thiserror::Error; +use crate::types::BlockTag; + #[derive(Debug, Error)] pub enum ExecutionError { #[error("invalid account proof for address: {0}")] @@ -13,8 +15,6 @@ pub enum ExecutionError { CodeHashMismatch(Address, B256, B256), #[error("receipt root mismatch for tx: {0}")] ReceiptRootMismatch(B256), - #[error("missing transaction for tx: {0}")] - MissingTransaction(B256), #[error("could not prove receipt for tx: {0}")] NoReceiptForTransaction(B256), #[error("missing log for transaction: {0}, index: {1}")] @@ -23,22 +23,14 @@ pub enum ExecutionError { TooManyLogsToProve(usize, usize), #[error("execution rpc is for the incorrect network")] IncorrectRpcNetwork(), - #[error("Invalid base gas fee helios {0} vs rpc endpoint {1} at block {2}")] - InvalidBaseGaseFee(U256, U256, u64), - #[error("Invalid gas used ratio of helios {0} vs rpc endpoint {1} at block {2}")] - InvalidGasUsedRatio(f64, f64, u64), - #[error("Block {0} not found")] - BlockNotFoundError(u64), - #[error("Helios Execution Payload is empty")] - EmptyExecutionPayload(), - #[error("User query for block {0} but helios oldest block is {1}")] - InvalidBlockRange(u64, u64), + #[error("block not found: {0}")] + BlockNotFound(BlockTag), } /// Errors that can occur during evm.rs calls #[derive(Debug, Error)] pub enum EvmError { - #[error("execution reverted: {0:?}")] + #[error("execution reverted: {}", display_revert(.0))] Revert(Option), #[error("evm error: {0:?}")] @@ -48,8 +40,9 @@ pub enum EvmError { RpcError(Report), } -impl EvmError { - pub fn decode_revert_reason(data: impl AsRef<[u8]>) -> Option { - decode_revert_reason(data.as_ref()) +fn display_revert(output: &Option) -> String { + match output { + Some(bytes) => decode_revert_reason(bytes.as_ref()).unwrap_or(hex::encode(bytes)), + None => "execution halted".to_string(), } } diff --git a/execution/src/evm.rs b/core/src/execution/evm.rs similarity index 70% rename from execution/src/evm.rs rename to core/src/execution/evm.rs index 7c4c3d72..bb5697d0 100644 --- a/execution/src/evm.rs +++ b/core/src/execution/evm.rs @@ -1,30 +1,31 @@ use std::{borrow::BorrowMut, collections::HashMap, sync::Arc}; -use alloy::{network::TransactionBuilder, rpc::types::TransactionRequest}; +use alloy::network::TransactionBuilder; use eyre::{Report, Result}; use futures::future::join_all; use revm::{ primitives::{ - address, AccessListItem, AccountInfo, Address, BlobExcessGasAndPrice, Bytecode, Bytes, Env, - ExecutionResult, ResultAndState, B256, U256, + address, AccessListItem, AccountInfo, Address, Bytecode, Bytes, Env, ExecutionResult, + ResultAndState, B256, U256, }, Database, Evm as Revm, }; use tracing::trace; -use crate::{ +use crate::execution::{ constants::PARALLEL_QUERY_BATCH_SIZE, errors::EvmError, rpc::ExecutionRpc, ExecutionClient, }; -use common::types::BlockTag; +use crate::network_spec::NetworkSpec; +use crate::types::BlockTag; -pub struct Evm { - execution: Arc>, +pub struct Evm> { + execution: Arc>, chain_id: u64, tag: BlockTag, } -impl Evm { - pub fn new(execution: Arc>, chain_id: u64, tag: BlockTag) -> Self { +impl> Evm { + pub fn new(execution: Arc>, chain_id: u64, tag: BlockTag) -> Self { Evm { execution, chain_id, @@ -32,7 +33,7 @@ impl Evm { } } - pub async fn call(&mut self, tx: &TransactionRequest) -> Result { + pub async fn call(&mut self, tx: &N::TransactionRequest) -> Result { let tx = self.call_inner(tx).await?; match tx.result { @@ -44,7 +45,7 @@ impl Evm { } } - pub async fn estimate_gas(&mut self, tx: &TransactionRequest) -> Result { + pub async fn estimate_gas(&mut self, tx: &N::TransactionRequest) -> Result { let tx = self.call_inner(tx).await?; match tx.result { @@ -54,7 +55,7 @@ impl Evm { } } - async fn call_inner(&mut self, tx: &TransactionRequest) -> Result { + async fn call_inner(&mut self, tx: &N::TransactionRequest) -> Result { let mut db = ProofDB::new(self.tag, self.execution.clone()); _ = db.state.prefetch_state(tx).await; @@ -83,38 +84,12 @@ impl Evm { tx_res.map_err(|_| EvmError::Generic("evm error".to_string())) } - async fn get_env(&self, tx: &TransactionRequest, tag: BlockTag) -> Env { + async fn get_env(&self, tx: &N::TransactionRequest, tag: BlockTag) -> Env { let mut env = Env::default(); - - env.tx.caller = tx.from.unwrap_or_default(); - env.tx.gas_limit = tx.gas_limit().map(|v| v as u64).unwrap_or(u64::MAX); - env.tx.gas_price = tx.gas_price().map(U256::from).unwrap_or_default(); - env.tx.transact_to = tx.to.unwrap_or_default(); - env.tx.value = tx.value.unwrap_or_default(); - env.tx.data = tx.input().unwrap_or_default().clone(); - env.tx.nonce = tx.nonce(); - env.tx.chain_id = tx.chain_id(); - env.tx.access_list = tx.access_list().map(|v| v.to_vec()).unwrap_or_default(); - env.tx.gas_priority_fee = tx.max_priority_fee_per_gas().map(U256::from); - env.tx.max_fee_per_blob_gas = tx.max_fee_per_gas().map(U256::from); - env.tx.blob_hashes = tx - .blob_versioned_hashes - .as_ref() - .map(|v| v.to_vec()) - .unwrap_or_default(); + env.tx = N::tx_env(tx); let block = self.execution.get_block(tag, false).await.unwrap(); - - env.block.number = block.number.to(); - env.block.coinbase = block.miner; - env.block.timestamp = block.timestamp.to(); - env.block.gas_limit = block.gas_limit.to(); - env.block.basefee = block.base_fee_per_gas; - env.block.difficulty = block.difficulty; - env.block.prevrandao = Some(block.mix_hash); - env.block.blob_excess_gas_and_price = block - .excess_blob_gas - .map(|v| BlobExcessGasAndPrice::new(v.to())); + env.block = N::block_env(&block); env.cfg.chain_id = self.chain_id; env.cfg.disable_block_gas_limit = true; @@ -125,12 +100,12 @@ impl Evm { } } -struct ProofDB { - state: EvmState, +struct ProofDB> { + state: EvmState, } -impl ProofDB { - pub fn new(tag: BlockTag, execution: Arc>) -> Self { +impl> ProofDB { + pub fn new(tag: BlockTag, execution: Arc>) -> Self { let state = EvmState::new(execution.clone(), tag); ProofDB { state } } @@ -142,17 +117,17 @@ enum StateAccess { Storage(Address, U256), } -struct EvmState { +struct EvmState> { basic: HashMap, block_hash: HashMap, storage: HashMap>, block: BlockTag, access: Option, - execution: Arc>, + execution: Arc>, } -impl EvmState { - pub fn new(execution: Arc>, block: BlockTag) -> Self { +impl> EvmState { + pub fn new(execution: Arc>, block: BlockTag) -> Self { Self { execution, block, @@ -239,7 +214,7 @@ impl EvmState { } } - pub async fn prefetch_state(&mut self, tx: &TransactionRequest) -> Result<()> { + pub async fn prefetch_state(&mut self, tx: &N::TransactionRequest) -> Result<()> { let mut list = self .execution .rpc @@ -249,7 +224,7 @@ impl EvmState { .0; let from_access_entry = AccessListItem { - address: tx.from.unwrap_or_default(), + address: tx.from().unwrap_or_default(), storage_keys: Vec::default(), }; @@ -322,7 +297,7 @@ impl EvmState { } } -impl Database for ProofDB { +impl> Database for ProofDB { type Error = Report; fn basic(&mut self, address: Address) -> Result, Report> { @@ -358,43 +333,43 @@ fn is_precompile(address: &Address) -> bool { address.le(&address!("0000000000000000000000000000000000000009")) && address.gt(&Address::ZERO) } -#[cfg(test)] -mod tests { - use revm::primitives::KECCAK_EMPTY; - use tokio::sync::{mpsc::channel, watch}; - - use crate::{rpc::mock_rpc::MockRpc, state::State}; - - use super::*; - - fn get_client() -> ExecutionClient { - let (_, block_recv) = channel(256); - let (_, finalized_recv) = watch::channel(None); - let state = State::new(block_recv, finalized_recv, 64); - ExecutionClient::new("testdata/", state).unwrap() - } - - #[tokio::test] - async fn test_proof_db() { - // Construct proofdb params - let execution = get_client(); - let tag = BlockTag::Latest; - - // Construct the proof database with the given client - let mut proof_db = ProofDB::new(tag, Arc::new(execution)); - - let address = address!("388C818CA8B9251b393131C08a736A67ccB19297"); - let info = AccountInfo::new( - U256::from(500), - 10, - KECCAK_EMPTY, - Bytecode::new_raw(revm::primitives::Bytes::default()), - ); - proof_db.state.basic.insert(address, info.clone()); - - // Get the account from the proof database - let account = proof_db.basic(address).unwrap().unwrap(); - - assert_eq!(account, info); - } -} +// #[cfg(test)] +// mod tests { +// use revm::primitives::KECCAK_EMPTY; +// use tokio::sync::{mpsc::channel, watch}; +// +// use crate::execution::{rpc::mock_rpc::MockRpc, state::State}; +// +// use super::*; +// +// fn get_client() -> ExecutionClient { +// let (_, block_recv) = channel(256); +// let (_, finalized_recv) = watch::channel(None); +// let state = State::new(block_recv, finalized_recv, 64); +// ExecutionClient::new("testdata/", state).unwrap() +// } +// +// #[tokio::test] +// async fn test_proof_db() { +// // Construct proofdb params +// let execution = get_client(); +// let tag = BlockTag::Latest; +// +// // Construct the proof database with the given client +// let mut proof_db = ProofDB::new(tag, Arc::new(execution)); +// +// let address = address!("388C818CA8B9251b393131C08a736A67ccB19297"); +// let info = AccountInfo::new( +// U256::from(500), +// 10, +// KECCAK_EMPTY, +// Bytecode::new_raw(revm::primitives::Bytes::default()), +// ); +// proof_db.state.basic.insert(address, info.clone()); +// +// // Get the account from the proof database +// let account = proof_db.basic(address).unwrap().unwrap(); +// +// assert_eq!(account, info); +// } +// } diff --git a/execution/src/execution.rs b/core/src/execution/mod.rs similarity index 80% rename from execution/src/execution.rs rename to core/src/execution/mod.rs index e566a019..ff488b65 100644 --- a/execution/src/execution.rs +++ b/core/src/execution/mod.rs @@ -1,35 +1,43 @@ use std::collections::HashMap; -use alloy::consensus::{Receipt, ReceiptWithBloom, TxReceipt, TxType}; +use alloy::network::ReceiptResponse; use alloy::primitives::{keccak256, Address, B256, U256}; use alloy::rlp::encode; -use alloy::rpc::types::{Filter, Log, Transaction, TransactionReceipt}; +use alloy::rpc::types::{Filter, Log}; use eyre::Result; use futures::future::join_all; use revm::primitives::KECCAK_EMPTY; use triehash_ethereum::ordered_trie_root; -use common::errors::BlockNotFoundError; -use common::types::{Block, BlockTag, Transactions}; +use crate::network_spec::NetworkSpec; +use crate::types::{Block, BlockTag, Transactions}; -use crate::constants::MAX_SUPPORTED_LOGS_NUMBER; -use crate::errors::ExecutionError; -use crate::state::State; +use self::constants::MAX_SUPPORTED_LOGS_NUMBER; +use self::errors::ExecutionError; +use self::proof::{encode_account, verify_proof}; +use self::rpc::ExecutionRpc; +use self::state::State; +use self::types::Account; -use super::proof::{encode_account, verify_proof}; -use super::rpc::ExecutionRpc; -use super::types::Account; +pub mod constants; +pub mod errors; +pub mod evm; +pub mod rpc; +pub mod state; +pub mod types; + +mod proof; #[derive(Clone)] -pub struct ExecutionClient { +pub struct ExecutionClient> { pub rpc: R, - state: State, + state: State, } -impl ExecutionClient { - pub fn new(rpc: &str, state: State) -> Result { +impl> ExecutionClient { + pub fn new(rpc: &str, state: State) -> Result { let rpc: R = ExecutionRpc::new(rpc)?; - Ok(ExecutionClient { rpc, state }) + Ok(ExecutionClient:: { rpc, state }) } pub async fn check_rpc(&self, chain_id: u64) -> Result<()> { @@ -51,7 +59,7 @@ impl ExecutionClient { .state .get_block(tag) .await - .ok_or(BlockNotFoundError::new(tag))?; + .ok_or(ExecutionError::BlockNotFound(tag))?; let proof = self .rpc @@ -122,12 +130,16 @@ impl ExecutionClient { self.rpc.send_raw_transaction(bytes).await } - pub async fn get_block(&self, tag: BlockTag, full_tx: bool) -> Result { + pub async fn get_block( + &self, + tag: BlockTag, + full_tx: bool, + ) -> Result> { let mut block = self .state .get_block(tag) .await - .ok_or(BlockNotFoundError::new(tag))?; + .ok_or(ExecutionError::BlockNotFound(tag))?; if !full_tx { block.transactions = Transactions::Hashes(block.transactions.hashes()); @@ -136,7 +148,11 @@ impl ExecutionClient { Ok(block) } - pub async fn get_block_by_hash(&self, hash: B256, full_tx: bool) -> Result { + pub async fn get_block_by_hash( + &self, + hash: B256, + full_tx: bool, + ) -> Result> { let mut block = self .state .get_block_by_hash(hash) @@ -154,7 +170,7 @@ impl ExecutionClient { &self, block_hash: B256, index: u64, - ) -> Option { + ) -> Option { self.state .get_transaction_by_block_and_index(block_hash, index) .await @@ -163,14 +179,14 @@ impl ExecutionClient { pub async fn get_transaction_receipt( &self, tx_hash: B256, - ) -> Result> { + ) -> Result> { let receipt = self.rpc.get_transaction_receipt(tx_hash).await?; if receipt.is_none() { return Ok(None); } let receipt = receipt.unwrap(); - let block_number = receipt.block_number.unwrap(); + let block_number = receipt.block_number().unwrap(); let block = self.state.get_block(BlockTag::Number(block_number)).await; let block = if let Some(block) = block { @@ -188,19 +204,20 @@ impl ExecutionClient { let receipts = join_all(receipts_fut).await; let receipts = receipts.into_iter().collect::>>()?; - let receipts_encoded: Vec> = receipts.iter().map(encode_receipt).collect(); + let receipts_encoded: Vec> = receipts.iter().map(N::encode_receipt).collect(); let expected_receipt_root = ordered_trie_root(receipts_encoded); let expected_receipt_root = B256::from_slice(&expected_receipt_root.to_fixed_bytes()); - if expected_receipt_root != block.receipts_root || !receipts.contains(&receipt) { + if expected_receipt_root != block.receipts_root || !N::receipt_contains(&receipts, &receipt) + { return Err(ExecutionError::ReceiptRootMismatch(tx_hash).into()); } Ok(Some(receipt)) } - pub async fn get_transaction(&self, hash: B256) -> Option { + pub async fn get_transaction(&self, hash: B256) -> Option { self.state.get_transaction(hash).await } @@ -288,9 +305,7 @@ impl ExecutionClient { // Check if the receipt contains the desired log // Encoding logs for comparison - let receipt_logs_encoded = receipt - .inner - .logs() + let receipt_logs_encoded = N::receipt_logs(&receipt) .iter() .map(|log| encode(&log.inner)) .collect::>(); @@ -308,27 +323,3 @@ impl ExecutionClient { Ok(()) } } - -fn encode_receipt(receipt: &TransactionReceipt) -> Vec { - let tx_type = receipt.transaction_type(); - let receipt = receipt.inner.as_receipt_with_bloom().unwrap(); - let logs = receipt - .logs() - .iter() - .map(|l| l.inner.clone()) - .collect::>(); - - let consensus_receipt = Receipt { - cumulative_gas_used: receipt.cumulative_gas_used(), - status: *receipt.status_or_post_state(), - logs, - }; - - let rwb = ReceiptWithBloom::new(consensus_receipt, receipt.bloom()); - let encoded = alloy::rlp::encode(rwb); - - match tx_type { - TxType::Legacy => encoded, - _ => [vec![tx_type as u8], encoded].concat(), - } -} diff --git a/execution/src/proof.rs b/core/src/execution/proof.rs similarity index 99% rename from execution/src/proof.rs rename to core/src/execution/proof.rs index dfe1a323..1e5e23c0 100644 --- a/execution/src/proof.rs +++ b/core/src/execution/proof.rs @@ -172,7 +172,7 @@ pub fn encode_account(proof: &EIP1186AccountProofResponse) -> Vec { #[cfg(test)] mod tests { - use crate::proof::shared_prefix_length; + use crate::execution::proof::shared_prefix_length; #[tokio::test] async fn test_shared_prefix_length() { diff --git a/execution/src/rpc/http_rpc.rs b/core/src/execution/rpc/http_rpc.rs similarity index 89% rename from execution/src/rpc/http_rpc.rs rename to core/src/execution/rpc/http_rpc.rs index 4af4b8a4..fb4f5a6f 100644 --- a/execution/src/rpc/http_rpc.rs +++ b/core/src/execution/rpc/http_rpc.rs @@ -1,10 +1,7 @@ use alloy::primitives::{Address, B256, U256}; use alloy::providers::{Provider, ProviderBuilder, RootProvider}; use alloy::rpc::client::ClientBuilder; -use alloy::rpc::types::{ - BlockId, EIP1186AccountProofResponse, FeeHistory, Filter, Log, Transaction, TransactionReceipt, - TransactionRequest, -}; +use alloy::rpc::types::{BlockId, EIP1186AccountProofResponse, FeeHistory, Filter, Log}; use alloy::transports::http::Http; use alloy::transports::layers::{RetryBackoffLayer, RetryBackoffService}; use async_trait::async_trait; @@ -12,17 +9,18 @@ use eyre::Result; use reqwest::Client; use revm::primitives::AccessList; -use common::errors::RpcError; -use common::types::BlockTag; +use crate::errors::RpcError; +use crate::network_spec::NetworkSpec; +use crate::types::BlockTag; use super::ExecutionRpc; -pub struct HttpRpc { +pub struct HttpRpc { url: String, - provider: RootProvider>>, + provider: RootProvider>, N>, } -impl Clone for HttpRpc { +impl Clone for HttpRpc { fn clone(&self) -> Self { Self::new(&self.url).unwrap() } @@ -30,13 +28,13 @@ impl Clone for HttpRpc { #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] -impl ExecutionRpc for HttpRpc { +impl ExecutionRpc for HttpRpc { fn new(rpc: &str) -> Result { let client = ClientBuilder::default() .layer(RetryBackoffLayer::new(100, 50, 300)) .http(rpc.parse().unwrap()); - let provider = ProviderBuilder::new().on_client(client); + let provider = ProviderBuilder::new().network::().on_client(client); Ok(HttpRpc { url: rpc.to_string(), @@ -62,7 +60,7 @@ impl ExecutionRpc for HttpRpc { async fn create_access_list( &self, - tx: &TransactionRequest, + tx: &N::TransactionRequest, block: BlockTag, ) -> Result { let block = match block { @@ -102,7 +100,7 @@ impl ExecutionRpc for HttpRpc { Ok(*tx.tx_hash()) } - async fn get_transaction_receipt(&self, tx_hash: B256) -> Result> { + async fn get_transaction_receipt(&self, tx_hash: B256) -> Result> { let receipt = self .provider .get_transaction_receipt(tx_hash) @@ -112,7 +110,7 @@ impl ExecutionRpc for HttpRpc { Ok(receipt) } - async fn get_transaction(&self, tx_hash: B256) -> Result> { + async fn get_transaction(&self, tx_hash: B256) -> Result> { Ok(self .provider .get_transaction_by_hash(tx_hash) diff --git a/execution/src/rpc/mock_rpc.rs b/core/src/execution/rpc/mock_rpc.rs similarity index 89% rename from execution/src/rpc/mock_rpc.rs rename to core/src/execution/rpc/mock_rpc.rs index 20a4f9cd..fae60b6f 100644 --- a/execution/src/rpc/mock_rpc.rs +++ b/core/src/execution/rpc/mock_rpc.rs @@ -1,15 +1,13 @@ use std::{fs::read_to_string, path::PathBuf}; use alloy::primitives::{Address, B256, U256}; -use alloy::rpc::types::{ - AccessList, EIP1186AccountProofResponse, FeeHistory, Filter, Log, Transaction, - TransactionReceipt, TransactionRequest, -}; +use alloy::rpc::types::{AccessList, EIP1186AccountProofResponse, FeeHistory, Filter, Log}; use async_trait::async_trait; use eyre::{eyre, Result}; use super::ExecutionRpc; -use common::types::BlockTag; +use crate::network_spec::NetworkSpec; +use crate::types::BlockTag; #[derive(Clone)] pub struct MockRpc { @@ -18,7 +16,7 @@ pub struct MockRpc { #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] -impl ExecutionRpc for MockRpc { +impl ExecutionRpc for MockRpc { fn new(rpc: &str) -> Result { let path = PathBuf::from(rpc); Ok(MockRpc { path }) @@ -36,7 +34,7 @@ impl ExecutionRpc for MockRpc { async fn create_access_list( &self, - _opts: &TransactionRequest, + _opts: &N::TransactionRequest, _block: BlockTag, ) -> Result { Err(eyre!("not implemented")) @@ -51,12 +49,12 @@ impl ExecutionRpc for MockRpc { Err(eyre!("not implemented")) } - async fn get_transaction_receipt(&self, _tx_hash: B256) -> Result> { + async fn get_transaction_receipt(&self, _tx_hash: B256) -> Result> { let receipt = read_to_string(self.path.join("receipt.json"))?; Ok(serde_json::from_str(&receipt)?) } - async fn get_transaction(&self, _tx_hash: B256) -> Result> { + async fn get_transaction(&self, _tx_hash: B256) -> Result> { let tx = read_to_string(self.path.join("transaction.json"))?; Ok(serde_json::from_str(&tx)?) } diff --git a/execution/src/rpc/mod.rs b/core/src/execution/rpc/mod.rs similarity index 81% rename from execution/src/rpc/mod.rs rename to core/src/execution/rpc/mod.rs index 4e31fe77..686b68a4 100644 --- a/execution/src/rpc/mod.rs +++ b/core/src/execution/rpc/mod.rs @@ -1,20 +1,17 @@ -use async_trait::async_trait; - use alloy::primitives::{Address, B256, U256}; -use alloy::rpc::types::{ - AccessList, EIP1186AccountProofResponse, FeeHistory, Filter, Log, Transaction, - TransactionReceipt, TransactionRequest, -}; +use alloy::rpc::types::{AccessList, EIP1186AccountProofResponse, FeeHistory, Filter, Log}; +use async_trait::async_trait; use eyre::Result; -use common::types::BlockTag; +use crate::network_spec::NetworkSpec; +use crate::types::BlockTag; pub mod http_rpc; pub mod mock_rpc; #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] -pub trait ExecutionRpc: Send + Clone + Sync + 'static { +pub trait ExecutionRpc: Send + Clone + Sync + 'static { fn new(rpc: &str) -> Result where Self: Sized; @@ -28,14 +25,14 @@ pub trait ExecutionRpc: Send + Clone + Sync + 'static { async fn create_access_list( &self, - tx: &TransactionRequest, + tx: &N::TransactionRequest, block: BlockTag, ) -> Result; async fn get_code(&self, address: Address, block: u64) -> Result>; async fn send_raw_transaction(&self, bytes: &[u8]) -> Result; - async fn get_transaction_receipt(&self, tx_hash: B256) -> Result>; - async fn get_transaction(&self, tx_hash: B256) -> Result>; + async fn get_transaction_receipt(&self, tx_hash: B256) -> Result>; + async fn get_transaction(&self, tx_hash: B256) -> Result>; async fn get_logs(&self, filter: &Filter) -> Result>; async fn get_filter_changes(&self, filter_id: U256) -> Result>; async fn uninstall_filter(&self, filter_id: U256) -> Result; diff --git a/execution/src/state.rs b/core/src/execution/state.rs similarity index 83% rename from execution/src/state.rs rename to core/src/execution/state.rs index dcc198b7..8158b5fc 100644 --- a/execution/src/state.rs +++ b/core/src/execution/state.rs @@ -4,23 +4,23 @@ use std::{ }; use alloy::primitives::{Address, B256, U256}; -use alloy::rpc::types::Transaction; use tokio::{ select, sync::{mpsc::Receiver, watch, RwLock}, }; -use common::types::{Block, BlockTag, Transactions}; +use crate::network_spec::NetworkSpec; +use crate::types::{Block, BlockTag, Transactions}; #[derive(Clone)] -pub struct State { - inner: Arc>, +pub struct State { + inner: Arc>>, } -impl State { +impl State { pub fn new( - mut block_recv: Receiver, - mut finalized_block_recv: watch::Receiver>, + mut block_recv: Receiver>, + mut finalized_block_recv: watch::Receiver>>, history_length: u64, ) -> Self { let inner = Arc::new(RwLock::new(Inner::new(history_length))); @@ -53,13 +53,13 @@ impl State { Self { inner } } - pub async fn push_block(&self, block: Block) { + pub async fn push_block(&self, block: Block) { self.inner.write().await.push_block(block); } // full block fetch - pub async fn get_block(&self, tag: BlockTag) -> Option { + pub async fn get_block(&self, tag: BlockTag) -> Option> { match tag { BlockTag::Latest => self .inner @@ -74,7 +74,7 @@ impl State { } } - pub async fn get_block_by_hash(&self, hash: B256) -> Option { + pub async fn get_block_by_hash(&self, hash: B256) -> Option> { let inner = self.inner.read().await; inner .hashes @@ -85,7 +85,7 @@ impl State { // transaction fetch - pub async fn get_transaction(&self, hash: B256) -> Option { + pub async fn get_transaction(&self, hash: B256) -> Option { let inner = self.inner.read().await; inner .txs @@ -106,7 +106,7 @@ impl State { &self, block_hash: B256, index: u64, - ) -> Option { + ) -> Option { let inner = self.inner.read().await; inner .hashes @@ -153,23 +153,26 @@ impl State { } #[derive(Default)] -struct Inner { - blocks: BTreeMap, - finalized_block: Option, +struct Inner { + blocks: BTreeMap>, + finalized_block: Option>, hashes: HashMap, txs: HashMap, history_length: u64, } -impl Inner { +impl Inner { pub fn new(history_length: u64) -> Self { Self { history_length, - ..Default::default() + blocks: BTreeMap::default(), + finalized_block: None, + hashes: HashMap::default(), + txs: HashMap::default(), } } - pub fn push_block(&mut self, block: Block) { + pub fn push_block(&mut self, block: Block) { self.hashes.insert(block.hash, block.number.to()); block .transactions @@ -193,7 +196,7 @@ impl Inner { } } - pub fn push_finalized_block(&mut self, block: Block) { + pub fn push_finalized_block(&mut self, block: Block) { self.finalized_block = Some(block.clone()); if let Some(old_block) = self.blocks.get(&block.number.to()) { diff --git a/execution/src/types.rs b/core/src/execution/types.rs similarity index 100% rename from execution/src/types.rs rename to core/src/execution/types.rs diff --git a/core/src/lib.rs b/core/src/lib.rs new file mode 100644 index 00000000..bcd61ab6 --- /dev/null +++ b/core/src/lib.rs @@ -0,0 +1,7 @@ +pub mod client; +pub mod consensus; +pub mod errors; +pub mod network_spec; +pub mod types; + +mod execution; diff --git a/core/src/network_spec.rs b/core/src/network_spec.rs new file mode 100644 index 00000000..e77d59e5 --- /dev/null +++ b/core/src/network_spec.rs @@ -0,0 +1,12 @@ +use alloy::{network::Network, rpc::types::Log}; +use revm::primitives::{BlockEnv, TxEnv}; + +use crate::types::Block; + +pub trait NetworkSpec: Network { + fn encode_receipt(receipt: &Self::ReceiptResponse) -> Vec; + fn receipt_contains(list: &[Self::ReceiptResponse], elem: &Self::ReceiptResponse) -> bool; + fn receipt_logs(receipt: &Self::ReceiptResponse) -> Vec; + fn tx_env(request: &Self::TransactionRequest) -> TxEnv; + fn block_env(block: &Block) -> BlockEnv; +} diff --git a/common/src/types.rs b/core/src/types.rs similarity index 87% rename from common/src/types.rs rename to core/src/types.rs index cd349f61..e219bf1b 100644 --- a/common/src/types.rs +++ b/core/src/types.rs @@ -1,12 +1,12 @@ use std::fmt::Display; +use alloy::network::TransactionResponse; use alloy::primitives::{Address, Bytes, B256, U256, U64}; -use alloy::rpc::types::Transaction; use serde::{de::Error, ser::SerializeSeq, Deserialize, Serialize}; #[derive(Deserialize, Serialize, Debug, Clone, Default)] #[serde(rename_all = "camelCase")] -pub struct Block { +pub struct Block { pub number: U64, pub base_fee_per_gas: U256, pub difficulty: U256, @@ -25,7 +25,7 @@ pub struct Block { pub state_root: B256, pub timestamp: U64, pub total_difficulty: U64, - pub transactions: Transactions, + pub transactions: Transactions, pub transactions_root: B256, pub uncles: Vec, pub blob_gas_used: Option, @@ -33,27 +33,27 @@ pub struct Block { } #[derive(Deserialize, Debug, Clone)] -pub enum Transactions { +pub enum Transactions { Hashes(Vec), - Full(Vec), + Full(Vec), } -impl Default for Transactions { +impl Default for Transactions { fn default() -> Self { Self::Full(Vec::new()) } } -impl Transactions { +impl Transactions { pub fn hashes(&self) -> Vec { match self { Self::Hashes(hashes) => hashes.clone(), - Self::Full(txs) => txs.iter().map(|tx| tx.hash).collect(), + Self::Full(txs) => txs.iter().map(|tx| tx.tx_hash()).collect(), } } } -impl Serialize for Transactions { +impl Serialize for Transactions { fn serialize(&self, s: S) -> std::result::Result where S: serde::Serializer, diff --git a/execution/testdata/code.json b/core/testdata/code.json similarity index 100% rename from execution/testdata/code.json rename to core/testdata/code.json diff --git a/execution/testdata/fee_history.json b/core/testdata/fee_history.json similarity index 100% rename from execution/testdata/fee_history.json rename to core/testdata/fee_history.json diff --git a/execution/testdata/logs.json b/core/testdata/logs.json similarity index 100% rename from execution/testdata/logs.json rename to core/testdata/logs.json diff --git a/execution/testdata/proof.json b/core/testdata/proof.json similarity index 100% rename from execution/testdata/proof.json rename to core/testdata/proof.json diff --git a/execution/testdata/receipt.json b/core/testdata/receipt.json similarity index 100% rename from execution/testdata/receipt.json rename to core/testdata/receipt.json diff --git a/execution/testdata/transaction.json b/core/testdata/transaction.json similarity index 100% rename from execution/testdata/transaction.json rename to core/testdata/transaction.json diff --git a/execution/tests/execution.rs b/core/tests/execution.rs similarity index 67% rename from execution/tests/execution.rs rename to core/tests/execution.rs index cadc7f4d..1dd40b14 100644 --- a/execution/tests/execution.rs +++ b/core/tests/execution.rs @@ -1,60 +1,60 @@ -use alloy::primitives::{address, b256, U256, U64}; -use common::types::{Block, BlockTag}; - -use execution::rpc::mock_rpc::MockRpc; -use execution::state::State; -use execution::ExecutionClient; -use tokio::sync::mpsc::channel; -use tokio::sync::watch; - -fn create_state() -> State { - let (_, block_recv) = channel(256); - let (_, finalized_recv) = watch::channel(None); - State::new(block_recv, finalized_recv, 64) -} - -fn create_client(state: State) -> ExecutionClient { - ExecutionClient::new("testdata/", state).unwrap() -} - -#[tokio::test] -async fn test_get_account() { - let state = create_state(); - - let address = address!("14f9D4aF749609c1438528C0Cce1cC3f6D411c47"); - let block = Block { - state_root: b256!("aa02f5db2ee75e3da400d10f3c30e894b6016ce8a2501680380a907b6674ce0d"), - ..Default::default() - }; - - state.push_block(block).await; - let execution = create_client(state); - - let account = execution - .get_account(address, None, BlockTag::Latest) - .await - .unwrap(); - - assert_eq!( - account.balance, - U256::from_str_radix("48c27395000", 16).unwrap() - ); -} - -#[tokio::test] -async fn test_get_account_bad_proof() { - let state = create_state(); - - let address = address!("14f9D4aF749609c1438528C0Cce1cC3f6D411c47"); - let block = Block::default(); - state.push_block(block).await; - - let execution = create_client(state); - let account_res = execution.get_account(address, None, BlockTag::Latest).await; - - assert!(account_res.is_err()); -} - +// use alloy::primitives::{address, b256, U256, U64}; +// use common::types::{Block, BlockTag}; +// +// use execution::rpc::mock_rpc::MockRpc; +// use execution::state::State; +// use execution::ExecutionClient; +// use tokio::sync::mpsc::channel; +// use tokio::sync::watch; +// +// fn create_state() -> State { +// let (_, block_recv) = channel(256); +// let (_, finalized_recv) = watch::channel(None); +// State::new(block_recv, finalized_recv, 64) +// } +// +// fn create_client(state: State) -> ExecutionClient { +// ExecutionClient::new("testdata/", state).unwrap() +// } +// +// #[tokio::test] +// async fn test_get_account() { +// let state = create_state(); +// +// let address = address!("14f9D4aF749609c1438528C0Cce1cC3f6D411c47"); +// let block = Block { +// state_root: b256!("aa02f5db2ee75e3da400d10f3c30e894b6016ce8a2501680380a907b6674ce0d"), +// ..Default::default() +// }; +// +// state.push_block(block).await; +// let execution = create_client(state); +// +// let account = execution +// .get_account(address, None, BlockTag::Latest) +// .await +// .unwrap(); +// +// assert_eq!( +// account.balance, +// U256::from_str_radix("48c27395000", 16).unwrap() +// ); +// } +// +// #[tokio::test] +// async fn test_get_account_bad_proof() { +// let state = create_state(); +// +// let address = address!("14f9D4aF749609c1438528C0Cce1cC3f6D411c47"); +// let block = Block::default(); +// state.push_block(block).await; +// +// let execution = create_client(state); +// let account_res = execution.get_account(address, None, BlockTag::Latest).await; +// +// assert!(account_res.is_err()); +// } +// // #[tokio::test] // async fn test_get_tx() { // let state = create_state(); @@ -73,21 +73,21 @@ async fn test_get_account_bad_proof() { // // assert_eq!(tx.hash(), tx_hash); // } - -#[tokio::test] -async fn test_get_tx_not_included() { - let state = create_state(); - let tx_hash = b256!("2dac1b27ab58b493f902dda8b63979a112398d747f1761c0891777c0983e591f"); - - let block = Block::default(); - state.push_block(block).await; - - let execution = create_client(state); - let tx_res = execution.get_transaction(tx_hash).await; - - assert!(tx_res.is_none()); -} - +// +// #[tokio::test] +// async fn test_get_tx_not_included() { +// let state = create_state(); +// let tx_hash = b256!("2dac1b27ab58b493f902dda8b63979a112398d747f1761c0891777c0983e591f"); +// +// let block = Block::default(); +// state.push_block(block).await; +// +// let execution = create_client(state); +// let tx_res = execution.get_transaction(tx_hash).await; +// +// assert!(tx_res.is_none()); +// } +// // #[tokio::test] // async fn test_get_logs() { // let tx = Transaction::decode(&Rlp::new(&hex::decode("02f8b20583623355849502f900849502f91082ea6094326c977e6efc84e512bb9c30f76e30c160ed06fb80b844a9059cbb0000000000000000000000007daccf9b3c1ae2fa5c55f1c978aeef700bc83be0000000000000000000000000000000000000000000000001158e460913d00000c080a0e1445466b058b6f883c0222f1b1f3e2ad9bee7b5f688813d86e3fa8f93aa868ca0786d6e7f3aefa8fe73857c65c32e4884d8ba38d0ecfb947fbffb82e8ee80c167").unwrap())).unwrap(); @@ -169,32 +169,32 @@ async fn test_get_tx_not_included() { // assert!(receipt_res.is_err()); // } -#[tokio::test] -async fn test_get_receipt_not_included() { - let state = create_state(); - let execution = create_client(state); - let tx_hash = b256!("2dac1b27ab58b493f902dda8b63979a112398d747f1761c0891777c0983e591f"); - let receipt_opt = execution.get_transaction_receipt(tx_hash).await.unwrap(); - - assert!(receipt_opt.is_none()); -} - -#[tokio::test] -async fn test_get_block() { - let block = Block { - number: U64::from(12345), - ..Default::default() - }; - - let state = create_state(); - state.push_block(block).await; - let execution = create_client(state); - - let block = execution.get_block(BlockTag::Latest, false).await.unwrap(); - - assert_eq!(block.number.to::(), 12345); -} - +// #[tokio::test] +// async fn test_get_receipt_not_included() { +// let state = create_state(); +// let execution = create_client(state); +// let tx_hash = b256!("2dac1b27ab58b493f902dda8b63979a112398d747f1761c0891777c0983e591f"); +// let receipt_opt = execution.get_transaction_receipt(tx_hash).await.unwrap(); +// +// assert!(receipt_opt.is_none()); +// } +// +// #[tokio::test] +// async fn test_get_block() { +// let block = Block { +// number: U64::from(12345), +// ..Default::default() +// }; +// +// let state = create_state(); +// state.push_block(block).await; +// let execution = create_client(state); +// +// let block = execution.get_block(BlockTag::Latest, false).await.unwrap(); +// +// assert_eq!(block.number.to::(), 12345); +// } +// // #[tokio::test] // async fn test_get_tx_by_block_hash_and_index() { // let tx = Transaction::decode(&Rlp::new(&hex::decode("02f8b20583623355849502f900849502f91082ea6094326c977e6efc84e512bb9c30f76e30c160ed06fb80b844a9059cbb0000000000000000000000007daccf9b3c1ae2fa5c55f1c978aeef700bc83be0000000000000000000000000000000000000000000000001158e460913d00000c080a0e1445466b058b6f883c0222f1b1f3e2ad9bee7b5f688813d86e3fa8f93aa868ca0786d6e7f3aefa8fe73857c65c32e4884d8ba38d0ecfb947fbffb82e8ee80c167").unwrap())).unwrap(); diff --git a/consensus/Cargo.toml b/ethereum/Cargo.toml similarity index 71% rename from consensus/Cargo.toml rename to ethereum/Cargo.toml index ecae3fd7..d111f773 100644 --- a/consensus/Cargo.toml +++ b/ethereum/Cargo.toml @@ -1,11 +1,17 @@ [package] -name = "consensus" -version = "0.6.0" +name = "helios-ethereum" +version = "0.7.0" edition = "2021" [dependencies] # consensus tree_hash.workspace = true +revm.workspace = true + +# config +figment = { version = "0.10.7", features = ["toml", "env"] } +serde_yaml = "0.9.14" +strum = { version = "0.26.2", features = ["derive"] } # async/futures tokio.workspace = true @@ -28,9 +34,8 @@ superstruct.workspace = true zduny-wasm-timer.workspace = true retri.workspace = true -common = { path = "../common" } -config = { path = "../config" } -consensus-core = { path = "../consensus-core" } +helios-core = { path = "../core" } +helios-consensus-core = { path = "consensus-core" } [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen-futures = "0.4.37" @@ -38,6 +43,7 @@ getrandom = { version = "0.2.1", features = ["js"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] openssl.workspace = true +dirs = "5.0.1" [target.wasm32-unknown-unknown.dependencies] parking_lot = { version = "0.12.2" } diff --git a/consensus-core/Cargo.toml b/ethereum/consensus-core/Cargo.toml similarity index 94% rename from consensus-core/Cargo.toml rename to ethereum/consensus-core/Cargo.toml index 7abc8bfb..aaa24f22 100644 --- a/consensus-core/Cargo.toml +++ b/ethereum/consensus-core/Cargo.toml @@ -1,6 +1,6 @@ [package] -version = "0.6.0" -name = "consensus-core" +version = "0.7.0" +name = "helios-consensus-core" edition = "2021" [dependencies] diff --git a/consensus-core/src/consensus_core.rs b/ethereum/consensus-core/src/consensus_core.rs similarity index 100% rename from consensus-core/src/consensus_core.rs rename to ethereum/consensus-core/src/consensus_core.rs diff --git a/consensus-core/src/errors.rs b/ethereum/consensus-core/src/errors.rs similarity index 100% rename from consensus-core/src/errors.rs rename to ethereum/consensus-core/src/errors.rs diff --git a/consensus-core/src/lib.rs b/ethereum/consensus-core/src/lib.rs similarity index 100% rename from consensus-core/src/lib.rs rename to ethereum/consensus-core/src/lib.rs diff --git a/consensus-core/src/proof.rs b/ethereum/consensus-core/src/proof.rs similarity index 100% rename from consensus-core/src/proof.rs rename to ethereum/consensus-core/src/proof.rs diff --git a/consensus-core/src/types/bls.rs b/ethereum/consensus-core/src/types/bls.rs similarity index 100% rename from consensus-core/src/types/bls.rs rename to ethereum/consensus-core/src/types/bls.rs diff --git a/consensus-core/src/types/bytes.rs b/ethereum/consensus-core/src/types/bytes.rs similarity index 100% rename from consensus-core/src/types/bytes.rs rename to ethereum/consensus-core/src/types/bytes.rs diff --git a/consensus-core/src/types/mod.rs b/ethereum/consensus-core/src/types/mod.rs similarity index 100% rename from consensus-core/src/types/mod.rs rename to ethereum/consensus-core/src/types/mod.rs diff --git a/consensus-core/src/types/serde_utils.rs b/ethereum/consensus-core/src/types/serde_utils.rs similarity index 100% rename from consensus-core/src/types/serde_utils.rs rename to ethereum/consensus-core/src/types/serde_utils.rs diff --git a/consensus-core/src/utils.rs b/ethereum/consensus-core/src/utils.rs similarity index 100% rename from consensus-core/src/utils.rs rename to ethereum/consensus-core/src/utils.rs diff --git a/client/src/client.rs b/ethereum/src/builder.rs similarity index 50% rename from client/src/client.rs rename to ethereum/src/builder.rs index edea7ffd..506b9e28 100644 --- a/client/src/client.rs +++ b/ethereum/src/builder.rs @@ -1,31 +1,24 @@ #[cfg(not(target_arch = "wasm32"))] -use std::net::IpAddr; +use std::net::{IpAddr, SocketAddr}; +#[cfg(not(target_arch = "wasm32"))] +use std::path::PathBuf; use std::sync::Arc; -use std::time::Duration; -use alloy::primitives::{Address, Bytes, B256, U256}; -use alloy::rpc::types::{ - Filter, Log, SyncStatus, Transaction, TransactionReceipt, TransactionRequest, -}; +use alloy::primitives::B256; use eyre::{eyre, Result}; -use tracing::{info, warn}; -use zduny_wasm_timer::Delay; - -use common::types::{Block, BlockTag}; -use config::networks::Network; -use config::Config; -use consensus::database::Database; -use crate::node::Node; +use helios_core::client::Client; -#[cfg(not(target_arch = "wasm32"))] -use std::path::PathBuf; - -#[cfg(not(target_arch = "wasm32"))] -use crate::rpc::Rpc; +use crate::config::networks::Network; +use crate::config::Config; +use crate::consensus::ConsensusClient; +use crate::database::Database; +use crate::rpc::http_rpc::HttpRpc; +use crate::spec::Ethereum; +use crate::EthereumClient; #[derive(Default)] -pub struct ClientBuilder { +pub struct EthereumClientBuilder { network: Option, consensus_rpc: Option, execution_rpc: Option, @@ -42,7 +35,7 @@ pub struct ClientBuilder { strict_checkpoint_age: bool, } -impl ClientBuilder { +impl EthereumClientBuilder { pub fn new() -> Self { Self::default() } @@ -105,7 +98,7 @@ impl ClientBuilder { self } - pub fn build(self) -> Result> { + pub fn build(self) -> Result> { let base_config = if let Some(network) = self.network { network.to_base_config() } else { @@ -152,7 +145,7 @@ impl ClientBuilder { } else if let Some(config) = &self.config { config.rpc_bind_ip } else { - None + Some(base_config.rpc_bind_ip) }; #[cfg(not(target_arch = "wasm32"))] @@ -219,182 +212,21 @@ impl ClientBuilder { database_type: None, }; - Client::::new(config) - } -} - -pub struct Client { - node: Arc>, - #[cfg(not(target_arch = "wasm32"))] - rpc: Option>, -} - -impl Client { - fn new(config: Config) -> Result { - let config = Arc::new(config); - let node = Node::new(config.clone())?; - let node = Arc::new(node); - #[cfg(not(target_arch = "wasm32"))] - let mut rpc: Option> = None; + let socket = if rpc_bind_ip.is_some() && rpc_port.is_some() { + Some(SocketAddr::new(rpc_bind_ip.unwrap(), rpc_port.unwrap())) + } else { + None + }; - #[cfg(not(target_arch = "wasm32"))] - if config.rpc_bind_ip.is_some() || config.rpc_port.is_some() { - rpc = Some(Rpc::new(node.clone(), config.rpc_bind_ip, config.rpc_port)); - } + let config = Arc::new(config); + let consensus = ConsensusClient::new(&config.consensus_rpc, config.clone())?; - Ok(Client { - node, + Client::>::new( + &config.execution_rpc.clone(), + consensus, #[cfg(not(target_arch = "wasm32"))] - rpc, - }) - } - - pub async fn start(&mut self) -> Result<()> { - #[cfg(not(target_arch = "wasm32"))] - if let Some(rpc) = &mut self.rpc { - rpc.start().await?; - } - - Ok(()) - } - - pub async fn shutdown(&self) { - info!(target: "helios::client","shutting down"); - if let Err(err) = self.node.consensus.shutdown() { - warn!(target: "helios::client", error = %err, "graceful shutdown failed"); - } - } - - pub async fn call(&self, tx: &TransactionRequest, block: BlockTag) -> Result { - self.node.call(tx, block).await.map_err(|err| err.into()) - } - - pub async fn estimate_gas(&self, tx: &TransactionRequest) -> Result { - self.node.estimate_gas(tx).await.map_err(|err| err.into()) - } - - pub async fn get_balance(&self, address: Address, block: BlockTag) -> Result { - self.node.get_balance(address, block).await - } - - pub async fn get_nonce(&self, address: Address, block: BlockTag) -> Result { - self.node.get_nonce(address, block).await - } - - pub async fn get_block_transaction_count_by_hash(&self, hash: B256) -> Result { - self.node.get_block_transaction_count_by_hash(hash).await - } - - pub async fn get_block_transaction_count_by_number(&self, block: BlockTag) -> Result { - self.node.get_block_transaction_count_by_number(block).await - } - - pub async fn get_code(&self, address: Address, block: BlockTag) -> Result { - self.node.get_code(address, block).await - } - - pub async fn get_storage_at( - &self, - address: Address, - slot: B256, - block: BlockTag, - ) -> Result { - self.node.get_storage_at(address, slot, block).await - } - - pub async fn send_raw_transaction(&self, bytes: &[u8]) -> Result { - self.node.send_raw_transaction(bytes).await - } - - pub async fn get_transaction_receipt( - &self, - tx_hash: B256, - ) -> Result> { - self.node.get_transaction_receipt(tx_hash).await - } - - pub async fn get_transaction_by_hash(&self, tx_hash: B256) -> Option { - self.node.get_transaction_by_hash(tx_hash).await - } - - pub async fn get_logs(&self, filter: &Filter) -> Result> { - self.node.get_logs(filter).await - } - - pub async fn get_filter_changes(&self, filter_id: U256) -> Result { - self.node.uninstall_filter(filter_id).await - } - - pub async fn uninstall_filter(&self, filter_id: U256) -> Result { - self.node.uninstall_filter(filter_id).await - } - - pub async fn get_new_filter(&self, filter: &Filter) -> Result { - self.node.get_new_filter(filter).await - } - - pub async fn get_new_block_filter(&self) -> Result { - self.node.get_new_block_filter().await - } - - pub async fn get_new_pending_transaction_filter(&self) -> Result { - self.node.get_new_pending_transaction_filter().await - } - - pub async fn get_gas_price(&self) -> Result { - self.node.get_gas_price().await - } - - pub async fn get_priority_fee(&self) -> Result { - self.node.get_priority_fee() - } - - pub async fn get_block_number(&self) -> Result { - self.node.get_block_number().await - } - - pub async fn get_block_by_number( - &self, - block: BlockTag, - full_tx: bool, - ) -> Result> { - self.node.get_block_by_number(block, full_tx).await - } - - pub async fn get_block_by_hash(&self, hash: B256, full_tx: bool) -> Result> { - self.node.get_block_by_hash(hash, full_tx).await - } - - pub async fn get_transaction_by_block_hash_and_index( - &self, - block_hash: B256, - index: u64, - ) -> Option { - self.node - .get_transaction_by_block_hash_and_index(block_hash, index) - .await - } - - pub async fn chain_id(&self) -> u64 { - self.node.chain_id() - } - - pub async fn syncing(&self) -> Result { - self.node.syncing().await - } - - pub async fn get_coinbase(&self) -> Result
{ - self.node.get_coinbase().await - } - - pub async fn wait_synced(&self) { - loop { - if let Ok(SyncStatus::None) = self.syncing().await { - break; - } - - Delay::new(Duration::from_millis(100)).await.unwrap(); - } + socket, + ) } } diff --git a/config/src/base.rs b/ethereum/src/config/base.rs similarity index 92% rename from config/src/base.rs rename to ethereum/src/config/base.rs index 50bf541e..f8491f48 100644 --- a/config/src/base.rs +++ b/ethereum/src/config/base.rs @@ -5,8 +5,9 @@ use std::path::PathBuf; use alloy::primitives::B256; use serde::Serialize; -use crate::types::ChainConfig; -use consensus_core::types::Forks; +use helios_consensus_core::types::Forks; + +use crate::config::types::ChainConfig; /// The base configuration for a network. #[derive(Serialize)] diff --git a/config/src/checkpoints.rs b/ethereum/src/config/checkpoints.rs similarity index 95% rename from config/src/checkpoints.rs rename to ethereum/src/config/checkpoints.rs index f8e659fc..dac2b5cc 100644 --- a/config/src/checkpoints.rs +++ b/ethereum/src/config/checkpoints.rs @@ -1,14 +1,15 @@ -use std::collections::HashMap; +use std::{collections::HashMap, time::Duration}; use alloy::primitives::B256; use eyre::Result; +use reqwest::ClientBuilder; use retri::{retry, BackoffSettings}; use serde::{ de::{self, Error}, Deserialize, Serialize, }; -use crate::networks; +use crate::config::networks; /// The location where the list of checkpoint services are stored. pub const CHECKPOINT_SYNC_SERVICES_LIST: &str = "https://raw.githubusercontent.com/ethpandaops/checkpoint-sync-health-checks/master/_data/endpoints.yaml"; @@ -81,7 +82,13 @@ pub struct CheckpointFallback { async fn get(req: &str) -> Result { retry( - || async { Ok::<_, eyre::Report>(reqwest::get(req).await?) }, + || async { + let client = ClientBuilder::new() + .timeout(Duration::from_secs(1)) + .build() + .unwrap(); + Ok::<_, eyre::Report>(client.get(req).send().await?) + }, BackoffSettings::default(), ) .await @@ -133,7 +140,7 @@ impl CheckpointFallback { /// Fetch the latest checkpoint from the checkpoint fallback service. pub async fn fetch_latest_checkpoint( &self, - network: &crate::networks::Network, + network: &crate::config::networks::Network, ) -> eyre::Result { let services = &self.get_healthy_fallback_services(network); Self::fetch_latest_checkpoint_from_services(&services[..]).await @@ -229,7 +236,7 @@ impl CheckpointFallback { /// This is an associated function and can be used like so: /// /// ```rust - /// use config::CheckpointFallback; + /// use helios_ethereum::config::checkpoints::CheckpointFallback; /// /// let url = CheckpointFallback::construct_url("https://sync-mainnet.beaconcha.in"); /// assert_eq!("https://sync-mainnet.beaconcha.in/checkpointz/v1/beacon/slots", url); diff --git a/config/src/cli.rs b/ethereum/src/config/cli.rs similarity index 100% rename from config/src/cli.rs rename to ethereum/src/config/cli.rs diff --git a/config/src/config.rs b/ethereum/src/config/mod.rs similarity index 92% rename from config/src/config.rs rename to ethereum/src/config/mod.rs index 250365b4..f95350dd 100644 --- a/config/src/config.rs +++ b/ethereum/src/config/mod.rs @@ -9,12 +9,19 @@ use figment::{ }; use serde::Deserialize; -use consensus_core::types::Forks; +use helios_consensus_core::types::Forks; -use crate::base::BaseConfig; -use crate::cli::CliConfig; -use crate::types::ChainConfig; -use crate::Network; +use self::base::BaseConfig; +use self::cli::CliConfig; +use self::networks::Network; +use self::types::ChainConfig; + +pub mod checkpoints; +pub mod cli; +pub mod networks; + +mod base; +mod types; #[derive(Deserialize, Debug, Default)] pub struct Config { diff --git a/config/src/networks.rs b/ethereum/src/config/networks.rs similarity index 98% rename from config/src/networks.rs rename to ethereum/src/config/networks.rs index e103e032..05f7c21c 100644 --- a/config/src/networks.rs +++ b/ethereum/src/config/networks.rs @@ -10,10 +10,10 @@ use eyre::Result; use serde::{Deserialize, Serialize}; use strum::EnumIter; -use consensus_core::types::{Fork, Forks}; +use helios_consensus_core::types::{Fork, Forks}; -use crate::base::BaseConfig; -use crate::types::ChainConfig; +use crate::config::base::BaseConfig; +use crate::config::types::ChainConfig; #[derive( Debug, Clone, Copy, Serialize, Deserialize, EnumIter, Hash, Eq, PartialEq, PartialOrd, Ord, diff --git a/config/src/types.rs b/ethereum/src/config/types.rs similarity index 100% rename from config/src/types.rs rename to ethereum/src/config/types.rs diff --git a/consensus/src/consensus.rs b/ethereum/src/consensus.rs similarity index 95% rename from consensus/src/consensus.rs rename to ethereum/src/consensus.rs index 08e96d0c..aeb473c9 100644 --- a/consensus/src/consensus.rs +++ b/ethereum/src/consensus.rs @@ -19,16 +19,7 @@ use tokio::sync::mpsc::Receiver; use tokio::sync::mpsc::Sender; use tokio::sync::watch; -use common::types::{Block, Transactions}; -use config::CheckpointFallback; -use config::Config; -use config::Network; - -use super::rpc::ConsensusRpc; -use crate::constants::MAX_REQUEST_LIGHT_CLIENT_UPDATES; -use crate::database::Database; - -use consensus_core::{ +use helios_consensus_core::{ apply_bootstrap, apply_finality_update, apply_optimistic_update, apply_update, calc_sync_period, errors::ConsensusError, @@ -36,13 +27,23 @@ use consensus_core::{ types::{ExecutionPayload, FinalityUpdate, LightClientStore, OptimisticUpdate, Update}, verify_bootstrap, verify_finality_update, verify_optimistic_update, verify_update, }; +use helios_core::consensus::Consensus; +use helios_core::types::{Block, Transactions}; + +use crate::config::checkpoints::CheckpointFallback; +use crate::config::networks::Network; +use crate::config::Config; +use crate::constants::MAX_REQUEST_LIGHT_CLIENT_UPDATES; +use crate::database::Database; +use crate::rpc::ConsensusRpc; pub struct ConsensusClient { - pub block_recv: Option>, - pub finalized_block_recv: Option>>, + pub block_recv: Option>>, + pub finalized_block_recv: Option>>>, pub checkpoint_recv: watch::Receiver>, genesis_time: u64, db: DB, + config: Arc, phantom: PhantomData, } @@ -51,18 +52,46 @@ pub struct Inner { pub rpc: R, pub store: LightClientStore, last_checkpoint: Option, - block_send: Sender, - finalized_block_send: watch::Sender>, + block_send: Sender>, + finalized_block_send: watch::Sender>>, checkpoint_send: watch::Sender>, pub config: Arc, } +impl Consensus for ConsensusClient { + fn block_recv(&mut self) -> Option>> { + self.block_recv.take() + } + + fn finalized_block_recv(&mut self) -> Option>>> { + self.finalized_block_recv.take() + } + + fn expected_highest_block(&self) -> u64 { + u64::MAX + } + + fn chain_id(&self) -> u64 { + self.config.chain.chain_id + } + + fn shutdown(&self) -> Result<()> { + let checkpoint = self.checkpoint_recv.borrow(); + if let Some(checkpoint) = checkpoint.as_ref() { + self.db.save_checkpoint(*checkpoint)?; + } + + Ok(()) + } +} + impl ConsensusClient { pub fn new(rpc: &str, config: Arc) -> Result> { let (block_send, block_recv) = channel(256); let (finalized_block_send, finalized_block_recv) = watch::channel(None); let (checkpoint_send, checkpoint_recv) = watch::channel(None); + let config_clone = config.clone(); let rpc = rpc.to_string(); let genesis_time = config.chain.genesis_time; let db = DB::new(&config)?; @@ -132,19 +161,11 @@ impl ConsensusClient { checkpoint_recv, genesis_time, db, + config: config_clone, phantom: PhantomData, }) } - pub fn shutdown(&self) -> Result<()> { - let checkpoint = self.checkpoint_recv.borrow(); - if let Some(checkpoint) = checkpoint.as_ref() { - self.db.save_checkpoint(*checkpoint)?; - } - - Ok(()) - } - pub fn expected_current_slot(&self) -> u64 { let now = SystemTime::now(); @@ -171,8 +192,8 @@ async fn sync_all_fallbacks(inner: &mut Inner, chain_id: u64 impl Inner { pub fn new( rpc: &str, - block_send: Sender, - finalized_block_send: watch::Sender>, + block_send: Sender>, + finalized_block_send: watch::Sender>>, checkpoint_send: watch::Sender>, config: Arc, ) -> Inner { @@ -499,7 +520,7 @@ impl Inner { } } -fn payload_to_block(value: ExecutionPayload) -> Block { +fn payload_to_block(value: ExecutionPayload) -> Block { let empty_nonce = "0x0000000000000000".to_string(); let empty_uncle_hash = b256!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"); @@ -634,18 +655,22 @@ fn gas_price(max_fee: u128, max_prio_fee: u128, base_fee: u128) -> u128 { mod tests { use std::sync::Arc; + use alloy::primitives::b256; + use tokio::sync::{mpsc::channel, watch}; + + use helios_consensus_core::errors::ConsensusError; + use helios_consensus_core::types::{ + bls::{PublicKey, Signature}, + Header, + }; + use crate::{ + config::{networks, Config}, consensus::calc_sync_period, + consensus::Inner, constants::MAX_REQUEST_LIGHT_CLIENT_UPDATES, rpc::{mock_rpc::MockRpc, ConsensusRpc}, - Inner, }; - use alloy::primitives::b256; - use consensus_core::types::bls::{PublicKey, Signature}; - use consensus_core::{errors::ConsensusError, types::LightClientHeader}; - - use config::{networks, Config}; - use tokio::sync::{mpsc::channel, watch}; async fn get_client(strict_checkpoint_age: bool, sync: bool) -> Inner { let base_config = networks::mainnet(); diff --git a/consensus/src/constants.rs b/ethereum/src/constants.rs similarity index 100% rename from consensus/src/constants.rs rename to ethereum/src/constants.rs diff --git a/consensus/src/database.rs b/ethereum/src/database.rs similarity index 98% rename from consensus/src/database.rs rename to ethereum/src/database.rs index c0dd50d1..3dba3886 100644 --- a/consensus/src/database.rs +++ b/ethereum/src/database.rs @@ -6,9 +6,10 @@ use std::{ }; use alloy::primitives::B256; -use config::Config; use eyre::Result; +use crate::config::Config; + pub trait Database: Clone + Sync + Send + 'static { fn new(config: &Config) -> Result where diff --git a/ethereum/src/lib.rs b/ethereum/src/lib.rs new file mode 100644 index 00000000..3e95d80b --- /dev/null +++ b/ethereum/src/lib.rs @@ -0,0 +1,16 @@ +use consensus::ConsensusClient; +use helios_core::client::Client; +use rpc::http_rpc::HttpRpc; +use spec::Ethereum; + +pub mod builder; +pub mod config; +pub mod consensus; +pub mod database; +pub mod rpc; +pub mod spec; + +mod constants; + +pub use builder::EthereumClientBuilder; +pub type EthereumClient = Client>; diff --git a/consensus/src/rpc/nimbus_rpc.rs b/ethereum/src/rpc/http_rpc.rs similarity index 94% rename from consensus/src/rpc/nimbus_rpc.rs rename to ethereum/src/rpc/http_rpc.rs index 7ecfad81..7bed839e 100644 --- a/consensus/src/rpc/nimbus_rpc.rs +++ b/ethereum/src/rpc/http_rpc.rs @@ -6,13 +6,16 @@ use eyre::Result; use retri::{retry, BackoffSettings}; use serde::de::DeserializeOwned; +use helios_consensus_core::types::{ + BeaconBlock, Bootstrap, FinalityUpdate, OptimisticUpdate, Update, +}; +use helios_core::errors::RpcError; + use super::ConsensusRpc; use crate::constants::MAX_REQUEST_LIGHT_CLIENT_UPDATES; -use common::errors::RpcError; -use consensus_core::types::{BeaconBlock, Bootstrap, FinalityUpdate, OptimisticUpdate, Update}; #[derive(Debug)] -pub struct NimbusRpc { +pub struct HttpRpc { rpc: String, } @@ -28,9 +31,9 @@ async fn get(req: &str) -> Result { #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] -impl ConsensusRpc for NimbusRpc { +impl ConsensusRpc for HttpRpc { fn new(rpc: &str) -> Self { - NimbusRpc { + HttpRpc { rpc: rpc.to_string(), } } diff --git a/consensus/src/rpc/mock_rpc.rs b/ethereum/src/rpc/mock_rpc.rs similarity index 95% rename from consensus/src/rpc/mock_rpc.rs rename to ethereum/src/rpc/mock_rpc.rs index b0a56ff7..4fa38282 100644 --- a/consensus/src/rpc/mock_rpc.rs +++ b/ethereum/src/rpc/mock_rpc.rs @@ -4,7 +4,9 @@ use alloy::primitives::B256; use async_trait::async_trait; use eyre::Result; -use consensus_core::types::{BeaconBlock, Bootstrap, FinalityUpdate, OptimisticUpdate, Update}; +use helios_consensus_core::types::{ + BeaconBlock, Bootstrap, FinalityUpdate, OptimisticUpdate, Update, +}; use super::ConsensusRpc; diff --git a/consensus/src/rpc/mod.rs b/ethereum/src/rpc/mod.rs similarity index 78% rename from consensus/src/rpc/mod.rs rename to ethereum/src/rpc/mod.rs index 6e8aa08d..09d190b9 100644 --- a/consensus/src/rpc/mod.rs +++ b/ethereum/src/rpc/mod.rs @@ -1,15 +1,17 @@ +pub mod http_rpc; pub mod mock_rpc; -pub mod nimbus_rpc; use alloy::primitives::B256; use async_trait::async_trait; use eyre::Result; -use consensus_core::types::{BeaconBlock, Bootstrap, FinalityUpdate, OptimisticUpdate, Update}; +use helios_consensus_core::types::{ + BeaconBlock, Bootstrap, FinalityUpdate, OptimisticUpdate, Update, +}; #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] -pub trait ConsensusRpc: Send + Sync { +pub trait ConsensusRpc: Send + Sync + 'static { fn new(path: &str) -> Self; async fn get_bootstrap(&self, checkpoint: B256) -> Result; async fn get_updates(&self, period: u64, count: u8) -> Result>; diff --git a/ethereum/src/spec.rs b/ethereum/src/spec.rs new file mode 100644 index 00000000..cb0f45d0 --- /dev/null +++ b/ethereum/src/spec.rs @@ -0,0 +1,292 @@ +use alloy::{ + consensus::{ + BlobTransactionSidecar, Receipt, ReceiptWithBloom, TxReceipt, TxType, TypedTransaction, + }, + network::{BuildResult, Network, NetworkWallet, TransactionBuilder, TransactionBuilderError}, + primitives::{Address, Bytes, ChainId, TxKind, U256}, + rpc::types::{AccessList, Log, TransactionRequest}, +}; +use revm::primitives::{BlobExcessGasAndPrice, BlockEnv, TxEnv}; + +use helios_core::{network_spec::NetworkSpec, types::Block}; + +#[derive(Clone, Copy, Debug)] +pub struct Ethereum; + +impl NetworkSpec for Ethereum { + fn encode_receipt(receipt: &Self::ReceiptResponse) -> Vec { + let tx_type = receipt.transaction_type(); + let receipt = receipt.inner.as_receipt_with_bloom().unwrap(); + let logs = receipt + .logs() + .iter() + .map(|l| l.inner.clone()) + .collect::>(); + + let consensus_receipt = Receipt { + cumulative_gas_used: receipt.cumulative_gas_used(), + status: *receipt.status_or_post_state(), + logs, + }; + + let rwb = ReceiptWithBloom::new(consensus_receipt, receipt.bloom()); + let encoded = alloy::rlp::encode(rwb); + + match tx_type { + TxType::Legacy => encoded, + _ => [vec![tx_type as u8], encoded].concat(), + } + } + + fn receipt_contains(list: &[Self::ReceiptResponse], elem: &Self::ReceiptResponse) -> bool { + for receipt in list { + if receipt == elem { + return true; + } + } + + false + } + + fn receipt_logs(receipt: &Self::ReceiptResponse) -> Vec { + receipt.inner.logs().to_vec() + } + + fn tx_env(tx: &Self::TransactionRequest) -> TxEnv { + let mut tx_env = TxEnv::default(); + tx_env.caller = tx.from.unwrap_or_default(); + tx_env.gas_limit = >::gas_limit(tx) + .map(|v| v as u64) + .unwrap_or(u64::MAX); + tx_env.gas_price = >::gas_price(tx) + .map(U256::from) + .unwrap_or_default(); + tx_env.transact_to = tx.to.unwrap_or_default(); + tx_env.value = tx.value.unwrap_or_default(); + tx_env.data = >::input(tx) + .unwrap_or_default() + .clone(); + tx_env.nonce = >::nonce(tx); + tx_env.chain_id = >::chain_id(tx); + tx_env.access_list = >::access_list(tx) + .map(|v| v.to_vec()) + .unwrap_or_default(); + tx_env.gas_priority_fee = + >::max_priority_fee_per_gas(tx) + .map(U256::from); + tx_env.max_fee_per_blob_gas = + >::max_fee_per_gas(tx).map(U256::from); + tx_env.blob_hashes = tx + .blob_versioned_hashes + .as_ref() + .map(|v| v.to_vec()) + .unwrap_or_default(); + + tx_env + } + + fn block_env(block: &Block) -> BlockEnv { + let mut block_env = BlockEnv::default(); + block_env.number = block.number.to(); + block_env.coinbase = block.miner; + block_env.timestamp = block.timestamp.to(); + block_env.gas_limit = block.gas_limit.to(); + block_env.basefee = block.base_fee_per_gas; + block_env.difficulty = block.difficulty; + block_env.prevrandao = Some(block.mix_hash); + block_env.blob_excess_gas_and_price = block + .excess_blob_gas + .map(|v| BlobExcessGasAndPrice::new(v.to())); + + block_env + } +} + +impl Network for Ethereum { + type TxType = alloy::consensus::TxType; + type TxEnvelope = alloy::consensus::TxEnvelope; + type UnsignedTx = alloy::consensus::TypedTransaction; + type ReceiptEnvelope = alloy::consensus::ReceiptEnvelope; + type Header = alloy::consensus::Header; + type TransactionRequest = alloy::rpc::types::TransactionRequest; + type TransactionResponse = alloy::rpc::types::Transaction; + type ReceiptResponse = alloy::rpc::types::TransactionReceipt; + type HeaderResponse = alloy::rpc::types::Header; +} + +impl TransactionBuilder for TransactionRequest { + fn chain_id(&self) -> Option { + self.chain_id + } + + fn set_chain_id(&mut self, chain_id: ChainId) { + self.chain_id = Some(chain_id); + } + + fn nonce(&self) -> Option { + self.nonce + } + + fn set_nonce(&mut self, nonce: u64) { + self.nonce = Some(nonce); + } + + fn input(&self) -> Option<&Bytes> { + self.input.input() + } + + fn set_input>(&mut self, input: T) { + self.input.input = Some(input.into()); + } + + fn from(&self) -> Option
{ + self.from + } + + fn set_from(&mut self, from: Address) { + self.from = Some(from); + } + + fn kind(&self) -> Option { + self.to + } + + fn clear_kind(&mut self) { + self.to = None; + } + + fn set_kind(&mut self, kind: TxKind) { + self.to = Some(kind); + } + + fn value(&self) -> Option { + self.value + } + + fn set_value(&mut self, value: U256) { + self.value = Some(value) + } + + fn gas_price(&self) -> Option { + self.gas_price + } + + fn set_gas_price(&mut self, gas_price: u128) { + self.gas_price = Some(gas_price); + } + + fn max_fee_per_gas(&self) -> Option { + self.max_fee_per_gas + } + + fn set_max_fee_per_gas(&mut self, max_fee_per_gas: u128) { + self.max_fee_per_gas = Some(max_fee_per_gas); + } + + fn max_priority_fee_per_gas(&self) -> Option { + self.max_priority_fee_per_gas + } + + fn set_max_priority_fee_per_gas(&mut self, max_priority_fee_per_gas: u128) { + self.max_priority_fee_per_gas = Some(max_priority_fee_per_gas); + } + + fn max_fee_per_blob_gas(&self) -> Option { + self.max_fee_per_blob_gas + } + + fn set_max_fee_per_blob_gas(&mut self, max_fee_per_blob_gas: u128) { + self.max_fee_per_blob_gas = Some(max_fee_per_blob_gas) + } + + fn gas_limit(&self) -> Option { + self.gas + } + + fn set_gas_limit(&mut self, gas_limit: u128) { + self.gas = Some(gas_limit); + } + + fn access_list(&self) -> Option<&AccessList> { + self.access_list.as_ref() + } + + fn set_access_list(&mut self, access_list: AccessList) { + self.access_list = Some(access_list); + } + + fn blob_sidecar(&self) -> Option<&BlobTransactionSidecar> { + self.sidecar.as_ref() + } + + fn set_blob_sidecar(&mut self, sidecar: BlobTransactionSidecar) { + self.sidecar = Some(sidecar); + self.populate_blob_hashes(); + } + + fn complete_type(&self, ty: TxType) -> Result<(), Vec<&'static str>> { + match ty { + TxType::Legacy => self.complete_legacy(), + TxType::Eip2930 => self.complete_2930(), + TxType::Eip1559 => self.complete_1559(), + TxType::Eip4844 => self.complete_4844(), + } + } + + fn can_submit(&self) -> bool { + // value and data may be None. If they are, they will be set to default. + // gas fields and nonce may be None, if they are, they will be populated + // with default values by the RPC server + self.from.is_some() + } + + fn can_build(&self) -> bool { + // value and data may be none. If they are, they will be set to default + // values. + + // chain_id and from may be none. + let common = self.gas.is_some() && self.nonce.is_some(); + + let legacy = self.gas_price.is_some(); + let eip2930 = legacy + && >::access_list(self).is_some(); + + let eip1559 = self.max_fee_per_gas.is_some() && self.max_priority_fee_per_gas.is_some(); + + let eip4844 = eip1559 && self.sidecar.is_some() && self.to.is_some(); + common && (legacy || eip2930 || eip1559 || eip4844) + } + + #[doc(alias = "output_transaction_type")] + fn output_tx_type(&self) -> TxType { + self.preferred_type() + } + + #[doc(alias = "output_transaction_type_checked")] + fn output_tx_type_checked(&self) -> Option { + self.buildable_type() + } + + fn prep_for_submission(&mut self) { + self.transaction_type = Some(self.preferred_type() as u8); + self.trim_conflicting_keys(); + self.populate_blob_hashes(); + } + + fn build_unsigned(self) -> BuildResult { + if let Err((tx_type, missing)) = self.missing_keys() { + return Err( + TransactionBuilderError::InvalidTransactionRequest(tx_type, missing) + .into_unbuilt(self), + ); + } + Ok(self.build_typed_tx().expect("checked by missing_keys")) + } + + async fn build>( + self, + wallet: &W, + ) -> Result<::TxEnvelope, TransactionBuilderError> { + Ok(wallet.sign_request(self).await?) + } +} diff --git a/consensus/testdata/blocks/7109344.json b/ethereum/testdata/blocks/7109344.json similarity index 100% rename from consensus/testdata/blocks/7109344.json rename to ethereum/testdata/blocks/7109344.json diff --git a/consensus/testdata/blocks/7109431.json b/ethereum/testdata/blocks/7109431.json similarity index 100% rename from consensus/testdata/blocks/7109431.json rename to ethereum/testdata/blocks/7109431.json diff --git a/consensus/testdata/bootstrap.json b/ethereum/testdata/bootstrap.json similarity index 100% rename from consensus/testdata/bootstrap.json rename to ethereum/testdata/bootstrap.json diff --git a/consensus/testdata/finality.json b/ethereum/testdata/finality.json similarity index 100% rename from consensus/testdata/finality.json rename to ethereum/testdata/finality.json diff --git a/consensus/testdata/optimistic.json b/ethereum/testdata/optimistic.json similarity index 100% rename from consensus/testdata/optimistic.json rename to ethereum/testdata/optimistic.json diff --git a/consensus/testdata/updates.json b/ethereum/testdata/updates.json similarity index 100% rename from consensus/testdata/updates.json rename to ethereum/testdata/updates.json diff --git a/config/tests/checkpoints.rs b/ethereum/tests/checkpoints.rs similarity index 89% rename from config/tests/checkpoints.rs rename to ethereum/tests/checkpoints.rs index 3742a7ae..0e08f410 100644 --- a/config/tests/checkpoints.rs +++ b/ethereum/tests/checkpoints.rs @@ -1,9 +1,9 @@ use alloy::primitives::B256; -use config::networks; +use helios_ethereum::config::{checkpoints, networks}; #[tokio::test] async fn test_checkpoint_fallback() { - let cf = config::checkpoints::CheckpointFallback::new(); + let cf = checkpoints::CheckpointFallback::new(); assert_eq!(cf.services.get(&networks::Network::MAINNET), None); assert_eq!(cf.services.get(&networks::Network::GOERLI), None); @@ -24,7 +24,7 @@ async fn test_checkpoint_fallback() { #[tokio::test] async fn test_construct_checkpoints() { - let cf = config::checkpoints::CheckpointFallback::new() + let cf = checkpoints::CheckpointFallback::new() .build() .await .unwrap(); @@ -37,7 +37,7 @@ async fn test_construct_checkpoints() { #[tokio::test] async fn test_fetch_latest_checkpoints() { - let cf = config::checkpoints::CheckpointFallback::new() + let cf = checkpoints::CheckpointFallback::new() .build() .await .unwrap(); @@ -60,7 +60,7 @@ async fn test_fetch_latest_checkpoints() { #[tokio::test] async fn test_get_all_fallback_endpoints() { - let cf = config::checkpoints::CheckpointFallback::new() + let cf = checkpoints::CheckpointFallback::new() .build() .await .unwrap(); @@ -76,7 +76,7 @@ async fn test_get_all_fallback_endpoints() { #[tokio::test] async fn test_get_healthy_fallback_endpoints() { - let cf = config::checkpoints::CheckpointFallback::new() + let cf = checkpoints::CheckpointFallback::new() .build() .await .unwrap(); diff --git a/consensus/tests/sync.rs b/ethereum/tests/sync.rs similarity index 84% rename from consensus/tests/sync.rs rename to ethereum/tests/sync.rs index 7d6755b3..e7a184d8 100644 --- a/consensus/tests/sync.rs +++ b/ethereum/tests/sync.rs @@ -1,8 +1,8 @@ use std::sync::Arc; use alloy::primitives::b256; -use config::{networks, Config}; -use consensus::{database::ConfigDB, rpc::mock_rpc::MockRpc, ConsensusClient}; +use helios_ethereum::config::{networks, Config}; +use helios_ethereum::{consensus::ConsensusClient, database::ConfigDB, rpc::mock_rpc::MockRpc}; async fn setup() -> ConsensusClient { let base_config = networks::mainnet(); diff --git a/examples/basic.rs b/examples/basic.rs index 6d2cbf7c..00d0a3c7 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -6,7 +6,10 @@ use tracing::info; use tracing_subscriber::filter::{EnvFilter, LevelFilter}; use tracing_subscriber::FmtSubscriber; -use helios::{config::networks::Network, prelude::*}; +use helios::core::types::BlockTag; +use helios::ethereum::{ + config::networks::Network, database::FileDB, EthereumClient, EthereumClientBuilder, +}; #[tokio::main] async fn main() -> Result<()> { @@ -27,7 +30,7 @@ async fn main() -> Result<()> { let consensus_rpc = "https://www.lightclientdata.org"; info!("Using consensus RPC URL: {}", consensus_rpc); - let mut client: Client = ClientBuilder::new() + let mut client: EthereumClient = EthereumClientBuilder::new() .network(Network::MAINNET) .consensus_rpc(consensus_rpc) .execution_rpc(untrusted_rpc_url) diff --git a/examples/call.rs b/examples/call.rs index 9e0023b7..2a2e5e87 100644 --- a/examples/call.rs +++ b/examples/call.rs @@ -9,10 +9,9 @@ use tracing::info; use tracing_subscriber::filter::{EnvFilter, LevelFilter}; use tracing_subscriber::FmtSubscriber; -use helios::{ - client::{Client, ClientBuilder, FileDB}, - config::networks::Network, - types::BlockTag, +use helios::core::types::BlockTag; +use helios::ethereum::{ + config::networks::Network, database::FileDB, EthereumClient, EthereumClientBuilder, }; #[tokio::main] @@ -36,7 +35,7 @@ async fn main() -> eyre::Result<()> { // Construct the client let data_dir = PathBuf::from("/tmp/helios"); - let mut client: Client = ClientBuilder::new() + let mut client: EthereumClient = EthereumClientBuilder::new() .network(Network::MAINNET) .data_dir(data_dir) .consensus_rpc(consensus_rpc) diff --git a/examples/checkpoints.rs b/examples/checkpoints.rs index 84146ba5..0b4a593f 100644 --- a/examples/checkpoints.rs +++ b/examples/checkpoints.rs @@ -1,7 +1,7 @@ use eyre::Result; // From helios::config -use config::{checkpoints, networks}; +use helios::ethereum::config::{checkpoints, networks}; #[tokio::main] async fn main() -> Result<()> { diff --git a/examples/client.rs b/examples/client.rs index 61e194e3..0039290f 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -3,15 +3,17 @@ use std::path::PathBuf; use alloy::primitives::b256; use eyre::Result; -use helios::prelude::*; +use helios::ethereum::{ + config::networks::Network, database::FileDB, EthereumClient, EthereumClientBuilder, +}; #[tokio::main] async fn main() -> Result<()> { // Create a new Helios Client Builder - let mut builder = ClientBuilder::new(); + let mut builder = EthereumClientBuilder::new(); // Set the network to mainnet - builder = builder.network(networks::Network::MAINNET); + builder = builder.network(Network::MAINNET); // Set the consensus rpc url builder = builder.consensus_rpc("https://www.lightclientdata.org"); @@ -37,7 +39,7 @@ async fn main() -> Result<()> { builder = builder.load_external_fallback(); // Build the client - let _client: Client = builder.build().unwrap(); + let _client: EthereumClient = builder.build().unwrap(); println!("Constructed client!"); Ok(()) diff --git a/examples/config.rs b/examples/config.rs index 2a9245ad..7068b351 100644 --- a/examples/config.rs +++ b/examples/config.rs @@ -1,8 +1,7 @@ use dirs::home_dir; use eyre::Result; -use config::CliConfig; -use helios::prelude::*; +use helios::ethereum::config::{cli::CliConfig, Config}; #[tokio::main] async fn main() -> Result<()> { diff --git a/execution/src/lib.rs b/execution/src/lib.rs deleted file mode 100644 index e69b079c..00000000 --- a/execution/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -pub mod constants; -pub mod errors; -pub mod evm; -pub mod rpc; -pub mod state; -pub mod types; - -mod execution; -pub use crate::execution::*; - -mod proof; diff --git a/src/lib.rs b/src/lib.rs index ce7a6a2d..90425f4f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,79 +7,19 @@ //! # Ethereum light client written in Rust. //! -//! > helios is a fully trustless, efficient, and portable Ethereum light client written in Rust. +//! > Helios is a fully trustless, efficient, and portable Ethereum light client written in Rust. //! //! Helios converts an untrusted centralized RPC endpoint into a safe unmanipulable local RPC for its users. It syncs in seconds, requires no storage, and is lightweight enough to run on mobile devices. //! -//! The entire size of Helios's binary is 13Mb and should be easy to compile into WebAssembly. This makes it a perfect target to embed directly inside wallets and dapps. +//! The entire size of Helios's binary is 13Mb and compiles into WebAssembly. This makes it a perfect target to embed directly inside wallets and dapps. //! -//! ## Quickstart: `prelude` +//! Examples on how you can use helios can be found in the [`examples` directory of the repository](https://github.com/a16z/helios/tree/master/examples) and in the `tests/` directories of each crate. //! -//! The prelude imports all the necessary data types and traits from helios. Use this to quickly bootstrap a new project. -//! -//! ```no_run -//! # #[allow(unused)] -//! use helios::prelude::*; -//! ``` -//! -//! Examples on how you can use the types imported by the prelude can be found in -//! the [`examples` directory of the repository](https://github.com/a16z/helios/tree/master/examples) -//! and in the `tests/` directories of each crate. -//! -//! ## Breakdown of exported helios modules -//! -//! ### `client` -//! -//! The `client` module exports three main types: `Client`, `ClientBuilder`, and `FileDB`. -//! -//! `ClientBuilder` is a builder for the `Client` type. It allows you to configure the client using the fluent builder pattern. -//! -//! `Client` serves Ethereum RPC endpoints locally that call a node on the backend. -//! -//! Finally, the `FileDB` type is a simple local database. It is used by the `Client` to store checkpoint data. -//! -//! ### `config` -//! -//! The `config` module provides the configuration types for all of helios. It is used by the `ClientBuilder` to configure the `Client`. -//! -//! ### `types` -//! -//! Generic types used across helios. -//! -//! ### `errors` -//! -//! Errors used across helios. - -pub mod client { - pub use client::{Client, ClientBuilder}; - pub use consensus::database::*; -} - -pub mod consensus { - pub use consensus::*; -} -pub mod config { - pub use config::{checkpoints, networks, Config}; +pub mod core { + pub use helios_core::*; } -pub mod types { - pub use common::types::{Block, BlockTag, Transactions}; - pub use consensus_core::types::*; - pub use execution::types::Account; -} - -pub mod errors { - pub use common::errors::*; - pub use consensus_core::errors::*; - pub use execution::errors::*; -} - -pub use consensus_core; - -pub mod prelude { - pub use crate::client::*; - pub use crate::config::*; - pub use crate::errors::*; - pub use crate::types::*; +pub mod ethereum { + pub use helios_ethereum::*; } diff --git a/tests/rpc_equivalence.rs b/tests/rpc_equivalence.rs index 2dac582d..69846191 100644 --- a/tests/rpc_equivalence.rs +++ b/tests/rpc_equivalence.rs @@ -8,13 +8,14 @@ use alloy::sol; use alloy::transports::http::{Client as ReqwestClient, Http}; use alloy::transports::layers::{RetryBackoffLayer, RetryBackoffService}; use pretty_assertions::assert_eq; - -use helios::client::{Client, ClientBuilder}; -use helios::consensus::database::ConfigDB; use rand::Rng; +use helios::ethereum::{ + config::networks::Network, database::ConfigDB, EthereumClient, EthereumClientBuilder, +}; + async fn setup() -> ( - Client, + EthereumClient, RootProvider>, RootProvider>>, ) { @@ -23,8 +24,8 @@ async fn setup() -> ( let port = rand::thread_rng().gen_range(0..=65535); - let mut helios_client = ClientBuilder::new() - .network(config::Network::MAINNET) + let mut helios_client = EthereumClientBuilder::new() + .network(Network::MAINNET) .execution_rpc(&execution_rpc) .consensus_rpc(&consensus_rpc) .load_external_fallback() From a89ed18e380427b7da2a1fa1ad0191e3e3de9c77 Mon Sep 17 00:00:00 2001 From: Noah Citron Date: Wed, 2 Oct 2024 18:35:20 -0400 Subject: [PATCH 02/10] feat: opstack support (#382) * add lc server * add client * add builder * add config * add server cli * fix rpc socket defaults * change rpc defaults * better block safety --- Cargo.lock | 2530 ++++++++++++++++++++--- Cargo.toml | 3 + cli/Cargo.toml | 3 + cli/src/main.rs | 156 +- core/src/execution/mod.rs | 2 +- core/src/execution/state.rs | 2 +- ethereum/src/config/mod.rs | 5 +- ethereum/src/config/networks.rs | 2 +- opstack/Cargo.toml | 46 + opstack/bin/server.rs | 49 + opstack/src/builder.rs | 96 + opstack/src/config.rs | 126 ++ opstack/src/consensus.rs | 306 +++ opstack/src/lib.rs | 76 + opstack/src/server/mod.rs | 88 + opstack/src/server/net/block_handler.rs | 43 + opstack/src/server/net/bootnodes.rs | 24 + opstack/src/server/net/discovery.rs | 137 ++ opstack/src/server/net/gossip.rs | 233 +++ opstack/src/server/net/mod.rs | 4 + opstack/src/spec.rs | 307 +++ opstack/src/types.rs | 36 + 22 files changed, 3915 insertions(+), 359 deletions(-) create mode 100644 opstack/Cargo.toml create mode 100644 opstack/bin/server.rs create mode 100644 opstack/src/builder.rs create mode 100644 opstack/src/config.rs create mode 100644 opstack/src/consensus.rs create mode 100644 opstack/src/lib.rs create mode 100644 opstack/src/server/mod.rs create mode 100644 opstack/src/server/net/block_handler.rs create mode 100644 opstack/src/server/net/bootnodes.rs create mode 100644 opstack/src/server/net/discovery.rs create mode 100644 opstack/src/server/net/gossip.rs create mode 100644 opstack/src/server/net/mod.rs create mode 100644 opstack/src/spec.rs create mode 100644 opstack/src/types.rs diff --git a/Cargo.lock b/Cargo.lock index 3f7b0377..ff0b8853 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,25 +4,54 @@ version = 3 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + [[package]] name = "ahash" version = "0.8.11" @@ -78,10 +107,11 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.33" +version = "0.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805f7a974de5804f5c053edc6ca43b20883bdd3a733b3691200ae3a4b454a2db" +checksum = "156bfc5dcd52ef9a5f33381701fa03310317e14c65093a9430d3e3557b08dcd3" dependencies = [ + "alloy-primitives 0.8.7", "num_enum", "strum", ] @@ -93,7 +123,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04c309895995eaa4bfcc345f5515a39c7df9447798645cc8bf462b6c5bf1dc96" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "c-kzg", @@ -110,7 +140,7 @@ dependencies = [ "alloy-json-abi", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-provider", "alloy-pubsub", "alloy-rpc-types-eth", @@ -129,7 +159,7 @@ checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-sol-types", ] @@ -141,14 +171,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413902aa18a97569e60f679c23f46a18db1656d87ab4d4e49d0e1e52042f66df" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-type-parser", "alloy-sol-types", "const-hex", "itoa", "serde", "serde_json", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -157,11 +187,11 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "c-kzg", - "derive_more", + "derive_more 0.99.18", "ethereum_ssz 0.5.4", "ethereum_ssz_derive 0.5.4", "k256", @@ -176,7 +206,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79614dfe86144328da11098edcc7bc1a3f25ad8d3134a9eb9e857e06f0d9840d" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-serde", "serde", ] @@ -187,7 +217,7 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc05b04ac331a9f07e3a4036ef7926e49a8bf84a99a1ccfc7e2ab55a5fcbb372" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-type-parser", "serde", "serde_json", @@ -199,7 +229,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57e2865c4c3bb4cdad3f0d9ec1ab5c0c657ba69a375651bd35e32fb6c180ccc2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-types", "serde", "serde_json", @@ -217,7 +247,7 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -234,7 +264,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec9d5a0f9170b10988b6774498a022845e13eda94318440d17709d50687f67f9" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-serde", "serde", ] @@ -249,7 +279,7 @@ dependencies = [ "bytes", "cfg-if", "const-hex", - "derive_more", + "derive_more 0.99.18", "ethereum_ssz 0.5.4", "hex-literal", "itoa", @@ -262,6 +292,23 @@ dependencies = [ "tiny-keccak 2.0.2", ] +[[package]] +name = "alloy-primitives" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb848c43f6b06ae3de2e4a67496cbbabd78ae87db0f1248934f15d76192c6a" +dependencies = [ + "bytes", + "cfg-if", + "const-hex", + "derive_more 1.0.0", + "hex-literal", + "itoa", + "paste", + "ruint", + "tiny-keccak 2.0.2", +] + [[package]] name = "alloy-provider" version = "0.2.1" @@ -274,7 +321,7 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-eth", @@ -305,7 +352,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f5da2c55cbaf229bad3c5f8b00b5ab66c74ef093e5f3a753d874cfecf7d2281" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-transport", "bimap", "futures", @@ -313,7 +360,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tracing", ] @@ -336,7 +383,7 @@ checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -346,7 +393,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b38e3ffdb285df5d9f60cb988d336d9b8e3505acb78750c3bc60336a7af41d3" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -359,7 +406,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tracing", "url", ] @@ -384,7 +431,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8a24bcff4f9691d7a4971b43e5da46aa7b4ce22ed7789796612dc1eed220983" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rpc-types-engine", "ethereum_ssz 0.5.4", "ethereum_ssz_derive 0.5.4", @@ -401,7 +448,7 @@ checksum = "ff63f51b2fb2f547df5218527fd0653afb1947bf7fead5b3ce58c75d170b30f7" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-rpc-types-eth", "alloy-serde", @@ -422,7 +469,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "alloy-sol-types", @@ -438,7 +485,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33feda6a53e6079895aed1d08dcb98a1377b000d80d16370fbbdb8155d547ef" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "serde", "serde_json", ] @@ -449,7 +496,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "740a25b92e849ed7b0fa013951fe2f64be9af1ad5abe805037b44fb7770c5c47" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "async-trait", "auto_impl", "elliptic-curve", @@ -465,7 +512,7 @@ checksum = "1b0707d4f63e4356a110b30ef3add8732ab6d181dd7be4607bf79b8777105cee" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-signer", "async-trait", "k256", @@ -484,7 +531,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -497,11 +544,11 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck 0.5.0", - "indexmap 2.5.0", + "indexmap 2.6.0", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "syn-solidity", "tiny-keccak 2.0.2", ] @@ -519,7 +566,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.77", + "syn 2.0.79", "syn-solidity", ] @@ -530,7 +577,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ "serde", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -540,7 +587,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-macro", "const-hex", "serde", @@ -560,7 +607,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tower", + "tower 0.4.13", "tracing", "url", ] @@ -575,7 +622,7 @@ dependencies = [ "alloy-transport", "reqwest", "serde_json", - "tower", + "tower 0.4.13", "tracing", "url", ] @@ -609,7 +656,7 @@ dependencies = [ "alloy-transport", "futures", "http 1.1.0", - "rustls 0.23.13", + "rustls 0.23.14", "serde_json", "tokio", "tokio-tungstenite", @@ -817,6 +864,12 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + [[package]] name = "arrayvec" version = "0.5.2" @@ -829,20 +882,95 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "asn1_der" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" + +[[package]] +name = "async-io" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +dependencies = [ + "async-lock 3.4.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "async-lock" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", ] [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -851,24 +979,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -882,6 +1010,19 @@ dependencies = [ "rustc_version 0.4.1", ] +[[package]] +name = "asynchronous-codec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + [[package]] name = "atomic" version = "0.6.0" @@ -915,14 +1056,69 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "axum" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tower 0.5.1", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.1", + "tower-layer", + "tower-service", + "tracing", +] [[package]] name = "backtrace" @@ -933,12 +1129,18 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.0", + "miniz_oxide", "object", "rustc-demangle", "windows-targets 0.52.6", ] +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + [[package]] name = "base16ct" version = "0.2.0" @@ -1037,6 +1239,15 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "block-buffer" version = "0.9.0" @@ -1081,6 +1292,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + [[package]] name = "bstr" version = "1.10.0" @@ -1153,9 +1370,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.21" +version = "1.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "58e804ac3194a48bb129643eb1d62fcc20d18c6b8c181704489353d13120bcd1" dependencies = [ "shlex", ] @@ -1172,6 +1389,30 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chacha20poly1305" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + [[package]] name = "chrono" version = "0.4.38" @@ -1214,11 +1455,22 @@ dependencies = [ "half", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + [[package]] name = "clap" -version = "4.5.18" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -1226,9 +1478,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.18" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -1245,7 +1497,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1266,11 +1518,20 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "const-hex" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "0121754e84117e65f9d90648ee6aa4882a6e63110307ab73967a4c5e7e69e586" dependencies = [ "cfg-if", "cpufeatures", @@ -1343,6 +1604,15 @@ dependencies = [ "libc", ] +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "cpufeatures" version = "0.2.14" @@ -1449,19 +1719,79 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "rand_core 0.6.4", "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 = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + [[package]] name = "ctrlc" version = "3.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" dependencies = [ - "nix", + "nix 0.29.0", "windows-sys 0.59.0", ] +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version 0.4.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "darling" version = "0.13.4" @@ -1507,7 +1837,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1529,7 +1859,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1542,7 +1872,7 @@ dependencies = [ "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core", + "parking_lot_core 0.9.10", ] [[package]] @@ -1552,13 +1882,57 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] -name = "der" -version = "0.7.9" +name = "data-encoding-macro" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" dependencies = [ - "const-oid", - "zeroize", + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" +dependencies = [ + "data-encoding", + "syn 1.0.109", +] + +[[package]] +name = "delay_map" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4355c25cbf99edcb6b4a0e906f6bdc6956eda149e84455bea49696429b2f8e8" +dependencies = [ + "futures", + "tokio-util", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", ] [[package]] @@ -1592,7 +1966,28 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.77", + "syn 2.0.79", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", + "unicode-xid", ] [[package]] @@ -1643,6 +2038,48 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "discv5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f569b8c367554666c8652305621e8bae3634a2ff5c6378081d5bd8c399c99f23" +dependencies = [ + "aes", + "aes-gcm", + "alloy-rlp", + "arrayvec 0.7.6", + "ctr", + "delay_map", + "enr", + "fnv", + "futures", + "hashlink", + "hex", + "hkdf", + "lazy_static", + "lru", + "more-asserts", + "parking_lot 0.11.2", + "rand 0.8.5", + "smallvec", + "socket2 0.4.10", + "tokio", + "tracing", + "uint 0.9.5", + "zeroize", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "dlib" version = "0.5.2" @@ -1664,6 +2101,12 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + [[package]] name = "dunce" version = "1.0.5" @@ -1672,9 +2115,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dwrote" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da3498378ed373237bdef1eddcc64e7be2d3ba4841f4c22a998e81cadeea83c" +checksum = "70182709525a3632b2ba96b6569225467b18ecb4a77f46d255f713a6bebf05fd" dependencies = [ "lazy_static", "libc", @@ -1702,6 +2145,31 @@ dependencies = [ "spki", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek 4.1.3", + "ed25519", + "rand_core 0.6.4", + "serde", + "sha2 0.10.8", + "subtle", + "zeroize", +] + [[package]] name = "either" version = "1.13.0" @@ -1736,6 +2204,37 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enr" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972070166c68827e64bd1ebc8159dd8e32d9bc2da7ebe8f20b61308f7974ad30" +dependencies = [ + "alloy-rlp", + "base64 0.21.7", + "bytes", + "ed25519-dalek", + "hex", + "k256", + "log", + "rand 0.8.5", + "serde", + "sha3", + "zeroize", +] + +[[package]] +name = "enum-as-inner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "enumn" version = "0.1.14" @@ -1744,7 +2243,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1832,7 +2331,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c228a90f44b159ccc0c16da6c56da42d0a521b0388cca87e89919d1af1889b2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "hex", "serde", "serde_derive", @@ -1856,7 +2355,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "654bbebe60af1f6554e0e1216b8e336bc1a5ec483b7774d904e25e6e65a655c6" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "itertools 0.13.0", "smallvec", ] @@ -1882,7 +2381,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1891,6 +2390,27 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.1", + "pin-project-lite", +] + [[package]] name = "eyre" version = "0.6.12" @@ -1920,9 +2440,9 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" dependencies = [ "simd-adler32", ] @@ -1938,6 +2458,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "figment" version = "0.10.19" @@ -1947,7 +2473,7 @@ dependencies = [ "atomic", "pear", "serde", - "toml", + "toml 0.8.19", "uncased", "version_check", ] @@ -1978,12 +2504,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1998,6 +2524,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "font-kit" version = "0.14.2" @@ -2050,7 +2582,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2093,9 +2625,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -2108,9 +2640,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2118,49 +2650,71 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", "futures-util", + "num_cpus", ] [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "futures-core", + "pin-project-lite", +] [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", +] + +[[package]] +name = "futures-rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" +dependencies = [ + "futures-io", + "rustls 0.20.9", + "webpki", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" @@ -2174,9 +2728,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -2231,6 +2785,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + [[package]] name = "gif" version = "0.12.0" @@ -2243,9 +2807,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -2262,8 +2826,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -2345,7 +2909,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -2364,7 +2928,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -2404,6 +2968,26 @@ dependencies = [ "serde", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "heck" version = "0.4.1" @@ -2448,8 +3032,11 @@ dependencies = [ "ctrlc", "dirs", "eyre", + "figment", "futures", + "helios-core", "helios-ethereum", + "helios-opstack", "tokio", "tracing", "tracing-subscriber", @@ -2489,7 +3076,7 @@ dependencies = [ "hex", "jsonrpsee", "openssl", - "parking_lot", + "parking_lot 0.12.3", "reqwest", "revm", "serde", @@ -2518,7 +3105,7 @@ dependencies = [ "helios-core", "hex", "openssl", - "parking_lot", + "parking_lot 0.12.3", "reqwest", "retri", "revm", @@ -2535,6 +3122,39 @@ dependencies = [ "zduny-wasm-timer", ] +[[package]] +name = "helios-opstack" +version = "0.7.0" +dependencies = [ + "alloy", + "axum", + "clap", + "discv5", + "ethereum_ssz 0.6.0", + "ethereum_ssz_derive 0.6.0", + "eyre", + "figment", + "helios-core", + "hex", + "libp2p", + "libp2p-identity", + "op-alloy-consensus", + "op-alloy-network", + "op-alloy-rpc-types", + "reqwest", + "revm", + "serde", + "sha2 0.9.9", + "snap", + "ssz_types", + "tokio", + "tracing", + "tracing-subscriber", + "typenum", + "unsigned-varint", + "url", +] + [[package]] name = "hermit-abi" version = "0.3.9" @@ -2562,6 +3182,31 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hex_fmt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +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", + "digest 0.9.0", +] + [[package]] name = "hmac" version = "0.12.1" @@ -2571,6 +3216,28 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + [[package]] name = "http" version = "0.2.12" @@ -2629,9 +3296,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2656,7 +3323,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -2676,6 +3343,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -2709,7 +3377,7 @@ dependencies = [ "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -2734,9 +3402,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -2745,9 +3413,8 @@ dependencies = [ "http-body 1.0.1", "hyper 1.4.1", "pin-project-lite", - "socket2", + "socket2 0.5.7", "tokio", - "tower", "tower-service", "tracing", ] @@ -2763,7 +3430,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -2783,7 +3450,18 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ @@ -2791,6 +3469,35 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "if-addrs" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "if-watch" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +dependencies = [ + "async-io", + "core-foundation", + "fnv", + "futures", + "if-addrs", + "ipnet", + "log", + "rtnetlink", + "system-configuration 0.5.1", + "tokio", + "windows", +] + [[package]] name = "image" version = "0.24.9" @@ -2898,12 +3605,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", "serde", ] @@ -2913,6 +3620,24 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + [[package]] name = "interprocess" version = "2.2.1" @@ -2928,11 +3653,23 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "ipconfig" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +dependencies = [ + "socket2 0.5.7", + "widestring", + "windows-sys 0.48.0", + "winreg", +] + [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" @@ -2983,9 +3720,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -3036,7 +3773,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aaa4c4d5fb801dcc316d81f76422db259809037a86b3194ae538dd026b05ed7" dependencies = [ "anyhow", - "async-lock", + "async-lock 2.8.0", "async-trait", "beef", "futures-timer", @@ -3044,7 +3781,7 @@ dependencies = [ "globset", "hyper 0.14.30", "jsonrpsee-types", - "parking_lot", + "parking_lot 0.12.3", "rand 0.8.5", "rustc-hash", "serde", @@ -3072,7 +3809,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tower", + "tower 0.4.13", "tracing", ] @@ -3083,7 +3820,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21dc12b1d4f16a86e8c522823c4fab219c88c03eb7c924ec0501a64bf12e058b" dependencies = [ "heck 0.4.1", - "proc-macro-crate 1.3.1", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", @@ -3105,7 +3842,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tower", + "tower 0.4.13", "tracing", ] @@ -3154,8 +3891,8 @@ checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" dependencies = [ "base64 0.21.7", "js-sys", - "pem", - "ring", + "pem 3.0.4", + "ring 0.17.8", "serde", "serde_json", "simple_asn1", @@ -3172,6 +3909,16 @@ dependencies = [ "elliptic-curve", "once_cell", "sha2 0.10.8", + "signature", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", ] [[package]] @@ -3216,14 +3963,14 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin", + "spin 0.9.8", ] [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libloading" @@ -3241,6 +3988,334 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libp2p" +version = "0.51.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "getrandom 0.2.15", + "instant", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", + "libp2p-dns", + "libp2p-gossipsub", + "libp2p-identity", + "libp2p-mdns", + "libp2p-metrics", + "libp2p-mplex", + "libp2p-noise", + "libp2p-ping", + "libp2p-quic", + "libp2p-swarm", + "libp2p-tcp", + "multiaddr", + "pin-project", +] + +[[package]] +name = "libp2p-allow-block-list" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-core" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-identity", + "log", + "multiaddr", + "multihash", + "multistream-select", + "once_cell", + "parking_lot 0.12.3", + "pin-project", + "quick-protobuf", + "rand 0.8.5", + "rw-stream-sink", + "smallvec", + "thiserror", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-dns" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" +dependencies = [ + "futures", + "libp2p-core", + "log", + "parking_lot 0.12.3", + "smallvec", + "trust-dns-resolver", +] + +[[package]] +name = "libp2p-gossipsub" +version = "0.44.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70b34b6da8165c0bde35c82db8efda39b824776537e73973549e76cadb3a77c5" +dependencies = [ + "asynchronous-codec", + "base64 0.21.7", + "byteorder", + "bytes", + "either", + "fnv", + "futures", + "hex_fmt", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "log", + "prometheus-client", + "quick-protobuf", + "quick-protobuf-codec", + "rand 0.8.5", + "regex", + "sha2 0.10.8", + "smallvec", + "thiserror", + "unsigned-varint", + "void", + "wasm-timer", +] + +[[package]] +name = "libp2p-identity" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" +dependencies = [ + "asn1_der", + "bs58", + "ed25519-dalek", + "libsecp256k1", + "log", + "multiaddr", + "multihash", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.8", + "thiserror", + "zeroize", +] + +[[package]] +name = "libp2p-mdns" +version = "0.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" +dependencies = [ + "data-encoding", + "futures", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "log", + "rand 0.8.5", + "smallvec", + "socket2 0.4.10", + "tokio", + "trust-dns-proto", + "void", +] + +[[package]] +name = "libp2p-metrics" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" +dependencies = [ + "libp2p-core", + "libp2p-gossipsub", + "libp2p-ping", + "libp2p-swarm", + "prometheus-client", +] + +[[package]] +name = "libp2p-mplex" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d34780b514b159e6f3fd70ba3e72664ec89da28dca2d1e7856ee55e2c7031ba" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures", + "libp2p-core", + "log", + "nohash-hasher", + "parking_lot 0.12.3", + "rand 0.8.5", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "libp2p-noise" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" +dependencies = [ + "bytes", + "curve25519-dalek 3.2.0", + "futures", + "libp2p-core", + "libp2p-identity", + "log", + "once_cell", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.8", + "snow", + "static_assertions", + "thiserror", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "libp2p-ping" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" +dependencies = [ + "either", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "rand 0.8.5", + "void", +] + +[[package]] +name = "libp2p-quic" +version = "0.7.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-tls", + "log", + "parking_lot 0.12.3", + "quinn-proto", + "rand 0.8.5", + "rustls 0.20.9", + "thiserror", + "tokio", +] + +[[package]] +name = "libp2p-swarm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm-derive", + "log", + "rand 0.8.5", + "smallvec", + "tokio", + "void", +] + +[[package]] +name = "libp2p-swarm-derive" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" +dependencies = [ + "heck 0.4.1", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "libp2p-tcp" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" +dependencies = [ + "futures", + "futures-timer", + "if-watch", + "libc", + "libp2p-core", + "log", + "socket2 0.4.10", + "tokio", +] + +[[package]] +name = "libp2p-tls" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" +dependencies = [ + "futures", + "futures-rustls", + "libp2p-core", + "libp2p-identity", + "rcgen", + "ring 0.16.20", + "rustls 0.20.9", + "thiserror", + "webpki", + "x509-parser", + "yasna", +] + [[package]] name = "libredox" version = "0.1.3" @@ -3251,6 +4326,60 @@ dependencies = [ "libc", ] +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -3275,80 +4404,256 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.0", +] + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "more-asserts" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" + +[[package]] +name = "multiaddr" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "log", + "multibase", + "multihash", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint", + "url", +] + +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "core2", + "multihash-derive", + "unsigned-varint", +] + +[[package]] +name = "multihash-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "multistream-select" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" +dependencies = [ + "bytes", + "futures", + "log", + "pin-project", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] [[package]] -name = "matchers" -version = "0.1.0" +name = "netlink-packet-core" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" dependencies = [ - "regex-automata 0.1.10", + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", ] [[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "mime" -version = "0.3.17" +name = "netlink-packet-route" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] [[package]] -name = "miniz_oxide" -version = "0.7.4" +name = "netlink-packet-utils" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" dependencies = [ - "adler", - "simd-adler32", + "anyhow", + "byteorder", + "paste", + "thiserror", ] [[package]] -name = "miniz_oxide" -version = "0.8.0" +name = "netlink-proto" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ - "adler2", + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", ] [[package]] -name = "mio" -version = "1.0.2" +name = "netlink-sys" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" dependencies = [ - "hermit-abi 0.3.9", + "bytes", + "futures", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "log", + "tokio", ] [[package]] -name = "native-tls" -version = "0.2.12" +name = "nix" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ + "bitflags 1.3.2", + "cfg-if", "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", ] [[package]] @@ -3363,6 +4668,22 @@ dependencies = [ "libc", ] +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -3480,23 +4801,32 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", +] + [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" @@ -3504,6 +4834,47 @@ version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +[[package]] +name = "op-alloy-consensus" +version = "0.1.5" +source = "git+https://github.com/alloy-rs/op-alloy?tag=v0.1.5#ce7f25c524f1eb8346ded160abd37eccfbdee2ac" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives 0.7.7", + "alloy-rlp", + "alloy-serde", + "derive_more 0.99.18", + "serde", +] + +[[package]] +name = "op-alloy-network" +version = "0.1.5" +source = "git+https://github.com/alloy-rs/op-alloy?tag=v0.1.5#ce7f25c524f1eb8346ded160abd37eccfbdee2ac" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives 0.7.7", + "alloy-rpc-types-eth", + "op-alloy-consensus", + "op-alloy-rpc-types", +] + +[[package]] +name = "op-alloy-rpc-types" +version = "0.1.5" +source = "git+https://github.com/alloy-rs/op-alloy?tag=v0.1.5#ce7f25c524f1eb8346ded160abd37eccfbdee2ac" +dependencies = [ + "alloy-network", + "alloy-primitives 0.7.7", + "alloy-rpc-types-eth", + "alloy-serde", + "op-alloy-consensus", + "serde", + "serde_json", +] + [[package]] name = "opaque-debug" version = "0.3.1" @@ -3533,7 +4904,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3623,6 +4994,23 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.3" @@ -3630,7 +5018,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.10", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -3641,7 +5043,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.7", "smallvec", "windows-targets 0.52.6", ] @@ -3691,7 +5093,16 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.77", + "syn 2.0.79", +] + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", ] [[package]] @@ -3733,22 +5144,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3836,15 +5247,53 @@ dependencies = [ [[package]] name = "png" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.7.4", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "3.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", ] [[package]] @@ -3900,12 +5349,12 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "thiserror", + "toml 0.5.11", ] [[package]] @@ -3914,7 +5363,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.21", + "toml_edit", ] [[package]] @@ -3943,9 +5392,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -3958,11 +5407,34 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "version_check", "yansi", ] +[[package]] +name = "prometheus-client" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.3", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "proptest" version = "1.5.0" @@ -3977,7 +5449,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", "rusty-fork", "tempfile", "unarray", @@ -3989,6 +5461,46 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "quinn-proto" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls 0.20.9", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki", +] + [[package]] name = "quote" version = "1.0.37" @@ -4110,6 +5622,18 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem 1.1.1", + "ring 0.16.20", + "time", + "yasna", +] + [[package]] name = "recvmsg" version = "1.0.0" @@ -4118,9 +5642,18 @@ checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -4138,14 +5671,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -4159,13 +5692,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -4176,15 +5709,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64 0.22.1", "bytes", @@ -4207,12 +5740,12 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", - "system-configuration", + "sync_wrapper 1.0.1", + "system-configuration 0.6.1", "tokio", "tokio-native-tls", "tower-service", @@ -4223,6 +5756,16 @@ dependencies = [ "windows-registry", ] +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error", +] + [[package]] name = "retri" version = "0.1.0" @@ -4282,7 +5825,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fc4311037ee093ec50ec734e1424fcb3e12d535c6cef683b75d1c064639630c" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "auto_impl", "bitflags 2.6.0", "bitvec 1.0.1", @@ -4302,10 +5845,25 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac", + "hmac 0.12.1", "subtle", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + [[package]] name = "ring" version = "0.17.8" @@ -4316,8 +5874,8 @@ dependencies = [ "cfg-if", "getrandom 0.2.15", "libc", - "spin", - "untrusted", + "spin 0.9.8", + "untrusted 0.9.0", "windows-sys 0.52.0", ] @@ -4349,6 +5907,21 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix 0.24.3", + "thiserror", + "tokio", +] + [[package]] name = "ruint" version = "1.12.3" @@ -4416,6 +5989,15 @@ dependencies = [ "semver 1.0.23", ] +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + [[package]] name = "rustix" version = "0.38.37" @@ -4429,6 +6011,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct", + "webpki", +] + [[package]] name = "rustls" version = "0.21.12" @@ -4436,19 +6030,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring", + "ring 0.17.8", "rustls-webpki 0.101.7", "sct", ] [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", - "ring", + "ring 0.17.8", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -4478,19 +6072,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" @@ -4498,8 +6091,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -4508,9 +6101,9 @@ version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "ring", + "ring 0.17.8", "rustls-pki-types", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -4531,6 +6124,17 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "rw-stream-sink" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + [[package]] name = "ryu" version = "1.0.18" @@ -4548,9 +6152,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -4567,8 +6171,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -4680,7 +6284,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4689,18 +6293,28 @@ version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa", "memchr", "ryu", "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -4719,15 +6333,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -4737,14 +6351,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4753,7 +6367,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa", "ryu", "serde", @@ -4808,6 +6422,16 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + [[package]] name = "sha3-asm" version = "0.1.4" @@ -4885,6 +6509,39 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + +[[package]] +name = "snow" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" +dependencies = [ + "aes-gcm", + "blake2", + "chacha20poly1305", + "curve25519-dalek 4.1.3", + "rand_core 0.6.4", + "ring 0.17.8", + "rustc_version 0.4.1", + "sha2 0.10.8", + "subtle", +] + +[[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.7" @@ -4911,6 +6568,12 @@ dependencies = [ "sha-1", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "spin" version = "0.9.8" @@ -4981,7 +6644,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5030,9 +6693,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -5048,9 +6711,15 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "sync_wrapper" version = "1.0.1" @@ -5060,6 +6729,29 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys 0.5.0", +] + [[package]] name = "system-configuration" version = "0.6.1" @@ -5068,7 +6760,17 @@ checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.6.0", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.6.0", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", ] [[package]] @@ -5089,9 +6791,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -5117,7 +6819,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5223,10 +6925,10 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot", + "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.52.0", ] @@ -5239,7 +6941,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5268,7 +6970,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "tokio", ] @@ -5293,7 +6995,7 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -5312,9 +7014,19 @@ dependencies = [ "futures-io", "futures-sink", "pin-project-lite", + "slab", "tokio", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.8.19" @@ -5324,7 +7036,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.21", + "toml_edit", ] [[package]] @@ -5338,26 +7050,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.5.0", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -5370,6 +7071,21 @@ dependencies = [ "futures-util", "pin-project", "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", "tokio", "tower-layer", "tower-service", @@ -5408,7 +7124,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5468,7 +7184,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5477,7 +7193,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f113108f55d589941862727b5a74f75276a54c157060983611d99f7f7fa6368" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "ethereum_hashing", "smallvec", ] @@ -5491,7 +7207,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5514,6 +7230,52 @@ dependencies = [ "triehash", ] +[[package]] +name = "trust-dns-proto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "rand 0.8.5", + "smallvec", + "socket2 0.4.10", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lazy_static", + "lru-cache", + "parking_lot 0.12.3", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -5539,7 +7301,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "sha1", "thiserror", @@ -5554,9 +7316,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" @@ -5599,9 +7361,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" @@ -5618,12 +7380,44 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unsafe-libyaml" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +[[package]] +name = "unsigned-varint" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +dependencies = [ + "asynchronous-codec", + "bytes", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "untrusted" version = "0.9.0" @@ -5637,8 +7431,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", + "serde", ] [[package]] @@ -5671,6 +7466,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "wait-timeout" version = "0.2.0" @@ -5713,9 +7514,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -5724,24 +7525,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -5751,9 +7552,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5761,33 +7562,58 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" + +[[package]] +name = "wasm-timer" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + [[package]] name = "webpki-roots" version = "0.24.0" @@ -5849,6 +7675,25 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core 0.51.1", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -6038,20 +7883,21 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] [[package]] -name = "winnow" -version = "0.6.18" +name = "winreg" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "memchr", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -6091,12 +7937,50 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek 3.2.0", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs", + "base64 0.13.1", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + [[package]] name = "yansi" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time", +] + [[package]] name = "yeslogic-fontconfig-sys" version = "6.0.0" @@ -6116,7 +8000,7 @@ checksum = "0f22d6a02cbc84ea1993b0b341833a55a0866a3378c3a76e0ca664bc2574e370" dependencies = [ "futures", "js-sys", - "parking_lot", + "parking_lot 0.12.3", "pin-utils", "wasm-bindgen", "wasm-bindgen-futures", @@ -6141,7 +8025,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -6161,5 +8045,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] diff --git a/Cargo.toml b/Cargo.toml index 8ea70d19..142a4694 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ members = [ "core", "ethereum", "ethereum/consensus-core", + "opstack", #"helios-ts", ] @@ -41,6 +42,7 @@ alloy = { version = "0.2.1", features = [ "network", "ssz", "json-rpc", + "signers", ]} revm = { version = "12.1.0", default-features = false, features = [ "std", @@ -58,6 +60,7 @@ tokio = { version = "1", features = ["rt", "sync", "macros"] } # io reqwest = { version = "0.12.4", features = ["json"] } +url = { version = "2.5.2", features = ["serde"] } serde = { version = "1.0.143", features = ["derive"] } serde_json = "1.0.85" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index de0d86b3..a2b794f1 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -13,10 +13,13 @@ eyre.workspace = true tracing.workspace = true futures.workspace = true alloy.workspace = true +figment = { version = "0.10.7", features = ["toml", "env"] } clap = { version = "4.5.4", features = ["derive", "env"] } tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } dirs = "5.0.1" ctrlc = "3.2.3" +helios-core = { path = "../core" } helios-ethereum = { path = "../ethereum" } +helios-opstack = { path = "../opstack" } diff --git a/cli/src/main.rs b/cli/src/main.rs index 305f0f2f..6263e1af 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,4 +1,5 @@ -use std::net::IpAddr; +use std::collections::HashMap; +use std::net::{IpAddr, SocketAddr}; use std::{ path::PathBuf, process::exit, @@ -7,20 +8,46 @@ use std::{ }; use alloy::primitives::B256; -use clap::Parser; +use clap::{Args, Parser, Subcommand}; use dirs::home_dir; use eyre::Result; +use figment::providers::Serialized; +use figment::value::Value; use futures::executor::block_on; use tracing::{error, info}; use tracing_subscriber::filter::{EnvFilter, LevelFilter}; use tracing_subscriber::FmtSubscriber; -use helios_ethereum::config::{cli::CliConfig, Config}; +use helios_core::client::Client; +use helios_core::consensus::Consensus; +use helios_core::network_spec::NetworkSpec; +use helios_ethereum::config::{cli::CliConfig, Config as EthereumConfig}; use helios_ethereum::database::FileDB; use helios_ethereum::{EthereumClient, EthereumClientBuilder}; +use helios_opstack::{config::Config as OpStackConfig, OpStackClient, OpStackClientBuilder}; #[tokio::main] async fn main() -> Result<()> { + enable_tracer(); + + let cli = Cli::parse(); + match cli.command { + Command::Ethereum(ethereum) => { + let mut client = ethereum.make_client(); + start_client(&mut client).await; + register_shutdown_handler(client); + } + Command::OpStack(opstack) => { + let mut client = opstack.make_client(); + start_client(&mut client).await; + register_shutdown_handler(client); + } + } + + std::future::pending().await +} + +fn enable_tracer() { let env_filter = EnvFilter::builder() .with_default_directive(LevelFilter::INFO.into()) .from_env() @@ -31,29 +58,20 @@ async fn main() -> Result<()> { .finish(); tracing::subscriber::set_global_default(subscriber).expect("subscriber set failed"); +} - let config = get_config(); - let mut client = match EthereumClientBuilder::new() - .config(config) - .build::() - { - Ok(client) => client, - Err(err) => { - error!(target: "helios::runner", error = %err); - exit(1); - } - }; - +async fn start_client>( + client: &mut Client, +) { if let Err(err) = client.start().await { error!(target: "helios::runner", error = %err); exit(1); } - - register_shutdown_handler(client); - std::future::pending().await } -fn register_shutdown_handler(client: EthereumClient) { +fn register_shutdown_handler>( + client: Client, +) { let client = Arc::new(client); let shutdown_counter = Arc::new(Mutex::new(0)); @@ -85,18 +103,24 @@ fn register_shutdown_handler(client: EthereumClient) { .expect("could not register shutdown handler"); } -fn get_config() -> Config { - let cli = Cli::parse(); - let config_path = home_dir().unwrap().join(".helios/helios.toml"); - let cli_config = cli.as_cli_config(); - - Config::from_file(&config_path, &cli.network, &cli_config) -} - #[derive(Parser)] #[clap(version, about)] -/// Helios is a fast, secure, and portable light client for Ethereum +/// Helios is a fast, secure, and portable multichain light client struct Cli { + #[command(subcommand)] + command: Command, +} + +#[derive(Subcommand)] +enum Command { + #[clap(name = "ethereum")] + Ethereum(EthereumArgs), + #[clap(name = "opstack")] + OpStack(OpStackArgs), +} + +#[derive(Args)] +struct EthereumArgs { #[clap(short, long, default_value = "mainnet")] network: String, #[clap(short = 'b', long, env)] @@ -119,7 +143,24 @@ struct Cli { strict_checkpoint_age: bool, } -impl Cli { +impl EthereumArgs { + fn make_client(&self) -> EthereumClient { + let config_path = home_dir().unwrap().join(".helios/helios.toml"); + let cli_config = self.as_cli_config(); + let config = EthereumConfig::from_file(&config_path, &self.network, &cli_config); + + match EthereumClientBuilder::new() + .config(config) + .build::() + { + Ok(client) => client, + Err(err) => { + error!(target: "helios::runner", error = %err); + exit(1); + } + } + } + fn as_cli_config(&self) -> CliConfig { CliConfig { checkpoint: self.checkpoint, @@ -138,6 +179,63 @@ impl Cli { } } +#[derive(Args, Debug)] +struct OpStackArgs { + #[clap(short, long)] + network: String, + #[clap(short = 'b', long, env, default_value = "127.0.0.1")] + rpc_bind_ip: Option, + #[clap(short = 'p', long, env, default_value = "8545")] + rpc_port: Option, + #[clap(short, long, env)] + execution_rpc: Option, + #[clap(short, long, env)] + consensus_rpc: Option, +} + +impl OpStackArgs { + fn make_client(&self) -> OpStackClient { + let config_path = home_dir().unwrap().join(".helios/helios.toml"); + let cli_provider = self.as_provider(); + let config = OpStackConfig::from_file(&config_path, &self.network, cli_provider); + + match OpStackClientBuilder::new().config(config).build() { + Ok(client) => client, + Err(err) => { + error!(target: "helios::runner", error = %err); + exit(1); + } + } + } + + fn as_provider(&self) -> Serialized> { + let mut user_dict = HashMap::new(); + + if let Some(rpc) = &self.execution_rpc { + user_dict.insert("execution_rpc", Value::from(rpc.clone())); + } + + if let Some(rpc) = &self.consensus_rpc { + user_dict.insert("consensus_rpc", Value::from(rpc.clone())); + } + + if self.rpc_bind_ip.is_some() && self.rpc_port.is_some() { + let rpc_socket = SocketAddr::new(self.rpc_bind_ip.unwrap(), self.rpc_port.unwrap()); + user_dict.insert("rpc_socket", Value::from(rpc_socket.to_string())); + } + + if let Some(ip) = self.rpc_bind_ip { + user_dict.insert("rpc_bind_ip", Value::from(ip.to_string())); + } + + if let Some(port) = self.rpc_port { + user_dict.insert("rpc_port", Value::from(port)); + } + + Serialized::from(user_dict, &self.network) + } +} + fn true_or_none(b: bool) -> Option { if b { Some(b) diff --git a/core/src/execution/mod.rs b/core/src/execution/mod.rs index ff488b65..f0f66c45 100644 --- a/core/src/execution/mod.rs +++ b/core/src/execution/mod.rs @@ -199,7 +199,7 @@ impl> ExecutionClient { let receipts_fut = tx_hashes.iter().map(|hash| async move { let receipt = self.rpc.get_transaction_receipt(*hash).await; - receipt?.ok_or(eyre::eyre!("not reachable")) + receipt?.ok_or(eyre::eyre!("missing block receipt")) }); let receipts = join_all(receipts_fut).await; diff --git a/core/src/execution/state.rs b/core/src/execution/state.rs index 8158b5fc..3efdffd5 100644 --- a/core/src/execution/state.rs +++ b/core/src/execution/state.rs @@ -45,7 +45,7 @@ impl State { inner_ref.write().await.push_finalized_block(block); } - } + }, } } }); diff --git a/ethereum/src/config/mod.rs b/ethereum/src/config/mod.rs index f95350dd..55af3e37 100644 --- a/ethereum/src/config/mod.rs +++ b/ethereum/src/config/mod.rs @@ -64,12 +64,9 @@ impl Config { match err.kind { figment::error::Kind::MissingField(field) => { let field = field.replace('_', "-"); - println!("\x1b[91merror\x1b[0m: missing configuration field: {field}"); - println!("\n\ttry supplying the proper command line argument: --{field}"); - - println!("\talternatively, you can add the field to your helios.toml file or as an environment variable"); + println!("\talternatively, you can add the field to your helios.toml file"); println!("\nfor more information, check the github README"); } _ => println!("cannot parse configuration: {err}"), diff --git a/ethereum/src/config/networks.rs b/ethereum/src/config/networks.rs index 05f7c21c..60528f15 100644 --- a/ethereum/src/config/networks.rs +++ b/ethereum/src/config/networks.rs @@ -79,7 +79,7 @@ pub fn mainnet() -> BaseConfig { "c7fc7b2f4b548bfc9305fa80bc1865ddc6eea4557f0a80507af5dc34db7bd9ce" ), rpc_port: 8545, - consensus_rpc: Some("https://www.lightclientdata.org".to_string()), + consensus_rpc: Some("https://ethereum.operationsolarstorm.org".to_string()), chain: ChainConfig { chain_id: 1, genesis_time: 1606824023, diff --git a/opstack/Cargo.toml b/opstack/Cargo.toml new file mode 100644 index 00000000..740a70b6 --- /dev/null +++ b/opstack/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "helios-opstack" +version = "0.7.0" +edition = "2021" + +[[bin]] +name = "server" +path = "./bin/server.rs" + +[dependencies] +tokio.workspace = true +eyre.workspace = true +tracing.workspace = true +hex.workspace = true +serde.workspace = true +typenum.workspace = true +tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } +reqwest.workspace = true +url.workspace = true + +# consensus +alloy.workspace = true +revm.workspace = true +sha2.workspace = true +ethereum_ssz_derive.workspace = true +ethereum_ssz.workspace = true +ssz_types.workspace = true +op-alloy-network = { git = "https://github.com/alloy-rs/op-alloy", tag = "v0.1.5" } +op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", tag = "v0.1.5" } +op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", tag = "v0.1.5" } + +# server +axum = "0.7.6" +clap = { version = "4.5.4", features = ["derive", "env"] } + +# config +figment = { version = "0.10.7", features = ["toml", "env"] } + +# networking +libp2p = { version = "0.51.3", features = ["macros", "tokio", "tcp", "mplex", "noise", "gossipsub", "ping"] } +discv5 = "0.7.0" +libp2p-identity = { version = "0.1.2", features = ["secp256k1"] } +unsigned-varint = "0.7.1" +snap = "1" + +helios-core = { path = "../core" } diff --git a/opstack/bin/server.rs b/opstack/bin/server.rs new file mode 100644 index 00000000..5493ef15 --- /dev/null +++ b/opstack/bin/server.rs @@ -0,0 +1,49 @@ +use std::net::SocketAddr; + +use clap::Parser; +use eyre::Result; +use tracing_subscriber::{EnvFilter, FmtSubscriber}; + +use helios_opstack::{ + config::{Network, NetworkConfig}, + server::start_server, +}; + +#[tokio::main] +async fn main() -> Result<()> { + enable_tracing(); + let cli = Cli::parse(); + let config = NetworkConfig::from(cli.network); + + let chain_id = config.chain.chain_id; + let unsafe_signer = config.chain.unsafe_signer; + let server_addr = cli.server_address; + let gossip_addr = cli.gossip_address; + + start_server(server_addr, gossip_addr, chain_id, unsafe_signer).await?; + + Ok(()) +} + +fn enable_tracing() { + let env_filter = EnvFilter::builder() + .with_default_directive("helios_opstack=info".parse().unwrap()) + .from_env() + .expect("invalid env filter"); + + let subscriber = FmtSubscriber::builder() + .with_env_filter(env_filter) + .finish(); + + tracing::subscriber::set_global_default(subscriber).expect("subscriber set failed"); +} + +#[derive(Parser)] +struct Cli { + #[clap(short, long)] + network: Network, + #[clap(short, long, default_value = "127.0.0.1:3000")] + server_address: SocketAddr, + #[clap(short, long, default_value = "0.0.0.0:9876")] + gossip_address: SocketAddr, +} diff --git a/opstack/src/builder.rs b/opstack/src/builder.rs new file mode 100644 index 00000000..50a5872f --- /dev/null +++ b/opstack/src/builder.rs @@ -0,0 +1,96 @@ +use std::net::SocketAddr; + +use alloy::primitives::Address; +use eyre::Result; +use reqwest::{IntoUrl, Url}; + +use crate::{ + config::{ChainConfig, Config}, + consensus::ConsensusClient, + OpStackClient, +}; + +#[derive(Default)] +pub struct OpStackClientBuilder { + config: Option, + chain_id: Option, + unsafe_signer: Option
, + consensus_rpc: Option, + execution_rpc: Option, + rpc_socket: Option, +} + +impl OpStackClientBuilder { + pub fn new() -> Self { + OpStackClientBuilder::default() + } + + pub fn config(mut self, config: Config) -> Self { + self.config = Some(config); + self + } + + pub fn chain_id(mut self, chain_id: u64) -> Self { + self.chain_id = Some(chain_id); + self + } + + pub fn unsafe_signer(mut self, signer: Address) -> Self { + self.unsafe_signer = Some(signer); + self + } + + pub fn consensus_rpc(mut self, consensus_rpc: T) -> Self { + self.consensus_rpc = Some(consensus_rpc.into_url().unwrap()); + self + } + + pub fn execution_rpc(mut self, execution_rpc: T) -> Self { + self.execution_rpc = Some(execution_rpc.into_url().unwrap()); + self + } + + pub fn rpc_socket(mut self, socket: SocketAddr) -> Self { + self.rpc_socket = Some(socket); + self + } + + pub fn build(self) -> Result { + let config = if let Some(config) = self.config { + config + } else { + let Some(chain_id) = self.chain_id else { + eyre::bail!("chain id required"); + }; + + let Some(unsafe_signer) = self.unsafe_signer else { + eyre::bail!("unsafe signer required"); + }; + + let Some(consensus_rpc) = self.consensus_rpc else { + eyre::bail!("consensus rpc required"); + }; + + let Some(execution_rpc) = self.execution_rpc else { + eyre::bail!("execution rpc required"); + }; + + Config { + consensus_rpc, + execution_rpc, + rpc_socket: self.rpc_socket, + chain: ChainConfig { + chain_id, + unsafe_signer, + }, + } + }; + + let consensus = ConsensusClient::new(&config); + OpStackClient::new( + &config.execution_rpc.to_string(), + consensus, + config.rpc_socket, + ) + } +} diff --git a/opstack/src/config.rs b/opstack/src/config.rs new file mode 100644 index 00000000..25521101 --- /dev/null +++ b/opstack/src/config.rs @@ -0,0 +1,126 @@ +use std::{ + collections::HashMap, fmt::Display, net::SocketAddr, path::PathBuf, process::exit, str::FromStr, +}; + +use alloy::primitives::{address, Address}; +use eyre::Result; +use figment::{ + providers::{Format, Serialized, Toml}, + value::Value, + Figment, +}; +use serde::{Deserialize, Serialize}; +use url::Url; + +#[derive(Serialize, Deserialize)] +pub struct Config { + pub consensus_rpc: Url, + pub execution_rpc: Url, + pub rpc_socket: Option, + pub chain: ChainConfig, +} + +#[derive(Serialize, Deserialize)] +pub struct ChainConfig { + pub chain_id: u64, + pub unsafe_signer: Address, +} + +#[derive(Serialize, Deserialize)] +pub struct NetworkConfig { + pub consensus_rpc: Option, + pub chain: ChainConfig, +} + +#[derive(Copy, Clone, Debug)] +pub enum Network { + Optimism, + Base, +} + +impl Display for Network { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Optimism => f.write_str("optimism"), + Self::Base => f.write_str("base"), + } + } +} + +impl FromStr for Network { + type Err = eyre::Report; + + fn from_str(s: &str) -> Result { + match s { + "optimism" => Ok(Self::Optimism), + "base" => Ok(Self::Base), + _ => Err(eyre::eyre!("network not recognized")), + } + } +} + +impl From for NetworkConfig { + fn from(value: Network) -> Self { + match value { + Network::Optimism => NetworkConfig { + consensus_rpc: Some("https://optimism.operationsolarstorm.org".parse().unwrap()), + chain: ChainConfig { + chain_id: 10, + unsafe_signer: address!("AAAA45d9549EDA09E70937013520214382Ffc4A2"), + }, + }, + Network::Base => NetworkConfig { + consensus_rpc: Some("https://base.operationsolarstorm.org".parse().unwrap()), + chain: ChainConfig { + chain_id: 8453, + unsafe_signer: address!("Af6E19BE0F9cE7f8afd49a1824851023A8249e8a"), + }, + }, + } + } +} + +impl Config { + pub fn from_file( + config_path: &PathBuf, + network: &str, + cli_provider: Serialized>, + ) -> Self { + let network = Network::from_str(network).unwrap(); + let network_config = NetworkConfig::from(network); + + let base_provider = Serialized::from(network_config, network.to_string()); + let toml_provider = Toml::file(config_path).nested(); + + let config_res = Figment::new() + .merge(base_provider) + .merge(toml_provider) + .merge(cli_provider) + .select(network.to_string()) + .extract(); + + match config_res { + Ok(config) => config, + Err(err) => { + match err.kind { + figment::error::Kind::MissingField(field) => { + let field = field.replace('_', "-"); + println!("\x1b[91merror\x1b[0m: missing configuration field: {field}"); + println!("\n\ttry supplying the proper command line argument: --{field}"); + println!("\talternatively, you can add the field to your helios.toml file"); + println!("\nfor more information, check the github README"); + } + figment::error::Kind::InvalidType(_, _) => { + let field = err.path.join(".").replace("_", "-"); + println!("\x1b[91merror\x1b[0m: invalid configuration field: {field}"); + println!("\n\ttry supplying the proper command line argument: --{field}"); + println!("\talternatively, you can add the field to your helios.toml file"); + println!("\nfor more information, check the github README"); + } + _ => println!("cannot parse configuration: {err}"), + } + exit(1); + } + } + } +} diff --git a/opstack/src/consensus.rs b/opstack/src/consensus.rs new file mode 100644 index 00000000..d9c1d24a --- /dev/null +++ b/opstack/src/consensus.rs @@ -0,0 +1,306 @@ +use std::time::{Duration, SystemTime, UNIX_EPOCH}; + +use alloy::consensus::Transaction as TxTrait; +use alloy::primitives::{b256, keccak256, Address, B256, U256, U64}; +use alloy::rlp::Decodable; +use alloy::rpc::types::{Parity, Signature, Transaction}; +use eyre::Result; +use op_alloy_consensus::OpTxEnvelope; +use tokio::sync::mpsc::Sender; +use tokio::{ + sync::{ + mpsc::{channel, Receiver}, + watch, + }, + time::sleep, +}; + +use helios_core::consensus::Consensus; +use helios_core::types::{Block, Transactions}; + +use crate::{config::Config, types::ExecutionPayload, SequencerCommitment}; + +pub struct ConsensusClient { + block_recv: Option>>, + finalized_block_recv: Option>>>, + chain_id: u64, +} + +impl ConsensusClient { + pub fn new(config: &Config) -> Self { + let (block_send, block_recv) = channel(256); + let (finalized_block_send, finalied_block_recv) = watch::channel(None); + + let mut inner = Inner { + server_url: config.consensus_rpc.to_string(), + unsafe_signer: config.chain.unsafe_signer, + chain_id: config.chain.chain_id, + latest_block: None, + block_send, + finalized_block_send, + }; + + tokio::spawn(async move { + loop { + _ = inner.advance().await; + sleep(Duration::from_secs(1)).await; + } + }); + + Self { + block_recv: Some(block_recv), + finalized_block_recv: Some(finalied_block_recv), + chain_id: config.chain.chain_id, + } + } +} + +impl Consensus for ConsensusClient { + fn chain_id(&self) -> u64 { + self.chain_id + } + + fn shutdown(&self) -> eyre::Result<()> { + Ok(()) + } + + fn block_recv(&mut self) -> Option>> { + self.block_recv.take() + } + + fn finalized_block_recv(&mut self) -> Option>>> { + self.finalized_block_recv.take() + } + + fn expected_highest_block(&self) -> u64 { + u64::MAX + } +} + +#[allow(dead_code)] +struct Inner { + server_url: String, + unsafe_signer: Address, + chain_id: u64, + latest_block: Option, + block_send: Sender>, + finalized_block_send: watch::Sender>>, +} + +impl Inner { + pub async fn advance(&mut self) -> Result<()> { + let req = format!("{}latest", self.server_url); + let commitment = reqwest::get(req) + .await? + .json::() + .await?; + + if commitment.verify(self.unsafe_signer, self.chain_id).is_ok() { + let payload = ExecutionPayload::try_from(&commitment)?; + if self + .latest_block + .map(|latest| payload.block_number > latest) + .unwrap_or(true) + { + let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); + let timestamp = Duration::from_secs(payload.timestamp); + let age = now.saturating_sub(timestamp); + let number = payload.block_number; + + if let Ok(block) = payload_to_block(payload) { + self.latest_block = Some(block.number.to()); + _ = self.block_send.send(block).await; + + tracing::info!( + "unsafe head updated: block={} age={}s", + number, + age.as_secs() + ); + } else { + tracing::warn!("invalid block received"); + } + } + } + + Ok(()) + } +} + +fn payload_to_block(value: ExecutionPayload) -> Result> { + let empty_nonce = "0x0000000000000000".to_string(); + let empty_uncle_hash = + b256!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"); + + let txs = value + .transactions + .iter() + .enumerate() + .map(|(i, tx_bytes)| { + let tx_bytes = tx_bytes.to_vec(); + let mut tx_bytes_slice = tx_bytes.as_slice(); + let tx_envelope = OpTxEnvelope::decode(&mut tx_bytes_slice)?; + let transaction_type = Some(tx_envelope.tx_type().into()); + + Ok(match tx_envelope { + OpTxEnvelope::Legacy(inner) => { + let inner_tx = inner.tx(); + Transaction { + hash: *inner.hash(), + nonce: inner_tx.nonce, + block_hash: Some(value.block_hash), + block_number: Some(value.block_number), + transaction_index: Some(i as u64), + to: inner_tx.to.to().cloned(), + value: inner_tx.value, + gas_price: Some(inner_tx.gas_price), + gas: inner_tx.gas_limit, + input: inner_tx.input.to_vec().into(), + chain_id: inner_tx.chain_id, + transaction_type, + from: inner.recover_signer()?, + signature: Some(Signature { + r: inner.signature().r(), + s: inner.signature().s(), + v: U256::from(inner.signature().v().to_u64()), + y_parity: None, + }), + ..Default::default() + } + } + OpTxEnvelope::Eip2930(inner) => { + let inner_tx = inner.tx(); + Transaction { + hash: *inner.hash(), + nonce: inner_tx.nonce, + block_hash: Some(value.block_hash), + block_number: Some(value.block_number), + transaction_index: Some(i as u64), + to: inner_tx.to.to().cloned(), + value: inner_tx.value, + gas_price: Some(inner_tx.gas_price), + gas: inner_tx.gas_limit, + input: inner_tx.input.to_vec().into(), + chain_id: Some(inner_tx.chain_id), + transaction_type, + from: inner.recover_signer()?, + signature: Some(Signature { + r: inner.signature().r(), + s: inner.signature().s(), + v: U256::from(inner.signature().v().to_u64()), + y_parity: Some(Parity(inner.signature().v().to_u64() == 1)), + }), + access_list: Some(inner.tx().access_list.clone()), + ..Default::default() + } + } + OpTxEnvelope::Eip1559(inner) => { + let inner_tx = inner.tx(); + Transaction { + hash: *inner.hash(), + nonce: inner_tx.nonce, + block_hash: Some(value.block_hash), + block_number: Some(value.block_number), + transaction_index: Some(i as u64), + to: inner_tx.to.to().cloned(), + value: inner_tx.value, + gas_price: inner_tx.gas_price(), + gas: inner_tx.gas_limit, + input: inner_tx.input.to_vec().into(), + chain_id: Some(inner_tx.chain_id), + transaction_type, + from: inner.recover_signer()?, + signature: Some(Signature { + r: inner.signature().r(), + s: inner.signature().s(), + v: U256::from(inner.signature().v().to_u64()), + y_parity: Some(Parity(inner.signature().v().to_u64() == 1)), + }), + access_list: Some(inner_tx.access_list.clone()), + max_fee_per_gas: Some(inner_tx.max_fee_per_gas), + max_priority_fee_per_gas: Some(inner_tx.max_priority_fee_per_gas), + ..Default::default() + } + } + OpTxEnvelope::Eip4844(inner) => { + let inner_tx = inner.tx(); + Transaction { + hash: *inner.hash(), + nonce: inner_tx.nonce(), + block_hash: Some(value.block_hash), + block_number: Some(value.block_number), + transaction_index: Some(i as u64), + to: inner_tx.to().to().cloned(), + value: inner_tx.value(), + gas_price: inner_tx.gas_price(), + gas: inner_tx.gas_limit(), + input: inner_tx.input().to_vec().into(), + chain_id: inner_tx.chain_id(), + transaction_type, + from: inner.recover_signer()?, + signature: Some(Signature { + r: inner.signature().r(), + s: inner.signature().s(), + v: U256::from(inner.signature().v().to_u64()), + y_parity: Some(Parity(inner.signature().v().to_u64() == 1)), + }), + access_list: Some(inner_tx.tx().access_list.clone()), + max_fee_per_gas: Some(inner_tx.tx().max_fee_per_gas), + max_priority_fee_per_gas: Some(inner_tx.tx().max_priority_fee_per_gas), + max_fee_per_blob_gas: Some(inner_tx.tx().max_fee_per_blob_gas), + blob_versioned_hashes: Some(inner_tx.tx().blob_versioned_hashes.clone()), + ..Default::default() + } + } + OpTxEnvelope::Deposit(inner) => { + let hash = + keccak256([&[0x7Eu8], alloy::rlp::encode(&inner).as_slice()].concat()); + + let tx = Transaction { + hash, + nonce: inner.nonce(), + block_hash: Some(value.block_hash), + block_number: Some(value.block_number), + transaction_index: Some(i as u64), + to: inner.to().to().cloned(), + value: inner.value(), + gas_price: inner.gas_price(), + gas: inner.gas_limit(), + input: inner.input().to_vec().into(), + chain_id: inner.chain_id(), + transaction_type, + ..Default::default() + }; + + tx + } + _ => unreachable!("new tx type"), + }) + }) + .collect::>>()?; + + Ok(Block { + number: U64::from(value.block_number), + base_fee_per_gas: value.base_fee_per_gas, + difficulty: U256::ZERO, + extra_data: value.extra_data.to_vec().into(), + gas_limit: U64::from(value.gas_limit), + gas_used: U64::from(value.gas_used), + hash: value.block_hash, + logs_bloom: value.logs_bloom.to_vec().into(), + miner: value.fee_recipient, + parent_hash: value.parent_hash, + receipts_root: value.receipts_root, + state_root: value.state_root, + timestamp: U64::from(value.timestamp), + total_difficulty: U64::ZERO, + transactions: Transactions::Full(txs), + mix_hash: value.prev_randao, + nonce: empty_nonce, + sha3_uncles: empty_uncle_hash, + size: U64::ZERO, + transactions_root: B256::default(), + uncles: vec![], + blob_gas_used: Some(U64::from(value.blob_gas_used)), + excess_blob_gas: Some(U64::from(value.excess_blob_gas)), + }) +} diff --git a/opstack/src/lib.rs b/opstack/src/lib.rs new file mode 100644 index 00000000..216c14f1 --- /dev/null +++ b/opstack/src/lib.rs @@ -0,0 +1,76 @@ +use alloy::{ + primitives::{keccak256, Address, Bytes, B256}, + signers::Signature, +}; +use eyre::Result; +use serde::{Deserialize, Serialize}; +use spec::OpStack; +use ssz::Decode; + +use helios_core::client::Client; + +use consensus::ConsensusClient; +use types::ExecutionPayload; + +mod builder; +pub mod config; +pub mod consensus; +pub mod server; +pub mod spec; +pub mod types; + +pub use builder::OpStackClientBuilder; +pub type OpStackClient = Client; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SequencerCommitment { + data: Bytes, + signature: Signature, +} + +impl SequencerCommitment { + pub fn new(data: &[u8]) -> Result { + let mut decoder = snap::raw::Decoder::new(); + let decompressed = decoder.decompress_vec(&data)?; + + let signature = Signature::try_from(&decompressed[..65])?; + let data = Bytes::from(decompressed[65..].to_vec()); + + Ok(SequencerCommitment { data, signature }) + } + + pub fn verify(&self, signer: Address, chain_id: u64) -> Result<()> { + let msg = signature_msg(&self.data, chain_id); + let pk = self.signature.recover_from_prehash(&msg)?; + let recovered_signer = Address::from_public_key(&pk); + + if signer != recovered_signer { + eyre::bail!("invalid signer"); + } + + Ok(()) + } +} + +impl TryFrom<&SequencerCommitment> for ExecutionPayload { + type Error = eyre::Report; + + fn try_from(value: &SequencerCommitment) -> Result { + let payload_bytes = &value.data[32..]; + ExecutionPayload::from_ssz_bytes(payload_bytes).map_err(|_| eyre::eyre!("decode failed")) + } +} + +fn signature_msg(data: &[u8], chain_id: u64) -> B256 { + let domain = B256::ZERO; + let chain_id = B256::left_padding_from(&chain_id.to_be_bytes()); + let payload_hash = keccak256(data); + + let signing_data = [ + domain.as_slice(), + chain_id.as_slice(), + payload_hash.as_slice(), + ]; + + keccak256(signing_data.concat()).into() +} diff --git a/opstack/src/server/mod.rs b/opstack/src/server/mod.rs new file mode 100644 index 00000000..1937bdc1 --- /dev/null +++ b/opstack/src/server/mod.rs @@ -0,0 +1,88 @@ +use std::{net::SocketAddr, sync::Arc, time::Duration}; + +use alloy::primitives::Address; +use axum::{extract::State, routing::get, Json, Router}; +use eyre::Result; +use tokio::{ + sync::{mpsc::Receiver, RwLock}, + time::sleep, +}; + +use crate::{types::ExecutionPayload, SequencerCommitment}; + +use self::net::{block_handler::BlockHandler, gossip::GossipService}; + +pub mod net; + +pub async fn start_server( + server_addr: SocketAddr, + gossip_addr: SocketAddr, + chain_id: u64, + signer: Address, +) -> Result<()> { + let state = Arc::new(RwLock::new(ServerState::new( + gossip_addr, + chain_id, + signer, + )?)); + + let state_copy = state.clone(); + let _handle = tokio::spawn(async move { + loop { + state_copy.write().await.update(); + sleep(Duration::from_secs(1)).await; + } + }); + + let router = Router::new() + .route("/latest", get(latest_handler)) + .with_state(state); + + let listener = tokio::net::TcpListener::bind(server_addr).await?; + axum::serve(listener, router).await?; + + Ok(()) +} + +async fn latest_handler( + State(state): State>>, +) -> Json> { + Json(state.read().await.latest_commitment.clone().map(|v| v.0)) +} + +struct ServerState { + commitment_recv: Receiver, + latest_commitment: Option<(SequencerCommitment, u64)>, +} + +impl ServerState { + pub fn new(addr: SocketAddr, chain_id: u64, signer: Address) -> Result { + let (handler, commitment_recv) = BlockHandler::new(signer, chain_id); + let gossip = GossipService::new(addr, chain_id, handler); + gossip.start()?; + + Ok(Self { + commitment_recv, + latest_commitment: None, + }) + } + + pub fn update(&mut self) { + if let Ok(commitment) = self.commitment_recv.try_recv() { + if let Ok(payload) = ExecutionPayload::try_from(&commitment) { + if self.is_latest_commitment(payload.block_number) { + tracing::info!("new commitment for block: {}", payload.block_number); + self.latest_commitment = Some((commitment, payload.block_number)); + } + } + } + } + + fn is_latest_commitment(&self, block_number: u64) -> bool { + if let Some((_, latest_block_number)) = self.latest_commitment { + block_number > latest_block_number + } else { + true + } + } +} diff --git a/opstack/src/server/net/block_handler.rs b/opstack/src/server/net/block_handler.rs new file mode 100644 index 00000000..c2fcdb6f --- /dev/null +++ b/opstack/src/server/net/block_handler.rs @@ -0,0 +1,43 @@ +use alloy::primitives::Address; +use libp2p::gossipsub::{IdentTopic, Message, MessageAcceptance, TopicHash}; +use tokio::sync::mpsc::{channel, Receiver, Sender}; + +use crate::SequencerCommitment; + +pub struct BlockHandler { + chain_id: u64, + signer: Address, + commitment_sender: Sender, + blocks_v3_topic: IdentTopic, +} + +impl BlockHandler { + pub fn new(signer: Address, chain_id: u64) -> (Self, Receiver) { + let (send, recv) = channel(256); + let handler = Self { + chain_id, + signer, + commitment_sender: send, + blocks_v3_topic: IdentTopic::new(format!("/optimism/{}/2/blocks", chain_id)), + }; + + (handler, recv) + } + + pub fn topics(&self) -> Vec { + vec![self.blocks_v3_topic.hash()] + } + + pub fn handle(&self, msg: Message) -> MessageAcceptance { + let Ok(commitment) = SequencerCommitment::new(&msg.data) else { + return MessageAcceptance::Reject; + }; + + if commitment.verify(self.signer, self.chain_id).is_ok() { + _ = self.commitment_sender.try_send(commitment); + MessageAcceptance::Accept + } else { + MessageAcceptance::Reject + } + } +} diff --git a/opstack/src/server/net/bootnodes.rs b/opstack/src/server/net/bootnodes.rs new file mode 100644 index 00000000..59e13284 --- /dev/null +++ b/opstack/src/server/net/bootnodes.rs @@ -0,0 +1,24 @@ +use std::str::FromStr; + +use discv5::enr::{CombinedKey, Enr}; + +/// Default bootnodes to use. Currently consists of 2 Base bootnodes & 1 Optimism bootnode. +pub fn bootnodes() -> Vec> { + let bootnodes = [ + "enr:-J64QBbwPjPLZ6IOOToOLsSjtFUjjzN66qmBZdUexpO32Klrc458Q24kbty2PdRaLacHM5z-cZQr8mjeQu3pik6jPSOGAYYFIqBfgmlkgnY0gmlwhDaRWFWHb3BzdGFja4SzlAUAiXNlY3AyNTZrMaECmeSnJh7zjKrDSPoNMGXoopeDF4hhpj5I0OsQUUt4u8uDdGNwgiQGg3VkcIIkBg", + "enr:-J64QAlTCDa188Hl1OGv5_2Kj2nWCsvxMVc_rEnLtw7RPFbOfqUOV6khXT_PH6cC603I2ynY31rSQ8sI9gLeJbfFGaWGAYYFIrpdgmlkgnY0gmlwhANWgzCHb3BzdGFja4SzlAUAiXNlY3AyNTZrMaECkySjcg-2v0uWAsFsZZu43qNHppGr2D5F913Qqs5jDCGDdGNwgiQGg3VkcIIkBg", + "enr:-J24QGEzN4mJgLWNTUNwj7riVJ2ZjRLenOFccl2dbRFxHHOCCZx8SXWzgf-sLzrGs6QgqSFCvGXVgGPBkRkfOWlT1-iGAYe6Cu93gmlkgnY0gmlwhCJBEUSHb3BzdGFja4OkAwCJc2VjcDI1NmsxoQLuYIwaYOHg3CUQhCkS-RsSHmUd1b_x93-9yQ5ItS6udIN0Y3CCIyuDdWRwgiMr", + + // Base bootnodes + "enr:-J24QNz9lbrKbN4iSmmjtnr7SjUMk4zB7f1krHZcTZx-JRKZd0kA2gjufUROD6T3sOWDVDnFJRvqBBo62zuF-hYCohOGAYiOoEyEgmlkgnY0gmlwhAPniryHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQKNVFlCxh_B-716tTs-h1vMzZkSs1FTu_OYTNjgufplG4N0Y3CCJAaDdWRwgiQG", + "enr:-J24QH-f1wt99sfpHy4c0QJM-NfmsIfmlLAMMcgZCUEgKG_BBYFc6FwYgaMJMQN5dsRBJApIok0jFn-9CS842lGpLmqGAYiOoDRAgmlkgnY0gmlwhLhIgb2Hb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJ9FTIv8B9myn1MWaC_2lJ-sMoeCDkusCsk4BYHjjCq04N0Y3CCJAaDdWRwgiQG", + "enr:-J24QDXyyxvQYsd0yfsN0cRr1lZ1N11zGTplMNlW4xNEc7LkPXh0NAJ9iSOVdRO95GPYAIc6xmyoCCG6_0JxdL3a0zaGAYiOoAjFgmlkgnY0gmlwhAPckbGHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJwoS7tzwxqXSyFL7g0JM-KWVbgvjfB8JA__T7yY_cYboN0Y3CCJAaDdWRwgiQG", + "enr:-J24QHmGyBwUZXIcsGYMaUqGGSl4CFdx9Tozu-vQCn5bHIQbR7On7dZbU61vYvfrJr30t0iahSqhc64J46MnUO2JvQaGAYiOoCKKgmlkgnY0gmlwhAPnCzSHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQINc4fSijfbNIiGhcgvwjsjxVFJHUstK9L1T8OTKUjgloN0Y3CCJAaDdWRwgiQG", + "enr:-J24QG3ypT4xSu0gjb5PABCmVxZqBjVw9ca7pvsI8jl4KATYAnxBmfkaIuEqy9sKvDHKuNCsy57WwK9wTt2aQgcaDDyGAYiOoGAXgmlkgnY0gmlwhDbGmZaHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQIeAK_--tcLEiu7HvoUlbV52MspE0uCocsx1f_rYvRenIN0Y3CCJAaDdWRwgiQG", + ]; + + bootnodes + .iter() + .filter_map(|enr| Enr::from_str(enr).ok()) + .collect() +} diff --git a/opstack/src/server/net/discovery.rs b/opstack/src/server/net/discovery.rs new file mode 100644 index 00000000..857d8f0f --- /dev/null +++ b/opstack/src/server/net/discovery.rs @@ -0,0 +1,137 @@ +use std::{ + net::{IpAddr, SocketAddr}, + time::Duration, +}; + +use alloy::{ + primitives::Bytes, + rlp::{self, Decodable}, +}; +use discv5::{ + enr::{Builder, CombinedKey, Enr, NodeId}, + ConfigBuilder, Discv5, ListenConfig, +}; +use eyre::Result; +use tokio::{ + sync::mpsc::{self, Receiver}, + time::sleep, +}; +use unsigned_varint::{decode, encode}; + +use super::bootnodes::bootnodes; + +/// Starts the [Discv5] discovery service and continually tries to find new peers. +/// Returns a [Receiver] to receive [Peer] structs +pub fn start(addr: SocketAddr, chain_id: u64) -> Result> { + let bootnodes = bootnodes(); + let mut disc = create_disc(addr, chain_id)?; + + let (sender, recv) = mpsc::channel::(256); + + tokio::spawn(async move { + bootnodes.into_iter().for_each(|enr| _ = disc.add_enr(enr)); + disc.start().await.unwrap(); + + tracing::info!("started peer discovery"); + + loop { + let target = NodeId::random(); + match disc.find_node(target).await { + Ok(nodes) => { + let peers = nodes + .iter() + .filter(|node| is_valid_node(node, chain_id)) + .flat_map(|peer| { + if let Some(ip) = peer.ip4() { + return Some(SocketAddr::new(IpAddr::V4(ip), peer.tcp4().unwrap())); + } + + if let Some(ip) = peer.ip6() { + return Some(SocketAddr::new(IpAddr::V6(ip), peer.tcp6().unwrap())); + } + + None + }); + + for peer in peers { + _ = sender.send(peer).await; + } + } + Err(err) => { + tracing::warn!("discovery error: {:?}", err); + } + } + + sleep(Duration::from_secs(1)).await; + } + }); + + Ok(recv) +} + +/// Returns `true` if a node [Enr] contains an `opstack` key and is on the same network. +fn is_valid_node(node: &Enr, chain_id: u64) -> bool { + node.get_raw_rlp("opstack") + .map(|opstack| { + OpStackEnrData::try_from(opstack) + .map(|opstack| opstack.chain_id == chain_id && opstack.version == 0) + .unwrap_or_default() + }) + .unwrap_or_default() +} + +/// Generates an [Enr] and creates a [Discv5] service struct +fn create_disc(addr: SocketAddr, chain_id: u64) -> Result { + let opstack = OpStackEnrData { + chain_id, + version: 0, + }; + let opstack_data: Vec = opstack.into(); + + let listen_config = ListenConfig::from(addr); + let config = ConfigBuilder::new(listen_config).build(); + let key = CombinedKey::generate_secp256k1(); + let enr = Builder::default() + .add_value_rlp("opstack", opstack_data.into()) + .build(&key)?; + + Discv5::new(enr, key, config).map_err(|_| eyre::eyre!("could not create disc service")) +} + +/// The unique L2 network identifier +#[derive(Debug)] +struct OpStackEnrData { + /// Chain ID + chain_id: u64, + /// The version. Always set to 0. + version: u64, +} + +impl TryFrom<&[u8]> for OpStackEnrData { + type Error = eyre::Report; + + /// Converts a slice of RLP encoded bytes to Op Stack Enr Data. + fn try_from(value: &[u8]) -> Result { + let mut buffer = value; + let bytes = Bytes::decode(&mut buffer)?; + let (chain_id, rest) = decode::u64(&bytes)?; + let (version, _) = decode::u64(rest)?; + + Ok(Self { chain_id, version }) + } +} + +impl From for Vec { + /// Converts Op Stack Enr data to a vector of bytes. + fn from(value: OpStackEnrData) -> Vec { + let mut chain_id_buf = encode::u128_buffer(); + let chain_id_slice = encode::u128(value.chain_id as u128, &mut chain_id_buf); + + let mut version_buf = encode::u128_buffer(); + let version_slice = encode::u128(value.version as u128, &mut version_buf); + + let opstack = [chain_id_slice, version_slice].concat(); + + rlp::encode(&opstack).to_vec() + } +} diff --git a/opstack/src/server/net/gossip.rs b/opstack/src/server/net/gossip.rs new file mode 100644 index 00000000..0a65b633 --- /dev/null +++ b/opstack/src/server/net/gossip.rs @@ -0,0 +1,233 @@ +use std::{ + net::{IpAddr, SocketAddr}, + time::Duration, +}; + +use eyre::Result; +use libp2p::{ + futures::StreamExt, + gossipsub::{self, IdentTopic, Message, MessageId}, + mplex::MplexConfig, + multiaddr::Protocol, + noise, ping, + swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent}, + tcp, Multiaddr, PeerId, Swarm, Transport, +}; +use libp2p_identity::Keypair; +use sha2::{Digest, Sha256}; +use tokio::select; + +use super::{block_handler::BlockHandler, discovery}; + +/// OP Stack gossip service +pub struct GossipService { + /// The socket address that the service is listening on. + addr: SocketAddr, + /// The chain ID of the network + chain_id: u64, + /// A unique keypair to validate the node's identity + keypair: Option, + /// Handler for the block + block_handler: BlockHandler, +} + +impl GossipService { + /// Creates a new [Service] + pub fn new(addr: SocketAddr, chain_id: u64, handler: BlockHandler) -> Self { + Self { + addr, + chain_id, + keypair: None, + block_handler: handler, + } + } + + /// Sets the keypair for [Service] + pub fn set_keypair(mut self, keypair: Keypair) -> Self { + self.keypair = Some(keypair); + self + } + + /// Starts the Discv5 peer discovery & libp2p services + /// and continually listens for new peers and messages to handle + pub fn start(self) -> Result<()> { + let keypair = self.keypair.unwrap_or_else(Keypair::generate_secp256k1); + + let mut swarm = create_swarm(keypair, &self.block_handler)?; + let mut peer_recv = discovery::start(self.addr, self.chain_id)?; + let multiaddr = socket_to_multiaddr(self.addr); + + swarm + .listen_on(multiaddr) + .map_err(|_| eyre::eyre!("swarm listen failed"))?; + + tokio::spawn(async move { + loop { + select! { + peer = peer_recv.recv() => { + if let Some(peer) = peer { + tracing::info!("adding peer"); + let peer = socket_to_multiaddr(peer); + _ = swarm.dial(peer); + } + }, + event = swarm.select_next_some() => { + if let SwarmEvent::Behaviour(event) = event { + event.handle(&mut swarm, &self.block_handler); + } + }, + } + } + }); + + Ok(()) + } +} + +fn socket_to_multiaddr(socket: SocketAddr) -> Multiaddr { + let mut multiaddr = Multiaddr::empty(); + match socket.ip() { + IpAddr::V4(ip) => multiaddr.push(Protocol::Ip4(ip)), + IpAddr::V6(ip) => multiaddr.push(Protocol::Ip6(ip)), + } + multiaddr.push(Protocol::Tcp(socket.port())); + multiaddr +} + +/// Computes the message ID of a `gossipsub` message +fn compute_message_id(msg: &Message) -> MessageId { + let mut decoder = snap::raw::Decoder::new(); + let id = match decoder.decompress_vec(&msg.data) { + Ok(data) => { + let domain_valid_snappy: Vec = vec![0x1, 0x0, 0x0, 0x0]; + let mut hasher = Sha256::new(); + hasher.update( + [domain_valid_snappy.as_slice(), data.as_slice()] + .concat() + .as_slice(), + ); + hasher.finalize()[..20].to_vec() + } + Err(_) => { + let domain_invalid_snappy: Vec = vec![0x0, 0x0, 0x0, 0x0]; + let mut hasher = Sha256::new(); + hasher.update( + [domain_invalid_snappy.as_slice(), msg.data.as_slice()] + .concat() + .as_slice(), + ); + hasher.finalize()[..20].to_vec() + } + }; + + MessageId(id) +} + +/// Creates the libp2p [Swarm] +fn create_swarm(keypair: Keypair, handler: &BlockHandler) -> Result> { + let transport = tcp::tokio::Transport::new(tcp::Config::default()) + .upgrade(libp2p::core::upgrade::Version::V1Lazy) + .authenticate(noise::Config::new(&keypair)?) + .multiplex(MplexConfig::default()) + .boxed(); + + let behaviour = Behaviour::new(handler)?; + + Ok( + SwarmBuilder::with_tokio_executor(transport, behaviour, PeerId::from(keypair.public())) + .build(), + ) +} + +/// Specifies the [NetworkBehaviour] of the node +#[derive(NetworkBehaviour)] +#[behaviour(out_event = "Event")] +struct Behaviour { + /// Adds [libp2p::ping] to respond to inbound pings, and send periodic outbound pings + ping: ping::Behaviour, + /// Adds [libp2p::gossipsub] to enable gossipsub as the routing layer + gossipsub: gossipsub::Behaviour, +} + +impl Behaviour { + /// Configures the swarm behaviors, subscribes to the gossip topics, and returns a new [Behaviour] + fn new(handler: &BlockHandler) -> Result { + let ping = ping::Behaviour::default(); + + let gossipsub_config = gossipsub::ConfigBuilder::default() + .mesh_n(8) + .mesh_n_low(6) + .mesh_n_high(12) + .gossip_lazy(6) + .heartbeat_interval(Duration::from_millis(500)) + .fanout_ttl(Duration::from_secs(24)) + .history_length(12) + .history_gossip(3) + .duplicate_cache_time(Duration::from_secs(65)) + .validation_mode(gossipsub::ValidationMode::None) + .validate_messages() + .message_id_fn(compute_message_id) + .build() + .map_err(|_| eyre::eyre!("gossipsub config creation failed"))?; + + let mut gossipsub = + gossipsub::Behaviour::new(gossipsub::MessageAuthenticity::Anonymous, gossipsub_config) + .map_err(|_| eyre::eyre!("gossipsub behaviour creation failed"))?; + + handler + .topics() + .iter() + .map(|topic| { + let topic = IdentTopic::new(topic.to_string()); + gossipsub + .subscribe(&topic) + .map_err(|_| eyre::eyre!("subscription failed")) + }) + .collect::>>()?; + + Ok(Self { ping, gossipsub }) + } +} + +/// The type of message received +enum Event { + /// Represents a [ping::Event] + #[allow(dead_code)] + Ping(ping::Event), + /// Represents a [gossipsub::Event] + Gossipsub(gossipsub::Event), +} + +impl Event { + /// Handles received gossipsub messages. Ping messages are ignored. + /// Reports back to [libp2p::gossipsub] to apply peer scoring and forward the message to other peers if accepted. + fn handle(self, swarm: &mut Swarm, handler: &BlockHandler) { + if let Self::Gossipsub(gossipsub::Event::Message { + propagation_source, + message_id, + message, + }) = self + { + let status = handler.handle(message); + + _ = swarm + .behaviour_mut() + .gossipsub + .report_message_validation_result(&message_id, &propagation_source, status); + } + } +} + +impl From for Event { + /// Converts [ping::Event] to [Event] + fn from(value: ping::Event) -> Self { + Event::Ping(value) + } +} + +impl From for Event { + /// Converts [gossipsub::Event] to [Event] + fn from(value: gossipsub::Event) -> Self { + Event::Gossipsub(value) + } +} diff --git a/opstack/src/server/net/mod.rs b/opstack/src/server/net/mod.rs new file mode 100644 index 00000000..d23dbaf4 --- /dev/null +++ b/opstack/src/server/net/mod.rs @@ -0,0 +1,4 @@ +pub mod block_handler; +mod bootnodes; +pub mod discovery; +pub mod gossip; diff --git a/opstack/src/spec.rs b/opstack/src/spec.rs new file mode 100644 index 00000000..338f0745 --- /dev/null +++ b/opstack/src/spec.rs @@ -0,0 +1,307 @@ +use alloy::{ + consensus::{ + BlobTransactionSidecar, Receipt, ReceiptWithBloom, TxReceipt, TxType, TypedTransaction, + }, + network::Network, + primitives::{Address, Bytes, ChainId, TxKind, U256}, + rpc::types::{AccessList, Log, TransactionRequest}, +}; +use helios_core::{network_spec::NetworkSpec, types::Block}; +use op_alloy_consensus::{ + OpDepositReceipt, OpDepositReceiptWithBloom, OpReceiptEnvelope, OpTxType, +}; +use op_alloy_network::{ + BuildResult, Ethereum, NetworkWallet, TransactionBuilder, TransactionBuilderError, +}; +use revm::primitives::{BlobExcessGasAndPrice, BlockEnv, TxEnv}; + +#[derive(Clone, Copy, Debug)] +pub struct OpStack; + +impl NetworkSpec for OpStack { + fn encode_receipt(receipt: &Self::ReceiptResponse) -> Vec { + let receipt = &receipt.inner.inner; + let bloom = receipt.bloom(); + let tx_type = receipt.tx_type(); + let logs = receipt + .logs() + .iter() + .map(|l| l.inner.clone()) + .collect::>(); + + let raw_encoded = match receipt { + OpReceiptEnvelope::Legacy(inner) + | OpReceiptEnvelope::Eip2930(inner) + | OpReceiptEnvelope::Eip1559(inner) + | OpReceiptEnvelope::Eip4844(inner) => { + let r = Receipt { + status: *inner.status_or_post_state(), + cumulative_gas_used: inner.cumulative_gas_used(), + logs, + }; + let rwb = ReceiptWithBloom::new(r, bloom); + alloy::rlp::encode(rwb) + } + OpReceiptEnvelope::Deposit(inner) => { + let r = Receipt { + status: inner.receipt.inner.status, + cumulative_gas_used: inner.receipt.inner.cumulative_gas_used, + logs, + }; + + let r = OpDepositReceipt { + inner: r, + deposit_nonce: inner.receipt.deposit_nonce, + deposit_receipt_version: inner.receipt.deposit_receipt_version, + }; + + let rwb = OpDepositReceiptWithBloom::new(r, bloom); + alloy::rlp::encode(rwb) + } + _ => panic!("unreachable"), + }; + + match tx_type { + OpTxType::Legacy => raw_encoded, + _ => [vec![tx_type as u8], raw_encoded].concat(), + } + } + + fn receipt_contains(list: &[Self::ReceiptResponse], elem: &Self::ReceiptResponse) -> bool { + for receipt in list { + if receipt == elem { + return true; + } + } + + false + } + + fn receipt_logs(receipt: &Self::ReceiptResponse) -> Vec { + receipt.inner.inner.logs().to_vec() + } + + fn tx_env(tx: &Self::TransactionRequest) -> TxEnv { + let mut tx_env = TxEnv::default(); + tx_env.caller = tx.from.unwrap_or_default(); + tx_env.gas_limit = >::gas_limit(tx) + .map(|v| v as u64) + .unwrap_or(u64::MAX); + tx_env.gas_price = >::gas_price(tx) + .map(U256::from) + .unwrap_or_default(); + tx_env.transact_to = tx.to.unwrap_or_default(); + tx_env.value = tx.value.unwrap_or_default(); + tx_env.data = >::input(tx) + .unwrap_or_default() + .clone(); + tx_env.nonce = >::nonce(tx); + tx_env.chain_id = >::chain_id(tx); + tx_env.access_list = >::access_list(tx) + .map(|v| v.to_vec()) + .unwrap_or_default(); + tx_env.gas_priority_fee = + >::max_priority_fee_per_gas(tx) + .map(U256::from); + tx_env.max_fee_per_blob_gas = + >::max_fee_per_gas(tx).map(U256::from); + tx_env.blob_hashes = tx + .blob_versioned_hashes + .as_ref() + .map(|v| v.to_vec()) + .unwrap_or_default(); + + tx_env + } + + fn block_env(block: &Block) -> BlockEnv { + let mut block_env = BlockEnv::default(); + block_env.number = block.number.to(); + block_env.coinbase = block.miner; + block_env.timestamp = block.timestamp.to(); + block_env.gas_limit = block.gas_limit.to(); + block_env.basefee = block.base_fee_per_gas; + block_env.difficulty = block.difficulty; + block_env.prevrandao = Some(block.mix_hash); + block_env.blob_excess_gas_and_price = block + .excess_blob_gas + .map(|v| BlobExcessGasAndPrice::new(v.to())); + + block_env + } +} + +impl Network for OpStack { + type TxType = op_alloy_consensus::OpTxType; + type TxEnvelope = alloy::consensus::TxEnvelope; + type UnsignedTx = alloy::consensus::TypedTransaction; + type ReceiptEnvelope = op_alloy_consensus::OpReceiptEnvelope; + type Header = alloy::consensus::Header; + type TransactionRequest = TransactionRequest; + type TransactionResponse = alloy::rpc::types::Transaction; + type ReceiptResponse = op_alloy_rpc_types::OpTransactionReceipt; + type HeaderResponse = alloy::rpc::types::Header; +} + +impl TransactionBuilder for TransactionRequest { + fn chain_id(&self) -> Option { + self.chain_id + } + + fn set_chain_id(&mut self, chain_id: ChainId) { + self.chain_id = Some(chain_id); + } + + fn nonce(&self) -> Option { + self.nonce + } + + fn set_nonce(&mut self, nonce: u64) { + self.nonce = Some(nonce); + } + + fn input(&self) -> Option<&Bytes> { + self.input.input() + } + + fn set_input>(&mut self, input: T) { + self.input.input = Some(input.into()); + } + + fn from(&self) -> Option
{ + self.from + } + + fn set_from(&mut self, from: Address) { + self.from = Some(from); + } + + fn kind(&self) -> Option { + self.to + } + + fn clear_kind(&mut self) { + self.to = None; + } + + fn set_kind(&mut self, kind: TxKind) { + self.to = Some(kind); + } + + fn value(&self) -> Option { + self.value + } + + fn set_value(&mut self, value: U256) { + self.value = Some(value) + } + + fn gas_price(&self) -> Option { + self.gas_price + } + + fn set_gas_price(&mut self, gas_price: u128) { + self.gas_price = Some(gas_price); + } + + fn max_fee_per_gas(&self) -> Option { + self.max_fee_per_gas + } + + fn set_max_fee_per_gas(&mut self, max_fee_per_gas: u128) { + self.max_fee_per_gas = Some(max_fee_per_gas); + } + + fn max_priority_fee_per_gas(&self) -> Option { + self.max_priority_fee_per_gas + } + + fn set_max_priority_fee_per_gas(&mut self, max_priority_fee_per_gas: u128) { + self.max_priority_fee_per_gas = Some(max_priority_fee_per_gas); + } + + fn max_fee_per_blob_gas(&self) -> Option { + self.max_fee_per_blob_gas + } + + fn set_max_fee_per_blob_gas(&mut self, max_fee_per_blob_gas: u128) { + self.max_fee_per_blob_gas = Some(max_fee_per_blob_gas) + } + + fn gas_limit(&self) -> Option { + self.gas + } + + fn set_gas_limit(&mut self, gas_limit: u128) { + self.gas = Some(gas_limit); + } + + fn access_list(&self) -> Option<&AccessList> { + self.access_list.as_ref() + } + + fn set_access_list(&mut self, access_list: AccessList) { + self.access_list = Some(access_list); + } + + fn blob_sidecar(&self) -> Option<&BlobTransactionSidecar> { + self.sidecar.as_ref() + } + + fn set_blob_sidecar(&mut self, sidecar: BlobTransactionSidecar) { + TransactionBuilder::::set_blob_sidecar(self, sidecar) + } + + fn complete_type(&self, ty: OpTxType) -> Result<(), Vec<&'static str>> { + match ty { + OpTxType::Deposit => Err(vec!["not implemented for deposit tx"]), + _ => { + let ty = TxType::try_from(ty as u8).unwrap(); + TransactionBuilder::::complete_type(self, ty) + } + } + } + + fn can_submit(&self) -> bool { + TransactionBuilder::::can_submit(self) + } + + fn can_build(&self) -> bool { + TransactionBuilder::::can_build(self) + } + + #[doc(alias = "output_transaction_type")] + fn output_tx_type(&self) -> OpTxType { + OpTxType::try_from(self.preferred_type() as u8).unwrap() + } + + #[doc(alias = "output_transaction_type_checked")] + fn output_tx_type_checked(&self) -> Option { + self.buildable_type() + .map(|tx_ty| OpTxType::try_from(tx_ty as u8).unwrap()) + } + + fn prep_for_submission(&mut self) { + self.transaction_type = Some(self.preferred_type() as u8); + self.trim_conflicting_keys(); + self.populate_blob_hashes(); + } + + fn build_unsigned(self) -> BuildResult { + if let Err((tx_type, missing)) = self.missing_keys() { + let tx_type = OpTxType::try_from(tx_type as u8).unwrap(); + return Err( + TransactionBuilderError::InvalidTransactionRequest(tx_type, missing) + .into_unbuilt(self), + ); + } + Ok(self.build_typed_tx().expect("checked by missing_keys")) + } + + async fn build>( + self, + wallet: &W, + ) -> Result<::TxEnvelope, TransactionBuilderError> { + Ok(wallet.sign_request(self).await?) + } +} diff --git a/opstack/src/types.rs b/opstack/src/types.rs new file mode 100644 index 00000000..be8c0d79 --- /dev/null +++ b/opstack/src/types.rs @@ -0,0 +1,36 @@ +use alloy::primitives::{Address, B256, U256}; +use ssz_derive::{Decode, Encode}; +use ssz_types::{FixedVector, VariableList}; + +#[derive(Debug, Clone, Encode, Decode)] +pub struct ExecutionPayload { + pub parent_hash: B256, + pub fee_recipient: Address, + pub state_root: B256, + pub receipts_root: B256, + pub logs_bloom: LogsBloom, + pub prev_randao: B256, + pub block_number: u64, + pub gas_limit: u64, + pub gas_used: u64, + pub timestamp: u64, + pub extra_data: ExtraData, + pub base_fee_per_gas: U256, + pub block_hash: B256, + pub transactions: VariableList, + pub withdrawals: VariableList, + pub blob_gas_used: u64, + pub excess_blob_gas: u64, +} + +pub type Transaction = VariableList; +pub type LogsBloom = FixedVector; +pub type ExtraData = VariableList; + +#[derive(Clone, Debug, Encode, Decode)] +pub struct Withdrawal { + index: u64, + validator_index: u64, + address: Address, + amount: u64, +} From 0c333ff9b2d1a1a732ba23240e18acbd2a6b74fa Mon Sep 17 00:00:00 2001 From: Noah Citron Date: Wed, 2 Oct 2024 19:41:19 -0400 Subject: [PATCH 03/10] fix: release ci (#383) --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b632ac0c..7db8da54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: build - run: cargo build --package cli --release --target aarch64-apple-darwin + run: cargo build --package helios-cli --release --target aarch64-apple-darwin - name: archive run: gtar -czvf "helios_darwin_arm64.tar.gz" -C ./target/aarch64-apple-darwin/release helios @@ -62,7 +62,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: build - run: cargo build --package cli --release --target x86_64-apple-darwin + run: cargo build --package helios-cli --release --target x86_64-apple-darwin - name: archive run: gtar -czvf "helios_darwin_amd64.tar.gz" -C ./target/x86_64-apple-darwin/release helios @@ -107,7 +107,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: build - run: cargo build --package cli --release --target aarch64-unknown-linux-gnu + run: cargo build --package helios-cli --release --target aarch64-unknown-linux-gnu - name: archive run: tar -czvf "helios_linux_arm64.tar.gz" -C ./target/aarch64-unknown-linux-gnu/release helios @@ -146,7 +146,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: build - run: cargo build --package cli --release --target x86_64-unknown-linux-gnu + run: cargo build --package helios-cli --release --target x86_64-unknown-linux-gnu - name: archive run: tar -czvf "helios_linux_amd64.tar.gz" -C ./target/x86_64-unknown-linux-gnu/release helios @@ -194,7 +194,7 @@ jobs: prefix-key: "fresh2" - name: build - run: cargo build --package cli --release --target armv7-unknown-linux-gnueabihf + run: cargo build --package helios-cli --release --target armv7-unknown-linux-gnueabihf - name: archive run: tar -czvf "helios_linux_armv7.tar.gz" -C ./target/armv7-unknown-linux-gnueabihf/release helios From 7283ca862bb2c35ee9313b8159685838fb0b89e5 Mon Sep 17 00:00:00 2001 From: Noah Citron Date: Mon, 7 Oct 2024 17:46:24 -0400 Subject: [PATCH 04/10] feat: wasm support for all networks (#384) * feat: wasm support for all networks * cleanup --- Cargo.lock | 87 ++ Cargo.toml | 2 +- core/src/client/mod.rs | 1 + core/src/errors.rs | 1 + core/src/execution/rpc/http_rpc.rs | 7 + ethereum/src/config/checkpoints.rs | 5 + helios-ts/Cargo.toml | 9 +- helios-ts/index.html | 203 ++- helios-ts/lib.ts | 47 +- helios-ts/package-lock.json | 2219 +++++++++++++++++++++++++++- helios-ts/run.sh | 9 - helios-ts/src/ethereum.rs | 241 +++ helios-ts/src/lib.rs | 234 +-- helios-ts/src/opstack.rs | 182 +++ helios-ts/src/storage.rs | 3 +- opstack/Cargo.toml | 21 +- opstack/src/builder.rs | 1 + opstack/src/consensus.rs | 22 +- opstack/src/lib.rs | 1 + 19 files changed, 2977 insertions(+), 318 deletions(-) create mode 100644 helios-ts/src/ethereum.rs create mode 100644 helios-ts/src/opstack.rs diff --git a/Cargo.lock b/Cargo.lock index ff0b8853..166b7c16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1527,6 +1527,16 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + [[package]] name = "const-hex" version = "1.13.1" @@ -3134,6 +3144,7 @@ dependencies = [ "ethereum_ssz_derive 0.6.0", "eyre", "figment", + "getrandom 0.2.15", "helios-core", "hex", "libp2p", @@ -3141,6 +3152,7 @@ dependencies = [ "op-alloy-consensus", "op-alloy-network", "op-alloy-rpc-types", + "parking_lot 0.12.3", "reqwest", "revm", "serde", @@ -3153,6 +3165,28 @@ dependencies = [ "typenum", "unsigned-varint", "url", + "wasm-bindgen-futures", + "zduny-wasm-timer", +] + +[[package]] +name = "helios-ts" +version = "0.1.0" +dependencies = [ + "alloy", + "console_error_panic_hook", + "eyre", + "helios-core", + "helios-ethereum", + "helios-opstack", + "hex", + "serde", + "serde-wasm-bindgen", + "serde_json", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "web-sys", ] [[package]] @@ -4459,6 +4493,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minicov" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c71e683cd655513b99affab7d317deb690528255a0d5f717f1024093c12b169" +dependencies = [ + "cc", + "walkdir", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -6159,6 +6203,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -6276,6 +6326,17 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_derive" version = "1.0.210" @@ -7579,6 +7640,32 @@ version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +[[package]] +name = "wasm-bindgen-test" +version = "0.3.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68497a05fb21143a08a7d24fc81763384a3072ee43c44e86aad1744d6adef9d9" +dependencies = [ + "console_error_panic_hook", + "js-sys", + "minicov", + "scoped-tls", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8220be1fa9e4c889b30fd207d4906657e7e90b12e0e6b0c8b8d8709f5de021" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "wasm-timer" version = "0.2.5" diff --git a/Cargo.toml b/Cargo.toml index 142a4694..2e0a2684 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ "ethereum", "ethereum/consensus-core", "opstack", - #"helios-ts", + "helios-ts", ] default-members = ["cli"] diff --git a/core/src/client/mod.rs b/core/src/client/mod.rs index 3a1216ac..c74441a3 100644 --- a/core/src/client/mod.rs +++ b/core/src/client/mod.rs @@ -9,6 +9,7 @@ use tracing::{info, warn}; use zduny_wasm_timer::Delay; use crate::client::node::Node; +#[cfg(not(target_arch = "wasm32"))] use crate::client::rpc::Rpc; use crate::consensus::Consensus; use crate::network_spec::NetworkSpec; diff --git a/core/src/errors.rs b/core/src/errors.rs index ab832897..378e5268 100644 --- a/core/src/errors.rs +++ b/core/src/errors.rs @@ -31,6 +31,7 @@ impl From for ClientError { } } +#[cfg(not(target_arch = "wasm32"))] impl From for jsonrpsee::core::Error { fn from(value: ClientError) -> Self { jsonrpsee::core::Error::Custom(value.to_string()) diff --git a/core/src/execution/rpc/http_rpc.rs b/core/src/execution/rpc/http_rpc.rs index fb4f5a6f..ecd04dad 100644 --- a/core/src/execution/rpc/http_rpc.rs +++ b/core/src/execution/rpc/http_rpc.rs @@ -17,7 +17,10 @@ use super::ExecutionRpc; pub struct HttpRpc { url: String, + #[cfg(not(target_arch = "wasm32"))] provider: RootProvider>, N>, + #[cfg(target_arch = "wasm32")] + provider: RootProvider, N>, } impl Clone for HttpRpc { @@ -30,10 +33,14 @@ impl Clone for HttpRpc { #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] impl ExecutionRpc for HttpRpc { fn new(rpc: &str) -> Result { + #[cfg(not(target_arch = "wasm32"))] let client = ClientBuilder::default() .layer(RetryBackoffLayer::new(100, 50, 300)) .http(rpc.parse().unwrap()); + #[cfg(target_arch = "wasm32")] + let client = ClientBuilder::default().http(rpc.parse().unwrap()); + let provider = ProviderBuilder::new().network::().on_client(client); Ok(HttpRpc { diff --git a/ethereum/src/config/checkpoints.rs b/ethereum/src/config/checkpoints.rs index dac2b5cc..0f1032e1 100644 --- a/ethereum/src/config/checkpoints.rs +++ b/ethereum/src/config/checkpoints.rs @@ -83,10 +83,15 @@ pub struct CheckpointFallback { async fn get(req: &str) -> Result { retry( || async { + #[cfg(not(target_arch = "wasm32"))] let client = ClientBuilder::new() .timeout(Duration::from_secs(1)) .build() .unwrap(); + + #[cfg(target_arch = "wasm32")] + let client = ClientBuilder::new().build().unwrap(); + Ok::<_, eyre::Report>(client.get(req).send().await?) }, BackoffSettings::default(), diff --git a/helios-ts/Cargo.toml b/helios-ts/Cargo.toml index bc8d356c..2af28bca 100644 --- a/helios-ts/Cargo.toml +++ b/helios-ts/Cargo.toml @@ -22,12 +22,9 @@ hex = "0.4.3" serde = { version = "1.0.143", features = ["derive"] } serde_json = "1.0.85" -client = { path = "../client" } -consensus = { path = "../consensus" } -execution = { path = "../execution" } -config = { path = "../config" } -common = { path = "../common" } - +helios-core = { path = "../core" } +helios-ethereum = { path = "../ethereum" } +helios-opstack = { path = "../opstack" } [dependencies.web-sys] version = "0.3" diff --git a/helios-ts/index.html b/helios-ts/index.html index 3b201ca4..c0eea8ad 100644 --- a/helios-ts/index.html +++ b/helios-ts/index.html @@ -1,24 +1,189 @@ - - - - hello-wasm example - - - - - + + + + + +
+

Helios Demo

+

Fast, Secure, and Portable Multichain Light Client

+
+ +
+
+

Ethereum

+
+
Syncing...
+
+
+
+

Optimism

+
+
Syncing...
+
+
+
+

Base

+
+
Syncing...
+
+
+
+ + - + + // Function to update block info for a network + async function updateBlockInfo(provider, networkName) { + if (provider) { + try { + const blockNumber = await provider.getBlockNumber(); + if (provider.lastUpdate == undefined || blockNumber > provider.lastUpdate) { + provider.lastUpdate = blockNumber; + const block = await provider.getBlock(blockNumber); + const blocksContainer = document.getElementById(networkName + "-blocks"); + + const blockEntry = document.createElement('pre'); + blockEntry.className = 'block-info'; + blockEntry.textContent = JSON.stringify({ + number: block.number, + hash: block.hash, + timestamp: new Date(block.timestamp * 1000).toLocaleString().replace(",", ""), + transactions: block.transactions.length, + }, null, 2); + + blocksContainer.insertBefore(blockEntry, blocksContainer.firstChild); + + let syncingElement = document.getElementById(networkName + "-syncing"); + if (syncingElement) { + syncingElement.remove(); + } + + if (blocksContainer.childElementCount > 100) { + blocksContainer.removeChild(blocksContainer.lastChild); + } + } + } catch (error) { + console.error(`Error fetching block for ${networkName}:`, error); + } + } + } + + setInterval(async () => updateBlockInfo(window.heliosEthereum, "ethereum"), 1000); + setInterval(async () => updateBlockInfo(window.heliosOptimism, "optimism"), 1000); + setInterval(async () => updateBlockInfo(window.heliosBase, "base"), 1000); + }); + + diff --git a/helios-ts/lib.ts b/helios-ts/lib.ts index fb015047..58242098 100644 --- a/helios-ts/lib.ts +++ b/helios-ts/lib.ts @@ -1,11 +1,8 @@ -import init, { Client } from "./pkg/index"; +import initWasm, { EthereumClient, OpStackClient } from "./pkg/index"; -export async function createHeliosProvider( - config: Config -): Promise { +export async function init() { const wasmData = require("./pkg/index_bg.wasm"); - await init(wasmData); - return new HeliosProvider(config); + await initWasm(wasmData); } /// An EIP-1193 compliant Ethereum provider. Treat this the same as you @@ -15,20 +12,32 @@ export class HeliosProvider { #chainId; /// Do not use this constructor. Instead use the createHeliosProvider function. - constructor(config: Config) { - const executionRpc = config.executionRpc; - const consensusRpc = config.consensusRpc; - const checkpoint = config.checkpoint; - const network = config.network ?? Network.MAINNET; - const dbType = config.dbType ?? "localstorage"; + constructor(config: Config, kind: "ethereum" | "opstack") { + if (kind === "ethereum") { + const executionRpc = config.executionRpc; + const consensusRpc = config.consensusRpc; + const checkpoint = config.checkpoint; + const network = config.network ?? Network.MAINNET; + const dbType = config.dbType ?? "localstorage"; - this.#client = new Client( - executionRpc, - consensusRpc, - network, - checkpoint, - dbType - ); + this.#client = new EthereumClient( + executionRpc, + consensusRpc, + network, + checkpoint, + dbType + ); + } else if (kind === "opstack") { + const executionRpc = config.executionRpc; + const network = config.network; + + this.#client = new OpStackClient( + executionRpc, + network, + ); + } else { + throw "invalid kind: must be ethereum or opstack"; + } this.#chainId = this.#client.chain_id(); } diff --git a/helios-ts/package-lock.json b/helios-ts/package-lock.json index 80c60219..43ccba46 100644 --- a/helios-ts/package-lock.json +++ b/helios-ts/package-lock.json @@ -13,6 +13,7 @@ }, "devDependencies": { "@wasm-tool/wasm-pack-plugin": "^1.6.0", + "local-cors-proxy": "^1.1.0", "ts-loader": "^9.4.1", "typescript": "^4.9.3", "webpack": "^5.75.0", @@ -1071,6 +1072,19 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/acorn": { "version": "8.8.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", @@ -1137,6 +1151,69 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "dev": true + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "dev": true, + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, "node_modules/bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", @@ -1147,6 +1224,30 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", @@ -1198,6 +1299,34 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001450", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001450.tgz", @@ -1214,6 +1343,12 @@ } ] }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "dev": true + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1277,18 +1412,100 @@ "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", "dev": true }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/command-exists": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", "dev": true }, + "node_modules/command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "dev": true, + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1303,6 +1520,88 @@ "node": ">= 8" } }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dev": true, + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true + }, "node_modules/electron-to-chromium": { "version": "1.4.286", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.286.tgz", @@ -1328,6 +1627,15 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/enhanced-resolve": { "version": "5.12.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", @@ -1353,6 +1661,27 @@ "node": ">=4" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", @@ -1368,6 +1697,12 @@ "node": ">=6" } }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1420,6 +1755,15 @@ "node": ">=4.0" } }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/ethers": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", @@ -1476,6 +1820,63 @@ "node": ">=0.8.x" } }, + "node_modules/express": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "dev": true, + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.10", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "dev": true, + "engines": [ + "node >=0.6.0" + ] + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1509,6 +1910,36 @@ "node": ">=8" } }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dev": true, + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -1522,11 +1953,83 @@ "node": ">=8" } }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + } }, "node_modules/glob-to-regexp": { "version": "0.4.1", @@ -1534,12 +2037,47 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "dev": true, + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1561,6 +2099,42 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -1570,6 +2144,18 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -1580,6 +2166,49 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -1613,6 +2242,15 @@ "node": ">=10.13.0" } }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/is-core-module": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", @@ -1646,6 +2284,12 @@ "node": ">=0.10.0" } }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1661,6 +2305,12 @@ "node": ">=0.10.0" } }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "dev": true + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -1695,18 +2345,51 @@ "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dev": true, + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -1725,6 +2408,84 @@ "node": ">=6.11.5" } }, + "node_modules/local-cors-proxy": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/local-cors-proxy/-/local-cors-proxy-1.1.0.tgz", + "integrity": "sha512-1UVrdG10HAT58TNZBhYSeMPkwQANuJunFsWBgEYOd1RChLDHGhvNPjUT8JsOlcqoJyr0QOH9cLx9IOLATf4j5w==", + "dev": true, + "dependencies": { + "chalk": "^2.3.2", + "command-line-args": "^5.0.2", + "cors": "^2.8.4", + "express": "^4.16.3", + "request": "^2.85.0" + }, + "bin": { + "lcp": "bin/lcp.js" + } + }, + "node_modules/local-cors-proxy/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/local-cors-proxy/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/local-cors-proxy/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/local-cors-proxy/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/local-cors-proxy/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/local-cors-proxy/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -1737,6 +2498,12 @@ "node": ">=8" } }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1749,12 +2516,39 @@ "node": ">=10" } }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", @@ -1768,6 +2562,18 @@ "node": ">=8.6" } }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1799,6 +2605,21 @@ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -1811,6 +2632,48 @@ "integrity": "sha512-2xfmOrRkGogbTK9R6Leda0DGiXeY3p2NJpy4+gNCffdUvV6mdEJnaDEic1i3Ec2djAo8jWYoJMR5PB0MSMpxUA==", "dev": true }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -1847,6 +2710,15 @@ "node": ">=6" } }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1871,6 +2743,18 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-to-regexp": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", + "dev": true + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "dev": true + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -1901,6 +2785,25 @@ "node": ">=8" } }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -1910,6 +2813,21 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1919,6 +2837,30 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/rechoir": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", @@ -1931,6 +2873,47 @@ "node": ">= 10.13.0" } }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -1989,6 +2972,12 @@ } ] }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "node_modules/schema-utils": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", @@ -2024,9 +3013,48 @@ "semver": "bin/semver.js" }, "engines": { - "node": ">=10" + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" } }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node_modules/serialize-javascript": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", @@ -2036,6 +3064,44 @@ "randombytes": "^2.1.0" } }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "dev": true, + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, "node_modules/shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -2069,6 +3135,24 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2088,6 +3172,40 @@ "source-map": "^0.6.0" } }, + "node_modules/sshpk": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "dev": true, + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2185,6 +3303,28 @@ "node": ">=8.0" } }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/ts-loader": { "version": "9.4.2", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", @@ -2204,6 +3344,37 @@ "webpack": "^5.0.0" } }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "dev": true + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -2217,6 +3388,24 @@ "node": ">=4.2.0" } }, + "node_modules/typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/update-browserslist-db": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", @@ -2252,6 +3441,48 @@ "punycode": "^2.1.0" } }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -3144,6 +4375,16 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + } + }, "acorn": { "version": "8.8.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", @@ -3190,6 +4431,60 @@ "color-convert": "^2.0.1" } }, + "array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true + }, + "asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "dev": true + }, + "aws4": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, "bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", @@ -3200,6 +4495,26 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, + "body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + } + }, "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", @@ -3232,12 +4547,37 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, "caniuse-lite": { "version": "1.0.30001450", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001450.tgz", "integrity": "sha512-qMBmvmQmFXaSxexkjjfMvD5rnDL0+m+dUMZKoDYsGG8iZN29RuYh9eRoMvKsT6uMAWlyUUGDEQGJJYjzCIO9ew==", "dev": true }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "dev": true + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3286,18 +4626,82 @@ "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", "dev": true }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, "command-exists": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", "dev": true }, + "command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "dev": true, + "requires": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + } + }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "requires": { + "safe-buffer": "5.2.1" + } + }, + "content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true + }, + "cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -3309,6 +4713,69 @@ "which": "^2.0.1" } }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true + }, "electron-to-chromium": { "version": "1.4.286", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.286.tgz", @@ -3336,6 +4803,12 @@ } } }, + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true + }, "enhanced-resolve": { "version": "5.12.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", @@ -3352,6 +4825,21 @@ "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", "dev": true }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, "es-module-lexer": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", @@ -3364,6 +4852,12 @@ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -3403,6 +4897,12 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true + }, "ethers": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", @@ -3446,6 +4946,57 @@ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true }, + "express": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "dev": true, + "requires": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.10", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "dev": true + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3470,37 +5021,137 @@ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + } + }, + "find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dev": true, + "requires": { + "array-back": "^3.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "dev": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "assert-plus": "^1.0.0" } }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, "glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -3516,6 +5167,27 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, "hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -3525,6 +5197,15 @@ "minimalistic-assert": "^1.0.1" } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -3535,6 +5216,39 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, "import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -3556,6 +5270,12 @@ "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", "dev": true }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true + }, "is-core-module": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", @@ -3580,6 +5300,12 @@ "isobject": "^3.0.1" } }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -3592,6 +5318,12 @@ "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "dev": true + }, "jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -3619,18 +5351,48 @@ "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "dev": true + }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -3643,6 +5405,71 @@ "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true }, + "local-cors-proxy": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/local-cors-proxy/-/local-cors-proxy-1.1.0.tgz", + "integrity": "sha512-1UVrdG10HAT58TNZBhYSeMPkwQANuJunFsWBgEYOd1RChLDHGhvNPjUT8JsOlcqoJyr0QOH9cLx9IOLATf4j5w==", + "dev": true, + "requires": { + "chalk": "^2.3.2", + "command-line-args": "^5.0.2", + "cors": "^2.8.4", + "express": "^4.16.3", + "request": "^2.85.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -3652,6 +5479,12 @@ "p-locate": "^4.1.0" } }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -3661,12 +5494,30 @@ "yallist": "^4.0.0" } }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true + }, + "merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true + }, "micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", @@ -3677,6 +5528,12 @@ "picomatch": "^2.3.1" } }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -3702,6 +5559,18 @@ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -3714,6 +5583,33 @@ "integrity": "sha512-2xfmOrRkGogbTK9R6Leda0DGiXeY3p2NJpy4+gNCffdUvV6mdEJnaDEic1i3Ec2djAo8jWYoJMR5PB0MSMpxUA==", "dev": true }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true + }, + "object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true + }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -3738,6 +5634,12 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -3756,6 +5658,18 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "path-to-regexp": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "dev": true + }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -3777,12 +5691,37 @@ "find-up": "^4.0.0" } }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, "punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true }, + "qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "requires": { + "side-channel": "^1.0.6" + } + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3792,6 +5731,24 @@ "safe-buffer": "^5.1.0" } }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, "rechoir": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", @@ -3801,6 +5758,42 @@ "resolve": "^1.20.0" } }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "dev": true + } + } + }, "resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -3833,6 +5826,12 @@ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "schema-utils": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", @@ -3858,6 +5857,41 @@ "lru-cache": "^6.0.0" } }, + "send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, "serialize-javascript": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", @@ -3867,6 +5901,38 @@ "randombytes": "^2.1.0" } }, + "serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "dev": true, + "requires": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + } + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, "shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -3891,6 +5957,18 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3907,6 +5985,29 @@ "source-map": "^0.6.0" } }, + "sshpk": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -3962,6 +6063,22 @@ "is-number": "^7.0.0" } }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, "ts-loader": { "version": "9.4.2", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", @@ -3974,12 +6091,49 @@ "semver": "^7.3.4" } }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, "typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, + "typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true + }, "update-browserslist-db": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", @@ -3999,6 +6153,35 @@ "punycode": "^2.1.0" } }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, "watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", diff --git a/helios-ts/run.sh b/helios-ts/run.sh index 2598996e..880d07c2 100755 --- a/helios-ts/run.sh +++ b/helios-ts/run.sh @@ -1,12 +1,3 @@ set -e - -if [ -z $ETH_RPC_URL ]; then - echo "ETH_RPC_URL not set" - exit 1 -fi - -(&>/dev/null lcp --proxyUrl $ETH_RPC_URL --port 9001 &) -(&>/dev/null lcp --proxyUrl https://www.lightclientdata.org --port 9002 &) - npm run build simple-http-server diff --git a/helios-ts/src/ethereum.rs b/helios-ts/src/ethereum.rs new file mode 100644 index 00000000..26872ef8 --- /dev/null +++ b/helios-ts/src/ethereum.rs @@ -0,0 +1,241 @@ +extern crate console_error_panic_hook; +extern crate web_sys; + +use std::str::FromStr; + +use alloy::hex::FromHex; +use alloy::primitives::{Address, B256}; +use alloy::rpc::types::{Filter, TransactionRequest}; +use eyre::Result; +use wasm_bindgen::prelude::*; + +use helios_core::types::BlockTag; +use helios_ethereum::config::{networks, Config}; +use helios_ethereum::database::{ConfigDB, Database}; +use helios_ethereum::EthereumClientBuilder; + +use crate::map_err; +use crate::storage::LocalStorageDB; + +#[derive(Clone)] +pub enum DatabaseType { + Memory(ConfigDB), + LocalStorage(LocalStorageDB), +} + +impl Database for DatabaseType { + fn new(config: &Config) -> Result { + // Implement this method based on the behavior of ConfigDB and LocalStorageDB + match config.database_type.as_deref() { + Some("config") => Ok(DatabaseType::Memory(ConfigDB::new(config)?)), + Some("localstorage") => Ok(DatabaseType::LocalStorage(LocalStorageDB::new(config)?)), + _ => Ok(DatabaseType::Memory(ConfigDB::new(config)?)), + } + } + + fn load_checkpoint(&self) -> Result { + match self { + DatabaseType::Memory(db) => db.load_checkpoint(), + DatabaseType::LocalStorage(db) => db.load_checkpoint(), + } + } + + fn save_checkpoint(&self, checkpoint: B256) -> Result<()> { + match self { + DatabaseType::Memory(db) => db.save_checkpoint(checkpoint), + DatabaseType::LocalStorage(db) => db.save_checkpoint(checkpoint), + } + } +} + +#[wasm_bindgen] +pub struct EthereumClient { + inner: helios_ethereum::EthereumClient, + chain_id: u64, +} + +#[wasm_bindgen] +impl EthereumClient { + #[wasm_bindgen(constructor)] + pub fn new( + execution_rpc: String, + consensus_rpc: Option, + network: String, + checkpoint: Option, + db_type: String, + ) -> Result { + console_error_panic_hook::set_once(); + + let base = match network.as_str() { + "mainnet" => networks::mainnet(), + "sepolia" => networks::sepolia(), + "holesky" => networks::holesky(), + other => Err(JsError::new(&format!("invalid network: {}", other)))?, + }; + + let chain_id = base.chain.chain_id; + + let checkpoint = Some( + checkpoint + .as_ref() + .map(|c| c.strip_prefix("0x").unwrap_or(c.as_str())) + .and_then(|c| B256::from_hex(c).ok()) + .unwrap_or(base.default_checkpoint), + ); + + let consensus_rpc = if let Some(rpc) = consensus_rpc { + rpc + } else { + base.consensus_rpc + .ok_or(JsError::new("consensus rpc not found"))? + }; + + let config = Config { + execution_rpc, + consensus_rpc, + checkpoint, + + chain: base.chain, + forks: base.forks, + + database_type: Some(db_type), + ..Default::default() + }; + + let inner = map_err(EthereumClientBuilder::new().config(config).build())?; + + Ok(Self { inner, chain_id }) + } + + #[wasm_bindgen] + pub async fn sync(&mut self) -> Result<(), JsError> { + map_err(self.inner.start().await) + } + + #[wasm_bindgen] + pub async fn wait_synced(&self) { + self.inner.wait_synced().await; + } + + #[wasm_bindgen] + pub fn chain_id(&self) -> u32 { + self.chain_id as u32 + } + + #[wasm_bindgen] + pub async fn get_block_number(&self) -> Result { + map_err(self.inner.get_block_number().await).map(|v| v.to()) + } + + #[wasm_bindgen] + pub async fn get_balance(&self, addr: JsValue, block: JsValue) -> Result { + let addr: Address = serde_wasm_bindgen::from_value(addr)?; + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let res = map_err(self.inner.get_balance(addr, block).await); + res.map(|v| v.to_string()) + } + + #[wasm_bindgen] + pub async fn get_transaction_by_hash(&self, hash: String) -> Result { + let hash = B256::from_str(&hash)?; + let tx = self.inner.get_transaction_by_hash(hash).await; + Ok(serde_wasm_bindgen::to_value(&tx)?) + } + + #[wasm_bindgen] + pub async fn get_transaction_count( + &self, + addr: JsValue, + block: JsValue, + ) -> Result { + let addr: Address = serde_wasm_bindgen::from_value(addr)?; + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + Ok(map_err(self.inner.get_nonce(addr, block).await)? as u32) + } + + #[wasm_bindgen] + pub async fn get_block_transaction_count_by_hash(&self, hash: JsValue) -> Result { + let hash: B256 = serde_wasm_bindgen::from_value(hash)?; + let count = map_err(self.inner.get_block_transaction_count_by_hash(hash).await)?; + Ok(count as u32) + } + + #[wasm_bindgen] + pub async fn get_block_transaction_count_by_number( + &self, + block: JsValue, + ) -> Result { + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let res = self + .inner + .get_block_transaction_count_by_number(block) + .await; + Ok(map_err(res)? as u32) + } + + #[wasm_bindgen] + pub async fn get_block_by_number( + &self, + block: JsValue, + full_tx: bool, + ) -> Result { + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let block = map_err(self.inner.get_block_by_number(block, full_tx).await)?; + Ok(serde_wasm_bindgen::to_value(&block)?) + } + + #[wasm_bindgen] + pub async fn get_code(&self, addr: JsValue, block: JsValue) -> Result { + let addr: Address = serde_wasm_bindgen::from_value(addr)?; + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let code = map_err(self.inner.get_code(addr, block).await)?; + Ok(format!("0x{}", hex::encode(code))) + } + + #[wasm_bindgen] + pub async fn call(&self, opts: JsValue, block: JsValue) -> Result { + let opts: TransactionRequest = serde_wasm_bindgen::from_value(opts)?; + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let res = map_err(self.inner.call(&opts, block).await)?; + Ok(format!("0x{}", hex::encode(res))) + } + + #[wasm_bindgen] + pub async fn estimate_gas(&self, opts: JsValue) -> Result { + let opts: TransactionRequest = serde_wasm_bindgen::from_value(opts)?; + Ok(map_err(self.inner.estimate_gas(&opts).await)? as u32) + } + + #[wasm_bindgen] + pub async fn gas_price(&self) -> Result { + let price = map_err(self.inner.get_gas_price().await)?; + Ok(serde_wasm_bindgen::to_value(&price)?) + } + + #[wasm_bindgen] + pub async fn max_priority_fee_per_gas(&self) -> Result { + let price = map_err(self.inner.get_priority_fee().await)?; + Ok(serde_wasm_bindgen::to_value(&price)?) + } + + #[wasm_bindgen] + pub async fn send_raw_transaction(&self, tx: String) -> Result { + let tx = hex::decode(tx)?; + let hash = map_err(self.inner.send_raw_transaction(&tx).await)?; + Ok(serde_wasm_bindgen::to_value(&hash)?) + } + + #[wasm_bindgen] + pub async fn get_transaction_receipt(&self, tx: JsValue) -> Result { + let tx: B256 = serde_wasm_bindgen::from_value(tx)?; + let receipt = map_err(self.inner.get_transaction_receipt(tx).await)?; + Ok(serde_wasm_bindgen::to_value(&receipt)?) + } + + #[wasm_bindgen] + pub async fn get_logs(&self, filter: JsValue) -> Result { + let filter: Filter = serde_wasm_bindgen::from_value(filter)?; + let logs = map_err(self.inner.get_logs(&filter).await)?; + Ok(serde_wasm_bindgen::to_value(&logs)?) + } +} diff --git a/helios-ts/src/lib.rs b/helios-ts/src/lib.rs index 472d7d45..3d41b8e0 100644 --- a/helios-ts/src/lib.rs +++ b/helios-ts/src/lib.rs @@ -1,20 +1,8 @@ -extern crate console_error_panic_hook; -extern crate web_sys; - -use std::str::FromStr; - -use alloy::hex::FromHex; -use alloy::primitives::{Address, B256}; -use alloy::rpc::types::{Filter, TransactionRequest}; use eyre::Result; -use wasm_bindgen::prelude::*; - -use common::types::BlockTag; -use config::{networks, Config}; -use consensus::database::{ConfigDB, Database}; - -use crate::storage::LocalStorageDB; +use wasm_bindgen::JsError; +pub mod ethereum; +pub mod opstack; pub mod storage; #[allow(unused_macros)] @@ -24,218 +12,6 @@ macro_rules! log { } } -#[derive(Clone)] -pub enum DatabaseType { - Memory(ConfigDB), - LocalStorage(LocalStorageDB), -} - -impl Database for DatabaseType { - fn new(config: &Config) -> Result { - // Implement this method based on the behavior of ConfigDB and LocalStorageDB - match config.database_type.as_deref() { - Some("config") => Ok(DatabaseType::Memory(ConfigDB::new(config)?)), - Some("localstorage") => Ok(DatabaseType::LocalStorage(LocalStorageDB::new(config)?)), - _ => Ok(DatabaseType::Memory(ConfigDB::new(config)?)), - } - } - - fn load_checkpoint(&self) -> Result { - match self { - DatabaseType::Memory(db) => db.load_checkpoint(), - DatabaseType::LocalStorage(db) => db.load_checkpoint(), - } - } - - fn save_checkpoint(&self, checkpoint: B256) -> Result<()> { - match self { - DatabaseType::Memory(db) => db.save_checkpoint(checkpoint), - DatabaseType::LocalStorage(db) => db.save_checkpoint(checkpoint), - } - } -} - -#[wasm_bindgen] -pub struct Client { - inner: client::Client, - chain_id: u64, -} - -#[wasm_bindgen] -impl Client { - #[wasm_bindgen(constructor)] - pub fn new( - execution_rpc: String, - consensus_rpc: Option, - network: String, - checkpoint: Option, - db_type: String, - ) -> Self { - console_error_panic_hook::set_once(); - - let base = match network.as_str() { - "mainnet" => networks::mainnet(), - "goerli" => networks::goerli(), - _ => panic!("invalid network"), - }; - - let chain_id = base.chain.chain_id; - - let checkpoint = Some( - checkpoint - .as_ref() - .map(|c| c.strip_prefix("0x").unwrap_or(c.as_str())) - .and_then(|c| B256::from_hex(c).ok()) - .unwrap_or(base.default_checkpoint), - ); - - let consensus_rpc = consensus_rpc.unwrap_or(base.consensus_rpc.unwrap()); - - let config = Config { - execution_rpc, - consensus_rpc, - checkpoint, - - chain: base.chain, - forks: base.forks, - - database_type: Some(db_type), - ..Default::default() - }; - - let inner: client::Client = - client::ClientBuilder::new().config(config).build().unwrap(); - - Self { inner, chain_id } - } - - #[wasm_bindgen] - pub async fn sync(&mut self) { - self.inner.start().await.unwrap() - } - - #[wasm_bindgen] - pub async fn wait_synced(&self) { - self.inner.wait_synced().await; - } - - #[wasm_bindgen] - pub fn chain_id(&self) -> u32 { - self.chain_id as u32 - } - - #[wasm_bindgen] - pub async fn get_block_number(&self) -> u32 { - self.inner.get_block_number().await.unwrap().to() - } - - #[wasm_bindgen] - pub async fn get_balance(&self, addr: JsValue, block: JsValue) -> String { - let addr: Address = serde_wasm_bindgen::from_value(addr).unwrap(); - let block: BlockTag = serde_wasm_bindgen::from_value(block).unwrap(); - self.inner - .get_balance(addr, block) - .await - .unwrap() - .to_string() - } - - #[wasm_bindgen] - pub async fn get_transaction_by_hash(&self, hash: String) -> JsValue { - let hash = B256::from_str(&hash).unwrap(); - let tx = self.inner.get_transaction_by_hash(hash).await.unwrap(); - serde_wasm_bindgen::to_value(&tx).unwrap() - } - - #[wasm_bindgen] - pub async fn get_transaction_count(&self, addr: JsValue, block: JsValue) -> u32 { - let addr: Address = serde_wasm_bindgen::from_value(addr).unwrap(); - let block: BlockTag = serde_wasm_bindgen::from_value(block).unwrap(); - self.inner.get_nonce(addr, block).await.unwrap() as u32 - } - - #[wasm_bindgen] - pub async fn get_block_transaction_count_by_hash(&self, hash: JsValue) -> u32 { - let hash: B256 = serde_wasm_bindgen::from_value(hash).unwrap(); - self.inner - .get_block_transaction_count_by_hash(hash) - .await - .unwrap() as u32 - } - - #[wasm_bindgen] - pub async fn get_block_transaction_count_by_number(&self, block: JsValue) -> u32 { - let block: BlockTag = serde_wasm_bindgen::from_value(block).unwrap(); - self.inner - .get_block_transaction_count_by_number(block) - .await - .unwrap() as u32 - } - - #[wasm_bindgen] - pub async fn get_block_by_number(&self, block: JsValue, full_tx: bool) -> JsValue { - let block: BlockTag = serde_wasm_bindgen::from_value(block).unwrap(); - let block = self - .inner - .get_block_by_number(block, full_tx) - .await - .unwrap() - .unwrap(); - serde_wasm_bindgen::to_value(&block).unwrap() - } - - #[wasm_bindgen] - pub async fn get_code(&self, addr: JsValue, block: JsValue) -> String { - let addr: Address = serde_wasm_bindgen::from_value(addr).unwrap(); - let block: BlockTag = serde_wasm_bindgen::from_value(block).unwrap(); - let code = self.inner.get_code(addr, block).await.unwrap(); - format!("0x{}", hex::encode(code)) - } - - #[wasm_bindgen] - pub async fn call(&self, opts: JsValue, block: JsValue) -> String { - let opts: TransactionRequest = serde_wasm_bindgen::from_value(opts).unwrap(); - let block: BlockTag = serde_wasm_bindgen::from_value(block).unwrap(); - let res = self.inner.call(&opts, block).await.unwrap(); - format!("0x{}", hex::encode(res)) - } - - #[wasm_bindgen] - pub async fn estimate_gas(&self, opts: JsValue) -> u32 { - let opts: TransactionRequest = serde_wasm_bindgen::from_value(opts).unwrap(); - self.inner.estimate_gas(&opts).await.unwrap() as u32 - } - - #[wasm_bindgen] - pub async fn gas_price(&self) -> JsValue { - let price = self.inner.get_gas_price().await.unwrap(); - serde_wasm_bindgen::to_value(&price).unwrap() - } - - #[wasm_bindgen] - pub async fn max_priority_fee_per_gas(&self) -> JsValue { - let price = self.inner.get_priority_fee().await.unwrap(); - serde_wasm_bindgen::to_value(&price).unwrap() - } - - #[wasm_bindgen] - pub async fn send_raw_transaction(&self, tx: String) -> JsValue { - let tx = hex::decode(tx).unwrap(); - let hash = self.inner.send_raw_transaction(&tx).await.unwrap(); - serde_wasm_bindgen::to_value(&hash).unwrap() - } - - #[wasm_bindgen] - pub async fn get_transaction_receipt(&self, tx: JsValue) -> JsValue { - let tx: B256 = serde_wasm_bindgen::from_value(tx).unwrap(); - let receipt = self.inner.get_transaction_receipt(tx).await.unwrap(); - serde_wasm_bindgen::to_value(&receipt).unwrap() - } - - #[wasm_bindgen] - pub async fn get_logs(&self, filter: JsValue) -> JsValue { - let filter: Filter = serde_wasm_bindgen::from_value(filter).unwrap(); - let logs = self.inner.get_logs(&filter).await.unwrap(); - serde_wasm_bindgen::to_value(&logs).unwrap() - } +fn map_err(val: Result) -> Result { + val.map_err(|err| JsError::new(&err.to_string())) } diff --git a/helios-ts/src/opstack.rs b/helios-ts/src/opstack.rs new file mode 100644 index 00000000..5e6b887e --- /dev/null +++ b/helios-ts/src/opstack.rs @@ -0,0 +1,182 @@ +extern crate console_error_panic_hook; +extern crate web_sys; + +use std::str::FromStr; + +use alloy::primitives::{Address, B256}; +use alloy::rpc::types::{Filter, TransactionRequest}; +use wasm_bindgen::prelude::*; + +use helios_core::types::BlockTag; +use helios_opstack::config::{Config, Network, NetworkConfig}; +use helios_opstack::OpStackClientBuilder; + +use crate::map_err; + +#[wasm_bindgen] +pub struct OpStackClient { + inner: helios_opstack::OpStackClient, + chain_id: u64, +} + +#[wasm_bindgen] +impl OpStackClient { + #[wasm_bindgen(constructor)] + pub fn new(execution_rpc: String, network: String) -> Result { + console_error_panic_hook::set_once(); + + let network_config = match network.as_str() { + "optimism" => NetworkConfig::from(Network::Optimism), + "base" => NetworkConfig::from(Network::Base), + other => Err(JsError::new(&format!("invalid network: {}", other)))?, + }; + + let chain_id = network_config.chain.chain_id; + let consensus_rpc = network_config + .consensus_rpc + .ok_or(JsError::new("consensus rpc not found"))?; + + let config = Config { + execution_rpc: execution_rpc.parse()?, + consensus_rpc, + chain: network_config.chain, + rpc_socket: None, + }; + + let inner = map_err(OpStackClientBuilder::new().config(config).build())?; + + Ok(Self { inner, chain_id }) + } + + #[wasm_bindgen] + pub async fn sync(&mut self) -> Result<(), JsError> { + map_err(self.inner.start().await) + } + + #[wasm_bindgen] + pub async fn wait_synced(&self) { + self.inner.wait_synced().await; + } + + #[wasm_bindgen] + pub fn chain_id(&self) -> u32 { + self.chain_id as u32 + } + + #[wasm_bindgen] + pub async fn get_block_number(&self) -> Result { + map_err(self.inner.get_block_number().await).map(|v| v.to()) + } + + #[wasm_bindgen] + pub async fn get_balance(&self, addr: JsValue, block: JsValue) -> Result { + let addr: Address = serde_wasm_bindgen::from_value(addr)?; + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let res = map_err(self.inner.get_balance(addr, block).await); + res.map(|v| v.to_string()) + } + + #[wasm_bindgen] + pub async fn get_transaction_by_hash(&self, hash: String) -> Result { + let hash = B256::from_str(&hash)?; + let tx = self.inner.get_transaction_by_hash(hash).await; + Ok(serde_wasm_bindgen::to_value(&tx)?) + } + + #[wasm_bindgen] + pub async fn get_transaction_count( + &self, + addr: JsValue, + block: JsValue, + ) -> Result { + let addr: Address = serde_wasm_bindgen::from_value(addr)?; + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + Ok(map_err(self.inner.get_nonce(addr, block).await)? as u32) + } + + #[wasm_bindgen] + pub async fn get_block_transaction_count_by_hash(&self, hash: JsValue) -> Result { + let hash: B256 = serde_wasm_bindgen::from_value(hash)?; + let count = map_err(self.inner.get_block_transaction_count_by_hash(hash).await)?; + Ok(count as u32) + } + + #[wasm_bindgen] + pub async fn get_block_transaction_count_by_number( + &self, + block: JsValue, + ) -> Result { + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let res = self + .inner + .get_block_transaction_count_by_number(block) + .await; + Ok(map_err(res)? as u32) + } + + #[wasm_bindgen] + pub async fn get_block_by_number( + &self, + block: JsValue, + full_tx: bool, + ) -> Result { + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let block = map_err(self.inner.get_block_by_number(block, full_tx).await)?; + Ok(serde_wasm_bindgen::to_value(&block)?) + } + + #[wasm_bindgen] + pub async fn get_code(&self, addr: JsValue, block: JsValue) -> Result { + let addr: Address = serde_wasm_bindgen::from_value(addr)?; + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let code = map_err(self.inner.get_code(addr, block).await)?; + Ok(format!("0x{}", hex::encode(code))) + } + + #[wasm_bindgen] + pub async fn call(&self, opts: JsValue, block: JsValue) -> Result { + let opts: TransactionRequest = serde_wasm_bindgen::from_value(opts)?; + let block: BlockTag = serde_wasm_bindgen::from_value(block)?; + let res = map_err(self.inner.call(&opts, block).await)?; + Ok(format!("0x{}", hex::encode(res))) + } + + #[wasm_bindgen] + pub async fn estimate_gas(&self, opts: JsValue) -> Result { + let opts: TransactionRequest = serde_wasm_bindgen::from_value(opts)?; + Ok(map_err(self.inner.estimate_gas(&opts).await)? as u32) + } + + #[wasm_bindgen] + pub async fn gas_price(&self) -> Result { + let price = map_err(self.inner.get_gas_price().await)?; + Ok(serde_wasm_bindgen::to_value(&price)?) + } + + #[wasm_bindgen] + pub async fn max_priority_fee_per_gas(&self) -> Result { + let price = map_err(self.inner.get_priority_fee().await)?; + Ok(serde_wasm_bindgen::to_value(&price)?) + } + + #[wasm_bindgen] + pub async fn send_raw_transaction(&self, tx: String) -> Result { + let tx = hex::decode(tx)?; + let hash = map_err(self.inner.send_raw_transaction(&tx).await)?; + Ok(serde_wasm_bindgen::to_value(&hash)?) + } + + #[wasm_bindgen] + pub async fn get_transaction_receipt(&self, tx: JsValue) -> Result { + let tx: B256 = serde_wasm_bindgen::from_value(tx)?; + let receipt = map_err(self.inner.get_transaction_receipt(tx).await)?; + Ok(serde_wasm_bindgen::to_value(&receipt)?) + } + + #[wasm_bindgen] + pub async fn get_logs(&self, filter: JsValue) -> Result { + let filter: Filter = serde_wasm_bindgen::from_value(filter)?; + let logs = map_err(self.inner.get_logs(&filter).await)?; + Ok(serde_wasm_bindgen::to_value(&logs)?) + } +} diff --git a/helios-ts/src/storage.rs b/helios-ts/src/storage.rs index 6d5094ed..a7395adc 100644 --- a/helios-ts/src/storage.rs +++ b/helios-ts/src/storage.rs @@ -5,8 +5,7 @@ use alloy::{hex::FromHex, primitives::B256}; use eyre::Result; use wasm_bindgen::prelude::*; -use config::Config; -use consensus::database::Database; +use helios_ethereum::{config::Config, database::Database}; #[derive(Clone)] pub struct LocalStorageDB; diff --git a/opstack/Cargo.toml b/opstack/Cargo.toml index 740a70b6..0930257e 100644 --- a/opstack/Cargo.toml +++ b/opstack/Cargo.toml @@ -17,6 +17,7 @@ typenum.workspace = true tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } reqwest.workspace = true url.workspace = true +zduny-wasm-timer.workspace = true # consensus alloy.workspace = true @@ -28,19 +29,27 @@ ssz_types.workspace = true op-alloy-network = { git = "https://github.com/alloy-rs/op-alloy", tag = "v0.1.5" } op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", tag = "v0.1.5" } op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", tag = "v0.1.5" } - -# server -axum = "0.7.6" -clap = { version = "4.5.4", features = ["derive", "env"] } +snap = "1" # config figment = { version = "0.10.7", features = ["toml", "env"] } +helios-core = { path = "../core" } + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +# server +axum = "0.7.6" +clap = { version = "4.5.4", features = ["derive", "env"] } # networking libp2p = { version = "0.51.3", features = ["macros", "tokio", "tcp", "mplex", "noise", "gossipsub", "ping"] } discv5 = "0.7.0" libp2p-identity = { version = "0.1.2", features = ["secp256k1"] } unsigned-varint = "0.7.1" -snap = "1" -helios-core = { path = "../core" } +[target.wasm32-unknown-unknown.dependencies] +parking_lot = { version = "0.12.2" } + +[target.'cfg(target_arch = "wasm32")'.dependencies] +wasm-bindgen-futures = "0.4.37" +getrandom = { version = "0.2.1", features = ["js"] } + diff --git a/opstack/src/builder.rs b/opstack/src/builder.rs index 50a5872f..0516075f 100644 --- a/opstack/src/builder.rs +++ b/opstack/src/builder.rs @@ -90,6 +90,7 @@ impl OpStackClientBuilder { OpStackClient::new( &config.execution_rpc.to_string(), consensus, + #[cfg(not(target_arch = "wasm32"))] config.rpc_socket, ) } diff --git a/opstack/src/consensus.rs b/opstack/src/consensus.rs index d9c1d24a..972191d8 100644 --- a/opstack/src/consensus.rs +++ b/opstack/src/consensus.rs @@ -1,4 +1,4 @@ -use std::time::{Duration, SystemTime, UNIX_EPOCH}; +use std::time::Duration; use alloy::consensus::Transaction as TxTrait; use alloy::primitives::{b256, keccak256, Address, B256, U256, U64}; @@ -7,13 +7,11 @@ use alloy::rpc::types::{Parity, Signature, Transaction}; use eyre::Result; use op_alloy_consensus::OpTxEnvelope; use tokio::sync::mpsc::Sender; -use tokio::{ - sync::{ - mpsc::{channel, Receiver}, - watch, - }, - time::sleep, +use tokio::sync::{ + mpsc::{channel, Receiver}, + watch, }; +use zduny_wasm_timer::{Delay, SystemTime, UNIX_EPOCH}; use helios_core::consensus::Consensus; use helios_core::types::{Block, Transactions}; @@ -40,10 +38,16 @@ impl ConsensusClient { finalized_block_send, }; - tokio::spawn(async move { + #[cfg(not(target_arch = "wasm32"))] + let run = tokio::spawn; + + #[cfg(target_arch = "wasm32")] + let run = wasm_bindgen_futures::spawn_local; + + run(async move { loop { _ = inner.advance().await; - sleep(Duration::from_secs(1)).await; + Delay::new(Duration::from_secs(1)).await.unwrap(); } }); diff --git a/opstack/src/lib.rs b/opstack/src/lib.rs index 216c14f1..9b2ff1c5 100644 --- a/opstack/src/lib.rs +++ b/opstack/src/lib.rs @@ -15,6 +15,7 @@ use types::ExecutionPayload; mod builder; pub mod config; pub mod consensus; +#[cfg(not(target_arch = "wasm32"))] pub mod server; pub mod spec; pub mod types; From 2a5b8b7b5400d3ec11a81be2b7d6b36e1909f60b Mon Sep 17 00:00:00 2001 From: Noah Citron Date: Fri, 11 Oct 2024 16:06:53 -0400 Subject: [PATCH 05/10] chore: update lockfile --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 166b7c16..cbb7255d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7663,7 +7663,7 @@ checksum = "4b8220be1fa9e4c889b30fd207d4906657e7e90b12e0e6b0c8b8d8709f5de021" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] From 31cfa61a24adc5dfc7dce393ba9fe26389e28424 Mon Sep 17 00:00:00 2001 From: Noah Citron Date: Fri, 11 Oct 2024 16:35:19 -0400 Subject: [PATCH 06/10] feat: block backfill (#391) * wip * feat: add execution block backfill * handle finalized blocks * cleanup * fix timing in wasm * remove web_sys from core * typo * rebase fixes --- Cargo.lock | 23 +++- core/Cargo.toml | 2 +- core/src/client/mod.rs | 6 +- core/src/client/node.rs | 6 +- core/src/execution/mod.rs | 4 +- core/src/execution/rpc/http_rpc.rs | 14 +- core/src/execution/rpc/mock_rpc.rs | 6 +- core/src/execution/rpc/mod.rs | 3 +- core/src/execution/state.rs | 121 +++++++++++++++--- core/src/lib.rs | 1 + core/src/time.rs | 9 ++ core/src/types.rs | 49 ++++++- ethereum/Cargo.toml | 2 +- ethereum/consensus-core/Cargo.toml | 4 +- ethereum/consensus-core/src/consensus_core.rs | 15 ++- ethereum/consensus-core/src/types/mod.rs | 3 +- ethereum/src/consensus.rs | 105 ++++++--------- helios-ts/index.html | 58 +++++---- helios-ts/lib.ts | 8 ++ opstack/Cargo.toml | 4 +- opstack/src/consensus.rs | 26 +++- opstack/src/types.rs | 3 +- 22 files changed, 327 insertions(+), 145 deletions(-) create mode 100644 core/src/time.rs diff --git a/Cargo.lock b/Cargo.lock index cbb7255d..e8bc0062 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3057,6 +3057,7 @@ name = "helios-consensus-core" version = "0.7.0" dependencies = [ "alloy", + "alloy-rlp", "bls12_381", "ethereum_ssz 0.6.0", "ethereum_ssz_derive 0.6.0", @@ -3071,6 +3072,7 @@ dependencies = [ "tree_hash", "tree_hash_derive", "typenum", + "wasmtimer", "zduny-wasm-timer", ] @@ -3096,7 +3098,7 @@ dependencies = [ "tracing", "triehash-ethereum", "wasm-bindgen-futures", - "zduny-wasm-timer", + "wasmtimer", ] [[package]] @@ -3128,8 +3130,8 @@ dependencies = [ "tokio", "tracing", "tree_hash", + "triehash-ethereum", "wasm-bindgen-futures", - "zduny-wasm-timer", ] [[package]] @@ -3137,6 +3139,7 @@ name = "helios-opstack" version = "0.7.0" dependencies = [ "alloy", + "alloy-rlp", "axum", "clap", "discv5", @@ -3162,11 +3165,11 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", + "triehash-ethereum", "typenum", "unsigned-varint", "url", "wasm-bindgen-futures", - "zduny-wasm-timer", ] [[package]] @@ -7681,6 +7684,20 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmtimer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f656cd8858a5164932d8a90f936700860976ec21eb00e0fe2aa8cab13f6b4cf" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.12.3", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "web-sys" version = "0.3.72" diff --git a/core/Cargo.toml b/core/Cargo.toml index dfaf0c80..c95b2441 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -24,7 +24,6 @@ eyre.workspace = true hex.workspace = true tracing.workspace = true thiserror.workspace = true -zduny-wasm-timer.workspace = true [target.'cfg(not(target_arch = "wasm32"))'.dependencies] jsonrpsee = { version = "0.19.0", features = ["full"] } @@ -33,6 +32,7 @@ openssl.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen-futures = "0.4.33" gloo-timers = "0.3.0" +wasmtimer = "0.2.0" [target.wasm32-unknown-unknown.dependencies] parking_lot = { version = "0.12.2" } diff --git a/core/src/client/mod.rs b/core/src/client/mod.rs index c74441a3..6d1a31f8 100644 --- a/core/src/client/mod.rs +++ b/core/src/client/mod.rs @@ -6,13 +6,13 @@ use alloy::primitives::{Address, Bytes, B256, U256}; use alloy::rpc::types::{Filter, Log, SyncStatus}; use eyre::Result; use tracing::{info, warn}; -use zduny_wasm_timer::Delay; use crate::client::node::Node; #[cfg(not(target_arch = "wasm32"))] use crate::client::rpc::Rpc; use crate::consensus::Consensus; use crate::network_spec::NetworkSpec; +use crate::time::interval; use crate::types::{Block, BlockTag}; pub mod node; @@ -192,12 +192,12 @@ impl> Client { } pub async fn wait_synced(&self) { + let mut interval = interval(Duration::from_millis(100)); loop { + interval.tick().await; if let Ok(SyncStatus::None) = self.syncing().await { break; } - - Delay::new(Duration::from_millis(100)).await.unwrap(); } } } diff --git a/core/src/client/node.rs b/core/src/client/node.rs index 2c17287c..5b82c199 100644 --- a/core/src/client/node.rs +++ b/core/src/client/node.rs @@ -3,7 +3,6 @@ use std::sync::Arc; use alloy::primitives::{Address, Bytes, B256, U256}; use alloy::rpc::types::{Filter, Log, SyncInfo, SyncStatus}; use eyre::{eyre, Result}; -use zduny_wasm_timer::{SystemTime, UNIX_EPOCH}; use crate::consensus::Consensus; use crate::errors::ClientError; @@ -12,6 +11,7 @@ use crate::execution::rpc::http_rpc::HttpRpc; use crate::execution::state::State; use crate::execution::ExecutionClient; use crate::network_spec::NetworkSpec; +use crate::time::{SystemTime, UNIX_EPOCH}; use crate::types::{Block, BlockTag}; pub struct Node> { @@ -25,7 +25,7 @@ impl> Node { let block_recv = consensus.block_recv().take().unwrap(); let finalized_block_recv = consensus.finalized_block_recv().take().unwrap(); - let state = State::new(block_recv, finalized_block_recv, 256); + let state = State::new(block_recv, finalized_block_recv, 256, execution_rpc); let execution = Arc::new( ExecutionClient::new(execution_rpc, state).map_err(ClientError::InternalError)?, ); @@ -239,7 +239,7 @@ impl> Node { async fn check_head_age(&self) -> Result<(), ClientError> { let timestamp = SystemTime::now() .duration_since(UNIX_EPOCH) - .unwrap() + .unwrap_or_else(|_| panic!("unreachable")) .as_secs(); let block_timestamp = self diff --git a/core/src/execution/mod.rs b/core/src/execution/mod.rs index f0f66c45..fcd26ebb 100644 --- a/core/src/execution/mod.rs +++ b/core/src/execution/mod.rs @@ -31,11 +31,11 @@ mod proof; #[derive(Clone)] pub struct ExecutionClient> { pub rpc: R, - state: State, + state: State, } impl> ExecutionClient { - pub fn new(rpc: &str, state: State) -> Result { + pub fn new(rpc: &str, state: State) -> Result { let rpc: R = ExecutionRpc::new(rpc)?; Ok(ExecutionClient:: { rpc, state }) } diff --git a/core/src/execution/rpc/http_rpc.rs b/core/src/execution/rpc/http_rpc.rs index ecd04dad..4eb52b96 100644 --- a/core/src/execution/rpc/http_rpc.rs +++ b/core/src/execution/rpc/http_rpc.rs @@ -5,13 +5,13 @@ use alloy::rpc::types::{BlockId, EIP1186AccountProofResponse, FeeHistory, Filter use alloy::transports::http::Http; use alloy::transports::layers::{RetryBackoffLayer, RetryBackoffService}; use async_trait::async_trait; -use eyre::Result; +use eyre::{eyre, Result}; use reqwest::Client; use revm::primitives::AccessList; use crate::errors::RpcError; use crate::network_spec::NetworkSpec; -use crate::types::BlockTag; +use crate::types::{Block, BlockTag}; use super::ExecutionRpc; @@ -190,4 +190,14 @@ impl ExecutionRpc for HttpRpc { .await .map_err(|e| RpcError::new("fee_history", e))?) } + + async fn get_block(&self, hash: B256) -> Result> { + self.provider + .raw_request::<_, Option>>( + "eth_getBlockByHash".into(), + (hash, true), + ) + .await? + .ok_or(eyre!("block not found")) + } } diff --git a/core/src/execution/rpc/mock_rpc.rs b/core/src/execution/rpc/mock_rpc.rs index fae60b6f..17c977bc 100644 --- a/core/src/execution/rpc/mock_rpc.rs +++ b/core/src/execution/rpc/mock_rpc.rs @@ -7,7 +7,7 @@ use eyre::{eyre, Result}; use super::ExecutionRpc; use crate::network_spec::NetworkSpec; -use crate::types::BlockTag; +use crate::types::{Block, BlockTag}; #[derive(Clone)] pub struct MockRpc { @@ -89,6 +89,10 @@ impl ExecutionRpc for MockRpc { Err(eyre!("not implemented")) } + async fn get_block(&self, _hash: B256) -> Result> { + Err(eyre!("not implemented")) + } + async fn get_fee_history( &self, _block_count: u64, diff --git a/core/src/execution/rpc/mod.rs b/core/src/execution/rpc/mod.rs index 686b68a4..56706dc4 100644 --- a/core/src/execution/rpc/mod.rs +++ b/core/src/execution/rpc/mod.rs @@ -4,7 +4,7 @@ use async_trait::async_trait; use eyre::Result; use crate::network_spec::NetworkSpec; -use crate::types::BlockTag; +use crate::types::{Block, BlockTag}; pub mod http_rpc; pub mod mock_rpc; @@ -40,6 +40,7 @@ pub trait ExecutionRpc: Send + Clone + Sync + 'static { async fn get_new_block_filter(&self) -> Result; async fn get_new_pending_transaction_filter(&self) -> Result; async fn chain_id(&self) -> Result; + async fn get_block(&self, hash: B256) -> Result>; async fn get_fee_history( &self, diff --git a/core/src/execution/state.rs b/core/src/execution/state.rs index 3efdffd5..3b89afa3 100644 --- a/core/src/execution/state.rs +++ b/core/src/execution/state.rs @@ -4,26 +4,32 @@ use std::{ }; use alloy::primitives::{Address, B256, U256}; +use eyre::{eyre, Result}; use tokio::{ select, sync::{mpsc::Receiver, watch, RwLock}, }; +use tracing::{info, warn}; use crate::network_spec::NetworkSpec; use crate::types::{Block, BlockTag, Transactions}; +use super::rpc::ExecutionRpc; + #[derive(Clone)] -pub struct State { - inner: Arc>>, +pub struct State> { + inner: Arc>>, } -impl State { +impl> State { pub fn new( mut block_recv: Receiver>, mut finalized_block_recv: watch::Receiver>>, history_length: u64, + rpc: &str, ) -> Self { - let inner = Arc::new(RwLock::new(Inner::new(history_length))); + let rpc = R::new(rpc).unwrap(); + let inner = Arc::new(RwLock::new(Inner::new(history_length, rpc))); let inner_ref = inner.clone(); #[cfg(not(target_arch = "wasm32"))] @@ -36,13 +42,13 @@ impl State { select! { block = block_recv.recv() => { if let Some(block) = block { - inner_ref.write().await.push_block(block); + inner_ref.write().await.push_block(block).await; } }, _ = finalized_block_recv.changed() => { let block = finalized_block_recv.borrow_and_update().clone(); if let Some(block) = block { - inner_ref.write().await.push_finalized_block(block); + inner_ref.write().await.push_finalized_block(block).await; } }, @@ -54,7 +60,7 @@ impl State { } pub async fn push_block(&self, block: Block) { - self.inner.write().await.push_block(block); + self.inner.write().await.push_block(block).await; } // full block fetch @@ -152,27 +158,65 @@ impl State { } } -#[derive(Default)] -struct Inner { +struct Inner> { blocks: BTreeMap>, finalized_block: Option>, hashes: HashMap, txs: HashMap, history_length: u64, + rpc: R, } -impl Inner { - pub fn new(history_length: u64) -> Self { +impl> Inner { + pub fn new(history_length: u64, rpc: R) -> Self { Self { history_length, blocks: BTreeMap::default(), finalized_block: None, hashes: HashMap::default(), txs: HashMap::default(), + rpc, } } - pub fn push_block(&mut self, block: Block) { + pub async fn push_block(&mut self, block: Block) { + let block_number = block.number.to::(); + if self.try_insert_tip(block) { + let mut n = block_number; + + loop { + if let Ok(backfilled) = self.backfill_behind(n).await { + if !backfilled { + break; + } + n -= 1; + } else { + self.prune_before(n); + break; + } + } + + let link_child = self.blocks.get(&n); + let link_parent = self.blocks.get(&(n - 1)); + + if let (Some(parent), Some(child)) = (link_parent, link_child) { + if child.parent_hash != parent.hash { + warn!("detected block reorganization"); + self.prune_before(n); + } + } + + self.prune(); + } + } + + fn try_insert_tip(&mut self, block: Block) -> bool { + if let Some((num, _)) = self.blocks.last_key_value() { + if num > &block.number.to() { + return false; + } + } + self.hashes.insert(block.hash, block.number.to()); block .transactions @@ -188,7 +232,10 @@ impl Inner { }); self.blocks.insert(block.number.to(), block); + true + } + fn prune(&mut self) { while self.blocks.len() as u64 > self.history_length { if let Some((number, _)) = self.blocks.first_key_value() { self.remove_block(*number); @@ -196,17 +243,55 @@ impl Inner { } } - pub fn push_finalized_block(&mut self, block: Block) { - self.finalized_block = Some(block.clone()); + fn prune_before(&mut self, n: u64) { + loop { + if let Some((oldest, _)) = self.blocks.first_key_value() { + let oldest = *oldest; + if oldest < n { + self.blocks.remove(&oldest); + } else { + break; + } + } else { + break; + } + } + } + + async fn backfill_behind(&mut self, n: u64) -> Result { + if self.blocks.len() < 2 { + return Ok(false); + } + + if let Some(block) = self.blocks.get(&n) { + let prev = n - 1; + if self.blocks.get(&prev).is_none() { + let backfilled = self.rpc.get_block(block.parent_hash).await?; + if backfilled.is_hash_valid() && block.parent_hash == backfilled.hash { + info!("backfilled: block={}", backfilled.number); + self.blocks.insert(backfilled.number.to(), backfilled); + Ok(true) + } else { + warn!("bad block backfill"); + Err(eyre!("bad backfill")) + } + } else { + Ok(false) + } + } else { + Ok(false) + } + } + pub async fn push_finalized_block(&mut self, block: Block) { if let Some(old_block) = self.blocks.get(&block.number.to()) { if old_block.hash != block.hash { - self.remove_block(old_block.number.to()); - self.push_block(block) + self.blocks = BTreeMap::new(); } - } else { - self.push_block(block); } + + self.finalized_block = Some(block.clone()); + self.push_block(block).await; } fn remove_block(&mut self, number: u64) { diff --git a/core/src/lib.rs b/core/src/lib.rs index bcd61ab6..91378f0a 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -2,6 +2,7 @@ pub mod client; pub mod consensus; pub mod errors; pub mod network_spec; +pub mod time; pub mod types; mod execution; diff --git a/core/src/time.rs b/core/src/time.rs new file mode 100644 index 00000000..59d0a99f --- /dev/null +++ b/core/src/time.rs @@ -0,0 +1,9 @@ +#[cfg(not(target_arch = "wasm32"))] +pub use std::time::{SystemTime, UNIX_EPOCH}; +#[cfg(not(target_arch = "wasm32"))] +pub use tokio::time::{interval, interval_at, Instant}; +#[cfg(target_arch = "wasm32")] +pub use wasmtimer::{ + std::{Instant, SystemTime, UNIX_EPOCH}, + tokio::{interval, interval_at}, +}; diff --git a/core/src/types.rs b/core/src/types.rs index e219bf1b..b15390c2 100644 --- a/core/src/types.rs +++ b/core/src/types.rs @@ -1,7 +1,8 @@ use std::fmt::Display; +use alloy::consensus::{Header, EMPTY_OMMER_ROOT_HASH}; use alloy::network::TransactionResponse; -use alloy::primitives::{Address, Bytes, B256, U256, U64}; +use alloy::primitives::{Address, Bloom, Bytes, FixedBytes, B256, U256, U64}; use serde::{de::Error, ser::SerializeSeq, Deserialize, Serialize}; #[derive(Deserialize, Serialize, Debug, Clone, Default)] @@ -17,7 +18,7 @@ pub struct Block { pub logs_bloom: Bytes, pub miner: Address, pub mix_hash: B256, - pub nonce: String, + pub nonce: FixedBytes<8>, pub parent_hash: B256, pub receipts_root: B256, pub sha3_uncles: B256, @@ -28,11 +29,43 @@ pub struct Block { pub transactions: Transactions, pub transactions_root: B256, pub uncles: Vec, + pub withdrawals_root: B256, pub blob_gas_used: Option, pub excess_blob_gas: Option, + pub parent_beacon_block_root: Option, } -#[derive(Deserialize, Debug, Clone)] +impl Block { + pub fn is_hash_valid(&self) -> bool { + let header = Header { + parent_hash: self.parent_hash, + ommers_hash: EMPTY_OMMER_ROOT_HASH, + beneficiary: self.miner, + state_root: self.state_root, + transactions_root: self.transactions_root, + receipts_root: self.receipts_root, + withdrawals_root: Some(self.withdrawals_root), + logs_bloom: Bloom::from_slice(&self.logs_bloom), + difficulty: self.difficulty, + number: self.number.to(), + gas_limit: self.gas_limit.to(), + gas_used: self.gas_used.to(), + timestamp: self.timestamp.to(), + mix_hash: self.mix_hash, + nonce: self.nonce, + base_fee_per_gas: Some(self.base_fee_per_gas.to()), + blob_gas_used: self.blob_gas_used.map(|v| v.to()), + excess_blob_gas: self.excess_blob_gas.map(|v| v.to()), + parent_beacon_block_root: self.parent_beacon_block_root, + requests_root: None, + extra_data: self.extra_data.clone(), + }; + + header.hash_slow() == self.hash + } +} + +#[derive(Debug, Clone)] pub enum Transactions { Hashes(Vec), Full(Vec), @@ -79,6 +112,16 @@ impl Serialize for Transactions { } } +impl<'de, T: TransactionResponse + Deserialize<'de>> Deserialize<'de> for Transactions { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let txs: Vec = serde::Deserialize::deserialize(deserializer)?; + Ok(Transactions::Full(txs)) + } +} + #[derive(Debug, Clone, Copy)] pub enum BlockTag { Latest, diff --git a/ethereum/Cargo.toml b/ethereum/Cargo.toml index d111f773..6e464a3d 100644 --- a/ethereum/Cargo.toml +++ b/ethereum/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" # consensus tree_hash.workspace = true revm.workspace = true +triehash-ethereum.workspace = true # config figment = { version = "0.10.7", features = ["toml", "env"] } @@ -31,7 +32,6 @@ tracing.workspace = true chrono.workspace = true thiserror.workspace = true superstruct.workspace = true -zduny-wasm-timer.workspace = true retri.workspace = true helios-core = { path = "../core" } diff --git a/ethereum/consensus-core/Cargo.toml b/ethereum/consensus-core/Cargo.toml index aaa24f22..aec62064 100644 --- a/ethereum/consensus-core/Cargo.toml +++ b/ethereum/consensus-core/Cargo.toml @@ -11,6 +11,7 @@ alloy = { version = "0.2.1", features = [ "rlp", "k256", ] } +alloy-rlp = "0.3.0" bls12_381.workspace = true ssz_types.workspace = true ethereum_ssz_derive.workspace = true @@ -27,6 +28,5 @@ tracing.workspace = true zduny-wasm-timer.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies] -# Building consensus-core for wasm requires getrandom with the js feature. -# Source: https://github.com/alloy-rs/core?tab=readme-ov-file#wasm-support getrandom = { version = "0.2", features = ["js"] } +wasmtimer = "0.2.0" diff --git a/ethereum/consensus-core/src/consensus_core.rs b/ethereum/consensus-core/src/consensus_core.rs index ff2bc582..e5ec0056 100644 --- a/ethereum/consensus-core/src/consensus_core.rs +++ b/ethereum/consensus-core/src/consensus_core.rs @@ -1,11 +1,14 @@ use std::cmp; +#[cfg(not(target_arch = "wasm32"))] +use std::time::{SystemTime, UNIX_EPOCH}; use alloy::primitives::B256; use eyre::Result; use ssz_types::BitVector; use tracing::{info, warn}; use tree_hash::TreeHash; -use zduny_wasm_timer::{SystemTime, UNIX_EPOCH}; +#[cfg(target_arch = "wasm32")] +use wasmtimer::std::{SystemTime, UNIX_EPOCH}; use crate::errors::ConsensusError; use crate::proof::{ @@ -309,10 +312,14 @@ fn verify_generic_update( } pub fn expected_current_slot(now: SystemTime, genesis_time: u64) -> u64 { - let now = now.duration_since(UNIX_EPOCH).unwrap(); - let since_genesis = now - std::time::Duration::from_secs(genesis_time); + let now = now + .duration_since(UNIX_EPOCH) + .unwrap_or_else(|_| panic!("unreachable")) + .as_secs(); - since_genesis.as_secs() / 12 + let since_genesis = now - genesis_time; + + since_genesis / 12 } pub fn calc_sync_period(slot: u64) -> u64 { diff --git a/ethereum/consensus-core/src/types/mod.rs b/ethereum/consensus-core/src/types/mod.rs index da29dbf8..f11d3903 100644 --- a/ethereum/consensus-core/src/types/mod.rs +++ b/ethereum/consensus-core/src/types/mod.rs @@ -1,4 +1,5 @@ use alloy::primitives::{Address, FixedBytes, B256, U256}; +use alloy_rlp::RlpEncodable; use eyre::Result; use serde::{Deserialize, Serialize}; use ssz_derive::Encode; @@ -182,7 +183,7 @@ impl Default for ExecutionPayloadHeader { } } -#[derive(Default, Clone, Debug, Encode, TreeHash, Deserialize)] +#[derive(Default, Clone, Debug, Encode, TreeHash, Deserialize, RlpEncodable)] pub struct Withdrawal { #[serde(with = "serde_utils::u64")] index: u64, diff --git a/ethereum/src/consensus.rs b/ethereum/src/consensus.rs index aeb473c9..34b528e0 100644 --- a/ethereum/src/consensus.rs +++ b/ethereum/src/consensus.rs @@ -3,8 +3,8 @@ use std::process; use std::sync::Arc; use alloy::consensus::{Transaction as TxTrait, TxEnvelope}; -use alloy::primitives::{b256, B256, U256, U64}; -use alloy::rlp::Decodable; +use alloy::primitives::{b256, fixed_bytes, B256, U256, U64}; +use alloy::rlp::{encode, Decodable}; use alloy::rpc::types::{Parity, Signature, Transaction}; use chrono::Duration; use eyre::eyre; @@ -12,7 +12,7 @@ use eyre::Result; use futures::future::join_all; use tracing::{debug, error, info, warn}; use tree_hash::TreeHash; -use zduny_wasm_timer::{SystemTime, UNIX_EPOCH}; +use triehash_ethereum::ordered_trie_root; use tokio::sync::mpsc::channel; use tokio::sync::mpsc::Receiver; @@ -20,14 +20,14 @@ use tokio::sync::mpsc::Sender; use tokio::sync::watch; use helios_consensus_core::{ - apply_bootstrap, apply_finality_update, apply_optimistic_update, apply_update, - calc_sync_period, + apply_bootstrap, apply_finality_update, apply_update, calc_sync_period, errors::ConsensusError, expected_current_slot, get_bits, - types::{ExecutionPayload, FinalityUpdate, LightClientStore, OptimisticUpdate, Update}, - verify_bootstrap, verify_finality_update, verify_optimistic_update, verify_update, + types::{ExecutionPayload, FinalityUpdate, LightClientStore, Update}, + verify_bootstrap, verify_finality_update, verify_update, }; use helios_core::consensus::Consensus; +use helios_core::time::{interval_at, Instant, SystemTime, UNIX_EPOCH}; use helios_core::types::{Block, Transactions}; use crate::config::checkpoints::CheckpointFallback; @@ -136,10 +136,11 @@ impl ConsensusClient { _ = inner.send_blocks().await; + let start = Instant::now() + inner.duration_until_next_update().to_std().unwrap(); + let mut interval = interval_at(start, std::time::Duration::from_secs(12)); + loop { - zduny_wasm_timer::Delay::new(inner.duration_until_next_update().to_std().unwrap()) - .await - .unwrap(); + interval.tick().await; let res = inner.advance().await; if let Err(err) = res { @@ -304,10 +305,6 @@ impl Inner { self.verify_finality_update(&finality_update)?; self.apply_finality_update(&finality_update); - let optimistic_update = self.rpc.get_optimistic_update().await?; - self.verify_optimistic_update(&optimistic_update)?; - self.apply_optimistic_update(&optimistic_update); - info!( target: "helios::consensus", "consensus client in sync with checkpoint: 0x{}", @@ -322,10 +319,6 @@ impl Inner { self.verify_finality_update(&finality_update)?; self.apply_finality_update(&finality_update); - let optimistic_update = self.rpc.get_optimistic_update().await?; - self.verify_optimistic_update(&optimistic_update)?; - self.apply_optimistic_update(&optimistic_update); - if self.store.next_sync_committee.is_none() { debug!(target: "helios::consensus", "checking for sync committee update"); let current_period = calc_sync_period(self.store.finalized_header.beacon.slot); @@ -368,7 +361,7 @@ impl Inner { let now = SystemTime::now() .duration_since(UNIX_EPOCH) - .unwrap() + .unwrap_or_else(|_| panic!("unreachable")) .as_secs(); let time_to_next_slot = next_slot_timestamp - now; @@ -420,16 +413,6 @@ impl Inner { ) } - fn verify_optimistic_update(&self, update: &OptimisticUpdate) -> Result<()> { - verify_optimistic_update( - update, - self.expected_current_slot(), - &self.store, - self.config.chain.genesis_root, - &self.config.forks, - ) - } - pub fn apply_update(&mut self, update: &Update) { let new_checkpoint = apply_update(&mut self.store, update); if new_checkpoint.is_some() { @@ -438,19 +421,20 @@ impl Inner { } fn apply_finality_update(&mut self, update: &FinalityUpdate) { + let prev_finalized_slot = self.store.finalized_header.beacon.slot; + let prev_optimistic_slot = self.store.optimistic_header.beacon.slot; let new_checkpoint = apply_finality_update(&mut self.store, update); + let new_finalized_slot = self.store.finalized_header.beacon.slot; + let new_optimistic_slot = self.store.optimistic_header.beacon.slot; if new_checkpoint.is_some() { self.last_checkpoint = new_checkpoint; } - self.log_finality_update(update); - } - - fn apply_optimistic_update(&mut self, update: &OptimisticUpdate) { - let new_checkpoint = apply_optimistic_update(&mut self.store, update); - if new_checkpoint.is_some() { - self.last_checkpoint = new_checkpoint; + if new_finalized_slot != prev_finalized_slot { + self.log_finality_update(update); + } + if new_optimistic_slot != prev_optimistic_slot { + self.log_optimistic_update(update) } - self.log_optimistic_update(update); } fn log_finality_update(&self, update: &FinalityUpdate) { @@ -471,7 +455,7 @@ impl Inner { ); } - fn log_optimistic_update(&self, update: &OptimisticUpdate) { + fn log_optimistic_update(&self, update: &FinalityUpdate) { let participation = get_bits(&update.sync_aggregate.sync_committee_bits) as f32 / 512f32 * 100f32; let decimals = if participation == 100.0 { 1 } else { 2 }; @@ -491,7 +475,10 @@ impl Inner { fn age(&self, slot: u64) -> Duration { let expected_time = self.slot_timestamp(slot); - let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); + let now = SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap_or_else(|_| panic!("unreachable")); + let delay = now - std::time::Duration::from_secs(expected_time); chrono::Duration::from_std(delay).unwrap() } @@ -521,7 +508,7 @@ impl Inner { } fn payload_to_block(value: ExecutionPayload) -> Block { - let empty_nonce = "0x0000000000000000".to_string(); + let empty_nonce = fixed_bytes!("0000000000000000"); let empty_uncle_hash = b256!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"); @@ -620,6 +607,12 @@ fn payload_to_block(value: ExecutionPayload) -> Block { }) .collect::>(); + let raw_txs = value.transactions().iter().map(|tx| tx.inner.to_vec()); + let txs_root = ordered_trie_root(raw_txs); + + let withdrawals = value.withdrawals().unwrap().iter().map(encode); + let withdrawals_root = ordered_trie_root(withdrawals); + Block { number: U64::from(*value.block_number()), base_fee_per_gas: *value.base_fee_per_gas(), @@ -640,10 +633,12 @@ fn payload_to_block(value: ExecutionPayload) -> Block { nonce: empty_nonce, sha3_uncles: empty_uncle_hash, size: U64::ZERO, - transactions_root: B256::default(), + transactions_root: B256::from_slice(txs_root.as_bytes()), uncles: vec![], blob_gas_used: value.blob_gas_used().map(|v| U64::from(*v)).ok(), excess_blob_gas: value.excess_blob_gas().map(|v| U64::from(*v)).ok(), + withdrawals_root: B256::from_slice(withdrawals_root.as_bytes()), + parent_beacon_block_root: Some(*value.parent_hash()), } } @@ -659,10 +654,8 @@ mod tests { use tokio::sync::{mpsc::channel, watch}; use helios_consensus_core::errors::ConsensusError; - use helios_consensus_core::types::{ - bls::{PublicKey, Signature}, - Header, - }; + use helios_consensus_core::types::bls::{PublicKey, Signature}; + use helios_consensus_core::types::LightClientHeader; use crate::{ config::{networks, Config}, @@ -817,28 +810,6 @@ mod tests { ); } - #[tokio::test] - async fn test_verify_optimistic() { - let client = get_client(false, true).await; - - let update = client.rpc.get_optimistic_update().await.unwrap(); - client.verify_optimistic_update(&update).unwrap(); - } - - #[tokio::test] - async fn test_verify_optimistic_invalid_sig() { - let client = get_client(false, true).await; - - let mut update = client.rpc.get_optimistic_update().await.unwrap(); - update.sync_aggregate.sync_committee_signature = Signature::default(); - - let err = client.verify_optimistic_update(&update).err().unwrap(); - assert_eq!( - err.to_string(), - ConsensusError::InvalidSignature.to_string() - ); - } - #[tokio::test] #[should_panic] async fn test_verify_checkpoint_age_invalid() { diff --git a/helios-ts/index.html b/helios-ts/index.html index c0eea8ad..425b39c5 100644 --- a/helios-ts/index.html +++ b/helios-ts/index.html @@ -111,7 +111,7 @@

Base