v1.18: Fix - FailedVerification
and Closed
tombstones (backport of #419)
#605
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.
Problems
TransactionBatchProcessor::load_program_with_pubkey()
returnsLoadedProgramType::FailedVerification
even for accounts which never got to the verifier (because they are empty or buffers for example) which should be marked asLoadedProgramType::Closed
instead.LoadedProgramType::FailedVerification
should only be used if there is a chance a program gets valid again in the recompilation phase when the feature set and environment changes.In the tests we currently check that loading non existent accounts results in
LoadedProgramType::Closed
entries. This however can not happen in integration because we only attempt to load accounts which have a loader as a owner, thus these account must exist. The situation is similar to when we testedLoadedProgramType::FailedVerification
existing in the global cache (which can't happen either) and it led to confusion and wasted efforts.Summary of Changes
ProgramAccountLoadResult::AccountNotFound
byNone
TransactionBatchProcessor::load_program_accounts()
only returnProgramAccountLoadResult::InvalidAccountData
in other error casesTransactionBatchProcessor::load_program_with_pubkey()
returnLoadedProgramType::Closed
whenTransactionBatchProcessor::load_program_accounts()
returnedProgramAccountLoadResult::InvalidAccountData
replenish_program_cache()
when attempting to load a nonexistent account, and add a test for thattest_bpf_loader_upgradeable_deploy_with_max_len()
:mock_process_instruction()
by a proper message sendThis is an automatic backport of pull request Fix -
FailedVerification
andClosed
tombstones #419 done by Mergify.