From 77de467250346659a4c70404f62c0a0c5ec01464 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Tue, 14 Sep 2021 16:11:25 -0700 Subject: [PATCH] add lru (#9592) --- beacon-chain/cache/BUILD.bazel | 2 +- beacon-chain/cache/active_balance.go | 2 +- beacon-chain/cache/checkpoint_state.go | 2 +- beacon-chain/cache/committee.go | 2 +- beacon-chain/cache/skip_slot_cache.go | 2 +- beacon-chain/cache/subnet_ids.go | 2 +- beacon-chain/cache/sync_committee_head_state.go | 2 +- beacon-chain/operations/attestations/BUILD.bazel | 2 +- beacon-chain/operations/attestations/service.go | 2 +- beacon-chain/state/stategen/BUILD.bazel | 2 +- beacon-chain/state/stategen/hot_state_cache.go | 2 +- beacon-chain/sync/BUILD.bazel | 4 ++-- beacon-chain/sync/pending_attestations_queue_test.go | 2 +- beacon-chain/sync/service.go | 2 +- beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go | 2 +- beacon-chain/sync/subscriber_test.go | 2 +- beacon-chain/sync/validate_aggregate_proof_test.go | 2 +- beacon-chain/sync/validate_beacon_attestation_test.go | 2 +- beacon-chain/sync/validate_beacon_blocks_test.go | 2 +- beacon-chain/sync/validate_proposer_slashing_test.go | 2 +- beacon-chain/sync/validate_voluntary_exit_test.go | 2 +- {shared => cache}/lru/BUILD.bazel | 2 +- {shared => cache}/lru/lru_wrpr.go | 0 {shared => cache}/lru/lru_wrpr_test.go | 0 shared/logutil/BUILD.bazel | 2 +- shared/logutil/stream.go | 2 +- slasher/cache/BUILD.bazel | 2 +- slasher/cache/flat_span_cache.go | 2 +- slasher/cache/highest_attestation_cache.go | 2 +- slasher/cache/validators_cache.go | 2 +- validator/client/BUILD.bazel | 4 ++-- validator/client/propose_test.go | 2 +- validator/client/service.go | 2 +- 33 files changed, 33 insertions(+), 33 deletions(-) rename {shared => cache}/lru/BUILD.bazel (87%) rename {shared => cache}/lru/lru_wrpr.go (100%) rename {shared => cache}/lru/lru_wrpr_test.go (100%) diff --git a/beacon-chain/cache/BUILD.bazel b/beacon-chain/cache/BUILD.bazel index 54b9335df..dacd06cc8 100644 --- a/beacon-chain/cache/BUILD.bazel +++ b/beacon-chain/cache/BUILD.bazel @@ -39,11 +39,11 @@ go_library( deps = [ "//beacon-chain/state:go_default_library", "//beacon-chain/state/v2:go_default_library", + "//cache/lru:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//shared/bytesutil:go_default_library", "//shared/featureconfig:go_default_library", "//shared/hashutil:go_default_library", - "//shared/lru:go_default_library", "//shared/mathutil:go_default_library", "//shared/params:go_default_library", "//shared/rand:go_default_library", diff --git a/beacon-chain/cache/active_balance.go b/beacon-chain/cache/active_balance.go index c1aa92d30..9cd80f6ac 100644 --- a/beacon-chain/cache/active_balance.go +++ b/beacon-chain/cache/active_balance.go @@ -12,8 +12,8 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" ethTypes "github.com/prysmaticlabs/eth2-types" "github.com/prysmaticlabs/prysm/beacon-chain/state" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" "github.com/prysmaticlabs/prysm/shared/featureconfig" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/params" ) diff --git a/beacon-chain/cache/checkpoint_state.go b/beacon-chain/cache/checkpoint_state.go index 4fb31bfee..1ea3d9a03 100644 --- a/beacon-chain/cache/checkpoint_state.go +++ b/beacon-chain/cache/checkpoint_state.go @@ -7,9 +7,9 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prysmaticlabs/prysm/beacon-chain/state" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/shared/hashutil" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" ) var ( diff --git a/beacon-chain/cache/committee.go b/beacon-chain/cache/committee.go index 43db9f278..b806974cc 100644 --- a/beacon-chain/cache/committee.go +++ b/beacon-chain/cache/committee.go @@ -10,7 +10,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" types "github.com/prysmaticlabs/eth2-types" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" "github.com/prysmaticlabs/prysm/shared/mathutil" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/sliceutil" diff --git a/beacon-chain/cache/skip_slot_cache.go b/beacon-chain/cache/skip_slot_cache.go index f11961572..ff8423225 100644 --- a/beacon-chain/cache/skip_slot_cache.go +++ b/beacon-chain/cache/skip_slot_cache.go @@ -10,7 +10,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prysmaticlabs/prysm/beacon-chain/state" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" "go.opencensus.io/trace" ) diff --git a/beacon-chain/cache/subnet_ids.go b/beacon-chain/cache/subnet_ids.go index 9f9b9c9a3..b30c1d59d 100644 --- a/beacon-chain/cache/subnet_ids.go +++ b/beacon-chain/cache/subnet_ids.go @@ -7,7 +7,7 @@ import ( lru "github.com/hashicorp/golang-lru" "github.com/patrickmn/go-cache" types "github.com/prysmaticlabs/eth2-types" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/sliceutil" ) diff --git a/beacon-chain/cache/sync_committee_head_state.go b/beacon-chain/cache/sync_committee_head_state.go index 0bc13a76c..18de61b24 100644 --- a/beacon-chain/cache/sync_committee_head_state.go +++ b/beacon-chain/cache/sync_committee_head_state.go @@ -7,7 +7,7 @@ import ( types "github.com/prysmaticlabs/eth2-types" "github.com/prysmaticlabs/prysm/beacon-chain/state" stateAltair "github.com/prysmaticlabs/prysm/beacon-chain/state/v2" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ) // SyncCommitteeHeadStateCache for the latest head state requested by a sync committee participant. diff --git a/beacon-chain/operations/attestations/BUILD.bazel b/beacon-chain/operations/attestations/BUILD.bazel index c76d30e0e..1f5c5b626 100644 --- a/beacon-chain/operations/attestations/BUILD.bazel +++ b/beacon-chain/operations/attestations/BUILD.bazel @@ -18,10 +18,10 @@ go_library( ], deps = [ "//beacon-chain/operations/attestations/kv:go_default_library", + "//cache/lru:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//shared/aggregation/attestations:go_default_library", "//shared/hashutil:go_default_library", - "//shared/lru:go_default_library", "//shared/params:go_default_library", "//shared/slotutil:go_default_library", "//shared/timeutils:go_default_library", diff --git a/beacon-chain/operations/attestations/service.go b/beacon-chain/operations/attestations/service.go index a1c9d7be0..e5b6530d7 100644 --- a/beacon-chain/operations/attestations/service.go +++ b/beacon-chain/operations/attestations/service.go @@ -8,7 +8,7 @@ import ( "time" lru "github.com/hashicorp/golang-lru" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" "github.com/prysmaticlabs/prysm/shared/params" ) diff --git a/beacon-chain/state/stategen/BUILD.bazel b/beacon-chain/state/stategen/BUILD.bazel index 7fb7d0228..b93c2c16d 100644 --- a/beacon-chain/state/stategen/BUILD.bazel +++ b/beacon-chain/state/stategen/BUILD.bazel @@ -27,10 +27,10 @@ go_library( "//beacon-chain/db:go_default_library", "//beacon-chain/db/filters:go_default_library", "//beacon-chain/state:go_default_library", + "//cache/lru:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/block:go_default_library", "//shared/bytesutil:go_default_library", - "//shared/lru:go_default_library", "//shared/params:go_default_library", "//shared/version:go_default_library", "@com_github_hashicorp_golang_lru//:go_default_library", diff --git a/beacon-chain/state/stategen/hot_state_cache.go b/beacon-chain/state/stategen/hot_state_cache.go index 07a9dff44..f0fe69b82 100644 --- a/beacon-chain/state/stategen/hot_state_cache.go +++ b/beacon-chain/state/stategen/hot_state_cache.go @@ -7,7 +7,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prysmaticlabs/prysm/beacon-chain/state" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ) var ( diff --git a/beacon-chain/sync/BUILD.bazel b/beacon-chain/sync/BUILD.bazel index 52d8c78da..b26d881c7 100644 --- a/beacon-chain/sync/BUILD.bazel +++ b/beacon-chain/sync/BUILD.bazel @@ -73,6 +73,7 @@ go_library( "//beacon-chain/p2p/types:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/stategen:go_default_library", + "//cache/lru:go_default_library", "//cmd/beacon-chain/flags:go_default_library", "//monitoring/tracing:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -84,7 +85,6 @@ go_library( "//shared/bls:go_default_library", "//shared/bytesutil:go_default_library", "//shared/featureconfig:go_default_library", - "//shared/lru:go_default_library", "//shared/messagehandler:go_default_library", "//shared/mputil:go_default_library", "//shared/p2putils:go_default_library", @@ -180,6 +180,7 @@ go_test( "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/state/v1:go_default_library", "//beacon-chain/sync/initial-sync/testing:go_default_library", + "//cache/lru:go_default_library", "//cmd/beacon-chain/flags:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/block:go_default_library", @@ -189,7 +190,6 @@ go_test( "//shared/attestationutil:go_default_library", "//shared/bls:go_default_library", "//shared/bytesutil:go_default_library", - "//shared/lru:go_default_library", "//shared/p2putils:go_default_library", "//shared/params:go_default_library", "//shared/rand:go_default_library", diff --git a/beacon-chain/sync/pending_attestations_queue_test.go b/beacon-chain/sync/pending_attestations_queue_test.go index 8277351f9..f3d349921 100644 --- a/beacon-chain/sync/pending_attestations_queue_test.go +++ b/beacon-chain/sync/pending_attestations_queue_test.go @@ -15,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations" "github.com/prysmaticlabs/prysm/beacon-chain/p2p/peers" p2ptest "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" pb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/wrapper" @@ -22,7 +23,6 @@ import ( "github.com/prysmaticlabs/prysm/shared/attestationutil" "github.com/prysmaticlabs/prysm/shared/bls" "github.com/prysmaticlabs/prysm/shared/bytesutil" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil" "github.com/prysmaticlabs/prysm/shared/testutil/assert" diff --git a/beacon-chain/sync/service.go b/beacon-chain/sync/service.go index bd42cc169..b76f9ca80 100644 --- a/beacon-chain/sync/service.go +++ b/beacon-chain/sync/service.go @@ -28,11 +28,11 @@ import ( "github.com/prysmaticlabs/prysm/beacon-chain/operations/voluntaryexits" "github.com/prysmaticlabs/prysm/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/beacon-chain/state/stategen" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" "github.com/prysmaticlabs/prysm/cmd/beacon-chain/flags" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/shared" "github.com/prysmaticlabs/prysm/shared/abool" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/runutil" "github.com/prysmaticlabs/prysm/shared/slotutil" diff --git a/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go b/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go index 4818e9228..94add24a3 100644 --- a/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go +++ b/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go @@ -7,8 +7,8 @@ import ( "github.com/prysmaticlabs/go-bitfield" mock "github.com/prysmaticlabs/prysm/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/testutil" "github.com/prysmaticlabs/prysm/shared/testutil/assert" "github.com/prysmaticlabs/prysm/shared/testutil/require" diff --git a/beacon-chain/sync/subscriber_test.go b/beacon-chain/sync/subscriber_test.go index 399891c2e..9ab8486d3 100644 --- a/beacon-chain/sync/subscriber_test.go +++ b/beacon-chain/sync/subscriber_test.go @@ -22,10 +22,10 @@ import ( "github.com/prysmaticlabs/prysm/beacon-chain/p2p/encoder" p2ptest "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing" mockSync "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" pb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/shared/abool" "github.com/prysmaticlabs/prysm/shared/bytesutil" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/p2putils" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil" diff --git a/beacon-chain/sync/validate_aggregate_proof_test.go b/beacon-chain/sync/validate_aggregate_proof_test.go index 244798693..e5c75f0d3 100644 --- a/beacon-chain/sync/validate_aggregate_proof_test.go +++ b/beacon-chain/sync/validate_aggregate_proof_test.go @@ -18,12 +18,12 @@ import ( "github.com/prysmaticlabs/prysm/beacon-chain/p2p" p2ptest "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing" mockSync "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/wrapper" "github.com/prysmaticlabs/prysm/shared/attestationutil" "github.com/prysmaticlabs/prysm/shared/bls" "github.com/prysmaticlabs/prysm/shared/bytesutil" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil" "github.com/prysmaticlabs/prysm/shared/testutil/assert" diff --git a/beacon-chain/sync/validate_beacon_attestation_test.go b/beacon-chain/sync/validate_beacon_attestation_test.go index 1077a385f..3b6de5e0e 100644 --- a/beacon-chain/sync/validate_beacon_attestation_test.go +++ b/beacon-chain/sync/validate_beacon_attestation_test.go @@ -15,10 +15,10 @@ import ( dbtest "github.com/prysmaticlabs/prysm/beacon-chain/db/testing" p2ptest "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing" mockSync "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/wrapper" "github.com/prysmaticlabs/prysm/shared/bytesutil" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil" "github.com/prysmaticlabs/prysm/shared/testutil/require" diff --git a/beacon-chain/sync/validate_beacon_blocks_test.go b/beacon-chain/sync/validate_beacon_blocks_test.go index cf70f832d..ae1f2a2ec 100644 --- a/beacon-chain/sync/validate_beacon_blocks_test.go +++ b/beacon-chain/sync/validate_beacon_blocks_test.go @@ -22,12 +22,12 @@ import ( p2ptest "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing" "github.com/prysmaticlabs/prysm/beacon-chain/state/stategen" mockSync "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/wrapper" "github.com/prysmaticlabs/prysm/shared/abool" "github.com/prysmaticlabs/prysm/shared/bls" "github.com/prysmaticlabs/prysm/shared/bytesutil" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil" "github.com/prysmaticlabs/prysm/shared/testutil/assert" diff --git a/beacon-chain/sync/validate_proposer_slashing_test.go b/beacon-chain/sync/validate_proposer_slashing_test.go index 34339dc7a..2bebcc24e 100644 --- a/beacon-chain/sync/validate_proposer_slashing_test.go +++ b/beacon-chain/sync/validate_proposer_slashing_test.go @@ -20,9 +20,9 @@ import ( "github.com/prysmaticlabs/prysm/beacon-chain/state" v1 "github.com/prysmaticlabs/prysm/beacon-chain/state/v1" mockSync "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/shared/bls" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil/assert" "github.com/prysmaticlabs/prysm/shared/testutil/require" diff --git a/beacon-chain/sync/validate_voluntary_exit_test.go b/beacon-chain/sync/validate_voluntary_exit_test.go index 26e1da6f6..be9e6f044 100644 --- a/beacon-chain/sync/validate_voluntary_exit_test.go +++ b/beacon-chain/sync/validate_voluntary_exit_test.go @@ -18,9 +18,9 @@ import ( "github.com/prysmaticlabs/prysm/beacon-chain/state" v1 "github.com/prysmaticlabs/prysm/beacon-chain/state/v1" mockSync "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/shared/bls" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil/assert" "github.com/prysmaticlabs/prysm/shared/testutil/require" diff --git a/shared/lru/BUILD.bazel b/cache/lru/BUILD.bazel similarity index 87% rename from shared/lru/BUILD.bazel rename to cache/lru/BUILD.bazel index c43675dea..d2fa5da60 100644 --- a/shared/lru/BUILD.bazel +++ b/cache/lru/BUILD.bazel @@ -3,7 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["lru_wrpr.go"], - importpath = "github.com/prysmaticlabs/prysm/shared/lru", + importpath = "github.com/prysmaticlabs/prysm/cache/lru", visibility = ["//visibility:public"], deps = ["@com_github_hashicorp_golang_lru//:go_default_library"], ) diff --git a/shared/lru/lru_wrpr.go b/cache/lru/lru_wrpr.go similarity index 100% rename from shared/lru/lru_wrpr.go rename to cache/lru/lru_wrpr.go diff --git a/shared/lru/lru_wrpr_test.go b/cache/lru/lru_wrpr_test.go similarity index 100% rename from shared/lru/lru_wrpr_test.go rename to cache/lru/lru_wrpr_test.go diff --git a/shared/logutil/BUILD.bazel b/shared/logutil/BUILD.bazel index c5b19b14f..27aabbef5 100644 --- a/shared/logutil/BUILD.bazel +++ b/shared/logutil/BUILD.bazel @@ -9,8 +9,8 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/shared/logutil", visibility = ["//visibility:public"], deps = [ + "//cache/lru:go_default_library", "//shared/event:go_default_library", - "//shared/lru:go_default_library", "//shared/params:go_default_library", "//shared/rand:go_default_library", "@com_github_hashicorp_golang_lru//:go_default_library", diff --git a/shared/logutil/stream.go b/shared/logutil/stream.go index cc60c807a..3d214a497 100644 --- a/shared/logutil/stream.go +++ b/shared/logutil/stream.go @@ -4,8 +4,8 @@ import ( "io" lru "github.com/hashicorp/golang-lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" "github.com/prysmaticlabs/prysm/shared/event" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/rand" ) diff --git a/slasher/cache/BUILD.bazel b/slasher/cache/BUILD.bazel index 43b089121..e60247758 100644 --- a/slasher/cache/BUILD.bazel +++ b/slasher/cache/BUILD.bazel @@ -13,8 +13,8 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/slasher/cache", visibility = ["//slasher:__subpackages__"], deps = [ + "//cache/lru:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//shared/lru:go_default_library", "//slasher/detection/attestations/types:go_default_library", "@com_github_hashicorp_golang_lru//:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", diff --git a/slasher/cache/flat_span_cache.go b/slasher/cache/flat_span_cache.go index 9ab6fef46..78a4795b0 100644 --- a/slasher/cache/flat_span_cache.go +++ b/slasher/cache/flat_span_cache.go @@ -3,7 +3,7 @@ package cache import ( lru "github.com/hashicorp/golang-lru" types "github.com/prysmaticlabs/eth2-types" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" slashertypes "github.com/prysmaticlabs/prysm/slasher/detection/attestations/types" ) diff --git a/slasher/cache/highest_attestation_cache.go b/slasher/cache/highest_attestation_cache.go index 785370e4d..c5226e16a 100644 --- a/slasher/cache/highest_attestation_cache.go +++ b/slasher/cache/highest_attestation_cache.go @@ -2,8 +2,8 @@ package cache import ( lru "github.com/hashicorp/golang-lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" slashpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" ) var ( diff --git a/slasher/cache/validators_cache.go b/slasher/cache/validators_cache.go index 80e3b0c75..577047c61 100644 --- a/slasher/cache/validators_cache.go +++ b/slasher/cache/validators_cache.go @@ -5,7 +5,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" types "github.com/prysmaticlabs/eth2-types" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ) var ( diff --git a/validator/client/BUILD.bazel b/validator/client/BUILD.bazel index c2271b888..701adc5eb 100644 --- a/validator/client/BUILD.bazel +++ b/validator/client/BUILD.bazel @@ -24,6 +24,7 @@ go_library( "//beacon-chain/core:go_default_library", "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//cache/lru:go_default_library", "//monitoring/tracing:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/block:go_default_library", @@ -36,7 +37,6 @@ go_library( "//shared/featureconfig:go_default_library", "//shared/grpcutils:go_default_library", "//shared/hashutil:go_default_library", - "//shared/lru:go_default_library", "//shared/mathutil:go_default_library", "//shared/mputil:go_default_library", "//shared/params:go_default_library", @@ -106,6 +106,7 @@ go_test( embed = [":go_default_library"], deps = [ "//beacon-chain/core/helpers:go_default_library", + "//cache/lru:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", "//proto/prysm/v1alpha1/wrapper:go_default_library", @@ -115,7 +116,6 @@ go_test( "//shared/event:go_default_library", "//shared/featureconfig:go_default_library", "//shared/fileutil:go_default_library", - "//shared/lru:go_default_library", "//shared/mock:go_default_library", "//shared/params:go_default_library", "//shared/slotutil:go_default_library", diff --git a/validator/client/propose_test.go b/validator/client/propose_test.go index b924c3706..50ba7cf71 100644 --- a/validator/client/propose_test.go +++ b/validator/client/propose_test.go @@ -10,12 +10,12 @@ import ( "github.com/golang/mock/gomock" types "github.com/prysmaticlabs/eth2-types" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/wrapper" "github.com/prysmaticlabs/prysm/shared/bls" "github.com/prysmaticlabs/prysm/shared/bytesutil" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/mock" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil" diff --git a/validator/client/service.go b/validator/client/service.go index b2e88cbc4..554e615dd 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -13,12 +13,12 @@ import ( grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/pkg/errors" types "github.com/prysmaticlabs/eth2-types" + lruwrpr "github.com/prysmaticlabs/prysm/cache/lru" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/block" "github.com/prysmaticlabs/prysm/shared/bytesutil" "github.com/prysmaticlabs/prysm/shared/event" "github.com/prysmaticlabs/prysm/shared/grpcutils" - lruwrpr "github.com/prysmaticlabs/prysm/shared/lru" "github.com/prysmaticlabs/prysm/shared/params" accountsiface "github.com/prysmaticlabs/prysm/validator/accounts/iface" "github.com/prysmaticlabs/prysm/validator/accounts/wallet"