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

New Diffusion-Consensus function for caught-up-ness #91

Open
Tracked by #414
nfrisby opened this issue May 16, 2023 · 3 comments
Open
Tracked by #414

New Diffusion-Consensus function for caught-up-ness #91

nfrisby opened this issue May 16, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@nfrisby
Copy link
Contributor

nfrisby commented May 16, 2023

PR IntersectMBO/ouroboros-network#4555 adds a new function to the interface that the Diffusion Layer demands from the Consensus Layer. See Issue IntersectMBO/ouroboros-network#4530 for the underlying motivation.

This task is to implement that function.

The interface we discussed with the Networking Team serves two purposes simultaneously.

  • It parses a recent ledger state in order to extract information about the registered stake pools (eg relative stake, relay node IP addresses, etc).

  • It decides whether the Diffusion Layer can currently safely sample a root peer from those ledger peers instead of the trusted public root peers (since Genesis is not yet deployed).

We anticipate the parsing will be simple. But the exact decision rule deserves more discussion. It has three constraints:

  1. The node should not sample its root peers from a ledger state that is too old, since the contained stake distribution, IP addresses, etc may no longer match the current state of the real world.

  2. The node should not sample its root peers from a ledger state when the node's immutable tip is too old, since there's a significant probability that one of its peers is adversarial and so could be performing a long-range attack. (Genesis will supplant this concern.)

  3. Otherwise, the node should sample its root peers from the ledger state when possible, to reduce load on the trusted public roots. (ChainSync Jumping will help this, but not supplant it.)

Constraint (2) dominates constraint (1), and constraint (3) is merely saying constraint (2) should not be excessively conservative. So it's really constraint (2) that this issue must design and implement.

See my contribution to the description of Issue IntersectMBO/ouroboros-network#4530 for the approach to satisfying constraint (2). I suspect the implementation will provide a specific threshold of the immutable tip age to use during each era.

Recall that the HFC can always determine the UTC time stamp of a block's ledger state: the ledger state itself must contain suffici information for the time translation to succeed. Thus the node can always determine the age of the immutable tip by mapping it to a UTC time and subtracting it from the wall clock.

@nfrisby nfrisby changed the title Implement new Diffusion-Consensus function for caught-up-ness New Diffusion-Consensus function for caught-up-ness May 16, 2023
@nfrisby
Copy link
Contributor Author

nfrisby commented May 16, 2023

cc @bolt12 @coot @dnadales

@nfrisby nfrisby added the enhancement New feature or request label May 16, 2023
@nfrisby
Copy link
Contributor Author

nfrisby commented May 17, 2023

Should split this Issue in two: one for the design work, one for the implementation work. We've started the design work, but not the implementation work. EG It may end upthat two separate people do them.

@coot
Copy link
Contributor

coot commented May 18, 2023

@nfrisby we will need a similar API when switching between Genesis and Praos mode to change the number of big ledger peers which the diffusion is using. The design could also answer if they differ or not (which is not obvious to me), or maybe this deserves a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants