Skip to content

Commit

Permalink
feat: set finalized and safe hash (parlia) (#54)
Browse files Browse the repository at this point in the history
* chore: move parlia engine task to new crates

* feat: update finalized and safe hash after fcu

* perf: move query snapshot and chain tracker updater to another thread

* chore: fix typo

* chore: fix ut

* chore: fix ut

* fix: incorrect consensus for live sync full block downloader

* fix: skip BlockPreMerge checks if running bsc network

* fix: add sleep to loop

* fix: review comments

* fix: change sleep time to 100ms

* fix: finalized block hash not sent if engine is too far behind

* fix: live sync issue

* chore: fix code conflicts

* chore: fix ut
  • Loading branch information
j75689 authored Jul 15, 2024
1 parent a91126a commit 9f13118
Show file tree
Hide file tree
Showing 19 changed files with 843 additions and 446 deletions.
45 changes: 45 additions & 0 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ members = [
"crates/trie/parallel/",
"crates/trie/trie",
"crates/bsc/node/",
"crates/bsc/engine/",
"examples/beacon-api-sidecar-fetcher/",
"examples/beacon-api-sse/",
"examples/bsc-p2p",
Expand All @@ -145,7 +146,7 @@ members = [
"examples/exex/minimal/",
"examples/exex/op-bridge/",
"testing/ef-tests/",
"testing/testing-utils",
"testing/testing-utils",
]
default-members = ["bin/reth"]

Expand Down Expand Up @@ -375,6 +376,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-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 Expand Up @@ -563,4 +565,4 @@ alloy-eips = { git = "https://github.com/bnb-chain/alloy", rev = "18f098dd78be66
alloy-network = { git = "https://github.com/bnb-chain/alloy", rev = "18f098dd78be661433bae682ad161a41f8a9c301" }
alloy-serde = { git = "https://github.com/bnb-chain/alloy", rev = "18f098dd78be661433bae682ad161a41f8a9c301" }
alloy-signer = { git = "https://github.com/bnb-chain/alloy", rev = "18f098dd78be661433bae682ad161a41f8a9c301" }
alloy-signer-local = { git = "https://github.com/bnb-chain/alloy", rev = "18f098dd78be661433bae682ad161a41f8a9c301" }
alloy-signer-local = { git = "https://github.com/bnb-chain/alloy", rev = "18f098dd78be661433bae682ad161a41f8a9c301" }
1 change: 1 addition & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ bsc = [
"reth-node-core/bsc",
"reth-stages/bsc",
"reth-node-builder/bsc",
"reth-beacon-consensus/bsc",
]

# no-op feature flag for switching between the `optimism` and default functionality in CI matrices
Expand Down
6 changes: 4 additions & 2 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ where
.provider_factory
.chain_spec()
.fork(EthereumHardfork::Paris)
.active_at_ttd(parent_td, U256::ZERO)
.active_at_ttd(parent_td, U256::ZERO) &&
!self.externals.provider_factory.chain_spec().is_bsc()
{
return Err(BlockExecutionError::Validation(BlockValidationError::BlockPreMerge {
hash: block.hash(),
Expand Down Expand Up @@ -1044,7 +1045,8 @@ where
.provider_factory
.chain_spec()
.fork(EthereumHardfork::Paris)
.active_at_ttd(td, U256::ZERO)
.active_at_ttd(td, U256::ZERO) &&
!self.externals.provider_factory.chain_spec().is_bsc()
{
return Err(CanonicalError::from(BlockValidationError::BlockPreMerge {
hash: block_hash,
Expand Down
3 changes: 1 addition & 2 deletions crates/bsc/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ reth-network.workspace = true
reth-engine-primitives.workspace = true
reth-network-p2p.workspace = true
reth-network-peers.workspace = true
reth-beacon-consensus.workspace = true

# eth
alloy-rlp.workspace = true
Expand Down Expand Up @@ -62,4 +61,4 @@ rand = "0.8.5"
bsc = [
"reth-primitives/bsc",
"reth-consensus-common/bsc"
]
]
Loading

0 comments on commit 9f13118

Please sign in to comment.