forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rpc): submit chainlock signature if needed RPC (#5765)
## Issue being fixed or feature implemented Once Platform is live, there could be an edge case where the CL could arrive to an EvoNode faster through Platform quorum than regular P2P propagation. ## What was done? This PR introduces a new RPC `submitchainlock` with the following 3 mandatory parameters: - `blockHash`, `signature` and `height`. Besides some basic tests: - If the block is unknown then the RPC returns an error (could happen if the node is stucked) - If the signature is not verified then the RPC return an error. - If the node already has this CL, the RPC returns true. - If the node doesn't have this CL, it inserts it, broadcast it through the inv system and return true. ## How Has This Been Tested? `feature_llmq_chainlocks.py` was modified with the following scenario: 1. node0 is isolated from the rest of the network 2. node1 mines a new block and waits for CL 3. Make sure node0 doesn't know the new block/CL (by checking `getbestchainlock()`) 4. CL is submitted via the new RPC on node0 5. checking `getbestchainlock()` and make sure the CL was processed + 'known_block' is false 6. reconnect node0 ## Breaking Changes no ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ --------- Co-authored-by: UdjinM6 <[email protected]> Co-authored-by: thephez <[email protected]>
- Loading branch information
1 parent
714be63
commit 3bc77a6
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Added RPC | ||
-------- | ||
|
||
- `submitchainlock` RPC allows the submission of a ChainLock signature. | ||
Note: This RPC is whitelisted for the Platform RPC user. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters