File tree Expand file tree Collapse file tree
crates/subspace-verification/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ use alloc::string::String;
1818use alloc:: vec:: Vec ;
1919use core:: mem;
2020#[ cfg( feature = "kzg" ) ]
21+ use core:: num:: NonZeroU64 ;
22+ #[ cfg( feature = "kzg" ) ]
2123use core:: simd:: Simd ;
2224use parity_scale_codec:: { Decode , Encode , MaxEncodedLen } ;
2325use schnorrkel:: SignatureError ;
@@ -263,7 +265,12 @@ where
263265 sector_expiration_check_segment_commitment,
264266 } ) = piece_check_params
265267 {
266- if & solution. history_size > current_history_size {
268+ // `+1` here is due to the possibility of plotting a sector that was just archived and whose
269+ // segment root is just being included in this very block we're checking (parent block,
270+ // which is where `current_history_size` comes from doesn't know about this block yet)
271+ if NonZeroU64 :: from ( solution. history_size ) . get ( )
272+ > NonZeroU64 :: from ( * current_history_size) . get ( ) + 1
273+ {
267274 return Err ( Error :: FutureHistorySize {
268275 current : * current_history_size,
269276 solution : solution. history_size ,
You can’t perform that action at this time.
0 commit comments