Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9db71ee12 | ||
|
|
62a85e60a7 | ||
|
|
6ce9f232dc | ||
|
|
20d1a5db70 | ||
|
|
d46ee7c89b | ||
|
|
d2abc409f9 | ||
|
|
5f9e7c4ff4 | ||
|
|
3f9849a63b | ||
|
|
09cd258780 | ||
|
|
7d65a2664d | ||
|
|
d29e3afc28 | ||
|
|
ff949d84ad | ||
|
|
6b0868089b | ||
|
|
2474c0b633 | ||
|
|
eabb9639a3 | ||
|
|
cfb6aca9a4 | ||
|
|
c37271422b | ||
|
|
975090256d | ||
|
|
cbf308a01d | ||
|
|
e05fdf8923 | ||
|
|
2343778559 | ||
|
|
1ffc3ed3a6 | ||
|
|
ba3c96f8c6 | ||
|
|
b7912cbe0b | ||
|
|
dafdb7689c | ||
|
|
46ba2b6b4f | ||
|
|
b4c1e340ea | ||
|
|
a438e6fa73 | ||
|
|
b21d3ded2f | ||
|
|
09a5c2e025 | ||
|
|
3f9f9eb667 | ||
|
|
29cdee761b | ||
|
|
67bedc4ace | ||
|
|
55ae9e8414 | ||
|
|
4768c425d1 | ||
|
|
b4bdb89f65 | ||
|
|
ea9130256c | ||
|
|
cde687bbe1 | ||
|
|
9725d72a80 | ||
|
|
fbd3c90b80 | ||
|
|
52c7fa2427 | ||
|
|
02fa0df81c | ||
|
|
027017d0d2 | ||
|
|
26c9120d22 | ||
|
|
71329f6c41 | ||
|
|
73f16f08e3 | ||
|
|
330cfc33ee | ||
|
|
cf20b0b2b8 | ||
|
|
001ecbb561 | ||
|
|
a597b072b8 | ||
|
|
f25efecb74 | ||
|
|
6d52d8552b | ||
|
|
c9a2ff4007 | ||
|
|
b961e1aab5 | ||
|
|
36868a8749 | ||
|
|
4ef8543128 | ||
|
|
93e4656a27 | ||
|
|
c4f46171ae | ||
|
|
e2a1ca7caa | ||
|
|
19e808fffb | ||
|
|
d21c44e266 | ||
|
|
01215b7d2c | ||
|
|
da9b0c6735 | ||
|
|
4d2f3375e8 | ||
|
|
27efbc3485 | ||
|
|
d4074e45cf | ||
|
|
f39942283b | ||
|
|
468b90a4a4 | ||
|
|
092e12d1be | ||
|
|
320b36495d | ||
|
|
e4f47de6ef | ||
|
|
410ecb4bbc | ||
|
|
d019853687 | ||
|
|
4d51980cb5 | ||
|
|
5b5e6b9e44 | ||
|
|
58a084049d | ||
|
|
9538fc9723 | ||
|
|
227188e908 | ||
|
|
61791b90ea | ||
|
|
797147097c | ||
|
|
f8b132890c | ||
|
|
134aee4582 | ||
|
|
77d75b7739 | ||
|
|
26c3752f48 | ||
|
|
4bcde2f0ff | ||
|
|
160bb0b050 | ||
|
|
05aa860459 | ||
|
|
a4c2a20851 | ||
|
|
4df9179d34 | ||
|
|
8943de27e4 | ||
|
|
fc728d9e11 | ||
|
|
f6131ce3b5 | ||
|
|
9110e6f632 | ||
|
|
331702cd95 | ||
|
|
743ce5a40f | ||
|
|
abec7dd3bc | ||
|
|
f6de16e95a | ||
|
|
a9ee263682 | ||
|
|
8d955d5f30 | ||
|
|
4d8be81a8f | ||
|
|
e3c7b8d006 | ||
|
|
3b1d86b750 | ||
|
|
cf0faf58dc | ||
|
|
af113f867d | ||
|
|
ca230bba09 | ||
|
|
a26a2160ae | ||
|
|
aafdf3d093 | ||
|
|
12dc3baff9 | ||
|
|
d5b4d93575 | ||
|
|
ab55a6fbbe | ||
|
|
0c884734a3 | ||
|
|
58dd814765 | ||
|
|
bd4927b494 | ||
|
|
8454abcf45 | ||
|
|
407bf4961c | ||
|
|
46937a1b9f | ||
|
|
210485d800 | ||
|
|
135796d4fa | ||
|
|
78949d6c05 | ||
|
|
83f65a673b | ||
|
|
407c2ed114 | ||
|
|
37141779ac | ||
|
|
b522901845 | ||
|
|
e362d47903 | ||
|
|
b1781c33ce | ||
|
|
2a1505b364 | ||
|
|
8b548ac02f | ||
|
|
5c77c25747 | ||
|
|
6c0374cd3c | ||
|
|
51753a1e25 | ||
|
|
dc744a8dd9 | ||
|
|
d1a63e4173 | ||
|
|
90d57f0243 | ||
|
|
3a81411d28 | ||
|
|
b12bb32ece | ||
|
|
0992e56fee | ||
|
|
5fe1726484 | ||
|
|
189b27f36e | ||
|
|
a0d6daa180 | ||
|
|
699d2c7b24 | ||
|
|
0262f1cd6e | ||
|
|
bdac11ade7 | ||
|
|
25e89d3a7a | ||
|
|
c6ac582c99 | ||
|
|
9ea229ed5a | ||
|
|
f88c514be9 | ||
|
|
3e70b8420e | ||
|
|
2c583b03ff | ||
|
|
dd78e75dd6 | ||
|
|
c6101aa02f | ||
|
|
46ee3a0c46 | ||
|
|
763659b8a3 | ||
|
|
74f645a098 | ||
|
|
53a48df77e | ||
|
|
597b72e286 | ||
|
|
ec2bfb99bb | ||
|
|
8ea5162ad9 | ||
|
|
9c119bfdad | ||
|
|
a1d5b2a293 | ||
|
|
450d0687da | ||
|
|
b83a9b902a | ||
|
|
b26906963b | ||
|
|
b0c043cc2f | ||
|
|
d0503d409f | ||
|
|
b9bd061bdd | ||
|
|
b868769ec8 | ||
|
|
89138bab4d | ||
|
|
60ea33b1c7 | ||
|
|
08e297a217 | ||
|
|
19732d3bd7 | ||
|
|
e3c9430e7e | ||
|
|
a189906b9b | ||
|
|
205f54d80d | ||
|
|
d9d54a918f | ||
|
|
81a2f2f06d | ||
|
|
3e41844e6c | ||
|
|
2620eab45e | ||
|
|
5b7bf6ca9f | ||
|
|
77dd022243 | ||
|
|
17cb5117f4 | ||
|
|
7a9824f00e | ||
|
|
32fc03886d | ||
|
|
73182cff3a | ||
|
|
ef0771ee48 | ||
|
|
943c40a233 | ||
|
|
9adaa9b967 | ||
|
|
2894567165 | ||
|
|
e196a81e99 | ||
|
|
eaac4b6de4 | ||
|
|
a3c806a7a8 | ||
|
|
495f08473d | ||
|
|
40d5c6f0dc | ||
|
|
6056858bf8 | ||
|
|
3be0c068b9 | ||
|
|
cd95b40d61 | ||
|
|
60b3ae2ac2 | ||
|
|
e94e26f529 | ||
|
|
6958b6fc2b | ||
|
|
34df787be6 | ||
|
|
b3eb9edc34 | ||
|
|
2767cdba9c | ||
|
|
8cb9c6e21f | ||
|
|
2d4f5958e2 | ||
|
|
735f6fec1a | ||
|
|
e0a9cae386 | ||
|
|
e7a7d4c75a | ||
|
|
758b54f36d | ||
|
|
6455b0edcc | ||
|
|
6fbaba1323 | ||
|
|
d9fd1d9a46 | ||
|
|
5a5a6f9cd2 | ||
|
|
14c26567b2 | ||
|
|
8efc8051d1 | ||
|
|
bcfe7a76e8 | ||
|
|
7d17ee5960 | ||
|
|
dc6bd2b015 | ||
|
|
724dfc6a4d | ||
|
|
47b82bdaea | ||
|
|
0fc1239445 | ||
|
|
18834de7d0 | ||
|
|
6607019788 | ||
|
|
1f339f623e | ||
|
|
95d294db63 | ||
|
|
a94a48f70b | ||
|
|
3bfaf5af16 | ||
|
|
3123400759 | ||
|
|
e1deed3b1a | ||
|
|
9369c54f54 | ||
|
|
67c732a100 | ||
|
|
3f7b15b598 | ||
|
|
f7884c4f45 | ||
|
|
a60ccbf106 | ||
|
|
97e4921a4a | ||
|
|
8182ffcf9f | ||
|
|
9ba7f372cd | ||
|
|
b7fe165b8f | ||
|
|
d2e9d21031 | ||
|
|
32a855b984 | ||
|
|
9a993d25d0 | ||
|
|
b1c06ece85 | ||
|
|
32ce12acfc | ||
|
|
726d9b86ea | ||
|
|
852ac4c178 | ||
|
|
d9100981ad | ||
|
|
e508055dc1 | ||
|
|
ba171954b4 | ||
|
|
1d8a9c75d4 | ||
|
|
c2d4dcae19 | ||
|
|
116ed01197 | ||
|
|
7b8d1cc54c | ||
|
|
7a55e8e892 | ||
|
|
3ab8ec57f1 | ||
|
|
0e17b6c066 | ||
|
|
44e092c07c | ||
|
|
c8a187e779 | ||
|
|
76d009e409 | ||
|
|
080aa3356a | ||
|
|
3b2e8c439a | ||
|
|
70589e4406 | ||
|
|
261238e157 | ||
|
|
11d738eee0 | ||
|
|
3943c3ae6f | ||
|
|
463f55ba13 | ||
|
|
e493d9e2e3 | ||
|
|
19f52b4541 | ||
|
|
9606dce425 | ||
|
|
98ff1c4d20 | ||
|
|
e5d73f2923 | ||
|
|
03806f7063 | ||
|
|
63c8b8edd1 | ||
|
|
a0795165af | ||
|
|
c23cff45f6 | ||
|
|
02cef1353e | ||
|
|
008120747e | ||
|
|
9964f80bb7 | ||
|
|
afe54ab5f3 | ||
|
|
6cd6732225 | ||
|
|
429b9a1bc5 | ||
|
|
d063a32def | ||
|
|
1ebd908fe3 | ||
|
|
e1a08b1c89 | ||
|
|
dd998037cf | ||
|
|
9dbeb3028d | ||
|
|
8e168cb657 | ||
|
|
5616dfb1bc | ||
|
|
ddef708178 | ||
|
|
67bdc266af | ||
|
|
f352c18290 | ||
|
|
d1e15e61d0 | ||
|
|
9fcc27edd5 | ||
|
|
e47cbae885 | ||
|
|
1a6c9b9c0e | ||
|
|
f1b4d2b1b3 | ||
|
|
1bd7f5b7ec | ||
|
|
8319323329 | ||
|
|
20544b6b7b | ||
|
|
1242e4a292 | ||
|
|
42a233c083 | ||
|
|
047f7e5015 | ||
|
|
d1e1f8bdce | ||
|
|
3a3edbbb16 | ||
|
|
8957213c56 | ||
|
|
f9433811c7 | ||
|
|
df2a852e6c | ||
|
|
c6b28b4d8b | ||
|
|
c92d73384b | ||
|
|
5abba9ca9f | ||
|
|
35291983a1 | ||
|
|
a19dbb8c91 | ||
|
|
6a3bb184b7 | ||
|
|
1acb6b4328 | ||
|
|
6e5ccc87cf | ||
|
|
4853762763 | ||
|
|
8533ae0032 | ||
|
|
90ff1d3ccf | ||
|
|
b4302df892 | ||
|
|
1723793c35 | ||
|
|
be774f55ce | ||
|
|
e158b1d1e4 | ||
|
|
28e94bf9db | ||
|
|
6184e8a943 | ||
|
|
c776811ea9 | ||
|
|
c8042540d5 | ||
|
|
bfcfb199a0 | ||
|
|
8b01725129 | ||
|
|
cb39dd8ed0 | ||
|
|
734a03cf82 | ||
|
|
aed6e8d0be | ||
|
|
ec0f7795d3 | ||
|
|
c95940acac | ||
|
|
3215eba0eb | ||
|
|
4e98f0abdc | ||
|
|
0ba88ac53a | ||
|
|
2c10dc6c57 | ||
|
|
778483166f | ||
|
|
a40aa9f90b | ||
|
|
c4a7de9d37 | ||
|
|
9e76aba3d1 | ||
|
|
1993efe201 | ||
|
|
e74f70346e | ||
|
|
530011fd09 | ||
|
|
1cdb414bf8 | ||
|
|
a572787013 | ||
|
|
3f92940a19 | ||
|
|
177aa3cffd | ||
|
|
6e44755b55 | ||
|
|
7e6c3a330a | ||
|
|
89db4235ce | ||
|
|
001fc7dd53 | ||
|
|
46ae2556c7 | ||
|
|
9b69b10fea | ||
|
|
a460ab84fa | ||
|
|
bac783774d | ||
|
|
4221461ede | ||
|
|
a324b3fce0 | ||
|
|
bd2176c398 | ||
|
|
441bcdc4af | ||
|
|
26ae8bb3a7 | ||
|
|
f8ac98bf46 | ||
|
|
5e6aceeb0e | ||
|
|
cbb147de23 | ||
|
|
f60692c7ef | ||
|
|
97c2cdb8d6 | ||
|
|
43f7fd5e10 | ||
|
|
a4e2fce9ca | ||
|
|
bff3af81d5 | ||
|
|
1d2f84322d | ||
|
|
368d72ebfe | ||
|
|
8d9f3719ce | ||
|
|
af0d9b650d | ||
|
|
2a1094fc17 | ||
|
|
cadbd00ac4 | ||
|
|
f70ec02a6c | ||
|
|
16973bc2e8 | ||
|
|
38e01cba83 | ||
|
|
9af82f2d68 | ||
|
|
b87142ec8e | ||
|
|
fc10281d96 | ||
|
|
28e720fef2 | ||
|
|
d7fbd8b67d | ||
|
|
809289f5ef | ||
|
|
c2fa54ca9c | ||
|
|
edcb28737c | ||
|
|
a8a9818043 | ||
|
|
95e8b59367 | ||
|
|
1b1879342c | ||
|
|
b3432b512e | ||
|
|
7c84e22c3e | ||
|
|
2f8a2fc907 | ||
|
|
4192e40a9a | ||
|
|
d7690aa719 | ||
|
|
89d7a72a4b | ||
|
|
98c99b4fea | ||
|
|
cd66afb05c | ||
|
|
c3faadf749 | ||
|
|
83c8e981b4 | ||
|
|
dbcb662f9c | ||
|
|
53a9dd5da4 | ||
|
|
0e7e665e6d | ||
|
|
8e0314b3a3 | ||
|
|
7759f13a13 | ||
|
|
fa7a5789aa | ||
|
|
7694f895c2 | ||
|
|
92190c7e0b | ||
|
|
f57d4b4126 | ||
|
|
7e933f7045 | ||
|
|
574b5c03dc | ||
|
|
b3816bc2dc | ||
|
|
9a07c2fd38 | ||
|
|
44ed3dc46b | ||
|
|
6064d2f2f1 | ||
|
|
ac2194b0eb | ||
|
|
fe56995244 | ||
|
|
714d7a146e | ||
|
|
c7e4217693 | ||
|
|
7863a269ad | ||
|
|
e70cefaa28 | ||
|
|
a80bc34d59 | ||
|
|
89ac8b09b5 | ||
|
|
2437a4182d | ||
|
|
ee7b6f2470 | ||
|
|
926858aeec | ||
|
|
38f7cbc6c7 | ||
|
|
b4a129068a | ||
|
|
ccf24b9952 | ||
|
|
3508a5b664 | ||
|
|
f79d34be5c | ||
|
|
605953565b | ||
|
|
34e3dc2b37 | ||
|
|
595b51ecdd | ||
|
|
6df17bceb1 | ||
|
|
ef03314c6d | ||
|
|
4fc78bf720 | ||
|
|
1d6db306ec | ||
|
|
b681078b06 | ||
|
|
aab42dd96f | ||
|
|
888b2040de | ||
|
|
aae9bf3f46 | ||
|
|
4d9b852875 | ||
|
|
3e10f2e250 | ||
|
|
67dc7523d5 | ||
|
|
caaff9b7af | ||
|
|
fe602ab3bb | ||
|
|
20a7193b06 | ||
|
|
65befc281e | ||
|
|
b4a3eb55e1 | ||
|
|
027c1b5ab8 | ||
|
|
b0b016b58c | ||
|
|
0444435589 | ||
|
|
0a04302fb2 | ||
|
|
8612d1e824 | ||
|
|
1ce7c250d7 | ||
|
|
2c5f4386ba | ||
|
|
92c12f9bde | ||
|
|
3b25934649 | ||
|
|
aef741ae19 | ||
|
|
16c60914eb | ||
|
|
d1d8845ab2 | ||
|
|
612befc962 | ||
|
|
cf94aed32e | ||
|
|
a5bcf8b5b2 | ||
|
|
ab71bc0e78 | ||
|
|
26da526379 |
+17
-57
@@ -285,21 +285,6 @@ jobs:
|
||||
root: "."
|
||||
paths:
|
||||
- linux-butterflynet
|
||||
build-ntwk-nerpa:
|
||||
description: |
|
||||
Compile lotus binaries for the nerpa network
|
||||
parameters:
|
||||
<<: *test-params
|
||||
executor: << parameters.executor >>
|
||||
steps:
|
||||
- install-deps
|
||||
- prepare
|
||||
- run: make nerpanet
|
||||
- run: mkdir linux-nerpanet && mv lotus lotus-miner lotus-worker linux-nerpanet
|
||||
- persist_to_workspace:
|
||||
root: "."
|
||||
paths:
|
||||
- linux-nerpanet
|
||||
build-lotus-soup:
|
||||
description: |
|
||||
Compile `lotus-soup` Testground test plan
|
||||
@@ -333,7 +318,7 @@ jobs:
|
||||
command: pushd testplans/lotus-soup && mkdir -p $HOME/testground && cp env-ci.toml $HOME/testground/.env.toml && echo 'endpoint="https://ci.testground.ipfs.team"' >> $HOME/testground/.env.toml && echo 'user="circleci"' >> $HOME/testground/.env.toml
|
||||
- run:
|
||||
name: "prepare testground home dir and link test plans"
|
||||
command: mkdir -p $HOME/testground/plans && ln -s $(pwd)/testplans/lotus-soup $HOME/testground/plans/lotus-soup && ln -s $(pwd)/testplans/graphsync $HOME/testground/plans/graphsync
|
||||
command: mkdir -p $HOME/testground/plans && ln -s $(pwd)/testplans/lotus-soup $HOME/testground/plans/lotus-soup
|
||||
- run:
|
||||
name: "go get lotus@master"
|
||||
command: cd testplans/lotus-soup && go get github.com/filecoin-project/lotus@master
|
||||
@@ -343,10 +328,6 @@ jobs:
|
||||
- run:
|
||||
name: "trigger payment channel stress testplan on taas"
|
||||
command: ~/testground-cli run composition -f $HOME/testground/plans/lotus-soup/_compositions/paych-stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
||||
- run:
|
||||
name: "trigger graphsync testplan on taas"
|
||||
command: ~/testground-cli run composition -f $HOME/testground/plans/graphsync/_compositions/stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
||||
|
||||
|
||||
build-macos:
|
||||
description: build darwin lotus binary
|
||||
@@ -724,18 +705,6 @@ jobs:
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-nerpanet:
|
||||
description: build and push AWS IAM and DigitalOcean droplet.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux-nerpanet -var lotus_network=nerpanet -var git_tag=$CIRCLE_TAG"
|
||||
publish-dockerhub:
|
||||
description: publish to dockerhub
|
||||
machine:
|
||||
@@ -836,6 +805,16 @@ workflows:
|
||||
suite: itest-deals_padding
|
||||
target: "./itests/deals_padding_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-deals_partial_retrieval_dm-level
|
||||
suite: itest-deals_partial_retrieval_dm-level
|
||||
target: "./itests/deals_partial_retrieval_dm-level_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-deals_partial_retrieval
|
||||
suite: itest-deals_partial_retrieval
|
||||
target: "./itests/deals_partial_retrieval_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-deals_power
|
||||
suite: itest-deals_power
|
||||
@@ -851,6 +830,11 @@ workflows:
|
||||
suite: itest-deals_publish
|
||||
target: "./itests/deals_publish_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-deals_retry_deal_no_funds
|
||||
suite: itest-deals_retry_deal_no_funds
|
||||
target: "./itests/deals_retry_deal_no_funds_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-deals
|
||||
suite: itest-deals
|
||||
@@ -961,7 +945,7 @@ workflows:
|
||||
codecov-upload: false
|
||||
suite: conformance-bleeding-edge
|
||||
target: "./conformance"
|
||||
vectors-branch: master
|
||||
vectors-branch: specs-actors-v7
|
||||
- trigger-testplans:
|
||||
filters:
|
||||
branches:
|
||||
@@ -983,11 +967,6 @@ workflows:
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- build-ntwk-nerpa:
|
||||
filters:
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- build-lotus-soup
|
||||
- build-macos:
|
||||
filters:
|
||||
@@ -997,19 +976,10 @@ workflows:
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- build-appimage:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish:
|
||||
requires:
|
||||
- build-all
|
||||
- build-macos
|
||||
- build-appimage
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
@@ -1052,16 +1022,6 @@ workflows:
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-nerpanet:
|
||||
requires:
|
||||
- build-ntwk-nerpa
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-snapcraft:
|
||||
name: publish-snapcraft-stable
|
||||
channel: stable
|
||||
|
||||
+2
-57
@@ -285,21 +285,6 @@ jobs:
|
||||
root: "."
|
||||
paths:
|
||||
- linux-butterflynet
|
||||
build-ntwk-nerpa:
|
||||
description: |
|
||||
Compile lotus binaries for the nerpa network
|
||||
parameters:
|
||||
<<: *test-params
|
||||
executor: << parameters.executor >>
|
||||
steps:
|
||||
- install-deps
|
||||
- prepare
|
||||
- run: make nerpanet
|
||||
- run: mkdir linux-nerpanet && mv lotus lotus-miner lotus-worker linux-nerpanet
|
||||
- persist_to_workspace:
|
||||
root: "."
|
||||
paths:
|
||||
- linux-nerpanet
|
||||
build-lotus-soup:
|
||||
description: |
|
||||
Compile `lotus-soup` Testground test plan
|
||||
@@ -333,7 +318,7 @@ jobs:
|
||||
command: pushd testplans/lotus-soup && mkdir -p $HOME/testground && cp env-ci.toml $HOME/testground/.env.toml && echo 'endpoint="https://ci.testground.ipfs.team"' >> $HOME/testground/.env.toml && echo 'user="circleci"' >> $HOME/testground/.env.toml
|
||||
- run:
|
||||
name: "prepare testground home dir and link test plans"
|
||||
command: mkdir -p $HOME/testground/plans && ln -s $(pwd)/testplans/lotus-soup $HOME/testground/plans/lotus-soup && ln -s $(pwd)/testplans/graphsync $HOME/testground/plans/graphsync
|
||||
command: mkdir -p $HOME/testground/plans && ln -s $(pwd)/testplans/lotus-soup $HOME/testground/plans/lotus-soup
|
||||
- run:
|
||||
name: "go get lotus@master"
|
||||
command: cd testplans/lotus-soup && go get github.com/filecoin-project/lotus@master
|
||||
@@ -343,10 +328,6 @@ jobs:
|
||||
- run:
|
||||
name: "trigger payment channel stress testplan on taas"
|
||||
command: ~/testground-cli run composition -f $HOME/testground/plans/lotus-soup/_compositions/paych-stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
||||
- run:
|
||||
name: "trigger graphsync testplan on taas"
|
||||
command: ~/testground-cli run composition -f $HOME/testground/plans/graphsync/_compositions/stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
||||
|
||||
|
||||
build-macos:
|
||||
description: build darwin lotus binary
|
||||
@@ -724,18 +705,6 @@ jobs:
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-nerpanet:
|
||||
description: build and push AWS IAM and DigitalOcean droplet.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux-nerpanet -var lotus_network=nerpanet -var git_tag=$CIRCLE_TAG"
|
||||
publish-dockerhub:
|
||||
description: publish to dockerhub
|
||||
machine:
|
||||
@@ -816,7 +785,7 @@ workflows:
|
||||
codecov-upload: false
|
||||
suite: conformance-bleeding-edge
|
||||
target: "./conformance"
|
||||
vectors-branch: master
|
||||
vectors-branch: specs-actors-v7
|
||||
- trigger-testplans:
|
||||
filters:
|
||||
branches:
|
||||
@@ -838,11 +807,6 @@ workflows:
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- build-ntwk-nerpa:
|
||||
filters:
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- build-lotus-soup
|
||||
- build-macos:
|
||||
filters:
|
||||
@@ -852,19 +816,10 @@ workflows:
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- build-appimage:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish:
|
||||
requires:
|
||||
- build-all
|
||||
- build-macos
|
||||
- build-appimage
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
@@ -907,16 +862,6 @@ workflows:
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-nerpanet:
|
||||
requires:
|
||||
- build-ntwk-nerpa
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-snapcraft:
|
||||
name: publish-snapcraft-stable
|
||||
channel: stable
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
name: sync-master-main
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: update remote branch main
|
||||
run: |
|
||||
# overrides the remote branch (origin:github) `main`
|
||||
git push origin --force master:main
|
||||
+278
@@ -1,5 +1,283 @@
|
||||
# Lotus changelog
|
||||
|
||||
# v1.13.2 / 2022-01-09
|
||||
|
||||
Lotus v1.13.2 is a *highly recommended* feature release with remarkable retrieval improvements, new features like
|
||||
worker management, schedule enhancements and so on.
|
||||
|
||||
## Highlights
|
||||
- 🚀🚀🚀Improve retrieval deal experience
|
||||
- Testing result with MinerX.3 shows the retrieval deal success rate has increased dramatically with faster transfer
|
||||
speed, you can join or follow along furthur performance testings [here](https://github.com/filecoin-project/lotus/discussions/7874). We recommend application developers to integrate with the new
|
||||
retrieval APIs to provide a better client experience.
|
||||
- 🌟🌟🌟 Reduce retrieval Time-To-First-Byte over 100x ([#7693](https://github.com/filecoin-project/lotus/pull/7693))
|
||||
- This change makes most free, small retrievals sub-second
|
||||
- 🌟🌟🌟 Partial retrieval ux improvements ([#7610](https://github.com/filecoin-project/lotus/pull/7610))
|
||||
- New retrieval commands for clients:
|
||||
- `lotus client ls`: retrieve and list desired object links
|
||||
- `lotus client cat`: retrieve and print the data from the network
|
||||
- 🌟🌟 The monolith `ClientRetrieve` method was broken into:
|
||||
- `ClientRetrieve` which retrieves data into the local repo (or into an IPFS node if ipfs integration is enabled)
|
||||
- `ClientRetrieveWait` which will wait for the retrieval to complete
|
||||
- `ClientExport` which will export data from the local node
|
||||
- Note: this change only applies to v1 API. v0 API remains unchanged.
|
||||
- 🌟 Support for full ipld selectors was added (for example making it possible to only retrieve list of directories in a deal, without fetching any file data)
|
||||
- To learn more, see [here](https://github.com/filecoin-project/lotus/blob/0523c946f984b22b3f5de8cc3003cc791389527e/api/types.go#L230-L264)
|
||||
- 🚀🚀 Sealing scheduler enhancements ([#7703](https://github.com/filecoin-project/lotus/pull/7703),
|
||||
[#7269](https://github.com/filecoin-project/lotus/pull/7269)), [#7714](https://github.com/filecoin-project/lotus/pull/7714)
|
||||
- Workers are now aware of cgroup memory limits
|
||||
- Multiple tasks which use a GPU can be scheduled on a single worker
|
||||
- Workers can override default resource table through env vars
|
||||
- Default value list: https://gist.github.com/magik6k/c0e1c7cd73c1241a9acabc30bf469a43
|
||||
- 🚀🚀 Sector storage groups ([#7453](https://github.com/filecoin-project/lotus/pull/7453))
|
||||
- Storage groups allow for better control of data flow between workers, for example, it makes it possible to define that data from PC1 on a given worker has to have it's PC2 step executed on the same worker
|
||||
- To set it up, follow the instructions under the `Sector Storage Group` section [here](https://lotus.filecoin.io/docs/storage-providers/seal-workers/#lotus-worker-co-location)
|
||||
|
||||
## New Features
|
||||
- Add RLE dump code ([#7691](https://github.com/filecoin-project/lotus/pull/7691))
|
||||
- Shed: Add a util to list miner faults ([#7605](https://github.com/filecoin-project/lotus/pull/7605))
|
||||
- lotus-shed msg: Decode submessages/msig proposals ([#7639](https://github.com/filecoin-project/lotus/pull/7639))
|
||||
- CLI: Add a lotus multisig cancel command ([#7645](https://github.com/filecoin-project/lotus/pull/7645))
|
||||
- shed: simple wallet balancer util ([#7414](https://github.com/filecoin-project/lotus/pull/7414))
|
||||
- balancing token balance between multiple accounts
|
||||
|
||||
## Improvements
|
||||
- Add verbose mode to `lotus-miner pieces list-cids` ([#7699](https://github.com/filecoin-project/lotus/pull/7699))
|
||||
- retrieval: Only output matching nodes, MatchPath dagspec ([#7706](https://github.com/filecoin-project/lotus/pull/7706))
|
||||
- Cleanup partial retrieval codepaths ( zero functional changes ) ([#7688](https://github.com/filecoin-project/lotus/pull/7688))
|
||||
- storage: Use 1M buffers for Tar transfers ([#7681](https://github.com/filecoin-project/lotus/pull/7681))
|
||||
- Chore/dm level tests plus merkle proof cars ([#7673](https://github.com/filecoin-project/lotus/pull/7673))
|
||||
- Shed: Add a util to create miners more easily ([#7595](https://github.com/filecoin-project/lotus/pull/7595))
|
||||
- add timeout flag to wait-api command ([#7592](https://github.com/filecoin-project/lotus/pull/7592))
|
||||
- add log for restart windows post scheduler ([#7613](https://github.com/filecoin-project/lotus/pull/7613))
|
||||
- remove jaeger envvars ([#7631](https://github.com/filecoin-project/lotus/pull/7631))
|
||||
- remove api and jaeger env from docker file ([#7624](https://github.com/filecoin-project/lotus/pull/7624))
|
||||
- Wdpost worker: Reduce challenge confidence to 1 epoch ([#7572](https://github.com/filecoin-project/lotus/pull/7572))
|
||||
- add additional methods to lotus gateway ([#7644](https://github.com/filecoin-project/lotus/pull/7644))
|
||||
- Add caches to lotus-stats and splitcode ([#7329](https://github.com/filecoin-project/lotus/pull/7329))
|
||||
- remote store: Remove debug printf ([#7664](https://github.com/filecoin-project/lotus/pull/7664))
|
||||
- docsgen-cli: Handle commands with no description correctly ([#7659](https://github.com/filecoin-project/lotus/pull/7659))
|
||||
|
||||
## Bug Fixes
|
||||
- fix docker logic error ([#7709](https://github.com/filecoin-project/lotus/pull/7709))
|
||||
- add missing NodeType tag ([#7559](https://github.com/filecoin-project/lotus/pull/7559))
|
||||
- checkCommit should return SectorCommitFailed ([#7555](https://github.com/filecoin-project/lotus/pull/7555))
|
||||
- ffiwrapper: Validate PC2 by calling C1 with random seeds ([#7710](https://github.com/filecoin-project/lotus/pull/7710))
|
||||
|
||||
## Dependency Updates
|
||||
- Update go-graphsync v0.10.6 ([#7708](https://github.com/filecoin-project/lotus/pull/7708))
|
||||
- update go-libp2p-pubsub to v0.5.6 ([#7581](https://github.com/filecoin-project/lotus/pull/7581))
|
||||
- Update go-state-types ([#7591](https://github.com/filecoin-project/lotus/pull/7591))
|
||||
- disable mplex stream muxer ([#7689](https://github.com/filecoin-project/lotus/pull/7689))
|
||||
- Bump ws from 5.2.2 to 5.2.3 in /lotuspond/front ([#7660](https://github.com/filecoin-project/lotus/pull/7660))
|
||||
- Bump color-string from 1.5.3 to 1.6.0 in /lotuspond/front ([#7658](https://github.com/filecoin-project/lotus/pull/7658))
|
||||
- Bump postcss from 7.0.17 to 7.0.39 in /lotuspond/front ([#7657](https://github.com/filecoin-project/lotus/pull/7657))
|
||||
- Bump path-parse from 1.0.6 to 1.0.7 in /lotuspond/front ([#7656](https://github.com/filecoin-project/lotus/pull/7656))
|
||||
- Bump tmpl from 1.0.4 to 1.0.5 in /lotuspond/front ([#7655](https://github.com/filecoin-project/lotus/pull/7655))
|
||||
- Bump url-parse from 1.4.7 to 1.5.3 in /lotuspond/front ([#7654](https://github.com/filecoin-project/lotus/pull/7654))
|
||||
- github.com/filecoin-project/go-state-types (v0.1.1-0.20210915140513-d354ccf10379 -> v0.1.1):
|
||||
|
||||
## Others
|
||||
- Update archive script ([#7690](https://github.com/filecoin-project/lotus/pull/7690))
|
||||
|
||||
## Contributors
|
||||
|
||||
| Contributor | Commits | Lines ± | Files Changed |
|
||||
|-------------|---------|---------|---------------|
|
||||
| @magik6k | 89 | +5200/-1818 | 232 |
|
||||
| Travis Person | 5 | +1473/-953 | 38 |
|
||||
| @arajasek | 6 | +550/-38 | 19 |
|
||||
| @clinta | 4 | +393/-123 | 26 |
|
||||
| @ribasushi | 3 | +334/-68 | 7 |
|
||||
| @jennijuju| 13 | +197/-120 | 67 |
|
||||
| @Kubuxu | 10 | +153/-30 | 10 |
|
||||
| @coryschwartz | 6 | +18/-26 | 6 |
|
||||
| Marten Seemann | 2 | +6/-34 | 5 |
|
||||
| @vyzo | 1 | +3/-3 | 2 |
|
||||
| @hannahhoward | 1 | +3/-3 | 2 |
|
||||
| @zenground0 | 2 | +2/-2 | 2 |
|
||||
| @yaohcn | 2 | +2/-2 | 2 |
|
||||
| @jennijuju | 1 | +1/-1 | 1 |
|
||||
| @hunjixin | 1 | +1/-0 | 1 |
|
||||
|
||||
|
||||
|
||||
# v1.13.1 / 2021-11-26
|
||||
|
||||
This is an optional Lotus v1.13.1 release.
|
||||
|
||||
## New Features
|
||||
- Shed: Add a util to find miner based on peerid ([filecoin-project/lotus#7544](https://github.com/filecoin-project/lotus/pull/7544))
|
||||
- Collect and expose graphsync metrics ([filecoin-project/lotus#7542](https://github.com/filecoin-project/lotus/pull/7542))
|
||||
- Shed: Add a util to find the most recent null tipset ([filecoin-project/lotus#7456](https://github.com/filecoin-project/lotus/pull/7456))
|
||||
|
||||
## Improvements
|
||||
- Show prepared tasks in sealing jobs ([filecoin-project/lotus#7527](https://github.com/filecoin-project/lotus/pull/7527))
|
||||
- To make Deep happy ([filecoin-project/lotus#7546](https://github.com/filecoin-project/lotus/pull/7546))
|
||||
- Expose per-state sector counts on the prometheus endpoint ([filecoin-project/lotus#7541](https://github.com/filecoin-project/lotus/pull/7541))
|
||||
- Add storage-id flag to proving check ([filecoin-project/lotus#7479](https://github.com/filecoin-project/lotus/pull/7479))
|
||||
- FilecoinEC: Improve a log message ([filecoin-project/lotus#7499](https://github.com/filecoin-project/lotus/pull/7499))
|
||||
- itests: retry deal when control addr is out of funds ([filecoin-project/lotus#7454](https://github.com/filecoin-project/lotus/pull/7454))
|
||||
- Normlize selector use within lotus ([filecoin-project/lotus#7467](https://github.com/filecoin-project/lotus/pull/7467))
|
||||
- sealing: Improve scheduling of ready work ([filecoin-project/lotus#7335](https://github.com/filecoin-project/lotus/pull/7335))
|
||||
- Remove dead example code + dep ([filecoin-project/lotus#7466](https://github.com/filecoin-project/lotus/pull/7466))
|
||||
|
||||
## Bug Fixes
|
||||
- fix the withdrawn amount unit ([filecoin-project/lotus#7563](https://github.com/filecoin-project/lotus/pull/7563))
|
||||
- rename vm#make{=>Account}Actor(). ([filecoin-project/lotus#7562](https://github.com/filecoin-project/lotus/pull/7562))
|
||||
- Fix used sector space accounting after AddPieceFailed ([filecoin-project/lotus#7530](https://github.com/filecoin-project/lotus/pull/7530))
|
||||
- Don't remove sector data when moving data into a shared path ([filecoin-project/lotus#7494](https://github.com/filecoin-project/lotus/pull/7494))
|
||||
- fix: support node instantiation in external packages ([filecoin-project/lotus#7511](https://github.com/filecoin-project/lotus/pull/7511))
|
||||
- Stop adding Jennifer's $HOME to lotus docs ([filecoin-project/lotus#7477](https://github.com/filecoin-project/lotus/pull/7477))
|
||||
- Bugfix: Use correct startup network versions ([filecoin-project/lotus#7486](https://github.com/filecoin-project/lotus/pull/7486))
|
||||
- Dep upgrade pass ([filecoin-project/lotus#7478](https://github.com/filecoin-project/lotus/pull/7478))
|
||||
- Remove obsolete GS testplan - it now lives in go-graphsync ([filecoin-project/lotus#7469](https://github.com/filecoin-project/lotus/pull/7469))
|
||||
- sealing: Recover sectors after failed AddPiece ([filecoin-project/lotus#7444](https://github.com/filecoin-project/lotus/pull/7444))
|
||||
|
||||
## Dependency Updates
|
||||
- Update go-graphsync v0.10.1 ([filecoin-project/lotus#7457](https://github.com/filecoin-project/lotus/pull/7457))
|
||||
- update to proof v10.1.0 ([filecoin-project/lotus#7564](https://github.com/filecoin-project/lotus/pull/7564))
|
||||
- github.com/filecoin-project/specs-actors/v6 (v6.0.0 -> v6.0.1):
|
||||
- github.com/filecoin-project/go-jsonrpc (v0.1.4-0.20210217175800-45ea43ac2bec -> v0.1.5):
|
||||
- github.com/filecoin-project/go-fil-markets (v1.13.1 -> v1.13.3):
|
||||
- github.com/filecoin-project/go-data-transfer (v1.11.1 -> v1.11.4):
|
||||
- github.com/filecoin-project/go-crypto (v0.0.0-20191218222705-effae4ea9f03 -> v0.0.1):
|
||||
- github.com/filecoin-project/go-commp-utils (v0.1.1-0.20210427191551-70bf140d31c7 -> v0.1.2):
|
||||
- github.com/filecoin-project/go-cbor-util (v0.0.0-20191219014500-08c40a1e63a2 -> v0.0.1):
|
||||
- github.com/filecoin-project/go-address (v0.0.5 -> v0.0.6):
|
||||
- unpin the yamux dependency ([filecoin-project/lotus#7532](https://github.com/filecoin-project/lotus/pull/7532)
|
||||
- peerstore@v0.2.9 was withdrawn, let's not depend on it directly ([filecoin-project/lotus#7481](https://github.com/filecoin-project/lotus/pull/7481))
|
||||
- chore(deps): use tagged github.com/ipld/go-ipld-selector-text-lite ([filecoin-project/lotus#7464](https://github.com/filecoin-project/lotus/pull/7464))
|
||||
- Stop indirectly depending on deprecated github.com/prometheus/common ([filecoin-project/lotus#7473](https://github.com/filecoin-project/lotus/pull/7473))
|
||||
|
||||
## Others
|
||||
- fix the changelog ([filecoin-project/lotus#7594](https://github.com/filecoin-project/lotus/pull/7594))
|
||||
- v1.13.1-rc2 prep ([filecoin-project/lotus#7593](https://github.com/filecoin-project/lotus/pull/7593))
|
||||
- lotus v1.13.1-rc1 ([filecoin-project/lotus#7569](https://github.com/filecoin-project/lotus/pull/7569))
|
||||
- misc: back-port v1.13.0 back to master ([filecoin-project/lotus#7537](https://github.com/filecoin-project/lotus/pull/7537))
|
||||
- Inline codegen ([filecoin-project/lotus#7495](https://github.com/filecoin-project/lotus/pull/7495))
|
||||
- releases -> master ([filecoin-project/lotus#7507](https://github.com/filecoin-project/lotus/pull/7507))
|
||||
- Make chocolate back to master ([filecoin-project/lotus#7493](https://github.com/filecoin-project/lotus/pull/7493))
|
||||
- restore filters for the build-macos job ([filecoin-project/lotus#7455](https://github.com/filecoin-project/lotus/pull/7455))
|
||||
- bump master to v1.13.1-dev ([filecoin-project/lotus#7451](https://github.com/filecoin-project/lotus/pull/7451))
|
||||
|
||||
Contributors
|
||||
|
||||
| Contributor | Commits | Lines ± | Files Changed |
|
||||
|-------------|---------|---------|---------------|
|
||||
| @magik6k | 27 | +1285/-531 | 76 |
|
||||
| @ribasushi | 7 | +265/-1635 | 21 |
|
||||
| @raulk | 2 | +2/-737 | 13 |
|
||||
| @nonsens | 4 | +391/-21 | 19 |
|
||||
| @arajasek | 6 | +216/-23 | 14 |
|
||||
| @jennijuju| 8 | +102/-37 | 29 |
|
||||
| Steven Allen | 2 | +77/-29 | 6 |
|
||||
| @jennijuju | 4 | +19/-18 | 11 |
|
||||
| @dirkmc | 2 | +9/-9 | 4 |
|
||||
| @@coryschwartz | 1 | +16/-2 | 2 |
|
||||
| @frrist | 1 | +12/-0 | 2 |
|
||||
| @Kubuxu | 5 | +5/-5 | 5 |
|
||||
| @hunjixin | 2 | +6/-3 | 2 |
|
||||
| @vyzo | 1 | +3/-3 | 2 |
|
||||
| @@rvagg | 1 | +3/-3 | 2 |
|
||||
| @hannahhoward | 1 | +3/-2 | 2 |
|
||||
| Marten Seemann | 1 | +3/-0 | 1 |
|
||||
| @ZenGround0 | 1 | +1/-1 | 1 |
|
||||
|
||||
|
||||
# v1.13.0 / 2021-10-18
|
||||
|
||||
Lotus v1.13.0 is a *highly recommended* feature release for all lotus users(i.e: storage providers, data brokers, application developers and so on) that supports the upcoming
|
||||
[Network v14 Chocolate upgrade](https://github.com/filecoin-project/lotus/discussions/7431).
|
||||
This feature release includes the latest functionalities and improvements, like data transfer rate-limiting for both storage and retrieval deals, proof v10 with CUDA support, etc. You can find more details in the Changelog below.
|
||||
|
||||
## Highlights
|
||||
- Enable separate storage and retrieval transfer limits ([filecoin-project/lotus#7405](https://github.com/filecoin-project/lotus/pull/7405))
|
||||
- `SimultaneousTransfer` is now replaced by `SimultaneousTransfersForStorage` and `SimultaneousTransfersForRetrieval`, where users may set the amount of ongoing data transfer for storage and retrieval deals in parallel separately. The default value for both is set to 20.
|
||||
- If you are using the lotus client, these two configuration variables are under the `Client` section in `./lotus/config.toml`.
|
||||
- If you are a service provider, these two configuration variables should be set under the `Dealmaking` section in `/.lotusminer/config.toml`.
|
||||
- Update proofs to v10.0.0 ([filecoin-project/lotus#7420](https://github.com/filecoin-project/lotus/pull/7420))
|
||||
- This version supports CUDA. To enable CUDA instead of openCL, build lotus with `FFI_USE_CUDA=1 FFI_BUILD_FROM_SOURCE=1 ...`.
|
||||
- You can find additional Nvidia driver installation instructions written by MinerX fellows [here](https://github.com/filecoin-project/lotus/discussions/7443#discussioncomment-1425274) and perf improvements result on PC2/C2/WindowPoSt computation on different profiles [here](https://github.com/filecoin-project/lotus/discussions/7443), most people observe a 30-50% decrease in computation time.
|
||||
|
||||
## New Features
|
||||
- Feat/datamodel selector retrieval ([filecoin-project/lotus#6393](https://github.com/filecoin-project/lotus/pull/66393393))
|
||||
- This introduces a new RetrievalOrder-struct field and a CLI option that takes a string representation as understood by [https://pkg.go.dev/github.com/ipld/go-ipld-selector-text-lite#SelectorSpecFromPath](https://pkg.go.dev/github.com/ipld/go-ipld-selector-text-lite#SelectorSpecFromPath). This allows for partial retrieval of any sub-DAG of a deal provided the user knows the exact low-level shape of the deal contents.
|
||||
- For example, to retrieve the first entry of a UnixFS directory by executing, run `lotus client retrieve --miner f0XXXXX --datamodel-path-selector 'Links/0/Hash' bafyROOTCID ~/output`
|
||||
- Expose storage stats on the metrics endpoint ([filecoin-project/lotus#7418](https://github.com/filecoin-project/lotus/pull/7418))
|
||||
- feat: Catch panic to generate report and reraise ([filecoin-project/lotus#7341](https://github.com/filecoin-project/lotus/pull/7341))
|
||||
- Set `LOTUS_PANIC_REPORT_PATH` and `LOTUS_PANIC_JOURNAL_LOOKBACK` to get reports generated when a panic occurs on your daemon miner or workers.
|
||||
- Add envconfig docs to the config ([filecoin-project/lotus#7412](https://github.com/filecoin-project/lotus/pull/7412))
|
||||
- You can now find supported env vars in [default-lotus-miner-config.toml](https://github.com/filecoin-project/lotus/blob/master/documentation/en/default-lotus-miner-config.toml).
|
||||
- lotus shed: fr32 utils ([filecoin-project/lotus#7355](https://github.com/filecoin-project/lotus/pull/7355))
|
||||
- Miner CLI: Allow trying to change owners of any miner actor ([filecoin-project/lotus#7328](https://github.com/filecoin-project/lotus/pull/7328))
|
||||
- Add --unproven flag to the sectors list command ([filecoin-project/lotus#7308](https://github.com/filecoin-project/lotus/pull/7308))
|
||||
|
||||
## Improvements
|
||||
- check for deal start epoch on SectorAddPieceToAny ([filecoin-project/lotus#7407](https://github.com/filecoin-project/lotus/pull/7407))
|
||||
- Verify Voucher locks in VoucherValidUnlocked ([filecoin-project/lotus#5609](https://github.com/filecoin-project/lotus/pull/5609))
|
||||
- Add more info to miner allinfo command ([filecoin-project/lotus#7384](https://github.com/filecoin-project/lotus/pull/7384))
|
||||
- add `lotus-miner storage-deals list --format=json` with transfers ([filecoin-project/lotus#7312](https://github.com/filecoin-project/lotus/pull/7312))
|
||||
- Fix formatting ([filecoin-project/lotus#7383](https://github.com/filecoin-project/lotus/pull/7383))
|
||||
- GetCurrentDealInfo err: handle correctly err case ([filecoin-project/lotus#7346](https://github.com/filecoin-project/lotus/pull/7346))
|
||||
- fix: Enforce verification key integrity check regardless of TRUST_PARAMS=1 ([filecoin-project/lotus#7327](https://github.com/filecoin-project/lotus/pull/7327))
|
||||
- Show more deal states in miner info ([filecoin-project/lotus#7311](https://github.com/filecoin-project/lotus/pull/7311))
|
||||
- Prep retrieval for selectors: no functional changes ([filecoin-project/lotus#7306](https://github.com/filecoin-project/lotus/pull/7306))
|
||||
- Seed: improve helptext ([filecoin-project/lotus#7304](https://github.com/filecoin-project/lotus/pull/7304))
|
||||
- Mempool: reduce size of sigValCache ([filecoin-project/lotus#7305](https://github.com/filecoin-project/lotus/pull/7305))
|
||||
- Stop indirectly depending on deprecated github.com/prometheus/common ([filecoin-project/lotus#7474](https://github.com/filecoin-project/lotus/pull/7474))
|
||||
|
||||
## Bug Fixes
|
||||
- StateSearchMsg: Correct usage of the allowReplaced flag ([filecoin-project/lotus#7450](https://github.com/filecoin-project/lotus/pull/7450))
|
||||
- fix staging area path buildup ([filecoin-project/lotus#7363](https://github.com/filecoin-project/lotus/pull/7363))
|
||||
- storagemgr: Cleanup workerLk around worker resources ([filecoin-project/lotus#7334](https://github.com/filecoin-project/lotus/pull/7334))
|
||||
- fix: check padSector Cid ([filecoin-project/lotus#7310](https://github.com/filecoin-project/lotus/pull/7310))
|
||||
- sealing: Recover sectors after failed AddPiece ([filecoin-project/lotus#7492](https://github.com/filecoin-project/lotus/pull/7492))
|
||||
- fix: support node instantiation in external packages ([filecoin-project/lotus#7511](https://github.com/filecoin-project/lotus/pull/7511))
|
||||
- Chore/backport cleanup withdrawn dependency ([filecoin-project/lotus#7482](https://github.com/filecoin-project/lotus/pull/7482))
|
||||
|
||||
## Dependency Updates
|
||||
- github.com/filecoin-project/go-data-transfer (v1.10.1 -> v1.11.1):
|
||||
- github.com/filecoin-project/go-fil-markets (v1.12.0 -> v1.13.1):
|
||||
- github.com/filecoin-project/go-paramfetch (v0.0.2-0.20210614165157-25a6c7769498 -> v0.0.2):
|
||||
- update go-libp2p to v0.15.0 ([filecoin-project/lotus#7362](https://github.com/filecoin-project/lotus/pull/7362))
|
||||
- update to go-graphsync v0.10.1 ([filecoin-project/lotus#7359](https://github.com/filecoin-project/lotus/pull/7359))
|
||||
|
||||
## Others
|
||||
- Chocolate to master ([filecoin-project/lotus#7440](https://github.com/filecoin-project/lotus/pull/7440))
|
||||
- releases -> master ([filecoin-project/lotus#7403](https://github.com/filecoin-project/lotus/pull/7403))
|
||||
- remove nerpanet related code ([filecoin-project/lotus#7373](https://github.com/filecoin-project/lotus/pull/7373))
|
||||
- sync branch main with master on updates ([filecoin-project/lotus#7366](https://github.com/filecoin-project/lotus/pull/7366))
|
||||
- remove job to install jq ([filecoin-project/lotus#7309](https://github.com/filecoin-project/lotus/pull/7309))
|
||||
- restore filters for the build-macos job ([filecoin-project/lotus#7455](https://github.com/filecoin-project/lotus/pull/7455))
|
||||
- v1.13.0-rc2 ([filecoin-project/lotus#7458](https://github.com/filecoin-project/lotus/pull/7458))
|
||||
- v1.13.0-rc1 ([filecoin-project/lotus#7452](https://github.com/filecoin-project/lotus/pull/7452))
|
||||
|
||||
## Contributors
|
||||
|
||||
| Contributor | Commits | Lines ± | Files Changed |
|
||||
|-------------|---------|---------|---------------|
|
||||
| @dirkmc | 8 | +845/-375 | 55 |
|
||||
| @magik6k | 10 | +1056/-60 | 26 |
|
||||
| @aarshkshah1992 | 6 | +813/-259 | 16 |
|
||||
| @arajasek | 10 | +552/-251 | 43 |
|
||||
| @ribasushi | 6 | +505/-78 | 22 |
|
||||
| @jennijuju | 7 | +212/-323 | 34 |
|
||||
| @nonsense | 10 | +335/-139 | 19 |
|
||||
| @dirkmc | 8 | +149/-55 | 16 |
|
||||
| @hannahhoward | 4 | +56/-32 | 17 |
|
||||
| @rvagg | 4 | +61/-13 | 9 |
|
||||
| @jennijuju | 2 | +0/-57 | 2 |
|
||||
| @hannahhoward | 1 | +33/-18 | 7 |
|
||||
| @Kubuxu | 8 | +27/-16 | 9 |
|
||||
| @coryschwartz | 1 | +16/-2 | 2 |
|
||||
| @travisperson | 1 | +14/-0 | 1 |
|
||||
| @frrist | 1 | +12/-0 | 2 |
|
||||
| @ognots | 1 | +0/-10 | 2 |
|
||||
| @lanzafame | 1 | +3/-3 | 1 |
|
||||
| @jennijuju | 1 | +2/-2 | 1 |
|
||||
| @swift-mx | 1 | +1/-1 | 1 |
|
||||
|
||||
# v1.12.0 / 2021-10-12
|
||||
|
||||
This is a mandatory release of Lotus that introduces [Filecoin Network v14](https://github.com/filecoin-project/community/discussions/74#discussioncomment-1398542), codenamed the Chocolate upgrade. The Filecoin mainnet will upgrade at epoch 1231620, on 2021-10-26T13:30:00Z.
|
||||
|
||||
+2
-21
@@ -36,7 +36,7 @@ WORKDIR /opt/filecoin
|
||||
ARG RUSTFLAGS=""
|
||||
ARG GOFLAGS=""
|
||||
|
||||
RUN make lotus lotus-miner lotus-worker lotus-shed lotus-wallet lotus-gateway
|
||||
RUN make lotus lotus-miner lotus-worker lotus-shed lotus-wallet lotus-gateway lotus-stats
|
||||
|
||||
|
||||
FROM ubuntu:20.04 AS base
|
||||
@@ -66,8 +66,6 @@ COPY scripts/docker-lotus-entrypoint.sh /
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
ENV LOTUS_PATH /var/lib/lotus
|
||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
||||
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
|
||||
ENV DOCKER_LOTUS_IMPORT_WALLET ""
|
||||
|
||||
@@ -92,8 +90,6 @@ MAINTAINER Lotus Development Team
|
||||
COPY --from=builder /opt/filecoin/lotus-wallet /usr/local/bin/
|
||||
|
||||
ENV WALLET_PATH /var/lib/lotus-wallet
|
||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
||||
|
||||
RUN mkdir /var/lib/lotus-wallet
|
||||
RUN chown fc: /var/lib/lotus-wallet
|
||||
@@ -114,10 +110,6 @@ MAINTAINER Lotus Development Team
|
||||
|
||||
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
|
||||
|
||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
||||
ENV FULLNODE_API_INFO /ip4/127.0.0.1/tcp/1234/http
|
||||
|
||||
USER fc
|
||||
|
||||
EXPOSE 1234
|
||||
@@ -135,11 +127,7 @@ COPY --from=builder /opt/filecoin/lotus-miner /usr/local/bin/
|
||||
COPY scripts/docker-lotus-miner-entrypoint.sh /
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
ENV FULLNODE_API_INFO /ip4/127.0.0.1/tcp/1234/http
|
||||
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
||||
ENV DOCKER_LOTUS_MINER_INIT true
|
||||
|
||||
RUN mkdir /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
|
||||
RUN chown fc: /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
|
||||
@@ -163,10 +151,7 @@ MAINTAINER Lotus Development Team
|
||||
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
ENV MINER_API_INFO /ip4/127.0.0.1/tcp/2345/http
|
||||
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
||||
|
||||
RUN mkdir /var/lib/lotus-worker
|
||||
RUN chown fc: /var/lib/lotus-worker
|
||||
@@ -186,16 +171,11 @@ CMD ["-help"]
|
||||
from base as lotus-all-in-one
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
ENV FULLNODE_API_INFO /ip4/127.0.0.1/tcp/1234/http
|
||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
||||
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
||||
ENV LOTUS_PATH /var/lib/lotus
|
||||
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
||||
ENV MINER_API_INFO /ip4/127.0.0.1/tcp/2345/http
|
||||
ENV WALLET_PATH /var/lib/lotus-wallet
|
||||
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
|
||||
ENV DOCKER_LOTUS_MINER_INIT true
|
||||
|
||||
COPY --from=builder /opt/filecoin/lotus /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-shed /usr/local/bin/
|
||||
@@ -203,6 +183,7 @@ COPY --from=builder /opt/filecoin/lotus-wallet /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-miner /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-stats /usr/local/bin/
|
||||
|
||||
RUN mkdir /var/tmp/filecoin-proof-parameters
|
||||
RUN mkdir /var/lib/lotus
|
||||
|
||||
@@ -76,9 +76,6 @@ debug: build-devnets
|
||||
calibnet: GOFLAGS+=-tags=calibnet
|
||||
calibnet: build-devnets
|
||||
|
||||
nerpanet: GOFLAGS+=-tags=nerpanet
|
||||
nerpanet: build-devnets
|
||||
|
||||
butterflynet: GOFLAGS+=-tags=butterflynet
|
||||
butterflynet: build-devnets
|
||||
|
||||
@@ -294,6 +291,7 @@ method-gen: api-gen
|
||||
(cd ./lotuspond/front/src/chain && $(GOCC) run ./methodgen.go)
|
||||
|
||||
actors-gen:
|
||||
$(GOCC) run ./gen/inline-gen . gen/inlinegen-data.json
|
||||
$(GOCC) run ./chain/actors/agen
|
||||
$(GOCC) fmt ./...
|
||||
|
||||
@@ -344,7 +342,7 @@ docsgen-openrpc-worker: docsgen-openrpc-bin
|
||||
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin
|
||||
|
||||
gen: actors-gen type-gen method-gen cfgdoc-gen docsgen api-gen circleci
|
||||
@echo ">>> IF YOU'VE MODIFIED THE CLI, REMEMBER TO ALSO MAKE docsgen-cli"
|
||||
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli"
|
||||
.PHONY: gen
|
||||
|
||||
snap: lotus lotus-miner lotus-worker
|
||||
@@ -354,6 +352,8 @@ snap: lotus lotus-miner lotus-worker
|
||||
# separate from gen because it needs binaries
|
||||
docsgen-cli: lotus lotus-miner lotus-worker
|
||||
python ./scripts/generate-lotus-cli.py
|
||||
./lotus config default > documentation/en/default-lotus-config.toml
|
||||
./lotus-miner config default > documentation/en/default-lotus-miner-config.toml
|
||||
.PHONY: docsgen-cli
|
||||
|
||||
print-%:
|
||||
|
||||
@@ -123,7 +123,6 @@ Note: The default branch `master` is the dev branch where the latest new feature
|
||||
|
||||
# Or to join a testnet or devnet:
|
||||
make clean calibnet # Calibration with min 32GiB sectors
|
||||
make clean nerpanet # Nerpa with min 512MiB sectors
|
||||
|
||||
sudo make install
|
||||
```
|
||||
|
||||
+17
-13
@@ -27,7 +27,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
marketevents "github.com/filecoin-project/lotus/markets/loggers"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
"github.com/filecoin-project/lotus/node/repo/imports"
|
||||
)
|
||||
@@ -290,7 +289,7 @@ type FullNode interface {
|
||||
|
||||
// // UX ?
|
||||
|
||||
// MethodGroup: Wallet
|
||||
// MethodGroup: WalletF
|
||||
|
||||
// WalletNew creates a new address in the wallet with the given sigType.
|
||||
// Available key types: bls, secp256k1, secp256k1-ledger
|
||||
@@ -351,10 +350,11 @@ type FullNode interface {
|
||||
// ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.
|
||||
ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (QueryOffer, error) //perm:read
|
||||
// ClientRetrieve initiates the retrieval of a file, as specified in the order.
|
||||
ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *FileRef) error //perm:admin
|
||||
// ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
|
||||
// of status updates.
|
||||
ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
|
||||
ClientRetrieve(ctx context.Context, params RetrievalOrder) (*RestrievalRes, error) //perm:admin
|
||||
// ClientRetrieveWait waits for retrieval to be complete
|
||||
ClientRetrieveWait(ctx context.Context, deal retrievalmarket.DealID) error //perm:admin
|
||||
// ClientExport exports a file stored in the local filestore to a system file
|
||||
ClientExport(ctx context.Context, exportRef ExportRef, fileRef FileRef) error //perm:admin
|
||||
// ClientListRetrievals returns information about retrievals made by the local client
|
||||
ClientListRetrievals(ctx context.Context) ([]RetrievalInfo, error) //perm:write
|
||||
// ClientGetRetrievalUpdates returns status of updated retrieval deals
|
||||
@@ -629,10 +629,14 @@ type FullNode interface {
|
||||
// <sender address of the approve msg>, <method to call in the proposed message>, <params to include in the proposed message>
|
||||
MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
|
||||
|
||||
// MsigCancel cancels a previously-proposed multisig message
|
||||
// It takes the following params: <multisig address>, <proposed transaction ID> <signer address>
|
||||
MsigCancel(context.Context, address.Address, uint64, address.Address) (*MessagePrototype, error) //perm:sign
|
||||
|
||||
// MsigCancel cancels a previously-proposed multisig message
|
||||
// It takes the following params: <multisig address>, <proposed transaction ID>, <recipient address>, <value to transfer>,
|
||||
// <sender address of the cancel msg>, <method to call in the proposed message>, <params to include in the proposed message>
|
||||
MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
|
||||
MsigCancelTxnHash(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
|
||||
|
||||
// MsigAddPropose proposes adding a signer in the multisig
|
||||
// It takes the following params: <multisig address>, <sender address of the propose msg>,
|
||||
@@ -929,14 +933,14 @@ type MarketDeal struct {
|
||||
}
|
||||
|
||||
type RetrievalOrder struct {
|
||||
// TODO: make this less unixfs specific
|
||||
Root cid.Cid
|
||||
Piece *cid.Cid
|
||||
Root cid.Cid
|
||||
Piece *cid.Cid
|
||||
DataSelector *Selector
|
||||
|
||||
// todo: Size/Total are only used for calculating price per byte; we should let users just pass that
|
||||
Size uint64
|
||||
Total types.BigInt
|
||||
|
||||
FromLocalCAR string // if specified, get data from a local CARv2 file.
|
||||
// TODO: support offset
|
||||
Total types.BigInt
|
||||
UnsealPrice types.BigInt
|
||||
PaymentInterval uint64
|
||||
PaymentIntervalIncrease uint64
|
||||
|
||||
@@ -31,6 +31,8 @@ import (
|
||||
type Gateway interface {
|
||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||
ChainHead(ctx context.Context) (*types.TipSet, error)
|
||||
ChainGetParentMessages(context.Context, cid.Cid) ([]Message, error)
|
||||
ChainGetParentReceipts(context.Context, cid.Cid) ([]*types.MessageReceipt, error)
|
||||
ChainGetBlockMessages(context.Context, cid.Cid) (*BlockMessages, error)
|
||||
ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
|
||||
ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*HeadChange, error)
|
||||
@@ -39,6 +41,7 @@ type Gateway interface {
|
||||
ChainGetTipSetAfterHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
|
||||
ChainNotify(context.Context) (<-chan []*HeadChange, error)
|
||||
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
|
||||
ChainGetGenesis(context.Context) (*types.TipSet, error)
|
||||
GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
|
||||
MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
|
||||
MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
|
||||
|
||||
@@ -166,6 +166,7 @@ type StorageMiner interface {
|
||||
MarketCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
|
||||
MarketPendingDeals(ctx context.Context) (PendingDealInfo, error) //perm:write
|
||||
MarketPublishPendingDeals(ctx context.Context) error //perm:admin
|
||||
MarketRetryPublishDeal(ctx context.Context, propcid cid.Cid) error //perm:admin
|
||||
|
||||
// DagstoreListShards returns information about all shards known to the
|
||||
// DAG store. Only available on nodes running the markets subsystem.
|
||||
|
||||
+15
-6
@@ -15,7 +15,6 @@ import (
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
"github.com/google/uuid"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipfs/go-filestore"
|
||||
"github.com/libp2p/go-libp2p-core/metrics"
|
||||
"github.com/libp2p/go-libp2p-core/network"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
@@ -24,9 +23,10 @@ import (
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
|
||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||
filestore2 "github.com/filecoin-project/go-fil-markets/filestore"
|
||||
filestore "github.com/filecoin-project/go-fil-markets/filestore"
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-jsonrpc/auth"
|
||||
textselector "github.com/ipld/go-ipld-selector-text-lite"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
@@ -90,6 +90,9 @@ func init() {
|
||||
addExample(&pid)
|
||||
|
||||
storeIDExample := imports.ID(50)
|
||||
textSelExample := textselector.Expression("Links/21/Hash/Links/42/Hash")
|
||||
apiSelExample := api.Selector("Links/21/Hash/Links/42/Hash")
|
||||
clientEvent := retrievalmarket.ClientEventDealAccepted
|
||||
|
||||
addExample(bitfield.NewFromSet([]uint64{5}))
|
||||
addExample(abi.RegisteredSealProof_StackedDrg32GiBV1_1)
|
||||
@@ -108,7 +111,6 @@ func init() {
|
||||
addExample(abi.UnpaddedPieceSize(1024))
|
||||
addExample(abi.UnpaddedPieceSize(1024).Padded())
|
||||
addExample(abi.DealID(5432))
|
||||
addExample(filestore.StatusFileChanged)
|
||||
addExample(abi.SectorNumber(9))
|
||||
addExample(abi.SectorSize(32 * 1024 * 1024 * 1024))
|
||||
addExample(api.MpoolChange(0))
|
||||
@@ -122,8 +124,12 @@ func init() {
|
||||
addExample(datatransfer.Ongoing)
|
||||
addExample(storeIDExample)
|
||||
addExample(&storeIDExample)
|
||||
addExample(clientEvent)
|
||||
addExample(&clientEvent)
|
||||
addExample(retrievalmarket.ClientEventDealAccepted)
|
||||
addExample(retrievalmarket.DealStatusNew)
|
||||
addExample(&textSelExample)
|
||||
addExample(&apiSelExample)
|
||||
addExample(network.ReachabilityPublic)
|
||||
addExample(build.NewestNetworkVersion)
|
||||
addExample(map[string]int{"name": 42})
|
||||
@@ -175,7 +181,7 @@ func init() {
|
||||
ExampleValues[reflect.TypeOf(struct{ A multiaddr.Multiaddr }{}).Field(0).Type] = maddr
|
||||
|
||||
// miner specific
|
||||
addExample(filestore2.Path(".lotusminer/fstmp123"))
|
||||
addExample(filestore.Path(".lotusminer/fstmp123"))
|
||||
si := uint64(12)
|
||||
addExample(&si)
|
||||
addExample(retrievalmarket.DealID(5))
|
||||
@@ -225,16 +231,18 @@ func init() {
|
||||
Hostname: "host",
|
||||
Resources: storiface.WorkerResources{
|
||||
MemPhysical: 256 << 30,
|
||||
MemUsed: 2 << 30,
|
||||
MemSwap: 120 << 30,
|
||||
MemReserved: 2 << 30,
|
||||
MemSwapUsed: 2 << 30,
|
||||
CPUs: 64,
|
||||
GPUs: []string{"aGPU 1337"},
|
||||
Resources: storiface.ResourceTable,
|
||||
},
|
||||
},
|
||||
Enabled: true,
|
||||
MemUsedMin: 0,
|
||||
MemUsedMax: 0,
|
||||
GpuUsed: false,
|
||||
GpuUsed: 0,
|
||||
CpuUse: 0,
|
||||
},
|
||||
})
|
||||
@@ -280,6 +288,7 @@ func init() {
|
||||
State: "ShardStateAvailable",
|
||||
Error: "<error>",
|
||||
})
|
||||
addExample(storiface.ResourceTable)
|
||||
}
|
||||
|
||||
func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
|
||||
|
||||
+48
-20
@@ -25,7 +25,6 @@ import (
|
||||
miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
types "github.com/filecoin-project/lotus/chain/types"
|
||||
alerting "github.com/filecoin-project/lotus/journal/alerting"
|
||||
marketevents "github.com/filecoin-project/lotus/markets/loggers"
|
||||
dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
imports "github.com/filecoin-project/lotus/node/repo/imports"
|
||||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
@@ -537,6 +536,20 @@ func (mr *MockFullNodeMockRecorder) ClientDealSize(arg0, arg1 interface{}) *gomo
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealSize", reflect.TypeOf((*MockFullNode)(nil).ClientDealSize), arg0, arg1)
|
||||
}
|
||||
|
||||
// ClientExport mocks base method.
|
||||
func (m *MockFullNode) ClientExport(arg0 context.Context, arg1 api.ExportRef, arg2 api.FileRef) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ClientExport", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// ClientExport indicates an expected call of ClientExport.
|
||||
func (mr *MockFullNodeMockRecorder) ClientExport(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientExport", reflect.TypeOf((*MockFullNode)(nil).ClientExport), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// ClientFindData mocks base method.
|
||||
func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *cid.Cid) ([]api.QueryOffer, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -775,17 +788,18 @@ func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2,
|
||||
}
|
||||
|
||||
// ClientRetrieve mocks base method.
|
||||
func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) error {
|
||||
func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder) (*api.RestrievalRes, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1)
|
||||
ret0, _ := ret[0].(*api.RestrievalRes)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// ClientRetrieve indicates an expected call of ClientRetrieve.
|
||||
func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||
func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1, arg2)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1)
|
||||
}
|
||||
|
||||
// ClientRetrieveTryRestartInsufficientFunds mocks base method.
|
||||
@@ -802,19 +816,18 @@ func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(ar
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveTryRestartInsufficientFunds", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveTryRestartInsufficientFunds), arg0, arg1)
|
||||
}
|
||||
|
||||
// ClientRetrieveWithEvents mocks base method.
|
||||
func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
// ClientRetrieveWait mocks base method.
|
||||
func (m *MockFullNode) ClientRetrieveWait(arg0 context.Context, arg1 retrievalmarket.DealID) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ClientRetrieveWithEvents", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(<-chan marketevents.RetrievalEvent)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
ret := m.ctrl.Call(m, "ClientRetrieveWait", arg0, arg1)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// ClientRetrieveWithEvents indicates an expected call of ClientRetrieveWithEvents.
|
||||
func (mr *MockFullNodeMockRecorder) ClientRetrieveWithEvents(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||
// ClientRetrieveWait indicates an expected call of ClientRetrieveWait.
|
||||
func (mr *MockFullNodeMockRecorder) ClientRetrieveWait(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWithEvents", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWithEvents), arg0, arg1, arg2)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWait", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWait), arg0, arg1)
|
||||
}
|
||||
|
||||
// ClientStartDeal mocks base method.
|
||||
@@ -1428,18 +1441,33 @@ func (mr *MockFullNodeMockRecorder) MsigApproveTxnHash(arg0, arg1, arg2, arg3, a
|
||||
}
|
||||
|
||||
// MsigCancel mocks base method.
|
||||
func (m *MockFullNode) MsigCancel(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address, arg4 big.Int, arg5 address.Address, arg6 uint64, arg7 []byte) (*api.MessagePrototype, error) {
|
||||
func (m *MockFullNode) MsigCancel(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address) (*api.MessagePrototype, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "MsigCancel", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
ret := m.ctrl.Call(m, "MsigCancel", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(*api.MessagePrototype)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// MsigCancel indicates an expected call of MsigCancel.
|
||||
func (mr *MockFullNodeMockRecorder) MsigCancel(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call {
|
||||
func (mr *MockFullNodeMockRecorder) MsigCancel(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCancel", reflect.TypeOf((*MockFullNode)(nil).MsigCancel), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCancel", reflect.TypeOf((*MockFullNode)(nil).MsigCancel), arg0, arg1, arg2, arg3)
|
||||
}
|
||||
|
||||
// MsigCancelTxnHash mocks base method.
|
||||
func (m *MockFullNode) MsigCancelTxnHash(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address, arg4 big.Int, arg5 address.Address, arg6 uint64, arg7 []byte) (*api.MessagePrototype, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "MsigCancelTxnHash", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
ret0, _ := ret[0].(*api.MessagePrototype)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// MsigCancelTxnHash indicates an expected call of MsigCancelTxnHash.
|
||||
func (mr *MockFullNodeMockRecorder) MsigCancelTxnHash(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCancelTxnHash", reflect.TypeOf((*MockFullNode)(nil).MsigCancelTxnHash), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||
}
|
||||
|
||||
// MsigCreate mocks base method.
|
||||
|
||||
+95
-18
@@ -28,7 +28,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
||||
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
|
||||
"github.com/filecoin-project/lotus/journal/alerting"
|
||||
marketevents "github.com/filecoin-project/lotus/markets/loggers"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
"github.com/filecoin-project/lotus/node/repo/imports"
|
||||
"github.com/filecoin-project/specs-storage/storage"
|
||||
@@ -162,6 +161,8 @@ type FullNodeStruct struct {
|
||||
|
||||
ClientDealSize func(p0 context.Context, p1 cid.Cid) (DataSize, error) `perm:"read"`
|
||||
|
||||
ClientExport func(p0 context.Context, p1 ExportRef, p2 FileRef) error `perm:"admin"`
|
||||
|
||||
ClientFindData func(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) `perm:"read"`
|
||||
|
||||
ClientGenCar func(p0 context.Context, p1 FileRef, p2 string) error `perm:"write"`
|
||||
@@ -194,11 +195,11 @@ type FullNodeStruct struct {
|
||||
|
||||
ClientRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
|
||||
|
||||
ClientRetrieve func(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) error `perm:"admin"`
|
||||
ClientRetrieve func(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) `perm:"admin"`
|
||||
|
||||
ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"`
|
||||
|
||||
ClientRetrieveWithEvents func(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"`
|
||||
ClientRetrieveWait func(p0 context.Context, p1 retrievalmarket.DealID) error `perm:"admin"`
|
||||
|
||||
ClientStartDeal func(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) `perm:"admin"`
|
||||
|
||||
@@ -270,7 +271,9 @@ type FullNodeStruct struct {
|
||||
|
||||
MsigApproveTxnHash func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 address.Address, p5 types.BigInt, p6 address.Address, p7 uint64, p8 []byte) (*MessagePrototype, error) `perm:"sign"`
|
||||
|
||||
MsigCancel func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (*MessagePrototype, error) `perm:"sign"`
|
||||
MsigCancel func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (*MessagePrototype, error) `perm:"sign"`
|
||||
|
||||
MsigCancelTxnHash func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (*MessagePrototype, error) `perm:"sign"`
|
||||
|
||||
MsigCreate func(p0 context.Context, p1 uint64, p2 []address.Address, p3 abi.ChainEpoch, p4 types.BigInt, p5 address.Address, p6 types.BigInt) (*MessagePrototype, error) `perm:"sign"`
|
||||
|
||||
@@ -478,8 +481,14 @@ type GatewayStruct struct {
|
||||
Internal struct {
|
||||
ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) ``
|
||||
|
||||
ChainGetGenesis func(p0 context.Context) (*types.TipSet, error) ``
|
||||
|
||||
ChainGetMessage func(p0 context.Context, p1 cid.Cid) (*types.Message, error) ``
|
||||
|
||||
ChainGetParentMessages func(p0 context.Context, p1 cid.Cid) ([]Message, error) ``
|
||||
|
||||
ChainGetParentReceipts func(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) ``
|
||||
|
||||
ChainGetPath func(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*HeadChange, error) ``
|
||||
|
||||
ChainGetTipSet func(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) ``
|
||||
@@ -683,6 +692,8 @@ type StorageMinerStruct struct {
|
||||
|
||||
MarketRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
|
||||
|
||||
MarketRetryPublishDeal func(p0 context.Context, p1 cid.Cid) error `perm:"admin"`
|
||||
|
||||
MarketSetAsk func(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error `perm:"admin"`
|
||||
|
||||
MarketSetRetrievalAsk func(p0 context.Context, p1 *retrievalmarket.Ask) error `perm:"admin"`
|
||||
@@ -1347,6 +1358,17 @@ func (s *FullNodeStub) ClientDealSize(p0 context.Context, p1 cid.Cid) (DataSize,
|
||||
return *new(DataSize), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientExport(p0 context.Context, p1 ExportRef, p2 FileRef) error {
|
||||
if s.Internal.ClientExport == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ClientExport(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) ClientExport(p0 context.Context, p1 ExportRef, p2 FileRef) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) {
|
||||
if s.Internal.ClientFindData == nil {
|
||||
return *new([]QueryOffer), ErrNotSupported
|
||||
@@ -1523,15 +1545,15 @@ func (s *FullNodeStub) ClientRestartDataTransfer(p0 context.Context, p1 datatran
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) error {
|
||||
func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) {
|
||||
if s.Internal.ClientRetrieve == nil {
|
||||
return ErrNotSupported
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.ClientRetrieve(p0, p1, p2)
|
||||
return s.Internal.ClientRetrieve(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) error {
|
||||
return ErrNotSupported
|
||||
func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error {
|
||||
@@ -1545,15 +1567,15 @@ func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Cont
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
if s.Internal.ClientRetrieveWithEvents == nil {
|
||||
return nil, ErrNotSupported
|
||||
func (s *FullNodeStruct) ClientRetrieveWait(p0 context.Context, p1 retrievalmarket.DealID) error {
|
||||
if s.Internal.ClientRetrieveWait == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ClientRetrieveWithEvents(p0, p1, p2)
|
||||
return s.Internal.ClientRetrieveWait(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
return nil, ErrNotSupported
|
||||
func (s *FullNodeStub) ClientRetrieveWait(p0 context.Context, p1 retrievalmarket.DealID) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) {
|
||||
@@ -1941,14 +1963,25 @@ func (s *FullNodeStub) MsigApproveTxnHash(p0 context.Context, p1 address.Address
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) MsigCancel(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (*MessagePrototype, error) {
|
||||
func (s *FullNodeStruct) MsigCancel(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (*MessagePrototype, error) {
|
||||
if s.Internal.MsigCancel == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.MsigCancel(p0, p1, p2, p3, p4, p5, p6, p7)
|
||||
return s.Internal.MsigCancel(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) MsigCancel(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (*MessagePrototype, error) {
|
||||
func (s *FullNodeStub) MsigCancel(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (*MessagePrototype, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) MsigCancelTxnHash(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (*MessagePrototype, error) {
|
||||
if s.Internal.MsigCancelTxnHash == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.MsigCancelTxnHash(p0, p1, p2, p3, p4, p5, p6, p7)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) MsigCancelTxnHash(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (*MessagePrototype, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
@@ -3030,6 +3063,17 @@ func (s *GatewayStub) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*Bl
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainGetGenesis(p0 context.Context) (*types.TipSet, error) {
|
||||
if s.Internal.ChainGetGenesis == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainGetGenesis(p0)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) ChainGetGenesis(p0 context.Context) (*types.TipSet, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) {
|
||||
if s.Internal.ChainGetMessage == nil {
|
||||
return nil, ErrNotSupported
|
||||
@@ -3041,6 +3085,28 @@ func (s *GatewayStub) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Me
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainGetParentMessages(p0 context.Context, p1 cid.Cid) ([]Message, error) {
|
||||
if s.Internal.ChainGetParentMessages == nil {
|
||||
return *new([]Message), ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainGetParentMessages(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) ChainGetParentMessages(p0 context.Context, p1 cid.Cid) ([]Message, error) {
|
||||
return *new([]Message), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainGetParentReceipts(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) {
|
||||
if s.Internal.ChainGetParentReceipts == nil {
|
||||
return *new([]*types.MessageReceipt), ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainGetParentReceipts(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) ChainGetParentReceipts(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) {
|
||||
return *new([]*types.MessageReceipt), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainGetPath(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*HeadChange, error) {
|
||||
if s.Internal.ChainGetPath == nil {
|
||||
return *new([]*HeadChange), ErrNotSupported
|
||||
@@ -4020,6 +4086,17 @@ func (s *StorageMinerStub) MarketRestartDataTransfer(p0 context.Context, p1 data
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) MarketRetryPublishDeal(p0 context.Context, p1 cid.Cid) error {
|
||||
if s.Internal.MarketRetryPublishDeal == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.MarketRetryPublishDeal(p0, p1)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) MarketRetryPublishDeal(p0 context.Context, p1 cid.Cid) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) MarketSetAsk(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error {
|
||||
if s.Internal.MarketSetAsk == nil {
|
||||
return ErrNotSupported
|
||||
|
||||
+45
-3
@@ -5,11 +5,10 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
@@ -194,4 +193,47 @@ type RetrievalInfo struct {
|
||||
|
||||
TransferChannelID *datatransfer.ChannelID
|
||||
DataTransfer *DataTransferChannel
|
||||
|
||||
// optional event if part of ClientGetRetrievalUpdates
|
||||
Event *retrievalmarket.ClientEvent
|
||||
}
|
||||
|
||||
type RestrievalRes struct {
|
||||
DealID retrievalmarket.DealID
|
||||
}
|
||||
|
||||
// Selector specifies ipld selector string
|
||||
// - if the string starts with '{', it's interpreted as json selector string
|
||||
// see https://ipld.io/specs/selectors/ and https://ipld.io/specs/selectors/fixtures/selector-fixtures-1/
|
||||
// - otherwise the string is interpreted as ipld-selector-text-lite (simple ipld path)
|
||||
// see https://github.com/ipld/go-ipld-selector-text-lite
|
||||
type Selector string
|
||||
|
||||
type DagSpec struct {
|
||||
// DataSelector matches data to be retrieved
|
||||
// - when using textselector, the path specifies subtree
|
||||
// - the matched graph must have a single root
|
||||
DataSelector *Selector
|
||||
|
||||
// ExportMerkleProof is applicable only when exporting to a CAR file via a path textselector
|
||||
// When true, in addition to the selection target, the resulting CAR will contain every block along the
|
||||
// path back to, and including the original root
|
||||
// When false the resulting CAR contains only the blocks of the target subdag
|
||||
ExportMerkleProof bool
|
||||
}
|
||||
|
||||
type ExportRef struct {
|
||||
Root cid.Cid
|
||||
|
||||
// DAGs array specifies a list of DAGs to export
|
||||
// - If exporting into unixfs files, only one DAG is supported, DataSelector is only used to find the targeted root node
|
||||
// - If exporting into a car file
|
||||
// - When exactly one text-path DataSelector is specified exports the subgraph and its full merkle-path from the original root
|
||||
// - Otherwise ( multiple paths and/or JSON selector specs) determines each individual subroot and exports the subtrees as a multi-root car
|
||||
// - When not specified defaults to a single DAG:
|
||||
// - Data - the entire DAG: `{"R":{"l":{"none":{}},":>":{"a":{">":{"@":{}}}}}}`
|
||||
DAGs []DagSpec
|
||||
|
||||
FromLocalCAR string // if specified, get data from a local CARv2 file.
|
||||
DealID retrievalmarket.DealID
|
||||
}
|
||||
|
||||
+37
-2
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
textselector "github.com/ipld/go-ipld-selector-text-lite"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
@@ -325,10 +326,10 @@ type FullNode interface {
|
||||
// ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.
|
||||
ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) //perm:read
|
||||
// ClientRetrieve initiates the retrieval of a file, as specified in the order.
|
||||
ClientRetrieve(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error //perm:admin
|
||||
ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef) error //perm:admin
|
||||
// ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
|
||||
// of status updates.
|
||||
ClientRetrieveWithEvents(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
|
||||
ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
|
||||
// ClientQueryAsk returns a signed StorageAsk from the specified miner.
|
||||
// ClientListRetrievals returns information about retrievals made by the local client
|
||||
ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) //perm:write
|
||||
@@ -714,3 +715,37 @@ type FullNode interface {
|
||||
// the path specified when calling CreateBackup is within the base path
|
||||
CreateBackup(ctx context.Context, fpath string) error //perm:admin
|
||||
}
|
||||
|
||||
func OfferOrder(o api.QueryOffer, client address.Address) RetrievalOrder {
|
||||
return RetrievalOrder{
|
||||
Root: o.Root,
|
||||
Piece: o.Piece,
|
||||
Size: o.Size,
|
||||
Total: o.MinPrice,
|
||||
UnsealPrice: o.UnsealPrice,
|
||||
PaymentInterval: o.PaymentInterval,
|
||||
PaymentIntervalIncrease: o.PaymentIntervalIncrease,
|
||||
Client: client,
|
||||
|
||||
Miner: o.Miner,
|
||||
MinerPeer: &o.MinerPeer,
|
||||
}
|
||||
}
|
||||
|
||||
type RetrievalOrder struct {
|
||||
// TODO: make this less unixfs specific
|
||||
Root cid.Cid
|
||||
Piece *cid.Cid
|
||||
DatamodelPathSelector *textselector.Expression
|
||||
Size uint64
|
||||
|
||||
FromLocalCAR string // if specified, get data from a local CARv2 file.
|
||||
// TODO: support offset
|
||||
Total types.BigInt
|
||||
UnsealPrice types.BigInt
|
||||
PaymentInterval uint64
|
||||
PaymentIntervalIncrease uint64
|
||||
Client address.Address
|
||||
Miner address.Address
|
||||
MinerPeer *retrievalmarket.RetrievalPeer
|
||||
}
|
||||
|
||||
@@ -125,11 +125,11 @@ type FullNodeStruct struct {
|
||||
|
||||
ClientRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
|
||||
|
||||
ClientRetrieve func(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) error `perm:"admin"`
|
||||
ClientRetrieve func(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error `perm:"admin"`
|
||||
|
||||
ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"`
|
||||
|
||||
ClientRetrieveWithEvents func(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"`
|
||||
ClientRetrieveWithEvents func(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"`
|
||||
|
||||
ClientStartDeal func(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) `perm:"admin"`
|
||||
|
||||
@@ -965,14 +965,14 @@ func (s *FullNodeStub) ClientRestartDataTransfer(p0 context.Context, p1 datatran
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) error {
|
||||
func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error {
|
||||
if s.Internal.ClientRetrieve == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ClientRetrieve(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) error {
|
||||
func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
@@ -987,14 +987,14 @@ func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Cont
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
if s.Internal.ClientRetrieveWithEvents == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.ClientRetrieveWithEvents(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
network "github.com/filecoin-project/go-state-types/network"
|
||||
api "github.com/filecoin-project/lotus/api"
|
||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||
v0api "github.com/filecoin-project/lotus/api/v0api"
|
||||
miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
types "github.com/filecoin-project/lotus/chain/types"
|
||||
alerting "github.com/filecoin-project/lotus/journal/alerting"
|
||||
@@ -760,7 +761,7 @@ func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2,
|
||||
}
|
||||
|
||||
// ClientRetrieve mocks base method.
|
||||
func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) error {
|
||||
func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 v0api.RetrievalOrder, arg2 *api.FileRef) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(error)
|
||||
@@ -788,7 +789,7 @@ func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(ar
|
||||
}
|
||||
|
||||
// ClientRetrieveWithEvents mocks base method.
|
||||
func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 v0api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ClientRetrieveWithEvents", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(<-chan marketevents.RetrievalEvent)
|
||||
|
||||
+144
-1
@@ -3,7 +3,10 @@ package v0api
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
marketevents "github.com/filecoin-project/lotus/markets/loggers"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
@@ -108,7 +111,7 @@ func (w *WrapperV1Full) MsigApproveTxnHash(ctx context.Context, msig address.Add
|
||||
}
|
||||
|
||||
func (w *WrapperV1Full) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
|
||||
p, err := w.FullNode.MsigCancel(ctx, msig, txID, to, amt, src, method, params)
|
||||
p, err := w.FullNode.MsigCancelTxnHash(ctx, msig, txID, to, amt, src, method, params)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
|
||||
}
|
||||
@@ -194,4 +197,144 @@ func (w *WrapperV1Full) ChainGetRandomnessFromBeacon(ctx context.Context, tsk ty
|
||||
return w.StateGetRandomnessFromBeacon(ctx, personalization, randEpoch, entropy, tsk)
|
||||
}
|
||||
|
||||
func (w *WrapperV1Full) ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef) error {
|
||||
events := make(chan marketevents.RetrievalEvent)
|
||||
go w.clientRetrieve(ctx, order, ref, events)
|
||||
|
||||
for {
|
||||
select {
|
||||
case evt, ok := <-events:
|
||||
if !ok { // done successfully
|
||||
return nil
|
||||
}
|
||||
|
||||
if evt.Err != "" {
|
||||
return xerrors.Errorf("retrieval failed: %s", evt.Err)
|
||||
}
|
||||
case <-ctx.Done():
|
||||
return xerrors.Errorf("retrieval timed out")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (w *WrapperV1Full) ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||
events := make(chan marketevents.RetrievalEvent)
|
||||
go w.clientRetrieve(ctx, order, ref, events)
|
||||
return events, nil
|
||||
}
|
||||
|
||||
func readSubscribeEvents(ctx context.Context, dealID retrievalmarket.DealID, subscribeEvents <-chan api.RetrievalInfo, events chan marketevents.RetrievalEvent) error {
|
||||
for {
|
||||
var subscribeEvent api.RetrievalInfo
|
||||
var evt retrievalmarket.ClientEvent
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return xerrors.New("Retrieval Timed Out")
|
||||
case subscribeEvent = <-subscribeEvents:
|
||||
if subscribeEvent.ID != dealID {
|
||||
// we can't check the deal ID ahead of time because:
|
||||
// 1. We need to subscribe before retrieving.
|
||||
// 2. We won't know the deal ID until after retrieving.
|
||||
continue
|
||||
}
|
||||
if subscribeEvent.Event != nil {
|
||||
evt = *subscribeEvent.Event
|
||||
}
|
||||
}
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return xerrors.New("Retrieval Timed Out")
|
||||
case events <- marketevents.RetrievalEvent{
|
||||
Event: evt,
|
||||
Status: subscribeEvent.Status,
|
||||
BytesReceived: subscribeEvent.BytesReceived,
|
||||
FundsSpent: subscribeEvent.TotalPaid,
|
||||
}:
|
||||
}
|
||||
|
||||
switch subscribeEvent.Status {
|
||||
case retrievalmarket.DealStatusCompleted:
|
||||
return nil
|
||||
case retrievalmarket.DealStatusRejected:
|
||||
return xerrors.Errorf("Retrieval Proposal Rejected: %s", subscribeEvent.Message)
|
||||
case
|
||||
retrievalmarket.DealStatusDealNotFound,
|
||||
retrievalmarket.DealStatusErrored:
|
||||
return xerrors.Errorf("Retrieval Error: %s", subscribeEvent.Message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (w *WrapperV1Full) clientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef, events chan marketevents.RetrievalEvent) {
|
||||
defer close(events)
|
||||
|
||||
finish := func(e error) {
|
||||
if e != nil {
|
||||
events <- marketevents.RetrievalEvent{Err: e.Error(), FundsSpent: big.Zero()}
|
||||
}
|
||||
}
|
||||
|
||||
var dealID retrievalmarket.DealID
|
||||
if order.FromLocalCAR == "" {
|
||||
// Subscribe to events before retrieving to avoid losing events.
|
||||
subscribeCtx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
retrievalEvents, err := w.ClientGetRetrievalUpdates(subscribeCtx)
|
||||
|
||||
if err != nil {
|
||||
finish(xerrors.Errorf("GetRetrievalUpdates failed: %w", err))
|
||||
return
|
||||
}
|
||||
|
||||
retrievalRes, err := w.FullNode.ClientRetrieve(ctx, api.RetrievalOrder{
|
||||
Root: order.Root,
|
||||
Piece: order.Piece,
|
||||
Size: order.Size,
|
||||
Total: order.Total,
|
||||
UnsealPrice: order.UnsealPrice,
|
||||
PaymentInterval: order.PaymentInterval,
|
||||
PaymentIntervalIncrease: order.PaymentIntervalIncrease,
|
||||
Client: order.Client,
|
||||
Miner: order.Miner,
|
||||
MinerPeer: order.MinerPeer,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
finish(xerrors.Errorf("Retrieve failed: %w", err))
|
||||
return
|
||||
}
|
||||
|
||||
dealID = retrievalRes.DealID
|
||||
|
||||
err = readSubscribeEvents(ctx, retrievalRes.DealID, retrievalEvents, events)
|
||||
if err != nil {
|
||||
finish(xerrors.Errorf("Retrieve: %w", err))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// If ref is nil, it only fetches the data into the configured blockstore.
|
||||
if ref == nil {
|
||||
finish(nil)
|
||||
return
|
||||
}
|
||||
|
||||
eref := api.ExportRef{
|
||||
Root: order.Root,
|
||||
FromLocalCAR: order.FromLocalCAR,
|
||||
DealID: dealID,
|
||||
}
|
||||
|
||||
if order.DatamodelPathSelector != nil {
|
||||
s := api.Selector(*order.DatamodelPathSelector)
|
||||
eref.DAGs = append(eref.DAGs, api.DagSpec{
|
||||
DataSelector: &s,
|
||||
ExportMerkleProof: true,
|
||||
})
|
||||
}
|
||||
|
||||
finish(w.ClientExport(ctx, eref, *ref))
|
||||
}
|
||||
|
||||
var _ FullNode = &WrapperV1Full{}
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ var (
|
||||
FullAPIVersion1 = newVer(2, 1, 0)
|
||||
|
||||
MinerAPIVersion0 = newVer(1, 2, 0)
|
||||
WorkerAPIVersion0 = newVer(1, 1, 0)
|
||||
WorkerAPIVersion0 = newVer(1, 5, 0)
|
||||
)
|
||||
|
||||
//nolint:varcheck,deadcode
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
/dns4/bootstrap-2.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWQcL6ReWmR6ASWx4iT7EiAmxKDQpvgq1MKNTQZp5NPnWW
|
||||
/dns4/bootstrap-0.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWGyJCwCm7EfupM15CFPXM4c7zRVHwwwjcuy9umaGeztMX
|
||||
/dns4/bootstrap-3.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWNK9RmfksKXSCQj7ZwAM7L6roqbN4kwJteihq7yPvSgPs
|
||||
/dns4/bootstrap-1.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWCWSaH6iUyXYspYxELjDfzToBsyVGVz3QvC7ysXv7wESo
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,183 @@
|
||||
package build
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime/debug"
|
||||
"runtime/pprof"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/icza/backscanner"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
panicLog = logging.Logger("panic-reporter")
|
||||
defaultJournalTail = 500
|
||||
)
|
||||
|
||||
// PanicReportingPath is the name of the subdir created within the repoPath
|
||||
// path provided to GeneratePanicReport
|
||||
var PanicReportingPath = "panic-reports"
|
||||
|
||||
// PanicReportJournalTail is the number of lines captured from the end of
|
||||
// the lotus journal to be included in the panic report.
|
||||
var PanicReportJournalTail = defaultJournalTail
|
||||
|
||||
// GeneratePanicReport produces a timestamped dump of the application state
|
||||
// for inspection and debugging purposes. Call this function from any place
|
||||
// where a panic or severe error needs to be examined. `persistPath` is the
|
||||
// path where the reports should be saved. `repoPath` is the path where the
|
||||
// journal should be read from. `label` is an optional string to include
|
||||
// next to the report timestamp.
|
||||
func GeneratePanicReport(persistPath, repoPath, label string) {
|
||||
// make sure we always dump the latest logs on the way out
|
||||
// especially since we're probably panicking
|
||||
defer panicLog.Sync() //nolint:errcheck
|
||||
|
||||
if persistPath == "" && repoPath == "" {
|
||||
panicLog.Warn("missing persist and repo paths, aborting panic report creation")
|
||||
return
|
||||
}
|
||||
|
||||
reportPath := filepath.Join(repoPath, PanicReportingPath, generateReportName(label))
|
||||
if persistPath != "" {
|
||||
reportPath = filepath.Join(persistPath, generateReportName(label))
|
||||
}
|
||||
panicLog.Warnf("generating panic report at %s", reportPath)
|
||||
|
||||
tl := os.Getenv("LOTUS_PANIC_JOURNAL_LOOKBACK")
|
||||
if tl != "" && PanicReportJournalTail == defaultJournalTail {
|
||||
i, err := strconv.Atoi(tl)
|
||||
if err == nil {
|
||||
PanicReportJournalTail = i
|
||||
}
|
||||
}
|
||||
|
||||
err := os.MkdirAll(reportPath, 0755)
|
||||
if err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
writeAppVersion(filepath.Join(reportPath, "version"))
|
||||
writeStackTrace(filepath.Join(reportPath, "stacktrace.dump"))
|
||||
writeProfile("goroutines", filepath.Join(reportPath, "goroutines.pprof.gz"))
|
||||
writeProfile("heap", filepath.Join(reportPath, "heap.pprof.gz"))
|
||||
writeJournalTail(PanicReportJournalTail, repoPath, filepath.Join(reportPath, "journal.ndjson"))
|
||||
}
|
||||
|
||||
func writeAppVersion(file string) {
|
||||
f, err := os.Create(file)
|
||||
if err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
}
|
||||
defer f.Close() //nolint:errcheck
|
||||
|
||||
versionString := []byte(BuildVersion + BuildTypeString() + CurrentCommit + "\n")
|
||||
if _, err := f.Write(versionString); err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func writeStackTrace(file string) {
|
||||
f, err := os.Create(file)
|
||||
if err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
}
|
||||
defer f.Close() //nolint:errcheck
|
||||
|
||||
if _, err := f.Write(debug.Stack()); err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func writeProfile(profileType string, file string) {
|
||||
p := pprof.Lookup(profileType)
|
||||
if p == nil {
|
||||
panicLog.Warnf("%s profile not available", profileType)
|
||||
return
|
||||
}
|
||||
f, err := os.Create(file)
|
||||
if err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
return
|
||||
}
|
||||
defer f.Close() //nolint:errcheck
|
||||
|
||||
if err := p.WriteTo(f, 0); err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func writeJournalTail(tailLen int, repoPath, file string) {
|
||||
if repoPath == "" {
|
||||
panicLog.Warn("repo path is empty, aborting copy of journal log")
|
||||
return
|
||||
}
|
||||
|
||||
f, err := os.Create(file)
|
||||
if err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
return
|
||||
}
|
||||
defer f.Close() //nolint:errcheck
|
||||
|
||||
jPath, err := getLatestJournalFilePath(repoPath)
|
||||
if err != nil {
|
||||
panicLog.Warnf("failed getting latest journal: %s", err.Error())
|
||||
return
|
||||
}
|
||||
j, err := os.OpenFile(jPath, os.O_RDONLY, 0400)
|
||||
if err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
return
|
||||
}
|
||||
js, err := j.Stat()
|
||||
if err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
return
|
||||
}
|
||||
jScan := backscanner.New(j, int(js.Size()))
|
||||
linesWritten := 0
|
||||
for {
|
||||
if linesWritten > tailLen {
|
||||
break
|
||||
}
|
||||
line, _, err := jScan.LineBytes()
|
||||
if err != nil {
|
||||
if err != io.EOF {
|
||||
panicLog.Error(err.Error())
|
||||
}
|
||||
break
|
||||
}
|
||||
if _, err := f.Write(line); err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
break
|
||||
}
|
||||
if _, err := f.Write([]byte("\n")); err != nil {
|
||||
panicLog.Error(err.Error())
|
||||
break
|
||||
}
|
||||
linesWritten++
|
||||
}
|
||||
}
|
||||
|
||||
func getLatestJournalFilePath(repoPath string) (string, error) {
|
||||
journalPath := filepath.Join(repoPath, "journal")
|
||||
entries, err := os.ReadDir(journalPath)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return filepath.Join(journalPath, entries[len(entries)-1].Name()), nil
|
||||
}
|
||||
|
||||
func generateReportName(label string) string {
|
||||
label = strings.ReplaceAll(label, " ", "")
|
||||
return fmt.Sprintf("report_%s_%s", label, time.Now().Format("2006-01-02T150405"))
|
||||
}
|
||||
@@ -28,8 +28,16 @@ const UnixfsLinksPerLevel = 1024
|
||||
const AllowableClockDriftSecs = uint64(1)
|
||||
|
||||
// TODO: This is still terrible...What's the impact of updating this before mainnet actually upgrades
|
||||
/* inline-gen template
|
||||
|
||||
const NewestNetworkVersion = network.Version{{.latestNetworkVersion}}
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
const NewestNetworkVersion = network.Version14
|
||||
|
||||
/* inline-gen end */
|
||||
|
||||
// Epochs
|
||||
const ForkLengthThreshold = Finality
|
||||
|
||||
|
||||
+3
-6
@@ -12,11 +12,10 @@ const (
|
||||
BuildDebug = 0x3
|
||||
BuildCalibnet = 0x4
|
||||
BuildInteropnet = 0x5
|
||||
BuildNerpanet = 0x6
|
||||
BuildButterflynet = 0x7
|
||||
)
|
||||
|
||||
func buildType() string {
|
||||
func BuildTypeString() string {
|
||||
switch BuildType {
|
||||
case BuildDefault:
|
||||
return ""
|
||||
@@ -30,8 +29,6 @@ func buildType() string {
|
||||
return "+calibnet"
|
||||
case BuildInteropnet:
|
||||
return "+interopnet"
|
||||
case BuildNerpanet:
|
||||
return "+nerpanet"
|
||||
case BuildButterflynet:
|
||||
return "+butterflynet"
|
||||
default:
|
||||
@@ -40,12 +37,12 @@ func buildType() string {
|
||||
}
|
||||
|
||||
// BuildVersion is the local build version
|
||||
const BuildVersion = "1.12.0"
|
||||
const BuildVersion = "1.13.2"
|
||||
|
||||
func UserVersion() string {
|
||||
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
|
||||
return BuildVersion
|
||||
}
|
||||
|
||||
return BuildVersion + buildType() + CurrentCommit
|
||||
return BuildVersion + BuildTypeString() + CurrentCommit
|
||||
}
|
||||
|
||||
@@ -67,3 +67,22 @@ func SealProofTypeFromSectorSize(ssize abi.SectorSize, nv network.Version) (abi.
|
||||
|
||||
return 0, xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
|
||||
// WindowPoStProofTypeFromSectorSize returns preferred post proof type for creating
|
||||
// new miner actors and new sectors
|
||||
func WindowPoStProofTypeFromSectorSize(ssize abi.SectorSize) (abi.RegisteredPoStProof, error) {
|
||||
switch ssize {
|
||||
case 2 << 10:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, nil
|
||||
case 8 << 20:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, nil
|
||||
case 512 << 20:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, nil
|
||||
case 32 << 30:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, nil
|
||||
case 64 << 30:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, nil
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported sector size for miner: %v", ssize)
|
||||
}
|
||||
}
|
||||
|
||||
+15
-1
@@ -8,9 +8,21 @@ import (
|
||||
|
||||
type Version int
|
||||
|
||||
/* inline-gen template
|
||||
|
||||
var LatestVersion = {{.latestActorsVersion}}
|
||||
|
||||
var Versions = []int{ {{range .actorVersions}} {{.}}, {{end}} }
|
||||
|
||||
const ({{range .actorVersions}}
|
||||
Version{{.}} Version = {{.}}{{end}}
|
||||
)
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
var LatestVersion = 6
|
||||
|
||||
var Versions = []int{0, 2, 3, 4, 5, LatestVersion}
|
||||
var Versions = []int{0, 2, 3, 4, 5, 6}
|
||||
|
||||
const (
|
||||
Version0 Version = 0
|
||||
@@ -21,6 +33,8 @@ const (
|
||||
Version6 Version = 6
|
||||
)
|
||||
|
||||
/* inline-gen end */
|
||||
|
||||
// Converts a network version into an actors adt version.
|
||||
func VersionForNetwork(version network.Version) (Version, error) {
|
||||
switch version {
|
||||
|
||||
@@ -16,6 +16,12 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
blockadt "github.com/filecoin-project/specs-actors/actors/util/adt"
|
||||
|
||||
/* 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"
|
||||
@@ -23,6 +29,8 @@ import (
|
||||
exported5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/exported"
|
||||
exported6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/exported"
|
||||
|
||||
/* inline-gen end */
|
||||
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
@@ -39,6 +47,11 @@ func NewActorRegistry() *vm.ActorRegistry {
|
||||
inv := vm.NewActorRegistry()
|
||||
|
||||
// TODO: define all these properties on the actors themselves, in specs-actors.
|
||||
/* inline-gen template
|
||||
{{range .actorVersions}}
|
||||
inv.Register(vm.ActorsVersionPredicate(actors.Version{{.}}), exported{{.}}.BuiltinActors()...){{end}}
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
inv.Register(vm.ActorsVersionPredicate(actors.Version0), exported0.BuiltinActors()...)
|
||||
inv.Register(vm.ActorsVersionPredicate(actors.Version2), exported2.BuiltinActors()...)
|
||||
@@ -47,6 +60,8 @@ func NewActorRegistry() *vm.ActorRegistry {
|
||||
inv.Register(vm.ActorsVersionPredicate(actors.Version5), exported5.BuiltinActors()...)
|
||||
inv.Register(vm.ActorsVersionPredicate(actors.Version6), exported6.BuiltinActors()...)
|
||||
|
||||
/* inline-gen end */
|
||||
|
||||
return inv
|
||||
}
|
||||
|
||||
|
||||
@@ -823,7 +823,7 @@ func (filec *FilecoinEC) checkPowerAndGetWorkerKey(ctx context.Context, bh *type
|
||||
|
||||
key, err := stmgr.GetMinerWorkerRaw(ctx, filec.sm, lbst, bh.Miner)
|
||||
if err != nil {
|
||||
log.Warnf("failed to resolve worker key for miner %s: %s", bh.Miner, err)
|
||||
log.Warnf("failed to resolve worker key for miner %s and block height %d: %s", bh.Miner, bh.Height, err)
|
||||
return address.Undef, ErrSoftFailure
|
||||
}
|
||||
|
||||
|
||||
@@ -297,6 +297,10 @@ func NewGeneratorWithUpgradeSchedule(us stmgr.UpgradeSchedule) (*ChainGen, error
|
||||
return NewGeneratorWithSectorsAndUpgradeSchedule(1, us)
|
||||
}
|
||||
|
||||
func (cg *ChainGen) Blockstore() blockstore.Blockstore {
|
||||
return cg.bs
|
||||
}
|
||||
|
||||
func (cg *ChainGen) StateManager() *stmgr.StateManager {
|
||||
return cg.sm
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
ffi "github.com/filecoin-project/filecoin-ffi"
|
||||
|
||||
"github.com/minio/blake2b-simd"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
@@ -751,11 +755,13 @@ func (mp *MessagePool) Add(ctx context.Context, m *types.SignedMessage) error {
|
||||
func sigCacheKey(m *types.SignedMessage) (string, error) {
|
||||
switch m.Signature.Type {
|
||||
case crypto.SigTypeBLS:
|
||||
if len(m.Signature.Data) < 90 {
|
||||
return "", fmt.Errorf("bls signature too short")
|
||||
if len(m.Signature.Data) != ffi.SignatureBytes {
|
||||
return "", fmt.Errorf("bls signature incorrectly sized")
|
||||
}
|
||||
|
||||
return string(m.Cid().Bytes()) + string(m.Signature.Data[64:]), nil
|
||||
hashCache := blake2b.Sum256(append(m.Cid().Bytes(), m.Signature.Data...))
|
||||
|
||||
return string(hashCache[:]), nil
|
||||
case crypto.SigTypeSecp256k1:
|
||||
return string(m.Cid().Bytes()), nil
|
||||
default:
|
||||
|
||||
@@ -152,7 +152,16 @@ func VersionForNetwork(ver network.Version) (types.StateTreeVersion, error) {
|
||||
return types.StateTreeVersion2, nil
|
||||
case network.Version12:
|
||||
return types.StateTreeVersion3, nil
|
||||
|
||||
/* inline-gen template
|
||||
{{$lastNv := .latestNetworkVersion}}
|
||||
case{{range .networkVersions}} {{if (ge . 13.)}} network.Version{{.}}{{if (lt . $lastNv)}},{{end}}{{end}}{{end}}:
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
case network.Version13, network.Version14:
|
||||
|
||||
/* inline-gen end */
|
||||
return types.StateTreeVersion4, nil
|
||||
default:
|
||||
panic(fmt.Sprintf("unsupported network version %d", ver))
|
||||
|
||||
+19
-14
@@ -252,22 +252,27 @@ func (sm *StateManager) tipsetExecutedMessage(ts *types.TipSet, msg cid.Cid, vmm
|
||||
|
||||
if m.VMMessage().From == vmm.From { // cheaper to just check origin first
|
||||
if m.VMMessage().Nonce == vmm.Nonce {
|
||||
if allowReplaced && m.VMMessage().EqualCall(vmm) {
|
||||
if m.Cid() != msg {
|
||||
log.Warnw("found message with equal nonce and call params but different CID",
|
||||
"wanted", msg, "found", m.Cid(), "nonce", vmm.Nonce, "from", vmm.From)
|
||||
}
|
||||
|
||||
pr, err := sm.cs.GetParentReceipt(ts.Blocks()[0], i)
|
||||
if err != nil {
|
||||
return nil, cid.Undef, err
|
||||
}
|
||||
return pr, m.Cid(), nil
|
||||
if !m.VMMessage().EqualCall(vmm) {
|
||||
// this is an entirely different message, fail
|
||||
return nil, cid.Undef, xerrors.Errorf("found message with equal nonce as the one we are looking for that is NOT a valid replacement message (F:%s n %d, TS: %s n%d)",
|
||||
msg, vmm.Nonce, m.Cid(), m.VMMessage().Nonce)
|
||||
}
|
||||
|
||||
// this should be that message
|
||||
return nil, cid.Undef, xerrors.Errorf("found message with equal nonce as the one we are looking for (F:%s n %d, TS: %s n%d)",
|
||||
msg, vmm.Nonce, m.Cid(), m.VMMessage().Nonce)
|
||||
if m.Cid() != msg {
|
||||
if !allowReplaced {
|
||||
log.Warnw("found message with equal nonce and call params but different CID",
|
||||
"wanted", msg, "found", m.Cid(), "nonce", vmm.Nonce, "from", vmm.From)
|
||||
return nil, cid.Undef, xerrors.Errorf("found message with equal nonce as the one we are looking for (F:%s n %d, TS: %s n%d)",
|
||||
msg, vmm.Nonce, m.Cid(), m.VMMessage().Nonce)
|
||||
}
|
||||
}
|
||||
|
||||
pr, err := sm.cs.GetParentReceipt(ts.Blocks()[0], i)
|
||||
if err != nil {
|
||||
return nil, cid.Undef, err
|
||||
}
|
||||
|
||||
return pr, m.Cid(), nil
|
||||
}
|
||||
if m.VMMessage().Nonce < vmm.Nonce {
|
||||
return nil, cid.Undef, nil // don't bother looking further
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
package stmgr_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/gen"
|
||||
_ "github.com/filecoin-project/lotus/lib/sigs/bls"
|
||||
_ "github.com/filecoin-project/lotus/lib/sigs/secp"
|
||||
)
|
||||
|
||||
func TestSearchForMessageReplacements(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
cg, err := gen.NewGenerator()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
mts1, err := cg.NextTipSet()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
m := mts1.Messages[0]
|
||||
|
||||
mts2, err := cg.NextTipSet()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Step 1: Searching for the executed msg with replacements allowed succeeds
|
||||
ts, r, mcid, err := cg.StateManager().SearchForMessage(ctx, mts2.TipSet.TipSet(), m.Cid(), 100, true)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if !ts.Equals(mts2.TipSet.TipSet()) {
|
||||
t.Fatal("searched tipset wasn't as expected")
|
||||
}
|
||||
|
||||
if r.ExitCode != 0 {
|
||||
t.Fatal("searched msg wasn't successfully executed")
|
||||
}
|
||||
|
||||
if mcid != m.Cid() {
|
||||
t.Fatal("searched msg wasn't identical to queried msg as expected")
|
||||
}
|
||||
|
||||
// Step 2: Searching for the executed msg with replacements disallowed also succeeds
|
||||
ts, r, mcid, err = cg.StateManager().SearchForMessage(ctx, mts2.TipSet.TipSet(), m.Cid(), 100, true)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if !ts.Equals(mts2.TipSet.TipSet()) {
|
||||
t.Fatal("searched tipset wasn't as expected")
|
||||
}
|
||||
|
||||
if r.ExitCode != 0 {
|
||||
t.Fatal("searched msg wasn't successfully executed")
|
||||
}
|
||||
|
||||
if mcid != m.Cid() {
|
||||
t.Fatal("searched msg wasn't identical to queried msg as expected")
|
||||
}
|
||||
|
||||
// rm is a valid replacement message for m
|
||||
rm := m.Message
|
||||
rm.GasLimit = m.Message.GasLimit + 1
|
||||
|
||||
rmb, err := rm.ToStorageBlock()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = cg.Blockstore().Put(rmb)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Step 3: Searching for the replacement msg with replacements allowed succeeds
|
||||
ts, r, mcid, err = cg.StateManager().SearchForMessage(ctx, mts2.TipSet.TipSet(), rm.Cid(), 100, true)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if !ts.Equals(mts2.TipSet.TipSet()) {
|
||||
t.Fatal("searched tipset wasn't as expected")
|
||||
}
|
||||
|
||||
if r.ExitCode != 0 {
|
||||
t.Fatal("searched msg wasn't successfully executed")
|
||||
}
|
||||
|
||||
if mcid == rm.Cid() {
|
||||
t.Fatal("searched msg was identical to queried msg, not as expected")
|
||||
}
|
||||
|
||||
if mcid != m.Cid() {
|
||||
t.Fatal("searched msg wasn't identical to executed msg as expected")
|
||||
}
|
||||
|
||||
// Step 4: Searching for the replacement msg with replacements disallowed fails
|
||||
_, _, _, err = cg.StateManager().SearchForMessage(ctx, mts2.TipSet.TipSet(), rm.Cid(), 100, false)
|
||||
if err == nil {
|
||||
t.Fatal("expected search to fail")
|
||||
}
|
||||
|
||||
// nrm is NOT a valid replacement message for m
|
||||
nrm := m.Message
|
||||
nrm.Value = big.Add(m.Message.Value, m.Message.Value)
|
||||
|
||||
nrmb, err := nrm.ToStorageBlock()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = cg.Blockstore().Put(nrmb)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Step 5: Searching for the not-replacement msg with replacements allowed fails
|
||||
_, _, _, err = cg.StateManager().SearchForMessage(ctx, mts2.TipSet.TipSet(), nrm.Cid(), 100, true)
|
||||
if err == nil {
|
||||
t.Fatal("expected search to fail")
|
||||
}
|
||||
|
||||
// Step 6: Searching for the not-replacement msg with replacements disallowed also fails
|
||||
_, _, _, err = cg.StateManager().SearchForMessage(ctx, mts2.TipSet.TipSet(), nrm.Cid(), 100, false)
|
||||
if err == nil {
|
||||
t.Fatal("expected search to fail")
|
||||
}
|
||||
|
||||
}
|
||||
+17
-2
@@ -14,6 +14,12 @@ import (
|
||||
"github.com/ipfs/go-cid"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
|
||||
/* inline-gen template
|
||||
{{range .actorVersions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"{{end}}
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
|
||||
@@ -21,6 +27,8 @@ import (
|
||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
|
||||
/* inline-gen end */
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/lotus/chain/actors/aerrors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
@@ -60,7 +68,7 @@ func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, add
|
||||
return nil, address.Undef, aerrors.Escalate(err, "unsupported network version")
|
||||
}
|
||||
|
||||
act, aerr := makeActor(av, addr)
|
||||
act, aerr := makeAccountActor(av, addr)
|
||||
if aerr != nil {
|
||||
return nil, address.Undef, aerr
|
||||
}
|
||||
@@ -87,7 +95,7 @@ func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, add
|
||||
return act, addrID, nil
|
||||
}
|
||||
|
||||
func makeActor(ver actors.Version, addr address.Address) (*types.Actor, aerrors.ActorError) {
|
||||
func makeAccountActor(ver actors.Version, addr address.Address) (*types.Actor, aerrors.ActorError) {
|
||||
switch addr.Protocol() {
|
||||
case address.BLS, address.SECP256K1:
|
||||
return newAccountActor(ver), nil
|
||||
@@ -104,6 +112,12 @@ func newAccountActor(ver actors.Version) *types.Actor {
|
||||
// TODO: ActorsUpgrade use a global actor registry?
|
||||
var code cid.Cid
|
||||
switch ver {
|
||||
/* inline-gen template
|
||||
{{range .actorVersions}}
|
||||
case actors.Version{{.}}:
|
||||
code = builtin{{.}}.AccountActorCodeID{{end}}
|
||||
/* inline-gen start */
|
||||
|
||||
case actors.Version0:
|
||||
code = builtin0.AccountActorCodeID
|
||||
case actors.Version2:
|
||||
@@ -116,6 +130,7 @@ func newAccountActor(ver actors.Version) *types.Actor {
|
||||
code = builtin5.AccountActorCodeID
|
||||
case actors.Version6:
|
||||
code = builtin6.AccountActorCodeID
|
||||
/* inline-gen end */
|
||||
default:
|
||||
panic("unsupported actors version")
|
||||
}
|
||||
|
||||
@@ -218,6 +218,7 @@ func (rt *Runtime) GetRandomnessFromTickets(personalization crypto.DomainSeparat
|
||||
var res []byte
|
||||
|
||||
rnv := rt.vm.ntwkVersion(rt.ctx, randEpoch)
|
||||
|
||||
if rnv >= network.Version13 {
|
||||
res, err = rt.vm.rand.GetChainRandomnessV2(rt.ctx, personalization, randEpoch, entropy)
|
||||
} else {
|
||||
|
||||
+2
-195
@@ -93,6 +93,8 @@ var clientCmd = &cli.Command{
|
||||
WithCategory("data", clientStat),
|
||||
WithCategory("retrieval", clientFindCmd),
|
||||
WithCategory("retrieval", clientRetrieveCmd),
|
||||
WithCategory("retrieval", clientRetrieveCatCmd),
|
||||
WithCategory("retrieval", clientRetrieveLsCmd),
|
||||
WithCategory("retrieval", clientCancelRetrievalDealCmd),
|
||||
WithCategory("retrieval", clientListRetrievalsCmd),
|
||||
WithCategory("util", clientCommPCmd),
|
||||
@@ -1028,201 +1030,6 @@ var clientFindCmd = &cli.Command{
|
||||
},
|
||||
}
|
||||
|
||||
const DefaultMaxRetrievePrice = "0.01"
|
||||
|
||||
var clientRetrieveCmd = &cli.Command{
|
||||
Name: "retrieve",
|
||||
Usage: "Retrieve data from network",
|
||||
ArgsUsage: "[dataCid outputPath]",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "from",
|
||||
Usage: "address to send transactions from",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "car",
|
||||
Usage: "export to a car file instead of a regular file",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "miner",
|
||||
Usage: "miner address for retrieval, if not present it'll use local discovery",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "maxPrice",
|
||||
Usage: fmt.Sprintf("maximum price the client is willing to consider (default: %s FIL)", DefaultMaxRetrievePrice),
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "pieceCid",
|
||||
Usage: "require data to be retrieved from a specific Piece CID",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "allow-local",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.NArg() != 2 {
|
||||
return ShowHelp(cctx, fmt.Errorf("incorrect number of arguments"))
|
||||
}
|
||||
|
||||
fapi, closer, err := GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
ctx := ReqContext(cctx)
|
||||
afmt := NewAppFmt(cctx.App)
|
||||
|
||||
var payer address.Address
|
||||
if cctx.String("from") != "" {
|
||||
payer, err = address.NewFromString(cctx.String("from"))
|
||||
} else {
|
||||
payer, err = fapi.WalletDefaultAddress(ctx)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
file, err := cid.Parse(cctx.Args().Get(0))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var pieceCid *cid.Cid
|
||||
if cctx.String("pieceCid") != "" {
|
||||
parsed, err := cid.Parse(cctx.String("pieceCid"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pieceCid = &parsed
|
||||
}
|
||||
|
||||
var order *lapi.RetrievalOrder
|
||||
if cctx.Bool("allow-local") {
|
||||
imports, err := fapi.ClientListImports(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, i := range imports {
|
||||
if i.Root != nil && i.Root.Equals(file) {
|
||||
order = &lapi.RetrievalOrder{
|
||||
Root: file,
|
||||
FromLocalCAR: i.CARPath,
|
||||
|
||||
Total: big.Zero(),
|
||||
UnsealPrice: big.Zero(),
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if order == nil {
|
||||
var offer api.QueryOffer
|
||||
minerStrAddr := cctx.String("miner")
|
||||
if minerStrAddr == "" { // Local discovery
|
||||
offers, err := fapi.ClientFindData(ctx, file, pieceCid)
|
||||
|
||||
var cleaned []api.QueryOffer
|
||||
// filter out offers that errored
|
||||
for _, o := range offers {
|
||||
if o.Err == "" {
|
||||
cleaned = append(cleaned, o)
|
||||
}
|
||||
}
|
||||
|
||||
offers = cleaned
|
||||
|
||||
// sort by price low to high
|
||||
sort.Slice(offers, func(i, j int) bool {
|
||||
return offers[i].MinPrice.LessThan(offers[j].MinPrice)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO: parse offer strings from `client find`, make this smarter
|
||||
if len(offers) < 1 {
|
||||
fmt.Println("Failed to find file")
|
||||
return nil
|
||||
}
|
||||
offer = offers[0]
|
||||
} else { // Directed retrieval
|
||||
minerAddr, err := address.NewFromString(minerStrAddr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
offer, err = fapi.ClientMinerQueryOffer(ctx, minerAddr, file, pieceCid)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if offer.Err != "" {
|
||||
return fmt.Errorf("The received offer errored: %s", offer.Err)
|
||||
}
|
||||
|
||||
maxPrice := types.MustParseFIL(DefaultMaxRetrievePrice)
|
||||
|
||||
if cctx.String("maxPrice") != "" {
|
||||
maxPrice, err = types.ParseFIL(cctx.String("maxPrice"))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("parsing maxPrice: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if offer.MinPrice.GreaterThan(big.Int(maxPrice)) {
|
||||
return xerrors.Errorf("failed to find offer satisfying maxPrice: %s", maxPrice)
|
||||
}
|
||||
|
||||
o := offer.Order(payer)
|
||||
order = &o
|
||||
}
|
||||
ref := &lapi.FileRef{
|
||||
Path: cctx.Args().Get(1),
|
||||
IsCAR: cctx.Bool("car"),
|
||||
}
|
||||
|
||||
updates, err := fapi.ClientRetrieveWithEvents(ctx, *order, ref)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error setting up retrieval: %w", err)
|
||||
}
|
||||
|
||||
var prevStatus retrievalmarket.DealStatus
|
||||
|
||||
for {
|
||||
select {
|
||||
case evt, ok := <-updates:
|
||||
if ok {
|
||||
afmt.Printf("> Recv: %s, Paid %s, %s (%s)\n",
|
||||
types.SizeStr(types.NewInt(evt.BytesReceived)),
|
||||
types.FIL(evt.FundsSpent),
|
||||
retrievalmarket.ClientEvents[evt.Event],
|
||||
retrievalmarket.DealStatuses[evt.Status],
|
||||
)
|
||||
prevStatus = evt.Status
|
||||
}
|
||||
|
||||
if evt.Err != "" {
|
||||
return xerrors.Errorf("retrieval failed: %s", evt.Err)
|
||||
}
|
||||
|
||||
if !ok {
|
||||
if prevStatus == retrievalmarket.DealStatusCompleted {
|
||||
afmt.Println("Success")
|
||||
} else {
|
||||
afmt.Printf("saw final deal state %s instead of expected success state DealStatusCompleted\n",
|
||||
retrievalmarket.DealStatuses[prevStatus])
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
case <-ctx.Done():
|
||||
return xerrors.Errorf("retrieval timed out")
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
var clientListRetrievalsCmd = &cli.Command{
|
||||
Name: "list-retrievals",
|
||||
Usage: "List retrieval market deals",
|
||||
|
||||
@@ -0,0 +1,602 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-blockservice"
|
||||
"github.com/ipfs/go-cid"
|
||||
offline "github.com/ipfs/go-ipfs-exchange-offline"
|
||||
"github.com/ipfs/go-merkledag"
|
||||
carv2 "github.com/ipld/go-car/v2"
|
||||
"github.com/ipld/go-car/v2/blockstore"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
||||
basicnode "github.com/ipld/go-ipld-prime/node/basic"
|
||||
"github.com/ipld/go-ipld-prime/traversal"
|
||||
"github.com/ipld/go-ipld-prime/traversal/selector"
|
||||
"github.com/ipld/go-ipld-prime/traversal/selector/builder"
|
||||
selectorparse "github.com/ipld/go-ipld-prime/traversal/selector/parse"
|
||||
textselector "github.com/ipld/go-ipld-selector-text-lite"
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
manet "github.com/multiformats/go-multiaddr/net"
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
|
||||
lapi "github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/markets/utils"
|
||||
"github.com/filecoin-project/lotus/node/repo"
|
||||
)
|
||||
|
||||
const DefaultMaxRetrievePrice = "0"
|
||||
|
||||
func retrieve(ctx context.Context, cctx *cli.Context, fapi lapi.FullNode, sel *lapi.Selector, printf func(string, ...interface{})) (*lapi.ExportRef, error) {
|
||||
var payer address.Address
|
||||
var err error
|
||||
if cctx.String("from") != "" {
|
||||
payer, err = address.NewFromString(cctx.String("from"))
|
||||
} else {
|
||||
payer, err = fapi.WalletDefaultAddress(ctx)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
file, err := cid.Parse(cctx.Args().Get(0))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var pieceCid *cid.Cid
|
||||
if cctx.String("pieceCid") != "" {
|
||||
parsed, err := cid.Parse(cctx.String("pieceCid"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pieceCid = &parsed
|
||||
}
|
||||
|
||||
var eref *lapi.ExportRef
|
||||
if cctx.Bool("allow-local") {
|
||||
imports, err := fapi.ClientListImports(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, i := range imports {
|
||||
if i.Root != nil && i.Root.Equals(file) {
|
||||
eref = &lapi.ExportRef{
|
||||
Root: file,
|
||||
FromLocalCAR: i.CARPath,
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// no local found, so make a retrieval
|
||||
if eref == nil {
|
||||
var offer lapi.QueryOffer
|
||||
minerStrAddr := cctx.String("provider")
|
||||
if minerStrAddr == "" { // Local discovery
|
||||
offers, err := fapi.ClientFindData(ctx, file, pieceCid)
|
||||
|
||||
var cleaned []lapi.QueryOffer
|
||||
// filter out offers that errored
|
||||
for _, o := range offers {
|
||||
if o.Err == "" {
|
||||
cleaned = append(cleaned, o)
|
||||
}
|
||||
}
|
||||
|
||||
offers = cleaned
|
||||
|
||||
// sort by price low to high
|
||||
sort.Slice(offers, func(i, j int) bool {
|
||||
return offers[i].MinPrice.LessThan(offers[j].MinPrice)
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// TODO: parse offer strings from `client find`, make this smarter
|
||||
if len(offers) < 1 {
|
||||
fmt.Println("Failed to find file")
|
||||
return nil, nil
|
||||
}
|
||||
offer = offers[0]
|
||||
} else { // Directed retrieval
|
||||
minerAddr, err := address.NewFromString(minerStrAddr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
offer, err = fapi.ClientMinerQueryOffer(ctx, minerAddr, file, pieceCid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if offer.Err != "" {
|
||||
return nil, fmt.Errorf("offer error: %s", offer.Err)
|
||||
}
|
||||
|
||||
maxPrice := types.MustParseFIL(DefaultMaxRetrievePrice)
|
||||
|
||||
if cctx.String("maxPrice") != "" {
|
||||
maxPrice, err = types.ParseFIL(cctx.String("maxPrice"))
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("parsing maxPrice: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if offer.MinPrice.GreaterThan(big.Int(maxPrice)) {
|
||||
return nil, xerrors.Errorf("failed to find offer satisfying maxPrice: %s", maxPrice)
|
||||
}
|
||||
|
||||
o := offer.Order(payer)
|
||||
o.DataSelector = sel
|
||||
|
||||
subscribeEvents, err := fapi.ClientGetRetrievalUpdates(ctx)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("error setting up retrieval updates: %w", err)
|
||||
}
|
||||
retrievalRes, err := fapi.ClientRetrieve(ctx, o)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("error setting up retrieval: %w", err)
|
||||
}
|
||||
|
||||
start := time.Now()
|
||||
readEvents:
|
||||
for {
|
||||
var evt lapi.RetrievalInfo
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil, xerrors.New("Retrieval Timed Out")
|
||||
case evt = <-subscribeEvents:
|
||||
if evt.ID != retrievalRes.DealID {
|
||||
// we can't check the deal ID ahead of time because:
|
||||
// 1. We need to subscribe before retrieving.
|
||||
// 2. We won't know the deal ID until after retrieving.
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
event := "New"
|
||||
if evt.Event != nil {
|
||||
event = retrievalmarket.ClientEvents[*evt.Event]
|
||||
}
|
||||
|
||||
printf("Recv %s, Paid %s, %s (%s), %s\n",
|
||||
types.SizeStr(types.NewInt(evt.BytesReceived)),
|
||||
types.FIL(evt.TotalPaid),
|
||||
strings.TrimPrefix(event, "ClientEvent"),
|
||||
strings.TrimPrefix(retrievalmarket.DealStatuses[evt.Status], "DealStatus"),
|
||||
time.Now().Sub(start).Truncate(time.Millisecond),
|
||||
)
|
||||
|
||||
switch evt.Status {
|
||||
case retrievalmarket.DealStatusCompleted:
|
||||
break readEvents
|
||||
case retrievalmarket.DealStatusRejected:
|
||||
return nil, xerrors.Errorf("Retrieval Proposal Rejected: %s", evt.Message)
|
||||
case
|
||||
retrievalmarket.DealStatusDealNotFound,
|
||||
retrievalmarket.DealStatusErrored:
|
||||
return nil, xerrors.Errorf("Retrieval Error: %s", evt.Message)
|
||||
}
|
||||
}
|
||||
|
||||
eref = &lapi.ExportRef{
|
||||
Root: file,
|
||||
DealID: retrievalRes.DealID,
|
||||
}
|
||||
}
|
||||
|
||||
return eref, nil
|
||||
}
|
||||
|
||||
var retrFlagsCommon = []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "from",
|
||||
Usage: "address to send transactions from",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "provider",
|
||||
Usage: "provider to use for retrieval, if not present it'll use local discovery",
|
||||
Aliases: []string{"miner"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "maxPrice",
|
||||
Usage: fmt.Sprintf("maximum price the client is willing to consider (default: %s FIL)", DefaultMaxRetrievePrice),
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "pieceCid",
|
||||
Usage: "require data to be retrieved from a specific Piece CID",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "allow-local",
|
||||
// todo: default to true?
|
||||
},
|
||||
}
|
||||
|
||||
var clientRetrieveCmd = &cli.Command{
|
||||
Name: "retrieve",
|
||||
Usage: "Retrieve data from network",
|
||||
ArgsUsage: "[dataCid outputPath]",
|
||||
Description: `Retrieve data from the Filecoin network.
|
||||
|
||||
The retrieve command will attempt to find a provider make a retrieval deal with
|
||||
them. In case a provider can't be found, it can be specified with the --provider
|
||||
flag.
|
||||
|
||||
By default the data will be interpreted as DAG-PB UnixFSv1 File. Alternatively
|
||||
a CAR file containing the raw IPLD graph can be exported by setting the --car
|
||||
flag.
|
||||
|
||||
Partial Retrieval:
|
||||
|
||||
The --data-selector flag can be used to specify a sub-graph to fetch. The
|
||||
selector can be specified as either IPLD datamodel text-path selector, or IPLD
|
||||
json selector.
|
||||
|
||||
In case of unixfs retrieval, the selector must point at a single root node, and
|
||||
match the entire graph under that node.
|
||||
|
||||
In case of CAR retrieval, the selector must have one common "sub-root" node.
|
||||
|
||||
Examples:
|
||||
|
||||
- Retrieve a file by CID
|
||||
$ lotus client retrieve Qm... my-file.txt
|
||||
|
||||
- Retrieve a file by CID from f0123
|
||||
$ lotus client retrieve --provider f0123 Qm... my-file.txt
|
||||
|
||||
- Retrieve a first file from a specified directory
|
||||
$ lotus client retrieve --data-selector /Links/0/Hash Qm... my-file.txt
|
||||
`,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "car",
|
||||
Usage: "Export to a car file instead of a regular file",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "data-selector",
|
||||
Aliases: []string{"datamodel-path-selector"},
|
||||
Usage: "IPLD datamodel text-path selector, or IPLD json selector",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "car-export-merkle-proof",
|
||||
Usage: "(requires --data-selector and --car) Export data-selector merkle proof",
|
||||
},
|
||||
}, retrFlagsCommon...),
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.NArg() != 2 {
|
||||
return ShowHelp(cctx, fmt.Errorf("incorrect number of arguments"))
|
||||
}
|
||||
|
||||
if cctx.Bool("car-export-merkle-proof") {
|
||||
if !cctx.Bool("car") || !cctx.IsSet("data-selector") {
|
||||
return ShowHelp(cctx, fmt.Errorf("--car-export-merkle-proof requires --car and --data-selector"))
|
||||
}
|
||||
}
|
||||
|
||||
fapi, closer, err := GetFullNodeAPIV1(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
ctx := ReqContext(cctx)
|
||||
afmt := NewAppFmt(cctx.App)
|
||||
|
||||
var s *lapi.Selector
|
||||
if sel := lapi.Selector(cctx.String("data-selector")); sel != "" {
|
||||
s = &sel
|
||||
}
|
||||
|
||||
eref, err := retrieve(ctx, cctx, fapi, s, afmt.Printf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if s != nil {
|
||||
eref.DAGs = append(eref.DAGs, lapi.DagSpec{DataSelector: s, ExportMerkleProof: cctx.Bool("car-export-merkle-proof")})
|
||||
}
|
||||
|
||||
err = fapi.ClientExport(ctx, *eref, lapi.FileRef{
|
||||
Path: cctx.Args().Get(1),
|
||||
IsCAR: cctx.Bool("car"),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
afmt.Println("Success")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func ClientExportStream(apiAddr string, apiAuth http.Header, eref lapi.ExportRef, car bool) (io.ReadCloser, error) {
|
||||
rj, err := json.Marshal(eref)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("marshaling export ref: %w", err)
|
||||
}
|
||||
|
||||
ma, err := multiaddr.NewMultiaddr(apiAddr)
|
||||
if err == nil {
|
||||
_, addr, err := manet.DialArgs(ma)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// todo: make cliutil helpers for this
|
||||
apiAddr = "http://" + addr
|
||||
}
|
||||
|
||||
aa, err := url.Parse(apiAddr)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("parsing api address: %w", err)
|
||||
}
|
||||
switch aa.Scheme {
|
||||
case "ws":
|
||||
aa.Scheme = "http"
|
||||
case "wss":
|
||||
aa.Scheme = "https"
|
||||
}
|
||||
|
||||
aa.Path = path.Join(aa.Path, "rest/v0/export")
|
||||
req, err := http.NewRequest("GET", fmt.Sprintf("%s?car=%t&export=%s", aa, car, url.QueryEscape(string(rj))), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req.Header = apiAuth
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
em, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("reading error body: %w", err)
|
||||
}
|
||||
|
||||
resp.Body.Close() // nolint
|
||||
return nil, xerrors.Errorf("getting root car: http %d: %s", resp.StatusCode, string(em))
|
||||
}
|
||||
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
||||
var clientRetrieveCatCmd = &cli.Command{
|
||||
Name: "cat",
|
||||
Usage: "Show data from network",
|
||||
ArgsUsage: "[dataCid]",
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "ipld",
|
||||
Usage: "list IPLD datamodel links",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "data-selector",
|
||||
Usage: "IPLD datamodel text-path selector, or IPLD json selector",
|
||||
},
|
||||
}, retrFlagsCommon...),
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.NArg() != 1 {
|
||||
return ShowHelp(cctx, fmt.Errorf("incorrect number of arguments"))
|
||||
}
|
||||
|
||||
ainfo, err := GetAPIInfo(cctx, repo.FullNode)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("could not get API info: %w", err)
|
||||
}
|
||||
|
||||
fapi, closer, err := GetFullNodeAPIV1(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
ctx := ReqContext(cctx)
|
||||
afmt := NewAppFmt(cctx.App)
|
||||
|
||||
sel := lapi.Selector(cctx.String("data-selector"))
|
||||
selp := &sel
|
||||
if sel == "" {
|
||||
selp = nil
|
||||
}
|
||||
|
||||
eref, err := retrieve(ctx, cctx, fapi, selp, afmt.Printf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println() // separate retrieval events from results
|
||||
|
||||
if sel != "" {
|
||||
eref.DAGs = append(eref.DAGs, lapi.DagSpec{DataSelector: &sel})
|
||||
}
|
||||
|
||||
rc, err := ClientExportStream(ainfo.Addr, ainfo.AuthHeader(), *eref, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer rc.Close() // nolint
|
||||
|
||||
_, err = io.Copy(os.Stdout, rc)
|
||||
return err
|
||||
},
|
||||
}
|
||||
|
||||
func pathToSel(psel string, matchTraversal bool, sub builder.SelectorSpec) (lapi.Selector, error) {
|
||||
rs, err := textselector.SelectorSpecFromPath(textselector.Expression(psel), matchTraversal, sub)
|
||||
if err != nil {
|
||||
return "", xerrors.Errorf("failed to parse path-selector: %w", err)
|
||||
}
|
||||
|
||||
var b bytes.Buffer
|
||||
if err := dagjson.Encode(rs.Node(), &b); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return lapi.Selector(b.String()), nil
|
||||
}
|
||||
|
||||
var clientRetrieveLsCmd = &cli.Command{
|
||||
Name: "ls",
|
||||
Usage: "List object links",
|
||||
ArgsUsage: "[dataCid]",
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "ipld",
|
||||
Usage: "list IPLD datamodel links",
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "depth",
|
||||
Usage: "list links recursively up to the specified depth",
|
||||
Value: 1,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "data-selector",
|
||||
Usage: "IPLD datamodel text-path selector, or IPLD json selector",
|
||||
},
|
||||
}, retrFlagsCommon...),
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.NArg() != 1 {
|
||||
return ShowHelp(cctx, fmt.Errorf("incorrect number of arguments"))
|
||||
}
|
||||
|
||||
ainfo, err := GetAPIInfo(cctx, repo.FullNode)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("could not get API info: %w", err)
|
||||
}
|
||||
|
||||
fapi, closer, err := GetFullNodeAPIV1(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
ctx := ReqContext(cctx)
|
||||
afmt := NewAppFmt(cctx.App)
|
||||
|
||||
dataSelector := lapi.Selector(fmt.Sprintf(`{"R":{"l":{"depth":%d},":>":{"a":{">":{"|":[{"@":{}},{".":{}}]}}}}}`, cctx.Int("depth")))
|
||||
|
||||
if cctx.IsSet("data-selector") {
|
||||
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
|
||||
dataSelector, err = pathToSel(cctx.String("data-selector"), cctx.Bool("ipld"),
|
||||
ssb.ExploreUnion(
|
||||
ssb.Matcher(),
|
||||
ssb.ExploreAll(
|
||||
ssb.ExploreRecursive(selector.RecursionLimitDepth(int64(cctx.Int("depth"))), ssb.ExploreAll(ssb.ExploreUnion(ssb.Matcher(), ssb.ExploreRecursiveEdge()))),
|
||||
)))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("parsing datamodel path: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
eref, err := retrieve(ctx, cctx, fapi, &dataSelector, afmt.Printf)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("retrieve: %w", err)
|
||||
}
|
||||
|
||||
fmt.Println() // separate retrieval events from results
|
||||
|
||||
eref.DAGs = append(eref.DAGs, lapi.DagSpec{
|
||||
DataSelector: &dataSelector,
|
||||
})
|
||||
|
||||
rc, err := ClientExportStream(ainfo.Addr, ainfo.AuthHeader(), *eref, true)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("export: %w", err)
|
||||
}
|
||||
defer rc.Close() // nolint
|
||||
|
||||
var memcar bytes.Buffer
|
||||
_, err = io.Copy(&memcar, rc)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cbs, err := blockstore.NewReadOnly(&bytesReaderAt{bytes.NewReader(memcar.Bytes())}, nil,
|
||||
carv2.ZeroLengthSectionAsEOF(true),
|
||||
blockstore.UseWholeCIDs(true))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("opening car blockstore: %w", err)
|
||||
}
|
||||
|
||||
roots, err := cbs.Roots()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting roots: %w", err)
|
||||
}
|
||||
|
||||
if len(roots) != 1 {
|
||||
return xerrors.Errorf("expected 1 car root, got %d", len(roots))
|
||||
}
|
||||
dserv := merkledag.NewDAGService(blockservice.New(cbs, offline.Exchange(cbs)))
|
||||
|
||||
if !cctx.Bool("ipld") {
|
||||
links, err := dserv.GetLinks(ctx, roots[0])
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting links: %w", err)
|
||||
}
|
||||
|
||||
for _, link := range links {
|
||||
fmt.Printf("%s %s\t%d\n", link.Cid, link.Name, link.Size)
|
||||
}
|
||||
} else {
|
||||
jsel := lapi.Selector(fmt.Sprintf(`{"R":{"l":{"depth":%d},":>":{"a":{">":{"|":[{"@":{}},{".":{}}]}}}}}`, cctx.Int("depth")))
|
||||
|
||||
if cctx.IsSet("data-selector") {
|
||||
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
|
||||
jsel, err = pathToSel(cctx.String("data-selector"), false,
|
||||
ssb.ExploreRecursive(selector.RecursionLimitDepth(int64(cctx.Int("depth"))), ssb.ExploreAll(ssb.ExploreUnion(ssb.Matcher(), ssb.ExploreRecursiveEdge()))),
|
||||
)
|
||||
}
|
||||
|
||||
sel, _ := selectorparse.ParseJSONSelector(string(jsel))
|
||||
|
||||
if err := utils.TraverseDag(
|
||||
ctx,
|
||||
dserv,
|
||||
roots[0],
|
||||
sel,
|
||||
func(p traversal.Progress, n ipld.Node, r traversal.VisitReason) error {
|
||||
if r == traversal.VisitReason_SelectionMatch {
|
||||
fmt.Println(p.Path)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
},
|
||||
}
|
||||
|
||||
type bytesReaderAt struct {
|
||||
btr *bytes.Reader
|
||||
}
|
||||
|
||||
func (b bytesReaderAt) ReadAt(p []byte, off int64) (n int, err error) {
|
||||
return b.btr.ReadAt(p, off)
|
||||
}
|
||||
|
||||
var _ io.ReaderAt = &bytesReaderAt{}
|
||||
+2
-2
@@ -220,8 +220,8 @@ var filplusCheckClientCmd = &cli.Command{
|
||||
}
|
||||
|
||||
var filplusCheckNotaryCmd = &cli.Command{
|
||||
Name: "check-notaries-datacap",
|
||||
Usage: "check notaries remaining bytes",
|
||||
Name: "check-notary-datacap",
|
||||
Usage: "check a notary's remaining bytes",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if !cctx.Args().Present() {
|
||||
return fmt.Errorf("must specify notary address to check")
|
||||
|
||||
+130
-2
@@ -51,6 +51,7 @@ var multisigCmd = &cli.Command{
|
||||
msigProposeCmd,
|
||||
msigRemoveProposeCmd,
|
||||
msigApproveCmd,
|
||||
msigCancelCmd,
|
||||
msigAddProposeCmd,
|
||||
msigAddApproveCmd,
|
||||
msigAddCancelCmd,
|
||||
@@ -159,6 +160,8 @@ var msigCreateCmd = &cli.Command{
|
||||
|
||||
msgCid := sm.Cid()
|
||||
|
||||
fmt.Println("sent create in message: ", msgCid)
|
||||
|
||||
// wait for it to get mined into a block
|
||||
wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
|
||||
if err != nil {
|
||||
@@ -448,7 +451,7 @@ var msigProposeCmd = &cli.Command{
|
||||
|
||||
msgCid := sm.Cid()
|
||||
|
||||
fmt.Println("send proposal in message: ", msgCid)
|
||||
fmt.Println("sent proposal in message: ", msgCid)
|
||||
|
||||
wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
|
||||
if err != nil {
|
||||
@@ -612,6 +615,131 @@ var msigApproveCmd = &cli.Command{
|
||||
},
|
||||
}
|
||||
|
||||
var msigCancelCmd = &cli.Command{
|
||||
Name: "cancel",
|
||||
Usage: "Cancel a multisig message",
|
||||
ArgsUsage: "<multisigAddress messageId> [destination value [methodId methodParams]]",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "from",
|
||||
Usage: "account to send the cancel message from",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.Args().Len() < 2 {
|
||||
return ShowHelp(cctx, fmt.Errorf("must pass at least multisig address and message ID"))
|
||||
}
|
||||
|
||||
if cctx.Args().Len() > 2 && cctx.Args().Len() < 4 {
|
||||
return ShowHelp(cctx, fmt.Errorf("usage: msig cancel <msig addr> <message ID> <desination> <value>"))
|
||||
}
|
||||
|
||||
if cctx.Args().Len() > 4 && cctx.Args().Len() != 6 {
|
||||
return ShowHelp(cctx, fmt.Errorf("usage: msig cancel <msig addr> <message ID> <desination> <value> [ <method> <params> ]"))
|
||||
}
|
||||
|
||||
srv, err := GetFullNodeServices(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer srv.Close() //nolint:errcheck
|
||||
|
||||
api := srv.FullNodeAPI()
|
||||
ctx := ReqContext(cctx)
|
||||
|
||||
msig, err := address.NewFromString(cctx.Args().Get(0))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
txid, err := strconv.ParseUint(cctx.Args().Get(1), 10, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var from address.Address
|
||||
if cctx.IsSet("from") {
|
||||
f, err := address.NewFromString(cctx.String("from"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
from = f
|
||||
} else {
|
||||
defaddr, err := api.WalletDefaultAddress(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
from = defaddr
|
||||
}
|
||||
|
||||
var msgCid cid.Cid
|
||||
if cctx.Args().Len() == 2 {
|
||||
proto, err := api.MsigCancel(ctx, msig, txid, from)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sm, err := InteractiveSend(ctx, cctx, srv, proto)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msgCid = sm.Cid()
|
||||
} else {
|
||||
dest, err := address.NewFromString(cctx.Args().Get(2))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
value, err := types.ParseFIL(cctx.Args().Get(3))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var method uint64
|
||||
var params []byte
|
||||
if cctx.Args().Len() == 6 {
|
||||
m, err := strconv.ParseUint(cctx.Args().Get(4), 10, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
method = m
|
||||
|
||||
p, err := hex.DecodeString(cctx.Args().Get(5))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
params = p
|
||||
}
|
||||
|
||||
proto, err := api.MsigCancelTxnHash(ctx, msig, txid, dest, types.BigInt(value), from, method, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sm, err := InteractiveSend(ctx, cctx, srv, proto)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msgCid = sm.Cid()
|
||||
}
|
||||
|
||||
fmt.Println("sent cancel in message: ", msgCid)
|
||||
|
||||
wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if wait.Receipt.ExitCode != 0 {
|
||||
return fmt.Errorf("cancel returned exit %d", wait.Receipt.ExitCode)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
var msigRemoveProposeCmd = &cli.Command{
|
||||
Name: "propose-remove",
|
||||
Usage: "Propose to remove a signer",
|
||||
@@ -1490,7 +1618,7 @@ var msigLockCancelCmd = &cli.Command{
|
||||
return actErr
|
||||
}
|
||||
|
||||
proto, err := api.MsigCancel(ctx, msig, txid, msig, big.Zero(), from, uint64(multisig.Methods.LockBalance), params)
|
||||
proto, err := api.MsigCancelTxnHash(ctx, msig, txid, msig, big.Zero(), from, uint64(multisig.Methods.LockBalance), params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+22
-4
@@ -1,6 +1,7 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -10,8 +11,22 @@ import (
|
||||
var WaitApiCmd = &cli.Command{
|
||||
Name: "wait-api",
|
||||
Usage: "Wait for lotus api to come online",
|
||||
Flags: []cli.Flag{
|
||||
&cli.DurationFlag{
|
||||
Name: "timeout",
|
||||
Usage: "duration to wait till fail",
|
||||
Value: time.Second * 30,
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
for i := 0; i < 30; i++ {
|
||||
ctx := ReqContext(cctx)
|
||||
ctx, cancel := context.WithTimeout(ctx, cctx.Duration("timeout"))
|
||||
defer cancel()
|
||||
for {
|
||||
if ctx.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
api, closer, err := GetAPI(cctx)
|
||||
if err != nil {
|
||||
fmt.Printf("Not online yet... (%s)\n", err)
|
||||
@@ -20,8 +35,6 @@ var WaitApiCmd = &cli.Command{
|
||||
}
|
||||
defer closer()
|
||||
|
||||
ctx := ReqContext(cctx)
|
||||
|
||||
_, err = api.Version(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -29,6 +42,11 @@ var WaitApiCmd = &cli.Command{
|
||||
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("timed out waiting for api to come online")
|
||||
|
||||
if ctx.Err() == context.DeadlineExceeded {
|
||||
return fmt.Errorf("timed out waiting for api to come online")
|
||||
}
|
||||
|
||||
return ctx.Err()
|
||||
},
|
||||
}
|
||||
|
||||
+2
-2
@@ -647,9 +647,9 @@ var walletMarketWithdraw = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Successfully withdrew %s FIL\n", withdrawn)
|
||||
fmt.Printf("Successfully withdrew %s \n", types.FIL(withdrawn))
|
||||
if withdrawn.LessThan(amt) {
|
||||
fmt.Printf("Note that this is less than the requested amount of %s FIL\n", amt)
|
||||
fmt.Printf("Note that this is less than the requested amount of %s \n", types.FIL(amt))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ var watchHeadCmd = &cli.Command{
|
||||
return
|
||||
}()
|
||||
|
||||
restart, err := notifyHandler(name, nCh, sCh)
|
||||
restart, err := notifyHandler(ctx, name, nCh, sCh)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
"github.com/coreos/go-systemd/v22/dbus"
|
||||
)
|
||||
|
||||
func notifyHandler(n string, ch chan interface{}, sCh chan os.Signal) (string, error) {
|
||||
func notifyHandler(ctx context.Context, n string, ch chan interface{}, sCh chan os.Signal) (string, error) {
|
||||
select {
|
||||
// alerts to restart systemd unit
|
||||
case <-ch:
|
||||
statusCh := make(chan string, 1)
|
||||
c, err := dbus.New()
|
||||
c, err := dbus.NewWithContext(ctx)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
_, err = c.TryRestartUnit(n, "fail", statusCh)
|
||||
_, err = c.TryRestartUnitContext(ctx, n, "fail", statusCh)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ var actorWithdrawCmd = &cli.Command{
|
||||
amount = abi.TokenAmount(f)
|
||||
|
||||
if amount.GreaterThan(available) {
|
||||
return xerrors.Errorf("can't withdraw more funds than available; requested: %s; available: %s", amount, available)
|
||||
return xerrors.Errorf("can't withdraw more funds than available; requested: %s; available: %s", types.FIL(amount), types.FIL(available))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,6 +283,7 @@ var actorWithdrawCmd = &cli.Command{
|
||||
|
||||
// wait for it to get mined into a block
|
||||
fmt.Printf("waiting for %d epochs for confirmation..\n", uint64(cctx.Int("confidence")))
|
||||
|
||||
wait, err := api.StateWaitMsg(ctx, smsg.Cid(), uint64(cctx.Int("confidence")))
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -305,9 +306,9 @@ var actorWithdrawCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Successfully withdrew %s FIL\n", withdrawn)
|
||||
fmt.Printf("Successfully withdrew %s \n", types.FIL(withdrawn))
|
||||
if withdrawn.LessThan(amount) {
|
||||
fmt.Printf("Note that this is less than the requested amount of %s FIL\n", amount)
|
||||
fmt.Printf("Note that this is less than the requested amount of %s\n", types.FIL(amount))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,12 +730,6 @@ var actorSetOwnerCmd = &cli.Command{
|
||||
return fmt.Errorf("must pass new owner address and sender address")
|
||||
}
|
||||
|
||||
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
|
||||
api, acloser, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -763,7 +758,7 @@ var actorSetOwnerCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
maddr, err := nodeApi.ActorAddress(ctx)
|
||||
maddr, err := getActorAddress(ctx, cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+12
-8
@@ -377,14 +377,18 @@ func handleMarketsInfo(ctx context.Context, nodeApi api.StorageMiner) error {
|
||||
}
|
||||
|
||||
showDealStates := map[storagemarket.StorageDealStatus]struct{}{
|
||||
storagemarket.StorageDealActive: {},
|
||||
storagemarket.StorageDealTransferring: {},
|
||||
storagemarket.StorageDealStaged: {},
|
||||
storagemarket.StorageDealAwaitingPreCommit: {},
|
||||
storagemarket.StorageDealSealing: {},
|
||||
storagemarket.StorageDealPublish: {},
|
||||
storagemarket.StorageDealCheckForAcceptance: {},
|
||||
storagemarket.StorageDealPublishing: {},
|
||||
storagemarket.StorageDealActive: {},
|
||||
storagemarket.StorageDealAcceptWait: {},
|
||||
storagemarket.StorageDealReserveProviderFunds: {},
|
||||
storagemarket.StorageDealProviderFunding: {},
|
||||
storagemarket.StorageDealTransferring: {},
|
||||
storagemarket.StorageDealValidating: {},
|
||||
storagemarket.StorageDealStaged: {},
|
||||
storagemarket.StorageDealAwaitingPreCommit: {},
|
||||
storagemarket.StorageDealSealing: {},
|
||||
storagemarket.StorageDealPublish: {},
|
||||
storagemarket.StorageDealCheckForAcceptance: {},
|
||||
storagemarket.StorageDealPublishing: {},
|
||||
}
|
||||
|
||||
var total dealStat
|
||||
|
||||
@@ -76,6 +76,21 @@ var infoAllCmd = &cli.Command{
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Proving Info")
|
||||
if err := provingInfoCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Proving Deadlines")
|
||||
if err := provingDeadlinesCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Proving Faults")
|
||||
if err := provingFaultsCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Sealing Jobs")
|
||||
if err := sealingJobsCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
@@ -92,8 +107,37 @@ var infoAllCmd = &cli.Command{
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Storage Deals")
|
||||
if err := dealsListCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
{
|
||||
fs := &flag.FlagSet{}
|
||||
for _, f := range dealsListCmd.Flags {
|
||||
if err := f.Apply(fs); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
}
|
||||
if err := fs.Parse([]string{"--verbose"}); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
if err := dealsListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Storage Deals JSON")
|
||||
{
|
||||
fs := &flag.FlagSet{}
|
||||
for _, f := range dealsListCmd.Flags {
|
||||
if err := f.Apply(fs); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
}
|
||||
if err := fs.Parse([]string{"--verbose", "--format=json"}); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
if err := dealsListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Retrieval Deals")
|
||||
@@ -101,11 +145,58 @@ var infoAllCmd = &cli.Command{
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Data Transfers")
|
||||
{
|
||||
fs := &flag.FlagSet{}
|
||||
for _, f := range transfersListCmd.Flags {
|
||||
if err := f.Apply(fs); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
}
|
||||
if err := fs.Parse([]string{"--verbose", "--completed", "--show-failed"}); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
if err := transfersListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println("\n#: DAGStore shards")
|
||||
if err := dagstoreListShardsCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Pending Batch Deals")
|
||||
if err := dealsPendingPublish.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Pending Batch Terminations")
|
||||
if err := sectorsTerminatePendingCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Pending Batch PreCommit")
|
||||
if err := sectorsBatchingPendingPreCommit.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Pending Batch Commit")
|
||||
if err := sectorsBatchingPendingCommit.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Sector List")
|
||||
if err := sectorsListCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Expired Sectors")
|
||||
if err := sectorsExpiredCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Sector Refs")
|
||||
if err := sectorsRefsCmd.Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
|
||||
+48
-20
@@ -13,6 +13,8 @@ import (
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
power6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/power"
|
||||
|
||||
"github.com/docker/go-units"
|
||||
"github.com/google/uuid"
|
||||
"github.com/ipfs/go-datastore"
|
||||
@@ -564,7 +566,7 @@ func makeHostKey(lr repo.LockedRepo) (crypto.PrivKey, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
kbytes, err := pk.Bytes()
|
||||
kbytes, err := crypto.MarshalPrivateKey(pk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -644,11 +646,26 @@ func createStorageMiner(ctx context.Context, api v1api.FullNode, peerid peer.ID,
|
||||
return address.Address{}, err
|
||||
}
|
||||
|
||||
sender := owner
|
||||
if fromstr := cctx.String("from"); fromstr != "" {
|
||||
faddr, err := address.NewFromString(fromstr)
|
||||
if err != nil {
|
||||
return address.Undef, fmt.Errorf("could not parse from address: %w", err)
|
||||
}
|
||||
sender = faddr
|
||||
}
|
||||
|
||||
// make sure the sender account exists on chain
|
||||
_, err = api.StateLookupID(ctx, owner, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("sender must exist on chain: %w", err)
|
||||
}
|
||||
|
||||
// make sure the worker account exists on chain
|
||||
_, err = api.StateLookupID(ctx, worker, types.EmptyTSK)
|
||||
if err != nil {
|
||||
signed, err := api.MpoolPushMessage(ctx, &types.Message{
|
||||
From: owner,
|
||||
From: sender,
|
||||
To: worker,
|
||||
Value: types.NewInt(0),
|
||||
}, nil)
|
||||
@@ -668,35 +685,46 @@ func createStorageMiner(ctx context.Context, api v1api.FullNode, peerid peer.ID,
|
||||
}
|
||||
}
|
||||
|
||||
nv, err := api.StateNetworkVersion(ctx, types.EmptyTSK)
|
||||
// make sure the owner account exists on chain
|
||||
_, err = api.StateLookupID(ctx, owner, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("getting network version: %w", err)
|
||||
signed, err := api.MpoolPushMessage(ctx, &types.Message{
|
||||
From: sender,
|
||||
To: owner,
|
||||
Value: types.NewInt(0),
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("push owner init: %w", err)
|
||||
}
|
||||
|
||||
log.Infof("Initializing owner account %s, message: %s", worker, signed.Cid())
|
||||
log.Infof("Waiting for confirmation")
|
||||
|
||||
mw, err := api.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence, lapi.LookbackNoLimit, true)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("waiting for owner init: %w", err)
|
||||
}
|
||||
if mw.Receipt.ExitCode != 0 {
|
||||
return address.Undef, xerrors.Errorf("initializing owner account failed: exit code %d", mw.Receipt.ExitCode)
|
||||
}
|
||||
}
|
||||
|
||||
spt, err := miner.SealProofTypeFromSectorSize(abi.SectorSize(ssize), nv)
|
||||
// Note: the correct thing to do would be to call SealProofTypeFromSectorSize if actors version is v3 or later, but this still works
|
||||
spt, err := miner.WindowPoStProofTypeFromSectorSize(abi.SectorSize(ssize))
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("getting seal proof type: %w", err)
|
||||
return address.Undef, xerrors.Errorf("getting post proof type: %w", err)
|
||||
}
|
||||
|
||||
params, err := actors.SerializeParams(&power2.CreateMinerParams{
|
||||
Owner: owner,
|
||||
Worker: worker,
|
||||
SealProofType: spt,
|
||||
Peer: abi.PeerID(peerid),
|
||||
params, err := actors.SerializeParams(&power6.CreateMinerParams{
|
||||
Owner: owner,
|
||||
Worker: worker,
|
||||
WindowPoStProofType: spt,
|
||||
Peer: abi.PeerID(peerid),
|
||||
})
|
||||
if err != nil {
|
||||
return address.Undef, err
|
||||
}
|
||||
|
||||
sender := owner
|
||||
if fromstr := cctx.String("from"); fromstr != "" {
|
||||
faddr, err := address.NewFromString(fromstr)
|
||||
if err != nil {
|
||||
return address.Undef, fmt.Errorf("could not parse from address: %w", err)
|
||||
}
|
||||
sender = faddr
|
||||
}
|
||||
|
||||
createStorageMinerMsg := &types.Message{
|
||||
To: power.Address,
|
||||
From: sender,
|
||||
|
||||
+15
-1
@@ -104,7 +104,7 @@ func main() {
|
||||
&cli.StringFlag{
|
||||
Name: "actor",
|
||||
Value: "",
|
||||
Usage: "specify other actor to check state for (read only)",
|
||||
Usage: "specify other actor to query / manipulate",
|
||||
Aliases: []string{"a"},
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
@@ -113,6 +113,12 @@ func main() {
|
||||
Usage: "use color in display output",
|
||||
DefaultText: "depends on output being a TTY",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "panic-reports",
|
||||
EnvVars: []string{"LOTUS_PANIC_REPORT_PATH"},
|
||||
Hidden: true,
|
||||
Value: "~/.lotusminer", // should follow --repo default
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "repo",
|
||||
EnvVars: []string{"LOTUS_PATH"},
|
||||
@@ -146,6 +152,14 @@ func main() {
|
||||
}
|
||||
return nil
|
||||
},
|
||||
After: func(c *cli.Context) error {
|
||||
if r := recover(); r != nil {
|
||||
// Generate report in LOTUS_PATH and re-raise panic
|
||||
build.GeneratePanicReport(c.String("panic-reports"), c.String(FlagMinerRepo), c.App.Name)
|
||||
panic(r)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
app.Setup()
|
||||
app.Metadata["repoType"] = repo.StorageMiner
|
||||
|
||||
+159
-37
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -28,6 +29,7 @@ import (
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
@@ -350,6 +352,7 @@ var storageDealsCmd = &cli.Command{
|
||||
resetBlocklistCmd,
|
||||
setSealDurationCmd,
|
||||
dealsPendingPublish,
|
||||
dealsRetryPublish,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -386,6 +389,11 @@ var dealsListCmd = &cli.Command{
|
||||
Name: "list",
|
||||
Usage: "List all deals for this miner",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "format",
|
||||
Usage: "output format of data, supported: table, json",
|
||||
Value: "table",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "verbose",
|
||||
Aliases: []string{"v"},
|
||||
@@ -396,63 +404,74 @@ var dealsListCmd = &cli.Command{
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, closer, err := lcli.GetMarketsAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
switch cctx.String("format") {
|
||||
case "table":
|
||||
return listDealsWithTable(cctx)
|
||||
case "json":
|
||||
return listDealsWithJSON(cctx)
|
||||
}
|
||||
defer closer()
|
||||
|
||||
ctx := lcli.DaemonContext(cctx)
|
||||
return fmt.Errorf("unknown format: %s; use `table` or `json`", cctx.String("format"))
|
||||
},
|
||||
}
|
||||
|
||||
deals, err := api.MarketListIncompleteDeals(ctx)
|
||||
func listDealsWithTable(cctx *cli.Context) error {
|
||||
api, closer, err := lcli.GetMarketsAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
|
||||
ctx := lcli.DaemonContext(cctx)
|
||||
|
||||
deals, err := api.MarketListIncompleteDeals(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
verbose := cctx.Bool("verbose")
|
||||
watch := cctx.Bool("watch")
|
||||
|
||||
if watch {
|
||||
updates, err := api.MarketGetDealUpdates(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
verbose := cctx.Bool("verbose")
|
||||
watch := cctx.Bool("watch")
|
||||
for {
|
||||
tm.Clear()
|
||||
tm.MoveCursor(1, 1)
|
||||
|
||||
if watch {
|
||||
updates, err := api.MarketGetDealUpdates(ctx)
|
||||
err = outputStorageDealsTable(tm.Output, deals, verbose)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for {
|
||||
tm.Clear()
|
||||
tm.MoveCursor(1, 1)
|
||||
tm.Flush()
|
||||
|
||||
err = outputStorageDeals(tm.Output, deals, verbose)
|
||||
if err != nil {
|
||||
return err
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil
|
||||
case updated := <-updates:
|
||||
var found bool
|
||||
for i, existing := range deals {
|
||||
if existing.ProposalCid.Equals(updated.ProposalCid) {
|
||||
deals[i] = updated
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
tm.Flush()
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil
|
||||
case updated := <-updates:
|
||||
var found bool
|
||||
for i, existing := range deals {
|
||||
if existing.ProposalCid.Equals(updated.ProposalCid) {
|
||||
deals[i] = updated
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
deals = append(deals, updated)
|
||||
}
|
||||
if !found {
|
||||
deals = append(deals, updated)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return outputStorageDeals(os.Stdout, deals, verbose)
|
||||
},
|
||||
return outputStorageDealsTable(os.Stdout, deals, verbose)
|
||||
}
|
||||
|
||||
func outputStorageDeals(out io.Writer, deals []storagemarket.MinerDeal, verbose bool) error {
|
||||
func outputStorageDealsTable(out io.Writer, deals []storagemarket.MinerDeal, verbose bool) error {
|
||||
sort.Slice(deals, func(i, j int) bool {
|
||||
return deals[i].CreationTime.Time().Before(deals[j].CreationTime.Time())
|
||||
})
|
||||
@@ -891,3 +910,106 @@ var dealsPendingPublish = &cli.Command{
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
var dealsRetryPublish = &cli.Command{
|
||||
Name: "retry-publish",
|
||||
Usage: "retry publishing a deal",
|
||||
ArgsUsage: "<proposal CID>",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if !cctx.Args().Present() {
|
||||
return cli.ShowCommandHelp(cctx, cctx.Command.Name)
|
||||
}
|
||||
api, closer, err := lcli.GetMarketsAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
propcid := cctx.Args().First()
|
||||
fmt.Printf("retrying deal with proposal-cid: %s\n", propcid)
|
||||
|
||||
cid, err := cid.Decode(propcid)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.MarketRetryPublishDeal(ctx, cid); err != nil {
|
||||
return xerrors.Errorf("retrying publishing deal: %w", err)
|
||||
}
|
||||
fmt.Println("retried to publish deal")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func listDealsWithJSON(cctx *cli.Context) error {
|
||||
node, closer, err := lcli.GetMarketsAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
|
||||
ctx := lcli.DaemonContext(cctx)
|
||||
|
||||
deals, err := node.MarketListIncompleteDeals(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
channels, err := node.MarketListDataTransfers(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sort.Slice(deals, func(i, j int) bool {
|
||||
return deals[i].CreationTime.Time().Before(deals[j].CreationTime.Time())
|
||||
})
|
||||
|
||||
channelsByTransferID := map[datatransfer.TransferID]api.DataTransferChannel{}
|
||||
for _, c := range channels {
|
||||
channelsByTransferID[c.TransferID] = c
|
||||
}
|
||||
|
||||
w := json.NewEncoder(os.Stdout)
|
||||
|
||||
for _, deal := range deals {
|
||||
val := struct {
|
||||
DateTime string `json:"datetime"`
|
||||
VerifiedDeal bool `json:"verified-deal"`
|
||||
ProposalCID string `json:"proposal-cid"`
|
||||
DealID abi.DealID `json:"deal-id"`
|
||||
DealStatus string `json:"deal-status"`
|
||||
Client string `json:"client"`
|
||||
PieceSize string `json:"piece-size"`
|
||||
Price types.FIL `json:"price"`
|
||||
DurationEpochs abi.ChainEpoch `json:"duration-epochs"`
|
||||
TransferID *datatransfer.TransferID `json:"transfer-id,omitempty"`
|
||||
TransferStatus string `json:"transfer-status,omitempty"`
|
||||
TransferredData string `json:"transferred-data,omitempty"`
|
||||
}{}
|
||||
|
||||
val.DateTime = deal.CreationTime.Time().Format(time.RFC3339)
|
||||
val.VerifiedDeal = deal.Proposal.VerifiedDeal
|
||||
val.ProposalCID = deal.ProposalCid.String()
|
||||
val.DealID = deal.DealID
|
||||
val.DealStatus = storagemarket.DealStates[deal.State]
|
||||
val.Client = deal.Proposal.Client.String()
|
||||
val.PieceSize = units.BytesSize(float64(deal.Proposal.PieceSize))
|
||||
val.Price = types.FIL(types.BigMul(deal.Proposal.StoragePricePerEpoch, types.NewInt(uint64(deal.Proposal.Duration()))))
|
||||
val.DurationEpochs = deal.Proposal.Duration()
|
||||
|
||||
if deal.TransferChannelId != nil {
|
||||
if c, ok := channelsByTransferID[deal.TransferChannelId.ID]; ok {
|
||||
val.TransferID = &c.TransferID
|
||||
val.TransferStatus = datatransfer.Statuses[c.Status]
|
||||
val.TransferredData = units.BytesSize(float64(c.Transferred))
|
||||
}
|
||||
}
|
||||
|
||||
err := w.Encode(val)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"text/tabwriter"
|
||||
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
"github.com/filecoin-project/lotus/lib/tablewriter"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
@@ -48,6 +49,12 @@ var piecesListPiecesCmd = &cli.Command{
|
||||
var piecesListCidInfosCmd = &cli.Command{
|
||||
Name: "list-cids",
|
||||
Usage: "list registered payload CIDs",
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "verbose",
|
||||
Aliases: []string{"v"},
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
nodeApi, closer, err := lcli.GetMarketsAPI(cctx)
|
||||
if err != nil {
|
||||
@@ -61,9 +68,54 @@ var piecesListCidInfosCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
w := tablewriter.New(tablewriter.Col("CID"),
|
||||
tablewriter.Col("Piece"),
|
||||
tablewriter.Col("BlockOffset"),
|
||||
tablewriter.Col("BlockLen"),
|
||||
tablewriter.Col("Deal"),
|
||||
tablewriter.Col("Sector"),
|
||||
tablewriter.Col("DealOffset"),
|
||||
tablewriter.Col("DealLen"),
|
||||
)
|
||||
|
||||
for _, c := range cids {
|
||||
fmt.Println(c)
|
||||
if !cctx.Bool("verbose") {
|
||||
fmt.Println(c)
|
||||
continue
|
||||
}
|
||||
|
||||
ci, err := nodeApi.PiecesGetCIDInfo(ctx, c)
|
||||
if err != nil {
|
||||
fmt.Printf("Error getting CID info: %s\n", err)
|
||||
continue
|
||||
}
|
||||
|
||||
for _, location := range ci.PieceBlockLocations {
|
||||
pi, err := nodeApi.PiecesGetPieceInfo(ctx, location.PieceCID)
|
||||
if err != nil {
|
||||
fmt.Printf("Error getting piece info: %s\n", err)
|
||||
continue
|
||||
}
|
||||
|
||||
for _, deal := range pi.Deals {
|
||||
w.Write(map[string]interface{}{
|
||||
"CID": c,
|
||||
"Piece": location.PieceCID,
|
||||
"BlockOffset": location.RelOffset,
|
||||
"BlockLen": location.BlockSize,
|
||||
"Deal": deal.DealID,
|
||||
"Sector": deal.SectorID,
|
||||
"DealOffset": deal.Offset,
|
||||
"DealLen": deal.Length,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if cctx.Bool("verbose") {
|
||||
return w.Flush(os.Stdout)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
|
||||
"github.com/filecoin-project/specs-storage/storage"
|
||||
)
|
||||
|
||||
@@ -360,6 +361,10 @@ var provingCheckProvableCmd = &cli.Command{
|
||||
Name: "slow",
|
||||
Usage: "run slower checks",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-id",
|
||||
Usage: "filter sectors by storage path (path id)",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.Args().Len() != 1 {
|
||||
@@ -408,6 +413,21 @@ var provingCheckProvableCmd = &cli.Command{
|
||||
tw := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
||||
_, _ = fmt.Fprintln(tw, "deadline\tpartition\tsector\tstatus")
|
||||
|
||||
var filter map[abi.SectorID]struct{}
|
||||
|
||||
if cctx.IsSet("storage-id") {
|
||||
sl, err := sapi.StorageList(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
decls := sl[stores.ID(cctx.String("storage-id"))]
|
||||
|
||||
filter = map[abi.SectorID]struct{}{}
|
||||
for _, decl := range decls {
|
||||
filter[decl.SectorID] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
for parIdx, par := range partitions {
|
||||
sectors := make(map[abi.SectorNumber]struct{})
|
||||
|
||||
@@ -418,13 +438,21 @@ var provingCheckProvableCmd = &cli.Command{
|
||||
|
||||
var tocheck []storage.SectorRef
|
||||
for _, info := range sectorInfos {
|
||||
si := abi.SectorID{
|
||||
Miner: abi.ActorID(mid),
|
||||
Number: info.SectorNumber,
|
||||
}
|
||||
|
||||
if filter != nil {
|
||||
if _, found := filter[si]; !found {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
sectors[info.SectorNumber] = struct{}{}
|
||||
tocheck = append(tocheck, storage.SectorRef{
|
||||
ProofType: info.SealProof,
|
||||
ID: abi.SectorID{
|
||||
Miner: abi.ActorID(mid),
|
||||
Number: info.SectorNumber,
|
||||
},
|
||||
ID: si,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
+45
-44
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
@@ -32,6 +33,17 @@ var sealingCmd = &cli.Command{
|
||||
},
|
||||
}
|
||||
|
||||
var barCols = float64(64)
|
||||
|
||||
func barString(total, y, g float64) string {
|
||||
yBars := int(math.Round(y / total * barCols))
|
||||
gBars := int(math.Round(g / total * barCols))
|
||||
eBars := int(barCols) - yBars - gBars
|
||||
return color.YellowString(strings.Repeat("|", yBars)) +
|
||||
color.GreenString(strings.Repeat("|", gBars)) +
|
||||
strings.Repeat(" ", eBars)
|
||||
}
|
||||
|
||||
var sealingWorkersCmd = &cli.Command{
|
||||
Name: "workers",
|
||||
Usage: "list workers",
|
||||
@@ -77,7 +89,7 @@ var sealingWorkersCmd = &cli.Command{
|
||||
for _, stat := range st {
|
||||
gpuUse := "not "
|
||||
gpuCol := color.FgBlue
|
||||
if stat.GpuUsed {
|
||||
if stat.GpuUsed > 0 {
|
||||
gpuCol = color.FgGreen
|
||||
gpuUse = ""
|
||||
}
|
||||
@@ -89,56 +101,43 @@ var sealingWorkersCmd = &cli.Command{
|
||||
|
||||
fmt.Printf("Worker %s, host %s%s\n", stat.id, color.MagentaString(stat.Info.Hostname), disabled)
|
||||
|
||||
var barCols = uint64(64)
|
||||
cpuBars := int(stat.CpuUse * barCols / stat.Info.Resources.CPUs)
|
||||
cpuBar := strings.Repeat("|", cpuBars)
|
||||
if int(barCols)-cpuBars >= 0 {
|
||||
cpuBar += strings.Repeat(" ", int(barCols)-cpuBars)
|
||||
}
|
||||
|
||||
fmt.Printf("\tCPU: [%s] %d/%d core(s) in use\n",
|
||||
color.GreenString(cpuBar), stat.CpuUse, stat.Info.Resources.CPUs)
|
||||
barString(float64(stat.Info.Resources.CPUs), 0, float64(stat.CpuUse)), stat.CpuUse, stat.Info.Resources.CPUs)
|
||||
|
||||
ramBarsRes := int(stat.Info.Resources.MemReserved * barCols / stat.Info.Resources.MemPhysical)
|
||||
ramBarsUsed := int(stat.MemUsedMin * barCols / stat.Info.Resources.MemPhysical)
|
||||
ramRepeatSpace := int(barCols) - (ramBarsUsed + ramBarsRes)
|
||||
|
||||
colorFunc := color.YellowString
|
||||
if ramRepeatSpace < 0 {
|
||||
ramRepeatSpace = 0
|
||||
colorFunc = color.RedString
|
||||
ramTotal := stat.Info.Resources.MemPhysical
|
||||
ramTasks := stat.MemUsedMin
|
||||
ramUsed := stat.Info.Resources.MemUsed
|
||||
var ramReserved uint64 = 0
|
||||
if ramUsed > ramTasks {
|
||||
ramReserved = ramUsed - ramTasks
|
||||
}
|
||||
|
||||
ramBar := colorFunc(strings.Repeat("|", ramBarsRes)) +
|
||||
color.GreenString(strings.Repeat("|", ramBarsUsed)) +
|
||||
strings.Repeat(" ", ramRepeatSpace)
|
||||
|
||||
vmem := stat.Info.Resources.MemPhysical + stat.Info.Resources.MemSwap
|
||||
|
||||
vmemBarsRes := int(stat.Info.Resources.MemReserved * barCols / vmem)
|
||||
vmemBarsUsed := int(stat.MemUsedMax * barCols / vmem)
|
||||
vmemRepeatSpace := int(barCols) - (vmemBarsUsed + vmemBarsRes)
|
||||
|
||||
colorFunc = color.YellowString
|
||||
if vmemRepeatSpace < 0 {
|
||||
vmemRepeatSpace = 0
|
||||
colorFunc = color.RedString
|
||||
}
|
||||
|
||||
vmemBar := colorFunc(strings.Repeat("|", vmemBarsRes)) +
|
||||
color.GreenString(strings.Repeat("|", vmemBarsUsed)) +
|
||||
strings.Repeat(" ", vmemRepeatSpace)
|
||||
ramBar := barString(float64(ramTotal), float64(ramReserved), float64(ramTasks))
|
||||
|
||||
fmt.Printf("\tRAM: [%s] %d%% %s/%s\n", ramBar,
|
||||
(stat.Info.Resources.MemReserved+stat.MemUsedMin)*100/stat.Info.Resources.MemPhysical,
|
||||
types.SizeStr(types.NewInt(stat.Info.Resources.MemReserved+stat.MemUsedMin)),
|
||||
(ramTasks+ramReserved)*100/stat.Info.Resources.MemPhysical,
|
||||
types.SizeStr(types.NewInt(ramTasks+ramUsed)),
|
||||
types.SizeStr(types.NewInt(stat.Info.Resources.MemPhysical)))
|
||||
|
||||
fmt.Printf("\tVMEM: [%s] %d%% %s/%s\n", vmemBar,
|
||||
(stat.Info.Resources.MemReserved+stat.MemUsedMax)*100/vmem,
|
||||
types.SizeStr(types.NewInt(stat.Info.Resources.MemReserved+stat.MemUsedMax)),
|
||||
types.SizeStr(types.NewInt(vmem)))
|
||||
vmemTotal := stat.Info.Resources.MemPhysical + stat.Info.Resources.MemSwap
|
||||
vmemTasks := stat.MemUsedMax
|
||||
vmemUsed := stat.Info.Resources.MemUsed + stat.Info.Resources.MemSwapUsed
|
||||
var vmemReserved uint64 = 0
|
||||
if vmemUsed > vmemTasks {
|
||||
vmemReserved = vmemUsed - vmemTasks
|
||||
}
|
||||
vmemBar := barString(float64(vmemTotal), float64(vmemReserved), float64(vmemTasks))
|
||||
|
||||
fmt.Printf("\tVMEM: [%s] %d%% %s/%s\n", vmemBar,
|
||||
(vmemTasks+vmemReserved)*100/vmemTotal,
|
||||
types.SizeStr(types.NewInt(vmemTasks+vmemReserved)),
|
||||
types.SizeStr(types.NewInt(vmemTotal)))
|
||||
|
||||
if len(stat.Info.Resources.GPUs) > 0 {
|
||||
gpuBar := barString(float64(len(stat.Info.Resources.GPUs)), 0, stat.GpuUsed)
|
||||
fmt.Printf("\tGPU: [%s] %.f%% %.2f/%d gpu(s) in use\n", color.GreenString(gpuBar),
|
||||
stat.GpuUsed*100/float64(len(stat.Info.Resources.GPUs)),
|
||||
stat.GpuUsed, len(stat.Info.Resources.GPUs))
|
||||
}
|
||||
for _, gpu := range stat.Info.Resources.GPUs {
|
||||
fmt.Printf("\tGPU: %s\n", color.New(gpuCol).Sprintf("%s, %sused", gpu, gpuUse))
|
||||
}
|
||||
@@ -224,8 +223,10 @@ var sealingJobsCmd = &cli.Command{
|
||||
for _, l := range lines {
|
||||
state := "running"
|
||||
switch {
|
||||
case l.RunWait > 0:
|
||||
case l.RunWait > 1:
|
||||
state = fmt.Sprintf("assigned(%d)", l.RunWait-1)
|
||||
case l.RunWait == storiface.RWPrepared:
|
||||
state = "prepared"
|
||||
case l.RunWait == storiface.RWRetDone:
|
||||
if !cctx.Bool("show-ret-done") {
|
||||
continue
|
||||
|
||||
+38
-14
@@ -266,8 +266,9 @@ var sectorsListCmd = &cli.Command{
|
||||
Usage: "List sectors",
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "show-removed",
|
||||
Usage: "show removed sectors",
|
||||
Name: "show-removed",
|
||||
Usage: "show removed sectors",
|
||||
Aliases: []string{"r"},
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "color",
|
||||
@@ -276,12 +277,14 @@ var sectorsListCmd = &cli.Command{
|
||||
Aliases: []string{"c"},
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "fast",
|
||||
Usage: "don't show on-chain info for better performance",
|
||||
Name: "fast",
|
||||
Usage: "don't show on-chain info for better performance",
|
||||
Aliases: []string{"f"},
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "events",
|
||||
Usage: "display number of events the sector has received",
|
||||
Name: "events",
|
||||
Usage: "display number of events the sector has received",
|
||||
Aliases: []string{"e"},
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "seal-time",
|
||||
@@ -291,6 +294,11 @@ var sectorsListCmd = &cli.Command{
|
||||
Name: "states",
|
||||
Usage: "filter sectors by a comma-separated list of states",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "unproven",
|
||||
Usage: "only show sectors which aren't in the 'Proving' state",
|
||||
Aliases: []string{"u"},
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.IsSet("color") {
|
||||
@@ -314,17 +322,33 @@ var sectorsListCmd = &cli.Command{
|
||||
var list []abi.SectorNumber
|
||||
|
||||
showRemoved := cctx.Bool("show-removed")
|
||||
states := cctx.String("states")
|
||||
var states []api.SectorState
|
||||
if cctx.IsSet("states") && cctx.IsSet("unproven") {
|
||||
return xerrors.Errorf("only one of --states or --unproven can be specified at once")
|
||||
}
|
||||
|
||||
if cctx.IsSet("states") {
|
||||
showRemoved = true
|
||||
sList := strings.Split(cctx.String("states"), ",")
|
||||
states = make([]api.SectorState, len(sList))
|
||||
for i := range sList {
|
||||
states[i] = api.SectorState(sList[i])
|
||||
}
|
||||
}
|
||||
|
||||
if cctx.Bool("unproven") {
|
||||
for state := range sealing.ExistSectorStateList {
|
||||
if state == sealing.Proving {
|
||||
continue
|
||||
}
|
||||
states = append(states, api.SectorState(state))
|
||||
}
|
||||
}
|
||||
|
||||
if len(states) == 0 {
|
||||
list, err = nodeApi.SectorsList(ctx)
|
||||
} else {
|
||||
showRemoved = true
|
||||
sList := strings.Split(states, ",")
|
||||
ss := make([]api.SectorState, len(sList))
|
||||
for i := range sList {
|
||||
ss[i] = api.SectorState(sList[i])
|
||||
}
|
||||
list, err = nodeApi.SectorsListInStates(ctx, ss)
|
||||
list, err = nodeApi.SectorsListInStates(ctx, states)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -95,6 +95,14 @@ over time
|
||||
Name: "max-storage",
|
||||
Usage: "(for init) limit storage space for sectors (expensive for very large paths!)",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "groups",
|
||||
Usage: "path group names",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "allow-to",
|
||||
Usage: "path groups allowed to pull data from this path (allow all if not specified)",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||
@@ -142,6 +150,8 @@ over time
|
||||
CanSeal: cctx.Bool("seal"),
|
||||
CanStore: cctx.Bool("store"),
|
||||
MaxStorage: uint64(maxStor),
|
||||
Groups: cctx.StringSlice("groups"),
|
||||
AllowTo: cctx.StringSlice("allow-to"),
|
||||
}
|
||||
|
||||
if !(cfg.CanStore || cfg.CanSeal) {
|
||||
@@ -322,10 +332,17 @@ var storageListCmd = &cli.Command{
|
||||
if si.CanStore {
|
||||
fmt.Print(color.CyanString("Store"))
|
||||
}
|
||||
fmt.Println("")
|
||||
} else {
|
||||
fmt.Print(color.HiYellowString("Use: ReadOnly"))
|
||||
}
|
||||
fmt.Println()
|
||||
|
||||
if len(si.Groups) > 0 {
|
||||
fmt.Printf("\tGroups: %s\n", strings.Join(si.Groups, ", "))
|
||||
}
|
||||
if len(si.AllowTo) > 0 {
|
||||
fmt.Printf("\tAllowTo: %s\n", strings.Join(si.AllowTo, ", "))
|
||||
}
|
||||
|
||||
if localPath, ok := local[s.ID]; ok {
|
||||
fmt.Printf("\tLocal: %s\n", color.GreenString(localPath))
|
||||
|
||||
+13
-12
@@ -17,6 +17,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
|
||||
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
|
||||
|
||||
@@ -41,7 +42,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/tools/stats"
|
||||
"github.com/filecoin-project/lotus/tools/stats/sync"
|
||||
)
|
||||
|
||||
var log = logging.Logger("main")
|
||||
@@ -160,15 +161,15 @@ var findMinersCmd = &cli.Command{
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
ctx := context.Background()
|
||||
api, closer, err := stats.GetFullNodeAPI(cctx.Context, cctx.String("lotus-path"))
|
||||
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
|
||||
if !cctx.Bool("no-sync") {
|
||||
if err := stats.WaitForSyncComplete(ctx, api); err != nil {
|
||||
log.Fatal(err)
|
||||
if err := sync.SyncWait(ctx, api); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +246,7 @@ var recoverMinersCmd = &cli.Command{
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
ctx := context.Background()
|
||||
api, closer, err := stats.GetFullNodeAPI(cctx.Context, cctx.String("lotus-path"))
|
||||
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -266,8 +267,8 @@ var recoverMinersCmd = &cli.Command{
|
||||
}
|
||||
|
||||
if !cctx.Bool("no-sync") {
|
||||
if err := stats.WaitForSyncComplete(ctx, api); err != nil {
|
||||
log.Fatal(err)
|
||||
if err := sync.SyncWait(ctx, api); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +428,7 @@ var runCmd = &cli.Command{
|
||||
}()
|
||||
|
||||
ctx := context.Background()
|
||||
api, closer, err := stats.GetFullNodeAPI(cctx.Context, cctx.String("lotus-path"))
|
||||
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -448,12 +449,12 @@ var runCmd = &cli.Command{
|
||||
}
|
||||
|
||||
if !cctx.Bool("no-sync") {
|
||||
if err := stats.WaitForSyncComplete(ctx, api); err != nil {
|
||||
log.Fatal(err)
|
||||
if err := sync.SyncWait(ctx, api); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
tipsetsCh, err := stats.GetTips(ctx, api, r.Height(), cctx.Int("head-delay"))
|
||||
tipsetsCh, err := sync.BufferedTipsetChannel(ctx, api, r.Height(), cctx.Int("head-delay"))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -58,8 +58,11 @@ var infoCmd = &cli.Command{
|
||||
|
||||
fmt.Printf("Hostname: %s\n", info.Hostname)
|
||||
fmt.Printf("CPUs: %d; GPUs: %v\n", info.Resources.CPUs, info.Resources.GPUs)
|
||||
fmt.Printf("RAM: %s; Swap: %s\n", types.SizeStr(types.NewInt(info.Resources.MemPhysical)), types.SizeStr(types.NewInt(info.Resources.MemSwap)))
|
||||
fmt.Printf("Reserved memory: %s\n", types.SizeStr(types.NewInt(info.Resources.MemReserved)))
|
||||
fmt.Printf("RAM: %s/%s; Swap: %s/%s\n",
|
||||
types.SizeStr(types.NewInt(info.Resources.MemUsed)),
|
||||
types.SizeStr(types.NewInt(info.Resources.MemPhysical)),
|
||||
types.SizeStr(types.NewInt(info.Resources.MemSwapUsed)),
|
||||
types.SizeStr(types.NewInt(info.Resources.MemSwap)))
|
||||
|
||||
fmt.Printf("Task types: ")
|
||||
for _, t := range ttList(tt) {
|
||||
|
||||
@@ -37,6 +37,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/lib/lotuslog"
|
||||
"github.com/filecoin-project/lotus/lib/rpcenc"
|
||||
"github.com/filecoin-project/lotus/metrics"
|
||||
"github.com/filecoin-project/lotus/metrics/proxy"
|
||||
"github.com/filecoin-project/lotus/node/modules"
|
||||
"github.com/filecoin-project/lotus/node/repo"
|
||||
)
|
||||
@@ -59,6 +60,7 @@ func main() {
|
||||
storageCmd,
|
||||
setCmd,
|
||||
waitQuietCmd,
|
||||
resourcesCmd,
|
||||
tasksCmd,
|
||||
}
|
||||
|
||||
@@ -75,6 +77,12 @@ func main() {
|
||||
Value: "~/.lotusworker", // TODO: Consider XDG_DATA_HOME
|
||||
Usage: fmt.Sprintf("Specify worker repo path. flag %s and env WORKER_PATH are DEPRECATION, will REMOVE SOON", FlagWorkerRepoDeprecation),
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "panic-reports",
|
||||
EnvVars: []string{"LOTUS_PANIC_REPORT_PATH"},
|
||||
Hidden: true,
|
||||
Value: "~/.lotusworker", // should follow --repo default
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "miner-repo",
|
||||
Aliases: []string{"storagerepo"},
|
||||
@@ -89,6 +97,14 @@ func main() {
|
||||
},
|
||||
},
|
||||
|
||||
After: func(c *cli.Context) error {
|
||||
if r := recover(); r != nil {
|
||||
// Generate report in LOTUS_PATH and re-raise panic
|
||||
build.GeneratePanicReport(c.String("panic-reports"), c.String(FlagWorkerRepo), c.App.Name)
|
||||
panic(r)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
Commands: local,
|
||||
}
|
||||
app.Setup()
|
||||
@@ -395,7 +411,7 @@ var runCmd = &cli.Command{
|
||||
|
||||
readerHandler, readerServerOpt := rpcenc.ReaderParamDecoder()
|
||||
rpcServer := jsonrpc.NewServer(readerServerOpt)
|
||||
rpcServer.Register("Filecoin", api.PermissionedWorkerAPI(metrics.MetricedWorkerAPI(workerApi)))
|
||||
rpcServer.Register("Filecoin", api.PermissionedWorkerAPI(proxy.MetricedWorkerAPI(workerApi)))
|
||||
|
||||
mux.Handle("/rpc/v0", rpcServer)
|
||||
mux.Handle("/rpc/streams/v0/push/{uuid}", readerHandler)
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
||||
)
|
||||
|
||||
var resourcesCmd = &cli.Command{
|
||||
Name: "resources",
|
||||
Usage: "Manage resource table overrides",
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "all",
|
||||
Usage: "print all resource envvars",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "default",
|
||||
Usage: "print default resource envvars",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
def := map[string]string{}
|
||||
set := map[string]string{}
|
||||
all := map[string]string{}
|
||||
|
||||
_, err := storiface.ParseResourceEnv(func(key, d string) (string, bool) {
|
||||
if d != "" {
|
||||
all[key] = d
|
||||
def[key] = d
|
||||
}
|
||||
|
||||
s, ok := os.LookupEnv(key)
|
||||
if ok {
|
||||
all[key] = s
|
||||
set[key] = s
|
||||
}
|
||||
|
||||
return s, ok
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printMap := func(m map[string]string) {
|
||||
var arr []string
|
||||
for k, v := range m {
|
||||
arr = append(arr, fmt.Sprintf("%s=%s", k, v))
|
||||
}
|
||||
sort.Strings(arr)
|
||||
for _, s := range arr {
|
||||
fmt.Println(s)
|
||||
}
|
||||
}
|
||||
|
||||
if cctx.Bool("default") {
|
||||
printMap(def)
|
||||
} else {
|
||||
if cctx.Bool("all") {
|
||||
printMap(all)
|
||||
} else {
|
||||
printMap(set)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
@@ -51,6 +51,14 @@ var storageAttachCmd = &cli.Command{
|
||||
Name: "max-storage",
|
||||
Usage: "(for init) limit storage space for sectors (expensive for very large paths!)",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "groups",
|
||||
Usage: "path group names",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "allow-to",
|
||||
Usage: "path groups allowed to pull data from this path (allow all if not specified)",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
nodeApi, closer, err := lcli.GetWorkerAPI(cctx)
|
||||
@@ -98,6 +106,8 @@ var storageAttachCmd = &cli.Command{
|
||||
CanSeal: cctx.Bool("seal"),
|
||||
CanStore: cctx.Bool("store"),
|
||||
MaxStorage: uint64(maxStor),
|
||||
Groups: cctx.StringSlice("groups"),
|
||||
AllowTo: cctx.StringSlice("allow-to"),
|
||||
}
|
||||
|
||||
if !(cfg.CanStore || cfg.CanSeal) {
|
||||
|
||||
@@ -94,9 +94,10 @@ var preSealCmd = &cli.Command{
|
||||
Name: "fake-sectors",
|
||||
Value: false,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
&cli.UintFlag{
|
||||
Name: "network-version",
|
||||
Usage: "specify network version",
|
||||
Value: uint(build.NewestNetworkVersion),
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
|
||||
@@ -104,7 +104,7 @@ var actorWithdrawCmd = &cli.Command{
|
||||
amount = abi.TokenAmount(f)
|
||||
|
||||
if amount.GreaterThan(available) {
|
||||
return xerrors.Errorf("can't withdraw more funds than available; requested: %s; available: %s", amount, available)
|
||||
return xerrors.Errorf("can't withdraw more funds than available; requested: %s; available: %s", types.FIL(amount), types.FIL(available))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,9 +151,9 @@ var actorWithdrawCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Successfully withdrew %s FIL\n", withdrawn)
|
||||
fmt.Printf("Successfully withdrew %s \n", types.FIL(withdrawn))
|
||||
if withdrawn.LessThan(amount) {
|
||||
fmt.Printf("Note that this is less than the requested amount of %s FIL\n", amount)
|
||||
fmt.Printf("Note that this is less than the requested amount of %s \n", types.FIL(amount))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/exitcode"
|
||||
|
||||
lapi "github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
)
|
||||
|
||||
var balancerCmd = &cli.Command{
|
||||
Name: "balancer",
|
||||
Usage: "Utility for balancing tokens between multiple wallets",
|
||||
Description: `Tokens are balanced based on the specification provided in arguments
|
||||
|
||||
Each argument specifies an address, role, and role parameters separated by ';'
|
||||
|
||||
Supported roles:
|
||||
- request;[addr];[low];[high] - request tokens when balance drops to [low], topping up to [high]
|
||||
- provide;[addr];[min] - provide tokens to other addresses as long as the balance is above [min]
|
||||
`,
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, closer, err := lcli.GetFullNodeAPIV1(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer closer()
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
type request struct {
|
||||
addr address.Address
|
||||
low, high abi.TokenAmount
|
||||
}
|
||||
type provide struct {
|
||||
addr address.Address
|
||||
min abi.TokenAmount
|
||||
}
|
||||
|
||||
var requests []request
|
||||
var provides []provide
|
||||
|
||||
for i, s := range cctx.Args().Slice() {
|
||||
ss := strings.Split(s, ";")
|
||||
switch ss[0] {
|
||||
case "request":
|
||||
if len(ss) != 4 {
|
||||
return xerrors.Errorf("request role needs 4 parameters (arg %d)", i)
|
||||
}
|
||||
|
||||
addr, err := address.NewFromString(ss[1])
|
||||
if err != nil {
|
||||
return xerrors.Errorf("parsing address in arg %d: %w", i, err)
|
||||
}
|
||||
|
||||
low, err := types.ParseFIL(ss[2])
|
||||
if err != nil {
|
||||
return xerrors.Errorf("parsing low in arg %d: %w", i, err)
|
||||
}
|
||||
|
||||
high, err := types.ParseFIL(ss[3])
|
||||
if err != nil {
|
||||
return xerrors.Errorf("parsing high in arg %d: %w", i, err)
|
||||
}
|
||||
|
||||
if abi.TokenAmount(low).GreaterThanEqual(abi.TokenAmount(high)) {
|
||||
return xerrors.Errorf("low must be less than high in arg %d", i)
|
||||
}
|
||||
|
||||
requests = append(requests, request{
|
||||
addr: addr,
|
||||
low: abi.TokenAmount(low),
|
||||
high: abi.TokenAmount(high),
|
||||
})
|
||||
case "provide":
|
||||
if len(ss) != 3 {
|
||||
return xerrors.Errorf("provide role needs 3 parameters (arg %d)", i)
|
||||
}
|
||||
|
||||
addr, err := address.NewFromString(ss[1])
|
||||
if err != nil {
|
||||
return xerrors.Errorf("parsing address in arg %d: %w", i, err)
|
||||
}
|
||||
|
||||
min, err := types.ParseFIL(ss[2])
|
||||
if err != nil {
|
||||
return xerrors.Errorf("parsing min in arg %d: %w", i, err)
|
||||
}
|
||||
|
||||
provides = append(provides, provide{
|
||||
addr: addr,
|
||||
min: abi.TokenAmount(min),
|
||||
})
|
||||
default:
|
||||
return xerrors.Errorf("unknown role '%s' in arg %d", ss[0], i)
|
||||
}
|
||||
}
|
||||
|
||||
if len(provides) == 0 {
|
||||
return xerrors.Errorf("no provides specified")
|
||||
}
|
||||
if len(requests) == 0 {
|
||||
return xerrors.Errorf("no requests specified")
|
||||
}
|
||||
|
||||
const confidence = 16
|
||||
|
||||
var notifs <-chan []*lapi.HeadChange
|
||||
for {
|
||||
if notifs == nil {
|
||||
notifs, err = api.ChainNotify(ctx)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("chain notify error: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
var ts *types.TipSet
|
||||
loop:
|
||||
for {
|
||||
time.Sleep(150 * time.Millisecond)
|
||||
select {
|
||||
case n := <-notifs:
|
||||
for _, change := range n {
|
||||
if change.Type != store.HCApply {
|
||||
continue
|
||||
}
|
||||
|
||||
ts = change.Val
|
||||
}
|
||||
case <-ctx.Done():
|
||||
return nil
|
||||
default:
|
||||
break loop
|
||||
}
|
||||
}
|
||||
|
||||
type send struct {
|
||||
to address.Address
|
||||
amt abi.TokenAmount
|
||||
filled bool
|
||||
}
|
||||
var toSend []*send
|
||||
|
||||
for _, req := range requests {
|
||||
bal, err := api.StateGetActor(ctx, req.addr, ts.Key())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if bal.Balance.LessThan(req.low) {
|
||||
toSend = append(toSend, &send{
|
||||
to: req.addr,
|
||||
amt: big.Sub(req.high, bal.Balance),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
for _, s := range toSend {
|
||||
fmt.Printf("REQUEST %s for %s\n", types.FIL(s.amt), s.to)
|
||||
}
|
||||
|
||||
var msgs []cid.Cid
|
||||
|
||||
for _, prov := range provides {
|
||||
bal, err := api.StateGetActor(ctx, prov.addr, ts.Key())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
avail := big.Sub(bal.Balance, prov.min)
|
||||
for _, s := range toSend {
|
||||
if s.filled {
|
||||
continue
|
||||
}
|
||||
if avail.LessThan(s.amt) {
|
||||
continue
|
||||
}
|
||||
|
||||
m, err := api.MpoolPushMessage(ctx, &types.Message{
|
||||
From: prov.addr,
|
||||
To: s.to,
|
||||
Value: s.amt,
|
||||
}, nil)
|
||||
if err != nil {
|
||||
fmt.Printf("SEND ERROR %s\n", err.Error())
|
||||
}
|
||||
fmt.Printf("SEND %s; %s from %s TO %s\n", m.Cid(), types.FIL(s.amt), s.to, prov.addr)
|
||||
|
||||
msgs = append(msgs, m.Cid())
|
||||
s.filled = true
|
||||
avail = big.Sub(avail, s.amt)
|
||||
}
|
||||
}
|
||||
|
||||
if len(msgs) > 0 {
|
||||
fmt.Printf("WAITING FOR %d MESSAGES\n", len(msgs))
|
||||
}
|
||||
|
||||
for _, msg := range msgs {
|
||||
ml, err := api.StateWaitMsg(ctx, msg, confidence, lapi.LookbackNoLimit, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if ml.Receipt.ExitCode != exitcode.Ok {
|
||||
fmt.Printf("MSG %s NON-ZERO EXITCODE: %s\n", msg, ml.Receipt.ExitCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var chainCmd = &cli.Command{
|
||||
Name: "chain",
|
||||
Usage: "chain-related utilities",
|
||||
Subcommands: []*cli.Command{
|
||||
chainNullTsCmd,
|
||||
},
|
||||
}
|
||||
|
||||
var chainNullTsCmd = &cli.Command{
|
||||
Name: "latest-null",
|
||||
Usage: "finds the most recent null tipset",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer closer()
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
ts, err := lcli.LoadTipSet(ctx, cctx, api)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for {
|
||||
pts, err := api.ChainGetTipSet(ctx, ts.Parents())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if ts.Height() != pts.Height()+1 {
|
||||
fmt.Println("null tipset at height ", ts.Height()-1)
|
||||
return nil
|
||||
}
|
||||
|
||||
ts = pts
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/fr32"
|
||||
)
|
||||
|
||||
var fr32Cmd = &cli.Command{
|
||||
Name: "fr32",
|
||||
Description: "fr32 encode/decode",
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "decode",
|
||||
Aliases: []string{"d"},
|
||||
},
|
||||
},
|
||||
Action: func(context *cli.Context) error {
|
||||
if context.Bool("decode") {
|
||||
st, err := os.Stdin.Stat()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pps := abi.PaddedPieceSize(st.Size())
|
||||
if pps == 0 {
|
||||
return xerrors.Errorf("zero size input")
|
||||
}
|
||||
|
||||
if err := pps.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
r, err := fr32.NewUnpadReader(os.Stdin, pps)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.Copy(os.Stdout, r); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
w := fr32.NewPadWriter(os.Stdout)
|
||||
if _, err := io.Copy(w, os.Stdin); err != nil {
|
||||
return err
|
||||
}
|
||||
return w.Close()
|
||||
},
|
||||
}
|
||||
@@ -59,8 +59,12 @@ func main() {
|
||||
signaturesCmd,
|
||||
actorCmd,
|
||||
minerTypesCmd,
|
||||
minerPeeridCmd,
|
||||
minerMultisigsCmd,
|
||||
splitstoreCmd,
|
||||
fr32Cmd,
|
||||
chainCmd,
|
||||
balancerCmd,
|
||||
}
|
||||
|
||||
app := &cli.App{
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
|
||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/consensus/filcns"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/state"
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/node/repo"
|
||||
"github.com/filecoin-project/specs-actors/v4/actors/util/adt"
|
||||
"github.com/ipfs/go-cid"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
var minerPeeridCmd = &cli.Command{
|
||||
Name: "miner-peerid",
|
||||
Usage: "Scrape state to find a miner based on peerid", Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "repo",
|
||||
Value: "~/.lotus",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
ctx := context.TODO()
|
||||
|
||||
if cctx.NArg() != 2 {
|
||||
return fmt.Errorf("must pass peer id and state root")
|
||||
}
|
||||
|
||||
pid, err := peer.Decode(cctx.Args().Get(0))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to parse input as a peerId: %w", err)
|
||||
}
|
||||
|
||||
sroot, err := cid.Decode(cctx.Args().Get(1))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to parse state root: %w", err)
|
||||
}
|
||||
|
||||
fsrepo, err := repo.NewFS(cctx.String("repo"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
lkrepo, err := fsrepo.Lock(repo.FullNode)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer lkrepo.Close() //nolint:errcheck
|
||||
|
||||
bs, err := lkrepo.Blockstore(ctx, repo.UniversalBlockstore)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to open blockstore: %w", err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if c, ok := bs.(io.Closer); ok {
|
||||
if err := c.Close(); err != nil {
|
||||
log.Warnf("failed to close blockstore: %s", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
mds, err := lkrepo.Datastore(context.Background(), "/metadata")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cs := store.NewChainStore(bs, bs, mds, filcns.Weight, nil)
|
||||
defer cs.Close() //nolint:errcheck
|
||||
|
||||
cst := cbor.NewCborStore(bs)
|
||||
store := adt.WrapStore(ctx, cst)
|
||||
|
||||
tree, err := state.LoadStateTree(cst, sroot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tree.ForEach(func(addr address.Address, act *types.Actor) error {
|
||||
if act.Code == builtin5.StorageMinerActorCodeID {
|
||||
ms, err := miner.Load(store, act)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mi, err := ms.Info()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if mi.PeerId != nil && *mi.PeerId == pid {
|
||||
fmt.Println(addr)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to loop over actors: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
@@ -2,11 +2,29 @@ package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
miner2 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
|
||||
power6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/power"
|
||||
|
||||
"github.com/docker/go-units"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
|
||||
"github.com/mitchellh/go-homedir"
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/xerrors"
|
||||
@@ -17,6 +35,231 @@ var minerCmd = &cli.Command{
|
||||
Usage: "miner-related utilities",
|
||||
Subcommands: []*cli.Command{
|
||||
minerUnpackInfoCmd,
|
||||
minerCreateCmd,
|
||||
minerFaultsCmd,
|
||||
},
|
||||
}
|
||||
|
||||
var minerFaultsCmd = &cli.Command{
|
||||
Name: "faults",
|
||||
Usage: "Display a list of faulty sectors for a SP",
|
||||
ArgsUsage: "[minerAddress]",
|
||||
Flags: []cli.Flag{
|
||||
&cli.Uint64Flag{
|
||||
Name: "expiring-in",
|
||||
Usage: "only list sectors that are expiring in the next <n> epochs",
|
||||
Value: 0,
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if !cctx.Args().Present() {
|
||||
return fmt.Errorf("must pass miner address")
|
||||
}
|
||||
|
||||
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer closer()
|
||||
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
m, err := address.NewFromString(cctx.Args().First())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
faultBf, err := api.StateMinerFaults(ctx, m, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
faults, err := faultBf.All(miner2.SectorsMax)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(faults) == 0 {
|
||||
fmt.Println("no faults")
|
||||
return nil
|
||||
}
|
||||
|
||||
expEpoch := abi.ChainEpoch(cctx.Uint64("expiring-in"))
|
||||
|
||||
if expEpoch == 0 {
|
||||
fmt.Print("faulty sectors: ")
|
||||
for _, v := range faults {
|
||||
fmt.Printf("%d ", v)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
h, err := api.ChainHead(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("faulty sectors expiring in the next %d epochs: ", expEpoch)
|
||||
for _, v := range faults {
|
||||
ss, err := api.StateSectorExpiration(ctx, m, abi.SectorNumber(v), types.EmptyTSK)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if ss.Early < h.Height()+expEpoch {
|
||||
fmt.Printf("%d ", v)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
var minerCreateCmd = &cli.Command{
|
||||
Name: "create",
|
||||
Usage: "sends a create miner msg",
|
||||
ArgsUsage: "[sender] [owner] [worker] [sector size]",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
wapi, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer closer()
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
if cctx.Args().Len() != 4 {
|
||||
return xerrors.Errorf("expected 4 args (sender owner worker sectorSize)")
|
||||
}
|
||||
|
||||
sender, err := address.NewFromString(cctx.Args().First())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
owner, err := address.NewFromString(cctx.Args().Get(1))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
worker, err := address.NewFromString(cctx.Args().Get(2))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ssize, err := units.RAMInBytes(cctx.Args().Get(3))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to parse sector size: %w", err)
|
||||
}
|
||||
|
||||
// make sure the sender account exists on chain
|
||||
_, err = wapi.StateLookupID(ctx, owner, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("sender must exist on chain: %w", err)
|
||||
}
|
||||
|
||||
// make sure the worker account exists on chain
|
||||
_, err = wapi.StateLookupID(ctx, worker, types.EmptyTSK)
|
||||
if err != nil {
|
||||
signed, err := wapi.MpoolPushMessage(ctx, &types.Message{
|
||||
From: sender,
|
||||
To: worker,
|
||||
Value: types.NewInt(0),
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("push worker init: %w", err)
|
||||
}
|
||||
|
||||
log.Infof("Initializing worker account %s, message: %s", worker, signed.Cid())
|
||||
log.Infof("Waiting for confirmation")
|
||||
|
||||
mw, err := wapi.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("waiting for worker init: %w", err)
|
||||
}
|
||||
|
||||
if mw.Receipt.ExitCode != 0 {
|
||||
return xerrors.Errorf("initializing worker account failed: exit code %d", mw.Receipt.ExitCode)
|
||||
}
|
||||
}
|
||||
|
||||
// make sure the owner account exists on chain
|
||||
_, err = wapi.StateLookupID(ctx, owner, types.EmptyTSK)
|
||||
if err != nil {
|
||||
signed, err := wapi.MpoolPushMessage(ctx, &types.Message{
|
||||
From: sender,
|
||||
To: owner,
|
||||
Value: types.NewInt(0),
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("push owner init: %w", err)
|
||||
}
|
||||
|
||||
log.Infof("Initializing owner account %s, message: %s", worker, signed.Cid())
|
||||
log.Infof("Wating for confirmation")
|
||||
|
||||
mw, err := wapi.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("waiting for owner init: %w", err)
|
||||
}
|
||||
|
||||
if mw.Receipt.ExitCode != 0 {
|
||||
return xerrors.Errorf("initializing owner account failed: exit code %d", mw.Receipt.ExitCode)
|
||||
}
|
||||
}
|
||||
|
||||
// Note: the correct thing to do would be to call SealProofTypeFromSectorSize if actors version is v3 or later, but this still works
|
||||
spt, err := miner.WindowPoStProofTypeFromSectorSize(abi.SectorSize(ssize))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting post proof type: %w", err)
|
||||
}
|
||||
|
||||
params, err := actors.SerializeParams(&power6.CreateMinerParams{
|
||||
Owner: owner,
|
||||
Worker: worker,
|
||||
WindowPoStProofType: spt,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
createStorageMinerMsg := &types.Message{
|
||||
To: power.Address,
|
||||
From: sender,
|
||||
Value: big.Zero(),
|
||||
|
||||
Method: power.Methods.CreateMiner,
|
||||
Params: params,
|
||||
}
|
||||
|
||||
signed, err := wapi.MpoolPushMessage(ctx, createStorageMinerMsg, nil)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("pushing createMiner message: %w", err)
|
||||
}
|
||||
|
||||
log.Infof("Pushed CreateMiner message: %s", signed.Cid())
|
||||
log.Infof("Waiting for confirmation")
|
||||
|
||||
mw, err := wapi.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("waiting for createMiner message: %w", err)
|
||||
}
|
||||
|
||||
if mw.Receipt.ExitCode != 0 {
|
||||
return xerrors.Errorf("create miner failed: exit code %d", mw.Receipt.ExitCode)
|
||||
}
|
||||
|
||||
var retval power6.CreateMinerReturn
|
||||
if err := retval.UnmarshalCBOR(bytes.NewReader(mw.Receipt.Return)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Infof("New miners address is: %s (%s)", retval.IDAddress, retval.RobustAddress)
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -148,6 +148,15 @@ func printMessage(cctx *cli.Context, msg *types.Message) error {
|
||||
|
||||
fmt.Println("Params:", p)
|
||||
|
||||
if msg, err := messageFromBytes(cctx, msg.Params); err == nil {
|
||||
fmt.Println("---")
|
||||
color.Red("Params message:")
|
||||
|
||||
if err := printMessage(cctx, msg.VMMessage()); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
+114
-24
@@ -2,11 +2,14 @@ package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
"image/png"
|
||||
"io"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -23,6 +26,7 @@ import (
|
||||
|
||||
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
|
||||
|
||||
"github.com/filecoin-project/lotus/api/v0api"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
@@ -38,6 +42,7 @@ var sectorsCmd = &cli.Command{
|
||||
terminateSectorCmd,
|
||||
terminateSectorPenaltyEstimationCmd,
|
||||
visAllocatedSectorsCmd,
|
||||
dumpRLESectorCmd,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -275,6 +280,113 @@ var terminateSectorPenaltyEstimationCmd = &cli.Command{
|
||||
},
|
||||
}
|
||||
|
||||
func activeMiners(ctx context.Context, api v0api.FullNode) ([]address.Address, error) {
|
||||
miners, err := api.StateListMiners(ctx, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
powCache := make(map[address.Address]types.BigInt)
|
||||
var lk sync.Mutex
|
||||
parmap.Par(32, miners, func(a address.Address) {
|
||||
pow, err := api.StateMinerPower(ctx, a, types.EmptyTSK)
|
||||
|
||||
lk.Lock()
|
||||
if err == nil {
|
||||
powCache[a] = pow.MinerPower.QualityAdjPower
|
||||
} else {
|
||||
powCache[a] = types.NewInt(0)
|
||||
}
|
||||
lk.Unlock()
|
||||
})
|
||||
sort.Slice(miners, func(i, j int) bool {
|
||||
return powCache[miners[i]].GreaterThan(powCache[miners[j]])
|
||||
})
|
||||
n := sort.Search(len(miners), func(i int) bool {
|
||||
pow := powCache[miners[i]]
|
||||
return pow.IsZero()
|
||||
})
|
||||
return append(miners[0:0:0], miners[:n]...), nil
|
||||
}
|
||||
|
||||
var dumpRLESectorCmd = &cli.Command{
|
||||
Name: "dump-rles",
|
||||
Usage: "Dump AllocatedSectors RLEs from miners passed as arguments as run lengths in uint64 LE format.\nIf no arguments are passed, dumps all active miners in the state tree.",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
var miners []address.Address
|
||||
if cctx.NArg() == 0 {
|
||||
miners, err = activeMiners(ctx, api)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting active miners: %w", err)
|
||||
}
|
||||
} else {
|
||||
for _, mS := range cctx.Args().Slice() {
|
||||
mA, err := address.NewFromString(mS)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("parsing address '%s': %w", mS, err)
|
||||
}
|
||||
miners = append(miners, mA)
|
||||
}
|
||||
}
|
||||
wbuf := make([]byte, 8)
|
||||
buf := &bytes.Buffer{}
|
||||
|
||||
for i := 0; i < len(miners); i++ {
|
||||
buf.Reset()
|
||||
err := func() error {
|
||||
state, err := api.StateReadState(ctx, miners[i], types.EmptyTSK)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting state: %+v", err)
|
||||
}
|
||||
allocSString := state.State.(map[string]interface{})["AllocatedSectors"].(map[string]interface{})["/"].(string)
|
||||
|
||||
allocCid, err := cid.Decode(allocSString)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding cid: %+v", err)
|
||||
}
|
||||
rle, err := api.ChainReadObj(ctx, allocCid)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("reading AllocatedSectors: %+v", err)
|
||||
}
|
||||
|
||||
var bf bitfield.BitField
|
||||
err = bf.UnmarshalCBOR(bytes.NewReader(rle))
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding bitfield: %w", err)
|
||||
}
|
||||
ri, err := bf.RunIterator()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("creating iterator: %w", err)
|
||||
}
|
||||
|
||||
for ri.HasNext() {
|
||||
run, err := ri.NextRun()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting run: %w", err)
|
||||
}
|
||||
binary.LittleEndian.PutUint64(wbuf, run.Len)
|
||||
buf.Write(wbuf)
|
||||
}
|
||||
_, err = io.Copy(os.Stdout, buf)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("copy: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}()
|
||||
if err != nil {
|
||||
log.Errorf("miner %d: %s: %+v", i, miners[i], err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
var visAllocatedSectorsCmd = &cli.Command{
|
||||
Name: "vis-allocated",
|
||||
Usage: "Produces a html with visualisation of allocated sectors",
|
||||
@@ -287,32 +399,10 @@ var visAllocatedSectorsCmd = &cli.Command{
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
var miners []address.Address
|
||||
if cctx.NArg() == 0 {
|
||||
miners, err = api.StateListMiners(ctx, types.EmptyTSK)
|
||||
miners, err = activeMiners(ctx, api)
|
||||
if err != nil {
|
||||
return err
|
||||
return xerrors.Errorf("getting active miners: %w", err)
|
||||
}
|
||||
powCache := make(map[address.Address]types.BigInt)
|
||||
var lk sync.Mutex
|
||||
parmap.Par(32, miners, func(a address.Address) {
|
||||
pow, err := api.StateMinerPower(ctx, a, types.EmptyTSK)
|
||||
|
||||
lk.Lock()
|
||||
if err == nil {
|
||||
powCache[a] = pow.MinerPower.QualityAdjPower
|
||||
} else {
|
||||
powCache[a] = types.NewInt(0)
|
||||
}
|
||||
lk.Unlock()
|
||||
})
|
||||
sort.Slice(miners, func(i, j int) bool {
|
||||
return powCache[miners[i]].GreaterThan(powCache[miners[j]])
|
||||
})
|
||||
n := sort.Search(len(miners), func(i int) bool {
|
||||
pow := powCache[miners[i]]
|
||||
log.Infof("pow @%d = %s", i, pow)
|
||||
return pow.IsZero()
|
||||
})
|
||||
miners = miners[:n]
|
||||
} else {
|
||||
for _, mS := range cctx.Args().Slice() {
|
||||
mA, err := address.NewFromString(mS)
|
||||
|
||||
@@ -2,7 +2,7 @@ version: '3'
|
||||
|
||||
services:
|
||||
influxdb:
|
||||
image: influxdb:latest
|
||||
image: influxdb:1.8
|
||||
container_name: influxdb
|
||||
ports:
|
||||
- "18086:8086"
|
||||
|
||||
+126
-20
@@ -2,18 +2,36 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
"github.com/filecoin-project/lotus/tools/stats"
|
||||
"github.com/filecoin-project/lotus/tools/stats/influx"
|
||||
"github.com/filecoin-project/lotus/tools/stats/ipldstore"
|
||||
"github.com/filecoin-project/lotus/tools/stats/metrics"
|
||||
"github.com/filecoin-project/lotus/tools/stats/points"
|
||||
"github.com/filecoin-project/lotus/tools/stats/sync"
|
||||
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"contrib.go.opencensus.io/exporter/prometheus"
|
||||
stats "go.opencensus.io/stats"
|
||||
"go.opencensus.io/stats/view"
|
||||
)
|
||||
|
||||
var log = logging.Logger("stats")
|
||||
|
||||
func init() {
|
||||
if err := view.Register(metrics.DefaultViews...); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
local := []*cli.Command{
|
||||
runCmd,
|
||||
@@ -37,7 +55,7 @@ func main() {
|
||||
},
|
||||
},
|
||||
Before: func(cctx *cli.Context) error {
|
||||
return logging.SetLogLevel("stats", cctx.String("log-level"))
|
||||
return logging.SetLogLevelRegex("stats/*", cctx.String("log-level"))
|
||||
},
|
||||
Commands: local,
|
||||
}
|
||||
@@ -104,6 +122,12 @@ var runCmd = &cli.Command{
|
||||
Usage: "do not wait for chain sync to complete",
|
||||
Value: false,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "ipld-store-cache-size",
|
||||
Usage: "size of lru cache for ChainReadObj",
|
||||
EnvVars: []string{"LOTUS_STATS_IPLD_STORE_CACHE_SIZE"},
|
||||
Value: 2 << 15,
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
ctx := context.Background()
|
||||
@@ -118,30 +142,35 @@ var runCmd = &cli.Command{
|
||||
influxPasswordFlag := cctx.String("influx-password")
|
||||
influxDatabaseFlag := cctx.String("influx-database")
|
||||
|
||||
ipldStoreCacheSizeFlag := cctx.Int("ipld-store-cache-size")
|
||||
|
||||
log.Infow("opening influx client", "hostname", influxHostnameFlag, "username", influxUsernameFlag, "database", influxDatabaseFlag)
|
||||
|
||||
influx, err := stats.InfluxClient(influxHostnameFlag, influxUsernameFlag, influxPasswordFlag)
|
||||
influxClient, err := influx.NewClient(influxHostnameFlag, influxUsernameFlag, influxPasswordFlag)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return err
|
||||
}
|
||||
|
||||
exporter, err := prometheus.NewExporter(prometheus.Options{
|
||||
Namespace: "lotus_stats",
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
go func() {
|
||||
http.Handle("/metrics", exporter)
|
||||
if err := http.ListenAndServe(":6688", nil); err != nil {
|
||||
log.Errorw("failed to start http server", "err", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if resetFlag {
|
||||
if err := stats.ResetDatabase(influx, influxDatabaseFlag); err != nil {
|
||||
log.Fatal(err)
|
||||
if err := influx.ResetDatabase(influxClient, influxDatabaseFlag); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
height := int64(heightFlag)
|
||||
|
||||
if !resetFlag && height == 0 {
|
||||
h, err := stats.GetLastRecordedHeight(influx, influxDatabaseFlag)
|
||||
if err != nil {
|
||||
log.Info(err)
|
||||
}
|
||||
|
||||
height = h
|
||||
}
|
||||
|
||||
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -149,12 +178,89 @@ var runCmd = &cli.Command{
|
||||
defer closer()
|
||||
|
||||
if !noSyncFlag {
|
||||
if err := stats.WaitForSyncComplete(ctx, api); err != nil {
|
||||
log.Fatal(err)
|
||||
if err := sync.SyncWait(ctx, api); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
stats.Collect(ctx, api, influx, influxDatabaseFlag, height, headLagFlag)
|
||||
gtp, err := api.ChainGetGenesis(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
genesisTime := time.Unix(int64(gtp.MinTimestamp()), 0)
|
||||
|
||||
// When height is set to `0` we will resume from the best height we can.
|
||||
// The goal is to ensure we have data in the last 60 tipsets
|
||||
height := int64(heightFlag)
|
||||
if !resetFlag && height == 0 {
|
||||
lastHeight, err := influx.GetLastRecordedHeight(influxClient, influxDatabaseFlag)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sinceGenesis := build.Clock.Now().Sub(genesisTime)
|
||||
expectedHeight := int64(sinceGenesis.Seconds()) / int64(build.BlockDelaySecs)
|
||||
|
||||
startOfWindowHeight := expectedHeight - 60
|
||||
|
||||
if lastHeight > startOfWindowHeight {
|
||||
height = lastHeight
|
||||
} else {
|
||||
height = startOfWindowHeight
|
||||
}
|
||||
|
||||
ts, err := api.ChainHead(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
headHeight := int64(ts.Height())
|
||||
if headHeight < height {
|
||||
height = headHeight
|
||||
}
|
||||
}
|
||||
|
||||
go func() {
|
||||
t := time.NewTicker(time.Second)
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-t.C:
|
||||
sinceGenesis := build.Clock.Now().Sub(genesisTime)
|
||||
expectedHeight := int64(sinceGenesis.Seconds()) / int64(build.BlockDelaySecs)
|
||||
|
||||
stats.Record(ctx, metrics.TipsetCollectionHeightExpected.M(expectedHeight))
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
store, err := ipldstore.NewApiIpldStore(ctx, api, ipldStoreCacheSizeFlag)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collector, err := points.NewChainPointCollector(ctx, store, api)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tipsets, err := sync.BufferedTipsetChannel(ctx, api, abi.ChainEpoch(height), headLagFlag)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
wq := influx.NewWriteQueue(ctx, influxClient)
|
||||
defer wq.Close()
|
||||
|
||||
for tipset := range tipsets {
|
||||
if nb, err := collector.Collect(ctx, tipset); err != nil {
|
||||
log.Warnw("failed to collect points", "err", err)
|
||||
} else {
|
||||
nb.SetDatabase(influxDatabaseFlag)
|
||||
wq.AddBatch(nb)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
"github.com/filecoin-project/lotus/lib/lotuslog"
|
||||
"github.com/filecoin-project/lotus/metrics"
|
||||
"github.com/filecoin-project/lotus/metrics/proxy"
|
||||
"github.com/filecoin-project/lotus/node/modules"
|
||||
"github.com/filecoin-project/lotus/node/repo"
|
||||
)
|
||||
@@ -204,7 +205,7 @@ var runCmd = &cli.Command{
|
||||
w = &LoggedWallet{under: w}
|
||||
}
|
||||
|
||||
rpcApi := metrics.MetricedWalletAPI(w)
|
||||
rpcApi := proxy.MetricedWalletAPI(w)
|
||||
if !cctx.Bool("disable-auth") {
|
||||
rpcApi = api.PermissionedWalletAPI(rpcApi)
|
||||
}
|
||||
|
||||
@@ -67,6 +67,12 @@ func main() {
|
||||
Version: build.UserVersion(),
|
||||
EnableBashCompletion: true,
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "panic-reports",
|
||||
EnvVars: []string{"LOTUS_PANIC_REPORT_PATH"},
|
||||
Hidden: true,
|
||||
Value: "~/.lotus", // should follow --repo default
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "repo",
|
||||
EnvVars: []string{"LOTUS_PATH"},
|
||||
@@ -84,6 +90,14 @@ func main() {
|
||||
},
|
||||
cliutil.FlagVeryVerbose,
|
||||
},
|
||||
After: func(c *cli.Context) error {
|
||||
if r := recover(); r != nil {
|
||||
// Generate report in LOTUS_PATH and re-raise panic
|
||||
build.GeneratePanicReport(c.String("panic-reports"), c.String("repo"), c.App.Name)
|
||||
panic(r)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
||||
Commands: append(local, lcli.Commands...),
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ services:
|
||||
# - FULLNODE_API_INFO=/dns/lotus/tcp/1234/http
|
||||
# - LOTUS_JAEGER_AGENT_HOST=jaeger
|
||||
# - LOTUS_JAEGER_AGENT_PORT=6831
|
||||
# - DOCKER_LOTUS_MINER_INIT=true
|
||||
# deploy:
|
||||
# restart_policy:
|
||||
# condition: on-failure
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
* [MarketPendingDeals](#MarketPendingDeals)
|
||||
* [MarketPublishPendingDeals](#MarketPublishPendingDeals)
|
||||
* [MarketRestartDataTransfer](#MarketRestartDataTransfer)
|
||||
* [MarketRetryPublishDeal](#MarketRetryPublishDeal)
|
||||
* [MarketSetAsk](#MarketSetAsk)
|
||||
* [MarketSetRetrievalAsk](#MarketSetRetrievalAsk)
|
||||
* [Mining](#Mining)
|
||||
@@ -949,6 +950,22 @@ Inputs:
|
||||
|
||||
Response: `{}`
|
||||
|
||||
### MarketRetryPublishDeal
|
||||
|
||||
|
||||
Perms: admin
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
Response: `{}`
|
||||
|
||||
### MarketSetAsk
|
||||
|
||||
|
||||
@@ -2131,7 +2148,9 @@ Inputs:
|
||||
"Weight": 42,
|
||||
"MaxStorage": 42,
|
||||
"CanSeal": true,
|
||||
"CanStore": true
|
||||
"CanStore": true,
|
||||
"Groups": null,
|
||||
"AllowTo": null
|
||||
},
|
||||
{
|
||||
"Capacity": 9,
|
||||
@@ -2241,7 +2260,9 @@ Response:
|
||||
"Weight": 42,
|
||||
"MaxStorage": 42,
|
||||
"CanSeal": true,
|
||||
"CanStore": true
|
||||
"CanStore": true,
|
||||
"Groups": null,
|
||||
"AllowTo": null
|
||||
}
|
||||
```
|
||||
|
||||
@@ -2432,18 +2453,595 @@ Response:
|
||||
"IgnoreResources": false,
|
||||
"Resources": {
|
||||
"MemPhysical": 274877906944,
|
||||
"MemUsed": 2147483648,
|
||||
"MemSwap": 128849018880,
|
||||
"MemReserved": 2147483648,
|
||||
"MemSwapUsed": 2147483648,
|
||||
"CPUs": 64,
|
||||
"GPUs": [
|
||||
"aGPU 1337"
|
||||
]
|
||||
],
|
||||
"Resources": {
|
||||
"seal/v0/addpiece": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 4294967296,
|
||||
"MaxMemory": 4294967296,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 8589934592,
|
||||
"MaxMemory": 8589934592,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 4294967296,
|
||||
"MaxMemory": 4294967296,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 8589934592,
|
||||
"MaxMemory": 8589934592,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
}
|
||||
},
|
||||
"seal/v0/commit/1": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
}
|
||||
},
|
||||
"seal/v0/commit/2": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1610612736,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10737418240
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 32212254720,
|
||||
"MaxMemory": 161061273600,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 34359738368
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 64424509440,
|
||||
"MaxMemory": 204010946560,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 68719476736
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1610612736,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10737418240
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 32212254720,
|
||||
"MaxMemory": 161061273600,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 34359738368
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 64424509440,
|
||||
"MaxMemory": 204010946560,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 68719476736
|
||||
}
|
||||
},
|
||||
"seal/v0/fetch": {
|
||||
"0": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
}
|
||||
},
|
||||
"seal/v0/precommit/1": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 805306368,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1048576
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 60129542144,
|
||||
"MaxMemory": 68719476736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 120259084288,
|
||||
"MaxMemory": 137438953472,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 805306368,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1048576
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 60129542144,
|
||||
"MaxMemory": 68719476736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 120259084288,
|
||||
"MaxMemory": 137438953472,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
}
|
||||
},
|
||||
"seal/v0/precommit/2": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1610612736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 16106127360,
|
||||
"MaxMemory": 16106127360,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 32212254720,
|
||||
"MaxMemory": 32212254720,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1610612736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 16106127360,
|
||||
"MaxMemory": 16106127360,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 32212254720,
|
||||
"MaxMemory": 32212254720,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 1073741824
|
||||
}
|
||||
},
|
||||
"seal/v0/unseal": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 805306368,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1048576
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 60129542144,
|
||||
"MaxMemory": 68719476736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 120259084288,
|
||||
"MaxMemory": 137438953472,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 805306368,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1048576
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 60129542144,
|
||||
"MaxMemory": 68719476736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 120259084288,
|
||||
"MaxMemory": 137438953472,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Enabled": true,
|
||||
"MemUsedMin": 0,
|
||||
"MemUsedMax": 0,
|
||||
"GpuUsed": false,
|
||||
"GpuUsed": 0,
|
||||
"CpuUse": 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,10 +92,587 @@ Response:
|
||||
"IgnoreResources": true,
|
||||
"Resources": {
|
||||
"MemPhysical": 42,
|
||||
"MemUsed": 42,
|
||||
"MemSwap": 42,
|
||||
"MemReserved": 42,
|
||||
"MemSwapUsed": 42,
|
||||
"CPUs": 42,
|
||||
"GPUs": null
|
||||
"GPUs": null,
|
||||
"Resources": {
|
||||
"seal/v0/addpiece": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 4294967296,
|
||||
"MaxMemory": 4294967296,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 8589934592,
|
||||
"MaxMemory": 8589934592,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 4294967296,
|
||||
"MaxMemory": 4294967296,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 8589934592,
|
||||
"MaxMemory": 8589934592,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
}
|
||||
},
|
||||
"seal/v0/commit/1": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
}
|
||||
},
|
||||
"seal/v0/commit/2": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1610612736,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10737418240
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 32212254720,
|
||||
"MaxMemory": 161061273600,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 34359738368
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 64424509440,
|
||||
"MaxMemory": 204010946560,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 68719476736
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1610612736,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10737418240
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 32212254720,
|
||||
"MaxMemory": 161061273600,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 34359738368
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 64424509440,
|
||||
"MaxMemory": 204010946560,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 68719476736
|
||||
}
|
||||
},
|
||||
"seal/v0/fetch": {
|
||||
"0": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 1048576,
|
||||
"MaxMemory": 1048576,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 0,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 0
|
||||
}
|
||||
},
|
||||
"seal/v0/precommit/1": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 805306368,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1048576
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 60129542144,
|
||||
"MaxMemory": 68719476736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 120259084288,
|
||||
"MaxMemory": 137438953472,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 805306368,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1048576
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 60129542144,
|
||||
"MaxMemory": 68719476736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 120259084288,
|
||||
"MaxMemory": 137438953472,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
}
|
||||
},
|
||||
"seal/v0/precommit/2": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1610612736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 16106127360,
|
||||
"MaxMemory": 16106127360,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 32212254720,
|
||||
"MaxMemory": 32212254720,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 1073741824,
|
||||
"MaxMemory": 1610612736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 16106127360,
|
||||
"MaxMemory": 16106127360,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 1073741824
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 32212254720,
|
||||
"MaxMemory": 32212254720,
|
||||
"GPUUtilization": 1,
|
||||
"MaxParallelism": -1,
|
||||
"MaxParallelismGPU": 6,
|
||||
"BaseMinMemory": 1073741824
|
||||
}
|
||||
},
|
||||
"seal/v0/unseal": {
|
||||
"0": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"1": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"2": {
|
||||
"MinMemory": 805306368,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1048576
|
||||
},
|
||||
"3": {
|
||||
"MinMemory": 60129542144,
|
||||
"MaxMemory": 68719476736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"4": {
|
||||
"MinMemory": 120259084288,
|
||||
"MaxMemory": 137438953472,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"5": {
|
||||
"MinMemory": 2048,
|
||||
"MaxMemory": 2048,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 2048
|
||||
},
|
||||
"6": {
|
||||
"MinMemory": 8388608,
|
||||
"MaxMemory": 8388608,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 8388608
|
||||
},
|
||||
"7": {
|
||||
"MinMemory": 805306368,
|
||||
"MaxMemory": 1073741824,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 1048576
|
||||
},
|
||||
"8": {
|
||||
"MinMemory": 60129542144,
|
||||
"MaxMemory": 68719476736,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
},
|
||||
"9": {
|
||||
"MinMemory": 120259084288,
|
||||
"MaxMemory": 137438953472,
|
||||
"GPUUtilization": 0,
|
||||
"MaxParallelism": 1,
|
||||
"MaxParallelismGPU": 0,
|
||||
"BaseMinMemory": 10485760
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1269,7 +1269,8 @@ Response:
|
||||
"Stages": {
|
||||
"Stages": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"Event": 5
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1469,6 +1470,7 @@ Inputs:
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
"Piece": null,
|
||||
"DatamodelPathSelector": "Links/21/Hash/Links/42/Hash",
|
||||
"Size": 42,
|
||||
"FromLocalCAR": "string value",
|
||||
"Total": "0",
|
||||
@@ -1523,6 +1525,7 @@ Inputs:
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
"Piece": null,
|
||||
"DatamodelPathSelector": "Links/21/Hash/Links/42/Hash",
|
||||
"Size": 42,
|
||||
"FromLocalCAR": "string value",
|
||||
"Total": "0",
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
* [ClientDataTransferUpdates](#ClientDataTransferUpdates)
|
||||
* [ClientDealPieceCID](#ClientDealPieceCID)
|
||||
* [ClientDealSize](#ClientDealSize)
|
||||
* [ClientExport](#ClientExport)
|
||||
* [ClientFindData](#ClientFindData)
|
||||
* [ClientGenCar](#ClientGenCar)
|
||||
* [ClientGetDealInfo](#ClientGetDealInfo)
|
||||
@@ -59,7 +60,7 @@
|
||||
* [ClientRestartDataTransfer](#ClientRestartDataTransfer)
|
||||
* [ClientRetrieve](#ClientRetrieve)
|
||||
* [ClientRetrieveTryRestartInsufficientFunds](#ClientRetrieveTryRestartInsufficientFunds)
|
||||
* [ClientRetrieveWithEvents](#ClientRetrieveWithEvents)
|
||||
* [ClientRetrieveWait](#ClientRetrieveWait)
|
||||
* [ClientStartDeal](#ClientStartDeal)
|
||||
* [ClientStatelessDeal](#ClientStatelessDeal)
|
||||
* [Create](#Create)
|
||||
@@ -108,6 +109,7 @@
|
||||
* [MsigApprove](#MsigApprove)
|
||||
* [MsigApproveTxnHash](#MsigApproveTxnHash)
|
||||
* [MsigCancel](#MsigCancel)
|
||||
* [MsigCancelTxnHash](#MsigCancelTxnHash)
|
||||
* [MsigCreate](#MsigCreate)
|
||||
* [MsigGetAvailableBalance](#MsigGetAvailableBalance)
|
||||
* [MsigGetPending](#MsigGetPending)
|
||||
@@ -1054,6 +1056,32 @@ Response:
|
||||
}
|
||||
```
|
||||
|
||||
### ClientExport
|
||||
ClientExport exports a file stored in the local filestore to a system file
|
||||
|
||||
|
||||
Perms: admin
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"Root": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
"DAGs": null,
|
||||
"FromLocalCAR": "string value",
|
||||
"DealID": 5
|
||||
},
|
||||
{
|
||||
"Path": "string value",
|
||||
"IsCAR": true
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
Response: `{}`
|
||||
|
||||
### ClientFindData
|
||||
ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer).
|
||||
|
||||
@@ -1281,7 +1309,8 @@ Response:
|
||||
"Stages": {
|
||||
"Stages": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"Event": 5
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1481,8 +1510,8 @@ Inputs:
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
"Piece": null,
|
||||
"DataSelector": "Links/21/Hash/Links/42/Hash",
|
||||
"Size": 42,
|
||||
"FromLocalCAR": "string value",
|
||||
"Total": "0",
|
||||
"UnsealPrice": "0",
|
||||
"PaymentInterval": 42,
|
||||
@@ -1494,15 +1523,16 @@ Inputs:
|
||||
"ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
|
||||
"PieceCID": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "string value",
|
||||
"IsCAR": true
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
Response: `{}`
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"DealID": 5
|
||||
}
|
||||
```
|
||||
|
||||
### ClientRetrieveTryRestartInsufficientFunds
|
||||
ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel
|
||||
@@ -1520,9 +1550,8 @@ Inputs:
|
||||
|
||||
Response: `{}`
|
||||
|
||||
### ClientRetrieveWithEvents
|
||||
ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
|
||||
of status updates.
|
||||
### ClientRetrieveWait
|
||||
ClientRetrieveWait waits for retrieval to be complete
|
||||
|
||||
|
||||
Perms: admin
|
||||
@@ -1530,42 +1559,11 @@ Perms: admin
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"Root": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
"Piece": null,
|
||||
"Size": 42,
|
||||
"FromLocalCAR": "string value",
|
||||
"Total": "0",
|
||||
"UnsealPrice": "0",
|
||||
"PaymentInterval": 42,
|
||||
"PaymentIntervalIncrease": 42,
|
||||
"Client": "f01234",
|
||||
"Miner": "f01234",
|
||||
"MinerPeer": {
|
||||
"Address": "f01234",
|
||||
"ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
|
||||
"PieceCID": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "string value",
|
||||
"IsCAR": true
|
||||
}
|
||||
5
|
||||
]
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"Event": 5,
|
||||
"Status": 0,
|
||||
"BytesReceived": 42,
|
||||
"FundsSpent": "0",
|
||||
"Err": "string value"
|
||||
}
|
||||
```
|
||||
Response: `{}`
|
||||
|
||||
### ClientStartDeal
|
||||
ClientStartDeal proposes a deal with a miner.
|
||||
@@ -2700,6 +2698,44 @@ Response:
|
||||
|
||||
### MsigCancel
|
||||
MsigCancel cancels a previously-proposed multisig message
|
||||
It takes the following params: <multisig address>, <proposed transaction ID> <signer address>
|
||||
|
||||
|
||||
Perms: sign
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
"f01234",
|
||||
42,
|
||||
"f01234"
|
||||
]
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"Message": {
|
||||
"Version": 42,
|
||||
"To": "f01234",
|
||||
"From": "f01234",
|
||||
"Nonce": 42,
|
||||
"Value": "0",
|
||||
"GasLimit": 9,
|
||||
"GasFeeCap": "0",
|
||||
"GasPremium": "0",
|
||||
"Method": 1,
|
||||
"Params": "Ynl0ZSBhcnJheQ==",
|
||||
"CID": {
|
||||
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
|
||||
}
|
||||
},
|
||||
"ValidNonce": true
|
||||
}
|
||||
```
|
||||
|
||||
### MsigCancelTxnHash
|
||||
MsigCancel cancels a previously-proposed multisig message
|
||||
It takes the following params: <multisig address>, <proposed transaction ID>, <recipient address>, <value to transfer>,
|
||||
<sender address of the cancel msg>, <method to call in the proposed message>, <params to include in the proposed message>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ USAGE:
|
||||
lotus-miner [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1.12.0
|
||||
1.13.2
|
||||
|
||||
COMMANDS:
|
||||
init Initialize a lotus miner repo
|
||||
@@ -41,7 +41,7 @@ COMMANDS:
|
||||
sealing interact with sealing pipeline
|
||||
|
||||
GLOBAL OPTIONS:
|
||||
--actor value, -a value specify other actor to check state for (read only)
|
||||
--actor value, -a value specify other actor to query / manipulate
|
||||
--color use color in display output (default: depends on output being a TTY)
|
||||
--miner-repo value, --storagerepo value Specify miner repo path. flag(storagerepo) and env(LOTUS_STORAGE_PATH) are DEPRECATION, will REMOVE SOON (default: "~/.lotusminer") [$LOTUS_MINER_PATH, $LOTUS_STORAGE_PATH]
|
||||
--markets-repo value Markets repo path [$LOTUS_MARKETS_PATH]
|
||||
@@ -590,7 +590,8 @@ CATEGORY:
|
||||
DEVELOPER
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
--timeout value duration to wait till fail (default: 30s)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
@@ -629,6 +630,7 @@ COMMANDS:
|
||||
reset-blocklist Remove all entries from the miner's piece CID blocklist
|
||||
set-seal-duration Set the expected time, in minutes, that you expect sealing sectors to take. Deals that start before this duration will be rejected.
|
||||
pending-publish list deals waiting in publish queue
|
||||
retry-publish retry publishing a deal
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
OPTIONS:
|
||||
@@ -659,9 +661,10 @@ USAGE:
|
||||
lotus-miner storage-deals list [command options] [arguments...]
|
||||
|
||||
OPTIONS:
|
||||
--verbose, -v (default: false)
|
||||
--watch watch deal updates in real-time, rather than a one time list (default: false)
|
||||
--help, -h show help (default: false)
|
||||
--format value output format of data, supported: table, json (default: "table")
|
||||
--verbose, -v (default: false)
|
||||
--watch watch deal updates in real-time, rather than a one time list (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
@@ -824,6 +827,19 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus-miner storage-deals retry-publish
|
||||
```
|
||||
NAME:
|
||||
lotus-miner storage-deals retry-publish - retry publishing a deal
|
||||
|
||||
USAGE:
|
||||
lotus-miner storage-deals retry-publish [command options] <proposal CID>
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
## lotus-miner retrieval-deals
|
||||
```
|
||||
NAME:
|
||||
@@ -1444,7 +1460,8 @@ USAGE:
|
||||
lotus-miner pieces list-cids [command options] [arguments...]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
--verbose, -v (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
@@ -1533,13 +1550,14 @@ USAGE:
|
||||
lotus-miner sectors list [command options] [arguments...]
|
||||
|
||||
OPTIONS:
|
||||
--show-removed show removed sectors (default: false)
|
||||
--color, -c use color in display output (default: depends on output being a TTY)
|
||||
--fast don't show on-chain info for better performance (default: false)
|
||||
--events display number of events the sector has received (default: false)
|
||||
--seal-time display how long it took for the sector to be sealed (default: false)
|
||||
--states value filter sectors by a comma-separated list of states
|
||||
--help, -h show help (default: false)
|
||||
--show-removed, -r show removed sectors (default: false)
|
||||
--color, -c use color in display output (default: depends on output being a TTY)
|
||||
--fast, -f don't show on-chain info for better performance (default: false)
|
||||
--events, -e display number of events the sector has received (default: false)
|
||||
--seal-time display how long it took for the sector to be sealed (default: false)
|
||||
--states value filter sectors by a comma-separated list of states
|
||||
--unproven, -u only show sectors which aren't in the 'Proving' state (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
@@ -1897,9 +1915,10 @@ USAGE:
|
||||
lotus-miner proving check [command options] <deadlineIdx>
|
||||
|
||||
OPTIONS:
|
||||
--only-bad print only bad sectors (default: false)
|
||||
--slow run slower checks (default: false)
|
||||
--help, -h show help (default: false)
|
||||
--only-bad print only bad sectors (default: false)
|
||||
--slow run slower checks (default: false)
|
||||
--storage-id value filter sectors by storage path (path id)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
@@ -1965,6 +1984,8 @@ OPTIONS:
|
||||
--seal (for init) use path for sealing (default: false)
|
||||
--store (for init) use path for long-term storage (default: false)
|
||||
--max-storage value (for init) limit storage space for sectors (expensive for very large paths!)
|
||||
--groups value path group names
|
||||
--allow-to value path groups allowed to pull data from this path (allow all if not specified)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@ USAGE:
|
||||
lotus-worker [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1.12.0
|
||||
1.13.2
|
||||
|
||||
COMMANDS:
|
||||
run Start lotus worker
|
||||
@@ -15,6 +15,7 @@ COMMANDS:
|
||||
storage manage sector storage
|
||||
set Manage worker settings
|
||||
wait-quiet Block until all running tasks exit
|
||||
resources Manage resource table overrides
|
||||
tasks Manage task processing
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
@@ -94,6 +95,8 @@ OPTIONS:
|
||||
--seal (for init) use path for sealing (default: false)
|
||||
--store (for init) use path for long-term storage (default: false)
|
||||
--max-storage value (for init) limit storage space for sectors (expensive for very large paths!)
|
||||
--groups value path group names
|
||||
--allow-to value path groups allowed to pull data from this path (allow all if not specified)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
@@ -125,6 +128,21 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
## lotus-worker resources
|
||||
```
|
||||
NAME:
|
||||
lotus-worker resources - Manage resource table overrides
|
||||
|
||||
USAGE:
|
||||
lotus-worker resources [command options] [arguments...]
|
||||
|
||||
OPTIONS:
|
||||
--all print all resource envvars (default: false)
|
||||
--default print default resource envvars (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
## lotus-worker tasks
|
||||
```
|
||||
NAME:
|
||||
|
||||
+130
-19
@@ -7,7 +7,7 @@ USAGE:
|
||||
lotus [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1.12.0
|
||||
1.13.2
|
||||
|
||||
COMMANDS:
|
||||
daemon Start a lotus daemon process
|
||||
@@ -426,6 +426,8 @@ COMMANDS:
|
||||
RETRIEVAL:
|
||||
find Find data in the network
|
||||
retrieve Retrieve data from network
|
||||
cat Show data from network
|
||||
ls List object links
|
||||
cancel-retrieval Cancel a retrieval deal by deal ID; this also cancels the associated transfer
|
||||
list-retrievals List retrieval market deals
|
||||
STORAGE:
|
||||
@@ -544,14 +546,97 @@ USAGE:
|
||||
CATEGORY:
|
||||
RETRIEVAL
|
||||
|
||||
DESCRIPTION:
|
||||
Retrieve data from the Filecoin network.
|
||||
|
||||
The retrieve command will attempt to find a provider make a retrieval deal with
|
||||
them. In case a provider can't be found, it can be specified with the --provider
|
||||
flag.
|
||||
|
||||
By default the data will be interpreted as DAG-PB UnixFSv1 File. Alternatively
|
||||
a CAR file containing the raw IPLD graph can be exported by setting the --car
|
||||
flag.
|
||||
|
||||
Partial Retrieval:
|
||||
|
||||
The --data-selector flag can be used to specify a sub-graph to fetch. The
|
||||
selector can be specified as either IPLD datamodel text-path selector, or IPLD
|
||||
json selector.
|
||||
|
||||
In case of unixfs retrieval, the selector must point at a single root node, and
|
||||
match the entire graph under that node.
|
||||
|
||||
In case of CAR retrieval, the selector must have one common "sub-root" node.
|
||||
|
||||
Examples:
|
||||
|
||||
- Retrieve a file by CID
|
||||
$ lotus client retrieve Qm... my-file.txt
|
||||
|
||||
- Retrieve a file by CID from f0123
|
||||
$ lotus client retrieve --provider f0123 Qm... my-file.txt
|
||||
|
||||
- Retrieve a first file from a specified directory
|
||||
$ lotus client retrieve --data-selector /Links/0/Hash Qm... my-file.txt
|
||||
|
||||
|
||||
OPTIONS:
|
||||
--from value address to send transactions from
|
||||
--car export to a car file instead of a regular file (default: false)
|
||||
--miner value miner address for retrieval, if not present it'll use local discovery
|
||||
--maxPrice value maximum price the client is willing to consider (default: 0.01 FIL)
|
||||
--pieceCid value require data to be retrieved from a specific Piece CID
|
||||
--allow-local (default: false)
|
||||
--help, -h show help (default: false)
|
||||
--car Export to a car file instead of a regular file (default: false)
|
||||
--data-selector value, --datamodel-path-selector value IPLD datamodel text-path selector, or IPLD json selector
|
||||
--car-export-merkle-proof (requires --data-selector and --car) Export data-selector merkle proof (default: false)
|
||||
--from value address to send transactions from
|
||||
--provider value, --miner value provider to use for retrieval, if not present it'll use local discovery
|
||||
--maxPrice value maximum price the client is willing to consider (default: 0 FIL)
|
||||
--pieceCid value require data to be retrieved from a specific Piece CID
|
||||
--allow-local (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus client cat
|
||||
```
|
||||
NAME:
|
||||
lotus client cat - Show data from network
|
||||
|
||||
USAGE:
|
||||
lotus client cat [command options] [dataCid]
|
||||
|
||||
CATEGORY:
|
||||
RETRIEVAL
|
||||
|
||||
OPTIONS:
|
||||
--ipld list IPLD datamodel links (default: false)
|
||||
--data-selector value IPLD datamodel text-path selector, or IPLD json selector
|
||||
--from value address to send transactions from
|
||||
--provider value, --miner value provider to use for retrieval, if not present it'll use local discovery
|
||||
--maxPrice value maximum price the client is willing to consider (default: 0 FIL)
|
||||
--pieceCid value require data to be retrieved from a specific Piece CID
|
||||
--allow-local (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus client ls
|
||||
```
|
||||
NAME:
|
||||
lotus client ls - List object links
|
||||
|
||||
USAGE:
|
||||
lotus client ls [command options] [dataCid]
|
||||
|
||||
CATEGORY:
|
||||
RETRIEVAL
|
||||
|
||||
OPTIONS:
|
||||
--ipld list IPLD datamodel links (default: false)
|
||||
--depth value list links recursively up to the specified depth (default: 1)
|
||||
--data-selector value IPLD datamodel text-path selector, or IPLD json selector
|
||||
--from value address to send transactions from
|
||||
--provider value, --miner value provider to use for retrieval, if not present it'll use local discovery
|
||||
--maxPrice value maximum price the client is willing to consider (default: 0 FIL)
|
||||
--pieceCid value require data to be retrieved from a specific Piece CID
|
||||
--allow-local (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
@@ -856,6 +941,7 @@ COMMANDS:
|
||||
propose Propose a multisig transaction
|
||||
propose-remove Propose to remove a signer
|
||||
approve Approve a multisig message
|
||||
cancel Cancel a multisig message
|
||||
add-propose Propose to add a signer
|
||||
add-approve Approve a message to add a signer
|
||||
add-cancel Cancel a message to add a signer
|
||||
@@ -951,6 +1037,20 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus msig cancel
|
||||
```
|
||||
NAME:
|
||||
lotus msig cancel - Cancel a multisig message
|
||||
|
||||
USAGE:
|
||||
lotus msig cancel [command options] <multisigAddress messageId> [destination value [methodId methodParams]]
|
||||
|
||||
OPTIONS:
|
||||
--from value account to send the cancel message from
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus msig add-propose
|
||||
```
|
||||
NAME:
|
||||
@@ -1116,12 +1216,12 @@ USAGE:
|
||||
lotus filplus command [command options] [arguments...]
|
||||
|
||||
COMMANDS:
|
||||
grant-datacap give allowance to the specified verified client address
|
||||
list-notaries list all notaries
|
||||
list-clients list all verified clients
|
||||
check-client-datacap check verified client remaining bytes
|
||||
check-notaries-datacap check notaries remaining bytes
|
||||
help, h Shows a list of commands or help for one command
|
||||
grant-datacap give allowance to the specified verified client address
|
||||
list-notaries list all notaries
|
||||
list-clients list all verified clients
|
||||
check-client-datacap check verified client remaining bytes
|
||||
check-notary-datacap check a notary's remaining bytes
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
@@ -1182,13 +1282,13 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus filplus check-notaries-datacap
|
||||
### lotus filplus check-notary-datacap
|
||||
```
|
||||
NAME:
|
||||
lotus filplus check-notaries-datacap - check notaries remaining bytes
|
||||
lotus filplus check-notary-datacap - check a notary's remaining bytes
|
||||
|
||||
USAGE:
|
||||
lotus filplus check-notaries-datacap [command options] [arguments...]
|
||||
lotus filplus check-notary-datacap [command options] [arguments...]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
@@ -1579,8 +1679,18 @@ OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
# nage
|
||||
|
||||
### lotus mpool manage
|
||||
```
|
||||
NAME:
|
||||
lotus mpool manage -
|
||||
|
||||
USAGE:
|
||||
lotus mpool manage [command options] [arguments...]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
## lotus state
|
||||
@@ -2449,7 +2559,8 @@ CATEGORY:
|
||||
DEVELOPER
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
--timeout value duration to wait till fail (default: 30s)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
[API]
|
||||
# Binding address for the Lotus API
|
||||
#
|
||||
# type: string
|
||||
# env var: LOTUS_API_LISTENADDRESS
|
||||
#ListenAddress = "/ip4/127.0.0.1/tcp/1234/http"
|
||||
|
||||
# type: string
|
||||
# env var: LOTUS_API_REMOTELISTENADDRESS
|
||||
#RemoteListenAddress = ""
|
||||
|
||||
# type: Duration
|
||||
# env var: LOTUS_API_TIMEOUT
|
||||
#Timeout = "30s"
|
||||
|
||||
|
||||
[Backup]
|
||||
# Note that in case of metadata corruption it might be much harder to recover
|
||||
# your node if metadata log is disabled
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_BACKUP_DISABLEMETADATALOG
|
||||
#DisableMetadataLog = false
|
||||
|
||||
|
||||
[Libp2p]
|
||||
# Binding address for the libp2p host - 0 means random port.
|
||||
# Format: multiaddress; see https://multiformats.io/multiaddr/
|
||||
#
|
||||
# type: []string
|
||||
# env var: LOTUS_LIBP2P_LISTENADDRESSES
|
||||
#ListenAddresses = ["/ip4/0.0.0.0/tcp/0", "/ip6/::/tcp/0"]
|
||||
|
||||
# Addresses to explicitally announce to other peers. If not specified,
|
||||
# all interface addresses are announced
|
||||
# Format: multiaddress
|
||||
#
|
||||
# type: []string
|
||||
# env var: LOTUS_LIBP2P_ANNOUNCEADDRESSES
|
||||
#AnnounceAddresses = []
|
||||
|
||||
# Addresses to not announce
|
||||
# Format: multiaddress
|
||||
#
|
||||
# type: []string
|
||||
# env var: LOTUS_LIBP2P_NOANNOUNCEADDRESSES
|
||||
#NoAnnounceAddresses = []
|
||||
|
||||
# When not disabled (default), lotus asks NAT devices (e.g., routers), to
|
||||
# open up an external port and forward it to the port lotus is running on.
|
||||
# When this works (i.e., when your router supports NAT port forwarding),
|
||||
# it makes the local lotus node accessible from the public internet
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_LIBP2P_DISABLENATPORTMAP
|
||||
#DisableNatPortMap = false
|
||||
|
||||
# ConnMgrLow is the number of connections that the basic connection manager
|
||||
# will trim down to.
|
||||
#
|
||||
# type: uint
|
||||
# env var: LOTUS_LIBP2P_CONNMGRLOW
|
||||
#ConnMgrLow = 150
|
||||
|
||||
# ConnMgrHigh is the number of connections that, when exceeded, will trigger
|
||||
# a connection GC operation. Note: protected/recently formed connections don't
|
||||
# count towards this limit.
|
||||
#
|
||||
# type: uint
|
||||
# env var: LOTUS_LIBP2P_CONNMGRHIGH
|
||||
#ConnMgrHigh = 180
|
||||
|
||||
# ConnMgrGrace is a time duration that new connections are immune from being
|
||||
# closed by the connection manager.
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_LIBP2P_CONNMGRGRACE
|
||||
#ConnMgrGrace = "20s"
|
||||
|
||||
|
||||
[Pubsub]
|
||||
# Run the node in bootstrap-node mode
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_PUBSUB_BOOTSTRAPPER
|
||||
#Bootstrapper = false
|
||||
|
||||
# type: string
|
||||
# env var: LOTUS_PUBSUB_REMOTETRACER
|
||||
#RemoteTracer = ""
|
||||
|
||||
|
||||
[Client]
|
||||
# type: bool
|
||||
# env var: LOTUS_CLIENT_USEIPFS
|
||||
#UseIpfs = false
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_CLIENT_IPFSONLINEMODE
|
||||
#IpfsOnlineMode = false
|
||||
|
||||
# type: string
|
||||
# env var: LOTUS_CLIENT_IPFSMADDR
|
||||
#IpfsMAddr = ""
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_CLIENT_IPFSUSEFORRETRIEVAL
|
||||
#IpfsUseForRetrieval = false
|
||||
|
||||
# The maximum number of simultaneous data transfers between the client
|
||||
# and storage providers for storage deals
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_CLIENT_SIMULTANEOUSTRANSFERSFORSTORAGE
|
||||
#SimultaneousTransfersForStorage = 20
|
||||
|
||||
# The maximum number of simultaneous data transfers between the client
|
||||
# and storage providers for retrieval deals
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_CLIENT_SIMULTANEOUSTRANSFERSFORRETRIEVAL
|
||||
#SimultaneousTransfersForRetrieval = 20
|
||||
|
||||
|
||||
[Wallet]
|
||||
# type: string
|
||||
# env var: LOTUS_WALLET_REMOTEBACKEND
|
||||
#RemoteBackend = ""
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_WALLET_ENABLELEDGER
|
||||
#EnableLedger = false
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_WALLET_DISABLELOCAL
|
||||
#DisableLocal = false
|
||||
|
||||
|
||||
[Fees]
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_DEFAULTMAXFEE
|
||||
#DefaultMaxFee = "0.07 FIL"
|
||||
|
||||
|
||||
[Chainstore]
|
||||
# type: bool
|
||||
# env var: LOTUS_CHAINSTORE_ENABLESPLITSTORE
|
||||
#EnableSplitstore = false
|
||||
|
||||
[Chainstore.Splitstore]
|
||||
# ColdStoreType specifies the type of the coldstore.
|
||||
# It can be "universal" (default) or "discard" for discarding cold blocks.
|
||||
#
|
||||
# type: string
|
||||
# env var: LOTUS_CHAINSTORE_SPLITSTORE_COLDSTORETYPE
|
||||
#ColdStoreType = "universal"
|
||||
|
||||
# HotStoreType specifies the type of the hotstore.
|
||||
# Only currently supported value is "badger".
|
||||
#
|
||||
# type: string
|
||||
# env var: LOTUS_CHAINSTORE_SPLITSTORE_HOTSTORETYPE
|
||||
#HotStoreType = "badger"
|
||||
|
||||
# MarkSetType specifies the type of the markset.
|
||||
# It can be "map" (default) for in memory marking or "badger" for on-disk marking.
|
||||
#
|
||||
# type: string
|
||||
# env var: LOTUS_CHAINSTORE_SPLITSTORE_MARKSETTYPE
|
||||
#MarkSetType = "map"
|
||||
|
||||
# HotStoreMessageRetention specifies the retention policy for messages, in finalities beyond
|
||||
# the compaction boundary; default is 0.
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_CHAINSTORE_SPLITSTORE_HOTSTOREMESSAGERETENTION
|
||||
#HotStoreMessageRetention = 0
|
||||
|
||||
# HotStoreFullGCFrequency specifies how often to perform a full (moving) GC on the hotstore.
|
||||
# A value of 0 disables, while a value 1 will do full GC in every compaction.
|
||||
# Default is 20 (about once a week).
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_CHAINSTORE_SPLITSTORE_HOTSTOREFULLGCFREQUENCY
|
||||
#HotStoreFullGCFrequency = 20
|
||||
|
||||
|
||||
@@ -0,0 +1,552 @@
|
||||
[API]
|
||||
# Binding address for the Lotus API
|
||||
#
|
||||
# type: string
|
||||
# env var: LOTUS_API_LISTENADDRESS
|
||||
#ListenAddress = "/ip4/127.0.0.1/tcp/2345/http"
|
||||
|
||||
# type: string
|
||||
# env var: LOTUS_API_REMOTELISTENADDRESS
|
||||
#RemoteListenAddress = "127.0.0.1:2345"
|
||||
|
||||
# type: Duration
|
||||
# env var: LOTUS_API_TIMEOUT
|
||||
#Timeout = "30s"
|
||||
|
||||
|
||||
[Backup]
|
||||
# Note that in case of metadata corruption it might be much harder to recover
|
||||
# your node if metadata log is disabled
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_BACKUP_DISABLEMETADATALOG
|
||||
#DisableMetadataLog = false
|
||||
|
||||
|
||||
[Libp2p]
|
||||
# Binding address for the libp2p host - 0 means random port.
|
||||
# Format: multiaddress; see https://multiformats.io/multiaddr/
|
||||
#
|
||||
# type: []string
|
||||
# env var: LOTUS_LIBP2P_LISTENADDRESSES
|
||||
#ListenAddresses = ["/ip4/0.0.0.0/tcp/0", "/ip6/::/tcp/0"]
|
||||
|
||||
# Addresses to explicitally announce to other peers. If not specified,
|
||||
# all interface addresses are announced
|
||||
# Format: multiaddress
|
||||
#
|
||||
# type: []string
|
||||
# env var: LOTUS_LIBP2P_ANNOUNCEADDRESSES
|
||||
#AnnounceAddresses = []
|
||||
|
||||
# Addresses to not announce
|
||||
# Format: multiaddress
|
||||
#
|
||||
# type: []string
|
||||
# env var: LOTUS_LIBP2P_NOANNOUNCEADDRESSES
|
||||
#NoAnnounceAddresses = []
|
||||
|
||||
# When not disabled (default), lotus asks NAT devices (e.g., routers), to
|
||||
# open up an external port and forward it to the port lotus is running on.
|
||||
# When this works (i.e., when your router supports NAT port forwarding),
|
||||
# it makes the local lotus node accessible from the public internet
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_LIBP2P_DISABLENATPORTMAP
|
||||
#DisableNatPortMap = false
|
||||
|
||||
# ConnMgrLow is the number of connections that the basic connection manager
|
||||
# will trim down to.
|
||||
#
|
||||
# type: uint
|
||||
# env var: LOTUS_LIBP2P_CONNMGRLOW
|
||||
#ConnMgrLow = 150
|
||||
|
||||
# ConnMgrHigh is the number of connections that, when exceeded, will trigger
|
||||
# a connection GC operation. Note: protected/recently formed connections don't
|
||||
# count towards this limit.
|
||||
#
|
||||
# type: uint
|
||||
# env var: LOTUS_LIBP2P_CONNMGRHIGH
|
||||
#ConnMgrHigh = 180
|
||||
|
||||
# ConnMgrGrace is a time duration that new connections are immune from being
|
||||
# closed by the connection manager.
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_LIBP2P_CONNMGRGRACE
|
||||
#ConnMgrGrace = "20s"
|
||||
|
||||
|
||||
[Pubsub]
|
||||
# Run the node in bootstrap-node mode
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_PUBSUB_BOOTSTRAPPER
|
||||
#Bootstrapper = false
|
||||
|
||||
# type: string
|
||||
# env var: LOTUS_PUBSUB_REMOTETRACER
|
||||
#RemoteTracer = ""
|
||||
|
||||
|
||||
[Subsystems]
|
||||
# type: bool
|
||||
# env var: LOTUS_SUBSYSTEMS_ENABLEMINING
|
||||
#EnableMining = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_SUBSYSTEMS_ENABLESEALING
|
||||
#EnableSealing = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_SUBSYSTEMS_ENABLESECTORSTORAGE
|
||||
#EnableSectorStorage = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_SUBSYSTEMS_ENABLEMARKETS
|
||||
#EnableMarkets = true
|
||||
|
||||
# type: string
|
||||
# env var: LOTUS_SUBSYSTEMS_SEALERAPIINFO
|
||||
#SealerApiInfo = ""
|
||||
|
||||
# type: string
|
||||
# env var: LOTUS_SUBSYSTEMS_SECTORINDEXAPIINFO
|
||||
#SectorIndexApiInfo = ""
|
||||
|
||||
|
||||
[Dealmaking]
|
||||
# When enabled, the miner can accept online deals
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_DEALMAKING_CONSIDERONLINESTORAGEDEALS
|
||||
#ConsiderOnlineStorageDeals = true
|
||||
|
||||
# When enabled, the miner can accept offline deals
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_DEALMAKING_CONSIDEROFFLINESTORAGEDEALS
|
||||
#ConsiderOfflineStorageDeals = true
|
||||
|
||||
# When enabled, the miner can accept retrieval deals
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_DEALMAKING_CONSIDERONLINERETRIEVALDEALS
|
||||
#ConsiderOnlineRetrievalDeals = true
|
||||
|
||||
# When enabled, the miner can accept offline retrieval deals
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_DEALMAKING_CONSIDEROFFLINERETRIEVALDEALS
|
||||
#ConsiderOfflineRetrievalDeals = true
|
||||
|
||||
# When enabled, the miner can accept verified deals
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_DEALMAKING_CONSIDERVERIFIEDSTORAGEDEALS
|
||||
#ConsiderVerifiedStorageDeals = true
|
||||
|
||||
# When enabled, the miner can accept unverified deals
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_DEALMAKING_CONSIDERUNVERIFIEDSTORAGEDEALS
|
||||
#ConsiderUnverifiedStorageDeals = true
|
||||
|
||||
# A list of Data CIDs to reject when making deals
|
||||
#
|
||||
# type: []cid.Cid
|
||||
# env var: LOTUS_DEALMAKING_PIECECIDBLOCKLIST
|
||||
#PieceCidBlocklist = []
|
||||
|
||||
# Maximum expected amount of time getting the deal into a sealed sector will take
|
||||
# This includes the time the deal will need to get transferred and published
|
||||
# before being assigned to a sector
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_DEALMAKING_EXPECTEDSEALDURATION
|
||||
#ExpectedSealDuration = "24h0m0s"
|
||||
|
||||
# Maximum amount of time proposed deal StartEpoch can be in future
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_DEALMAKING_MAXDEALSTARTDELAY
|
||||
#MaxDealStartDelay = "336h0m0s"
|
||||
|
||||
# When a deal is ready to publish, the amount of time to wait for more
|
||||
# deals to be ready to publish before publishing them all as a batch
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_DEALMAKING_PUBLISHMSGPERIOD
|
||||
#PublishMsgPeriod = "1h0m0s"
|
||||
|
||||
# The maximum number of deals to include in a single PublishStorageDeals
|
||||
# message
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_DEALMAKING_MAXDEALSPERPUBLISHMSG
|
||||
#MaxDealsPerPublishMsg = 8
|
||||
|
||||
# The maximum collateral that the provider will put up against a deal,
|
||||
# as a multiplier of the minimum collateral bound
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_DEALMAKING_MAXPROVIDERCOLLATERALMULTIPLIER
|
||||
#MaxProviderCollateralMultiplier = 2
|
||||
|
||||
# The maximum allowed disk usage size in bytes of staging deals not yet
|
||||
# passed to the sealing node by the markets service. 0 is unlimited.
|
||||
#
|
||||
# type: int64
|
||||
# env var: LOTUS_DEALMAKING_MAXSTAGINGDEALSBYTES
|
||||
#MaxStagingDealsBytes = 0
|
||||
|
||||
# The maximum number of parallel online data transfers for storage deals
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_DEALMAKING_SIMULTANEOUSTRANSFERSFORSTORAGE
|
||||
#SimultaneousTransfersForStorage = 20
|
||||
|
||||
# The maximum number of parallel online data transfers for retrieval deals
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_DEALMAKING_SIMULTANEOUSTRANSFERSFORRETRIEVAL
|
||||
#SimultaneousTransfersForRetrieval = 20
|
||||
|
||||
# Minimum start epoch buffer to give time for sealing of sector with deal.
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_DEALMAKING_STARTEPOCHSEALINGBUFFER
|
||||
#StartEpochSealingBuffer = 480
|
||||
|
||||
# A command used for fine-grained evaluation of storage deals
|
||||
# see https://docs.filecoin.io/mine/lotus/miner-configuration/#using-filters-for-fine-grained-storage-and-retrieval-deal-acceptance for more details
|
||||
#
|
||||
# type: string
|
||||
# env var: LOTUS_DEALMAKING_FILTER
|
||||
#Filter = ""
|
||||
|
||||
# A command used for fine-grained evaluation of retrieval deals
|
||||
# see https://docs.filecoin.io/mine/lotus/miner-configuration/#using-filters-for-fine-grained-storage-and-retrieval-deal-acceptance for more details
|
||||
#
|
||||
# type: string
|
||||
# env var: LOTUS_DEALMAKING_RETRIEVALFILTER
|
||||
#RetrievalFilter = ""
|
||||
|
||||
[Dealmaking.RetrievalPricing]
|
||||
# env var: LOTUS_DEALMAKING_RETRIEVALPRICING_STRATEGY
|
||||
#Strategy = "default"
|
||||
|
||||
[Dealmaking.RetrievalPricing.Default]
|
||||
# env var: LOTUS_DEALMAKING_RETRIEVALPRICING_DEFAULT_VERIFIEDDEALSFREETRANSFER
|
||||
#VerifiedDealsFreeTransfer = true
|
||||
|
||||
[Dealmaking.RetrievalPricing.External]
|
||||
# env var: LOTUS_DEALMAKING_RETRIEVALPRICING_EXTERNAL_PATH
|
||||
#Path = ""
|
||||
|
||||
|
||||
[Sealing]
|
||||
# Upper bound on how many sectors can be waiting for more deals to be packed in it before it begins sealing at any given time.
|
||||
# If the miner is accepting multiple deals in parallel, up to MaxWaitDealsSectors of new sectors will be created.
|
||||
# If more than MaxWaitDealsSectors deals are accepted in parallel, only MaxWaitDealsSectors deals will be processed in parallel
|
||||
# Note that setting this number too high in relation to deal ingestion rate may result in poor sector packing efficiency
|
||||
# 0 = no limit
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_SEALING_MAXWAITDEALSSECTORS
|
||||
#MaxWaitDealsSectors = 2
|
||||
|
||||
# Upper bound on how many sectors can be sealing at the same time when creating new CC sectors (0 = unlimited)
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_SEALING_MAXSEALINGSECTORS
|
||||
#MaxSealingSectors = 0
|
||||
|
||||
# Upper bound on how many sectors can be sealing at the same time when creating new sectors with deals (0 = unlimited)
|
||||
#
|
||||
# type: uint64
|
||||
# env var: LOTUS_SEALING_MAXSEALINGSECTORSFORDEALS
|
||||
#MaxSealingSectorsForDeals = 0
|
||||
|
||||
# CommittedCapacitySectorLifetime is the duration a Committed Capacity (CC) sector will
|
||||
# live before it must be extended or converted into sector containing deals before it is
|
||||
# terminated. Value must be between 180-540 days inclusive
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_SEALING_COMMITTEDCAPACITYSECTORLIFETIME
|
||||
#CommittedCapacitySectorLifetime = "12960h0m0s"
|
||||
|
||||
# Period of time that a newly created sector will wait for more deals to be packed in to before it starts to seal.
|
||||
# Sectors which are fully filled will start sealing immediately
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_SEALING_WAITDEALSDELAY
|
||||
#WaitDealsDelay = "6h0m0s"
|
||||
|
||||
# Whether to keep unsealed copies of deal data regardless of whether the client requested that. This lets the miner
|
||||
# avoid the relatively high cost of unsealing the data later, at the cost of more storage space
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_SEALING_ALWAYSKEEPUNSEALEDCOPY
|
||||
#AlwaysKeepUnsealedCopy = true
|
||||
|
||||
# Run sector finalization before submitting sector proof to the chain
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_SEALING_FINALIZEEARLY
|
||||
#FinalizeEarly = false
|
||||
|
||||
# Whether to use available miner balance for sector collateral instead of sending it with each message
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_SEALING_COLLATERALFROMMINERBALANCE
|
||||
#CollateralFromMinerBalance = false
|
||||
|
||||
# Minimum available balance to keep in the miner actor before sending it with messages
|
||||
#
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_SEALING_AVAILABLEBALANCEBUFFER
|
||||
#AvailableBalanceBuffer = "0 FIL"
|
||||
|
||||
# Don't send collateral with messages even if there is no available balance in the miner actor
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_SEALING_DISABLECOLLATERALFALLBACK
|
||||
#DisableCollateralFallback = false
|
||||
|
||||
# enable / disable precommit batching (takes effect after nv13)
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_SEALING_BATCHPRECOMMITS
|
||||
#BatchPreCommits = true
|
||||
|
||||
# maximum precommit batch size - batches will be sent immediately above this size
|
||||
#
|
||||
# type: int
|
||||
# env var: LOTUS_SEALING_MAXPRECOMMITBATCH
|
||||
#MaxPreCommitBatch = 256
|
||||
|
||||
# how long to wait before submitting a batch after crossing the minimum batch size
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_SEALING_PRECOMMITBATCHWAIT
|
||||
#PreCommitBatchWait = "24h0m0s"
|
||||
|
||||
# time buffer for forceful batch submission before sectors/deal in batch would start expiring
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_SEALING_PRECOMMITBATCHSLACK
|
||||
#PreCommitBatchSlack = "3h0m0s"
|
||||
|
||||
# enable / disable commit aggregation (takes effect after nv13)
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_SEALING_AGGREGATECOMMITS
|
||||
#AggregateCommits = true
|
||||
|
||||
# maximum batched commit size - batches will be sent immediately above this size
|
||||
#
|
||||
# type: int
|
||||
# env var: LOTUS_SEALING_MINCOMMITBATCH
|
||||
#MinCommitBatch = 4
|
||||
|
||||
# type: int
|
||||
# env var: LOTUS_SEALING_MAXCOMMITBATCH
|
||||
#MaxCommitBatch = 819
|
||||
|
||||
# how long to wait before submitting a batch after crossing the minimum batch size
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_SEALING_COMMITBATCHWAIT
|
||||
#CommitBatchWait = "24h0m0s"
|
||||
|
||||
# time buffer for forceful batch submission before sectors/deals in batch would start expiring
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_SEALING_COMMITBATCHSLACK
|
||||
#CommitBatchSlack = "1h0m0s"
|
||||
|
||||
# network BaseFee below which to stop doing precommit batching, instead
|
||||
# sending precommit messages to the chain individually
|
||||
#
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_SEALING_BATCHPRECOMMITABOVEBASEFEE
|
||||
#BatchPreCommitAboveBaseFee = "0.00000000032 FIL"
|
||||
|
||||
# network BaseFee below which to stop doing commit aggregation, instead
|
||||
# submitting proofs to the chain individually
|
||||
#
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_SEALING_AGGREGATEABOVEBASEFEE
|
||||
#AggregateAboveBaseFee = "0.00000000032 FIL"
|
||||
|
||||
# type: uint64
|
||||
# env var: LOTUS_SEALING_TERMINATEBATCHMAX
|
||||
#TerminateBatchMax = 100
|
||||
|
||||
# type: uint64
|
||||
# env var: LOTUS_SEALING_TERMINATEBATCHMIN
|
||||
#TerminateBatchMin = 1
|
||||
|
||||
# type: Duration
|
||||
# env var: LOTUS_SEALING_TERMINATEBATCHWAIT
|
||||
#TerminateBatchWait = "5m0s"
|
||||
|
||||
|
||||
[Storage]
|
||||
# env var: LOTUS_STORAGE_PARALLELFETCHLIMIT
|
||||
#ParallelFetchLimit = 10
|
||||
|
||||
# env var: LOTUS_STORAGE_ALLOWADDPIECE
|
||||
#AllowAddPiece = true
|
||||
|
||||
# env var: LOTUS_STORAGE_ALLOWPRECOMMIT1
|
||||
#AllowPreCommit1 = true
|
||||
|
||||
# env var: LOTUS_STORAGE_ALLOWPRECOMMIT2
|
||||
#AllowPreCommit2 = true
|
||||
|
||||
# env var: LOTUS_STORAGE_ALLOWCOMMIT
|
||||
#AllowCommit = true
|
||||
|
||||
# env var: LOTUS_STORAGE_ALLOWUNSEAL
|
||||
#AllowUnseal = true
|
||||
|
||||
# env var: LOTUS_STORAGE_RESOURCEFILTERING
|
||||
#ResourceFiltering = "hardware"
|
||||
|
||||
|
||||
[Fees]
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXPRECOMMITGASFEE
|
||||
#MaxPreCommitGasFee = "0.025 FIL"
|
||||
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXCOMMITGASFEE
|
||||
#MaxCommitGasFee = "0.05 FIL"
|
||||
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXTERMINATEGASFEE
|
||||
#MaxTerminateGasFee = "0.5 FIL"
|
||||
|
||||
# WindowPoSt is a high-value operation, so the default fee should be high.
|
||||
#
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXWINDOWPOSTGASFEE
|
||||
#MaxWindowPoStGasFee = "5 FIL"
|
||||
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXPUBLISHDEALSFEE
|
||||
#MaxPublishDealsFee = "0.05 FIL"
|
||||
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXMARKETBALANCEADDFEE
|
||||
#MaxMarketBalanceAddFee = "0.007 FIL"
|
||||
|
||||
[Fees.MaxPreCommitBatchGasFee]
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXPRECOMMITBATCHGASFEE_BASE
|
||||
#Base = "0 FIL"
|
||||
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXPRECOMMITBATCHGASFEE_PERSECTOR
|
||||
#PerSector = "0.02 FIL"
|
||||
|
||||
[Fees.MaxCommitBatchGasFee]
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXCOMMITBATCHGASFEE_BASE
|
||||
#Base = "0 FIL"
|
||||
|
||||
# type: types.FIL
|
||||
# env var: LOTUS_FEES_MAXCOMMITBATCHGASFEE_PERSECTOR
|
||||
#PerSector = "0.03 FIL"
|
||||
|
||||
|
||||
[Addresses]
|
||||
# Addresses to send PreCommit messages from
|
||||
#
|
||||
# type: []string
|
||||
# env var: LOTUS_ADDRESSES_PRECOMMITCONTROL
|
||||
#PreCommitControl = []
|
||||
|
||||
# Addresses to send Commit messages from
|
||||
#
|
||||
# type: []string
|
||||
# env var: LOTUS_ADDRESSES_COMMITCONTROL
|
||||
#CommitControl = []
|
||||
|
||||
# type: []string
|
||||
# env var: LOTUS_ADDRESSES_TERMINATECONTROL
|
||||
#TerminateControl = []
|
||||
|
||||
# type: []string
|
||||
# env var: LOTUS_ADDRESSES_DEALPUBLISHCONTROL
|
||||
#DealPublishControl = []
|
||||
|
||||
# DisableOwnerFallback disables usage of the owner address for messages
|
||||
# sent automatically
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_ADDRESSES_DISABLEOWNERFALLBACK
|
||||
#DisableOwnerFallback = false
|
||||
|
||||
# DisableWorkerFallback disables usage of the worker address for messages
|
||||
# sent automatically, if control addresses are configured.
|
||||
# A control address that doesn't have enough funds will still be chosen
|
||||
# over the worker address if this flag is set.
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_ADDRESSES_DISABLEWORKERFALLBACK
|
||||
#DisableWorkerFallback = false
|
||||
|
||||
|
||||
[DAGStore]
|
||||
# Path to the dagstore root directory. This directory contains three
|
||||
# subdirectories, which can be symlinked to alternative locations if
|
||||
# need be:
|
||||
# - ./transients: caches unsealed deals that have been fetched from the
|
||||
# storage subsystem for serving retrievals.
|
||||
# - ./indices: stores shard indices.
|
||||
# - ./datastore: holds the KV store tracking the state of every shard
|
||||
# known to the DAG store.
|
||||
# Default value: <LOTUS_MARKETS_PATH>/dagstore (split deployment) or
|
||||
# <LOTUS_MINER_PATH>/dagstore (monolith deployment)
|
||||
#
|
||||
# type: string
|
||||
# env var: LOTUS_DAGSTORE_ROOTDIR
|
||||
#RootDir = ""
|
||||
|
||||
# The maximum amount of indexing jobs that can run simultaneously.
|
||||
# 0 means unlimited.
|
||||
# Default value: 5.
|
||||
#
|
||||
# type: int
|
||||
# env var: LOTUS_DAGSTORE_MAXCONCURRENTINDEX
|
||||
#MaxConcurrentIndex = 5
|
||||
|
||||
# The maximum amount of unsealed deals that can be fetched simultaneously
|
||||
# from the storage subsystem. 0 means unlimited.
|
||||
# Default value: 0 (unlimited).
|
||||
#
|
||||
# type: int
|
||||
# env var: LOTUS_DAGSTORE_MAXCONCURRENTREADYFETCHES
|
||||
#MaxConcurrentReadyFetches = 0
|
||||
|
||||
# The maximum number of simultaneous inflight API calls to the storage
|
||||
# subsystem.
|
||||
# Default value: 100.
|
||||
#
|
||||
# type: int
|
||||
# env var: LOTUS_DAGSTORE_MAXCONCURRENCYSTORAGECALLS
|
||||
#MaxConcurrencyStorageCalls = 100
|
||||
|
||||
# The time between calls to periodic dagstore GC, in time.Duration string
|
||||
# representation, e.g. 1m, 5m, 1h.
|
||||
# Default value: 1 minute.
|
||||
#
|
||||
# type: Duration
|
||||
# env var: LOTUS_DAGSTORE_GCINTERVAL
|
||||
#GCInterval = "1m0s"
|
||||
|
||||
|
||||
@@ -3,17 +3,11 @@
|
||||
- [ ] Import new actors
|
||||
- [ ] Define upgrade heights in `build/params_`
|
||||
- [ ] Generate adapters
|
||||
- [ ] Add the new version in `chain/actors/agen/main.go`
|
||||
- [ ] Update `gen/inlinegen-data.json`
|
||||
- [ ] Update `chain/actors/version.go`
|
||||
- [ ] Update adapter code in `chain/actors/builtin` if needed
|
||||
- [ ] Update `chain/actors/policy/policy.go`
|
||||
- [ ] Update `chain/actors/version.go`
|
||||
- [ ] Register in `chain/vm/invoker.go`
|
||||
- [ ] Register in `chain/vm/mkactor.go`
|
||||
- [ ] Update `chain/types/state.go`
|
||||
- [ ] Update `chain/state/statetree.go` (New / Load)
|
||||
- [ ] Update `chain/stmgr/forks.go`
|
||||
- [ ] Run `make actors-gen`
|
||||
- [ ] Update `chain/consensus/filcns/upgrades.go`
|
||||
- [ ] Schedule
|
||||
- [ ] Migration
|
||||
- [ ] Update upgrade schedule in `api/test/test.go` and `chain/sync_test.go`
|
||||
- [ ] Update `NewestNetworkVersion` in `build/params_shared_vals.go`
|
||||
- [ ] Register in init in `chain/stmgr/utils.go`
|
||||
- [ ] Update upgrade schedule in `chain/sync_test.go`
|
||||
|
||||
Vendored
+1
-1
Submodule extern/filecoin-ffi updated: dc585c4860...7912389334
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package sectorstorage
|
||||
|
||||
func cgroupV1Mem() (memoryMax, memoryUsed, swapMax, swapUsed uint64, err error) {
|
||||
return 0, 0, 0, 0, nil
|
||||
}
|
||||
|
||||
func cgroupV2Mem() (memoryMax, memoryUsed, swapMax, swapUsed uint64, err error) {
|
||||
return 0, 0, 0, 0, nil
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package sectorstorage
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"math"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/containerd/cgroups"
|
||||
cgroupv2 "github.com/containerd/cgroups/v2"
|
||||
)
|
||||
|
||||
func cgroupV2MountPoint() (string, error) {
|
||||
f, err := os.Open("/proc/self/mountinfo")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer f.Close() //nolint
|
||||
|
||||
scanner := bufio.NewScanner(f)
|
||||
for scanner.Scan() {
|
||||
fields := bytes.Fields(scanner.Bytes())
|
||||
if len(fields) >= 9 && bytes.Equal(fields[8], []byte("cgroup2")) {
|
||||
return string(fields[4]), nil
|
||||
}
|
||||
}
|
||||
return "", cgroups.ErrMountPointNotExist
|
||||
}
|
||||
|
||||
func cgroupV1Mem() (memoryMax, memoryUsed, swapMax, swapUsed uint64, err error) {
|
||||
path := cgroups.NestedPath("")
|
||||
if pid := os.Getpid(); pid == 1 {
|
||||
path = cgroups.RootPath
|
||||
}
|
||||
c, err := cgroups.Load(cgroups.SingleSubsystem(cgroups.V1, cgroups.Memory), path)
|
||||
if err != nil {
|
||||
return 0, 0, 0, 0, err
|
||||
}
|
||||
stats, err := c.Stat()
|
||||
if err != nil {
|
||||
return 0, 0, 0, 0, err
|
||||
}
|
||||
if stats.Memory == nil {
|
||||
return 0, 0, 0, 0, nil
|
||||
}
|
||||
if stats.Memory.Usage != nil {
|
||||
memoryMax = stats.Memory.Usage.Limit
|
||||
// Exclude cached files
|
||||
memoryUsed = stats.Memory.Usage.Usage - stats.Memory.InactiveFile - stats.Memory.ActiveFile
|
||||
}
|
||||
if stats.Memory.Swap != nil {
|
||||
swapMax = stats.Memory.Swap.Limit
|
||||
swapUsed = stats.Memory.Swap.Usage
|
||||
}
|
||||
return memoryMax, memoryUsed, swapMax, swapUsed, nil
|
||||
}
|
||||
|
||||
func cgroupV2MemFromPath(mp, path string) (memoryMax, memoryUsed, swapMax, swapUsed uint64, err error) {
|
||||
c, err := cgroupv2.LoadManager(mp, path)
|
||||
if err != nil {
|
||||
return 0, 0, 0, 0, err
|
||||
}
|
||||
|
||||
stats, err := c.Stat()
|
||||
if err != nil {
|
||||
return 0, 0, 0, 0, err
|
||||
}
|
||||
|
||||
if stats.Memory != nil {
|
||||
memoryMax = stats.Memory.UsageLimit
|
||||
// Exclude memory used caching files
|
||||
memoryUsed = stats.Memory.Usage - stats.Memory.File
|
||||
swapMax = stats.Memory.SwapLimit
|
||||
swapUsed = stats.Memory.SwapUsage
|
||||
}
|
||||
|
||||
return memoryMax, memoryUsed, swapMax, swapUsed, nil
|
||||
}
|
||||
|
||||
func cgroupV2Mem() (memoryMax, memoryUsed, swapMax, swapUsed uint64, err error) {
|
||||
memoryMax = math.MaxUint64
|
||||
swapMax = math.MaxUint64
|
||||
|
||||
path, err := cgroupv2.PidGroupPath(os.Getpid())
|
||||
if err != nil {
|
||||
return 0, 0, 0, 0, err
|
||||
}
|
||||
|
||||
mp, err := cgroupV2MountPoint()
|
||||
if err != nil {
|
||||
return 0, 0, 0, 0, err
|
||||
}
|
||||
|
||||
for path != "/" {
|
||||
cgMemoryMax, cgMemoryUsed, cgSwapMax, cgSwapUsed, err := cgroupV2MemFromPath(mp, path)
|
||||
if err != nil {
|
||||
return 0, 0, 0, 0, err
|
||||
}
|
||||
if cgMemoryMax != 0 && cgMemoryMax < memoryMax {
|
||||
log.Debugf("memory limited by cgroup %s: %v", path, cgMemoryMax)
|
||||
memoryMax = cgMemoryMax
|
||||
memoryUsed = cgMemoryUsed
|
||||
}
|
||||
if cgSwapMax != 0 && cgSwapMax < swapMax {
|
||||
log.Debugf("swap limited by cgroup %s: %v", path, cgSwapMax)
|
||||
swapMax = cgSwapMax
|
||||
swapUsed = cgSwapUsed
|
||||
}
|
||||
path = filepath.Dir(path)
|
||||
}
|
||||
|
||||
return memoryMax, memoryUsed, swapMax, swapUsed, nil
|
||||
}
|
||||
+58
-1
@@ -7,6 +7,9 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"math/bits"
|
||||
"os"
|
||||
@@ -530,9 +533,19 @@ func (sb *Sealer) SealPreCommit1(ctx context.Context, sector storage.SectorRef,
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("presealing sector %d (%s): %w", sector.ID.Number, paths.Unsealed, err)
|
||||
}
|
||||
return p1o, nil
|
||||
|
||||
p1odec := map[string]interface{}{}
|
||||
if err := json.Unmarshal(p1o, &p1odec); err != nil {
|
||||
return nil, xerrors.Errorf("unmarshaling pc1 output: %w", err)
|
||||
}
|
||||
|
||||
p1odec["_lotus_SealRandomness"] = ticket
|
||||
|
||||
return json.Marshal(&p1odec)
|
||||
}
|
||||
|
||||
var PC2CheckRounds = 3
|
||||
|
||||
func (sb *Sealer) SealPreCommit2(ctx context.Context, sector storage.SectorRef, phase1Out storage.PreCommit1Out) (storage.SectorCids, error) {
|
||||
paths, done, err := sb.sectors.AcquireSector(ctx, sector, storiface.FTSealed|storiface.FTCache, 0, storiface.PathSealing)
|
||||
if err != nil {
|
||||
@@ -545,6 +558,50 @@ func (sb *Sealer) SealPreCommit2(ctx context.Context, sector storage.SectorRef,
|
||||
return storage.SectorCids{}, xerrors.Errorf("presealing sector %d (%s): %w", sector.ID.Number, paths.Unsealed, err)
|
||||
}
|
||||
|
||||
ssize, err := sector.ProofType.SectorSize()
|
||||
if err != nil {
|
||||
return storage.SectorCids{}, xerrors.Errorf("get ssize: %w", err)
|
||||
}
|
||||
|
||||
p1odec := map[string]interface{}{}
|
||||
if err := json.Unmarshal(phase1Out, &p1odec); err != nil {
|
||||
return storage.SectorCids{}, xerrors.Errorf("unmarshaling pc1 output: %w", err)
|
||||
}
|
||||
|
||||
var ticket abi.SealRandomness
|
||||
ti, found := p1odec["_lotus_SealRandomness"]
|
||||
|
||||
if found {
|
||||
ticket, err = base64.StdEncoding.DecodeString(ti.(string))
|
||||
if err != nil {
|
||||
return storage.SectorCids{}, xerrors.Errorf("decoding ticket: %w", err)
|
||||
}
|
||||
|
||||
for i := 0; i < PC2CheckRounds; i++ {
|
||||
var sd [32]byte
|
||||
_, _ = rand.Read(sd[:])
|
||||
|
||||
_, err := ffi.SealCommitPhase1(
|
||||
sector.ProofType,
|
||||
sealedCID,
|
||||
unsealedCID,
|
||||
paths.Cache,
|
||||
paths.Sealed,
|
||||
sector.ID.Number,
|
||||
sector.ID.Miner,
|
||||
ticket,
|
||||
sd[:],
|
||||
[]abi.PieceInfo{{Size: abi.PaddedPieceSize(ssize), PieceCID: unsealedCID}},
|
||||
)
|
||||
if err != nil {
|
||||
log.Warn("checking PreCommit failed: ", err)
|
||||
log.Warnf("num:%d tkt:%v seed:%v sealedCID:%v, unsealedCID:%v", sector.ID.Number, ticket, sd[:], sealedCID, unsealedCID)
|
||||
|
||||
return storage.SectorCids{}, xerrors.Errorf("checking PreCommit failed: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return storage.SectorCids{
|
||||
Unsealed: unsealedCID,
|
||||
Sealed: sealedCID,
|
||||
|
||||
+2
-1
@@ -622,7 +622,8 @@ func requireFDsClosed(t *testing.T, start int) {
|
||||
}
|
||||
|
||||
log.Infow("open FDs", "start", start, "now", openNow)
|
||||
require.Equal(t, start, openNow, "FDs shouldn't leak")
|
||||
// todo make work with cuda somehow
|
||||
// require.Equal(t, start, openNow, "FDs shouldn't leak")
|
||||
}
|
||||
|
||||
func TestGenerateUnsealedCID(t *testing.T) {
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
)
|
||||
|
||||
var MTTresh = uint64(32 << 20)
|
||||
var MTTresh = uint64(512 << 10)
|
||||
|
||||
func mtChunkCount(usz abi.PaddedPieceSize) uint64 {
|
||||
threads := (uint64(usz)) / MTTresh
|
||||
|
||||
+10
-2
@@ -16,13 +16,21 @@ type unpadReader struct {
|
||||
work []byte
|
||||
}
|
||||
|
||||
func BufSize(sz abi.PaddedPieceSize) int {
|
||||
return int(MTTresh * mtChunkCount(sz))
|
||||
}
|
||||
|
||||
func NewUnpadReader(src io.Reader, sz abi.PaddedPieceSize) (io.Reader, error) {
|
||||
buf := make([]byte, BufSize(sz))
|
||||
|
||||
return NewUnpadReaderBuf(src, sz, buf)
|
||||
}
|
||||
|
||||
func NewUnpadReaderBuf(src io.Reader, sz abi.PaddedPieceSize, buf []byte) (io.Reader, error) {
|
||||
if err := sz.Validate(); err != nil {
|
||||
return nil, xerrors.Errorf("bad piece size: %w", err)
|
||||
}
|
||||
|
||||
buf := make([]byte, MTTresh*mtChunkCount(sz))
|
||||
|
||||
return &unpadReader{
|
||||
src: src,
|
||||
|
||||
|
||||
+3
@@ -1,3 +1,6 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package fsutil
|
||||
|
||||
import (
|
||||
|
||||
Vendored
+3
-8
@@ -51,13 +51,8 @@ type SectorManager interface {
|
||||
FaultTracker
|
||||
}
|
||||
|
||||
type WorkerID uuid.UUID // worker session UUID
|
||||
var ClosedWorkerID = uuid.UUID{}
|
||||
|
||||
func (w WorkerID) String() string {
|
||||
return uuid.UUID(w).String()
|
||||
}
|
||||
|
||||
type Manager struct {
|
||||
ls stores.LocalStorage
|
||||
storage *stores.Remote
|
||||
@@ -588,13 +583,13 @@ func (m *Manager) Remove(ctx context.Context, sector storage.SectorRef) error {
|
||||
|
||||
var err error
|
||||
|
||||
if rerr := m.storage.Remove(ctx, sector.ID, storiface.FTSealed, true); rerr != nil {
|
||||
if rerr := m.storage.Remove(ctx, sector.ID, storiface.FTSealed, true, nil); rerr != nil {
|
||||
err = multierror.Append(err, xerrors.Errorf("removing sector (sealed): %w", rerr))
|
||||
}
|
||||
if rerr := m.storage.Remove(ctx, sector.ID, storiface.FTCache, true); rerr != nil {
|
||||
if rerr := m.storage.Remove(ctx, sector.ID, storiface.FTCache, true, nil); rerr != nil {
|
||||
err = multierror.Append(err, xerrors.Errorf("removing sector (cache): %w", rerr))
|
||||
}
|
||||
if rerr := m.storage.Remove(ctx, sector.ID, storiface.FTUnsealed, true); rerr != nil {
|
||||
if rerr := m.storage.Remove(ctx, sector.ID, storiface.FTUnsealed, true, nil); rerr != nil {
|
||||
err = multierror.Append(err, xerrors.Errorf("removing sector (unsealed): %w", rerr))
|
||||
}
|
||||
|
||||
|
||||
+124
-4
@@ -322,7 +322,7 @@ func TestRestartWorker(t *testing.T) {
|
||||
defer cleanup()
|
||||
|
||||
localTasks := []sealtasks.TaskType{
|
||||
sealtasks.TTAddPiece, sealtasks.TTPreCommit1, sealtasks.TTCommit1, sealtasks.TTFinalize, sealtasks.TTFetch,
|
||||
sealtasks.TTAddPiece, sealtasks.TTFetch,
|
||||
}
|
||||
|
||||
wds := datastore.NewMapDatastore()
|
||||
@@ -332,7 +332,7 @@ func TestRestartWorker(t *testing.T) {
|
||||
return &testExec{apch: arch}, nil
|
||||
}, WorkerConfig{
|
||||
TaskTypes: localTasks,
|
||||
}, stor, lstor, idx, m, statestore.New(wds))
|
||||
}, os.LookupEnv, stor, lstor, idx, m, statestore.New(wds))
|
||||
|
||||
err := m.AddWorker(ctx, w)
|
||||
require.NoError(t, err)
|
||||
@@ -368,7 +368,7 @@ func TestRestartWorker(t *testing.T) {
|
||||
return &testExec{apch: arch}, nil
|
||||
}, WorkerConfig{
|
||||
TaskTypes: localTasks,
|
||||
}, stor, lstor, idx, m, statestore.New(wds))
|
||||
}, os.LookupEnv, stor, lstor, idx, m, statestore.New(wds))
|
||||
|
||||
err = m.AddWorker(ctx, w)
|
||||
require.NoError(t, err)
|
||||
@@ -404,7 +404,7 @@ func TestReenableWorker(t *testing.T) {
|
||||
return &testExec{apch: arch}, nil
|
||||
}, WorkerConfig{
|
||||
TaskTypes: localTasks,
|
||||
}, stor, lstor, idx, m, statestore.New(wds))
|
||||
}, os.LookupEnv, stor, lstor, idx, m, statestore.New(wds))
|
||||
|
||||
err := m.AddWorker(ctx, w)
|
||||
require.NoError(t, err)
|
||||
@@ -453,3 +453,123 @@ func TestReenableWorker(t *testing.T) {
|
||||
i, _ = m.sched.Info(ctx)
|
||||
require.Len(t, i.(SchedDiagInfo).OpenWindows, 2)
|
||||
}
|
||||
|
||||
func TestResUse(t *testing.T) {
|
||||
logging.SetAllLoggers(logging.LevelDebug)
|
||||
|
||||
ctx, done := context.WithCancel(context.Background())
|
||||
defer done()
|
||||
|
||||
ds := datastore.NewMapDatastore()
|
||||
|
||||
m, lstor, stor, idx, cleanup := newTestMgr(ctx, t, ds)
|
||||
defer cleanup()
|
||||
|
||||
localTasks := []sealtasks.TaskType{
|
||||
sealtasks.TTAddPiece, sealtasks.TTFetch,
|
||||
}
|
||||
|
||||
wds := datastore.NewMapDatastore()
|
||||
|
||||
arch := make(chan chan apres)
|
||||
w := newLocalWorker(func() (ffiwrapper.Storage, error) {
|
||||
return &testExec{apch: arch}, nil
|
||||
}, WorkerConfig{
|
||||
TaskTypes: localTasks,
|
||||
}, func(s string) (string, bool) {
|
||||
return "", false
|
||||
}, stor, lstor, idx, m, statestore.New(wds))
|
||||
|
||||
err := m.AddWorker(ctx, w)
|
||||
require.NoError(t, err)
|
||||
|
||||
sid := storage.SectorRef{
|
||||
ID: abi.SectorID{Miner: 1000, Number: 1},
|
||||
ProofType: abi.RegisteredSealProof_StackedDrg2KiBV1,
|
||||
}
|
||||
|
||||
go func() {
|
||||
_, err := m.AddPiece(ctx, sid, nil, 1016, strings.NewReader(strings.Repeat("testthis", 127)))
|
||||
require.Error(t, err)
|
||||
}()
|
||||
|
||||
l:
|
||||
for {
|
||||
st := m.WorkerStats()
|
||||
require.Len(t, st, 1)
|
||||
for _, w := range st {
|
||||
if w.MemUsedMax > 0 {
|
||||
break l
|
||||
}
|
||||
time.Sleep(time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
st := m.WorkerStats()
|
||||
require.Len(t, st, 1)
|
||||
for _, w := range st {
|
||||
require.Equal(t, storiface.ResourceTable[sealtasks.TTAddPiece][abi.RegisteredSealProof_StackedDrg2KiBV1].MaxMemory, w.MemUsedMax)
|
||||
}
|
||||
}
|
||||
|
||||
func TestResOverride(t *testing.T) {
|
||||
logging.SetAllLoggers(logging.LevelDebug)
|
||||
|
||||
ctx, done := context.WithCancel(context.Background())
|
||||
defer done()
|
||||
|
||||
ds := datastore.NewMapDatastore()
|
||||
|
||||
m, lstor, stor, idx, cleanup := newTestMgr(ctx, t, ds)
|
||||
defer cleanup()
|
||||
|
||||
localTasks := []sealtasks.TaskType{
|
||||
sealtasks.TTAddPiece, sealtasks.TTFetch,
|
||||
}
|
||||
|
||||
wds := datastore.NewMapDatastore()
|
||||
|
||||
arch := make(chan chan apres)
|
||||
w := newLocalWorker(func() (ffiwrapper.Storage, error) {
|
||||
return &testExec{apch: arch}, nil
|
||||
}, WorkerConfig{
|
||||
TaskTypes: localTasks,
|
||||
}, func(s string) (string, bool) {
|
||||
if s == "AP_2K_MAX_MEMORY" {
|
||||
return "99999", true
|
||||
}
|
||||
|
||||
return "", false
|
||||
}, stor, lstor, idx, m, statestore.New(wds))
|
||||
|
||||
err := m.AddWorker(ctx, w)
|
||||
require.NoError(t, err)
|
||||
|
||||
sid := storage.SectorRef{
|
||||
ID: abi.SectorID{Miner: 1000, Number: 1},
|
||||
ProofType: abi.RegisteredSealProof_StackedDrg2KiBV1,
|
||||
}
|
||||
|
||||
go func() {
|
||||
_, err := m.AddPiece(ctx, sid, nil, 1016, strings.NewReader(strings.Repeat("testthis", 127)))
|
||||
require.Error(t, err)
|
||||
}()
|
||||
|
||||
l:
|
||||
for {
|
||||
st := m.WorkerStats()
|
||||
require.Len(t, st, 1)
|
||||
for _, w := range st {
|
||||
if w.MemUsedMax > 0 {
|
||||
break l
|
||||
}
|
||||
time.Sleep(time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
st := m.WorkerStats()
|
||||
require.Len(t, st, 1)
|
||||
for _, w := range st {
|
||||
require.Equal(t, uint64(99999), w.MemUsedMax)
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+14
-3
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
proof5 "github.com/filecoin-project/specs-actors/v5/actors/runtime/proof"
|
||||
|
||||
"github.com/filecoin-project/dagstore/mount"
|
||||
ffiwrapper2 "github.com/filecoin-project/go-commp-utils/ffiwrapper"
|
||||
commcid "github.com/filecoin-project/go-fil-commcid"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
@@ -384,12 +385,22 @@ func generateFakePoSt(sectorInfo []proof5.SectorInfo, rpt func(abi.RegisteredSea
|
||||
}
|
||||
}
|
||||
|
||||
func (mgr *SectorMgr) ReadPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (io.ReadCloser, bool, error) {
|
||||
if offset != 0 {
|
||||
func (mgr *SectorMgr) ReadPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (mount.Reader, bool, error) {
|
||||
if uint64(offset) != 0 {
|
||||
panic("implme")
|
||||
}
|
||||
|
||||
return ioutil.NopCloser(bytes.NewReader(mgr.pieces[mgr.sectors[sector.ID].pieces[0]][:size])), false, nil
|
||||
br := bytes.NewReader(mgr.pieces[mgr.sectors[sector.ID].pieces[0]][:size])
|
||||
|
||||
return struct {
|
||||
io.ReadCloser
|
||||
io.Seeker
|
||||
io.ReaderAt
|
||||
}{
|
||||
ReadCloser: ioutil.NopCloser(br),
|
||||
Seeker: br,
|
||||
ReaderAt: br,
|
||||
}, false, nil
|
||||
}
|
||||
|
||||
func (mgr *SectorMgr) StageFakeData(mid abi.ActorID, spt abi.RegisteredSealProof) (storage.SectorRef, []abi.PieceInfo, error) {
|
||||
|
||||
+80
-41
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/dagstore/mount"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/specs-storage/storage"
|
||||
|
||||
@@ -23,7 +24,11 @@ type Unsealer interface {
|
||||
|
||||
type PieceProvider interface {
|
||||
// ReadPiece is used to read an Unsealed piece at the given offset and of the given size from a Sector
|
||||
ReadPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (io.ReadCloser, bool, error)
|
||||
// pieceOffset + pieceSize specify piece bounds for unsealing (note: with SDR the entire sector will be unsealed by
|
||||
// default in most cases, but this might matter with future PoRep)
|
||||
// startOffset is added to the pieceOffset to get the starting reader offset.
|
||||
// The number of bytes that can be read is pieceSize-startOffset
|
||||
ReadPiece(ctx context.Context, sector storage.SectorRef, pieceOffset storiface.UnpaddedByteIndex, pieceSize abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (mount.Reader, bool, error)
|
||||
IsUnsealed(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error)
|
||||
}
|
||||
|
||||
@@ -67,50 +72,104 @@ func (p *pieceProvider) IsUnsealed(ctx context.Context, sector storage.SectorRef
|
||||
// It will NOT try to schedule an Unseal of a sealed sector file for the read.
|
||||
//
|
||||
// Returns a nil reader if the piece does NOT exist in any unsealed file or there is no unsealed file for the given sector on any of the workers.
|
||||
func (p *pieceProvider) tryReadUnsealedPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (io.ReadCloser, context.CancelFunc, error) {
|
||||
func (p *pieceProvider) tryReadUnsealedPiece(ctx context.Context, pc cid.Cid, sector storage.SectorRef, pieceOffset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (mount.Reader, error) {
|
||||
// acquire a lock purely for reading unsealed sectors
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
if err := p.index.StorageLock(ctx, sector.ID, storiface.FTUnsealed, storiface.FTNone); err != nil {
|
||||
cancel()
|
||||
return nil, nil, xerrors.Errorf("acquiring read sector lock: %w", err)
|
||||
return nil, xerrors.Errorf("acquiring read sector lock: %w", err)
|
||||
}
|
||||
|
||||
// Reader returns a reader for an unsealed piece at the given offset in the given sector.
|
||||
// Reader returns a reader getter for an unsealed piece at the given offset in the given sector.
|
||||
// The returned reader will be nil if none of the workers has an unsealed sector file containing
|
||||
// the unsealed piece.
|
||||
r, err := p.storage.Reader(ctx, sector, abi.PaddedPieceSize(offset.Padded()), size.Padded())
|
||||
rg, err := p.storage.Reader(ctx, sector, abi.PaddedPieceSize(pieceOffset.Padded()), size.Padded())
|
||||
if err != nil {
|
||||
cancel()
|
||||
log.Debugf("did not get storage reader;sector=%+v, err:%s", sector.ID, err)
|
||||
cancel()
|
||||
return nil, nil, err
|
||||
return nil, err
|
||||
}
|
||||
if r == nil {
|
||||
if rg == nil {
|
||||
cancel()
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return r, cancel, nil
|
||||
buf := make([]byte, fr32.BufSize(size.Padded()))
|
||||
|
||||
pr, err := (&pieceReader{
|
||||
ctx: ctx,
|
||||
getReader: func(ctx context.Context, startOffset uint64) (io.ReadCloser, error) {
|
||||
startOffsetAligned := storiface.UnpaddedByteIndex(startOffset / 127 * 127) // floor to multiple of 127
|
||||
|
||||
r, err := rg(startOffsetAligned.Padded())
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("getting reader at +%d: %w", startOffsetAligned, err)
|
||||
}
|
||||
|
||||
upr, err := fr32.NewUnpadReaderBuf(r, size.Padded(), buf)
|
||||
if err != nil {
|
||||
r.Close() // nolint
|
||||
return nil, xerrors.Errorf("creating unpadded reader: %w", err)
|
||||
}
|
||||
|
||||
bir := bufio.NewReaderSize(upr, 127)
|
||||
if startOffset > uint64(startOffsetAligned) {
|
||||
if _, err := bir.Discard(int(startOffset - uint64(startOffsetAligned))); err != nil {
|
||||
r.Close() // nolint
|
||||
return nil, xerrors.Errorf("discarding bytes for startOffset: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return struct {
|
||||
io.Reader
|
||||
io.Closer
|
||||
}{
|
||||
Reader: bir,
|
||||
Closer: funcCloser(func() error {
|
||||
return r.Close()
|
||||
}),
|
||||
}, nil
|
||||
},
|
||||
len: size,
|
||||
onClose: cancel,
|
||||
pieceCid: pc,
|
||||
}).init()
|
||||
if err != nil || pr == nil { // pr == nil to make sure we don't return typed nil
|
||||
cancel()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return pr, err
|
||||
}
|
||||
|
||||
type funcCloser func() error
|
||||
|
||||
func (f funcCloser) Close() error {
|
||||
return f()
|
||||
}
|
||||
|
||||
var _ io.Closer = funcCloser(nil)
|
||||
|
||||
// ReadPiece is used to read an Unsealed piece at the given offset and of the given size from a Sector
|
||||
// If an Unsealed sector file exists with the Piece Unsealed in it, we'll use that for the read.
|
||||
// Otherwise, we will Unseal a Sealed sector file for the given sector and read the Unsealed piece from it.
|
||||
// If we do NOT have an existing unsealed file containing the given piece thus causing us to schedule an Unseal,
|
||||
// the returned boolean parameter will be set to true.
|
||||
// If we have an existing unsealed file containing the given piece, the returned boolean will be set to false.
|
||||
func (p *pieceProvider) ReadPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (io.ReadCloser, bool, error) {
|
||||
if err := offset.Valid(); err != nil {
|
||||
return nil, false, xerrors.Errorf("offset is not valid: %w", err)
|
||||
func (p *pieceProvider) ReadPiece(ctx context.Context, sector storage.SectorRef, pieceOffset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (mount.Reader, bool, error) {
|
||||
if err := pieceOffset.Valid(); err != nil {
|
||||
return nil, false, xerrors.Errorf("pieceOffset is not valid: %w", err)
|
||||
}
|
||||
if err := size.Validate(); err != nil {
|
||||
return nil, false, xerrors.Errorf("size is not a valid piece size: %w", err)
|
||||
}
|
||||
|
||||
r, unlock, err := p.tryReadUnsealedPiece(ctx, sector, offset, size)
|
||||
r, err := p.tryReadUnsealedPiece(ctx, unsealed, sector, pieceOffset, size)
|
||||
|
||||
log.Debugf("result of first tryReadUnsealedPiece: r=%+v, err=%s", r, err)
|
||||
|
||||
if xerrors.Is(err, storiface.ErrSectorNotFound) {
|
||||
log.Debugf("no unsealed sector file with unsealed piece, sector=%+v, offset=%d, size=%d", sector, offset, size)
|
||||
log.Debugf("no unsealed sector file with unsealed piece, sector=%+v, pieceOffset=%d, size=%d", sector, pieceOffset, size)
|
||||
err = nil
|
||||
}
|
||||
if err != nil {
|
||||
@@ -129,14 +188,14 @@ func (p *pieceProvider) ReadPiece(ctx context.Context, sector storage.SectorRef,
|
||||
if unsealed == cid.Undef {
|
||||
commd = nil
|
||||
}
|
||||
if err := p.uns.SectorsUnsealPiece(ctx, sector, offset, size, ticket, commd); err != nil {
|
||||
if err := p.uns.SectorsUnsealPiece(ctx, sector, pieceOffset, size, ticket, commd); err != nil {
|
||||
log.Errorf("failed to SectorsUnsealPiece: %s", err)
|
||||
return nil, false, xerrors.Errorf("unsealing piece: %w", err)
|
||||
}
|
||||
|
||||
log.Debugf("unsealed a sector file to read the piece, sector=%+v, offset=%d, size=%d", sector, offset, size)
|
||||
log.Debugf("unsealed a sector file to read the piece, sector=%+v, pieceOffset=%d, size=%d", sector, pieceOffset, size)
|
||||
|
||||
r, unlock, err = p.tryReadUnsealedPiece(ctx, sector, offset, size)
|
||||
r, err = p.tryReadUnsealedPiece(ctx, unsealed, sector, pieceOffset, size)
|
||||
if err != nil {
|
||||
log.Errorf("failed to tryReadUnsealedPiece after SectorsUnsealPiece: %s", err)
|
||||
return nil, true, xerrors.Errorf("read after unsealing: %w", err)
|
||||
@@ -145,32 +204,12 @@ func (p *pieceProvider) ReadPiece(ctx context.Context, sector storage.SectorRef,
|
||||
log.Errorf("got no reader after unsealing piece")
|
||||
return nil, true, xerrors.Errorf("got no reader after unsealing piece")
|
||||
}
|
||||
log.Debugf("got a reader to read unsealed piece, sector=%+v, offset=%d, size=%d", sector, offset, size)
|
||||
log.Debugf("got a reader to read unsealed piece, sector=%+v, pieceOffset=%d, size=%d", sector, pieceOffset, size)
|
||||
} else {
|
||||
log.Debugf("unsealed piece already exists, no need to unseal, sector=%+v, offset=%d, size=%d", sector, offset, size)
|
||||
log.Debugf("unsealed piece already exists, no need to unseal, sector=%+v, pieceOffset=%d, size=%d", sector, pieceOffset, size)
|
||||
}
|
||||
|
||||
upr, err := fr32.NewUnpadReader(r, size.Padded())
|
||||
if err != nil {
|
||||
unlock()
|
||||
return nil, uns, xerrors.Errorf("creating unpadded reader: %w", err)
|
||||
}
|
||||
log.Debugf("returning reader to read unsealed piece, sector=%+v, pieceOffset=%d, size=%d", sector, pieceOffset, size)
|
||||
|
||||
log.Debugf("returning reader to read unsealed piece, sector=%+v, offset=%d, size=%d", sector, offset, size)
|
||||
|
||||
return &funcCloser{
|
||||
Reader: bufio.NewReaderSize(upr, 127),
|
||||
close: func() error {
|
||||
err = r.Close()
|
||||
unlock()
|
||||
return err
|
||||
},
|
||||
}, uns, nil
|
||||
return r, uns, nil
|
||||
}
|
||||
|
||||
type funcCloser struct {
|
||||
io.Reader
|
||||
close func() error
|
||||
}
|
||||
|
||||
func (fc *funcCloser) Close() error { return fc.close() }
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@ import (
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
@@ -286,7 +287,7 @@ func (p *pieceProviderTestHarness) addRemoteWorker(t *testing.T, tasks []sealtas
|
||||
|
||||
worker := newLocalWorker(nil, WorkerConfig{
|
||||
TaskTypes: tasks,
|
||||
}, remote, localStore, p.index, p.mgr, csts)
|
||||
}, os.LookupEnv, remote, localStore, p.index, p.mgr, csts)
|
||||
|
||||
p.servers = append(p.servers, svc)
|
||||
p.localStores = append(p.localStores, localStore)
|
||||
@@ -298,7 +299,7 @@ func (p *pieceProviderTestHarness) addRemoteWorker(t *testing.T, tasks []sealtas
|
||||
func (p *pieceProviderTestHarness) removeAllUnsealedSectorFiles(t *testing.T) {
|
||||
for i := range p.localStores {
|
||||
ls := p.localStores[i]
|
||||
require.NoError(t, ls.Remove(p.ctx, p.sector.ID, storiface.FTUnsealed, false))
|
||||
require.NoError(t, ls.Remove(p.ctx, p.sector.ID, storiface.FTUnsealed, false, nil))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user