This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
Use NET bill in transaction receipt during light validation mode #8856
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.
Change Description
Since the NET bill is objective, a node in full validation mode is able to calculate what the NET bill for a transaction should be. Even with this change, a node in full validation mode will always compute the NET bill rather than blindly trusting the NET bill provided by the producer in the transaction receipt and it will reject the block if there is a mismatch.
However, with the changes in this PR, a node operating in a mode where the normal transaction checks are skipped (light validation mode or applying a block by a trusted producer) will now simply use the NET bill provided by the producer in the transaction receipt rather than computing the amount itself. This sets the stage for later changes that allow a light validation node to apply a block that may have had some context-free data within the block removed, which would make it impossible to calculate the correct NET bill.
This PR also adds a new unit test,
resource_limits_test/light_net_validation
, to test the new behavior.Consensus Changes
API Changes
Documentation Additions