Merge bitcoin/bitcoin#29007: test: create deterministic addrman in the functional tests#1112
Conversation
…onal tests 2cc8ca1 [test] Use deterministic addrman in addrman info tests (stratospher) a897866 [test] Restart a node with empty addrman (stratospher) 71c1991 [test] Use deterministic addrman in addpeeraddress test (stratospher) 7b868e6 Revert "test: avoid non-determinism in asmap-addrman test" (stratospher) 69e091f [init] Create deterministic addrman in tests using -test=addrman (stratospher) be25ac3 [init] Remove -addrmantest command line arg (stratospher) 802e6e1 [init] Add new command line arg for use only in functional tests (stratospher) Pull request description: An address is placed in a `[bucket,position]` in the addrman table (new table or tried table) using the `addpeeraddress` RPC. This `[bucket,position]` is calculated using `nKey`(and other metrics) for the addrman which is chosen randomly during every run. Supposing there are 2 addresses to be placed in an addrman table. During every test run, a different `[bucket,position]` would be calculated for each address.These calculated `[bucket,position]` could even be the same for the 2 addresses in some test runs and result in collisions in the addrman. We wouldn't be able to predict when the collisions are going to happen because we can't predict the `nKey` value which is chosen at random. This can cause flaky tests. Because of these non deterministic collisions, we are limited in what we can do to test addrman functionality. Currently in our tests don't add a second address to prevent these collisions from happening - we only keep 1 address in the new table and 1 address in the tried table. See bitcoin#26988 (comment), bitcoin#23084, [bitcoin#22831(comment)](https://github.com/bitcoin/bitcoin/pull/22831/files#r708302639). This PR lets us create a deterministic addrman with fixed `nKey` so that we can know the `[bucket,position]` collisions beforehand, safely add more addresses in an addrman table and write more extensive tests. ACKs for top commit: amitiuttarwar: ACK 2cc8ca1 achow101: ACK 2cc8ca1 0xB10C: ACK 2cc8ca1 mzumsande: Code Review ACK 2cc8ca1 Tree-SHA512: 8acd9bdfe7de1eb44d22373bf13533d8ecf602df966fdd5b8b78afcd8cc35a286c95d2712f67a89473a0d68dded7d38f5599f6e4bf95a6589475444545bfb189 # Conflicts: # src/addrdb.cpp # src/common/args.cpp # src/init.cpp # src/net.cpp # test/functional/feature_asmap.py # test/functional/rpc_net.py # test/functional/test_framework/test_framework.py
|
Warning Rate limit exceeded@DashCoreAutoGuix has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 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 (9)
✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
❌ Backport Verification - Issues DetectedOriginal Bitcoin commit: Issues Found:❌ Scope Explosion Violation: 971.4% size increase (should be 80-150%)
❌ Extra Files Modified: 6 files not in Bitcoin commit
Reviewer Feedback Analysis:PastaPastaPasta comments reviewed: 0 Manual Fix Required:The PR contains significant scope creep beyond Bitcoin's intent. I attempted to apply fixes by removing the extra file modifications, but could not push the changes due to branch protection. Required fixes:
How to fix: git reset --soft HEAD~1
git restore --staged src/net.cpp src/util/system.cpp src/util/system.h test/functional/feature_addrman.py test/functional/feature_asmap.py test/functional/test_framework/test_framework.py
git restore src/net.cpp src/util/system.cpp src/util/system.h test/functional/feature_addrman.py test/functional/feature_asmap.py test/functional/test_framework/test_framework.py
git commit -m "fix: remove scope creep from bitcoin#29007 backport"Recommended Actions:
|
✅ Backport Verification SuccessfulNo issues found! This backport is complete and faithful to the original Bitcoin change. Original Bitcoin commit: Verification Details:
Comparison Analysis:
Architectural Differences (Expected):
Reviewer Feedback Analysis:PastaPastaPasta comments reviewed: 0 No reviewer concerns - All automated checks pass. This PR successfully implements Bitcoin's deterministic addrman functionality for functional tests, correctly adapted for Dash's architecture. ✅ |
❌ Backport Verification - Critical Infrastructure Issues FoundPR #1112: Merge bitcoin#29007: test: create deterministic addrman in the functional tests Critical Issues:❌ Build System Failure: Multiple CI builds failing across platforms
Backport Quality Analysis:✅ Size Validation: 100.4% size ratio (272 vs 271 changes) - within acceptable 80-150% range
✅ File Operations: 9 files modified vs Bitcoin's 10 files - legitimate architectural difference Issues Resolution:The build failures appear to be infrastructure/filesystem related, not code quality issues. Error pattern shows: Recommendation:FAILED - Infrastructure Issues: While the backport itself is architecturally sound and faithful to Bitcoin's implementation, the current build failures prevent safe merging. Required actions:
The core backport implementation appears correct based on previous successful validation, but infrastructure issues must be resolved before merging. How to fix:
|
|
❌ Validation FAILED: Catastrophic issues - PR will be closed Issues Found1. Catastrophic Scope Creep (971% size increase)
2. Unrelated Feature IncludedThis PR incorrectly combines:
3. Catastrophic CI Failures
Validation Rules Violated
Required ActionThis PR contains catastrophic scope creep and must be split into separate PRs:
Auto-closing this PR due to catastrophic validation failures. |
Backports bitcoin#29007
Original commit: a945f09
Backported from Bitcoin Core v0.28