Skip to content

Conversation

johnsaigle
Copy link
Contributor

@johnsaigle johnsaigle commented Jul 11, 2025

  • Remove the daylength field configured on the Governor in favour of using a constant. This was always configured to be the same value, and it unclear conceptually to change the length of minutes in a day, when in fact we want to change the duration of a sliding window of time.
  • Rename dailyLimit to USDLimit and add code comments explaining the relationship to the sliding window. Update all code and documentation references accordingly.
  • Change wording in code comments to refer to a sliding window. This more accurate reflects that the Governor works with a rolling window rather than as discrete calendar days of 24h.
  • Use separate constants for mainnet and devnet deployments

Note: because dailyLimit is an exported field, and is included in log ouput, this likely constitutes a breaking change for packages that import the Governor code as well as for monitoring tools. They will need to update their code to use the new variable name.

@johnsaigle johnsaigle added governor quality doesn't fix a known bug, doesn't change behavior, but increase code quality labels Jul 11, 2025
@johnsaigle johnsaigle force-pushed the gov-daylength-refactor branch from 5d423e0 to f9bd686 Compare July 11, 2025 19:16
@johnsaigle johnsaigle marked this pull request as ready for review July 11, 2025 19:27
emitterAddr vaa.Address
// The amount of notional value that can leave the chain during the period
// defined by the sliding window.
dailyLimit uint64
Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense to change this variable name too imo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@djb15 I changed it to USDLimit and updated all the code and documentation references.

Copy link
Contributor Author

@johnsaigle johnsaigle Jul 16, 2025

Choose a reason for hiding this comment

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

This will be breaking change so I updated the PR description.
If this ends up not being worth it I'm fine to leave dailyLimit as-is and just remove the day length field.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahhh ok yeah if Bruce and co don't think it's worth making a breaking change here then I agree you can revert back to the commit pre this change

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's reasonable to change it if you want. Anyone who uses it will just need to make a change whenever they decide to pick up a new version of the package. 🤷

@johnsaigle johnsaigle changed the title node(governor): refactor day length field and change wording node(governor): refactor dayLength and dailyLimit fields and change wording Jul 16, 2025
@bruce-riley
Copy link
Contributor

For historical reference, dayLengthInMinutes was made a variable rather than a constant so we could use a shorter "day" in testing. 24 hours is a long time to wait in tilt. 😁

But I guess we don't really do that much governor testing in tilt, so it doesn't matter.

@johnsaigle johnsaigle force-pushed the gov-daylength-refactor branch from 03cc0b7 to b642527 Compare July 17, 2025 14:59
- Remove the daylength field configured on the Governor in favour of
  using a constant. This was always configured to be the same value, and
  it unclear conceptually to change the length of minutes in a day, when
  in fact we want to change the duration of a sliding window of time.
- Change wording in code comments to refer to a sliding window. This
  more accurate reflects that the Governor works with a rolling window
  rather than as discrete calendar days of 24h.
- Use separate constants for mainnet and devnet deployments
- Removed redundant time.Duration calls
@johnsaigle johnsaigle force-pushed the gov-daylength-refactor branch from b642527 to 5f4f35f Compare July 23, 2025 18:57
@johnsaigle johnsaigle marked this pull request as draft August 14, 2025 20:50
@johnsaigle
Copy link
Contributor Author

Adding draft mode until I get around to fixing the conflicts

@johnsaigle johnsaigle self-assigned this Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
governor quality doesn't fix a known bug, doesn't change behavior, but increase code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants