-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix mech requests criteria for rewards eligibility #179
Conversation
…onsole.log statements
…for calculating nowInSeconds
frontend/service/Autonolas.ts
Outdated
@@ -134,16 +140,22 @@ const getAgentStakingRewardsInfo = async ({ | |||
const getAvailableRewardsForEpoch = async (): Promise<number | undefined> => { | |||
const contractCalls = [ | |||
serviceStakingTokenMechUsageContract.rewardsPerSecond(), | |||
serviceStakingTokenMechUsageContract.livenessPeriod(), | |||
serviceStakingTokenMechUsageContract.livenessPeriod(), // epoch length? | |||
serviceStakingTokenMechUsageContract.tsCheckpoint(), // last checkpoint timestamp? |
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.
i'm assuming the last checkpoint timestamp is roughly the same as the start of the current epoch?
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.
livenessPeriod is a constant for each staking program. It's the minimum epoch lenght (minimum call between checkpoints)
tsCheckpoint is the latest executed checkpoint - start of a new epoch.
there are no contract errors thrown with the updated changes @oaksprout unsure if this is enough to merge to main, but the formula makes sense, and has been approved thus far.