-
Notifications
You must be signed in to change notification settings - Fork 5.8k
BIP330: drop redundant booleans from the sendtxrcncl message #1376
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
The reconciliation protocol assumes using one role consistently. Since it is irrelevant which one is which, we can imply that the initiator of the P2P connection will assume the role of reconciliation initiator. This protocol simplification will seep into the implementation.
|
Having two booleans means we have to deal with all 4 cases:
Allowing only 2. and 3. means we can have just one boolean and derive the value of the other from it. However, since it is completely irrelevant which one is which we can just assign the roles based on who is the P2P connection initiator. bitcoin/bitcoin#23443 does that (+ trying to handle the nonsensical cases). I think this redundancy can be a source of confusion and/or bugs. |
|
The idea behind two non-implied roles was future upgradeability, which might be not based on the connection.
The fact that you caught a (comment) mistake in the code which was acked and near-merged is probably a good argument towards dropping this redundancy. @sipa what do you think? |
|
@naumenkogs I'm fine with just making the reconciliation direction fixed by the protocol. There is still a version number in |
|
Then I hope for the following events to occur shortly:
(unless we come to a different opinion in the meanwhile) |
|
I missed this was a PR already. ACK 8b107a0 |
|
@vasild kinda unrelated to this PR. I'm not sure we have to always seek a synchronization between BIPs and master. I expect this BIP to be updated at least couple more times along the Erlay merging, and I think it's no big deal if e.g. the lag is one month. |
|
Sounds good to use the version for future upgrades - then the Yeah, the waterfall model where design is followed by implementation rarely works. There will be iterative steps where some mods will be done to the design while the implementation is happening. We just have to keep in mind alternative implementations and not let things diverge too much for a long time, in case somebody implements stuff based on an outdated spec. |
e56d1d2 test: Add functional tests for sendtxrcncl message from outbound (Gleb Naumenko) cfcef60 test: Add functional tests for sendtxrcncl from inbound (Gleb Naumenko) b99ee9d test: Add unit tests for reconciliation negotiation (Gleb Naumenko) f63f1d3 p2p: clear txreconciliation state for non-wtxid peers (Gleb Naumenko) 88d326c p2p: Finish negotiating reconciliation support (Gleb Naumenko) 36cf6bf Add helper to see if a peer is registered for reconciliations (Gleb Naumenko) 4470acf p2p: Forget peer's reconciliation state on disconnect (Gleb Naumenko) 3fcf78e p2p: Announce reconciliation support (Gleb Naumenko) 24e36fa log: Add tx reconciliation log category (Gleb Naumenko) Pull request description: This is a part of the Erlay project: - [parent PR](bitcoin/bitcoin#21515) - [associated BIP-330](bitcoin/bips#1376). ------- This PR adds a new p2p message `sendtxrcncl` signaling for reconciliation support. Before sending that message, a node is supposed to "pre-register" the peer by generating and storing an associated reconciliation salt component. Once the salts are exchanged within this new message, nodes "register" each other for future reconciliations by computing and storing the aggregate salt, along with the reconciliation parameters based on the connection direction. ACKs for top commit: dergoegge: re-ACK e56d1d2 sipa: re-ACK e56d1d2. No differences with a rebase of previously reviewed e91690e67dad180c7fb9bed0409a9c4567d3e5df. mzumsande: re-ACK e56d1d2 vasild: ACK e56d1d2 Tree-SHA512: 0db953b7347364e2496ebca3bfe6a27ac336307eec698242523a18336fcfc7a1ab87e3b09ce8b2bdf800ebbb1c9d33736ffdb8f5672f93735318789aa4a45f39
|
ACK 8b107a0 |
46339d2 test, refactor: Reorder sendtxrcncl tests for better readability (Gleb Naumenko) 14263c1 p2p, refactor: Extend logs for unexpected sendtxrcncl (Gleb Naumenko) 87493e1 p2p, test, refactor: Minor code improvements (Gleb Naumenko) 00c5dec p2p: Clarify sendtxrcncl policies (Gleb Naumenko) ac6ee5b test: Expand unit and functional tests for txreconciliation (Gleb Naumenko) bc84e24 p2p, refactor: Switch to enum class for ReconciliationRegisterResult (Gleb Naumenko) a60f729 p2p: Drop roles from sendtxrcncl (Gleb Naumenko) 6772cbf tests: stabilize sendtxrcncl test (Gleb Naumenko) Pull request description: Non-trivial changes include: - Getting rid of roles in `sendtxrcncl` message (summarized in the [BIP PR](bitcoin/bips#1376)); - Disconnect the peer if it send `sendtxrcncl` although we are in `blocksonly` and notified the peer with `fRelay=0`; - Don't send `sendtxrcncl` to feeler connections. ACKs for top commit: vasild: ACK 46339d2 ariard: ACK 46339d2 mzumsande: Code Review ACK 46339d2 Tree-SHA512: b5cc6934b4670c12b7dbb3189e739ef747ee542ec56678bf4e4355bfb481b746d32363c173635685b71969b3fe4bd52b1c8ebd3ea3b35c82044bba69220f6417
46339d2 test, refactor: Reorder sendtxrcncl tests for better readability (Gleb Naumenko) 14263c1 p2p, refactor: Extend logs for unexpected sendtxrcncl (Gleb Naumenko) 87493e1 p2p, test, refactor: Minor code improvements (Gleb Naumenko) 00c5dec p2p: Clarify sendtxrcncl policies (Gleb Naumenko) ac6ee5b test: Expand unit and functional tests for txreconciliation (Gleb Naumenko) bc84e24 p2p, refactor: Switch to enum class for ReconciliationRegisterResult (Gleb Naumenko) a60f729 p2p: Drop roles from sendtxrcncl (Gleb Naumenko) 6772cbf tests: stabilize sendtxrcncl test (Gleb Naumenko) Pull request description: Non-trivial changes include: - Getting rid of roles in `sendtxrcncl` message (summarized in the [BIP PR](bitcoin/bips#1376)); - Disconnect the peer if it send `sendtxrcncl` although we are in `blocksonly` and notified the peer with `fRelay=0`; - Don't send `sendtxrcncl` to feeler connections. ACKs for top commit: vasild: ACK 46339d2 ariard: ACK 46339d2 mzumsande: Code Review ACK 46339d2 Tree-SHA512: b5cc6934b4670c12b7dbb3189e739ef747ee542ec56678bf4e4355bfb481b746d32363c173635685b71969b3fe4bd52b1c8ebd3ea3b35c82044bba69220f6417
The reconciliation protocol assumes using one role consistently. Since it is irrelevant which one is which, we can imply that the initiator of the P2P connection will assume the role of reconciliation initiator.
This protocol simplification will seep into the implementation.