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
Make sure that we prefer own blocks over incoming blocks #1286
Comments
Note that clock skew cannot make this worse: although we might allow for clock skew in the chain sync client, the chain DB will store such "blocks from the future" but not adopt them. See also #1150, especially #1150 (comment) . |
The Praos protocol implementation ( |
Note that this is not essential for the testnet: if two nodes are both producing a block, a fork is created in the chain, which must later be resolved; one of the two nodes is going to lose anyway and its block will be lost. Not implementing this ticket will mean that the second leader, if it gets the other block before it manages to produce its own (rather unlikely anyway), will just "resolve the fork" of its own accord. |
Lowering this to medium priority since the probability of it happening is sufficiently unlikely and it won't break the system if we don't do it. |
Raising this to high priority again, because people might intentionally set their clocks ahead to increase the probability of this happening. The Ouroboros spec stipulates: if there are multiple leaders for any given slot, you should prefer your own block. We have a good way to handle it: in case of a tie in block numbers during chain selection, when the slots are equal, prefer the block we produced. |
Fixes #1286. * Include `SelfIssued` in `TPraosChainSelectView`, use that to prefer the self issued tip in case the tips are produced in the same slot. * Store the block issuer verification key (new, strict `BlockIssuerVKey` data type) in the `BlockConfig` so that we have access to it when we need to extract the 'SelectView' for a header. * Fix the ordering: first look at the ocert issue number instead of the VRF hashes, doing it in the opposite order (as before) defeated the purpose.
Fixes #1286. * Include `SelfIssued` in `TPraosChainSelectView`, use that to prefer the self issued tip in case the tips are produced in the same slot. * Store the block issuer verification key (new, strict `BlockIssuerVKey` data type) in the `BlockConfig` so that we have access to it when we need to extract the 'SelectView' for a header. * Fix the ordering: first look at the ocert issue number instead of the VRF hashes, doing it in the opposite order (as before) defeated the purpose.
Fixes #1286. * Include `SelfIssued` in `TPraosChainSelectView`, use that to prefer the self issued tip in case the tips are produced in the same slot. * Store the block issuer verification key (new, strict `BlockIssuerVKey` data type) in the `BlockConfig` so that we have access to it when we need to extract the 'SelectView' for a header. * Fix the ordering: first look at the ocert issue number instead of the VRF hashes, doing it in the opposite order (as before) defeated the purpose.
2348: Shelley: prefer self-produced blocks during chain selection r=mrBliss a=mrBliss Fixes #1286. * Include `SelfIssued` in `TPraosChainSelectView`, use that to prefer the self issued tip in case the tips are produced in the same slot. * Store the block issuer verification key (new, strict `BlockIssuerVKey` data type) in the `BlockConfig` so that we have access to it when we need to extract the 'SelectView' for a header. Co-authored-by: Thomas Winant <thomas@well-typed.com>
For future reference, we're not sure the spec specifies you should favor your own (eg the Praos paper does not obviously handle the case where the result of Edit: I found a Slack thread in
|
When an upstream node and we ourselves are both elected leader, in the (admittedly unlikely) scenario that we receive the upstream block before we manage to produce our own, I think the current chain DB does not guarantee that we will prefer our own block -- but it should; this is a clear violation of the Ouroboros spec.
The text was updated successfully, but these errors were encountered: