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

Stakeless gauge checkpointer: generic cost gauges #2547

Merged
merged 8 commits into from
Sep 14, 2023

Conversation

jubeira
Copy link
Contributor

@jubeira jubeira commented Sep 11, 2023

Description

This PR makes the stakeless gauge checkpointer more future proof and flexible, while making it compatible with the new avax gauges.

Summary of the changes:

  • Introduce the notion of gauge costs for any gauge type (not only Arbitrum). The checkpointer is prepared in case legacy (mostly all existing non-arbitrum gauges) not implementing the interface to retrieve the cost, and defaulting to 0 in that case.
  • Add more methods to checkpoint in a flexible manner: by a given list of types (which supersedes the function to checkpoint a single type).
  • Moved the argument checks to the external / public functions. Before this change some checks were implicit (mostly for single gauge checkpoints); now all the functions are protected at the entry level, and internal functions just work with validated inputs.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency changes
  • Code refactor / cleanup
  • Documentation or wording changes
  • Other

Checklist:

  • The diff is legible and has no extraneous changes
  • Complex code has been commented, including external interfaces
  • Tests are included for all code paths
  • The base branch is either master, or there's a description of how to merge

Issue Resolution

N/A

Juan Ignacio Ubeira added 3 commits September 11, 2023 16:41
- Allow generic paid types other than Arbitrum.
- API to checkpoint by types, get cost by types.
Copy link
Collaborator

@EndymionJkb EndymionJkb left a comment

Choose a reason for hiding this comment

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

Have some suggestions for a little more refactoring

@EndymionJkb EndymionJkb changed the title Stakeles gauge checkpointer: generic cost gauges Stakeless gauge checkpointer: generic cost gauges Sep 12, 2023
jubeira and others added 2 commits September 12, 2023 10:02
Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>
@jubeira
Copy link
Contributor Author

jubeira commented Sep 12, 2023

Thanks for the review! Could you please take one more look at the latest changes?

Copy link
Collaborator

@EndymionJkb EndymionJkb 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 now. (One small comment nit: a pet peeve :)

…er.sol

Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>
@jubeira jubeira merged commit fc3e573 into master Sep 14, 2023
16 checks passed
@jubeira jubeira deleted the dev/stakeles-gauge-checkpointer-generic-cost-gauges branch September 14, 2023 12:25
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