Skip to content

refactor: simplify header proof generation #1782

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

Merged
merged 2 commits into from
Apr 26, 2025

Conversation

morph-dev
Copy link
Collaborator

This is first PR that simplifies existing logic before I start adding changes from: #1779

What was wrong?

The code for generating historical_roots and historical_summaries proof is duplicated in a few places.
Some of the utility functions could also be more specific

How was it fixed?

  • simplify proof generation logic in headers_with_proof and improve tests a bit
  • moved the logic for generating execution_block_proof into BeaconBlock
    • removed similar, no longer needed, logic from BlockBody
  • removed block generation logic from bin/e2hs-writer/src/reader.rs (it was identical with the one in headers_with_proof)
    • also removed the tests, because they were also identical
  • added tests for verifying that decoded HeaderWithProof::proof matches expected value
  • make build_merkle_proof_for_index generic

To-Do

Copy link
Collaborator

@carver carver left a comment

Choose a reason for hiding this comment

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

Nice PR summary 👍🏻

Just did a light walkthrough, didn't get a deep dive. No notes!

Copy link
Member

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

:shipit: looks good

Copy link
Member

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

ops wrong button before

@morph-dev morph-dev merged commit 34a7e5e into ethereum:master Apr 26, 2025
14 checks passed
@morph-dev morph-dev deleted the proof_generation branch April 26, 2025 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants