Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/aggregation-layer/v0.3.0/Changes-v0.3.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ The migration flow can be found explained in this section: [flow migration](./Di

#### New Mapping and Events:

- `isRollupMigrating`: A new [mapping](https://github.com/agglayer/agglayer-contracts/blob/feature/zkEVMToPP/contracts/v2/PolygonRollupManager.sol#L322) has been added to keep track of rollups that are in the process of migrating.
- `isRollupMigrating`: A new [mapping](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/contracts/v2/PolygonRollupManager.sol#L322) 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](https://github.com/agglayer/agglayer-contracts/blob/feature/zkEVMToPP/contracts/v2/PolygonRollupManager.sol#L454) and [completion](https://github.com/agglayer/agglayer-contracts/blob/feature/zkEVMToPP/contracts/v2/PolygonRollupManager.sol#L460) of the migration flow, respectively.
- `InitMigration` and `CompletedMigration`: Two events are emitted to signal the [start](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/contracts/v2/PolygonRollupManager.sol#L454) and [completion](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/contracts/v2/PolygonRollupManager.sol#L460) of the migration flow, respectively.

```
/**
Expand All @@ -48,8 +48,8 @@ The migration flow can be found explained in this section: [flow migration](./Di

#### New Error Conditions

- `NewRollupTypeMustBePessimisticOrALGateway`: [Thrown](https://github.com/agglayer/agglayer-contracts/blob/feature/zkEVMToPP/contracts/v2/PolygonRollupManager.sol#L974) when trying to migrate a rollup to a non pessimistic or ALGateway rollup type with `initMigration` function.
- `InvalidNewLocalExitRoot`: [Thrown](https://github.com/agglayer/agglayer-contracts/blob/feature/zkEVMToPP/contracts/v2/PolygonRollupManager.sol#L1324) 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.
- `NewRollupTypeMustBePessimisticOrALGateway`: [Thrown](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/contracts/v2/PolygonRollupManager.sol#L974) when trying to migrate a rollup to a non pessimistic or ALGateway rollup type with `initMigration` function.
- `InvalidNewLocalExitRoot`: [Thrown](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/contracts/v2/PolygonRollupManager.sol#L1324) 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.

#### Remedations audit
- [Comment localExitRoot](https://github.com/agglayer/agglayer-contracts/commit/b0e950539c14d565868d9de2c3f40df0b65a443a): add new comment
Expand Down Expand Up @@ -108,5 +108,5 @@ Now, the event will occur before the call. This way, there won’t be an orderin

### Tools
- e2e [instructions](https://github.com/0xPolygonHermez/protocol-team-kanban/issues/604)
- [upgrade script](https://github.com/agglayer/agglayer-contracts/tree/feature/zkEVMToPP/upgrade/upgrade-rollupManager-v0.3.1)
- [migate SC call ](https://github.com/agglayer/agglayer-contracts/tree/feature/zkEVMToPP/tools/initMigration)
- [upgrade script](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/upgrade/upgrade-rollupManager-v0.3.1)
- [migate SC call ](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/initMigration)
34 changes: 17 additions & 17 deletions docs/aggregation-layer/v0.3.0/Diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@ Here's the flow that needs to be followed to add a new aggchain (in this case, a
![Flow add new AggchainFEP](/aggregation-layer/v0.3.0/img/flow_FEP.png)

### addNewRollupType
First step a new rollup type is added. This [tool](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/tools/addRollupType) will be used to do it.
First step a new rollup type is added. This [tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/addRollupType) will be used to do it.

Following the next [README](https://github.com/agglayer/agg-contracts-internal/blob/feature/ongoing-v0.3.0/tools/addRollupType/README.md), a new rollup type is added by calling the `addNewRollupType` function of `PolygonRollupManager` contract. Once called, the `rollupTypeID` parameter will be obtained and should be used in the following tool.
Following the next [README](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/tools/addRollupType/README.md), a new rollup type is added by calling the `addNewRollupType` function of `PolygonRollupManager` contract. Once called, the `rollupTypeID` parameter will be obtained and should be used in the following tool.

### attachAggchainToAL
The second step is to create a new chain with the rollup type we created earlier. This [tool](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/tools/createNewRollup) will be used to do it.
The second step is to create a new chain with the rollup type we created earlier. This [tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/createNewRollup) will be used to do it.

The following [README](https://github.com/agglayer/agg-contracts-internal/blob/feature/ongoing-v0.3.0/tools/createNewRollup/README.md) can be followed to create the new `AggchainFEP` by calling the `attachAggchainToAL` function, using the `rollupTypeID` created with the previous tool.
The following [README](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/tools/createNewRollup/README.md) can be followed to create the new `AggchainFEP` by calling the `attachAggchainToAL` function, using the `rollupTypeID` created with the previous tool.

### add vkeys to AggLayerGateway

The third step is to initialize the vkeys in `AggLayerGateway` contract:

- This [tool](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/tools/aggLayerGatewayTools/addPessimisticVKeyRoute) is used to add the pessimistic vkey route (`addPessimisticVKeyRoute`).
- This [tool](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/tools/aggLayerGatewayTools/addDefaultAggchainVKey) is used to add the aggchain vkey (`addDefaultAggchainVKey`).
- This [tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/aggLayerGatewayTools/addPessimisticVKeyRoute) is used to add the pessimistic vkey route (`addPessimisticVKeyRoute`).
- This [tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/aggLayerGatewayTools/addDefaultAggchainVKey) is used to add the aggchain vkey (`addDefaultAggchainVKey`).

## Update v0.2.0-ECDSA to v0.3.0-FEP

![Flow update to AggchainFEP](/aggregation-layer/v0.3.0/img/update_FEP.png)

### addNewRollupType
First step a new rollup type is added. This [tool](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/tools/addRollupType) will be used to do it.
First step a new rollup type is added. This [tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/addRollupType) will be used to do it.

Following the next [README](https://github.com/agglayer/agg-contracts-internal/blob/feature/ongoing-v0.3.0/tools/addRollupType/README.md), a new rollup type is added by calling the `addNewRollupType` function of `PolygonRollupManager` contract. Once called, the `rollupTypeID` parameter will be obtained and should be used in the following tool.
Following the next [README](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/tools/addRollupType/README.md), a new rollup type is added by calling the `addNewRollupType` function of `PolygonRollupManager` contract. Once called, the `rollupTypeID` parameter will be obtained and should be used in the following tool.

### updateRollup
The second step is to update the old rollup to the new rollup type that was created with the previous tool. This [tool](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/tools/updateRollup) will be used to do it.
The second step is to update the old rollup to the new rollup type that was created with the previous tool. This [tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/updateRollup) will be used to do it.

The following [README](https://github.com/agglayer/agg-contracts-internal/blob/feature/ongoing-v0.3.0/tools/updateRollup/README.md) can be followed to update the old rollup to the new rollup type created with the previous tool by calling the `updateRollup` function, using the `rollupTypeID` created with the previous tool.
The following [README](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/tools/updateRollup/README.md) can be followed to update the old rollup to the new rollup type created with the previous tool by calling the `updateRollup` function, using the `rollupTypeID` created with the previous tool.

### add vkeys to AggLayerGateway

The third step is to initialize the vkeys in `AggLayerGateway` contract:

- This [tool](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/tools/aggLayerGatewayTools/addPessimisticVKeyRoute) is used to add the pessimistic vkey route (`addPessimisticVKeyRoute`).
- This [tool](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/tools/aggLayerGatewayTools/addDefaultAggchainVKey) is used to add the aggchain vkey (`addDefaultAggchainVKey`).
- This [tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/aggLayerGatewayTools/addPessimisticVKeyRoute) is used to add the pessimistic vkey route (`addPessimisticVKeyRoute`).
- This [tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/aggLayerGatewayTools/addDefaultAggchainVKey) is used to add the aggchain vkey (`addDefaultAggchainVKey`).

## Verify FEP

Expand Down Expand Up @@ -99,7 +99,7 @@ If the verification succeeds:

### Migration Initialization

A new [function](https://github.com/agglayer/agglayer-contracts/blob/feature/zkEVMToPP/contracts/v2/PolygonRollupManager.sol#L954), `initMigration`, enables the explicit start of a migration process.
A new [function](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/contracts/v2/PolygonRollupManager.sol#L954), `initMigration`, enables the explicit start of a migration process.

This function performs checks to ensure:

Expand All @@ -110,7 +110,7 @@ This function performs checks to ensure:

### Proof Verification During Migration

The `verifyPessimisticTrustedAggregator` [function](https://github.com/agglayer/agglayer-contracts/blob/feature/zkEVMToPP/contracts/v2/PolygonRollupManager.sol#L1313) was adjusted to support special cases that occur during the migration process.
The `verifyPessimisticTrustedAggregator` [function](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/contracts/v2/PolygonRollupManager.sol#L1313) was adjusted to support special cases that occur during the migration process.

- It now allows the verification of bootstrap certificates, which are required to validate the first proof after switching to the new system.
- It's a hard requirement that the `newLocalExitRoot` matches the current `lastLocalExitRoot` meaning that the certificates covers all the bridges
Expand All @@ -121,11 +121,11 @@ The `verifyPessimisticTrustedAggregator` [function](https://github.com/agglayer/
![Flow migration](/aggregation-layer/v0.3.0/img/migration_flow.png)

#### addNewRollupType
First step a new rollup type is added. This [tool](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/tools/addRollupType) will be used to do it.
First step a new rollup type is added. This [tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/addRollupType) will be used to do it.

Following the next [README](https://github.com/agglayer/agg-contracts-internal/blob/feature/ongoing-v0.3.0/tools/addRollupType/README.md), a new rollup type is added by calling the `addNewRollupType` function of `PolygonRollupManager` contract. Once called, the `rollupTypeID` parameter will be obtained and should be used in the following tool.
Following the next [README](https://github.com/agglayer/agglayer-contracts/blob/v11.0.0/tools/addRollupType/README.md), a new rollup type is added by calling the `addNewRollupType` function of `PolygonRollupManager` contract. Once called, the `rollupTypeID` parameter will be obtained and should be used in the following tool.

#### initMigration
To initiate the migration, this tool can be used: [initMigration tool](https://github.com/agglayer/agglayer-contracts/tree/feature/zkEVMToPP/tools/initMigration)
To initiate the migration, this tool can be used: [initMigration tool](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/tools/initMigration)
We will see that an event indicating the migration has been initialized is emitted (`InitMigration`).
Finally, when the verification is done with `verifyPessimisticTrustedAggregator`, an event indicating that the migration has been completed will be emitted (`CompletedMigration`).
2 changes: 1 addition & 1 deletion docs/aggregation-layer/v0.3.0/Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You can change the deployment `mnemonic` creating a `.env` file in the project r
- docker-compose

## 2. Config files
In the case of the Docker deployment, we are going to take the default configuration files that we have in this [folder](https://github.com/agglayer/agg-contracts-internal/tree/feature/ongoing-v0.3.0/docker/scripts/v2).
In the case of the Docker deployment, we are going to take the default configuration files that we have in this [folder](https://github.com/agglayer/agglayer-contracts/tree/v11.0.0/docker/scripts/v2).

### 2.1. deploy_parameters.json

Expand Down
Loading