filecoin-project / specs-actors

DEPRECATED Specification of builtin actors, in the form of executable code.
Other
86 stars 102 forks source link

Miner.ProveCommitAggregate does not check sectors against abi.MaxSectorNumber #1444

Closed wadealexc closed 3 years ago

wadealexc commented 3 years ago

Description

ProveCommitSector checks the passed-in sector against abi.MaxSectorNumber:

https://github.com/filecoin-project/specs-actors/blob/a9f9f95f5e93bb7a27fd9fe8c0217e347fa1bef9/actors/builtin/miner/miner_actor.go#L975-L980

ProveCommitAggregate does not do this.

Recommendation

Add a check for consistency between the two methods. The easiest place to do this would be in GetAllPrecommittedSectors:

https://github.com/filecoin-project/specs-actors/blob/a9f9f95f5e93bb7a27fd9fe8c0217e347fa1bef9/actors/builtin/miner/miner_state.go#L387-L392