-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
A-networkingRelated to networking in generalRelated to networking in generalC-enhancementNew feature or requestNew feature or requestD-good-first-issueNice and easy! A great choice to get startedNice and easy! A great choice to get started
Description
Describe the feature
Only tracing is done but the TODO
still need to be done because the current implementation is not punishing the malicious peer for sending unwanted hashes.
reth/crates/net/network/src/transactions/fetcher.rs
Lines 898 to 906 in 7272b21
if verification_outcome == VerificationOutcome::ReportPeer { | |
// todo: report peer for sending hashes that weren't requested | |
trace!(target: "net::tx", | |
peer_id=format!("{peer_id:#}"), | |
unverified_len, | |
verified_payload_len=verified_payload.len(), | |
"received `PooledTransactions` response from peer with entries that didn't verify against request, filtered out transactions" | |
); | |
} |
I think it could be good to proceed in a similar way as (with a boolean and reporting at the end of the function):
reth/crates/net/network/src/transactions/mod.rs
Lines 1332 to 1344 in 7272b21
let tx = match tx.try_into_recovered() { | |
Ok(tx) => tx, | |
Err(badtx) => { | |
trace!(target: "net::tx", | |
peer_id=format!("{peer_id:#}"), | |
hash=%badtx.tx_hash(), | |
client_version=%peer.client_version, | |
"failed ecrecovery for transaction" | |
); | |
has_bad_transactions = true; | |
continue | |
} | |
}; |
reth/crates/net/network/src/transactions/mod.rs
Lines 1413 to 1416 in 7272b21
if has_bad_transactions { | |
// peer sent us invalid transactions | |
self.report_peer_bad_transactions(peer_id) | |
} |
Additional context
No response
mattsse
Metadata
Metadata
Assignees
Labels
A-networkingRelated to networking in generalRelated to networking in generalC-enhancementNew feature or requestNew feature or requestD-good-first-issueNice and easy! A great choice to get startedNice and easy! A great choice to get started
Type
Projects
Status
Backlog