fix(avm)!: last_child id constraints#16568
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
dbanks12
left a comment
There was a problem hiding this comment.
Looks mostly good, but a couple concerns
barretenberg/cpp/pil/vm2/context.pil
Outdated
| #[ENTER_CALL_LAST_CHILD_ID] | ||
| NOT_LAST_EXEC * (sel_enter_call + sel_error) * last_child_id' = 0; |
There was a problem hiding this comment.
Why the + sel_error? sel_enter_call implies sel_error == 0
There was a problem hiding this comment.
Yeah so last_child_id of the next row should be 0 if we either enter a new call context or if we have an exceptional halt. Thinking about this some more i think there might be an issue with the other returndatas as well
- It might need to only be for nested exceptional halt, in a top level halt we do nothing anyways
- We zero out rd_size and rd_addr so that the parent context can't access a failed child context's memory via returndata. However, in our current execution flow we don't zero it out.
I'll think abit more about it
There was a problem hiding this comment.
We no longer zero out last_child_id if we exit a failing call
95932af to
9093797
Compare
78de546 to
08e8cf0
Compare
|
|
||
| check_relation<context>(trace); | ||
|
|
||
| // TODO: Migrate to check_interaction pattern once these lookups are added in a builder |
There was a problem hiding this comment.
Update to clean up this todo as well
| lookup_context_ctx_stack_return_settings>(trace); | ||
| } | ||
|
|
||
| TEST(ContextConstrainingTest, ContextSwitchingExceptionalHalt) |
There was a problem hiding this comment.
New test to check correct reset during an exceptional halt
08e8cf0 to
9965aa8
Compare
9093797 to
b3ed32f
Compare
dbanks12
left a comment
There was a problem hiding this comment.
Approving to unblock, but want to review for real later.
b3ed32f to
8d6f1cd
Compare
9965aa8 to
d06ed9b
Compare


Adds the constraints for the
last_child_idintroduced in #16531. It has similar behaviour to other return data information stored in the context