Skip to content

Commit

Permalink
respond to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Jul 6, 2024
1 parent 35768ec commit 3f93b70
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
11 changes: 9 additions & 2 deletions packages/protocol/contracts/L1/TaikoData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ library TaikoData {
// ---------------------------------------------------------------------
// The number of L2 blocks between each L2-to-L1 state root sync.
uint8 stateRootSyncInternal;
uint64 maxAnchorHeightOffset;
// ---------------------------------------------------------------------
// Group 5: Others
// ---------------------------------------------------------------------
// The number of L2 blocks between each L2-to-L1 state root sync.
uint64 ontakeForkHeight;
}

Expand Down Expand Up @@ -110,8 +115,10 @@ library TaikoData {
bytes32 parentMetaHash;
address proposer;
uint96 livenessBond;
uint64 proposedAt; // timestamp
uint64 proposedIn; // L1 block number, required/used by node/client.
// Time this block is proposed at, used to check proving window and cooldown window.
uint64 proposedAt;
// L1 block number, required/used by node/client.
uint64 proposedIn;
}

/// @dev Struct representing transition to be proven.
Expand Down
3 changes: 2 additions & 1 deletion packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ contract TaikoL1 is EssentialContract, ITaikoL1 {
blockMaxGasLimit: 240_000_000,
livenessBond: 125e18, // 125 Taiko token
stateRootSyncInternal: 16,
ontakeForkHeight: 324_512 * 2
maxAnchorHeightOffset: 64,
ontakeForkHeight: 500_000
});
}

Expand Down
6 changes: 4 additions & 2 deletions packages/protocol/contracts/L1/libs/LibProposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import "./LibUtils.sol";
library LibProposing {
using LibAddress for address;

uint256 public constant MAX_ANCHOR_HEIGHT_OFFSET = 64;

struct Local {
TaikoData.SlotB b;
bytes32 parentMetaHash;
Expand Down Expand Up @@ -126,7 +128,7 @@ library LibProposing {
// one
// in the previous L2 block.
if (
params.anchorBlockId + 64 < block.number //
params.anchorBlockId + _config.maxAnchorHeightOffset < block.number //
|| params.anchorBlockId >= block.number
|| params.anchorBlockId < parentBlk.proposedIn
) {
Expand All @@ -139,7 +141,7 @@ library LibProposing {
// one
// in the previous L2 block.
if (
params.timestamp + 64 * 12 < block.timestamp
params.timestamp + _config.maxAnchorHeightOffset * 12 < block.timestamp
|| params.timestamp > block.timestamp || params.timestamp < parentBlk.proposedAt
) {
revert L1_INVALID_TIMESTAMP();
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/tiers/TierRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "./ITierRouter.sol";
/// @dev Labeled in AddressResolver as "tier_router"
/// @custom:security-contact [email protected]
contract TierRouter is ITierRouter {
uint256 public constant ONTAKE_FORK_HEIGHT = 324_512 * 2;
uint256 public constant ONTAKE_FORK_HEIGHT = 500_000;

/// @inheritdoc ITierRouter
function getProvider(uint256 _blockId) external pure returns (address) {
Expand Down

0 comments on commit 3f93b70

Please sign in to comment.