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

ReleaseGold L2 Compatibility Check #11005

Merged
merged 15 commits into from
May 24, 2024
2 changes: 2 additions & 0 deletions packages/protocol/contracts/governance/ReleaseGold.sol
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ contract ReleaseGold is UsingRegistry, ReentrancyGuard, IReleaseGold, Initializa
* @param ecdsaPublicKey The ECDSA public key corresponding to `signer`.
* @dev The v,r and s signature should be signed by the authorized signer
* key, with the ReleaseGold contract address as the message.
* @dev Function is deprecated on L2.
*/
function authorizeValidatorSignerWithPublicKey(
address payable signer,
Expand Down Expand Up @@ -479,6 +480,7 @@ contract ReleaseGold is UsingRegistry, ReentrancyGuard, IReleaseGold, Initializa
* account address. 48 bytes.
* @dev The v,r and s signature should be signed by the authorized signer
* key, with the ReleaseGold contract address as the message.
* @dev Function is deprecated on L2.
*/
function authorizeValidatorSignerWithKeys(
address payable signer,
Expand Down
17 changes: 14 additions & 3 deletions packages/protocol/contracts/governance/test/MockValidators.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ pragma solidity ^0.5.13;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";

import "../../../contracts-0.8/common/IsL2Check.sol";

/**
* @title Holds a list of addresses of validators
*/
contract MockValidators {
contract MockValidators is IsL2Check {
using SafeMath for uint256;

uint256 private constant FIXED1_UINT = 1000000000000000000000000;
Expand All @@ -20,6 +22,7 @@ contract MockValidators {
uint256 private numRegisteredValidators;

function updateEcdsaPublicKey(address, address, bytes calldata) external returns (bool) {
allowOnlyL1();
return true;
}

Expand All @@ -30,6 +33,7 @@ contract MockValidators {
bytes calldata,
bytes calldata
) external returns (bool) {
allowOnlyL1();
return true;
}

Expand All @@ -42,6 +46,7 @@ contract MockValidators {
}

function affiliate(address group) external returns (bool) {
allowOnlyL1();
affiliations[msg.sender] = group;
return true;
}
Expand All @@ -62,9 +67,13 @@ contract MockValidators {
lockedGoldRequirements[account] = value;
}

function halveSlashingMultiplier(address) external {}
function halveSlashingMultiplier(address) external {
allowOnlyL1();
}

function forceDeaffiliateIfValidator(address validator) external {}
function forceDeaffiliateIfValidator(address validator) external {
allowOnlyL1();
}

function getTopGroupValidators(
address group,
Expand All @@ -79,6 +88,7 @@ contract MockValidators {
}

function getValidatorGroupSlashingMultiplier(address) external view returns (uint256) {
allowOnlyL1();
return FIXED1_UINT;
}

Expand Down Expand Up @@ -107,6 +117,7 @@ contract MockValidators {
}

function groupMembershipInEpoch(address addr, uint256, uint256) external view returns (address) {
allowOnlyL1();
return affiliations[addr];
}

Expand Down
Loading
Loading