Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

trie: introduce UpdateBatch #32448

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

Open
rjl493456442 wants to merge 1 commit into ethereum:master
base: master
Choose a base branch
Loading
from rjl493456442:trie-concurrent-insert

Conversation

@rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented Aug 15, 2025
edited
Loading

This feature is an optimization used in the BAL, mostly for experimental purpose.

hkey := keybytesToHex(key)
ikeys[hkey[0]] = append(ikeys[hkey[0]], hkey)
ivals[hkey[0]] = append(ivals[hkey[0]], values[i])
}
Copy link
Contributor

@jwasinger jwasinger Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}
if len(keys) > 0 {
fn.flags = t.newFlag()
}

We need to reset the flag of the root node if there are any mutations. Otherwise, when it comes time to hash, the previous hashed node will be cached in the root.

Comment on lines +189 to +222
func (t *VerkleTrie) UpdateStorageBatch(address common.Address, keys [][]byte, values [][]byte) error {
if len(keys) != len(values) {
return fmt.Errorf("keys and values length mismatch: %d != %d", len(keys), len(values))
}
for i, key := range keys {
if err := t.UpdateStorage(address, key, values[i]); err != nil {
return err
}
}
return nil
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either implement it, or panic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gballet gballet gballet left review comments

@jwasinger jwasinger jwasinger left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /