forest icon indicating copy to clipboard operation
forest copied to clipboard

Prevent certain RPC commands during node initialization

Open LesnyRumcajs opened this issue 2 years ago β€’ 2 comments

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

LesnyRumcajs avatar May 05 '23 08:05 LesnyRumcajs

Maybe RPC service could be started only at some point (when Forest is able to serve all API calls)?

elmattic avatar May 05 '23 08:05 elmattic

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.

LesnyRumcajs avatar May 05 '23 09:05 LesnyRumcajs