Skip to content

refactor: name decided contract state explicitly - #23

Open
MuncleUscles wants to merge 1 commit into
v0.3-devfrom
pr/v0.3/refactor/latest-decided-state
Open

refactor: name decided contract state explicitly#23
MuncleUscles wants to merge 1 commit into
v0.3-devfrom
pr/v0.3/refactor/latest-decided-state

Conversation

@MuncleUscles

@MuncleUscles MuncleUscles commented Aug 14, 2026

Copy link
Copy Markdown
Member

What changed

  • rename public storage modes to LatestFinalized and LatestDecided
  • keep wire values 1 and 2 unchanged
  • preserve LatestFinal / LatestNonFinal as deprecated Rust/Python/serde aliases
  • make contract views default explicitly to LATEST_DECIDED
  • align executor internals and nested-call conversion with the canonical names

Why

The old LatestNonFinal name exposed the accepted-queue implementation and became misleading once finalized transactions moved out of that queue. The requested state view is the latest state-changing decided transaction: newest accepted effect first, otherwise the latest finalized effect.

Compatibility

No ABI value changes. Existing source and serialized names remain valid aliases.

Dependency

Depends on genlayerlabs/genvm-manager#25 for the shared generator and nested-call enum aliases.

Validation

  • generated Rust and Python files exactly match the updated manager generator
  • Rust SDK compatibility test passed
  • Python alias/default-view assertions passed
  • full optimized arm64 v0.3-dev executor build passed through the updated manager umbrella

Summary by CodeRabbit

  • Updates

    • Renamed storage state options to latest_finalized and latest_decided for clearer terminology.
    • Legacy names latest_final and latest_non_final remain supported as deprecated aliases for compatibility.
    • View operations now default to the latest decided state.
    • Storage-state conversions and nested execution behavior now consistently use the updated names.
  • Tests

    • Added coverage for new values, legacy aliases, serialization, and default view behavior.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: aaae58df-fb7a-4b1f-b33b-fba3732c6a9a

📥 Commits

Reviewing files that changed from the base of the PR and between ef7dd2f and 968538d.

📒 Files selected for processing (10)
  • executor/codegen/data/public-abi.json
  • executor/crates/sdk-rs/src/abi/consts.rs
  • executor/crates/sdk-rs/src/abi/mod.rs
  • executor/src/host/mod.rs
  • executor/src/lib.rs
  • executor/src/runners/mod.rs
  • executor/src/wasi/genlayer_sdk/run.rs
  • runners/genlayer-py-std/src/genlayer/contract/__init__.py
  • runners/genlayer-py-std/src/genlayer/vm/public_abi.py
  • runners/genlayer-py-std/tests/test_public_abi.py

📝 Walkthrough

Walkthrough

The storage type ABI now uses latest_finalized and latest_decided, with legacy aliases preserved. Rust and Python definitions, executor mappings, defaults, and tests use the renamed states.

Changes

Storage type alignment

Layer / File(s) Summary
ABI names and compatibility
executor/codegen/data/public-abi.json, executor/crates/sdk-rs/src/abi/..., runners/genlayer-py-std/src/genlayer/vm/public_abi.py, .../tests/test_public_abi.py
The ABI definitions use finalized and decided names. Rust and Python retain legacy aliases. Tests cover values, conversions, aliases, and legacy deserialization.
Executor state mapping
executor/src/lib.rs, executor/src/runners/mod.rs, executor/src/wasi/genlayer_sdk/run.rs, executor/src/host/mod.rs
Nested execution, chain-state conversion, child runner handling, runner identifiers, and related tests use the renamed storage states.
View default state
runners/genlayer-py-std/src/genlayer/contract/__init__.py
Proxy.view and _ContractAt.view now default to StorageType.LATEST_DECIDED.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 96853

The PR clarifies decided-state names while preserving wire values and deprecated aliases, and explicitly sets contract views to the intended default. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: explicitly naming the decided contract state while refactoring storage modes.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr/v0.3/refactor/latest-decided-state

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

1 participant