-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: Fetch epoch info from the RewardDistribution contract #3
Conversation
7f61d09
to
34aabe6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of the information for each epoch is stored on chain, including the number of epochs and calc timestamps and send blocknumber/timestamps for each epoch. Some of this info is required (calc timestamp), and anyway it might be better for the full node if you search for the event only on the individual blocks where they occur rather than a large range of blocks. Somehow there needs to be a check that you got the events for all the epochs you expect. Also the CurrentEpoch
in StakingSettings
can probably be set based on the number of epochs read from the SC and increased when there is a new distribution event. If something goes wrong with getting epoch info, the service should probably be crashed with process.exit
so we can know about it...
src/lib/epoch-info.ts
Outdated
decodedLog.args.epoch.toString(), | ||
{ | ||
endBlockNumber: blockNumber, | ||
calcTimeStamp: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The calcTimeStamp is stored on chain and needs to be retrieved for each epoch.
I agree with Jason's comments! You can follow the following sequence:
|
add retries for epoch info retrieving
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still need to update CurrentEpoch
in StakingSettings
.
Feat/gas refund compute tree test
No description provided.