fix leader crosslink issue to not include old cross link in the proposing block

fix/crosslink_processing
“GheisMohammadi” 9 months ago
parent c24ea5cebd
commit 29512cb70d
No known key found for this signature in database
GPG Key ID: 15073AED3829FE90
  1. 2
      consensus/view_change_construct.go
  2. 3
      node/node_newblock.go

@ -464,7 +464,7 @@ func (vc *viewChange) InitPayload(
if !inited { if !inited {
viewIDBytes := make([]byte, 8) viewIDBytes := make([]byte, 8)
binary.LittleEndian.PutUint64(viewIDBytes, viewID) binary.LittleEndian.PutUint64(viewIDBytes, viewID)
vc.getLogger().Info().Uint64("viewID", viewID).Uint64("blockNum", blockNum).Msg("[InitPayload] add my M3 (ViewID) type messaage") vc.getLogger().Info().Uint64("viewID", viewID).Uint64("blockNum", blockNum).Msg("[InitPayload] add my M3 (ViewID) type message")
for _, key := range privKeys { for _, key := range privKeys {
if _, ok := vc.viewIDBitmap[viewID]; !ok { if _, ok := vc.viewIDBitmap[viewID]; !ok {
viewIDBitmap := bls_cosi.NewMask(members) viewIDBitmap := bls_cosi.NewMask(members)

@ -231,6 +231,9 @@ func (node *Node) ProposeNewBlock(commitSigs chan []byte) (*types.Block, error)
invalidToDelete := []types.CrossLink{} invalidToDelete := []types.CrossLink{}
if err == nil { if err == nil {
for _, pending := range allPending { for _, pending := range allPending {
if pending.EpochF.Int64() < currentHeader.Epoch().Int64()-3 {
continue
}
// ReadCrossLink beacon chain usage. // ReadCrossLink beacon chain usage.
exist, err := node.Blockchain().ReadCrossLink(pending.ShardID(), pending.BlockNum()) exist, err := node.Blockchain().ReadCrossLink(pending.ShardID(), pending.BlockNum())
if err == nil || exist != nil { if err == nil || exist != nil {

Loading…
Cancel
Save