diff --git a/Cargo.lock b/Cargo.lock index c2c9931..d0209de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,11 +111,13 @@ dependencies = [ "alloy-core", "alloy-eips 0.2.1", "alloy-genesis 0.2.1", + "alloy-json-rpc 0.2.1", "alloy-network 0.2.1", "alloy-provider 0.2.1", "alloy-rpc-client 0.2.1", "alloy-rpc-types 0.2.1", "alloy-serde 0.2.1", + "alloy-signer 0.2.1", "alloy-transport 0.2.1", "alloy-transport-http 0.2.1", ] @@ -1359,16 +1361,14 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.69.5" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ "bitflags 2.6.0", "cexpr", "clang-sys", - "itertools 0.12.1", - "lazy_static", - "lazycell", + "itertools 0.13.0", "log", "prettyplease", "proc-macro2", @@ -1377,7 +1377,6 @@ dependencies = [ "rustc-hash 1.1.0", "shlex", "syn 2.0.79", - "which", ] [[package]] @@ -1464,7 +1463,6 @@ dependencies = [ "cc", "cfg-if", "constant_time_eq", - "rayon-core", ] [[package]] @@ -1733,36 +1731,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" -[[package]] -name = "client" -version = "0.6.1" -source = "git+https://github.com/a16z/helios#545d809be0f135f69a8e6f613bb6bdd0fb4b22d1" -dependencies = [ - "alloy 0.2.1", - "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", -] - -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - [[package]] name = "coins-bip32" version = "0.8.7" @@ -1821,98 +1789,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" -[[package]] -name = "common" -version = "0.6.1" -source = "git+https://github.com/a16z/helios#545d809be0f135f69a8e6f613bb6bdd0fb4b22d1" -dependencies = [ - "alloy 0.2.1", - "eyre", - "hex", - "serde", - "serde_json", - "superstruct", - "thiserror", - "tracing", - "zduny-wasm-timer", -] - -[[package]] -name = "config" -version = "0.6.1" -source = "git+https://github.com/a16z/helios#545d809be0f135f69a8e6f613bb6bdd0fb4b22d1" -dependencies = [ - "alloy 0.2.1", - "common", - "consensus-core", - "dirs", - "eyre", - "figment", - "futures", - "hex", - "reqwest 0.12.8", - "retri", - "serde", - "serde_yaml", - "strum", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "consensus" -version = "0.6.1" -source = "git+https://github.com/a16z/helios#545d809be0f135f69a8e6f613bb6bdd0fb4b22d1" -dependencies = [ - "alloy 0.2.1", - "async-trait", - "chrono", - "common", - "config", - "consensus-core", - "eyre", - "futures", - "getrandom 0.2.15", - "hex", - "openssl", - "parking_lot", - "reqwest 0.12.8", - "retri", - "serde", - "serde_json", - "superstruct", - "thiserror", - "tokio", - "tracing", - "tree_hash", - "wasm-bindgen-futures", - "zduny-wasm-timer", -] - -[[package]] -name = "consensus-core" -version = "0.6.1" -source = "git+https://github.com/a16z/helios#545d809be0f135f69a8e6f613bb6bdd0fb4b22d1" -dependencies = [ - "alloy 0.2.1", - "bls12_381 0.8.0", - "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" version = "0.15.8" @@ -2419,18 +2295,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "embedded-io" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" - [[package]] name = "encode_unicode" version = "0.3.6" @@ -2900,30 +2764,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "execution" -version = "0.6.1" -source = "git+https://github.com/a16z/helios#545d809be0f135f69a8e6f613bb6bdd0fb4b22d1" -dependencies = [ - "alloy 0.2.1", - "async-trait", - "common", - "consensus", - "eyre", - "futures", - "hex", - "openssl", - "reqwest 0.12.8", - "revm", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "triehash-ethereum", - "wasm-bindgen-futures", -] - [[package]] name = "eyre" version = "0.6.12" @@ -3492,16 +3332,89 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "helios" -version = "0.6.1" -source = "git+https://github.com/a16z/helios#545d809be0f135f69a8e6f613bb6bdd0fb4b22d1" +name = "helios-consensus-core" +version = "0.7.0" +source = "git+https://github.com/a16z/helios#4f14e16391cedffe9d937d1dc129f5a9b0fd72a5" dependencies = [ - "client", - "common", - "config", - "consensus", - "consensus-core", - "execution", + "alloy 0.2.1", + "alloy-rlp", + "bls12_381 0.8.0", + "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", + "wasmtimer", + "zduny-wasm-timer", +] + +[[package]] +name = "helios-core" +version = "0.7.0" +source = "git+https://github.com/a16z/helios#4f14e16391cedffe9d937d1dc129f5a9b0fd72a5" +dependencies = [ + "alloy 0.2.1", + "async-trait", + "eyre", + "futures", + "gloo-timers 0.3.0", + "hex", + "jsonrpsee", + "openssl", + "parking_lot", + "reqwest 0.12.8", + "revm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "triehash-ethereum", + "wasm-bindgen-futures", + "wasmtimer", +] + +[[package]] +name = "helios-ethereum" +version = "0.7.0" +source = "git+https://github.com/a16z/helios#4f14e16391cedffe9d937d1dc129f5a9b0fd72a5" +dependencies = [ + "alloy 0.2.1", + "async-trait", + "chrono", + "dirs", + "eyre", + "figment", + "futures", + "getrandom 0.2.15", + "helios-consensus-core", + "helios-core", + "hex", + "openssl", + "parking_lot", + "reqwest 0.12.8", + "retri", + "revm", + "serde", + "serde_json", + "serde_yaml", + "strum", + "superstruct", + "thiserror", + "tokio", + "tracing", + "tree_hash", + "triehash-ethereum", + "typenum", + "wasm-bindgen-futures", ] [[package]] @@ -3534,15 +3447,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "http" version = "0.2.12" @@ -3696,6 +3600,19 @@ dependencies = [ "webpki-roots 0.26.6", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper 0.14.31", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "hyper-tls" version = "0.6.0" @@ -4254,12 +4171,6 @@ dependencies = [ "spin 0.9.8", ] -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.159" @@ -4647,12 +4558,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "oneshot" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e296cf87e61c9cfc1a61c3c63a0f7f286ed4554e0e22be84e8a38e1d264a2a29" - [[package]] name = "opaque-debug" version = "0.3.1" @@ -4718,9 +4623,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.2+3.3.2" +version = "300.4.0+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" +checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" dependencies = [ "cc", ] @@ -4752,9 +4657,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "p3-air" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e909ef66fa5d77ff0fd3cb5af4b33b27fa6fb68d02b9b1e70edbc29383e565" +checksum = "066f571b2e645505ed5972dd0e1e252ba03352150830c9566769ca711c0f1e9b" dependencies = [ "p3-field", "p3-matrix", @@ -4762,9 +4667,9 @@ dependencies = [ [[package]] name = "p3-baby-bear" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46965470aac1cddfe52f535424b59d52f2fffef0fdeb9dbed19da39b1d8f048a" +checksum = "ff00f571044d299310d9659c6e51c98422de3bf94b8577f7f30cf59cf2043e40" dependencies = [ "num-bigint 0.4.6", "p3-field", @@ -4777,9 +4682,9 @@ dependencies = [ [[package]] name = "p3-blake3" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ef32d6ea21dd5cf9fec8a31bf0c64e6ceee8901dbf50966b83a443093c2aba" +checksum = "cc4cb69ae54a279bbbd477566d1bdb71aa879b528fd658d0fcfc36f54b00217c" dependencies = [ "blake3", "p3-symmetric", @@ -4787,9 +4692,9 @@ dependencies = [ [[package]] name = "p3-bn254-fr" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3edfca6be3b3109adf8e3330baec30c3fc5f9f4d63d27aaec1b471ca51ed67" +checksum = "bf19917f986d45e9abb6d177e875824ced6eed096480d574fce16f2c45c721ea" dependencies = [ "ff 0.13.0", "num-bigint 0.4.6", @@ -4802,25 +4707,27 @@ dependencies = [ [[package]] name = "p3-challenger" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6662ea899a5d848b60c699944491d72757873b5e1fd46798e4712f90a03a4e9" +checksum = "3be7e4fbce4566a93091107eadfafa0b5374bd1ffd3e0f6b850da3ff72eb183f" dependencies = [ "p3-field", "p3-maybe-rayon", "p3-symmetric", "p3-util", + "serde", "tracing", ] [[package]] name = "p3-commit" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc3563918b5cc44ef5280bf9b51753e70dc78802de25e3fb81ed6c94617ccb6e" +checksum = "7a03eb0f99d68a712c41e658e9a7782a0705d4ffcfb6232a43bd3f1ef9591002" dependencies = [ "itertools 0.12.1", "p3-challenger", + "p3-dft", "p3-field", "p3-matrix", "p3-util", @@ -4829,9 +4736,9 @@ dependencies = [ [[package]] name = "p3-dft" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510095701819d83c9509fe825bbf1ebfe50426ae75149df5fe1dcfd18261323a" +checksum = "1556de968523fbe5d804ab50600ea306fcceea3500cfd7601e40882480524664" dependencies = [ "p3-field", "p3-matrix", @@ -4842,9 +4749,9 @@ dependencies = [ [[package]] name = "p3-field" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f1977a0a65789f719aa824119c332c4676b000bdbfe94d312fb6244a70d601" +checksum = "cec2af6e1ac47a2035af5165e668d64612c4b9ccabd06df37fc1fd381fdf8a71" dependencies = [ "itertools 0.12.1", "num-bigint 0.4.6", @@ -4856,9 +4763,9 @@ dependencies = [ [[package]] name = "p3-fri" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22ddb958f200d9289cc73ff68847b0167ca0c14557b791dd9e318f98c2d1b28" +checksum = "f351ee9f9d4256455164565cd91e3e6d2487cc2a5355515fa2b6d479269188dd" dependencies = [ "itertools 0.12.1", "p3-challenger", @@ -4875,30 +4782,20 @@ dependencies = [ [[package]] name = "p3-interpolation" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d032cda212f6b408d7d5b0b9a8270a9455acb93742fe55a0880d82be8e90e500" +checksum = "d24d0f2907a374ebe4545fcff3120d6376d9630cf0bef30feedcfc5908ea2c37" dependencies = [ "p3-field", "p3-matrix", "p3-util", ] -[[package]] -name = "p3-keccak" -version = "0.1.3-succinct" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c56abdd5a8a780049d2f8e92cea1df57b55a2ef50a40d1103f2732f7a00e4b1" -dependencies = [ - "p3-symmetric", - "tiny-keccak 2.0.2", -] - [[package]] name = "p3-keccak-air" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8398f1694ccc38513df0b8cab5f9ef7325423f27cd9e4fa20bdc77d5079cf1b" +checksum = "e66badd47cedf6570e91a0cabc389b80dfd53ba1a6e9a45a3923fd54b86122ff" dependencies = [ "p3-air", "p3-field", @@ -4906,15 +4803,13 @@ dependencies = [ "p3-maybe-rayon", "p3-util", "tracing", - "tracing-forest", - "tracing-subscriber", ] [[package]] name = "p3-matrix" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d548ee0b834f8e2ebc5037073acd101a3b0ca41a2d1d28a15ba0ccd9059495b0" +checksum = "fa272f3ae77ed8d73478aa7c89e712efb15bda3ff4aff10fadfe11a012cd5389" dependencies = [ "itertools 0.12.1", "p3-field", @@ -4927,18 +4822,18 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55f5575d3d61bedb3e05681abb0f36b8bb339d65aa395d50756bfa64e9cd3f46" +checksum = "3eecad6292021858f282d643d9d1284ab112a200494d589863a9c4080e578ef0" dependencies = [ "rayon", ] [[package]] name = "p3-mds" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6e57ed310d59245f93e24ee805ea7aa16fc9c505551b76a15f5e50f29d177e" +checksum = "716c4dbe68a02f1541eb09149d07b8663a3a5951b1864a31cd67ff3bb0826e57" dependencies = [ "itertools 0.12.1", "p3-dft", @@ -4951,9 +4846,9 @@ dependencies = [ [[package]] name = "p3-merkle-tree" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af46b41cba75d483ec8a553cbab1d2d794935ae3403d75394acfa4fb2c977cce" +checksum = "ad7ebab52a03c26025988663a135aed62f5084a2e2ea262176dc8748efb593e5" dependencies = [ "itertools 0.12.1", "p3-commit", @@ -4968,22 +4863,23 @@ dependencies = [ [[package]] name = "p3-poseidon2" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adaba6f14c197203530e233badce0ca1126ba3bf3c9ff766505b497bdad0bee1" +checksum = "39c042efa15beab7a8c4d0ca9b9e4cbda7582be0c08e121e830fec45f082935b" dependencies = [ "gcd", "p3-field", "p3-mds", "p3-symmetric", "rand 0.8.5", + "serde", ] [[package]] name = "p3-symmetric" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ecc4282566eb14f48be7707f6745c4dff6be664984d59ec0fb1849cd82b5c2" +checksum = "b9896a831f5b688adc13f6fbe1dcf66ecfaa4622a500f81aa745610e777acb72" dependencies = [ "itertools 0.12.1", "p3-field", @@ -4992,9 +4888,9 @@ dependencies = [ [[package]] name = "p3-uni-stark" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1af5c038b22b058bf1d49fb1ea3dd6c240a3e46c3278fde5c444e0034f7ffe37" +checksum = "8437ebcd060c8a5479898030b114a93da8a86eb4c2e5f313d9eeaaf40c6e6f61" dependencies = [ "itertools 0.12.1", "p3-air", @@ -5005,18 +4901,15 @@ dependencies = [ "p3-matrix", "p3-maybe-rayon", "p3-util", - "postcard", "serde", "tracing", - "tracing-forest", - "tracing-subscriber", ] [[package]] name = "p3-util" -version = "0.1.3-succinct" +version = "0.1.4-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79f3fef0e00d9d7246385e758c4cd39b4efcbbcea31752471491ab502631385e" +checksum = "dedb9d27ba47ac314c6fac4ca54e55c3e486c864d51ec5ba55dbe47b75121157" dependencies = [ "serde", ] @@ -5287,18 +5180,6 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" -[[package]] -name = "postcard" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7f0a8d620d71c457dd1d47df76bb18960378da56af4527aaa10f515eee732e" -dependencies = [ - "cobs", - "embedded-io 0.4.0", - "embedded-io 0.6.1", - "serde", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -5438,9 +5319,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", "prost-derive", @@ -5448,26 +5329,17 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.13.0", "proc-macro2", "quote", "syn 2.0.79", ] -[[package]] -name = "psm" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" -dependencies = [ - "cc", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -5737,19 +5609,23 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.31", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", "system-configuration 0.5.1", "tokio", + "tokio-native-tls", "tower-service", "url", "wasm-bindgen", @@ -5775,7 +5651,7 @@ dependencies = [ "http-body-util", "hyper 1.5.0", "hyper-rustls 0.27.3", - "hyper-tls", + "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", @@ -6682,9 +6558,9 @@ dependencies = [ [[package]] name = "sp1-build" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8216e07a9c463c6ee091cdc817cfc10c25446cfd4d020812818177e0a3d1c943" +checksum = "8929a4197b02537dbcd16a078e9424d40985438091df64a9373ebd10e5557083" dependencies = [ "anyhow", "cargo_metadata", @@ -6695,16 +6571,15 @@ dependencies = [ [[package]] name = "sp1-core-executor" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9855631556145c827f959527a2f60cb2c6ededfb42afcee49e41dab5f507ce7b" +checksum = "1ff9718f87f207404aee3f447c4438e2a35791092dc24ce65ff95db699ed49c1" dependencies = [ "bincode", "bytemuck", "elf", "enum-map", "eyre", - "generic-array 1.1.0", "hashbrown 0.14.5", "hex", "itertools 0.13.0", @@ -6712,14 +6587,11 @@ dependencies = [ "nohash-hasher", "num", "p3-field", - "p3-keccak-air", "p3-maybe-rayon", "rand 0.8.5", "rrs-succinct", "serde", - "serde_with", "sp1-curves", - "sp1-derive", "sp1-primitives", "sp1-stark", "strum", @@ -6733,18 +6605,12 @@ dependencies = [ [[package]] name = "sp1-core-machine" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d9c51416ef52b258fa637538c02a2ac06ecaeec79d075c620013a77f035dee" +checksum = "7ac8b5f2cecb7b2174495fc7a3e004bdb78e1c7ea44577ac0acc0d1e90b817ea" dependencies = [ - "anyhow", - "arrayref", "bincode", - "blake3", - "bytemuck", "cfg-if", - "curve25519-dalek", - "elf", "elliptic-curve", "generic-array 1.1.0", "hashbrown 0.14.5", @@ -6752,32 +6618,20 @@ dependencies = [ "itertools 0.13.0", "k256", "log", - "nohash-hasher", "num", - "num-bigint 0.4.6", "num_cpus", "p3-air", "p3-baby-bear", "p3-blake3", "p3-challenger", - "p3-commit", - "p3-dft", "p3-field", - "p3-fri", - "p3-keccak", "p3-keccak-air", "p3-matrix", "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", "p3-uni-stark", "p3-util", "rand 0.8.5", - "rayon-scan", - "rrs-succinct", "serde", - "serde_with", "size", "snowbridge-amcl", "sp1-core-executor", @@ -6799,10 +6653,11 @@ dependencies = [ [[package]] name = "sp1-curves" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c33d4d3f5e3590cc8c8d8a3d074097020bc0be0b9dd35fe43e04c586440c85" +checksum = "f1af9ff15e524ebe58286d7ee9bc345657b45b13091b5dc58fdce61542b65a47" dependencies = [ + "cfg-if", "curve25519-dalek", "dashu", "elliptic-curve", @@ -6820,11 +6675,10 @@ dependencies = [ [[package]] name = "sp1-derive" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e33825340e1b21b37a29f5304fbd18a1c7c97ba1376fa35b7c017fd95dd627e" +checksum = "5f1490c07bd283f59169eae6e67df355b5de8ba10cc75bf6dbfc05a28fdccfc6" dependencies = [ - "proc-macro2", "quote", "syn 1.0.109", ] @@ -6835,7 +6689,7 @@ version = "0.1.0" dependencies = [ "alloy-primitives 0.7.7", "alloy-sol-types", - "consensus-core", + "helios-consensus-core", "serde", "ssz_rs", ] @@ -6846,7 +6700,7 @@ version = "0.1.0" dependencies = [ "alloy-primitives 0.7.7", "alloy-sol-types", - "consensus-core", + "helios-consensus-core", "serde_cbor", "sp1-helios-primitives", "sp1-zkvm", @@ -6865,7 +6719,8 @@ dependencies = [ "clap", "dotenv", "env_logger", - "helios", + "helios-consensus-core", + "helios-ethereum", "log", "reqwest 0.12.8", "serde", @@ -6895,53 +6750,56 @@ dependencies = [ [[package]] name = "sp1-lib" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413956de14568d7fb462213b9505ad4607d75c875301b9eca567cfb2e58eaac1" +checksum = "9c372b16988e765af85ccf958b18b26d89c05886f2592d313a285415dcc769cb" dependencies = [ - "anyhow", "bincode", - "cfg-if", - "hex", "serde", - "snowbridge-amcl", ] [[package]] name = "sp1-primitives" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbeba375fe59917f162f1808c280d2e39e4698dc7eeac83936b6e70c2f8dbbc" +checksum = "025f06b633588e246308ad5f67b32f0f7d1cbeab38f7a842314699270bc706f5" dependencies = [ - "itertools 0.13.0", + "bincode", + "hex", "lazy_static", + "num-bigint 0.4.6", "p3-baby-bear", "p3-field", "p3-poseidon2", "p3-symmetric", + "serde", + "sha2 0.10.8", ] [[package]] name = "sp1-prover" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "166e9f9fd29ecdfd4fd452d49052abdfbe735317f00016e94fde8410f90b4134" +checksum = "1bd16530cb12f1cecb1b6902142d8d0d87507f88de84bc714f10c29a7fd3769c" dependencies = [ "anyhow", "bincode", "clap", "dirs", - "hex", + "eyre", "itertools 0.13.0", + "lazy_static", + "lru", "num-bigint 0.4.6", - "oneshot", "p3-baby-bear", "p3-bn254-fr", "p3-challenger", "p3-commit", "p3-field", "p3-matrix", + "p3-symmetric", "rayon", + "reqwest 0.11.27", "serde", "serde_json", "serial_test", @@ -6952,7 +6810,6 @@ dependencies = [ "sp1-recursion-compiler", "sp1-recursion-core", "sp1-recursion-gnark-ffi", - "sp1-recursion-program", "sp1-stark", "subtle-encoding", "tempfile", @@ -6963,53 +6820,54 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ccdda16cd078f32c6707212b8e8f3e423992eeff6ace898d3e15bf94e78a16" +checksum = "98d0a8ceee12600bd14d2e2d31b54db00b7985e30acedbfe8e1c1a9e41d7992f" dependencies = [ - "bincode", + "hashbrown 0.14.5", "itertools 0.13.0", + "num-traits", "p3-air", "p3-baby-bear", "p3-bn254-fr", + "p3-challenger", "p3-commit", + "p3-dft", "p3-field", "p3-fri", "p3-matrix", + "p3-symmetric", "p3-util", + "rand 0.8.5", + "rayon", "serde", + "sp1-core-executor", "sp1-core-machine", + "sp1-derive", + "sp1-primitives", "sp1-recursion-compiler", "sp1-recursion-core", - "sp1-recursion-derive", - "sp1-recursion-program", + "sp1-recursion-gnark-ffi", "sp1-stark", + "tracing", ] [[package]] name = "sp1-recursion-compiler" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae17b6c8506b3521e78450cf28f76c2426b5b2f132bb89660d3d61eb155439c4" +checksum = "591d60768948dcef34a1fc16c3c6cf457e32fdee83d55ec14dbb94cd4447c030" dependencies = [ "backtrace", "itertools 0.13.0", - "p3-air", "p3-baby-bear", "p3-bn254-fr", - "p3-commit", "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", "p3-symmetric", - "p3-util", - "rayon", "serde", "sp1-core-machine", "sp1-primitives", "sp1-recursion-core", - "sp1-recursion-core-v2", "sp1-recursion-derive", "sp1-stark", "tracing", @@ -7018,54 +6876,14 @@ dependencies = [ [[package]] name = "sp1-recursion-core" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8414c3d16cd2fedd293989cef601915d4e1efab662e3a08923606970dc8ae7e6" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.13.0", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "serde_with", - "sp1-core-executor", - "sp1-core-machine", - "sp1-derive", - "sp1-primitives", - "sp1-stark", - "static_assertions", - "tracing", - "zkhash", -] - -[[package]] -name = "sp1-recursion-core-v2" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0a2af67ca6f7db964b7f1ffdb48f6e26f10e3cc027a11bdd17b224f8747650" +checksum = "85c15a51b675accb41608f7bf7ef5f95c23b47ceac38a9a87833a2b12c3bc190" dependencies = [ - "arrayref", "backtrace", "ff 0.13.0", "hashbrown 0.14.5", "itertools 0.13.0", - "num_cpus", "p3-air", "p3-baby-bear", "p3-bn254-fr", @@ -7081,12 +6899,9 @@ dependencies = [ "p3-symmetric", "p3-util", "serde", - "serde_with", - "sp1-core-executor", "sp1-core-machine", "sp1-derive", "sp1-primitives", - "sp1-recursion-core", "sp1-stark", "static_assertions", "thiserror", @@ -7097,20 +6912,19 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4921db3912a60ee3896242ce336203066377e6eddd1c26d099e8bf6b9c470a21" +checksum = "c5b2aaa03093afb2b0f58379bb4f0d7898344ef1bb8dd326ec02db7125c1a590" dependencies = [ - "proc-macro2", "quote", "syn 1.0.109", ] [[package]] name = "sp1-recursion-gnark-ffi" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718b2e92bfd3ce91fcef2ac0b3a8d31746dbc3ad4071f3bec45aa2e5e025adb1" +checksum = "1a12889c662cf64870e72bb3ba8096f3465bf442f5f179c07b50c86f5c47ce80" dependencies = [ "anyhow", "bincode", @@ -7123,7 +6937,6 @@ dependencies = [ "p3-baby-bear", "p3-field", "p3-symmetric", - "rand 0.8.5", "serde", "serde_json", "sha2 0.10.8", @@ -7133,43 +6946,11 @@ dependencies = [ "tempfile", ] -[[package]] -name = "sp1-recursion-program" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "676661b42f5d55c64932ad400ec920bd8b8098b1500b13c483a541bf3b396dd1" -dependencies = [ - "itertools 0.13.0", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand 0.8.5", - "serde", - "sp1-core-executor", - "sp1-core-machine", - "sp1-primitives", - "sp1-recursion-compiler", - "sp1-recursion-core", - "sp1-stark", - "stacker", - "tracing", -] - [[package]] name = "sp1-sdk" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b289585392a3639f6541bce32dd89e03e7893f42e9b9bcf6bee7d54183d5e05" +checksum = "39bab15e962d1218e8ad021b2e9904597d5506d12847ef8be182385d5f3d3a6c" dependencies = [ "alloy-sol-types", "anyhow", @@ -7179,31 +6960,25 @@ dependencies = [ "dirs", "ethers", "futures", - "getrandom 0.2.15", "hashbrown 0.14.5", "hex", "indicatif", "itertools 0.13.0", "log", - "num-bigint 0.4.6", "p3-baby-bear", - "p3-commit", "p3-field", "p3-fri", - "p3-matrix", "prost", "reqwest 0.12.8", "reqwest-middleware", "serde", - "serde_json", - "sha2 0.10.8", "sp1-core-executor", "sp1-core-machine", + "sp1-primitives", "sp1-prover", "sp1-stark", "strum", "strum_macros", - "sysinfo", "tempfile", "thiserror", "tokio", @@ -7214,14 +6989,15 @@ dependencies = [ [[package]] name = "sp1-stark" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4048fc99a6c1123f5040b5ade1ae2839ca1be421e4c427fc7d1fd9bbf6e174f5" +checksum = "ec27b60e797a52eed7af54e032498edcaf8f1ab0649077cbaa6f146a740380dd" dependencies = [ "arrayref", "getrandom 0.2.15", "hashbrown 0.14.5", "itertools 0.13.0", + "num-traits", "p3-air", "p3-baby-bear", "p3-challenger", @@ -7240,26 +7016,26 @@ dependencies = [ "serde", "sp1-derive", "sp1-primitives", + "strum", + "strum_macros", "sysinfo", + "thiserror", "tracing", ] [[package]] name = "sp1-zkvm" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c525f67cfd3f65950f01c713a72c41a5d44d289155644c8ace4ec264098039" +checksum = "ce08dc324dade0709260b01c76c8eeb665f2ef7c652c2002e2edf5a492ded7f1" dependencies = [ - "bincode", "cfg-if", "getrandom 0.2.15", "lazy_static", "libm", - "once_cell", "rand 0.8.5", - "serde", "sha2 0.10.8", - "sp1-lib 2.0.0", + "sp1-lib 3.0.0", ] [[package]] @@ -7326,19 +7102,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "stacker" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" -dependencies = [ - "cc", - "cfg-if", - "libc", - "psm", - "windows-sys 0.59.0", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -7997,13 +7760,12 @@ dependencies = [ [[package]] name = "twirp-rs" -version = "0.3.0" +version = "0.13.0-succinct" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa3161d8eee0abcad4e762f4215381a430cc1281870d575b0f1e4fbfc74b8ce" +checksum = "27dfcc06b8d9262bc2d4b8d1847c56af9971a52dd8a0076876de9db763227d0d" dependencies = [ "async-trait", "axum", - "bytes", "futures", "http 1.1.0", "http-body-util", @@ -8014,7 +7776,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tower 0.4.13", + "tower 0.5.1", "url", ] @@ -8313,6 +8075,20 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmtimer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ed9d8b15c7fb594d72bfb4b5a276f3d2029333cd93a932f376f5937f6f80ee" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "web-sys" version = "0.3.72" @@ -8351,18 +8127,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "widestring" version = "1.1.0" diff --git a/Cargo.toml b/Cargo.toml index a2afbd9..4bdd2e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,15 +16,15 @@ sp1-helios-program = { path = "program" } sp1-helios-primitives = { path = "primitives" } # helios -helios = { git = "https://github.com/a16z/helios", version = "0.6.1" } -consensus-core = { git = "https://github.com/a16z/helios", version = "0.6.1" } -common = { git = "https://github.com/a16z/helios", version = "0.6.1" } +helios = { git = "https://github.com/a16z/helios", version = "0.7.0" } +helios-consensus-core = { git = "https://github.com/a16z/helios", version = "0.7.0" } +helios-ethereum = { git = "https://github.com/a16z/helios", version = "0.7.0" } # general dotenv = "0.15.0" eyre = "0.6.12" -sp1-sdk = "2.0.0" -sp1-build = "2.0.0" +sp1-sdk = "3.0.0" +sp1-build = "3.0.0" tokio = "1.38.0" tracing = "0.1.37" serde = "1.0.203" diff --git a/elf/riscv32im-succinct-zkvm-elf b/elf/riscv32im-succinct-zkvm-elf index 7f29957..909be1f 100755 Binary files a/elf/riscv32im-succinct-zkvm-elf and b/elf/riscv32im-succinct-zkvm-elf differ diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index ebc1567..3d184f4 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -8,6 +8,6 @@ authors.workspace = true [dependencies] ssz-rs = { workspace = true } serde = { workspace = true } -consensus-core = { workspace = true } +helios-consensus-core = { workspace = true } alloy-sol-types = { workspace = true } alloy-primitives = { workspace = true } diff --git a/primitives/src/types.rs b/primitives/src/types.rs index 5762861..585f229 100644 --- a/primitives/src/types.rs +++ b/primitives/src/types.rs @@ -1,17 +1,18 @@ use alloy_primitives::B256; use alloy_sol_types::sol; -use consensus_core::types::Forks; -use consensus_core::types::{FinalityUpdate, LightClientStore, Update}; +use helios_consensus_core::consensus_spec::MainnetConsensusSpec; +use helios_consensus_core::types::Forks; +use helios_consensus_core::types::{FinalityUpdate, LightClientStore, Update}; use serde::{Deserialize, Serialize}; use ssz_rs::prelude::*; pub use ssz_rs::prelude::{Bitvector, Vector}; #[derive(Serialize, Deserialize, Debug)] pub struct ProofInputs { - pub updates: Vec, - pub finality_update: FinalityUpdate, + pub updates: Vec>, + pub finality_update: FinalityUpdate, pub expected_current_slot: u64, - pub store: LightClientStore, + pub store: LightClientStore, pub genesis_root: B256, pub forks: Forks, pub execution_state_proof: ExecutionStateProof, diff --git a/program/Cargo.toml b/program/Cargo.toml index 989dcdc..2968430 100644 --- a/program/Cargo.toml +++ b/program/Cargo.toml @@ -6,8 +6,8 @@ license.workspace = true authors.workspace = true [dependencies] -sp1-zkvm = "2.0.0" -consensus-core = { workspace = true } +sp1-zkvm = "3.0.0" +helios-consensus-core = { workspace = true } serde_cbor = { workspace = true } sp1-helios-primitives = { workspace = true } alloy-sol-types = { workspace = true } diff --git a/program/src/main.rs b/program/src/main.rs index 3857eb7..314d0ae 100644 --- a/program/src/main.rs +++ b/program/src/main.rs @@ -3,7 +3,9 @@ sp1_zkvm::entrypoint!(main); use alloy_primitives::{B256, U256}; use alloy_sol_types::SolValue; -use consensus_core::{apply_finality_update, apply_update, verify_finality_update, verify_update}; +use helios_consensus_core::{ + apply_finality_update, apply_update, verify_finality_update, verify_update, +}; use sp1_helios_primitives::types::{ProofInputs, ProofOutputs}; use ssz_rs::prelude::*; use tree_hash::TreeHash; @@ -31,8 +33,8 @@ pub fn main() { execution_state_proof, } = serde_cbor::from_slice(&encoded_inputs).unwrap(); - let prev_header: B256 = store.finalized_header.beacon.tree_hash_root(); - let prev_head = store.finalized_header.beacon.slot; + let prev_header: B256 = store.finalized_header.beacon().tree_hash_root(); + let prev_head = store.finalized_header.beacon().slot; // 1. Apply sync committee updates, if any for (index, update) in updates.iter().enumerate() { @@ -75,7 +77,7 @@ pub fn main() { execution_state_branch_nodes.iter(), MERKLE_BRANCH_DEPTH, MERKLE_BRANCH_INDEX, - &Node::try_from(store.finalized_header.beacon.body_root.as_ref()).unwrap(), + &Node::try_from(store.finalized_header.beacon().body_root.as_ref()).unwrap(), ); if !execution_state_proof_is_valid { panic!("Execution state root proof is invalid!"); @@ -83,13 +85,13 @@ pub fn main() { println!("Execution state root proof is valid."); // 4. Commit new state root, header, and sync committee for usage in the on-chain contract - let header: B256 = store.finalized_header.beacon.tree_hash_root(); + let header: B256 = store.finalized_header.beacon().tree_hash_root(); let sync_committee_hash: B256 = store.current_sync_committee.tree_hash_root(); let next_sync_committee_hash: B256 = match &mut store.next_sync_committee { Some(next_sync_committee) => next_sync_committee.tree_hash_root(), None => B256::ZERO, }; - let head = store.finalized_header.beacon.slot; + let head = store.finalized_header.beacon().slot; let proof_outputs = ProofOutputs { executionStateRoot: execution_state_proof.execution_state_root, diff --git a/script/Cargo.toml b/script/Cargo.toml index 9c73712..792c8b7 100644 --- a/script/Cargo.toml +++ b/script/Cargo.toml @@ -21,7 +21,8 @@ path = "./bin/test.rs" dotenv = { workspace = true } sp1-sdk = { workspace = true } tokio = { workspace = true } -helios = { workspace = true } +helios-consensus-core = { workspace = true } +helios-ethereum = { workspace = true } sp1-helios-primitives = { workspace = true } serde = { workspace = true } ssz-rs = { workspace = true } diff --git a/script/bin/genesis.rs b/script/bin/genesis.rs index 6ca62e0..76bd9af 100644 --- a/script/bin/genesis.rs +++ b/script/bin/genesis.rs @@ -82,9 +82,9 @@ pub async fn main() -> Result<()> { .store .finalized_header .clone() - .beacon + .beacon() .tree_hash_root(); - let head = helios_client.store.finalized_header.clone().beacon.slot; + let head = helios_client.store.finalized_header.clone().beacon().slot; let sync_committee_hash = helios_client .store .current_sync_committee diff --git a/script/bin/operator.rs b/script/bin/operator.rs index 772d9a6..8ce4fe8 100644 --- a/script/bin/operator.rs +++ b/script/bin/operator.rs @@ -10,10 +10,12 @@ use alloy::{ sol, transports::http::{Client, Http}, }; +use helios_ethereum::consensus::Inner; +use helios_ethereum::rpc::http_rpc::HttpRpc; +use helios_consensus_core::consensus_spec::MainnetConsensusSpec; +use helios_ethereum::rpc::ConsensusRpc; use alloy_primitives::{B256, U256}; use anyhow::Result; -use helios::consensus::rpc::ConsensusRpc; -use helios::consensus::{rpc::nimbus_rpc::NimbusRpc, Inner}; use log::{error, info}; use sp1_helios_primitives::types::ProofInputs; use sp1_helios_script::*; @@ -124,7 +126,7 @@ impl SP1LightClientOperator { /// Fetch values and generate an 'update' proof for the SP1 LightClient contract. async fn request_update( &self, - mut client: Inner, + mut client: Inner, ) -> Result> { // Fetch required values. let contract = SP1LightClient::new(self.contract_address, self.wallet_filler.clone()); @@ -158,7 +160,7 @@ impl SP1LightClientOperator { let finality_update = client.rpc.get_finality_update().await.unwrap(); // Check if contract is up to date - let latest_block = finality_update.finalized_header.beacon.slot; + let latest_block = finality_update.finalized_header.beacon().slot; if latest_block <= head { info!("Contract is up to date. Nothing to update."); return Ok(None); @@ -199,7 +201,7 @@ impl SP1LightClientOperator { stdin.write_slice(&encoded_proof_inputs); // Generate proof. - let proof = self.client.prove(&self.pk, stdin).plonk().run()?; + let proof = self.client.prove(&self.pk, stdin).groth16().run()?; info!("Attempting to update to new head block: {:?}", latest_block); Ok(Some(proof)) diff --git a/script/bin/test.rs b/script/bin/test.rs index e5f9cde..6ead15a 100644 --- a/script/bin/test.rs +++ b/script/bin/test.rs @@ -1,6 +1,6 @@ use anyhow::Result; use clap::{command, Parser}; -use helios::consensus::rpc::ConsensusRpc; +use helios_ethereum::rpc::ConsensusRpc; use sp1_helios_primitives::types::ProofInputs; use sp1_helios_script::{ get_checkpoint, get_client, get_execution_state_root_proof, get_latest_checkpoint, get_updates, @@ -32,7 +32,7 @@ async fn main() -> Result<()> { let helios_client = get_client(checkpoint).await; let updates = get_updates(&helios_client).await; let finality_update = helios_client.rpc.get_finality_update().await.unwrap(); - let latest_block = finality_update.finalized_header.beacon.slot; + let latest_block = finality_update.finalized_header.beacon().slot; let execution_state_root_proof = get_execution_state_root_proof(latest_block).await.unwrap(); diff --git a/script/src/lib.rs b/script/src/lib.rs index 5ad8b88..d4ec59b 100644 --- a/script/src/lib.rs +++ b/script/src/lib.rs @@ -1,15 +1,11 @@ use alloy_primitives::B256; -use helios::{ - config::networks::Network, - consensus::{ - constants, - rpc::{nimbus_rpc::NimbusRpc, ConsensusRpc}, - Inner, - }, - consensus_core::calc_sync_period, - prelude::*, - types::Update, +use helios_consensus_core::{calc_sync_period, consensus_spec::MainnetConsensusSpec, types::{Update, BeaconBlock}}; +use helios_ethereum::{ + config::{checkpoints, networks::Network, Config}, + consensus::Inner, + rpc::http_rpc::HttpRpc, }; +use helios_ethereum::rpc::ConsensusRpc; use serde::Deserialize; use sp1_helios_primitives::types::ExecutionStateProof; use ssz_rs::prelude::*; @@ -18,13 +14,16 @@ use tokio::sync::{mpsc::channel, watch}; use tree_hash::TreeHash; pub mod relay; +/// TODO: Expose this from helios-ethereum +pub const MAX_REQUEST_LIGHT_CLIENT_UPDATES: u8 = 128; + /// Fetch updates for client -pub async fn get_updates(client: &Inner) -> Vec { - let period = calc_sync_period(client.store.finalized_header.beacon.slot); +pub async fn get_updates(client: &Inner) -> Vec> { + let period = calc_sync_period::(client.store.finalized_header.beacon().slot); let updates = client .rpc - .get_updates(period, constants::MAX_REQUEST_LIGHT_CLIENT_UPDATES) + .get_updates(period, MAX_REQUEST_LIGHT_CLIENT_UPDATES) .await .unwrap(); @@ -46,11 +45,32 @@ pub async fn get_latest_checkpoint() -> B256 { /// Fetch checkpoint from a slot number. pub async fn get_checkpoint(slot: u64) -> B256 { - let rpc_url = - std::env::var("SOURCE_CONSENSUS_RPC_URL").expect("SOURCE_CONSENSUS_RPC_URL not set"); - let rpc: NimbusRpc = NimbusRpc::new(&rpc_url); + let consensus_rpc = std::env::var("SOURCE_CONSENSUS_RPC_URL").unwrap(); + let chain_id = std::env::var("SOURCE_CHAIN_ID").unwrap(); + let network = Network::from_chain_id(chain_id.parse().unwrap()).unwrap(); + let base_config = network.to_base_config(); + + let config = Config { + consensus_rpc: consensus_rpc.to_string(), + execution_rpc: String::new(), + chain: base_config.chain, + forks: base_config.forks, + strict_checkpoint_age: false, + ..Default::default() + }; + + let (block_send, _) = channel(256); + let (finalized_block_send, _) = watch::channel(None); + let (channel_send, _) = watch::channel(None); + let client = Inner::::new( + &consensus_rpc, + block_send, + finalized_block_send, + channel_send, + Arc::new(config), + ); - let block = rpc.get_block(slot).await.unwrap(); + let block: BeaconBlock = client.rpc.get_block(slot).await.unwrap(); B256::from_slice(block.tree_hash_root().as_ref()) } @@ -90,7 +110,7 @@ pub async fn get_execution_state_root_proof( } /// Setup a client from a checkpoint. -pub async fn get_client(checkpoint: B256) -> Inner { +pub async fn get_client(checkpoint: B256) -> Inner { let consensus_rpc = std::env::var("SOURCE_CONSENSUS_RPC_URL").unwrap(); let chain_id = std::env::var("SOURCE_CHAIN_ID").unwrap(); let network = Network::from_chain_id(chain_id.parse().unwrap()).unwrap(); @@ -109,7 +129,7 @@ pub async fn get_client(checkpoint: B256) -> Inner { let (finalized_block_send, _) = watch::channel(None); let (channel_send, _) = watch::channel(None); - let mut client = Inner::::new( + let mut client = Inner::new( &consensus_rpc, block_send, finalized_block_send,