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

eth: explicitly commented the code were bor could get into snap-sync mode 2.0 #1247

Merged
merged 1 commit 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
22 changes: 12 additions & 10 deletions eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,19 @@ func newHandler(config *handlerConfig) (*handler, error) {
// * the last snap sync is not finished while user specifies a full sync this
// time. But we don't have any recent state for full sync.
// In these cases however it's safe to reenable snap sync.
fullBlock, snapBlock := h.chain.CurrentBlock(), h.chain.CurrentSnapBlock()

if fullBlock.Number.Uint64() == 0 && snapBlock.Number.Uint64() > 0 {
h.snapSync.Store(true)
log.Warn("Switch sync mode from full sync to snap sync", "reason", "snap sync incomplete")
} else if !h.chain.HasState(fullBlock.Root) {
// TODO - uncomment when we (Polygon-PoS, bor) have snap sync/pbss
// For more info - https://github.com/ethereum/go-ethereum/pull/28171
// h.snapSync.Store(true)
log.Warn("Switch sync mode from full sync to snap sync", "reason", "head state missing")
}
// TODO - uncomment when we (Polygon-PoS, bor) have snap sync/pbss
// fullBlock, snapBlock := h.chain.CurrentBlock(), h.chain.CurrentSnapBlock()

// TODO - uncomment when we (Polygon-PoS, bor) have snap sync/pbss
// For more info - https://github.com/ethereum/go-ethereum/pull/28171
// if fullBlock.Number.Uint64() == 0 && snapBlock.Number.Uint64() > 0 {
// h.snapSync.Store(true)
// log.Warn("Switch sync mode from full sync to snap sync", "reason", "snap sync incomplete")
// } else if !h.chain.HasState(fullBlock.Root) {
// h.snapSync.Store(true)
// log.Warn("Switch sync mode from full sync to snap sync", "reason", "head state missing")
// }
} else {
head := h.chain.CurrentBlock()
if head.Number.Uint64() > 0 && h.chain.HasState(head.Root) {
Expand Down
Loading