-
Notifications
You must be signed in to change notification settings - Fork 180
Open
Description
Problem
Currently, the RPC layer directly uses CLI methods from the archive_cmd
module, which violates separation of concerns principles. Specifically, the do_export
function in src/tool/subcommands/archive_cmd.rs
is being used by both:
- CLI commands (
forest-tool archive export
) - RPC methods (
Forest.ChainExportDiff
)
Proposed Solution
Move the core export logic to a separate crate or dedicated module that can be shared between CLI and RPC layers without creating architectural dependencies.
This would involve:
- Extracting the core export functionality from
archive_cmd.rs
- Creating a new module/crate for shared export logic
- Having both CLI and RPC layers depend on this shared module
- Maintaining clear separation between presentation layer (CLI/RPC) and business logic (export operations)
Context
This issue was identified during review of PR #6074 which adds forest-cli snapshot export-diff
functionality.
References:
- PR: feat: forest-cli snapshot export-diff #6074
- Comment: feat: forest-cli snapshot export-diff #6074 (comment)
- Requested by: @hanabi1224
Benefits
- Better architectural separation
- Easier testing of core export logic
- Reduced coupling between CLI and RPC layers
- More maintainable codebase
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Ready