Skip to content

Commit

Permalink
Prohibit --internalcl in E2 (#13757)
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis authored Feb 11, 2025
1 parent 997fa46 commit 6946d19
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"errors"
"fmt"
"io/fs"
"math"
"math/big"
"net"
"os"
Expand Down Expand Up @@ -78,12 +77,7 @@ import (
libtypes "github.com/erigontech/erigon-lib/types"
"github.com/erigontech/erigon-lib/wrap"
"github.com/erigontech/erigon/cl/clparams"
"github.com/erigontech/erigon/cl/persistence/db_config"
"github.com/erigontech/erigon/cl/persistence/format/snapshot_format/getters"
clcore "github.com/erigontech/erigon/cl/phase1/core"
executionclient "github.com/erigontech/erigon/cl/phase1/execution_client"
"github.com/erigontech/erigon/cl/utils/eth_clock"
"github.com/erigontech/erigon/cmd/caplin/caplin1"
"github.com/erigontech/erigon/cmd/rpcdaemon/cli"
"github.com/erigontech/erigon/common/debug"
"github.com/erigontech/erigon/consensus"
Expand Down Expand Up @@ -857,34 +851,7 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger

// If we choose not to run a consensus layer, run our embedded.
if config.InternalCL && clparams.EmbeddedSupported(config.NetworkID) {
networkCfg, beaconCfg := clparams.GetConfigsByNetwork(clparams.NetworkType(config.NetworkID))
if err != nil {
return nil, err
}
state, err := clcore.RetrieveBeaconState(ctx, beaconCfg,
clparams.GetCheckpointSyncEndpoint(clparams.NetworkType(config.NetworkID)))
if err != nil {
return nil, err
}
ethClock := eth_clock.NewEthereumClock(state.GenesisTime(), state.GenesisValidatorsRoot(), beaconCfg)

pruneBlobDistance := uint64(128600)
if config.CaplinConfig.BlobBackfilling || config.CaplinConfig.BlobPruningDisabled {
pruneBlobDistance = math.MaxUint64
}

indiciesDB, blobStorage, err := caplin1.OpenCaplinDatabase(ctx, db_config.DefaultDatabaseConfiguration, beaconCfg, ethClock, dirs.CaplinIndexing, dirs.CaplinBlobs, executionEngine, false, pruneBlobDistance)
if err != nil {
return nil, err
}

go func() {
eth1Getter := getters.NewExecutionSnapshotReader(ctx, beaconCfg, blockReader, backend.chainDB)
if err := caplin1.RunCaplinPhase1(ctx, executionEngine, config, networkCfg, beaconCfg, ethClock, state, dirs, eth1Getter, backend.downloaderClient, config.CaplinConfig.Backfilling, config.CaplinConfig.BlobBackfilling, config.CaplinConfig.Archive, indiciesDB, blobStorage, creds); err != nil {
logger.Error("could not start caplin", "err", err)
}
ctxCancel()
}()
panic("Caplin (--internalcl) in Erigon 2 is not ready for Pectra. Either upgrade to Erigon 3 or use an external CL.")
}

if config.PolygonSync {
Expand Down

0 comments on commit 6946d19

Please sign in to comment.