Skip to content

cmd/devp2p: tweak DNS TTLs#20801

Merged
karalabe merged 2 commits intoethereum:masterfrom
fjl:cmd-devp2p-dns-ttl
Mar 26, 2020
Merged

cmd/devp2p: tweak DNS TTLs#20801
karalabe merged 2 commits intoethereum:masterfrom
fjl:cmd-devp2p-dns-ttl

Conversation

@fjl
Copy link
Copy Markdown
Contributor

@fjl fjl commented Mar 23, 2020

This increases the TTL on tree root records to enable some caching.
It also decreases the TTL on the leaves to a saner value.

Comment thread cmd/devp2p/dnscmd.go Outdated
rootTTL = 1
treeNodeTTL = 2147483647
rootTTL = 30 * 60 // 30 min
treeNodeTTL = 2 * 7 * 24 * 60 * 60 // 2 weeks
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any reason to decrease this? AFAIK this thing is immutable.

Copy link
Copy Markdown
Contributor Author

@fjl fjl Mar 24, 2020

Choose a reason for hiding this comment

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

I just thought the previous one was ridiculously high. Most DNS caches won't keep things forever anyway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It was the highest that Cloudflare allowed. I know they won't keep it forever, but the current code will just cause everyone to rerequest everything every 2 weeks.

@karalabe karalabe added this to the 1.9.13 milestone Mar 26, 2020
@karalabe karalabe merged commit 1583e7d into ethereum:master Mar 26, 2020
enriquefynn pushed a commit to enriquefynn/go-ethereum that referenced this pull request Mar 10, 2021
* cmd/devp2p: tweak DNS TTLs

* cmd/devp2p: bump treeNodeTTL to four weeks
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.

2 participants