Skip to content

Conversation

Tristan-Wilson
Copy link
Member

  • Introduce ICustomDAProofValidator interface for extensible DA proof validation
  • Implement ReferenceDAProofValidator with hash verification and chunk extraction
  • Integrate CustomDA validation into OneStepProverHostIo for preimage type 3
  • Add comprehensive test coverage for reference validator implementation

- Introduce ICustomDAProofValidator interface for extensible DA proof validation
- Implement ReferenceDAProofValidator with hash verification and chunk extraction
- Integrate CustomDA validation into OneStepProverHostIo for preimage type 3
- Add comprehensive test coverage for reference validator implementation
@cla-bot cla-bot bot added the s label Jun 18, 2025
@gzeoneth gzeoneth changed the base branch from main to develop June 18, 2025 18:25
Comment on lines 33 to 41
ICustomDAProofValidator public customDAValidator;

function setCustomDAValidator(
ICustomDAProofValidator _validator
) external {
// TODO: Add appropriate access control
customDAValidator = _validator;
}

Copy link
Member

Choose a reason for hiding this comment

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

we don't keep any storage in the OSP contract, so instead I think we have 2 options

  1. store the var in the rollup and have the OSP read from the rollup
  2. make this immutable and set in the constructor, but we have to consider how it works with the rollup creator

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to make this immutable because this allow more deterministic behavior, otherwise the rollup owner may change the DA contract and make a assertion invalid.

Tristan-Wilson and others added 8 commits July 11, 2025 16:56
This commit removes redundant certHash and offset from the proof data,
since they are part of the instruction parameters, which are proven.
The certificate is checked against the proven hash (leafContents).

Also work around stack too depth limit in ReferenceDAProofValidator.
- Add new ValidatePreimage instruction that validates CustomDA
  certificates
- Update ICustomDAProofValidator interface to pass full proof to
  validateCertificate for extensibility
- Implement certificate validation in ReferenceDA, just checking a
  simple version byte as an example
- OSP verifies prover's validity claim matches DA provider's
  validation result
Implement ECDSA signature validation for CustomDA certificates with configurable trusted signers. This demonstrates how validators can verify that certificates are signed by authorized parties before accepting them as valid.

Key changes:
- Add trustedSigners mapping to store authorized signer addresses
- Implement signature recovery and validation in validateCertificate()
- Update certificate format to include ECDSA signature components (v, r, s)
- Add comprehensive tests for signature validation scenarios
- Document revert vs return behavior for different validation failures
@Tristan-Wilson Tristan-Wilson marked this pull request as ready for review September 9, 2025 07:37
Base automatically changed from deterministic-factory-deployments to develop September 9, 2025 19:31
@gzeoneth gzeoneth self-requested a review September 9, 2025 19:56
@gzeoneth
Copy link
Member

will work on the review comments

@yahgwai yahgwai self-requested a review September 30, 2025 15:54
yahgwai
yahgwai previously approved these changes Sep 30, 2025
Since this is a reference implementation only, it's moved into the
nitro repo under contracts-local.
@Tristan-Wilson
Copy link
Member Author

I've moved the reference implementation into nitro's contracts-local directory.

…tificate

Bug was introduced in 44b2eb4 when refactoring from assembly.
The certSize was being read from proof[0:] instead of proof[proofOffset:],
causing PROOF_TOO_SHORT errors when the validator tried to use garbage
data as the certificate size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants