Skip to content

Conversation

@Dentosal
Copy link
Member

@Dentosal Dentosal commented Dec 15, 2025

Discussed in #517.

Adds a minimal set of opcodes required to operate with dynamic (variable-sized) storage slots. More instructions can be added later to speed up common operations, as discussed in #517.

This PR marks sequential bulk read and write opcodes as deprecated. There's no process for actually removing opcodes, but simply including DEPRECATED in the heading informs readers that they ought to be careful. Most imporatantly, the sequential read opcode now panics if attempting to read slots with size other than 32 bytes. The sequential clear instuction still works as expected and is kept as-is.

The PR also clarifies how the old storarge instructions interact with variable sized slots.

Before requesting review

  • I have reviewed the code myself

@Dentosal Dentosal self-assigned this Dec 15, 2025
@cursor
Copy link

cursor bot commented Dec 15, 2025

PR Summary

Introduces variable-sized storage operations and clarifies storage semantics.

  • Adds new contract state instructions: SCLR, SRDD, SRDI, SWRD, SWRI, SUPD, SUPI, SPLD, SPCP for partial reads/writes, full-slot writes, and preload/copy from a staging area
  • Deprecates legacy sequential ops SCWQ, SRWQ, SWWQ; updates SRW to use an immediate word offset and to panic on insufficient slot length; clarifies SWW zero-padding to 32 bytes
  • Documents a storage preload staging area in index.md (cleared on call/return) accessible via SPLD/SPCP
  • Adds MAX_STORAGE_SLOT_LENGTH to consensus parameters
  • Minor: extends spell-check dictionary with preload/preloaded

Written by Cursor Bugbot for commit 396aa15. This will update automatically on new commits. Configure here.

@Dentosal
Copy link
Member Author

Meeting notes 2025-12-17:

  • Use $err to signal errors instead of a status output register (new opcodes only, of course)
  • Change SLEN to load the value to a "staging area", add separate opcodes to memcopy from it
  • Remove write status
  • New storage clear opcode without status
  • Document the slot size limit
  • SRW: add immediate offset
  • Buffer extend support to SUPD/SUPI

I'll update the PR to include these.

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.

1 participant