Skip to content

feat(vault): support configurable ENVECTOR_EVAL_MODE (rmp/mm)#60

Open
heeyeon01 wants to merge 7 commits intomainfrom
worktree-issue-59-configurable-eval-mode
Open

feat(vault): support configurable ENVECTOR_EVAL_MODE (rmp/mm)#60
heeyeon01 wants to merge 7 commits intomainfrom
worktree-issue-59-configurable-eval-mode

Conversation

@heeyeon01
Copy link
Copy Markdown

@heeyeon01 heeyeon01 commented Apr 20, 2026

Context
eval_mode was hardcoded to "rmp" in vault_core.py, blocking users on envector-msa ≥ 1.4.0-alpha which requires "mm" mode. Invalid values also silently propagated to the SDK with an opaque error.

TL;DR
Make FHE eval mode configurable via ENVECTOR_EVAL_MODE env var, with startup-time validation.

Summary

  • vault_core.py: read ENVECTOR_EVAL_MODE env var (default "rmp"), validate against allowlist {"rmp", "mm"} in ensure_vault() — invalid values raise ValueError with a clear message at startup
  • docker-compose.yml: expose ENVECTOR_EVAL_MODE=${ENVECTOR_EVAL_MODE:-rmp} to the container
  • .env.example: document rmp vs mm difference and the key-regeneration requirement
  • tests/unit/test_eval_mode.py: 7 unit tests covering env var reading, ev.init() call args, and allowlist guard behavior

Alternatives

Test plan

  • ENVECTOR_EVAL_MODE unset → defaults to rmp, vault starts healthy
  • ENVECTOR_EVAL_MODE=mm → vault starts healthy
  • ENVECTOR_EVAL_MODE=invalid → ValueError: Invalid ENVECTOR_EVAL_MODE='invalid'. Must be one of: ['mm', 'rmp']... at startup, container exits immediately

heeyeon and others added 4 commits April 17, 2026 12:05
…ar (#59)

Hardcoded eval_mode="rmp" in vault_core.py prevented connecting to
envector-msa >= 1.4.0 which uses MM (Multi-Multiplication) mode.
Read eval mode from ENVECTOR_EVAL_MODE env var (default: rmp for
backward compat with envector.io cloud / 1.2.x deployments).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Raise ValueError at startup if ENVECTOR_EVAL_MODE is not one of the
supported values {"rmp", "mm"}, so misconfiguration fails fast with a
clear message instead of propagating an opaque SDK error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…59)

Remove cloud/deployment-type framing in favor of version-based guidance,
which stays accurate as envector-msa versions evolve.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@heeyeon01 heeyeon01 self-assigned this Apr 20, 2026
@heeyeon01 heeyeon01 requested a review from a team April 20, 2026 04:39
@jh-lee-cryptolab
Copy link
Copy Markdown
Contributor

After envector version v1.4.0, we cannot choose the eval_mode from SDK. If you are planning to test mm mode on vault-side, please use local copy of this repo to deploy it.

@couragehong
Copy link
Copy Markdown

As Junghwad said + AFAIK, there is no more 'rmp' mode. mm only.
This PR cannot be used

heeyeon and others added 3 commits April 21, 2026 16:01
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ecurity (#59)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

3 participants