Skip to content

Commit

Permalink
Actor upgrade checklist
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Apr 30, 2021
1 parent 54a494e commit 5bcd062
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api/test/ccupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {

func testCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, upgradeHeight abi.ChainEpoch) {
ctx := context.Background()
n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV4At(upgradeHeight)}, OneMiner)
n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(upgradeHeight)}, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]

Expand Down
2 changes: 1 addition & 1 deletion api/test/deadlines.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV4At(upgradeH)}, OneMiner)
n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(upgradeH)}, OneMiner)

client := n[0].FullNode.(*impl.FullNodeAPI)
minerA := sn[0]
Expand Down
2 changes: 1 addition & 1 deletion api/test/mining.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func TestDealMining(t *testing.T, b APIBuilder, blocktime time.Duration, carExpo
func (ts *testSuite) testNonGenesisMiner(t *testing.T) {
ctx := context.Background()
n, sn := ts.makeNodes(t, []FullNodeOpts{
FullNodeWithActorsV4At(-1),
FullNodeWithLatestActorsAt(-1),
}, []StorageMiner{
{Full: 0, Preseal: PresealGenesis},
})
Expand Down
2 changes: 1 addition & 1 deletion api/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ var OneMiner = []StorageMiner{{Full: 0, Preseal: PresealGenesis}}
var OneFull = DefaultFullOpts(1)
var TwoFull = DefaultFullOpts(2)

var FullNodeWithActorsV4At = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
var FullNodeWithLatestActorsAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
if upgradeHeight == -1 {
upgradeHeight = 3
}
Expand Down
8 changes: 4 additions & 4 deletions api/test/window_post.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func testWindowPostUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration,
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV4At(upgradeHeight)}, OneMiner)
n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(upgradeHeight)}, OneMiner)

client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
Expand Down Expand Up @@ -442,7 +442,7 @@ func TestTerminate(t *testing.T, b APIBuilder, blocktime time.Duration) {

nSectors := uint64(2)

n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV4At(-1)}, []StorageMiner{{Full: 0, Preseal: int(nSectors)}})
n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(-1)}, []StorageMiner{{Full: 0, Preseal: int(nSectors)}})

client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
Expand Down Expand Up @@ -617,7 +617,7 @@ func TestWindowPostDispute(t *testing.T, b APIBuilder, blocktime time.Duration)
///
// Then we're going to manually submit bad proofs.
n, sn := b(t, []FullNodeOpts{
FullNodeWithActorsV4At(-1),
FullNodeWithLatestActorsAt(-1),
}, []StorageMiner{
{Full: 0, Preseal: PresealGenesis},
{Full: 0},
Expand Down Expand Up @@ -900,7 +900,7 @@ func TestWindowPostDisputeFails(t *testing.T, b APIBuilder, blocktime time.Durat
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV4At(-1)}, OneMiner)
n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(-1)}, OneMiner)

client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
Expand Down
4 changes: 2 additions & 2 deletions chain/actors/agen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ var actors = map[string][]int{
}

func main() {
if err := run(); err != nil {
if err := generateAdapters(); err != nil {
fmt.Println(err)
return
}
}

func run() error {
func generateAdapters() error {
for act, versions := range actors {
actDir := filepath.Join("chain/actors/builtin", act)

Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-storage-miner/actor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestWorkerKeyChange(t *testing.T) {

blocktime := 1 * time.Millisecond

n, sn := builder.MockSbBuilder(t, []test.FullNodeOpts{test.FullNodeWithActorsV4At(-1), test.FullNodeWithActorsV4At(-1)}, test.OneMiner)
n, sn := builder.MockSbBuilder(t, []test.FullNodeOpts{test.FullNodeWithLatestActorsAt(-1), test.FullNodeWithLatestActorsAt(-1)}, test.OneMiner)

client1 := n[0]
client2 := n[1]
Expand Down
18 changes: 18 additions & 0 deletions documentation/misc/actors_version_checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Actor version integration checklist

- [ ] Import new actors
- [ ] Generate adapters
- [ ] Add the new version in `chain/actors/agen/main.go`
- [ ] Update adapter code in `chain/actors/builtin` if needed
- [ ] Update `chain/actors/policy/policy.go`
- [ ] Update `chain/actors/version.go`
- [ ] Register in `chain/vm/invoker.go`
- [ ] Register in `chain/vm/mkactor.go`
- [ ] Update `chain/types/state.go`
- [ ] Update `chain/state/statetree.go`
- [ ] Update `chain/stmgr/forks.go`
- [ ] Schedule
- [ ] Migration
- [ ] Define upgrade heights in `build/params_`
- [ ] Update upgrade schedule in `api/test/test.go`
- [ ] Register in init in `chain/stmgr/utils.go`

0 comments on commit 5bcd062

Please sign in to comment.