Skip to content

Commit 8eaf4bb

Browse files
authored
Merge pull request #1611 from maticnetwork/milestone_whitelist_hotfix
Fix milestone whitelist delay on restart
2 parents 81caac8 + 27cebc6 commit 8eaf4bb

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

eth/backend.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,6 @@ func (s *Ethereum) fetchAndHandleWhitelistCheckpoint(ctx context.Context, ethHan
803803

804804
type heimdallHandler func(ctx context.Context, ethHandler *ethHandler, bor *bor.Bor) error
805805

806-
var lastSeenMilestoneBlockNumber uint64
807-
808806
// fetchAndHandleMilestone handles the milestone mechanism.
809807
func (s *Ethereum) fetchAndHandleMilestone(ctx context.Context, ethHandler *ethHandler, bor *bor.Bor) error {
810808
// Create a new bor verifier, which will be used to verify checkpoints and milestones

eth/handler_bor.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,14 @@ func (h *ethHandler) handleMilestone(ctx context.Context, eth *Ethereum, milesto
159159
return err
160160
}
161161

162-
for lastSeenMilestoneBlockNumber < num {
163-
lastSeenMilestoneBlockNumber += 1
164-
block := eth.blockchain.GetBlockByNumber(lastSeenMilestoneBlockNumber)
162+
start := milestone.StartBlock
163+
164+
for start <= milestone.EndBlock {
165+
block := eth.blockchain.GetBlockByNumber(start)
165166
if block != nil && block.Header() != nil {
166167
MilestoneWhitelistedDelayTimer.UpdateSince(time.Unix(int64(block.Time()), 0))
167168
}
169+
start += 1
168170
}
169171

170172
h.downloader.ProcessMilestone(num, hash)

params/version.go

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

0 commit comments

Comments
 (0)