Skip to content

Commit

Permalink
chore(protocol): remove code related to PSE zkEVM (#16020)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Feb 24, 2024
1 parent 9cbfd08 commit c0643ff
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 3,102 deletions.
2 changes: 0 additions & 2 deletions packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, ITierProvider, TaikoEvents, Tai
function getConfig() public view virtual override returns (TaikoData.Config memory) {
// All hard-coded configurations:
// - treasury: the actual TaikoL2 address.
// - blockMaxTxs: 80 (limited by the PSE zkEVM circuits)
// - anchorGasLimit: 250_000 (based on internal devnet, its ~220_000
// after 256 L2 blocks)
return TaikoData.Config({
Expand All @@ -221,7 +220,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, ITierProvider, TaikoEvents, Tai
blockRingBufferSize: 864_100,
// Can be overridden by the tier config.
maxBlocksToVerifyPerProposal: 10,
// Limited by the PSE zkEVM circuits.
blockMaxGasLimit: 15_000_000,
// Each go-ethereum transaction has a size limit of 128KB,
// and right now txList is still saved in calldata, so we set it
Expand Down
2 changes: 0 additions & 2 deletions packages/protocol/contracts/L1/tiers/ITierProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,5 @@ interface ITierProvider {
library LibTiers {
uint16 public constant TIER_OPTIMISTIC = 100;
uint16 public constant TIER_SGX = 200;
uint16 public constant TIER_PSE_ZKEVM = 300;
uint16 public constant TIER_SGX_AND_PSE_ZKEVM = 400;
uint16 public constant TIER_GUARDIAN = 1000;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ pragma solidity 0.8.24;
import "../../common/EssentialContract.sol";
import "./ITierProvider.sol";

/// @title TaikoA6TierProvider
/// @title TestnetTierProvider
/// @dev Labeled in AddressResolver as "tier_provider"
/// @dev Assuming liveness bound is 250TKO.
// Taiko token's total supply is 1 billion. Assuming block time is 2 second, and
// the cool down period is 2 days. In 2 days, we can have (2*86400/2)=86400
// blocks. Assuming 10% tokens are used in bonds, then each block may use up to
// these many tokens: 1,000,000,000 * 10% / 86400=1157 TOK per block, which is
// about 722 USD.
contract TaikoA6TierProvider is EssentialContract, ITierProvider {
contract TestnetTierProvider is EssentialContract, ITierProvider {
error TIER_NOT_FOUND();

/// @notice Initializes the contract with the provided address manager.
Expand Down Expand Up @@ -56,17 +56,6 @@ contract TaikoA6TierProvider is EssentialContract, ITierProvider {
});
}

if (tierId == LibTiers.TIER_SGX_AND_PSE_ZKEVM) {
return ITierProvider.Tier({
verifierName: "tier_sgx_and_pse_zkevm",
validityBond: 1000 ether, // TKO
contestBond: 2000 ether, // TKO
cooldownWindow: 24 hours,
provingWindow: 6 hours,
maxBlocksToVerifyPerProof: 6
});
}

if (tierId == LibTiers.TIER_GUARDIAN) {
return ITierProvider.Tier({
verifierName: "tier_guardian",
Expand All @@ -82,16 +71,13 @@ contract TaikoA6TierProvider is EssentialContract, ITierProvider {
}

function getTierIds() public pure override returns (uint16[] memory tiers) {
tiers = new uint16[](4);
tiers = new uint16[](3);
tiers[0] = LibTiers.TIER_OPTIMISTIC;
tiers[1] = LibTiers.TIER_SGX;
tiers[2] = LibTiers.TIER_SGX_AND_PSE_ZKEVM;
tiers[3] = LibTiers.TIER_GUARDIAN;
tiers[2] = LibTiers.TIER_GUARDIAN;
}

function getMinTier(uint256 rand) public pure override returns (uint16) {
// 0.2% will be selected to require PSE zkEVM + SGX proofs.
if (rand % 500 == 0) return LibTiers.TIER_SGX_AND_PSE_ZKEVM;
// 10% will be selected to require SGX proofs.
if (rand % 10 == 0) return LibTiers.TIER_SGX;
// Other blocks are optimisitc, without validity proofs.
Expand Down
Loading

0 comments on commit c0643ff

Please sign in to comment.