Closed HarleyAppleChoi closed 2 years ago
May look at payreward() to listen to the reward emmitted events
Do an additional operation to monitor if the last ~100 blocks have EpochTotalRewardsPaid event emitted. If yes, do the node operator/delegator balance scan. @kwunyeung do you think it is a good idea?
Is it possible to track the reward payout transaction?
@kwunyeung Yes There are Events emitted when having reward payout transactions:
We can scan NewEpoch event emitted in the last ~50 blocks like every ~1 minute. Once that is emitted, do the balance scan. Is that good?
Or we can do it for every block parsed. If NewEpoch event is in the block, do the balance scan. I think that is not good especially when flowjuno is parsing old blocks. It will scan so many time when parsing old block, but that is at the same epoch.
@HarleyAppleChoi what do you mean
but that is at the same epoch
for the old blocks?
Scanning latest validators and delegators status. If the trigger is just finding event message at block parsing event instead of fetching event at latest blocks, the latest status may get scan so many times when parsing old block.
Do you know which epoch would it be when you see the event in previous blocks?
@kwunyeung Yes but the gRPC endpoints for Flow are unstable when executing scripts from old states See here. Even we find an end epoch event on some block, we cannot require the state on that epoch yet
I see. For the old state, I think we can copy those data from some existing public data, e.g, another explorer.
Flowscan seems don't have historical data for validators but only
Let’s ping the FLOW team and see how they can be retrieved.
Feature description
Since epoch end at approximately 12:00 pm PT on Tuesday (7:00 pm UTC). There are possibilities that the epoch not end on time due to some accident or upgrade. The variance in epoch length to be less than 2 hours for a 1-week epoch (~1%). Therefore, there should be some additional operation to monitor the epoch changes.
Implementation proposal
This explains how epoch changes. The system should monitor the transaction about flowEpoch.endEpoch() in real time