Maintenance

The Maintenance contract manages the scheduling, execution, and tracking of maintenance periods for validators in the Ronin network. It ensures that validators can temporarily exit block production without being slashed.


Key Responsibilities

  1. Scheduling Maintenance:

    • Validators can request maintenance schedules within defined time frames.
    • Maintenance schedules are subject to duration, block offset, and maximum schedule constraints.
  2. Exiting Maintenance:

    • Validators can exit maintenance early, marking the end of their scheduled maintenance period.
    • Exiting requires updating the maintenance state and ensuring synchronization.
  3. Tracking Maintenance:

    • Active maintenance schedules are tracked and synchronized to ensure accurate status updates.
    • The contract maintains an up-to-date list of active maintenance schedules.

Workflow

1. Scheduling Maintenance

  • A validator requests a maintenance schedule by specifying:
    • Start and end blocks within allowed offsets.
    • A duration within the defined minimum and maximum maintenance block ranges.
  • The system verifies the following:
    • Validator is eligible and is the caller’s candidate.
    • The schedule adheres to constraints.
    • No other active schedule exists for the validator.

2. Maintenance Execution

  • Validators in maintenance are excluded from block production during their scheduled period.
  • The state of maintenance is actively tracked using block ranges and synchronization checks.

3. Exiting Maintenance

  • Validators can exit maintenance early by:
    • Updating the end block to the current block.
    • Synchronizing the maintenance schedule to remove the validator from active lists.

4. Synchronization of Active Schedules

  • At each synchronization point:
    • The system checks if scheduled maintenance has ended for any validator.
    • Validators with expired schedules are removed from the active schedule list.

Integration

The Maintenance contract integrates with the RoninValidatorSet to ensure:

  • Validation of maintenance eligibility.
  • Removal of validators under maintenance from block production.