Skip to content

bugfix: fix network inbound queue delay underflow - #80

Open
Lchangliang wants to merge 1 commit into
aptos-nodefrom
codex/fix-inbound-queue-delay-underflow
Open

bugfix: fix network inbound queue delay underflow#80
Lchangliang wants to merge 1 commit into
aptos-nodefrom
codex/fix-inbound-queue-delay-underflow

Conversation

@Lchangliang

Copy link
Copy Markdown
Collaborator

Summary

  • Guard inbound network queue delay calculation against reversed wall-clock timestamps
  • Log a warning and record 0 seconds when dequeue time is earlier than receive time
  • Add unit coverage for normal and reversed timestamp calculations

Root cause

ReceivedMessage::new() records receive_timestamp_micros using Unix wall-clock time, and received_message_to_event() later reads Unix wall-clock time again before observing inbound queue delay. If the system clock moves backwards between those two reads, or a manually constructed ReceivedMessage carries a future receive timestamp, dequeue_at - rx_at underflows and can panic.

Validation

  • cargo fmt --package aptos-network
  • git diff --check
  • cargo test -p aptos-network inbound_queue_delay_seconds

@Lchangliang
Lchangliang marked this pull request as ready for review August 6, 2026 01:38
@Lchangliang Lchangliang changed the title fix network inbound queue delay underflow bugfix: fix network inbound queue delay underflow Aug 6, 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.

1 participant