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

feat: runtime multi version #81

Merged
merged 30 commits into from
Mar 25, 2025

Conversation

lispc
Copy link
Contributor

@lispc lispc commented Mar 14, 2025

No description provided.

@github-actions github-actions bot added crate-chunk-circuit Updates to the guest program chunk-circuit crate-batch-circuit Updates to the guest program batch-circuit crate-bundle-circuit Updates to the guest grogram bundle-circuit crate-prover Updates to the prover crate crate-integration Updates to the integration crate crate-circuits Any update made to the circuits, i.e. commitments reflect a change labels Mar 14, 2025
@github-actions github-actions bot added crate-verifier Updates to the verifier crate crate-build-guest Updates to building of guest programs labels Mar 18, 2025
@lispc
Copy link
Contributor Author

lispc commented Mar 18, 2025

seems we have too many xx_commitments.rs.. is there an easy way to unify them or we do this in later refactor?

@roynalnaruto
Copy link
Collaborator

We can have a single commitments.rs that defines multiple modules:

mod chunk {
    pub const EXE_COMMIT /* */
}
mod batch {
    pub const EXE_COMMIT /* */
}
/* */

@lispc
Copy link
Contributor Author

lispc commented Mar 20, 2025

We can have a single commitments.rs that defines multiple modules:

mod chunk {
    pub const EXE_COMMIT /* */
}
mod batch {
    pub const EXE_COMMIT /* */
}
/* */

nonono, batch program verifies chunk commitment, so they are dependent. Cannot be in same crate i think.

@noel2004 noel2004 mentioned this pull request Mar 20, 2025
2 tasks
@lispc lispc changed the title circuit::types can support multi versions feat: runtime multi version Mar 20, 2025
@lispc lispc changed the base branch from master to feat/phase1-stable March 20, 2025 03:17
@roynalnaruto
Copy link
Collaborator

@lispc

Cannot be in same crate i think.

I meant for prover and verifier crates

Rename codec_version => fork_name
unitfy the occurance of fork_name field among task and witness (not info)
@noel2004
Copy link
Member

feat/phase2-stable has been merged

@noel2004
Copy link
Member

e2e tests passed

@noel2004 noel2004 marked this pull request as ready for review March 21, 2025 12:54
@noel2004
Copy link
Member

We can have a single commitments.rs that defines multiple modules:

mod chunk {
    pub const EXE_COMMIT /* */
}
mod batch {
    pub const EXE_COMMIT /* */
}
/* */

nonono, batch program verifies chunk commitment, so they are dependent. Cannot be in same crate i think.

So we need to update files in at least 3 separated crates. If the bundle / batch / chunk dep for circuits/types has been separated we can:

  • put commitment of chunk in circuits/types/batch
  • put commitment of batch in circuits/types/bundle
  • comitment of bundle is not needed by circuits and can be updated in prover (or verifier) crate

@noel2004 noel2004 removed their request for review March 21, 2025 13:08
@lispc
Copy link
Contributor Author

lispc commented Mar 23, 2025

one final idea is, "legacy" is not a good word. We will have v8 v9 ... in future.

V6 is much more clear.

See https://github.com/scroll-tech/scroll-contracts/blob/1a44cc4cd5bb29067051f59c09dd4407511f1a3a/src/L1/rollup/ScrollChain.sol#L397
we either use "v6" "v7" or "euclidV1" "euclidV2"

noel2004 and others added 7 commits March 25, 2025 10:15
* better structure for testdata (WIP)

* fix chunk test and prune batch test (WIP)

* update make file and test samples

* test new batch test scheme

* add batch invariant test

* update makefile for required chunk proof

* prune unnecessary container cleanning

* fixings after rebase

* fix according to review: use more straight fashion for chunk task generations

* FIX: the correct order in batchheader enum

* better version setting for test task

* add readme files
…version" field in batchheader changed (7->6)
@roynalnaruto roynalnaruto merged commit 9d1ed70 into feat/phase1-stable Mar 25, 2025
4 checks passed
roynalnaruto added a commit that referenced this pull request Mar 27, 2025
* phase1 tested

* seems ok

* lint

* cleanup

* fix(TOB-SCREUC-1): at least 1 pi | pis and pi_hashes are equal in length

* chore: rename chunk infos

* fix(TOB-SCREUC-2): insufficient validation of chunk info between witness and blob

* fix(TOB-SCREUC-5): lax parsing of batch payload

* fix: code quality recommendations

* chore: update commitments

* fix: update v3 payload parsing

* chore: update commitments

* [Fix] for phase1 rc9 (#87)

* fix pi hash in bundle

* add santiy check for bundle task

* fix typo and expression

* add local task test, output local task in e2e

* + add bundle local task sample, update batch local task sample
+ sanity check for final e2e bundle pi

* rc9

* rc9

* phase2

* done

* feat: extend prover config

* fix(integration): compile OK

* chore: bump rc10 and update commitments

* upgrade openvm (#97)

* upgrade openvm

* chore: update snark-verifier-sdk

* chore: update tiny-keccak

* chore: upgrade openvm (alloy-core, revm, reth, sbv)

* chore: update sbv

* chore(build-guest): build both since openvm upgraded

* chore: update commitments

---------

Co-authored-by: Rohit Narurkar <rohit.narurkar@proton.me>

* Update the comment for kzg g2 setup (#88)

* chore: update commitments

* Phase-2 audit fixes (#98)

* fix(TOB-SCREUC2-3): use github output instead of github env

* fix(TOB-SCREUC2-4): pin 3rd party actions

* fix(TOB-SCREUC2-5): do not persist git credentials

* feat: runtime multi version (#81)

* circuit::types can support multi versions

* phase feature free for batch circuit

* fix issue after merging

* make chunk circuit feature free

* prune unnecessary commitment file, and revert verify_commitments update

* fix: soundnes in bundle circuit and typo

* bundle circuit feature free

* refactoring:
Rename codec_version => fork_name
unitfy the occurance of fork_name field among task and witness (not info)

* resume multiple version of bundle circuit

* update build-guest

* update make file

* fix build-guest

* update lock

* fix issue in build guest input

* enable co-exist of mutiple bundle app

* fix typo

* fix "most legacy" issue

* update release scripts

* [FEAT] better test structure (#82)

* better structure for testdata (WIP)

* fix chunk test and prune batch test (WIP)

* update make file and test samples

* test new batch test scheme

* add batch invariant test

* update makefile for required chunk proof

* prune unnecessary container cleanning

* fixings after rebase

* fix according to review: use more straight fashion for chunk task generations

* FIX: the correct order in batchheader enum

* better version setting for test task

* add readme files

* rename v3 to v6

* rename "legacy" to "euclidv1" according to review

* renaming in scripts

* task must use explicitily specified `fork_name`

* update the sanity check of bundle hash in e2e of phase v1 since the "version" field in batchheader changed (7->6)

---------

Co-authored-by: noelwei <fan@scroll.io>
Co-authored-by: Ho <noelwei@gmail.com>

* chore: update commitments

* upgrade openvm and revm; fix pairing edge cases

* add commitments

* fmt

* pruge unused bls12_381 openvm extension in bundle circuit

* fix(TOB-SCREUC2-3) follow-up: extract variable and use

* feat: rv32 chunk fallback (#100)

* feat: batch support rv32 chunk

* add ChunkRv32Prover and e2e tests, testing

* add commitment verify for rv32 fallback in verifier

* testing e2e

* add commitments

* toolchain & lint

* docker

* tag 0.2.0

* update commits

---------

Co-authored-by: noelwei <fan@scroll.io>

* clean

* chore: cleanup

* chore: update commitments

* feat(build-guest): write digests

* fix(build-guest): add digests

* fix: batch task v7 contains unpadded blob bytes, envelope v7 expects padded

* [Feat] sanity check for pi while generating proof (#102)

* sanity check for pi in proof gen

* update according to review

* fix another issue

* add missed assert

* resume the comment

* chore: update commitments

* fix: update release script to push digests from correct source path

* fix(tests): prev msg queue hash population for euclidv1

* fix: sanity check on wrapped proof

* fix: tests

* chore: update commitments

---------

Co-authored-by: Rohit Narurkar <rohit.narurkar@proton.me>
Co-authored-by: Ho <fan@scroll.io>
Co-authored-by: xkx <xiakunxian130@gmail.com>
Co-authored-by: Ho <noelwei@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate-batch-circuit Updates to the guest program batch-circuit crate-build-guest Updates to building of guest programs crate-bundle-circuit Updates to the guest grogram bundle-circuit crate-chunk-circuit Updates to the guest program chunk-circuit crate-circuits Any update made to the circuits, i.e. commitments reflect a change crate-integration Updates to the integration crate crate-prover Updates to the prover crate crate-verifier Updates to the verifier crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants