Skip to content

Commit

Permalink
++ missing onlyL1 check in downtime & double signing slasher
Browse files Browse the repository at this point in the history
  • Loading branch information
soloseng committed Sep 24, 2024
1 parent 580bd9d commit 968c62f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ contract DoubleSigningSlasher is ICeloVersionedContract, SlasherUtil {
uint256 index,
bytes memory headerA,
bytes memory headerB
) public view returns (uint256) {
) public view onlyL1 returns (uint256) {
require(hashHeader(headerA) != hashHeader(headerB), "Block hashes have to be different");
uint256 blockNumber = getBlockNumberFromHeader(headerA);
require(
Expand Down
6 changes: 3 additions & 3 deletions packages/protocol/contracts/governance/DowntimeSlasher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ contract DowntimeSlasher is ICeloVersionedContract, SlasherUtil {
function getBitmapForInterval(
uint256 startBlock,
uint256 endBlock
) public view returns (bytes32) {
) public view onlyL1 returns (bytes32) {
require(endBlock >= startBlock, "endBlock must be greater or equal than startBlock");
// The signature bitmap for block N is stored in block N+1.
// The latest block is `block.number - 1`, which stores the signature bitmap for
Expand Down Expand Up @@ -215,7 +215,7 @@ contract DowntimeSlasher is ICeloVersionedContract, SlasherUtil {
uint256 startBlock,
uint256 endBlock,
uint256 signerIndex
) public view returns (bool) {
) public view onlyL1 returns (bool) {
require(signerIndex < numberValidatorsInSet(startBlock), "bad validator index at start block");
require(
isBitmapSetForInterval(startBlock, endBlock),
Expand Down Expand Up @@ -250,7 +250,7 @@ contract DowntimeSlasher is ICeloVersionedContract, SlasherUtil {
uint256[] memory startBlocks,
uint256[] memory endBlocks,
uint256[] memory signerIndices
) public view returns (bool) {
) public view onlyL1 returns (bool) {
require(startBlocks.length > 0, "requires at least one interval");
require(
startBlocks.length == endBlocks.length,
Expand Down

0 comments on commit 968c62f

Please sign in to comment.