1. Implement a pass-through for garbage collection on the idstore.
2. Fix the `lotus-shed state-prune` command.
NOTE: the new performance of running a full prune will be significantly
less as this version doesn't batch. However, it should now actually
_work_ and most users will be using the splitstore anyways.
This commit includes the following updates:
- Added a new 'pprof' flag to the command-line arguments in main.go. This flag allows the user to specify a file name for writing CPU profile information, enabling performance analysis.
- Implemented functionality to start CPU profiling in the 'Before' function. If a file name is provided via the 'pprof' flag, the function creates the specified file and begins CPU profiling.
- Added an 'After' function to stop CPU profiling once the program execution is finished.
These changes provide a way to analyze the CPU usage of the 'lotus-shed' application, which can be valuable for performance tuning and optimization.
This commit includes the following updates:
- Imported v12 of the filecoin state types in migrations.go. This allows the system to interpret and operate on the latest structure of filecoin state information, ensuring compatibility with the latest version of the Filecoin network.
- Updated the 'getMigrationFuncsForNetwork' function to include a case for network.Version21, enabling the use of the UpgradeActorsV12 and PreUpgradeActorsV12 functions for network migration. These changes ensure the system correctly handles migrations when the network upgrades to version 21.
- Implemented a new 'checkNv21Invariants' function to check the invariants for version 21 of the Filecoin network. This function:
1. Loads the new state root from the actor store.
2. Retrieves the actor code IDs for the current state version (v12).
3. Loads the actor tree from the state root and checks state invariants using the actor code IDs.
4. Logs any error messages generated during the invariant check.
5. Finally, prints a message with the time taken to complete the checks.
By checking these invariants, we can ensure the system's state is consistent and valid after migrating to network version 21.
This commit refactors the code in `invariants.go` to support state invariant checks for different actor versions. The code now includes checks for versions 10 and 11 of the actors. The `CheckStateInvariants` function is invoked based on the actor version, passing the appropriate parameters. This change ensures that state invariant checks are performed correctly for different actor versions.
The changes made are as follows:
- Added imports for actor versions 10 and 11.
- Added `case` statements for versions 10 and 11 in the switch statement.
- Invoked `CheckStateInvariants` function with the correct parameters for each version.
- Handled errors returned by the `CheckStateInvariants` function.
These changes enhance the flexibility and compatibility of the code with different actor versions, improving the accuracy of state invariant checks.