-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protocol): update
HeklaTierProvider
to introduce sp1 proof (#1…
…8022) Co-authored-by: YoGhurt111 <[email protected]>
- Loading branch information
1 parent
434bf3c
commit 76b6514
Showing
1 changed file
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,27 +2,37 @@ | |
pragma solidity 0.8.24; | ||
|
||
import "../L1/tiers/TierProviderBase.sol"; | ||
import "../L1/tiers/ITierRouter.sol"; | ||
|
||
/// @title HeklaTierProvider | ||
/// @custom:security-contact [email protected] | ||
contract HeklaTierProvider is TierProviderBase { | ||
contract HeklaTierProvider is TierProviderBase, ITierRouter { | ||
address public constant LAB_PROPOSER = 0xD3f681bD6B49887A48cC9C9953720903967E9DC0; | ||
|
||
/// @inheritdoc ITierRouter | ||
function getProvider(uint256) external view returns (address) { | ||
return address(this); | ||
} | ||
|
||
/// @inheritdoc ITierProvider | ||
function getTierIds() public pure override returns (uint16[] memory tiers_) { | ||
tiers_ = new uint16[](5); | ||
tiers_ = new uint16[](6); | ||
tiers_[0] = LibTiers.TIER_OPTIMISTIC; | ||
tiers_[1] = LibTiers.TIER_SGX; | ||
tiers_[2] = LibTiers.TIER_ZKVM_RISC0; | ||
tiers_[3] = LibTiers.TIER_GUARDIAN_MINORITY; | ||
tiers_[4] = LibTiers.TIER_GUARDIAN; | ||
tiers_[5] = LibTiers.TIER_ZKVM_SP1; | ||
} | ||
|
||
/// @inheritdoc ITierProvider | ||
function getMinTier(address _proposer, uint256 _rand) public pure override returns (uint16) { | ||
if (_proposer == LAB_PROPOSER && _rand % 1000 == 0) { | ||
// 0.1% of the total blocks will require ZKVM proofs. | ||
// 0.1% of the total blocks will require ZKVM Risc0 proofs. | ||
return LibTiers.TIER_ZKVM_RISC0; | ||
} else if (_proposer == LAB_PROPOSER && _rand % 1000 == 1) { | ||
// 0.1% of the total blocks will require ZKVM Sp1 proofs. | ||
return LibTiers.TIER_ZKVM_SP1; | ||
} else if (_rand % 2 == 0) { | ||
// 50% of the total blocks will require SGX proofs. | ||
return LibTiers.TIER_SGX; | ||
|