New and fixed tests for gas refunding and block weight reporting#1883
Merged
timbrinded merged 19 commits intomasterfrom Oct 26, 2022
Merged
New and fixed tests for gas refunding and block weight reporting#1883timbrinded merged 19 commits intomasterfrom
timbrinded merged 19 commits intomasterfrom
Conversation
crystalin
reviewed
Oct 20, 2022
crystalin
reviewed
Oct 25, 2022
crystalin
approved these changes
Oct 25, 2022
imstar15
pushed a commit
to AvaProtocol/moonbeam
that referenced
this pull request
May 16, 2023
…nbeam-foundation#1883) * Draft new weight tests * Hardened test * Updated test * Calculated non-ext weights * Combined block weight packs * Added context state storage * first draft * reverted pkg.json changes * Fixed context * Lint * lint * removed chai-roughly * Killed memo idea * tidied comments * lint * Small Fixes
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.
What does it do?
Contains tests for MOON-1913, as well as additional tests for:
What important points reviewers should know?
This refactors existing test
tests/smoke-tests/test-block-weight-per-class.tsin order to make it a more functional flavour.I've added the a memo feature to the context function, so I can pass immutable state between tests. This is massively reduces the amount of async calls required to do multiple tests on the same data set.
What alternative implementations were considered?
We used to have a lot of old code that used global scope
lets to pass state around, which was unsafe and messy. However duplicating and pushing everything into the tests themselves would not be performant.Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?
Related:
polkadot-evm/frontier#865
https://purestake.atlassian.net/browse/MOON-1912
What value does it bring to the blockchain users?
Better gas usage reporting and ultimately will flag up any incorrectly full blocks on prod networks.