forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 3
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
[PVM] AddressStateTx and tests refactoring #348
Merged
Merged
Conversation
This file contains 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
evlekht
changed the base branch from
evlekht/new-dev-resulting
to
cortina-15-dev/cortina-cleanup
July 24, 2024 09:28
evlekht
force-pushed
the
cortina-15-dev/cortina-cleanup
branch
from
July 24, 2024 10:41
0f8c1c3
to
eb5231d
Compare
evlekht
force-pushed
the
cortina-15-dev/addr-state-tx-test-refactor
branch
from
July 24, 2024 10:42
0018a72
to
4fa4308
Compare
mo-c4t
previously approved these changes
Jul 24, 2024
havan
previously approved these changes
Jul 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look consistent with the original PR.
evlekht
force-pushed
the
cortina-15-dev/cortina-cleanup
branch
from
July 25, 2024 12:56
eb5231d
to
6112960
Compare
evlekht
dismissed stale reviews from havan and mo-c4t
July 25, 2024 12:57
The base branch was changed.
evlekht
force-pushed
the
cortina-15-dev/addr-state-tx-test-refactor
branch
from
July 25, 2024 12:59
4fa4308
to
6881669
Compare
evlekht
force-pushed
the
cortina-15-dev/addr-state-tx-test-refactor
branch
from
July 25, 2024 13:00
6881669
to
449e162
Compare
mo-c4t
approved these changes
Jul 25, 2024
evlekht
added a commit
that referenced
this pull request
Aug 1, 2024
(cherry picked from commit 8d23dfe)
evlekht
added a commit
that referenced
this pull request
Aug 1, 2024
(cherry picked from commit 8d23dfe)
evlekht
added a commit
that referenced
this pull request
Aug 1, 2024
(cherry picked from commit 8d23dfe)
evlekht
added a commit
that referenced
this pull request
Aug 1, 2024
(cherry picked from commit 8d23dfe)
evlekht
added a commit
that referenced
this pull request
Aug 1, 2024
(cherry picked from commit 8d23dfe)
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.
Why this should be merged
This PR is mainly focused on rewriting addressStateTx execution and syntacticVerify tests as well as refactoring some parts of addressStateTx execution logic.
Previous syntacticVerify wasn't correctly splitting test cases for testing package and wasn't handling all required test cases.
Previous execution test wasn't correctly testing things at all and there were also separate test function for testing node deferring/resuming.
And addressStateTx execution logic just had some checks and state actions in a not optimal order.
This PR also updates tx builder, so its addressStateTx method will support upgradeVersion1.
How this works
SyntacticVerify test were simply rewritten, so it will match pattern of other syntactic tests, where each test case it called with its own t.Run(). There are also previously missing test cases, that were added.
AddressStateTx execution refactoring is basically only about renaming and some reshuffling of checks and state function calls, so checks will always go first before any other action, also prioritizing stateless checks first.
There are other small changes, but they're mostly renaming.
The most complex change is execution logic test rewrite. This complexity comes out of of transaction structure, 64 possible bits of address states, permissions logic and 3 different phases (for now ) that are putting different limitations on allowed bits and tx structure. So, it all have to be combined, and not every combination is possible. And some of combinations require different mock setups for state.
codec.UpgradeVersion
In athens, we added new feature to codec.
Its a technical field called "UpgradeVersionID". It must be first field in struct.
This field value is used to determine upgradeVersion value.
And fields of marshallable with codec structs like transactions, they could have tag "upgradeversion:n". Fields with this tag will be ignored if structure upgradeVersion is less, than tags value.
How this was tested
With new unit tests.
Additional references
Original PR based on cortina-19 dev
#335