diff --git a/Cargo.lock b/Cargo.lock index 911ed1b5..ca5702ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -249,6 +249,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-hardforks", + "alloy-op-hardforks", "alloy-primitives", "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -356,6 +357,36 @@ dependencies = [ "serde", ] +[[package]] +name = "alloy-op-evm" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231262d7e06000f3fb642d32d38ca75e09e78e04977c10be0a07a5ee2c869cfd" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-evm", + "alloy-op-hardforks", + "alloy-primitives", + "auto_impl", + "op-alloy", + "op-revm", + "revm", + "thiserror 2.0.17", +] + +[[package]] +name = "alloy-op-hardforks" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f96fb2fce4024ada5b2c11d4076acf778a0d3e4f011c6dfd2ffce6d0fcf84ee9" +dependencies = [ + "alloy-chains", + "alloy-hardforks", + "alloy-primitives", + "auto_impl", +] + [[package]] name = "alloy-primitives" version = "1.4.1" @@ -932,7 +963,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -943,7 +974,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -1462,6 +1493,7 @@ dependencies = [ "clap", "derive_more", "eyre", + "futures-util", "jsonrpsee", "jsonrpsee-core", "jsonrpsee-proc-macros", @@ -1491,6 +1523,8 @@ dependencies = [ "reth-node-builder", "reth-node-core", "reth-node-ethereum", + "reth-optimism-flashblocks", + "reth-optimism-rpc", "reth-payload-primitives", "reth-payload-validator", "reth-primitives-traits", @@ -2832,7 +2866,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.2", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -3103,7 +3137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3999,7 +4033,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core 0.61.2", ] [[package]] @@ -5186,7 +5220,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -5375,6 +5409,12 @@ dependencies = [ "thiserror 2.0.17", ] +[[package]] +name = "op-alloy-flz" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a79f352fc3893dcd670172e615afef993a41798a1d3fc0db88a3e60ef2e70ecc" + [[package]] name = "op-alloy-network" version = "0.22.4" @@ -5406,6 +5446,16 @@ dependencies = [ "op-alloy-rpc-types-engine", ] +[[package]] +name = "op-alloy-rpc-jsonrpsee" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ef9114426b16172254555aad34a8ea96c01895e40da92f5d12ea680a1baeaa7" +dependencies = [ + "alloy-primitives", + "jsonrpsee", +] + [[package]] name = "op-alloy-rpc-types" version = "0.22.4" @@ -6466,7 +6516,7 @@ checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" [[package]] name = "reth" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-rpc-types", "aquamarine", @@ -6512,7 +6562,7 @@ dependencies = [ [[package]] name = "reth-basic-payload-builder" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6536,7 +6586,7 @@ dependencies = [ [[package]] name = "reth-chain-state" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6567,7 +6617,7 @@ dependencies = [ [[package]] name = "reth-chainspec" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-chains", "alloy-consensus", @@ -6587,7 +6637,7 @@ dependencies = [ [[package]] name = "reth-cli" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-genesis", "clap", @@ -6601,7 +6651,7 @@ dependencies = [ [[package]] name = "reth-cli-commands" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-chains", "alloy-consensus", @@ -6676,7 +6726,7 @@ dependencies = [ [[package]] name = "reth-cli-runner" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "reth-tasks", "tokio", @@ -6686,7 +6736,7 @@ dependencies = [ [[package]] name = "reth-cli-util" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-primitives", @@ -6704,7 +6754,7 @@ dependencies = [ [[package]] name = "reth-codecs" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6724,7 +6774,7 @@ dependencies = [ [[package]] name = "reth-codecs-derive" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "proc-macro2", "quote", @@ -6734,7 +6784,7 @@ dependencies = [ [[package]] name = "reth-config" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "eyre", "humantime-serde", @@ -6750,7 +6800,7 @@ dependencies = [ [[package]] name = "reth-consensus" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -6763,7 +6813,7 @@ dependencies = [ [[package]] name = "reth-consensus-common" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6775,7 +6825,7 @@ dependencies = [ [[package]] name = "reth-consensus-debug-client" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6801,7 +6851,7 @@ dependencies = [ [[package]] name = "reth-db" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "derive_more", @@ -6827,7 +6877,7 @@ dependencies = [ [[package]] name = "reth-db-api" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-genesis", @@ -6855,7 +6905,7 @@ dependencies = [ [[package]] name = "reth-db-common" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-genesis", @@ -6885,7 +6935,7 @@ dependencies = [ [[package]] name = "reth-db-models" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-primitives", @@ -6900,7 +6950,7 @@ dependencies = [ [[package]] name = "reth-discv4" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -6925,7 +6975,7 @@ dependencies = [ [[package]] name = "reth-discv5" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -6949,7 +6999,7 @@ dependencies = [ [[package]] name = "reth-dns-discovery" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "data-encoding", @@ -6973,7 +7023,7 @@ dependencies = [ [[package]] name = "reth-downloaders" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7008,7 +7058,7 @@ dependencies = [ [[package]] name = "reth-e2e-test-utils" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7066,7 +7116,7 @@ dependencies = [ [[package]] name = "reth-ecies" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "aes", "alloy-primitives", @@ -7095,7 +7145,7 @@ dependencies = [ [[package]] name = "reth-engine-local" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -7118,7 +7168,7 @@ dependencies = [ [[package]] name = "reth-engine-primitives" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7143,7 +7193,7 @@ dependencies = [ [[package]] name = "reth-engine-service" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "futures", "pin-project", @@ -7165,7 +7215,7 @@ dependencies = [ [[package]] name = "reth-engine-tree" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7220,7 +7270,7 @@ dependencies = [ [[package]] name = "reth-engine-util" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-rpc-types-engine", @@ -7248,7 +7298,7 @@ dependencies = [ [[package]] name = "reth-era" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7263,7 +7313,7 @@ dependencies = [ [[package]] name = "reth-era-downloader" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "bytes", @@ -7279,7 +7329,7 @@ dependencies = [ [[package]] name = "reth-era-utils" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -7301,7 +7351,7 @@ dependencies = [ [[package]] name = "reth-errors" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -7312,7 +7362,7 @@ dependencies = [ [[package]] name = "reth-eth-wire" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-chains", "alloy-primitives", @@ -7340,7 +7390,7 @@ dependencies = [ [[package]] name = "reth-eth-wire-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-chains", "alloy-consensus", @@ -7361,7 +7411,7 @@ dependencies = [ [[package]] name = "reth-ethereum-cli" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "clap", "eyre", @@ -7383,7 +7433,7 @@ dependencies = [ [[package]] name = "reth-ethereum-consensus" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7399,7 +7449,7 @@ dependencies = [ [[package]] name = "reth-ethereum-engine-primitives" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-primitives", @@ -7417,7 +7467,7 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eip2124", "alloy-hardforks", @@ -7430,7 +7480,7 @@ dependencies = [ [[package]] name = "reth-ethereum-payload-builder" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7459,7 +7509,7 @@ dependencies = [ [[package]] name = "reth-ethereum-primitives" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7479,7 +7529,7 @@ dependencies = [ [[package]] name = "reth-etl" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "rayon", "reth-db-api", @@ -7489,7 +7539,7 @@ dependencies = [ [[package]] name = "reth-evm" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7512,7 +7562,7 @@ dependencies = [ [[package]] name = "reth-evm-ethereum" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7533,7 +7583,7 @@ dependencies = [ [[package]] name = "reth-execution-errors" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-evm", "alloy-primitives", @@ -7546,7 +7596,7 @@ dependencies = [ [[package]] name = "reth-execution-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7564,7 +7614,7 @@ dependencies = [ [[package]] name = "reth-exex" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7602,7 +7652,7 @@ dependencies = [ [[package]] name = "reth-exex-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-primitives", @@ -7616,7 +7666,7 @@ dependencies = [ [[package]] name = "reth-fs-util" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "serde", "serde_json", @@ -7626,7 +7676,7 @@ dependencies = [ [[package]] name = "reth-invalid-block-hooks" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -7654,7 +7704,7 @@ dependencies = [ [[package]] name = "reth-ipc" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "bytes", "futures", @@ -7674,7 +7724,7 @@ dependencies = [ [[package]] name = "reth-libmdbx" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "bitflags 2.10.0", "byteorder", @@ -7690,7 +7740,7 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "bindgen 0.71.1", "cc", @@ -7699,7 +7749,7 @@ dependencies = [ [[package]] name = "reth-metrics" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "futures", "metrics", @@ -7711,7 +7761,7 @@ dependencies = [ [[package]] name = "reth-net-banlist" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "ipnet", @@ -7720,7 +7770,7 @@ dependencies = [ [[package]] name = "reth-net-nat" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "futures-util", "if-addrs", @@ -7734,7 +7784,7 @@ dependencies = [ [[package]] name = "reth-network" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7789,7 +7839,7 @@ dependencies = [ [[package]] name = "reth-network-api" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -7814,7 +7864,7 @@ dependencies = [ [[package]] name = "reth-network-p2p" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7837,7 +7887,7 @@ dependencies = [ [[package]] name = "reth-network-peers" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -7852,7 +7902,7 @@ dependencies = [ [[package]] name = "reth-network-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eip2124", "humantime-serde", @@ -7866,7 +7916,7 @@ dependencies = [ [[package]] name = "reth-nippy-jar" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "anyhow", "bincode 1.3.3", @@ -7883,7 +7933,7 @@ dependencies = [ [[package]] name = "reth-node-api" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-rpc-types-engine", "eyre", @@ -7907,7 +7957,7 @@ dependencies = [ [[package]] name = "reth-node-builder" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -7974,7 +8024,7 @@ dependencies = [ [[package]] name = "reth-node-core" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8030,7 +8080,7 @@ dependencies = [ [[package]] name = "reth-node-ethereum" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-network", @@ -8068,7 +8118,7 @@ dependencies = [ [[package]] name = "reth-node-ethstats" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8092,7 +8142,7 @@ dependencies = [ [[package]] name = "reth-node-events" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8116,7 +8166,7 @@ dependencies = [ [[package]] name = "reth-node-metrics" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "eyre", "http", @@ -8138,7 +8188,7 @@ dependencies = [ [[package]] name = "reth-node-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "reth-chainspec", "reth-db-api", @@ -8147,10 +8197,175 @@ dependencies = [ "reth-primitives-traits", ] +[[package]] +name = "reth-optimism-chainspec" +version = "1.9.3" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" +dependencies = [ + "alloy-chains", + "alloy-consensus", + "alloy-eips", + "alloy-genesis", + "alloy-hardforks", + "alloy-primitives", + "derive_more", + "op-alloy-consensus", + "op-alloy-rpc-types", + "reth-chainspec", + "reth-ethereum-forks", + "reth-network-peers", + "reth-optimism-forks", + "reth-optimism-primitives", + "reth-primitives-traits", + "serde_json", +] + +[[package]] +name = "reth-optimism-consensus" +version = "1.9.3" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-trie", + "reth-chainspec", + "reth-consensus", + "reth-consensus-common", + "reth-execution-types", + "reth-optimism-chainspec", + "reth-optimism-forks", + "reth-optimism-primitives", + "reth-primitives-traits", + "reth-storage-api", + "reth-storage-errors", + "reth-trie-common", + "revm", + "thiserror 2.0.17", + "tracing", +] + +[[package]] +name = "reth-optimism-evm" +version = "1.9.3" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-evm", + "alloy-op-evm", + "alloy-primitives", + "op-alloy-consensus", + "op-alloy-rpc-types-engine", + "op-revm", + "reth-chainspec", + "reth-evm", + "reth-execution-errors", + "reth-execution-types", + "reth-optimism-chainspec", + "reth-optimism-consensus", + "reth-optimism-forks", + "reth-optimism-primitives", + "reth-primitives-traits", + "reth-storage-errors", + "revm", + "thiserror 2.0.17", +] + +[[package]] +name = "reth-optimism-flashblocks" +version = "1.9.3" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rpc-types-engine", + "brotli", + "derive_more", + "eyre", + "futures-util", + "metrics", + "op-alloy-consensus", + "op-alloy-rpc-types-engine", + "reth-chain-state", + "reth-engine-primitives", + "reth-errors", + "reth-evm", + "reth-execution-types", + "reth-metrics", + "reth-optimism-payload-builder", + "reth-optimism-primitives", + "reth-payload-primitives", + "reth-primitives-traits", + "reth-revm", + "reth-rpc-eth-types", + "reth-storage-api", + "reth-tasks", + "ringbuffer", + "serde", + "serde_json", + "tokio", + "tokio-tungstenite", + "tracing", + "url", +] + +[[package]] +name = "reth-optimism-forks" +version = "1.9.3" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" +dependencies = [ + "alloy-op-hardforks", + "alloy-primitives", + "once_cell", + "reth-ethereum-forks", +] + +[[package]] +name = "reth-optimism-payload-builder" +version = "1.9.3" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-evm", + "alloy-primitives", + "alloy-rlp", + "alloy-rpc-types-debug", + "alloy-rpc-types-engine", + "derive_more", + "either", + "op-alloy-consensus", + "op-alloy-rpc-types-engine", + "reth-basic-payload-builder", + "reth-chainspec", + "reth-evm", + "reth-execution-types", + "reth-optimism-evm", + "reth-optimism-forks", + "reth-optimism-primitives", + "reth-optimism-txpool", + "reth-payload-builder", + "reth-payload-builder-primitives", + "reth-payload-primitives", + "reth-payload-util", + "reth-payload-validator", + "reth-primitives-traits", + "reth-revm", + "reth-storage-api", + "reth-transaction-pool", + "revm", + "serde", + "sha2", + "thiserror 2.0.17", + "tracing", +] + [[package]] name = "reth-optimism-primitives" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8162,10 +8377,107 @@ dependencies = [ "serde_with", ] +[[package]] +name = "reth-optimism-rpc" +version = "1.9.3" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-primitives", + "alloy-rpc-client", + "alloy-rpc-types-debug", + "alloy-rpc-types-engine", + "alloy-rpc-types-eth", + "alloy-transport", + "alloy-transport-http", + "async-trait", + "derive_more", + "eyre", + "futures", + "jsonrpsee", + "jsonrpsee-core", + "jsonrpsee-types", + "metrics", + "op-alloy-consensus", + "op-alloy-network", + "op-alloy-rpc-jsonrpsee", + "op-alloy-rpc-types", + "op-alloy-rpc-types-engine", + "op-revm", + "reqwest", + "reth-chain-state", + "reth-chainspec", + "reth-evm", + "reth-metrics", + "reth-node-api", + "reth-node-builder", + "reth-optimism-evm", + "reth-optimism-flashblocks", + "reth-optimism-forks", + "reth-optimism-payload-builder", + "reth-optimism-primitives", + "reth-optimism-txpool", + "reth-primitives-traits", + "reth-rpc", + "reth-rpc-api", + "reth-rpc-engine-api", + "reth-rpc-eth-api", + "reth-rpc-eth-types", + "reth-rpc-server-types", + "reth-storage-api", + "reth-tasks", + "reth-transaction-pool", + "revm", + "serde_json", + "thiserror 2.0.17", + "tokio", + "tokio-stream", + "tower", + "tracing", +] + +[[package]] +name = "reth-optimism-txpool" +version = "1.9.3" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-primitives", + "alloy-rpc-client", + "alloy-rpc-types-eth", + "alloy-serde", + "c-kzg", + "derive_more", + "futures-util", + "metrics", + "op-alloy-consensus", + "op-alloy-flz", + "op-alloy-rpc-types", + "op-revm", + "parking_lot", + "reth-chain-state", + "reth-chainspec", + "reth-metrics", + "reth-optimism-evm", + "reth-optimism-forks", + "reth-optimism-primitives", + "reth-primitives-traits", + "reth-storage-api", + "reth-transaction-pool", + "serde", + "thiserror 2.0.17", + "tokio", + "tracing", +] + [[package]] name = "reth-payload-builder" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8186,7 +8498,7 @@ dependencies = [ [[package]] name = "reth-payload-builder-primitives" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "pin-project", "reth-payload-primitives", @@ -8198,7 +8510,7 @@ dependencies = [ [[package]] name = "reth-payload-primitives" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8218,10 +8530,20 @@ dependencies = [ "tokio", ] +[[package]] +name = "reth-payload-util" +version = "1.9.3" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" +dependencies = [ + "alloy-consensus", + "alloy-primitives", + "reth-transaction-pool", +] + [[package]] name = "reth-payload-validator" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-rpc-types-engine", @@ -8231,7 +8553,7 @@ dependencies = [ [[package]] name = "reth-primitives" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "once_cell", @@ -8244,7 +8566,7 @@ dependencies = [ [[package]] name = "reth-primitives-traits" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8277,7 +8599,7 @@ dependencies = [ [[package]] name = "reth-provider" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8321,7 +8643,7 @@ dependencies = [ [[package]] name = "reth-prune" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8349,7 +8671,7 @@ dependencies = [ [[package]] name = "reth-prune-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "arbitrary", @@ -8364,7 +8686,7 @@ dependencies = [ [[package]] name = "reth-ress-protocol" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8383,7 +8705,7 @@ dependencies = [ [[package]] name = "reth-ress-provider" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8410,7 +8732,7 @@ dependencies = [ [[package]] name = "reth-revm" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "reth-primitives-traits", @@ -8423,7 +8745,7 @@ dependencies = [ [[package]] name = "reth-rpc" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -8502,7 +8824,7 @@ dependencies = [ [[package]] name = "reth-rpc-api" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-genesis", @@ -8530,7 +8852,7 @@ dependencies = [ [[package]] name = "reth-rpc-builder" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-network", "alloy-provider", @@ -8569,7 +8891,7 @@ dependencies = [ [[package]] name = "reth-rpc-convert" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-evm", @@ -8581,16 +8903,21 @@ dependencies = [ "auto_impl", "dyn-clone", "jsonrpsee-types", + "op-alloy-consensus", + "op-alloy-network", + "op-alloy-rpc-types", "reth-ethereum-primitives", "reth-evm", + "reth-optimism-primitives", "reth-primitives-traits", + "reth-storage-api", "thiserror 2.0.17", ] [[package]] name = "reth-rpc-engine-api" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8619,7 +8946,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-api" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -8663,7 +8990,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8710,7 +9037,7 @@ dependencies = [ [[package]] name = "reth-rpc-layer" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-rpc-types-engine", "http", @@ -8724,7 +9051,7 @@ dependencies = [ [[package]] name = "reth-rpc-server-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8740,7 +9067,7 @@ dependencies = [ [[package]] name = "reth-stages" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8788,7 +9115,7 @@ dependencies = [ [[package]] name = "reth-stages-api" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8815,7 +9142,7 @@ dependencies = [ [[package]] name = "reth-stages-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "arbitrary", @@ -8829,7 +9156,7 @@ dependencies = [ [[package]] name = "reth-static-file" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "parking_lot", @@ -8849,7 +9176,7 @@ dependencies = [ [[package]] name = "reth-static-file-types" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "clap", @@ -8861,7 +9188,7 @@ dependencies = [ [[package]] name = "reth-storage-api" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8885,7 +9212,7 @@ dependencies = [ [[package]] name = "reth-storage-errors" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-eips", "alloy-primitives", @@ -8901,7 +9228,7 @@ dependencies = [ [[package]] name = "reth-tasks" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "auto_impl", "dyn-clone", @@ -8919,7 +9246,7 @@ dependencies = [ [[package]] name = "reth-testing-utils" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -8935,7 +9262,7 @@ dependencies = [ [[package]] name = "reth-tokio-util" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "tokio", "tokio-stream", @@ -8945,7 +9272,7 @@ dependencies = [ [[package]] name = "reth-tracing" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "clap", "eyre", @@ -8961,7 +9288,7 @@ dependencies = [ [[package]] name = "reth-tracing-otlp" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "clap", "eyre", @@ -8978,7 +9305,7 @@ dependencies = [ [[package]] name = "reth-transaction-pool" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9019,7 +9346,7 @@ dependencies = [ [[package]] name = "reth-trie" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -9045,7 +9372,7 @@ dependencies = [ [[package]] name = "reth-trie-common" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9072,7 +9399,7 @@ dependencies = [ [[package]] name = "reth-trie-db" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "reth-db-api", @@ -9085,7 +9412,7 @@ dependencies = [ [[package]] name = "reth-trie-parallel" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -9110,7 +9437,7 @@ dependencies = [ [[package]] name = "reth-trie-sparse" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -9129,7 +9456,7 @@ dependencies = [ [[package]] name = "reth-trie-sparse-parallel" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -9147,7 +9474,7 @@ dependencies = [ [[package]] name = "reth-zstd-compressors" version = "1.9.3" -source = "git+https://github.com/paradigmxyz/reth?rev=536bebfcd#536bebfcd7e8100ed69fe32c1122e18d6d6c3ff4" +source = "git+https://github.com/rezbera/reth?branch=rezbera%2Fmodular-flashblocks#64b95481b3900c3d8986f7fee5a4f17f85ef871b" dependencies = [ "zstd", ] @@ -9579,7 +9906,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -10421,7 +10748,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix 1.1.2", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -11569,7 +11896,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 42935f9b..50ab389e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,8 @@ reth-node-api = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" reth-node-builder = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } reth-node-core = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } +reth-optimism-flashblocks = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } +reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } reth-payload-validator = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } @@ -75,6 +77,7 @@ alloy-provider = "1.1.2" alloy-rpc-client = "1.1.2" alloy-rpc-types-trace = "1.1.2" eyre = "0.6.12" +futures-util = { version = "0.3", default-features = false } reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth", rev = "536bebfcd" } revm-inspectors = "0.33.0" @@ -111,49 +114,53 @@ lto = "thin" [package.metadata.cargo-machete] ignored = ["modular-bitfield"] -# [patch."https://github.com/paradigmxyz/reth"] -# reth = { path = "../reth/bin/reth" } -# reth-rpc = { path = "../reth/crates/rpc/rpc" } -# reth-basic-payload-builder = { path = "../reth/crates/payload/basic" } -# reth-chainspec = { path = "../reth/crates/chainspec" } -# reth-cli = { path = "../reth/crates/cli/cli" } -# reth-cli-commands = { path = "../reth/crates/cli/commands" } -# reth-cli-util = { path = "../reth/crates/cli/util" } -# reth-db = { path = "../reth/crates/storage/db" } -# reth-engine-local = { path = "../reth/crates/engine/local" } -# reth-engine-primitives = { path = "../reth/crates/engine/primitives" } -# reth-ethereum-cli = { path = "../reth/crates/ethereum/cli" } -# reth-engine-tree = { path = "../reth/crates/engine/tree" } -# reth-ethereum-engine-primitives = { path = "../reth/crates/ethereum/engine-primitives" } -# reth-ethereum-payload-builder = { path = "../reth/crates/ethereum/payload" } -# reth-ethereum-primitives = { path = "../reth/crates/ethereum/primitives" } -# reth-evm = { path = "../reth/crates/evm/evm" } -# reth-evm-ethereum = { path = "../reth/crates/ethereum/evm" } -# reth-network-peers = { path = "../reth/crates/net/peers" } -# reth-node-api = { path = "../reth/crates/node/api" } -# reth-node-builder = { path = "../reth/crates/node/builder" } -# reth-node-core = { path = "../reth/crates/node/core" } -# reth-payload-validator = { path = "../reth/crates/payload/validator" } -# reth-node-ethereum = { path = "../reth/crates/ethereum/node" } -# reth-payload-primitives = { path = "../reth/crates/payload/primitives" } -# reth-primitives-traits = { path = "../reth/crates/primitives-traits" } -# reth-tracing = { path = "../reth/crates/tracing" } -# reth-codecs = { path = "../reth/crates/storage/codecs" } -# reth-db-api = { path = "../reth/crates/storage/db-api" } -# reth-rpc-engine-api = { path = "../reth/crates/rpc/rpc-engine-api" } -# reth-rpc-eth-api = { path = "../reth/crates/rpc/rpc-eth-api" } -# reth-rpc-eth-types = { path = "../reth/crates/rpc/rpc-eth-types" } -# reth-rpc-convert = { path = "../reth/crates/rpc/rpc-convert" } -# reth-transaction-pool = { path = "../reth/crates/transaction-pool" } -# reth-zstd-compressors = { path = "../reth/crates/storage/zstd-compressors" } -# reth-trie-common = { path = "../reth/crates/trie/common" } -# reth-trie-db = { path = "../reth/crates/trie/db" } -# reth-trie = { path = "../reth/crates/trie/trie" } -# reth-stages-types = { path = "../reth/crates/stages/types" } -# reth-execution-types = { path = "../reth/crates/evm/execution-types" } -# reth-execution-errors = { path = "../reth/crates/evm/execution-errors" } -# reth-storage-api = { path = "../reth/crates/storage/storage-api" } -# reth-provider = { path = "../reth/crates/storage/provider" } -# reth-storage-errors = { path = "../reth/crates/storage/errors" } -# reth-e2e-test-utils = { path = "../reth/crates/e2e-test-utils" } -# reth-rpc-builder = { path = "../reth/crates/rpc/rpc-builder" } +[patch."https://github.com/paradigmxyz/reth"] +reth = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-rpc = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-basic-payload-builder = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-chainspec = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-cli = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-cli-commands = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-cli-util = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-db = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-engine-local = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-engine-primitives = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-errors = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-ethereum-cli = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-engine-tree = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-ethereum-engine-primitives = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-ethereum-payload-builder = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-ethereum-primitives = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-evm = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-evm-ethereum = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-network-peers = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-node-api = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-node-builder = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-node-core = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-payload-validator = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-node-ethereum = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-payload-primitives = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-primitives-traits = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-tracing = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-codecs = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-db-api = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-rpc-engine-api = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-rpc-eth-api = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-rpc-eth-types = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-rpc-convert = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-transaction-pool = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-zstd-compressors = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-trie-common = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-trie-db = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-trie = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-stages-types = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-execution-types = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-execution-errors = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-storage-api = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-provider = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-storage-errors = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-e2e-test-utils = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-rpc-builder = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-optimism-flashblocks = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-optimism-rpc = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } +reth-consensus-common = { git = "https://github.com/rezbera/reth", branch = "rezbera/modular-flashblocks" } diff --git a/src/flashblocks/mod.rs b/src/flashblocks/mod.rs new file mode 100644 index 00000000..e581cd86 --- /dev/null +++ b/src/flashblocks/mod.rs @@ -0,0 +1,500 @@ +#[cfg(test)] +pub mod test_utils; + +use crate::{primitives::header::BlsPublicKey, transaction::BerachainTxEnvelope}; +use alloy_consensus::{crypto::RecoveryError, transaction::Recovered}; +use alloy_eips::{ + eip2718::WithEncoded, + eip4895::{Withdrawal, Withdrawals}, +}; +use alloy_primitives::{Address, B256, Bloom, Bytes, U256}; +use reth::rpc::types::engine::PayloadId; +use reth_optimism_flashblocks::{FlashblockDiff, FlashblockPayload, FlashblockPayloadBase}; + +#[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +pub struct BerachainFlashblockPayloadBase { + /// Parent beacon block root. + pub parent_beacon_block_root: B256, + /// Hash of the parent block. + pub parent_hash: B256, + /// Address that receives fees for this block. + pub fee_recipient: Address, + /// The previous randao value. + pub prev_randao: B256, + /// Block number. + #[serde(with = "alloy_serde::quantity")] + pub block_number: u64, + /// Gas limit for this block. + #[serde(with = "alloy_serde::quantity")] + pub gas_limit: u64, + /// Block timestamp. + #[serde(with = "alloy_serde::quantity")] + pub timestamp: u64, + /// Extra data for the block. + pub extra_data: Bytes, + /// Base fee per gas for this block. + pub base_fee_per_gas: U256, + /// Berachain specific BlsPublicKey + pub prev_proposer_pubkey: Option, +} + +impl FlashblockPayloadBase for BerachainFlashblockPayloadBase { + fn parent_hash(&self) -> B256 { + self.parent_hash + } + + fn block_number(&self) -> u64 { + self.block_number + } + + fn timestamp(&self) -> u64 { + self.timestamp + } +} + +#[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +pub struct BerachainFlashblockPayloadDiff { + /// The state root of the block. + pub state_root: B256, + /// The receipts root of the block. + pub receipts_root: B256, + /// The logs bloom of the block. + pub logs_bloom: Bloom, + /// The gas used of the block. + #[serde(with = "alloy_serde::quantity")] + pub gas_used: u64, + /// The block hash of the block. + pub block_hash: B256, + /// The transactions of the block. + pub transactions: Vec, + /// Array of [`Withdrawal`] enabled with V2 + pub withdrawals: Vec, + /// The withdrawals root of the block. + pub withdrawals_root: B256, + /// The estimated cumulative blob gas used for the block. Introduced in Jovian. + /// spec: + /// Defaults to 0 if not present (for pre-Jovian blocks). + #[serde(default, skip_serializing_if = "Option::is_none", with = "alloy_serde::quantity::opt")] + pub blob_gas_used: Option, +} + +impl FlashblockDiff for BerachainFlashblockPayloadDiff { + fn block_hash(&self) -> B256 { + self.block_hash + } + + fn state_root(&self) -> B256 { + self.state_root + } + + fn gas_used(&self) -> u64 { + self.gas_used + } + + fn logs_bloom(&self) -> &Bloom { + &self.logs_bloom + } + + fn receipts_root(&self) -> B256 { + self.receipts_root + } + + fn transactions_raw(&self) -> &[Bytes] { + &self.transactions + } + + fn withdrawals(&self) -> Option<&Withdrawals> { + None + } + + fn withdrawals_root(&self) -> Option { + None + } +} + +#[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +pub struct BerachainFlashblockPayloadMetadata { + pub block_number: u64, +} + +#[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +pub struct BerachainFlashblockPayload { + pub payload_id: PayloadId, + pub index: u64, + pub base: Option, + pub diff: BerachainFlashblockPayloadDiff, + pub metadata: BerachainFlashblockPayloadMetadata, +} + +impl BerachainFlashblockPayload { + pub const fn block_number(&self) -> u64 { + self.metadata.block_number + } +} + +impl FlashblockPayload for BerachainFlashblockPayload { + type Base = BerachainFlashblockPayloadBase; + type Diff = BerachainFlashblockPayloadDiff; + type SignedTx = BerachainTxEnvelope; + + fn index(&self) -> u64 { + self.index + } + + fn payload_id(&self) -> PayloadId { + self.payload_id + } + + fn base(&self) -> Option { + self.base.clone() + } + + fn diff(&self) -> &Self::Diff { + &self.diff + } + + fn block_number(&self) -> u64 { + Self::block_number(self) + } + + fn recover_transactions( + &self, + ) -> impl Iterator>, RecoveryError>> { + use alloy_consensus::transaction::SignerRecoverable; + use alloy_eips::Decodable2718; + + self.diff.transactions.clone().into_iter().map(|raw| { + let tx = BerachainTxEnvelope::decode_2718(&mut raw.as_ref()) + .map_err(RecoveryError::from_source)?; + tx.try_into_recovered().map(|tx| tx.into_encoded_with(raw.clone())) + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::flashblocks::test_utils::BerachainTestFlashBlockFactory; + use reth_optimism_flashblocks::{FlashBlockCompleteSequence, FlashBlockPendingSequence}; + + mod serde_tests { + use super::*; + + #[test] + fn test_flashblock_payload_serde_roundtrip() { + let factory = BerachainTestFlashBlockFactory::new(); + let fb = + factory.flashblock_at(0).transactions(vec![Bytes::from_static(&[1, 2, 3])]).build(); + + let serialized = serde_json::to_string(&fb).expect("serialize"); + let deserialized: BerachainFlashblockPayload = + serde_json::from_str(&serialized).expect("deserialize"); + + assert_eq!(fb, deserialized); + } + + #[test] + fn test_flashblock_payload_base_serde_roundtrip() { + let base = BerachainFlashblockPayloadBase { + parent_beacon_block_root: B256::random(), + parent_hash: B256::random(), + fee_recipient: Address::random(), + prev_randao: B256::random(), + block_number: 100, + gas_limit: 30_000_000, + timestamp: 1_000_000, + extra_data: Bytes::from_static(&[0x42]), + base_fee_per_gas: U256::from(1_000_000_000u64), + prev_proposer_pubkey: Some(BlsPublicKey::random()), + }; + + let serialized = serde_json::to_string(&base).expect("serialize"); + let deserialized: BerachainFlashblockPayloadBase = + serde_json::from_str(&serialized).expect("deserialize"); + + assert_eq!(base, deserialized); + } + + #[test] + fn test_flashblock_payload_diff_serde_roundtrip() { + let diff = BerachainFlashblockPayloadDiff { + state_root: B256::random(), + receipts_root: B256::random(), + logs_bloom: Bloom::default(), + gas_used: 21000, + block_hash: B256::random(), + transactions: vec![Bytes::from_static(&[1, 2, 3])], + withdrawals: vec![], + withdrawals_root: B256::ZERO, + blob_gas_used: Some(131072), + }; + + let serialized = serde_json::to_string(&diff).expect("serialize"); + let deserialized: BerachainFlashblockPayloadDiff = + serde_json::from_str(&serialized).expect("deserialize"); + + assert_eq!(diff, deserialized); + } + + #[test] + fn test_flashblock_sequence_serde_roundtrip() { + let factory = BerachainTestFlashBlockFactory::new(); + let fb0 = factory.flashblock_at(0).build(); + let fb1 = factory.flashblock_after(&fb0).build(); + + let fbs = vec![fb0, fb1]; + let serialized = serde_json::to_string(&fbs).expect("serialize"); + let deserialized: Vec = + serde_json::from_str(&serialized).expect("deserialize"); + + assert_eq!(fbs.len(), deserialized.len()); + assert_eq!(fbs[0], deserialized[0]); + assert_eq!(fbs[1], deserialized[1]); + } + } + + mod pending_sequence_tests { + use super::*; + + #[test] + fn test_insert_index_zero_creates_new_sequence() { + let mut sequence: FlashBlockPendingSequence = + FlashBlockPendingSequence::new(); + let factory = BerachainTestFlashBlockFactory::new(); + let fb0 = factory.flashblock_at(0).build(); + let payload_id = fb0.payload_id; + + sequence.insert(fb0); + + assert_eq!(sequence.count(), 1); + assert_eq!(sequence.block_number(), Some(100)); + assert_eq!(sequence.payload_id(), Some(payload_id)); + } + + #[test] + fn test_insert_followup_same_block_and_payload() { + let mut sequence: FlashBlockPendingSequence = + FlashBlockPendingSequence::new(); + let factory = BerachainTestFlashBlockFactory::new(); + + let fb0 = factory.flashblock_at(0).build(); + sequence.insert(fb0.clone()); + + let fb1 = factory.flashblock_after(&fb0).build(); + sequence.insert(fb1.clone()); + + let fb2 = factory.flashblock_after(&fb1).build(); + sequence.insert(fb2); + + assert_eq!(sequence.count(), 3); + assert_eq!(sequence.index(), Some(2)); + } + + #[test] + fn test_insert_ignores_different_block_number() { + let mut sequence: FlashBlockPendingSequence = + FlashBlockPendingSequence::new(); + let factory = BerachainTestFlashBlockFactory::new(); + + let fb0 = factory.flashblock_at(0).build(); + sequence.insert(fb0.clone()); + + let fb1 = factory.flashblock_after(&fb0).block_number(101).build(); + sequence.insert(fb1); + + assert_eq!(sequence.count(), 1); + assert_eq!(sequence.block_number(), Some(100)); + } + + #[test] + fn test_insert_ignores_different_payload_id() { + let mut sequence: FlashBlockPendingSequence = + FlashBlockPendingSequence::new(); + let factory = BerachainTestFlashBlockFactory::new(); + + let fb0 = factory.flashblock_at(0).build(); + let payload_id1 = fb0.payload_id; + sequence.insert(fb0.clone()); + + let payload_id2 = PayloadId::new([2u8; 8]); + let fb1 = factory.flashblock_after(&fb0).payload_id(payload_id2).build(); + sequence.insert(fb1); + + assert_eq!(sequence.count(), 1); + assert_eq!(sequence.payload_id(), Some(payload_id1)); + } + + #[test] + fn test_finalize_empty_sequence_fails() { + let mut sequence: FlashBlockPendingSequence = + FlashBlockPendingSequence::new(); + let result = sequence.finalize(); + + assert!(result.is_err()); + } + + #[test] + fn test_finalize_clears_pending_state() { + let mut sequence: FlashBlockPendingSequence = + FlashBlockPendingSequence::new(); + let factory = BerachainTestFlashBlockFactory::new(); + + let fb0 = factory.flashblock_at(0).build(); + sequence.insert(fb0); + + assert_eq!(sequence.count(), 1); + + let _complete = sequence.finalize().unwrap(); + + assert_eq!(sequence.count(), 0); + assert_eq!(sequence.block_number(), None); + } + } + + mod complete_sequence_tests { + use super::*; + + #[test] + fn test_new_empty_sequence_fails() { + let result = + FlashBlockCompleteSequence::::new(vec![], None); + assert!(result.is_err()); + } + + #[test] + fn test_new_requires_base_at_index_zero() { + let factory = BerachainTestFlashBlockFactory::new(); + let mut fb0_no_base = factory.flashblock_at(1).build(); + fb0_no_base.index = 0; + fb0_no_base.base = None; + + let result = FlashBlockCompleteSequence::new(vec![fb0_no_base], None); + assert!(result.is_err()); + } + + #[test] + fn test_new_validates_successive_indices() { + let factory = BerachainTestFlashBlockFactory::new(); + + let fb0 = factory.flashblock_at(0).build(); + let fb2 = factory.flashblock_after(&fb0).index(2).build(); + + let result = FlashBlockCompleteSequence::new(vec![fb0, fb2], None); + assert!(result.is_err()); + } + + #[test] + fn test_new_valid_single_flashblock() { + let factory = BerachainTestFlashBlockFactory::new(); + let fb0 = factory.flashblock_at(0).build(); + + let result = FlashBlockCompleteSequence::new(vec![fb0], None); + assert!(result.is_ok()); + + let complete = result.unwrap(); + assert_eq!(complete.count(), 1); + assert_eq!(complete.block_number(), 100); + } + + #[test] + fn test_new_valid_multiple_flashblocks() { + let factory = BerachainTestFlashBlockFactory::new(); + + let fb0 = factory.flashblock_at(0).build(); + let fb1 = factory.flashblock_after(&fb0).build(); + let fb2 = factory.flashblock_after(&fb1).build(); + + let result = FlashBlockCompleteSequence::new(vec![fb0, fb1, fb2], None); + assert!(result.is_ok()); + + let complete = result.unwrap(); + assert_eq!(complete.count(), 3); + assert_eq!(complete.last().index(), 2); + } + + #[test] + fn test_all_transactions_aggregates_correctly() { + let factory = BerachainTestFlashBlockFactory::new(); + + let fb0 = factory + .flashblock_at(0) + .transactions(vec![Bytes::from_static(&[1, 2, 3]), Bytes::from_static(&[4, 5, 6])]) + .build(); + + let fb1 = factory + .flashblock_after(&fb0) + .transactions(vec![Bytes::from_static(&[7, 8, 9])]) + .build(); + + let complete = FlashBlockCompleteSequence::new(vec![fb0, fb1], None).unwrap(); + let all_txs = complete.all_transactions(); + + assert_eq!(all_txs.len(), 3); + assert_eq!(all_txs[0], Bytes::from_static(&[1, 2, 3])); + assert_eq!(all_txs[1], Bytes::from_static(&[4, 5, 6])); + assert_eq!(all_txs[2], Bytes::from_static(&[7, 8, 9])); + } + + #[test] + fn test_berachain_specific_payload_base_preserved() { + let factory = BerachainTestFlashBlockFactory::new(); + let pubkey = BlsPublicKey::random(); + + let fb0 = factory.flashblock_at(0).prev_proposer_pubkey(Some(pubkey)).build(); + + let complete = FlashBlockCompleteSequence::new(vec![fb0], None).unwrap(); + let base = complete.payload_base(); + + assert_eq!(base.prev_proposer_pubkey, Some(pubkey)); + } + } + + mod sequence_conversion_tests { + use super::*; + + #[test] + fn test_try_from_pending_to_complete_valid() { + let mut pending: FlashBlockPendingSequence = + FlashBlockPendingSequence::new(); + let factory = BerachainTestFlashBlockFactory::new(); + + let fb0 = factory.flashblock_at(0).build(); + pending.insert(fb0); + + let complete: Result, _> = + pending.try_into(); + assert!(complete.is_ok()); + assert_eq!(complete.unwrap().count(), 1); + } + + #[test] + fn test_try_from_pending_to_complete_empty_fails() { + let pending: FlashBlockPendingSequence = + FlashBlockPendingSequence::new(); + + let complete: Result, _> = + pending.try_into(); + assert!(complete.is_err()); + } + + #[test] + fn test_finalize_multiple_times_after_refill() { + let mut sequence: FlashBlockPendingSequence = + FlashBlockPendingSequence::new(); + let factory = BerachainTestFlashBlockFactory::new(); + + let fb0 = factory.flashblock_at(0).build(); + sequence.insert(fb0); + + let complete1 = sequence.finalize().unwrap(); + assert_eq!(complete1.count(), 1); + + let fb1 = factory.flashblock_for_next_block(&complete1.last().clone()).build(); + sequence.insert(fb1); + + let complete2 = sequence.finalize().unwrap(); + assert_eq!(complete2.count(), 1); + assert_eq!(complete2.block_number(), 101); + } + } +} diff --git a/src/flashblocks/test_utils.rs b/src/flashblocks/test_utils.rs new file mode 100644 index 00000000..2648c370 --- /dev/null +++ b/src/flashblocks/test_utils.rs @@ -0,0 +1,169 @@ +//! Test utilities for creating flashblock payloads. + +use crate::{ + flashblocks::{ + BerachainFlashblockPayload, BerachainFlashblockPayloadBase, BerachainFlashblockPayloadDiff, + BerachainFlashblockPayloadMetadata, + }, + primitives::header::BlsPublicKey, +}; +use alloy_primitives::{Address, B256, Bloom, Bytes, U256}; +use reth::rpc::types::engine::PayloadId; + +#[derive(Debug)] +pub struct BerachainTestFlashBlockFactory { + block_time: u64, + base_timestamp: u64, + current_block_number: u64, +} + +impl BerachainTestFlashBlockFactory { + pub fn new() -> Self { + Self { block_time: 2, base_timestamp: 1_000_000, current_block_number: 100 } + } + + pub fn with_block_number(mut self, block_number: u64) -> Self { + self.current_block_number = block_number; + self + } + + pub fn flashblock_at(&self, index: u64) -> BerachainTestFlashBlockBuilder { + self.builder().index(index).block_number(self.current_block_number) + } + + pub fn flashblock_after( + &self, + previous: &BerachainFlashblockPayload, + ) -> BerachainTestFlashBlockBuilder { + let parent_hash = + previous.base.as_ref().map(|b| b.parent_hash).unwrap_or(previous.diff.block_hash); + + self.builder() + .index(previous.index + 1) + .block_number(previous.metadata.block_number) + .payload_id(previous.payload_id) + .parent_hash(parent_hash) + .timestamp(previous.base.as_ref().map(|b| b.timestamp).unwrap_or(self.base_timestamp)) + } + + pub fn flashblock_for_next_block( + &self, + previous: &BerachainFlashblockPayload, + ) -> BerachainTestFlashBlockBuilder { + let prev_timestamp = + previous.base.as_ref().map(|b| b.timestamp).unwrap_or(self.base_timestamp); + let prev_block_number = previous.metadata.block_number; + + self.builder() + .index(0) + .block_number(prev_block_number + 1) + .payload_id(PayloadId::new(B256::random().0[0..8].try_into().unwrap())) + .parent_hash(previous.diff.block_hash) + .timestamp(prev_timestamp + self.block_time) + } + + fn builder(&self) -> BerachainTestFlashBlockBuilder { + BerachainTestFlashBlockBuilder { + index: 0, + block_number: self.current_block_number, + payload_id: PayloadId::new([1u8; 8]), + parent_hash: B256::random(), + timestamp: self.base_timestamp, + gas_limit: 30_000_000, + transactions: vec![], + prev_proposer_pubkey: Some(BlsPublicKey::random()), + } + } +} + +impl Default for BerachainTestFlashBlockFactory { + fn default() -> Self { + Self::new() + } +} + +#[derive(Debug)] +pub struct BerachainTestFlashBlockBuilder { + index: u64, + block_number: u64, + payload_id: PayloadId, + parent_hash: B256, + timestamp: u64, + gas_limit: u64, + transactions: Vec, + prev_proposer_pubkey: Option, +} + +impl BerachainTestFlashBlockBuilder { + pub fn index(mut self, index: u64) -> Self { + self.index = index; + self + } + + pub fn block_number(mut self, block_number: u64) -> Self { + self.block_number = block_number; + self + } + + pub fn payload_id(mut self, payload_id: PayloadId) -> Self { + self.payload_id = payload_id; + self + } + + pub fn parent_hash(mut self, parent_hash: B256) -> Self { + self.parent_hash = parent_hash; + self + } + + pub fn timestamp(mut self, timestamp: u64) -> Self { + self.timestamp = timestamp; + self + } + + pub fn transactions(mut self, transactions: Vec) -> Self { + self.transactions = transactions; + self + } + + pub fn prev_proposer_pubkey(mut self, pubkey: Option) -> Self { + self.prev_proposer_pubkey = pubkey; + self + } + + pub fn build(self) -> BerachainFlashblockPayload { + let base = if self.index == 0 { + Some(BerachainFlashblockPayloadBase { + parent_hash: self.parent_hash, + parent_beacon_block_root: B256::random(), + fee_recipient: Address::default(), + prev_randao: B256::random(), + block_number: self.block_number, + gas_limit: self.gas_limit, + timestamp: self.timestamp, + extra_data: Default::default(), + base_fee_per_gas: U256::from(1_000_000_000u64), + prev_proposer_pubkey: self.prev_proposer_pubkey, + }) + } else { + None + }; + + BerachainFlashblockPayload { + index: self.index, + payload_id: self.payload_id, + base, + diff: BerachainFlashblockPayloadDiff { + block_hash: B256::random(), + state_root: B256::random(), + receipts_root: B256::random(), + logs_bloom: Bloom::default(), + gas_used: 0, + transactions: self.transactions, + withdrawals: vec![], + withdrawals_root: B256::ZERO, + blob_gas_used: None, + }, + metadata: BerachainFlashblockPayloadMetadata { block_number: self.block_number }, + } + } +} diff --git a/src/lib.rs b/src/lib.rs index 30b4118d..59e85b89 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,7 @@ pub mod chainspec; pub mod consensus; pub mod engine; pub mod evm; +pub mod flashblocks; pub mod genesis; pub mod hardforks; pub mod node; diff --git a/src/node/evm/config.rs b/src/node/evm/config.rs index f611cffe..e8be66d3 100644 --- a/src/node/evm/config.rs +++ b/src/node/evm/config.rs @@ -2,6 +2,7 @@ use crate::{ chainspec::BerachainChainSpec, engine::BerachainExecutionData, evm::BerachainEvmFactory, + flashblocks::BerachainFlashblockPayloadBase, node::evm::{ assembler::BerachainBlockAssembler, block_context::BerachainBlockExecutionCtx, builder::BerachainBlockBuilder, receipt::BerachainReceiptBuilder, @@ -358,3 +359,18 @@ impl ConfigureEngineEvm for BerachainEvmConfig { })) } } + +impl From for BerachainNextBlockEnvAttributes { + fn from(value: BerachainFlashblockPayloadBase) -> Self { + Self { + timestamp: value.timestamp, + suggested_fee_recipient: value.fee_recipient, + prev_randao: value.prev_randao, + gas_limit: value.gas_limit, + parent_beacon_block_root: Some(value.parent_beacon_block_root), + withdrawals: None, /* TODO: Add to BerachainFlashblockPayloadBase. Removed as using + * OP fields for starting parity tests */ + prev_proposer_pubkey: value.prev_proposer_pubkey, + } + } +} diff --git a/src/rpc/api.rs b/src/rpc/api.rs index 842bd958..0793f2f2 100644 --- a/src/rpc/api.rs +++ b/src/rpc/api.rs @@ -1,9 +1,10 @@ use crate::{ + flashblocks::BerachainFlashblockPayload, primitives::BerachainHeader, rpc::receipt::BerachainReceiptEnvelope, transaction::{BerachainTxEnvelope, BerachainTxType, POL_TX_TYPE}, }; -use alloy_consensus::Transaction; +use alloy_consensus::{BlockHeader, Transaction}; use alloy_eips::eip2930::AccessList; use alloy_network::{ BuildResult, Network, NetworkWallet, TransactionBuilder, TransactionBuilderError, @@ -13,16 +14,17 @@ use alloy_rpc_types_eth::{Transaction as RpcTransaction, TransactionRequest}; use core::fmt; use derive_more::Deref; use reth::{ - providers::ProviderHeader, + providers::{BlockReaderIdExt, ProviderHeader}, rpc::compat::RpcConvert, tasks::{ TaskSpawner, pool::{BlockingTaskGuard, BlockingTaskPool}, }, }; +use reth_optimism_flashblocks::{FlashBlockBuildInfo, FlashblocksListeners, PendingFlashBlock}; use reth_primitives_traits::{Recovered, WithEncoded}; use reth_rpc_eth_api::{ - EthApiTypes, RpcNodeCore, RpcNodeCoreExt, + EthApiTypes, RpcNodeCore, RpcNodeCoreExt, RpcReceipt, helpers::{ Call, EthApiSpec, EthBlocks, EthCall, EthFees, EthState, EthTransactions, LoadBlock, LoadFee, LoadPendingBlock, LoadReceipt, LoadState, LoadTransaction, SpawnBlocking, Trace, @@ -34,6 +36,8 @@ use reth_rpc_eth_types::{ builder::config::PendingBlockKind, error::FromEvmError, }; use reth_transaction_pool::PoolPooledTx; +use std::{sync::Arc, time::Duration}; +use tokio::time; impl fmt::Display for BerachainTxType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -327,6 +331,75 @@ pub struct BerachainApi { /// All nested fields bundled together. #[deref] pub(super) inner: reth_rpc::EthApi, + + /// Flashblocks listeners. + /// + /// If set, provides receivers for pending blocks, flashblock sequences, and build status. + pub flashblocks: Option>>, +} + +/// Maximum duration to wait for a fresh flashblock when one is being built. +const MAX_FLASHBLOCK_WAIT_DURATION: Duration = Duration::from_millis(50); + +impl BerachainApi { + /// Returns information about the flashblock currently being built, if any. + fn flashblock_build_info(&self) -> Option { + self.flashblocks.as_ref().and_then(|f| *f.in_progress_rx.borrow()) + } + + /// Extracts pending block if it matches the expected parent hash. + fn extract_matching_block( + &self, + block: Option<&PendingFlashBlock>, + parent_hash: B256, + ) -> Option> { + block.filter(|b| b.block().parent_hash() == parent_hash).map(|b| b.pending.clone()) + } + + /// Returns a [`PendingBlock`] that is built out of flashblocks. + /// + /// If flashblocks receiver is not set, then it always returns `None`. + /// + /// It may wait up to 50ms for a fresh flashblock if one is currently being built. + pub async fn pending_flashblock(&self) -> eyre::Result>> + where + // OpEthApiError: FromEvmError, + Rpc: RpcConvert, + { + let Some(latest) = self.provider().latest_header()? else { + return Ok(None); + }; + + self.flashblock(latest.hash()).await + } + + /// Awaits a fresh flashblock if one is being built, otherwise returns current. + async fn flashblock( + &self, + parent_hash: B256, + ) -> eyre::Result>> { + let Some(rx) = self.flashblocks.as_ref().as_ref().map(|f| &f.pending_block_rx) else { + return Ok(None) + }; + + // Check if a flashblock is being built + if let Some(build_info) = self.flashblock_build_info() { + let current_index = rx.borrow().as_ref().map(|b| b.last_flashblock_index); + + // Check if this is the first flashblock or the next consecutive index + let is_next_index = current_index.is_none_or(|idx| build_info.index == idx + 1); + + // Wait only for relevant flashblocks: matching parent and next in sequence + if build_info.parent_hash == parent_hash && is_next_index { + let mut rx_clone = rx.clone(); + // Wait up to MAX_FLASHBLOCK_WAIT_DURATION for a new flashblock to arrive + let _ = time::timeout(MAX_FLASHBLOCK_WAIT_DURATION, rx_clone.changed()).await; + } + } + + // Fall back to current block + Ok(self.extract_matching_block(rx.borrow().as_ref(), parent_hash)) + } } impl Clone for BerachainApi @@ -335,7 +408,7 @@ where Rpc: RpcConvert, { fn clone(&self) -> Self { - Self { inner: self.inner.clone() } + Self { inner: self.inner.clone(), flashblocks: self.flashblocks.clone() } } } @@ -445,6 +518,34 @@ where ) -> Result { EthTransactions::send_transaction(&self.inner, tx).await } + + /// Returns the transaction receipt for the given hash. + /// + /// With flashblocks, we should also lookup the pending block for the transaction + /// because this is considered confirmed/mined. + fn transaction_receipt( + &self, + hash: B256, + ) -> impl Future>, Self::Error>> + Send + { + let this = self.clone(); + async move { + // first attempt to fetch the mined transaction receipt data + let tx_receipt = this.load_transaction_and_receipt(hash).await?; + + if tx_receipt.is_none() { + // if flashblocks are supported, attempt to find id from the pending block + if let Ok(Some(pending_block)) = this.pending_flashblock().await && + let Some(Ok(receipt)) = pending_block + .find_and_convert_transaction_receipt(hash, this.converter()) + { + return Ok(Some(receipt)); + } + } + let Some((tx, meta, receipt)) = tx_receipt else { return Ok(None) }; + self.build_transaction_receipt(tx, meta, receipt).await.map(Some) + } + } } impl LoadTransaction for BerachainApi diff --git a/src/rpc/mod.rs b/src/rpc/mod.rs index f9b582ab..682a1eec 100644 --- a/src/rpc/mod.rs +++ b/src/rpc/mod.rs @@ -1,4 +1,6 @@ +use jsonrpsee::client_transport::ws::Url; use reth_rpc_eth_api::helpers::config::EthConfigApiServer; +use std::sync::Arc; pub mod api; pub mod config; pub mod receipt; @@ -9,6 +11,7 @@ use crate::{ BerachainExecutionData, rpc::BerachainEngineApiBuilder, validator::BerachainEngineValidatorBuilder, }, + flashblocks::{BerachainFlashblockPayload, BerachainFlashblockPayloadBase}, node::evm::config::{BerachainEvmConfig, BerachainNextBlockEnvAttributes}, primitives::BerachainPrimitives, rpc::{ @@ -35,12 +38,52 @@ use reth_node_builder::rpc::{ EthApiBuilder, EthApiCtx, PayloadValidatorBuilder, RethRpcAddOns, RethRpcMiddleware, RpcAddOns, RpcHandle, }; +use reth_optimism_flashblocks::{FlashBlockService, FlashblocksListeners, WsFlashBlockStream}; +use reth_optimism_rpc::OpRpcTypes; use reth_rpc_convert::{RpcConvert, RpcConverter}; use reth_rpc_eth_api::helpers::pending_block::BuildPendingEnv; +use tokio::sync::watch; +use tracing::info; /// Builds `BerachainEthApi` for Berachain. -#[derive(Debug, Default)] -pub struct BerachainEthApiBuilder; +#[derive(Clone, Default)] +pub struct BerachainEthApiBuilder { + /// A URL pointing to a secure websocket connection (wss) that streams out flashblocks. + flashblocks_url: Option, + /// Pre-built flashblocks listeners (for testing/dependency injection). + /// Wrapped in Arc for clonability. + flashblocks_listeners: + Option>>, +} + +impl std::fmt::Debug for BerachainEthApiBuilder { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("BerachainEthApiBuilder") + .field("flashblocks_url", &self.flashblocks_url) + .field("has_flashblocks_listeners", &self.flashblocks_listeners.is_some()) + .finish() + } +} + +impl BerachainEthApiBuilder { + /// Configure flashblocks with a WebSocket URL. + pub fn with_flashblocks_url(mut self, url: Option) -> Self { + self.flashblocks_url = url; + self + } + + /// Configure flashblocks with pre-built listeners. + /// + /// This is primarily useful for testing, where you can build `FlashblocksListeners` + /// from a custom stream source instead of connecting to a real WebSocket server. + pub fn with_flashblocks_listeners( + mut self, + listeners: FlashblocksListeners, + ) -> Self { + self.flashblocks_listeners = Some(Arc::new(listeners)); + self + } +} pub type BerachainEthRpcConverterFor = RpcConverter< BerachainNetwork, @@ -48,6 +91,10 @@ pub type BerachainEthRpcConverterFor = RpcConverter< BerachainEthReceiptConverter<<::Provider as ChainSpecProvider>::ChainSpec>, >; +impl OpRpcTypes for BerachainNetwork { + type Flashblock = BerachainFlashblockPayload; +} + impl EthApiBuilder for BerachainEthApiBuilder where N: FullNodeComponents< @@ -55,7 +102,11 @@ where ChainSpec: EthereumHardforks + Hardforks, Primitives = BerachainPrimitives, >, - Evm: ConfigureEvm>>, + Evm: ConfigureEvm< + NextBlockEnvCtx: BuildPendingEnv> + + From + + Unpin, + >, >, BerachainEthRpcConverterFor: RpcConvert< Primitives = PrimitivesTy, @@ -68,13 +119,52 @@ where type EthApi = BerachainApi>; async fn build_eth_api(self, ctx: EthApiCtx<'_, N>) -> eyre::Result { + if self.flashblocks_listeners.is_some() && self.flashblocks_url.is_some() { + return Err(eyre::eyre!( + "Cannot configure both flashblocks_listeners and flashblocks_url. \ + Use flashblocks_listeners for testing or flashblocks_url for production." + )); + } + let tx_resp_builder = BerachainEthRpcConverterFor::::new( BerachainEthReceiptConverter::new(ctx.components.provider().clone().chain_spec()), ); + let flashblocks = if let Some(listeners) = self.flashblocks_listeners { + info!(target: "bera-reth:rpc", "Using pre-built flashblocks listeners"); + Some(listeners) + } else if let Some(ws_url) = self.flashblocks_url { + info!(target: "bera-reth:rpc", %ws_url, "Launching flashblocks service"); + + let (tx, pending_rx) = watch::channel(None); + let stream: WsFlashBlockStream<_, _, _, BerachainFlashblockPayload> = + WsFlashBlockStream::new(ws_url); + let service = FlashBlockService::new( + stream, + ctx.components.evm_config().clone(), + ctx.components.provider().clone(), + ctx.components.task_executor().clone(), + false, + ); + + let flashblocks_sequence = service.block_sequence_broadcaster().clone(); + let received_flashblocks = service.flashblocks_broadcaster().clone(); + let in_progress_rx = service.subscribe_in_progress(); + ctx.components.task_executor().spawn(Box::pin(service.run(tx))); + + Some(Arc::new(FlashblocksListeners::new( + pending_rx, + flashblocks_sequence, + in_progress_rx, + received_flashblocks, + ))) + } else { + None + }; + let inner = ctx.eth_api_builder().with_rpc_converter(tx_resp_builder.clone()).build(); - Ok(BerachainApi { inner }) + Ok(BerachainApi { inner, flashblocks }) } } @@ -97,9 +187,27 @@ where BerachainEthApiBuilder: EthApiBuilder, { fn default() -> Self { + Self::new(BerachainEthApiBuilder::default()) + } +} + +impl BerachainAddOns +where + N: FullNodeComponents, + BerachainEthApiBuilder: EthApiBuilder, +{ + /// Creates new Berachain add-ons with a custom EthApiBuilder. + /// + /// This is useful for testing, where you can inject pre-built flashblocks listeners: + /// ```ignore + /// let eth_api_builder = BerachainEthApiBuilder::default() + /// .with_flashblocks_listeners(listeners); + /// let add_ons = BerachainAddOns::new(eth_api_builder); + /// ``` + pub fn new(eth_api_builder: BerachainEthApiBuilder) -> Self { Self { inner: RpcAddOns::new( - BerachainEthApiBuilder, + eth_api_builder, BerachainEngineValidatorBuilder::default(), BerachainEngineApiBuilder::::default(), BasicEngineValidatorBuilder::new(BerachainEngineValidatorBuilder::default()), diff --git a/tests/e2e/flashblocks.rs b/tests/e2e/flashblocks.rs new file mode 100644 index 00000000..6b442d40 --- /dev/null +++ b/tests/e2e/flashblocks.rs @@ -0,0 +1,285 @@ +//! E2E tests for flashblock integration. +//! +//! These tests verify the complete flow: flashblock stream → FlashBlockService → +//! pending block construction → RPC receipt availability. + +use crate::e2e::{setup_test_boilerplate, test_signer}; +use alloy_consensus::BlockHeader; +use alloy_eips::eip2718::Encodable2718; +use alloy_primitives::{Address, B256, Bloom, Bytes, U256}; +use alloy_provider::Provider; +use bera_reth::{ + engine::validator::BerachainEngineValidatorBuilder, + flashblocks::{ + BerachainFlashblockPayload, BerachainFlashblockPayloadBase, BerachainFlashblockPayloadDiff, + BerachainFlashblockPayloadMetadata, + }, + node::BerachainNode, + primitives::{BerachainPrimitives, header::BlsPublicKey}, + rpc::{BerachainAddOns, BerachainEthApiBuilder}, +}; +use reth::{providers::BlockReaderIdExt, rpc::types::engine::PayloadId}; +use reth_chainspec::EthChainSpec; +use reth_e2e_test_utils::transaction::TransactionTestContext; +use reth_node_builder::{Node, NodeBuilder, NodeHandle}; +use reth_node_core::{args::RpcServerArgs, node_config::NodeConfig}; +use reth_optimism_flashblocks::{ + FlashBlockCompleteSequence, FlashBlockService, FlashblocksListeners, +}; +use std::{pin::Pin, sync::Arc, task::Poll, time::Duration}; +use tokio::sync::{broadcast, watch}; + +fn create_test_flashblock( + index: u64, + block_number: u64, + payload_id: PayloadId, + parent_hash: B256, + timestamp: u64, +) -> BerachainFlashblockPayload { + let base = if index == 0 { + Some(BerachainFlashblockPayloadBase { + parent_beacon_block_root: B256::random(), + parent_hash, + fee_recipient: Address::random(), + prev_randao: B256::random(), + block_number, + gas_limit: 30_000_000, + timestamp, + extra_data: Bytes::default(), + base_fee_per_gas: U256::from(1_000_000_000u64), + prev_proposer_pubkey: Some(BlsPublicKey::random()), + }) + } else { + None + }; + + BerachainFlashblockPayload { + payload_id, + index, + base, + diff: BerachainFlashblockPayloadDiff { + state_root: B256::random(), + receipts_root: B256::random(), + logs_bloom: Bloom::default(), + gas_used: 21000, + block_hash: B256::random(), + transactions: vec![], + withdrawals: vec![], + withdrawals_root: B256::ZERO, + blob_gas_used: None, + }, + metadata: BerachainFlashblockPayloadMetadata { block_number }, + } +} + +struct MockFlashblockStream { + rx: tokio::sync::mpsc::Receiver, +} + +impl futures_util::Stream for MockFlashblockStream { + type Item = eyre::Result; + + fn poll_next( + mut self: Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> Poll> { + match Pin::new(&mut self.rx).poll_recv(cx) { + Poll::Ready(Some(fb)) => Poll::Ready(Some(Ok(fb))), + Poll::Ready(None) => Poll::Ready(None), + Poll::Pending => Poll::Pending, + } + } +} + +/// Tests the complete flashblock → pending block → RPC receipt flow. +/// +/// # Data Flow +/// +/// This test wires together two separate systems that need to communicate: +/// +/// ```text +/// TEST HARNESS NODE (RPC) +/// ──────────── ────────── +/// +/// fb_tx ──────► MockFlashblockStream +/// │ +/// ▼ +/// FlashBlockService +/// │ │ +/// │ ▼ +/// │ service.subscribe_in_progress() +/// │ │ +/// ▼ │ (test manually bridges) +/// pending_tx ─────────┼──────────────────► pending_rx ──► RPC EthApi +/// │ (reads pending block) +/// ▼ +/// in_progress_tx ─────────► in_progress_rx ──► RPC EthApi +/// (knows build is active) +/// ``` +/// +/// The key insight is that `FlashblocksListeners` holds the rx ends of channels, which are +/// passed into the node at build time. The test harness holds the tx ends and must: +/// 1. Pass `pending_tx` to `service.run()` so the service can publish pending blocks +/// 2. Manually forward `in_progress` state from service → node (the service has its own internal +/// channel, so we subscribe and forward to the node's channel) +/// +/// When an RPC call like `eth_getTransactionReceipt` comes in, the EthApi checks +/// `pending_rx` for a flashblock-derived pending block containing that transaction. +#[tokio::test] +async fn test_rpc_returns_flashblock_pending_receipt() -> eyre::Result<()> { + let (tasks, chain_spec) = setup_test_boilerplate().await?; + let executor = tasks.executor(); + + // Channels that connect FlashBlockService (producer) to RPC EthApi (consumer). + // The service writes to pending_tx, the RPC reads from pending_rx. + let (pending_tx, pending_rx) = watch::channel(None); + + // in_progress channel tells RPC layer that a flashblock build is active. + // We manually bridge from service's internal channel to this one (see below). + let (in_progress_tx, in_progress_rx) = watch::channel(None); + + // These broadcast channels are for external listeners (e.g., websocket subscribers). + // Not used in this test but required by FlashblocksListeners constructor. + let (unused_sequence_tx, _) = + broadcast::channel::>(1); + let (unused_received_tx, _) = broadcast::channel::>(1); + + // FlashblocksListeners bundles the rx ends for the node's RPC layer. + let listeners: FlashblocksListeners = + FlashblocksListeners::new( + pending_rx, + unused_sequence_tx, + in_progress_rx, + unused_received_tx, + ); + + let eth_api_builder = BerachainEthApiBuilder::default().with_flashblocks_listeners(listeners); + let add_ons = BerachainAddOns::<_, _, BerachainEngineValidatorBuilder>::new(eth_api_builder); + + let node_config = NodeConfig::new(chain_spec.clone()) + .with_unused_ports() + .with_rpc(RpcServerArgs::default().with_unused_ports().with_http()); + + let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(node_config) + .testing_node(executor.clone()) + .with_types::() + .with_components(BerachainNode::default().components_builder()) + .with_add_ons(add_ons) + .launch() + .await?; + + // Create the flashblock input channel. Test sends flashblocks via fb_tx. + let (fb_tx, fb_rx) = tokio::sync::mpsc::channel::(128); + let stream = MockFlashblockStream { rx: fb_rx }; + + let service = FlashBlockService::new( + stream, + node.evm_config.clone(), + node.provider().clone(), + executor.clone(), + false, + ); + + // Subscribe to service's internal in_progress channel so we can forward to node's channel. + let mut service_in_progress_rx = service.subscribe_in_progress(); + + // Start the service, passing pending_tx so it can publish pending blocks to the RPC layer. + executor.spawn_critical( + "flashblock-service", + Box::pin(async move { + service.run(pending_tx).await; + }), + ); + + let latest = node.provider().latest_header()?.expect("should have genesis"); + let latest_hash = latest.hash(); + let next_block = latest.number() + 1; + let next_timestamp = latest.timestamp() + 2; + + let signer = test_signer()?; + let chain_id = chain_spec.chain_id(); + let tx = TransactionTestContext::transfer_tx(chain_id, signer).await; + let tx_bytes = Bytes::from(tx.encoded_2718()); + let tx_hash = *tx.tx_hash(); + + let payload_id = PayloadId::new([1u8; 8]); + let mut fb0 = create_test_flashblock(0, next_block, payload_id, latest_hash, next_timestamp); + fb0.diff.transactions = vec![tx_bytes]; + fb0.diff.gas_used = 21000; + + // Inject the flashblock into the service via our mock stream. + fb_tx.send(fb0).await?; + + // Wait for service to signal it's building, then forward that state to the node's channel. + tokio::time::timeout(Duration::from_millis(500), service_in_progress_rx.changed()).await??; + in_progress_tx.send(*service_in_progress_rx.borrow())?; + + // Give the service time to build and publish the pending block. + tokio::time::sleep(Duration::from_millis(100)).await; + + // Query the RPC - should find the transaction in the flashblock-derived pending block. + let rpc_url = + format!("http://127.0.0.1:{}", node.rpc_server_handle().http_local_addr().unwrap().port()); + let rpc_client = alloy_provider::ProviderBuilder::new().connect(&rpc_url).await?; + + let receipt = rpc_client.get_transaction_receipt(tx_hash).await?; + + assert!( + receipt.is_some(), + "Transaction receipt should be available from flashblock pending state" + ); + assert_eq!(receipt.unwrap().transaction_hash, tx_hash); + + Ok(()) +} + +/// Tests that flashblocks with invalid parent hashes are rejected. +#[tokio::test] +async fn test_flashblock_rejects_invalid_parent_hash() -> eyre::Result<()> { + let (tasks, chain_spec) = setup_test_boilerplate().await?; + let executor = tasks.executor(); + + let node_config = NodeConfig::new(chain_spec.clone()) + .with_unused_ports() + .with_rpc(RpcServerArgs::default().with_unused_ports().with_http()); + + let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(node_config) + .testing_node(executor.clone()) + .node(BerachainNode::default()) + .launch() + .await?; + + let (fb_tx, fb_rx) = tokio::sync::mpsc::channel::(128); + let stream = MockFlashblockStream { rx: fb_rx }; + + let service = FlashBlockService::new( + stream, + node.evm_config.clone(), + node.provider().clone(), + executor.clone(), + false, + ); + + let (pending_tx, mut pending_rx) = watch::channel(None); + executor.spawn_critical( + "flashblock-service", + Box::pin(async move { + service.run(pending_tx).await; + }), + ); + + let latest = node.provider().latest_header()?.expect("should have genesis"); + let next_block = latest.number() + 1; + let next_timestamp = latest.timestamp() + 2; + + let wrong_parent_hash = B256::random(); + let payload_id = PayloadId::new([1u8; 8]); + let fb = create_test_flashblock(0, next_block, payload_id, wrong_parent_hash, next_timestamp); + + fb_tx.send(fb).await?; + + let result = tokio::time::timeout(Duration::from_millis(200), pending_rx.changed()).await; + assert!(result.is_err(), "Should not build pending block with wrong parent hash"); + + Ok(()) +} diff --git a/tests/e2e/mod.rs b/tests/e2e/mod.rs index 503dd071..31348eb1 100644 --- a/tests/e2e/mod.rs +++ b/tests/e2e/mod.rs @@ -18,6 +18,7 @@ use reth_payload_primitives::PayloadBuilderAttributes; use std::{str::FromStr, sync::Arc}; pub mod coinbase_system_state_change_test; +pub mod flashblocks; pub mod gas_limit_regression_test; pub mod pol_revert_test; pub mod transaction_tests;