Skip to content

Commit

Permalink
Accepting blocks!
Browse files Browse the repository at this point in the history
  • Loading branch information
poplexity authored and aamirpashaa committed Feb 29, 2024
1 parent 87c5aca commit 3bf1c18
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ telos = [
"reth-network/telos",
"reth-node-core/telos",
"reth-primitives/telos",
"reth-provider/telos",
"reth-consensus-common/telos",
]

[[bin]]
Expand Down
1 change: 1 addition & 0 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ impl<DB: Database, EVM: ExecutorFactory> BlockchainTree<DB, EVM> {
.state_root_with_updates(provider.tx_ref())
.map_err(Into::<DatabaseError>::into)?;
let tip = blocks.tip();
#[cfg(not(feature = "telos"))]
if state_root != tip.state_root {
return Err(RethError::Provider(ProviderError::StateRootMismatch(Box::new(
RootMismatch {
Expand Down
1 change: 1 addition & 0 deletions crates/consensus/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ mockall = "0.11.3"

[features]
optimism = ["reth-primitives/optimism"]
telos = []
1 change: 1 addition & 0 deletions crates/primitives/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ impl SealedHeader {
}

// timestamp in past check
#[cfg(not(feature = "telos"))]
if self.header.is_timestamp_in_past(parent.timestamp) {
return Err(HeaderValidationError::TimestampIsInPast {
parent_timestamp: parent.timestamp,
Expand Down
1 change: 1 addition & 0 deletions crates/storage/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ rand.workspace = true
[features]
test-utils = ["alloy-rlp", "reth-db/test-utils"]
optimism = ["reth-primitives/optimism", "reth-interfaces/optimism"]
telos = []
3 changes: 3 additions & 0 deletions crates/storage/provider/src/providers/database/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ use std::{
sync::{mpsc, Arc},
time::{Duration, Instant},
};
use revm::interpreter::instructions::bitwise::not;
use tracing::{debug, warn};

/// A [`DatabaseProvider`] that holds a read-only database transaction.
Expand Down Expand Up @@ -2119,6 +2120,7 @@ impl<TX: DbTxMut + DbTx> HashingWriter for DatabaseProvider<TX> {
.with_prefix_sets(prefix_sets)
.root_with_updates()
.map_err(Into::<reth_db::DatabaseError>::into)?;
#[cfg(not(feature = "telos"))]
if state_root != expected_state_root {
return Err(ProviderError::StateRootMismatch(Box::new(RootMismatch {
root: GotExpected { got: state_root, expected: expected_state_root },
Expand Down Expand Up @@ -2310,6 +2312,7 @@ impl<TX: DbTxMut + DbTx> BlockExecutionWriter for DatabaseProvider<TX> {

// state root should be always correct as we are reverting state.
// but for sake of double verification we will check it again.
#[cfg(not(feature = "telos"))]
if new_state_root != parent_state_root {
let parent_hash = self
.block_hash(parent_number)?
Expand Down

0 comments on commit 3bf1c18

Please sign in to comment.