Skip to content
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

Verify tx response data against request #6439

Merged
merged 48 commits into from
Feb 27, 2024
Merged

Conversation

emhane
Copy link
Member

@emhane emhane commented Feb 6, 2024

Closes #6438, closes #6396

@emhane emhane marked this pull request as draft February 6, 2024 06:57
Base automatically changed from emhane/speed-up-request-buffered-hashes to main February 13, 2024 19:08
@emhane emhane added the A-networking Related to networking in general label Feb 17, 2024
@emhane emhane marked this pull request as ready for review February 18, 2024 02:02
@emhane emhane requested a review from gakonst as a code owner February 18, 2024 02:02
@emhane emhane requested a review from rkrasiuk February 18, 2024 13:34
crates/net/eth-wire/src/types/transactions.rs Outdated Show resolved Hide resolved
crates/net/eth-wire/src/types/broadcast.rs Outdated Show resolved Hide resolved
crates/net/eth-wire/src/types/broadcast.rs Outdated Show resolved Hide resolved
crates/net/eth-wire/src/types/broadcast.rs Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/eth-wire/src/types/broadcast.rs Outdated Show resolved Hide resolved
crates/net/eth-wire/src/types/broadcast.rs Show resolved Hide resolved
crates/net/eth-wire/src/types/broadcast.rs Outdated Show resolved Hide resolved
@emhane emhane requested a review from mattsse February 18, 2024 14:46
@emhane emhane closed this Feb 22, 2024
@emhane emhane reopened this Feb 22, 2024
@emhane emhane force-pushed the emhane/one-req-per-peer-bottleneck branch from 573f333 to 358f3ac Compare February 22, 2024 19:10
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.

I like the new traits and types because they make this process easier to reason about.

left some suggestions for reducing a few allocs that I think we don't need/can live without.

crates/net/eth-wire/src/types/broadcast.rs Outdated Show resolved Hide resolved
crates/net/eth-wire/src/types/broadcast.rs Outdated Show resolved Hide resolved
@emhane emhane requested a review from mattsse February 26, 2024 22:52
@emhane emhane changed the base branch from emhane/one-req-per-peer-bottleneck to main February 26, 2024 22:53
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.

lgtm

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

smallest nit and a question, feel free to ignore the nits

crates/net/eth-wire/src/types/broadcast.rs Outdated Show resolved Hide resolved

let unvalidated_payload_len = verified_payload.len();

// todo: report peer for sending invalid response
Copy link
Member

Choose a reason for hiding this comment

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

is this for a follow up?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah exactly can add which issues it depends on

@@ -972,6 +983,8 @@ where
return
}

let mut transactions = transactions.0;
Copy link
Member

Choose a reason for hiding this comment

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

Should we impl deref etc on PooledTransactions?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah sure, Deref is always safe, DerefMut you have to be sure this doesn't effect existing behaviour. usually only do it on my own new types cause of this.

Copy link
Member Author

Choose a reason for hiding this comment

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

anyhow, out of scope of pr I think

crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
emhane and others added 4 commits February 27, 2024 17:52
Co-authored-by: Oliver Nordbjerg <[email protected]>
Co-authored-by: Oliver Nordbjerg <[email protected]>
@emhane emhane added this pull request to the merge queue Feb 27, 2024
Merged via the queue into main with commit 0007c9a Feb 27, 2024
30 checks passed
@emhane emhane deleted the emhane/validate-tx-response branch February 27, 2024 17:19
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
None yet
Development

Successfully merging this pull request may close these issues.

Verify PooledTransactions response against GetPooleTransactions Divide validation into two passes
3 participants