Merge pull request #9712 from filecoin-project/id/update-go-version
_build_: Update to Go Version 1.18.8
This commit is contained in:
commit
b1045c39ed
@ -6,7 +6,7 @@ executors:
|
||||
golang:
|
||||
docker:
|
||||
# Must match GO_VERSION_MIN in project root
|
||||
- image: cimg/go:1.18.1
|
||||
- image: cimg/go:1.18.8
|
||||
resource_class: 2xlarge
|
||||
ubuntu:
|
||||
docker:
|
||||
|
@ -6,7 +6,7 @@ executors:
|
||||
golang:
|
||||
docker:
|
||||
# Must match GO_VERSION_MIN in project root
|
||||
- image: cimg/go:1.18.1
|
||||
- image: cimg/go:1.18.8
|
||||
resource_class: 2xlarge
|
||||
ubuntu:
|
||||
docker:
|
||||
|
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.18.1'
|
||||
go-version: '1.18.8'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM golang:1.18.1-buster AS builder-deps
|
||||
FROM golang:1.18.8-buster AS builder-deps
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
|
||||
|
@ -1 +1 @@
|
||||
1.18.1
|
||||
1.18.8
|
||||
|
@ -10,7 +10,7 @@
|
||||
<a href="https://circleci.com/gh/filecoin-project/lotus"><img src="https://circleci.com/gh/filecoin-project/lotus.svg?style=svg"></a>
|
||||
<a href="https://codecov.io/gh/filecoin-project/lotus"><img src="https://codecov.io/gh/filecoin-project/lotus/branch/master/graph/badge.svg"></a>
|
||||
<a href="https://goreportcard.com/report/github.com/filecoin-project/lotus"><img src="https://goreportcard.com/badge/github.com/filecoin-project/lotus" /></a>
|
||||
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.18.1-blue.svg" /></a>
|
||||
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.18.8-blue.svg" /></a>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
@ -71,10 +71,10 @@ For other distributions you can find the required dependencies [here.](https://l
|
||||
|
||||
#### Go
|
||||
|
||||
To build Lotus, you need a working installation of [Go 1.18.1 or higher](https://golang.org/dl/):
|
||||
To build Lotus, you need a working installation of [Go 1.18.8 or higher](https://golang.org/dl/):
|
||||
|
||||
```bash
|
||||
wget -c https://golang.org/dl/go1.18.1.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
|
||||
wget -c https://golang.org/dl/go1.18.8.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
|
||||
```
|
||||
|
||||
**TIP:**
|
||||
|
@ -24,6 +24,8 @@ import (
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
"github.com/libp2p/go-libp2p/core/protocol"
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
"golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
@ -456,7 +458,8 @@ func exampleStruct(method string, t, parent reflect.Type) interface{} {
|
||||
if f.Type == parent {
|
||||
continue
|
||||
}
|
||||
if strings.Title(f.Name) == f.Name {
|
||||
caser := cases.Title(language.English)
|
||||
if caser.String(f.Name) == f.Name {
|
||||
ns.Elem().Field(i).Set(reflect.ValueOf(ExampleValue(method, f.Type, t)))
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -29,7 +29,7 @@ func Weight(ctx context.Context, stateBs bstore.Blockstore, ts *types.TipSet) (t
|
||||
|
||||
// >>> wFunction(totalPowerAtTipset(ts)) * 2^8 <<< + (wFunction(totalPowerAtTipset(ts)) * sum(ts.blocks[].ElectionProof.WinCount) * wRatio_num * 2^8) / (e * wRatio_den)
|
||||
|
||||
tpow := big2.Zero()
|
||||
var tpow big2.Int
|
||||
{
|
||||
cst := cbor.NewCborStore(stateBs)
|
||||
state, err := state.LoadStateTree(cst, ts.ParentState())
|
||||
|
@ -105,7 +105,7 @@ func TestFundManagerBasic(t *testing.T) {
|
||||
// Note: Expect failure because there is no available balance to withdraw:
|
||||
// balance - reserved = 16 - 16 = 0
|
||||
amt = abi.NewTokenAmount(1)
|
||||
sentinel, err = s.fm.Withdraw(s.ctx, s.walletAddr, s.acctAddr, amt)
|
||||
_, err = s.fm.Withdraw(s.ctx, s.walletAddr, s.acctAddr, amt)
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ func ParseFIL(s string) (FIL, error) {
|
||||
return FIL{}, fmt.Errorf("string length too large: %d", len(s))
|
||||
}
|
||||
|
||||
r, ok := new(big.Rat).SetString(s)
|
||||
r, ok := new(big.Rat).SetString(s) //nolint:gosec
|
||||
if !ok {
|
||||
return FIL{}, fmt.Errorf("failed to parse %q as a decimal number", s)
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ func FullNodeProxy[T api.FullNode](ins []T, outstr *api.FullNodeStruct) {
|
||||
}
|
||||
|
||||
total := len(rins)
|
||||
result, err := retry.Retry(ctx, 5, initialBackoff, errorsToRetry, func() (results []reflect.Value, err2 error) {
|
||||
result, _ := retry.Retry(ctx, 5, initialBackoff, errorsToRetry, func() ([]reflect.Value, error) {
|
||||
curr = (curr + 1) % total
|
||||
|
||||
result := fns[curr].Call(args)
|
||||
|
@ -149,7 +149,7 @@ var importBenchCmd = &cli.Command{
|
||||
|
||||
http.Handle("/debug/metrics", exporter)
|
||||
|
||||
http.ListenAndServe("localhost:6060", nil) //nolint:errcheck
|
||||
_ = http.ListenAndServe("localhost:6060", nil)
|
||||
}()
|
||||
|
||||
var tdir string
|
||||
@ -771,7 +771,7 @@ var importAnalyzeCmd = &cli.Command{
|
||||
}
|
||||
|
||||
go func() {
|
||||
http.ListenAndServe("localhost:6060", nil) //nolint:errcheck
|
||||
_ = http.ListenAndServe("localhost:6060", nil)
|
||||
}()
|
||||
|
||||
fi, err := os.Open(cctx.Args().First())
|
||||
|
@ -74,6 +74,10 @@ var runCmd = &cli.Command{
|
||||
Name: "captcha-threshold",
|
||||
Value: 0.5,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "http-server-timeout",
|
||||
Value: "30s",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
sendPerRequest, err := types.ParseFIL(cctx.String("amount"))
|
||||
@ -127,7 +131,17 @@ var runCmd = &cli.Command{
|
||||
os.Exit(0)
|
||||
}()
|
||||
|
||||
return http.ListenAndServe(cctx.String("front"), nil)
|
||||
timeout, err := time.ParseDuration(cctx.String("http-server-timeout"))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("invalid time string %s: %x", cctx.String("http-server-timeout"), err)
|
||||
}
|
||||
|
||||
server := &http.Server{
|
||||
Addr: cctx.String("front"),
|
||||
ReadHeaderTimeout: timeout,
|
||||
}
|
||||
|
||||
return server.ListenAndServe()
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -418,10 +418,24 @@ var runCmd = &cli.Command{
|
||||
Usage: "messages with a prove cap larger than this will be skipped when processing pre commit messages",
|
||||
Value: "0.000000001",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "http-server-timeout",
|
||||
Value: "30s",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
timeout, err := time.ParseDuration(cctx.String("http-timeout"))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("invalid time string %s: %x", cctx.String("http-timeout"), err)
|
||||
}
|
||||
|
||||
go func() {
|
||||
http.ListenAndServe(":6060", nil) //nolint:errcheck
|
||||
server := &http.Server{
|
||||
Addr: ":6060",
|
||||
ReadHeaderTimeout: timeout,
|
||||
}
|
||||
|
||||
_ = server.ListenAndServe()
|
||||
}()
|
||||
|
||||
ctx := context.Background()
|
||||
@ -898,7 +912,7 @@ func (r *refunder) EnsureMinerMinimums(ctx context.Context, tipset *types.TipSet
|
||||
func (r *refunder) processTipsetStorageMarketActor(ctx context.Context, tipset *types.TipSet, msg api.Message, recp *types.MessageReceipt) (bool, string, types.BigInt, error) {
|
||||
|
||||
m := msg.Message
|
||||
refundValue := types.NewInt(0)
|
||||
var refundValue types.BigInt
|
||||
var messageMethod string
|
||||
|
||||
switch m.Method {
|
||||
@ -925,7 +939,7 @@ func (r *refunder) processTipsetStorageMarketActor(ctx context.Context, tipset *
|
||||
func (r *refunder) processTipsetStorageMinerActor(ctx context.Context, tipset *types.TipSet, msg api.Message, recp *types.MessageReceipt) (bool, string, types.BigInt, error) {
|
||||
|
||||
m := msg.Message
|
||||
refundValue := types.NewInt(0)
|
||||
var refundValue types.BigInt
|
||||
var messageMethod string
|
||||
|
||||
if _, found := r.blockmap[m.To]; found {
|
||||
|
@ -36,7 +36,7 @@ type Option uint64
|
||||
|
||||
const (
|
||||
Approve Option = 49
|
||||
Reject = 50
|
||||
Reject Option = 50
|
||||
)
|
||||
|
||||
type Vote struct {
|
||||
@ -148,7 +148,7 @@ var finalResultCmd = &cli.Command{
|
||||
}
|
||||
votes, err := getVotesMap(vj)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to get voters: ", err)
|
||||
return xerrors.Errorf("failed to get voters: %w\n", err)
|
||||
}
|
||||
|
||||
type minerBriefInfo struct {
|
||||
@ -160,23 +160,23 @@ var finalResultCmd = &cli.Command{
|
||||
// power actor
|
||||
pa, err := st.GetActor(power.Address)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to get power actor: \n", err)
|
||||
return xerrors.Errorf("failed to get power actor: %w\n", err)
|
||||
}
|
||||
|
||||
powerState, err := power.Load(store, pa)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to get power state: \n", err)
|
||||
return xerrors.Errorf("failed to get power state: %w\n", err)
|
||||
}
|
||||
|
||||
//market actor
|
||||
ma, err := st.GetActor(market.Address)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("fail to get market actor: ", err)
|
||||
return xerrors.Errorf("fail to get market actor: %w\n", err)
|
||||
}
|
||||
|
||||
marketState, err := market.Load(store, ma)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("fail to load market state: ", err)
|
||||
return xerrors.Errorf("fail to load market state: %w\n", err)
|
||||
}
|
||||
|
||||
lookupId := func(addr address.Address) address.Address {
|
||||
@ -219,7 +219,7 @@ var finalResultCmd = &cli.Command{
|
||||
// TODO: Confirm that these are always ID addresses
|
||||
signers, err := ms.Signers()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("fail to get msig signers", err)
|
||||
return xerrors.Errorf("fail to get msig signers: %w", err)
|
||||
}
|
||||
for _, s := range signers {
|
||||
signerId := lookupId(s)
|
||||
@ -244,12 +244,12 @@ var finalResultCmd = &cli.Command{
|
||||
if builtin.IsStorageMinerActor(act.Code) {
|
||||
m, err := miner.Load(store, act)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("fail to load miner actor: \n", err)
|
||||
return xerrors.Errorf("fail to load miner actor: %w", err)
|
||||
}
|
||||
|
||||
info, err := m.Info()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("fail to get miner info: \n", err)
|
||||
return xerrors.Errorf("fail to get miner info: %w\n", err)
|
||||
}
|
||||
|
||||
ownerId := lookupId(info.Owner)
|
||||
@ -353,7 +353,7 @@ var finalResultCmd = &cli.Command{
|
||||
//process votes for regular accounts
|
||||
accountActor, err := st.GetActor(signerId)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("fail to get account account for signer: ", err)
|
||||
return xerrors.Errorf("fail to get account account for signer: %w\n", err)
|
||||
}
|
||||
|
||||
clientBytes, ok := clientToDealStorage[signerId]
|
||||
|
@ -234,6 +234,9 @@ var replayOfflineCmd = &cli.Command{
|
||||
return xerrors.Errorf("could not find message within the last %d epochs", lookbackLimit)
|
||||
}
|
||||
executionTs, err := cs.GetTipsetByHeight(ctx, ts.Height()-2, ts, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tw := tabwriter.NewWriter(os.Stdout, 8, 2, 2, ' ', tabwriter.AlignRight)
|
||||
res, err := sm.CallWithGas(ctx, msg, []types.ChainMsg{}, executionTs)
|
||||
|
@ -98,6 +98,9 @@ var invariantsCmd = &cli.Command{
|
||||
fmt.Println("Network Version ", nv)
|
||||
|
||||
av, err := actorstypes.VersionForNetwork(nv)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println("Actors Version ", av)
|
||||
|
||||
actorCodeCids, err := actors.GetActorCodeIDs(av)
|
||||
@ -114,6 +117,9 @@ var invariantsCmd = &cli.Command{
|
||||
}
|
||||
|
||||
actorTree, err := builtin.LoadTree(actorStore, stateRoot.Actors)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
startTime := time.Now()
|
||||
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
"github.com/chzyer/readline"
|
||||
"github.com/urfave/cli/v2"
|
||||
@ -25,6 +26,10 @@ var itestdCmd = &cli.Command{
|
||||
Name: "listen",
|
||||
Value: "127.0.0.1:5674",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "http-server-timeout",
|
||||
Value: "30s",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
var nodes []kit.ItestdNotif
|
||||
@ -44,9 +49,14 @@ var itestdCmd = &cli.Command{
|
||||
if err != nil {
|
||||
return xerrors.Errorf("net listen: %w", err)
|
||||
}
|
||||
|
||||
timeout, err := time.ParseDuration(cctx.String("http-server-timeout"))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("invalid time string %s: %x", cctx.String("http-server-timeout"), err)
|
||||
}
|
||||
s := &httptest.Server{
|
||||
Listener: l,
|
||||
Config: &http.Server{Handler: m},
|
||||
Config: &http.Server{Handler: m, ReadHeaderTimeout: timeout},
|
||||
}
|
||||
s.Start()
|
||||
fmt.Printf("ITest env:\n\nLOTUS_ITESTD=%s\n\nSay 'sh' to spawn a shell connected to test nodes\n--- waiting for clients\n", s.URL)
|
||||
|
@ -13,6 +13,7 @@ import (
|
||||
"go.opencensus.io/stats"
|
||||
"go.opencensus.io/stats/view"
|
||||
"go.opencensus.io/tag"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
@ -76,8 +77,14 @@ type msgInfo struct {
|
||||
|
||||
var mpoolStatsCmd = &cli.Command{
|
||||
Name: "mpool-stats",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "http-server-timeout",
|
||||
Value: "30s",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
logging.SetLogLevel("rpc", "ERROR")
|
||||
_ = logging.SetLogLevel("rpc", "ERROR")
|
||||
|
||||
if err := view.Register(AgeView, SizeView, InboundRate, InclusionRate, MsgWait); err != nil {
|
||||
return err
|
||||
@ -92,8 +99,18 @@ var mpoolStatsCmd = &cli.Command{
|
||||
|
||||
http.Handle("/debug/metrics", expo)
|
||||
|
||||
timeout, err := time.ParseDuration(cctx.String("http-server-timeout"))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("invalid time string %s: %x", cctx.String("http-server-timeout"), err)
|
||||
}
|
||||
|
||||
go func() {
|
||||
if err := http.ListenAndServe(":10555", nil); err != nil {
|
||||
server := &http.Server{
|
||||
Addr: ":10555",
|
||||
ReadHeaderTimeout: timeout,
|
||||
}
|
||||
|
||||
if err := server.ListenAndServe(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
|
@ -239,8 +239,10 @@ func checkMigrationInvariants(ctx context.Context, v8StateRootCid cid.Cid, v9Sta
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
v9actorTree, err := builtin.LoadTree(actorStore, v9stateRoot.Actors)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
messages, err := v9.CheckStateInvariants(v9actorTree, epoch, actorCodeCids)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("checking state invariants: %w", err)
|
||||
@ -465,7 +467,7 @@ func compareProposalToAllocation(prop market8.DealProposal, alloc verifreg9.Allo
|
||||
return xerrors.Errorf("couldnt get ID from address")
|
||||
}
|
||||
if proposalClientID != uint64(alloc.Client) {
|
||||
return xerrors.Errorf("client id mismatch between proposal and allocation: %s, %s", proposalClientID, alloc.Client)
|
||||
return xerrors.Errorf("client id mismatch between proposal and allocation: %v, %v", proposalClientID, alloc.Client)
|
||||
}
|
||||
|
||||
proposalProviderID, err := address.IDFromAddress(prop.Provider)
|
||||
@ -473,11 +475,11 @@ func compareProposalToAllocation(prop market8.DealProposal, alloc verifreg9.Allo
|
||||
return xerrors.Errorf("couldnt get ID from address")
|
||||
}
|
||||
if proposalProviderID != uint64(alloc.Provider) {
|
||||
return xerrors.Errorf("provider id mismatch between proposal and allocation: %s, %s", proposalProviderID, alloc.Provider)
|
||||
return xerrors.Errorf("provider id mismatch between proposal and allocation: %v, %v", proposalProviderID, alloc.Provider)
|
||||
}
|
||||
|
||||
if prop.PieceSize != alloc.Size {
|
||||
return xerrors.Errorf("piece size mismatch between proposal and allocation: %s, %s", prop.PieceSize, alloc.Size)
|
||||
return xerrors.Errorf("piece size mismatch between proposal and allocation: %v, %v", prop.PieceSize, alloc.Size)
|
||||
}
|
||||
|
||||
if alloc.TermMax != 540*builtin.EpochsInDay {
|
||||
|
@ -121,6 +121,10 @@ var multisigGetAllCmd = &cli.Command{
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
out, err := json.MarshalIndent(msigActorsInfo, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -12,6 +12,7 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
"go.opencensus.io/stats"
|
||||
"go.opencensus.io/stats/view"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
|
||||
@ -128,6 +129,10 @@ var runCmd = &cli.Command{
|
||||
EnvVars: []string{"LOTUS_STATS_IPLD_STORE_CACHE_SIZE"},
|
||||
Value: 2 << 15,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "http-server-timeout",
|
||||
Value: "30s",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
ctx := context.Background()
|
||||
@ -158,9 +163,18 @@ var runCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
timeout, err := time.ParseDuration(cctx.String("http-server-timeout"))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("invalid time string %s: %x", cctx.String("http-server-timeout"), err)
|
||||
}
|
||||
|
||||
go func() {
|
||||
http.Handle("/metrics", exporter)
|
||||
if err := http.ListenAndServe(":6688", nil); err != nil {
|
||||
server := &http.Server{
|
||||
Addr: ":6688",
|
||||
ReadHeaderTimeout: timeout,
|
||||
}
|
||||
if err := server.ListenAndServe(); err != nil {
|
||||
log.Errorw("failed to start http server", "err", err)
|
||||
}
|
||||
}()
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/gbrlsnchs/jwt/v3"
|
||||
"github.com/gorilla/mux"
|
||||
@ -142,6 +143,10 @@ var runCmd = &cli.Command{
|
||||
Usage: "(insecure) disable api auth",
|
||||
Hidden: true,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "http-server-timeout",
|
||||
Value: "30s",
|
||||
},
|
||||
},
|
||||
Description: "Needs FULLNODE_API_INFO env-var to be set before running (see lotus-wallet --help for setup instructions)",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
@ -239,8 +244,14 @@ var runCmd = &cli.Command{
|
||||
}
|
||||
}
|
||||
|
||||
timeout, err := time.ParseDuration(cctx.String("http-server-timeout"))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("invalid time string %s: %x", cctx.String("http-server-timeout"), err)
|
||||
}
|
||||
|
||||
srv := &http.Server{
|
||||
Handler: handler,
|
||||
Handler: handler,
|
||||
ReadHeaderTimeout: timeout,
|
||||
BaseContext: func(listener net.Listener) context.Context {
|
||||
ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, "lotus-wallet"))
|
||||
return ctx
|
||||
|
@ -272,6 +272,10 @@ var runCmd = &cli.Command{
|
||||
Value: "30m",
|
||||
EnvVars: []string{"LOTUS_WORKER_TIMEOUT"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "http-server-timeout",
|
||||
Value: "30s",
|
||||
},
|
||||
},
|
||||
Before: func(cctx *cli.Context) error {
|
||||
if cctx.IsSet("address") {
|
||||
@ -562,8 +566,14 @@ var runCmd = &cli.Command{
|
||||
|
||||
log.Info("Setting up control endpoint at " + address)
|
||||
|
||||
timeout, err := time.ParseDuration(cctx.String("http-server-timeout"))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("invalid time string %s: %x", cctx.String("http-server-timeout"), err)
|
||||
}
|
||||
|
||||
srv := &http.Server{
|
||||
Handler: sealworker.WorkerHandler(nodeApi.AuthVerify, remoteHandler, workerApi, true),
|
||||
Handler: sealworker.WorkerHandler(nodeApi.AuthVerify, remoteHandler, workerApi, true),
|
||||
ReadHeaderTimeout: timeout,
|
||||
BaseContext: func(listener net.Listener) context.Context {
|
||||
ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, "lotus-worker"))
|
||||
return ctx
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -75,10 +75,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
1,
|
||||
"sealing",
|
||||
@ -93,7 +93,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -108,16 +108,14 @@ Response:
|
||||
```json
|
||||
{
|
||||
"Hostname": "string value",
|
||||
"IgnoreResources": true,
|
||||
"IgnoreResources": false,
|
||||
"Resources": {
|
||||
"MemPhysical": 42,
|
||||
"MemUsed": 42,
|
||||
"MemSwap": 42,
|
||||
"MemSwapUsed": 42,
|
||||
"CPUs": 42,
|
||||
"GPUs": [
|
||||
"string value"
|
||||
],
|
||||
"MemPhysical": 0,
|
||||
"MemUsed": 0,
|
||||
"MemSwap": 0,
|
||||
"MemSwapUsed": 0,
|
||||
"CPUs": 0,
|
||||
"GPUs": null,
|
||||
"Resources": {
|
||||
"post/v0/windowproof": {
|
||||
"0": {
|
||||
@ -1423,11 +1421,11 @@ Response:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"ID": "76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8",
|
||||
"ID": "",
|
||||
"Weight": 42,
|
||||
"LocalPath": "string value",
|
||||
"CanSeal": true,
|
||||
"CanStore": true
|
||||
"LocalPath": "",
|
||||
"CanSeal": false,
|
||||
"CanStore": false
|
||||
}
|
||||
]
|
||||
```
|
||||
@ -1492,10 +1490,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
[
|
||||
1024
|
||||
@ -1512,7 +1510,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1540,7 +1538,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1557,10 +1555,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
true,
|
||||
{
|
||||
@ -1580,7 +1578,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1597,10 +1595,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
}
|
||||
]
|
||||
```
|
||||
@ -1612,7 +1610,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1626,10 +1624,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
}
|
||||
]
|
||||
```
|
||||
@ -1641,7 +1639,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1658,10 +1656,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
{
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
@ -1676,7 +1674,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1692,11 +1690,9 @@ Inputs:
|
||||
1000,
|
||||
[
|
||||
{
|
||||
"SealProof": 8,
|
||||
"SectorNumber": 9,
|
||||
"SealedCID": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
"SealProof": 0,
|
||||
"SectorNumber": 0,
|
||||
"SealedCID": null,
|
||||
"Challenge": [
|
||||
42
|
||||
],
|
||||
@ -1712,8 +1708,8 @@ Response:
|
||||
```json
|
||||
{
|
||||
"PoStProofs": {
|
||||
"PoStProof": 8,
|
||||
"ProofBytes": "Ynl0ZSBhcnJheQ=="
|
||||
"PoStProof": 0,
|
||||
"ProofBytes": null
|
||||
},
|
||||
"Skipped": [
|
||||
{
|
||||
@ -1736,11 +1732,9 @@ Inputs:
|
||||
1000,
|
||||
[
|
||||
{
|
||||
"SealProof": 8,
|
||||
"SectorNumber": 9,
|
||||
"SealedCID": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
"SealProof": 0,
|
||||
"SectorNumber": 0,
|
||||
"SealedCID": null,
|
||||
"Challenge": [
|
||||
42
|
||||
],
|
||||
@ -1755,8 +1749,8 @@ Response:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"PoStProof": 8,
|
||||
"ProofBytes": "Ynl0ZSBhcnJheQ=="
|
||||
"PoStProof": 0,
|
||||
"ProofBytes": null
|
||||
}
|
||||
]
|
||||
```
|
||||
@ -1774,10 +1768,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
1
|
||||
]
|
||||
@ -1790,7 +1784,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1821,10 +1815,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
{
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
@ -1845,7 +1839,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1859,10 +1853,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
{
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
@ -1886,7 +1880,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1903,10 +1897,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
[
|
||||
{
|
||||
@ -1924,7 +1918,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1941,17 +1935,15 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
[
|
||||
{
|
||||
"Size": 1032,
|
||||
"PieceCID": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
}
|
||||
"PieceCID": null
|
||||
}
|
||||
]
|
||||
]
|
||||
@ -1964,7 +1956,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -1981,19 +1973,17 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
"Bw==",
|
||||
"Bw==",
|
||||
[
|
||||
{
|
||||
"Size": 1032,
|
||||
"PieceCID": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
}
|
||||
"PieceCID": null
|
||||
}
|
||||
],
|
||||
{
|
||||
@ -2014,7 +2004,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -2028,10 +2018,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
"Bw=="
|
||||
]
|
||||
@ -2044,7 +2034,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -2058,18 +2048,16 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
"Bw==",
|
||||
[
|
||||
{
|
||||
"Size": 1032,
|
||||
"PieceCID": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
}
|
||||
"PieceCID": null
|
||||
}
|
||||
]
|
||||
]
|
||||
@ -2082,7 +2070,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -2096,10 +2084,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
"Bw=="
|
||||
]
|
||||
@ -2112,7 +2100,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
@ -2263,10 +2251,10 @@ Inputs:
|
||||
[
|
||||
{
|
||||
"ID": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
"Miner": 0,
|
||||
"Number": 0
|
||||
},
|
||||
"ProofType": 8
|
||||
"ProofType": 0
|
||||
},
|
||||
1040384,
|
||||
1024,
|
||||
@ -2284,7 +2272,7 @@ Response:
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
"ID": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
```
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -40,6 +40,7 @@ USAGE:
|
||||
OPTIONS:
|
||||
--addpiece enable addpiece (default: true) [$LOTUS_WORKER_ADDPIECE]
|
||||
--commit enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap) (default: true) [$LOTUS_WORKER_COMMIT]
|
||||
--http-server-timeout value (default: "30s")
|
||||
--listen value host address and port the worker api will listen on (default: "0.0.0.0:3456") [$LOTUS_WORKER_LISTEN]
|
||||
--name value custom worker name (default: hostname) [$LOTUS_WORKER_NAME]
|
||||
--no-default disable all default compute tasks, use the worker for storage/fetching only (default: false) [$LOTUS_WORKER_NO_DEFAULT]
|
||||
|
4
go.mod
4
go.mod
@ -115,7 +115,6 @@ require (
|
||||
github.com/libp2p/go-libp2p-consensus v0.0.1
|
||||
github.com/libp2p/go-libp2p-gorpc v0.4.0
|
||||
github.com/libp2p/go-libp2p-kad-dht v0.18.0
|
||||
github.com/libp2p/go-libp2p-peerstore v0.8.0
|
||||
github.com/libp2p/go-libp2p-pubsub v0.8.1
|
||||
github.com/libp2p/go-libp2p-raft v0.1.8
|
||||
github.com/libp2p/go-libp2p-record v0.2.0
|
||||
@ -156,6 +155,7 @@ require (
|
||||
golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5
|
||||
golang.org/x/sync v0.0.0-20220907140024-f12130a52804
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8
|
||||
golang.org/x/text v0.3.7
|
||||
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9
|
||||
golang.org/x/tools v0.1.12
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
|
||||
@ -265,6 +265,7 @@ require (
|
||||
github.com/libp2p/go-libp2p-gostream v0.5.0 // indirect
|
||||
github.com/libp2p/go-libp2p-kbucket v0.5.0 // indirect
|
||||
github.com/libp2p/go-libp2p-noise v0.5.0 // indirect
|
||||
github.com/libp2p/go-libp2p-peerstore v0.8.0 // indirect
|
||||
github.com/libp2p/go-libp2p-tls v0.5.0 // indirect
|
||||
github.com/libp2p/go-nat v0.1.0 // indirect
|
||||
github.com/libp2p/go-netroute v0.2.0 // indirect
|
||||
@ -333,7 +334,6 @@ require (
|
||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4 // indirect
|
||||
google.golang.org/grpc v1.45.0 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
manet "github.com/multiformats/go-multiaddr/net"
|
||||
@ -22,7 +23,10 @@ type Closer func()
|
||||
func CreateRPCServer(t *testing.T, handler http.Handler, listener net.Listener) (*httptest.Server, multiaddr.Multiaddr, Closer) {
|
||||
testServ := &httptest.Server{
|
||||
Listener: listener,
|
||||
Config: &http.Server{Handler: handler},
|
||||
Config: &http.Server{
|
||||
Handler: handler,
|
||||
ReadHeaderTimeout: 30 * time.Second,
|
||||
},
|
||||
}
|
||||
testServ.Start()
|
||||
|
||||
|
@ -38,8 +38,6 @@ import (
|
||||
)
|
||||
|
||||
func TestMigrationNV17(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
kit.QuietMiningLogs()
|
||||
|
||||
rootKey, err := key.GenerateKey(types.KTSecp256k1)
|
||||
@ -201,6 +199,7 @@ func TestMigrationNV17(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
sig, err := clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes())
|
||||
require.NoError(t, err)
|
||||
|
||||
publishDealParams := markettypes.PublishStorageDealsParams{
|
||||
Deals: []markettypes.ClientDealProposal{{
|
||||
@ -407,6 +406,7 @@ func TestMigrationNV17(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
sig, err = clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes())
|
||||
require.NoError(t, err)
|
||||
|
||||
publishDealParams = markettypes.PublishStorageDealsParams{
|
||||
Deals: []markettypes.ClientDealProposal{{
|
||||
|
@ -31,8 +31,6 @@ import (
|
||||
)
|
||||
|
||||
func TestGetAllocationForPendingDeal(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
rootKey, err := key.GenerateKey(types.KTSecp256k1)
|
||||
require.NoError(t, err)
|
||||
|
||||
@ -146,6 +144,7 @@ func TestGetAllocationForPendingDeal(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
sig, err := api.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes())
|
||||
require.NoError(t, err)
|
||||
|
||||
publishDealParams := markettypes.PublishStorageDealsParams{
|
||||
Deals: []markettypes.ClientDealProposal{{
|
||||
@ -196,5 +195,6 @@ func TestGetAllocationForPendingDeal(t *testing.T) {
|
||||
}
|
||||
|
||||
marketDeal, err := api.StateMarketStorageDeal(ctx, dealIds[0], types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, marketDeal.State.SectorStartEpoch, abi.ChainEpoch(-1))
|
||||
}
|
||||
|
@ -79,7 +79,6 @@ func setup(ctx context.Context, t *testing.T, node0 *kit.TestFullNode, node1 *ki
|
||||
node.Override(node.GoRPCServer, modules.NewRPCServer),
|
||||
)
|
||||
//raftOps := kit.ConstructorOpts()
|
||||
kit.ThroughRPC()
|
||||
|
||||
ens := kit.NewEnsemble(t).FullNode(node0, raftOps, kit.ThroughRPC()).FullNode(node1, raftOps, kit.ThroughRPC()).FullNode(node2, raftOps, kit.ThroughRPC())
|
||||
node0.AssignPrivKey(pkey0)
|
||||
@ -527,7 +526,6 @@ func TestGoRPCAuth(t *testing.T) {
|
||||
node.Override(node.GoRPCServer, modules.NewRPCServer),
|
||||
)
|
||||
//raftOps := kit.ConstructorOpts()
|
||||
kit.ThroughRPC()
|
||||
|
||||
ens := kit.NewEnsemble(t).FullNode(&node0, raftOps, kit.ThroughRPC()).FullNode(&node1, raftOps, kit.ThroughRPC()).FullNode(&node2, raftOps, kit.ThroughRPC()).FullNode(&node3, raftOps)
|
||||
node0.AssignPrivKey(pkey0)
|
||||
|
@ -29,8 +29,6 @@ import (
|
||||
)
|
||||
|
||||
func TestNoRemoveDatacapFromVerifreg(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
kit.QuietMiningLogs()
|
||||
|
||||
rootKey, err := key.GenerateKey(types.KTSecp256k1)
|
||||
@ -185,6 +183,7 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
sig, err := clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes())
|
||||
require.NoError(t, err)
|
||||
|
||||
publishDealParams := markettypes.PublishStorageDealsParams{
|
||||
Deals: []markettypes.ClientDealProposal{{
|
||||
@ -276,6 +275,7 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) {
|
||||
Params: params,
|
||||
Value: big.Zero(),
|
||||
}, types.EmptyTSK)
|
||||
require.Error(t, err)
|
||||
require.False(t, callResult.MsgRct.ExitCode.IsSuccess())
|
||||
|
||||
verifregDatacapAfter, err := clientApi.StateVerifiedClientStatus(ctx, builtin.VerifiedRegistryActorAddr, types.EmptyTSK)
|
||||
|
@ -152,6 +152,12 @@ func NewConsensus(host host.Host, cfg *ClusterRaftConfig, mpool *messagepool.Mes
|
||||
|
||||
peers := []peer.ID{}
|
||||
addrInfos, err := addrutil.ParseAddresses(ctx, cfg.InitPeerset)
|
||||
if err != nil {
|
||||
logger.Error("error parsing addresses: ", err)
|
||||
cancel()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, addrInfo := range addrInfos {
|
||||
peers = append(peers, addrInfo.ID)
|
||||
|
||||
@ -422,7 +428,7 @@ func (cc *Consensus) RmPeer(ctx context.Context, pid peer.ID) error {
|
||||
return err
|
||||
}
|
||||
// Being here means we are the leader and can commit
|
||||
finalErr = cc.raft.RemovePeer(ctx, peer.Encode(pid))
|
||||
finalErr = cc.raft.RemovePeer(ctx, pid.String())
|
||||
if finalErr != nil {
|
||||
time.Sleep(cc.config.CommitRetryDelay)
|
||||
continue
|
||||
|
@ -80,7 +80,7 @@ func newRaftWrapper(
|
||||
raftW.staging = staging
|
||||
raftW.repo = repo
|
||||
// Set correct LocalID
|
||||
cfg.RaftConfig.LocalID = hraft.ServerID(peer.Encode(host.ID()))
|
||||
cfg.RaftConfig.LocalID = hraft.ServerID(host.ID().String())
|
||||
|
||||
df := cfg.GetDataFolder(repo)
|
||||
err := makeDataFolder(df)
|
||||
@ -248,7 +248,7 @@ func makeServerConf(peers []peer.ID) hraft.Configuration {
|
||||
|
||||
// Servers are peers + self. We avoid duplicate entries below
|
||||
for _, pid := range peers {
|
||||
p := peer.Encode(pid)
|
||||
p := pid.String()
|
||||
_, ok := sm[p]
|
||||
if !ok { // avoid dups
|
||||
sm[p] = struct{}{}
|
||||
@ -284,7 +284,7 @@ func (rw *raftWrapper) WaitForLeader(ctx context.Context) (string, error) {
|
||||
func (rw *raftWrapper) WaitForVoter(ctx context.Context) error {
|
||||
logger.Debug("waiting until we are promoted to a voter")
|
||||
|
||||
pid := hraft.ServerID(peer.Encode(rw.host.ID()))
|
||||
pid := hraft.ServerID(rw.host.ID().String())
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
|
@ -7,11 +7,11 @@ import (
|
||||
nilrouting "github.com/ipfs/go-ipfs-routing/none"
|
||||
"github.com/libp2p/go-libp2p"
|
||||
dht "github.com/libp2p/go-libp2p-kad-dht"
|
||||
"github.com/libp2p/go-libp2p-peerstore/pstoremem"
|
||||
record "github.com/libp2p/go-libp2p-record"
|
||||
"github.com/libp2p/go-libp2p/core/host"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
"github.com/libp2p/go-libp2p/core/peerstore"
|
||||
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem"
|
||||
routedhost "github.com/libp2p/go-libp2p/p2p/host/routed"
|
||||
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
|
||||
"go.uber.org/fx"
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
_ "net/http/pprof"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gorilla/mux"
|
||||
@ -51,7 +52,8 @@ func ServeRPC(h http.Handler, id string, addr multiaddr.Multiaddr) (StopFunc, er
|
||||
|
||||
// Instantiate the server and start listening.
|
||||
srv := &http.Server{
|
||||
Handler: h,
|
||||
Handler: h,
|
||||
ReadHeaderTimeout: 30 * time.Second,
|
||||
BaseContext: func(listener net.Listener) context.Context {
|
||||
ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, id))
|
||||
return ctx
|
||||
|
@ -90,7 +90,7 @@ func ExtractTar(body io.Reader, dir string, buf []byte) (int64, error) {
|
||||
|
||||
sz, found := CacheFileConstraints[header.Name]
|
||||
if !found {
|
||||
return read, xerrors.Errorf("tar file %#v isn't expected")
|
||||
return read, xerrors.Errorf("tar file %#v isn't expected", header.Name)
|
||||
}
|
||||
if header.Size > sz {
|
||||
return read, xerrors.Errorf("tar file %#v is bigger than expected: %d > %d", header.Name, header.Size, sz)
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM golang:1.18.1-buster as tg-build
|
||||
FROM golang:1.18.8-buster as tg-build
|
||||
|
||||
ARG TESTGROUND_REF="oni"
|
||||
WORKDIR /usr/src
|
||||
|
@ -1,4 +1,4 @@
|
||||
ARG GO_VERSION=1.18.1
|
||||
ARG GO_VERSION=1.18.8
|
||||
|
||||
FROM golang:${GO_VERSION}-buster
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
ARG GO_VERSION=1.18.1
|
||||
ARG GO_VERSION=1.18.8
|
||||
|
||||
FROM golang:${GO_VERSION}-buster as downloader
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
ARG GO_VERSION=1.18.1
|
||||
ARG GO_VERSION=1.18.8
|
||||
|
||||
FROM golang:${GO_VERSION}-buster as downloader
|
||||
|
||||
|
@ -182,7 +182,7 @@ func startFullNodeAPIServer(t *TestEnvironment, repo repo.Repo, napi api.FullNod
|
||||
Next: mux.ServeHTTP,
|
||||
}
|
||||
|
||||
srv := &http.Server{Handler: ah}
|
||||
srv := &http.Server{Handler: ah, ReadHeaderTimeout: 30 * time.Second}
|
||||
|
||||
endpoint, err := repo.APIEndpoint()
|
||||
if err != nil {
|
||||
|
@ -638,7 +638,7 @@ func startStorageMinerAPIServer(t *TestEnvironment, repo repo.Repo, minerApi api
|
||||
return nil, fmt.Errorf("no API endpoint in repo: %w", err)
|
||||
}
|
||||
|
||||
srv := &http.Server{Handler: ah}
|
||||
srv := &http.Server{Handler: ah, ReadHeaderTimeout: 30 * time.Second}
|
||||
|
||||
listenAddr, err := startServer(endpoint, srv)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user