Skip to content

State machine scaffolding#24

Merged
sapinb merged 9 commits intomainfrom
state-machine-scaffolding
Jan 7, 2026
Merged

State machine scaffolding#24
sapinb merged 9 commits intomainfrom
state-machine-scaffolding

Conversation

@sapinb
Copy link
Copy Markdown
Collaborator

@sapinb sapinb commented Jan 2, 2026

Description

scaffolding for state machine integration + some other traits. Still messy, but I'm trying to keep the mess away from the cac protocol state machine.

mosaic-cac-protocol hold the protocol state machines (garbler setup, evaluator setup, garbler deposit, evaluator deposit) and these are based on StateMachineSpec trait. This will only deal with state, inputs and actions.

StateMachineAdaptorSpec impls (1 - 1 with protocol state machines) hold the messier bits of translating between network/job messages and the protocol state machine inputs, actions.

StateMachineExecutor<StateMachineAdaptorSpec> is responsible for running all state machines of a given type and manage its inputs and outputs.

a Router component (TODO) will handle coordination between the 4 types of state machine executors and the other parts of the system (rpc, p2p, jobs)

Storage is currently divided into 2 parts: StateMachineDb and JobStateDb.
A third storage, ArtifactDb may be required if storing ~200mb blobs (adaptors, polynomial commitments) in the state directly proves problematic.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency update
  • Security fix

Notes to Reviewers

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

Related Issues

@sapinb sapinb force-pushed the state-machine-scaffolding branch from 2b8a2a8 to 76f7b84 Compare January 4, 2026 20:39
@sapinb sapinb marked this pull request as ready for review January 7, 2026 09:29
Fix other lints.

Note: not everything needs to be boxed, but doing so for simplicity.
Smaller values should be used directly here.
@sapinb sapinb force-pushed the state-machine-scaffolding branch from 48f8351 to b65ba8a Compare January 7, 2026 10:45
@sapinb sapinb merged commit af03d7c into main Jan 7, 2026
10 checks passed
@storopoli storopoli deleted the state-machine-scaffolding branch January 9, 2026 12:05
@Zk2u Zk2u added this to the Service Production Ready milestone Feb 11, 2026
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