forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 14
[wip] replay at 17M but deleting storage slots + accounts #475
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
Draft
gballet
wants to merge
1
commit into
replay-17m
Choose a base branch
from
replay-17m-delete
base: replay-17m
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -289,7 +289,7 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo | |
| } | ||
| // Create a new context to be used in the EVM environment | ||
| blockContext := NewEVMBlockContext(header, bc, author) | ||
| istarget := blockContext.BlockNumber.Uint64() == 17366216 | ||
| istarget := blockContext.BlockNumber.Uint64() == 17165311 | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. error at this location. It doesn't seem like the problem of the nyota costs, even though it's at the same block. |
||
| if istarget { | ||
| tracer := logger.NewStructLogger(&logger.Config{ | ||
| Debug: istarget, | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -204,23 +204,17 @@ func (trie *VerkleTrie) UpdateStorage(address common.Address, key, value []byte) | |
| } | ||
|
|
||
| func (t *VerkleTrie) DeleteAccount(addr common.Address) error { | ||
| var ( | ||
| err error | ||
| values = make([][]byte, verkle.NodeWidth) | ||
| stem = t.pointCache.GetTreeKeyVersionCached(addr[:]) | ||
| ) | ||
|
|
||
| for i := 0; i < verkle.NodeWidth; i++ { | ||
| values[i] = zero[:] | ||
| } | ||
| switch root := t.root.(type) { | ||
| case *verkle.InternalNode: | ||
| err = root.InsertValuesAtStem(stem, values, t.FlatdbNodeResolver) | ||
| default: | ||
| return errInvalidRootType | ||
| } | ||
| if err != nil { | ||
| return fmt.Errorf("DeleteAccount (%x) error: %v", addr, err) | ||
| var key = t.pointCache.GetTreeKeyVersionCached(addr[:]) | ||
|
|
||
| // XXX this only deletes the header account, but for completeness, | ||
| // we need to delete everything. This is only a problem pre-cancun | ||
| // which unfortunately we are still stuck at. | ||
| // NOTE we should also return immediately if we are post-transition. | ||
| for i := 0; i < 256; i++ { | ||
| key[31] = byte(i) | ||
| if root, err := t.root.(*verkle.InternalNode).Delete(key, t.FlatdbNodeResolver); root || err != nil { | ||
| return fmt.Errorf("error deleting key %x: %w", err) | ||
| } | ||
|
Comment on lines
+213
to
+217
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to rebase to get |
||
| } | ||
| return nil | ||
| } | ||
|
|
@@ -230,8 +224,11 @@ func (t *VerkleTrie) DeleteAccount(addr common.Address) error { | |
| func (trie *VerkleTrie) DeleteStorage(addr common.Address, key []byte) error { | ||
| pointEval := trie.pointCache.GetTreeKeyHeader(addr[:]) | ||
| k := utils.GetTreeKeyStorageSlotWithEvaluatedAddress(pointEval, key) | ||
| var zero [32]byte | ||
| return trie.root.Insert(k, zero[:], trie.FlatdbNodeResolver) | ||
| deleteRoot, err := trie.root.Delete(k, trie.FlatdbNodeResolver) | ||
| if deleteRoot { | ||
| return errors.New("trying to delete the root node, that should never happen") | ||
| } | ||
| return err | ||
| } | ||
|
|
||
| // Hash returns the root hash of the trie. It does not write to the database and | ||
|
|
||
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.
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 is because the test file I have is truncated