Skip to content

Keep the simulation running while player contract acceptance is saved - #186

Open
viktor-ferenczi wants to merge 11 commits into
codex/se-1909-contract-acceptancefrom
codex/se-1909-deferred-contract
Open

viktor-ferenczi wants to merge 11 commits into
codex/se-1909-contract-acceptancefrom
codex/se-1909-deferred-contract

Conversation

@viktor-ferenczi

@viktor-ferenczi viktor-ferenczi commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Accepting a contract at a block used to stop the simulation thread until a recoverable World Authority save contained the acceptance. The node now waits for an exclusive offer reservation on a worker. Vanilla checks eligibility and grants the contract on the simulation thread once the reservation is durable. The payment journal records the confirmation decision in the same append as the collateral commit. A restarted origin can confirm a completed grant or release an unused reservation.

Linux validation

  • Stock timed out on a one-second game-thread read during a withheld reply. The candidate answered in 18.13 ms while the offer was still reserved.
  • All 32 two-client checks passed with a competing acceptance, a dropped response, a fresh replacement World Authority, and delivery on another node. The winning player received one package and paid collateral once. A separate item acquisition contract of the production type activated with zero collateral and no balance change.
  • Three identical requests from the same player produced one acceptance reply. The server sent no early reply during reservation or between the local grant and confirmation. A nested activation scope check verified that an inner callback cannot dispose the outer deposit. A restart check verified that an origin with a recorded release decision sends no new reservation request.
  • Killing the origin before the grant passed 13/13 checks. Its reservation was released, its balance was unchanged, and its original character had no package.
  • Killing the origin after its synchronous collateral commit and a player checkpoint passed 14/14 checks. Recovery confirmed the owner and the same character retained one package. Its balance changed from 110,000 to 109,800.

These tests cover process restarts with the origin's data retained. Recovery requires its intent and payment journal. The checkpointed character retained its package. In a separate comparison, stock 0.3.34 and the candidate both lost the package when the origin restarted from a character checkpoint taken before the grant. Both retained the active contract and the 200-credit debit. The separate inventory defect is tracked in SE-1923. SE-1909

@viktor-ferenczi
viktor-ferenczi marked this pull request as ready for review November 25, 2026 04:36
@viktor-ferenczi
viktor-ferenczi marked this pull request as draft November 25, 2026 05:03
@viktor-ferenczi
viktor-ferenczi force-pushed the codex/se-1909-contract-acceptance branch from 4d2e713 to 49e8549 Compare November 25, 2026 05:04
@viktor-ferenczi
viktor-ferenczi force-pushed the codex/se-1909-deferred-contract branch from b9cf752 to 1d2826f Compare November 25, 2026 05:04
@viktor-ferenczi
viktor-ferenczi marked this pull request as ready for review November 25, 2026 05:28
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