Skip to content

Conversation

iceseer
Copy link

@iceseer iceseer commented Oct 15, 2025

βœ„ -----------------------------------------------------------------------------

Thank you for your Pull Request! πŸ™ Please make sure it follows the contribution guidelines outlined in this
document
and fill out the
sections below. Once you're ready to submit your PR for review, please delete this section and leave only the text under
the "Description" heading.

Description

What Was Done
The main change involves transitioning from time-based slot calculation logic to incremental slot calculation logic in the AURA consensus for parachains. Instead of calculating slots based on time (S_i = T/D), an incremental logic (S_i = S_{i-1} + 1) is now used.

Key Changes:

  1. New slot_tracker.rs Module
    Created new IncrementalSlotTracker module for client-side slot tracking
    Implements S_i = S_{i-1} + 1 logic on the client side
    Uses atomic operations for thread-safety
    Supports initialization from storage and fallback to timestamp-based calculation
  2. Changes in collator.rs
    claim_slot function now accepts IncrementalSlotTracker instead of slot_duration
    Removed time-based slot calculation logic, replaced with slot_tracker.current_slot()
    Added comments about client-side slot calculation
  3. Changes in basic.rs
    Added global slot tracker initialization
    Initialization happens once with storage reading
    Fallback to zero slot on initialization error
    Passing tracker to claim_slot
  4. Changes in lookahead.rs
    Similar slot tracker initialization
    Modified can_build_upon logic to use tracker
    Removed time-based slot calculation logic
  5. Changes in equivocation_import_queue.rs
    slot_now function now first tries to use global tracker
    Fallback to timestamp-based calculation if tracker not initialized
  6. Changes in consensus_hook.rs
    Removed parachain slot alignment check with relay chain slot
    Removed time-based slot calculation logic
    Kept only velocity management and relay chain synchronization logic
  7. Changes in aura-ext/src/lib.rs
    Removed LastParachainSlot storage - tracking moved to client side
    Added comments about moving logic to client
  8. Changes in slot_timer.rs
    Added comment that timing remains timestamp-based, but slot index comes from incremental API
  9. Dependencies
    Added frame-support dependency in Cargo.toml

Integration

In depth notes about how this PR should be integrated by downstream projects. This part is
mandatory, and should be reviewed by reviewers, if the PR does NOT have the
R0-no-crate-publish-required label. In case of a R0-no-crate-publish-required, it can be
ignored.

Review Notes

In depth notes about the implementation details of your PR. This should be the main guide for reviewers to
understand your approach and effectively review it. If too long, use
<details>
.

Imagine that someone who is depending on the old code wants to integrate your new code and the only information that
they get is this section. It helps to include example usage and default value here, with a diff code-block to show
possibly integration.

Include your leftover TODOs, if any, here.

Checklist

  • My PR includes a detailed description as outlined in the "Description" and its two subsections above.
  • My PR follows the labeling requirements of this project (at minimum one label for T required)
    • External contributors: ask maintainers to put the right label on your PR.
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

You can remove the "Checklist" section once all have been checked. Thank you for your contribution!

βœ„ -----------------------------------------------------------------------------

@cla-bot-2021
Copy link

cla-bot-2021 bot commented Oct 15, 2025

User @iceseer, please sign the CLA here.

@iceseer iceseer marked this pull request as draft October 15, 2025 05:12
@iceseer iceseer force-pushed the feature/inc_slot_duration branch from c26d971 to 1e98600 Compare October 19, 2025 07:17
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.

1 participant