Skip to content

Commit

Permalink
fix(verkle): remove duplicate Verkle definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
morph-dev committed Jun 19, 2024
1 parent 37f11e8 commit 786c7e2
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 17 deletions.
3 changes: 0 additions & 3 deletions ethportal-api/src/types/portal_wire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ pub enum ProtocolId {
History,
TransactionGossip,
CanonicalIndices,
Verkle,
Beacon,
Utp,
}
Expand Down Expand Up @@ -247,7 +246,6 @@ impl fmt::Display for ProtocolId {
ProtocolId::History => "History",
ProtocolId::TransactionGossip => "Transaction Gossip",
ProtocolId::CanonicalIndices => "Canonical Indices",
ProtocolId::Verkle => "Verkle",
ProtocolId::Beacon => "Beacon",
ProtocolId::Utp => "uTP",
};
Expand All @@ -263,7 +261,6 @@ impl From<ProtocolId> for u8 {
ProtocolId::History => 0,
ProtocolId::TransactionGossip => 3,
ProtocolId::CanonicalIndices => 4,
ProtocolId::Verkle => 5,
ProtocolId::Beacon => 1,
ProtocolId::Utp => 99,
}
Expand Down
6 changes: 3 additions & 3 deletions portalnet/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl PortalnetEvents {
request.into(),
"state",
),
ProtocolId::Verkle => self.send_overlay_request(
ProtocolId::VerkleState => self.send_overlay_request(
self.verkle_handle.tx.as_ref(),
request.into(),
"verkle",
Expand Down Expand Up @@ -185,7 +185,7 @@ impl PortalnetEvents {
ProtocolId::History,
ProtocolId::Beacon,
ProtocolId::State,
ProtocolId::Verkle,
ProtocolId::VerkleState,
];
let mut recipients = event
.destination
Expand All @@ -209,7 +209,7 @@ impl PortalnetEvents {
if recipients.contains(&ProtocolId::State) {
self.send_overlay_request(self.state_handle.tx.as_ref(), Event(event.clone()), "state");
}
if recipients.contains(&ProtocolId::Verkle) {
if recipients.contains(&ProtocolId::VerkleState) {
self.send_overlay_request(
self.verkle_handle.tx.as_ref(),
Event(event.clone()),
Expand Down
6 changes: 3 additions & 3 deletions rpc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ pub enum PortalRpcModule {
History,
/// `state` module
State,
/// 'verkle' module
Verkle,
/// 'verkle_state' module
VerkleState,
/// `web3_` module
Web3,
}
Expand Down Expand Up @@ -456,7 +456,7 @@ impl RpcModuleBuilder {
.expect("State protocol not initialized");
StateNetworkApi::new(state_tx).into_rpc().into()
}
PortalRpcModule::Verkle => {
PortalRpcModule::VerkleState => {
let verkle_tx = self
.verkle_tx
.clone()
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub async fn launch_jsonrpc_server(
modules.push(PortalRpcModule::Eth);
}
STATE_NETWORK => modules.push(PortalRpcModule::State),
VERKLE_NETWORK => modules.push(PortalRpcModule::Verkle),
VERKLE_NETWORK => modules.push(PortalRpcModule::VerkleState),
BEACON_NETWORK => modules.push(PortalRpcModule::Beacon),
_ => panic!("Unexpected network type: {network}"),
}
Expand Down
3 changes: 0 additions & 3 deletions trin-metrics/src/labels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ impl From<ProtocolLabel> for MetricLabel {
ProtocolLabel::History => "history",
ProtocolLabel::TransactionGossip => "transaction_gossip",
ProtocolLabel::CanonicalIndices => "canonical_indices",
ProtocolLabel::Verkle => "verkle",
ProtocolLabel::Beacon => "beacon",
ProtocolLabel::Utp => "utp",
}
Expand Down Expand Up @@ -94,7 +93,6 @@ pub enum ProtocolLabel {
History,
TransactionGossip,
CanonicalIndices,
Verkle,
Beacon,
Utp,
}
Expand Down Expand Up @@ -128,7 +126,6 @@ impl From<&ProtocolId> for ProtocolLabel {
ProtocolId::History => Self::History,
ProtocolId::TransactionGossip => Self::TransactionGossip,
ProtocolId::CanonicalIndices => Self::CanonicalIndices,
ProtocolId::Verkle => Self::Verkle,
ProtocolId::Beacon => Self::Beacon,
ProtocolId::Utp => Self::Utp,
}
Expand Down
2 changes: 1 addition & 1 deletion trin-storage/src/versioned/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub use utils::create_store;
pub enum ContentType {
History,
State,
Verkle,
VerkleState,
}

/// The version of the store. There should be exactly one implementation of the
Expand Down
2 changes: 1 addition & 1 deletion trin-verkle/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl VerkleNetwork {
discovery,
utp_socket,
storage,
ProtocolId::Verkle,
ProtocolId::VerkleState,
validator,
)
.await;
Expand Down
5 changes: 3 additions & 2 deletions trin-verkle/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ impl ContentStore for VerkleStorage {
impl VerkleStorage {
pub fn new(config: PortalStorageConfig) -> Result<Self, ContentStoreError> {
let sql_connection_pool = config.sql_connection_pool.clone();
let config = IdIndexedV1StoreConfig::new(ContentType::Verkle, ProtocolId::Verkle, config);
let config =
IdIndexedV1StoreConfig::new(ContentType::VerkleState, ProtocolId::VerkleState, config);
Ok(Self {
store: create_store(ContentType::Verkle, config, sql_connection_pool)?,
store: create_store(ContentType::VerkleState, config, sql_connection_pool)?,
})
}

Expand Down

0 comments on commit 786c7e2

Please sign in to comment.