fix: shared mutable private getter delay change fix - failing test#6654
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
95f13c1 to
50c4550
Compare
ac77790 to
145deec
Compare
50c4550 to
90d9a67
Compare
| } | ||
|
|
||
| #[aztec(public)] | ||
| fn get_authorized_delay() -> u32 { |
There was a problem hiding this comment.
Being a bit of a pain in the ass, but this one can be a view as well 👀
#[aztec(view)]There was a problem hiding this comment.
Good point, have addressed for both you mentioned and any potential others.
| expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(expectedMaxBlockNumber)); | ||
| }); | ||
|
|
||
| it('checks max block number propagated by reading with our SharedMutablePrivateGetter in TestContract accessing AuthContract; before and after a decreasing then increasing delay change', async () => { |
There was a problem hiding this comment.
Would prefer a shorter test name here. Not sure we need to be told exactly how, but more what it is testing, should be ok with
it('check propagation of max block number in private', async () => {| // We change the SharedMutable authorized delay here to 100, this means that a change to the "authorized" value can | ||
| // only be applied 100 blocks after it is initiated, and thus read requests on a historical state without an initiated change is | ||
| // valid for at least 100 blocks | ||
| await authContract.methods.set_authorized_delay(2).send().wait(); |
There was a problem hiding this comment.
The comment is saying 100, but the code is saying 2 👀
You are first shortening the delay, and then extending it? Is there a special case when we do both of these, or would it be the same if two tests? One that is extending and one reducing?
There was a problem hiding this comment.
Ah yep, fixed. Also added a note for why we delay 4 below.
Would be the same if it is in two tests, and its nicer to go short -> long, as long -> short has a dependency on the previous delay, and also just a bit easier to show peculiarities within the whole flow as one test.
| // We now call our AuthContract to see if the change in max block number has reflected our delay change | ||
| const tx2 = await authContract.methods.get_authorized_in_private().prove(); | ||
|
|
||
| // The validity of our SharedMutable read request should now be limited to 100 blocks, instead of 5 |
| new Fr(expectedModifiedMaxBlockNumber), | ||
| ); | ||
|
|
||
| // We access the same SharedMutable from our SharedMutablePrivateGetter, expecting the validity assumptions to remain the same. |
There was a problem hiding this comment.
Checking parity between our fancy getter and the direct call? 👀
| // We now call our AuthContract to see if the change in max block number has reflected our delay change | ||
| const tx4 = await authContract.methods.get_authorized_in_private().prove(); | ||
|
|
||
| // The validity of our SharedMutable read request should now be limited to 100 blocks, instead of 5 |
There was a problem hiding this comment.
Stale comment.
This one is always a little funky to me.
So you reduced it to 2, and now you are increasing it 100.
The reduction needs to wait for the full execution before it is "happy", but for the extension it can take effect more quickly where there is not a pending value change 🤔
There was a problem hiding this comment.
Yeah to me as well. Have added a comment there making this difference explicit
7ce1f9f to
9e276ec
Compare
20fb637 to
4443965
Compare
9e276ec to
4ce1f0e
Compare
bf7019a to
f094691
Compare
f094691 to
511478a
Compare
f6cbf00
into
ek/fix/shared-mutable-private-getter-context-fix-failing-test
Benchmark resultsMetrics with a significant change:
Detailed resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Proof generationEach column represents the number of threads used in proof generation.
L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 16 txs.
Circuits statsStats on running time and I/O sizes collected for every kernel circuit run across all benchmarks.
Stats on running time collected for app circuits
Tree insertion statsThe duration to insert a fixed batch of leaves into each tree type.
MiscellaneousTransaction sizes based on how many contract classes are registered in the tx.
Transaction size based on fee payment method | Metric | | |

Adding another state vars test that fails