From 81ab987e37c5984a52bb5b723f54785cc4bca7d4 Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:36:31 +0200 Subject: [PATCH] Disable antiquation (#12442) Cherry pick #12237 into `release/2.61` Co-authored-by: Giulio rebuffo --- cl/antiquary/antiquary.go | 6 ++++++ cl/antiquary/tests/tests.go | 1 + cmd/caplin/caplin1/run.go | 1 + 3 files changed, 8 insertions(+) diff --git a/cl/antiquary/antiquary.go b/cl/antiquary/antiquary.go index 91f363c55c1..645f8d328ba 100644 --- a/cl/antiquary/antiquary.go +++ b/cl/antiquary/antiquary.go @@ -22,6 +22,8 @@ import ( const safetyMargin = 10_000 // We retire snapshots 10k blocks after the finalized head +var IsTest = true + // Antiquary is where the snapshots go, aka old history, it is what keep track of the oldest records. type Antiquary struct { mainDB kv.RwDB // this is the main DB @@ -165,6 +167,10 @@ func (a *Antiquary) Loop() error { if a.states { go a.loopStates(a.ctx) } + if !IsTest { + return nil + } + if a.blobs { go a.loopBlobs(a.ctx) } diff --git a/cl/antiquary/tests/tests.go b/cl/antiquary/tests/tests.go index 47b7c713599..58f99cb1490 100644 --- a/cl/antiquary/tests/tests.go +++ b/cl/antiquary/tests/tests.go @@ -161,6 +161,7 @@ func GetPhase0Random() ([]*cltypes.SignedBeaconBlock, *state.CachingBeaconState, func GetBellatrixRandom() ([]*cltypes.SignedBeaconBlock, *state.CachingBeaconState, *state.CachingBeaconState) { ret := make([]*cltypes.SignedBeaconBlock, 0, 96) + // 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++ { block := cltypes.NewSignedBeaconBlock(&clparams.MainnetBeaconConfig) diff --git a/cmd/caplin/caplin1/run.go b/cmd/caplin/caplin1/run.go index b04def6aeec..88b17b385ce 100644 --- a/cmd/caplin/caplin1/run.go +++ b/cmd/caplin/caplin1/run.go @@ -225,6 +225,7 @@ func RunCaplinPhase1(ctx context.Context, engine execution_client.ExecutionEngin } }() } + antiquary.IsTest = false tx, err := indexDB.BeginRw(ctx) if err != nil {