@@ -691,14 +691,18 @@ func (w *worker) resultLoop() {
691691 shadowHeader := block .Header ()
692692 shadowHeader .Extra [0 ] = 'd'
693693 shadowHeader .Extra [1 ] = 's'
694- shadowBlock := types .NewBlockWithHeader (shadowHeader ).WithBody (block .Transactions (), block .Uncles ()).WithWithdrawals (block .Withdrawals ()).WithSidecars (block .Sidecars ())
694+ shadowBlock := types .NewBlockWithHeader (shadowHeader ).WithBody (block .Transactions (), block .Uncles ()).WithWithdrawals (block .Withdrawals ())
695+ shadowBlock .DeepCopySidecars (block .Sidecars ())
695696 shadowBlock , err := p .AssembleSignature (shadowBlock )
696697 if err == nil {
697698 w .postBlock (shadowBlock , inturn )
698699 sealhash := w .engine .SealHash (shadowBlock .Header ())
699700 hash := shadowBlock .Hash ()
700701 log .Info ("Successfully sealed new block" , "number" , shadowBlock .Number (), "sealhash" , sealhash , "hash" , hash ,
701702 "elapsed" , common .PrettyDuration (time .Since (task .createdAt )))
703+ if len (block .Sidecars ()) != 0 {
704+ log .Debug ("show sidecars" , "block.Sidecars()[0].BlockHash" , block .Sidecars ()[0 ].BlockHash , "shadowBlock.Sidecars()[0].BlockHash" , shadowBlock .Sidecars ()[0 ].BlockHash )
705+ }
702706 } else {
703707 log .Info ("Failed to AssembleSignature" , "err" , err )
704708 }
@@ -1329,8 +1333,8 @@ LOOP:
13291333 workList = append (workList , work )
13301334
13311335 delay := w .engine .Delay (w .chain , work .header , & w .config .DelayLeftOver )
1332- if w . config . MB . LastBlockMiningTime > w . chainConfig . Parlia . Period * 1000 / 2 {
1333- if p , ok := w . engine .( * parlia. Parlia ); ok {
1336+ if p , ok := w . engine .( * parlia. Parlia ); ok {
1337+ if w . config . MB . LastBlockMiningTime > w . chainConfig . Parlia . Period * 1000 / 2 {
13341338 service := p .APIs (w .chain )[0 ].Service
13351339 latestBlockNumber := rpc .LatestBlockNumber
13361340 currentTurnLength , err := service .(* parlia.API ).GetTurnLength (& latestBlockNumber )
0 commit comments