Skip to content

policy: don't CheckEphemeralSpends on reorg#33616

Merged
sedited merged 1 commit intobitcoin:masterfrom
instagibbs:2025-10-bypass_checkephemeral
Feb 25, 2026
Merged

policy: don't CheckEphemeralSpends on reorg#33616
sedited merged 1 commit intobitcoin:masterfrom
instagibbs:2025-10-bypass_checkephemeral

Conversation

@instagibbs
Copy link
Member

@instagibbs instagibbs commented Oct 13, 2025

Similar reasoning to #33504

During a deeper reorg it's possible that a long sequence of dust-having transactions that are connected in a linear fashion. On reorg, this could cause each subsequent "generation" to be rejected. These rejected transactions may contain a large amount of competitive fees via normal means.

PreCheck based PreCheckEphemeralSpends is left in place because we wouldn't have relayed them prior to the reorg.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 13, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33616.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK darosior, ismaelsadeeq, sedited

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #33959 (test: use ForkGenerator to deduplicate reorg test code by yuvicc)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

LLM Linter (✨ experimental)

Possible typos and grammar issues:

  • Does context-less checks about a single transaction. -> Performs context-less checks on a single transaction. [Subject-verb mismatch: "Does ... checks" is ungrammatical; "Performs ... checks on" is correct and clearer]

2026-02-25 14:24:30

@instagibbs instagibbs changed the title 2025 10 bypass checkephemeral policy: don't CheckEphemeralSpends on reorg Oct 13, 2025
Copy link
Member

@glozow glozow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to make sense. I'd feel more confident if we add some more test cases for topologies and reorg scenarios that this does (not) apply to?

@@ -1608,7 +1608,7 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactions(const std::
}

// Now that we've bounded the resulting possible ancestry count, check package for dust spends
if (m_pool.m_opts.require_standard) {
if (!args.m_bypass_limits && m_pool.m_opts.require_standard) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's impossible for m_bypass_limits to be true in this function, so undoing this diff doesn't make a difference. Could we omit it or Assume(!args.m_bypass_limits)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took feedback in other PR ahead of time #33504 (comment)

I can definitely put an Assume() on it.

Copy link
Member

@darosior darosior Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mild preference for consistency between the two checks that are disabled upon reorgs: either we gate both TRUC and ephemeral dust on !bypass_limits in both code paths, or we gate both only on the AcceptSingleTx code path. Since the TRUC bypass is not enabled in AccecptMultiTx, the easier seems to be dropping it in this PR. Assume sounds good.

Not a blocker for me. Happy to re-ACK if you drop it and/or add an Assume.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This confused me until I read the discussion here. I would appreciate if it were dropped.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dropped it

@instagibbs
Copy link
Member Author

marking as draft for now until it becomes dependency-less and I've looked over the tests some more

@instagibbs instagibbs force-pushed the 2025-10-bypass_checkephemeral branch from 0ae5db4 to 9ddde71 Compare November 26, 2025 14:09
@instagibbs instagibbs force-pushed the 2025-10-bypass_checkephemeral branch from 9ddde71 to a5299c3 Compare December 1, 2025 17:36
@instagibbs instagibbs marked this pull request as ready for review December 1, 2025 17:37
@instagibbs
Copy link
Member Author

Added some more coverage and now has no dependencies.

@fanquake fanquake added this to the 31.0 milestone Dec 4, 2025
@ismaelsadeeq
Copy link
Member

Concept ACK

1 similar comment
@darosior
Copy link
Member

Concept ACK

@ismaelsadeeq
Copy link
Member

ACK a5299c3

The comment for CheckEphemeralSpends seems incorrect. It currently states, "Must be called for each package/transaction with dust." That is no longer the case. It wasn’t the case before either, because on the test chain, you can override and accept non-standard transactions, and then it won’t be called.

@DrahtBot DrahtBot requested a review from darosior February 24, 2026 13:00
@instagibbs instagibbs force-pushed the 2025-10-bypass_checkephemeral branch from a5299c3 to 2854de7 Compare February 24, 2026 15:42
@instagibbs
Copy link
Member Author

@ismaelsadeeq dropped the "must" in both places, since they are not true.

@ismaelsadeeq
Copy link
Member

reACK 2854de7

9a3631b1b..2854de7b fixed a comment as mentioned in #33616 (comment)

Copy link
Member

@darosior darosior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 2854de7

@sedited
Copy link
Contributor

sedited commented Feb 25, 2026

Approach ACK

Looks good, but I would prefer to see glozow's original comment addressed.

@instagibbs instagibbs force-pushed the 2025-10-bypass_checkephemeral branch from 2854de7 to 33fbaed Compare February 25, 2026 14:23
@darosior
Copy link
Member

re-ACK 33fbaed

@ismaelsadeeq
Copy link
Member

reACK 33fbaed

Copy link
Contributor

@sedited sedited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 33fbaed

@sedited sedited merged commit 7c80301 into bitcoin:master Feb 25, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants