RVN coin Maker Payment Transaction fails with 'min relay fee not met' errorΒ #2313
Description
Bug Description
Maker payment transaction with tx fee close to min relay fee fails with 'min relay fee not met' error.
Apparently the tx fee is too low due to miscalculation.
RVN (raven) is a utxo coin, so this issue may be relevant for other utxo coins.
MM2 version
MM2 code: dev branch 075c55b
Additional Info
The tx has 13 inputs and a change output.
MM2 log with the transaction as hex:
31 05:44:25, mm2_main::lp_swap::maker_swap:2134] ERROR [swap uuid=a4ceefc5-7b1c-4713-9da3-9cd388b3c093] MakerPaymentTransactionFailed(SwapError { error: "maker_swap:866] mm2src/coins/utxo.rs:1778] utxo_common:4733] client:871] Rpc(ResponseParseError(JsonRpcError { client_info: \"coin: RVN\", request: JsonRpcRequest { jsonrpc: \"2.0\", id: 46818, method: \"blockchain.transaction.broadcast\", params: [String(\"010000000db9fee7764523e2fa8f89d6ac9b4b8d12f78327705905468530c5ed234fefe4fd020000006a473044022050254ba03b1e7c31baa50d9f6257eb7b32ec0b3b3807b0ab76d084f3fb39583302203c8f4a94017fe3d1ed0cc8dfad8485d27c2c1208f4635eb54c49eb007f2d2cf9012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff850f93af604365e3f2c36c126c34f3182eb76b35c5f020fc793086ad0db02e2f000000006a47304402201193c5e217e0fdf671bb1f2359c968c46d00f7504d70be63b2a135bbf2c6f12502207114f9a9c2278e99f4c0e52e709d8ecff3572e6ead4c143621e9d3b363e507a7012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffffab96213fb337f2420a0542d7591a1f1ebec532ad5fce589d4333faf1976e804a000000006a47304402200f2245cac25614f318763b0bdea3906017361c4e1cb93032a1b830851084fe10022054e66b9d365efd5288947eb3c8265d29428efcd0d858c7dccc9ff1b88766541c012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1fffffffff3ec6f0f688b9f5eba8da067fbd00a6935ff759fb342bb51702443638855f8c0000000006a473044022067669fabae6ede91fef5c510a8bc1aa652031b2945a6957e869b0b0b7d8c1c0b022077ea9fc7fd9bf8d3ac3ea33ab7e35b07f91ed7621de71f35e57f65af703ecfe9012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff35b8d31d1bec53b207dc359a54d1c339fc4b5d63f3a1a512639cb46b2da6750e000000006a473044022056028731a01653e3bd1f76a5f00675ced90cb90ba65d05eede8054f5b05f799002200f7e070bfc6f4889f7a39c7e275e6ce8d8775131ba272e2aeb3f25e2ce95c6ee012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff906450a7e78e2c8dca5fe388f821570be02ad23a2d4221b52907e5d2cc541592000000006a4730440220580ea6773c6d12b7fa50cdc61462ab758e18321eb54f27630e2868aefedca80202206f1a2da6cc8d8f147fb7c0556676878a0b44a5c88dd8fa59047382d950b6dae8012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffffbe5305e97cf4f01f84b35c7529a6a26797303f23e7025474650a3d2e6f25f49d000000006a473044022018a12e5583667f3c38fafb70e1f327af6a1084e5684ae95559cfa4c5783515dc02202f448fe4b07e81c6b69273178bb0963c318d1069f4910201ad51d428ce948961012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff3b7a0655320b325c12e7f0045c05be0fbc63da95e5a06db01aa4a98f72693ebf000000006a47304402202947b91d32c25d5674ffa37ca93a4bc01585cab909d4b1c588036126415f03aa022052c2c35c2c52fc896216ef8df96d5163db65a869b28b8164fa7005b5c0b27a32012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff4b215e5352c984ebdd49a57d63fe4e97a1d27b7b65d0462733c9fe9835fa2ec6020000006a47304402205fb969c95a34964748283947bdfd2144ccaf1965fb099febe79ca7eb05f85bba022070522ae95b869bcbf8b063fdf3ebe48d675a9e3e256af407b26e9227c2f7a6ea012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff467951f095083e5604e120f49fd41f0b4c83f3118fb4371a804e1ea8c66b679b020000006a47304402206b65c72e9aeb307b7d22e57c22767ac136491dfec91c52f4a90588c58c56f7c102204c7ae6736e07763356bfd5da1e55050980aa8745af048344bd5da069e8967ae4012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffffd1bea17a8da35f41008d70bd600b724a4631d958e1fa5b743a03dc4aa9250521000000006a4730440220516a3ebbc38ad81d036f3aa4c656d83b9f86348b84cb13663d8b2c5ce674a67a022012bf819134f78cf09c8219063ff1cfa2c34f1b5e5a5e02f68e5c7d678b5b61cf012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff14ed3604d32c836b8e17d33fa795e3a3132b62a75da41d59c19ffc8d1e738dd7000000006a4730440220496d3afcb1791266ac670c19701ee47dd17f74b6cddb0c2a07ffc4ab49826d11022056cac842cf5f690ec28caa6acff3e37c65150b6491dcfb7f43926720a431dbb6012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffffa4b841cffb3568b009aa61f59d01db31106ffffd5d085403f7f11e64ce3b1402000000006a473044022029e3e10a7be74b3b64fa5ebd88e5bfd0e83fa0a12a1429f80ac8b730889ffb5a02202e3a2632731a7fa9f20c74884a262e79ed2addc20970a1e37098db725791d7e7012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff03375ad3109801000017a91417ad3c3cd6e32aede379ac0efa42e310ba30b81d870000000000000000166a145786f27ae947255c21e47a3d3fe0d4e132f34e6c1e38c052190000001976a914124b0846223ef78130b8e544b9afc3b09988238688acb9847367\")] }, error: Response(electrum1.cipig.net:10051, Object({\"code\": Number(1), \"message\": String(\"the transaction was rejected by network rules.\\n\\n66: min relay fee not met\\n[010000000db9fee7764523e2fa8f89d6ac9b4b8d12f78327705905468530c5ed234fefe4fd020000006a473044022050254ba03b1e7c31baa50d9f6257eb7b32ec0b3b3807b0ab76d084f3fb39583302203c8f4a94017fe3d1ed0cc8dfad8485d27c2c1208f4635eb54c49eb007f2d2cf9012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff850f93af604365e3f2c36c126c34f3182eb76b35c5f020fc793086ad0db02e2f000000006a47304402201193c5e217e0fdf671bb1f2359c968c46d00f7504d70be63b2a135bbf2c6f12502207114f9a9c2278e99f4c0e52e709d8ecff3572e6ead4c143621e9d3b363e507a7012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffffab96213fb337f2420a0542d7591a1f1ebec532ad5fce589d4333faf1976e804a000000006a47304402200f2245cac25614f318763b0bdea3906017361c4e1cb93032a1b830851084fe10022054e66b9d365efd5288947eb3c8265d29428efcd0d858c7dccc9ff1b88766541c012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1fffffffff3ec6f0f688b9f5eba8da067fbd00a6935ff759fb342bb51702443638855f8c0000000006a473044022067669fabae6ede91fef5c510a8bc1aa652031b2945a6957e869b0b0b7d8c1c0b022077ea9fc7fd9bf8d3ac3ea33ab7e35b07f91ed7621de71f35e57f65af703ecfe9012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff35b8d31d1bec53b207dc359a54d1c339fc4b5d63f3a1a512639cb46b2da6750e000000006a473044022056028731a01653e3bd1f76a5f00675ced90cb90ba65d05eede8054f5b05f799002200f7e070bfc6f4889f7a39c7e275e6ce8d8775131ba272e2aeb3f25e2ce95c6ee012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff906450a7e78e2c8dca5fe388f821570be02ad23a2d4221b52907e5d2cc541592000000006a4730440220580ea6773c6d12b7fa50cdc61462ab758e18321eb54f27630e2868aefedca80202206f1a2da6cc8d8f147fb7c0556676878a0b44a5c88dd8fa59047382d950b6dae8012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffffbe5305e97cf4f01f84b35c7529a6a26797303f23e7025474650a3d2e6f25f49d000000006a473044022018a12e5583667f3c38fafb70e1f327af6a1084e5684ae95559cfa4c5783515dc02202f448fe4b07e81c6b69273178bb0963c318d1069f4910201ad51d428ce948961012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff3b7a0655320b325c12e7f0045c05be0fbc63da95e5a06db01aa4a98f72693ebf000000006a47304402202947b91d32c25d5674ffa37ca93a4bc01585cab909d4b1c588036126415f03aa022052c2c35c2c52fc896216ef8df96d5163db65a869b28b8164fa7005b5c0b27a32012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff4b215e5352c984ebdd49a57d63fe4e97a1d27b7b65d0462733c9fe9835fa2ec6020000006a47304402205fb969c95a34964748283947bdfd2144ccaf1965fb099febe79ca7eb05f85bba022070522ae95b869bcbf8b063fdf3ebe48d675a9e3e256af407b26e9227c2f7a6ea012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff467951f095083e5604e120f49fd41f0b4c83f3118fb4371a804e1ea8c66b679b020000006a47304402206b65c72e9aeb307b7d22e57c22767ac136491dfec91c52f4a90588c58c56f7c102204c7ae6736e07763356bfd5da1e55050980aa8745af048344bd5da069e8967ae4012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffffd1bea17a8da35f41008d70bd600b724a4631d958e1fa5b743a03dc4aa9250521000000006a4730440220516a3ebbc38ad81d036f3aa4c656d83b9f86348b84cb13663d8b2c5ce674a67a022012bf819134f78cf09c8219063ff1cfa2c34f1b5e5a5e02f68e5c7d678b5b61cf012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff14ed3604d32c836b8e17d33fa795e3a3132b62a75da41d59c19ffc8d1e738dd7000000006a4730440220496d3afcb1791266ac670c19701ee47dd17f74b6cddb0c2a07ffc4ab49826d11022056cac842cf5f690ec28caa6acff3e37c65150b6491dcfb7f43926720a431dbb6012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffffa4b841cffb3568b009aa61f59d01db31106ffffd5d085403f7f11e64ce3b1402000000006a473044022029e3e10a7be74b3b64fa5ebd88e5bfd0e83fa0a12a1429f80ac8b730889ffb5a02202e3a2632731a7fa9f20c74884a262e79ed2addc20970a1e37098db725791d7e7012102dbd8c73e2e80e4f3cf88d2f04a9d2d0df4269496608b14a3e17556fdcb01e0c1ffffffff03375ad3109801000017a91417ad3c3cd6e32aede379ac0efa42e310ba30b81d870000000000000000166a145786f27ae947255c21e47a3d3fe0d4e132f34e6c1e38c052190000001976a914124b0846223ef78130b8e544b9afc3b09988238688acb9847367]\")})) }))" })
The coins file excerpt:
"txfee": 1000000,
"dust": 1000000,
"force_min_relay_fee": true,
raven-cli getinfo shows "relayfee": 0.01000000
log entry in debug.log of ravend:
2024-12-31 01:30:57 Modifed fees: 2000000, minrelayfee: 2018000
Bug investigation results
A test was created to run UtxoTxBuilder::build() for the transaction in this issue.
This test calculated the tx fee as 2000000 (but should at least 3000000).
The cause for the issue is that build() fn does not include the change output in the tx size to produce the total tx fee.