@@ -37,9 +37,9 @@ import (
37
37
"github.com/ethereum/go-ethereum/rpc"
38
38
)
39
39
40
- // Register adds catalyst APIs to the full node.
40
+ // Register adds the engine API to the full node.
41
41
func Register (stack * node.Node , backend * eth.Ethereum ) error {
42
- log .Warn ("Catalyst mode enabled" , "protocol" , "eth" )
42
+ log .Warn ("Engine API enabled" , "protocol" , "eth" )
43
43
stack .RegisterAPIs ([]rpc.API {
44
44
{
45
45
Namespace : "engine" ,
@@ -62,7 +62,7 @@ type ConsensusAPI struct {
62
62
// The underlying blockchain needs to have a valid terminal total difficulty set.
63
63
func NewConsensusAPI (eth * eth.Ethereum ) * ConsensusAPI {
64
64
if eth .BlockChain ().Config ().TerminalTotalDifficulty == nil {
65
- panic ( "Catalyst started without valid total difficulty" )
65
+ log . Warn ( "Engine API started without valid total difficulty" )
66
66
}
67
67
return & ConsensusAPI {
68
68
eth : eth ,
@@ -73,7 +73,7 @@ func NewConsensusAPI(eth *eth.Ethereum) *ConsensusAPI {
73
73
74
74
// ForkchoiceUpdatedV1 has several responsibilities:
75
75
// If the method is called with an empty head block:
76
- // we return success, which can be used to check if the catalyst mode is enabled
76
+ // we return success, which can be used to check if the engine API is enabled
77
77
// If the total difficulty was not reached:
78
78
// we return INVALID
79
79
// If the finalizedBlockHash is set:
@@ -223,7 +223,7 @@ func (api *ConsensusAPI) ExchangeTransitionConfigurationV1(config beacon.Transit
223
223
return nil , errors .New ("invalid terminal total difficulty" )
224
224
}
225
225
ttd := api .eth .BlockChain ().Config ().TerminalTotalDifficulty
226
- if ttd .Cmp (config .TerminalTotalDifficulty .ToInt ()) != 0 {
226
+ if ttd == nil || ttd .Cmp (config .TerminalTotalDifficulty .ToInt ()) != 0 {
227
227
log .Warn ("Invalid TTD configured" , "geth" , ttd , "beacon" , config .TerminalTotalDifficulty )
228
228
return nil , fmt .Errorf ("invalid ttd: execution %v consensus %v" , ttd , config .TerminalTotalDifficulty )
229
229
}
0 commit comments