-
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.
…17913) Co-authored-by: YoGhurt111 <YoGhurt111@users.noreply.github.com> Co-authored-by: David <david@taiko.xyz> Co-authored-by: Daniel Wang <dan@taiko.xyz>
- Loading branch information
1 parent
0c10ac9
commit 64ed666
Showing
7 changed files
with
104 additions
and
17 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
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
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import "../L1/tiers/TierProviderBase.sol"; | ||
|
||
/// @title HeklaTierProvider | ||
/// @custom:security-contact security@taiko.xyz | ||
contract HeklaTierProvider is TierProviderBase { | ||
/// @inheritdoc ITierProvider | ||
function getTierIds() public pure override returns (uint16[] memory tiers_) { | ||
tiers_ = new uint16[](5); | ||
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; | ||
} | ||
|
||
/// @inheritdoc ITierProvider | ||
function getMinTier(uint256 _rand) public pure override returns (uint16) { | ||
if (_rand % 1000 == 0) { | ||
// 0.1% of the total blocks will require ZKVM proofs. | ||
return LibTiers.TIER_ZKVM_RISC0; | ||
} else if (_rand % 2 == 0) { | ||
// 50% of the total blocks will require SGX proofs. | ||
return LibTiers.TIER_SGX; | ||
} | ||
return LibTiers.TIER_OPTIMISTIC; | ||
} | ||
} |
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
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.8.24; | ||
|
||
import "@risc0/contracts/groth16/RiscZeroGroth16Verifier.sol"; | ||
import "../test/DeployCapability.sol"; | ||
import "../contracts/verifiers/RiscZeroVerifier.sol"; | ||
|
||
contract DeployRisc0Verifier is DeployCapability { | ||
uint256 public deployerPrivKey = vm.envUint("PRIVATE_KEY"); | ||
address public rollupAddressManager = vm.envAddress("ROLLUP_ADDRESS_MANAGER"); | ||
|
||
function run() external { | ||
require(deployerPrivKey != 0, "invalid deployer priv key"); | ||
require(rollupAddressManager != address(0), "invalid rollup address manager address"); | ||
|
||
vm.startBroadcast(deployerPrivKey); | ||
RiscZeroGroth16Verifier verifier = | ||
new RiscZeroGroth16Verifier(ControlID.CONTROL_ROOT, ControlID.BN254_CONTROL_ID); | ||
register(rollupAddressManager, "risc0_groth16_verifier", address(verifier)); | ||
deployProxy({ | ||
name: "tier_zkvm_risc0", | ||
impl: address(new RiscZeroVerifier()), | ||
data: abi.encodeCall(RiscZeroVerifier.init, (address(0), rollupAddressManager)), | ||
registerTo: rollupAddressManager | ||
}); | ||
vm.stopBroadcast(); | ||
} | ||
} |