Repository navigation
[PVM] Fix Psi_M to panic when the program fails to load - #374
Merged
Merged
Conversation
- follows `Ψ_M` of the Graypaper, which yields the PVM exit reason `panic` with no gas used when `Y` or `deblob` fails, where FastRoll returned an error and rejected the block - adds `get_or_load_program`, which returns `None` for such a program and does not cache it - returns `PVMInvocationResult::panic(0)` from `invoke_with_args` on `None` - tests the load failures and a `Ψ_M` panic on a program failing `deblob`
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.
Summary
Fixes
Ψ_Mso that a program which fails standard program initialization (Y) ordeblobends the invocation with the PVM exit reasonpanicand gas used 0. Before, the failure became an error that rejected the whole block. The rule is the same in GP v0.7.2 and v0.8.0, so this is not a deviation.What was wrong
invoke_with_argsreturnedErr(PVMError)forfrom_standard_program,is_program_size_validcheck andProgramLoader::load_program. In accumulation this became aTransitionErrorand rejected the block.Changes
get_or_load_programreads the global program cache and loads the program on a miss. It returnsNonewhenYordeblobfails, and such a program is not cached.invoke_with_argsreturnsPVMInvocationResult::panic(0)onNone, as it already did whenPVM::new_with_formatted_programfails.Ψ_Mcaller (accumulate, refine, is-authorized).