Paginated datastore-key ABIs (AS path, exploratory) - #361
Merged
Merged
Conversation
Leo-Besancon
previously requested changes
Sep 23, 2026
Leo-Besancon
self-requested a review
September 24, 2026 13:59
Member
There was a problem hiding this comment.
LGTM (not approving as I still think everyone's input is needed. Not entirely sure this would be needed, but if we want it it seems a nice implementation.
Note that it would be good to explicitely test the MIP gate on the test network once this is merged (it's harder to review the behaviour than massa repo only breaking changes IMO).
Add get_keys_paginated / get_keys_for_paginated to the Interface trait (prefix filter, exclusive start_after cursor, mandatory count), with matching assembly_script_get_keys_paginated[_for] host functions, gas cost entries (provisional, mirrored) and unit tests for the pagination param mapping. Exploratory work for massalabs/massa#5284 (wasmv1 intentionally out: its request type lives in massa-proto-rs, a third repo).
Only resolve the new assembly_script_get_keys_paginated[_for] imports when the host reports an execution component version at or past PAGINATED_DS_KEYS_EXECUTION_VERSION (MIP-0002 massa-side), so an updated node rejects the imports before activation exactly like a non-updated node. Unknown versions fail closed.
peterjah
force-pushed
the
5284-paginated-ds-keys
branch
from
September 28, 2026 10:18
8c4e6ed to
d5f8223
Compare
peterjah
marked this pull request as ready for review
September 28, 2026 10:20
Leo-Besancon
left a comment
Member
There was a problem hiding this comment.
Some inline comments, otherwise LGTM!
Leo-Besancon
previously approved these changes
Sep 28, 2026
Leo-Besancon
left a comment
Member
There was a problem hiding this comment.
Left a nit, but not blocking: approving.
peterjah
force-pushed
the
5284-paginated-ds-keys
branch
from
September 28, 2026 13:51
81a382e to
d2357de
Compare
peterjah
approved these changes
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exploratory implementation for massalabs/massa#5284 (part (a) of massalabs/massa#5241).Addsget_keys_paginated/get_keys_for_paginatedto theInterfacetrait (prefix filter, exclusivestart_aftercursor, mandatorycount), the matchingassembly_script_get_keys_paginated[_for]host functions, gas cost entries (provisional values mirrored from the existing key ABIs — real calibration is tracked massa-side), and unit tests for the pagination param mapping.Deliberately out of scope here: wasmv1.GetDsKeysRequestlives in massa-proto-rs, so paginating wasmv1 would pull a third repo into this change — that keep-or-cut decision is tracked on massalabs/massa#5284.Draft until the massa-side integration and review feedback settle the shape (in particular whether part (c) metering needs the scanned-key count to cross this same trait boundary, to avoid a second migration).##UPDATE
Adds paginated AssemblyScript datastore-key ABIs, activated with massa MIP-0002.
assembly_script_get_keys_paginatedandassembly_script_get_keys_for_paginatedtake an optionalprefix, an exclusivestart_keycursor, and a mandatorycountin1..=500(MAX_DATASTORE_KEYS_PAGE).PAGINATED_DS_KEYS_EXECUTION_VERSION, an alias of the MIP-0002 wasmv1-disable version. Before that, or if the host cannot report a version, the imports are absent, so instantiation fails the same way as on a node that does not have them.190000gas. That covers the worst page the cap allows: 500 keys of 255 bytes (117k + 500 × 255 × 0.55 ≈ 187k).The existing
get_keys/get_keys_forimports stay registered. The wasmv1 datastore-key ABI is unchanged.