RPC: sendrawtransaction: Allow the user to ignore/override specific rejections #7533

pull luke-jr wants to merge 6 commits into bitcoin:master from luke-jr:sendraw_force changing 13 files +243 −125
  1. luke-jr commented at 9:00 AM on February 14, 2016: member

    Replace boolean allowhighfees with an Array of rejections to ignore (in a backward compatible manner)

    This is useful for node operators who wish to manually accept transactions that don't meet their typical policies, yet don't necessarily want to override all the policies.

    It's a bit ugly internally - suggestions on improving that are welcome.

  2. luke-jr force-pushed on Feb 14, 2016
  3. luke-jr referenced this in commit 0793f9a834 on Feb 14, 2016
  4. luke-jr referenced this in commit bfd00aa78e on Feb 14, 2016
  5. luke-jr referenced this in commit 26b5f34eed on Feb 14, 2016
  6. laanwj added the label RPC on Feb 15, 2016
  7. luke-jr referenced this in commit 1193a14ff9 on Feb 25, 2016
  8. luke-jr cross-referenced this on Mar 2, 2016 from issue mempool min fee not met when using sendrawtransaction by grue0
  9. jameshilliard commented at 5:14 AM on March 9, 2016: contributor

    concept ACK

  10. promag commented at 8:04 AM on March 9, 2016: member

    @luke-jr why not turn the second argument an JSON object to be more scalable. For instance, I was planning to add option unlockUnspents.

  11. in src/main.h:None in 1cc1ce4c9b outdated
     280 | @@ -281,7 +281,22 @@ void PruneAndFlush();
     281 |  
     282 |  /** (try to) add transaction to memory pool **/
     283 |  bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
    


    MarcoFalke commented at 9:02 AM on March 30, 2016:

    Wouldn't it make sense to finally get rid of fLimitFree, which is only hardcoded to false for the wallet and sendrawtransaction?


    luke-jr commented at 6:13 AM on November 12, 2016:

    It does already support ignoring "rate limited free transaction" failures, but fLimitFree not only bypasses such failures, it also exempts the transaction from the rate limiting count entirely.

  12. luke-jr referenced this in commit 3b30ebe63c on Jun 28, 2016
  13. luke-jr referenced this in commit 9c0febaaef on Jun 28, 2016
  14. jameshilliard commented at 6:32 PM on July 5, 2016: contributor

    Is this something that we might be able to get in 0.13? Without something like this the alternative for pool operators is usually to patch out the problematic is-standard check blocking the send which is usually not desired.

  15. laanwj commented at 12:55 PM on July 11, 2016: member

    Sorry, no, this missed the feature freeze for 0.13 by a long haul.

  16. luke-jr force-pushed on Aug 6, 2016
  17. luke-jr force-pushed on Aug 24, 2016
  18. MarcoFalke commented at 5:58 PM on October 22, 2016: member

    Needs rebase on top of master instead of 0.13

  19. luke-jr force-pushed on Nov 12, 2016
  20. luke-jr commented at 7:05 AM on November 12, 2016: member

    @jameshilliard Knots has had this for a while. Miners should probably be using it anyway. @MarcoFalke Rebased.

  21. luke-jr force-pushed on Nov 16, 2016
  22. paveljanik commented at 7:51 PM on December 10, 2016: contributor

    Concept ACK Needs rebase.

  23. luke-jr force-pushed on Dec 26, 2016
  24. luke-jr commented at 6:58 PM on December 26, 2016: member

    Rebased.

    Could be combined with #9422 to restore policy-bypassing transactions after a restart, but I consider that beyond the scope of this PR, and something to address after both get merged.

  25. luke-jr force-pushed on Feb 2, 2017
  26. luke-jr force-pushed on Feb 5, 2017
  27. sipa commented at 2:36 PM on April 9, 2017: member

    I'm not convinced about the need to ignore based on the exact reason (as that is likely something that's hard to maintain, as reasons change over time). How about just a boolean to bypass standardness/fee/mempool policy rules (but keep consensus and script execution flags for upgradability)?

  28. TheBlueMatt commented at 5:45 PM on July 11, 2017: contributor

    Agree with @sipa. This is not going to be maintainable for API clients. Are you planning on rebasing this luke?

  29. luke-jr commented at 2:22 PM on August 14, 2017: member

    Typically people only want to bypass a specific policy, and not others. For example, a miner might want to bypass the fee checks or bypass the ancestor limit on replacements, but not other policies.

    Will have a rebase done soon.

  30. jameshilliard commented at 9:46 PM on August 14, 2017: contributor

    I don't think it's all that important to have the ability to have granular overrides, if that's important to some miners it can be implemented externally, most of the time a miner will just want to force add the transaction and will have already checked that it violates policy rules(often by looking at the failure reason when they try and send it normally).

  31. luke-jr force-pushed on Aug 16, 2017
  32. luke-jr force-pushed on Aug 16, 2017
  33. luke-jr commented at 6:34 PM on August 16, 2017: member

    @jameshilliard It can't be added externally... Looking at the first failure reason won't tell you if it violates other policies as well.

    Anyhow, rebase is ready for review, and refactored somewhat so hopefully it's also easier to review.

  34. AcceptToMemoryPool: Standardise rejection reason format
    BIP22-like
    963da741dd
  35. AreInputsStandard: Return specific reject reasons c59e716625
  36. AcceptToMemoryPool: Refactor overrideable rejections (previously fOverrideMempoolLimit) with flexible set of rejections to ignore e786e726d4
  37. AcceptToMemoryPool: Replace fLimitFree[=false] with rejectmsg_gratis in ignore_rejects 916f12fa67
  38. Make bad-witness-nonstandard rejection more specific, and support overriding some 38b8fc9ec4
  39. RPC: sendrawtransaction: Replace boolean allowhighfees with an Array of rejections to ignore (in a backward compatible manner) 89e516ffcb
  40. luke-jr force-pushed on Aug 21, 2017
  41. sipa commented at 7:47 PM on September 21, 2017: member

    I think the ability to override specific rejection reasons is overkill, and risks creating an interface that is unmaintainable.

    A boolean to say "ignore all policy, accept if consensus-valid" would be fine, though.

  42. laanwj commented at 7:58 PM on September 21, 2017: member

    Agree with @sipa, making this too granular makes this unmaintainable as rejection reasons might come and go, or implemented differently, as policy changes. After all, policy is not standardized. (on the other hand ,the interface would be expected to change based on policy changes...)

  43. DuncanBetts commented at 2:05 PM on January 8, 2018: none

    I've just been mulling over this. How about giving node operators a hook, and allowing them to implement this sort of functionality themselves if they need it. I note that no node operators aside luke have requested this functionality here. I don't know how practical my suggestion is.

  44. ghost commented at 8:43 AM on January 25, 2018: none

    this seems kool lets merge it

  45. Sjors commented at 9:26 PM on March 8, 2018: member

    Needs love (as in, needs rebase and addressing concerns). A simpler alternative is probably the best way to move this forward. Some examples of use cases would be nice too; "node operators who wish to manually accept transactions that don't meet their typical policies" is a bit vague.

  46. MarcoFalke added the label Needs rebase on Jun 6, 2018
  47. luke-jr cross-referenced this on Jul 29, 2018 from issue policy: Report reason inputs are nonstandard from AreInputsStandard by Empact
  48. laanwj added the label Up for grabs on Aug 31, 2018
  49. laanwj commented at 10:48 AM on August 31, 2018: member

    Closing and adding "up for grabs", this is the oldest PR and has been inactive for quite long, too

  50. laanwj closed this on Aug 31, 2018

  51. luke-jr cross-referenced this on May 1, 2019 from issue Rpc removemempoolentry by IntegralTeam
  52. laanwj removed the label Needs rebase on Oct 24, 2019
  53. MarcoFalke cross-referenced this on Oct 19, 2020 from issue Allow spending from segwit addresses created from uncompressed private keys (P2SH-P2WPKH) by leventturksoy
  54. MarcoFalke removed the label Up for grabs on Dec 23, 2020
  55. MarcoFalke commented at 4:15 PM on December 23, 2020: member

    Did something like this in #20753

  56. jnewbery cross-referenced this on Dec 29, 2020 from issue rpc: Allow to ignore specific policy reject reasons by MarcoFalke
  57. bitcoin locked this on Feb 15, 2022

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-05-19 06:55 UTC