-
Notifications
You must be signed in to change notification settings - Fork 945
eth, cmd: add RollupNetrestrictTxPoolGossipFlag and RollupTxPoolTrustedPeersOnlyFlag #706
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
base: optimism
Are you sure you want to change the base?
Conversation
|
We may update the forkdiff(https://github.com/ethereum-optimism/op-geth/blob/optimism/fork.yaml) to track the geth diff. |
e06f64a to
e3042c2
Compare
pcw109550
left a comment
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.
This only takes care of outbound connections. To truly restrict tx gossiping, we must also prohibit inbound connections from disallowed peers. In other words, external peers' transactions must not be gossiped in to the node.
We may need to explore other control flows that may create outbound connections for tx gossiping.
|
Worth to mention that the new flag will be the same information restriction level with |
edf0d1e to
2e01ede
Compare
|
I have written the PoC code based on this, at #713, using txpool to not manually short circuit tx gossiping. |
|
Thanks @pcw109550 , returning a |
0ca4903 to
09c3616
Compare
|
Change-set here is pretty trivial, but we nevertheless validated it with a test at ethereum-optimism/optimism#18072 . Adding an acceptance test on I added a unit test for TxGossipNetRestrict. |
|
And as discussed in Slack, we also want to restrict receiving & accepting incoming tx gossip. @nonsense |
a71fe51 to
b87d4c4
Compare
b87d4c4 to
0e113cf
Compare
…outgoing message.
efe2aa7 to
66ef6ac
Compare
This PR is:
1 . Adding a
rollup.netrestricttxpoolgossipstringflag, so that the node gossips and accepts gossips of transactions only to a restricted set, if one is specified.2. Adding a
rollup.txpooltrustedpeersonlyboolflag, so that the node gossips and accepts gossips of transactions only to and from its trusted peers.If none of the flags is specified, no peers are filtered, i.e. gossiping works for all peers.
RollupNetrestrictTxPoolGossipFlagflagRollupTxPoolTrustedPeersOnlyFlagflagTxPool(peer)inBackendto return an actual transaction pool orniltransaction pool, depending if filtering is enabled with a given flag.TxPool(peer)also returns if the peer is allowed for gossiping (used for short-circuiting incoming messages, so that they get dropped)Related: ethereum-optimism/optimism#17751
Fixes: #717
op-devstacktest: ethereum-optimism/optimism#18072