Skip to content

fix(tbtc): complete Taproot discovery and fee handling#4146

Merged
mswilkison merged 1 commit into
feat/frost-schnorr-migration-scaffoldfrom
fix/pr3866-taproot-review
Jul 12, 2026
Merged

fix(tbtc): complete Taproot discovery and fee handling#4146
mswilkison merged 1 commit into
feat/frost-schnorr-migration-scaffoldfrom
fix/pr3866-taproot-review

Conversation

@mswilkison

Copy link
Copy Markdown
Contributor

Stack

3 of 3. Depends on #4145 and targets fix/pr3866-registry-review.

What changed

  • merge legacy and V2 wallet-registration history and deduplicate compatibility events without synthesizing zero legacy wallet IDs
  • estimate moving-funds fees from the resolved source and target scripts
  • discover native P2TR deposit sweeps through Taproot reveals and canonical wallet scripts, with an explicit error for unsupported history backends
  • preserve the Taproot deposit marker through sweep proposal construction
  • estimate P2TR sweep fees with the actual main-UTXO presence instead of assuming one exists

Verification

  • go test ./pkg/bitcoin ./pkg/maintainer/spv ./pkg/tbtcpg ./pkg/tbtc ./pkg/chain/ethereum
  • go test -tags=frost_native ./pkg/tbtc ./pkg/chain/ethereum
  • independent focused review and tests for registration-history compatibility, P2TR discovery, and sweep fee shapes

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a274e4c1-a569-4af7-83e6-197501b1be9c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pr3866-taproot-review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mswilkison
mswilkison force-pushed the fix/pr3866-registry-review branch from 3898afd to d0401b1 Compare July 11, 2026 20:03
@mswilkison
mswilkison force-pushed the fix/pr3866-taproot-review branch 3 times, most recently from fce3a0c to d6497bf Compare July 12, 2026 20:12
@mswilkison
mswilkison force-pushed the fix/pr3866-registry-review branch from d0401b1 to b674361 Compare July 12, 2026 20:12
@mswilkison
mswilkison force-pushed the fix/pr3866-registry-review branch from b674361 to 1294939 Compare July 12, 2026 22:01
@mswilkison
mswilkison force-pushed the fix/pr3866-taproot-review branch from d6497bf to 014b43b Compare July 12, 2026 22:01
mswilkison added a commit that referenced this pull request Jul 12, 2026
Stack 1 of 3 on top of #3866. Followed by #4145 and #4146.

Addresses the FROST DKG configuration and coordinator findings from the
latest review:

- load `groupSize`, `activeThreshold`, and `groupThreshold` from
`FrostDkgValidator` independently of the legacy ECDSA validator
- use the FROST parameters for DKG execution, result signing, readiness,
signer registration, recovery lookback, wallet signing, and inactivity
executors
- replace eager seven-day FROST event deduplication with atomic
in-progress leases that are released after transient failures and
completed only after work is handled or safely scheduled
- when a stale DkgStarted replay resolves a newer event, complete the
stale lease and acquire a fresh lease for the newer seed before
membership or DKG execution
- guard nil native DKG parameters and treat build-level native
unavailability as terminal for the current process while keeping
runtime-changeable gates retryable
- stop result approval immediately when the parent context is canceled

Startup now intentionally fails if `FrostWalletRegistry` is enabled
without a configured `FrostDkgValidator`, because the node cannot safely
infer the independent FROST thresholds.

Verification:

- `go test ./pkg/tbtc ./pkg/chain/ethereum`
- focused default and `frost_native` coordinator/parameter tests
- focused race tests and `go vet`
- stale-to-latest seed regressions covering concurrent, completed, and
transient-failure cases

The next stack layer, #4145, routes heartbeat, inactivity, and closure
handling through the wallet's scheme-specific registry.
mswilkison added a commit that referenced this pull request Jul 12, 2026
## Stack

2 of 3. Depends on #4144, is followed by #4146, and targets
`fix/pr3866-dkg-review`.

## What changed

- route FROST inactivity claims through FrostWalletRegistry and
FrostSortitionPool, including the FROST claim hash and operator IDs
- keep legacy heartbeat stake and registration checks bound to the ECDSA
registry during dual-stack migration
- subscribe to and recover recent FROST wallet-closure and
inactivity-claim events through cancellation-aware delivery; in-flight
log filters stop on unsubscribe
- confirm wallet closure and remove signer material against the wallet's
signing scheme
- make closure deduplication scheme-scoped, retryable after failures,
and safe when a replay arrives during active handling
- remove the obsolete eager ECDSA-only closure helper and align
local-chain FROST registration behavior with production

## Verification

- `go test ./pkg/tbtc ./pkg/chain/ethereum`
- `go test -tags=frost_native ./pkg/tbtc ./pkg/chain/ethereum`
- focused `-race` tests for wallet-closure deduplication and FROST
inactivity event delivery
Base automatically changed from fix/pr3866-registry-review to feat/frost-schnorr-migration-scaffold July 12, 2026 22:27
@mswilkison
mswilkison merged commit 0b0f663 into feat/frost-schnorr-migration-scaffold Jul 12, 2026
35 checks passed
@mswilkison
mswilkison deleted the fix/pr3866-taproot-review branch July 12, 2026 22:28
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.

1 participant