Fix 'mempool min fee not met' debug output #12356

pull Empact wants to merge 3 commits into bitcoin:master from Empact:minfee-message changing 10 files +25 −16
  1. Empact commented at 3:55 PM on February 5, 2018: member

    Output the value that is tested, rather than the unmodified fee value.

    Prompted by looking into: #11955

  2. Empact force-pushed on Feb 5, 2018
  3. promag commented at 5:00 PM on February 5, 2018: member

    utACK 875d62f.

    It would be nice to add tests for mempool min fee not met and mempool full errors, it's the missing cases of REJECT_INSUFFICIENTFEE.

  4. fanquake added the label Mempool on Feb 5, 2018
  5. Empact force-pushed on Feb 6, 2018
  6. Empact force-pushed on Feb 6, 2018
  7. Empact force-pushed on Feb 7, 2018
  8. Empact force-pushed on Feb 7, 2018
  9. Empact commented at 3:55 AM on February 7, 2018: member

    I added a change to include the full FormatStateMessage output in RPC errors that are currently including just the reason or reason + code. That would include the missing debug output that comes up e.g. in #11955

  10. in test/functional/mempool_limit.py:58 in 16d05540f6 outdated
      49 | @@ -50,5 +50,18 @@ def run_test(self):
      50 |          assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
      51 |          assert_greater_than(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
      52 |  
      53 | +        self.log.info('Create a mempool tx that will not pass mempoolminfee')
      54 | +        us0 = utxos.pop()
      55 | +        inputs = [{ "txid" : us0["txid"], "vout" : us0["vout"]}]
      56 | +        outputs = {self.nodes[0].getnewaddress() : 0.0001}
      57 | +        tx = self.nodes[0].createrawtransaction(inputs, outputs)
      58 | +        self.nodes[0].settxfee(relayfee) # specifically fund this tx with a fee < mempoolminfee, >= than minrelaytxfee
    


    promag commented at 10:18 AM on February 8, 2018:

    I believe you can set feeRate option in fundrawtransaction instead.

  11. in test/functional/mempool_limit.py:64 in 16d05540f6 outdated
      59 | +        txF = self.nodes[0].fundrawtransaction(tx)
      60 | +        self.nodes[0].settxfee(0) # return to automatic fee selection
      61 | +        tx_hex = self.nodes[0].signrawtransaction(txF['hex'])['hex']
      62 | +        tx_id = self.nodes[0].decoderawtransaction(tx_hex)["txid"]
      63 | +        assert_raises_rpc_error(-26, "66: mempool min fee not met", self.nodes[0].sendrawtransaction, tx_hex)
      64 | +        assert(tx_id not in self.nodes[0].getrawmempool())
    


    promag commented at 10:21 AM on February 8, 2018:

    I guess there is no need to assert this, sendrawtransaction above failed. This assert makes sense when testing sendrawtransaction failure, so move it there if it's missing.


    Empact commented at 4:03 PM on February 8, 2018:

    Fair enough, removed that and generally simplified the test.

    Fyi I was following the example set in: https://github.com/bitcoin/bitcoin/blob/master/test/functional/mining_prioritisetransaction.py#L124

  12. promag commented at 10:24 AM on February 8, 2018: member

    Make "Consistently use FormatStateMessage in RPC error output" commit the first (or second) so that the new test is not changed.

  13. Fix 'mempool min fee not met' debug output
    Output the value that is tested, rather than the unmodified fee value.
    c04e0f607a
  14. Add test for 'mempool min fee not met' rpc error 8b8a1c4f8b
  15. Consistently use FormatStateMessage in RPC error output
    This will include the error code and debug output as well as the reason string.
    
    See #11955 for the motivation.
    bb00c95c16
  16. Empact force-pushed on Feb 8, 2018
  17. dcousens approved
  18. laanwj merged this on Feb 15, 2018
  19. laanwj closed this on Feb 15, 2018

  20. laanwj referenced this in commit fd65937ec6 on Feb 15, 2018
  21. promag commented at 3:45 PM on February 15, 2018: member

    utACK bb00c95. Thanks for the commit reorder @Empact.

  22. Empact deleted the branch on Feb 16, 2018
  23. Empact referenced this in commit fc079e359a on Feb 16, 2018
  24. Empact referenced this in commit e710387ca9 on Feb 16, 2018
  25. MarcoFalke referenced this in commit 23481fa503 on Feb 16, 2018
  26. in test/functional/mempool_limit.py:61 in bb00c95c16
      56 | +        outputs = {self.nodes[0].getnewaddress() : 0.0001}
      57 | +        tx = self.nodes[0].createrawtransaction(inputs, outputs)
      58 | +        # specifically fund this tx with a fee < mempoolminfee, >= than minrelaytxfee
      59 | +        txF = self.nodes[0].fundrawtransaction(tx, {'feeRate': relayfee})
      60 | +        txFS = self.nodes[0].signrawtransaction(txF['hex'])
      61 | +        assert_raises_rpc_error(-26, "mempool min fee not met, 166 < 411 (code 66)", self.nodes[0].sendrawtransaction, txFS['hex'])
    


    MarcoFalke commented at 9:14 PM on February 22, 2018:

    The transaction is created non-deterministically, thus you can't hardcode the exact value here.

    See for example the following failure (off-by-two):

    AssertionError: Expected substring not found:mempool min fee not met, 166 < 409 (code 66)
    

    Empact commented at 9:27 PM on February 22, 2018:

    Ok, will send up a fix shortly.

  27. Willtech referenced this in commit 2f0b180464 on Feb 23, 2018
  28. hkjn referenced this in commit 89e044270f on Feb 23, 2018
  29. laanwj referenced this in commit 955fd23517 on Mar 5, 2018
  30. HashUnlimited referenced this in commit e0d4e75288 on Jul 31, 2018
  31. lionello referenced this in commit c13bfe9b71 on Nov 7, 2018
  32. PastaPastaPasta referenced this in commit 3c0f689243 on Jun 9, 2020
  33. PastaPastaPasta referenced this in commit 5cd83205ab on Jun 9, 2020
  34. PastaPastaPasta referenced this in commit b2735215d5 on Jun 10, 2020
  35. PastaPastaPasta referenced this in commit 44ed3001c2 on Jun 10, 2020
  36. PastaPastaPasta referenced this in commit 831ff51a7f on Jun 11, 2020
  37. PastaPastaPasta referenced this in commit d3725fd130 on Jun 11, 2020
  38. PastaPastaPasta referenced this in commit 9167df9e5f on Jun 11, 2020
  39. PastaPastaPasta referenced this in commit bec0ce9cba on Jun 11, 2020
  40. PastaPastaPasta referenced this in commit 31bc883118 on Jun 11, 2020
  41. PastaPastaPasta referenced this in commit 40ad658abb on Jun 11, 2020
  42. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me