Disabled caplin phase2 for Gnosis temporairly. (#9006)

Gnosis phase2 will be disabled until we get good snapshot automation.

* Just run it in "phase1" mode.
* Create jwt secret accordingly
This commit is contained in:
Giulio rebuffo 2023-12-19 13:10:34 +01:00 committed by GitHub
parent a0b9d60265
commit e75dc25181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 6 deletions

View File

@ -780,7 +780,7 @@ func isWebsocket(r *http.Request) bool {
// obtainJWTSecret loads the jwt-secret, either from the provided config,
// or from the default location. If neither of those are present, it generates
// a new secret and stores to the default location.
func obtainJWTSecret(cfg *httpcfg.HttpCfg, logger log.Logger) ([]byte, error) {
func ObtainJWTSecret(cfg *httpcfg.HttpCfg, logger log.Logger) ([]byte, error) {
// try reading from file
logger.Info("Reading JWT secret", "path", cfg.JWTSecretPath)
// If we run the rpcdaemon and datadir is not specified we just use jwt.hex in current directory.
@ -840,7 +840,7 @@ func createEngineListener(cfg *httpcfg.HttpCfg, engineApi []rpc.API, logger log.
return nil, nil, "", fmt.Errorf("could not start register RPC engine api: %w", err)
}
jwtSecret, err := obtainJWTSecret(cfg, logger)
jwtSecret, err := ObtainJWTSecret(cfg, logger)
if err != nil {
return nil, nil, "", err
}

View File

@ -669,7 +669,6 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger
// Initialize ethbackend
ethBackendRPC := privateapi.NewEthBackendServer(ctx, backend, backend.chainDB, backend.notifications.Events, blockReader, logger, latestBlockBuiltStore)
// intiialize engine backend
var engine *execution_client.ExecutionClientDirect
blockRetire := freezeblocks.NewBlockRetire(1, dirs, blockReader, blockWriter, backend.chainDB, backend.chainConfig, backend.notifications.Events, logger)
@ -809,9 +808,25 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger
false,
config.Miner.EnabledPOS)
backend.engineBackendRPC = engineBackendRPC
engine, err = execution_client.NewExecutionClientDirect(ctx, eth1_chain_reader.NewChainReaderEth1(ctx, chainConfig, executionRpc, 1000))
if err != nil {
return nil, err
var engine execution_client.ExecutionEngine
// Gnosis has too few blocks on his network for phase2 to work. Once we have proper snapshot automation, it can go back to normal.
if config.NetworkID == uint64(clparams.GnosisNetwork) {
// Read the jwt secret
jwtSecret, err := cli.ObtainJWTSecret(&stack.Config().Http, logger)
if err != nil {
return nil, err
}
engine, err = execution_client.NewExecutionClientRPC(ctx, jwtSecret, stack.Config().Http.AuthRpcHTTPListenAddress, stack.Config().Http.AuthRpcPort)
if err != nil {
return nil, err
}
} else {
engine, err = execution_client.NewExecutionClientDirect(ctx, eth1_chain_reader.NewChainReaderEth1(ctx, chainConfig, executionRpc, 1000))
if err != nil {
return nil, err
}
}
// If we choose not to run a consensus layer, run our embedded.