@@ -375,29 +375,30 @@ func (t *submitRplPrice) run(state *state.NetworkState) error {
375375 eth2Config := state .BeaconConfig
376376
377377 var hasSubmittedPastBlock bool
378+ var eventFound bool
378379 var nextSubmissionTime time.Time
379380 var targetBlockNumber uint64
380381 var lastSubmissionSlotTimestamp uint64
381382 // Check if the node has submitted prices for the latest block
382383 if lastSubmissionBlock != 0 {
383- found , lastSubmissionEvent , err := network .GetPriceUpdatedEvent (t .rp , lastSubmissionBlock , nil )
384+ eventFound , lastSubmissionEvent , err := network .GetPriceUpdatedEvent (t .rp , lastSubmissionBlock , nil )
384385 if err != nil {
385386 t .log .Printlnf ("Error getting price submission event for block %d" , lastSubmissionBlock )
386387 return err
387388 }
388- if ! found {
389+ if ! eventFound {
389390 t .log .Printlnf ("No price submission event found for block %d" , lastSubmissionBlock )
390- return fmt .Errorf ("no price submission event found for block %d" , lastSubmissionBlock )
391- }
392- lastSubmissionSlotTimestamp = lastSubmissionEvent .SlotTimestamp .Uint64 ()
391+ } else {
392+ lastSubmissionSlotTimestamp = lastSubmissionEvent .SlotTimestamp .Uint64 ()
393393
394- hasSubmittedPastBlock , err = t .hasSubmittedSpecificBlockPrices (nodeAccount .Address , lastSubmissionBlock , lastSubmissionSlotTimestamp , state .NetworkDetails .RplPrice )
395- if err != nil {
396- t .log .Printlnf ("Error checking if node has submitted prices for block %d: %s" , lastSubmissionBlock , err .Error ())
397- return err
394+ hasSubmittedPastBlock , err = t .hasSubmittedSpecificBlockPrices (nodeAccount .Address , lastSubmissionBlock , lastSubmissionSlotTimestamp , state .NetworkDetails .RplPrice )
395+ if err != nil {
396+ t .log .Printlnf ("Error checking if node has submitted prices for block %d: %s" , lastSubmissionBlock , err .Error ())
397+ return err
398+ }
398399 }
399400 }
400- if hasSubmittedPastBlock || lastSubmissionBlock == 0 {
401+ if hasSubmittedPastBlock || lastSubmissionBlock == 0 || ! eventFound {
401402 // If the node participated in consensus, find the next submission target
402403 var targetBlockHeader * types.Header
403404 _ , nextSubmissionTime , targetBlockHeader , err = utils .FindNextSubmissionTarget (t .rp , eth2Config , t .bc , t .ec , lastSubmissionBlock , referenceTimestamp , submissionIntervalInSeconds )
0 commit comments