celestia-app
celestia-app copied to clipboard
Consider removing `count` from sparse share splitter
Context
https://github.com/informalsystems/audit-celestia/issues/20#issuecomment-1278899785
Problem
The sparse share splitter struct contains the field count
which needs to be updated when modifying shares in the sparse share splitter.
https://github.com/celestiaorg/celestia-app/blob/3598fe28772ed1ad55a0bc0b76d222828d35960f/pkg/shares/split_sparse_shares.go#L17
Proposal
The count
field may be removed from the sparse share splitter struct and the count can be computed by taking the length of shares in the share splitter.