Skip to content

feat(aggregation-mode): turn program IDs into a mapping - #2175

Merged
JuArce merged 41 commits into
stagingfrom
feat/turn-program-ids-mapping-testnet
Dec 4, 2025
Merged

feat(aggregation-mode): turn program IDs into a mapping#2175
JuArce merged 41 commits into
stagingfrom
feat/turn-program-ids-mapping-testnet

Conversation

@maximopalopoli

@maximopalopolimaximopalopoli commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Description

This PR turns the fixed program IDs for Risc0 and SP1 to be part of a map (program ID -> proving system ID), to make the system more scalable (because it's easier to add new program IDs) and retrocompatible (because this program ID - proving system is not unique anymore, and when we update the program ID now we can also handle the previous programs).

How to test

  1. Start ethereum package:
make ethereum_package_start
  1. Start batcher after waiting for 2 minutes:
make batcher_start_ethereum_package
  1. Send SP1 and Risc0 proofs:
make batcher_send_sp1_burst BURST_SIZE=1
make batcher_send_risc0_burst BURST_SIZE=1
  1. Run proof aggregator for SP1 and RISC0:
make proof_aggregator_start AGGREGATOR=sp1
make proof_aggregator_start AGGREGATOR=risc0
  1. Verify the proofs have been aggregated:
make verify_aggregated_proof_sp1 FROM_BLOCK=0
make verify_aggregated_proof_risc0 FROM_BLOCK=0

You can also follow the steps in the l2 example README to test this example.

Type of change

Please delete options that are not relevant.

  • New feature
  • Bug fix
  • Optimization
  • Refactor

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change crates/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@maximopalopolimaximopalopoli self-assigned this Nov 25, 2025
@maximopalopoli
maximopalopoli marked this pull request as ready for review November 25, 2025 16:54
@JuArceJuArce changed the title feat: turn program IDs into a mappingfeat(aggregation-mode): turn program IDs into a mappingNov 25, 2025
Comment threadcontracts/src/core/IAlignedProofAggregationService.sol Outdated
Comment threadcontracts/src/core/AlignedProofAggregationService.sol Outdated
Comment threadcontracts/src/core/AlignedProofAggregationService.sol Outdated
Comment threadcontracts/src/core/AlignedProofAggregationService.sol Outdated
Comment threadaggregation_mode/README.md Outdated
Comment threadaggregation_mode/src/backend/mod.rs
Comment threadaggregation_mode/src/backend/mod.rs
Comment threadconfig-files/config-proof-aggregator-ethereum-package.yaml Outdated

@JuArceJuArce left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The explorer is not detecting the proving system correctly. It is missing to update

 @verifyRisc0_solidity_signature "0x54687ccf"
@verifySp1_solidity_signature "0xf6e04ac4"

in explorer/lib/explorer/contract_managers/aligned_proof_aggregation_service.ex

Warning

This PR requires to update config files in the servers

Comment threadcontracts/src/core/AlignedProofAggregationService.sol Outdated

@MarcosNicolauMarcosNicolau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

SP1 is working but Risc0 is failing with InvalidProgramId

Comment threadcontracts/src/core/AlignedProofAggregationService.sol Outdated
Comment threadcontracts/src/core/IAlignedProofAggregationService.sol Outdated
@github-actions

github-actionsBot commented Dec 1, 2025

Copy link
Copy Markdown

Changes to gas cost

Generated at commit: 34c4d2be320aaaedfbf10d042ac30283841365c7, compared to commit: a2dcb5f519f4e7251c7fefd90b8652663defa3cf

🧾 Summary (10% most significant diffs)

ContractMethodAvg (+/-)%
AlignedLayerServiceManagercreateNewTask-88 ✅-0.11%

Full diff report 👇
ContractDeployment Cost (+/-)MethodMin (+/-)%Avg (+/-)%Median (+/-)%Max (+/-)%# Calls (+/-)
AlignedLayerServiceManager4,398,072 (0)createNewTask
receive
56,910 (+36)
23,301 (0)
+0.06%
0.00%
76,638 (-88)
46,556 (-93)
-0.11%
-0.20%
77,050 (-24)
47,115 (0)
-0.03%
0.00%
77,788 (-48)
47,115 (0)
-0.06%
0.00%
256 (0)
256 (0)

@maximopalopolimaximopalopoli left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

LGTM

Comment threadcontracts/src/core/AlignedProofAggregationService.sol
Comment threadcontracts/src/core/AlignedProofAggregationService.sol

@MarcosNicolauMarcosNicolau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Honestly, it looks much readable. I am not approving it because verifyProofInclusion not being updated on the sdk (see comment above). L2 example is working correctly.

@MarcosNicolau

Copy link
Copy Markdown
Collaborator

Honestly, it looks much readable. I am not approving it because verifyProofInclusion not being updated on the sdk (see comment above). L2 example is working correctly.

Solved it in d5b88f6.

@MauroToscano
MauroToscano changed the base branch from testnet to stagingDecember 4, 2025 12:09
@JuArce
JuArce added this pull request to the merge queueDec 4, 2025
Merged via the queue into staging with commit 492ed20Dec 4, 2025
8 checks passed
@JuArce
JuArce deleted the feat/turn-program-ids-mapping-testnet branch December 4, 2025 15:13
Sign up for freeto 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

@maximopalopoli@MarcosNicolau@MauroToscano@JuArce