Compare commits

..

32 Commits

Author SHA1 Message Date
CleverWild
438bfd4ca1 chore(deps): bump kameo version 2026-08-25 14:46:32 +02:00
CleverWild
cfd0d5bbe6 feat(vault)!: implement full Shamir re-key flow and governance execution (§3.3–§3.5)
- Add `rekey.proto` with `ContributePassphrase` / `ContributeRecoveryPassphrase` / `RekeyResult`
- Wire `rekey` as a 4th vault stream payload in `vault.proto` and gRPC dispatch
- Add `RekeyRootKey` message to `Vault` actor: generates new random seal key, re-encrypts root key, writes new `root_key_history` row
- Add `StartRekey`, `ContributeRekey`, `ContributeRecoveryRekey` messages to `VaultCoordinator`; `finalize_rekey` uses threshold-1 fast path identical to bootstrap
- `execute_replace_operator` now UPDATEs `operator_identity.public_key` in-place (avoids FK constraint violation), deletes stale `operator` share row, then triggers `StartRekey`
- `execute_update_shamir_parameters` triggers `StartRekey` instead of warning stub
- `ProposalKind::ReplaceOperator` carries `old_operator_id`; encode/decode updated accordingly
- `GlobalActors::spawn` extracts `vault_coordinator` before `Ok(Self { … })` so it can be cloned into `ProposalManager::new`
- Add `handle_rekey` in session handlers forwarding passphrase contributions to `VaultCoordinator`
- Fix test: rename `replace_operator_inserts_identity_row` → `replace_operator_updates_pubkey_and_starts_rekey`, assert count stays 1 and pubkey is updated
2026-08-25 14:46:32 +02:00
CleverWild
2378690329 refactor(proposal): replace string kind dispatch with ProposalKindTag enum (strum) 2026-08-25 14:46:32 +02:00
CleverWild
8d940daf90 feat(vault): add recovery passphrase handling for bootstrap and unseal processes 2026-08-25 14:46:32 +02:00
CleverWild
547cb9325b fix(crypto): handle 1-of-N Shamir split when ordinary_count=1 2026-08-25 14:46:32 +02:00
CleverWild
048343cc94 feat(server): recovery operators with sleeping/wakeup mechanism (§3.5/§3.6) 2026-08-25 14:46:32 +02:00
CleverWild
95c5a54530 feat(server): key-rotation proposals require full quorum (§3.3) 2026-08-25 14:46:32 +02:00
CleverWild
d2de5bcd37 feat(server): two-operator vault requires at least one recovery share 2026-08-25 14:46:32 +02:00
CleverWild
a31ef6389b refactor(server): typed pubkey len via u32::try_from in ReplaceOperator 2026-08-25 14:46:32 +02:00
CleverWild
039a20225a feat(server): ProposalKind::ApproveOneOffTransaction 2026-08-25 14:46:32 +02:00
CleverWild
1d86820afe feat(server): ProposalKind::ApprovePersistentGrant 2026-08-25 14:46:32 +02:00
CleverWild
16e388d7fd feat(server): ProposalKind::UpdateShamirParameters 2026-08-25 14:46:32 +02:00
CleverWild
48c77c7d96 feat(server): ProposalKind::ReplaceOperator 2026-08-25 14:46:32 +02:00
CleverWild
d60fa81441 feat(server): ProposalKind ::GrantWalletAccess and ::ApproveServerUpdate 2026-08-25 14:46:32 +02:00
CleverWild
f9795747a6 test(server): governance integration tests 2026-08-25 14:46:32 +02:00
CleverWild
cd01ad6a9d feat(server::grpc): wire governance RPCs through operator session 2026-08-25 14:46:32 +02:00
CleverWild
4dac689745 feat(server): introduce ProposalManager actor with quorum voting logic 2026-08-25 14:46:31 +02:00
CleverWild
4879d9971c feat(crypto): expose governance signing context and make shamir_threshold pub const 2026-08-25 14:46:31 +02:00
CleverWild
b0437ebfce feat(db): add proposal and proposal_vote tables 2026-08-25 14:46:31 +02:00
CleverWild
93070af53b feat(proto): add governance proposal/vote RPC definitions 2026-08-25 14:46:31 +02:00
CleverWild
70c4def8b9 housekepping: add fixme for start_bootstrap's operator_id 2026-08-25 14:46:31 +02:00
CleverWild
4bb408e509 refactor(server::crypto): use fixed-size [u8; 32] and KeyCell throughout seal key API 2026-08-25 14:46:31 +02:00
CleverWild
a7c53aa9b6 fix(server::tests): tighten unseal test seal_key params to &[u8; 32] 2026-08-25 14:46:31 +02:00
CleverWild
8265281213 feat(server::grpc): wire Shamir committee bootstrap and unseal proto messages
Adds DeclareCommittee and ContributePassphrase variants to bootstrap.proto,
ContributePassphrase to unseal.proto, and AwaitingContributions result codes
to both. Implements corresponding inbound converters and outbound reply
mappings. VaultGate handlers delegate to VaultCoordinator.
2026-08-25 14:46:31 +02:00
CleverWild
c8948c73fb feat(server): introduce VaultCoordinator for multi-operator Shamir bootstrap/unseal
VaultCoordinator collects operator passphrases, splits the seal key into
Shamir shares on bootstrap (encrypting each share with the operator's
passphrase via Argon2 + XChaCha20-Poly1305), and reconstructs the seal
key from threshold shares on unseal. Adds vsss-rs 5.4.0 and rand_core 0.6
dependencies.
2026-08-25 14:46:31 +02:00
CleverWild
602dda1fa7 refactor(server::actors::vault): clean up Bootstrap/TryUnseal, remove Bootstrapping state
Bootstrap and TryUnseal now accept a SafeCell<Vec<u8>> seal key directly.
The Bootstrapping intermediate state is removed — multi-operator coordination
is the responsibility of VaultCoordinator, which calls Bootstrap atomically
once all shares are collected.
2026-08-25 14:46:31 +02:00
CleverWild
8c49ee6e51 feat(server::crypto): add Shamir secret sharing utilities
Wraps vsss_rs Gf256::split_array / combine_array into thin split_key /
combine_shares helpers. Also widens derive_key salt parameter from &[u8;16]
to &[u8] to accommodate the 32-byte share salts.
2026-08-25 14:46:31 +02:00
CleverWild
bcd08dbb64 feat(server::db): add share_salt column to operator table
Each operator row now stores a 32-byte random salt used to derive the
per-operator share encryption key from their passphrase (Argon2 KDF).
2026-08-25 14:46:31 +02:00
CleverWild
2abc6fa0e6 feat(server::actors::evm): implement operator_delete_grant
Sets revoked_at on the evm_basic_grant row; returns NotFound if the grant
does not exist. Wires the handler in OperatorSession replacing the todo!().
2026-08-25 14:46:31 +02:00
CleverWild
81cf3693c2 fix(server::peers::operator::auth): make ChallengeContext pub for smlang state machine
smlang generates a public state enum whose variants contain ChallengeContext,
requiring the type itself to be fully public. Also tightens the wildcard arm
in client auth to an exhaustive match.
2026-08-25 14:46:31 +02:00
Skipper
9000909e54 WIP: some things 2026-08-25 14:46:31 +02:00
Skipper
e911165137 feat(grpc): governance contract 2026-08-25 14:46:31 +02:00

Diff Content Not Available