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

create validation stub to facilitate parallel work on validation and message passing #137

Closed
wants to merge 4 commits into from

Conversation

dknopik
Copy link
Member

@dknopik dknopik commented Feb 14, 2025

Two remaining tasks for the MVP are message passing and validation. This PR enables parallel work on this by adding a stub - and creating a todo location for validation and for message passing, allowing two team members to work simultaneously on one topic each.

@Zacholme7 Zacholme7 mentioned this pull request Feb 14, 2025
use tracing::debug;

// TODO taken from go-SSV as rough guidance. feel free to adjust as needed. https://github.com/ssvlabs/ssv/blob/e12abf7dfbbd068b99612fa2ebbe7e3372e57280/message/validation/errors.go#L55
pub enum ValidationFailure {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some errors in here that require qbft specific data. How do we plan on getting access to that data? or should these errors be used within qbft?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent question 😅

if we really end up needing some of the internal qbft state, then this approach is too naive, and we will need some callback system for parts of the validation. We'll see. This was just a quick copy&paste.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a potential double decoding cause we need to try to decode to check UndecodableMessageData. We are routing messages with the processor and receiving results through queues. It might be controversial, but we could have a queue for something like std::Resut<our::Result, ValidationFailure>. In this way, we could split the validation and do each part where it's more appropriate. Thoughts?

Copy link

@diegomrsantos diegomrsantos Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zacholme7 the validation here

if valid_data.hash != wrapped_msg.qbft_message.root {
seems the same as in https://github.com/ssvlabs/ssv/blob/main/message/validation/consensus_validation.go#L116

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems there's a lot of overlap. What kind of validation are we supposed to do in the validator crate?

@dknopik dknopik marked this pull request as draft February 18, 2025 13:06
@Zacholme7
Copy link
Member

Think we should just get this in or keep it as a draft for now?

@dknopik
Copy link
Member Author

dknopik commented Feb 19, 2025

Think we should just get this in or keep it as a draft for now?

marked it as draft as #147 includes it and we can therefore just merge that. As soon as that is done, we can close this one

@dknopik
Copy link
Member Author

dknopik commented Feb 20, 2025

Superseded by #152.

@dknopik dknopik closed this Feb 20, 2025
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.

3 participants