Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue: Forest executable re-organization #3172

Closed
24 of 31 tasks
lemmih opened this issue Jul 12, 2023 · 3 comments
Closed
24 of 31 tasks

Tracking issue: Forest executable re-organization #3172

lemmih opened this issue Jul 12, 2023 · 3 comments
Assignees

Comments

@lemmih
Copy link
Contributor

lemmih commented Jul 12, 2023

Issue summary

It's becoming increasingly painful to keep all commands in forest-cli. Pain points include commands that aren't just RPC calls to the forest-daemon and wallet commands that demand much higher scrutiny — a deeper discussion happened here.

Let's split forest-cli into three parts:

  • forest-cli: This executable is a human-friendly wrapper around the Forest RPC.
  • forest-tool: This executable handles tasks not involving the forest-daemon (such as downloading snapshots).
  • forest-wallet: This executable is a human-friendly wrapper around the Forest RPC. It's kept separate from forest-cli because it deals with sensitive data and the attack surface should be kept small. This will be the only executable that may access the store of private keys.

Notes:

  • Moving the wallet handling out of the daemon will break compatibility with Lotus. However, we can add a separate compatibility layer between the Lotus-miner and the Forest-daemon. This won't be a concern for quite a while, though.

Sub-tasks:

  • Move non-rpc commands to forest-tool
    • forest-tool fetch-params
    • forest-tool config dump
    • forest-tool snapshot fetch
    • forest-tool snapshot validate
    • forest-tool archive info
    • forest-tool db clean, side-note: Maybe this command should be renamed to db destroy.
    • forest-tool db stats
    • forest-tool snapshot fetch
    • forest-tool snapshot validate
    • forest-tool snapshot compress
    • forest-tool state diff
    • forest-tool archive info
    • forest-tool archive export
    • forest-tool archive checkpoints
    • forest-tool car concat
  • Print a helpful error message if old commands are used with forest-cli.
  • Remove unused command line flags from forest-cli.
  • Change the default RPC port from 1234 to 2345. We used 1234 to be compatible with Lotus, but we'll handle compatibility separately.
  • Move wallet commands to forest-wallet
    • forest-wallet send
    • forest-wallet new
    • forest-wallet balance
    • forest-wallet default
    • forest-wallet export
    • forest-wallet has
    • forest-wallet import
    • forest-wallet list
    • forest-wallet set-default
    • forest-wallet sign
    • forest-wallet verify

Other information and links

#2274

@aatifsyed
Copy link
Contributor

aatifsyed commented Jul 12, 2023

Alternative proposal: a single forest binary front for these various commands, and better segregation in the code.

A kind of "do what git does".

I also want to change how Config and common params are handled - it shouldn't be possible to provide --chain for commands where it doesn't make sense

@LesnyRumcajs
Copy link
Member

The configuration is already a known issue and there were attempts to make it right, unfortunately, it got buried at the bottom of the backlog.

As for one binary, it was the case for Forest some time ago. We decided to split. While splitting further the forest-cli is not exactly a must.

Having a separate forest-wallet is important from a security point of view. It is a critical piece of code that should be easily auditable, and the more clear the boundaries between forest-wallet and forest the better. Right now, we're not doing very well on this front. See #1517

@lemmih
Copy link
Contributor Author

lemmih commented Oct 22, 2023

Done.

@lemmih lemmih closed this as completed Oct 22, 2023
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

No branches or pull requests

4 participants