You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the first iteration, use functions consistent with transaction kernel's:
set_storage_item / get_storage_item for getting/setting value slots.
set_storage_map_item / get_storage_map_item for reading, updating storage maps.
Also, if we could encapsulate them in a module, that may be slightly better ergonomics. For example, storage::get_item, storage::set_item, storage::get_map_item, storage::set_map_item.
The storage metadata in the toml format is described in 0xPolygonMiden/miden-base#1015 needs to be generated and stored in the Miden package compiled artifact. The attribute macros can generate the metadata, and we can "smuggle" it past the rustc via the custom link_section (as wit-bindgen smuggles WIT binary, see generated bindings.rs) into the compiler.
The text was updated successfully, but these errors were encountered:
For the first iteration, we implement the generic set_storage_value(slot: usize, value: Word) and get_storage_value(slot: usize) -> Word functions and their map and vec variants.
I would probably use naming a bit more consistent with transaction kernel's.
set_storage_item / get_storage_item for getting/setting value slots.
set_storage_map_item / get_storage_map_item for reading updating storage maps.
Also, if we could encapsulate them in a module, that may be slightly better ergonomics. For example, storage::get_item, storage::set_item, storage::get_map_item, storage::set_map_item.
As discussed in #333
And later on the call with @bobbinth, @bitwalker @igamigo @phklive
For the first iteration, use functions consistent with transaction kernel's:
set_storage_item
/get_storage_item
for getting/setting value slots.set_storage_map_item
/get_storage_map_item
for reading, updating storage maps.Also, if we could encapsulate them in a module, that may be slightly better ergonomics. For example,
storage::get_item
,storage::set_item
,storage::get_map_item
,storage::set_map_item
.For the second iteration, we go with macros:
Where the
Value
andStorageMap
implement a trait similar toMapping
from https://github.com/r55-eth/r55/blob/main/eth-riscv-runtime/src/types.rs, so that the storage access will look likeself.pub_key.read()
andself.pub_key.write(value)
.The storage metadata in the
toml
format is described in 0xPolygonMiden/miden-base#1015 needs to be generated and stored in the Miden package compiled artifact. The attribute macros can generate the metadata, and we can "smuggle" it past the rustc via the customlink_section
(as wit-bindgen smuggles WIT binary, see generatedbindings.rs
) into the compiler.The text was updated successfully, but these errors were encountered: