-
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.
fix(protocol)!: apply bug fixes and introduce a few new features (#16543
- Loading branch information
Showing
38 changed files
with
712 additions
and
336 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
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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import "../../libs/LibMath.sol"; | ||
import "../TaikoData.sol"; | ||
|
||
/// @title LibUtils | ||
/// @notice A library that offers helper functions. | ||
/// @custom:security-contact [email protected] | ||
library LibUtils { | ||
using LibMath for uint256; | ||
|
||
// Warning: Any errors defined here must also be defined in TaikoErrors.sol. | ||
error L1_BLOCK_MISMATCH(); | ||
error L1_INVALID_BLOCK_ID(); | ||
|
@@ -85,4 +88,17 @@ library LibUtils { | |
|
||
if (tid_ >= _blk.nextTransitionId) revert L1_UNEXPECTED_TRANSITION_ID(); | ||
} | ||
|
||
function isPostDeadline( | ||
uint256 _tsTimestamp, | ||
uint256 _lastUnpausedAt, | ||
uint256 _windowMinutes | ||
) | ||
internal | ||
view | ||
returns (bool) | ||
{ | ||
uint256 deadline = _tsTimestamp.max(_lastUnpausedAt) + _windowMinutes * 60; | ||
return block.timestamp >= deadline; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,10 +4,10 @@ pragma solidity 0.8.24; | |
import "../../common/EssentialContract.sol"; | ||
import "./ITierProvider.sol"; | ||
|
||
/// @title TestnetTierProvider | ||
/// @title TierProviderV1 | ||
/// @dev Labeled in AddressResolver as "tier_provider" | ||
/// @custom:security-contact [email protected] | ||
contract TestnetTierProvider is EssentialContract, ITierProvider { | ||
contract TierProviderV1 is EssentialContract, ITierProvider { | ||
uint256[50] private __gap; | ||
|
||
/// @notice Initializes the contract. | ||
|
@@ -32,8 +32,8 @@ contract TestnetTierProvider is EssentialContract, ITierProvider { | |
if (_tierId == LibTiers.TIER_SGX) { | ||
return ITierProvider.Tier({ | ||
verifierName: "tier_sgx", | ||
validityBond: 500 ether, // TKO | ||
contestBond: 1000 ether, // TKO | ||
validityBond: 250 ether, // TKO | ||
contestBond: 1640 ether, // =250TKO * 6.5625 | ||
cooldownWindow: 1440, //24 hours | ||
provingWindow: 60, // 1 hours | ||
maxBlocksToVerifyPerProof: 8 | ||
|
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 |
---|---|---|
|
@@ -4,10 +4,10 @@ pragma solidity 0.8.24; | |
import "../../common/EssentialContract.sol"; | ||
import "./ITierProvider.sol"; | ||
|
||
/// @title MainnetTierProvider | ||
/// @title TierProviderV2 | ||
/// @dev Labeled in AddressResolver as "tier_provider" | ||
/// @custom:security-contact [email protected] | ||
contract MainnetTierProvider is EssentialContract, ITierProvider { | ||
contract TierProviderV2 is EssentialContract, ITierProvider { | ||
uint256[50] private __gap; | ||
|
||
/// @notice Initializes the contract. | ||
|
@@ -22,7 +22,7 @@ contract MainnetTierProvider is EssentialContract, ITierProvider { | |
return ITierProvider.Tier({ | ||
verifierName: "tier_sgx", | ||
validityBond: 250 ether, // TKO | ||
contestBond: 500 ether, // TKO | ||
contestBond: 1640 ether, // =250TKO * 6.5625 | ||
cooldownWindow: 1440, //24 hours | ||
provingWindow: 60, // 1 hours | ||
maxBlocksToVerifyPerProof: 8 | ||
|
@@ -33,7 +33,7 @@ contract MainnetTierProvider is EssentialContract, ITierProvider { | |
return ITierProvider.Tier({ | ||
verifierName: "tier_sgx_zkvm", | ||
validityBond: 500 ether, // TKO | ||
contestBond: 1000 ether, // TKO | ||
contestBond: 3280 ether, // =500TKO * 6.5625 | ||
cooldownWindow: 1440, //24 hours | ||
provingWindow: 240, // 4 hours | ||
maxBlocksToVerifyPerProof: 4 | ||
|
Oops, something went wrong.