Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Fix sequence number overflow handling#74

Open
MorganaFuture wants to merge 1 commit intovacp2p:mainfrom
MorganaFuture:MorganaFuture/feat/seqno_overflow_handling
Open

Fix sequence number overflow handling#74
MorganaFuture wants to merge 1 commit intovacp2p:mainfrom
MorganaFuture:MorganaFuture/feat/seqno_overflow_handling

Conversation

@MorganaFuture
Copy link

@MorganaFuture MorganaFuture commented Aug 17, 2025

Add epoch tracking to handle uint32 wraparound safely Implement overflow detection and epoch increment

Links: Issues

Add epoch tracking to handle uint32 wraparound safely
Implement overflow detection and epoch increme
@MorganaFuture MorganaFuture marked this pull request as ready for review August 17, 2025 08:59
@MorganaFuture
Copy link
Author

@Ben-PH @richard-ramos Could you please take a look?

@richard-ramos
Copy link
Member

cc: @AkshayaMani

Comment on lines +49 to +61
if a.epoch != b.epoch:
if a.epoch < b.epoch:
return -1
else:
return 1

# Same epoch, compare counters normally
if a.counter < b.counter:
return -1
elif a.counter > b.counter:
return 1
else:
return 0
Copy link
Member

@vladopajic vladopajic Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if a.epoch != b.epoch:
if a.epoch < b.epoch:
return -1
else:
return 1
# Same epoch, compare counters normally
if a.counter < b.counter:
return -1
elif a.counter > b.counter:
return 1
else:
return 0
if a.epoch == b.epoch:
return a.counter - b.counter
return a.epoch - b.epoch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants