Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add storage bounds to account procedures #866

Closed
bobbinth opened this issue Sep 10, 2024 · 1 comment · Fixed by #886
Closed

Add storage bounds to account procedures #866

bobbinth opened this issue Sep 10, 2024 · 1 comment · Fixed by #886
Assignees
Labels
enhancement New feature or request kernels Related to transaction, batch, or block kernels
Milestone

Comments

@bobbinth
Copy link
Contributor

Currently, we specify storage offsets for account procedures. That is, if storage offset for a procedure is 1, whenever the procedure tries to access storage item 0, the actual item accessed will be 1, when i tries to access storage item 1, the actual accessed item will be 2 etc. This puts a "lower bound" on the item a procedure can access - but we do not restrict the upper bound. That is, a procedure can access any storage item (up to a max of 255) starting from its offset.

It would be good to make sure that a given procedure can access only a specific set of storage items. This would prevent potential overlaps between different procedures. To do this, we need to do the following:

Update the AccountProcedureInfo struct to look something like this:

pub struct AccountProcedureInfo {
    mast_root: Digest,
    storage_offset: u8,
    storage_size: u8,
}

Where storage size would be the number of storage slots a procedure can access. So, the "physical" storage slots accessible by a procedure would be bounded by [storage_offset, storage_offset + storage_size).

We would also need to update the transaction kernel to handle this properly.

@bobbinth bobbinth added enhancement New feature or request kernels Related to transaction, batch, or block kernels labels Sep 10, 2024
@bobbinth bobbinth added this to the v0.6 milestone Sep 17, 2024
@phklive phklive linked a pull request Sep 20, 2024 that will close this issue
@bobbinth
Copy link
Contributor Author

Largely closed by #886.

@phklive - could you create an issue (unless it already exists) on what remains to be done to remove the temporary code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kernels Related to transaction, batch, or block kernels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants