Skip to content

Commit

Permalink
fix: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Jul 11, 2024
1 parent f5f225e commit 962cbb5
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ members = [
"crates/trie/parallel/",
"crates/trie/trie",
"crates/bsc/node/",
"crates/bsc/tasks",
"crates/bsc/engine/",
"examples/beacon-api-sidecar-fetcher/",
"examples/beacon-api-sse/",
"examples/bsc-p2p",
Expand Down Expand Up @@ -338,7 +338,7 @@ 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-tasks = { path = "crates/tasks" }
reth-bsc-tasks = { path = "crates/bsc/tasks" }
reth-bsc-engine = { path = "crates/bsc/engine" }
reth-testing-utils = { path = "testing/testing-utils" }
reth-tokio-util = { path = "crates/tokio-util" }
reth-tracing = { path = "crates/tracing" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "reth-bsc-tasks"
name = "reth-bsc-engine"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{client::ParliaClient, Storage};
use alloy_rlp::Encodable;
use reth_beacon_consensus::{BeaconEngineMessage, ForkchoiceStatus};
use reth_bsc_consensus::Parlia;
use reth_chainspec::ChainSpec;
Expand All @@ -18,7 +17,6 @@ use std::{
};
use tokio::sync::Mutex;

use reth_network_p2p::bodies::client::BodiesClient;
use tokio::{
signal,
sync::{
Expand All @@ -35,7 +33,7 @@ enum ForkChoiceMessage {
/// Broadcast new hash.
NewHeader(NewHeaderEvent),
}
/// internal message to beacon engine
/// internal message to notify the engine of a new block
#[derive(Debug, Clone)]
struct NewHeaderEvent {
header: SealedHeader,
Expand Down Expand Up @@ -366,6 +364,7 @@ impl<
}
Err(err) => {
error!(target: "consensus::parlia", %err, "Parlia fork choice update failed");
break
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions crates/bsc/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,17 +859,14 @@ where
Ok(snap)
}

pub(crate) fn get_header_by_hash(
&self,
block_hash: B256,
) -> Result<Header, BlockExecutionError> {
fn get_header_by_hash(&self, block_hash: B256) -> Result<Header, BlockExecutionError> {
self.provider
.header(&block_hash)
.map_err(|err| BscBlockExecutionError::ProviderInnerError { error: err.into() })?
.ok_or_else(|| BscBlockExecutionError::UnknownHeader { block_hash }.into())
}

pub(crate) fn find_ancient_header(
fn find_ancient_header(
&self,
header: &Header,
count: u64,
Expand Down
4 changes: 2 additions & 2 deletions crates/node/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ reth-node-events.workspace = true
reth-consensus.workspace = true
reth-consensus-debug-client.workspace = true
reth-rpc-types.workspace = true
reth-bsc-tasks = { workspace = true, optional = true}
reth-bsc-engine = { workspace = true, optional = true}

## async
futures.workspace = true
Expand Down Expand Up @@ -80,5 +80,5 @@ tempfile.workspace = true

[features]
bsc = [
"reth-bsc-tasks/bsc",
"reth-bsc-engine/bsc",
]
2 changes: 1 addition & 1 deletion crates/node/builder/src/launch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use reth_beacon_consensus::{
use reth_blockchain_tree::{BlockchainTree, ShareableBlockchainTree, TreeExternals};

#[cfg(feature = "bsc")]
use reth_bsc_tasks::ParliaEngineBuilder;
use reth_bsc_engine::ParliaEngineBuilder;
use reth_consensus::Consensus;
use reth_consensus_debug_client::{DebugConsensusClient, EtherscanBlockProvider, RpcBlockProvider};
use reth_exex::ExExManagerHandle;
Expand Down

0 comments on commit 962cbb5

Please sign in to comment.