Skip to content

Sync with Upstream#1

Open
2a5A1Ghu1 wants to merge 1231 commits into
theohmproject:masterfrom
btcsuite:master
Open

Sync with Upstream#1
2a5A1Ghu1 wants to merge 1231 commits into
theohmproject:masterfrom
btcsuite:master

Conversation

@2a5A1Ghu1
Copy link
Copy Markdown
Member

No description provided.

yyforyongyu and others added 30 commits March 7, 2025 13:29
multi:use t.TempDir replace os.MkdirTemp to simplify test temp dir manager
multi: remove deprecated io/ioutil
docs: update guidelines and links
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.
multi: implement testnet4 and add support for soft forks that are always active
…ocks-from-same-height-peers

netsync: don't ask for blocks from peers on the same block height
Signed-off-by: xinhangzhou <shuangcui@aliyun.com>
docs: update contribution link
refactor: use map.Copy for cleaner map handling
psbt: check path minimum length
Currently btcd keeps downloading blocks and fails to verify them if the
disk is out of space. We exit immediately if we detect that the disk is
out of space to ensure the database is at a recoverable state later on.
…ng-out-of-disk-space

database: shut the program down immediately if we run out of disk space
Roasbeef and others added 30 commits May 14, 2026 15:59
server: fix peer add/done race between peerHandler and syncManager
httpURL was being recomputed on every JSON-RPC POST. It went through
ParseAddressString to discriminate Unix sockets from TCP, which
called net.ResolveTCPAddr and triggered a DNS lookup whose result
was thrown away.

Both inputs (config.Host and config.DisableTLS) are immutable after
New, so the URL is constant for the life of the Client. Compute it
once and store it on the Client, mirroring the parsedDialAddr cache
already in newHTTPClient.

The httpURL method now uses HasPrefix and runs exactly once per
Client. Drop its (string, error) signature — with the resolve gone
nothing can fail. Add table coverage for the URL strings, plus a
wiring test that catches refactors of New silently dropping the
assignment to Client.httpURL.
Golang's net package has been broken for android since android 11
and the node will not be able to call net.InterfaceAddr() without
root.

For android builds, we use anet so that the btcd node can be used
without root.
We update go.mod and go.sum to point to the local btcutil library.

This commit should be updated later on so that we do it right.
We use this as the net.InterfaceAddr is broken from android 11.
rpcclient: compute httpURL once at construction time
The previous commit exported the interfaceAddrs helper in net.go but
missed the parallel definition in net_noop.go (build tag: appengine),
which left builds with -tags appengine broken with:

    ./certgen.go:79:16: undefined: InterfaceAddrs

Rename the appengine no-op variant to match, restoring the appengine
build.
Add a build step to the existing Build job that cross-compiles both the
top-level module and btcutil for GOOS=android GOARCH=arm64.

This catches regressions in the android-specific build path (e.g. the
net_android.go wrapper around anet.InterfaceAddrs) without needing an
emulator or NDK toolchain - android/arm64 builds without cgo.
Add VerifyLowS helper function to ECDSA signature
In this commit, we pin every in-tree go.mod to the freshly cut submodule
tags ahead of a btcd point release: btcec/v2.4.0, btcutil/v1.2.0,
btcutil/psbt/v1.2.0, and chaincfg/chainhash/v1.2.0. The btcec bump also
drags secp256k1 up to v4.4.0 (and blake256 to v1.1.0 transitively) for
every module that imports btcec.

v2transport stays at v1.0.1 since no v2transport code changed since the
last tag, but its go.mod is bumped here so the workspace resolves to a
consistent set of internal deps.
In this commit, we update every in-tree go.mod to declare go 1.25 and
have CI build with 1.26.3 (Dockerfile uses the golang:1.26-alpine base).
Docs that mention the minimum required Go version are aligned with the
new floor as well.

Fixes #2527, which flagged the README.md / go.mod version mismatch (the
README claimed 1.22 while the root + v2transport go.mod files already
required 1.23.2).
In this commit, we fix two go vet errors that go 1.26 now treats as
hard failures during test compilation.

In btcjson/help.go, the final result row of a complex help description
was emitted via fmt.Fprintf with a non-constant format string (the
result text could contain '%' chars). Switch to fmt.Fprint, since
there are no format args here anyway.

In btcec/schnorr/musig2/musig2_test.go, the nonce-registration loop
ran inside a goroutine and called t.Fatalf on failure. Fatalf only
exits the calling goroutine, so the test goroutine would keep running
with stale state. Use t.Errorf + return so the failure is recorded
correctly and the goroutine exits cleanly.
multi: bump in-tree go.mod files to new submodule tags
mod: remove `btcutil` circular dependency with main module
In this commit, we strip all of the local `replace ... => ../...`
directives that were introduced as part of #1825 (the v2 module
restructuring), now that proper tags exist for every freshly carved-out
submodule. Every in-tree go.mod is pinned to the newly published tags:
chainhash/v2.0.0, wire/v2.0.0, chaincfg/v2.0.0, address/v2.0.0,
txscript/v2.0.0, btcutil/v2.0.0, psbt/v2.0.0, and btcec is bumped to
v2.5.0 since it now depends on chainhash/v2 (previously
chaincfg/chainhash).

While here, we also unify the Go toolchain to 1.25 across every
submodule so the workspace resolves a consistent set of language
features.

Finally, we bump the main btcd version to v0.26.0-beta.rc1 in
preparation for the upcoming release candidate.
multi: pin new v2 submodule tags and bump to v0.26.0-beta.rc1
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.