Skip to content

BIP 54: return the appropriate type of error according to activation status in mempool submission - #118

Closed
darosior wants to merge 3 commits into
bitcoin-inquisition:29.xfrom
darosior:2607_extract_legacy_sigops
Closed

BIP 54: return the appropriate type of error according to activation status in mempool submission#118
darosior wants to merge 3 commits into
bitcoin-inquisition:29.xfrom
darosior:2607_extract_legacy_sigops

Conversation

@darosior

Copy link
Copy Markdown

The current logic in PreChecks always returns a consensus error for legacy sigops violations and a standardness error for 64-byte transactions.

This PR fixes it by reverting the inclusion of the BIP 54 sigops check inside CheckTxInputs (#99 (comment)) and explicitly performing the check depending on activation status both in PreChecks and in ConnectBlock. Then we add a check to PreChecks for transactions that are exactly 64 bytes, to return a consensus error when BIP 54 is active.

The last commit complements the existing functional test by sanity checking that we return the appropriate type of error before and after activation.

darosior added 3 commits July 22, 2026 17:40
This makes it possible to return the appropriate type of error for
mempool submission failures: a standardness error before BIP 54
activation and a consensus error afterwards.
…ation

We would previously always return a standardness error.
@darosior

Copy link
Copy Markdown
Author

This does however means that running with -acceptnonstdtxn would accept transactions violation the BIP54-sigops rule, as per AJ's comment here: #99 (comment).

@darosior

Copy link
Copy Markdown
Author

So the error type (consensus vs standardness) is not exposed to the user. This patch therefore really only changes the error message before and after activation. Since the error message already doesn't contain "consensus-critical" language (like for instance "mandatory script flag"), i don't think this is worth doing because this change also has the drawback mentioned just above, as well as making the upstream patch further diverge from what has been tested on Inquisition.

Therefore i think a better alternative is to simply make both the legacy sigops and the stripped size errors consensus, as i did in my draft PR to upstream: #99 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant