Skip to content

Commit 087a8ad

Browse files
committed
refactor: remove BscEthApi
1 parent 4063ea7 commit 087a8ad

19 files changed

Lines changed: 389 additions & 942 deletions

File tree

Cargo.lock

Lines changed: 319 additions & 293 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,44 @@ name = "reth-bsc"
1212
path = "src/main.rs"
1313

1414
[dependencies]
15-
reth = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
16-
reth-cli = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
17-
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
18-
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
19-
reth-db = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
20-
reth-engine-local = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
21-
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
22-
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
23-
reth-discv4 = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b", features = ["test-utils"] }
24-
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
25-
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b", features = ["serde"] }
26-
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
27-
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
28-
reth-eth-wire = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
29-
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
30-
reth-evm = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
31-
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
32-
reth-node-core = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
33-
reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
34-
reth-network = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b", features = ["test-utils"] }
35-
reth-network-p2p = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
36-
reth-network-api = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
37-
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b", features = ["test-utils"] }
38-
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
39-
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
40-
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
41-
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
42-
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
43-
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b", features = ["test-utils"] }
44-
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
45-
reth-rpc-engine-api = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
46-
reth-tracing = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
47-
reth-trie-common = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
48-
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", rev = "8e0ff926b" }
15+
reth = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
16+
reth-cli = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
17+
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
18+
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
19+
reth-db = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
20+
reth-engine-local = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
21+
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
22+
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
23+
reth-discv4 = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3", features = ["test-utils"] }
24+
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
25+
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3", features = ["serde"] }
26+
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
27+
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
28+
reth-eth-wire = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
29+
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
30+
reth-evm = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
31+
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
32+
reth-node-core = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
33+
reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
34+
reth-network = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3", features = ["test-utils"] }
35+
reth-network-p2p = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
36+
reth-network-api = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
37+
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3", features = ["test-utils"] }
38+
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
39+
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
40+
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
41+
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
42+
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
43+
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3", features = ["test-utils"] }
44+
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
45+
reth-rpc-engine-api = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
46+
reth-tracing = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
47+
reth-trie-common = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
48+
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", rev = "c0246e3" }
4949
revm = "27.0.2"
5050

5151
# alloy dependencies
52-
alloy-evm = "0.14"
52+
alloy-evm = "0.15"
5353

5454
alloy-genesis = "1.0.17"
5555
alloy-consensus = "1.0.17"

src/hardforks/bsc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ mod tests {
400400

401401
// Test mainnet chain spec
402402
let mainnet_spec = crate::chainspec::BscChainSpec::from(bsc_mainnet());
403-
403+
404404
// Test blocks around the critical transition points
405405
// Block 23846000: Should be Moran (before Gibbs activation)
406406
assert_eq!(
@@ -444,7 +444,7 @@ mod tests {
444444

445445
// Test testnet chain spec
446446
let testnet_spec = crate::chainspec::BscChainSpec::from(bsc_testnet());
447-
447+
448448
// Test blocks around the critical transition points for testnet
449449
// Block 23603939: Should be Nano (before Moran activation)
450450
assert_eq!(

src/node/engine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::sync::Arc;
22

33
use crate::{
4-
node::{rpc::engine_api::payload::BscPayloadTypes, BscNode},
4+
node::{engine_api::payload::BscPayloadTypes, BscNode},
55
BscBlock, BscPrimitives,
66
};
77
use alloy_eips::eip7685::Requests;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::node::{engine::BscBuiltPayload, rpc::engine_api::validator::BscExecutionData};
1+
use crate::node::{engine::BscBuiltPayload, engine_api::validator::BscExecutionData};
22
use reth::{
33
payload::EthPayloadBuilderAttributes,
44
primitives::{NodePrimitives, SealedBlock},

src/node/evm/executor.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use super::patch::{patch_mainnet_after_tx, patch_mainnet_before_tx, patch_chapel_after_tx, patch_chapel_before_tx};
1+
use super::patch::{
2+
patch_chapel_after_tx, patch_chapel_before_tx, patch_mainnet_after_tx, patch_mainnet_before_tx,
3+
};
24
use crate::{
35
consensus::{MAX_SYSTEM_REWARD, SYSTEM_ADDRESS, SYSTEM_REWARD_PERCENT},
46
evm::transaction::BscTxEnv,
@@ -272,9 +274,12 @@ where
272274
Ok(())
273275
}
274276

275-
/// Handle update validatorsetv2 system tx.
276-
/// Activated by <https://github.com/bnb-chain/BEPs/pull/294>
277-
fn handle_update_validator_set_v2_tx(&mut self, tx: &TransactionSigned) -> Result<(), BlockExecutionError> {
277+
/// Handle update validatorsetv2 system tx.
278+
/// Activated by <https://github.com/bnb-chain/BEPs/pull/294>
279+
fn handle_update_validator_set_v2_tx(
280+
&mut self,
281+
tx: &TransactionSigned,
282+
) -> Result<(), BlockExecutionError> {
278283
sol!(
279284
function updateValidatorSetV2(
280285
address[] _consensusAddrs,

src/node/evm/mod.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ where
8888
unimplemented!()
8989
}
9090

91-
fn db_mut(&mut self) -> &mut Self::DB {
92-
&mut self.journaled_state.database
93-
}
94-
9591
fn finish(self) -> (Self::DB, EvmEnv<Self::Spec>) {
9692
let Context { block: block_env, cfg: cfg_env, journaled_state, .. } = self.inner.ctx;
9793

@@ -102,20 +98,16 @@ where
10298
self.inspect = enabled;
10399
}
104100

105-
fn precompiles_mut(&mut self) -> &mut Self::Precompiles {
106-
&mut self.inner.precompiles
107-
}
108-
109-
fn inspector_mut(&mut self) -> &mut Self::Inspector {
110-
&mut self.inner.inspector
111-
}
112-
113-
fn precompiles(&self) -> &Self::Precompiles {
114-
&self.inner.precompiles
101+
fn components(&self) -> (&Self::DB, &Self::Inspector, &Self::Precompiles) {
102+
(&self.journaled_state.database, &self.inner.inspector, &self.inner.precompiles)
115103
}
116104

117-
fn inspector(&self) -> &Self::Inspector {
118-
&self.inner.inspector
105+
fn components_mut(&mut self) -> (&mut Self::DB, &mut Self::Inspector, &mut Self::Precompiles) {
106+
(
107+
&mut self.inner.ctx.journaled_state.database,
108+
&mut self.inner.inspector,
109+
&mut self.inner.precompiles,
110+
)
119111
}
120112
}
121113

0 commit comments

Comments
 (0)