-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1.18: Fix - FailedVerification
and Closed
tombstones (backport of #419)
#605
Conversation
Cherry-pick of 55c05c5 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
4960a0f
to
2fd67fd
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v1.18 #605 +/- ##
=======================================
Coverage 81.5% 81.5%
=======================================
Files 827 827
Lines 224833 224852 +19
=======================================
+ Hits 183453 183474 +21
+ Misses 41380 41378 -2 |
2fd67fd
to
8eb1fba
Compare
* Only the verifier can cause FailedVerification, everything else is Closed * Removes the environments parameter from load_program_accounts(). * cargo fmt * Simplify invocation of deployed program * Attempt to invoke a program before it is deployed * Attempt to invoke a buffer before it is used in a deployment * Escalates Option return value of load_program_accounts() to load_program_with_pubkey(). * Review feedback (cherry picked from commit 55c05c5)
8eb1fba
to
37726cb
Compare
…anza-xyz#419) (anza-xyz#605) Fix - `FailedVerification` and `Closed` tombstones (anza-xyz#419) * Only the verifier can cause FailedVerification, everything else is Closed * Removes the environments parameter from load_program_accounts(). * cargo fmt * Simplify invocation of deployed program * Attempt to invoke a program before it is deployed * Attempt to invoke a buffer before it is used in a deployment * Escalates Option return value of load_program_accounts() to load_program_with_pubkey(). * Review feedback (cherry picked from commit 55c05c5) Co-authored-by: Alexander Meißner <[email protected]>
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.