Skip to content

Conversation

gianbelinche
Copy link

What ❔

This PR implements verifier for EigenDA

Since config was changed, recompile zkstack:
cargo install --path zkstack_cli/crates/zkstack --force --locked

Why ❔

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zkstack dev fmt and zkstack dev lint.

Copy link

@juan518munoz juan518munoz left a comment

Choose a reason for hiding this comment

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

LGTM. Be sure to remove all unused imports before merging!

pub path_to_points: String,
}

#[derive(Debug, Clone)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you add some docs to this struct?

})
}

fn commit(&self, blob: Vec<u8>) -> Result<G1Affine, VerificationError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add docs

Ok(())
}

pub async fn verify_certificate(&self, cert: BlobInfo) -> Result<(), VerificationError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

add docs

Copy link
Collaborator

@juanbono juanbono left a comment

Choose a reason for hiding this comment

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

Add docs

@gianbelinche
Copy link
Author

Add docs

Done

let blob_info = blob_info::BlobInfo::try_from(blob_info)
.map_err(|e| anyhow::anyhow!("Failed to convert blob info: {}", e))?;
self.verifier
.verify_commitment(blob_info.blob_header.commitment.clone(), data)
Copy link

Choose a reason for hiding this comment

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

In this code, I was looking at this file. Where does eigenda fit in the match (self.mode, self.pubdata_da) result ?

Copy link

Choose a reason for hiding this comment

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

To clarify, is this computing the commitment locally to see if the DA has computed the same commitment ?

Copy link
Author

Choose a reason for hiding this comment

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

We fit in (L1BatchCommitmentMode::Validium, PubdataSendingMode::Custom)
The verifier.verifyCommitment function is the one that generates a commitment based on the blob and compares it to the one given by EigenDA.
The code you were looking at is the one that defines what would be sent to the L1, once we make the PR with full M0, that part will send the EigenDA commitment.

&format!("{}{}", cfg.path_to_points, "/g1.point"),
"",
&format!("{}{}", cfg.path_to_points, "/g2.point.powerOf2"),
268435456, // 2 ^ 32
Copy link

Choose a reason for hiding this comment

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

small correction, its 2 ^ 28

let expected_commitment = G1Affine::new_unchecked(
Fq::from(num_bigint::BigUint::from_bytes_be(&expected_commitment.x)),
Fq::from(num_bigint::BigUint::from_bytes_be(&expected_commitment.y)),
);
Copy link

@anupsv anupsv Nov 5, 2024

Choose a reason for hiding this comment

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

We should add a isInSubgroup and IsOnCurve checks. Good to catch it even though DA also does it on its end.

) -> Result<Vec<u8>, VerificationError> {
let mut index = index;
if proof.len() == 0 || proof.len() % 32 != 0 {
return Err(VerificationError::WrongProof);
Copy link

Choose a reason for hiding this comment

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

Would be good to differentiate the errors since the VerificationError::WrongProof is used in many places.

Base automatically changed from eigen-client-memstore to eigen-client-extra-features November 5, 2024 16:10
Copy link
Collaborator

@juanbono juanbono left a comment

Choose a reason for hiding this comment

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

LGTM

@gianbelinche gianbelinche merged commit 9c06b40 into eigen-client-extra-features Nov 5, 2024
12 of 24 checks passed
@gianbelinche gianbelinche deleted the eigen-client-verifier branch November 5, 2024 19:11
github-merge-queue bot pushed a commit to matter-labs/zksync-era that referenced this pull request Feb 20, 2025
## What ❔

### Note:
Related era-contract PR:
matter-labs/era-contracts#1233

This PR adds extra functionality to the eigen client:

- [x] Non authenticated blob dispersal
lambdaclass#318
- [x] RLP encoding for blobs
lambdaclass#319
- [x] Get inclusion data
lambdaclass#324
- [x] Memstore lambdaclass#321
- [x] Blob size limit lambdaclass#325
- [x] Soft confirmations
lambdaclass#322
- [x] Verification logic
lambdaclass#326
- [x] EigenDA Documentation
lambdaclass#327

## Why ❔

These features are needed to have a full featured client and to have the
same features as when communicating with the EigenDA proxy.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.

---------

Co-authored-by: Juan Munoz <juanmunoz890@gmail.com>
Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com>
Co-authored-by: juan518munoz <62400508+juan518munoz@users.noreply.github.com>
zkzoomer pushed a commit to matter-labs/zksync-era that referenced this pull request Jun 21, 2025
## What ❔

### Note:
Related era-contract PR:
matter-labs/era-contracts#1233

This PR adds extra functionality to the eigen client:

- [x] Non authenticated blob dispersal
lambdaclass#318
- [x] RLP encoding for blobs
lambdaclass#319
- [x] Get inclusion data
lambdaclass#324
- [x] Memstore lambdaclass#321
- [x] Blob size limit lambdaclass#325
- [x] Soft confirmations
lambdaclass#322
- [x] Verification logic
lambdaclass#326
- [x] EigenDA Documentation
lambdaclass#327

## Why ❔

These features are needed to have a full featured client and to have the
same features as when communicating with the EigenDA proxy.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.

---------

Co-authored-by: Juan Munoz <juanmunoz890@gmail.com>
Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com>
Co-authored-by: juan518munoz <62400508+juan518munoz@users.noreply.github.com>
dutterbutter pushed a commit to dutterbutter/zkstack-cli that referenced this pull request Jul 3, 2025
## What ❔

### Note:
Related era-contract PR:
matter-labs/era-contracts#1233

This PR adds extra functionality to the eigen client:

- [x] Non authenticated blob dispersal
lambdaclass/zksync-era#318
- [x] RLP encoding for blobs
lambdaclass/zksync-era#319
- [x] Get inclusion data
lambdaclass/zksync-era#324
- [x] Memstore lambdaclass/zksync-era#321
- [x] Blob size limit lambdaclass/zksync-era#325
- [x] Soft confirmations
lambdaclass/zksync-era#322
- [x] Verification logic
lambdaclass/zksync-era#326
- [x] EigenDA Documentation
lambdaclass/zksync-era#327

## Why ❔

These features are needed to have a full featured client and to have the
same features as when communicating with the EigenDA proxy.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.

---------

Co-authored-by: Juan Munoz <juanmunoz890@gmail.com>
Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com>
Co-authored-by: juan518munoz <62400508+juan518munoz@users.noreply.github.com>
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.

4 participants