diff --git a/consensus/cometbft/service/service.go b/consensus/cometbft/service/service.go index 74d24a61d..33e593d5f 100644 --- a/consensus/cometbft/service/service.go +++ b/consensus/cometbft/service/service.go @@ -184,7 +184,24 @@ func (s *Service[_]) Start( return err } - return s.node.Start() + started := make(chan struct{}) + + // we start the node in a goroutine since calling Start() can block if genesis + // time is in the future causing us not to handle signals gracefully. + go func() { + err = s.node.Start() + started <- struct{}{} + }() + + select { + case <-ctx.Done(): + return ctx.Err() + case <-started: + } + + close(started) + + return err } func (s *Service[_]) Stop() error {