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.