-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add Chainid to p2p filter #355
base: main
Are you sure you want to change the base?
Conversation
|
||
// clear pstore from DB if the version is not match | ||
// the DB path is set by p2p.peerstore.path flag, and the default value is esnode_peerstore_db | ||
go func() { |
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.
What is the purpose of this function, and in what scenarios would we need to increase the p2pversion?
Is there a note that outlines what boot node and full node operators should do for the beta testnet if they take this PR? Additionally, should we update our runL2.sh script to include the new ENR? |
Issue:
Currently, we use l1.chain_id to filter ENR in the discovery UDPv5 table, which cannot filter out the es-node ENR that has been connected before. Also, the run*.sh does not set the l1.chain_id, and the es-node will use 1 as the default value.
So now, we only use the contract address as a filter in the SyncClient.AddPeer filters out es-nodes that do not belong to the same network. However, when we change SWC from Alpha to Beta, the contract address will not change. So, Alpha and Beta es-node networks will join together if any Beta es-node does not clear its discovery DB (esnode_discovery_db) before it starts.
How to fix:
Note: After this change, the Bootnode ENR will be changed, so all the es-nodes in the network need to sync to the latest code and restart.
How to test:
with
this chain ID change + es-nodewith
this chain ID change should connect and sync.with
this chain ID change + es-nodewithout
this chain ID change should not connect and sync.without
this chain ID change + es-nodewith
this chain ID change should not connect and sync.switch
to this chain ID change without clear esnode_discovery_db and esnode_peerstore_db, es-nodewithout
this chain ID change should not connect and sync.switch
to this chain ID change without clear esnode_discovery_db and esnode_peerstore_db, it shouldconnect to bootnode
with
this chain ID change and it should not connect to bootnodewithout
this chain ID change.