fix(prover): Bind parentStateRoot to parentShnarf presage#3542
Open
Tabaie wants to merge 11 commits into
Open
Conversation
Signed-off-by: Arya Tabaie <arya.pourtabatabaie@gmail.com>
Signed-off-by: Arya Tabaie <arya.pourtabatabaie@gmail.com>
Tabaie
requested review from
AlexandreBelling,
Soleimani193,
Copilot,
eloi010,
fluentcrafter,
gauravahuja and
gusiri
July 10, 2026 16:33
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens the security binding between the aggregation proof and the previous (parent) L2 state root by opening the parent shnarf inside the PI interconnection circuit and enforcing that it matches the first execution proof’s parent state root. It also removes the previously flagged Koalabear migration fallback path by eliminating the related circuit logic and tests, and updates the coordinator to supply the required parent shnarf preimage components to the prover.
Changes:
- Extend aggregation inputs to include the parent shnarf preimage components (grandparent shnarf + snark hash + evaluation point/claim) and validate/open them in the PI interconnection circuit.
- Update coordinator aggregation flow to fetch the parent blob compression proof from storage (or an in-memory repository for backtesting) and pass its shnarf preimage to the prover request.
- Remove Koalabear migration fallback logic and the dedicated migration tests.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| prover/public-input/aggregation.go | Adds parent shnarf preimage fields to the aggregation request model; adjusts snark-type struct layout. |
| prover/circuits/pi-interconnection/test_utils/test_utils.go | Adds helper to fabricate consistent parent shnarf preimages and wires them into PI-interconnection test requests. |
| prover/circuits/pi-interconnection/koala_migration_test.go | Removes tests for the Koalabear migration fallback/selection mechanism. |
| prover/circuits/pi-interconnection/e2e_test.go | Updates E2E tests to include parent shnarf preimage inputs. |
| prover/circuits/pi-interconnection/circuit.go | Implements in-circuit opening of the parent shnarf and derives the initial state root from that opening; removes Koalabear fallback logic. |
| prover/circuits/pi-interconnection/assign.go | Recomputes and checks the parent shnarf digest from its preimage (mirrors in-circuit check) and removes Koalabear fallback plumbing. |
| prover/CHANGELOG.md | Adds unreleased changelog entry for the aggregation binding fix. |
| prover/backend/aggregation/request.go | Extends prover aggregation request schema to include parent shnarf preimage components. |
| prover/backend/aggregation/prove.go | Propagates the new preimage fields into the prover’s aggregation public input construction. |
| prover/backend/aggregation/craft.go | Carries the new preimage fields through collection/crafting of aggregation requests/responses. |
| coordinator/core/src/test/kotlin/linea/coordination/aggregation/ProofAggregationCoordinatorServiceTest.kt | Updates coordinator unit test to mock parent blob lookup and assert new shnarf-preimage fields are populated. |
| coordinator/core/src/main/kotlin/linea/coordination/aggregation/ProofAggregationCoordinatorService.kt | Fetches parent blob compression proof from BlobsRepository and injects the shnarf preimage into aggregation proof requests. |
| coordinator/core-interfaces/src/main/kotlin/linea/domain/Aggregation.kt | Extends ProofsToAggregate domain object with the parent shnarf preimage components. |
| coordinator/clients/prover-client/file-based-client/src/test/kotlin/linea/coordinator/clients/prover/ProverClientFactoryTest.kt | Updates test fixtures to include the new ProofsToAggregate fields. |
| coordinator/clients/prover-client/file-based-client/src/main/kotlin/linea/coordinator/clients/prover/FileBasedProofAggregationClientV2.kt | Extends aggregation request DTO to serialize grandparent shnarf + parent shnarf (snarkHash/x/y). |
| coordinator/CHANGELOG.md | Adds unreleased changelog entry for supplying parent shnarf preimage in aggregation requests. |
| coordinator/app/src/main/kotlin/linea/coordinator/app/conflationbacktesting/InMemoryBlobsRepository.kt | Adds an in-memory BlobsRepository implementation to support backtesting without Postgres blobs table. |
| coordinator/app/src/main/kotlin/linea/coordinator/app/conflationbacktesting/ConflationBacktestingApp.kt | Wires the new in-memory blobs repository into backtesting flow and populates it as blobs are proven. |
| coordinator/app/src/main/kotlin/linea/coordinator/app/conflation/ConflationApp.kt | Passes blobsRepository into the aggregation coordinator service so production flow can fetch parent compression proofs. |
|
|
||
| ### 🐛 Bug Fixes | ||
|
|
||
| - *(coordinator)* Supply parent shnarf preimage for aggregation requests |
|
|
||
| ### 🐛 Bug Fixes | ||
|
|
||
| - *(prover)* Bind aggregation's initial state root to the parent shnarf via in-circuit opening |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Addresses Copilot review feedback: changelog bullets in this repo consistently include the originating PR number for traceability. Signed-off-by: Arya Tabaie <arya.pourtabatabaie@gmail.com>
…T-Lineth/lineth-monorepo into prover/fix/stateroot-binding Signed-off-by: Arya Tabaie <arya.pourtabatabaie@gmail.com>
…binding Signed-off-by: Arya Tabaie <arya.pourtabatabaie@gmail.com> # Conflicts: # coordinator/CHANGELOG.md
Adds unit coverage for the parent-shnarf preimage logic introduced for the aggregation state-root binding fix: InMemoryBlobsRepository CRUD behavior, the genesis and retry-until-available branches in ProofAggregationCoordinatorService.getParentShnarfPreimage, and the new equality/hashCode branches on ProofsToAggregate. Signed-off-by: Arya Tabaie <arya.pourtabatabaie@gmail.com>
parentStateRoot to aggregation proofparentStateRoot to parentShnarf presage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR tightens the state root binding of the aggregated proof seen by L1.
Now the parent shnarf (to which the aggregation PI is already bound) is opened in the PI interconnection circuit and ensured to match the parent state root of the first execution proof. This requires no nontrivial change to the verifier contract, but it does involve updates to the coordinator as the prover backend now needs the parent shnarf pre-image.
It also removes the Koalabear migration state root fallback, which is no longer necessary.
I am not well versed in the coordinator or the Kotlin language so we will probably need some hands-on involvement from the coordinator team.