@@ -120,6 +120,8 @@ func (n *Node) ChainID() string {
120120}
121121
122122func (n * Node ) Start (ctx context.Context ) error {
123+ log := log .With ().Str ("node" , n .Redacted ()).Logger ()
124+
123125 // Wait for the node to be ready
124126 initTicker := time .NewTicker (30 * time .Second )
125127 for {
@@ -167,25 +169,25 @@ func (n *Node) Start(ctx context.Context) error {
167169 for {
168170 select {
169171 case <- ctx .Done ():
170- log .Debug ().Err (ctx .Err ()).Str ( "node" , n . Redacted ()). Msgf ("stopping node status loop" )
172+ log .Debug ().Err (ctx .Err ()).Msgf ("stopping node status loop" )
171173 return nil
172174
173175 case evt := <- blocksEvents :
174- log .Debug ().Str ( "node" , n . Redacted ()). Msg ("got new block event" )
176+ log .Debug ().Msg ("got new block event" )
175177 n .saveLatestBlock (evt .Data .(types.EventDataNewBlock ).Block )
176178 n .handleEvent (ctx , EventNewBlock , & evt )
177179 blocksTicker .Reset (10 * time .Second )
178180
179181 case evt := <- validatorEvents :
180- log .Debug ().Str ( "node" , n . Redacted ()). Msg ("got validator set update event" )
182+ log .Debug ().Msg ("got validator set update event" )
181183 n .handleEvent (ctx , EventValidatorSetUpdates , & evt )
182184
183185 case <- blocksTicker .C :
184- log .Debug ().Str ( "node" , n . Redacted ()). Msg ("syncing latest blocks" )
186+ log .Debug ().Msg ("syncing latest blocks" )
185187 n .syncBlocks (ctx )
186188
187189 case <- statusTicker .C :
188- log .Debug ().Str ( "node" , n . Redacted ()). Msg ("syncing status" )
190+ log .Debug ().Msg ("syncing status" )
189191 n .syncStatus (ctx )
190192 }
191193 }
0 commit comments