Skip to content

Commit

Permalink
Merge pull request #8845 from filecoin-project/asr/cherry-picks
Browse files Browse the repository at this point in the history
chore: cherry-pick fixes to release branch
  • Loading branch information
arajasek authored Jun 10, 2022
2 parents b6a7e05 + dda9ac3 commit 2d07131
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 71 deletions.
35 changes: 26 additions & 9 deletions chain/consensus/filcns/compute_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ import (
"context"
"sync/atomic"

/* inline-gen template
{{range .actorVersions}}
exported{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin/exported"{{end}}
/* inline-gen start */

exported0 "github.com/filecoin-project/specs-actors/actors/builtin/exported"
exported2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/exported"
exported3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/exported"
exported4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/exported"
exported5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/exported"
exported6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/exported"
exported7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/exported"
exported8 "github.com/filecoin-project/specs-actors/v8/actors/builtin/exported"

/* inline-gen end */

"github.com/filecoin-project/lotus/chain/rand"

"github.com/ipfs/go-cid"
Expand All @@ -16,15 +33,6 @@ import (
"github.com/filecoin-project/go-state-types/big"
blockadt "github.com/filecoin-project/specs-actors/actors/util/adt"

exported0 "github.com/filecoin-project/specs-actors/actors/builtin/exported"
exported2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/exported"
exported3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/exported"
exported4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/exported"
exported5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/exported"
exported6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/exported"
exported7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/exported"
exported8 "github.com/filecoin-project/specs-actors/v8/actors/builtin/exported"

"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
Expand All @@ -41,6 +49,13 @@ import (
func NewActorRegistry() *vm.ActorRegistry {
inv := vm.NewActorRegistry()

/* inline-gen template
{{range .actorVersions}}
inv.Register(actors.Version{{.}}, vm.ActorsVersionPredicate(actors.Version{{.}}), exported{{.}}.BuiltinActors()...){{end}}
/* inline-gen start */

inv.Register(actors.Version0, vm.ActorsVersionPredicate(actors.Version0), exported0.BuiltinActors()...)
inv.Register(actors.Version2, vm.ActorsVersionPredicate(actors.Version2), exported2.BuiltinActors()...)
inv.Register(actors.Version3, vm.ActorsVersionPredicate(actors.Version3), exported3.BuiltinActors()...)
Expand All @@ -50,6 +65,8 @@ func NewActorRegistry() *vm.ActorRegistry {
inv.Register(actors.Version7, vm.ActorsVersionPredicate(actors.Version7), exported7.BuiltinActors()...)
inv.Register(actors.Version8, vm.ActorsVersionPredicate(actors.Version8), exported8.BuiltinActors()...)

/* inline-gen end */

return inv
}

Expand Down
18 changes: 0 additions & 18 deletions chain/vm/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
rt7 "github.com/filecoin-project/specs-actors/v7/actors/runtime"
"github.com/ipfs/go-cid"
ipldcbor "github.com/ipfs/go-ipld-cbor"
mh "github.com/multiformats/go-multihash"
"go.opencensus.io/trace"
"golang.org/x/xerrors"

Expand Down Expand Up @@ -223,23 +222,6 @@ func (rt *Runtime) GetActorCodeCID(addr address.Address) (ret cid.Cid, ok bool)
panic(aerrors.Fatalf("failed to get actor: %s", err))
}

// required for genesis/testing
if nv := rt.NetworkVersion(); nv >= network.Version16 {
name, av, ok := actors.GetActorMetaByCode(act.Code)

if ok {
// lies, lies, lies
builder := cid.V1Builder{Codec: cid.Raw, MhType: mh.IDENTITY}
synthetic := fmt.Sprintf("fil/%d/%s", av, name)
syntheticCid, err := builder.Sum([]byte(synthetic))
if err != nil {
panic(aerrors.Fatalf("failed to generate synthetic CID: %s", err))
}

return syntheticCid, true
}
}

return act.Code, true
}

Expand Down
3 changes: 1 addition & 2 deletions cmd/lotus-shed/cid.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/filecoin-project/lotus/blockstore"
"github.com/ipld/go-car"
"golang.org/x/net/context"

"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
Expand Down Expand Up @@ -95,7 +94,7 @@ var cidFromCarCmd = &cli.Command{
Usage: "Get the manifest CID from a car file",
ArgsUsage: "[path]",
Action: func(cctx *cli.Context) error {
ctx := context.TODO()
ctx := cctx.Context

cf := cctx.Args().Get(0)
f, err := os.OpenFile(cf, os.O_RDONLY, 0664)
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ require (
github.com/filecoin-project/go-storedcounter v0.1.0
github.com/filecoin-project/index-provider v0.5.0
github.com/filecoin-project/pubsub v1.0.0
github.com/filecoin-project/specs-actors v0.9.15-0.20220514164640-94e0d5e123bd
github.com/filecoin-project/specs-actors v0.9.15
github.com/filecoin-project/specs-actors/v2 v2.3.6
github.com/filecoin-project/specs-actors/v3 v3.1.2
github.com/filecoin-project/specs-actors/v4 v4.0.2
github.com/filecoin-project/specs-actors/v5 v5.0.6-0.20220514165557-0b29a778685b
github.com/filecoin-project/specs-actors/v6 v6.0.2-0.20220511204807-569c6d12432b
github.com/filecoin-project/specs-actors/v7 v7.0.1-0.20220511223846-637436c27154
github.com/filecoin-project/specs-actors/v8 v8.0.1
github.com/filecoin-project/specs-actors/v5 v5.0.6
github.com/filecoin-project/specs-actors/v6 v6.0.2
github.com/filecoin-project/specs-actors/v7 v7.0.1
github.com/filecoin-project/specs-actors/v8 v8.0.0
github.com/filecoin-project/specs-storage v0.4.1
github.com/filecoin-project/test-vectors/schema v0.0.5
github.com/gbrlsnchs/jwt/v3 v3.0.1
Expand Down
23 changes: 12 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go
github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
github.com/filecoin-project/go-state-types v0.1.1-0.20210810190654-139e0e79e69e/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
github.com/filecoin-project/go-state-types v0.1.3/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
github.com/filecoin-project/go-state-types v0.1.4-0.20220511200558-7a486892661a/go.mod h1:xCA/WfKlC2zcn3fUmDv4IrzznwS98X5XW/irUP3Lhxg=
github.com/filecoin-project/go-state-types v0.1.4/go.mod h1:xCA/WfKlC2zcn3fUmDv4IrzznwS98X5XW/irUP3Lhxg=
github.com/filecoin-project/go-state-types v0.1.5/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.9 h1:7ffQu+arDAiW5dphWTl8WdgWTo9Kt3BsjGcNYr99crI=
github.com/filecoin-project/go-state-types v0.1.9/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
Expand All @@ -388,8 +388,9 @@ github.com/filecoin-project/index-provider v0.5.0/go.mod h1:KHVrP2vU3YuScb+fawOb
github.com/filecoin-project/pubsub v1.0.0 h1:ZTmT27U07e54qV1mMiQo4HDr0buo8I1LDHBYLXlsNXM=
github.com/filecoin-project/pubsub v1.0.0/go.mod h1:GkpB33CcUtUNrLPhJgfdy4FDx4OMNR9k+46DHx/Lqrg=
github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
github.com/filecoin-project/specs-actors v0.9.15-0.20220514164640-94e0d5e123bd h1:PoQ9+o9zjqD7gBMAvG0nwvpmmONo2lFajmjIfzlqeFc=
github.com/filecoin-project/specs-actors v0.9.15-0.20220514164640-94e0d5e123bd/go.mod h1:pjGEe3QlWtK20ju/aFRsiArbMX6Cn8rqEhhsiCM9xYE=
github.com/filecoin-project/specs-actors v0.9.15 h1:3VpKP5/KaDUHQKAMOg4s35g/syDaEBueKLws0vbsjMc=
github.com/filecoin-project/specs-actors v0.9.15/go.mod h1:pjGEe3QlWtK20ju/aFRsiArbMX6Cn8rqEhhsiCM9xYE=
github.com/filecoin-project/specs-actors/v2 v2.3.5-0.20210114162132-5b58b773f4fb/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc=
github.com/filecoin-project/specs-actors/v2 v2.3.6 h1:UxnWTfQd7JsOae39/aHCK0m1IBjdcyymCJfqxuSkn+g=
github.com/filecoin-project/specs-actors/v2 v2.3.6/go.mod h1:DJMpxVRXvev9t8P0XWA26RmTzN+MHiL9IlItVLT0zUc=
Expand All @@ -399,19 +400,19 @@ github.com/filecoin-project/specs-actors/v3 v3.1.2/go.mod h1:uOJn+m6W8OW/1mdWMEv
github.com/filecoin-project/specs-actors/v4 v4.0.0/go.mod h1:TkHXf/l7Wyw4ZejyXIPS2rK8bBO0rdwhTZyQQgaglng=
github.com/filecoin-project/specs-actors/v4 v4.0.2 h1:VTsv30kIf1Keo8Jlu6Omco+2Ud0pG4EN5UAzyYCibh8=
github.com/filecoin-project/specs-actors/v4 v4.0.2/go.mod h1:zT0GVFxwFS93prGK0b/rMd1sePjRQKfAuodQ9DFAd6Y=
github.com/filecoin-project/specs-actors/v5 v5.0.4-0.20220511204328-97fa6fffc45a/go.mod h1:tg58UmhrivJsYrnsvWNEr+RQugRZCpJA+aTBE71t48E=
github.com/filecoin-project/specs-actors/v5 v5.0.4/go.mod h1:5BAKRAMsOOlD8+qCw4UvT/lTLInCJ3JwOWZbX8Ipwq4=
github.com/filecoin-project/specs-actors/v5 v5.0.6-0.20220514165557-0b29a778685b h1:0DevEGyWsWWItaOuqzMa2b2swyCAwRp6crY3uS35qGk=
github.com/filecoin-project/specs-actors/v5 v5.0.6-0.20220514165557-0b29a778685b/go.mod h1:myb/UGwESp0V1f1BACXSUrFgTWLvGUoG0ZZH7eqriFM=
github.com/filecoin-project/specs-actors/v5 v5.0.5/go.mod h1:dnfda2U+0ZidVnZJ44fnLMa3Mbyzwx51iW/brSsS+nc=
github.com/filecoin-project/specs-actors/v5 v5.0.6 h1:TLtA9hT3pHQF5vB83GmB+m6anw9u6MjdT+VVn/lyC+c=
github.com/filecoin-project/specs-actors/v5 v5.0.6/go.mod h1:myb/UGwESp0V1f1BACXSUrFgTWLvGUoG0ZZH7eqriFM=
github.com/filecoin-project/specs-actors/v6 v6.0.0/go.mod h1:V1AYfi5GkHXipx1mnVivoICZh3wtwPxDVuds+fbfQtk=
github.com/filecoin-project/specs-actors/v6 v6.0.1/go.mod h1:V1AYfi5GkHXipx1mnVivoICZh3wtwPxDVuds+fbfQtk=
github.com/filecoin-project/specs-actors/v6 v6.0.2-0.20220511204807-569c6d12432b h1:UaMSIWqvyBAkM5/hA/iVcTrnwI7IOgQI0Xi4wEkmYM4=
github.com/filecoin-project/specs-actors/v6 v6.0.2-0.20220511204807-569c6d12432b/go.mod h1:UkunB8pzBOV5Rzx0BmvVB2mxMV6CXEnHAC5VlMokOVE=
github.com/filecoin-project/specs-actors/v6 v6.0.2 h1:K1xPRJoW5PBvb08QF9+4w1AjcnqwR6BjTmeltQFCvWo=
github.com/filecoin-project/specs-actors/v6 v6.0.2/go.mod h1:wnfVvPnYmzPZilNvSqCSSA/ZQX3rdV/U/Vf9EIoQhrI=
github.com/filecoin-project/specs-actors/v7 v7.0.0/go.mod h1:TA5FwCna+Yi36POaT7SLKXsgEDvJwc0V/L6ZsO19B9M=
github.com/filecoin-project/specs-actors/v7 v7.0.1-0.20220511223846-637436c27154 h1:NKA2mpz3GAksmrP7P13zLufvoYG9DlasgKxdhrk9gGM=
github.com/filecoin-project/specs-actors/v7 v7.0.1-0.20220511223846-637436c27154/go.mod h1:2pWr2Soyl4yfOkoMThzj41l2lPIRC+CUgU5cW3wI+K4=
github.com/filecoin-project/specs-actors/v8 v8.0.1 h1:4u0tIRJeT5G7F05lwLRIsDnsrN+bJ5Ixj6h49Q7uE2Y=
github.com/filecoin-project/specs-actors/v8 v8.0.1/go.mod h1:UYIPg65iPWoFw5NEftREdJwv9b/5yaLKdCgTvNI/2FA=
github.com/filecoin-project/specs-actors/v7 v7.0.1 h1:w72xCxijK7xs1qzmJiw+WYJaVt2EPHN8oiwpA1Ay3/4=
github.com/filecoin-project/specs-actors/v7 v7.0.1/go.mod h1:tPLEYXoXhcpyLh69Ccq91SOuLXsPWjHiY27CzawjUEk=
github.com/filecoin-project/specs-actors/v8 v8.0.0 h1:c6NztoE4J5j7KvIfGmx9XW9o5aszPl6DU0M4xDqAJVU=
github.com/filecoin-project/specs-actors/v8 v8.0.0/go.mod h1:UYIPg65iPWoFw5NEftREdJwv9b/5yaLKdCgTvNI/2FA=
github.com/filecoin-project/specs-storage v0.4.1 h1:yvLEaLZj8f+uByhNC4mFOtCUyL2wQku+NGBp6hjTe9M=
github.com/filecoin-project/specs-storage v0.4.1/go.mod h1:Z2eK6uMwAOSLjek6+sy0jNV2DSsMEENziMUz0GHRFBw=
github.com/filecoin-project/storetheindex v0.3.5 h1:KoS9TvjPm6zIZfUH8atAHJbVHOO7GTP1MdTG+v0eE+Q=
Expand Down
18 changes: 9 additions & 9 deletions testplans/lotus-soup/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ require (
github.com/filecoin-project/go-data-transfer v1.15.1
github.com/filecoin-project/go-fil-markets v1.20.1-v16-1
github.com/filecoin-project/go-jsonrpc v0.1.5
github.com/filecoin-project/go-state-types v0.1.7
github.com/filecoin-project/go-state-types v0.1.9
github.com/filecoin-project/go-storedcounter v0.1.0
github.com/filecoin-project/lotus v0.0.0-00010101000000-000000000000
github.com/filecoin-project/specs-actors v0.9.15-0.20220514164640-94e0d5e123bd
github.com/filecoin-project/specs-actors v0.9.15
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/hashicorp/go-multierror v1.1.1
Expand All @@ -27,7 +27,7 @@ require (
github.com/ipfs/go-unixfs v0.3.1
github.com/ipld/go-car v0.3.3
github.com/kpacha/opencensus-influxdb v0.0.0-20181102202715-663e2683a27c
github.com/libp2p/go-libp2p v0.19.3
github.com/libp2p/go-libp2p v0.19.4
github.com/libp2p/go-libp2p-core v0.15.1
github.com/libp2p/go-libp2p-pubsub-tracer v0.0.0-20200626141350-e730b32bf1e6
github.com/multiformats/go-multiaddr v0.5.0
Expand Down Expand Up @@ -104,10 +104,10 @@ require (
github.com/filecoin-project/specs-actors/v2 v2.3.6 // indirect
github.com/filecoin-project/specs-actors/v3 v3.1.2 // indirect
github.com/filecoin-project/specs-actors/v4 v4.0.2 // indirect
github.com/filecoin-project/specs-actors/v5 v5.0.6-0.20220514165557-0b29a778685b // indirect
github.com/filecoin-project/specs-actors/v6 v6.0.2-0.20220511204807-569c6d12432b // indirect
github.com/filecoin-project/specs-actors/v7 v7.0.1-0.20220511223846-637436c27154 // indirect
github.com/filecoin-project/specs-actors/v8 v8.0.0-20220422153930-0afe155bfffa // indirect
github.com/filecoin-project/specs-actors/v5 v5.0.6 // indirect
github.com/filecoin-project/specs-actors/v6 v6.0.2 // indirect
github.com/filecoin-project/specs-actors/v7 v7.0.1 // indirect
github.com/filecoin-project/specs-actors/v8 v8.0.0 // indirect
github.com/filecoin-project/specs-storage v0.4.1 // indirect
github.com/filecoin-project/storetheindex v0.3.5 // indirect
github.com/flynn/noise v1.0.0 // indirect
Expand Down Expand Up @@ -215,7 +215,7 @@ require (
github.com/libp2p/go-libp2p-noise v0.4.0 // indirect
github.com/libp2p/go-libp2p-peerstore v0.6.0 // indirect
github.com/libp2p/go-libp2p-pnet v0.2.0 // indirect
github.com/libp2p/go-libp2p-pubsub v0.6.1 // indirect
github.com/libp2p/go-libp2p-pubsub v0.7.0 // indirect
github.com/libp2p/go-libp2p-quic-transport v0.17.0 // indirect
github.com/libp2p/go-libp2p-record v0.1.3 // indirect
github.com/libp2p/go-libp2p-resource-manager v0.2.1 // indirect
Expand All @@ -236,7 +236,7 @@ require (
github.com/libp2p/go-stream-muxer-multistream v0.4.0 // indirect
github.com/libp2p/go-tcp-transport v0.5.1 // indirect
github.com/libp2p/go-ws-transport v0.6.0 // indirect
github.com/libp2p/go-yamux/v3 v3.1.1 // indirect
github.com/libp2p/go-yamux/v3 v3.1.2 // indirect
github.com/lucas-clemente/quic-go v0.27.1 // indirect
github.com/lucasb-eyer/go-colorful v1.0.3 // indirect
github.com/magefile/mage v1.9.0 // indirect
Expand Down
Loading

0 comments on commit 2d07131

Please sign in to comment.