Skip to content

Commit 094a67a

Browse files
authored
fix: use a named deadline timer in CCC stage (#782)
1 parent ab349d6 commit 094a67a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

params/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
const (
2525
VersionMajor = 5 // Major version component of the current release
2626
VersionMinor = 3 // Minor version component of the current release
27-
VersionPatch = 28 // Patch version component of the current release
27+
VersionPatch = 29 // Patch version component of the current release
2828
VersionMeta = "mainnet" // Version metadata to append to the version string
2929
)
3030

rollup/pipeline/pipeline.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,16 @@ func (p *Pipeline) cccStage(candidates <-chan *BlockCandidate, deadline time.Tim
310310
var deadlineReached bool
311311

312312
go func() {
313+
deadlineTimer := time.NewTimer(time.Until(deadline))
313314
defer func() {
314315
close(resultCh)
316+
deadlineTimer.Stop()
315317
lifetimeTimer.UpdateSince(p.start)
316318
}()
317319
for {
318320
idleStart := time.Now()
319321
select {
320-
case <-time.After(time.Until(deadline)):
322+
case <-deadlineTimer.C:
321323
cccIdleTimer.UpdateSince(idleStart)
322324
// note: currently we don't allow empty blocks, but if we ever do; make sure to CCC check it first
323325
if lastCandidate != nil {
@@ -328,8 +330,6 @@ func (p *Pipeline) cccStage(candidates <-chan *BlockCandidate, deadline time.Tim
328330
return
329331
}
330332
deadlineReached = true
331-
// avoid deadline case being triggered again and again
332-
deadline = time.Now().Add(time.Hour)
333333
case candidate := <-candidates:
334334
cccIdleTimer.UpdateSince(idleStart)
335335
cccStart := time.Now()

0 commit comments

Comments
 (0)