-
Notifications
You must be signed in to change notification settings - Fork 219
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
feat!: add custom noise prologue to comms nodes #6502
feat!: add custom noise prologue to comms nodes #6502
Conversation
Added a custom noise prologue to the noise protocol to be hashed in to the handshake hash value. This enables an application to specify a unique identifier like the genesis block hash as the noise prologue, effectively stopping any communication handshake to succeed with nodes that is not on the same genesis block.
Test Results (CI) 3 files 126 suites 38m 55s ⏱️ Results for commit 3d77336. ♻️ This comment has been updated with latest results. |
Test Results (Integration tests) 2 files + 2 11 suites +11 25m 56s ⏱️ + 25m 56s For more details on these failures, see this check. Results for commit 3d77336. ± Comparison against base commit e734269. ♻️ This comment has been updated with latest results. |
Would this handle the case of an intentional chain fork that uses the same genesis block? |
Yes. |
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.
utACK
f5207ed
to
66a0571
Compare
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.
utACK
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.
I am very much against the idea of using the gen block in the handshake. We have the wire mode, we can use that to stop wallets and base nodes to not talk to each other on different networks. This seems like an over engineered solution to a problem we already have a solution to.
BUT
My biggest issue is this. When we launch mainnet, we need to be able to compile the wallets ahead of time. Especially mobile wallets that need a minimum of 3 days lead time to go through app approval process. If we merge this pr, we will launch without any mobile wallets for 3 days.
One option could be to do something akin to Zcash's branch IDs, which are an opt-in way for intentional chain forks to offer replay protection, and which was also proposed for handshake binding. Forks simply choose an arbitrary but globally-unique brand ID, which is bound to transactions for replay protection, and which can be bound to the handshake for peer interaction. |
I am busy changing the PR to be activated by consensus, espescially for mainnet. It will start with a default block hash, and then at any later date, it will be replaced by the actual block hash. Consensus (as |
Description --- Added network wire byte. This is now independent of the network as byte. Note: This method in favour of #6502. Motivation and Context --- Base nodes and wallets maintained numerous connections from which they could not sync or obtain useful information. This caused base nodes to try and follow other base nodes that were on a higher proof of work but on a different genesis block, and caused wallets to query base nodes that supplied information from a different blockchain. This byte can now be changed every time the genesis block changes. How Has This Been Tested? --- Passed all unit tests. What process can a PR reviewer use to test or verify this change? --- <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [X] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer -->
Description
Added a custom noise prologue to the noise protocol to be hashed into the handshake hash value. This enables an application to specify a unique identifier like the genesis block hash as the noise prologue, effectively stopping any communication handshake from succeeding with nodes not on the same genesis block.
Thanks to @sdbondi for brainstorming and suggesting the way this requirement could be implemented.
Motivation and Context
Base nodes and wallets maintained numerous connections from which they could not sync or obtain useful information. This caused base nodes to try and follow other base nodes that were on a higher proof of work but on a different genesis block, and caused wallets to query base nodes that supplied information from a different blockchain.
How Has This Been Tested?
Passed all unit tests.
Passed system-level testing.
What process can a PR reviewer use to test or verify this change?
Code review.
System-level testing.
Breaking Changes
BREAKING CHANGE: Communication between base nodes and wallets will be exclusively linked to the genesis block hash once this PR is implemented. They will not be able to communicate to any previous release.