Skip to content

Commit

Permalink
docs: update network skeleton docs based on nv24 learnings
Browse files Browse the repository at this point in the history
This includes some followups/learnings #12481.
  • Loading branch information
BigLep committed Sep 27, 2024
1 parent 2b32250 commit c675cd1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 8 deletions.
60 changes: 52 additions & 8 deletions documentation/misc/Building_a_network_skeleton.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This guide will walk you through the process of creating a skeleton for a networ
- [Go-State-Types Checklist](#go-state-types-checklist)
- [Filecoin-FFI Checklist](#filecoin-ffi-checklist)
- [Lotus Checklist](#lotus-checklist)
- [Special Cases](#special-cases)
- [New types in go-state-types](#new-types-in-go-state-types)

Each repository has its own set of steps that need to be followed. This guide provides detailed instructions for each repository in the proper order.

Expand Down Expand Up @@ -59,11 +61,35 @@ The table below gives an overview of how Lotus and its critical dependencies rel

## Setup

1. Clone the [ref-fvm](https://github.com/filecoin-project/ref-fvm.git) repository.
0. Create a tracking issue for this effort:

Title: Skeleton for nvXX to support development and testing
<details><summary>Body:</summary>

````
## Done Criteria
There is a network skeleton in Lotus, which bubbles up all the other dependencies, and allows one to run a 2k-network and see that it switches network version from nv(XX-1) --> nvXX
## Notes
1. This is the overarching tracking issue for the network skeleton update, but thare are tasks that needed to be completed in other repos as well. All PRs for this effort can reference this issue.
2. How to create a skeleton in Lotus is documented here: https://github.com/filecoin-project/lotus/blob/master/documentation/misc/Building_a_network_skeleton.md
2. Clone the [filecoin-ffi](https://github.com/filecoin-project/filecoin-ffi.git) repository.
```[tasklist]
## Tasks
- [ ] Skeleton for nv24 to support development and testing ref-fvm
- [ ] Skeleton for nv24 to support development and testing go-state-types
- [ ] Skeleton for nv24 to support development and testing filecoin-ffi
- [ ] Skeleton for nv24 to support development and testing Lotus
```
````
</details>

1. Clone the [ref-fvm](https://github.com/filecoin-project/ref-fvm.git) repository.

3. Clone the [go-state-types](https://github.com/filecoin-project/go-state-types) repository.
2. Clone the [go-state-types](https://github.com/filecoin-project/go-state-types) repository.

3. Clone the [filecoin-ffi](https://github.com/filecoin-project/filecoin-ffi.git) repository.

4. Clone the [lotus](https://github.com/filecoin-project/lotus) repository.

Expand Down Expand Up @@ -92,7 +118,9 @@ You can take a look at [this Ref-FVM PR as a reference](https://github.com/filec
section. It may be appropriate to duplicate some entries across these crates if the changes are
relevant to multiple crates.

You can take a look at [this PR as a reference](https://github.com/filecoin-project/ref-fvm/pull/2002). Wait for the PR to be merged, then the reviewer will publish a new release.
You can take a look at [this PR as a reference](https://github.com/filecoin-project/ref-fvm/pull/2002).

3. Wait for the PR to be merged and the reviewer to [publish a new release](https://github.com/filecoin-project/ref-fvm/blob/master/CONTRIBUTING.md#releasing).

## Go-State-Types Checklist

Expand Down Expand Up @@ -129,12 +157,16 @@ You can take a look at [this PR as a reference](https://github.com/filecoin-proj

👉 You can take a look at this [Go-State-Types PR as a reference](https://github.com/filecoin-project/go-state-types/pull/257), which added the skeleton for network version 23.

1. In a second PR based off your first PR, add a simple migration for the network upgrade:
2. In a second PR based off your first PR, add a simple migration for the network upgrade:

- Copy the system.go template [^1], and add it to your `/builtin/vXX+1/migration` folder.
- Copy the top.go template [^2], and add it to your `/builtin/vXX+1/migration` folder.

👉 You can take a look at this [Go-State-Types PR as a reference](https://github.com/filecoin-project/go-state-types/pull/258), which added added a simple migration for network version 23.
👉 You can take a look at this [Go-State-Types PR as a reference](https://github.com/filecoin-project/go-state-types/pull/258), which added a simple migration for network version 23.

3. [Follow the release process](https://github.com/filecoin-project/go-state-types#release-process) to publish `v0.NEW_VERSION.0-dev`

👉 You can take a look at this [Go-State-Types PR as a reference](https://github.com/filecoin-project/go-state-types/pull/306), which was for network version 24.

## Filecoin-FFI Checklist

Expand All @@ -144,11 +176,17 @@ You can take a look at [this PR as a reference](https://github.com/filecoin-proj
2. Patch the FVM-dependency (fvm4 and fvm4_shared) in `rust/cargo.toml` to use the newly published Ref-FVM release.
- Add `features = ["nvXX+1-dev"]`.

You can take a look at this [Filecoin-FFI PR as a reference](https://github.com/filecoin-project/filecoin-ffi/pull/454), which added the skeleton for network version 23.
👉 You can take a look at this [Filecoin-FFI PR as a reference](https://github.com/filecoin-project/filecoin-ffi/pull/454), which added the skeleton for network version 23.

3. [Follow the release process](https://github.com/filecoin-project/filecoin-ffi/blob/master/RELEASE.md) to publish `v1.NEW_LOTUS_MINOR_VERSION.0-dev`

👉 You can take a look at this [Filecoin-FFI PR as a reference](https://github.com/filecoin-project/filecoin-ffi/pull/481), which was for network version 24.

Note: only when a network upgrade is introducing new types in `go-state-types` do we need to update `filecion-ffi`'s dependency on `go-state-types` (see [below](#new-types-in-go-state-types)). Otherwise, `filecion-ffi`'s dependency on `go-state-types` is just updated when doing fiinal releases before the network upgrade.

## Lotus Checklist

1. To integrate the network skeleton into Lotus, ensure that the relevant releases for ref-fvm, filecoin-ffi, and go-state-types are bubbled up to Lotus.
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.
- Refer to the [Update Dependencies Lotus tutorial](Update_Dependencies_Lotus.md) for detailed instructions on updating these dependencies in Lotus.

1. Import new actors:
Expand Down Expand Up @@ -225,6 +263,12 @@ And you're done! These are all the steps necessary to create a network upgrade s
You can take a look at this [Lotus PR as a reference](https://github.com/filecoin-project/lotus/pull/11964), which added the skeleton for network version 23.
## Special Cases
### New types in go-state-types
Typically it's safe to not upgrade filecoin-ffi's version of go-state-types. The exception is when we add a new type (e.g., a new proof variant). In that case, filecoin-ffi needs to be tracking the dev/rc releases of go-state-types.
---
[^1]: Here is system.go template for a simple migration:
```go
Expand Down
4 changes: 4 additions & 0 deletions documentation/misc/Update_Dependencies_Lotus.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Updating these dependencies in Lotus is usually related to network upgrades. Se

## Updating Filecoin-FFI

0. In Lotus´s [go.mod file](https://github.com/filecoin-project/lotus/blob/master/go.mod), search for `filecoin-ffi` and update the version to your wanted version.

0. Run `go mod tidy`, and commit your changes.

1. In your `lotus` directory, `cd extern/filecoin-ffi`.

2. `git fetch` to ensure you have the latests changes for *filecoin-ffi*.
Expand Down

0 comments on commit c675cd1

Please sign in to comment.