Skip to content

Conversation

@0xKarl98
Copy link
Contributor

This targets on issue #19805 , since eip-7542 has been withdrawn , this PR is implementing eip-7975 .

Scope of this PR:

  • focus on server‑side eth/70 support and basic compatibility only; full client‑side eth/70 pagination and the EIP‑7975 safety checks for partial receipt downloads (using lastBlockIncomplete and transaction/gas‑limit constraints) are explicitly left for follow‑up PRs.

cc @mattsse

Comment on lines 29 to 30
/// The request id used to correlate the response.
pub request_id: u64,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need this here because the request id is tracked in

pub struct RequestPair<T> {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can exclude all of this for this pr?

EthMessageID::GetReceipts => EthMessage::GetReceipts(RequestPair::decode(buf)?),
EthMessageID::GetReceipts => {
if version >= EthVersion::Eth70 {
EthMessage::GetReceipts70(GetReceipts70::decode(buf)?)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also use RequestPair

Comment on lines +31 to +34
/// Index into the receipts of the first requested block hash.
pub first_block_receipt_index: u64,
/// The block hashes to request receipts for.
pub block_hashes: Vec<B256>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then we need to adjust rlp encoding of this type so that this becomes:

firstBlockReceiptIndex: P, [blockhash₁: B_32, blockhash₂: B_32, ...]

and not

[firstBlockReceiptIndex: P, [blockhash₁: B_32, blockhash₂: B_32, ...]]]

like it would with the macro

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes we can also undo

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Dec 10, 2025
@0xKarl98 0xKarl98 marked this pull request as draft December 10, 2025 14:43
@0xKarl98 0xKarl98 marked this pull request as ready for review December 11, 2025 03:56
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool,

we can simplify a lot of things here, basically the session shouldnt have to deal with any response manipulation

this has some additional changes for the withdrawn eip that we can fully exclude from this pr


/// `StatusMessage` can store either the Legacy version (with TD) or the
/// eth/69 version (omits TD).
/// Status message for `eth/70` including the block range as per EIP-7975.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need this anymore, right? so we can undo all status changes I believe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah forgot to change the comment here

///
/// Note: The eth/70 encoding for `Receipts` in EIP-7975 inlines the
/// request id instead of using a generic [`RequestPair`].
Receipts70(Receipts70<N::Receipt>),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also use RequestPair and we can implement encode manually for Receipts70

Copy link
Contributor Author

@0xKarl98 0xKarl98 Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have used RequestPair here , but the comment isn't clear , i.e. :
pub type Receipts70<T = Receipt> = crate::message::RequestPair<Receipts70Payload>;

Will make others misunderstood that we don't use RequestPair here but i wil simplify it

Comment on lines 140 to 141
/// The last time we updated the remote block range information.
pub(crate) last_range_update: Option<Instant>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isnt needed for this pr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have removed them

request_id,
rx: PeerResponse::$resp_item { response },
received: Instant::now(),
metadata: ReceivedRequestMetadata::None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can assume that we handle the request properly internally so we dont need to track this here

Comment on lines 466 to 482
fn handle_outgoing_response(
&mut self,
id: u64,
metadata: ReceivedRequestMetadata,
resp: PeerResponseResult<N>,
) {
let msg_result = match metadata {
ReceivedRequestMetadata::Eth70Receipts { first_block_receipt_index } => {
// For eth/70 GetReceipts requests we construct a `Receipts70`
// message that respects `firstBlockReceiptIndex` but still
// reuses the existing receipts lookup path.
self.build_eth70_receipts_response(id, first_block_receipt_index, resp)
}
ReceivedRequestMetadata::None => resp.try_into_message(id),
};

match msg_result {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this we dont need to change, we can instead introduce another variant for this so we can handle the v70 request internally properly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

Comment on lines 500 to 505
fn build_eth70_receipts_response(
&self,
id: u64,
first_block_receipt_index: u64,
resp: PeerResponseResult<N>,
) -> RequestResult<EthMessage<N>> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this we can undo, this should be handled where we process the request

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suspect so , but thanks for the confirm

@mattsse mattsse added the A-networking Related to networking in general label Dec 11, 2025
@0xKarl98 0xKarl98 marked this pull request as draft December 11, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-networking Related to networking in general

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants