Skip to content

[pallet-revive] add get_storage_var_key for variable-sized keys#8274

Merged
athei merged 3 commits intoparitytech:masterfrom
voliva:revive-storage-var-key
Apr 23, 2025
Merged

[pallet-revive] add get_storage_var_key for variable-sized keys#8274
athei merged 3 commits intoparitytech:masterfrom
voliva:revive-storage-var-key

Conversation

@voliva
Copy link
Copy Markdown
Contributor

@voliva voliva commented Apr 17, 2025

Description

Fixes #8253

This adds a new runtime ReviveApi call get_storage_var_key, which does the same as get_storage, but for variable-sized keys, which are still being used by ink!v6 and use a different hashing function than the fixed-size 32-byte keys.

I've considered changing the API of get_storage to support both type of keys, but on the issue discussion it was said that it would be better to add a new runtime call.

Integration

With the following runtime upgrade, all chains using revive should support it by default, as the low-level storage access already supports both types of keys. It was only the runtime call that was not exposing that properly.

The trait pallet_revive::ReviveApi has changed to include the new runtime call, to implement it just relay the call to Revive::get_storage_var_key.

Checklist

  • My PR includes a detailed description as outlined in the "Description" and its two subsections above.
  • My PR follows the labeling requirements of this project (at minimum one label for T required)
    • External contributors: ask maintainers to put the right label on your PR.

@voliva voliva changed the title revive: add get_storage_var_key for variable-sized keys [pallet-revive] add get_storage_var_key for variable-sized keys Apr 17, 2025
@voliva voliva force-pushed the revive-storage-var-key branch from c738efd to bd56bf9 Compare April 17, 2025 13:48
@voliva voliva marked this pull request as ready for review April 17, 2025 13:56
@voliva
Copy link
Copy Markdown
Contributor Author

voliva commented Apr 22, 2025

@athei @pgherveou I think this is ready for review.

If there's anything I missed please let me know.

@pgherveou pgherveou added the T7-smart_contracts This PR/Issue is related to smart contracts. label Apr 22, 2025
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
@athei athei added this pull request to the merge queue Apr 23, 2025
Merged via the queue into paritytech:master with commit 0fa1b00 Apr 23, 2025
231 of 244 checks passed
@voliva voliva deleted the revive-storage-var-key branch April 23, 2025 13:32
ordian added a commit that referenced this pull request Apr 28, 2025
* master: (120 commits)
  [CI] Improve GH build status checking (#8331)
  [CI/CD] Use original PR name in prdoc check for the backport PR's to the stable branches (#8329)
  Add new host APIs set_storage_or_clear and get_storage_or_zero (#7857)
  push to dockerhub (#8322)
  Snowbridge - V1 - Adds 2 hop transfer to Rococo (#7956)
  [AHM] Prepare `election-provider-multi-block` for full lazy data deletion (#8304)
  Check umbrella version (#8250)
  [AHM] Fully bound staking async (#8303)
  migrate parachain-templates tests to `gha` (#8226)
  staking-async: add missing new_session_genesis (#8310)
  New NFT traits: granular and abstract interface (#5620)
  Extract create_pool_with_native_on macro to common crate (#8289)
  XCMP: use batching when enqueuing inbound messages (#8021)
  Snowbridge - Tests refactor (#8014)
  Allow configuration of worst case buy execution weight (#7944)
  Fix faulty pre-upgrade migration check in pallet-session (#8294)
  [pallet-revive] add get_storage_var_key for variable-sized keys (#8274)
  add poke_deposit extrinsic to pallet-recovery (#7882)
  `txpool`: use tracing for structured logging (#8001)
  [revive] eth-rpc refactoring (#8148)
  ...
castillax pushed a commit that referenced this pull request May 12, 2025
# Description

Fixes #8253 

This adds a new runtime ReviveApi call `get_storage_var_key`, which does
the same as `get_storage`, but for variable-sized keys, which are still
being used by ink!v6 and use a different hashing function than the
fixed-size 32-byte keys.

I've considered changing the API of `get_storage` to support both type
of keys, but on the issue discussion it was said that it would be better
to add a new runtime call.

## Integration

With the following runtime upgrade, all chains using revive should
support it by default, as the low-level storage access already supports
both types of keys. It was only the runtime call that was not exposing
that properly.

The trait `pallet_revive::ReviveApi` has changed to include the new
runtime call, to implement it just relay the call to
`Revive::get_storage_var_key`.

# Checklist

* [x] My PR includes a detailed description as outlined in the
"Description" and its two subsections above.
* [ ] My PR follows the [labeling requirements](

https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process
) of this project (at minimum one label for `T` required)
* External contributors: ask maintainers to put the right label on your
PR.

---------

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
@AlexD10S
Copy link
Copy Markdown
Contributor

AlexD10S commented Jun 4, 2025

Hey! Just checking, will this be part of the next release? I noticed it’s not included in stable2503-5 (link).

@athei
Copy link
Copy Markdown
Member

athei commented Jun 4, 2025

It didn't make the cutoff. It will be in 2506.

@Polkadot-Forum
Copy link
Copy Markdown

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/sponsorship-for-active-devs-and-community-members-during-polkadot-symbiosis-in-buenos-aires/14723/92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T7-smart_contracts This PR/Issue is related to smart contracts.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[revive] ReviveApi_get_storage doesn't accept 4-byte keys

5 participants