Skip to content

Commit

Permalink
bump reth to v1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Oct 3, 2024
1 parent cb51078 commit 41d0ba1
Show file tree
Hide file tree
Showing 11 changed files with 1,304 additions and 694 deletions.
1,879 changes: 1,241 additions & 638 deletions Cargo.lock

Large diffs are not rendered by default.

35 changes: 19 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,27 @@ kakarot-pool = { path = "crates/pool" }
kakarot-exex = { path = "crates/exex" }

# Reth
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-ethereum-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-exex = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.7", features = [
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-ethereum-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-exex = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.8", features = [
"serde",
] }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.7" }
reth-exex-test-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.7" }
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.7" }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.8" }
reth-exex-test-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.8" }
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.8" }

alloy-primitives = { version = "0.8.4", default-features = false }
alloy-genesis = { version = "0.4.2", default-features = false }

serde = { version = "1.0", default-features = false }
eyre = "0.6"
Expand Down
15 changes: 9 additions & 6 deletions bin/keth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ exclude.workspace = true
kakarot-node.workspace = true

# Reth
reth-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-cli-runner = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-cli-runner = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-node-builder.workspace = true
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8" }
reth-primitives.workspace = true

alloy-primitives.workspace = true
alloy-genesis.workspace = true

# Tracing
tracing = { version = "0.1.40", default-features = false }
tracing-subscriber = { version = "0.3.18", default-features = false }
tracing = { version = "0.1", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false }

# Other
clap = { version = "4.5.9", features = ["derive"] }
Expand Down
3 changes: 2 additions & 1 deletion bin/keth/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use alloy_genesis::Genesis;
use alloy_primitives::Address;
use clap::Parser;
use reth_chainspec::{Chain, ChainSpec};
use reth_node_core::args::DevArgs;
use reth_primitives::{Address, Genesis};
use std::{str::FromStr, time::Duration};
use tracing_subscriber::EnvFilter;

Expand Down
3 changes: 3 additions & 0 deletions crates/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ reth-revm = { workspace = true }
reth-execution-errors = { workspace = true }
reth-provider = { workspace = true }

alloy-primitives = { workspace = true }
alloy-genesis = { workspace = true }

# SQLite for debugging, should be removed in the future
rusqlite = { version = "0.31.0", features = ["bundled"] }

Expand Down
3 changes: 2 additions & 1 deletion crates/exex/src/db.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use alloy_primitives::{Address, B256, U256};
use cairo_vm::{
air_private_input::AirPrivateInput, air_public_input::PublicInput,
vm::trace::trace_entry::RelocatedTraceEntry, Felt252,
};
use reth_primitives::{
revm_primitives::{AccountInfo, Bytecode},
Address, SealedBlockWithSenders, B256, U256,
SealedBlockWithSenders,
};
use reth_provider::OriginalValuesKnown;
use reth_revm::db::BundleState;
Expand Down
14 changes: 10 additions & 4 deletions crates/exex/src/execution.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use crate::{db::Database, exex::CHAIN_SPEC};
use alloy_primitives::U256;
use reth::primitives::BlockBody;
use reth_execution_errors::BlockValidationError;
use reth_node_api::{ConfigureEvm, ConfigureEvmEnv};
use reth_node_ethereum::EthEvmConfig;
use reth_primitives::{
revm_primitives::{CfgEnvWithHandlerCfg, EVMError, ExecutionResult, ResultAndState},
Block, BlockWithSenders, EthereumHardfork, Header, Receipt, SealedBlockWithSenders,
TransactionSigned, TransactionSignedEcRecovered, U256,
TransactionSigned, TransactionSignedEcRecovered,
};
use reth_revm::{
db::{states::bundle_state::BundleRetention, BundleState},
Expand Down Expand Up @@ -33,9 +35,13 @@ pub async fn execute_block(

// Construct a new block using the executed transactions and header, and attempt to recover
// senders.
let block = Block { header: header.clone(), body: executed_txs, ..Default::default() }
.with_recovered_senders()
.ok_or_else(|| eyre::eyre!("Failed to recover senders for transactions"))?;
let block = Block {
header: header.clone(),
body: BlockBody { transactions: executed_txs, ..Default::default() },
..Default::default()
}
.with_recovered_senders()
.ok_or_else(|| eyre::eyre!("Failed to recover senders for transactions"))?;

// Extract the current bundle state from the EVM's database.
let bundle = evm.db_mut().take_bundle();
Expand Down
11 changes: 9 additions & 2 deletions crates/exex/src/exex.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::{db::Database, hints::KakarotHintProcessor};
use alloy_genesis::Genesis;
use alloy_primitives::Address;
use cairo_vm::{
air_private_input::AirPrivateInput,
air_public_input::PublicInput,
Expand All @@ -12,7 +14,7 @@ use once_cell::sync::Lazy;
use reth_chainspec::{ChainSpec, ChainSpecBuilder};
use reth_exex::{ExExContext, ExExEvent};
use reth_node_api::FullNodeComponents;
use reth_primitives::{Address, Genesis};
use reth_primitives::BlockNumHash;
use rusqlite::Connection;
use std::{path::PathBuf, sync::Arc};

Expand Down Expand Up @@ -68,12 +70,17 @@ impl<Node: FullNodeComponents> KakarotRollup<Node> {
while let Some(notification) = self.ctx.notifications.next().await {
// Check if the notification contains a committed chain.
if let Some(committed_chain) = notification.committed_chain() {
// Get the tip of the committed chain.
let tip = committed_chain.tip();

// Send a notification that the chain processing is finished.
//
// Finished height is the tip of the committed chain.
//
// The ExEx will not require all earlier blocks which can be pruned.
self.ctx.events.send(ExExEvent::FinishedHeight(committed_chain.tip().number))?;
self.ctx
.events
.send(ExExEvent::FinishedHeight(BlockNumHash::new(tip.number, tip.hash())))?;

// Build the Kakarot hint processor.
let mut hint_processor = KakarotHintProcessor::default().build();
Expand Down
2 changes: 1 addition & 1 deletion crates/exex/src/model.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_primitives::{Address, Bloom, B256, U256};
use cairo_vm::{types::relocatable::MaybeRelocatable, Felt252};
use reth_primitives::{Address, Bloom, B256, U256};
use serde::{Deserialize, Serialize};

/// A custom wrapper around [`MaybeRelocatable`] for the Keth execution environment.
Expand Down
24 changes: 0 additions & 24 deletions crates/node/src/engine.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
//! The Kakarot node implementation.
use reth_chainspec::ChainSpec;
use reth_ethereum_engine_primitives::{
EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes, ExecutionPayloadEnvelopeV2,
ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4, ExecutionPayloadV1,
};
use reth_node_api::{
validate_parent_beacon_block_root_presence, EngineApiMessageVersion,
EngineObjectValidationError, PayloadOrAttributes,
};
use reth_node_builder::{EngineTypes, PayloadTypes};
use serde::{Deserialize, Serialize};

Expand All @@ -28,23 +23,4 @@ impl EngineTypes for KakarotEngineTypes {
type ExecutionPayloadV2 = ExecutionPayloadEnvelopeV2;
type ExecutionPayloadV3 = ExecutionPayloadEnvelopeV3;
type ExecutionPayloadV4 = ExecutionPayloadEnvelopeV4;

fn validate_version_specific_fields(
chain_spec: &ChainSpec,
version: EngineApiMessageVersion,
payload_or_attrs: PayloadOrAttributes<'_, EthPayloadAttributes>,
) -> Result<(), EngineObjectValidationError> {
if payload_or_attrs.withdrawals().map_or(false, |w| !w.is_empty()) {
return Err(EngineObjectValidationError::InvalidParams(
"Withdrawals are not supported by Kakarot network".into(),
));
}
validate_parent_beacon_block_root_presence(
chain_spec,
version,
payload_or_attrs.message_validation_kind(),
payload_or_attrs.timestamp(),
payload_or_attrs.parent_beacon_block_root().is_some(),
)
}
}
9 changes: 8 additions & 1 deletion crates/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use reth_node_builder::{
};
use reth_node_ethereum::{
node::{
EthereumAddOns, EthereumConsensusBuilder, EthereumNetworkBuilder, EthereumPayloadBuilder,
EthereumAddOns, EthereumConsensusBuilder, EthereumEngineValidatorBuilder,
EthereumNetworkBuilder, EthereumPayloadBuilder,
},
EthEngineTypes,
};
Expand All @@ -26,6 +27,9 @@ pub type KakarotNetworkBuilder = EthereumNetworkBuilder;
/// TODO: we don't need a consensus for now, so just implement a type that does nothing.
pub type KakarotConsensusBuilder = EthereumConsensusBuilder;

/// Type alias for the Kakarot engine validator builder.
pub type KakarotEngineValidatorBuilder = EthereumEngineValidatorBuilder;

/// Type alias for the Kakarot add-ons.
pub type KakarotAddsOns = EthereumAddOns;

Expand All @@ -43,6 +47,7 @@ impl KakarotNode {
KakarotNetworkBuilder,
KakarotExecutorBuilder,
KakarotConsensusBuilder,
KakarotEngineValidatorBuilder,
>
where
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec>>,
Expand All @@ -59,6 +64,7 @@ impl KakarotNode {
.network(KakarotNetworkBuilder::default())
.executor(KakarotExecutorBuilder::default())
.consensus(KakarotConsensusBuilder::default())
.engine_validator(KakarotEngineValidatorBuilder::default())
}
}

Expand All @@ -83,6 +89,7 @@ where
KakarotNetworkBuilder,
KakarotExecutorBuilder,
KakarotConsensusBuilder,
KakarotEngineValidatorBuilder,
>;

type AddOns = KakarotAddsOns;
Expand Down

0 comments on commit 41d0ba1

Please sign in to comment.