forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: types.StateAccount
pseudo-generic payload
#44
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
ARR4N
added a commit
that referenced
this pull request
Oct 1, 2024
All commits except the last two constitute PRs #43 and #44. The last two reverted files such that only changes to the `pseudo` and `ethtest` packages remain; once this is merged into the `libevm` branch then `libevm` will be merged into the branch for #44 too. Cherry-picking commits was not possible as some touched both halves of the changes; the squash-merges will, however, make this convoluted history irrelevant. * feat: `types.StateAccount` pseudo-generic payload * feat: registration of `StateAccount` payload type * chore: mark `eth/tracers/logger` flaky * chore: copyright header + `gci` * test: lock default `types.SlimAccount` RLP encoding * feat: `vm.SlimAccount.Extra` from `StateAccount` equiv * chore: placate the linter * test: `pseudo.Type.EncodeRLP()` * test: `pseudo.Type.DecodeRLP()` * fix: `pseudo.Type.DecodeRLP()` with non-pointer type * feat: `pseudo.Type.IsZero()` and `Type.Equal(*Type)` * feat: `types.StateAccountExtra.DecodeRLP()` * chore: revert non-pseudo-package modifications * chore: delete non-pseudo-package additions
darioush
approved these changes
Oct 1, 2024
darioush
reviewed
Oct 1, 2024
darioush
reviewed
Oct 1, 2024
@@ -579,6 +579,7 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject { | |||
Balance: acc.Balance, | |||
CodeHash: acc.CodeHash, | |||
Root: common.BytesToHash(acc.Root), | |||
Extra: acc.Extra, // no need to deep-copy as `acc` is short-lived |
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.
this code is also removed upstream in upcoming revisions, fyi
@darioush I added the |
darioush
approved these changes
Oct 2, 2024
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
Allows
types.StateAccount
to mirrorava-labs/coreth
behaviour w.r.t. RLP encoding (i.e.IsMultiCoin
) while maintaining backwards compatibility.How this works
This is very similar to
params.RegisterExtras()
except that it's in thetypes
package.The
pseudo.Type.Format()
method was necessary to avoid changing upstream formatting verbs.How this was tested
RLP encodings of vanilla-geth
types.StateAccount
andtypes.SlimAccount
were first locked in with unit tests, before any libevm modidifcations. Similar test cases were generated fromava-labs/coreth
withIsMultiCoin bool
to be mirrored withtypes.RegisterExtras[bool]()
. Round-trip RLP encoding/decoding demonstrates correct behaviour for both geth and coreth use cases.