You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Handle event ring-buffer resizing safely in set_max_events #28
The explorer contract stores decoded events in a ring buffer indexed by seq % max (see the slot computation in get_events/submit_event). set_max_events (explorer/src/lib.rs) validates only that the new value is at least MIN_MAX_EVENTS, then overwrites DataKey::MaxEvents. It does not remap existing entries. After a resize, seq % new_max points at different physical slots than the data was written to, so get_event/get_events return wrong, misordered, or missing events for everything already stored. This silently corrupts the readable history.
What needs to be done
Define and implement safe resize semantics. Options, to be chosen and documented:
Rebuild/migrate the buffer contents into the new layout during set_max_events.
Or reset/clear the buffer on resize with an explicit event and documented consequence.
Or forbid resizing while the buffer is non-empty and require an explicit clear first.
Ensure get_event/get_events remain correct across a resize.
Extend the instance TTL on the write and emit an event describing the resize.
Files
explorer/src/lib.rs
Acceptance deliverables
Reads return correct, correctly ordered events before and after a resize (per the chosen, documented semantics).
The resize behavior is documented in the README.
All CI checks pass; the change cannot be merged until CI is green.
Tests to pass
Test: write events, call set_max_events, then read back and assert the documented behavior (no silent corruption).
Test: get_events ordering is correct after a resize.
Activity
Ayinkx01 commentedon Aug 18, 2026
Hi i would like to work on this issue please assign to me
I can do it perfectly
Ayinkx01 commentedon Aug 18, 2026
Hi i would like to work on this issue please assign to me
I can do it perfectly
Ayinkx01 commentedon Aug 18, 2026
Hi i would like to work on this issue please assign to me
I can do it perfectly
rudeus112266 commentedon Aug 25, 2026
I would love to have a go at resolving this issue. kindly assign
grantfox-oss commentedon Aug 25, 2026
🦊 GrantFox — @rudeus112266 has been assigned to this issue as part of the Third Campaign campaign!
Next steps:
Closes #28)Good luck! Track your progress on GrantFox.
fix: #28 Handle event ring-buffer resizing safely in set_max_events
grantfox-oss commentedon Oct 9, 2026
🎉 This issue has been marked as completed on GrantFox!
@rudeus112266's PR #34 was approved and merged by @priscaenoch.
🏆 @rudeus112266: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (433 total points). Track your full progress on GrantFox.
👏 Great work, @rudeus112266! Keep contributing to octraban.