Engine API: replace terminal block error with INVALID_TERMINAL_BLOCK status #170
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.
Replaces
-32002: Invalid terminal block
error withINVALID_TERMINAL_BLOCK
status value.The motivation behind this change is to have terminal block conditions check handled in a way similar to other block validity conditions in terms of response to CL.
Additionally, this PR does also contain an explicit requirement on invalidating all descendants of the last PoW block in the chain if this PoW block is not a valid terminal block.
Alternatively, we could use an
INVALID
status to signal terminal block conditions violations. But this status is accompanied withlatestValidHash
which in the case of invalid terminal block can't be clearly defined, and moreover doesn't exist on CL. Thus, having a separate status tells that entire block tree starting from a transition block must be invalidated by CL, if this transition block is built upon invalid terminal block.