Skip to content

Commit

Permalink
fix(protocol): fix proving window logic (#17378)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored May 27, 2024
1 parent 06f97d6 commit 9ad6691
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/protocol/contracts/L1/libs/LibProving.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ library LibProving {
struct Local {
TaikoData.SlotB b;
ITierProvider.Tier tier;
ITierProvider.Tier minTier;
bytes32 metaHash;
address assignedProver;
uint64 slot;
Expand Down Expand Up @@ -152,13 +153,16 @@ library LibProving {

// Retrieve the tier configurations. If the tier is not supported, the
// subsequent action will result in a revert.
local.tier =
ITierProvider(_resolver.resolve(LibStrings.B_TIER_PROVIDER, false)).getTier(_proof.tier);
ITierProvider tierProvider =
ITierProvider(_resolver.resolve(LibStrings.B_TIER_PROVIDER, false));

local.tier = tierProvider.getTier(_proof.tier);
local.minTier = tierProvider.getTier(_meta.minTier);

local.inProvingWindow = !LibUtils.isPostDeadline({
_tsTimestamp: blk.proposedAt,
_tsTimestamp: ts.timestamp,
_lastUnpausedAt: local.b.lastUnpausedAt,
_windowMinutes: local.tier.provingWindow
_windowMinutes: local.minTier.provingWindow
});

// Checks if only the assigned prover is permissioned to prove the block.
Expand Down

0 comments on commit 9ad6691

Please sign in to comment.