-
Notifications
You must be signed in to change notification settings - Fork 265
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
chore: pull across macro ordering changes #10466
Conversation
Seems like a simple reordering of annotations makes this work (waiting for CI). One thing that I found curious: #[event]
#[derive(Serialize)]
struct ContractInstanceDeployed { ^^^ that fails, while this works: #[derive(Serialize)]
#[event]
struct ContractInstanceDeployed { Makes sense, since let any = fresh_type_variable();
let maybe_serialize_impl = typ.get_trait_impl(quote { protocol_types::traits::Serialize<$any> }.as_trait_constraint());
assert(maybe_serialize_impl.is_some(), "A nice error message to convey #[derive(Serialize)] must come before #[event]"); And to my surprise, |
#10460) Skip computation of numerator and denominator of z_perm at indexes that are not part of the active ranges, and refine the threshold in commit_structured for `z_perm`. New benchmarks: **Now: 5.6 s difference** We still see a difference between committing to z_perm between an ambient trace of 2^19 and 2^20, caused by the fact that the active ranges complement are larger (i.e. the ranges in the trace blocks where z_perm is constant) because the blocks themselves are larger. We make sure to at least avoid computing and committing to z_perm after the final active wire index.
Ah excellent! Much easier than I feared. |
Hmm, I'm not entirely sure why there would be an impl in that case. @jfecher can you shed light here? |
#[derive_via(derive_serialize)]
trait Serialize<let N: u32> {}
comptime fn derive_serialize(s: StructDefinition) -> Quoted {
let t = s.as_type();
quote[impl Serialize<0> for $t {}]
}
#[find_serialize]
#[derive(Serialize)]
struct Foo {}
comptime fn find_serialize(s: StructDefinition) {
let any = std::meta::typ::fresh_type_variable();
let serialize = quote { Serialize<$any> }.as_trait_constraint();
let serialize_impl = s.as_type().get_trait_impl(serialize);
assert(serialize_impl.is_some(), "#[derive(Serialize)] must come before #[find_serialize]");
} Errors as expected for me |
This PR pulls across the changes from noir-lang/noir#6326 so we can see how it affects the aztec-nr macros.