0xPolygonMiden / miden-base

Core components of the Polygon Miden rollup
MIT License
68 stars 41 forks source link

Enforce `procedure offsets` are in bounds of initialised `storage slots` #863

Closed phklive closed 1 week ago

phklive commented 2 weeks ago

Feature description

Since this PR: #843 each account code procedure has an associated storage offset. Enabling procedures MAST to stay fixed while making dynamic storage accesses.

We need to make sure that all initialised account code procedures storage offsets are accessing existing storage slots.

When initialising storage in the transaction prologue we store the num of existing account storage slots in memory.

Goal of this issue:

During transaction prologue make sure that no account code procedures offset is greater than the num_storage_slots, which would mean that the index of the procedure offset would be out of bounds.

Why is this feature needed?

We need to make sure that all initialised procedures of the account are correctly offset to existing storage slots