Skip to content

Conversation

@Roasbeef
Copy link
Member

Taken over from: #2318

Only the last commit is new.

@Roasbeef Roasbeef requested a review from guggero March 11, 2025 19:50
@Roasbeef Roasbeef force-pushed the testnet4-bip9 branch 3 times, most recently from b2172bd to c5ea1cc Compare March 11, 2025 21:24
@coveralls
Copy link

coveralls commented Mar 11, 2025

Pull Request Test Coverage Report for Build 13928238660

Details

  • 54 of 108 (50.0%) changed or added relevant lines in 12 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 55.321%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chaincfg/params.go 15 16 93.75%
blockchain/thresholdstate.go 6 8 75.0%
rpcclient/infrastructure.go 0 2 0.0%
cmd/addblock/config.go 0 4 0.0%
cmd/findcheckpoint/config.go 0 4 0.0%
config.go 0 4 0.0%
database/cmd/dbtool/globalconfig.go 0 4 0.0%
rpcserver.go 0 4 0.0%
blockchain/difficulty.go 2 7 28.57%
blockchain/versionbits.go 10 15 66.67%
Files with Coverage Reduction New Missed Lines %
btcutil/gcs/gcs.go 1 81.25%
Totals Coverage Status
Change from base Build 13794438730: 0.02%
Covered Lines: 29997
Relevant Lines: 54224

💛 - Coveralls

Copy link
Collaborator

@guggero guggero left a 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...

@Roasbeef Roasbeef force-pushed the testnet4-bip9 branch 2 times, most recently from f68aeba to 987745e Compare March 12, 2025 18:24
@Roasbeef
Copy link
Member Author

I think some tuning of the CONVENTIONS.md file is in order for Aider to be useful in this repo.

Def, things like require usage in tests, or more details re comments should be pretty easy to capture.

Copy link
Collaborator

@guggero guggero left a 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.

AlwaysActiveHeight: 1,
},
DeploymentCSV: {
BitNumber: 29,
Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Collaborator

@yyforyongyu yyforyongyu left a 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
Copy link
Collaborator

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

bullet-tooth and others added 12 commits March 18, 2025 11:18
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.
@Roasbeef Roasbeef merged commit 4f4ea81 into btcsuite:master Mar 18, 2025
3 checks passed
rahul-aravind-opti added a commit to paxosglobal/btcd that referenced this pull request Nov 10, 2025
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>
rahul-aravind-opti pushed a commit to paxosglobal/btcd that referenced this pull request Nov 12, 2025
multi: implement testnet4 and add support for soft forks that are always active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants