-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Replace old storage API with the new one explained in the StorageKey
RFC
#4464
Conversation
StorageKey
RFC
8aa8c48
to
b84161a
Compare
a2165ab
to
c246e05
Compare
e7c87ae
to
ab88253
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one @mohammadfawaz, great to see how much this simplifies! Loving these detailed docs with examples too - good motivation to address #3176. I just left a couple Qs/suggestions but no blockers.
test/src/e2e_vm_tests/test_programs/should_fail/generics_in_contract/src/main.sw
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super impressive work, thanks boss :)
Description
Implement FuelLabs/sway-rfcs#23
Closes #3419 (technically via the RFC)
Closes #3202
Closes #3043
Closes #2639
Closes #2465
Closes #4304
This is a big one but mostly removes stuff. It's hard to review but the summary of changes below should be sufficient. Most of the changes here are things that I just had to do to make CI pass.
--experimental-storage
flag and made its behavior the default. Also removed everything that was required for the previous storage APIs in favour of the new ones.std::storage
into multiple submodules:storage_key
implements the API forstd::core::StorageKey
storage_api
implements the free functionsread
(previouslyget
),write
(previouslystore
), andclear
.StorageKey
API.#[storage(write)]
now allows reading from storage as well. This is needed because the way we pack structs in storage now requires that we sometimes read from storage first if we were to write a portion of a slot.__get_storage_key
intrinsic and theget_storage_key
IR instruction and all corresponding tests. Also removed thestate_index
metadata as it is no longer required.Checklist
Breaking*
orNew Feature
labels where relevant.