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
* Building_a_network_skeleton.md cleanups
Go-State-Types Checklist updates
* Updated Lotus PR to the one that was merged for nv23
* Made network version substitute variable to consistently be "xx" instead of 3 or more "x"'s in some cases.
Adjusted ToC.
* Leaving ToC untouched
* Building_a_network_skeleton.md cleanups
Go-State-Types Checklist updates
* Made network version substitute variable to consistently be "xx" instead of 3 or more "x"'s in some cases.
Adjusted ToC.
* Leaving ToC untouched
* Building_a_network_skeleton.md cleanups
Go-State-Types Checklist updates
* Made network version substitute variable to consistently be "xx" instead of 3 or more "x"'s in some cases.
Adjusted ToC.
Copy file name to clipboardExpand all lines: documentation/misc/Building_a_network_skeleton.md
+42-25Lines changed: 42 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,11 @@
2
2
3
3
This guide will walk you through the process of creating a skeleton for a network upgrade in Lotus. The process involves making changes in multiple repositories in the following order:
- Make a commit with this change. That way the followup commit(s) will be separated out from the copy/paste change for easier reviewing.
75
+
- Change all references from vXX to v(XX+1) in the new files.
76
+
```bash
77
+
# Find all the files that have a reference to vXX
78
+
# Update them to vXX+1
79
+
# "sed -i=''" is done for macOS compatibility per https://stackoverflow.com/questions/12272065/sed-undefined-label-on-macos
80
+
find builtin/$NEW_VERSION -type f -exec sh -c 'grep -q "builtin/$CURRENT_VERSION" "$1" && sed -i='' "s/builtin\/$CURRENT_VERSION/builtin\/$NEW_VERSION/g" "$1" && echo "$1"' _ {} \;
81
+
```
65
82
- Add new network version to `network/version.go`.
66
83
- Add new actors version to `actors/version.go`.
67
84
- Add `Version(XX+1) Version = XX+1` as a constant.
@@ -73,14 +90,14 @@ You can take a look at this [Filecoin-FFI PR as a reference](https://github.com/
73
90
- Commit the above changes with a `Delete migration specific for nvXX` message so its easier to review.
74
91
- Check your `/builtin/vXX+1/check.go` file, and see if there is any Invariant TODOs that stems from the previous migration that needs to be cleaned up.
75
92
76
-
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.
93
+
👉 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.
77
94
78
-
2. In a second PR based off your first PR, add a simple migration for the network upgrade:
95
+
1. In a second PR based off your first PR, add a simple migration for the network upgrade:
79
96
80
97
- Copy the system.go template [^1], and add it to your `/builtin/vXX+1/migration` folder.
81
98
- Copy the top.go template [^2], and add it to your `/builtin/vXX+1/migration` folder.
82
99
83
-
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.
100
+
👉 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.
84
101
85
102
## Lotus Checklist
86
103
@@ -96,27 +113,27 @@ You can take a look at this [Go-State-Types PR as a reference](https://github.co
96
113
97
114
- Update the following files:
98
115
- `params_2k.go`
99
-
- Set previous `UpgradeXxxxxHeight = abi.ChainEpoch(-xx-1)`
8. Add network version to `chain/state/statetree.go`.
144
161
- Add `network.VersionXX+1` to `VersionForNetwork` function.
@@ -155,7 +172,7 @@ And you're done! These are all the steps necessary to create a network upgrade s
155
172
- Complete the migration at upgrade epoch, with a succesful upgrade.
156
173
- 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`
157
174
158
-
You can take a look at this [Lotus PR as a reference](https://github.com/filecoin-project/lotus/pull/11897), which added the skeleton for network version 23.
175
+
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.
159
176
160
177
[^1]: Here is system.go template for a simple migration:
161
178
@@ -315,7 +332,7 @@ You can take a look at this [Lotus PR as a reference](https://github.com/filecoi
0 commit comments