Skip to content

Commit 3b8d20c

Browse files
authored
docs: update network skeleton docs with devnet testing requirement (#13186)
* docs: update network skeleton docs with devnet testing requirement This came from following these docs for nv27 in #13125 * Cosmetic cleanups
1 parent a369f21 commit 3b8d20c

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

documentation/misc/Building_a_network_skeleton.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ Note: one only needs to update `filecoin-ffi`'s dependency on `go-state-types` w
186186
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.
187187
- Refer to the [Update Dependencies Lotus tutorial](Update_Dependencies_Lotus.md) for detailed instructions on updating these dependencies in Lotus.
188188

189-
1. Import new actors:
189+
2. Import new actors:
190190

191191
- Create a mock actor-bundle for the new network version.
192192
- In `/build/actors` run `./pack.sh vXX+1 vXX.0.0` where XX is the current actor bundle version.
193193

194-
2. Define upgrade heights in `build/params_`:
194+
3. Define upgrade heights in `build/params_`:
195195

196196
- Update the following files:
197197
- `params_2k.go`
@@ -217,48 +217,51 @@ Note: one only needs to update `filecoin-ffi`'s dependency on `go-state-types` w
217217
- `params_testground.go`
218218
- Add `UpgradeXxHeight abi.ChainEpoch = (-xx-1)`
219219

220-
3. Generate adapters:
220+
4. Generate adapters:
221221

222222
- Update `gen/inlinegen-data.json`.
223223
- Add `XX+1` to "actorVersions" and set "latestActorsVersion" to `XX+1`.
224224
- Add `XX+1` to "networkVersions" and set "latestNetworkVersion" to `XX+1`.
225225

226226
- 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`.
227227

228-
4. Update `chain/consensus/filcns/upgrades.go`.
228+
5. Update `chain/consensus/filcns/upgrades.go`.
229229
- Import `nv(XX+1) "github.com/filecoin-project/go-state-types/builtin/v(XX+1)/migration`.
230230
- Add Schedule. [^3]
231231
- Add Migration. [^4]
232232
233-
5. Add actorstype to the NewActorRegistry in `/chain/consensus/computestate.go`.
233+
6. Add actorstype to the NewActorRegistry in `/chain/consensus/computestate.go`.
234234
- Add `inv.Register(actorstypes.Version(XX+1), vm.ActorsVersionPredicate(actorstypes.Version(XX+1)), builtin.MakeRegistry(actorstypes.Version(XX+1))`.
235235
236-
6. Add upgrade field to `api/types.go/ForkUpgradeParams`.
236+
7. Add upgrade field to `api/types.go/ForkUpgradeParams`.
237237
- Add `UpgradeXxHeight abi.ChainEpoch` to `ForkUpgradeParams` struct.
238238
239-
7. Add upgrade to `node/impl/full/state.go`.
239+
8. Add upgrade to `node/impl/full/state.go`.
240240
- Add `UpgradeXxHeight: build.UpgradeXxHeight,`.
241241
242-
8. Add network version to `chain/state/statetree.go`.
242+
9. Add network version to `chain/state/statetree.go`.
243243
- Add `network.VersionXX+1` to `VersionForNetwork` function.
244244
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.
246246
247-
10. In the [getMigrationFuncsForNetwork](https://github.com/filecoin-project/lotus/blob/4f63a0860542140e1efd7045ca49cab3463f6761/cmd/lotus-shed/migrations.go#L283-L301) function, add a new case for 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 case for the latest network version, and create the corresponding `checkNvXXInvariants` function.
248248
249-
11. Run `make gen`.
249+
12. Run `make gen`.
250250
251-
12. Run `make docsgen-cli`.
251+
13. Run `make docsgen-cli`.
252252
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`
254259
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.
261+
- [nv24 example](https://github.com/filecoin-project/lotus/pull/12455)
262+
- [nv27 example](https://github.com/filecoin-project/lotus/pull/13125)
260263
261-
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.
262265
263266
## Special Cases
264267

0 commit comments

Comments
 (0)