Skip to content
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

Merged
merged 11 commits into from
Jun 21, 2024

Conversation

truemiller
Copy link
Collaborator

@truemiller truemiller commented Jun 17, 2024

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.

image

@@ -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?
Copy link
Collaborator Author

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?

Copy link
Collaborator

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.

@truemiller truemiller merged commit 6988fbf into main Jun 21, 2024
4 checks passed
@truemiller truemiller deleted the josh/fix-mech-requests-criteria branch July 26, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants