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

Calculate class_commitment from proof #460

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

notlesh
Copy link
Collaborator

@notlesh notlesh commented Jan 8, 2025

This works around an issue introduced when Pathfinder removed class_commitment from its class proof.

The proofs we get back from Pathfinder (prior to v0.8 RPC) are in order. What that means is that the proof is a list of MPT nodes, ordered such that you can walk through the proof from top-to-bottom. This implies that the first node is always the root node, which is the same thing as the commitment. In other words, we can get the root/commitment by simply looking at the first node, and that's what this PR does.

Note, however, that this is redundant -- verify_proof() ultimately hashes the root node and compares that to class_commitment, which is exactly what this PR does. It would be just as good to make class_commitment an Option an only verify it then; but this PR at least makes the problem clear.

Type

  • feature
  • bugfix
  • dev (no functional changes, no API changes)
  • fmt (formatting, renaming)
  • build
  • docs
  • testing

Description

Breaking changes?

  • yes
  • no

@notlesh notlesh requested a review from HermanObst as a code owner January 8, 2025 00:10
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.

2 participants