Skip to content

Commit 6422bf4

Browse files
authored
Merge pull request #8843 from filecoin-project/gstuart/lite-migration-master
Feat: migration: Implement function to migrate actors with only code changes
2 parents e899f73 + b7010c9 commit 6422bf4

File tree

40 files changed

+586
-30
lines changed

40 files changed

+586
-30
lines changed

.circleci/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,11 @@ workflows:
868868
suite: itest-get_messages_in_ts
869869
target: "./itests/get_messages_in_ts_test.go"
870870

871+
- test:
872+
name: test-itest-lite_migration
873+
suite: itest-lite_migration
874+
target: "./itests/lite_migration_test.go"
875+
871876
- test:
872877
name: test-itest-lookup_robust_address
873878
suite: itest-lookup_robust_address

api/api_full.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"time"
88

9+
blocks "github.com/ipfs/go-block-format"
910
"github.com/ipfs/go-cid"
1011
"github.com/libp2p/go-libp2p-core/peer"
1112

@@ -38,6 +39,7 @@ import (
3839
type ChainIO interface {
3940
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
4041
ChainHasObj(context.Context, cid.Cid) (bool, error)
42+
ChainPutObj(context.Context, blocks.Block) error
4143
}
4244

4345
const LookbackNoLimit = abi.ChainEpoch(-1)
@@ -123,6 +125,9 @@ type FullNode interface {
123125
// ChainHasObj checks if a given CID exists in the chain blockstore.
124126
ChainHasObj(context.Context, cid.Cid) (bool, error) //perm:read
125127

128+
// ChainPutObj puts a given object into the block store
129+
ChainPutObj(context.Context, blocks.Block) error //perm:admin
130+
126131
// ChainStatObj returns statistics about the graph referenced by 'obj'.
127132
// If 'base' is also specified, then the returned stat will be a diff
128133
// between the two objects.

api/api_gateway.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package api
33
import (
44
"context"
55

6+
blocks "github.com/ipfs/go-block-format"
67
"github.com/ipfs/go-cid"
78

89
"github.com/filecoin-project/go-address"
@@ -30,6 +31,7 @@ import (
3031

3132
type Gateway interface {
3233
ChainHasObj(context.Context, cid.Cid) (bool, error)
34+
ChainPutObj(context.Context, blocks.Block) error
3335
ChainHead(ctx context.Context) (*types.TipSet, error)
3436
ChainGetParentMessages(context.Context, cid.Cid) ([]Message, error)
3537
ChainGetParentReceipts(context.Context, cid.Cid) ([]*types.MessageReceipt, error)

api/docgen/docgen.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
filestore "github.com/filecoin-project/go-fil-markets/filestore"
2929
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
3030
"github.com/filecoin-project/go-jsonrpc/auth"
31+
blocks "github.com/ipfs/go-block-format"
3132
textselector "github.com/ipld/go-ipld-selector-text-lite"
3233

3334
"github.com/filecoin-project/go-state-types/abi"
@@ -95,6 +96,9 @@ func init() {
9596
apiSelExample := api.Selector("Links/21/Hash/Links/42/Hash")
9697
clientEvent := retrievalmarket.ClientEventDealAccepted
9798

99+
block := blocks.Block(&blocks.BasicBlock{})
100+
ExampleValues[reflect.TypeOf(&block).Elem()] = block
101+
98102
addExample(bitfield.NewFromSet([]uint64{5}))
99103
addExample(abi.RegisteredSealProof_StackedDrg32GiBV1_1)
100104
addExample(abi.RegisteredPoStProof_StackedDrgWindow32GiBV1)

api/mocks/mock_full.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/proxy_gen.go

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v0api/full.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/filecoin-project/go-state-types/abi"
1212
"github.com/filecoin-project/go-state-types/crypto"
1313
"github.com/filecoin-project/go-state-types/dline"
14+
blocks "github.com/ipfs/go-block-format"
1415
"github.com/ipfs/go-cid"
1516
textselector "github.com/ipld/go-ipld-selector-text-lite"
1617
"github.com/libp2p/go-libp2p-core/peer"
@@ -110,6 +111,9 @@ type FullNode interface {
110111
// ChainDeleteObj deletes node referenced by the given CID
111112
ChainDeleteObj(context.Context, cid.Cid) error //perm:admin
112113

114+
// ChainPutObj puts and object into the blockstore
115+
ChainPutObj(context.Context, blocks.Block) error
116+
113117
// ChainHasObj checks if a given CID exists in the chain blockstore.
114118
ChainHasObj(context.Context, cid.Cid) (bool, error) //perm:read
115119

api/v0api/gateway.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package v0api
33
import (
44
"context"
55

6+
blocks "github.com/ipfs/go-block-format"
67
"github.com/ipfs/go-cid"
78

89
"github.com/filecoin-project/go-address"
@@ -34,6 +35,7 @@ import (
3435

3536
type Gateway interface {
3637
ChainHasObj(context.Context, cid.Cid) (bool, error)
38+
ChainPutObj(context.Context, blocks.Block) error
3739
ChainHead(ctx context.Context) (*types.TipSet, error)
3840
ChainGetBlockMessages(context.Context, cid.Cid) (*api.BlockMessages, error)
3941
ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)

api/v0api/proxy_gen.go

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v0api/v0mocks/mock_full.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)