@@ -97,7 +97,7 @@ func testClientDownloadClosedClient(t *testing.T) {
9797
9898func testClientDownloadExactTargetCount (t * testing.T ) {
9999 // test that we download from exactly downloadTarget validators (no more)
100- // with 10 validators and 2/3 target , downloadTarget = 6
100+ // with 10 equal-stake validators and livenessThreshold=1/3 , downloadTarget = 4
101101 const numValidators = 10
102102
103103 blob := makeTestBlobV0 (t , 256 * 1024 )
@@ -112,13 +112,14 @@ func testClientDownloadExactTargetCount(t *testing.T) {
112112 require .NoError (t , err )
113113 require .Equal (t , blob .Data (), downloaded .Data ())
114114
115- // downloadTarget = 10 * 2/3 = 6
116- // we should have exactly 6 successful downloads (no over-fetching in happy path)
117- require .Equal (t , int64 (6 ), counter .Load (), "should download from exactly downloadTarget validators" )
115+ // Select returns minRequired = 4 for 10 equal-stake validators with livenessThreshold=1/3
116+ // we should have exactly 4 successful downloads (no over-fetching in happy path)
117+ require .Equal (t , int64 (4 ), counter .Load (), "should download from exactly downloadTarget validators" )
118118}
119119
120120func testClientDownloadFaultTolerance (t * testing.T ) {
121- // test failure tolerance boundaries with 10 validators and 2/3 target
121+ // test failure tolerance boundaries with 10 validators
122+ // Select uses livenessThreshold (1/3), so downloadTarget = 4 for 10 equal-stake validators
122123 const numValidators = 10
123124 blob := makeTestBlobV0 (t , 256 * 1024 )
124125
@@ -127,10 +128,10 @@ func testClientDownloadFaultTolerance(t *testing.T) {
127128 expectErr error
128129 }{
129130 {10 , fibre .ErrNotFound },
130- {6 , fibre .ErrNotEnoughShards }, // 4 successes, need 6
131- {5 , fibre . ErrNotEnoughShards }, // 5 successes, need 6
132- {4 , nil }, // 6 successes, exactly enough
133- {3 , nil }, // 7 successes, more than enough
131+ {7 , fibre .ErrNotEnoughShards }, // 3 successes, need 4
132+ {6 , nil }, // 4 successes, exactly enough
133+ {5 , nil }, // 5 successes, more than enough
134+ {4 , nil }, // 6 successes, more than enough
134135 }
135136
136137 for _ , tc := range tests {
0 commit comments