Commit 9bc1365
authored
Fix native coin forward gas buffer (#3529)
* Fix native coin forward gas buffer to prevent stuck transactions
Increase gas fee buffer from 1.00001x to 2x when calculating the send
amount for native coin forwards. The previous 0.001% buffer was
insufficient to handle gas price fluctuations between the cached fee
estimation and actual send, causing value + gas to exceed the wallet
balance. This resulted in transactions being dropped from the mempool
and an infinite forward/timeout/reset loop.
* Use fresh gas cost for native coin forward amount calculation
Instead of relying on a cached fee estimate (30s TTL) to calculate
the send amount, fetch the current gas cost at dispatch time. This
eliminates the race condition where gas price changes between the
cached estimation and actual send, causing value + gas > balance
and the transaction to be dropped from the mempool.
* Reduce gas buffer from 1.5x to 1.05x
Fresh gas cost is fetched milliseconds before the actual send,
so only a minimal buffer is needed for potential block boundary
gas price changes (max 12.5% per block via EIP-1559).
* Apply fresh gas cost deduction to both forward and return paths
The return path for native coins had no gas deduction at all,
which would cause the same value + gas > balance issue when
chargebackAmount equals the full deposit amount.
* Update handlebars 4.7.8 → 4.7.9 to fix critical vulnerability
Resolves 8 security advisories including JS injection, prototype
pollution, and DoS via malformed decorator syntax.1 parent 3ea8fff commit 9bc1365
4 files changed
Lines changed: 14 additions & 8 deletions
File tree
- src/subdomains/supporting/payin
- services/base
- strategies/send/impl/base
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
0 commit comments