Skip to content

skip extend reservation vote when reservation already expired#36

Closed
nudiltoys-cmyk wants to merge 1 commit intoentrius:testfrom
nudiltoys-cmyk:fix/skip-expired-extend-vote
Closed

skip extend reservation vote when reservation already expired#36
nudiltoys-cmyk wants to merge 1 commit intoentrius:testfrom
nudiltoys-cmyk:fix/skip-expired-extend-vote

Conversation

@nudiltoys-cmyk
Copy link
Copy Markdown

summary

I noticed _try_extend_reservation fires vote_extend_reservation even when the miner's reservation has already lapsed. the condition reserved_until < current_block + EXTEND_THRESHOLD_BLOCKS is true for any reserved_until behind current_block, so expired reservations trigger a contract call that gets rejected with NoReservation

changed the guard to 0 < blocks_left < EXTEND_THRESHOLD_BLOCKS so it only fires when the reservation is still alive but within the threshold window

test plan

verified the condition against blocks_left values of -5, 0, 1, 19, 20, 21, only 1 through 19 should trigger the extend vote

@LandynDev
Copy link
Copy Markdown
Collaborator

hey — appreciate the eye on this, but this one's been overtaken by the post-v1 refactor in #46 and #47

  • already prevented upstreamstate_store.purge_expired_pending_confirms() at forward.py:44 drops expired pending_confirms before try_extend_reservation is even reached, so the blocks_left ≤ 0 path you're guarding shouldn't be hit in normal flow anymore.

@LandynDev LandynDev closed this Apr 17, 2026
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