BIP 54: return the appropriate type of error according to activation status in mempool submission - #118
Conversation
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.
|
This does however means that running with |
|
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). |
The current logic in
PreChecksalways 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 inPreChecksand inConnectBlock. Then we add a check toPreChecksfor 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.