Skip to content

Commit

Permalink
Removed active count and shuffling cache (prysmaticlabs#4266)
Browse files Browse the repository at this point in the history
* Removed
* All tests pass
* Gaz
* Removed new lines
* A few more lines...
* I think i got them all
* and I didnt : )
* Could this be last...
  • Loading branch information
terencechain authored and cryptomental committed Feb 28, 2020
1 parent 171cfec commit 0be8531
Show file tree
Hide file tree
Showing 35 changed files with 3 additions and 340 deletions.
3 changes: 0 additions & 3 deletions beacon-chain/blockchain/forkchoice/lmd_ghost_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
"github.com/prysmaticlabs/go-ssz"
"github.com/prysmaticlabs/prysm/beacon-chain/cache"
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
testDB "github.com/prysmaticlabs/prysm/beacon-chain/db/testing"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
"github.com/prysmaticlabs/prysm/shared/bytesutil"
Expand Down Expand Up @@ -132,8 +131,6 @@ func TestGetHeadFromYaml(t *testing.T) {
t.Errorf("wanted root %#x, got root %#x", wantedHead, head)
}

helpers.ClearAllCaches()
testDB.TeardownDB(t, db)

}
}
2 changes: 0 additions & 2 deletions beacon-chain/blockchain/forkchoice/process_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func (s *Store) OnBlock(ctx context.Context, b *ethpb.BeaconBlock) error {
// Prune the block cache and helper caches on every new finalized epoch.
if postState.FinalizedCheckpoint.Epoch > s.finalizedCheckpt.Epoch {
s.clearSeenAtts()
helpers.ClearAllCaches()
if err := s.db.SaveFinalizedCheckpoint(ctx, postState.FinalizedCheckpoint); err != nil {
return errors.Wrap(err, "could not save finalized checkpoint")
}
Expand Down Expand Up @@ -201,7 +200,6 @@ func (s *Store) OnBlockInitialSyncStateTransition(ctx context.Context, b *ethpb.
// Prune the block cache and helper caches on every new finalized epoch.
if postState.FinalizedCheckpoint.Epoch > s.finalizedCheckpt.Epoch {
s.clearSeenAtts()
helpers.ClearAllCaches()

startSlot := helpers.StartSlot(s.prevFinalizedCheckpt.Epoch) + 1
if featureconfig.Get().PruneEpochBoundaryStates {
Expand Down
3 changes: 0 additions & 3 deletions beacon-chain/blockchain/forkchoice/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/prysmaticlabs/go-ssz"
"github.com/prysmaticlabs/prysm/beacon-chain/cache"
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/beacon-chain/db/filters"
testDB "github.com/prysmaticlabs/prysm/beacon-chain/db/testing"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
Expand Down Expand Up @@ -206,8 +205,6 @@ func TestStore_LatestAttestingBalance(t *testing.T) {
}

func TestStore_ChildrenBlocksFromParentRoot(t *testing.T) {
helpers.ClearAllCaches()

ctx := context.Background()
db := testDB.SetupDB(t)
defer testDB.TeardownDB(t, db)
Expand Down
1 change: 0 additions & 1 deletion beacon-chain/blockchain/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ func setupBeaconChain(t *testing.T, beaconDB db.Database) *Service {
}

func TestChainStartStop_Uninitialized(t *testing.T) {
helpers.ClearAllCaches()
hook := logTest.NewGlobal()
db := testDB.SetupDB(t)
defer testDB.TeardownDB(t, db)
Expand Down
2 changes: 0 additions & 2 deletions beacon-chain/cache/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
"active_count.go",
"attestation_data.go",
"checkpoint_state.go",
"committee.go",
Expand Down Expand Up @@ -31,7 +30,6 @@ go_test(
name = "go_default_test",
size = "small",
srcs = [
"active_count_test.go",
"attestation_data_test.go",
"checkpoint_state_test.go",
"committee_test.go",
Expand Down
102 changes: 0 additions & 102 deletions beacon-chain/cache/active_count.go

This file was deleted.

83 changes: 0 additions & 83 deletions beacon-chain/cache/active_count_test.go

This file was deleted.

Loading

0 comments on commit 0be8531

Please sign in to comment.