Skip to content
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

circuitv2: specify timestamp units for reservation expiration #531

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

achingbrain
Copy link
Member

The reservation expiration date is specified in seconds so be explicit about that in the spec in the same way we are explicit about the duration limit units.

The reservation expiration date is specified in seconds so be explicit about that in the spec in the same way we are explicit about the duration limit units.
@achingbrain achingbrain changed the title docs: specify timestamp units docs: specify timestamp units for circuit relay v2 reservation expiration Mar 21, 2023
Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

@marten-seemann marten-seemann changed the title docs: specify timestamp units for circuit relay v2 reservation expiration circuitv2: specify timestamp units for reservation expiration Mar 21, 2023
@marten-seemann marten-seemann merged commit aac4e1f into master Mar 21, 2023
@marten-seemann marten-seemann deleted the achingbrain-patch-1 branch March 21, 2023 08:21
achingbrain added a commit to libp2p/js-libp2p that referenced this pull request Mar 21, 2023
Spec update: libp2p/specs#531

Fixes #1635 which causes the circuit relay to repeatedly connect
to a discovered relay. If the relay returns connection expiration in
seconds, we get a negative ttl when calculating 
`expiration - new Date().getTime()`.

This caused the `addRelay` function to set the timeout at 0ms which
triggers instantly.

---------

Co-authored-by: achingbrain <alex@achingbrain.net>
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

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.

3 participants