-
Notifications
You must be signed in to change notification settings - Fork 369
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
L1-L2-checks #11225
L1-L2-checks #11225
Changes from all commits
968c62f
7a623ce
0cc126a
1d4149e
c41ae10
708891b
0500b3d
fec724b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uses precompile. Added modifier for a clean revert message. |
||
require(hashHeader(headerA) != hashHeader(headerB), "Block hashes have to be different"); | ||
uint256 blockNumber = getBlockNumberFromHeader(headerA); | ||
require( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,7 +170,7 @@ contract DowntimeSlasher is ICeloVersionedContract, SlasherUtil { | |
function getBitmapForInterval( | ||
uint256 startBlock, | ||
uint256 endBlock | ||
) public view returns (bytes32) { | ||
) public view onlyL1 returns (bytes32) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uses precompile. Added modifier for a clean revert msg. |
||
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 | ||
|
@@ -215,7 +215,7 @@ contract DowntimeSlasher is ICeloVersionedContract, SlasherUtil { | |
uint256 startBlock, | ||
uint256 endBlock, | ||
uint256 signerIndex | ||
) public view returns (bool) { | ||
) public view onlyL1 returns (bool) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto |
||
require(signerIndex < numberValidatorsInSet(startBlock), "bad validator index at start block"); | ||
require( | ||
isBitmapSetForInterval(startBlock, endBlock), | ||
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto.
|
||
require(startBlocks.length > 0, "requires at least one interval"); | ||
require( | ||
startBlocks.length == endBlocks.length, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to support L2 epoch number