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

DNS TTL Not Respected by celestia-core Leading to Potential Future Sync Issues #1425

Closed
smuu opened this issue Jul 22, 2024 · 3 comments · Fixed by #1442
Closed

DNS TTL Not Respected by celestia-core Leading to Potential Future Sync Issues #1425

smuu opened this issue Jul 22, 2024 · 3 comments · Fixed by #1442
Assignees

Comments

@smuu
Copy link
Member

smuu commented Jul 22, 2024

Description:

We identified a potential issue where changes to the DNS entries of nodes in celestia-core are not respected, similar to the issue observed in celestia-node. Although we have not yet encountered sync issues due to this behavior, it could pose a problem in the future. It appears that nodes resolve DNS entries only once at startup and continue using the same IP address indefinitely, ignoring DNS TTL.

Steps to Reproduce:

  1. Change the DNS entries for nodes.
  2. Observe that nodes continue to use the old IP address without re-resolving the DNS entries.

Suspected Cause:
Nodes resolve DNS entries only once at startup and continue using the same IP address without respecting the TTL. This could affect:

  • Nodes connecting to other nodes within the network.

Relevant Code:

Potential Fix:

  1. Periodically re-resolve DNS entries based on the TTL.
  2. Update active connections if the resolved IP address changes.

Repositories Potentially Needing Changes:

Impact:
Not respecting DNS TTL can lead to potential connectivity and sync issues, affecting network reliability in the future.

Request for Assistance:

  1. Implement periodic DNS resolution based on TTL.
  2. Test changes to ensure nodes dynamically update connections based on DNS updates.
@smuu
Copy link
Member Author

smuu commented Jul 22, 2024

For reference the issue in celestia-node: celestiaorg/celestia-node#3570

@smuu
Copy link
Member Author

smuu commented Jul 22, 2024

One workaround for this issue would be to recreate the connection once it fails after the IP address changes. This way, we don't need to add support to handle the DNS TTL, and the node would request the new IP address from the DNS server.

@cmwaters
Copy link
Contributor

cmwaters commented Jul 22, 2024

Yeah, we could add code such that if the connection failed it would try resolve the DNS again to see if there had been an IP change and if so reconnect to the peer. Ideally we'd only try connect if the error specifically had to do with the network connection and not some malicious behaviour from the peer

ninabarbakadze added a commit that referenced this issue Aug 23, 2024
## Description

Fixes #1425 

## Testing

Testing DNS change is not really possible in unit tests so @smuu agreed
to help me test manually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants