Skip to content

feat(gas-rebates): update gas rebate scripts with new rules #4801

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

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

md0x
Copy link
Contributor

@md0x md0x commented Feb 4, 2025

Changes proposed in this PR:

  • Update the gas rebates scripts to account for the new rules:

Voters must have at least 500 UMA staked at the start of the commit period for the following commit and reveals transactions to be rebated.

Commited votes must be revealed to be rebated.

If a voter commits more than once on a dispute, only the last first commit will be rebated.

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Copy link

linear bot commented Feb 4, 2025

md0x added 2 commits February 4, 2025 18:27
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
@md0x md0x marked this pull request as ready for review February 4, 2025 17:33
const revealEventsMinBalance = revealEvents.filter((event) => event.args.numTokens.gte(minTokens));

// Filter out duplicate commit events as we only refund the latest commit event per voter per round
const uniqueCommitEvents = new Map<string, VoteCommittedEvent>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is interesting. ive had to sometimes commit more than once because theres so many votes sometimes. is this a technical or design decision

Copy link
Contributor

@daywiss daywiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, im wondering if rather than taking last commit, we take most expensive commit. im thinking of the cases where i double commit, its usually because i missed one answer or felt i had to change it due to discussion, making the last commit usually cheaper than the original

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
@md0x md0x requested a review from daywiss February 12, 2025 17:59
@md0x md0x changed the title feat: update gas rebate scripts with new rules feat(gas-rebates): update gas rebate scripts with new rules Feb 12, 2025
Copy link
Contributor

@daywiss daywiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

// Filter out duplicate commit events as we only refund the first commit event per voter per round
const uniqueCommitEvents = new Map<string, VoteCommittedEvent>();

// Sort first by blockNumber (desc) and then by logIndex (desc) as a tiebreaker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
@md0x md0x merged commit 5c3135e into master Feb 13, 2025
22 checks passed
@md0x md0x deleted the pablo/uma-2827-revise-gas-rebate-script branch February 13, 2025 11:43
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.

2 participants