NeoToken contract use of Prefix_VoterRewardPerCommittee seems pretty inefficient.
NeoToken.PostPersist creates a new Prefix_VoterRewardPerCommittee for every committee member with votes every time the committee is refreshed. Since the committee size == the epoch block count, this means we are generating an average of one new VoterRewardPerCommittee every block. This comes out to about 275 records per member per day
NeoToken.CheckCandidate will find and delete all Prefix_VoterRewardPerCommittee records for a candidate who is not registered and has no votes. For a candidate that had been a committee member for a while but is dropping out of the race, this could end up deleting 10,000s of records.
- Once the GAS for a given block has been claimed, this record is no longer needed but continues to take up space in the data store.
- Retrieving 10000s of records via StateService is not feasible, so the [
StateServiceStore'](https://github.com/ngdenterprise/neo-blockchaintoolkit-library/blob/master/src/bctklib/persistence/StateServiceStore.cs) can't provide these records. So offline / trace / branch scenarios that use StateServiceStore` can't rely on committee rewards as part of unclaimed gas calculations.
NeoTokencontract use ofPrefix_VoterRewardPerCommitteeseems pretty inefficient.NeoToken.PostPersistcreates a newPrefix_VoterRewardPerCommitteefor every committee member with votes every time the committee is refreshed. Since the committee size == the epoch block count, this means we are generating an average of one new VoterRewardPerCommittee every block. This comes out to about 275 records per member per dayNeoToken.CheckCandidatewill find and delete allPrefix_VoterRewardPerCommitteerecords for a candidate who is not registered and has no votes. For a candidate that had been a committee member for a while but is dropping out of the race, this could end up deleting 10,000s of records.StateServiceStore'](https://github.com/ngdenterprise/neo-blockchaintoolkit-library/blob/master/src/bctklib/persistence/StateServiceStore.cs) can't provide these records. So offline / trace / branch scenarios that useStateServiceStore` can't rely on committee rewards as part of unclaimed gas calculations.