Skip to content

feat(gnodev): auto-import the dev key into the local keybase#5680

Draft
davd-gzl wants to merge 5 commits into
gnolang:masterfrom
davd-gzl:feat/gnodev-auto-import-devtest
Draft

feat(gnodev): auto-import the dev key into the local keybase#5680
davd-gzl wants to merge 5 commits into
gnolang:masterfrom
davd-gzl:feat/gnodev-auto-import-devtest

Conversation

@davd-gzl

Copy link
Copy Markdown
Member

On startup, gnodev writes the well-known deployer mnemonic into ~/.gnokey under the name dev. gnokey ... dev then signs against the preloaded address with no gnokey add -recover step. Existing entries are never overwritten; opt out with --no-dev-key.

Depends on #5656

@Gno2D2

Gno2D2 commented May 16, 2026

Copy link
Copy Markdown
Collaborator

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info)
🟢 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: davd-gzl/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🟢 Requirement satisfied
└── 🟢 If
    ├── 🟢 Condition
    │   └── 🟢 Or
    │       ├── 🔴 At least one of these user(s) reviewed the pull request: [aronpark1007 davd-gzl jefft0 notJoon omarsy MikaelVallenet] (with state "APPROVED")
    │       ├── 🔴 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🟢 This pull request is a draft
    └── 🟢 Then
        └── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

@codecov

codecov Bot commented May 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.15094% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
contribs/gnodev/setup_address_book.go 72.34% 9 Missing and 4 partials ⚠️
contribs/gnodev/app_config.go 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

On startup, gnodev writes the public DefaultDeployerSeed into the
user's gnokey keybase under the name `dev`, so `gnokey ... dev` signs
against the chain's preloaded address with no further setup. The
import is skipped if the entry already exists (matching or
conflicting), if --no-dev-key is passed, or if the home directory is
missing or unset. The previous startup banner that dumped the
mnemonic to the log is replaced by the import-success line — the
seed is now in the keybase, so logging it again is noise.

Updates docs/resources/gnodev.md, docs/builders/getting-started.md
and docs/cheatsheet.md to match the new behavior and reconcile the
in-flight `devtest` rename back to `dev`. See ADR
gno.land/adr/prxxxx_gnodev_auto_import_dev_key.md for the naming
rationale and the alternatives considered.
@davd-gzl davd-gzl force-pushed the feat/gnodev-auto-import-devtest branch from bb0b762 to 921f615 Compare May 24, 2026 20:40
davd-gzl added 4 commits May 24, 2026 22:43
ensureDevKey no longer aborts gnodev startup when the keybase is
missing, unwritable, locked, or corrupt: every failure now warns and
continues like the other branches, and openKeybase recovers the panic
NewKeyBaseFromDir raises on an unwritable home. Skip the import when the
deployer address is already in the keybase under any name, so an
existing entry (commonly test1) is preserved instead of being silently
deleted by the keybase's one-name-per-address rule. Clean both paths in
the default-home guard so a path-equivalent -home still counts.

Add tests for the address-under-another-name, broken-keybase,
unwritable-home, and cannot-create-default-home paths. Update the ADR
and docs to the real behavior, fix the gnokey export note, refresh the
stale minisocial banner, and normalize the flag to -no-dev-key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 documentation Improvements or additions to documentation 🐳 devops 🛠️ gnodev 📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related 📄 top-level-md

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants