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

Check/update API to correctly convey tx/block/layer finality #256

Open
lrettig opened this issue Aug 21, 2023 · 1 comment
Open

Check/update API to correctly convey tx/block/layer finality #256

lrettig opened this issue Aug 21, 2023 · 1 comment
Assignees

Comments

@lrettig
Copy link
Member

lrettig commented Aug 21, 2023

The API was originally designed to convey several degrees of confirmation/finality, but a few things have changed since it was designed and implemented, including the introduction of the Hare certificate.

Per @tal-m, we consider a layer/block/tx final if:

  • a block has a Hare certificate. the certificate is needed only for sync; if a node observed the Hare protocol completing successfully, that's equivalent.
  • or, if the Hare fails, or we're in self-healing mode, it's enough that the vote margin for a block passes the global confidence threshold.

Note that, just like Bitcoin, we don't have actual finality. The "finality guidelines" above guarantee irreversibility except with 2^{-40} probability, assuming all the security assumptions hold.

to be on the safe side it's probably better to wait until the global threshold is reached even when we see a Hare output.

@lrettig lrettig self-assigned this Aug 21, 2023
@lrettig
Copy link
Member Author

lrettig commented Aug 22, 2023

I spent some time refamiliarizing myself with the tx/layer flow and how the API reports it. For reference a lot of the history is explained/linked here: spacemeshos/api#144.

Right now the node applies a layer after the Hare outputs a block. At this point the layer gets marked LAYER_STATUS_APPLIED. There's no differentiation at present between Hare and Tortoise "approving" a tx/block/layer. TransactionState and TransactionResult and TransactionReceipt don't contain any information on this, either: the TransactionResult.layer gets set when the tx gets processed/applied to state.

This needs some more thought/design.

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

No branches or pull requests

1 participant