Agglayer SmartContract Upgrade v0.3.0 –> v0.3.1

Motivation

The motivation behind these smart contract upgrade is to enable the upgrade of a zkEVM rollup to a pessimistic consensus rollup (PP). It aims to extend the current functionality for upgrading rollups in a broader way

Our goal has been to introduce this functionality with minimal modifications across all system components. To support this transition, we designed a migration mechanism that integrates smoothly into the current rollup architecture.

Specifically, we added a new function to initiate the migration process, and structured the system so that the migration is automatically finalized upon the successful verification of the first proof following the upgrade. This ensures consistency and security during the transition while maintaining alignment with existing rollup lifecycle flows.

Sources

Technical details

This update introduces a new version (al-v0.3.1 ) of the PolygonRollupManager contract, focusing on enabling rollup migrations from a state transition system to a pessimistic proof (PP) system. The following core updates were implemented:

This update (version al-v0.3.1 ) of the PolygonRollupManager contract includes extended functionality to support the migration of rollups from a standard state transition mechanism (ZK) to a pessimistic proof (PP) system. The following components and logic were added or updated to enable this capability:

New Mapping and Events:

  • isRollupMigrating : A new mapping has been added to keep track of rollups that are in the process of migrating.
  • InitMigration and CompletedMigration : Two events are emitted to signal the start and completion of the migration flow, respectively.
    /**
     * @dev Emitted when `initMigration` is called
     * @param rollupID Rollup ID that is being migrated
     * @param newRollupTypeID New rollup type ID that the rollup will be migrated to
     */
    event InitMigration(uint32 indexed rollupID, uint32 newRollupTypeID);

    /**
     * @dev Emitted when a rollup completes the migration to Pessimistic or ALGateway, just after proving bootstrapped batch
     * @param rollupID Rollup ID that completed the migration
     */
    event CompletedMigration(uint32 indexed rollupID);  

New Error Conditions

  • NewRollupTypeMustBePessimisticOrALGateway : Thrown when trying to migrate a rollup to a non pessimistic or ALGateway rollup type with initMigration function.
  • InvalidNewLocalExitRoot : Thrown when trying to finish a migration of a rollup to a pessimistic rollup type with verifyPessimisticTrustedAggregator function and the proposed new local exit root does not match the expected new local exit root.
1 Like