storj/satellite/audit
Andrew Harding 93fad70e4b satellite/audit: prevent accessing unset reservoir segments
This change fixes the access of unset segments and keys on the reservoir
when the reservoir size is less than the max OR the number of sampled
segments is smaller than the reservoir size. It does so by tucking away
the segments and keys behind methods that return properly sized slices
into the segments/keys arrays.

It also fixes a bug in the housekeeping for the internal index variable
that holds onto how many items in the array have been populated. As part
of this fix, it changes the type of index to int8, which reduces the
size of the reservoir struct by 8 bytes.

The tests have been updated to provide better coverage for this case.

Change-Id: I3ceb17b692fe456fc4c1ca5d67d35c96aeb0a169
2022-12-14 17:43:17 -07:00
..
audit_test.go satellite/audit: use db for auditor queue 2022-11-22 14:04:00 +00:00
chore.go satellite/audit: prevent accessing unset reservoir segments 2022-12-14 17:43:17 -07:00
collector_test.go satellite/audit: prevent accessing unset reservoir segments 2022-12-14 17:43:17 -07:00
collector.go satellite/audit: optimize loop observer 2022-10-02 22:24:37 +00:00
containment2_test.go satellite/{satellitedb,audit}: add NewContainment 2022-12-07 18:03:37 +00:00
containment_test.go satellite/{audit, reputation}: fix potential nodes reputation status 2022-01-06 21:05:59 +00:00
containment.go satellite/{satellitedb,audit}: add NewContainment 2022-12-07 18:03:37 +00:00
cryptosource.go all: fix dots 2020-07-16 14:58:28 +00:00
disqualification_test.go satellite/audit: teach Reporter about piecewise audits 2022-12-12 11:28:02 +00:00
getshare_test.go satellite/{satellitedb,audit}: add NewContainment 2022-12-07 18:03:37 +00:00
integration_test.go satellite/audit: use db for auditor queue 2022-11-22 14:04:00 +00:00
pieces_test.go satellite/repair: update audit records during repair 2021-09-24 00:48:13 +00:00
pieces.go satellite/repair: move over audit.Pieces 2022-09-22 16:43:03 +00:00
queue.go satellite/audit: Split Reverifier from Verifier 2022-12-05 09:55:49 -06:00
reporter_test.go satellite/audit: teach Reporter about piecewise audits 2022-12-12 11:28:02 +00:00
reporter.go satellite/audit: teach Reporter about piecewise audits 2022-12-12 11:28:02 +00:00
reservoir_test.go satellite/audit: prevent accessing unset reservoir segments 2022-12-14 17:43:17 -07:00
reservoir.go satellite/audit: prevent accessing unset reservoir segments 2022-12-14 17:43:17 -07:00
reverifier_test.go satellite/audit: change signature of ReverifyPiece 2022-12-07 18:32:42 +00:00
reverifier.go satellite/audit: change signature of ReverifyPiece 2022-12-07 18:32:42 +00:00
reverify_test.go satellite/audit: teach Reporter about piecewise audits 2022-12-12 11:28:02 +00:00
reverifyworker.go satellite/audit: add audit.ReverifyWorker 2022-12-12 11:57:08 +00:00
verifier_test.go satellite/audit: add IdentifyContainedNodes 2022-12-13 20:46:43 +00:00
verifier_unit_test.go satellite/audit: retire audit.Queues 2022-12-01 13:12:43 +00:00
verifier.go satellite/audit: add IdentifyContainedNodes 2022-12-13 20:46:43 +00:00
worker.go satellite/audit: add audit.ReverifyWorker 2022-12-12 11:57:08 +00:00