Delegation compliance, count all blocks in epoch #8884
Merged
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.
In the delegation compliance app, the number of blocks produced for a given block producer was less than the number reported by Gareth. That was due to the change to consider only payments between slots 3500 of the current epoch and slot 3500 of the next epoch, to avoid double-attribution of payments to epochs.
Instead, obtain all block ids for slots between the start of the current epoch and slot 3500 of the following epoch along the canonical chain. To get the number of blocks produced, obtain block ids for produced blocks in current epoch, filtered to the canonical chain. For payments, filter the block ids between slot 3500 of the current epoch and slot 3500 of the following epoch and membership in the canonical chain.
Tested by running with a payout address where the result mismatched Gareth's result, new result did match.
Update: also consider indirect payments to a payout address, neither from the delegatee block producer nor from a coinbase receiver.