-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Efficiency of NeoToken VoterRewardPerCommittee records #2815
Comments
Which one?, |
It'd be nice to delete them, but I don't think we know when all of the GAS has been claimed. It's only when all voting NEO accounts have The other two options we have probably are:
The second option may be interesting to evaluate, even though it makes per-voter data somewhat larger we no longer need to store full history of these values and it'll be updated in a natural way, so storage-wise it'd probably be about the same. It's also easy to cache the latest |
NeoToken
contract use ofPrefix_VoterRewardPerCommittee
seems pretty inefficient.NeoToken.PostPersist
creates a newPrefix_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 dayNeoToken.CheckCandidate
will find and delete allPrefix_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.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.The text was updated successfully, but these errors were encountered: