Merge branch 'filecoin-project:master' into master

This commit is contained in:
kaola526
2022-06-14 11:22:48 +08:00
committed by GitHub
343 changed files with 8447 additions and 3436 deletions
+1 -1
View File
@@ -1654,7 +1654,7 @@ var clientQueryAskCmd = &cli.Command{
return xerrors.Errorf("failed to get peerID for miner: %w", err)
}
if mi.PeerId == nil || *mi.PeerId == peer.ID("SETME") {
if mi.PeerId == nil || *mi.PeerId == ("SETME") {
return fmt.Errorf("the miner hasn't initialized yet")
}
+5 -5
View File
@@ -6,7 +6,7 @@ import (
"encoding/hex"
"fmt"
verifreg4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/verifreg"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v8/verifreg"
"github.com/filecoin-project/go-state-types/big"
@@ -96,7 +96,7 @@ var filplusVerifyClientCmd = &cli.Command{
}
// TODO: This should be abstracted over actor versions
params, err := actors.SerializeParams(&verifreg4.AddVerifiedClientParams{Address: target, Allowance: allowance})
params, err := actors.SerializeParams(&verifregtypes.AddVerifiedClientParams{Address: target, Allowance: allowance})
if err != nil {
return err
}
@@ -361,14 +361,14 @@ var filplusSignRemoveDataCapProposal = &cli.Command{
}
}
params := verifreg.RemoveDataCapProposal{
RemovalProposalID: verifreg.RmDcProposalID{ProposalID: id},
params := verifregtypes.RemoveDataCapProposal{
RemovalProposalID: verifregtypes.RmDcProposalID{ProposalID: id},
DataCapAmount: allowanceToRemove,
VerifiedClient: clientIdAddr,
}
paramBuf := new(bytes.Buffer)
paramBuf.WriteString(verifreg.SignatureDomainSeparation_RemoveDataCap)
paramBuf.WriteString(verifregtypes.SignatureDomainSeparation_RemoveDataCap)
err = params.MarshalCBOR(paramBuf)
if err != nil {
return xerrors.Errorf("failed to marshall paramBuf: %w", err)
+5 -4
View File
@@ -10,13 +10,14 @@ import (
lapi "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
"github.com/filecoin-project/lotus/paychmgr"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/build"
"github.com/urfave/cli/v2"
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
lpaych "github.com/filecoin-project/lotus/chain/actors/builtin/paych"
"github.com/filecoin-project/lotus/chain/types"
)
@@ -417,7 +418,7 @@ var paychVoucherCheckCmd = &cli.Command{
return err
}
sv, err := paych.DecodeSignedVoucher(cctx.Args().Get(1))
sv, err := lpaych.DecodeSignedVoucher(cctx.Args().Get(1))
if err != nil {
return err
}
@@ -453,7 +454,7 @@ var paychVoucherAddCmd = &cli.Command{
return err
}
sv, err := paych.DecodeSignedVoucher(cctx.Args().Get(1))
sv, err := lpaych.DecodeSignedVoucher(cctx.Args().Get(1))
if err != nil {
return err
}
@@ -611,7 +612,7 @@ var paychVoucherSubmitCmd = &cli.Command{
return err
}
sv, err := paych.DecodeSignedVoucher(cctx.Args().Get(1))
sv, err := lpaych.DecodeSignedVoucher(cctx.Args().Get(1))
if err != nil {
return err
}
+74
View File
@@ -15,8 +15,13 @@ import (
"sort"
"strconv"
"strings"
"text/tabwriter"
"time"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/chain/consensus/filcns"
@@ -79,6 +84,7 @@ var StateCmd = &cli.Command{
StateExecTraceCmd,
StateNtwkVersionCmd,
StateMinerProvingDeadlineCmd,
StateSysActorCIDsCmd,
},
}
@@ -1875,3 +1881,71 @@ var StateNtwkVersionCmd = &cli.Command{
return nil
},
}
var StateSysActorCIDsCmd = &cli.Command{
Name: "actor-cids",
Usage: "Returns the built-in actor bundle manifest ID & system actor cids",
Flags: []cli.Flag{
&cli.UintFlag{
Name: "network-version",
Usage: "specify network version",
Value: uint(build.NewestNetworkVersion),
},
},
Action: func(cctx *cli.Context) error {
if cctx.Args().Present() {
return ShowHelp(cctx, fmt.Errorf("doesn't expect any arguments"))
}
api, closer, err := GetFullNodeAPI(cctx)
if err != nil {
return err
}
defer closer()
ctx := ReqContext(cctx)
ts, err := LoadTipSet(ctx, cctx, api)
if err != nil {
return err
}
nv, err := api.StateNetworkVersion(ctx, ts.Key())
if err != nil {
return err
}
if cctx.IsSet("network-version") {
nv = network.Version(cctx.Uint64("network-version"))
}
fmt.Printf("Network Version: %d\n", nv)
actorVersion, err := actors.VersionForNetwork(nv)
if err != nil {
return err
}
fmt.Printf("Actor Version: %d\n", actorVersion)
manifestCid, ok := actors.GetManifest(actorVersion)
if !ok {
return xerrors.Errorf("cannot get manifest CID")
}
fmt.Printf("Manifest CID: %v\n", manifestCid)
tw := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
_, _ = fmt.Fprintln(tw, "\nActor\tCID\t")
var actorKeys = actors.GetBuiltinActorsKeys()
for _, name := range actorKeys {
sysActorCID, ok := actors.GetActorCodeID(actorVersion, name)
if !ok {
return xerrors.Errorf("error getting actor %v code id for actor version %d", name,
actorVersion)
}
_, _ = fmt.Fprintf(tw, "%v\t%v\n", name, sysActorCID)
}
return tw.Flush()
},
}