Skip to content

feat(evm): migrate storageprovider precompile to native runtime base#338

Merged
phenix3443 merged 1 commit into
precompile-integrationfrom
precompile/storageprovider-native
Jul 14, 2026
Merged

feat(evm): migrate storageprovider precompile to native runtime base#338
phenix3443 merged 1 commit into
precompile-integrationfrom
precompile/storageprovider-native

Conversation

@phenix3443

Copy link
Copy Markdown
Contributor

What

Part of subtask 3 (storage-series) of the precompile → cosmos/evm native-mode migration. Migrates the storageprovider precompile onto x/evm/precompiles/base.

Changes

  • Contract embeds base.Precompile; Run delegates to RunPrecompile; dispatch moves to Execute (existing handler map + base Dispatch/SetupABI for routing and read-only write protection).
  • Dropped the hand-rolled cache-context / snapshot / commit template.
  • IsTransaction is derived from ABI mutability (!method.IsConstant()) — uniform rule reused across the remaining precompiles.
  • Runtime alignment only: EOA-only guards and per-handler readonly checks kept; no balance handler (updateSPPrice moves no bank coins).

Behavior change (native revert semantics)

Same as bank #337: failures now revert with the reason ABI-encoded in the return data. The storageprovider baseline TestUpdateSPPrice_FailureDoesNotMutateState (merged in #334) is updated to decode StorageProvider does not exist via abi.UnpackRevert(res.Ret); the state-invariant and EOA-only assertions are unchanged.

Tests

  • go test ./x/evm/precompiles/storageprovider -count=1 → ok.
  • Base branch is precompile-integration.

Move the storageprovider precompile onto x/evm/precompiles/base:
- embed base.Precompile; Run delegates to RunPrecompile; dispatch moves to
  Execute using the existing handler map, method routing + read-only write
  protection via the base Dispatch (SetupABI) with IsTransaction
- drop the hand-rolled cache-context / snapshot / commit template
- IsTransaction is derived from ABI mutability (!method.IsConstant())

Runtime alignment only: EOA-only guards and per-handler readonly checks are
kept; no balance handler is wired (updateSPPrice moves no bank coins).

The storageprovider baseline failure test is updated for native revert
semantics: the "StorageProvider does not exist" reason is now decoded from
the revert return data via abi.UnpackRevert.
@phenix3443 phenix3443 merged commit 47326aa into precompile-integration Jul 14, 2026
3 of 10 checks passed
@phenix3443 phenix3443 deleted the precompile/storageprovider-native branch July 14, 2026 04:09
@github-actions github-actions Bot added the tests label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant