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

Hook revm and inspectors into gwyneth #11

Merged
merged 25 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
47e789b
Try hook revm and revm-inspectors hook into gwyneth for testing
Nov 27, 2024
aa13828
add boilerplate for match tracer
Nov 28, 2024
75ff5b4
fix spec chain_id issue
Nov 29, 2024
11dcf72
prepend L1 chain id
Dec 2, 2024
de04e0c
try xCall
Dec 3, 2024
d301cbc
chore: update Cargo.lock for gwyneth dependencies
Dec 6, 2024
a031b78
Fix EVM.sol for latest revm
Brechtpd Dec 12, 2024
5e71f76
fix deployment issue
Dec 13, 2024
1372ac4
changed contract address
Dec 13, 2024
91d12f0
Add builder support for external db dependencies
Brechtpd Dec 13, 2024
2cece48
temp fix tx without chain_id (simulated call())
Dec 18, 2024
51a69b9
set chain_id to reasonable value when not known in estimate_gas
Brechtpd Dec 18, 2024
87d3233
try to fix chain_id again for rpc calls
Brechtpd Dec 19, 2024
ef01ba4
cross chain calls potentially working
Brechtpd Dec 20, 2024
b83022f
script for checking on-chain balances
Dec 20, 2024
0343701
sync composability with state diffs wip
Brechtpd Dec 30, 2024
4a1608a
State diff + make syncing build the same block as rbuilder
Brechtpd Jan 2, 2025
a9eeb29
DA improvements + more fixes to make reth build the same block as rbu…
Brechtpd Jan 2, 2025
d7459b4
add state root to StateDiff
Brechtpd Jan 6, 2025
b69ed4c
add state root to StateDiff (again)
Brechtpd Jan 6, 2025
3de43c0
fix compile error
Brechtpd Jan 6, 2025
edffe3e
Added bundle directly to StateDiff
Brechtpd Jan 7, 2025
1b8dd78
fix compile error
Brechtpd Jan 7, 2025
8c0ab00
sync composability + state delta's
Brechtpd Jan 11, 2025
f93d526
Merge pull request #12 from taikoxyz/sync-composability
Brechtpd Jan 11, 2025
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
2,090 changes: 1,158 additions & 932 deletions Cargo.lock

Large diffs are not rendered by default.

20 changes: 14 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ tracing = "0.1.0"
tracing-appender = "0.2"
url = "2.3"
zstd = "0.13"
bincode = "1.3"

# metrics
metrics = "0.23.0"
Expand Down Expand Up @@ -563,11 +564,18 @@ proptest-derive = "0.5"
serial_test = "3"
similar-asserts = "1.5.0"
tempfile = "3.8"
test-fuzz = "5"
test-fuzz = "5"

[patch.crates-io]
revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v43-gwyneth" }
revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v43-gwyneth" }
revm-interpreter = { git = "https://github.com/taikoxyz/revm.git", branch = "v43-gwyneth" }
revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v43-gwyneth" }
revm-inspectors = { git = "https://github.com/taikoxyz/revm-inspectors.git", branch = "main-rbuilder" }
revm = { git = "https://github.com/taikoxyz/revm.git", branch = "gwyneth-debug-shit" }
revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "gwyneth-debug-shit" }
revm-interpreter = { git = "https://github.com/taikoxyz/revm.git", branch = "gwyneth-debug-shit" }
revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "gwyneth-debug-shit" }

#revm = { path = "../../revm-gwyneth/revm/crates/revm" }
#revm-primitives = { path = "../../revm-gwyneth/revm/crates/primitives" }
#revm-interpreter = { path = "../../revm-gwyneth/revm/crates/interpreter" }
#revm-precompile = { path = "../../revm-gwyneth/revm/crates/precompile" }

revm-inspectors = { git = "https://github.com/taikoxyz/revm-inspectors.git", branch = "main-rbuilder" }
#revm-inspectors = { path = "../../revm-inspector-gwyneth/revm-inspectors"}
9 changes: 8 additions & 1 deletion bin/reth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use reth::args::{DiscoveryArgs, NetworkArgs, RpcServerArgs};
use reth_chainspec::ChainSpecBuilder;
use reth_node_builder::{NodeBuilder, NodeConfig, NodeHandle};
use reth_node_ethereum::EthereumNode;
use reth_provider::NODES;
use reth_tasks::TaskManager;

const BASE_CHAIN_ID: u64 = gwyneth::exex::BASE_CHAIN_ID; // Base chain ID for L2s
Expand Down Expand Up @@ -49,13 +50,16 @@ fn main() -> eyre::Result<()> {
.with_static_l2_rpc_ip_and_port(chain_id)
);

let chain_id = chain_spec.chain.id();

let NodeHandle { node: gwyneth_node, node_exit_future: _ } =
NodeBuilder::new(node_config.clone())
.gwyneth_node(exec.clone(), chain_spec.chain.id())
.gwyneth_node(exec.clone(), chain_id)
.node(GwynethNode::default())
.launch()
.await?;

NODES.lock().unwrap().insert(chain_id, gwyneth_node.provider.clone());
gwyneth_nodes.push(gwyneth_node);
}

Expand All @@ -67,6 +71,9 @@ fn main() -> eyre::Result<()> {
.launch()
.await?;


NODES.lock().unwrap().insert(handle.node.chain_spec().chain.id(), handle.node.provider.clone());

handle.wait_for_node_exit().await
})
}
Expand Down
3 changes: 3 additions & 0 deletions crates/blockchain-tree/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ metrics.workspace = true
# misc
aquamarine.workspace = true
linked_hash_set.workspace = true
serde.workspace = true
serde_json.workspace = true
bincode.workspace = true

[dev-dependencies]
reth-chainspec.workspace = true
Expand Down
22 changes: 2 additions & 20 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use reth_primitives::{
use reth_provider::{
BlockExecutionWriter, BlockNumReader, BlockWriter, CanonStateNotification,
CanonStateNotificationSender, CanonStateNotifications, ChainSpecProvider, ChainSplit,
ChainSplitTarget, DisplayBlocksChain, HeaderProvider, ProviderError, StaticFileProviderFactory,
ChainSplitTarget, DisplayBlocksChain, HeaderProvider, ProviderError, StaticFileProviderFactory, NODES,
};
use reth_prune_types::PruneModes;
use reth_stages_api::{MetricEvent, MetricEventsSender};
Expand Down Expand Up @@ -648,6 +648,7 @@ where
return None;
};

println!("insert_unwound_chain");
debug!(target: "blockchain_tree",
unwound_block= ?block.num_hash(),
chain_id = ?chain_id,
Expand Down Expand Up @@ -1285,25 +1286,6 @@ where
Ok(())
}

/// Unwind tables and put it inside state
pub fn unwind(&mut self, unwind_to: BlockNumber) -> Result<(), CanonicalError> {
// nothing to be done if unwind_to is higher then the tip
if self.block_indices().canonical_tip().number <= unwind_to {
return Ok(())
}
// revert `N` blocks from current canonical chain and put them inside BlockchainTree
let old_canon_chain = self.revert_canonical_from_database(unwind_to)?;

// check if there is block in chain
if let Some(old_canon_chain) = old_canon_chain {
self.state.block_indices.unwind_canonical_chain(unwind_to);
// insert old canonical chain to BlockchainTree.
self.insert_unwound_chain(AppendableChain::new(old_canon_chain));
}

Ok(())
}

/// Reverts the canonical chain down to the given block from the database and returns the
/// unwound chain.
///
Expand Down
Loading
Loading