Skip to content

Commit

Permalink
bugfix: Stop the etx collection if the slice was not created yet
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Apr 26, 2024
1 parent 39b4362 commit db842ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,13 @@ func (sl *Slice) CollectNewlyConfirmedEtxs(block *types.WorkObject, location com
return newlyConfirmedEtxs, subRollup, nil
}

// Terminate the search if the slice to which the given block belongs was
// not activated yet
regions, zones := common.GetHierarchySizeForExpansionNumber(ancestor.ExpansionNumber())
if location.Region() > int(regions) || location.Zone() > int(zones) {
return newlyConfirmedEtxs, subRollup, nil
}

// Terminate the search when we find a block produced by the same sub
if ancestor.Location().SubIndex(nodeLocation) == location.SubIndex(nodeLocation) {
return newlyConfirmedEtxs, subRollup, nil
Expand Down

0 comments on commit db842ac

Please sign in to comment.