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

Use monotonic SOA serial numbers, enforced by 12-confirmation "safe height" for tree roots #766

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pinheadmz
Copy link
Member

@pinheadmz pinheadmz commented Sep 5, 2022

Closes #690
Implementation of #690 (comment):

  1. Like SPV node, Full Node should wait 12 confirmations after each Urkel Tree update before resolving records from the updated root zone. (see getSafeRoot() in chain.js)

  2. The SOA serial should be the timestamp in the first block header after each tree update (ie. the first block header to commit to the updated tree root hash, which according to (1) was at least 11 blocks ago)

  3. The hsd (and hnsd) root server should send REFUSED (or is there something better ?) until the chain is "synced" which means the timestamp in the chain tip (most recent block) is within the last 6 hours. This is a different definition of "synced" than is used elsewhere in the code, that's OK.

This will:

  • prevent old records from being served while a node is still syncing
  • guarantee that SOA serial is always increasing, and only changes when the root zone actually changes
    • even if there is a chain reorg, but only if that reorg is < 12 blocks deep (which is like, we got bigger problems then)
  • synchronize the responses from full and light nodes
    • HNS users will have to get used to an extra 2-hour wait when updating records on chain 😬

TODO:
- [ ] Add EDNS error code (will require update to bns as well): suggested by @buffrr <- This will be handled in a future PR once chjj/bns#37 is reviewed and merged.

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.

SOA Serial does not reflect the version of the data being served
1 participant