Skip to content

feat(move): expose fee payer in move context#523

Merged
beer-1 merged 1 commit into
mainfrom
feat/move-fee-payer-context
May 28, 2026
Merged

feat(move): expose fee payer in move context#523
beer-1 merged 1 commit into
mainfrom
feat/move-fee-payer-context

Conversation

@beer-1
Copy link
Copy Markdown
Member

@beer-1 beer-1 commented May 28, 2026

Description

Closes: N/A

This PR wires movevm v1.3.0's Env.FeePayer support into Initia's Move execution path.

What changed:

  • Updates github.com/initia-labs/movevm and the Docker LIBMOVEVM_VERSION to v1.3.0.
  • Renames the ante decorator from gas-prices-specific naming to MoveContextDecorator, with deprecated GasPricesDecorator aliases kept for compatibility.
  • Sets Move context values in ante: gas prices for non-simulation execution and fee payer for all modes.
  • Passes the fee payer from context into types.NewEnv for entry functions, scripts, views, and account abstraction authentication.
  • Adds a Move TxContextTests test module and a keeper regression test that executes store_fee_payer, reads the stored value back with a view function, and compares it with the expected fee payer.

Validation:

  • go test ./x/move/keeper -run TestExecuteEntryFunctionWithFeePayer -count=1
  • go test ./x/move/...
  • go test ./app/ante

Author Checklist

I have...

  • included the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change (not applicable)
  • targeted the correct branch (main)
  • provided a link to the relevant issue or specification (movevm PR: feat: expose transaction_context::fee_payer and senders to Move movevm#252)
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

This PR adds fee payer awareness to the Move VM execution environment by replacing the standalone GasPricesDecorator with a unified MoveContextDecorator that handles both gas price and fee payer context injection. The fee payer is threaded through all Move environment initialization calls and made available to Move code via initia_std::transaction_context::fee_payer(). A Dockerfile dependency is also bumped to libmovevm v1.3.0.

Changes

Fee payer context enrichment for Move VM

Layer / File(s) Summary
Context keys and environment contract
x/move/types/keys.go, x/move/types/env.go
Adds FeePayerContextKey context key and FeePayer(ctx) helper function. Updates NewEnv signature to accept an optional feePayer *vmtypes.AccountAddress parameter and populates the returned environment's FeePayer field.
MoveContextDecorator ante handler
x/move/ante/move_context.go
Introduces MoveContextDecorator that validates sdk.FeeTx transactions, computes and stores truncated gas prices in context, converts the fee payer address to Move VM AccountAddress format and stores it under FeePayerContextKey. Includes deprecated GasPricesDecorator and NewGasPricesDecorator aliases for backward compatibility.
Ante handler chain updates
app/ante/ante.go, app/ante/minimal.go
Replaces moveante.NewGasPricesDecorator() with moveante.NewMoveContextDecorator() in both the full and minimal ante handler chains.
Move environment propagation
x/move/keeper/account_abstraction.go, x/move/keeper/handler.go, x/move/keeper/genesis.go
Updates all types.NewEnv calls in entry function execution, script execution, view function execution, and genesis initialization to pass types.FeePayer(ctx) as the fee payer argument.
MoveContextDecorator test coverage
x/move/ante/move_context_test.go
Replaces TestGasPricesDecorator with TestMoveContextDecorator. Adds vmtypes import and requireFeePayer helper; verifies gas prices context behavior in simulation vs. normal mode and asserts fee payer address is correctly stored and retrievable via movetypes.FeePayer(ctx).
Fee payer integration tests
x/move/keeper/common_test.go, x/move/keeper/contracts/sources/TxContextTests.move, x/move/keeper/transaction_context_test.go
Introduces new Move test module TestAccount::TxContextTests with FeePayerStore key resource and functions to store/read fee payer values. Adds test fixtures in common_test.go to load the module. Includes end-to-end test TestExecuteEntryFunctionWithFeePayer that injects fee payer into context, invokes the store function, and verifies correct retrieval via the view function.
Build infrastructure
Dockerfile
Bumps LIBMOVEVM_VERSION from v1.2.0 to v1.3.0 for the Alpine builder stage.

🎯 3 (Moderate) | ⏱️ ~25 minutes

A decorator now brings context cheer,
Fee payer whispers, crystal clear,
Through Move's machine the context flows,
Where gas prices and addresses go,
Consolidation hops and bounds—
One handler wears the finest crowns! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the main change: exposing the fee payer in the Move context, which is the primary objective of this PR.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, explaining the what, why, and how of the fee payer context changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/move-fee-payer-context

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 1 package(s) with unknown licenses.
See the Details below.

License Issues

go.mod

PackageVersionLicenseIssue Type
github.com/initia-labs/movevm1.3.0NullUnknown License
Allowed Licenses: Apache-2.0, MIT, BSD-2-Clause, BSD-3-Clause, ISC, Unlicense, CC0-1.0, Zlib, MIT-0, PostgreSQL, BSL-1.0, MPL-2.0, LGPL-2.1-only, LGPL-2.1-or-later, LGPL-3.0-only, LGPL-3.0-or-later, LicenseRef-scancode-google-patent-license-golang
Excluded from license check: pkg:golang/github.com/initia-labs/store, pkg:golang/github.com/initia-labs/store/memiavl, pkg:golang/github.com/initia-labs/store/versiondb

OpenSSF Scorecard

PackageVersionScoreDetails
gomod/github.com/initia-labs/movevm 1.3.0 UnknownUnknown

Scanned Files

  • go.mod

@beer-1 beer-1 force-pushed the feat/move-fee-payer-context branch from baaed66 to 18ac12e Compare May 28, 2026 07:19
@beer-1 beer-1 marked this pull request as ready for review May 28, 2026 07:22
@beer-1 beer-1 requested a review from a team as a code owner May 28, 2026 07:22
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
Dockerfile (1)

12-12: Ensure LIBMOVEVM_VERSION=v1.3.0 has required movevm release artifacts

  • Docker pulls libmovevm_muslc.${ARCH}.a and libcompiler_muslc.${ARCH}.a from initia-labs/movevm release v1.3.0, and the Go module bump to v1.3.0 is consistent.
  • The movevm release v1.3.0 includes all required muslc static libraries: libmovevm_muslc.{x86_64,aarch64}.a and libcompiler_muslc.{x86_64,aarch64}.a.
  • SHA256 verification commands in the Dockerfile remain commented out (optional hardening, but pre-existing).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Dockerfile` at line 12, Confirm that the Dockerfile's ENV
LIBMOVEVM_VERSION=v1.3.0 points to a release that contains the required muslc
static libraries; check the `initia-labs/movevm` release v1.3.0 for the
artifacts `libmovevm_muslc.x86_64.a`, `libmovevm_muslc.aarch64.a`,
`libcompiler_muslc.x86_64.a`, and `libcompiler_muslc.aarch64.a`; if any are
missing, update ENV LIBMOVEVM_VERSION to a release that includes them or add the
missing artifacts to the build source, and optionally re-enable and update the
commented SHA256 verification commands in the Dockerfile to validate those
downloaded files.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@x/move/keeper/contracts/sources/TxContextTests.move`:
- Line 10: The test calls transaction_context::fee_payer() which doesn't exist
in initia_std; either update the test to call the correct exported accessor or
add the missing export. Locate the transaction context module
(initia_std::transaction_context) and either (A) change the call in
TxContextTests.move from transaction_context::fee_payer() to the actual provided
API (e.g., the existing getter name such as get_fee_payer or fee_payer_address —
confirm by searching for functions returning Option<address> in
transaction_context), or (B) if the intended API is missing, add and export a
public function fee_payer(): Option<address> in initia_std::transaction_context
that returns the fee payer from the internal context so the test can call
transaction_context::fee_payer().

---

Nitpick comments:
In `@Dockerfile`:
- Line 12: Confirm that the Dockerfile's ENV LIBMOVEVM_VERSION=v1.3.0 points to
a release that contains the required muslc static libraries; check the
`initia-labs/movevm` release v1.3.0 for the artifacts
`libmovevm_muslc.x86_64.a`, `libmovevm_muslc.aarch64.a`,
`libcompiler_muslc.x86_64.a`, and `libcompiler_muslc.aarch64.a`; if any are
missing, update ENV LIBMOVEVM_VERSION to a release that includes them or add the
missing artifacts to the build source, and optionally re-enable and update the
commented SHA256 verification commands in the Dockerfile to validate those
downloaded files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cc5320c6-1acc-4c89-a962-b76ba4810b94

📥 Commits

Reviewing files that changed from the base of the PR and between fc6ecf9 and 18ac12e.

⛔ Files ignored due to path filters (2)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (15)
  • Dockerfile
  • app/ante/ante.go
  • app/ante/minimal.go
  • x/move/ante/gas_prices.go
  • x/move/ante/move_context.go
  • x/move/ante/move_context_test.go
  • x/move/keeper/account_abstraction.go
  • x/move/keeper/binaries/TxContextTests.mv
  • x/move/keeper/common_test.go
  • x/move/keeper/contracts/sources/TxContextTests.move
  • x/move/keeper/genesis.go
  • x/move/keeper/handler.go
  • x/move/keeper/transaction_context_test.go
  • x/move/types/env.go
  • x/move/types/keys.go
💤 Files with no reviewable changes (1)
  • x/move/ante/gas_prices.go

Comment thread x/move/keeper/contracts/sources/TxContextTests.move
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 67.50000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.41%. Comparing base (b2f3bc0) to head (18ac12e).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
x/move/ante/move_context.go 56.00% 8 Missing and 3 partials ⚠️
app/ante/ante.go 0.00% 1 Missing ⚠️
app/ante/minimal.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #523      +/-   ##
==========================================
+ Coverage   38.40%   38.41%   +0.01%     
==========================================
  Files         327      327              
  Lines       30676    30685       +9     
==========================================
+ Hits        11782    11789       +7     
- Misses      17004    17006       +2     
  Partials     1890     1890              
Files with missing lines Coverage Δ
x/move/keeper/account_abstraction.go 67.44% <100.00%> (ø)
x/move/keeper/genesis.go 11.03% <100.00%> (-2.26%) ⬇️
x/move/keeper/handler.go 81.44% <100.00%> (ø)
x/move/types/env.go 100.00% <100.00%> (ø)
x/move/types/keys.go 41.86% <100.00%> (+9.42%) ⬆️
app/ante/ante.go 0.00% <0.00%> (ø)
app/ante/minimal.go 0.00% <0.00%> (ø)
x/move/ante/move_context.go 56.00% <56.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@traviolus traviolus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@beer-1 beer-1 merged commit aa074b0 into main May 28, 2026
14 checks passed
@beer-1 beer-1 deleted the feat/move-fee-payer-context branch May 28, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants