-
Notifications
You must be signed in to change notification settings - Fork 2.5k
multi: implement testnet4 and add support for soft forks that are always active #2339
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
b2172bd to
c5ea1cc
Compare
Pull Request Test Coverage Report for Build 13928238660Details
💛 - Coveralls |
guggero
left a comment
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 think some tuning of the CONVENTIONS.md file is in order for Aider to be useful in this repo. Otherwise it feels like the workload is shifted from the author to the reviewer...
f68aeba to
987745e
Compare
Def, things like |
guggero
left a comment
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.
LGTM 🎉
Was able to successfully sync a btcd node from scratch and also a Neutrino node referencing the changes in this PR.
chaincfg/params.go
Outdated
| AlwaysActiveHeight: 1, | ||
| }, | ||
| DeploymentCSV: { | ||
| BitNumber: 29, |
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.
You mentioned the other day that the bit numbers probably shouldn't be the same for CSV and Segwit. Not sure if that's relevant given the AlwaysActiveHeight though.
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.
Bumped to a unique bit number. But yeah it matters less due to AlwaysActiveHeight, since we don't need to count the amount of block headers with the bit set to determine the current activation state.
yyforyongyu
left a comment
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.
❤️
|
|
||
| // The height of this block is one more than the referenced previous | ||
| // block. | ||
| blockHeight := prevNode.Height() + 1 |
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.
nit: kinda weird this code block is moved here since blockHeight isn't used until line 729
Add robust property-based tests for the assertNoTimeWarp function using the rapid testing library. The tests verify the following scenarios: - Basic property tests: - Only retarget blocks (block height divisible by blocksPerRetarget) are checked - Valid timestamps (within maxTimeWarp of previous block) pass validation - Invalid timestamps (too early) fail with appropriate ErrTimewarpAttack - Correct boundary behavior (exactly at maxTimeWarp limit) - Invariant tests: - Function never panics with valid inputs - Non-retarget blocks always return nil regardless of timestamps - Security tests: - All retarget blocks are protected from timewarp attacks - Non-retarget blocks are not affected by the timewarp check
…tion This commit introduces the concept of `AlwaysActiveHeight` to the deployment mechanism, allowing a deployment to be forced into the active state if the next block's height meets or exceeds this threshold. This is intended primarily to be used alongside the new Testnet4 deployment, as the past major soft forks are meant to be active from the very first block height.
Merged btcsuite/btcd upstream master branch to bring in: - TestNet4 network support (PR btcsuite#2339) - Added TestNet4 params to chaincfg, wire, rpcclient, btcd, dbtool, and cmd - AlwaysActiveHeight deployment mechanism for forced soft fork activation - BIP94 support - Version bump from v0.24.2-beta to v0.25 - HTTP timeout support for RPC client (defaultHTTPTimeout) - Unix domain socket support for RPC connections - Thread-safe batch operations with batchLock - Signet support in rpcclient - Deprecation of io/ioutil in favor of io and os packages - ElmSwift implementation in btcec - PSBT improvements and bug fixes - Bloom filter hash function alignment - Submit package JSON-RPC stubs - V2 transport protocol implementation - Various bug fixes and improvements Preserved Paxos customizations in rpcclient/infrastructure.go: - X-RPC-Method header for RPC method tracking (line 798) - OnResponseCapture callback mechanism in ConnConfig (lines 1291-1294) - ObservingTransport wrapper for response observation (lines 1334-1349) Conflicts resolved: - .gitignore: Combined Paxos (.idea) and upstream (.DS_Store, .aider*) entries - rpcclient/infrastructure.go: Integrated Unix socket support and HTTP timeout while preserving ObservingTransport wrapper and OnResponseCapture functionality Merge includes 170 commits from upstream since last merge on 2024-06-24. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
multi: implement testnet4 and add support for soft forks that are always active
Taken over from: #2318
Only the last commit is new.