Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 committed Oct 7, 2024
1 parent 2004db0 commit b6c745e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cl/antiquary/antiquary.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

const safetyMargin = 10_000 // We retire snapshots 10k blocks after the finalized head

var IsTest = false
var IsTest = true

// Antiquary is where the snapshots go, aka old history, it is what keep track of the oldest records.
type Antiquary struct {
Expand Down
6 changes: 0 additions & 6 deletions cl/antiquary/tests/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon/cl/antiquary"
"github.com/ledgerwatch/erigon/cl/clparams"
"github.com/ledgerwatch/erigon/cl/cltypes"
"github.com/ledgerwatch/erigon/cl/persistence/beacon_indicies"
Expand Down Expand Up @@ -53,7 +52,6 @@ type MockBlockReader struct {
}

func NewMockBlockReader() *MockBlockReader {
antiquary.IsTest = true
return &MockBlockReader{U: make(map[uint64]*cltypes.SignedBeaconBlock)}
}

Expand Down Expand Up @@ -101,7 +99,6 @@ func LoadChain(blocks []*cltypes.SignedBeaconBlock, s *state.CachingBeaconState,
tx, err := db.BeginRw(context.Background())
require.NoError(t, err)
defer tx.Rollback()
antiquary.IsTest = true

m := NewMockBlockReader()
for _, block := range blocks {
Expand All @@ -118,7 +115,6 @@ func LoadChain(blocks []*cltypes.SignedBeaconBlock, s *state.CachingBeaconState,
func GetCapellaRandom() ([]*cltypes.SignedBeaconBlock, *state.CachingBeaconState, *state.CachingBeaconState) {
block1 := cltypes.NewSignedBeaconBlock(&clparams.MainnetBeaconConfig)
block2 := cltypes.NewSignedBeaconBlock(&clparams.MainnetBeaconConfig)
antiquary.IsTest = true

// Lets do te
if err := utils.DecodeSSZSnappy(block1, capella_blocks_0_ssz_snappy, int(clparams.CapellaVersion)); err != nil {
Expand All @@ -143,7 +139,6 @@ func GetCapellaRandom() ([]*cltypes.SignedBeaconBlock, *state.CachingBeaconState
func GetPhase0Random() ([]*cltypes.SignedBeaconBlock, *state.CachingBeaconState, *state.CachingBeaconState) {
block1 := cltypes.NewSignedBeaconBlock(&clparams.MainnetBeaconConfig)
block2 := cltypes.NewSignedBeaconBlock(&clparams.MainnetBeaconConfig)
antiquary.IsTest = true

// Lets do te
if err := utils.DecodeSSZSnappy(block1, phase0_blocks_0_ssz_snappy, int(clparams.Phase0Version)); err != nil {
Expand All @@ -166,7 +161,6 @@ func GetPhase0Random() ([]*cltypes.SignedBeaconBlock, *state.CachingBeaconState,

func GetBellatrixRandom() ([]*cltypes.SignedBeaconBlock, *state.CachingBeaconState, *state.CachingBeaconState) {
ret := make([]*cltypes.SignedBeaconBlock, 0, 96)
antiquary.IsTest = true

// format for blocks is blocks_{i}.ssz_snappy where i is the index of the block, starting from 0 to 95 included.
for i := 0; i < 96; i++ {
Expand Down
1 change: 1 addition & 0 deletions cmd/caplin/caplin1/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ func RunCaplinPhase1(ctx context.Context, engine execution_client.ExecutionEngin
}
}()
}
antiquary.IsTest = false

tx, err := indexDB.BeginRw(ctx)
if err != nil {
Expand Down

0 comments on commit b6c745e

Please sign in to comment.