Skip to content

Filter stale/out-of-range updates from get_updates#26

Merged
0xSasaPrsic merged 1 commit into
helios-cudafrom
fix/get-updates-stale-period
Jun 16, 2026
Merged

Filter stale/out-of-range updates from get_updates#26
0xSasaPrsic merged 1 commit into
helios-cudafrom
fix/get-updates-stale-period

Conversation

@0xSasaPrsic

Copy link
Copy Markdown
Member

Some beacon RPC providers return a malformed light_client/updates list when start_period is the current (in-progress) sync-committee period: they ignore count, prepend the head-period update, then dump their entire retained history (~200 older periods), out of order.

helios passes this through unsorted, so the SP1 program receives a stale update as entry #2 and verify_update rejects it with InvalidPeriod ("Update 2 is invalid!"), aborting the run.

Defend against the non-compliant response by keeping only updates whose sync period is >= the requested period and sorting ascending, so they form a clean chain starting from the store.

Some beacon RPC providers return a malformed light_client/updates list
when start_period is the current (in-progress) sync-committee period:
they ignore `count`, prepend the head-period update, then dump their
entire retained history (~200 older periods), out of order.

helios passes this through unsorted, so the SP1 program receives a
stale update as entry #2 and verify_update rejects it with
InvalidPeriod ("Update 2 is invalid!"), aborting the run.

Defend against the non-compliant response by keeping only updates whose
sync period is >= the requested period and sorting ascending, so they
form a clean chain starting from the store.
@0xSasaPrsic 0xSasaPrsic merged commit 096e562 into helios-cuda Jun 16, 2026
2 checks passed
@0xSasaPrsic 0xSasaPrsic deleted the fix/get-updates-stale-period branch June 16, 2026 12:10
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