Skip to content

Commit 9ec9bc5

Browse files
vgao1996claude
andcommitted
[mono-move] Typed outcome; mock-providers crate
The executor now concludes transactions in its own typed taxonomy (TxnOutcome = Discarded(DiscardReason) | Committed(CommitStatus + raw effects)) instead of assembling VMStatus along the way. The legacy formats are constructed in exactly one place, the new legacy/ submodule (status projection + output materialization), so the eventual mono-move-native outcome layer only has to replace that seam. The taxonomy makes illegal states unrepresentable: the can't-pay-fee retry signal never reaches DiscardReason, and payload discards carry only the runtime error (aborts always commit). Parity fix found on the way: discard-class payload failures now skip the epilogue and produce an empty output, matching v1's failure cleanup. Structural changes from the same audit round: - SequentialBlockExecutor deleted; block semantics (reconfiguration, block metadata, checkpoints, limits) belong to the Block-STM workstream, obligations documented in AGENTS.md. - lib.rs reduced to declarations/re-exports; the lifecycle driver lives in executor.rs, unmetered framework calls in sys_calls.rs (nee validation.rs), native wiring in natives.rs. - The StateView-backed mock providers move to a new crate, mono-move-aptos-mock-providers, leaving only the AptosDataProvider seam in the executor crate; this drops the aptos-framework and move-bytecode-verifier dependencies from the production surface. - runtime: InterpreterContext::new_idle() for drivers that resolve their first function through the context itself; payload shape and type arguments preflight before the prologue. Differential e2e coverage grows to five cases, including exact-status checks for a nonexistent entry function and the drain-fee-payer epilogue retry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 870cdf6 commit 9ec9bc5

23 files changed

Lines changed: 1593 additions & 1205 deletions

File tree

Cargo.lock

Lines changed: 19 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ members = [
210210
"third_party/move/documentation/framework-book/builder",
211211
"third_party/move/extensions/move-table-extension",
212212
"third_party/move/mono-move/alloc",
213+
"third_party/move/mono-move/aptos-mock-providers",
213214
"third_party/move/mono-move/aptos-transaction-executor",
214215
"third_party/move/mono-move/core",
215216
"third_party/move/mono-move/global-context",
@@ -902,6 +903,7 @@ aptos-position-natives = { path = "aptos-move/framework/position-natives" }
902903
aptos-table-natives = { path = "aptos-move/framework/table-natives" }
903904
legacy-move-compiler = { path = "third_party/move/move-compiler-v2/legacy-move-compiler" }
904905
mono-move-alloc = { path = "third_party/move/mono-move/alloc" }
906+
mono-move-aptos-mock-providers = { path = "third_party/move/mono-move/aptos-mock-providers" }
905907
mono-move-aptos-transaction-executor = { path = "third_party/move/mono-move/aptos-transaction-executor" }
906908
mono-move-core = { path = "third_party/move/mono-move/core" }
907909
mono-move-global-context = { path = "third_party/move/mono-move/global-context" }
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# aptos-mock-providers
2+
3+
Mock `StateView`-backed implementations of the transaction executor's data
4+
traits (`ModuleProvider` for code, `AptosDataProvider` for resources):
5+
reference implementations for sequential execution — tests and replay-style
6+
tools — not the production data layer, which the Block-STM integration
7+
provides behind the same traits.
8+
9+
- `StateViewModuleProvider` serves raw module bytes and package co-membership
10+
(from `PackageRegistry`) to the loader.
11+
- `StateViewResourceProvider` serves resource and table-item reads,
12+
materializing each value from BCS into a long-lived flat-value arena on
13+
first access, and resolves/remembers resource-group placement for write-set
14+
publication.
15+
16+
Everything here trades performance for simplicity: a private per-provider
17+
arena that is never collected, whole-group blob caching, and group-membership
18+
resolution by deserializing the defining module. The production
19+
implementations own these concerns at the block level (versioned caches,
20+
granular group support).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CLAUDE.md
2+
3+
See [AGENTS.md](AGENTS.md) for crate documentation.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[package]
2+
name = "mono-move-aptos-mock-providers"
3+
description = "Mock StateView-backed data providers for the MonoMove Aptos transaction executor."
4+
version = "0.1.0"
5+
6+
# Workspace inherited keys
7+
authors = { workspace = true }
8+
edition = { workspace = true }
9+
homepage = { workspace = true }
10+
license = { workspace = true }
11+
publish = { workspace = true }
12+
repository = { workspace = true }
13+
rust-version = { workspace = true }
14+
15+
[dependencies]
16+
anyhow = { workspace = true }
17+
aptos-framework = { workspace = true }
18+
aptos-types = { workspace = true }
19+
bcs = { workspace = true }
20+
bytes = { workspace = true }
21+
mono-move-aptos-transaction-executor = { workspace = true }
22+
mono-move-core = { workspace = true }
23+
mono-move-global-context = { workspace = true }
24+
mono-move-runtime = { workspace = true }
25+
move-binary-format = { workspace = true }
26+
move-bytecode-verifier = { workspace = true }
27+
move-core-types = { workspace = true }

0 commit comments

Comments
 (0)