Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7856d25
Add eth/70 protocol support and block range messaging
0xKarl98 Dec 5, 2025
70480ac
add comments
0xKarl98 Dec 5, 2025
3b129f5
fix tests
0xKarl98 Dec 5, 2025
13e9c00
touchups
0xKarl98 Dec 5, 2025
14453cc
add more comments to undertsand precisely
0xKarl98 Dec 5, 2025
dd7a10b
cargo fmt
0xKarl98 Dec 5, 2025
90492aa
keep eth/69 once enable full support
0xKarl98 Dec 6, 2025
63ac93a
instantiate based on message variant
0xKarl98 Dec 6, 2025
0d38ba9
optimize instant related code and remove test for now
0xKarl98 Dec 6, 2025
04824d3
cargo fmt
0xKarl98 Dec 6, 2025
f49b954
Throttle range requests using interval ticks
0xKarl98 Dec 6, 2025
c68bd50
simplify maybe_request_block_range and add comments
0xKarl98 Dec 6, 2025
19bdc02
chore: rerun CI
0xKarl98 Dec 7, 2025
39c725e
add eth/70 GetReceipts/Receipts message types and session wiring
0xKarl98 Dec 9, 2025
3e4e764
fix cargo doc
0xKarl98 Dec 9, 2025
b5ccdb8
remove unused import
0xKarl98 Dec 9, 2025
3b67d78
Add server-side support for eth/70 receipts pagination
0xKarl98 Dec 10, 2025
6d364b1
Reuse Receipts69 bloom helper for Receipts70
0xKarl98 Dec 10, 2025
2c70f51
remove block-range
0xKarl98 Dec 10, 2025
b7b3f32
address mattse suggestions
0xKarl98 Dec 11, 2025
d44a500
remove eth/70 block_range
0xKarl98 Dec 11, 2025
3f2f5ba
fix cargo doc
0xKarl98 Dec 11, 2025
c6628ae
fix test error
0xKarl98 Dec 11, 2025
f257508
remove unnessary last_range_update
0xKarl98 Dec 11, 2025
0b4d697
add manual encode for Receipts70
0xKarl98 Dec 11, 2025
d242059
apply mattese suggestions
0xKarl98 Dec 11, 2025
26db968
remove blockRangeUpdate from eth/70
0xKarl98 Dec 11, 2025
04d22f6
share eth/69 status with eth/70
0xKarl98 Dec 11, 2025
ed093cd
clean up
0xKarl98 Dec 11, 2025
35d214f
fix clippy
0xKarl98 Dec 11, 2025
b6d0e04
cargo fmt
0xKarl98 Dec 11, 2025
72bfdfe
remove unnessary macro
0xKarl98 Dec 11, 2025
fc8931c
remove unnessary macro
0xKarl98 Dec 11, 2025
5db0e51
restore max
0xKarl98 Dec 11, 2025
fd3b778
restore unnessary comment change
0xKarl98 Dec 11, 2025
6a4e5eb
remove unnessary import
0xKarl98 Dec 11, 2025
912ce28
cargo fmt
0xKarl98 Dec 11, 2025
3ab7774
restore unnessary session changes
0xKarl98 Dec 11, 2025
1af8a03
Delegating constraints to the method level
0xKarl98 Dec 12, 2025
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
2 changes: 1 addition & 1 deletion crates/net/eth-wire-types/src/broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl NewPooledTransactionHashes {
matches!(version, EthVersion::Eth67 | EthVersion::Eth66)
}
Self::Eth68(_) => {
matches!(version, EthVersion::Eth68 | EthVersion::Eth69)
matches!(version, EthVersion::Eth68 | EthVersion::Eth69 | EthVersion::Eth70)
}
}
}
Expand Down
50 changes: 47 additions & 3 deletions crates/net/eth-wire-types/src/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ impl Capability {
Self::eth(EthVersion::Eth68)
}

/// Returns the [`EthVersion::Eth69`] capability.
pub const fn eth_69() -> Self {
Self::eth(EthVersion::Eth69)
}

/// Returns the [`EthVersion::Eth70`] capability.
pub const fn eth_70() -> Self {
Self::eth(EthVersion::Eth70)
}

/// Whether this is eth v66 protocol.
#[inline]
pub fn is_eth_v66(&self) -> bool {
Expand All @@ -118,10 +128,26 @@ impl Capability {
self.name == "eth" && self.version == 68
}

/// Whether this is eth v69.
#[inline]
pub fn is_eth_v69(&self) -> bool {
self.name == "eth" && self.version == 69
}

/// Whether this is eth v70.
#[inline]
pub fn is_eth_v70(&self) -> bool {
self.name == "eth" && self.version == 70
}

/// Whether this is any eth version.
#[inline]
pub fn is_eth(&self) -> bool {
self.is_eth_v66() || self.is_eth_v67() || self.is_eth_v68()
self.is_eth_v66() ||
self.is_eth_v67() ||
self.is_eth_v68() ||
self.is_eth_v69() ||
self.is_eth_v70()
}
}

Expand All @@ -141,7 +167,7 @@ impl From<EthVersion> for Capability {
#[cfg(any(test, feature = "arbitrary"))]
impl<'a> arbitrary::Arbitrary<'a> for Capability {
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
let version = u.int_in_range(66..=69)?; // Valid eth protocol versions are 66-69
let version = u.int_in_range(66..=70)?; // Valid eth protocol versions are 66-70
// Only generate valid eth protocol name for now since it's the only supported protocol
Ok(Self::new_static("eth", version))
}
Expand All @@ -155,6 +181,8 @@ pub struct Capabilities {
eth_66: bool,
eth_67: bool,
eth_68: bool,
eth_69: bool,
eth_70: bool,
}

impl Capabilities {
Expand All @@ -164,6 +192,8 @@ impl Capabilities {
eth_66: value.iter().any(Capability::is_eth_v66),
eth_67: value.iter().any(Capability::is_eth_v67),
eth_68: value.iter().any(Capability::is_eth_v68),
eth_69: value.iter().any(Capability::is_eth_v69),
eth_70: value.iter().any(Capability::is_eth_v70),
inner: value,
}
}
Expand All @@ -182,7 +212,7 @@ impl Capabilities {
/// Whether the peer supports `eth` sub-protocol.
#[inline]
pub const fn supports_eth(&self) -> bool {
self.eth_68 || self.eth_67 || self.eth_66
self.eth_70 || self.eth_69 || self.eth_68 || self.eth_67 || self.eth_66
}

/// Whether this peer supports eth v66 protocol.
Expand All @@ -202,6 +232,18 @@ impl Capabilities {
pub const fn supports_eth_v68(&self) -> bool {
self.eth_68
}

/// Whether this peer supports eth v69 protocol.
#[inline]
pub const fn supports_eth_v69(&self) -> bool {
self.eth_69
}

/// Whether this peer supports eth v70 protocol.
#[inline]
pub const fn supports_eth_v70(&self) -> bool {
self.eth_70
}
}

impl From<Vec<Capability>> for Capabilities {
Expand All @@ -224,6 +266,8 @@ impl Decodable for Capabilities {
eth_66: inner.iter().any(Capability::is_eth_v66),
eth_67: inner.iter().any(Capability::is_eth_v67),
eth_68: inner.iter().any(Capability::is_eth_v68),
eth_69: inner.iter().any(Capability::is_eth_v69),
eth_70: inner.iter().any(Capability::is_eth_v70),
inner,
})
}
Expand Down
2 changes: 1 addition & 1 deletion crates/net/eth-wire-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
extern crate alloc;

mod status;
pub use status::{Status, StatusBuilder, StatusEth69, StatusMessage, UnifiedStatus};
pub use status::{Status, StatusBuilder, StatusEth69, StatusEth70, StatusMessage, UnifiedStatus};

pub mod version;
pub use version::{EthVersion, ProtocolVersion};
Expand Down
Loading
Loading