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

chore(protocol): set 167000 as the mainnet ID #16787

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents, TaikoErrors {
// - anchorGasLimit: 250_000 (based on internal devnet, its ~220_000
// after 256 L2 blocks)
return TaikoData.Config({
chainId: 167_009,
chainId: LibNetwork.TAIKO,
// Assume the block time is 3s, the protocol will allow ~90 days of
// new blocks without any verification.
blockMaxProposals: 3_000_000,
Expand Down
9 changes: 9 additions & 0 deletions packages/protocol/contracts/libs/LibNetwork.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ library LibNetwork {
uint256 internal constant HOLESKY = 17_000;
uint256 internal constant SEPOLIA = 11_155_111;

uint64 internal constant TAIKO = 167_000;

/// @dev Checks if the chain ID represents an Ethereum testnet.
/// @param _chainId The chain ID.
/// @return true if the chain ID represents an Ethereum testnet, false otherwise.
Expand All @@ -28,6 +30,13 @@ library LibNetwork {
return _chainId == LibNetwork.MAINNET || isEthereumTestnet(_chainId);
}

/// @dev Checks if the chain ID represents the Taiko L2 mainnet.
/// @param _chainId The chain ID.
/// @return true if the chain ID represents the Taiko L2 mainnet.
function isTaikoMainnet(uint256 _chainId) internal pure returns (bool) {
return _chainId == TAIKO;
}

/// @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's base layer, false
Expand Down
Loading