-
Notifications
You must be signed in to change notification settings - Fork 1k
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
PeerDAS: Stop generating new P2P private key at start. #14099
Conversation
beacon-chain/p2p/utils.go
Outdated
@@ -93,7 +95,7 @@ func privKey(cfg *Config) (*ecdsa.PrivateKey, error) { | |||
return nil, err | |||
} | |||
|
|||
log.Info("Wrote network key to file") | |||
log.WithField("file", defaultKeyPath).Info("Wrote network key to") |
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 log looks a little funny since it isn't really a complete sentence. It looks a bit better like this
log.WithField("file", defaultKeyPath).Info("Wrote network key to") | |
log.WithField("filepath", defaultKeyPath).Info("Wrote network key to file.") |
For comparison:
INFO[0000] Wrote network key to file=path/to/default/key
vs
INFO[0000] Wrote network key to file. filepath=path/to/default/key
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.
My initial intent was to avoid having two times the word file
.
Let me propose an alternative!
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.
Fixed in 1d08139.
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.
LGTM
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
* `privKey`: Improve logs. * peerDAS: Move functions in file. Add documentation. * PeerDAS: Remove unused `ComputeExtendedMatrix` and `RecoverMatrix` functions. * PeerDAS: Stop generating new P2P private key at start. * Fix sammy' comment.
https://hackmd.io/@6-HLeMXARN2tdFLKKcqrxw/BJVSxU7VC
Please read commit by commit.
s = 128
and 4 custody subnets, there is10,668,000
possible subnets combinations.128! / (4! * (128 - 4)!)
As a result, if a node changes its Node ID (for anonymity) but keeps the same subnets combination, it is very easy to notice that it is actually the same node.
==> Regardless of the computational difficulty to generate a pseudo-deterministic node ID, when peerDAS is activated, we stop rotating the P2P private key at every reboot.
Replace #14098