From 2968d18e226cfd3fa80de3ddd55a88dab86def4f Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Fri, 10 Mar 2023 12:18:19 +0700 Subject: [PATCH] fix build --- consensus/clique/snapshot.go | 4 ++-- consensus/clique/verifier.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index 43637c73b80..e9b7fddb5ef 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -25,7 +25,7 @@ import ( "time" "github.com/goccy/go-json" - lru "github.com/hashicorp/golang-lru" + lru2 "github.com/hashicorp/golang-lru/v2" "github.com/ledgerwatch/erigon-lib/chain" libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" @@ -196,7 +196,7 @@ func (s *Snapshot) uncast(address libcommon.Address, authorize bool) bool { // apply creates a new authorization snapshot by applying the given headers to // the original one. -func (s *Snapshot) apply(sigcache *lru.ARCCache, headers ...*types.Header) (*Snapshot, error) { +func (s *Snapshot) apply(sigcache *lru2.ARCCache[libcommon.Hash, libcommon.Address], headers ...*types.Header) (*Snapshot, error) { // Allow passing in no headers for cleaner code if len(headers) == 0 { return s, nil diff --git a/consensus/clique/verifier.go b/consensus/clique/verifier.go index 4802d5dfb1e..ef628548efa 100644 --- a/consensus/clique/verifier.go +++ b/consensus/clique/verifier.go @@ -168,7 +168,7 @@ func (c *Clique) Snapshot(chain consensus.ChainHeaderReader, number uint64, hash for snap == nil { // If an in-memory snapshot was found, use that if s, ok := c.recents.Get(hash); ok { - snap = s.(*Snapshot) + snap = s break } // If an on-disk checkpoint snapshot can be found, use that