Skip to content

rpc: lease chain fee estimation includes account version at batch time - #532

Merged
Roasbeef merged 3 commits into
masterfrom
release-v0.7.3-fee-estimation
Nov 13, 2026
Merged

Roasbeef merged 3 commits into
masterfrom
release-v0.7.3-fee-estimation

Conversation

@Roasbeef

Copy link
Copy Markdown
Member

Rebases #434 onto current master (original commits preserved).

Change

ListLeases previously assumed P2WSH for every account when estimating the chain fees paid for executing a batch, so the estimate was wrong for Taproot accounts (see #431).

This change:

  • Snapshots the spending accounts' versions in the local batch snapshot at execution time.
  • Uses that snapshot's account version in the fee-estimation calculation rather than a fixed P2WSH assumption, so the estimate reflects the account version at the time of the batch even if the account is auto-upgraded from P2WSH (version 0) to P2TR (version 1) within the batch.

Validation

  • go build ./... passes.
  • go test . (root package, includes batch/rpcserver tests) passes.
  • go test ./clientdb/... passes.
  • Full CI will run the race/coverage/fuzz matrix.

Closes #431. Supersedes #434.

The account versions from the spending accounts snapshot will be used in estimating on-chain fees.
Account version is taken from a snapshot of spending account states. This is because the account might be updated to a new version within the batch.
@Roasbeef
Roasbeef merged commit f48e57b into master Nov 13, 2026
6 checks passed
@Roasbeef
Roasbeef deleted the release-v0.7.3-fee-estimation branch November 13, 2026 21:26
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.

ListLeases: fix lease chain fee estimation for Taproot accounts

2 participants