Skip to content

rholang: add opt-in split LogicT post-match execution runtime with persisted continuations#457

Open
machieke wants to merge 17 commits intoF1R3FLY-io:rust/devfrom
asi-alliance:experimental/logicT-execution-runtime
Open

rholang: add opt-in split LogicT post-match execution runtime with persisted continuations#457
machieke wants to merge 17 commits intoF1R3FLY-io:rust/devfrom
asi-alliance:experimental/logicT-execution-runtime

Conversation

@machieke
Copy link
Copy Markdown
Contributor

Summary

This PR merges asi/experimental/logicT-execution-runtime into origin/rust/dev and introduces an experimental, opt-in split execution runtime for post-match continuation processing in Rholang.

The new runtime path is gated by SplitPostMatchConfig.enabled and remains disabled by default, preserving existing behavior unless explicitly enabled.

Diff size: 15 files changed, +5555 / -279.

Why

Post-match continuation execution currently runs in a single flow. This change introduces a deterministic step-based model that can:

  • bound execution by step gas limits
  • persist suspended execution state
  • resume execution safely with optimistic version checks
  • support executor-facing continuation queues and bridge-specific scheduling hooks

What changed

1. Split post-match execution model (feature-gated)

  • Added explicit post-match execution state and control states.
  • Added internal reduce_step(exec_state, gas_limit) stepping with terminal outcomes:
    • Completed
    • Suspended
  • Added compatibility path for full execution and equivalence coverage.

2. Continuation persistence layer

  • Added dedicated in-memory continuation store with lifecycle support:
    • create, load, update, complete, expire, fail
  • Persisted continuation schema includes:
    • handle (origin + nonce)
    • serialized state
    • per-step gas limit
    • funding policy and visibility
    • optional bounty and TTL-derived expiry
    • subtype metadata (Standard / Bridge)
    • status, version, state root, storage bytes
  • Added optimistic concurrency/version mismatch protection.
  • Added snapshot/restore support for recovery validation.

3. Runtime continuation APIs

  • Added reducer APIs for continuation management and execution:
    • queue/list/load/epoch-expiry operations
    • execute_continuation
    • execute_public_continuation
    • bridge execution helpers:
      • queue by deadline / reward
      • rescue candidates
      • phase updates
      • execute-next scheduling hooks

4. Funding, visibility, and bridge subtype support

  • Added:
    • FundingPolicy::{ProducerOnly, ExecutorPays}
    • ContinuationVisibility::{Private, Public}
    • bridge metadata/finality/reward policy structures
  • Public executor flow enforces eligibility checks (public + executor-funded).
  • Bridge queue ordering supports deadline and reward priority paths.

5. Operational hardening and observability

  • Added continuation safety caps:
    • max serialized state size: 128 KiB
    • max branch fan-out: 128
  • Added deterministic epoch-based expiry sweeps.
  • Added continuation and bridge metrics for creation, resume outcomes, gas-per-step, expiry, and queue/execute requests.

6. Tests

  • Expanded reducer and integration coverage for:
    • split enabled/disabled behavior
    • deferred follow-up persistence + resume semantics
    • stale version / invalid handle rejection
    • deterministic replay/idempotent retry behavior
    • public executor policy enforcement
    • private/TTL expiry behavior
    • bridge metadata/queue ordering/scheduler hooks
  • Added continuation store tests for:
    • serialization round-trip and tamper detection
    • versioning and state-root transitions
    • storage accounting
    • expiry and epoch regression
    • snapshot/restore behavior

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