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

Add last_finalized_estimate to protocols that need it #156

Open
naterush opened this issue Dec 11, 2017 · 1 comment
Open

Add last_finalized_estimate to protocols that need it #156

naterush opened this issue Dec 11, 2017 · 1 comment

Comments

@naterush
Copy link
Collaborator

Issue

Currently, we don't check message validity. To see if a message is valid, its estimate should be justified.

For some protocols, checking that an estimate is valid requires walking from some previous block (or set of outputs) in the past. For example, this is the last_finalized_block in TGF. However, this is not currently included in messages.

Proposed Implementation

Add last_finalized_block to blocks (and a similar field anywhere else this is needed), and have this be specified for a block when created.

This is an issue b/c messages are currently created by a single validator class, and we should not be specifying any last-finalized-anything for protocols that don't require a walk and are simply based off latest messages (e.g. binary).

One option might be having a sub-class of validators where message creation is specific to protocol type (or maybe protocol class...). E.g. there's one for binary, integer, order, and a different validator class for blockchain and concurrent rewrite.

@naterush
Copy link
Collaborator Author

Another (better) solution is to reintroduce the Justification data structure. Here, we two options. We can have multiple Justification's - one that just stores latest_messages, and one that also has last_finalized_estimate, or we can have a single Justification that has both fields, but last_finalized_estimate defaults to None.

Also, the Justification data structure can have a function get_new_messages(self, latest_message) where it returns a dict that just contains the difference between the latest_messages and the justification. This will be useful for computing the minimal justification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant