Skip to content

fix: keep the warped slot in the stake test's advance_epoch helper - #451

Merged
Aursen merged 1 commit into
LiteSVM:masterfrom
Lightx0x:fix/advance-epoch-slot
Oct 29, 2026
Merged

Aursen merged 1 commit into
LiteSVM:masterfrom
Lightx0x:fix/advance-epoch-slot

Conversation

@Lightx0x

Copy link
Copy Markdown
Contributor

advance_epoch in tests/stake_program.rs reads the Clock, calls warp_to_slot,
then writes back the copy it read before the warp with epoch + 1. That
overwrites the warped slot, so the helper only advances the epoch:

slot epoch
before 459,648,000 0
after 1 call 459,648,000 1
after 2 calls 459,648,000 2

This change reads the Clock once, advances both slot (by slots_per_epoch)
and epoch, and writes it once. After the test's two calls the Clock is now
at slot 460,512,000, epoch 2.

The stake test passes before and after, since what it checks depends on the
epoch. This just makes the helper do what its name says, so slot and epoch
stay consistent.

Tested: cargo test --features precompiles, all passed; fmt --check and
clippy --all-features --all-targets clean.

@Aursen
Aursen merged commit a41a484 into LiteSVM:master Oct 29, 2026
23 checks passed
@Lightx0x
Lightx0x deleted the fix/advance-epoch-slot branch October 29, 2026 13:40
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