diff --git a/aztec/src/state_vars/shared_mutable/scheduled_delay_change.nr b/aztec/src/state_vars/shared_mutable/scheduled_delay_change.nr index 7710c73f..4352ae5c 100644 --- a/aztec/src/state_vars/shared_mutable/scheduled_delay_change.nr +++ b/aztec/src/state_vars/shared_mutable/scheduled_delay_change.nr @@ -9,7 +9,7 @@ mod test; // is performed via `schedule_change` in order to satisfy ScheduleValueChange constraints: if e.g. we allowed for the // delay to be decreased immediately then it'd be possible for the state variable to schedule a value change with a // reduced delay, invalidating prior private reads. -struct ScheduledDelayChange { +struct ScheduledDelayChange { // Both pre and post are stored in public storage, so by default they are zeroed. By wrapping them in an Option, // they default to Option::none(), which we detect and replace with INITIAL_DELAY. The end result is that a // ScheduledDelayChange that has not been initialized has a delay equal to INITIAL_DELAY, which is the desired @@ -18,14 +18,11 @@ struct ScheduledDelayChange { post: Option, // Block at which `post` value is used instead of `pre` block_of_change: u32, - // The _dummy variable forces INITIAL_DELAY to be interpreted as a numeric value. This is a workaround to - // https://github.com/noir-lang/noir/issues/4633. Remove once resolved. - _dummy: [Field; INITIAL_DELAY], } -impl ScheduledDelayChange { +impl ScheduledDelayChange { pub fn new(pre: Option, post: Option, block_of_change: u32) -> Self { - Self { pre, post, block_of_change, _dummy: [0; INITIAL_DELAY] } + Self { pre, post, block_of_change } } /// Returns the current value of the delay stored in the data structure. @@ -167,7 +164,6 @@ impl Deserialize<1> for ScheduledDelayChange { pre: if pre_is_some { Option::some(pre_inner) } else { Option::none() }, post: if post_is_some { Option::some(post_inner) } else { Option::none() }, block_of_change, - _dummy: [0; INITIAL_DELAY], } } } diff --git a/aztec/src/state_vars/shared_mutable/shared_mutable_private_getter.nr b/aztec/src/state_vars/shared_mutable/shared_mutable_private_getter.nr index e389721c..2378a102 100644 --- a/aztec/src/state_vars/shared_mutable/shared_mutable_private_getter.nr +++ b/aztec/src/state_vars/shared_mutable/shared_mutable_private_getter.nr @@ -18,9 +18,6 @@ struct SharedMutablePrivateGetter { other_contract_address: AztecAddress, // The storage slot where the SharedMutable is stored on the other contract storage_slot: Field, - // The _dummy variable forces INITIAL_DELAY to be interpreted as a numberic value. This is a workaround to - // https://github.com/noir-lang/noir/issues/4633. Remove once resolved. - _dummy: [Field; INITIAL_DELAY], } // We have this as a view-only interface to reading Shared Mutables in other contracts. @@ -33,7 +30,7 @@ impl SharedMutablePrivateGetter where T: Fr ) -> Self { assert(storage_slot != 0, "Storage slot 0 not allowed. Storage slots must start from 1."); assert(other_contract_address.to_field() != 0, "Other contract address cannot be 0"); - Self { context, other_contract_address, storage_slot, _dummy: [0; INITIAL_DELAY] } + Self { context, other_contract_address, storage_slot } } pub fn get_value_in_private(self, header: Header) -> T {