Skip to content

[V132-specific] Consistent TxOutItem MaxGas and GasRate, and txout deduction of MaxGas cost or outbound fee but not both #check-lint-warning

Multipartite requested to merge Multi/gas-and-fee-consistency into develop

[V132-specific]

Intended to close #1865
'TxOutItem MaxGas and GasRate are inconsistent'
and #1866
'InactiveVault refunds are sending outbound fees from pools to the Reserve'.

The #check-lint-warning is intended to be solely for the addition of GetGasDetails to the GasManager interface
and the requisite method addition to earlier-version manager_gas files.


Update:
Smoke test update needed.

Attempting testing with a fork repository's #check-lint-warning MR:
https://gitlab.com/Multipartite/thornode/-/pipelines/1163029472
https://gitlab.com/Multipartite/thornode/-/jobs/6087822658

1. Ensure the following passes locally: `make generate lint test smoke test-regression`

Attempting testing locally, despite poor reliability in the past:
make generate smoke

Traceback (most recent call last):
  File "/app/scripts/smoke.py", line 11, in <module>
    from chains.binance import Binance, MockBinance
  File "/app/chains/binance.py", line 5, in <module>
    from utils.common import Coin, HttpClient, get_rune_asset, Asset
  File "/app/utils/common.py", line 9, in <module>
    from thornode_proto.common import Coin as Coin_pb
ModuleNotFoundError: No module named 'thornode_proto'
make: *** [Makefile:264: smoke] Error 1

(Intermediate steps omitted.)
make protob had no effect, but make smoke-protob-docker was sufficient to get past that step.

To update the
http://localhost:1317/cosmos/base/tendermint/v1beta1/node_info
"git_commit" (a greatly-welcome thing to be able to check)
and to have less chance of failing earlier than a pipeline at test 62 (BTC) or 86 (LTC),
BLOCK_SCANNER_BACKOFF="0.3s" make build-mocknet smoke
is working fairly well so far.


2024-02-04 note:

I am currently inclined to, dependent on merging of this MR,
rebase unmerged April 2023 commit !2866 (f6b4acf4)
'Always withhold gas asset fee in manager_txout'
to deduct a gas asset's MaxGas in the txout manager when the Layer 1 pool's BalanceRune or BalanceAsset are zero,
and deducting a fee in the txout manager if not.
(Rather than deducting the gas cost in the withdraw handler and leaving Asset intended for gas in no-RUNE pool,
or the situation where a pool has depths and synths (thus could still pay a RUNE outbound fee) though no pool units (no non-synth liquidity providers.)
|
Its pre-rebase code only addresses the synths-only case where there are still both depths (a fee can be calculated),
and not the Ragnarok-like case where the last withdrawal indeed empties the pool and a gas asset outbound needs to have its own gas cost deducted
(without leaving the gas cost in the pool to do so).

Edited by Multipartite

Merge request reports