Skip to content

Cleanup PolygonPessimisticConsensus 1#575

Draft
alrevuelta wants to merge 1 commit intodevelopfrom
polpesconsensus-clean1
Draft

Cleanup PolygonPessimisticConsensus 1#575
alrevuelta wants to merge 1 commit intodevelopfrom
polpesconsensus-clean1

Conversation

@alrevuelta
Copy link
Contributor

@alrevuelta alrevuelta commented Nov 25, 2025

This PR is part of a series of multiple PRs cleaning up the legacy PolygonPessimisticConsensus. All code referencing such feature is removed. This can be done since there are no PolygonPessimisticConsensus deployed in any chain (mainnet, testnets, etc), no migrations to/from PolygonPessimisticConsensus are expected in the future and no new deployment with such types will happen in the future.

Since the changes are rather big for a single PR, more PRs will follow up addressing the following in parts:

  • Updates in AgglayerManager and tests (this)
  • Update scripts and tools
  • Update previous version. As agreed in previous versions we will only keep things that are deprecated but still existing onchain.
  • Other cleanups.

NOTE: Do not merge this PR until feature/v13 branch is created.

@alrevuelta alrevuelta changed the base branch from main to feature/v12 November 25, 2025 17:01
@@ -4,36 +4,29 @@
/* eslint-disable no-plusplus, no-await-in-loop */
Copy link
Contributor Author

@alrevuelta alrevuelta Nov 25, 2025

Choose a reason for hiding this comment

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

Some things re this file:

  • The diff is missleading. I havent added code, just removed. And some very very minor renaming and changes.
  • To avoid more complexity in here, leaving this as TODO. This file is named UpgradeToPP but there is a should create rollup type validium & migrate to ALGateway test. I guess that test doesn't belong here. If so, will move it in a different PR.


describe('Polygon Rollup Manager with Polygon Pessimistic Consensus', () => {

describe('Polygon Rollup Manager with zkevm etrog migration to ECDSA Multisig with real prover', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed this, since this test contains migration zkevm etroc to ECDSA as well, not just to PP.

await polTokenContract.transfer(trustedSequencer, ethers.parseEther('1000'));
});

it('should check the initialized parameters', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed this logic since it is already tested here: https://github.com/agglayer/agglayer-contracts/blob/feature/v12/test/contractsv2/PolygonRollupManager.test.ts#L225-L256 It was a copy paste, so no need to be duplicated.

@alrevuelta alrevuelta marked this pull request as ready for review November 25, 2025 17:26
@alrevuelta alrevuelta changed the title Polpesconsensus clean1 Cleanup PolygonPessimisticConsensus 1 Nov 25, 2025
Comment on lines -531 to -534
if (rollupVerifierType == VerifierType.Pessimistic) {
// No genesis on pessimistic rollups
if (genesis != bytes32(0)) revert InvalidRollupType();
} else if (rollupVerifierType == VerifierType.ALGateway) {
Copy link
Collaborator

@invocamanman invocamanman Dec 2, 2025

Choose a reason for hiding this comment

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

after those lines fix comment:
// unreachable code since solidity enforces the enum input rollupVerifierType to be one of the enum values

Comment on lines -781 to -788
if (rollupVerifierType == VerifierType.Pessimistic) {
rollup.programVKey = programVKey;
rollup.lastPessimisticRoot = initPessimisticRoot;
rollup.lastLocalExitRoot = initRoot;
if (verifier.code.length == 0) {
revert InvalidVerifierAddress();
}
} else if (rollupVerifierType == VerifierType.ALGateway) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

the condition if (rollupVerifierType == VerifierType.Pessimistic) {
should revert with a custom error.
Now we can create a "weird" state transition rollup

@krlosMata
Copy link
Member

This cleanup will come with v13, I'd suggest to change the PR to draft

@alrevuelta alrevuelta marked this pull request as draft December 2, 2025 17:31
Base automatically changed from feature/v12 to develop December 19, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants