Skip to content

fix(wallet): support explicit --encrypt false for forest-wallet#7211

Open
sudo-shashank wants to merge 2 commits into
mainfrom
shashank/fix-encrypted-wallet-usage
Open

fix(wallet): support explicit --encrypt false for forest-wallet#7211
sudo-shashank wants to merge 2 commits into
mainfrom
shashank/fix-encrypted-wallet-usage

Conversation

@sudo-shashank

@sudo-shashank sudo-shashank commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Changes introduced in this pull request:

  • As reported when an encrypted keystore existed, forest-wallet always used it with no way to select the unencrypted keystore. This PR adds --encrypt false to allow that when both exist.
--encrypt <ENCRYPT>
    Use encrypted keystore.
          
    Note: When an encrypted keystore exists, it is used by default if `--encrypt` is omitted.
          
   [possible values: true, false]

Reference issue to close (if applicable)

Closes #5209

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • New Features
    • The --encrypt flag is now optional. When omitted, the wallet automatically uses an encrypted keystore if available; otherwise, it uses the unencrypted keystore.
    • Users can explicitly use --encrypt false to force the unencrypted keystore, even when an encrypted keystore exists.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The --encrypt CLI flag on forest-wallet is changed from a required bool to Option<bool>. When omitted, WalletBackend::new_local defaults to using the encrypted keystore if one exists on disk (unwrap_or(is_encrypted)). When explicitly set to false, it forces the unencrypted keystore. The changelog is updated accordingly.

Changes

Optional encryption flag with on-disk default

Layer / File(s) Summary
CLI flag and backend encryption defaulting
src/wallet/subcommands/mod.rs, src/wallet/subcommands/wallet_cmd.rs, CHANGELOG.md
Cli.encrypt and WalletCommands::run change from bool to Option<bool>; WalletBackend::new_local derives use_encryption via want_encryption.unwrap_or(is_encrypted), enabling --encrypt false to override an existing encrypted keystore. Changelog entry added.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • akaladarshi
  • hanabi1224
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and specifically describes the main change: adding support for explicitly using --encrypt false in forest-wallet.
Linked Issues check ✅ Passed The PR directly addresses issue #5209 by enabling explicit selection of unencrypted keystores via --encrypt false flag and updating documentation.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the --encrypt flag feature and updating documentation; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shashank/fix-encrypted-wallet-usage
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch shashank/fix-encrypted-wallet-usage

Comment @coderabbitai help to get the list of available commands and usage tips.

@sudo-shashank sudo-shashank marked this pull request as ready for review June 19, 2026 22:50
@sudo-shashank sudo-shashank requested a review from a team as a code owner June 19, 2026 22:50
@sudo-shashank sudo-shashank requested review from LesnyRumcajs and hanabi1224 and removed request for a team June 19, 2026 22:50

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 44: In the CHANGELOG.md file at the entry describing the forest-wallet
fix, replace the PR reference `#7211` with the issue reference `#5209` to follow the
project's changelog traceability convention of preferring issue numbers when
both an issue and PR exist for a change. Keep the rest of the changelog entry
text unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a3acaaf5-2315-4cd4-8755-677a0fe2ebda

📥 Commits

Reviewing files that changed from the base of the PR and between d1cb4f8 and 0010b46.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/wallet/subcommands/mod.rs
  • src/wallet/subcommands/wallet_cmd.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • filecoin-project/lotus (manual)

Comment thread CHANGELOG.md
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.37%. Comparing base (d1cb4f8) to head (0010b46).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/wallet/subcommands/wallet_cmd.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/wallet/subcommands/mod.rs 100.00% <ø> (ø)
src/wallet/subcommands/wallet_cmd.rs 26.55% <0.00%> (-0.07%) ⬇️

... and 12 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1cb4f8...0010b46. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Address encrypted wallet usage issues

1 participant