diff --git a/Cargo.lock b/Cargo.lock index cdc8f9b..93f01bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,26 +95,6 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[package]] -name = "alloy" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8367891bf380210abb0d6aa30c5f85a9080cb4a066c4d5c5acadad630823751b" -dependencies = [ - "alloy-consensus", - "alloy-contract", - "alloy-core", - "alloy-eips", - "alloy-genesis", - "alloy-network", - "alloy-provider", - "alloy-rpc-client", - "alloy-serde", - "alloy-signer", - "alloy-transport", - "alloy-transport-http", -] - [[package]] name = "alloy-chains" version = "0.1.32" @@ -144,38 +124,6 @@ dependencies = [ "serde", ] -[[package]] -name = "alloy-contract" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eefe64fd344cffa9cf9e3435ec4e93e6e9c3481bc37269af988bf497faf4a6a" -dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-network", - "alloy-network-primitives", - "alloy-primitives", - "alloy-provider", - "alloy-rpc-types-eth", - "alloy-sol-types", - "alloy-transport", - "futures", - "futures-util", - "thiserror", -] - -[[package]] -name = "alloy-core" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b095eb0533144b4497e84a9cc3e44a5c2e3754a3983c0376a55a2f9183a53e" -dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-types", -] - [[package]] name = "alloy-dyn-abi" version = "0.8.3" @@ -639,7 +587,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bc65475025fc1e84bf86fc840f04f63fcccdcf3cf12053c99918e4054dfbc69" dependencies = [ - "alloy-json-abi", "alloy-sol-macro-input", "const-hex", "heck", @@ -658,13 +605,11 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ed10f0715a0b69fde3236ff3b9ae5f6f7c97db5a387747100070d3016b9266b" dependencies = [ - "alloy-json-abi", "const-hex", "dunce", "heck", "proc-macro2", "quote", - "serde_json", "syn 2.0.77", "syn-solidity", ] @@ -812,18 +757,15 @@ dependencies = [ name = "alphanet-testing" version = "0.0.0" dependencies = [ - "alloy", - "alloy-network", - "alloy-signer-local", "alphanet-node", - "once_cell", - "reth", - "reth-node-builder", + "eyre", + "reth-e2e-test-utils", "reth-node-core", + "reth-node-optimism", + "reth-payload-builder", "reth-primitives", "reth-tracing", "tokio", - "url", ] [[package]] @@ -2454,21 +2396,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -2954,22 +2881,6 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.8" @@ -3935,23 +3846,6 @@ dependencies = [ "unsigned-varint", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nibble_vec" version = "0.1.0" @@ -4258,50 +4152,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -5016,13 +4872,11 @@ dependencies = [ "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -5036,7 +4890,6 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 1.0.1", "tokio", - "tokio-native-tls", "tokio-rustls", "tower-service", "url", @@ -5682,6 +5535,43 @@ dependencies = [ "tracing", ] +[[package]] +name = "reth-e2e-test-utils" +version = "1.0.7" +source = "git+https://github.com/paradigmxyz/reth.git?rev=v1.0.7#75b7172cf77eb4fd65fe1a6924f75066fb09fcd1" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives", + "alloy-rpc-types", + "alloy-signer", + "alloy-signer-local", + "eyre", + "futures-util", + "jsonrpsee", + "jsonrpsee-types", + "reth", + "reth-chainspec", + "reth-db", + "reth-network-peers", + "reth-node-builder", + "reth-node-ethereum", + "reth-payload-builder", + "reth-primitives", + "reth-provider", + "reth-rpc", + "reth-rpc-layer", + "reth-rpc-types", + "reth-rpc-types-compat", + "reth-stages-types", + "reth-tokio-util", + "reth-tracing", + "serde_json", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "reth-ecies" version = "1.0.7" @@ -6752,6 +6642,7 @@ dependencies = [ "futures-util", "metrics", "pin-project", + "reth-chain-state", "reth-errors", "reth-ethereum-engine-primitives", "reth-metrics", @@ -8724,16 +8615,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -9241,12 +9122,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "vergen" version = "8.3.2" diff --git a/Cargo.toml b/Cargo.toml index 2e3ab02..169267f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,25 +57,16 @@ strip = false alphanet-node = { path = "crates/node" } alphanet-precompile = { path = "crates/precompile" } -alloy = { version = "0.3", features = [ - "contract", - "providers", - "provider-http", - "signers", -] } -alloy-network = { version = "0.3" } -alloy-signer-local = { version = "0.3", features = ["mnemonic"] } - # tokio tokio = { version = "1.21", default-features = false } # reth -reth = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.7" } reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.7", features = [ "optimism", ] } reth-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.7" } reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.7" } +reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.7" } reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.7" } reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.7" } reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.7", features = [ diff --git a/crates/testing/Cargo.toml b/crates/testing/Cargo.toml index e524899..2132dec 100644 --- a/crates/testing/Cargo.toml +++ b/crates/testing/Cargo.toml @@ -12,19 +12,15 @@ categories.workspace = true [dev-dependencies] alphanet-node.workspace = true -alloy.workspace = true -alloy-network.workspace = true -alloy-signer-local = { workspace = true, features = ["mnemonic"] } - -reth = { workspace = true } -reth-node-core = { workspace = true } -reth-node-builder = { workspace = true, features = ["test-utils"] } +reth-e2e-test-utils.workspace = true +reth-node-core.workspace = true +reth-node-optimism.workspace = true +reth-payload-builder.workspace = true reth-primitives.workspace = true reth-tracing.workspace = true -once_cell = "1.19.0" +eyre.workspace = true tokio.workspace = true -url = "2.5.0" [lints] workspace = true diff --git a/crates/testing/src/lib.rs b/crates/testing/src/lib.rs index 59f922f..2973f7b 100644 --- a/crates/testing/src/lib.rs +++ b/crates/testing/src/lib.rs @@ -1,13 +1,5 @@ //! Alphanet-testing module +#![warn(unused_crate_dependencies)] -// todo(onbjerg): uncomment this when adding a test, -// it was commented out due to removing our bls tests since they are now -// in revm -// #![warn(unused_crate_dependencies)] - -#[cfg(test)] -mod test_suite; #[cfg(test)] mod tests; -#[cfg(test)] -mod wallet; diff --git a/crates/testing/src/tests.rs b/crates/testing/src/tests.rs index 0db677e..cd8f7fd 100644 --- a/crates/testing/src/tests.rs +++ b/crates/testing/src/tests.rs @@ -1,4 +1,51 @@ -#[test] -fn dummy() { - // kept here to prevent the ci from failing on no tests +use alphanet_node::{chainspec::ALPHANET_MAINNET, node::AlphaNetNode}; +use reth_e2e_test_utils::{setup, transaction::TransactionTestContext}; +use reth_node_core::rpc::types::engine::PayloadAttributes; +use reth_node_optimism::OptimismPayloadBuilderAttributes; +use reth_payload_builder::EthPayloadBuilderAttributes; +use reth_primitives::{Address, B256}; + +#[tokio::test] +async fn can_progress_7702() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + + // todo: use devnet and fund accounts + let (mut nodes, _tasks, wallet) = + setup::(1, ALPHANET_MAINNET.clone(), false).await?; + + let mut node = nodes.pop().unwrap(); + // todo: swap with 7702 tx + let raw_tx = TransactionTestContext::transfer_tx_bytes(41144114, wallet.inner).await; + + // make the node advance + let tx_hash = node.rpc.inject_tx(raw_tx).await?; + + // make the node advance + let (payload, _) = node.advance_block(vec![], optimism_payload_attributes).await?; + + let block_hash = payload.block().hash(); + let block_number = payload.block().number; + + // assert the block has been committed to the blockchain + node.assert_new_block(tx_hash, block_hash, block_number).await?; + + Ok(()) +} + +/// Helper function to create a new eth payload attributes +pub(crate) fn optimism_payload_attributes(timestamp: u64) -> OptimismPayloadBuilderAttributes { + let attributes = PayloadAttributes { + timestamp, + prev_randao: B256::ZERO, + suggested_fee_recipient: Address::ZERO, + withdrawals: Some(vec![]), + parent_beacon_block_root: Some(B256::ZERO), + }; + + OptimismPayloadBuilderAttributes { + payload_attributes: EthPayloadBuilderAttributes::new(B256::ZERO, attributes), + transactions: vec![], + no_tx_pool: false, + gas_limit: Some(30_000_000), + } }