Skip to content
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

fix(protocol): fix tier id conflicts #18004

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions packages/protocol/contracts/L1/tiers/LibTiers.sol
Original file line number Diff line number Diff line change
@@ -2,29 +2,23 @@
pragma solidity 0.8.24;

/// @title LibTiers
/// @dev Tier ID cannot be zero!
/// @dev Tier ID cannot be zero and must be unique.
/// @custom:security-contact security@taiko.xyz
library LibTiers {
/// @notice Optimistic tier ID.
uint16 public constant TIER_OPTIMISTIC = 100;

/// @notice SGX proof
/// @notice TEE tiers
/// Although these tiers have diffeerent IDs, at most one should be selected in a verifier.
uint16 public constant TIER_SGX = 200;

/// @notice TDX proof
uint16 public constant TIER_TDX = 200;

/// @notice Any TEE proof
uint16 public constant TIER_TEE_ANY = 200;

/// @notice Risc0's ZKVM proof
uint16 public constant TIER_ZKVM_RISC0 = 290;

/// @notice SP1's ZKVM proof
uint16 public constant TIER_ZKVM_SP1 = 290;

/// @notice Any ZKVM proof
uint16 public constant TIER_ZKVM_ANY = 290;
uint16 public constant TIER_TDX = 201;
uint16 public constant TIER_TEE_ANY = 202;

/// @notice ZK Tiers.
/// Although these tiers have diffeerent IDs, at most one should be selected in a verifier.
uint16 public constant TIER_ZKVM_RISC0 = 250;
uint16 public constant TIER_ZKVM_SP1 = 251;
uint16 public constant TIER_ZKVM_ANY = 252;

/// @notice Any ZKVM+TEE proof
uint16 public constant TIER_ZKVM_AND_TEE = 300;
Loading