Skip to content
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

Fix BitcoinTx vsize calculation #289

Merged
merged 5 commits into from
Sep 6, 2024
Merged

Fix BitcoinTx vsize calculation #289

merged 5 commits into from
Sep 6, 2024

Conversation

mappum
Copy link
Contributor

@mappum mappum commented Mar 21, 2024

This PR changes BitcoinTx vsize estimates to include size for worst-case witness signatures. This fixes the fee calculation for recovery transactions to ensure they properly pay a large enough fee.

"Worst-case" is based on including 100% of possible signatures, since it is possible for griefers to relay transactions with this many signatures regardless of how many are necessary to satisfy the threshold. If we can ensure it doesn't cause fee-rate-based Bitcoin confirmation DoS or delays, we can adjust this to a less conservative worst-case which is the maximum number of signatures to satisfy the threshold.

…include size for worst-case witness signatures
@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 36.94%. Comparing base (5f3a867) to head (5fb26e0).

Files with missing lines Patch % Lines
src/bitcoin/recovery.rs 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #289      +/-   ##
===========================================
+ Coverage    36.90%   36.94%   +0.04%     
===========================================
  Files           25       25              
  Lines         9448     9454       +6     
===========================================
+ Hits          3487     3493       +6     
  Misses        5961     5961              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mappum mappum merged commit f7c1d3d into develop Sep 6, 2024
9 checks passed
@mappum mappum deleted the vsize-fix branch September 6, 2024 02:03
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.

2 participants