Skip to content

Feature/runtime/persistency#3

Merged
0xwonj merged 33 commits intomainfrom
feature/runtime/persistency
Oct 17, 2025
Merged

Feature/runtime/persistency#3
0xwonj merged 33 commits intomainfrom
feature/runtime/persistency

Conversation

@0xwonj
Copy link
Owner

@0xwonj 0xwonj commented Oct 17, 2025

No description provided.

0xwonj and others added 30 commits October 15, 2025 07:55
- Add persistence configuration to RuntimeConfig (enable_persistence, persistence_base_dir, session_id)
- Add RuntimeBuilder methods for persistence settings (enable_persistence, session_id, persistence_dir)
- Implement PersistenceWorker creation in Runtime::build() when enabled
- Implement ProverWorker creation that reads from same action log file
- ProverWorker now uses FileActionLog::open() to read from PersistenceWorker's output
- Add proper worker shutdown handling for persistence_worker_handle
- Add new RuntimeError variants: InvalidConfig, InvalidEntityId, MissingProvider
- Remove unused imports from prover.rs (Tick, ActionRepository)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Critical bug fixes:
- Fix ProverWorker offset tracking (was skipping entries by jumping to EOF)
- Add flush after action log append to prevent race conditions
- Implement real state hash using bincode serialization
- Fix checkpoint serialization by switching from JSON to bincode

Environment and configuration:
- Add dotenvy for .env file loading
- Implement all environment variables (ENABLE_PERSISTENCE, ENABLE_ZK_PROVING, GAME_SESSION_ID, SAVE_DATA_DIR, CHECKPOINT_INTERVAL)
- Use directories crate for platform-specific system directories
- Add checkpoint interval configuration

Proof tracking improvements:
- Add proof index persistence in ProverWorker
- Create dedicated directories for proof_indices/ and proofs/
- Add before/after state hashes to proof generated logs
- Track proof file metadata (filename, size)

Logging improvements:
- Implement file logging with tracing-appender
- Remove stderr output to prevent TUI interference
- Add session-specific log directories

Code quality:
- Fix all clippy warnings (unused imports, auto-deref, collapsed ifs)
- Derive Default for CliConfig instead of manual implementation
- Add #[allow(dead_code)] for hash_proof_data utility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ilds

The RISC0_SKIP_BUILD environment variable in .cargo/config.toml was
preventing risc0_build::embed_methods() from compiling the guest program,
resulting in "Malformed ProgramBinary" errors at runtime.

Root cause: build.rs checks env::var("RISC0_SKIP_BUILD").is_ok(), which
returns true if the variable exists with ANY value (including "0").

Solution: Remove RISC0_SKIP_BUILD from cargo config entirely. Developers
can use `RISC0_SKIP_BUILD=1 cargo build` when needed for fast iteration.

Also simplified .env.example documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add convenience script to build only the RISC0 zkVM guest program
without rebuilding the entire workspace.

Usage:
  ./scripts/build-guest.sh          # Debug build
  ./scripts/build-guest.sh --release # Release build

Also updated CLAUDE.md to reflect correct ZK build workflow and
clarify RISC0_SKIP_BUILD usage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@0xwonj 0xwonj self-assigned this Oct 17, 2025
@0xwonj 0xwonj added the enhancement New feature or request label Oct 17, 2025
@0xwonj 0xwonj merged commit 8411b96 into main Oct 17, 2025
8 checks passed
@0xwonj 0xwonj deleted the feature/runtime/persistency branch November 12, 2025 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant