Skip to content

Conversation

@gzeoneth
Copy link
Member

@gzeoneth gzeoneth commented Jun 26, 2025

Deploying the OSP in the RollupCreator is not feasible due to contract size limit unless we create a OSP factory which isn't ideal either. This fits tightly into the existing rollup creator while still support legacy abi (not that important, but helpful for older sdk versions)

Including change from #358

@cla-bot cla-bot bot added the s label Jun 26, 2025
@gzeoneth gzeoneth force-pushed the customda-bold-creator branch from b0462fc to d5cb4a1 Compare June 26, 2025 10:16
@gzeoneth gzeoneth force-pushed the customda-bold-creator branch from d5cb4a1 to de204ba Compare June 26, 2025 10:26
@gzeoneth gzeoneth marked this pull request as ready for review July 7, 2025 18:55
@gzeoneth gzeoneth merged commit e508d7f into customda-bold Jul 7, 2025
13 checks passed
@gzeoneth gzeoneth deleted the customda-bold-creator branch July 7, 2025 18:56
gzeoneth added a commit that referenced this pull request Nov 14, 2025
* Add CustomDA proof validation interface and reference 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

* format: yarn format

* fix: 0x01

* wip: use create2 for factory deployment

* remove key from config

* fmt

* fix signatures

* refactor: make OneStepProverHostIo validator immutable

* test: storage and 4bytes

* test: simple CustomDAProof test

* chore: restore file

* fix: triage slither

* inline up exec deployment

* chore: move file to foundry test folder

* salt length check

* update tests

* fmt

* remove SetTemplatesArgs struct

* remove ownership from bridge creator

* add CREATE2_FACTORY env and deployment instructions

* fix signatures

* factory owner as deployAllContracts arg

* set deployer as owner in local deployment

* chore: disable metahash and align hardhat foundry (#363)

* disable CBOR

* chore: remove entries for removed files

* refactor: commonSetting

* feat: foundry override

* fix: test

* chore: default profile

* format: yarn format

* ci: comapre bytecodes

* fix: slither db

---------

Co-authored-by: gzeon <im@gzeon.dev>

* fix: deploy create2 factory for local deployment

* fix: wait for funding

* ci: use geth-allow-pre155

* fix: _uint256ToAddress helper

* test: fix ReferenceDAProofValidatorTest

* fix: 4bytes and storage

* wip: make rollup creator support customda feature (#361)

* feat: rollup creator support custom osp

* fix: slither and typo

* Add CUSTOM_DA_MESSAGE_HEADER_FLAG support

* Cert is part of the customda proof

* Make certificate part of verioned proof

* format: yarn format

* test: fix ReferenceDAProofValidatorTest

* chore: include customOsp in example config

* fix: add customOsp to scripts

* fix: createRollup

* test: fix sig

---------

Co-authored-by: Tristan Wilson <twilson@offchainlabs.com>

* Check certKeccak against proven hash in memory

* Move cert into standardized part of OSP validation

* Simplify CustomDA proof format and fix stack depth error

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.

* format: yarn format

* test: fix

* test: refactor

* test: add more coverage

* Add ValidatePreimage inst for CustomDA cert val OSP

- 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

* feat: add trusted signer validation to ReferenceDAProofValidator

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

* Fix hostio range

* chore: disable forge lint_on_build

* refactor: avoid assembly

* chore: check nonzero customDAValidator

* refactor: isValid

* refcator: avoid more assembly

* Rename VALIDATE_PREIMAGE opcode to VALIDATE_CERTIFICATE

* Replace hardcoded proof offset values with constants

* Return up to 32 bytes from validateReadPreimage

* Move ReferenceDAProofValidator.sol out of contracts

Since this is a reference implementation only, it's moved into the
nitro repo under contracts-local.

* Fix: Read certificate size from correct offset in validateAndCheckCertificate

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.

* fix: foundry config

* fix: inherit is default

* fix: use foundry v1.3.6

* format: yarn format

* chore: update slither db

* chore: remove RollupDeploymentParamsLegacy

---------

Co-authored-by: Henry <11198460+godzillaba@users.noreply.github.com>
Co-authored-by: gzeon <hng@offchainlabs.com>
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.

3 participants