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

Sanitise eth68 announcement #6222

Merged
merged 41 commits into from
Jan 31, 2024
Merged

Sanitise eth68 announcement #6222

merged 41 commits into from
Jan 31, 2024

Conversation

emhane
Copy link
Member

@emhane emhane commented Jan 24, 2024

adds validation checks in tx fetcher for NewPooledTransactions68

  • empty announcement
  • invalid tx type, doesn't convert to type TxType
  • invalid tx size, zero or bigger than constant MAX_TX_SIZE
  • duplicate hash

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.

This mixes rlp and validation.

this is a lot of added complexity based on size assumptions.

what's the benefit this gives us?

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
@mattsse
Copy link
Collaborator

mattsse commented Jan 24, 2024

perhaps this would be more appropriate as a configurable setting inside the Transactionmanager/fetcher?

@emhane emhane force-pushed the emhane/sanitise-eth68-announcement branch from f8fa2d3 to ca622e8 Compare January 25, 2024 17:35
@emhane emhane requested a review from mattsse January 25, 2024 17:37
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.

this is very easy to follow.

now we need some good thresholds

crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/primitives/src/transaction/tx_type.rs Outdated Show resolved Hide resolved
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.

only a few remaining nits

crates/net/network/src/peers/reputation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/fetcher.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/primitives/src/transaction/tx_type.rs Show resolved Hide resolved
crates/primitives/src/transaction/tx_type.rs Show resolved Hide resolved
crates/primitives/src/transaction/tx_type.rs Outdated Show resolved Hide resolved
@mattsse mattsse added the A-networking Related to networking in general label Jan 27, 2024
@emhane emhane requested a review from mattsse January 29, 2024 20:47
crates/net/eth-wire/src/types/broadcast.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/mod.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
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 this trait a lot!

last nit re upper bound, then send it

crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
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.

pending @Rjected an suggestion for removing entries

crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

LGTM, pending the nitpick comments I left, I like the validation trait!

crates/net/network/src/peers/reputation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
crates/net/network/src/transactions/validation.rs Outdated Show resolved Hide resolved
@emhane emhane enabled auto-merge January 31, 2024 12:37
@emhane emhane added this pull request to the merge queue Jan 31, 2024
Merged via the queue into main with commit 34cda3a Jan 31, 2024
29 checks passed
@emhane emhane deleted the emhane/sanitise-eth68-announcement branch January 31, 2024 13:33
@rswanson rswanson mentioned this pull request Feb 9, 2024
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.

5 participants