Skip to content

fix(sources): serialize first source keypair generation (from #85) - #95

Merged
zeekay merged 1 commit into
mainfrom
g6/sources-keypair-lock
Nov 25, 2026
Merged

zeekay merged 1 commit into
mainfrom
g6/sources-keypair-lock

Conversation

@zeekay

@zeekay zeekay commented Nov 25, 2026

Copy link
Copy Markdown
Member

Audits and lands fork PR #85 on a first-party branch with full Rust test and clippy verification.

Changes

  • Acquire crate::config::Lock::acquire(path) (cross-platform OS file lock on <path>.lock, creating parent dirs if absent) in load_or_create_keypair before checking/creating source-key.ed25519.
  • Add 12-worker concurrent barrier regression test ensuring all racing first links observe the single persisted Ed25519 public key.

Verification

  • cargo test --locked commands::sources::: all tests passed (including 12-worker concurrency test)
  • cargo clippy --locked --all-targets -- -D warnings: 0 warnings
  • rustfmt --edition 2021 --check src/commands/sources.rs: clean

Supersedes #85 (with full attribution to @DivyamTalwar).

Acquire the existing cross-process Lock beside the keypair path before
checking for and generating source-key.ed25519 so concurrent first-time
`hanzo sources link` invocations share one persisted Ed25519 identity.

Co-authored-by: Divyam Talwar <[email protected]>

Co-authored-by: Hanzo Dev <[email protected]>
@zeekay
zeekay merged commit 2821a9b into main Nov 25, 2026
@zeekay
zeekay deleted the g6/sources-keypair-lock branch November 25, 2026 10:34
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