forest
forest copied to clipboard
Prevent certain RPC commands during node initialization
Issue summary
When the node is initializing, e.g., downloading and importing a snapshot, some operations such as snapshot export should be forbidden, otherwise they produce bogus artifacts which may be identified by less aware as correct ones.
For example, I got:
β― target/release/forest-cli snapshot export
Exporting snapshot 39 / 39 [=============================================================================================================] 100.00 % 43752.09/s
Export completed. Snapshot located at ./forest_snapshot_calibnet_2023-05-05_height_0.carβ
When downloading a new snapshot and exporting the snapshot at the same time.
Consider revisiting other RPC commands (such as send) and setting a lock on those as well.
Other information and links
Maybe RPC service could be started only at some point (when Forest is able to serve all API calls)?
Maybe RPC service could be started only at some point (when Forest is able to serve all API calls)?
That may be a bit too simplistic. We still want to call forest-cli sync wait.