You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/misc/Building_a_network_skeleton.md
+22-19Lines changed: 22 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -186,12 +186,12 @@ Note: one only needs to update `filecoin-ffi`'s dependency on `go-state-types` w
186
186
1. To integrate the network skeleton into Lotus, ensure that the relevant releases for ref-fvm, go-state-types, and filecoin-ffi are bubbled up to Lotus.
187
187
- Refer to the [Update Dependencies Lotus tutorial](Update_Dependencies_Lotus.md) fordetailed instructions on updating these dependenciesin Lotus.
188
188
189
-
1. Import new actors:
189
+
2. Import new actors:
190
190
191
191
- Create a mock actor-bundle for the new network version.
192
192
- In `/build/actors` run `./pack.sh vXX+1 vXX.0.0` where XX is the current actor bundle version.
193
193
194
-
2. Define upgrade heights in`build/params_`:
194
+
3. Define upgrade heights in`build/params_`:
195
195
196
196
- Update the following files:
197
197
- `params_2k.go`
@@ -217,48 +217,51 @@ Note: one only needs to update `filecoin-ffi`'s dependency on `go-state-types` w
217
217
- `params_testground.go`
218
218
- Add `UpgradeXxHeight abi.ChainEpoch = (-xx-1)`
219
219
220
-
3. Generate adapters:
220
+
4. Generate adapters:
221
221
222
222
- Update `gen/inlinegen-data.json`.
223
223
- Add `XX+1` to "actorVersions" and set"latestActorsVersion" to `XX+1`.
224
224
- Add `XX+1` to "networkVersions" and set"latestNetworkVersion" to `XX+1`.
225
225
226
226
- Run `make actors-gen`. This generates the `/chain/actors/builtin/*` code, `/chain/actors/policy/policy.go` code, `/chain/actors/version.go`, and `/itest/kit/ensemble_opts_nv.go`.
6. Add upgrade field to `api/types.go/ForkUpgradeParams`.
236
+
7. Add upgrade field to `api/types.go/ForkUpgradeParams`.
237
237
- Add `UpgradeXxHeight abi.ChainEpoch` to `ForkUpgradeParams` struct.
238
238
239
-
7. Add upgrade to `node/impl/full/state.go`.
239
+
8. Add upgrade to `node/impl/full/state.go`.
240
240
- Add `UpgradeXxHeight: build.UpgradeXxHeight,`.
241
241
242
-
8. Add network version to `chain/state/statetree.go`.
242
+
9. Add network version to `chain/state/statetree.go`.
243
243
- Add `network.VersionXX+1` to `VersionForNetwork` function.
244
244
245
-
9. Copy the latest version case block in`cmd/lotus-shed/invariants.go`, paste it below and increment the network version number.
245
+
10. Copy the latest version case block in`cmd/lotus-shed/invariants.go`, paste it below and increment the network version number.
246
246
247
-
10. In the [getMigrationFuncsForNetwork](https://github.com/filecoin-project/lotus/blob/4f63a0860542140e1efd7045ca49cab3463f6761/cmd/lotus-shed/migrations.go#L283-L301) function, add a new casefor the latest network version, and create the corresponding `checkNvXXInvariants` function.
247
+
11. In the [getMigrationFuncsForNetwork](https://github.com/filecoin-project/lotus/blob/4f63a0860542140e1efd7045ca49cab3463f6761/cmd/lotus-shed/migrations.go#L283-L301) function, add a new casefor the latest network version, and create the corresponding `checkNvXXInvariants` function.
248
248
249
-
11. Run `make gen`.
249
+
12. Run `make gen`.
250
250
251
-
12. Run `make docsgen-cli`.
251
+
13. Run `make docsgen-cli`.
252
252
253
-
And you're done! These are all the steps necessary to create a network upgrade skeleton that you will be able to run in a local devnet, and creates a basis where you can start testing new FIPs. When running a local developer network from this Lotus branch, bringing in all it dependencies, you should be able to:
253
+
14. Validate the network skeleton on a devnet by:
254
+
- Have a local developer network that starts at the current network version. See docs at https://docs.filecoin.io/networks/local-testnet .
255
+
- Be able to see the Actor CIDs/Actor version for the mock Actor-bundle through `lotus state actor-cids --network-version XX+1`
256
+
- Have a successful pre-migration.
257
+
- Complete the migration at upgrade epoch, with a successful upgrade.
258
+
- Sync the new network version with the mock actor bundle, and be able to see that you are on a new network version with `lotus state network-version`
254
259
255
-
- Have a local developer network that starts at the current network version.
256
-
- Be able to see the Actor CIDs/Actor version for the mock Actor-bundle through `lotus state actor-cids --network-version XX+1`
257
-
- Have a successful pre-migration.
258
-
- Complete the migration at upgrade epoch, with a successful upgrade.
259
-
- Sync the new network version with the mock actor bundle, and be able to see that you are on a new network version with `lotus state network-version`
260
+
15. Post a PR with the changes and include the local devnet output.
You can take a look at this [Lotus PR as a reference](https://github.com/filecoin-project/lotus/pull/12419) and [this](https://github.com/filecoin-project/lotus/pull/12455), which added the skeleton for network version 24.
264
+
And you're done 🎉! This creates a basis where you can start testing new FIPs.
0 commit comments