Skip to content
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

move proof building before root computation #527

Open
wants to merge 9 commits into
base: kaustinen-with-shapella
Choose a base branch
from

Conversation

gballet
Copy link
Owner

@gballet gballet commented Nov 7, 2024

This is a rewrite of #517. It generates the proof against the prestate, before the post state is inserted. This avoids reloading the prestate from disk.

TLDR: Break the proving into two parts:

  1. the Proof part where the proof is build, which is called before IntermediateRoot
  2. the "post state" part, which is created after the intermediate root has been computed.

In the case of the execusion spec test, the pre tree is saved before execution, so there is no need to move things around, just use the new API.

Copy link
Collaborator

@jsign jsign left a comment

Choose a reason for hiding this comment

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

Makes sense, but note the CI is failing.

consensus/beacon/consensus.go Show resolved Hide resolved
trie/verkle.go Outdated Show resolved Hide resolved
@jsign jsign requested a review from Copilot December 11, 2024 16:23

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (2)

cmd/evm/internal/t8ntool/execution.go:374

  • [nitpick] The function name 'Proof' is not very descriptive. Consider renaming it to 'GenerateProof'.
proof, err := trie.Proof(vtrpre, proofTrie, keys, vtrpre.FlatdbNodeResolver)

cmd/evm/internal/t8ntool/execution.go:378

  • [nitpick] The error message 'error adding post values to proof' could be more descriptive. Consider including more context about what went wrong.
err = trie.AddPostValuesToProof(keys, proofTrie, proof)
@gballet gballet force-pushed the proof-building-before-root-computation branch from b7c13cd to b408f09 Compare January 7, 2025 07:39
@gballet gballet force-pushed the proof-building-before-root-computation branch from 9dbe4d4 to fbb80c4 Compare January 8, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants