Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rollupManager initializer versioning #314

Merged
merged 4 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 15 additions & 0 deletions contracts/v2/PolygonRollupManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ contract PolygonRollupManager is
// Last timestamp when an aggregation happen
uint64 public lastAggregationTimestamp;

// Current rollup manager version
string public constant ROLLUP_MANAGER_VERSION = "pessimistic";
Copy link
Collaborator

Choose a reason for hiding this comment

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

move it to constants part of the file^^


// Trusted aggregator timeout, if a sequence is not verified in this time frame,
// everyone can verify that sequence
/// @custom:oz-renamed-from trustedAggregatorTimeout
Expand Down Expand Up @@ -382,6 +385,11 @@ contract PolygonRollupManager is
*/
event SetBatchFee(uint256 newBatchFee);

/**
* @dev Emitted when rollup manager is upgraded
*/
event UpdateRollupManagerVersion(string rollupManagerVersion);

/**
* @param _globalExitRootManager Global exit root manager address
* @param _pol POL token address
Expand All @@ -400,6 +408,13 @@ contract PolygonRollupManager is
_disableInitializers();
}

/**
* Initializer function to set new rollup manager version
*/
function initialize() external virtual reinitializer(3) {
emit UpdateRollupManagerVersion(ROLLUP_MANAGER_VERSION);
}

///////////////////////////////////////
// Rollups management functions
///////////////////////////////////////
Expand Down
75 changes: 0 additions & 75 deletions contracts/v2/mocks/PolygonRollupManagerMockInternalTest.sol

This file was deleted.

2 changes: 2 additions & 0 deletions test/contractsv2/PolygonRollupManager-Pessimistic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ describe("Polygon Rollup Manager with Polygon Pessimistic Consensus", () => {
emergencyCouncil.address
);

await expect(rollupManagerContract.initialize()).to.emit(rollupManagerContract, "UpdateRollupManagerVersion")

// fund sequencer address with Matic tokens
await polTokenContract.transfer(trustedSequencer.address, ethers.parseEther("1000"));
});
Expand Down
Loading