Skip to content

Commit

Permalink
test full pesismistic
Browse files Browse the repository at this point in the history
  • Loading branch information
krlosMata committed Jul 26, 2024
1 parent b8f847b commit a7e7955
Show file tree
Hide file tree
Showing 3 changed files with 420 additions and 18 deletions.
10 changes: 9 additions & 1 deletion contracts/mocks/VerifierRollupHelperMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
pragma solidity 0.8.20;

import "../interfaces/IVerifierRollup.sol";
import "../v2/interfaces/ISP1Verifier.sol";

contract VerifierRollupHelperMock is IVerifierRollup {
contract VerifierRollupHelperMock is IVerifierRollup, ISP1Verifier {
function verifyProof(
bytes32[24] calldata proof,
uint256[1] memory pubSignals
) public pure override returns (bool) {
return true;
}

// SP1 interface
function verifyProof(
bytes32 programVKey,
bytes calldata publicValues,
bytes calldata proofBytes
) public pure {}
}
15 changes: 1 addition & 14 deletions contracts/v2/PolygonRollupManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -593,13 +593,6 @@ contract PolygonRollupManager is
revert UpdateToOldRollupTypeID();
}

if (
rollup.rollupVerifierType !=
rollupTypeMap[newRollupTypeID].rollupVerifierType
) {
revert UpdateNotCompatible();
}

_updateRollup(rollupContract, newRollupTypeID, new bytes(0));
}

Expand Down Expand Up @@ -655,13 +648,7 @@ contract PolygonRollupManager is

// Check rollup types
if (rollup.rollupVerifierType != newRollupType.rollupVerifierType) {
// Currently the transition from pessimistic to state transition is not allowed
if (rollup.rollupVerifierType == VerifierType.Pessimistic) {
revert RollupTypeObsolete();
}

// Update rollup verifier type
rollup.rollupVerifierType = newRollupType.rollupVerifierType;
revert UpdateNotCompatible();
}

// Update rollup parameters
Expand Down
Loading

0 comments on commit a7e7955

Please sign in to comment.