Skip to content

Add snapshots#4

Draft
rmgaray wants to merge 3 commits into
milestone3from
rmgaray/add-snapshots
Draft

Add snapshots#4
rmgaray wants to merge 3 commits into
milestone3from
rmgaray/add-snapshots

Conversation

@rmgaray
Copy link
Copy Markdown
Collaborator

@rmgaray rmgaray commented May 7, 2026

Overview

This PR adds snapshots to the execution of all MeTTa programs. It brings a set of changes to how MeTTa programs are run from Rholang as well.

  • MeTTa programs must now have a main entrypoint which takes one parameter. This parameter is currently set to dummy, so it should not be inspected by the MeTTa program.
  • All MeTTa programs are now executed inside a PeTTa session, which is located under the petta_sessions directory. The name of the session is the Blake2B-256 hash of the program's contents.
  • MeTTa programs provided from Rholang are automatically injected with snapshots at every X inferences (see the implementation of petta_lib_snapshot).
  • Session folders live only as much as necessary: if a MeTTa program succeeds or fails in any expected way (i.e: by producing some IntepreterError) the session is promptly cleaned. They will also be cleaned if the f1r3node panics, which may be desirable or not.

@rmgaray rmgaray changed the title Rmgaray/add snapshots Add snapshots May 8, 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.

1 participant