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. jameshilliard commented at 5:14 am on March 9, 2016: contributor
    concept ACK
  9. 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.
  10. in src/main.h: 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.
  11. luke-jr referenced this in commit 3b30ebe63c on Jun 28, 2016
  12. luke-jr referenced this in commit 9c0febaaef on Jun 28, 2016
  13. 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.
  14. 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.
  15. luke-jr force-pushed on Aug 6, 2016
  16. luke-jr force-pushed on Aug 24, 2016
  17. MarcoFalke commented at 5:58 pm on October 22, 2016: member
    Needs rebase on top of master instead of 0.13
  18. luke-jr force-pushed on Nov 12, 2016
  19. 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.
  20. luke-jr force-pushed on Nov 16, 2016
  21. paveljanik commented at 7:51 pm on December 10, 2016: contributor
    Concept ACK Needs rebase.
  22. luke-jr force-pushed on Dec 26, 2016
  23. 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.

  24. luke-jr force-pushed on Feb 2, 2017
  25. luke-jr force-pushed on Feb 5, 2017
  26. 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)?
  27. TheBlueMatt commented at 5:45 pm on July 11, 2017: member
    Agree with @sipa. This is not going to be maintainable for API clients. Are you planning on rebasing this luke?
  28. 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.

  29. 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).
  30. luke-jr force-pushed on Aug 16, 2017
  31. luke-jr force-pushed on Aug 16, 2017
  32. 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.

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

  41. 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…)
  42. 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.
  43. ghost commented at 8:43 am on January 25, 2018: none
    this seems kool lets merge it
  44. 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.
  45. MarcoFalke added the label Needs rebase on Jun 6, 2018
  46. laanwj added the label Up for grabs on Aug 31, 2018
  47. 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
  48. laanwj closed this on Aug 31, 2018

  49. laanwj removed the label Needs rebase on Oct 24, 2019
  50. MarcoFalke removed the label Up for grabs on Dec 23, 2020
  51. MarcoFalke commented at 4:15 pm on December 23, 2020: member
    Did something like this in #20753
  52. DrahtBot 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: 2024-06-26 16:12 UTC

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