Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: port taiko-geth #5

Open
wants to merge 51 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8ee7b80
init commit
johntaiko Mar 12, 2024
2209fb4
Update t8n command arguments and parsers
johntaiko Mar 13, 2024
2195995
Refactor t8n command arguments and execution
johntaiko Mar 13, 2024
d139b4d
Refactor t8n command and provider module
johntaiko Mar 13, 2024
7ec3960
Refactor t8n command and update visibility of utility functions
johntaiko Mar 13, 2024
f9c6c8c
feat: Add is_anchor field and functions
petarvujovic98 Mar 13, 2024
04f026d
feat: Add taiko block attributes builder
petarvujovic98 Mar 13, 2024
9009c5a
[WIP]: Start work on Taiko block builder
petarvujovic98 Mar 13, 2024
8fe5634
Add thiserror crate to dependencies
johntaiko Mar 14, 2024
b5624c2
Add rlp crate and implement StateAccount struct
johntaiko Mar 14, 2024
0062b0d
Merge branch 'feat/support_t8n_and_taikop' of gh_work:taikoxyz/reth i…
johntaiko Mar 14, 2024
138e603
Remove unused dependencies and dead code
johntaiko Mar 14, 2024
ab178d6
[WIP]: Make progress on block building
petarvujovic98 Mar 14, 2024
d3da37b
Fix serialization issue and update dependencies
johntaiko Mar 14, 2024
955f5e9
Merge branch 'feat/support_t8n_and_taikop' of gh_work:taikoxyz/reth i…
johntaiko Mar 14, 2024
dd15fd2
[WIP]: Configure payload builder for Taiko node
petarvujovic98 Mar 14, 2024
72c2e52
feat: Add TaikoExecutionPayload export
petarvujovic98 Mar 15, 2024
f78b1e5
feat: Add anchor validation after block building
petarvujovic98 Mar 15, 2024
c57446a
feat: Add TaikoExecutionPayload as payload for on_new_payload handler
petarvujovic98 Mar 15, 2024
dbcfc28
feat: Allow same timestamp as parent
petarvujovic98 Mar 15, 2024
c925049
fix: Fix compiler errors
petarvujovic98 Mar 19, 2024
54a9783
chore: Rename node
petarvujovic98 Mar 20, 2024
4b6a2bc
refactor: Move block metadata and l1 origin structs into primitives
petarvujovic98 Mar 20, 2024
fc73efa
feat: Add stub implementations for taiko extended API
petarvujovic98 Mar 20, 2024
3a67414
fix: Enhance the EthApi trait with Taiko APIs
petarvujovic98 Mar 20, 2024
8cd32bc
feat: Add TxPoolContent API handler
petarvujovic98 Mar 20, 2024
382010d
feat: Add Taiko genesis and chain spec
petarvujovic98 Mar 20, 2024
3564fd1
fix: Put taiko features behind compilation flags
petarvujovic98 Mar 20, 2024
8197581
chore: Rename structs and update export from payload builder
petarvujovic98 Mar 21, 2024
a9ca112
feat: Add consts to finalize anchor validation
petarvujovic98 Mar 22, 2024
a5692d1
refactor: Update transaction iteration
petarvujovic98 Mar 22, 2024
6e0abb2
fix: Fix compile errors
petarvujovic98 Mar 22, 2024
b5928a9
feat: Update attributes definition
petarvujovic98 Mar 27, 2024
02c6277
feat: Add taiko related tables to database
petarvujovic98 Mar 27, 2024
1cbc438
feat: Add L1 Origin writing and reading
petarvujovic98 Mar 27, 2024
cf82cce
feat: Implement L1 origin related API handlers
petarvujovic98 Mar 27, 2024
060538d
feat: Handle L1 origin tables
petarvujovic98 Mar 28, 2024
b352771
chore: Remove unused imports
petarvujovic98 Mar 28, 2024
847e1eb
feat: Use bytes to store L1 origin
petarvujovic98 Mar 28, 2024
b6a8954
feat: Implement L1 origin traits for tests
petarvujovic98 Mar 28, 2024
b449c18
fix: Map errors to correct type
petarvujovic98 Mar 28, 2024
153a80f
chore: Remove contractName field from json
petarvujovic98 Mar 29, 2024
d100cfd
feat: Expose chain specs
petarvujovic98 Mar 29, 2024
a6eef4c
feat: Add taiko payload and taiko-reth binary
petarvujovic98 Mar 29, 2024
60073ef
chore: Remove tx_pool_content function until clear
petarvujovic98 Apr 2, 2024
9037ef4
refactor: Add get_txs closure
petarvujovic98 Apr 2, 2024
c4517c0
Merge branch 'taiko' into feat/support_t8n_and_taikop
petarvujovic98 Jun 11, 2024
b485e2e
chore: Update code based on upstream changes
petarvujovic98 Jun 12, 2024
04096c8
Merge branch 'taiko' into feat/support_t8n_and_taikop
petarvujovic98 Jun 12, 2024
41823f0
feat: Move taiko features to separate rpc module
petarvujovic98 Jun 12, 2024
04b81f4
Merge remote-tracking branch 'upstream/main' into feat/support_t8n_an…
petarvujovic98 Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,18 @@ members = [
"crates/node/api/",
"crates/node/builder/",
"crates/node/events/",
"crates/node-taiko/",
"crates/optimism/consensus",
"crates/optimism/evm/",
"crates/optimism/node/",
"crates/optimism/payload/",
"crates/optimism/primitives/",
"crates/payload/basic/",
"crates/payload/builder/",
"crates/payload/primitives/",
"crates/payload/primitives",
"crates/ethereum/payload",
"crates/optimism/payload",
"crates/payload/taiko/",
"crates/payload/validator/",
"crates/primitives/",
"crates/primitives-traits/",
Expand Down Expand Up @@ -300,6 +304,7 @@ reth-node-core = { path = "crates/node-core" }
reth-node-ethereum = { path = "crates/ethereum/node" }
reth-node-events = { path = "crates/node/events" }
reth-node-optimism = { path = "crates/optimism/node" }
reth-node-taiko = { path = "crates/node-taiko" }
reth-optimism-consensus = { path = "crates/optimism/consensus" }
reth-optimism-payload-builder = { path = "crates/optimism/payload" }
reth-optimism-primitives = { path = "crates/optimism/primitives" }
Expand Down Expand Up @@ -328,6 +333,7 @@ reth-static-file = { path = "crates/static-file/static-file" }
reth-static-file-types = { path = "crates/static-file/types" }
reth-storage-api = { path = "crates/storage/storage-api" }
reth-storage-errors = { path = "crates/storage/errors" }
reth-taiko-payload-builder = { path = "crates/payload/taiko" }
reth-tasks = { path = "crates/tasks" }
reth-testing-utils = { path = "testing/testing-utils" }
reth-tokio-util = { path = "crates/tokio-util" }
Expand Down
20 changes: 20 additions & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ reth-downloaders.workspace = true
reth-tracing.workspace = true
reth-tasks.workspace = true
reth-ethereum-payload-builder.workspace = true
reth-taiko-payload-builder = { workspace = true, optional = true }
reth-payload-builder.workspace = true
reth-payload-primitives.workspace = true
reth-payload-validator.workspace = true
Expand All @@ -59,6 +60,7 @@ reth-node-ethereum.workspace = true
reth-node-optimism = { workspace = true, optional = true, features = [
"optimism",
] }
reth-node-taiko = { workspace = true, optional = true }
reth-node-core.workspace = true
reth-db-common.workspace = true
reth-node-builder.workspace = true
Expand All @@ -69,6 +71,9 @@ reth-prune-types.workspace = true

# crypto
alloy-rlp.workspace = true
rlp = "0.5"
alloy-chains.workspace = true
secp256k1.workspace = true

# tracing
tracing.workspace = true
Expand Down Expand Up @@ -110,6 +115,7 @@ eyre.workspace = true
clap = { workspace = true, features = ["derive", "env"] }
tempfile.workspace = true
backon.workspace = true
thiserror.workspace = true
similar-asserts.workspace = true
itertools.workspace = true
rayon.workspace = true
Expand Down Expand Up @@ -151,6 +157,15 @@ optimism = [
"reth-node-core/optimism",
]

taiko = [
"reth-primitives/taiko",
"reth-beacon-consensus/taiko",
"reth-payload-builder/taiko",
"reth-node-core/taiko",
"dep:reth-taiko-payload-builder",
"dep:reth-node-taiko",
]

# no-op feature flag for switching between the `optimism` and default functionality in CI matrices
ethereum = []

Expand All @@ -162,3 +177,8 @@ path = "src/main.rs"
name = "op-reth"
path = "src/optimism.rs"
required-features = ["optimism"]

[[bin]]
name = "taiko-reth"
path = "src/taiko.rs"
required-features = ["taiko"]
9 changes: 8 additions & 1 deletion bin/reth/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
commands::{
config_cmd, db, debug_cmd, dump_genesis, import, init_cmd, init_state,
node::{self, NoArgs},
p2p, recover, stage, test_vectors,
p2p, recover, stage, t8n, test_vectors,
},
version::{LONG_VERSION, SHORT_VERSION},
};
Expand Down Expand Up @@ -160,6 +160,7 @@ impl<Ext: clap::Args + fmt::Debug> Cli<Ext> {
Commands::Db(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::Stage(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
Commands::P2P(command) => runner.run_until_ctrl_c(command.execute()),
Commands::T8n(command) => runner.run_until_ctrl_c(command.execute()),
Commands::TestVectors(command) => runner.run_until_ctrl_c(command.execute()),
Commands::Config(command) => runner.run_until_ctrl_c(command.execute()),
Commands::Debug(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
Expand Down Expand Up @@ -211,6 +212,12 @@ pub enum Commands<Ext: clap::Args + fmt::Debug = NoArgs> {
/// P2P Debugging utilities
#[command(name = "p2p")]
P2P(p2p::Command),
/// Runs an EVM state transition using the provided JSON pre-state files.
///
/// Equivalent of Geth's `./evm t8n` utility, and should be used to confirm
/// equivalence of behavior between Geth and Reth executors.
#[command(name = "t8n")]
T8n(t8n::Command),
/// Generate Test Vectors
#[command(name = "test-vectors")]
TestVectors(test_vectors::Command),
Expand Down
4 changes: 2 additions & 2 deletions bin/reth/src/commands/db/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,12 @@ where
) {
// do not bother comparing if the key is already in the discrepancies map
if self.discrepancies.contains_key(&key) {
return
return;
}

// do not bother comparing if the key is already in the extra elements map
if self.extra_elements.contains_key(&key) {
return
return;
}

match (first, second) {
Expand Down
1 change: 1 addition & 0 deletions bin/reth/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mod node;
pub mod p2p;
pub mod recover;
pub mod stage;
pub mod t8n;
pub mod test_vectors;

pub mod common;
Loading
Loading