-
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): user smaller cooldown windows (#18345)
Co-authored-by: dantaik <dantaik@users.noreply.github.com>
- Loading branch information
Showing
12 changed files
with
93 additions
and
110 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
49 changes: 0 additions & 49 deletions
49
packages/protocol/contracts/layer1/hekla/HeklaTierProvider.sol
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
packages/protocol/contracts/layer1/hekla/HeklaTierRouter.sol
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,43 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.24; | ||
|
||
import "../tiers/TierProviderBase.sol"; | ||
import "../tiers/ITierRouter.sol"; | ||
|
||
/// @title HeklaTierRouter | ||
/// @custom:security-contact security@taiko.xyz | ||
contract HeklaTierRouter is TierProviderBase, ITierRouter { | ||
address public immutable DAO_FALLBACK_PROPOSER; | ||
|
||
constructor(address _daoFallbackProposer) { | ||
// 0xD3f681bD6B49887A48cC9C9953720903967E9DC0 | ||
DAO_FALLBACK_PROPOSER = _daoFallbackProposer; | ||
} | ||
|
||
/// @inheritdoc ITierRouter | ||
function getProvider(uint256) external view returns (address) { | ||
return address(this); | ||
} | ||
|
||
/// @inheritdoc ITierProvider | ||
function getTierIds() external pure returns (uint16[] memory tiers_) { | ||
tiers_ = new uint16[](6); | ||
tiers_[0] = LibTiers.TIER_OPTIMISTIC; | ||
tiers_[1] = LibTiers.TIER_SGX; | ||
tiers_[2] = LibTiers.TIER_ZKVM_RISC0; | ||
tiers_[3] = LibTiers.TIER_ZKVM_SP1; | ||
tiers_[4] = LibTiers.TIER_GUARDIAN_MINORITY; | ||
tiers_[5] = LibTiers.TIER_GUARDIAN; | ||
} | ||
|
||
/// @inheritdoc ITierProvider | ||
function getMinTier(address _proposer, uint256 _rand) public view override returns (uint16) { | ||
if (_proposer == DAO_FALLBACK_PROPOSER) { | ||
if (_rand % 1000 == 0) return LibTiers.TIER_ZKVM_RISC0; | ||
else if (_rand % 1000 == 1) return LibTiers.TIER_ZKVM_SP1; | ||
else return LibTiers.TIER_SGX; | ||
} | ||
|
||
return _rand % 2 == 0 ? LibTiers.TIER_SGX : 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
21 changes: 0 additions & 21 deletions
21
packages/protocol/contracts/layer1/tiers/TierProviderV2.sol
This file was deleted.
Oops, something went wrong.
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