@@ -408,23 +408,28 @@ func (api *RelayAPI) StartServer() (err error) {
408408 if err != nil {
409409 return err
410410 }
411+ var foundCapellaEpoch , foundDenebEpoch bool
411412 for _ , fork := range forkSchedule .Data {
412413 log .Infof ("forkSchedule: version=%s / epoch=%d" , fork .CurrentVersion , fork .Epoch )
413414 switch fork .CurrentVersion {
414415 case api .opts .EthNetDetails .CapellaForkVersionHex :
416+ foundCapellaEpoch = true
415417 api .capellaEpoch = fork .Epoch
416418 case api .opts .EthNetDetails .DenebForkVersionHex :
419+ foundDenebEpoch = true
417420 api .denebEpoch = fork .Epoch
418421 }
419422 }
420423
424+ if ! foundCapellaEpoch || ! foundDenebEpoch {
425+ return ErrMissingForkVersions
426+ }
427+
421428 // Print fork version information
422- if hasReachedFork (currentSlot , api .capellaEpoch ) {
423- log .Infof ("capella fork detected (currentEpoch: %d / capellaEpoch: %d)" , common .SlotToEpoch (currentSlot ), api .capellaEpoch )
424- } else if hasReachedFork (currentSlot , api .denebEpoch ) {
429+ if hasReachedFork (currentSlot , api .denebEpoch ) {
425430 log .Infof ("deneb fork detected (currentEpoch: %d / denebEpoch: %d)" , common .SlotToEpoch (currentSlot ), api .denebEpoch )
426- } else {
427- return ErrMismatchedForkVersions
431+ } else if hasReachedFork ( currentSlot , api . capellaEpoch ) {
432+ log . Infof ( "capella fork detected (currentEpoch: %d / capellaEpoch: %d)" , common . SlotToEpoch ( currentSlot ), api . capellaEpoch )
428433 }
429434
430435 // start proposer API specific things
0 commit comments