-
Notifications
You must be signed in to change notification settings - Fork 131
feat(l2): reject privileged transactions in p2p messages #5086
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds rejection logic for privileged L2 transactions when operating in L2 mode, preventing these transactions from being broadcasted through the peer-to-peer network.
- Added validation to reject privileged L2 transactions in L2 mode alongside existing blob transaction rejections
- Updated debug messages to provide clearer information about rejected transaction types
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/networking/p2p/rlpx/eth/transactions.rs | Added check to reject privileged L2 transactions in pooled transactions handler |
| crates/networking/p2p/rlpx/connection/server.rs | Expanded transaction rejection logic to include privileged L2 transactions and improved debug message formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| debug!( | ||
| peer=%node, | ||
| "Rejecting privileged L2 transaction in L2 mode - privileged L2 transactions are not broadcasted", |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is inconsistent with the one in server.rs (line 941). Consider using a similar pattern by extracting the transaction type to make messages consistent: let tx_type = tx.tx_type(); debug!(peer=%node, \"Rejecting transaction in L2 mode - {tx_type} transactions are not broadcasted in L2\");
| debug!( | |
| peer=%node, | |
| "Rejecting privileged L2 transaction in L2 mode - privileged L2 transactions are not broadcasted", | |
| let tx_type = tx.tx_type(); | |
| debug!( | |
| peer=%node, | |
| "Rejecting transaction in L2 mode - {tx_type} transactions are not broadcasted in L2", |
Lines of code reportTotal lines added: Detailed view |
| EIP1559Transaction(EIP1559Transaction), | ||
| EIP4844TransactionWithBlobs(WrappedEIP4844Transaction), | ||
| EIP7702Transaction(EIP7702Transaction), | ||
| PrivilegedL2Transaction(PrivilegedL2Transaction), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably document this change somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 63675e2
Motivation
We don't want to broadcast Privileged transactions between peers as every lead sequencer can get them through the OnChainProposer contract and look for the logs.
Description
The P2P messages that broadcast transactions are:
Transactionsmatches!(..)to deny themNewPooledTransactionHashesGetPooledTransactionsget_p2p_transaction_by_hashPooledTransactions: the response form theGetPooledTransactionsmatches!(..)inside the handle method to reject adding them to the mempool