Skip to content

Conversation

@fernantho
Copy link
Contributor

What type of PR is this?
Feature

What does this PR do? Why is it needed?
This PR serves to build the Generic Merkle Proofs in the framework of SSZ-QL. All these developments aim to provide cryptographic proofs to allow the verification of the requested information.

Which issues(s) does this PR fix?
Partially #15598

Other notes for review

  • Prior to reaching to this solution, other options have been studied and (partially) prototyped. This write-up summarizes the different options:
    a. State-native approach: This is an attempt to build the proofs for any given element of the BeaconState.
    b. Trying to build a wrapper to use the current SSZ generated files always led me to a dead end.
  • This PR is deeply inspired in Dynssz approach.
  • Added tests that concatenates checks:
    • HashTreeRoot computed from ssz-generated file equals to HashTreeRoot computed using the SSZObject interface (in the end this is the same) and the HashTreeRoot using the recursive root builder approach. // Compute merkle tree using dynamic merkleizer with a fresh wrapper for each test. By doing this, the source of truth is in code (my initial thought was to use Pythonic eth2spec).
    • A similar approach has been followed to verify the Merkle Proofs. We have the HashTreeRoot from the ssz generated filed, the HashTreeRoot built recursively and the proofs. In this case we verify that the response.Root is equal to the stateRoot and, only after this is correct, we verify the merkle proofs: // Decode the response to verify the proof.
  • Bump into multi-dimensional arrays length issue, pointed here.

Acknowledgements

commit 660e088ba941aa544ff5d0e1a52c43204a12c19a
Author: fernantho <[email protected]>
Date:   Mon Nov 10 00:02:11 2025 +0100

    reviewed code focusing on dynamic_merkleizer

commit 8ad78a84513bca6ebfe2034f1c9858f8a83cf2b8
Author: fernantho <[email protected]>
Date:   Sun Nov 9 23:11:45 2025 +0100

    beacon state hash tree root ssz-generated does not match with the recursiverly calculated

commit 92a83471bc4a89d4201d281444a0b6de301d5874
Author: fernantho <[email protected]>
Date:   Sun Nov 9 23:07:40 2025 +0100

    refactored and moved code to proper domain

commit bb0146eb6915f3782b3afa2672eb445ac2bb3661
Author: fernantho <[email protected]>
Date:   Sun Nov 9 21:13:49 2025 +0100

    wip

commit 9d93007f54999299a6ed5b514b93ae30962c508a
Author: fernantho <[email protected]>
Date:   Fri Nov 7 13:10:52 2025 +0100

    wip

commit 7819612d27e426e3ca4f9fcb13bc54bdcbc8ac83
Author: fernantho <[email protected]>
Date:   Thu Nov 6 12:34:51 2025 +0100

    wip

commit a3fe12cc293f8d5284acd371dfca94726bb5a1a9
Author: fernantho <[email protected]>
Date:   Wed Nov 5 17:52:06 2025 +0100

    minimum test to verify changes in another beacon state version

commit 31726295c0e895beba1922e55e3bdde0039f83ee
Author: fernantho <[email protected]>
Date:   Wed Nov 5 17:44:19 2025 +0100

    added Jun's ProofByFieldIndex + working version of ProofByGeneralizedIndex for top-level fields

commit c08656647d00a0cb24b1802d91b8c962f3e6cc17
Author: fernantho <[email protected]>
Date:   Wed Nov 5 15:37:39 2025 +0100

    run gazelle after adding fastssz files

commit a676482dc69d95052aa1c9601dfd2a29f0a6ce58
Author: fernantho <[email protected]>
Date:   Wed Nov 5 11:47:08 2025 +0100

    integrated fastssz libraries to generate arbitrary merkle proofs
…eacon-chain/state/state-native/proofs.go approach
…ck proofs work, but beacon state does not work.
…erkle proofs verification from merkle_proof_generator
- renamed: merkle_proof_generator -> merkle_tree_prover
- removed all unnecessary usage of reflections
- fixed dumb error that consisted on trying to verifying merkle proofs against to outdated state root
- major refactor, review and comparison of dynssz build root dispatcher and inner functions
- run gazelle
@fernantho fernantho marked this pull request as ready for review November 12, 2025 09:52
@fernantho fernantho marked this pull request as draft November 22, 2025 01:50
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.

1 participant