-
Notifications
You must be signed in to change notification settings - Fork 24
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
simplify ValidityPredicate trait #201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the changes are fine,
It's just that the dyn traits are still there, but this is a good first step
pub type ValidityPredicate = dyn ValidityPredicateVerifyingInfo; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is a fine simplification, seems it is still used everywhere, however this does bring up a question.
taiga_halo2/src/note.rs
Outdated
app_vp_verifying_info: Box<dyn ValidityPredicateVerifyingInfo>, | ||
app_vp_verifying_info_dynamic: Vec<Box<dyn ValidityPredicateVerifyingInfo>>, | ||
app_vp_verifying_info: Box<ValidityPredicate>, | ||
app_vp_verifying_info_dynamic: Vec<Box<ValidityPredicate>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems here we are still essentially being reliant upon a dyn trait
, if we were to expand this alias, it ends up being
app_vp_verifying_info: Box<dyn ValidityPredicateVerifyingInfo>
app_vp_verifying_info_dynamic: Vec,Box<dyn ValidityPredicateVerifyingInfo>>
meaning that binding to this is still hard if this is exposed as the outside interface
taiga_halo2/src/note.rs
Outdated
app_vp_verifying_info: Box<dyn ValidityPredicateVerifyingInfo>, | ||
app_vp_verifying_info_dynamic: Vec<Box<dyn ValidityPredicateVerifyingInfo>>, | ||
app_vp_verifying_info: Box<ValidityPredicate>, | ||
app_vp_verifying_info_dynamic: Vec<Box<ValidityPredicate>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here
circuit::{vp_circuit::ValidityPredicateInfo, vp_examples::TrivialValidityPredicateCircuit}, | ||
circuit::{vp_circuit::ValidityPredicateCircuit, vp_examples::TrivialValidityPredicateCircuit}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should have changed with the commit that removed the type,, but good that the bench still works.
dad72c2
to
eb3a0e2
Compare
ValidityPredicateInfo
trait intoValidityPredicateCircuit
trait. Can not merge theValidityPredicateVerifyingInfo
trait because it causes an "unsafe object" compile error when creating a dynamic object.ValidityPredicateConfig
trait and use the concrete ValidityPredicateConfig struct instead since we've unified the VP config. TODO: fix the Sudoku example later, which uses the deprecatedValidityPredicateConfig
trait.app_vp_verifying_info/app_vp_verifying_info_dynamic
in the Input/OuputNoteProvingInfo toapplication_vp/dynamic_vps
ValidityPredicateCircuit
of Taiga.