-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: implement automatic detection of clsigs in blocks and process them #6236
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
base: develop
Are you sure you want to change the base?
feat: implement automatic detection of clsigs in blocks and process them #6236
Conversation
|
This pull request has conflicts, please rebase. |
- Add 13 unit tests covering chainlock construction, serialization, edge cases - Add functional test for automatic coinbase chainlock processing - Add test utilities for LLMQ testing infrastructure - Fix compilation errors and add proper error handling - Add edge case validation for height overflow and invalid data All tests pass successfully, resolving WIP status.
1dd9573 to
b15ed7e
Compare
|
…dBlockFromDisk - Add GetCoinbaseChainlock() that extracts chainlock directly from CBlock - Refactor GetNonNullCoinbaseChainlock() to use new function for backward compatibility - Update CChainLocksHandler::BlockConnected() to use efficient GetCoinbaseChainlock() - Add unit tests for both functions - Eliminates expensive ReadBlockFromDisk() call in hot path since CBlock is already available Performance improvement: Avoids disk I/O in automatic chainlock detection during block processing.
… type safety - Create CCoinbaseChainlock struct with signature and heightDiff members - Replace std::optional<std::pair<CBLSSignature, uint32_t>> with std::optional<CCoinbaseChainlock> - Update all usage sites across specialtxman, chainlocks, utils, miner, RPC, and simplifiedmns - Add comprehensive unit tests for new structure - Improve code readability and type safety Benefits: - Self-documenting structure (clear what signature/heightDiff represent) - Type-safe (prevents parameter swapping) - Consistent with existing chainlock patterns - Easier to maintain and extend
- Fix unsigned comparison error in chainlocks.cpp by changing clsig_height to int32_t - Remove trailing whitespace from test files - Fix executable permissions on feature_llmq_chainlocks_automatic.py These changes address the critical build failure and linting issues preventing CI from passing.
|
|
||
| class LLMQChainLocksAutomaticTest(DashTestFramework): | ||
| def set_test_params(self): | ||
| self.set_dash_test_params(6, 5) |
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.
consider ab42708
firstly, you don't need to test masternode functionality, only just "some" chainlocks. Single-node-quorum speed up this functional test significantly.
Secondly, you should not isolate masternode for this functional test, because it adds instability in case if this masternode is in quorum. Instead, isolate regular node.
It takes only 18 seconds to run with my changes.
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.
or maybe even 71db9ad
it uses 1 less node and just 10 seconds to run
…solate node-1 (NOT Masternode) to avoid intermittent random failures
|
Warning Rate limit exceeded@github-actions[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 21 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (16)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
This pull request has conflicts, please rebase. |
Issue being fixed or feature implemented
This PR implements automatic detection and processing of chainlock signatures (CLSIGs) embedded in coinbase transactions. Currently, chainlock signatures in coinbase transactions are only stored but not automatically processed when blocks are connected. This enhancement enables automatic detection and processing of these signatures, improving the efficiency of the chainlock system.
What was done?
CChainLocksHandlerto automatically detect chainlock signatures from coinbase transactions usingGetNonNullCoinbaseChainlock()How Has This Been Tested?
Unit Tests: 13 comprehensive test cases in
src/test/llmq_chainlock_tests.cppcovering:Functional Tests: End-to-end test in
test/functional/feature_llmq_chainlocks_automatic.pycovering:All tests pass successfully: Unit tests (13/13) and functional tests complete without errors
No performance regression: Tested with existing chainlock functionality
Backward compatibility: Maintains compatibility with existing chainlock processing
Breaking Changes
None. This is a backward-compatible enhancement that extends existing functionality without modifying existing behavior.
Checklist: