Update Pools for delayed collections #197
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Very minor change to detect delayed collections (collect in an epoch grater than the closedAtEpoch).
Per the Staking.sol contract, query fees are added to the rebate pool in which the allocation was closed (not when the collect function is run).
Updated pool to attempt to use the closedAtEpoch if available, otherwise use the current epoch, but only update
epoch.queryFeesCollected
andpool.totalQueryFees
when the allocation is closed so it can mirror what's seen in the rebate pool.Example: Epoch 634 has a total
fees
of765540551752580194585
per the Staking Contract yet thepool.totalQueryFees
shows918822211489531994645
. queryConsideration: What happens if an allocation is collected on twice post allocation closure? This doesn't appear to be prevented in the contract and could result in double counting.