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

fix(protocol): fix proving window logic #17378

Merged
merged 5 commits into from
May 27, 2024
Merged
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
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