Skip to content

fix: use estimated gas rate for bitcoin outTx and put a cap on total fee#1240

Closed
ws4charlie wants to merge 1 commit intodevelopfrom
fix-btc-outtx-gasprice
Closed

fix: use estimated gas rate for bitcoin outTx and put a cap on total fee#1240
ws4charlie wants to merge 1 commit intodevelopfrom
fix-btc-outtx-gasprice

Conversation

@ws4charlie
Copy link
Contributor

Description

We paid up to 3M satoshis ($800) in mock mainnet for bitcoin outTx which is way more than enough. A more reasonable gas price needs to be used.

  1. Use estimated fee rate to send bitcoin outTx.
  2. Put 0.001 BTC as the cap of fee. (in case of accident)
  3. Round gas price to multiple of 1000 satoshis across TSS signers.

Closes:

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

!!!WARNING!!!
nosec detected in the following files: zetaclient/bitcoin_client.go, zetaclient/btc_signer.go

Be very careful about using #nosec in code. It can be a quick way to suppress security warnings and move forward with development, it should be employed with caution. Suppressing warnings with #nosec can hide potentially serious vulnerabilities. Only use #nosec when you're absolutely certain that the security issue is either a false positive or has been mitigated in another way.

Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203
Broad #nosec annotations should be avoided, as they can hide other vulnerabilities. The CI will block you from merging this PR until you remove #nosec annotations that do not target specific rules.

Pay extra attention to the way #nosec is being used in the files listed above.

@github-actions github-actions bot added the nosec label Oct 5, 2023
@lumtis
Copy link
Contributor

lumtis commented Oct 5, 2023

Is it still relevant @ws4charlie or does #1243 replaces it?

@lumtis
Copy link
Contributor

lumtis commented Oct 5, 2023

Closing, please feel free to reopen

@lumtis lumtis closed this Oct 5, 2023
@ws4charlie ws4charlie deleted the fix-btc-outtx-gasprice branch October 17, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants