Skip to content

refactor: add trin prefix to most crates #1640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 139 additions & 139 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@ url = "2.3.1"
utp-rs = { tag = "v0.1.0-alpha.14", git = "https://github.com/ethereum/utp" }

# Trin workspace crates
e2store = { path = "crates/e2store" }
ethportal-api = { path = "crates/ethportal-api" }
light-client = { path = "crates/light-client" }
portal-bridge = { path = "bin/portal-bridge" }
portalnet = { path = "crates/portalnet" }
rpc = { path = "crates/rpc"}
trin = { path = "bin/trin"}
trin-beacon = { path = "crates/subnetworks/beacon" }
trin-evm = { path = "crates/evm" }
trin-e2store = { path = "crates/e2store" }
trin-execution = { path = "bin/trin-execution" }
trin-history = { path = "crates/subnetworks/history" }
trin-light-client = { path = "crates/light-client" }
trin-metrics = { path = "crates/metrics" }
trin-portalnet = { path = "crates/portalnet" }
trin-rpc = { path = "crates/rpc"}
trin-state = { path = "crates/subnetworks/state" }
trin-storage = { path = "crates/storage" }
trin-utils = { path = "crates/utils" }
Expand Down
4 changes: 2 additions & 2 deletions bin/portal-bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ chrono.workspace = true
clap.workspace = true
delay_map.workspace = true
discv5.workspace = true
e2store.workspace = true
eth_trie.workspace = true
ethereum_ssz.workspace = true
ethportal-api.workspace = true
Expand All @@ -32,7 +31,6 @@ jsonrpsee = { workspace = true, features = [
"macros",
"server",
] }
portalnet.workspace = true
prometheus_exporter.workspace = true
rand.workspace = true
reqwest.workspace = true
Expand All @@ -50,7 +48,9 @@ tokio.workspace = true
tracing.workspace = true
trin-evm.workspace = true
trin-execution.workspace = true
trin-e2store.workspace = true
trin-metrics.workspace = true
trin-portalnet.workspace = true
trin-utils.workspace = true
trin-validation.workspace = true
url.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions bin/portal-bridge/src/bridge/era1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ use std::{

use alloy::primitives::B256;
use anyhow::{anyhow, ensure};
use e2store::{
era1::{BlockTuple, Era1},
utils::get_shuffled_era1_files,
};
use ethportal_api::{
jsonrpsee::http_client::HttpClient, types::execution::accumulator::EpochAccumulator,
HistoryContentKey, HistoryContentValue, HistoryNetworkApiClient,
Expand All @@ -26,6 +22,10 @@ use tokio::{
time::{sleep, timeout, Duration},
};
use tracing::{debug, error, info, warn};
use trin_e2store::{
era1::{BlockTuple, Era1},
utils::get_shuffled_era1_files,
};
use trin_metrics::bridge::BridgeMetricsReporter;
use trin_validation::{
constants::EPOCH_SIZE, header_validator::HeaderValidator, oracle::HeaderOracle,
Expand Down
2 changes: 1 addition & 1 deletion bin/portal-bridge/src/bridge/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::{

use alloy::{consensus::EMPTY_ROOT_HASH, rlp::Decodable};
use anyhow::ensure;
use e2store::utils::get_era2_files;
use eth_trie::{decode_node, node::Node, EthTrie, RootWithTrieDiff, Trie};
use ethportal_api::{
jsonrpsee::http_client::HttpClient,
Expand All @@ -28,6 +27,7 @@ use tokio::{
time::timeout,
};
use tracing::{debug, enabled, error, info, warn, Level};
use trin_e2store::utils::get_era2_files;
use trin_evm::spec_id::get_spec_block_number;
use trin_execution::{
cli::{ImportStateConfig, APP_NAME},
Expand Down
8 changes: 4 additions & 4 deletions bin/portal-bridge/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ use ethportal_api::{
types::{network::Subnetwork, portal_wire::NetworkSpec},
Enr,
};
use portalnet::{
constants::{DEFAULT_DISCOVERY_PORT, DEFAULT_NETWORK, DEFAULT_WEB3_HTTP_PORT},
discovery::ENR_PORTAL_CLIENT_KEY,
};
use reqwest::{
header::{HeaderMap, HeaderValue, CONTENT_TYPE},
Client, IntoUrl, Request, Response,
Expand All @@ -18,6 +14,10 @@ use reqwest_middleware::{ClientBuilder, ClientWithMiddleware, RequestBuilder};
use reqwest_retry::{policies::ExponentialBackoff, RetryTransientMiddleware};
use tokio::time::Duration;
use tracing::error;
use trin_portalnet::{
constants::{DEFAULT_DISCOVERY_PORT, DEFAULT_NETWORK, DEFAULT_WEB3_HTTP_PORT},
discovery::ENR_PORTAL_CLIENT_KEY,
};
use trin_utils::cli::{check_private_key_length, network_parser};
use url::Url;

Expand Down
2 changes: 1 addition & 1 deletion bin/trin-execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ alloy-rpc-types-engine = { version = "0.4.2", default-features = false, features
anyhow.workspace = true
clap.workspace = true
ethportal-api.workspace = true
e2store.workspace = true
eth_trie.workspace = true
futures-util.workspace = true
hashbrown = "0.14.0"
Expand All @@ -40,6 +39,7 @@ thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
trin-evm.workspace = true
trin-e2store.workspace = true
trin-utils.workspace = true

[dev-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions bin/trin-execution/src/era/binary_search.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use e2store::{
use reqwest::Client;
use revm_primitives::SpecId;
use trin_e2store::{
e2store::types::{Entry, Header as E2StoreHeader},
era::{get_beacon_fork, CompressedSignedBeaconBlock, Era, SLOTS_PER_HISTORICAL_ROOT},
utils::get_era_files,
};
use reqwest::Client;
use revm_primitives::SpecId;
use trin_evm::spec_id::get_spec_block_number;

use super::{
Expand Down
8 changes: 4 additions & 4 deletions bin/trin-execution/src/era/manager.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use std::collections::HashMap;

use anyhow::{bail, ensure};
use e2store::{
era1::Era1,
utils::{get_era1_files, get_era_files, ERA1_FILE_COUNT},
};
use reqwest::{
header::{HeaderMap, HeaderValue, CONTENT_TYPE},
Client,
};
use tokio::task::JoinHandle;
use tracing::info;
use trin_e2store::{
era1::Era1,
utils::{get_era1_files, get_era_files, ERA1_FILE_COUNT},
};

use super::{
binary_search::EraBinarySearch,
Expand Down
8 changes: 4 additions & 4 deletions bin/trin-execution/src/era/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ use std::time::Duration;

use alloy::primitives::bytes::Bytes;
use anyhow::anyhow;
use e2store::{
era::Era,
era1::{BlockTuple, Era1, BLOCK_TUPLE_COUNT},
};
use ethportal_api::BlockBody;
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
use reqwest::Client;
use tokio::time::sleep;
use tracing::{info, warn};
use trin_e2store::{
era::Era,
era1::{BlockTuple, Era1, BLOCK_TUPLE_COUNT},
};

use super::types::ProcessedEra;
use crate::era::{
Expand Down
6 changes: 3 additions & 3 deletions bin/trin-execution/src/subcommands/era2/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ use std::{

use alloy::{consensus::EMPTY_ROOT_HASH, rlp::Decodable};
use anyhow::ensure;
use e2store::era2::{
AccountEntry, AccountOrStorageEntry, Era2Writer, StorageEntry, StorageItem, MAX_STORAGE_ITEMS,
};
use eth_trie::{EthTrie, Trie};
use ethportal_api::{types::state_trie::account_state::AccountState, Header};
use parking_lot::Mutex;
use revm_primitives::{B256, KECCAK_EMPTY, U256};
use tracing::info;
use trin_e2store::era2::{
AccountEntry, AccountOrStorageEntry, Era2Writer, StorageEntry, StorageItem, MAX_STORAGE_ITEMS,
};

use crate::{
cli::ExportStateConfig,
Expand Down
2 changes: 1 addition & 1 deletion bin/trin-execution/src/subcommands/era2/import.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::{path::Path, sync::Arc};

use anyhow::{ensure, Error};
use e2store::era2::{AccountEntry, AccountOrStorageEntry, Era2Reader, StorageItem};
use eth_trie::{EthTrie, Trie};
use ethportal_api::Header;
use revm_primitives::{keccak256, B256, U256};
use tracing::info;
use trin_e2store::era2::{AccountEntry, AccountOrStorageEntry, Era2Reader, StorageItem};

use crate::{
cli::ImportStateConfig,
Expand Down
4 changes: 2 additions & 2 deletions bin/trin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ anyhow.workspace = true
clap.workspace = true
discv5.workspace = true
ethportal-api.workspace = true
portalnet.workspace = true
prometheus_exporter.workspace = true
rpc.workspace = true
tokio.workspace = true
tracing.workspace = true
tree_hash.workspace = true
trin-beacon.workspace = true
trin-history.workspace = true
trin-portalnet.workspace = true
trin-state.workspace = true
trin-storage.workspace = true
trin-rpc.workspace = true
trin-utils.workspace = true
trin-validation.workspace = true
utp-rs.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions bin/trin/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ use ethportal_api::{
},
version::FULL_VERSION,
};
use portalnet::{
use trin_portalnet::{
bootnodes::Bootnodes,
config::{PortalnetConfig, NODE_ADDR_CACHE_CAPACITY},
constants::{
DEFAULT_DISCOVERY_PORT, DEFAULT_NETWORK, DEFAULT_UTP_TRANSFER_LIMIT,
DEFAULT_WEB3_HTTP_ADDRESS, DEFAULT_WEB3_IPC_PATH, DEFAULT_WEB3_WS_PORT,
},
};
use rpc::config::RpcConfig;
use trin_rpc::config::RpcConfig;
use trin_storage::config::StorageCapacityConfig;
use trin_utils::cli::{
check_private_key_length, network_parser, subnetwork_parser, Web3TransportType,
Expand Down Expand Up @@ -977,7 +977,7 @@ mod tests {

mod bootnodes {
use ethportal_api::{types::network::Network, Enr};
use portalnet::bootnodes::Bootnode;
use trin_portalnet::bootnodes::Bootnode;

use super::*;

Expand Down
12 changes: 6 additions & 6 deletions bin/trin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ use cli::TrinConfig;
use ethportal_api::{
types::network::Subnetwork, utils::bytes::hex_encode, version::get_trin_version,
};
use portalnet::{
discovery::{Discovery, Discv5UdpSocket},
events::PortalnetEvents,
utils::db::{configure_node_data_dir, configure_trin_data_dir},
};
use rpc::{launch_jsonrpc_server, RpcServerHandle};
use tokio::sync::{mpsc, RwLock};
use tracing::info;
use tree_hash::TreeHash;
use trin_beacon::initialize_beacon_network;
use trin_history::initialize_history_network;
use trin_portalnet::{
discovery::{Discovery, Discv5UdpSocket},
events::PortalnetEvents,
utils::db::{configure_node_data_dir, configure_trin_data_dir},
};
use trin_rpc::{launch_jsonrpc_server, RpcServerHandle};
use trin_state::initialize_state_network;
use trin_storage::PortalStorageConfigFactory;
#[cfg(windows)]
Expand Down
2 changes: 1 addition & 1 deletion crates/e2store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "e2store"
name = "trin-e2store"
keywords = ["ethereum", "portal-network", "e2store", "era", "era1"]
description = "E2store, era, and era1 implementations for Ethereum"
authors.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/e2store/src/bin/era2-stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::path::PathBuf;
use alloy::primitives::{keccak256, B256};
use anyhow::bail;
use clap::Parser;
use e2store::era2::{self, AccountOrStorageEntry, Era2Reader};
use tracing::info;
use trin_e2store::era2::{self, AccountOrStorageEntry, Era2Reader};

#[derive(Debug, Parser)]
#[command(
Expand Down
4 changes: 2 additions & 2 deletions crates/light-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "light-client"
name = "trin-light-client"
description = "Beacon chain light client implementation"
authors.workspace = true
categories.workspace = true
Expand All @@ -23,7 +23,6 @@ hex.workspace = true
jsonrpsee = { workspace = true, features = ["full"] }
log = "0.4.17"
milagro_bls = { package="snowbridge-milagro-bls", git = "https://github.com/Snowfork/milagro_bls" }
portalnet.workspace = true
reqwest.workspace = true
serde.workspace = true
serde-this-or-that.workspace = true
Expand All @@ -36,6 +35,7 @@ thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
trin-portalnet.workspace = true
tree_hash.workspace = true

[lib]
Expand Down
2 changes: 1 addition & 1 deletion crates/light-client/src/consensus/rpc/portal_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use ethportal_api::{
LightClientUpdatesByRangeKey,
};
use futures::channel::oneshot;
use portalnet::overlay::command::OverlayCommand;
use tokio::sync::mpsc::UnboundedSender;
use tracing::warn;
use trin_portalnet::overlay::command::OverlayCommand;

use crate::consensus::rpc::ConsensusRpc;

Expand Down
2 changes: 1 addition & 1 deletion crates/portalnet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "portalnet"
name = "trin-portalnet"
description = "Core library for Trin."
authors.workspace = true
categories.workspace = true
Expand Down
10 changes: 5 additions & 5 deletions crates/portalnet/tests/overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ use ethportal_api::{
OverlayContentKey,
};
use parking_lot::RwLock;
use portalnet::{
use tokio::{
sync::{mpsc, mpsc::unbounded_channel, RwLock as TokioRwLock},
time::{self, Duration},
};
use trin_portalnet::{
config::PortalnetConfig,
discovery::{Discovery, Discv5UdpSocket},
overlay::{
config::{FindContentConfig, OverlayConfig},
protocol::OverlayProtocol,
},
};
use tokio::{
sync::{mpsc, mpsc::unbounded_channel, RwLock as TokioRwLock},
time::{self, Duration},
};
use trin_storage::{ContentStore, DistanceFunction, MemoryContentStore};
use trin_validation::{oracle::HeaderOracle, validator::MockValidator};
use utp_rs::socket::UtpSocket;
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "rpc"
name = "trin-rpc"
description = "Implementations of jsonrpsee server API traits for Trin and server interface"
authors.workspace = true
categories.workspace = true
Expand All @@ -17,7 +17,6 @@ discv5.workspace = true
eth_trie.workspace = true
ethportal-api.workspace = true
http = "1.1.0"
portalnet.workspace = true
reth-ipc.workspace = true
revm.workspace = true
serde.workspace = true
Expand All @@ -29,5 +28,6 @@ tower = { version = "0.4.13", features = ["full"] }
tower-http = { version = "0.5.0", features = ["full"] }
tracing.workspace = true
trin-evm.workspace = true
trin-portalnet.workspace = true
trin-utils.workspace = true
trin-validation.workspace = true
2 changes: 1 addition & 1 deletion crates/rpc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use ethportal_api::{
BeaconNetworkApiServer, Discv5ApiServer, EthApiServer, HistoryNetworkApiServer,
StateNetworkApiServer, Web3ApiServer,
};
use portalnet::discovery::Discovery;
use serde::Deserialize;
use strum::{AsRefStr, EnumString, VariantNames};
use tokio::sync::mpsc;
use trin_portalnet::discovery::Discovery;

use crate::{
errors::{RpcError, WsHttpSamePortError},
Expand Down
Loading