Skip to content

Commit 2e73972

Browse files
authored
refactor: break e2hs-writer and portal-bridge dependency (#1831)
1 parent ade1963 commit 2e73972

File tree

25 files changed

+114
-101
lines changed

25 files changed

+114
-101
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ jobs:
235235
# parallelism level should be set to the amount of simulators we have or greater
236236
# The reason for this is the CI code currently only supports 1 input at a time
237237
# if we have a parallelism level of 5 and 6 sims one test runner will get 2 test sims and fail
238-
parallelism: 20
238+
parallelism: 21
239239
steps:
240240
- checkout
241241
- run:

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ members = [
44
"bin/portal-bridge",
55
"bin/trin",
66
"bin/trin-execution",
7-
"crates/ethportal-api",
87
"crates/e2store",
8+
"crates/ethereum-rpc-client",
9+
"crates/ethportal-api",
910
"crates/evm",
1011
"crates/light-client",
1112
"crates/metrics",
1213
"crates/portalnet",
1314
"crates/rpc",
1415
"crates/storage",
1516
"crates/subnetworks/beacon",
16-
"crates/subnetworks/history",
17+
"crates/subnetworks/history",
1718
"crates/subnetworks/state",
1819
"crates/utils",
1920
"crates/validation",
@@ -104,6 +105,7 @@ utp-rs = "0.1.0-alpha.17"
104105

105106
# Trin workspace crates
106107
e2store = { path = "crates/e2store" }
108+
ethereum-rpc-client = { path = "crates/ethereum-rpc-client" }
107109
ethportal-api = { path = "crates/ethportal-api" }
108110
light-client = { path = "crates/light-client" }
109111
portal-bridge = { path = "bin/portal-bridge" }

bin/e2hs-writer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ aws-config = { version = "1.6", features = ["behavior-version-latest"] }
2020
aws-sdk-s3 = "1.83.0"
2121
clap.workspace = true
2222
e2store.workspace = true
23+
ethereum-rpc-client.workspace = true
2324
ethereum_ssz.workspace = true
2425
ethportal-api.workspace = true
2526
futures.workspace = true
2627
humanize-duration.workspace = true
27-
portal-bridge.workspace = true
2828
reqwest.workspace = true
2929
rstest.workspace = true
3030
serde_yaml.workspace = true

bin/e2hs-writer/src/cli.rs

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

33
use clap::{Args, Parser, Subcommand};
4-
use portal_bridge::{constants::DEFAULT_TOTAL_REQUEST_TIMEOUT, DEFAULT_BASE_EL_ENDPOINT};
4+
use ethereum_rpc_client::constants::{DEFAULT_BASE_EL_ENDPOINT, DEFAULT_TOTAL_REQUEST_TIMEOUT};
55
use url::Url;
66

77
pub const DEFAULT_PORTAL_ACCUMULATOR_PATH: &str = "./portal-accumulators";

bin/e2hs-writer/src/subcommands/head_generator/ethereum_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use anyhow::{anyhow, bail, ensure};
2+
use ethereum_rpc_client::{consensus::ConsensusApi, execution::ExecutionApi};
23
use ethportal_api::{
34
consensus::{
45
beacon_block::SignedBeaconBlockElectra, beacon_state::BeaconStateElectra,
56
constants::SLOTS_PER_HISTORICAL_ROOT,
67
},
78
Receipts,
89
};
9-
use portal_bridge::api::{consensus::ConsensusApi, execution::ExecutionApi};
1010
use tracing::warn;
1111
use url::Url;
1212

bin/e2hs-writer/src/subcommands/single_generator/e2hs_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use alloy_hardforks::EthereumHardforks;
1010
use anyhow::{anyhow, bail, ensure};
1111
use async_stream::stream;
1212
use e2store::e2hs::{E2HSWriter, BLOCKS_PER_E2HS};
13+
use ethereum_rpc_client::execution::ExecutionApi;
1314
use ethportal_api::{
1415
types::{
1516
execution::{
@@ -24,7 +25,6 @@ use ethportal_api::{
2425
Receipts,
2526
};
2627
use futures::{Stream, StreamExt};
27-
use portal_bridge::api::execution::ExecutionApi;
2828
use ssz::Decode;
2929
use tokio::try_join;
3030
use tracing::info;

bin/portal-bridge/Cargo.toml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ version.workspace = true
1313

1414
[dependencies]
1515
alloy.workspace = true
16-
alloy-hardforks.workspace = true
1716
anyhow.workspace = true
1817
bytes.workspace = true
1918
chrono.workspace = true
@@ -22,37 +21,21 @@ delay_map.workspace = true
2221
discv5.workspace = true
2322
e2store.workspace = true
2423
eth_trie.workspace = true
25-
ethereum_ssz.workspace = true
26-
ethereum_ssz_derive.workspace = true
24+
ethereum-rpc-client.workspace = true
2725
ethportal-api.workspace = true
2826
futures.workspace = true
2927
humanize-duration.workspace = true
3028
itertools.workspace = true
31-
jsonrpsee = { workspace = true, features = [
32-
"async-client",
33-
"client",
34-
"macros",
35-
"server",
36-
] }
3729
portalnet.workspace = true
3830
prometheus_exporter.workspace = true
3931
rand.workspace = true
40-
regex = "1.10.2"
4132
reqwest.workspace = true
42-
reqwest-middleware = { version = "0.3.3", features = ["json"] }
43-
reqwest-retry = "0.6.1"
44-
reth-ipc.workspace = true
4533
revm.workspace = true
4634
revm-primitives.workspace = true
47-
scraper.workspace = true
48-
serde = { workspace = true, features = ["rc"] }
49-
serde_json.workspace = true
5035
ssz_types.workspace = true
5136
thiserror.workspace = true
5237
tokio.workspace = true
5338
tracing.workspace = true
54-
tracing-subscriber.workspace = true
55-
tree_hash.workspace = true
5639
trin.workspace = true
5740
trin-beacon.workspace = true
5841
trin-history.workspace = true
@@ -64,7 +47,6 @@ trin-metrics.workspace = true
6447
trin-utils.workspace = true
6548
trin-validation.workspace = true
6649
url.workspace = true
67-
utp-rs.workspace = true
6850

6951
[dev-dependencies]
7052
env_logger.workspace = true

bin/portal-bridge/src/api/mod.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

bin/portal-bridge/src/bridge/beacon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::{
66

77
use alloy::primitives::B256;
88
use anyhow::bail;
9+
use ethereum_rpc_client::consensus::ConsensusApi;
910
use ethportal_api::{
1011
consensus::{
1112
constants::{SLOTS_PER_EPOCH, SLOTS_PER_HISTORICAL_ROOT},
@@ -37,7 +38,6 @@ use trin_metrics::bridge::BridgeMetricsReporter;
3738

3839
use super::{constants::SERVE_BLOCK_TIMEOUT, offer_report::OfferReport};
3940
use crate::{
40-
api::consensus::ConsensusApi,
4141
census::Census,
4242
constants::BEACON_GENESIS_TIME,
4343
types::mode::BridgeMode,

0 commit comments

Comments
 (0)