Skip to content

Caplin: lru non-positive ttl #10089

@AskAlexSharov

Description

@AskAlexSharov

Gnosis --internalcl synced node - right after restart:

[INFO] [04-27|05:54:56.642] Static peers                             len=0
[INFO] [04-27|05:54:56.643] [Sentinel] Sentinel started              app=caplin
[WARN] [04-27|05:59:40.954] [dbg] epochDuration                      beaconCfg.SlotsPerEpoch=16 beaconCfg.SecondsPerSlot=5
panic: non-positive interval for NewTicker

goroutine 27808 [running]:
time.NewTicker(0x0?)
	time/tick.go:22 +0xe5
github.com/hashicorp/golang-lru/v2/expirable.NewLRU[...].func1()
	github.com/hashicorp/golang-lru/v2@v2.0.7/expirable/expirable_lru.go:83 +0x71
created by github.com/hashicorp/golang-lru/v2/expirable.NewLRU[...] in goroutine 23435
	github.com/hashicorp/golang-lru/v2@v2.0.7/expirable/expirable_lru.go:82 +0x32a
exit status 2

seems it comes from:
epochDuration := beaconCfg.SlotsPerEpoch * beaconCfg.SecondsPerSlot
validatorAttestationSeen: lru.NewWithTTL[uint64, uint64]("validator_attestation_seen", validatorAttestationCacheSize, time.Duration(epochDuration)),

probably need change to:

epochDuration := time.Duration(beaconCfg.SlotsPerEpoch*beaconCfg.SecondsPerSlot) * time.Second

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions