Skip to content

Enforcing absolute timestamps in Networking Protocols #2315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MarcosNicolau opened this issue Mar 26, 2025 · 0 comments · May be fixed by #2441
Open

Enforcing absolute timestamps in Networking Protocols #2315

MarcosNicolau opened this issue Mar 26, 2025 · 0 comments · May be fixed by #2441

Comments

@MarcosNicolau
Copy link
Member

MarcosNicolau commented Mar 26, 2025

We should explicitly enforce abosulte timestamps (the UTC timezone) in our code when handling timestamps used in networking protocols like discv4 and RLPx, as required by the devp2p specifications:

"The expiration field is an absolute UNIX timestamp. Packets containing a timestamp that lies in the past are expired and may not be processed."

In discv4 (reference here), our implementation was incorrectly treating messages as expired because the server's timestamp was offset by +3 hours. This caused our node to reject valid messages and prevented us from initiating RLPx connections.

This lib appears to be the standard for dates in rust: https://docs.rs/chrono/latest/chrono/struct.Utc.html

For now, make sure your machine is synchronized with UTC time.

@iovoid iovoid linked a pull request Apr 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant