Skip to content

Commit

Permalink
Merge branch 'main' into lastSyncedAt
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Apr 5, 2024
2 parents b74f47e + e787493 commit 9af4d5a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/protocol/contracts/L1/libs/LibProposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../../common/IAddressResolver.sol";
import "../../libs/LibAddress.sol";
import "../../libs/LibNetwork.sol";
import "../hooks/IHook.sol";
import "../tiers/ITierProvider.sol";

Expand Down Expand Up @@ -122,7 +123,7 @@ library LibProposing {

// Update certain meta fields
if (meta_.blobUsed) {
if (block.chainid != 1) revert L1_BLOB_NOT_AVAILABLE();
if (!LibNetwork.isDencunSupported(block.chainid)) revert L1_BLOB_NOT_AVAILABLE();

// Always use the first blob in this transaction. If the
// proposeBlock functions are called more than once in the same
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ contract Bridge is EssentialContract, IBridge {
// For Taiko mainnet and public testnets
// 384 seconds = 6.4 minutes = one ethereum epoch
return (1 hours, 384 seconds);
} else if (LibNetwork.isTaikoDevnet(block.chainid)) {
} else if (LibNetwork.isTaikoDevnetL1(block.chainid)) {
return (5 minutes, 384 seconds);
} else {
// This is a Taiko L2 chain where no deleys are applied.
Expand Down
9 changes: 5 additions & 4 deletions packages/protocol/contracts/libs/LibNetwork.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ library LibNetwork {
return _chainId == LibNetwork.MAINNET || isEthereumTestnet(_chainId);
}

/// @dev Checks if the chain ID represents an internal Taiko devnet.
/// @dev Checks if the chain ID represents an internal Taiko devnet's base layer.
/// @param _chainId The chain ID.
/// @return true if the chain ID represents an internal Taiko devnet, false otherwise.
function isTaikoDevnet(uint256 _chainId) internal pure returns (bool) {
/// @return true if the chain ID represents an internal Taiko devnet's base layer, false
/// otherwise.
function isTaikoDevnetL1(uint256 _chainId) internal pure returns (bool) {
return _chainId >= 32_300 && _chainId <= 32_400;
}

Expand All @@ -41,6 +42,6 @@ library LibNetwork {
/// @return true if the chain supports Dencun hardfork, false otherwise.
function isDencunSupported(uint256 _chainId) internal pure returns (bool) {
return _chainId == LibNetwork.MAINNET || _chainId == LibNetwork.HOLESKY
|| _chainId == LibNetwork.SEPOLIA;
|| _chainId == LibNetwork.SEPOLIA || isTaikoDevnetL1(_chainId);
}
}
2 changes: 1 addition & 1 deletion packages/protocol/contracts/verifiers/SgxVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract SgxVerifier is EssentialContract, IVerifier {

/// @notice A security feature, a delay until an instance is enabled when using onchain RA
/// verification
uint64 public constant INSTANCE_VALIDITY_DELAY = 1 days;
uint64 public constant INSTANCE_VALIDITY_DELAY = 0;

/// @dev For gas savings, we shall assign each SGX instance with an id that when we need to
/// set a new pub key, just write storage once.
Expand Down

0 comments on commit 9af4d5a

Please sign in to comment.