fullblocktests: Add ErrInvalidRevokeInput test. - #3786
Open
matthawkins90 wants to merge 1 commit into
Open
Conversation
This adds a test which ensures the chain rejects a block when a revocation references a ticket output other than the submission output. The test mutates the revocation to reference the ticket change output. The change output still exists in the utxo set, so the input existence checks pass and the index check itself rejects the block. This also renames brt7 to brt8 so the accepted block that ends the revocation series keeps the highest number.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is work towards #1182.
This adds full block test coverage for
ErrInvalidRevokeInput(which used to be namedErrInvalidSSRtxInputbefore #1468). The newbrt7block contains a revocation whose ticket input references the ticket change output (index 2) instead of the submission output (index 0).Issue #1182 quotes an old TestBlockValidationRules comment that called this error impossible to hit:
#1307 proposed to remove the check, but Dave wrote:
That earlier check (
checkTicketRedeemers) matches missed tickets by hash only. A revocation with the right hash and a wrong index passes it and reaches the wrong-index check incheckRevocationInputs.Further analysis in the issue thread considered a revocation that references non-stake outputs, which other checks catch.
Notes:
countP2SHSigOpswithErrMissingTxOut.brt7becomesbrt8. This follows the convention from chaingen/fullblocktests: Add disapproval tests. #1485, which renamedbrtfinaltobrt7when it extended the series: the accepted block that ends the series keeps the highest number.existsMissedTicket), because fullblocktests does not activate the automatic revocations agenda.A note on the companion kind
ErrInvalidVoteInput(namedErrInvalidSSGenInputbefore #1468): it is not reachable from a block, so no test is added for it.CheckSSGenVotesrejects any nonzero ticket input index during classification (ErrSSGenWrongIndex), so the chain never classifies such a transaction as a vote andcheckVoteInputsnever runs. A trial block failed at sanity withErrBadTxInput, which matches the result reported in the issue thread.