Skip to content

Commit

Permalink
Simpler algorithm for Seedable algorithm (#9732)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 authored Mar 18, 2024
1 parent 114c8b1 commit 3c35bd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ var (
}
CaplinArchiveFlag = cli.BoolFlag{
Name: "caplin.archive",
Usage: "enables archival node in caplin (Experimental, does not work)",
Usage: "enables archival node in caplin",
Value: false,
}
BeaconApiAllowCredentialsFlag = cli.BoolFlag{
Expand Down
10 changes: 1 addition & 9 deletions erigon-lib/chain/snapcfg/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,7 @@ type Cfg struct {
}

func (c Cfg) Seedable(info snaptype.FileInfo) bool {
// Caplin uses slots not block numbers, so the merge limit function does not work on some chains like sepolia.
var mergeLimit uint64
if info.Type.Enum() == snaptype.Enums.BlobSidecars || info.Type.Enum() == snaptype.Enums.BeaconBlocks {
mergeLimit = snaptype.Erigon2MergeLimit
} else {
mergeLimit = c.MergeLimit(info.From)
}

return info.To-info.From == mergeLimit
return info.To-info.From == snaptype.Erigon2MergeLimit || info.To-info.From == snaptype.Erigon2OldMergeLimit
}

func (c Cfg) MergeLimit(fromBlock uint64) uint64 {
Expand Down

0 comments on commit 3c35bd2

Please sign in to comment.