From 07df6e010fba95abbe6201fe76756ace6b2a91e1 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Tue, 10 Mar 2020 21:48:55 -0300 Subject: [PATCH 1/7] add dealID in DealInfo Signed-off-by: Ignacio Hagopian --- api/api_full.go | 11 +++++++---- node/impl/client/client.go | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/api/api_full.go b/api/api_full.go index 62e47fe1e..379737ad5 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -2,9 +2,10 @@ package api import ( "context" - "github.com/filecoin-project/lotus/chain/vm" "time" + "github.com/filecoin-project/lotus/chain/vm" + "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" "github.com/ipfs/go-filestore" @@ -168,6 +169,8 @@ type DealInfo struct { PricePerEpoch types.BigInt Duration uint64 + + DealID uint64 } type MsgWait struct { @@ -273,10 +276,10 @@ type RetrievalOrder struct { } type InvocResult struct { - Msg *types.Message - MsgRct *types.MessageReceipt + Msg *types.Message + MsgRct *types.MessageReceipt InternalExecutions []*vm.ExecutionResult - Error string + Error string } type ActiveSync struct { diff --git a/node/impl/client/client.go b/node/impl/client/client.go index 3c4b7f438..06b0e0480 100644 --- a/node/impl/client/client.go +++ b/node/impl/client/client.go @@ -110,6 +110,8 @@ func (a *API) ClientListDeals(ctx context.Context) ([]api.DealInfo, error) { PricePerEpoch: utils.FromSharedTokenAmount(v.Proposal.StoragePricePerEpoch), Duration: v.Proposal.Duration, + + DealID: v.DealID, } } @@ -121,7 +123,6 @@ func (a *API) ClientGetDealInfo(ctx context.Context, d cid.Cid) (*api.DealInfo, if err != nil { return nil, err } - return &api.DealInfo{ ProposalCid: v.ProposalCid, State: v.State, @@ -130,6 +131,7 @@ func (a *API) ClientGetDealInfo(ctx context.Context, d cid.Cid) (*api.DealInfo, Size: v.Proposal.PieceSize, PricePerEpoch: utils.FromSharedTokenAmount(v.Proposal.StoragePricePerEpoch), Duration: v.Proposal.Duration, + DealID: v.DealID, }, nil } From 4777ca21c33ab1245d1076fdf36b23002a8e5ee0 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Wed, 11 Mar 2020 15:32:41 -0400 Subject: [PATCH 2/7] Bugfix: Check if vmctx is nil before dereferencing in ApplyMessage --- chain/vm/vm.go | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/chain/vm/vm.go b/chain/vm/vm.go index eb407bf99..9a72472a8 100644 --- a/chain/vm/vm.go +++ b/chain/vm/vm.go @@ -44,9 +44,9 @@ const ( ) type ExecutionResult struct { - Msg *types.Message - MsgRct *types.MessageReceipt - Error string + Msg *types.Message + MsgRct *types.MessageReceipt + Error string } type VMContext struct { @@ -173,9 +173,9 @@ func (vmc *VMContext) Send(to address.Address, method uint64, value types.BigInt es = err.Error() } er := ExecutionResult{ - Msg: msg, + Msg: msg, MsgRct: &mr, - Error: es, + Error: es, } vmc.internalExecutions = append(vmc.internalExecutions, &er) @@ -366,7 +366,7 @@ type Rand interface { type ApplyRet struct { types.MessageReceipt - ActorErr aerrors.ActorError + ActorErr aerrors.ActorError InternalExecutions []*ExecutionResult } @@ -532,15 +532,21 @@ func (vm *VM) ApplyMessage(ctx context.Context, msg *types.Message) (*ApplyRet, return nil, xerrors.Errorf("gas handling math is wrong") } - return &ApplyRet{ + r := ApplyRet{ MessageReceipt: types.MessageReceipt{ ExitCode: errcode, Return: ret, GasUsed: gasUsed, }, - ActorErr: actorErr, - InternalExecutions: vmctx.internalExecutions, - }, nil + ActorErr: actorErr, + InternalExecutions: nil, + } + + if vmctx != nil { + r.InternalExecutions = vmctx.internalExecutions + } + + return &r, nil } func (vm *VM) SetBlockMiner(m address.Address) { From b6d5ea629b6a358bebb391b207d20fda57e9f194 Mon Sep 17 00:00:00 2001 From: Jim Pick Date: Fri, 13 Mar 2020 13:07:39 -0700 Subject: [PATCH 3/7] Make websocket connection upgrade header check case-insensitive I was having troubles configuring an nginx reverse-proxy when using Websockets. It turns out my configuration was sending a "Connection: upgrade" header, but Lotus expected "Connection: Upgrade". This commit converts the check to be case-insensitive. Some of the examples on the MDN page show lower-case "upgrade", so I think it's not unusual for the usage to vary. --- lib/jsonrpc/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jsonrpc/server.go b/lib/jsonrpc/server.go index bb9fa4594..860cd6414 100644 --- a/lib/jsonrpc/server.go +++ b/lib/jsonrpc/server.go @@ -65,7 +65,8 @@ func (s *RPCServer) handleWS(ctx context.Context, w http.ResponseWriter, r *http func (s *RPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - if strings.Contains(r.Header.Get("Connection"), "Upgrade") { + h := strings.ToLower(r.Header.Get("Connection")) + if strings.Contains(h, "upgrade") { s.handleWS(ctx, w, r) return } From 77019c547b5e64d1fe2f6cee3baa60689b61a0a0 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Sun, 15 Mar 2020 21:57:46 -0400 Subject: [PATCH 4/7] Add a minor detail to the FAQs --- documentation/en/faqs.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/documentation/en/faqs.md b/documentation/en/faqs.md index edcc9670a..f273673cf 100644 --- a/documentation/en/faqs.md +++ b/documentation/en/faqs.md @@ -117,6 +117,11 @@ Note that these might NOT be the minimum requirements for mining on Mainnet. A list of benchmarked GPUs can be found [here](https://lotu.sh/en+hardware-mining#benchmarked-gpus-7393). +### Why is my GPU not being used when sealing a sector? + +Sealing a sector does not involve constant GPU operations. It's possible +that your GPU simply isn't necessary at the moment you checked. + ## Advanced questions ### Is there a Docker image for lotus? From b96aedd7204b56d461c506afd1d7ad769c8f3f3a Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 19 Mar 2020 16:00:42 +0800 Subject: [PATCH 5/7] Correct the number of waiting blocks --- cmd/lotus-storage-miner/info.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/lotus-storage-miner/info.go b/cmd/lotus-storage-miner/info.go index 6cbc3ee41..13d0aa942 100644 --- a/cmd/lotus-storage-miner/info.go +++ b/cmd/lotus-storage-miner/info.go @@ -100,10 +100,10 @@ var infoCmd = &cli.Command{ lastEps := int64(head.Height() - eps) lastEpsS := lastEps * build.BlockDelay - fallback := lastEps + build.FallbackPoStDelay + fallback := build.FallbackPoStDelay - lastEps fallbackS := fallback * build.BlockDelay - next := lastEps + build.SlashablePowerDelay + next := build.SlashablePowerDelay - lastEps nextS := next * build.BlockDelay fmt.Printf("PoSt Submissions:\n") From bc914de388a6b627ca1ce7cb6fae375675a71520 Mon Sep 17 00:00:00 2001 From: Jim Pick Date: Mon, 23 Mar 2020 23:54:39 -0700 Subject: [PATCH 6/7] Error message spelling fixes --- cli/cmd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/cmd.go b/cli/cmd.go index ac3811d0f..b781eee0d 100644 --- a/cli/cmd.go +++ b/cli/cmd.go @@ -109,7 +109,7 @@ func GetAPIInfo(ctx *cli.Context, t repo.RepoType) (APIInfo, error) { p, err := homedir.Expand(ctx.String(repoFlag)) if err != nil { - return APIInfo{}, xerrors.Errorf("cound not exand home dir (%s): %w", repoFlag, err) + return APIInfo{}, xerrors.Errorf("cound not expand home dir (%s): %w", repoFlag, err) } r, err := repo.NewFS(p) @@ -119,7 +119,7 @@ func GetAPIInfo(ctx *cli.Context, t repo.RepoType) (APIInfo, error) { ma, err := r.APIEndpoint() if err != nil { - return APIInfo{}, xerrors.Errorf("could not get api enpoint: %w", err) + return APIInfo{}, xerrors.Errorf("could not get api endpoint: %w", err) } token, err := r.APIToken() From d73a9f4f341c06f98d8d3a051c6cc5e1cc5b14ce Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Tue, 7 Apr 2020 20:35:41 -0400 Subject: [PATCH 7/7] Add info for miners who want to accept storage deals --- documentation/en/.library.json | 6 +++++ documentation/en/miner-deals.md | 41 +++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 documentation/en/miner-deals.md diff --git a/documentation/en/.library.json b/documentation/en/.library.json index e74e1934c..db7f43ed1 100644 --- a/documentation/en/.library.json +++ b/documentation/en/.library.json @@ -101,6 +101,12 @@ "slug": "en+storing-data-troubleshooting", "github": "en/storing-data-troubleshooting.md", "value": null + }, + { + "title": "Information for Miners", + "slug": "en+info-for-miners", + "github": "en/miner-deals.md", + "value": null } ] }, diff --git a/documentation/en/miner-deals.md b/documentation/en/miner-deals.md new file mode 100644 index 000000000..9dbd2deca --- /dev/null +++ b/documentation/en/miner-deals.md @@ -0,0 +1,41 @@ +# Information for Miners + +Here is how a miner can get set up to accept storage deals. The first step is +to install a Lotus node and sync to the top of the chain. + +## Set up an ask + +``` +lotus-storage-miner set-price +``` + +This command will set up your miner to accept deal proposals that meet the input price. +The price is inputted in FIL per GiB per epoch, and the default is 0.0000000005. + + + +## Ensure you can be discovered + +Clients need to be able to find you in order to make storage deals with you. +While there isn't necessarily anything you need to do to become discoverable, here are some things you can +try to check that people can connect to you. + +To start off, make sure you are connected to at least some peers, and your port is +open and working. + +### Connect to your own node + +If you are in contact with someone else running Lotus, you can ask them to try connecting +to your node. To do so, provide them your peer ID, which you can get by running `lotus net id` on +your node. + +They can then try running `lotus net findpeer ` to get your address(es), and can then +run `lotus net connect
` to connect to you. If successful, your node will now +appear on their peers list (run `lotus net peers` to check). + +You can also check this by running a second instance of Lotus yourself. + +### Query your own ask + +A client should be able to find your ask by running `lotus client query-ask `. If +someone is not able to retrieve your ask by doing so, then there is an issue with your node. \ No newline at end of file