Skip to content

feat: remove offset and size from AccountProcedureInfo#2162

Merged
bobbinth merged 45 commits intonextfrom
pgackst-remove-procedure-offset-and-size
Dec 13, 2025
Merged

feat: remove offset and size from AccountProcedureInfo#2162
bobbinth merged 45 commits intonextfrom
pgackst-remove-procedure-offset-and-size

Conversation

@PhilippGackstatter
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter commented Dec 11, 2025

Rename AccountProcedureInfo into AccountProcedureRoot and remove storage offset and size.

  • Reduces number of elements needed for each procedure in the kernel from 8 to 4.
  • Remove storage offset and storage size which is no longer needed after named storage slots, as each component can access any storage slot by name.
  • Updates account code docs and removes some unused and (imo) unnecessary methods like "find index by root", which is now easy to implement via AccountCode::procedures. Happy to bring these back if you have different opinions.
  • Removes a lot of code 🎉
  • Notably, the kernel now uses mem::pipe_words_to_memory instead of pipe_double_words_to_memory for hashing account code. This is less efficient, but I don't think we should enforce that the number of procedures is even?
  • Previously, we used the storage_offset to detect procedures by the same account component in AccountComponentInterface. Then each component corresponded to one AccountComponentInterface::Custom entry. We can no longer differentiate components at the procedure level now, and so all procedures that are not well-known are put into a single AccountComponentInterface::Custom. Since we want to refactor this anyway, I assume this is not a big deal.

This addresses the remaining TODO(named_slots) and so this should close the named storage slots issue.

Follow-up: (note to self) Open issue for rearranging account memory to make all account sections contiguous.

closes #1724

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left some comments inline.

Base automatically changed from pgackst-find-slot to next December 12, 2025 02:19
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left just one comment inline.

@bobbinth bobbinth merged commit 5c4edb4 into next Dec 13, 2025
17 checks passed
@bobbinth bobbinth deleted the pgackst-remove-procedure-offset-and-size branch December 13, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Named Storage Slots

3 participants