feat(protocol): bound note storage loading in the OwnerConfig and FaucetPolicyConfig scripts - #3563
Conversation
bobbinth
left a comment
There was a problem hiding this comment.
Looks good! Thank you! I left some comments inline - but they should be pretty easy to address (and one of them probably shouldn't be addressed at all).
| #! - num_storage_items is greater than max_num_storage_items. | ||
| #! | ||
| #! Invocation: exec | ||
| pub proc get_bounded_storage(dest_ptr: MemoryAddress, max_num_storage_items: u16) -> u16 |
There was a problem hiding this comment.
Probably not a good idea, but I wonder if we should just change the get_storage procedure to work like this. The biggest issue is that that would be a pretty bad breaking change (not easy to detect downstream) - but if we were designing the protocol from scratch, that's how I'd probably make get_storage work.
|
|
||
| # write the note storage to memory starting at STORAGE_PTR | ||
| push.STORAGE_PTR exec.active_note::get_storage | ||
| push.MAX_NUM_ITEMS push.STORAGE_PTR exec.active_note::get_bounded_storage |
There was a problem hiding this comment.
Should we propagate this everywhere (maybe in a different PR)? Basically, I'm not sure there should be much usage of get_storage any more.
| # push a placeholder note_index (ignored when is_active_note = 1) and the active note flag | ||
| push.0.1 | ||
| # => [is_active_note = 1, note_index = 0, dest_ptr, max_num_storage_items] | ||
|
|
||
| exec.input_note_internal::get_storage_info_raw | ||
| # => [NOTE_STORAGE_COMMITMENT, num_storage_items, dest_ptr, max_num_storage_items] |
There was a problem hiding this comment.
this is the same as exec.get_storage_info right? I'd replace that.
Closes: #3562