@@ -78,11 +78,15 @@ func ValidateBlockValues(bSchedule Schedule, nv network.Version, h *types.BlockH
78
78
return fmt .Errorf ("expected final beacon entry in block to be at round %d, got %d" , maxRound , last .Round )
79
79
}
80
80
81
- // Verify that all other entries' rounds are as expected for the epochs in between parentEpoch and h.Height
82
- for i , e := range h .BeaconEntries {
83
- correctRound := currBeacon .MaxBeaconRoundForEpoch (nv , parentEpoch + abi .ChainEpoch (i )+ 1 )
84
- if e .Round != correctRound {
85
- return fmt .Errorf ("unexpected beacon round %d, expected %d for epoch %d" , e .Round , correctRound , parentEpoch + abi .ChainEpoch (i ))
81
+ // If the beacon is UNchained, verify that the block only includes the rounds we want for the epochs in between parentEpoch and h.Height
82
+ // For chained beacons, you must have all the rounds forming a valid chain with prevEntry, so we can skip this step
83
+ if ! currBeacon .IsChained () {
84
+ // Verify that all other entries' rounds are as expected for the epochs in between parentEpoch and h.Height
85
+ for i , e := range h .BeaconEntries {
86
+ correctRound := currBeacon .MaxBeaconRoundForEpoch (nv , parentEpoch + abi .ChainEpoch (i )+ 1 )
87
+ if e .Round != correctRound {
88
+ return fmt .Errorf ("unexpected beacon round %d, expected %d for epoch %d" , e .Round , correctRound , parentEpoch + abi .ChainEpoch (i ))
89
+ }
86
90
}
87
91
}
88
92
0 commit comments