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

Improve and simplify epoch boundaries calculation #2427

Open
4 tasks
bosko-m opened this issue Nov 26, 2024 · 0 comments
Open
4 tasks

Improve and simplify epoch boundaries calculation #2427

bosko-m opened this issue Nov 26, 2024 · 0 comments
Assignees

Comments

@bosko-m
Copy link
Contributor

bosko-m commented Nov 26, 2024

Description

The current implementation of epoch boundaries calculation could be improved to ensure correctness and maintainability. Instead of hardcoding or using derived constants, we should leverage protocol parameters like epochLength, slotLength, and Gov Action Validity. By relying on these parameters, we can ensure that epoch boundary calculations remain accurate even when protocol configurations change, reducing the need for future code adjustments.

Proposal

  1. Refactor the codebase to calculate epoch boundaries dynamically using the following protocol parameters:
    • epochLength: Defines the number of slots in an epoch.
    • slotLength: Specifies the duration of a single slot.
    • Gov Action Validity: Ensures that governance action periods are properly aligned with epoch boundaries.
  2. Remove any hardcoded values related to epoch calculations to reduce technical debt and potential bugs.
  3. Add appropriate tests to validate the correctness of the new dynamic calculation approach under various scenarios.

Benefits

  • Reduces the risk of inaccuracies when protocol parameters are updated.
  • Improves code clarity and maintainability.
  • Aligns governance actions with protocol standards.

Acceptance Criteria

  • Epoch boundaries are calculated dynamically using protocol parameters.
  • All hardcoded values for epoch calculations are removed.
  • Comprehensive tests validate the new implementation across different parameter configurations.
  • Documentation is updated to reflect the new approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: Backlog
Development

No branches or pull requests

2 participants