-
Notifications
You must be signed in to change notification settings - Fork 112
feat(utxo): add new fixed txfee option for DINGO-like coins #2454
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
Conversation
fix use gas_fee in build(); fix min_relay_tx_fee calc; refactor break build() into functions rename fn get_tx_fee to get_fee_per_kb; fix utxos tests for recalculated tx fee
fix refactored UtxoTxBuilder::build(): return only txfee (w/o gas fee) with tx as it used to be
refactor (borngraced): add_change simplified, remove tx_fee mut, use checked_sub
* dev: (24 commits) fix(eth-tpu): remove state from funding validation (#2334) improvement(rpc-server): rpc server dynamic port allocation (#2342) fix(tests): fix or ignore unstable tests (#2365) fix(fs): make `filter_files_by_extension` return only files (#2364) fix(derive_key_from_path): check length of current_key_material (#2356) chore(release): bump mm2 version to 2.4.0-beta (#2346) fix(tests): add additional testnet sepolia nodes to test code (#2358) fix(swaps): maintain legacy compatibility for negotiation messages (#2353) refactor(SwapOps): impl defaults for protocol specific swapops fns (#2354) feat(tpu-v2): provide swap protocol versioning (#2324) feat(wallet): add change mnemonic password rpc (#2317) fix(tpu-v2): fix tpu-v2 wait for payment spend and extract secret (#2261) feat(tendermint): unstaking/undelegation (#2330) fix(utxo-withdraw): get hw ctx only when `PrivKeyPolicy` is trezor (#2333) feat(event-streaming): API-driven subscription management (#2172) fix(hash-types): remove panic, enforce fixed-size arrays (#2279) fix(ARRR): store unconfirmed change output (#2276) feat(tendermint): staking/delegation (#2322) chore(deps): `timed-map` migration (#2247) fix(mem-leak): `running_swap` never shrinks (#2301) ...
…sable txfee helpers
|
can i please have a new build of this? the old one was removed |
* dev: chore(core): replace hash_raw_entry with stable entry() API (#2473) chore(core): adapt `MmError` and usages for compatibility with new rustc versions (#2443) feat(wallet): add `delete_wallet` RPC (#2497) chore(release): add changelog entries for v2.5.0-beta (#2494) chore(release): bump kdf version to 2.5.0-beta (#2492) feat(tests): zcoin unit test to validate dex fee (#2460) # Conflicts: # mm2src/coins/qrc20.rs # mm2src/mm2_main/src/lp_swap/maker_swap.rs
|
Merged with dev and fixed several preimage volume tests broken due to new DEFAULT_SWAP_TX_SPEND_SIZE value in the dev (ad1cdf4). (Note: I added env vars _KDF_NO_UTXO_DOCKER, _KDF_NO_QTUM_DOCKER etc to disable start of unneeded docker containers for easier docker tests debugging) |
* dev: fix(eth): Correctly implement ETH max withdrawal logic (#2531) feat(use-clap-for-cli): use clap to parse CLI-Args #2215 (#2510) feat(orderbook): expirable maker orders (#2516) improvement(eth): drop parity support (#2527) chore(release): finalize changelog for v2.5.0-beta (#2524) chore(toolchain): upgrade toolchain to nightly 1.86.0 (#2444) feat(swap): rpc to find best swap with liquidity routing for ask (#2362) fix(kdf_walletconnect): apply explicit MmError mapping (#2514) fix(walletconnect): centralize connection and retry logic (#2508) fix(hw-wallet): avoid calling `get_enabled_address` in trezor-based coin init (#2504)
|
can we please merge this? using it on all makers since a long time and works perfectly fine |
Have to do my own line by line review, utxo fee changes PRs are usually complex and require rigorous review. |
shamardy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
@dimxy |
|
Thank you |
It's failing in dev so it's not this PR. I did check it yesterday and went back all the commits until the commit that introduced it and it still fails locally. I am thinking of ignoring it or changing how the test covers this case. |
Yeah I thought maybe just increasing the wait-for-log timeout would help but it didn't, seems a more complex problem. |
* dev: (21 commits) feat(wallet-connect): impl BTC (UTxO) activation via WalletConnect (#2499) feat(utxo): add new fixed txfee option for DINGO-like coins (#2454) ci(pull-requests): review notification bot (#2468) improvement(walletconnect): return the `pairing_topic` in `new_connection` response (#2538) bless clippy (#2560) refactor(toolchain): use latest available stable compiler (#2557) feat(wallet): implement unified offline private key export API (#2542) improve note for docker test start failure (#2550) fix(DOCS): add note for macos to fix docker containers startup failure (#2544) refactor(toolchain): general stabilization for stable rust (#2528) fix(ci): adds nodejs 20 to ci-container (#2536) fix(WASM and Debian): fix build failures (#2534) improvement(event-streaming): impl DeriveStreamerId trait for all streamers (#2489) fix(eth): Propagate structured EIP-1559 fee errors (#2532) fix(eth): Correctly implement ETH max withdrawal logic (#2531) feat(use-clap-for-cli): use clap to parse CLI-Args #2215 (#2510) feat(orderbook): expirable maker orders (#2516) improvement(eth): drop parity support (#2527) chore(release): finalize changelog for v2.5.0-beta (#2524) chore(toolchain): upgrade toolchain to nightly 1.86.0 (#2444) ... # Conflicts: # mm2src/coins/lp_coins.rs # mm2src/coins/rpc_command/get_new_address.rs # mm2src/trezor/src/eth/eth_command.rs
* dev: feat(wallet-connect): impl BTC (UTxO) activation via WalletConnect (#2499) feat(utxo): add new fixed txfee option for DINGO-like coins (#2454) ci(pull-requests): review notification bot (#2468) improvement(walletconnect): return the `pairing_topic` in `new_connection` response (#2538) bless clippy (#2560) refactor(toolchain): use latest available stable compiler (#2557) feat(wallet): implement unified offline private key export API (#2542) improve note for docker test start failure (#2550) fix(DOCS): add note for macos to fix docker containers startup failure (#2544) refactor(toolchain): general stabilization for stable rust (#2528) fix(ci): adds nodejs 20 to ci-container (#2536) fix(WASM and Debian): fix build failures (#2534) improvement(event-streaming): impl DeriveStreamerId trait for all streamers (#2489) chore(release): v2.3.0-beta (#2284) # Conflicts: # mm2src/coins/eth.rs # mm2src/coins/eth/eth_swap_v2/eth_maker_swap_v2.rs # mm2src/coins/eth/eth_swap_v2/eth_taker_swap_v2.rs # mm2src/coins/eth/eth_tests.rs # mm2src/coins/eth/eth_withdraw.rs # mm2src/coins/eth/v2_activation.rs # mm2src/coins/nft.rs # mm2src/coins/qrc20.rs # mm2src/mm2_main/src/rpc/dispatcher/dispatcher.rs # mm2src/mm2_main/src/rpc/lp_commands/one_inch/rpcs.rs # mm2src/mm2_main/src/rpc/lp_commands/tokens.rs # mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
* dev: (24 commits) fix(ordermatch): ignore loop-back; clear on null root; reject stale keep-alives (#2580) fix(clippy): fix clippy warnings for #2565 (#2589) fix(Trezor): fix utxo and eth calls due to firmware changes (#2565) fix(utxo): calculate min_trading_vol based on fixed tx fees (#2564) feat(protocol): [0] solana support (#2586) fix(utxo): fix header deserialization; guard AuxPoW (#2583) chore(rust 1.89): make CI clippy/fmt pass (wasm32, all-targets) (#2581) fix(utxo): deserialize sapling root for PIVX block headers (#2572) improvement(dep-stack): security bumps (#2562) fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (#2563) feat(wallet-connect): impl BTC (UTxO) activation via WalletConnect (#2499) feat(utxo): add new fixed txfee option for DINGO-like coins (#2454) ci(pull-requests): review notification bot (#2468) improvement(walletconnect): return the `pairing_topic` in `new_connection` response (#2538) bless clippy (#2560) refactor(toolchain): use latest available stable compiler (#2557) feat(wallet): implement unified offline private key export API (#2542) improve note for docker test start failure (#2550) fix(DOCS): add note for macos to fix docker containers startup failure (#2544) refactor(toolchain): general stabilization for stable rust (#2528) ... # Conflicts: # mm2src/coins/eth.rs # mm2src/coins/eth/eth_swap_v2/eth_maker_swap_v2.rs # mm2src/coins/eth/eth_swap_v2/eth_taker_swap_v2.rs # mm2src/coins/eth/eth_tests.rs # mm2src/coins/eth/eth_withdraw.rs # mm2src/coins/eth/v2_activation.rs # mm2src/coins/nft.rs # mm2src/coins/qrc20.rs # mm2src/mm2_main/src/rpc/dispatcher/dispatcher.rs # mm2src/mm2_main/src/rpc/lp_commands/one_inch/rpcs.rs # mm2src/mm2_main/src/rpc/lp_commands/tokens.rs # mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
* dev: improvement(`static mut`s): `static mut` removal (#2590) fix(orders): set subscription on kickstart and skip GC of own pubkeys (#2597) fix(ordermatch): ignore loop-back; clear on null root; reject stale keep-alives (#2580) fix(clippy): fix clippy warnings for #2565 (#2589) fix(Trezor): fix utxo and eth calls due to firmware changes (#2565) fix(utxo): calculate min_trading_vol based on fixed tx fees (#2564) feat(protocol): [0] solana support (#2586) fix(utxo): fix header deserialization; guard AuxPoW (#2583) chore(rust 1.89): make CI clippy/fmt pass (wasm32, all-targets) (#2581) fix(utxo): deserialize sapling root for PIVX block headers (#2572) improvement(dep-stack): security bumps (#2562) fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (#2563) feat(wallet-connect): impl BTC (UTxO) activation via WalletConnect (#2499) feat(utxo): add new fixed txfee option for DINGO-like coins (#2454) ci(pull-requests): review notification bot (#2468) improvement(walletconnect): return the `pairing_topic` in `new_connection` response (#2538) bless clippy (#2560) refactor(toolchain): use latest available stable compiler (#2557) feat(wallet): implement unified offline private key export API (#2542) chore(release): v2.3.0-beta (#2284) # Conflicts: # mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
* dev: (28 commits) fix build script failing to find .git/HEAD (GLEECBTC#2601) refactor(EVM): rename fn, fix timeouts, add activation req validation (GLEECBTC#2543) improvement(`static mut`s): `static mut` removal (GLEECBTC#2590) fix(orders): set subscription on kickstart and skip GC of own pubkeys (GLEECBTC#2597) fix(ordermatch): ignore loop-back; clear on null root; reject stale keep-alives (GLEECBTC#2580) fix(clippy): fix clippy warnings for GLEECBTC#2565 (GLEECBTC#2589) fix(Trezor): fix utxo and eth calls due to firmware changes (GLEECBTC#2565) fix(utxo): calculate min_trading_vol based on fixed tx fees (GLEECBTC#2564) feat(protocol): [0] solana support (GLEECBTC#2586) fix(utxo): fix header deserialization; guard AuxPoW (GLEECBTC#2583) chore(rust 1.89): make CI clippy/fmt pass (wasm32, all-targets) (GLEECBTC#2581) fix(utxo): deserialize sapling root for PIVX block headers (GLEECBTC#2572) improvement(dep-stack): security bumps (GLEECBTC#2562) fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (GLEECBTC#2563) feat(wallet-connect): impl BTC (UTxO) activation via WalletConnect (GLEECBTC#2499) feat(utxo): add new fixed txfee option for DINGO-like coins (GLEECBTC#2454) ci(pull-requests): review notification bot (GLEECBTC#2468) improvement(walletconnect): return the `pairing_topic` in `new_connection` response (GLEECBTC#2538) bless clippy (GLEECBTC#2560) refactor(toolchain): use latest available stable compiler (GLEECBTC#2557) ... # Conflicts: # mm2src/coins/eth.rs # mm2src/coins/eth/eth_rpc.rs # mm2src/coins/eth/eth_swap_v2/eth_maker_swap_v2.rs # mm2src/coins/eth/eth_swap_v2/eth_taker_swap_v2.rs # mm2src/coins/eth/eth_withdraw.rs # mm2src/coins/eth/v2_activation.rs # mm2src/coins/lightning.rs # mm2src/coins/lp_coins.rs # mm2src/coins/nft.rs # mm2src/coins/qrc20.rs # mm2src/coins/siacoin.rs # mm2src/coins/tendermint/tendermint_token.rs # mm2src/coins/test_coin.rs # mm2src/coins/utxo/bch.rs # mm2src/coins/utxo/qtum.rs # mm2src/coins/utxo/slp.rs # mm2src/coins/utxo/utxo_standard.rs # mm2src/coins/z_coin.rs # mm2src/coins_activation/src/bch_with_tokens_activation.rs # mm2src/coins_activation/src/erc20_token_activation.rs # mm2src/coins_activation/src/eth_with_token_activation.rs # mm2src/coins_activation/src/init_erc20_token_activation.rs # mm2src/coins_activation/src/init_token.rs # mm2src/coins_activation/src/platform_coin_with_tokens.rs # mm2src/coins_activation/src/slp_token_activation.rs # mm2src/coins_activation/src/tendermint_with_assets_activation.rs # mm2src/coins_activation/src/token.rs # mm2src/mm2_main/src/lp_swap.rs # mm2src/mm2_main/src/lp_swap/check_balance.rs # mm2src/mm2_main/src/lp_swap/maker_swap.rs # mm2src/mm2_main/src/lp_swap/max_maker_vol_rpc.rs # mm2src/mm2_main/src/lp_swap/swap_v2_rpcs.rs # mm2src/mm2_main/src/lp_swap/taker_swap.rs # mm2src/mm2_main/src/lp_swap/trade_preimage.rs # mm2src/mm2_main/src/rpc/dispatcher/dispatcher.rs # mm2src/mm2_main/src/rpc/lp_commands/legacy.rs # mm2src/mm2_main/src/rpc/lp_commands/lr_swap.rs # mm2src/mm2_main/src/rpc/lp_commands/lr_swap/lr_impl.rs # mm2src/mm2_main/src/rpc/lp_commands/one_inch/errors.rs # mm2src/mm2_main/src/rpc/lp_commands/one_inch/rpcs.rs # mm2src/mm2_main/src/rpc/lp_commands/tokens.rs # mm2src/mm2_main/tests/docker_tests/docker_tests_common.rs # mm2src/mm2_main/tests/docker_tests/docker_tests_inner.rs # mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs # mm2src/mm2_main/tests/integration_tests_common/mod.rs # mm2src/trading_api/src/one_inch_api/client.rs
This commit make txsize not round up by default. It then adds a new fixed tx fee option "dingo_fee"=true, with rounding up, that could be set for a coin in the coins file.
Before this PR, for the utxo fixed fee calculation we rounded up txsize up to 1000 bytes. It was once required for the DOGE coin (but not anymore), but we did this for all utxo coins (what in fact unnecessarily increased txfee).
This rounding up is now required for few coins, like DINGO or RUNES.
With this PR, this txsize rounding up is not done by default.
Added a new fixed tx fee option
"dingo_fee"=true, with rounding up, that could be set for a coin in the coins file.Updated tests involving swap max volume and txfee (due to changed txfee calculation).
Fixes #2446 issue.
@cipig
This PR also has an internal design improvement:
For calculating max swap volume (trade_preimage max_taker_vol rpcs) we should take into account possible refund fee. In this PR the include_refund_fee param is eliminated and instead a new variant is added into the existing FeeApproxStage enum.