Compare commits
331
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f6a383023 | ||
|
|
a7e8f5aa17 | ||
|
|
c095d101a1 | ||
|
|
cec9425c83 | ||
|
|
130ef04ca5 | ||
|
|
ff02a666bd | ||
|
|
869f6abcd6 | ||
|
|
64709dd587 | ||
|
|
8cbbee3a87 | ||
|
|
ddbcf1fc61 | ||
|
|
24474042f8 | ||
|
|
4c6598e861 | ||
|
|
b32e5e916b | ||
|
|
199f48d16a | ||
|
|
cd5b6e30fa | ||
|
|
d0c97e07f9 | ||
|
|
e1dfccb542 | ||
|
|
5d65d9f7c8 | ||
|
|
33a05d33a9 | ||
|
|
03f412404a | ||
|
|
c69b579201 | ||
|
|
d6178993c2 | ||
|
|
9da58c5f6a | ||
|
|
ddc46fc059 | ||
|
|
c057ce10d1 | ||
|
|
f22a0f9ec0 | ||
|
|
b9750087ce | ||
|
|
518dc962ee | ||
|
|
abdaae7ece | ||
|
|
f4931c6098 | ||
|
|
5efa364d50 | ||
|
|
c1f1d3d093 | ||
|
|
304fa02d59 | ||
|
|
e75e864070 | ||
|
|
3184eb9f4d | ||
|
|
767a53f8c3 | ||
|
|
962e37e893 | ||
|
|
d8f1380ec9 | ||
|
|
4fcc9a1b09 | ||
|
|
0b5e40f455 | ||
|
|
0de1b84f9a | ||
|
|
23378f8710 | ||
|
|
1740dcb90a | ||
|
|
b83824b28b | ||
|
|
8ab23cbd5c | ||
|
|
27e99ff84f | ||
|
|
85be0aad1b | ||
|
|
cfe201450c | ||
|
|
2478814e5a | ||
|
|
69db877335 | ||
|
|
7184c9a529 | ||
|
|
0869bea026 | ||
|
|
abf4957e18 | ||
|
|
514c756570 | ||
|
|
7020892631 | ||
|
|
662f7526c9 | ||
|
|
8863bdbfc0 | ||
|
|
704833cd29 | ||
|
|
19ec0ef25d | ||
|
|
7036636fcf | ||
|
|
57198a2fba | ||
|
|
002bdbf03a | ||
|
|
33f190c9ce | ||
|
|
4cfc73e17e | ||
|
|
e793d7e128 | ||
|
|
3702d4be27 | ||
|
|
415b506a85 | ||
|
|
d6618c75a0 | ||
|
|
3ab625fa4c | ||
|
|
94d9dee0dd | ||
|
|
8d0b28bda4 | ||
|
|
4d5e850aa9 | ||
|
|
ece51c5372 | ||
|
|
88f8c7d166 | ||
|
|
6c0c111847 | ||
|
|
f9a4a400da | ||
|
|
562d4e0f85 | ||
|
|
43436f7bc8 | ||
|
|
04bb539502 | ||
|
|
779e923854 | ||
|
|
a2d90625d2 | ||
|
|
d7c52f8adf | ||
|
|
48c54605ae | ||
|
|
1aed631fe5 | ||
|
|
a50a20b5a7 | ||
|
|
1162b02e60 | ||
|
|
5b1800556b | ||
|
|
825cdb8db9 | ||
|
|
6c40d363f5 | ||
|
|
bd9e8c7663 | ||
|
|
2be9452ced | ||
|
|
efad692353 | ||
|
|
357da15e5c | ||
|
|
cc328689e1 | ||
|
|
d044e30e12 | ||
|
|
ff987e0b9d | ||
|
|
cc294496ab | ||
|
|
ed0b4b0bfa | ||
|
|
bab500bec5 | ||
|
|
1c8880ed2c | ||
|
|
f273a440f0 | ||
|
|
295bf03e4d | ||
|
|
48ffb15901 | ||
|
|
e0d2b9526e | ||
|
|
5f5bd31f58 | ||
|
|
2410cf3d84 | ||
|
|
36a8d9716e | ||
|
|
a3a3fefb1c | ||
|
|
eb894b0dd2 | ||
|
|
1922e76349 | ||
|
|
4bd039902c | ||
|
|
77615e9583 | ||
|
|
49d6c07280 | ||
|
|
0db46dfeaa | ||
|
|
06f8637485 | ||
|
|
5bdcc7d7e0 | ||
|
|
db5082552d | ||
|
|
dcf6f64143 | ||
|
|
372dd2ced9 | ||
|
|
0c8828514e | ||
|
|
0a4b49d3b3 | ||
|
|
84470e9c64 | ||
|
|
88142d246c | ||
|
|
98c861e3c9 | ||
|
|
42a79d52a2 | ||
|
|
563dc8e59a | ||
|
|
02a6176bd0 | ||
|
|
cc7055774d | ||
|
|
d540f7af72 | ||
|
|
239274cb1d | ||
|
|
fe6c25353c | ||
|
|
aca9496437 | ||
|
|
ce3c6472fb | ||
|
|
787bcef130 | ||
|
|
cf92776c64 | ||
|
|
1fc94e33b2 | ||
|
|
137f494619 | ||
|
|
df7e2a884b | ||
|
|
ac57797904 | ||
|
|
3c8aa18f70 | ||
|
|
0f4019cbb7 | ||
|
|
c3f2f12cb2 | ||
|
|
656a33863f | ||
|
|
0dcad9cc18 | ||
|
|
6bef1aeb82 | ||
|
|
3cd563622e | ||
|
|
66f88773c0 | ||
|
|
3ecb1fd5d9 | ||
|
|
7900479e9c | ||
|
|
731da455d4 | ||
|
|
b5791d4442 | ||
|
|
af7e301867 | ||
|
|
681c255bc5 | ||
|
|
8a30448fa7 | ||
|
|
fa6389a7e7 | ||
|
|
0c099dfbd0 | ||
|
|
fd40280300 | ||
|
|
5a48c3a921 | ||
|
|
68b6190c12 | ||
|
|
e2f4c70b70 | ||
|
|
7518854625 | ||
|
|
d1c0b8b0c9 | ||
|
|
0a2429b467 | ||
|
|
e37c54f38e | ||
|
|
4043923e56 | ||
|
|
76c10807d6 | ||
|
|
20698a7843 | ||
|
|
a4c24985e8 | ||
|
|
b26ac2bd0e | ||
|
|
c34ade9ffb | ||
|
|
5f0489ace0 | ||
|
|
96ee416b96 | ||
|
|
80133aaa79 | ||
|
|
6de4e3d4cd | ||
|
|
f652dd3436 | ||
|
|
9f98d0ae4a | ||
|
|
f369d99138 | ||
|
|
7e7e88e330 | ||
|
|
20bf46f309 | ||
|
|
f378c6d3ee | ||
|
|
b88307f875 | ||
|
|
255ff1a4b7 | ||
|
|
696659d6bc | ||
|
|
8a16e1ca7d | ||
|
|
39dee1410b | ||
|
|
c715254d54 | ||
|
|
d1f3ab5dec | ||
|
|
0fa74a7712 | ||
|
|
e69cc545b3 | ||
|
|
68f3e4483f | ||
|
|
e1ef1b759e | ||
|
|
1bd0f55945 | ||
|
|
a40381a700 | ||
|
|
9a34f5803c | ||
|
|
913478b21e | ||
|
|
2b3fad1261 | ||
|
|
bba2ee92bd | ||
|
|
c4aece4ab4 | ||
|
|
e74e56947b | ||
|
|
ce0b8149e9 | ||
|
|
5915d4ac6a | ||
|
|
940505569c | ||
|
|
8c46d00ee7 | ||
|
|
cc57f732d2 | ||
|
|
f410da2a0a | ||
|
|
cb39ce66bc | ||
|
|
eb0d52a249 | ||
|
|
2804c2ca99 | ||
|
|
71614bd639 | ||
|
|
78187ab8d1 | ||
|
|
6b4cc44060 | ||
|
|
61742f5d5a | ||
|
|
c330641866 | ||
|
|
33019ee496 | ||
|
|
b40b7cc40e | ||
|
|
17bcf91910 | ||
|
|
f04b5f2963 | ||
|
|
6ff99568cf | ||
|
|
0a220a3efb | ||
|
|
0bc3e26090 | ||
|
|
257bc70c2e | ||
|
|
6c1651cb3d | ||
|
|
01efb3b1a7 | ||
|
|
2ad3a117f1 | ||
|
|
e19c5bfcd7 | ||
|
|
f9ae5c0cb3 | ||
|
|
ac82366b9e | ||
|
|
b493855195 | ||
|
|
4bb8865e2f | ||
|
|
9c25aea327 | ||
|
|
cc5e96b23f | ||
|
|
0095d93686 | ||
|
|
1da3e2c711 | ||
|
|
73468e706e | ||
|
|
4894e0b18d | ||
|
|
f155b3003b | ||
|
|
4974b6874e | ||
|
|
1fac7981a4 | ||
|
|
b244277ff2 | ||
|
|
0c6f3ee19c | ||
|
|
12752c6970 | ||
|
|
39c38c44a3 | ||
|
|
f0944030b7 | ||
|
|
7eb7edb950 | ||
|
|
6a88a94a8b | ||
|
|
7e86f7196e | ||
|
|
eeeb33c9ac | ||
|
|
b8e412884b | ||
|
|
4d2691a2e1 | ||
|
|
3ce467a25f | ||
|
|
0710342317 | ||
|
|
d95f24b9d2 | ||
|
|
c456836ad5 | ||
|
|
be418e77f9 | ||
|
|
21a1f3a34d | ||
|
|
ebd34f1884 | ||
|
|
ba2596e318 | ||
|
|
d0af0eff9f | ||
|
|
d502eeba2b | ||
|
|
064c3d473c | ||
|
|
5a42083abd | ||
|
|
54cb55a7ae | ||
|
|
a709a0a682 | ||
|
|
029610fb40 | ||
|
|
1646edf513 | ||
|
|
e2781ea0f2 | ||
|
|
555ff81cbf | ||
|
|
003df89edf | ||
|
|
bfc2cc3aa3 | ||
|
|
eeab118a05 | ||
|
|
04458ea12b | ||
|
|
c951e348b4 | ||
|
|
2a988d453c | ||
|
|
b8b33c4f06 | ||
|
|
f2fa2f5067 | ||
|
|
001de1a915 | ||
|
|
f0f0fe38a3 | ||
|
|
2498da742d | ||
|
|
ad684ed0ea | ||
|
|
0d7d02da35 | ||
|
|
b78892934b | ||
|
|
c50b63c5f6 | ||
|
|
b0ff3dfb90 | ||
|
|
b2dbe8dfef | ||
|
|
9436b15528 | ||
|
|
d6e6bfbb5a | ||
|
|
3fbf765605 | ||
|
|
8e75a8d12d | ||
|
|
450d4b256a | ||
|
|
595e29186e | ||
|
|
c070f253ac | ||
|
|
46447ef55c | ||
|
|
6861705354 | ||
|
|
7d0f5dd4f9 | ||
|
|
cd499e3ab8 | ||
|
|
7244ff9e14 | ||
|
|
3c252e1d87 | ||
|
|
84896f4790 | ||
|
|
d4cbb0803b | ||
|
|
ff244fba6c | ||
|
|
49a4c06a88 | ||
|
|
361dc55dfd | ||
|
|
2ed2ee1da7 | ||
|
|
58876aefa3 | ||
|
|
77b123b02f | ||
|
|
114cb4e0d5 | ||
|
|
4a1b211876 | ||
|
|
d78f1e4eee | ||
|
|
5e14892ef8 | ||
|
|
9e4c8881b6 | ||
|
|
b8ba5274e2 | ||
|
|
aa4adb0dfd | ||
|
|
62a393bf12 | ||
|
|
a440339548 | ||
|
|
3c15314ed5 | ||
|
|
d3cec2f0d1 | ||
|
|
1158a928ec | ||
|
|
1bd2cbbef6 | ||
|
|
a9d757f3a0 | ||
|
|
9a854e9ab7 | ||
|
|
2cef55a4f6 | ||
|
|
5ea1502b02 | ||
|
|
99c6ef564e | ||
|
|
39e3ddb0ed | ||
|
|
defdea7b49 | ||
|
|
d249eb3f93 | ||
|
|
668c33fdcd | ||
|
|
7f26ce614b | ||
|
|
ada499ef14 | ||
|
|
6240729ee4 | ||
|
|
8f95cd4149 |
+54
-101
@@ -1,23 +1,32 @@
|
||||
version: 2.1
|
||||
orbs:
|
||||
go: gotest/tools@0.0.13
|
||||
aws-cli: circleci/aws-cli@1.3.2
|
||||
packer: salaxander/packer@0.0.3
|
||||
|
||||
executors:
|
||||
golang:
|
||||
docker:
|
||||
- image: circleci/golang:1.16.4
|
||||
- image: cimg/go:1.17.9
|
||||
resource_class: 2xlarge
|
||||
ubuntu:
|
||||
docker:
|
||||
- image: ubuntu:20.04
|
||||
packer:
|
||||
description: |
|
||||
The HashiCorp provided Packer container
|
||||
parameters:
|
||||
packer-version:
|
||||
type: string
|
||||
default: "1.8"
|
||||
docker:
|
||||
- image: hashicorp/packer:<< parameters.packer-version >>
|
||||
|
||||
|
||||
commands:
|
||||
install-deps:
|
||||
steps:
|
||||
- go/install-ssh
|
||||
- go/install: {package: git}
|
||||
- run: |
|
||||
sudo apt update
|
||||
sudo apt install python-is-python3
|
||||
prepare:
|
||||
parameters:
|
||||
linux:
|
||||
@@ -58,14 +67,14 @@ commands:
|
||||
- run: |
|
||||
apt update
|
||||
apt install -y wget
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512
|
||||
if [ "$(sha512sum go-ipfs_v0.4.22_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512)" ]
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
|
||||
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
|
||||
then
|
||||
echo "ipfs failed checksum check"
|
||||
exit 1
|
||||
fi
|
||||
tar -xf go-ipfs_v0.4.22_linux-amd64.tar.gz
|
||||
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
|
||||
mv go-ipfs/ipfs /usr/local/bin/ipfs
|
||||
chmod +x /usr/local/bin/ipfs
|
||||
git_fetch_all_tags:
|
||||
@@ -75,14 +84,38 @@ commands:
|
||||
command: |
|
||||
git fetch --all
|
||||
|
||||
packer_build:
|
||||
description: "Run a packer build"
|
||||
parameters:
|
||||
template:
|
||||
description: |
|
||||
The name of the packer template file
|
||||
type: string
|
||||
default: packer.json
|
||||
args:
|
||||
description: |
|
||||
Arguments to pass to the packer build command
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: "Run a packer build"
|
||||
command: packer build << parameters.args >> << parameters.template >>
|
||||
no_output_timeout: 30m
|
||||
|
||||
jobs:
|
||||
mod-tidy-check:
|
||||
executor: golang
|
||||
steps:
|
||||
- install-deps
|
||||
- prepare
|
||||
- go/mod-tidy-check
|
||||
|
||||
- run: go mod tidy -v
|
||||
- run:
|
||||
name: Check git diff
|
||||
command: |
|
||||
git --no-pager diff go.mod go.sum
|
||||
git --no-pager diff --quiet go.mod go.sum
|
||||
build-all:
|
||||
executor: golang
|
||||
steps:
|
||||
@@ -159,9 +192,6 @@ jobs:
|
||||
command: make deps lotus
|
||||
no_output_timeout: 30m
|
||||
- download-params
|
||||
- go/install-gotestsum:
|
||||
gobin: $HOME/.local/bin
|
||||
version: 0.5.2
|
||||
- run:
|
||||
name: go test
|
||||
environment:
|
||||
@@ -186,8 +216,6 @@ jobs:
|
||||
- when:
|
||||
condition: << parameters.codecov-upload >>
|
||||
steps:
|
||||
- go/install: {package: bash}
|
||||
- go/install: {package: curl}
|
||||
- run:
|
||||
shell: /bin/bash -eo pipefail
|
||||
command: |
|
||||
@@ -226,9 +254,6 @@ jobs:
|
||||
cd extern/test-vectors
|
||||
git fetch
|
||||
git checkout origin/<< parameters.vectors-branch >>
|
||||
- go/install-gotestsum:
|
||||
gobin: $HOME/.local/bin
|
||||
version: 0.5.2
|
||||
- run:
|
||||
name: install statediff globally
|
||||
command: |
|
||||
@@ -341,8 +366,8 @@ jobs:
|
||||
- run:
|
||||
name: Install go
|
||||
command: |
|
||||
curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
|
||||
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
|
||||
curl -O https://dl.google.com/go/go1.17.9.darwin-amd64.pkg && \
|
||||
sudo installer -pkg go1.17.9.darwin-amd64.pkg -target /
|
||||
- run:
|
||||
name: Install pkg-config
|
||||
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
|
||||
@@ -363,7 +388,6 @@ jobs:
|
||||
- restore_cache:
|
||||
name: restore cargo cache
|
||||
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
|
||||
- install-deps
|
||||
- run:
|
||||
command: make build
|
||||
no_output_timeout: 30m
|
||||
@@ -483,9 +507,6 @@ jobs:
|
||||
executor:
|
||||
type: executor
|
||||
default: golang
|
||||
golangci-lint-version:
|
||||
type: string
|
||||
default: 1.27.0
|
||||
concurrency:
|
||||
type: string
|
||||
default: '2'
|
||||
@@ -504,13 +525,10 @@ jobs:
|
||||
- run:
|
||||
command: make deps
|
||||
no_output_timeout: 30m
|
||||
- go/install-golangci-lint:
|
||||
gobin: $HOME/.local/bin
|
||||
version: << parameters.golangci-lint-version >>
|
||||
- run:
|
||||
name: Lint
|
||||
command: |
|
||||
$HOME/.local/bin/golangci-lint run -v --timeout 2m \
|
||||
golangci-lint run -v --timeout 2m \
|
||||
--concurrency << parameters.concurrency >> << parameters.args >>
|
||||
lint-all:
|
||||
<<: *lint
|
||||
@@ -685,52 +703,15 @@ jobs:
|
||||
docker push $<<parameters.account-url>>/<<parameters.repo>>:${tag}
|
||||
done
|
||||
|
||||
publish-packer-mainnet:
|
||||
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 -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-calibrationnet:
|
||||
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-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-butterflynet:
|
||||
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-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-snap:
|
||||
description: build packer image with snap. mainnet only.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
name: packer
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
- packer_build:
|
||||
template: tools/packer/lotus-snap.pkr.hcl
|
||||
publish-dockerhub:
|
||||
description: publish to dockerhub
|
||||
@@ -882,6 +863,11 @@ workflows:
|
||||
suite: itest-get_messages_in_ts
|
||||
target: "./itests/get_messages_in_ts_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-lookup_robust_address
|
||||
suite: itest-lookup_robust_address
|
||||
target: "./itests/lookup_robust_address_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-mempool
|
||||
suite: itest-mempool
|
||||
@@ -1032,9 +1018,6 @@ workflows:
|
||||
- build-lotus-soup
|
||||
- build-macos:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -1070,36 +1053,6 @@ workflows:
|
||||
repo: lotus-test
|
||||
tag: '${CIRCLE_SHA1:0:8}'
|
||||
target: lotus-test
|
||||
- publish-packer-mainnet:
|
||||
requires:
|
||||
- build-all
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-calibrationnet:
|
||||
requires:
|
||||
- build-ntwk-calibration
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-butterflynet:
|
||||
requires:
|
||||
- build-ntwk-butterfly
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-snapcraft:
|
||||
name: publish-snapcraft-stable
|
||||
channel: stable
|
||||
|
||||
+49
-101
@@ -1,23 +1,32 @@
|
||||
version: 2.1
|
||||
orbs:
|
||||
go: gotest/tools@0.0.13
|
||||
aws-cli: circleci/aws-cli@1.3.2
|
||||
packer: salaxander/packer@0.0.3
|
||||
|
||||
executors:
|
||||
golang:
|
||||
docker:
|
||||
- image: circleci/golang:1.16.4
|
||||
- image: cimg/go:1.17.9
|
||||
resource_class: 2xlarge
|
||||
ubuntu:
|
||||
docker:
|
||||
- image: ubuntu:20.04
|
||||
packer:
|
||||
description: |
|
||||
The HashiCorp provided Packer container
|
||||
parameters:
|
||||
packer-version:
|
||||
type: string
|
||||
default: "1.8"
|
||||
docker:
|
||||
- image: hashicorp/packer:<< parameters.packer-version >>
|
||||
|
||||
|
||||
commands:
|
||||
install-deps:
|
||||
steps:
|
||||
- go/install-ssh
|
||||
- go/install: {package: git}
|
||||
- run: |
|
||||
sudo apt update
|
||||
sudo apt install python-is-python3
|
||||
prepare:
|
||||
parameters:
|
||||
linux:
|
||||
@@ -58,14 +67,14 @@ commands:
|
||||
- run: |
|
||||
apt update
|
||||
apt install -y wget
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512
|
||||
if [ "$(sha512sum go-ipfs_v0.4.22_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512)" ]
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
|
||||
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
|
||||
then
|
||||
echo "ipfs failed checksum check"
|
||||
exit 1
|
||||
fi
|
||||
tar -xf go-ipfs_v0.4.22_linux-amd64.tar.gz
|
||||
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
|
||||
mv go-ipfs/ipfs /usr/local/bin/ipfs
|
||||
chmod +x /usr/local/bin/ipfs
|
||||
git_fetch_all_tags:
|
||||
@@ -75,14 +84,38 @@ commands:
|
||||
command: |
|
||||
git fetch --all
|
||||
|
||||
packer_build:
|
||||
description: "Run a packer build"
|
||||
parameters:
|
||||
template:
|
||||
description: |
|
||||
The name of the packer template file
|
||||
type: string
|
||||
default: packer.json
|
||||
args:
|
||||
description: |
|
||||
Arguments to pass to the packer build command
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: "Run a packer build"
|
||||
command: packer build << parameters.args >> << parameters.template >>
|
||||
no_output_timeout: 30m
|
||||
|
||||
jobs:
|
||||
mod-tidy-check:
|
||||
executor: golang
|
||||
steps:
|
||||
- install-deps
|
||||
- prepare
|
||||
- go/mod-tidy-check
|
||||
|
||||
- run: go mod tidy -v
|
||||
- run:
|
||||
name: Check git diff
|
||||
command: |
|
||||
git --no-pager diff go.mod go.sum
|
||||
git --no-pager diff --quiet go.mod go.sum
|
||||
build-all:
|
||||
executor: golang
|
||||
steps:
|
||||
@@ -159,9 +192,6 @@ jobs:
|
||||
command: make deps lotus
|
||||
no_output_timeout: 30m
|
||||
- download-params
|
||||
- go/install-gotestsum:
|
||||
gobin: $HOME/.local/bin
|
||||
version: 0.5.2
|
||||
- run:
|
||||
name: go test
|
||||
environment:
|
||||
@@ -186,8 +216,6 @@ jobs:
|
||||
- when:
|
||||
condition: << parameters.codecov-upload >>
|
||||
steps:
|
||||
- go/install: {package: bash}
|
||||
- go/install: {package: curl}
|
||||
- run:
|
||||
shell: /bin/bash -eo pipefail
|
||||
command: |
|
||||
@@ -226,9 +254,6 @@ jobs:
|
||||
cd extern/test-vectors
|
||||
git fetch
|
||||
git checkout origin/<< parameters.vectors-branch >>
|
||||
- go/install-gotestsum:
|
||||
gobin: $HOME/.local/bin
|
||||
version: 0.5.2
|
||||
- run:
|
||||
name: install statediff globally
|
||||
command: |
|
||||
@@ -341,8 +366,8 @@ jobs:
|
||||
- run:
|
||||
name: Install go
|
||||
command: |
|
||||
curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
|
||||
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
|
||||
curl -O https://dl.google.com/go/go1.17.9.darwin-amd64.pkg && \
|
||||
sudo installer -pkg go1.17.9.darwin-amd64.pkg -target /
|
||||
- run:
|
||||
name: Install pkg-config
|
||||
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
|
||||
@@ -363,7 +388,6 @@ jobs:
|
||||
- restore_cache:
|
||||
name: restore cargo cache
|
||||
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
|
||||
- install-deps
|
||||
- run:
|
||||
command: make build
|
||||
no_output_timeout: 30m
|
||||
@@ -483,9 +507,6 @@ jobs:
|
||||
executor:
|
||||
type: executor
|
||||
default: golang
|
||||
golangci-lint-version:
|
||||
type: string
|
||||
default: 1.27.0
|
||||
concurrency:
|
||||
type: string
|
||||
default: '2'
|
||||
@@ -504,13 +525,10 @@ jobs:
|
||||
- run:
|
||||
command: make deps
|
||||
no_output_timeout: 30m
|
||||
- go/install-golangci-lint:
|
||||
gobin: $HOME/.local/bin
|
||||
version: << parameters.golangci-lint-version >>
|
||||
- run:
|
||||
name: Lint
|
||||
command: |
|
||||
$HOME/.local/bin/golangci-lint run -v --timeout 2m \
|
||||
golangci-lint run -v --timeout 2m \
|
||||
--concurrency << parameters.concurrency >> << parameters.args >>
|
||||
lint-all:
|
||||
<<: *lint
|
||||
@@ -685,52 +703,15 @@ jobs:
|
||||
docker push $<<parameters.account-url>>/<<parameters.repo>>:${tag}
|
||||
done
|
||||
|
||||
publish-packer-mainnet:
|
||||
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 -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-calibrationnet:
|
||||
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-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-butterflynet:
|
||||
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-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-snap:
|
||||
description: build packer image with snap. mainnet only.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
name: packer
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
- packer_build:
|
||||
template: tools/packer/lotus-snap.pkr.hcl
|
||||
publish-dockerhub:
|
||||
description: publish to dockerhub
|
||||
@@ -837,9 +818,6 @@ workflows:
|
||||
- build-lotus-soup
|
||||
- build-macos:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -875,36 +853,6 @@ workflows:
|
||||
repo: lotus-test
|
||||
tag: '${CIRCLE_SHA1:0:8}'
|
||||
target: lotus-test
|
||||
- publish-packer-mainnet:
|
||||
requires:
|
||||
- build-all
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-calibrationnet:
|
||||
requires:
|
||||
- build-ntwk-calibration
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-butterflynet:
|
||||
requires:
|
||||
- build-ntwk-butterfly
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-snapcraft:
|
||||
name: publish-snapcraft-stable
|
||||
channel: stable
|
||||
|
||||
+5
-4
@@ -17,6 +17,7 @@ coverage:
|
||||
status:
|
||||
patch: off
|
||||
project:
|
||||
threshold: 1%
|
||||
tools-and-tests:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
@@ -34,27 +35,27 @@ coverage:
|
||||
markets:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: false
|
||||
informational: true
|
||||
paths:
|
||||
- "markets"
|
||||
- "paychmgr"
|
||||
miner:
|
||||
target: auto
|
||||
threshold: 1.5%
|
||||
informational: false
|
||||
informational: true
|
||||
paths:
|
||||
- "miner"
|
||||
- "storage"
|
||||
chain:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: false
|
||||
informational: true
|
||||
paths:
|
||||
- "chain"
|
||||
node:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: false
|
||||
informational: true
|
||||
paths:
|
||||
- "node"
|
||||
- "blockstore"
|
||||
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.16.4'
|
||||
go-version: '1.17.9'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
@@ -41,6 +41,7 @@ build/paramfetch.sh
|
||||
/darwin
|
||||
/linux
|
||||
*.snap
|
||||
build/builtin-actors
|
||||
|
||||
*-fuzz.zip
|
||||
/chain/types/work_msg/
|
||||
|
||||
+5
-2
@@ -25,7 +25,7 @@ skip-dirs:
|
||||
|
||||
issues:
|
||||
exclude:
|
||||
- "func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this"
|
||||
- "by other packages, and that stutters; consider calling this"
|
||||
- "Potential file inclusion via variable"
|
||||
- "should have( a package)? comment"
|
||||
- "Error return value of `logging.SetLogLevel` is not checked"
|
||||
@@ -37,6 +37,9 @@ issues:
|
||||
- "string .* has .* occurrences, make it a constant"
|
||||
- "a blank import should be only in a main or test package, or have a comment justifying it"
|
||||
- "package comment should be of the form"
|
||||
- "Potential hardcoded credentials"
|
||||
- "Use of weak random number generator"
|
||||
- "xerrors.* is deprecated"
|
||||
|
||||
exclude-use-default: false
|
||||
exclude-rules:
|
||||
@@ -51,7 +54,7 @@ issues:
|
||||
- path: build/params_.*\.go
|
||||
linters:
|
||||
- golint
|
||||
|
||||
|
||||
- path: api/apistruct/struct.go
|
||||
linters:
|
||||
- golint
|
||||
|
||||
+348
@@ -1,5 +1,353 @@
|
||||
# Lotus changelog
|
||||
|
||||
# 1.15.3 / 2022-05-31
|
||||
|
||||
This is an optional release of lotus that include new APIs, some improvements and bug fixes.
|
||||
|
||||
## New Features
|
||||
- feat: api: add StateGetNetworkParams api ([filecoin-project/lotus#8546](https://github.com/filecoin-project/lotus/pull/8546))
|
||||
- feat: api: Implement StateLookupRobustAddress ([filecoin-project/lotus#8486](https://github.com/filecoin-project/lotus/pull/8486))
|
||||
- sealing: DataCid on workers ([filecoin-project/lotus#8557](https://github.com/filecoin-project/lotus/pull/8557))
|
||||
- feat: FVM: Support exectraces ([filecoin-project/lotus#8514](https://github.com/filecoin-project/lotus/pull/8514))
|
||||
|
||||
## Improvements
|
||||
- ux: wallet: update delete usage ([filecoin-project/lotus#8442](https://github.com/filecoin-project/lotus/pull/8442))
|
||||
- chore: config: default-disable kvlog ([filecoin-project/lotus#8477](https://github.com/filecoin-project/lotus/pull/8477))
|
||||
- chore: cli: Alias cli commands for uniformity ([filecoin-project/lotus#8587](https://github.com/filecoin-project/lotus/pull/8587))
|
||||
|
||||
## Bug Fixes
|
||||
- fix: Make deal making logs much less noisy ([filecoin-project/lotus#8622](https://github.com/filecoin-project/lotus/pull/8622))
|
||||
- fix: mpool: avoid deadlock on unsubscribe ([filecoin-project/lotus#8635](https://github.com/filecoin-project/lotus/pull/8635))
|
||||
- fix: update StatApplied when fvm apply message ([filecoin-project/lotus#8545](https://github.com/filecoin-project/lotus/pull/8545))
|
||||
- fix: ci: build macos and linux assets on tagged releases ([filecoin-project/lotus#8597](https://github.com/filecoin-project/lotus/pull/8597))
|
||||
- fix: Clean up vanilla proof fetching errors for proper display ([filecoin-project/lotus#8564](https://github.com/filecoin-project/lotus/pull/8564))
|
||||
- fix: Make markets logger less noisy when doing retrievals ([filecoin-project/lotus#8604](https://github.com/filecoin-project/lotus/pull/8604))
|
||||
- fix: test: Fix flaky TestGatewayWalletMsig ([filecoin-project/lotus#8601](https://github.com/filecoin-project/lotus/pull/8601))
|
||||
- fix: lotus-wallet: correct network in version ([filecoin-project/lotus#8563](https://github.com/filecoin-project/lotus/pull/8563))
|
||||
- fix: worker: Download proofs if PRU2 is enabled ([filecoin-project/lotus#8555](https://github.com/filecoin-project/lotus/pull/8555))
|
||||
- fix: ux: update `lotus-wallet run` description ([filecoin-project/lotus#8528](https://github.com/filecoin-project/lotus/pull/8528))
|
||||
- fix: market: Infer index provider topic from network name by default ([filecoin-project/lotus#8526](https://github.com/filecoin-project/lotus/pull/8526))
|
||||
- fix: storiface: Make FSOverhead numbers more accurate ([filecoin-project/lotus#8481](https://github.com/filecoin-project/lotus/pull/8481))
|
||||
- fix: node: fix comment for IndexProvider ([filecoin-project/lotus#8480](https://github.com/filecoin-project/lotus/pull/8480))
|
||||
- fix: sealing: fail to add expired precommits to a batch ([filecoin-project/lotus#8479](https://github.com/filecoin-project/lotus/pull/8479))
|
||||
- fix:sealing:check index out of bounds against correct param length not return length ([filecoin-project/lotus#8475](https://github.com/filecoin-project/lotus/pull/8475))
|
||||
- fix: sealing: Finalize snap sectors before submitting proofs ([filecoin-project/lotus#8582](https://github.com/filecoin-project/lotus/pull/8582))
|
||||
- chore: fix lint issue ([filecoin-project/lotus#8531](https://github.com/filecoin-project/lotus/pull/8531))
|
||||
- feat: vm: add actor error backtraces to FVM ([filecoin-project/lotus#8524](https://github.com/filecoin-project/lotus/pull/8524))
|
||||
|
||||
## Dependency Updates
|
||||
- github.com/filecoin-project/specs-storage (v0.2.2 -> v0.2.3-0.20220426183226-1a0a63c5990f):
|
||||
- deps: update go-libp2p@v0.19 ([filecoin-project/lotus#8511](https://github.com/filecoin-project/lotus/pull/8511))
|
||||
- chore: deps: Use tagged version of specs-storage #8764
|
||||
|
||||
## Others
|
||||
- chore: merge releases back into master ([filecoin-project/lotus#8638](https://github.com/filecoin-project/lotus/pull/8638))
|
||||
- chore:ci:make codecov quiet ([filecoin-project/lotus#8600](https://github.com/filecoin-project/lotus/pull/8600))
|
||||
- chore: version: bump the version to v1.15.3-dev ([filecoin-project/lotus#8473](https://github.com/filecoin-project/lotus/pull/8473))
|
||||
- chore: .gitignore: ignore built in actor bundles ([filecoin-project/lotus#8590](https://github.com/filecoin-project/lotus/pull/8590))
|
||||
- ci: deps: macos build deps ([filecoin-project/lotus#8581](https://github.com/filecoin-project/lotus/pull/8581))
|
||||
- chore:chore:chore remove the wrong TODO ([filecoin-project/lotus#8586](https://github.com/filecoin-project/lotus/pull/8586))
|
||||
- add 1475 bootstrapper ([filecoin-project/lotus#8495](https://github.com/filecoin-project/lotus/pull/8495))
|
||||
- Bump version for xtools ([filecoin-project/lotus#8494](https://github.com/filecoin-project/lotus/pull/8494))
|
||||
- chore: bundle: remove wrongly committed bundle cars #8763
|
||||
## Contributors
|
||||
|
||||
| Contributor | Commits | Lines ± | Files Changed |
|
||||
|-------------|---------|---------|---------------|
|
||||
| @stebalien | 4 | +607/-95 | 19 |
|
||||
| @magik6k | 9 | +550/-37 | 43 |
|
||||
| @geoff-vball | 5 | +279/-219 | 27 |
|
||||
| @simlecode | 1 | +306/-39 | 20 |
|
||||
| @arajasek | 1 | +256/-34 | 10 |
|
||||
| @zenground0 | 11 | +214/-66 | 31 |
|
||||
| @arajasek | 2 | +149/-99 | 8 |
|
||||
| @vyzo | 3 | +125/-81 | 4 |
|
||||
| @Masih| 1 | +134/-15 | 7 |
|
||||
| @travisperson | 3 | +24/-32 | 6 |
|
||||
| @Rjan | 6 | +16/-16 | 9 |
|
||||
| @jennijuju | 3 | +9/-8 | 15 |
|
||||
| Rob Quist | 3 | +12/-4 | 3 |
|
||||
| @Icarus9913 | 1 | +3/-3 | 3 |
|
||||
| @swift-mx | 1 | +3/-0 | 1 |
|
||||
| @Phi-rjan | 1 | +1/-1 | 1 |
|
||||
| @lifei | 1 | +1/-0 | 1 |
|
||||
|
||||
|
||||
# 1.15.2 / 2022-05-06
|
||||
|
||||
This is a highly recommended feature lotus release v1.15.2. This feature release introduces many new features and for SPs, including PoSt workers, sealing scheduler, snap deal queue and so on.
|
||||
|
||||
Note: You need to be using go v1.17.9&up from this release onwards.
|
||||
|
||||
## Highlights
|
||||
### ❣️❣️❣️ PoSt Workers ❣️❣️❣️
|
||||
‼️️Attention - the long-awaited yet highly requested PoSt workers, they are here! And they come in as a combo: you may setup PoSt workers for both winningPoSt or/and windowPoSt worker. You can also setup any number of PoSt workers as long as you have the hardware resources!
|
||||
For more details and learn how to set it up, see the docs [here](https://lotus.filecoin.io/storage-providers/seal-workers/post-workers/). You can also find early result of the PoSt workers performance by the community [here](https://github.com/filecoin-project/lotus/discussions/8375).
|
||||
- feat: PoSt workers ([filecoin-project/lotus#7971](https://github.com/filecoin-project/lotus/pull/7971))
|
||||
- feat: storage: Parallel proving checks ([filecoin-project/lotus#8391](https://github.com/filecoin-project/lotus/pull/8391))
|
||||
- adjust `ParallelCheckLimit` according to your resource setup to get pre-post checkers run faster!
|
||||
|
||||
In addition, we also added some handy toolings:
|
||||
- feat: miner: API/CLI to compute window-post ([filecoin-project/lotus#8389](https://github.com/filecoin-project/lotus/pull/8389))
|
||||
- run `lotus-miner proving compute window-post` to manually trigger a full windowPoSt computation for a specific deadline for full sanity checks.
|
||||
- feat: miner cli: Separate proving workers command ([filecoin-project/lotus#8379](https://github.com/filecoin-project/lotus/pull/8379))
|
||||
- run `lotus-miner proving workers` to list all the PoSt workers that's attached
|
||||
- feat: miner cli: proving check --faulty, faults in storage list sectors ([filecoin-project/lotus#8349](https://github.com/filecoin-project/lotus/pull/8349))
|
||||
- run `lotus-miner proving check --faulty` to identify the sectors that might be bad.
|
||||
|
||||
### 🔥🔥🔥 Sealing Scheduler Enhancement 🔥🔥🔥
|
||||
|
||||
Have you ever got a couple workers but only a few of them are super packed, while the rest are idling waiting for jobs? Now the task can be distributed more evenly with:
|
||||
- feat: sched: Improve worker assigning logic ([filecoin-project/lotus#8447](https://github.com/filecoin-project/lotus/pull/8447))
|
||||
|
||||
### 🌟🌟🌟 Snap Deal Enhancements 🌟🌟🌟
|
||||
|
||||
The Filecoin Network introduced Snap Deal with the network v15 OhSnap upgrade, and lotus shipped v1.14.0 with basic snappy support for SP to use this feature. Since then, we have received good ux feedbacks and bug reports from the community, and we are introducing a couple enhancement for SPs to better leverage this feature.
|
||||
|
||||
- feat: sealing: Sector upgrade queue ([filecoin-project/lotus#8330](https://github.com/filecoin-project/lotus/pull/8330))
|
||||
- Snap up CCs to be ready for deals automatically, learn more [here](https://lotus.filecoin.io/storage-providers/operate/snap-deals/#snap-deal-queue)
|
||||
- feat: sealing: More SnapDeals config knobs ([filecoin-project/lotus#8343](https://github.com/filecoin-project/lotus/pull/8343))
|
||||
- SPs can now set `PreferNewSectorsForDeals` and `MaxUpgradingSectors` to better manage their sealing/dealing pipeline.
|
||||
- feat: config: Move MakeNewSectorForDeals config into the Sealing sectoin ([filecoin-project/lotus#8378](https://github.com/filecoin-project/lotus/pull/8378))
|
||||
- fix: sealing: Release unsealed sector files after snapdeals abort ([filecoin-project/lotus#8438](https://github.com/filecoin-project/lotus/pull/8438))
|
||||
- fix: sealing: always do cooldown in handleSubmitReplicaUpdateFailed ([filecoin-project/lotus#8353](https://github.com/filecoin-project/lotus/pull/8353))
|
||||
- fix: storagefsm: Fix error loop on bad event ([filecoin-project/lotus#8338](https://github.com/filecoin-project/lotus/pull/8338))
|
||||
- fix: sealing: Remove sector copies from workers after snapdeals ([filecoin-project/lotus#8329](https://github.com/filecoin-project/lotus/pull/8329))
|
||||
|
||||
## New Features
|
||||
- enable rcmgr by default ([filecoin-project/lotus#8470](https://github.com/filecoin-project/lotus/pull/8470))
|
||||
- feat: cli: lotus client list-asks --protocols ([filecoin-project/lotus#8464](https://github.com/filecoin-project/lotus/pull/8464))
|
||||
- feat: shed: Multi-file vlog2car ([filecoin-project/lotus#8426](https://github.com/filecoin-project/lotus/pull/8426))
|
||||
- feat: worker: check fd limit on startup ([filecoin-project/lotus#8390](https://github.com/filecoin-project/lotus/pull/8390))
|
||||
- feat: lotus-shed: add command to compute state over a range of tipsets. ([filecoin-project/lotus#8371](https://github.com/filecoin-project/lotus/pull/8371))
|
||||
- feat: cli/net: implement 'net ping' command ([filecoin-project/lotus#8357](https://github.com/filecoin-project/lotus/pull/8357))
|
||||
- feat: stmgr: call: use a buffered concurrent-access blockstore ([filecoin-project/lotus#8358](https://github.com/filecoin-project/lotus/pull/8358))
|
||||
- feat: infra/ci: add `lotus-test` image as CI build step ([filecoin-project/lotus#7956](https://github.com/filecoin-project/lotus/pull/7956))
|
||||
- feat: multisig: lotus-sheed miner-multisig change-worker command. ([filecoin-project/lotus#8281](https://github.com/filecoin-project/lotus/pull/8281))
|
||||
- feat: Add additional test annotations (#8272) ([filecoin-project/lotus#8272](https://github.com/filecoin-project/lotus/pull/8272))
|
||||
|
||||
## Improvements
|
||||
- Revert appimage removal ([filecoin-project/lotus#8439](https://github.com/filecoin-project/lotus/pull/8439))
|
||||
- sealing: Don't panic in ReleaseUnsealed with no ranges ([filecoin-project/lotus#8461](https://github.com/filecoin-project/lotus/pull/8461))
|
||||
- testkit: give up on waiting for the RPC server to shutdown after 1s ([filecoin-project/lotus#8450](https://github.com/filecoin-project/lotus/pull/8450))
|
||||
- chore: events: implement event observer deregister method ([filecoin-project/lotus#8441](https://github.com/filecoin-project/lotus/pull/8441))
|
||||
- Thread safe piecereader ([filecoin-project/lotus#8397](https://github.com/filecoin-project/lotus/pull/8397))
|
||||
- VM: Refactor pricelist to be based on network versions ([filecoin-project/lotus#8369](https://github.com/filecoin-project/lotus/pull/8369))
|
||||
- --max-piece-size in set-ask is no longer required ([filecoin-project/lotus#8361](https://github.com/filecoin-project/lotus/pull/8361))
|
||||
- refactor: convert RepoType from int to interface ([filecoin-project/lotus#8086](https://github.com/filecoin-project/lotus/pull/8086))
|
||||
- Shed: fix error message ([filecoin-project/lotus#8340](https://github.com/filecoin-project/lotus/pull/8340))
|
||||
|
||||
## Bug Fixes
|
||||
- fix: FVM: add finality check for consensus faults ([filecoin-project/lotus#8452](https://github.com/filecoin-project/lotus/pull/8452))
|
||||
- fix: market: Reuse the market `PubSub` in index provider ([filecoin-project/lotus#8443](https://github.com/filecoin-project/lotus/pull/8443))
|
||||
- fix: market: set all index provider options based on lotus config ([filecoin-project/lotus#8444](https://github.com/filecoin-project/lotus/pull/8444))
|
||||
- release worker tracker lock when call cb func ([filecoin-project/lotus#8206](https://github.com/filecoin-project/lotus/pull/8206))
|
||||
- fix: node: Fix market node startup ([filecoin-project/lotus#8425](https://github.com/filecoin-project/lotus/pull/8425))
|
||||
- fix: sealing: Fix PR1 worker selection ([filecoin-project/lotus#8420](https://github.com/filecoin-project/lotus/pull/8420))
|
||||
- fix: go: make Go 1.18 builds work ([filecoin-project/lotus#8410](https://github.com/filecoin-project/lotus/pull/8410))
|
||||
- fix: sealing: Added error checking ([filecoin-project/lotus#8404](https://github.com/filecoin-project/lotus/pull/8404))
|
||||
- fix: ux: Change Propose-worker msg ([filecoin-project/lotus#8384](https://github.com/filecoin-project/lotus/pull/8384))
|
||||
- fix: miner: dead loop on removing sector ([filecoin-project/lotus#8386](https://github.com/filecoin-project/lotus/pull/8386))
|
||||
- fix: worker: Fix default value handling ([filecoin-project/lotus#8380](https://github.com/filecoin-project/lotus/pull/8380))
|
||||
- Revert "Update params for interopnet for fvm" ([filecoin-project/lotus#8374](https://github.com/filecoin-project/lotus/pull/8374))
|
||||
- fix: cli: Reset miner/ask lists in interactive deal 'miner' step (#8155) ([filecoin-project/lotus#8155](https://github.com/filecoin-project/lotus/pull/8155))
|
||||
- fix:snapup: Rename error message ([filecoin-project/lotus#8370](https://github.com/filecoin-project/lotus/pull/8370))
|
||||
- fix: multisig: Print "waiting for confirmation.." ([filecoin-project/lotus#8368](https://github.com/filecoin-project/lotus/pull/8368))
|
||||
- fix: lotus-wallet: pass correct repo type to repo.Init ([filecoin-project/lotus#8356](https://github.com/filecoin-project/lotus/pull/8356))
|
||||
- fix: avoid racy memstores when estimating gas ([filecoin-project/lotus#8351](https://github.com/filecoin-project/lotus/pull/8351))
|
||||
- fix: itests: Don't hang on exit in MineBlocksMustPost ([filecoin-project/lotus#8345](https://github.com/filecoin-project/lotus/pull/8345))
|
||||
- fix: miner cli: Estimate deal weight in sector list when upgrading ([filecoin-project/lotus#8336](https://github.com/filecoin-project/lotus/pull/8336))
|
||||
- fix: sealing: FinalizeSector doesn't need sealed replica access ([filecoin-project/lotus#8337](https://github.com/filecoin-project/lotus/pull/8337))
|
||||
- fix: cli: add ArgsUsage field to clientGetDealCmd ([filecoin-project/lotus#8241](https://github.com/filecoin-project/lotus/pull/8241))
|
||||
- fix: market: Infer index provider topic from network name by default #8533
|
||||
- fix: deps: Update to FFI with logger bump #8588
|
||||
- fix: sealing: Finalize snap sectors before submitting proofs #8588
|
||||
|
||||
## Dependency Updates
|
||||
- deps: update go-libp2p@v0.19 #8533
|
||||
- deps: ffi: update ffi that includes the log fix #8577
|
||||
- deps: ffi: pull ffi that includes the latest fvm ([filecoin-project/lotus#8424](https://github.com/filecoin-project/lotus/pull/8424))
|
||||
- Update to go-log 2.5.1 ([filecoin-project/lotus#8422](https://github.com/filecoin-project/lotus/pull/8422))
|
||||
- chore(deps): update go-data-transfer with fixes (master edition) ([filecoin-project/lotus#8411](https://github.com/filecoin-project/lotus/pull/8411))
|
||||
- deps: update ffi with actor v7.1.0 and fvm that uses the bundle that includes the new manifest ([filecoin-project/lotus#8402](https://github.com/filecoin-project/lotus/pull/8402))
|
||||
- Update to specs-storage v0.2.2 ([filecoin-project/lotus#8400](https://github.com/filecoin-project/lotus/pull/8400))
|
||||
- chore: ffi: the latest fvm release ([filecoin-project/lotus#8381](https://github.com/filecoin-project/lotus/pull/8381))
|
||||
- Update params for interopnet for fvm ([filecoin-project/lotus#8119](https://github.com/filecoin-project/lotus/pull/8119))
|
||||
- github.com/filecoin-project/specs-storage (v0.2.0 -> v0.2.2):
|
||||
- ci: deps: macos build deps #8588
|
||||
|
||||
## Others
|
||||
- chore: merge releases back to master ([filecoin-project/lotus#8468](https://github.com/filecoin-project/lotus/pull/8468))
|
||||
- Packer publish copy orb ([filecoin-project/lotus#8413](https://github.com/filecoin-project/lotus/pull/8413))
|
||||
- chore: Remove temp gomock reflect file ([filecoin-project/lotus#8372](https://github.com/filecoin-project/lotus/pull/8372))
|
||||
- chore: FVM: log when fvm is used ([filecoin-project/lotus#8363](https://github.com/filecoin-project/lotus/pull/8363))
|
||||
- lib: extract unixfs filestore into lib ([filecoin-project/lotus#8354](https://github.com/filecoin-project/lotus/pull/8354))
|
||||
- test: use `T.TempDir` to create temporary test directory ([filecoin-project/lotus#8295](https://github.com/filecoin-project/lotus/pull/8295))
|
||||
- Update Dockerfile.lotus
|
||||
- chore:sealing:remove endpoint from cli ([filecoin-project/lotus#8215](https://github.com/filecoin-project/lotus/pull/8215))
|
||||
- chore: build: bump the master version to v1.15.2-dev ([filecoin-project/lotus#8322](https://github.com/filecoin-project/lotus/pull/8322))
|
||||
- chore: fix lint issue #8533
|
||||
|
||||
## Contributors
|
||||
|
||||
| Contributor | Commits | Lines ± | Files Changed |
|
||||
|-------------|---------|---------|---------------|
|
||||
| @magik6k | 95 | +5147/-2922 | 401 |
|
||||
| @mz-sirius | 3 | +1789/-546 | 48 |
|
||||
| @nonsense | 11 | +777/-567 | 121 |
|
||||
| @arajasek | 11 | +336/-231 | 28 |
|
||||
| Darko Brdareski | 1 | +463/-13 | 95 |
|
||||
| @coryschwartz | 11 | +147/-217 | 13 |
|
||||
| spark8899 | 2 | +300/-0 | 2 |
|
||||
| @zenground0 | 2 | +6/-193 | 7 |
|
||||
| Eng Zer Jun | 1 | +31/-158 | 11 |
|
||||
| Kevin Li | 2 | +174/-0 | 14 |
|
||||
| @arajasek | 5 | +85/-86 | 18 |
|
||||
| @jennijuju | 1 | +0/-119 | 3 |
|
||||
| @jennijuju | 1 | +0/-98 | 6 |
|
||||
| @raulk | 1 | +60/-1 | 1 |
|
||||
| @frrist | 1 | +56/-0 | 2 |
|
||||
| @vyzo | 3 | +18/-16 | 5 |
|
||||
| @Masih | 3 | +29/-4 | 3 |
|
||||
| @jennijuju | 4 | +18/-11 | 11 |
|
||||
| @hannahhoward | 1 | +13/-10 | 2 |
|
||||
| @dirkmc | 1 | +21/-1 | 1 |
|
||||
| koalacxr | 1 | +10/-11 | 4 |
|
||||
| Aarsh Shah | 1 | +19/-1 | 1 |
|
||||
| @Rjan | 6 | +10/-8 | 7 |
|
||||
| @zl | 1 | +7/-1 | 1 |
|
||||
| KAYUII | 1 | +3/-2 | 1 |
|
||||
| @simlecode | 1 | +4/-0 | 1 |
|
||||
| @dirkmc | 1 | +1/-3 | 1 |
|
||||
| Jerry | 1 | +3/-0 | 1 |
|
||||
| @steblian | 1 | +1/-1 | 1 |
|
||||
| Geoff Stuart | 1 | +1/-0 | 1 |
|
||||
| Florian Ruen | 1 | +0/-1 | 1 |
|
||||
|
||||
# 1.15.1 / 2022-04-07
|
||||
|
||||
This is a *HIGHLY recommended* feature release v1.15.1, especially for node operators and storage providers who want to be a part of the content addressing network of Filecoin and IPFS.
|
||||
This feature release introduces Index Provider, GraphSync v2, and many other latest functionalities, improvements and bug fixes. More importantly, node operator can now enable the FVM(experimental) to sync mainnet!!
|
||||
|
||||
## Highlights
|
||||
|
||||
### 🔥🔥🔥 FVM (Experimental) 🔥🔥🔥
|
||||
- feat: fvm: FVM integration ([filecoin-project/lotus#8332](https://github.com/filecoin-project/lotus/pull/8332))
|
||||
The lotus team is excited to announce the launch of experimental non-programmable FVM on mainnet. By enabling `"LOTUS_USE_FVM_EXPERIMENTAL=1` envvar, the lotus daemon will be running the [WASM-compiled built-in actors](https://github.com/filecoin-project/builtin-actors) that is compatible with the existing chain(Network v15 OhSnap). If you are trying it out and having any questions or feedbacks, please leave a comment [here](https://github.com/filecoin-project/lotus/discussions/8334)!
|
||||
- chore: FVM: log when fvm is used([filecoin-project/lotus#8363](https://github.com/filecoin-project/lotus/pull/8363))
|
||||
- chore: ffi: the latest fvm release([filecoin-project/lotus#8382](https://github.com/filecoin-project/lotus/pull/8382))
|
||||
|
||||
### 🌟🌟🌟 Index Provider (Production Ready!) 🌟🌟🌟
|
||||
- feat: markets: Integrate index ingest protocol and retrieve by any CID ([filecoin-project/lotus#7313](https://github.com/filecoin-project/lotus/pull/7313))
|
||||
|
||||
More and more useful data is being stored on Filecoin via deals made by clients to Storage Providers. The goal is that this content is discoverable when people need them. To achieve that goal, one of the projects [the Bedrock team](https://www.notion.so/pl-strflt/Bedrock-2e956d5d8143432080a1d84435ccf0ff) is working on is building an Indexer Ecosystem, a project that's focus on content addressing on Filecoin, then potentially have interoperability with IPFS in the future and eventually serve the retrieval market. The Indexer Ecosystem high level architecture overview diagram can be found [here](https://github.com/filecoin-project/storetheindex/blob/main/doc/indexer_ecosys.png) and a detailed write up about can be found [here](https://www.notion.so/pl-strflt/Introducing-Indexer-to-SP-90bf296794174a8281c121d4ce6747a0).
|
||||
|
||||
That being said, with this release, lotus Storage Providers can easily become an Index Provider and serve the Indexer Content Addressing System. Index Providers generate advertisements from the deals made by a storage provider and announces the data to the indexer nodes for further processing:
|
||||
- To learn more about *what is an Index Provider and how to be an Index Provider*, read it [here](https://lotus.filecoin.io/storage-providers/operate/index-provider/) in lotus docuementation.
|
||||
- An [one-off migration](https://lotus.filecoin.io/storage-providers/operate/index-provider/#first-time-migration) is needed in order for a Storage Provider to become an Index Provider and announce the proper formatted index. It's *highly recommended* for all Index Provider to do a [force bulk initialization](https://lotus.filecoin.io/storage-providers/configure/dagstore/#forcing-bulk-initialization) to enable index announcement on all existing deals.
|
||||
- Note that the Initialization places IO workload on your storage system. SP should set a proper `concurrency` based on your hardware or can stop/start initialization at their wish/convenience as proving deadlines approach and elapse, to avoid IOPS starvation or competition with window PoSt.
|
||||
- After the first one-time migration, being an Index Provider barely puts any extra usage on SP's market system.
|
||||
- You can find the testing result by SPX fellows [here](https://github.com/filecoin-project/lotus/discussions/8087).
|
||||
|
||||
We recommend all Storage Providers that are serving deals in the Filecoin network to become a Index Provider, make the data you are storing discoverable for the retrieval market and retrieval clients!
|
||||
- If you have any questions about becoming an index provider, or the indexer system in general, leave a comment [here](https://github.com/filecoin-project/lotus/discussions/8341).
|
||||
- Follow the indexer project at https://github.com/filecoin-project/go-indexer-core.
|
||||
- If you have any feature request or bug reports of running an index provider, create an issue in https://github.com/filecoin-project/index-provider.
|
||||
- You may also join the #storetheindex channel in the Filecoin Slack to engage with the team & the community!
|
||||
|
||||
### ❗️❗️❗️ Dag Migration For New CAR index format in DagStore ❗️❗️❗️
|
||||
The index provider leverages the latest CARv2 indexing format `MultihashIndexSorted`, which stores the multihash code as well as the digest of all CIDs in a CAR file. Thus, all Storage Providers SHOULD perform an one-off DAG mirgation to regenerate DagStore CARv2 indices. You have to do it to become an index provider, failing to do so may also impact your future deal making.
|
||||
Follow the instruction [here](https://lotus.filecoin.io/storage-providers/operate/index-provider/) to perform the migration.
|
||||
|
||||
## New Features
|
||||
- feat: sealing: Sector upgrade queue ([filecoin-project/lotus#8333](https://github.com/filecoin-project/lotus/pull/8333))
|
||||
- see more details in docs: [here](https://lotus.filecoin.io/storage-providers/operate/snap-deals/#snap-deal-queue)
|
||||
- feat: market utils: Support unixfsnode in TraverseDag ([filecoin-project/lotus#8168](https://github.com/filecoin-project/lotus/pull/8168))
|
||||
- feat: config: enable indexer providing by default ([filecoin-project/lotus#8314](https://github.com/filecoin-project/lotus/pull/8314))
|
||||
- feat: api: Make ClientCalcCommP multithreaded ([filecoin-project/lotus#8276](https://github.com/filecoin-project/lotus/pull/8276))
|
||||
- feat: config: Persistent subsystem log level config ([filecoin-project/lotus#8283](https://github.com/filecoin-project/lotus/pull/8283))
|
||||
- feat: shed: blockstore/vlog to car export cmds ([filecoin-project/lotus#8265](https://github.com/filecoin-project/lotus/pull/8265))
|
||||
- feat: shed: ItestD ([filecoin-project/lotus#8290](https://github.com/filecoin-project/lotus/pull/8290))
|
||||
- feat: Make add piece idempotent ([filecoin-project/lotus#8160](https://github.com/filecoin-project/lotus/pull/8160))
|
||||
- feat: paychmgr: Support paych funding (a.k.a. fast paid retrieval) ([filecoin-project/lotus#7883](https://github.com/filecoin-project/lotus/pull/7883))
|
||||
- feat: ci: packer snap ([filecoin-project/lotus#7819](https://github.com/filecoin-project/lotus/pull/7819))
|
||||
- feat: #6147: Include worker name in sealing errors ([filecoin-project/lotus#7844](https://github.com/filecoin-project/lotus/pull/7844))
|
||||
- Feat: cli: Remove verified data cap ([filecoin-project/lotus#8175](https://github.com/filecoin-project/lotus/pull/8175))
|
||||
- feat: gateway: add MsigGetVestingSchedule to gateway api ([filecoin-project/lotus#8104](https://github.com/filecoin-project/lotus/pull/8104))
|
||||
- feat: itests: add itests ensemble mocknet getter ([filecoin-project/lotus#8157](https://github.com/filecoin-project/lotus/pull/8157))
|
||||
- feat: lotus-miner sectors list --initial-pledge ([filecoin-project/lotus#8098](https://github.com/filecoin-project/lotus/pull/8098))
|
||||
- Resource Manager Metrics ([filecoin-project/lotus#8089](https://github.com/filecoin-project/lotus/pull/8089))
|
||||
- feat: cli: set current network version from params ([filecoin-project/lotus#8111](https://github.com/filecoin-project/lotus/pull/8111))
|
||||
- feat: Snapdeals support in `storage find` CLI ([filecoin-project/lotus#8130](https://github.com/filecoin-project/lotus/pull/8130))
|
||||
|
||||
## Improvements
|
||||
- improve resource manager integration ([filecoin-project/lotus#8318](https://github.com/filecoin-project/lotus/pull/8318))
|
||||
- add check manual-stateless-deal with interactive deal making ([filecoin-project/lotus#7560](https://github.com/filecoin-project/lotus/pull/7560))
|
||||
- test: cli: adding wallet tests ([filecoin-project/lotus#8079](https://github.com/filecoin-project/lotus/pull/8079))
|
||||
- test: chain: unit tests for the syncer & sync manager ([filecoin-project/lotus#8072](https://github.com/filecoin-project/lotus/pull/8072))
|
||||
- test: cli: unit tests for sync related commands ([filecoin-project/lotus#8080](https://github.com/filecoin-project/lotus/pull/8080))
|
||||
- misc: wallet: wallet tests with annotations for system test matrix ([filecoin-project/lotus#7928](https://github.com/filecoin-project/lotus/pull/7928))
|
||||
- test: Cli: add mempool tests ([filecoin-project/lotus#8162](https://github.com/filecoin-project/lotus/pull/8162))
|
||||
- add a state-tree diff command to lotus shed ([filecoin-project/lotus#8081](https://github.com/filecoin-project/lotus/pull/8081))
|
||||
- test: mempool: Add unit and integration tests ([filecoin-project/lotus#8017](https://github.com/filecoin-project/lotus/pull/8017))
|
||||
- splistore cold object reification redux ([filecoin-project/lotus#8029](https://github.com/filecoin-project/lotus/pull/8029))
|
||||
- test: cli: chain category unit tests ([filecoin-project/lotus#8048](https://github.com/filecoin-project/lotus/pull/8048))
|
||||
- feat: config: Move MakeNewSectorForDeals config into the Sealing section([filecoin-project/lotus#8382](https://github.com/filecoin-project/lotus/pull/8382))
|
||||
|
||||
## Bug Fixes
|
||||
- fix: FVM: add finality check for consensus faults #8452
|
||||
- fix: market: Reuse the market PubSub in index provider #8451
|
||||
- fix: market: set all index provider options based on lotus config #8444
|
||||
- fix: sealing: Fix PR1 worker selection (#8421)
|
||||
- fix: miner: dead loop on removing sector (#8421)
|
||||
- fix: sealing: Remove sector copies from workers after snapdeals ([filecoin-project/lotus#8331](https://github.com/filecoin-project/lotus/pull/8331))
|
||||
- fix: storagefsm: Fix error loop on bad event ([filecoin-project/lotus#8339](https://github.com/filecoin-project/lotus/pull/8339))
|
||||
- fix: sealing: FinalizeSector doesn't need sealed replica access ([filecoin-project/lotus#8339](https://github.com/filecoin-project/lotus/pull/8339))
|
||||
- fix: sealing: always do cooldown in handleSubmitReplicaUpdateFailed ([filecoin-project/lotus#8353](https://github.com/filecoin-project/lotus/pull/8353))
|
||||
- fix: storage cli: Output primary sector status correctly ([filecoin-project/lotus#8320](https://github.com/filecoin-project/lotus/pull/8320))
|
||||
- fix: sealing fsm: Handle inputLk correctly ([filecoin-project/lotus#8291](https://github.com/filecoin-project/lotus/pull/8291))
|
||||
- fix: piece provider: Don't log CIDs as binary ([filecoin-project/lotus#8287](https://github.com/filecoin-project/lotus/pull/8287))
|
||||
- fix:sealing:Log instead of error normal shutdown of state machine ([filecoin-project/lotus#8232](https://github.com/filecoin-project/lotus/pull/8232))
|
||||
- fix:sealing:Handle finalize replica update failures in fsm ([filecoin-project/lotus#8229](https://github.com/filecoin-project/lotus/pull/8229))
|
||||
- ci: appimage: re-install appimage CI ([filecoin-project/lotus#7943](https://github.com/filecoin-project/lotus/pull/7943))
|
||||
- fix: sealing: PRU insufficient collateral ([filecoin-project/lotus#8219](https://github.com/filecoin-project/lotus/pull/8219))
|
||||
- fix: shed: diff command ([filecoin-project/lotus#8202](https://github.com/filecoin-project/lotus/pull/8202))
|
||||
- Make `--lite` option visible in the lotus daemon help text ([filecoin-project/lotus#8207](https://github.com/filecoin-project/lotus/pull/8207))
|
||||
- fix:sealing:Less verbose sector manager logging ([filecoin-project/lotus#8213](https://github.com/filecoin-project/lotus/pull/8213))
|
||||
- avoid panic ([filecoin-project/lotus#8205](https://github.com/filecoin-project/lotus/pull/8205))
|
||||
- A package is vulnerable to Exposure of Sensitive Information ([filecoin-project/lotus#8204](https://github.com/filecoin-project/lotus/pull/8204))
|
||||
- fix: sealing: add flag usage ([filecoin-project/lotus#8190](https://github.com/filecoin-project/lotus/pull/8190))
|
||||
- Fix the epoch used for gas in the message pool & validation ([filecoin-project/lotus#8163](https://github.com/filecoin-project/lotus/pull/8163))
|
||||
- fix:sealing:really-do-it flag for abort upgrade ([filecoin-project/lotus#8181](https://github.com/filecoin-project/lotus/pull/8181))
|
||||
- fix:proving:post check sector handles snap deals replica faults ([filecoin-project/lotus#8177](https://github.com/filecoin-project/lotus/pull/8177))
|
||||
- fix: client: calculate commps for pieces bigger than 32GB ([filecoin-project/lotus#8179](https://github.com/filecoin-project/lotus/pull/8179))
|
||||
- fix:cli:Continue instead of return error if no valid value is filled ([filecoin-project/lotus#8131](https://github.com/filecoin-project/lotus/pull/8131))
|
||||
- fix: limit reification sizes ([filecoin-project/lotus#8149](https://github.com/filecoin-project/lotus/pull/8149))
|
||||
- fix: state: Allow lotus-miner info to complete without admin permission ([filecoin-project/lotus#8057](https://github.com/filecoin-project/lotus/pull/8057))
|
||||
- fix:paychan:deflake integration test ([filecoin-project/lotus#8088](https://github.com/filecoin-project/lotus/pull/8088))
|
||||
- fix: worker: allow enable/disabling ReplicaUpdate tasks ([filecoin-project/lotus#8090](https://github.com/filecoin-project/lotus/pull/8090))
|
||||
- don't fail reification on missing references ([filecoin-project/lotus#8128](https://github.com/filecoin-project/lotus/pull/8128))
|
||||
- sealer: fix error message ([filecoin-project/lotus#8121](https://github.com/filecoin-project/lotus/pull/8121))
|
||||
- don't track peer ids in rcmgr metrics ([filecoin-project/lotus#8099](https://github.com/filecoin-project/lotus/pull/8099))
|
||||
- temporarily disable reification ([filecoin-project/lotus#8132](https://github.com/filecoin-project/lotus/pull/8132))
|
||||
- [Describe]: when excute cmd "lotus-bench sealing" without "benchmark-… ([filecoin-project/lotus#8173](https://github.com/filecoin-project/lotus/pull/8173))
|
||||
|
||||
## Dependency Updates
|
||||
- deps: update go-libp2p and go-libp2p-resource-manager ([filecoin-project/lotus#8289](https://github.com/filecoin-project/lotus/pull/8289))
|
||||
- feat(deps): update to graphsync v0.13.0 with 2.0 protocol ([filecoin-project/lotus#8273](https://github.com/filecoin-project/lotus/pull/8273))
|
||||
- dep: actor: get v7 ([filecoin-project/lotus#8194](https://github.com/filecoin-project/lotus/pull/8194))
|
||||
- deps: update go-libp2p to v0.18 release ([filecoin-project/lotus#8355](https://github.com/filecoin-project/lotus/pull/8355))
|
||||
- github.com/filecoin-project/go-data-transfer (v1.14.1 -> v1.15.0):
|
||||
- github.com/filecoin-project/go-fil-markets (v1.19.2 -> v1.20.1):
|
||||
- deps: update go-libp2p to v0.18.0-rc5 ([filecoin-project/lotus#8169](https://github.com/filecoin-project/lotus/pull/8169))
|
||||
|
||||
## Others
|
||||
- chore: build: backport releases ([filecoin-project/lotus#8192](https://github.com/filecoin-project/lotus/pull/8192))
|
||||
- feat: build: bump the version to v1.15.1-dev ([filecoin-project/lotus#8073](https://github.com/filecoin-project/lotus/pull/8073))
|
||||
- makefile: add make jen ([filecoin-project/lotus#8122](https://github.com/filecoin-project/lotus/pull/8122))
|
||||
- chore: Merge releases into master ([filecoin-project/lotus#8156](https://github.com/filecoin-project/lotus/pull/8156))
|
||||
- chore: ci: disable publish-packer #8451
|
||||
|
||||
# 1.15.0 / 2022-03-09
|
||||
|
||||
This is an optional release with retrieval improvements(client side), SP ux with unsealing, snap deals and regular deal making and many other new features, improvements and bug fixes.
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.16.4 AS builder-deps
|
||||
FROM golang:1.17.9-buster AS builder-deps
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
|
||||
@@ -253,3 +253,4 @@ EXPOSE 1234
|
||||
EXPOSE 2345
|
||||
EXPOSE 3456
|
||||
EXPOSE 1777
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ GOCC?=go
|
||||
GOVERSION:=$(shell $(GOCC) version | tr ' ' '\n' | grep go1 | sed 's/^go//' | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
|
||||
ifeq ($(shell expr $(GOVERSION) \< 1016000), 1)
|
||||
$(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell expr $(GOVERSION) % 1000000 / 1000).$(shell expr $(GOVERSION) % 1000))
|
||||
$(error Update Golang to version to at least 1.16.0)
|
||||
$(error Update Golang to version to at least 1.17.9)
|
||||
endif
|
||||
|
||||
# git modules that need to be loaded
|
||||
@@ -193,7 +193,7 @@ BINS+=lotus-health
|
||||
|
||||
lotus-wallet:
|
||||
rm -f lotus-wallet
|
||||
$(GOCC) build -o lotus-wallet ./cmd/lotus-wallet
|
||||
$(GOCC) build $(GOFLAGS) -o lotus-wallet ./cmd/lotus-wallet
|
||||
.PHONY: lotus-wallet
|
||||
BINS+=lotus-wallet
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<a href="https://circleci.com/gh/filecoin-project/lotus"><img src="https://circleci.com/gh/filecoin-project/lotus.svg?style=svg"></a>
|
||||
<a href="https://codecov.io/gh/filecoin-project/lotus"><img src="https://codecov.io/gh/filecoin-project/lotus/branch/master/graph/badge.svg"></a>
|
||||
<a href="https://goreportcard.com/report/github.com/filecoin-project/lotus"><img src="https://goreportcard.com/badge/github.com/filecoin-project/lotus" /></a>
|
||||
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.16-blue.svg" /></a>
|
||||
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.17-blue.svg" /></a>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
@@ -71,10 +71,10 @@ For other distributions you can find the required dependencies [here.](https://d
|
||||
|
||||
#### Go
|
||||
|
||||
To build Lotus, you need a working installation of [Go 1.16.4 or higher](https://golang.org/dl/):
|
||||
To build Lotus, you need a working installation of [Go 1.17.9 or higher](https://golang.org/dl/):
|
||||
|
||||
```bash
|
||||
wget -c https://golang.org/dl/go1.16.4.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
|
||||
wget -c https://golang.org/dl/go1.17.9.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
|
||||
```
|
||||
|
||||
**TIP:**
|
||||
|
||||
+13
-2
@@ -360,7 +360,7 @@ type FullNode interface {
|
||||
// ClientGetRetrievalUpdates returns status of updated retrieval deals
|
||||
ClientGetRetrievalUpdates(ctx context.Context) (<-chan RetrievalInfo, error) //perm:write
|
||||
// ClientQueryAsk returns a signed StorageAsk from the specified miner.
|
||||
ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) //perm:read
|
||||
ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*StorageAsk, error) //perm:read
|
||||
// ClientCalcCommP calculates the CommP and data size of the specified CID
|
||||
ClientDealPieceCID(ctx context.Context, root cid.Cid) (DataCIDSize, error) //perm:read
|
||||
// ClientCalcCommP calculates the CommP for a specified file
|
||||
@@ -522,8 +522,10 @@ type FullNode interface {
|
||||
StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*MarketDeal, error) //perm:read
|
||||
// StateLookupID retrieves the ID address of the given address
|
||||
StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
|
||||
// StateAccountKey returns the public key address of the given ID address
|
||||
// StateAccountKey returns the public key address of the given ID address for secp and bls accounts
|
||||
StateAccountKey(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
|
||||
// StateLookupRobustAddress returns the public key address of the given ID address for non-account addresses (multisig, miners etc)
|
||||
StateLookupRobustAddress(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
|
||||
// StateChangedActors returns all the actors whose states change between the two given state CIDs
|
||||
// TODO: Should this take tipset keys instead?
|
||||
StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) //perm:read
|
||||
@@ -590,6 +592,9 @@ type FullNode interface {
|
||||
// StateGetRandomnessFromBeacon is used to sample the beacon for randomness.
|
||||
StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
|
||||
|
||||
// StateGetNetworkParams return current network params
|
||||
StateGetNetworkParams(ctx context.Context) (*NetworkParams, error) //perm:read
|
||||
|
||||
// MethodGroup: Msig
|
||||
// The Msig methods are used to interact with multisig wallets on the
|
||||
// filecoin network
|
||||
@@ -728,6 +733,12 @@ type FullNode interface {
|
||||
CreateBackup(ctx context.Context, fpath string) error //perm:admin
|
||||
}
|
||||
|
||||
type StorageAsk struct {
|
||||
Response *storagemarket.StorageAsk
|
||||
|
||||
DealProtocols []string
|
||||
}
|
||||
|
||||
type FileRef struct {
|
||||
Path string
|
||||
IsCAR bool
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -51,6 +52,10 @@ type StorageMiner interface {
|
||||
|
||||
MiningBase(context.Context) (*types.TipSet, error) //perm:read
|
||||
|
||||
ComputeWindowPoSt(ctx context.Context, dlIdx uint64, tsk types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) //perm:admin
|
||||
|
||||
ComputeDataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (abi.PieceInfo, error) //perm:admin
|
||||
|
||||
// Temp api for testing
|
||||
PledgeSector(context.Context) (abi.SectorID, error) //perm:write
|
||||
|
||||
@@ -121,6 +126,7 @@ type StorageMiner interface {
|
||||
WorkerJobs(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) //perm:admin
|
||||
|
||||
//storiface.WorkerReturn
|
||||
ReturnDataCid(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error //perm:admin retry:true
|
||||
ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error //perm:admin retry:true
|
||||
ReturnSealPreCommit1(ctx context.Context, callID storiface.CallID, p1o storage.PreCommit1Out, err *storiface.CallError) error //perm:admin retry:true
|
||||
ReturnSealPreCommit2(ctx context.Context, callID storiface.CallID, sealed storage.SectorCids, err *storiface.CallError) error //perm:admin retry:true
|
||||
|
||||
@@ -34,6 +34,7 @@ type Worker interface {
|
||||
Info(context.Context) (storiface.WorkerInfo, error) //perm:admin
|
||||
|
||||
// storiface.WorkerCalls
|
||||
DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error) //perm:admin
|
||||
AddPiece(ctx context.Context, sector storage.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error) //perm:admin
|
||||
SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (storiface.CallID, error) //perm:admin
|
||||
SealPreCommit2(ctx context.Context, sector storage.SectorRef, pc1o storage.PreCommit1Out) (storiface.CallID, error) //perm:admin
|
||||
|
||||
+32
-3
@@ -14,7 +14,6 @@ import (
|
||||
bitfield "github.com/filecoin-project/go-bitfield"
|
||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||
retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
auth "github.com/filecoin-project/go-jsonrpc/auth"
|
||||
abi "github.com/filecoin-project/go-state-types/abi"
|
||||
big "github.com/filecoin-project/go-state-types/big"
|
||||
@@ -746,10 +745,10 @@ func (mr *MockFullNodeMockRecorder) ClientMinerQueryOffer(arg0, arg1, arg2, arg3
|
||||
}
|
||||
|
||||
// ClientQueryAsk mocks base method.
|
||||
func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*storagemarket.StorageAsk, error) {
|
||||
func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*api.StorageAsk, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ClientQueryAsk", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(*storagemarket.StorageAsk)
|
||||
ret0, _ := ret[0].(*api.StorageAsk)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -2407,6 +2406,21 @@ func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{})
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateGetNetworkParams mocks base method.
|
||||
func (m *MockFullNode) StateGetNetworkParams(arg0 context.Context) (*api.NetworkParams, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetNetworkParams", arg0)
|
||||
ret0, _ := ret[0].(*api.NetworkParams)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetNetworkParams indicates an expected call of StateGetNetworkParams.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetNetworkParams(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetNetworkParams", reflect.TypeOf((*MockFullNode)(nil).StateGetNetworkParams), arg0)
|
||||
}
|
||||
|
||||
// StateGetRandomnessFromBeacon mocks base method.
|
||||
func (m *MockFullNode) StateGetRandomnessFromBeacon(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 types.TipSetKey) (abi.Randomness, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -2497,6 +2511,21 @@ func (mr *MockFullNodeMockRecorder) StateLookupID(arg0, arg1, arg2 interface{})
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateLookupID", reflect.TypeOf((*MockFullNode)(nil).StateLookupID), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateLookupRobustAddress mocks base method.
|
||||
func (m *MockFullNode) StateLookupRobustAddress(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (address.Address, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateLookupRobustAddress", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(address.Address)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateLookupRobustAddress indicates an expected call of StateLookupRobustAddress.
|
||||
func (mr *MockFullNodeMockRecorder) StateLookupRobustAddress(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateLookupRobustAddress", reflect.TypeOf((*MockFullNode)(nil).StateLookupRobustAddress), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateMarketBalance mocks base method.
|
||||
func (m *MockFullNode) StateMarketBalance(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MarketBalance, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
||||
+81
-3
@@ -190,7 +190,7 @@ type FullNodeStruct struct {
|
||||
|
||||
ClientMinerQueryOffer func(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) `perm:"read"`
|
||||
|
||||
ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) `perm:"read"`
|
||||
ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) `perm:"read"`
|
||||
|
||||
ClientRemoveImport func(p0 context.Context, p1 imports.ID) error `perm:"admin"`
|
||||
|
||||
@@ -352,6 +352,8 @@ type FullNodeStruct struct {
|
||||
|
||||
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
|
||||
|
||||
StateGetNetworkParams func(p0 context.Context) (*NetworkParams, error) `perm:"read"`
|
||||
|
||||
StateGetRandomnessFromBeacon func(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) `perm:"read"`
|
||||
|
||||
StateGetRandomnessFromTickets func(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) `perm:"read"`
|
||||
@@ -364,6 +366,8 @@ type FullNodeStruct struct {
|
||||
|
||||
StateLookupID func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"`
|
||||
|
||||
StateLookupRobustAddress func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"`
|
||||
|
||||
StateMarketBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) `perm:"read"`
|
||||
|
||||
StateMarketDeals func(p0 context.Context, p1 types.TipSetKey) (map[string]MarketDeal, error) `perm:"read"`
|
||||
@@ -639,8 +643,12 @@ type StorageMinerStruct struct {
|
||||
|
||||
CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) `perm:"admin"`
|
||||
|
||||
ComputeDataCid func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (abi.PieceInfo, error) `perm:"admin"`
|
||||
|
||||
ComputeProof func(p0 context.Context, p1 []builtin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]builtin.PoStProof, error) `perm:"read"`
|
||||
|
||||
ComputeWindowPoSt func(p0 context.Context, p1 uint64, p2 types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) `perm:"admin"`
|
||||
|
||||
CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"`
|
||||
|
||||
DagstoreGC func(p0 context.Context) ([]DagstoreShardResult, error) `perm:"admin"`
|
||||
@@ -739,6 +747,8 @@ type StorageMinerStruct struct {
|
||||
|
||||
ReturnAddPiece func(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error `perm:"admin"`
|
||||
|
||||
ReturnDataCid func(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error `perm:"admin"`
|
||||
|
||||
ReturnFetch func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
|
||||
|
||||
ReturnFinalizeReplicaUpdate func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
|
||||
@@ -890,6 +900,8 @@ type WorkerStruct struct {
|
||||
Internal struct {
|
||||
AddPiece func(p0 context.Context, p1 storage.SectorRef, p2 []abi.UnpaddedPieceSize, p3 abi.UnpaddedPieceSize, p4 storage.Data) (storiface.CallID, error) `perm:"admin"`
|
||||
|
||||
DataCid func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (storiface.CallID, error) `perm:"admin"`
|
||||
|
||||
Enabled func(p0 context.Context) (bool, error) `perm:"admin"`
|
||||
|
||||
Fetch func(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) `perm:"admin"`
|
||||
@@ -1569,14 +1581,14 @@ func (s *FullNodeStub) ClientMinerQueryOffer(p0 context.Context, p1 address.Addr
|
||||
return *new(QueryOffer), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) {
|
||||
func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) {
|
||||
if s.Internal.ClientQueryAsk == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.ClientQueryAsk(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) {
|
||||
func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
@@ -2460,6 +2472,17 @@ func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetNetworkParams(p0 context.Context) (*NetworkParams, error) {
|
||||
if s.Internal.StateGetNetworkParams == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetNetworkParams(p0)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetNetworkParams(p0 context.Context) (*NetworkParams, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetRandomnessFromBeacon(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) {
|
||||
if s.Internal.StateGetRandomnessFromBeacon == nil {
|
||||
return *new(abi.Randomness), ErrNotSupported
|
||||
@@ -2526,6 +2549,17 @@ func (s *FullNodeStub) StateLookupID(p0 context.Context, p1 address.Address, p2
|
||||
return *new(address.Address), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateLookupRobustAddress(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
|
||||
if s.Internal.StateLookupRobustAddress == nil {
|
||||
return *new(address.Address), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateLookupRobustAddress(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateLookupRobustAddress(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
|
||||
return *new(address.Address), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) {
|
||||
if s.Internal.StateMarketBalance == nil {
|
||||
return *new(MarketBalance), ErrNotSupported
|
||||
@@ -3846,6 +3880,17 @@ func (s *StorageMinerStub) CheckProvable(p0 context.Context, p1 abi.RegisteredPo
|
||||
return *new(map[abi.SectorNumber]string), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ComputeDataCid(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (abi.PieceInfo, error) {
|
||||
if s.Internal.ComputeDataCid == nil {
|
||||
return *new(abi.PieceInfo), ErrNotSupported
|
||||
}
|
||||
return s.Internal.ComputeDataCid(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) ComputeDataCid(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (abi.PieceInfo, error) {
|
||||
return *new(abi.PieceInfo), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ComputeProof(p0 context.Context, p1 []builtin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]builtin.PoStProof, error) {
|
||||
if s.Internal.ComputeProof == nil {
|
||||
return *new([]builtin.PoStProof), ErrNotSupported
|
||||
@@ -3857,6 +3902,17 @@ func (s *StorageMinerStub) ComputeProof(p0 context.Context, p1 []builtin.Extende
|
||||
return *new([]builtin.PoStProof), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ComputeWindowPoSt(p0 context.Context, p1 uint64, p2 types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) {
|
||||
if s.Internal.ComputeWindowPoSt == nil {
|
||||
return *new([]miner.SubmitWindowedPoStParams), ErrNotSupported
|
||||
}
|
||||
return s.Internal.ComputeWindowPoSt(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) ComputeWindowPoSt(p0 context.Context, p1 uint64, p2 types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) {
|
||||
return *new([]miner.SubmitWindowedPoStParams), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) CreateBackup(p0 context.Context, p1 string) error {
|
||||
if s.Internal.CreateBackup == nil {
|
||||
return ErrNotSupported
|
||||
@@ -4396,6 +4452,17 @@ func (s *StorageMinerStub) ReturnAddPiece(p0 context.Context, p1 storiface.CallI
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ReturnDataCid(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error {
|
||||
if s.Internal.ReturnDataCid == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ReturnDataCid(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) ReturnDataCid(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ReturnFetch(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
|
||||
if s.Internal.ReturnFetch == nil {
|
||||
return ErrNotSupported
|
||||
@@ -5133,6 +5200,17 @@ func (s *WorkerStub) AddPiece(p0 context.Context, p1 storage.SectorRef, p2 []abi
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *WorkerStruct) DataCid(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (storiface.CallID, error) {
|
||||
if s.Internal.DataCid == nil {
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
return s.Internal.DataCid(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *WorkerStub) DataCid(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (storiface.CallID, error) {
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *WorkerStruct) Enabled(p0 context.Context) (bool, error) {
|
||||
if s.Internal.Enabled == nil {
|
||||
return false, ErrNotSupported
|
||||
|
||||
+33
-2
@@ -11,6 +11,7 @@ import (
|
||||
"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/filecoin-project/lotus/node/modules/dtypes"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipfs/go-graphsync"
|
||||
|
||||
@@ -19,8 +20,6 @@ import (
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
)
|
||||
|
||||
// TODO: check if this exists anywhere else
|
||||
|
||||
type MultiaddrSlice []ma.Multiaddr
|
||||
|
||||
func (m *MultiaddrSlice) UnmarshalJSON(raw []byte) (err error) {
|
||||
@@ -286,3 +285,35 @@ type ExportRef struct {
|
||||
FromLocalCAR string // if specified, get data from a local CARv2 file.
|
||||
DealID retrievalmarket.DealID
|
||||
}
|
||||
|
||||
type NetworkParams struct {
|
||||
NetworkName dtypes.NetworkName
|
||||
BlockDelaySecs uint64
|
||||
ConsensusMinerMinPower abi.StoragePower
|
||||
SupportedProofTypes []abi.RegisteredSealProof
|
||||
PreCommitChallengeDelay abi.ChainEpoch
|
||||
ForkUpgradeParams ForkUpgradeParams
|
||||
}
|
||||
|
||||
type ForkUpgradeParams struct {
|
||||
UpgradeSmokeHeight abi.ChainEpoch
|
||||
UpgradeBreezeHeight abi.ChainEpoch
|
||||
UpgradeIgnitionHeight abi.ChainEpoch
|
||||
UpgradeLiftoffHeight abi.ChainEpoch
|
||||
UpgradeAssemblyHeight abi.ChainEpoch
|
||||
UpgradeRefuelHeight abi.ChainEpoch
|
||||
UpgradeTapeHeight abi.ChainEpoch
|
||||
UpgradeKumquatHeight abi.ChainEpoch
|
||||
UpgradePriceListOopsHeight abi.ChainEpoch
|
||||
BreezeGasTampingDuration abi.ChainEpoch
|
||||
UpgradeCalicoHeight abi.ChainEpoch
|
||||
UpgradePersianHeight abi.ChainEpoch
|
||||
UpgradeOrangeHeight abi.ChainEpoch
|
||||
UpgradeClausHeight abi.ChainEpoch
|
||||
UpgradeTrustHeight abi.ChainEpoch
|
||||
UpgradeNorwegianHeight abi.ChainEpoch
|
||||
UpgradeTurboHeight abi.ChainEpoch
|
||||
UpgradeHyperdriveHeight abi.ChainEpoch
|
||||
UpgradeChocolateHeight abi.ChainEpoch
|
||||
UpgradeOhSnapHeight abi.ChainEpoch
|
||||
}
|
||||
|
||||
@@ -604,6 +604,9 @@ type FullNode interface {
|
||||
// StateGetRandomnessFromBeacon is used to sample the beacon for randomness.
|
||||
StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
|
||||
|
||||
// StateGetNetworkParams return current network params
|
||||
StateGetNetworkParams(ctx context.Context) (*api.NetworkParams, error) //perm:read
|
||||
|
||||
// MethodGroup: Msig
|
||||
// The Msig methods are used to interact with multisig wallets on the
|
||||
// filecoin network
|
||||
|
||||
@@ -267,6 +267,8 @@ type FullNodeStruct struct {
|
||||
|
||||
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
|
||||
|
||||
StateGetNetworkParams func(p0 context.Context) (*api.NetworkParams, error) `perm:"read"`
|
||||
|
||||
StateGetRandomnessFromBeacon func(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) `perm:"read"`
|
||||
|
||||
StateGetRandomnessFromTickets func(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) `perm:"read"`
|
||||
@@ -1746,6 +1748,17 @@ func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetNetworkParams(p0 context.Context) (*api.NetworkParams, error) {
|
||||
if s.Internal.StateGetNetworkParams == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetNetworkParams(p0)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetNetworkParams(p0 context.Context) (*api.NetworkParams, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetRandomnessFromBeacon(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) {
|
||||
if s.Internal.StateGetRandomnessFromBeacon == nil {
|
||||
return *new(abi.Randomness), ErrNotSupported
|
||||
|
||||
@@ -2275,6 +2275,21 @@ func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{})
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateGetNetworkParams mocks base method.
|
||||
func (m *MockFullNode) StateGetNetworkParams(arg0 context.Context) (*api.NetworkParams, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetNetworkParams", arg0)
|
||||
ret0, _ := ret[0].(*api.NetworkParams)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetNetworkParams indicates an expected call of StateGetNetworkParams.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetNetworkParams(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetNetworkParams", reflect.TypeOf((*MockFullNode)(nil).StateGetNetworkParams), arg0)
|
||||
}
|
||||
|
||||
// StateGetRandomnessFromBeacon mocks base method.
|
||||
func (m *MockFullNode) StateGetRandomnessFromBeacon(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 types.TipSetKey) (abi.Randomness, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
||||
@@ -3,6 +3,9 @@ package v0api
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
@@ -341,4 +344,12 @@ func (w *WrapperV1Full) PaychGet(ctx context.Context, from, to address.Address,
|
||||
return w.FullNode.PaychFund(ctx, from, to, amt)
|
||||
}
|
||||
|
||||
func (w *WrapperV1Full) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) {
|
||||
a, err := w.FullNode.ClientQueryAsk(ctx, p, miner)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return a.Response, nil
|
||||
}
|
||||
|
||||
var _ FullNode = &WrapperV1Full{}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWPfaWdJjpPTQp5kSqsqvauJaM4cFz5NWja7qyjx7vVfjL
|
||||
/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWS5tjcL6s4hHZ1HVRTgGKaXpKkiHfbBSJdjbzgejgJpEh
|
||||
/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWLGPq9JL1xwL6gHok7HSNxtK1Q5kyfg4Hk69ifRPghn4i
|
||||
/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWFYS1f31zafv8mqqYu8U3hEqYvaZ6avWzYU3BmZdpyH3h
|
||||
|
||||
@@ -13,3 +13,4 @@
|
||||
/dns4/node.glif.io/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt
|
||||
/dns4/bootstrap-0.ipfsmain.cn/tcp/34721/p2p/12D3KooWQnwEGNqcM2nAcPtRR9rAX8Hrg4k9kJLCHoTR5chJfz6d
|
||||
/dns4/bootstrap-1.ipfsmain.cn/tcp/34723/p2p/12D3KooWMKxMkD5DMpSWsW7dBddKxKT7L2GgbNuckz9otxvkvByP
|
||||
/dns4/bootstarp-0.1475.io/tcp/61256/p2p/12D3KooWQjaNmbz9b1XmheQB3RWsRjKSzuRLfjeiDZHyX7Y5RcBr
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+12
-4
@@ -53,11 +53,19 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
}
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg2KiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg8MiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(2048)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(256)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(10)
|
||||
|
||||
func init() {
|
||||
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1, abi.RegisteredSealProof_StackedDrg8MiBV1)
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
|
||||
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
||||
policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
|
||||
policy.SetSupportedProofTypes(SupportedProofTypes...)
|
||||
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
|
||||
hs, found := os.LookupEnv(ev)
|
||||
|
||||
@@ -44,13 +44,20 @@ const UpgradeChocolateHeight = -17
|
||||
|
||||
const UpgradeOhSnapHeight = 240
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(2 << 30)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||
|
||||
func init() {
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
|
||||
policy.SetSupportedProofTypes(
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
)
|
||||
policy.SetSupportedProofTypes(SupportedProofTypes...)
|
||||
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
SetAddressNetwork(address.Testnet)
|
||||
|
||||
|
||||
@@ -57,12 +57,19 @@ const UpgradeChocolateHeight = 312746
|
||||
// 2022-02-10T19:23:00Z
|
||||
const UpgradeOhSnapHeight = 682006
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(32 << 30)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||
|
||||
func init() {
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(32 << 30))
|
||||
policy.SetSupportedProofTypes(
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
)
|
||||
policy.SetSupportedProofTypes(SupportedProofTypes...)
|
||||
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
SetAddressNetwork(address.Testnet)
|
||||
|
||||
|
||||
+17
-16
@@ -13,12 +13,13 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
)
|
||||
|
||||
const BootstrappersFile = "interopnet.pi"
|
||||
const GenesisFile = "interopnet.car"
|
||||
|
||||
const GenesisNetworkVersion = network.Version15
|
||||
const GenesisNetworkVersion = network.Version13
|
||||
|
||||
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
|
||||
|
||||
@@ -52,18 +53,20 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
}
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg2KiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg8MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(2048)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(256)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(10)
|
||||
|
||||
func init() {
|
||||
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
||||
policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
|
||||
|
||||
InsecurePoStValidation = true
|
||||
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
|
||||
policy.SetSupportedProofTypes(
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
)
|
||||
policy.SetSupportedProofTypes(SupportedProofTypes...)
|
||||
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
|
||||
hs, found := os.LookupEnv(ev)
|
||||
@@ -95,8 +98,6 @@ func init() {
|
||||
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
|
||||
UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
|
||||
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
|
||||
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
|
||||
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
|
||||
|
||||
BuildType |= BuildInteropnet
|
||||
SetAddressNetwork(address.Testnet)
|
||||
@@ -104,9 +105,9 @@ func init() {
|
||||
|
||||
}
|
||||
|
||||
const BlockDelaySecs = uint64(5)
|
||||
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
||||
|
||||
const PropagationDelaySecs = uint64(1)
|
||||
const PropagationDelaySecs = uint64(6)
|
||||
|
||||
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
||||
const BootstrapPeerThreshold = 2
|
||||
|
||||
@@ -70,6 +70,14 @@ const UpgradeChocolateHeight = 1231620
|
||||
// 2022-03-01T15:00:00Z
|
||||
var UpgradeOhSnapHeight = abi.ChainEpoch(1594680)
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||
|
||||
func init() {
|
||||
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
|
||||
SetAddressNetwork(address.Mainnet)
|
||||
|
||||
+22
-16
@@ -50,23 +50,29 @@ const UpgradeHyperdriveHeight = 379178
|
||||
|
||||
const UpgradeChocolateHeight = 999999999
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
|
||||
// Minimum block production power is set to 4 TiB
|
||||
// Rationale is to discourage small-scale miners from trying to take over the network
|
||||
// One needs to invest in ~2.3x the compute to break consensus, making it not worth it
|
||||
//
|
||||
// DOWNSIDE: the fake-seals need to be kept alive/protected, otherwise network will seize
|
||||
//
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(4 << 40)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
||||
|
||||
// Lower the most time-consuming parts of PoRep
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(10)
|
||||
|
||||
func init() {
|
||||
// Minimum block production power is set to 4 TiB
|
||||
// Rationale is to discourage small-scale miners from trying to take over the network
|
||||
// One needs to invest in ~2.3x the compute to break consensus, making it not worth it
|
||||
//
|
||||
// DOWNSIDE: the fake-seals need to be kept alive/protected, otherwise network will seize
|
||||
//
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(4 << 40))
|
||||
|
||||
policy.SetSupportedProofTypes(
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
)
|
||||
|
||||
// Lower the most time-consuming parts of PoRep
|
||||
policy.SetPreCommitChallengeDelay(10)
|
||||
policy.SetSupportedProofTypes(SupportedProofTypes...)
|
||||
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
// TODO - make this a variable
|
||||
//miner.WPoStChallengeLookback = abi.ChainEpoch(2)
|
||||
|
||||
@@ -33,6 +33,12 @@ var (
|
||||
MinimumBaseFee = int64(100)
|
||||
BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
||||
PropagationDelaySecs = uint64(6)
|
||||
SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)
|
||||
PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||
|
||||
AllowableClockDriftSecs = uint64(1)
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ func BuildTypeString() string {
|
||||
}
|
||||
|
||||
// BuildVersion is the local build version
|
||||
const BuildVersion = "1.15.2-dev"
|
||||
const BuildVersion = "1.15.3"
|
||||
|
||||
func UserVersion() string {
|
||||
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
|
||||
|
||||
@@ -108,7 +108,7 @@ type PublishStorageDealsParams = market0.PublishStorageDealsParams
|
||||
type PublishStorageDealsReturn interface {
|
||||
DealIDs() ([]abi.DealID, error)
|
||||
// Note that this index is based on the batch of deals that were published, NOT the DealID
|
||||
IsDealValid(index uint64) (bool, error)
|
||||
IsDealValid(index uint64) (bool, int, error)
|
||||
}
|
||||
|
||||
func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStorageDealsReturn, error) {
|
||||
|
||||
@@ -197,7 +197,7 @@ type PublishStorageDealsParams = market0.PublishStorageDealsParams
|
||||
type PublishStorageDealsReturn interface {
|
||||
DealIDs() ([]abi.DealID, error)
|
||||
// Note that this index is based on the batch of deals that were published, NOT the DealID
|
||||
IsDealValid(index uint64) (bool, error)
|
||||
IsDealValid(index uint64) (bool, int, error)
|
||||
}
|
||||
|
||||
func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStorageDealsReturn, error) {
|
||||
|
||||
@@ -8,6 +8,11 @@ import (
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
{{if (ge .v 6)}}
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
{{end}}
|
||||
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
@@ -253,12 +258,29 @@ type publishStorageDealsReturn{{.v}} struct {
|
||||
market{{.v}}.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn{{.v}}) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn{{.v}}) IsDealValid(index uint64) (bool, int, error) {
|
||||
{{if (ge .v 6)}}
|
||||
return r.ValidDeals.IsSet(index)
|
||||
set, err := r.ValidDeals.IsSet(index)
|
||||
if err != nil || !set {
|
||||
return false, -1, err
|
||||
}
|
||||
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
|
||||
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
outIdx, err := before.Count()
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
return set, int(outIdx), nil
|
||||
{{else}}
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
|
||||
@@ -246,10 +246,10 @@ type publishStorageDealsReturn0 struct {
|
||||
market0.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn0) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn0) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -246,10 +246,10 @@ type publishStorageDealsReturn2 struct {
|
||||
market2.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn2) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn2) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -241,10 +241,10 @@ type publishStorageDealsReturn3 struct {
|
||||
market3.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn3) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn3) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -241,10 +241,10 @@ type publishStorageDealsReturn4 struct {
|
||||
market4.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn4) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn4) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -241,10 +241,10 @@ type publishStorageDealsReturn5 struct {
|
||||
market5.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn5) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn5) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ import (
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
@@ -241,9 +244,26 @@ type publishStorageDealsReturn6 struct {
|
||||
market6.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn6) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn6) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
return r.ValidDeals.IsSet(index)
|
||||
set, err := r.ValidDeals.IsSet(index)
|
||||
if err != nil || !set {
|
||||
return false, -1, err
|
||||
}
|
||||
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
|
||||
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
outIdx, err := before.Count()
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
return set, int(outIdx), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ import (
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
@@ -241,9 +244,26 @@ type publishStorageDealsReturn7 struct {
|
||||
market7.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn7) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn7) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
return r.ValidDeals.IsSet(index)
|
||||
set, err := r.ValidDeals.IsSet(index)
|
||||
if err != nil || !set {
|
||||
return false, -1, err
|
||||
}
|
||||
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
|
||||
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
outIdx, err := before.Count()
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
return set, int(outIdx), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -467,7 +467,7 @@ func (filec *FilecoinEC) checkBlockMessages(ctx context.Context, b *types.FullBl
|
||||
}
|
||||
|
||||
nv := filec.sm.GetNetworkVersion(ctx, b.Header.Height)
|
||||
pl := vm.PricelistByEpochAndNetworkVersion(b.Header.Height, nv)
|
||||
pl := vm.PricelistByEpoch(b.Header.Height)
|
||||
var sumGasLimit int64
|
||||
checkMsg := func(msg types.ChainMsg) error {
|
||||
m := msg.VMMessage()
|
||||
|
||||
@@ -1469,3 +1469,35 @@ func TestReconnect(t *testing.T) {
|
||||
fcs.advance(0, 5, 2, nil, 0, 1, 3)
|
||||
require.True(t, fcs.callNumber["ChainGetPath"] == 4)
|
||||
}
|
||||
|
||||
func TestUnregister(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
fcs := newFakeCS(t)
|
||||
|
||||
events, err := NewEvents(ctx, fcs)
|
||||
require.NoError(t, err)
|
||||
|
||||
tsObs := &testObserver{t: t}
|
||||
events.Observe(tsObs)
|
||||
|
||||
// observer receives heads as the chain advances
|
||||
fcs.advance(0, 1, 0, nil)
|
||||
headBeforeDeregister := events.lastTs
|
||||
require.Equal(t, tsObs.head, headBeforeDeregister)
|
||||
|
||||
// observer unregistered successfully
|
||||
found := events.Unregister(tsObs)
|
||||
require.True(t, found)
|
||||
|
||||
// observer stops receiving heads as the chain advances
|
||||
fcs.advance(0, 1, 0, nil)
|
||||
require.Equal(t, tsObs.head, headBeforeDeregister)
|
||||
require.NotEqual(t, tsObs.head, events.lastTs)
|
||||
|
||||
// unregistering an invalid observer returns false
|
||||
dneObs := &testObserver{t: t}
|
||||
found = events.Unregister(dneObs)
|
||||
require.False(t, found)
|
||||
}
|
||||
|
||||
@@ -253,3 +253,27 @@ func (o *observer) Observe(obs TipSetObserver) *types.TipSet {
|
||||
o.observers = append(o.observers, obs)
|
||||
return o.head
|
||||
}
|
||||
|
||||
// Unregister unregisters an observer. Returns true if we successfully removed the observer.
|
||||
//
|
||||
// NOTE: The observer _may_ be called after being removed. Observers MUST handle this case
|
||||
// internally.
|
||||
func (o *observer) Unregister(obs TipSetObserver) (found bool) {
|
||||
o.lk.Lock()
|
||||
defer o.lk.Unlock()
|
||||
// We _copy_ the observers list because we may be concurrently reading it from a headChange
|
||||
// handler.
|
||||
//
|
||||
// This should happen infrequently, so it's fine if we spend a bit of time here.
|
||||
newObservers := make([]TipSetObserver, 0, len(o.observers))
|
||||
for _, existingObs := range o.observers {
|
||||
if existingObs == obs {
|
||||
found = true
|
||||
continue
|
||||
}
|
||||
newObservers = append(newObservers, existingObs)
|
||||
}
|
||||
|
||||
o.observers = newObservers
|
||||
return found
|
||||
}
|
||||
|
||||
@@ -281,11 +281,12 @@ func (mp *MessagePool) checkMessages(ctx context.Context, msgs []*types.Message,
|
||||
// gas checks
|
||||
|
||||
// 4. Min Gas
|
||||
minGas := vm.PricelistByEpochAndNetworkVersion(epoch, nv).OnChainMessage(m.ChainLength())
|
||||
minGas := vm.PricelistByEpoch(epoch).OnChainMessage(m.ChainLength())
|
||||
|
||||
check = api.MessageCheckStatus{
|
||||
Cid: m.Cid(),
|
||||
CheckStatus: api.CheckStatus{Code: api.CheckStatusMessageMinGas,
|
||||
CheckStatus: api.CheckStatus{
|
||||
Code: api.CheckStatusMessageMinGas,
|
||||
Hint: map[string]interface{}{
|
||||
"minGas": minGas,
|
||||
},
|
||||
|
||||
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
lps "github.com/filecoin-project/pubsub"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -27,7 +28,6 @@ import (
|
||||
"github.com/ipfs/go-datastore/query"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||
lps "github.com/whyrusleeping/pubsub"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
@@ -629,11 +629,7 @@ func (mp *MessagePool) addLocal(ctx context.Context, m *types.SignedMessage) err
|
||||
// a (soft) validation error.
|
||||
func (mp *MessagePool) verifyMsgBeforeAdd(m *types.SignedMessage, curTs *types.TipSet, local bool) (bool, error) {
|
||||
epoch := curTs.Height() + 1
|
||||
nv, err := mp.getNtwkVersion(epoch)
|
||||
if err != nil {
|
||||
return false, xerrors.Errorf("getting network version: %w", err)
|
||||
}
|
||||
minGas := vm.PricelistByEpochAndNetworkVersion(epoch, nv).OnChainMessage(m.ChainLength())
|
||||
minGas := vm.PricelistByEpoch(epoch).OnChainMessage(m.ChainLength())
|
||||
|
||||
if err := m.VMMessage().ValidForBlockInclusion(minGas.Total(), build.NewestNetworkVersion); err != nil {
|
||||
return false, xerrors.Errorf("message will not be included in a block: %w", err)
|
||||
@@ -1477,7 +1473,7 @@ func (mp *MessagePool) Updates(ctx context.Context) (<-chan api.MpoolUpdate, err
|
||||
sub := mp.changes.Sub(localUpdates)
|
||||
|
||||
go func() {
|
||||
defer mp.changes.Unsub(sub, localUpdates)
|
||||
defer mp.changes.Unsub(sub)
|
||||
defer close(out)
|
||||
|
||||
for {
|
||||
|
||||
@@ -781,7 +781,6 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint6
|
||||
// cannot exceed the block limit; drop all messages that exceed the limit
|
||||
// - the total gasReward cannot exceed the actor's balance; drop all messages that exceed
|
||||
// the balance
|
||||
|
||||
a, err := mp.api.GetActorAfter(actor, ts)
|
||||
if err != nil {
|
||||
log.Errorf("failed to load actor state, not building chain for %s: %v", actor, err)
|
||||
@@ -794,12 +793,6 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint6
|
||||
skip := 0
|
||||
i := 0
|
||||
rewards := make([]*big.Int, 0, len(msgs))
|
||||
|
||||
nv, err := mp.getNtwkVersion(ts.Height())
|
||||
if err != nil {
|
||||
log.Errorf("getting network version: %v", err)
|
||||
return nil
|
||||
}
|
||||
for i = 0; i < len(msgs); i++ {
|
||||
m := msgs[i]
|
||||
|
||||
@@ -815,7 +808,7 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint6
|
||||
}
|
||||
curNonce++
|
||||
|
||||
minGas := vm.PricelistByEpochAndNetworkVersion(ts.Height(), nv).OnChainMessage(m.ChainLength()).Total()
|
||||
minGas := vm.PricelistByEpoch(ts.Height()).OnChainMessage(m.ChainLength()).Total()
|
||||
if m.Message.GasLimit < minGas {
|
||||
break
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
"github.com/filecoin-project/specs-actors/v7/actors/migration/nv15"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/rand"
|
||||
@@ -22,6 +24,7 @@ import (
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
_init "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
|
||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||
"github.com/filecoin-project/lotus/chain/state"
|
||||
@@ -318,6 +321,48 @@ func (sm *StateManager) LookupID(ctx context.Context, addr address.Address, ts *
|
||||
return state.LookupID(addr)
|
||||
}
|
||||
|
||||
func (sm *StateManager) LookupRobustAddress(ctx context.Context, idAddr address.Address, ts *types.TipSet) (address.Address, error) {
|
||||
idAddrDecoded, err := address.IDFromAddress(idAddr)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("failed to decode provided address as id addr: %w", err)
|
||||
}
|
||||
|
||||
cst := cbor.NewCborStore(sm.cs.StateBlockstore())
|
||||
wrapStore := adt.WrapStore(ctx, cst)
|
||||
|
||||
stateTree, err := state.LoadStateTree(cst, sm.parentState(ts))
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("load state tree: %w", err)
|
||||
}
|
||||
|
||||
initActor, err := stateTree.GetActor(_init.Address)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("load init actor: %w", err)
|
||||
}
|
||||
|
||||
initState, err := _init.Load(wrapStore, initActor)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("load init state: %w", err)
|
||||
}
|
||||
robustAddr := address.Undef
|
||||
|
||||
err = initState.ForEachActor(func(id abi.ActorID, addr address.Address) error {
|
||||
if uint64(id) == idAddrDecoded {
|
||||
robustAddr = addr
|
||||
// Hacky way to early return from ForEach
|
||||
return xerrors.New("robust address found")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if robustAddr == address.Undef {
|
||||
if err == nil {
|
||||
return address.Undef, xerrors.Errorf("Address %s not found", idAddr.String())
|
||||
}
|
||||
return address.Undef, xerrors.Errorf("finding address: %w", err)
|
||||
}
|
||||
return robustAddr, nil
|
||||
}
|
||||
|
||||
func (sm *StateManager) ValidateChain(ctx context.Context, ts *types.TipSet) error {
|
||||
tschain := []*types.TipSet{ts}
|
||||
for ts.Height() != 0 {
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
"github.com/filecoin-project/pubsub"
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -35,7 +36,6 @@ import (
|
||||
"github.com/ipfs/go-datastore/query"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"github.com/whyrusleeping/pubsub"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
|
||||
+2
-2
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
|
||||
"github.com/Gurpartap/async"
|
||||
"github.com/filecoin-project/pubsub"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -22,7 +23,6 @@ import (
|
||||
"github.com/libp2p/go-libp2p-core/connmgr"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"github.com/whyrusleeping/pubsub"
|
||||
"go.opencensus.io/stats"
|
||||
"go.opencensus.io/trace"
|
||||
"golang.org/x/xerrors"
|
||||
@@ -260,7 +260,7 @@ func (syncer *Syncer) IncomingBlocks(ctx context.Context) (<-chan *types.BlockHe
|
||||
out := make(chan *types.BlockHeader, 10)
|
||||
|
||||
go func() {
|
||||
defer syncer.incoming.Unsub(sub, LocalIncoming)
|
||||
defer syncer.incoming.Unsub(sub)
|
||||
|
||||
for {
|
||||
select {
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT.
|
||||
|
||||
package vm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"sort"
|
||||
|
||||
types "github.com/filecoin-project/lotus/chain/types"
|
||||
cid "github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
xerrors "golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
var _ = xerrors.Errorf
|
||||
var _ = cid.Undef
|
||||
var _ = math.E
|
||||
var _ = sort.Sort
|
||||
|
||||
var lengthBufFvmExecutionTrace = []byte{132}
|
||||
|
||||
func (t *FvmExecutionTrace) MarshalCBOR(w io.Writer) error {
|
||||
if t == nil {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
if _, err := w.Write(lengthBufFvmExecutionTrace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scratch := make([]byte, 9)
|
||||
|
||||
// t.Msg (types.Message) (struct)
|
||||
if err := t.Msg.MarshalCBOR(w); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.MsgRct (types.MessageReceipt) (struct)
|
||||
if err := t.MsgRct.MarshalCBOR(w); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.Error (string) (string)
|
||||
if len(t.Error) > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field t.Error was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len(t.Error))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string(t.Error)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.Subcalls ([]vm.FvmExecutionTrace) (slice)
|
||||
if len(t.Subcalls) > cbg.MaxLength {
|
||||
return xerrors.Errorf("Slice value in field t.Subcalls was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajArray, uint64(len(t.Subcalls))); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, v := range t.Subcalls {
|
||||
if err := v.MarshalCBOR(w); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *FvmExecutionTrace) UnmarshalCBOR(r io.Reader) error {
|
||||
*t = FvmExecutionTrace{}
|
||||
|
||||
br := cbg.GetPeeker(r)
|
||||
scratch := make([]byte, 8)
|
||||
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if maj != cbg.MajArray {
|
||||
return fmt.Errorf("cbor input should be of type array")
|
||||
}
|
||||
|
||||
if extra != 4 {
|
||||
return fmt.Errorf("cbor input had wrong number of fields")
|
||||
}
|
||||
|
||||
// t.Msg (types.Message) (struct)
|
||||
|
||||
{
|
||||
|
||||
b, err := br.ReadByte()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if b != cbg.CborNull[0] {
|
||||
if err := br.UnreadByte(); err != nil {
|
||||
return err
|
||||
}
|
||||
t.Msg = new(types.Message)
|
||||
if err := t.Msg.UnmarshalCBOR(br); err != nil {
|
||||
return xerrors.Errorf("unmarshaling t.Msg pointer: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// t.MsgRct (types.MessageReceipt) (struct)
|
||||
|
||||
{
|
||||
|
||||
b, err := br.ReadByte()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if b != cbg.CborNull[0] {
|
||||
if err := br.UnreadByte(); err != nil {
|
||||
return err
|
||||
}
|
||||
t.MsgRct = new(types.MessageReceipt)
|
||||
if err := t.MsgRct.UnmarshalCBOR(br); err != nil {
|
||||
return xerrors.Errorf("unmarshaling t.MsgRct pointer: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// t.Error (string) (string)
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadStringBuf(br, scratch)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
t.Error = string(sval)
|
||||
}
|
||||
// t.Subcalls ([]vm.FvmExecutionTrace) (slice)
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("t.Subcalls: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
if maj != cbg.MajArray {
|
||||
return fmt.Errorf("expected cbor array")
|
||||
}
|
||||
|
||||
if extra > 0 {
|
||||
t.Subcalls = make([]FvmExecutionTrace, extra)
|
||||
}
|
||||
|
||||
for i := 0; i < int(extra); i++ {
|
||||
|
||||
var v FvmExecutionTrace
|
||||
if err := v.UnmarshalCBOR(br); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
t.Subcalls[i] = v
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
+94
-18
@@ -3,8 +3,15 @@ package vm
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/lotus/chain/actors/aerrors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
@@ -13,7 +20,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/state"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/exitcode"
|
||||
"github.com/filecoin-project/lotus/lib/sigs"
|
||||
@@ -28,7 +34,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/ipfs/go-cid"
|
||||
)
|
||||
|
||||
var _ Interface = (*FVM)(nil)
|
||||
@@ -38,12 +43,41 @@ type FvmExtern struct {
|
||||
Rand
|
||||
blockstore.Blockstore
|
||||
epoch abi.ChainEpoch
|
||||
nv network.Version
|
||||
lbState LookbackStateGetter
|
||||
base cid.Cid
|
||||
}
|
||||
|
||||
// VerifyConsensusFault is similar to the one in syscalls.go used by the LegacyVM, except it never errors
|
||||
// This may eventually become identical to ExecutionTrace, but we can make incremental progress towards that
|
||||
type FvmExecutionTrace struct {
|
||||
Msg *types.Message
|
||||
MsgRct *types.MessageReceipt
|
||||
Error string
|
||||
|
||||
Subcalls []FvmExecutionTrace
|
||||
}
|
||||
|
||||
func (t *FvmExecutionTrace) ToExecutionTrace() types.ExecutionTrace {
|
||||
if t == nil {
|
||||
return types.ExecutionTrace{}
|
||||
}
|
||||
|
||||
ret := types.ExecutionTrace{
|
||||
Msg: t.Msg,
|
||||
MsgRct: t.MsgRct,
|
||||
Error: t.Error,
|
||||
Duration: 0,
|
||||
GasCharges: nil,
|
||||
Subcalls: make([]types.ExecutionTrace, len(t.Subcalls)),
|
||||
}
|
||||
|
||||
for i, v := range t.Subcalls {
|
||||
ret.Subcalls[i] = v.ToExecutionTrace()
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
// VerifyConsensusFault is similar to the one in syscalls.go used by the Lotus VM, except it never errors
|
||||
// Errors are logged and "no fault" is returned, which is functionally what go-actors does anyway
|
||||
func (x *FvmExtern) VerifyConsensusFault(ctx context.Context, a, b, extra []byte) (*ffi_cgo.ConsensusFault, int64) {
|
||||
totalGas := int64(0)
|
||||
@@ -169,6 +203,10 @@ func (x *FvmExtern) VerifyBlockSig(ctx context.Context, blk *types.BlockHeader)
|
||||
}
|
||||
|
||||
func (x *FvmExtern) workerKeyAtLookback(ctx context.Context, minerId address.Address, height abi.ChainEpoch) (address.Address, int64, error) {
|
||||
if height < x.epoch-policy.ChainFinality {
|
||||
return address.Undef, 0, xerrors.Errorf("cannot get worker key (currEpoch %d, height %d)", x.epoch, height)
|
||||
}
|
||||
|
||||
gasUsed := int64(0)
|
||||
gasAdder := func(gc GasCharge) {
|
||||
// technically not overflow safe, but that's fine
|
||||
@@ -176,7 +214,7 @@ func (x *FvmExtern) workerKeyAtLookback(ctx context.Context, minerId address.Add
|
||||
}
|
||||
|
||||
cstWithoutGas := cbor.NewCborStore(x.Blockstore)
|
||||
cbb := &gasChargingBlocks{gasAdder, PricelistByEpochAndNetworkVersion(x.epoch, x.nv), x.Blockstore}
|
||||
cbb := &gasChargingBlocks{gasAdder, PricelistByEpoch(x.epoch), x.Blockstore}
|
||||
cstWithGas := cbor.NewCborStore(cbb)
|
||||
|
||||
lbState, err := x.lbState(ctx, height)
|
||||
@@ -234,10 +272,19 @@ func NewFVM(ctx context.Context, opts *VMOpts) (*FVM, error) {
|
||||
}
|
||||
}
|
||||
|
||||
fvm, err := ffi.CreateFVM(0,
|
||||
&FvmExtern{Rand: opts.Rand, Blockstore: opts.Bstore, lbState: opts.LookbackState, base: opts.StateBase, epoch: opts.Epoch, nv: opts.NetworkVersion},
|
||||
opts.Epoch, opts.BaseFee, circToReport, opts.NetworkVersion, opts.StateBase,
|
||||
)
|
||||
fvmOpts := ffi.FVMOpts{
|
||||
FVMVersion: 0,
|
||||
Externs: &FvmExtern{Rand: opts.Rand, Blockstore: opts.Bstore, lbState: opts.LookbackState, base: opts.StateBase, epoch: opts.Epoch},
|
||||
Epoch: opts.Epoch,
|
||||
BaseFee: opts.BaseFee,
|
||||
BaseCircSupply: circToReport,
|
||||
NetworkVersion: opts.NetworkVersion,
|
||||
StateBase: opts.StateBase,
|
||||
Tracing: EnableDetailedTracing,
|
||||
}
|
||||
|
||||
fvm, err := ffi.CreateFVM(&fvmOpts)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -249,6 +296,7 @@ func NewFVM(ctx context.Context, opts *VMOpts) (*FVM, error) {
|
||||
|
||||
func (vm *FVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet, error) {
|
||||
start := build.Clock.Now()
|
||||
defer atomic.AddUint64(&StatApplied, 1)
|
||||
msgBytes, err := cmsg.VMMessage().Serialize()
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("serializing msg: %w", err)
|
||||
@@ -259,6 +307,22 @@ func (vm *FVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet
|
||||
return nil, xerrors.Errorf("applying msg: %w", err)
|
||||
}
|
||||
|
||||
var et FvmExecutionTrace
|
||||
if len(ret.ExecTraceBytes) != 0 {
|
||||
if err = et.UnmarshalCBOR(bytes.NewReader(ret.ExecTraceBytes)); err != nil {
|
||||
return nil, xerrors.Errorf("failed to unmarshal exectrace: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
var aerr aerrors.ActorError
|
||||
if ret.ExitCode != 0 {
|
||||
amsg := ret.FailureInfo
|
||||
if amsg == "" {
|
||||
amsg = "unknown error"
|
||||
}
|
||||
aerr = aerrors.New(exitcode.ExitCode(ret.ExitCode), amsg)
|
||||
}
|
||||
|
||||
return &ApplyRet{
|
||||
MessageReceipt: types.MessageReceipt{
|
||||
Return: ret.Return,
|
||||
@@ -275,16 +339,15 @@ func (vm *FVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet
|
||||
GasRefund: 0,
|
||||
GasBurned: 0,
|
||||
},
|
||||
// TODO: do these eventually, not consensus critical
|
||||
// https://github.com/filecoin-project/ref-fvm/issues/318
|
||||
ActorErr: nil,
|
||||
ExecutionTrace: types.ExecutionTrace{},
|
||||
ActorErr: aerr,
|
||||
ExecutionTrace: et.ToExecutionTrace(),
|
||||
Duration: time.Since(start),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (vm *FVM) ApplyImplicitMessage(ctx context.Context, cmsg *types.Message) (*ApplyRet, error) {
|
||||
start := build.Clock.Now()
|
||||
defer atomic.AddUint64(&StatApplied, 1)
|
||||
msgBytes, err := cmsg.VMMessage().Serialize()
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("serializing msg: %w", err)
|
||||
@@ -294,17 +357,30 @@ func (vm *FVM) ApplyImplicitMessage(ctx context.Context, cmsg *types.Message) (*
|
||||
return nil, xerrors.Errorf("applying msg: %w", err)
|
||||
}
|
||||
|
||||
var et FvmExecutionTrace
|
||||
if len(ret.ExecTraceBytes) != 0 {
|
||||
if err = et.UnmarshalCBOR(bytes.NewReader(ret.ExecTraceBytes)); err != nil {
|
||||
return nil, xerrors.Errorf("failed to unmarshal exectrace: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
var aerr aerrors.ActorError
|
||||
if ret.ExitCode != 0 {
|
||||
amsg := ret.FailureInfo
|
||||
if amsg == "" {
|
||||
amsg = "unknown error"
|
||||
}
|
||||
aerr = aerrors.New(exitcode.ExitCode(ret.ExitCode), amsg)
|
||||
}
|
||||
|
||||
return &ApplyRet{
|
||||
MessageReceipt: types.MessageReceipt{
|
||||
Return: ret.Return,
|
||||
ExitCode: exitcode.ExitCode(ret.ExitCode),
|
||||
GasUsed: ret.GasUsed,
|
||||
},
|
||||
GasCosts: nil,
|
||||
// TODO: do these eventually, not consensus critical
|
||||
// https://github.com/filecoin-project/ref-fvm/issues/318
|
||||
ActorErr: nil,
|
||||
ExecutionTrace: types.ExecutionTrace{},
|
||||
ActorErr: aerr,
|
||||
ExecutionTrace: et.ToExecutionTrace(),
|
||||
Duration: time.Since(start),
|
||||
}, nil
|
||||
}
|
||||
|
||||
+122
-132
@@ -3,8 +3,6 @@ package vm
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
|
||||
vmr "github.com/filecoin-project/specs-actors/v7/actors/runtime"
|
||||
proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof"
|
||||
|
||||
@@ -84,153 +82,145 @@ type Pricelist interface {
|
||||
OnVerifyConsensusFault() GasCharge
|
||||
}
|
||||
|
||||
var priceListGenesis = pricelistV0{
|
||||
computeGasMulti: 1,
|
||||
storageGasMulti: 1000,
|
||||
// Prices are the price lists per starting epoch. Public for testing purposes
|
||||
// (concretely to allow the test vector runner to rebase prices).
|
||||
var Prices = map[abi.ChainEpoch]Pricelist{
|
||||
abi.ChainEpoch(0): &pricelistV0{
|
||||
computeGasMulti: 1,
|
||||
storageGasMulti: 1000,
|
||||
|
||||
onChainMessageComputeBase: 38863,
|
||||
onChainMessageStorageBase: 36,
|
||||
onChainMessageStoragePerByte: 1,
|
||||
onChainMessageComputeBase: 38863,
|
||||
onChainMessageStorageBase: 36,
|
||||
onChainMessageStoragePerByte: 1,
|
||||
|
||||
onChainReturnValuePerByte: 1,
|
||||
onChainReturnValuePerByte: 1,
|
||||
|
||||
sendBase: 29233,
|
||||
sendTransferFunds: 27500,
|
||||
sendTransferOnlyPremium: 159672,
|
||||
sendInvokeMethod: -5377,
|
||||
sendBase: 29233,
|
||||
sendTransferFunds: 27500,
|
||||
sendTransferOnlyPremium: 159672,
|
||||
sendInvokeMethod: -5377,
|
||||
|
||||
ipldGetBase: 75242,
|
||||
ipldPutBase: 84070,
|
||||
ipldPutPerByte: 1,
|
||||
ipldGetBase: 75242,
|
||||
ipldPutBase: 84070,
|
||||
ipldPutPerByte: 1,
|
||||
|
||||
createActorCompute: 1108454,
|
||||
createActorStorage: 36 + 40,
|
||||
deleteActor: -(36 + 40), // -createActorStorage
|
||||
createActorCompute: 1108454,
|
||||
createActorStorage: 36 + 40,
|
||||
deleteActor: -(36 + 40), // -createActorStorage
|
||||
|
||||
verifySignature: map[crypto.SigType]int64{
|
||||
crypto.SigTypeBLS: 16598605,
|
||||
crypto.SigTypeSecp256k1: 1637292,
|
||||
verifySignature: map[crypto.SigType]int64{
|
||||
crypto.SigTypeBLS: 16598605,
|
||||
crypto.SigTypeSecp256k1: 1637292,
|
||||
},
|
||||
|
||||
hashingBase: 31355,
|
||||
computeUnsealedSectorCidBase: 98647,
|
||||
verifySealBase: 2000, // TODO gas , it VerifySeal syscall is not used
|
||||
verifyAggregateSealBase: 0,
|
||||
verifyPostLookup: map[abi.RegisteredPoStProof]scalingCost{
|
||||
abi.RegisteredPoStProof_StackedDrgWindow512MiBV1: {
|
||||
flat: 123861062,
|
||||
scale: 9226981,
|
||||
},
|
||||
abi.RegisteredPoStProof_StackedDrgWindow32GiBV1: {
|
||||
flat: 748593537,
|
||||
scale: 85639,
|
||||
},
|
||||
abi.RegisteredPoStProof_StackedDrgWindow64GiBV1: {
|
||||
flat: 748593537,
|
||||
scale: 85639,
|
||||
},
|
||||
},
|
||||
verifyPostDiscount: true,
|
||||
verifyConsensusFault: 495422,
|
||||
},
|
||||
abi.ChainEpoch(build.UpgradeCalicoHeight): &pricelistV0{
|
||||
computeGasMulti: 1,
|
||||
storageGasMulti: 1300,
|
||||
|
||||
hashingBase: 31355,
|
||||
computeUnsealedSectorCidBase: 98647,
|
||||
verifySealBase: 2000, // TODO gas , it VerifySeal syscall is not used
|
||||
verifyAggregateSealBase: 0,
|
||||
verifyPostLookup: map[abi.RegisteredPoStProof]scalingCost{
|
||||
abi.RegisteredPoStProof_StackedDrgWindow512MiBV1: {
|
||||
flat: 123861062,
|
||||
scale: 9226981,
|
||||
onChainMessageComputeBase: 38863,
|
||||
onChainMessageStorageBase: 36,
|
||||
onChainMessageStoragePerByte: 1,
|
||||
|
||||
onChainReturnValuePerByte: 1,
|
||||
|
||||
sendBase: 29233,
|
||||
sendTransferFunds: 27500,
|
||||
sendTransferOnlyPremium: 159672,
|
||||
sendInvokeMethod: -5377,
|
||||
|
||||
ipldGetBase: 114617,
|
||||
ipldPutBase: 353640,
|
||||
ipldPutPerByte: 1,
|
||||
|
||||
createActorCompute: 1108454,
|
||||
createActorStorage: 36 + 40,
|
||||
deleteActor: -(36 + 40), // -createActorStorage
|
||||
|
||||
verifySignature: map[crypto.SigType]int64{
|
||||
crypto.SigTypeBLS: 16598605,
|
||||
crypto.SigTypeSecp256k1: 1637292,
|
||||
},
|
||||
abi.RegisteredPoStProof_StackedDrgWindow32GiBV1: {
|
||||
flat: 748593537,
|
||||
scale: 85639,
|
||||
|
||||
hashingBase: 31355,
|
||||
computeUnsealedSectorCidBase: 98647,
|
||||
verifySealBase: 2000, // TODO gas, it VerifySeal syscall is not used
|
||||
|
||||
verifyAggregateSealPer: map[abi.RegisteredSealProof]int64{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1_1: 449900,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1_1: 359272,
|
||||
},
|
||||
abi.RegisteredPoStProof_StackedDrgWindow64GiBV1: {
|
||||
flat: 748593537,
|
||||
scale: 85639,
|
||||
verifyAggregateSealSteps: map[abi.RegisteredSealProof]stepCost{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1_1: {
|
||||
{4, 103994170},
|
||||
{7, 112356810},
|
||||
{13, 122912610},
|
||||
{26, 137559930},
|
||||
{52, 162039100},
|
||||
{103, 210960780},
|
||||
{205, 318351180},
|
||||
{410, 528274980},
|
||||
},
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1_1: {
|
||||
{4, 102581240},
|
||||
{7, 110803030},
|
||||
{13, 120803700},
|
||||
{26, 134642130},
|
||||
{52, 157357890},
|
||||
{103, 203017690},
|
||||
{205, 304253590},
|
||||
{410, 509880640},
|
||||
},
|
||||
},
|
||||
|
||||
verifyPostLookup: map[abi.RegisteredPoStProof]scalingCost{
|
||||
abi.RegisteredPoStProof_StackedDrgWindow512MiBV1: {
|
||||
flat: 117680921,
|
||||
scale: 43780,
|
||||
},
|
||||
abi.RegisteredPoStProof_StackedDrgWindow32GiBV1: {
|
||||
flat: 117680921,
|
||||
scale: 43780,
|
||||
},
|
||||
abi.RegisteredPoStProof_StackedDrgWindow64GiBV1: {
|
||||
flat: 117680921,
|
||||
scale: 43780,
|
||||
},
|
||||
},
|
||||
verifyPostDiscount: false,
|
||||
verifyConsensusFault: 495422,
|
||||
|
||||
verifyReplicaUpdate: 36316136,
|
||||
},
|
||||
verifyPostDiscount: true,
|
||||
verifyConsensusFault: 495422,
|
||||
}
|
||||
|
||||
var priceListCalico = pricelistV0{
|
||||
computeGasMulti: 1,
|
||||
storageGasMulti: 1300,
|
||||
|
||||
onChainMessageComputeBase: 38863,
|
||||
onChainMessageStorageBase: 36,
|
||||
onChainMessageStoragePerByte: 1,
|
||||
|
||||
onChainReturnValuePerByte: 1,
|
||||
|
||||
sendBase: 29233,
|
||||
sendTransferFunds: 27500,
|
||||
sendTransferOnlyPremium: 159672,
|
||||
sendInvokeMethod: -5377,
|
||||
|
||||
ipldGetBase: 114617,
|
||||
ipldPutBase: 353640,
|
||||
ipldPutPerByte: 1,
|
||||
|
||||
createActorCompute: 1108454,
|
||||
createActorStorage: 36 + 40,
|
||||
deleteActor: -(36 + 40), // -createActorStorage
|
||||
|
||||
verifySignature: map[crypto.SigType]int64{
|
||||
crypto.SigTypeBLS: 16598605,
|
||||
crypto.SigTypeSecp256k1: 1637292,
|
||||
},
|
||||
|
||||
hashingBase: 31355,
|
||||
computeUnsealedSectorCidBase: 98647,
|
||||
verifySealBase: 2000, // TODO gas, it VerifySeal syscall is not used
|
||||
|
||||
verifyAggregateSealPer: map[abi.RegisteredSealProof]int64{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1_1: 449900,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1_1: 359272,
|
||||
},
|
||||
verifyAggregateSealSteps: map[abi.RegisteredSealProof]stepCost{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1_1: {
|
||||
{4, 103994170},
|
||||
{7, 112356810},
|
||||
{13, 122912610},
|
||||
{26, 137559930},
|
||||
{52, 162039100},
|
||||
{103, 210960780},
|
||||
{205, 318351180},
|
||||
{410, 528274980},
|
||||
},
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1_1: {
|
||||
{4, 102581240},
|
||||
{7, 110803030},
|
||||
{13, 120803700},
|
||||
{26, 134642130},
|
||||
{52, 157357890},
|
||||
{103, 203017690},
|
||||
{205, 304253590},
|
||||
{410, 509880640},
|
||||
},
|
||||
},
|
||||
|
||||
verifyPostLookup: map[abi.RegisteredPoStProof]scalingCost{
|
||||
abi.RegisteredPoStProof_StackedDrgWindow512MiBV1: {
|
||||
flat: 117680921,
|
||||
scale: 43780,
|
||||
},
|
||||
abi.RegisteredPoStProof_StackedDrgWindow32GiBV1: {
|
||||
flat: 117680921,
|
||||
scale: 43780,
|
||||
},
|
||||
abi.RegisteredPoStProof_StackedDrgWindow64GiBV1: {
|
||||
flat: 117680921,
|
||||
scale: 43780,
|
||||
},
|
||||
},
|
||||
verifyPostDiscount: false,
|
||||
verifyConsensusFault: 495422,
|
||||
|
||||
verifyReplicaUpdate: 36316136,
|
||||
}
|
||||
|
||||
// Prices are the price lists per starting epoch.
|
||||
// For network v8 and onwards, this is disregarded; the pricelist is selected by network version.
|
||||
var pricesByEpoch = map[abi.ChainEpoch]Pricelist{
|
||||
abi.ChainEpoch(0): &priceListGenesis,
|
||||
abi.ChainEpoch(build.UpgradeCalicoHeight): &priceListCalico,
|
||||
}
|
||||
|
||||
// PricelistByEpochAndNetworkVersion finds the latest prices for the given epoch
|
||||
func PricelistByEpochAndNetworkVersion(epoch abi.ChainEpoch, nv network.Version) Pricelist {
|
||||
if nv >= network.Version8 {
|
||||
return &priceListCalico
|
||||
}
|
||||
|
||||
// PricelistByEpoch finds the latest prices for the given epoch
|
||||
func PricelistByEpoch(epoch abi.ChainEpoch) Pricelist {
|
||||
// since we are storing the prices as map or epoch to price
|
||||
// we need to get the price with the highest epoch that is lower or equal to the `epoch` arg
|
||||
bestEpoch := abi.ChainEpoch(0)
|
||||
bestPrice := pricesByEpoch[bestEpoch]
|
||||
for e, pl := range pricesByEpoch {
|
||||
bestPrice := Prices[bestEpoch]
|
||||
for e, pl := range Prices {
|
||||
// if `e` happened after `bestEpoch` and `e` is earlier or equal to the target `epoch`
|
||||
if e > bestEpoch && e <= epoch {
|
||||
bestEpoch = e
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ var EmptyObjectCid cid.Cid
|
||||
|
||||
// TryCreateAccountActor creates account actors from only BLS/SECP256K1 addresses.
|
||||
func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, address.Address, aerrors.ActorError) {
|
||||
if err := rt.chargeGasSafe(PricelistByEpochAndNetworkVersion(rt.height, rt.NetworkVersion()).OnCreateActor()); err != nil {
|
||||
if err := rt.chargeGasSafe(PricelistByEpoch(rt.height).OnCreateActor()); err != nil {
|
||||
return nil, address.Undef, err
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -56,8 +56,8 @@ func (m *Message) ValueReceived() abi.TokenAmount {
|
||||
return m.msg.Value
|
||||
}
|
||||
|
||||
// EnableGasTracing, if true, outputs gas tracing in execution traces.
|
||||
var EnableGasTracing = os.Getenv("LOTUS_VM_ENABLE_GAS_TRACING_VERY_SLOW") == "1"
|
||||
// EnableDetailedTracing, if true, outputs gas tracing in execution traces.
|
||||
var EnableDetailedTracing = os.Getenv("LOTUS_VM_ENABLE_GAS_TRACING_VERY_SLOW") == "1"
|
||||
|
||||
type Runtime struct {
|
||||
rt7.Message
|
||||
@@ -516,7 +516,7 @@ func (rt *Runtime) stateCommit(oldh, newh cid.Cid) aerrors.ActorError {
|
||||
}
|
||||
|
||||
func (rt *Runtime) finilizeGasTracing() {
|
||||
if EnableGasTracing {
|
||||
if EnableDetailedTracing {
|
||||
if rt.lastGasCharge != nil {
|
||||
rt.lastGasCharge.TimeTaken = time.Since(rt.lastGasChargeTime)
|
||||
}
|
||||
@@ -550,7 +550,7 @@ func (rt *Runtime) chargeGasFunc(skip int) func(GasCharge) {
|
||||
|
||||
func (rt *Runtime) chargeGasInternal(gas GasCharge, skip int) aerrors.ActorError {
|
||||
toUse := gas.Total()
|
||||
if EnableGasTracing {
|
||||
if EnableDetailedTracing {
|
||||
var callers [10]uintptr
|
||||
|
||||
cout := gruntime.Callers(2+skip, callers[:])
|
||||
|
||||
@@ -56,14 +56,14 @@ func BenchmarkRuntime_CreateRuntimeChargeGas_TracingDisabled(b *testing.B) {
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
EnableGasTracing = false
|
||||
noop := func() bool { return EnableGasTracing }
|
||||
EnableDetailedTracing = false
|
||||
noop := func() bool { return EnableDetailedTracing }
|
||||
for n := 0; n < b.N; n++ {
|
||||
// flip the value and access it to make sure
|
||||
// the compiler doesn't optimize away
|
||||
EnableGasTracing = true
|
||||
EnableDetailedTracing = true
|
||||
_ = noop()
|
||||
EnableGasTracing = false
|
||||
EnableDetailedTracing = false
|
||||
_ = (&Runtime{cst: cst}).chargeGasInternal(gch, 0)
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -42,7 +42,7 @@ const MaxCallDepth = 4096
|
||||
|
||||
var (
|
||||
log = logging.Logger("vm")
|
||||
actorLog = logging.Logger("actors")
|
||||
actorLog = logging.WithSkip(logging.Logger("actors"), 1)
|
||||
gasOnActorExec = newGasCharge("OnActorExec", 0, 0)
|
||||
)
|
||||
|
||||
@@ -135,7 +135,7 @@ func (vm *LegacyVM) makeRuntime(ctx context.Context, msg *types.Message, parent
|
||||
gasAvailable: msg.GasLimit,
|
||||
depth: 0,
|
||||
numActorsCreated: 0,
|
||||
pricelist: PricelistByEpochAndNetworkVersion(vm.blockHeight, vm.networkVersion),
|
||||
pricelist: PricelistByEpoch(vm.blockHeight),
|
||||
allowInternal: true,
|
||||
callerValidated: false,
|
||||
executionTrace: types.ExecutionTrace{Msg: msg},
|
||||
@@ -283,7 +283,7 @@ func (vm *LegacyVM) send(ctx context.Context, msg *types.Message, parent *Runtim
|
||||
st := vm.cstate
|
||||
|
||||
rt := vm.makeRuntime(ctx, msg, parent)
|
||||
if EnableGasTracing {
|
||||
if EnableDetailedTracing {
|
||||
rt.lastGasChargeTime = start
|
||||
if parent != nil {
|
||||
rt.lastGasChargeTime = parent.lastGasChargeTime
|
||||
@@ -431,7 +431,7 @@ func (vm *LegacyVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*App
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pl := PricelistByEpochAndNetworkVersion(vm.blockHeight, vm.networkVersion)
|
||||
pl := PricelistByEpoch(vm.blockHeight)
|
||||
|
||||
msgGas := pl.OnChainMessage(cmsg.ChainLength())
|
||||
msgGasCost := msgGas.Total()
|
||||
|
||||
+4
-1
@@ -90,7 +90,8 @@ var ChainHeadCmd = &cli.Command{
|
||||
}
|
||||
|
||||
var ChainGetBlock = &cli.Command{
|
||||
Name: "getblock",
|
||||
Name: "get-block",
|
||||
Aliases: []string{"getblock"},
|
||||
Usage: "Get a block and print its details",
|
||||
ArgsUsage: "[blockCid]",
|
||||
Flags: []cli.Flag{
|
||||
@@ -299,6 +300,7 @@ var ChainStatObjCmd = &cli.Command{
|
||||
|
||||
var ChainGetMsgCmd = &cli.Command{
|
||||
Name: "getmessage",
|
||||
Aliases: []string{"get-message", "get-msg"},
|
||||
Usage: "Get and print a message by its cid",
|
||||
ArgsUsage: "[messageCid]",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
@@ -349,6 +351,7 @@ var ChainGetMsgCmd = &cli.Command{
|
||||
|
||||
var ChainSetHeadCmd = &cli.Command{
|
||||
Name: "sethead",
|
||||
Aliases: []string{"set-head"},
|
||||
Usage: "manually set the local nodes head tipset (Caution: normally only used for recovery)",
|
||||
ArgsUsage: "[tipsetkey]",
|
||||
Flags: []cli.Flag{
|
||||
|
||||
+23
-9
@@ -515,7 +515,7 @@ The minimum value is 518400 (6 months).`,
|
||||
}
|
||||
|
||||
func interactiveDeal(cctx *cli.Context) error {
|
||||
api, closer, err := GetFullNodeAPI(cctx)
|
||||
api, closer, err := GetFullNodeAPIV1(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -873,7 +873,7 @@ uiLoop:
|
||||
continue uiLoop
|
||||
}
|
||||
|
||||
ask = append(ask, *a)
|
||||
ask = append(ask, *a.Response)
|
||||
}
|
||||
|
||||
// TODO: run more validation
|
||||
@@ -1403,9 +1403,13 @@ var clientListAsksCmd = &cli.Command{
|
||||
Value: "text",
|
||||
Usage: "Either 'text' or 'csv'",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "protocols",
|
||||
Usage: "Output supported deal protocols",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, closer, err := GetFullNodeAPI(cctx)
|
||||
api, closer, err := GetFullNodeAPIV1(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1422,21 +1426,27 @@ var clientListAsksCmd = &cli.Command{
|
||||
return asks[i].Ping < asks[j].Ping
|
||||
})
|
||||
}
|
||||
pfmt := "%s: min:%s max:%s price:%s/GiB/Epoch verifiedPrice:%s/GiB/Epoch ping:%s\n"
|
||||
pfmt := "%s: min:%s max:%s price:%s/GiB/Epoch verifiedPrice:%s/GiB/Epoch ping:%s protos:%s\n"
|
||||
if cctx.String("output-format") == "csv" {
|
||||
fmt.Printf("Miner,Min,Max,Price,VerifiedPrice,Ping\n")
|
||||
pfmt = "%s,%s,%s,%s,%s,%s\n"
|
||||
fmt.Printf("Miner,Min,Max,Price,VerifiedPrice,Ping,Protocols")
|
||||
pfmt = "%s,%s,%s,%s,%s,%s,%s\n"
|
||||
}
|
||||
|
||||
for _, a := range asks {
|
||||
ask := a.Ask
|
||||
|
||||
protos := ""
|
||||
if cctx.Bool("protocols") {
|
||||
protos = "[" + strings.Join(a.DealProtocols, ",") + "]"
|
||||
}
|
||||
|
||||
fmt.Printf(pfmt, ask.Miner,
|
||||
types.SizeStr(types.NewInt(uint64(ask.MinPieceSize))),
|
||||
types.SizeStr(types.NewInt(uint64(ask.MaxPieceSize))),
|
||||
types.FIL(ask.Price),
|
||||
types.FIL(ask.VerifiedPrice),
|
||||
a.Ping,
|
||||
protos,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1445,11 +1455,13 @@ var clientListAsksCmd = &cli.Command{
|
||||
}
|
||||
|
||||
type QueriedAsk struct {
|
||||
Ask *storagemarket.StorageAsk
|
||||
Ask *storagemarket.StorageAsk
|
||||
DealProtocols []string
|
||||
|
||||
Ping time.Duration
|
||||
}
|
||||
|
||||
func GetAsks(ctx context.Context, api v0api.FullNode) ([]QueriedAsk, error) {
|
||||
func GetAsks(ctx context.Context, api lapi.FullNode) ([]QueriedAsk, error) {
|
||||
isTTY := true
|
||||
if fileInfo, _ := os.Stdout.Stat(); (fileInfo.Mode() & os.ModeCharDevice) == 0 {
|
||||
isTTY = false
|
||||
@@ -1560,7 +1572,9 @@ loop:
|
||||
atomic.AddInt64(&got, 1)
|
||||
lk.Lock()
|
||||
asks = append(asks, QueriedAsk{
|
||||
Ask: ask,
|
||||
Ask: ask.Response,
|
||||
DealProtocols: ask.DealProtocols,
|
||||
|
||||
Ping: pingDuration,
|
||||
})
|
||||
lk.Unlock()
|
||||
|
||||
+2
-1
@@ -358,7 +358,8 @@ var NetId = &cli.Command{
|
||||
}
|
||||
|
||||
var NetFindPeer = &cli.Command{
|
||||
Name: "findpeer",
|
||||
Name: "find-peer",
|
||||
Aliases: []string{"findpeer"},
|
||||
Usage: "Find the addresses of a given peerID",
|
||||
ArgsUsage: "[peerId]",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
|
||||
@@ -1428,6 +1428,7 @@ func jsonReturn(code cid.Cid, method abi.MethodNum, ret []byte) (string, error)
|
||||
|
||||
var StateWaitMsgCmd = &cli.Command{
|
||||
Name: "wait-msg",
|
||||
Aliases: []string{"wait-message"},
|
||||
Usage: "Wait for a message to appear on chain",
|
||||
ArgsUsage: "[messageCid]",
|
||||
Flags: []cli.Flag{
|
||||
@@ -1470,6 +1471,7 @@ var StateWaitMsgCmd = &cli.Command{
|
||||
|
||||
var StateSearchMsgCmd = &cli.Command{
|
||||
Name: "search-msg",
|
||||
Aliases: []string{"search-message"},
|
||||
Usage: "Search to see whether a message has appeared on chain",
|
||||
ArgsUsage: "[messageCid]",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
@@ -1727,6 +1729,7 @@ var StateCircSupplyCmd = &cli.Command{
|
||||
|
||||
var StateSectorCmd = &cli.Command{
|
||||
Name: "sector",
|
||||
Aliases: []string{"sector-info"},
|
||||
Usage: "Get miner sector info",
|
||||
ArgsUsage: "[minerAddress] [sectorNumber]",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
|
||||
+1
-1
@@ -500,7 +500,7 @@ var walletVerify = &cli.Command{
|
||||
|
||||
var walletDelete = &cli.Command{
|
||||
Name: "delete",
|
||||
Usage: "Delete an account from the wallet",
|
||||
Usage: "Soft delete an address from the wallet - hard deletion needed for permanent removal",
|
||||
ArgsUsage: "<address> ",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, closer, err := GetFullNodeAPI(cctx)
|
||||
|
||||
@@ -51,8 +51,9 @@ var actorCmd = &cli.Command{
|
||||
}
|
||||
|
||||
var actorSetAddrsCmd = &cli.Command{
|
||||
Name: "set-addrs",
|
||||
Usage: "set addresses that your miner can be publicly dialed on",
|
||||
Name: "set-addresses",
|
||||
Aliases: []string{"set-addrs"},
|
||||
Usage: "set addresses that your miner can be publicly dialed on",
|
||||
Flags: []cli.Flag{
|
||||
&cli.Int64Flag{
|
||||
Name: "gas-limit",
|
||||
@@ -916,8 +917,8 @@ var actorProposeChangeWorker = &cli.Command{
|
||||
return fmt.Errorf("Proposed worker address change not reflected on chain: expected '%s', found '%s'", na, mi.NewWorker)
|
||||
}
|
||||
|
||||
fmt.Fprintf(cctx.App.Writer, "Worker key change to %s successfully proposed.\n", na)
|
||||
fmt.Fprintf(cctx.App.Writer, "Call 'confirm-change-worker' at or after height %d to complete.\n", mi.WorkerChangeEpoch)
|
||||
fmt.Fprintf(cctx.App.Writer, "Worker key change to %s successfully sent, change happens at height %d.\n", na, mi.WorkerChangeEpoch)
|
||||
fmt.Fprintf(cctx.App.Writer, "If you have no active deadlines, call 'confirm-change-worker' at or after height %d to complete.\n", mi.WorkerChangeEpoch)
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
@@ -72,7 +72,7 @@ func TestWorkerKeyChange(t *testing.T) {
|
||||
result := output.String()
|
||||
output.Reset()
|
||||
|
||||
require.Contains(t, result, fmt.Sprintf("Worker key change to %s successfully proposed.", newKey))
|
||||
require.Contains(t, result, fmt.Sprintf("Worker key change to %s successfully sent", newKey))
|
||||
|
||||
epochRe := regexp.MustCompile("at or after height (?P<epoch>[0-9]+) to complete")
|
||||
matches := epochRe.FindStringSubmatch(result)
|
||||
|
||||
@@ -50,8 +50,13 @@ var infoAllCmd = &cli.Command{
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Worker List")
|
||||
if err := sealingWorkersCmd.Action(cctx); err != nil {
|
||||
fmt.Println("\n#: Sealing Worker List")
|
||||
if err := workersCmd(true).Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
fmt.Println("\n#: Proving Worker List")
|
||||
if err := workersCmd(false).Action(cctx); err != nil {
|
||||
fmt.Println("ERROR: ", err)
|
||||
}
|
||||
|
||||
|
||||
@@ -467,7 +467,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api v1api.FullNode
|
||||
}
|
||||
stor := stores.NewRemote(lstor, si, http.Header(sa), 10, &stores.DefaultPartialFileHandler{})
|
||||
|
||||
smgr, err := sectorstorage.New(ctx, lstor, stor, lr, si, sectorstorage.SealerConfig{
|
||||
smgr, err := sectorstorage.New(ctx, lstor, stor, lr, si, sectorstorage.Config{
|
||||
ParallelFetchLimit: 10,
|
||||
AllowAddPiece: true,
|
||||
AllowPreCommit1: true,
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"text/tabwriter"
|
||||
"time"
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/urfave/cli/v2"
|
||||
@@ -30,6 +32,8 @@ var provingCmd = &cli.Command{
|
||||
provingDeadlineInfoCmd,
|
||||
provingFaultsCmd,
|
||||
provingCheckProvableCmd,
|
||||
workersCmd(false),
|
||||
provingComputeCmd,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -509,3 +513,51 @@ var provingCheckProvableCmd = &cli.Command{
|
||||
return tw.Flush()
|
||||
},
|
||||
}
|
||||
|
||||
var provingComputeCmd = &cli.Command{
|
||||
Name: "compute",
|
||||
Subcommands: []*cli.Command{
|
||||
provingComputeWindowPoStCmd,
|
||||
},
|
||||
}
|
||||
|
||||
var provingComputeWindowPoStCmd = &cli.Command{
|
||||
Name: "windowed-post",
|
||||
Aliases: []string{"window-post"},
|
||||
Usage: "Compute WindowPoSt for a specific deadline",
|
||||
Description: `Note: This command is intended to be used to verify PoSt compute performance.
|
||||
It will not send any messages to the chain.`,
|
||||
ArgsUsage: "[deadline index]",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.Args().Len() != 1 {
|
||||
return xerrors.Errorf("must pass deadline index")
|
||||
}
|
||||
|
||||
dlIdx, err := strconv.ParseUint(cctx.Args().Get(0), 10, 64)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("could not parse deadline index: %w", err)
|
||||
}
|
||||
|
||||
sapi, scloser, err := lcli.GetStorageMinerAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer scloser()
|
||||
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
start := time.Now()
|
||||
res, err := sapi.ComputeWindowPoSt(ctx, dlIdx, types.EmptyTSK)
|
||||
fmt.Printf("Took %s\n", time.Now().Sub(start))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
jr, err := json.Marshal(res)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(string(jr))
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
+98
-89
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
@@ -27,7 +28,7 @@ var sealingCmd = &cli.Command{
|
||||
Usage: "interact with sealing pipeline",
|
||||
Subcommands: []*cli.Command{
|
||||
sealingJobsCmd,
|
||||
sealingWorkersCmd,
|
||||
workersCmd(true),
|
||||
sealingSchedDiagCmd,
|
||||
sealingAbortCmd,
|
||||
},
|
||||
@@ -47,107 +48,115 @@ func barString(total, y, g float64) string {
|
||||
return barString
|
||||
}
|
||||
|
||||
var sealingWorkersCmd = &cli.Command{
|
||||
Name: "workers",
|
||||
Usage: "list workers",
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "color",
|
||||
Usage: "use color in display output",
|
||||
DefaultText: "depends on output being a TTY",
|
||||
func workersCmd(sealing bool) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "workers",
|
||||
Usage: "list workers",
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "color",
|
||||
Usage: "use color in display output",
|
||||
DefaultText: "depends on output being a TTY",
|
||||
},
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.IsSet("color") {
|
||||
color.NoColor = !cctx.Bool("color")
|
||||
}
|
||||
|
||||
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
stats, err := nodeApi.WorkerStats(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
type sortableStat struct {
|
||||
id uuid.UUID
|
||||
storiface.WorkerStats
|
||||
}
|
||||
|
||||
st := make([]sortableStat, 0, len(stats))
|
||||
for id, stat := range stats {
|
||||
st = append(st, sortableStat{id, stat})
|
||||
}
|
||||
|
||||
sort.Slice(st, func(i, j int) bool {
|
||||
return st[i].id.String() < st[j].id.String()
|
||||
})
|
||||
|
||||
for _, stat := range st {
|
||||
gpuUse := "not "
|
||||
gpuCol := color.FgBlue
|
||||
if stat.GpuUsed > 0 {
|
||||
gpuCol = color.FgGreen
|
||||
gpuUse = ""
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.IsSet("color") {
|
||||
color.NoColor = !cctx.Bool("color")
|
||||
}
|
||||
|
||||
var disabled string
|
||||
if !stat.Enabled {
|
||||
disabled = color.RedString(" (disabled)")
|
||||
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
stats, err := nodeApi.WorkerStats(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Worker %s, host %s%s\n", stat.id, color.MagentaString(stat.Info.Hostname), disabled)
|
||||
|
||||
fmt.Printf("\tCPU: [%s] %d/%d core(s) in use\n",
|
||||
barString(float64(stat.Info.Resources.CPUs), 0, float64(stat.CpuUse)), stat.CpuUse, stat.Info.Resources.CPUs)
|
||||
|
||||
ramTotal := stat.Info.Resources.MemPhysical
|
||||
ramTasks := stat.MemUsedMin
|
||||
ramUsed := stat.Info.Resources.MemUsed
|
||||
var ramReserved uint64 = 0
|
||||
if ramUsed > ramTasks {
|
||||
ramReserved = ramUsed - ramTasks
|
||||
type sortableStat struct {
|
||||
id uuid.UUID
|
||||
storiface.WorkerStats
|
||||
}
|
||||
ramBar := barString(float64(ramTotal), float64(ramReserved), float64(ramTasks))
|
||||
|
||||
fmt.Printf("\tRAM: [%s] %d%% %s/%s\n", ramBar,
|
||||
(ramTasks+ramReserved)*100/stat.Info.Resources.MemPhysical,
|
||||
types.SizeStr(types.NewInt(ramTasks+ramUsed)),
|
||||
types.SizeStr(types.NewInt(stat.Info.Resources.MemPhysical)))
|
||||
st := make([]sortableStat, 0, len(stats))
|
||||
for id, stat := range stats {
|
||||
if len(stat.Tasks) > 0 {
|
||||
if (stat.Tasks[0].WorkerType() != sealtasks.WorkerSealing) == sealing {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
st = append(st, sortableStat{id, stat})
|
||||
}
|
||||
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)))
|
||||
sort.Slice(st, func(i, j int) bool {
|
||||
return st[i].id.String() < st[j].id.String()
|
||||
})
|
||||
|
||||
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 _, stat := range st {
|
||||
gpuUse := "not "
|
||||
gpuCol := color.FgBlue
|
||||
if stat.GpuUsed > 0 {
|
||||
gpuCol = color.FgGreen
|
||||
gpuUse = ""
|
||||
}
|
||||
|
||||
var disabled string
|
||||
if !stat.Enabled {
|
||||
disabled = color.RedString(" (disabled)")
|
||||
}
|
||||
|
||||
fmt.Printf("Worker %s, host %s%s\n", stat.id, color.MagentaString(stat.Info.Hostname), disabled)
|
||||
|
||||
fmt.Printf("\tCPU: [%s] %d/%d core(s) in use\n",
|
||||
barString(float64(stat.Info.Resources.CPUs), 0, float64(stat.CpuUse)), stat.CpuUse, stat.Info.Resources.CPUs)
|
||||
|
||||
ramTotal := stat.Info.Resources.MemPhysical
|
||||
ramTasks := stat.MemUsedMin
|
||||
ramUsed := stat.Info.Resources.MemUsed
|
||||
var ramReserved uint64 = 0
|
||||
if ramUsed > ramTasks {
|
||||
ramReserved = ramUsed - ramTasks
|
||||
}
|
||||
ramBar := barString(float64(ramTotal), float64(ramReserved), float64(ramTasks))
|
||||
|
||||
fmt.Printf("\tRAM: [%s] %d%% %s/%s\n", ramBar,
|
||||
(ramTasks+ramReserved)*100/stat.Info.Resources.MemPhysical,
|
||||
types.SizeStr(types.NewInt(ramTasks+ramUsed)),
|
||||
types.SizeStr(types.NewInt(stat.Info.Resources.MemPhysical)))
|
||||
|
||||
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))
|
||||
}
|
||||
}
|
||||
for _, gpu := range stat.Info.Resources.GPUs {
|
||||
fmt.Printf("\tGPU: %s\n", color.New(gpuCol).Sprintf("%s, %sused", gpu, gpuUse))
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
var sealingJobsCmd = &cli.Command{
|
||||
|
||||
@@ -14,7 +14,8 @@ import (
|
||||
)
|
||||
|
||||
var blockmsgidCmd = &cli.Command{
|
||||
Name: "blockmsgid",
|
||||
Name: "block-message-id",
|
||||
Aliases: []string{"blockmsgid"},
|
||||
Usage: "Print a block's pubsub message ID",
|
||||
ArgsUsage: "<blockCid> ...",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/dgraph-io/badger/v2/y"
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/mitchellh/go-homedir"
|
||||
"github.com/multiformats/go-base32"
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/xerrors"
|
||||
@@ -23,11 +24,6 @@ var datastoreVlog2CarCmd = &cli.Command{
|
||||
Name: "vlog2car",
|
||||
Usage: "convert badger blockstore .vlog to .car",
|
||||
Flags: []cli.Flag{
|
||||
&cli.PathFlag{
|
||||
Name: "vlog",
|
||||
Usage: "vlog file",
|
||||
Required: true,
|
||||
},
|
||||
&cli.PathFlag{
|
||||
Name: "car",
|
||||
Usage: "out car file name (no .car)",
|
||||
@@ -39,10 +35,11 @@ var datastoreVlog2CarCmd = &cli.Command{
|
||||
Value: "/blocks/",
|
||||
},
|
||||
},
|
||||
ArgsUsage: "[vlog...]",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
ctx := cctx.Context
|
||||
|
||||
maxSz := uint64(1 << 20)
|
||||
maxSz := uint64(31 << 30)
|
||||
|
||||
carb := &rawCarb{
|
||||
max: maxSz,
|
||||
@@ -53,11 +50,16 @@ var datastoreVlog2CarCmd = &cli.Command{
|
||||
pref := cctx.String("key-prefix")
|
||||
plen := len(pref)
|
||||
|
||||
{
|
||||
for _, vlogPath := range cctx.Args().Slice() {
|
||||
vlogPath, err := homedir.Expand(vlogPath)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("expand vlog path: %w", err)
|
||||
}
|
||||
|
||||
// NOTE: Some bits of code in this code block come from https://github.com/dgraph-io/badger, which is licensed
|
||||
// under Apache 2.0; See https://github.com/dgraph-io/badger/blob/master/LICENSE
|
||||
|
||||
vf, err := os.Open(cctx.Path("vlog"))
|
||||
vf, err := os.Open(vlogPath)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("open vlog file: %w", err)
|
||||
}
|
||||
|
||||
@@ -41,8 +41,9 @@ type keyInfoOutput struct {
|
||||
}
|
||||
|
||||
var keyinfoCmd = &cli.Command{
|
||||
Name: "keyinfo",
|
||||
Usage: "work with lotus keyinfo files (wallets and libp2p host keys)",
|
||||
Name: "key-info",
|
||||
Aliases: []string{"keyinfo"},
|
||||
Usage: "work with lotus keyinfo files (wallets and libp2p host keys)",
|
||||
Description: `The subcommands of keyinfo provide helpful tools for working with keyinfo files without
|
||||
having to run the lotus daemon.`,
|
||||
Subcommands: []*cli.Command{
|
||||
|
||||
@@ -119,7 +119,7 @@ var minerFaultsCmd = &cli.Command{
|
||||
|
||||
var minerCreateCmd = &cli.Command{
|
||||
Name: "create",
|
||||
Usage: "sends a create miner msg",
|
||||
Usage: "sends a create miner message",
|
||||
ArgsUsage: "[sender] [owner] [worker] [sector size]",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
wapi, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
|
||||
@@ -20,7 +20,8 @@ var mpoolCmd = &cli.Command{
|
||||
}
|
||||
|
||||
var minerSelectMsgsCmd = &cli.Command{
|
||||
Name: "miner-select-msgs",
|
||||
Name: "miner-select-messages",
|
||||
Aliases: []string{"miner-select-msgs"},
|
||||
Flags: []cli.Flag{
|
||||
&cli.Float64Flag{
|
||||
Name: "ticket-quality",
|
||||
|
||||
@@ -22,7 +22,8 @@ import (
|
||||
)
|
||||
|
||||
var msgCmd = &cli.Command{
|
||||
Name: "msg",
|
||||
Name: "message",
|
||||
Aliases: []string{"msg"},
|
||||
Usage: "Translate message between various formats",
|
||||
ArgsUsage: "Message in any form",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
|
||||
@@ -6,12 +6,11 @@ import (
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"github.com/streadway/quantile"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/koalacxr/quantile"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/exitcode"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
@@ -4,17 +4,19 @@ import (
|
||||
"fmt"
|
||||
"syscall"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/koalacxr/quantile"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/cmd/lotus-sim/simulation"
|
||||
"github.com/filecoin-project/lotus/lib/stati"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/streadway/quantile"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var infoMessageSizeSimCommand = &cli.Command{
|
||||
Name: "message-size",
|
||||
Aliases: []string{"msg-size"},
|
||||
Description: "Output information about message size distribution",
|
||||
Flags: []cli.Flag{
|
||||
&cli.Int64Flag{
|
||||
|
||||
@@ -144,7 +144,7 @@ var runCmd = &cli.Command{
|
||||
Hidden: true,
|
||||
},
|
||||
},
|
||||
Description: "For setup instructions see 'lotus-wallet --help'",
|
||||
Description: "Needs FULLNODE_API_INFO env-var to be set before running (see lotus-wallet --help for setup instructions)",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
log.Info("Starting lotus wallet")
|
||||
|
||||
|
||||
+24
-12
@@ -35,6 +35,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
||||
"github.com/filecoin-project/lotus/lib/lotuslog"
|
||||
"github.com/filecoin-project/lotus/lib/ulimit"
|
||||
"github.com/filecoin-project/lotus/metrics"
|
||||
"github.com/filecoin-project/lotus/node/modules"
|
||||
"github.com/filecoin-project/lotus/node/repo"
|
||||
@@ -195,7 +196,7 @@ var runCmd = &cli.Command{
|
||||
&cli.IntFlag{
|
||||
Name: "post-parallel-reads",
|
||||
Usage: "maximum number of parallel challenge reads (0 = no limit)",
|
||||
Value: 0,
|
||||
Value: 128,
|
||||
},
|
||||
&cli.DurationFlag{
|
||||
Name: "post-read-timeout",
|
||||
@@ -227,12 +228,23 @@ var runCmd = &cli.Command{
|
||||
}
|
||||
}
|
||||
|
||||
limit, _, err := ulimit.GetLimit()
|
||||
switch {
|
||||
case err == ulimit.ErrUnsupported:
|
||||
log.Errorw("checking file descriptor limit failed", "error", err)
|
||||
case err != nil:
|
||||
return xerrors.Errorf("checking fd limit: %w", err)
|
||||
default:
|
||||
if limit < build.MinerFDLimit {
|
||||
return xerrors.Errorf("soft file descriptor limit (ulimit -n) too low, want %d, current %d", build.MinerFDLimit, limit)
|
||||
}
|
||||
}
|
||||
|
||||
// Connect to storage-miner
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
var nodeApi api.StorageMiner
|
||||
var closer func()
|
||||
var err error
|
||||
for {
|
||||
nodeApi, closer, err = lcli.GetStorageMinerAPI(cctx, cliutil.StorageMinerUseHttp)
|
||||
if err == nil {
|
||||
@@ -277,7 +289,7 @@ var runCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
if cctx.Bool("commit") {
|
||||
if cctx.Bool("commit") || cctx.Bool("prove-replica-update2") {
|
||||
if err := paramfetch.GetParams(ctx, build.ParametersJSON(), build.SrsJSON(), uint64(ssize)); err != nil {
|
||||
return xerrors.Errorf("get params: %w", err)
|
||||
}
|
||||
@@ -300,28 +312,28 @@ var runCmd = &cli.Command{
|
||||
taskTypes = append(taskTypes, sealtasks.TTFetch, sealtasks.TTCommit1, sealtasks.TTProveReplicaUpdate1, sealtasks.TTFinalize, sealtasks.TTFinalizeReplicaUpdate)
|
||||
}
|
||||
|
||||
if (workerType != sealtasks.WorkerSealing || cctx.IsSet("addpiece")) && cctx.Bool("addpiece") {
|
||||
taskTypes = append(taskTypes, sealtasks.TTAddPiece)
|
||||
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("addpiece")) && cctx.Bool("addpiece") {
|
||||
taskTypes = append(taskTypes, sealtasks.TTAddPiece, sealtasks.TTDataCid)
|
||||
}
|
||||
if (workerType != sealtasks.WorkerSealing || cctx.IsSet("precommit1")) && cctx.Bool("precommit1") {
|
||||
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("precommit1")) && cctx.Bool("precommit1") {
|
||||
taskTypes = append(taskTypes, sealtasks.TTPreCommit1)
|
||||
}
|
||||
if (workerType != sealtasks.WorkerSealing || cctx.IsSet("unseal")) && cctx.Bool("unseal") {
|
||||
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("unseal")) && cctx.Bool("unseal") {
|
||||
taskTypes = append(taskTypes, sealtasks.TTUnseal)
|
||||
}
|
||||
if (workerType != sealtasks.WorkerSealing || cctx.IsSet("precommit2")) && cctx.Bool("precommit2") {
|
||||
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("precommit2")) && cctx.Bool("precommit2") {
|
||||
taskTypes = append(taskTypes, sealtasks.TTPreCommit2)
|
||||
}
|
||||
if (workerType != sealtasks.WorkerSealing || cctx.IsSet("commit")) && cctx.Bool("commit") {
|
||||
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("commit")) && cctx.Bool("commit") {
|
||||
taskTypes = append(taskTypes, sealtasks.TTCommit2)
|
||||
}
|
||||
if (workerType != sealtasks.WorkerSealing || cctx.IsSet("replica-update")) && cctx.Bool("replica-update") {
|
||||
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("replica-update")) && cctx.Bool("replica-update") {
|
||||
taskTypes = append(taskTypes, sealtasks.TTReplicaUpdate)
|
||||
}
|
||||
if (workerType != sealtasks.WorkerSealing || cctx.IsSet("prove-replica-update2")) && cctx.Bool("prove-replica-update2") {
|
||||
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("prove-replica-update2")) && cctx.Bool("prove-replica-update2") {
|
||||
taskTypes = append(taskTypes, sealtasks.TTProveReplicaUpdate2)
|
||||
}
|
||||
if (workerType != sealtasks.WorkerSealing || cctx.IsSet("regen-sector-key")) && cctx.Bool("regen-sector-key") {
|
||||
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("regen-sector-key")) && cctx.Bool("regen-sector-key") {
|
||||
taskTypes = append(taskTypes, sealtasks.TTRegenSectorKey)
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ var tasksCmd = &cli.Command{
|
||||
|
||||
var allowSetting = map[sealtasks.TaskType]struct{}{
|
||||
sealtasks.TTAddPiece: {},
|
||||
sealtasks.TTDataCid: {},
|
||||
sealtasks.TTPreCommit1: {},
|
||||
sealtasks.TTPreCommit2: {},
|
||||
sealtasks.TTCommit2: {},
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
@@ -28,6 +29,7 @@ import (
|
||||
"github.com/filecoin-project/test-vectors/schema"
|
||||
|
||||
"github.com/filecoin-project/lotus/blockstore"
|
||||
"github.com/filecoin-project/lotus/chain/consensus/filcns"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/chain/vm"
|
||||
)
|
||||
@@ -51,6 +53,52 @@ var TipsetVectorOpts struct {
|
||||
OnTipsetApplied []func(bs blockstore.Blockstore, params *ExecuteTipsetParams, res *ExecuteTipsetResult)
|
||||
}
|
||||
|
||||
type GasPricingRestoreFn func()
|
||||
|
||||
// adjustGasPricing adjusts the global gas price mapping to make sure that the
|
||||
// gas pricelist for vector's network version is used at the vector's epoch.
|
||||
// Because it manipulates a global, it returns a function that reverts the
|
||||
// change. The caller MUST invoke this function or the test vector runner will
|
||||
// become invalid.
|
||||
func adjustGasPricing(vectorEpoch abi.ChainEpoch, vectorNv network.Version) GasPricingRestoreFn {
|
||||
// Stash the current pricing mapping.
|
||||
// Ok to take a reference instead of a copy, because we override the map
|
||||
// with a new one below.
|
||||
var old = vm.Prices
|
||||
|
||||
// Resolve the epoch at which the vector network version kicks in.
|
||||
var epoch abi.ChainEpoch = math.MaxInt64
|
||||
if vectorNv == network.Version0 {
|
||||
// genesis is not an upgrade.
|
||||
epoch = 0
|
||||
} else {
|
||||
for _, u := range filcns.DefaultUpgradeSchedule() {
|
||||
if u.Network == vectorNv {
|
||||
epoch = u.Height
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if epoch == math.MaxInt64 {
|
||||
panic(fmt.Sprintf("could not resolve network version %d to height", vectorNv))
|
||||
}
|
||||
|
||||
// Find the right pricelist for this network version.
|
||||
pricelist := vm.PricelistByEpoch(epoch)
|
||||
|
||||
// Override the pricing mapping by setting the relevant pricelist for the
|
||||
// network version at the epoch where the vector runs.
|
||||
vm.Prices = map[abi.ChainEpoch]vm.Pricelist{
|
||||
vectorEpoch: pricelist,
|
||||
}
|
||||
|
||||
// Return a function to restore the original mapping.
|
||||
return func() {
|
||||
vm.Prices = old
|
||||
}
|
||||
}
|
||||
|
||||
// ExecuteMessageVector executes a message-class test vector.
|
||||
func ExecuteMessageVector(r Reporter, vector *schema.TestVector, variant *schema.Variant) (diffs []string, err error) {
|
||||
var (
|
||||
@@ -69,6 +117,10 @@ func ExecuteMessageVector(r Reporter, vector *schema.TestVector, variant *schema
|
||||
// Create a new Driver.
|
||||
driver := NewDriver(ctx, vector.Selector, DriverOpts{DisableVMFlush: true})
|
||||
|
||||
// Monkey patch the gas pricing.
|
||||
revertFn := adjustGasPricing(baseEpoch, nv)
|
||||
defer revertFn()
|
||||
|
||||
// Apply every message.
|
||||
for i, m := range vector.ApplyMessages {
|
||||
msg, err := types.DecodeMessage(m.Bytes)
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
* [Check](#Check)
|
||||
* [CheckProvable](#CheckProvable)
|
||||
* [Compute](#Compute)
|
||||
* [ComputeDataCid](#ComputeDataCid)
|
||||
* [ComputeProof](#ComputeProof)
|
||||
* [ComputeWindowPoSt](#ComputeWindowPoSt)
|
||||
* [Create](#Create)
|
||||
* [CreateBackup](#CreateBackup)
|
||||
* [Dagstore](#Dagstore)
|
||||
@@ -104,6 +106,7 @@
|
||||
* [PledgeSector](#PledgeSector)
|
||||
* [Return](#Return)
|
||||
* [ReturnAddPiece](#ReturnAddPiece)
|
||||
* [ReturnDataCid](#ReturnDataCid)
|
||||
* [ReturnFetch](#ReturnFetch)
|
||||
* [ReturnFinalizeReplicaUpdate](#ReturnFinalizeReplicaUpdate)
|
||||
* [ReturnFinalizeSector](#ReturnFinalizeSector)
|
||||
@@ -360,6 +363,29 @@ Response:
|
||||
## Compute
|
||||
|
||||
|
||||
### ComputeDataCid
|
||||
|
||||
|
||||
Perms: admin
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
1024,
|
||||
{}
|
||||
]
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"Size": 1032,
|
||||
"PieceCID": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### ComputeProof
|
||||
|
||||
|
||||
@@ -394,6 +420,52 @@ Response:
|
||||
]
|
||||
```
|
||||
|
||||
### ComputeWindowPoSt
|
||||
|
||||
|
||||
Perms: admin
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
42,
|
||||
[
|
||||
{
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
{
|
||||
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
|
||||
}
|
||||
]
|
||||
]
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"Deadline": 42,
|
||||
"Partitions": [
|
||||
{
|
||||
"Index": 42,
|
||||
"Skipped": [
|
||||
5,
|
||||
1
|
||||
]
|
||||
}
|
||||
],
|
||||
"Proofs": [
|
||||
{
|
||||
"PoStProof": 8,
|
||||
"ProofBytes": "Ynl0ZSBhcnJheQ=="
|
||||
}
|
||||
],
|
||||
"ChainCommitEpoch": 10101,
|
||||
"ChainCommitRand": "Bw=="
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## Create
|
||||
|
||||
|
||||
@@ -2148,6 +2220,36 @@ Response:
|
||||
|
||||
|
||||
### ReturnAddPiece
|
||||
|
||||
|
||||
Perms: admin
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"Sector": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
},
|
||||
{
|
||||
"Size": 1032,
|
||||
"PieceCID": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Code": 0,
|
||||
"Message": "string value"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
Response: `{}`
|
||||
|
||||
### ReturnDataCid
|
||||
storiface.WorkerReturn
|
||||
|
||||
|
||||
@@ -3973,6 +4075,88 @@ Response:
|
||||
"BaseMinMemory": 68719476736
|
||||
}
|
||||
},
|
||||
"seal/v0/datacid": {
|
||||
"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/fetch": {
|
||||
"0": {
|
||||
"MinMemory": 1048576,
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
* [Version](#Version)
|
||||
* [Add](#Add)
|
||||
* [AddPiece](#AddPiece)
|
||||
* [Data](#Data)
|
||||
* [DataCid](#DataCid)
|
||||
* [Finalize](#Finalize)
|
||||
* [FinalizeReplicaUpdate](#FinalizeReplicaUpdate)
|
||||
* [FinalizeSector](#FinalizeSector)
|
||||
@@ -520,6 +522,88 @@ Response:
|
||||
"BaseMinMemory": 68719476736
|
||||
}
|
||||
},
|
||||
"seal/v0/datacid": {
|
||||
"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/fetch": {
|
||||
"0": {
|
||||
"MinMemory": 1048576,
|
||||
@@ -1242,7 +1326,6 @@ Response: `131584`
|
||||
|
||||
|
||||
### AddPiece
|
||||
storiface.WorkerCalls
|
||||
|
||||
|
||||
Perms: admin
|
||||
@@ -1276,6 +1359,34 @@ Response:
|
||||
}
|
||||
```
|
||||
|
||||
## Data
|
||||
|
||||
|
||||
### DataCid
|
||||
storiface.WorkerCalls
|
||||
|
||||
|
||||
Perms: admin
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
1024,
|
||||
{}
|
||||
]
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"Sector": {
|
||||
"Miner": 1000,
|
||||
"Number": 9
|
||||
},
|
||||
"ID": "07070707-0707-0707-0707-070707070707"
|
||||
}
|
||||
```
|
||||
|
||||
## Finalize
|
||||
|
||||
|
||||
|
||||
@@ -165,6 +165,7 @@
|
||||
* [StateDealProviderCollateralBounds](#StateDealProviderCollateralBounds)
|
||||
* [StateDecodeParams](#StateDecodeParams)
|
||||
* [StateGetActor](#StateGetActor)
|
||||
* [StateGetNetworkParams](#StateGetNetworkParams)
|
||||
* [StateGetRandomnessFromBeacon](#StateGetRandomnessFromBeacon)
|
||||
* [StateGetRandomnessFromTickets](#StateGetRandomnessFromTickets)
|
||||
* [StateGetReceipt](#StateGetReceipt)
|
||||
@@ -5185,6 +5186,49 @@ Response:
|
||||
}
|
||||
```
|
||||
|
||||
### StateGetNetworkParams
|
||||
StateGetNetworkParams return current network params
|
||||
|
||||
|
||||
Perms: read
|
||||
|
||||
Inputs: `null`
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"NetworkName": "lotus",
|
||||
"BlockDelaySecs": 42,
|
||||
"ConsensusMinerMinPower": "0",
|
||||
"SupportedProofTypes": [
|
||||
8
|
||||
],
|
||||
"PreCommitChallengeDelay": 10101,
|
||||
"ForkUpgradeParams": {
|
||||
"UpgradeSmokeHeight": 10101,
|
||||
"UpgradeBreezeHeight": 10101,
|
||||
"UpgradeIgnitionHeight": 10101,
|
||||
"UpgradeLiftoffHeight": 10101,
|
||||
"UpgradeAssemblyHeight": 10101,
|
||||
"UpgradeRefuelHeight": 10101,
|
||||
"UpgradeTapeHeight": 10101,
|
||||
"UpgradeKumquatHeight": 10101,
|
||||
"UpgradePriceListOopsHeight": 10101,
|
||||
"BreezeGasTampingDuration": 10101,
|
||||
"UpgradeCalicoHeight": 10101,
|
||||
"UpgradePersianHeight": 10101,
|
||||
"UpgradeOrangeHeight": 10101,
|
||||
"UpgradeClausHeight": 10101,
|
||||
"UpgradeTrustHeight": 10101,
|
||||
"UpgradeNorwegianHeight": 10101,
|
||||
"UpgradeTurboHeight": 10101,
|
||||
"UpgradeHyperdriveHeight": 10101,
|
||||
"UpgradeChocolateHeight": 10101,
|
||||
"UpgradeOhSnapHeight": 10101
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### StateGetRandomnessFromBeacon
|
||||
StateGetRandomnessFromBeacon is used to sample the beacon for randomness.
|
||||
|
||||
|
||||
@@ -175,12 +175,14 @@
|
||||
* [StateDecodeParams](#StateDecodeParams)
|
||||
* [StateEncodeParams](#StateEncodeParams)
|
||||
* [StateGetActor](#StateGetActor)
|
||||
* [StateGetNetworkParams](#StateGetNetworkParams)
|
||||
* [StateGetRandomnessFromBeacon](#StateGetRandomnessFromBeacon)
|
||||
* [StateGetRandomnessFromTickets](#StateGetRandomnessFromTickets)
|
||||
* [StateListActors](#StateListActors)
|
||||
* [StateListMessages](#StateListMessages)
|
||||
* [StateListMiners](#StateListMiners)
|
||||
* [StateLookupID](#StateLookupID)
|
||||
* [StateLookupRobustAddress](#StateLookupRobustAddress)
|
||||
* [StateMarketBalance](#StateMarketBalance)
|
||||
* [StateMarketDeals](#StateMarketDeals)
|
||||
* [StateMarketParticipants](#StateMarketParticipants)
|
||||
@@ -1897,14 +1899,19 @@ Inputs:
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"Price": "0",
|
||||
"VerifiedPrice": "0",
|
||||
"MinPieceSize": 1032,
|
||||
"MaxPieceSize": 1032,
|
||||
"Miner": "f01234",
|
||||
"Timestamp": 10101,
|
||||
"Expiry": 10101,
|
||||
"SeqNo": 42
|
||||
"Response": {
|
||||
"Price": "0",
|
||||
"VerifiedPrice": "0",
|
||||
"MinPieceSize": 1032,
|
||||
"MaxPieceSize": 1032,
|
||||
"Miner": "f01234",
|
||||
"Timestamp": 10101,
|
||||
"Expiry": 10101,
|
||||
"SeqNo": 42
|
||||
},
|
||||
"DealProtocols": [
|
||||
"string value"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -5032,7 +5039,7 @@ A nil TipSetKey can be provided as a param, this will cause the heaviest tipset
|
||||
|
||||
|
||||
### StateAccountKey
|
||||
StateAccountKey returns the public key address of the given ID address
|
||||
StateAccountKey returns the public key address of the given ID address for secp and bls accounts
|
||||
|
||||
|
||||
Perms: read
|
||||
@@ -5636,6 +5643,49 @@ Response:
|
||||
}
|
||||
```
|
||||
|
||||
### StateGetNetworkParams
|
||||
StateGetNetworkParams return current network params
|
||||
|
||||
|
||||
Perms: read
|
||||
|
||||
Inputs: `null`
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"NetworkName": "lotus",
|
||||
"BlockDelaySecs": 42,
|
||||
"ConsensusMinerMinPower": "0",
|
||||
"SupportedProofTypes": [
|
||||
8
|
||||
],
|
||||
"PreCommitChallengeDelay": 10101,
|
||||
"ForkUpgradeParams": {
|
||||
"UpgradeSmokeHeight": 10101,
|
||||
"UpgradeBreezeHeight": 10101,
|
||||
"UpgradeIgnitionHeight": 10101,
|
||||
"UpgradeLiftoffHeight": 10101,
|
||||
"UpgradeAssemblyHeight": 10101,
|
||||
"UpgradeRefuelHeight": 10101,
|
||||
"UpgradeTapeHeight": 10101,
|
||||
"UpgradeKumquatHeight": 10101,
|
||||
"UpgradePriceListOopsHeight": 10101,
|
||||
"BreezeGasTampingDuration": 10101,
|
||||
"UpgradeCalicoHeight": 10101,
|
||||
"UpgradePersianHeight": 10101,
|
||||
"UpgradeOrangeHeight": 10101,
|
||||
"UpgradeClausHeight": 10101,
|
||||
"UpgradeTrustHeight": 10101,
|
||||
"UpgradeNorwegianHeight": 10101,
|
||||
"UpgradeTurboHeight": 10101,
|
||||
"UpgradeHyperdriveHeight": 10101,
|
||||
"UpgradeChocolateHeight": 10101,
|
||||
"UpgradeOhSnapHeight": 10101
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### StateGetRandomnessFromBeacon
|
||||
StateGetRandomnessFromBeacon is used to sample the beacon for randomness.
|
||||
|
||||
@@ -5778,6 +5828,29 @@ Response:
|
||||
StateLookupID retrieves the ID address of the given address
|
||||
|
||||
|
||||
Perms: read
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
"f01234",
|
||||
[
|
||||
{
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
{
|
||||
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
|
||||
}
|
||||
]
|
||||
]
|
||||
```
|
||||
|
||||
Response: `"f01234"`
|
||||
|
||||
### StateLookupRobustAddress
|
||||
StateLookupRobustAddress returns the public key address of the given ID address for non-account addresses (multisig, miners etc)
|
||||
|
||||
|
||||
Perms: read
|
||||
|
||||
Inputs:
|
||||
|
||||
@@ -7,7 +7,7 @@ USAGE:
|
||||
lotus-miner [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1.15.2-dev
|
||||
1.15.3
|
||||
|
||||
COMMANDS:
|
||||
init Initialize a lotus miner repo
|
||||
@@ -236,35 +236,24 @@ USAGE:
|
||||
lotus-miner actor command [command options] [arguments...]
|
||||
|
||||
COMMANDS:
|
||||
set-addrs set addresses that your miner can be publicly dialed on
|
||||
withdraw withdraw available balance
|
||||
repay-debt pay down a miner's debt
|
||||
set-peer-id set the peer id of your miner
|
||||
set-owner Set owner address (this command should be invoked twice, first with the old owner as the senderAddress, and then with the new owner)
|
||||
control Manage control addresses
|
||||
propose-change-worker Propose a worker address change
|
||||
confirm-change-worker Confirm a worker address change
|
||||
compact-allocated compact allocated sectors bitfield
|
||||
help, h Shows a list of commands or help for one command
|
||||
set-addresses, set-addrs set addresses that your miner can be publicly dialed on
|
||||
withdraw withdraw available balance
|
||||
repay-debt pay down a miner's debt
|
||||
set-peer-id set the peer id of your miner
|
||||
set-owner Set owner address (this command should be invoked twice, first with the old owner as the senderAddress, and then with the new owner)
|
||||
control Manage control addresses
|
||||
propose-change-worker Propose a worker address change
|
||||
confirm-change-worker Confirm a worker address change
|
||||
compact-allocated compact allocated sectors bitfield
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus-miner actor set-addrs
|
||||
#### lotus-miner actor set-addresses, set-addrs
|
||||
```
|
||||
NAME:
|
||||
lotus-miner actor set-addrs - set addresses that your miner can be publicly dialed on
|
||||
|
||||
USAGE:
|
||||
lotus-miner actor set-addrs [command options] [arguments...]
|
||||
|
||||
OPTIONS:
|
||||
--gas-limit value set gas limit (default: 0)
|
||||
--unset unset address (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus-miner actor withdraw
|
||||
@@ -1199,22 +1188,22 @@ USAGE:
|
||||
lotus-miner net command [command options] [arguments...]
|
||||
|
||||
COMMANDS:
|
||||
peers Print peers
|
||||
ping Ping peers
|
||||
connect Connect to a peer
|
||||
listen List listen addresses
|
||||
id Get node identity
|
||||
findpeer Find the addresses of a given peerID
|
||||
scores Print peers' pubsub scores
|
||||
reachability Print information about reachability from the internet
|
||||
bandwidth Print bandwidth usage information
|
||||
block Manage network connection gating rules
|
||||
stat Report resource usage for a scope
|
||||
limit Get or set resource limits for a scope
|
||||
protect Add one or more peer IDs to the list of protected peer connections
|
||||
unprotect Remove one or more peer IDs from the list of protected peer connections.
|
||||
list-protected List the peer IDs with protected connection.
|
||||
help, h Shows a list of commands or help for one command
|
||||
peers Print peers
|
||||
ping Ping peers
|
||||
connect Connect to a peer
|
||||
listen List listen addresses
|
||||
id Get node identity
|
||||
find-peer, findpeer Find the addresses of a given peerID
|
||||
scores Print peers' pubsub scores
|
||||
reachability Print information about reachability from the internet
|
||||
bandwidth Print bandwidth usage information
|
||||
block Manage network connection gating rules
|
||||
stat Report resource usage for a scope
|
||||
limit Get or set resource limits for a scope
|
||||
protect Add one or more peer IDs to the list of protected peer connections
|
||||
unprotect Remove one or more peer IDs from the list of protected peer connections.
|
||||
list-protected List the peer IDs with protected connection.
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
@@ -1290,17 +1279,8 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus-miner net findpeer
|
||||
#### lotus-miner net find-peer, findpeer
|
||||
```
|
||||
NAME:
|
||||
lotus-miner net findpeer - Find the addresses of a given peerID
|
||||
|
||||
USAGE:
|
||||
lotus-miner net findpeer [command options] [peerId]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus-miner net scores
|
||||
@@ -2040,6 +2020,8 @@ COMMANDS:
|
||||
deadline View the current proving period deadline information by its index
|
||||
faults View the currently known proving faulty sectors information
|
||||
check Check sectors provable
|
||||
workers list workers
|
||||
compute
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
OPTIONS:
|
||||
@@ -2116,6 +2098,41 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus-miner proving workers
|
||||
```
|
||||
NAME:
|
||||
lotus-miner proving workers - list workers
|
||||
|
||||
USAGE:
|
||||
lotus-miner proving workers [command options] [arguments...]
|
||||
|
||||
OPTIONS:
|
||||
--color use color in display output (default: depends on output being a TTY)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus-miner proving compute
|
||||
```
|
||||
NAME:
|
||||
lotus-miner proving compute - A new cli application
|
||||
|
||||
USAGE:
|
||||
lotus-miner proving compute command [command options] [arguments...]
|
||||
|
||||
COMMANDS:
|
||||
windowed-post, window-post Compute WindowPoSt for a specific deadline
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
##### lotus-miner proving compute windowed-post, window-post
|
||||
```
|
||||
```
|
||||
|
||||
## lotus-miner storage
|
||||
```
|
||||
NAME:
|
||||
|
||||
@@ -7,7 +7,7 @@ USAGE:
|
||||
lotus-worker [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1.15.2-dev
|
||||
1.15.3
|
||||
|
||||
COMMANDS:
|
||||
run Start lotus worker
|
||||
@@ -50,7 +50,7 @@ OPTIONS:
|
||||
--windowpost enable window post (default: false)
|
||||
--winningpost enable winning post (default: false)
|
||||
--parallel-fetch-limit value maximum fetch operations to run in parallel (default: 5)
|
||||
--post-parallel-reads value maximum number of parallel challenge reads (0 = no limit) (default: 0)
|
||||
--post-parallel-reads value maximum number of parallel challenge reads (0 = no limit) (default: 128)
|
||||
--post-read-timeout value time limit for reading PoSt challenges (0 = no limit) (default: 0s)
|
||||
--timeout value used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function (default: "30m")
|
||||
--help, -h show help (default: false)
|
||||
@@ -173,7 +173,7 @@ NAME:
|
||||
lotus-worker tasks enable - Enable a task type
|
||||
|
||||
USAGE:
|
||||
lotus-worker tasks enable [command options] [UNS|C2|PC2|PC1|PR2|RU|AP|GSK]
|
||||
lotus-worker tasks enable [command options] [UNS|C2|PC2|PC1|PR2|RU|AP|DC|GSK]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
@@ -186,7 +186,7 @@ NAME:
|
||||
lotus-worker tasks disable - Disable a task type
|
||||
|
||||
USAGE:
|
||||
lotus-worker tasks disable [command options] [UNS|C2|PC2|PC1|PR2|RU|AP|GSK]
|
||||
lotus-worker tasks disable [command options] [UNS|C2|PC2|PC1|PR2|RU|AP|DC|GSK]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
+69
-135
@@ -7,7 +7,7 @@ USAGE:
|
||||
lotus [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1.15.2-dev
|
||||
1.15.3
|
||||
|
||||
COMMANDS:
|
||||
daemon Start a lotus daemon process
|
||||
@@ -212,7 +212,7 @@ COMMANDS:
|
||||
set-default Set default wallet address
|
||||
sign sign a message
|
||||
verify verify the signature of a message
|
||||
delete Delete an account from the wallet
|
||||
delete Soft delete an address from the wallet - hard deletion needed for permanent removal
|
||||
market Interact with market balances
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
@@ -346,7 +346,7 @@ OPTIONS:
|
||||
### lotus wallet delete
|
||||
```
|
||||
NAME:
|
||||
lotus wallet delete - Delete an account from the wallet
|
||||
lotus wallet delete - Soft delete an address from the wallet - hard deletion needed for permanent removal
|
||||
|
||||
USAGE:
|
||||
lotus wallet delete [command options] <address>
|
||||
@@ -794,6 +794,7 @@ CATEGORY:
|
||||
OPTIONS:
|
||||
--by-ping sort by ping (default: false)
|
||||
--output-format value Either 'text' or 'csv' (default: "text")
|
||||
--protocols Output supported deal protocols (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
@@ -1725,30 +1726,30 @@ USAGE:
|
||||
lotus state command [command options] [arguments...]
|
||||
|
||||
COMMANDS:
|
||||
power Query network or miner power
|
||||
sectors Query the sector set of a miner
|
||||
active-sectors Query the active sector set of a miner
|
||||
list-actors list all actors in the network
|
||||
list-miners list all miners in the network
|
||||
circulating-supply Get the exact current circulating supply of Filecoin
|
||||
sector Get miner sector info
|
||||
get-actor Print actor information
|
||||
lookup Find corresponding ID address
|
||||
replay Replay a particular message
|
||||
sector-size Look up miners sector size
|
||||
read-state View a json representation of an actors state
|
||||
list-messages list messages on chain matching given criteria
|
||||
compute-state Perform state computations
|
||||
call Invoke a method on an actor locally
|
||||
get-deal View on-chain deal info
|
||||
wait-msg Wait for a message to appear on chain
|
||||
search-msg Search to see whether a message has appeared on chain
|
||||
miner-info Retrieve miner information
|
||||
market Inspect the storage market actor
|
||||
exec-trace Get the execution trace of a given message
|
||||
network-version Returns the network version
|
||||
miner-proving-deadline Retrieve information about a given miner's proving deadline
|
||||
help, h Shows a list of commands or help for one command
|
||||
power Query network or miner power
|
||||
sectors Query the sector set of a miner
|
||||
active-sectors Query the active sector set of a miner
|
||||
list-actors list all actors in the network
|
||||
list-miners list all miners in the network
|
||||
circulating-supply Get the exact current circulating supply of Filecoin
|
||||
sector, sector-info Get miner sector info
|
||||
get-actor Print actor information
|
||||
lookup Find corresponding ID address
|
||||
replay Replay a particular message
|
||||
sector-size Look up miners sector size
|
||||
read-state View a json representation of an actors state
|
||||
list-messages list messages on chain matching given criteria
|
||||
compute-state Perform state computations
|
||||
call Invoke a method on an actor locally
|
||||
get-deal View on-chain deal info
|
||||
wait-msg, wait-message Wait for a message to appear on chain
|
||||
search-msg, search-message Search to see whether a message has appeared on chain
|
||||
miner-info Retrieve miner information
|
||||
market Inspect the storage market actor
|
||||
exec-trace Get the execution trace of a given message
|
||||
network-version Returns the network version
|
||||
miner-proving-deadline Retrieve information about a given miner's proving deadline
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
OPTIONS:
|
||||
--tipset value specify tipset to call method on (pass comma separated array of cids)
|
||||
@@ -1836,17 +1837,8 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus state sector
|
||||
#### lotus state sector, sector-info
|
||||
```
|
||||
NAME:
|
||||
lotus state sector - Get miner sector info
|
||||
|
||||
USAGE:
|
||||
lotus state sector [command options] [minerAddress] [sectorNumber]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus state get-actor
|
||||
@@ -1984,31 +1976,12 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus state wait-msg
|
||||
#### lotus state wait-msg, wait-message
|
||||
```
|
||||
NAME:
|
||||
lotus state wait-msg - Wait for a message to appear on chain
|
||||
|
||||
USAGE:
|
||||
lotus state wait-msg [command options] [messageCid]
|
||||
|
||||
OPTIONS:
|
||||
--timeout value (default: "10m")
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus state search-msg
|
||||
#### lotus state search-msg, search-message
|
||||
```
|
||||
NAME:
|
||||
lotus state search-msg - Search to see whether a message has appeared on chain
|
||||
|
||||
USAGE:
|
||||
lotus state search-msg [command options] [messageCid]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus state miner-info
|
||||
@@ -2102,24 +2075,24 @@ USAGE:
|
||||
lotus chain command [command options] [arguments...]
|
||||
|
||||
COMMANDS:
|
||||
head Print chain head
|
||||
getblock Get a block and print its details
|
||||
read-obj Read the raw bytes of an object
|
||||
delete-obj Delete an object from the chain blockstore
|
||||
stat-obj Collect size and ipld link counts for objs
|
||||
getmessage Get and print a message by its cid
|
||||
sethead manually set the local nodes head tipset (Caution: normally only used for recovery)
|
||||
list, love View a segment of the chain
|
||||
get Get chain DAG node by path
|
||||
bisect bisect chain for an event
|
||||
export export chain to a car file
|
||||
slash-consensus Report consensus fault
|
||||
gas-price Estimate gas prices
|
||||
inspect-usage Inspect block space usage of a given tipset
|
||||
decode decode various types
|
||||
encode encode various types
|
||||
disputer interact with the window post disputer
|
||||
help, h Shows a list of commands or help for one command
|
||||
head Print chain head
|
||||
get-block, getblock Get a block and print its details
|
||||
read-obj Read the raw bytes of an object
|
||||
delete-obj Delete an object from the chain blockstore
|
||||
stat-obj Collect size and ipld link counts for objs
|
||||
getmessage, get-message, get-msg Get and print a message by its cid
|
||||
sethead, set-head manually set the local nodes head tipset (Caution: normally only used for recovery)
|
||||
list, love View a segment of the chain
|
||||
get Get chain DAG node by path
|
||||
bisect bisect chain for an event
|
||||
export export chain to a car file
|
||||
slash-consensus Report consensus fault
|
||||
gas-price Estimate gas prices
|
||||
inspect-usage Inspect block space usage of a given tipset
|
||||
decode decode various types
|
||||
encode encode various types
|
||||
disputer interact with the window post disputer
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
@@ -2139,18 +2112,8 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus chain getblock
|
||||
#### lotus chain get-block, getblock
|
||||
```
|
||||
NAME:
|
||||
lotus chain getblock - Get a block and print its details
|
||||
|
||||
USAGE:
|
||||
lotus chain getblock [command options] [blockCid]
|
||||
|
||||
OPTIONS:
|
||||
--raw print just the raw block header (default: false)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus chain read-obj
|
||||
@@ -2203,32 +2166,12 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus chain getmessage
|
||||
##### lotus chain getmessage, get-message, get-msg
|
||||
```
|
||||
NAME:
|
||||
lotus chain getmessage - Get and print a message by its cid
|
||||
|
||||
USAGE:
|
||||
lotus chain getmessage [command options] [messageCid]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus chain sethead
|
||||
#### lotus chain sethead, set-head
|
||||
```
|
||||
NAME:
|
||||
lotus chain sethead - manually set the local nodes head tipset (Caution: normally only used for recovery)
|
||||
|
||||
USAGE:
|
||||
lotus chain sethead [command options] [tipsetkey]
|
||||
|
||||
OPTIONS:
|
||||
--genesis reset head to genesis (default: false)
|
||||
--epoch value reset head to given epoch (default: 0)
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
#### lotus chain list, love
|
||||
@@ -2601,22 +2544,22 @@ USAGE:
|
||||
lotus net command [command options] [arguments...]
|
||||
|
||||
COMMANDS:
|
||||
peers Print peers
|
||||
ping Ping peers
|
||||
connect Connect to a peer
|
||||
listen List listen addresses
|
||||
id Get node identity
|
||||
findpeer Find the addresses of a given peerID
|
||||
scores Print peers' pubsub scores
|
||||
reachability Print information about reachability from the internet
|
||||
bandwidth Print bandwidth usage information
|
||||
block Manage network connection gating rules
|
||||
stat Report resource usage for a scope
|
||||
limit Get or set resource limits for a scope
|
||||
protect Add one or more peer IDs to the list of protected peer connections
|
||||
unprotect Remove one or more peer IDs from the list of protected peer connections.
|
||||
list-protected List the peer IDs with protected connection.
|
||||
help, h Shows a list of commands or help for one command
|
||||
peers Print peers
|
||||
ping Ping peers
|
||||
connect Connect to a peer
|
||||
listen List listen addresses
|
||||
id Get node identity
|
||||
find-peer, findpeer Find the addresses of a given peerID
|
||||
scores Print peers' pubsub scores
|
||||
reachability Print information about reachability from the internet
|
||||
bandwidth Print bandwidth usage information
|
||||
block Manage network connection gating rules
|
||||
stat Report resource usage for a scope
|
||||
limit Get or set resource limits for a scope
|
||||
protect Add one or more peer IDs to the list of protected peer connections
|
||||
unprotect Remove one or more peer IDs from the list of protected peer connections.
|
||||
list-protected List the peer IDs with protected connection.
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
@@ -2692,17 +2635,8 @@ OPTIONS:
|
||||
|
||||
```
|
||||
|
||||
### lotus net findpeer
|
||||
#### lotus net find-peer, findpeer
|
||||
```
|
||||
NAME:
|
||||
lotus net findpeer - Find the addresses of a given peerID
|
||||
|
||||
USAGE:
|
||||
lotus net findpeer [command options] [peerId]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
### lotus net scores
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_BACKUP_DISABLEMETADATALOG
|
||||
#DisableMetadataLog = false
|
||||
#DisableMetadataLog = true
|
||||
|
||||
|
||||
[Logging]
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_BACKUP_DISABLEMETADATALOG
|
||||
#DisableMetadataLog = false
|
||||
#DisableMetadataLog = true
|
||||
|
||||
|
||||
[Logging]
|
||||
@@ -173,14 +173,6 @@
|
||||
# env var: LOTUS_DEALMAKING_EXPECTEDSEALDURATION
|
||||
#ExpectedSealDuration = "24h0m0s"
|
||||
|
||||
# Whether new sectors are created to pack incoming deals
|
||||
# When this is set to false no new sectors will be created for sealing incoming deals
|
||||
# This is useful for forcing all deals to be assigned as snap deals to sectors marked for upgrade
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_DEALMAKING_MAKENEWSECTORFORDEALS
|
||||
#MakeNewSectorForDeals = true
|
||||
|
||||
# Maximum amount of time proposed deal StartEpoch can be in future
|
||||
#
|
||||
# type: Duration
|
||||
@@ -273,11 +265,11 @@
|
||||
|
||||
[IndexProvider]
|
||||
# Enable set whether to enable indexing announcement to the network and expose endpoints that
|
||||
# allow indexer nodes to process announcements. Disabled by default.
|
||||
# allow indexer nodes to process announcements. Enabled by default.
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_INDEXPROVIDER_ENABLE
|
||||
#Enable = false
|
||||
#Enable = true
|
||||
|
||||
# EntriesCacheCapacity sets the maximum capacity to use for caching the indexing advertisement
|
||||
# entries. Defaults to 1024 if not specified. The cache is evicted using LRU policy. The
|
||||
@@ -299,11 +291,13 @@
|
||||
#EntriesChunkSize = 16384
|
||||
|
||||
# TopicName sets the topic name on which the changes to the advertised content are announced.
|
||||
# Defaults to '/indexer/ingest/mainnet' if not specified.
|
||||
# If not explicitly specified, the topic name is automatically inferred from the network name
|
||||
# in following format: '/indexer/ingest/<network-name>'
|
||||
# Defaults to empty, which implies the topic name is inferred from network name.
|
||||
#
|
||||
# type: string
|
||||
# env var: LOTUS_INDEXPROVIDER_TOPICNAME
|
||||
#TopicName = "/indexer/ingest/mainnet"
|
||||
#TopicName = ""
|
||||
|
||||
# PurgeCacheOnStart sets whether to clear any cached entries chunks when the provider engine
|
||||
# starts. By default, the cache is rehydrated from previously cached entries stored in
|
||||
@@ -314,6 +308,14 @@
|
||||
#PurgeCacheOnStart = false
|
||||
|
||||
|
||||
[Proving]
|
||||
# Maximum number of sector checks to run in parallel. (0 = unlimited)
|
||||
#
|
||||
# type: int
|
||||
# env var: LOTUS_PROVING_PARALLELCHECKLIMIT
|
||||
#ParallelCheckLimit = 128
|
||||
|
||||
|
||||
[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.
|
||||
@@ -380,6 +382,14 @@
|
||||
# env var: LOTUS_SEALING_FINALIZEEARLY
|
||||
#FinalizeEarly = false
|
||||
|
||||
# Whether new sectors are created to pack incoming deals
|
||||
# When this is set to false no new sectors will be created for sealing incoming deals
|
||||
# This is useful for forcing all deals to be assigned as snap deals to sectors marked for upgrade
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_SEALING_MAKENEWSECTORFORDEALS
|
||||
#MakeNewSectorForDeals = true
|
||||
|
||||
# After sealing CC sectors, make them available for upgrading with deals
|
||||
#
|
||||
# type: bool
|
||||
@@ -484,33 +494,49 @@
|
||||
|
||||
|
||||
[Storage]
|
||||
# type: int
|
||||
# env var: LOTUS_STORAGE_PARALLELFETCHLIMIT
|
||||
#ParallelFetchLimit = 10
|
||||
|
||||
# Local worker config
|
||||
#
|
||||
# type: bool
|
||||
# env var: LOTUS_STORAGE_ALLOWADDPIECE
|
||||
#AllowAddPiece = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_STORAGE_ALLOWPRECOMMIT1
|
||||
#AllowPreCommit1 = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_STORAGE_ALLOWPRECOMMIT2
|
||||
#AllowPreCommit2 = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_STORAGE_ALLOWCOMMIT
|
||||
#AllowCommit = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_STORAGE_ALLOWUNSEAL
|
||||
#AllowUnseal = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_STORAGE_ALLOWREPLICAUPDATE
|
||||
#AllowReplicaUpdate = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_STORAGE_ALLOWPROVEREPLICAUPDATE2
|
||||
#AllowProveReplicaUpdate2 = true
|
||||
|
||||
# type: bool
|
||||
# env var: LOTUS_STORAGE_ALLOWREGENSECTORKEY
|
||||
#AllowRegenSectorKey = true
|
||||
|
||||
# ResourceFiltering instructs the system which resource filtering strategy
|
||||
# to use when evaluating tasks against this worker. An empty value defaults
|
||||
# to "hardware".
|
||||
#
|
||||
# type: sectorstorage.ResourceFilteringStrategy
|
||||
# env var: LOTUS_STORAGE_RESOURCEFILTERING
|
||||
#ResourceFiltering = "hardware"
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ may be subject to change.
|
||||
Complete gas balancing is performed using `lotus-bench` the process is based on importing a chain export
|
||||
and collecting gas traces which are later aggregated.
|
||||
|
||||
Before building `lotus-bench` make sure `EnableGasTracing` in `chain/vm/runtime.go` is set to `true`.
|
||||
Before building `lotus-bench` make sure `EnableDetailedTracing` in `chain/vm/runtime.go` is set to `true`.
|
||||
|
||||
The process can be started using `./lotus-bench import` with `--car` flag set to the location of
|
||||
CAR chain export. `--start-epoch` and `--end-epoch` can be used to to limit the range of epochs to run
|
||||
|
||||
Vendored
+1
-1
Submodule extern/filecoin-ffi updated: 5216e96fd1...cd52de8dbc
Vendored
+51
-22
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"golang.org/x/xerrors"
|
||||
@@ -24,22 +25,55 @@ type FaultTracker interface {
|
||||
|
||||
// CheckProvable returns unprovable sectors
|
||||
func (m *Manager) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, rg storiface.RGetter) (map[abi.SectorID]string, error) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
if rg == nil {
|
||||
return nil, xerrors.Errorf("rg is nil")
|
||||
}
|
||||
|
||||
var bad = make(map[abi.SectorID]string)
|
||||
var badLk sync.Mutex
|
||||
|
||||
var postRand abi.PoStRandomness = make([]byte, abi.RandomnessLength)
|
||||
_, _ = rand.Read(postRand)
|
||||
postRand[31] &= 0x3f
|
||||
|
||||
limit := m.parallelCheckLimit
|
||||
if limit <= 0 {
|
||||
limit = len(sectors)
|
||||
}
|
||||
throttle := make(chan struct{}, limit)
|
||||
|
||||
addBad := func(s abi.SectorID, reason string) {
|
||||
badLk.Lock()
|
||||
bad[s] = reason
|
||||
badLk.Unlock()
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(len(sectors))
|
||||
|
||||
for _, sector := range sectors {
|
||||
err := func() error {
|
||||
select {
|
||||
case throttle <- struct{}{}:
|
||||
case <-ctx.Done():
|
||||
return nil, ctx.Err()
|
||||
}
|
||||
|
||||
go func(sector storage.SectorRef) {
|
||||
defer wg.Done()
|
||||
defer func() {
|
||||
<-throttle
|
||||
}()
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
commr, update, err := rg(ctx, sector.ID)
|
||||
if err != nil {
|
||||
log.Warnw("CheckProvable Sector FAULT: getting commR", "sector", sector, "sealed", "err", err)
|
||||
bad[sector.ID] = fmt.Sprintf("getting commR: %s", err)
|
||||
return nil
|
||||
addBad(sector.ID, fmt.Sprintf("getting commR: %s", err))
|
||||
return
|
||||
}
|
||||
|
||||
toLock := storiface.FTSealed | storiface.FTCache
|
||||
@@ -49,31 +83,29 @@ func (m *Manager) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof,
|
||||
|
||||
locked, err := m.index.StorageTryLock(ctx, sector.ID, toLock, storiface.FTNone)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("acquiring sector lock: %w", err)
|
||||
addBad(sector.ID, fmt.Sprintf("tryLock error: %s", err))
|
||||
return
|
||||
}
|
||||
|
||||
if !locked {
|
||||
log.Warnw("CheckProvable Sector FAULT: can't acquire read lock", "sector", sector)
|
||||
bad[sector.ID] = fmt.Sprint("can't acquire read lock")
|
||||
return nil
|
||||
addBad(sector.ID, fmt.Sprint("can't acquire read lock"))
|
||||
return
|
||||
}
|
||||
|
||||
wpp, err := sector.ProofType.RegisteredWindowPoStProof()
|
||||
if err != nil {
|
||||
return err
|
||||
addBad(sector.ID, fmt.Sprint("can't get proof type"))
|
||||
return
|
||||
}
|
||||
|
||||
var pr abi.PoStRandomness = make([]byte, abi.RandomnessLength)
|
||||
_, _ = rand.Read(pr)
|
||||
pr[31] &= 0x3f
|
||||
|
||||
ch, err := ffi.GeneratePoStFallbackSectorChallenges(wpp, sector.ID.Miner, pr, []abi.SectorNumber{
|
||||
ch, err := ffi.GeneratePoStFallbackSectorChallenges(wpp, sector.ID.Miner, postRand, []abi.SectorNumber{
|
||||
sector.ID.Number,
|
||||
})
|
||||
if err != nil {
|
||||
log.Warnw("CheckProvable Sector FAULT: generating challenges", "sector", sector, "err", err)
|
||||
bad[sector.ID] = fmt.Sprintf("generating fallback challenges: %s", err)
|
||||
return nil
|
||||
addBad(sector.ID, fmt.Sprintf("generating fallback challenges: %s", err))
|
||||
return
|
||||
}
|
||||
|
||||
vctx, cancel2 := context.WithTimeout(ctx, PostCheckTimeout)
|
||||
@@ -88,17 +120,14 @@ func (m *Manager) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof,
|
||||
}, wpp)
|
||||
if err != nil {
|
||||
log.Warnw("CheckProvable Sector FAULT: generating vanilla proof", "sector", sector, "err", err)
|
||||
bad[sector.ID] = fmt.Sprintf("generating vanilla proof: %s", err)
|
||||
return nil
|
||||
addBad(sector.ID, fmt.Sprintf("generating vanilla proof: %s", err))
|
||||
return
|
||||
}
|
||||
|
||||
return nil
|
||||
}()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}(sector)
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
||||
return bad, nil
|
||||
}
|
||||
|
||||
|
||||
+114
@@ -51,6 +51,120 @@ func (sb *Sealer) NewSector(ctx context.Context, sector storage.SectorRef) error
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sb *Sealer) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (abi.PieceInfo, error) {
|
||||
// TODO: allow tuning those:
|
||||
chunk := abi.PaddedPieceSize(4 << 20)
|
||||
parallel := runtime.NumCPU()
|
||||
|
||||
maxSizeSpt := abi.RegisteredSealProof_StackedDrg64GiBV1_1
|
||||
|
||||
throttle := make(chan []byte, parallel)
|
||||
piecePromises := make([]func() (abi.PieceInfo, error), 0)
|
||||
|
||||
buf := make([]byte, chunk.Unpadded())
|
||||
for i := 0; i < parallel; i++ {
|
||||
if abi.UnpaddedPieceSize(i)*chunk.Unpadded() >= pieceSize {
|
||||
break // won't use this many buffers
|
||||
}
|
||||
throttle <- make([]byte, chunk.Unpadded())
|
||||
}
|
||||
|
||||
for {
|
||||
var read int
|
||||
for rbuf := buf; len(rbuf) > 0; {
|
||||
n, err := pieceData.Read(rbuf)
|
||||
if err != nil && err != io.EOF {
|
||||
return abi.PieceInfo{}, xerrors.Errorf("pr read error: %w", err)
|
||||
}
|
||||
|
||||
rbuf = rbuf[n:]
|
||||
read += n
|
||||
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
}
|
||||
if read == 0 {
|
||||
break
|
||||
}
|
||||
|
||||
done := make(chan struct {
|
||||
cid.Cid
|
||||
error
|
||||
}, 1)
|
||||
pbuf := <-throttle
|
||||
copy(pbuf, buf[:read])
|
||||
|
||||
go func(read int) {
|
||||
defer func() {
|
||||
throttle <- pbuf
|
||||
}()
|
||||
|
||||
c, err := sb.pieceCid(maxSizeSpt, pbuf[:read])
|
||||
done <- struct {
|
||||
cid.Cid
|
||||
error
|
||||
}{c, err}
|
||||
}(read)
|
||||
|
||||
piecePromises = append(piecePromises, func() (abi.PieceInfo, error) {
|
||||
select {
|
||||
case e := <-done:
|
||||
if e.error != nil {
|
||||
return abi.PieceInfo{}, e.error
|
||||
}
|
||||
|
||||
return abi.PieceInfo{
|
||||
Size: abi.UnpaddedPieceSize(read).Padded(),
|
||||
PieceCID: e.Cid,
|
||||
}, nil
|
||||
case <-ctx.Done():
|
||||
return abi.PieceInfo{}, ctx.Err()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if len(piecePromises) == 1 {
|
||||
return piecePromises[0]()
|
||||
}
|
||||
|
||||
var payloadRoundedBytes abi.PaddedPieceSize
|
||||
pieceCids := make([]abi.PieceInfo, len(piecePromises))
|
||||
for i, promise := range piecePromises {
|
||||
pinfo, err := promise()
|
||||
if err != nil {
|
||||
return abi.PieceInfo{}, err
|
||||
}
|
||||
|
||||
pieceCids[i] = pinfo
|
||||
payloadRoundedBytes += pinfo.Size
|
||||
}
|
||||
|
||||
pieceCID, err := ffi.GenerateUnsealedCID(maxSizeSpt, pieceCids)
|
||||
if err != nil {
|
||||
return abi.PieceInfo{}, xerrors.Errorf("generate unsealed CID: %w", err)
|
||||
}
|
||||
|
||||
// validate that the pieceCID was properly formed
|
||||
if _, err := commcid.CIDToPieceCommitmentV1(pieceCID); err != nil {
|
||||
return abi.PieceInfo{}, err
|
||||
}
|
||||
|
||||
if payloadRoundedBytes < pieceSize.Padded() {
|
||||
paddedCid, err := commpffi.ZeroPadPieceCommitment(pieceCID, payloadRoundedBytes.Unpadded(), pieceSize)
|
||||
if err != nil {
|
||||
return abi.PieceInfo{}, xerrors.Errorf("failed to pad data: %w", err)
|
||||
}
|
||||
|
||||
pieceCID = paddedCid
|
||||
}
|
||||
|
||||
return abi.PieceInfo{
|
||||
Size: pieceSize.Padded(),
|
||||
PieceCID: pieceCID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existingPieceSizes []abi.UnpaddedPieceSize, pieceSize abi.UnpaddedPieceSize, file storage.Data) (abi.PieceInfo, error) {
|
||||
// TODO: allow tuning those:
|
||||
chunk := abi.PaddedPieceSize(4 << 20)
|
||||
|
||||
+20
-13
@@ -71,18 +71,21 @@ func (s *seal) precommit(t *testing.T, sb *Sealer, id storage.SectorRef, done fu
|
||||
r := data(id.ID.Number, dlen)
|
||||
s.pi, err = sb.AddPiece(context.TODO(), id, []abi.UnpaddedPieceSize{}, dlen, r)
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
t.Errorf("%+v", err)
|
||||
return
|
||||
}
|
||||
|
||||
s.ticket = sealRand
|
||||
|
||||
p1, err := sb.SealPreCommit1(context.TODO(), id, s.ticket, []abi.PieceInfo{s.pi})
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
t.Errorf("%+v", err)
|
||||
return
|
||||
}
|
||||
cids, err := sb.SealPreCommit2(context.TODO(), id, p1)
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
t.Errorf("%+v", err)
|
||||
return
|
||||
}
|
||||
s.cids = cids
|
||||
}
|
||||
@@ -94,11 +97,13 @@ func (s *seal) commit(t *testing.T, sb *Sealer, done func()) storage.Proof {
|
||||
|
||||
pc1, err := sb.SealCommit1(context.TODO(), s.ref, s.ticket, seed, []abi.PieceInfo{s.pi}, s.cids)
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
t.Errorf("%+v", err)
|
||||
return nil
|
||||
}
|
||||
proof, err := sb.SealCommit2(context.TODO(), s.ref, pc1)
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
t.Errorf("%+v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
ok, err := ProofVerifier.VerifySeal(proof2.SealVerifyInfo{
|
||||
@@ -111,11 +116,13 @@ func (s *seal) commit(t *testing.T, sb *Sealer, done func()) storage.Proof {
|
||||
UnsealedCID: s.cids.Unsealed,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
t.Errorf("%+v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
if !ok {
|
||||
t.Fatal("proof failed to validate")
|
||||
t.Errorf("proof failed to validate")
|
||||
return nil
|
||||
}
|
||||
|
||||
return proof
|
||||
@@ -458,17 +465,17 @@ func TestSealAndVerify3(t *testing.T) {
|
||||
s3 := seal{ref: si3}
|
||||
|
||||
wg.Add(3)
|
||||
go s1.precommit(t, sb, si1, wg.Done) //nolint: staticcheck
|
||||
go s1.precommit(t, sb, si1, wg.Done)
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
go s2.precommit(t, sb, si2, wg.Done) //nolint: staticcheck
|
||||
go s2.precommit(t, sb, si2, wg.Done)
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
go s3.precommit(t, sb, si3, wg.Done) //nolint: staticcheck
|
||||
go s3.precommit(t, sb, si3, wg.Done)
|
||||
wg.Wait()
|
||||
|
||||
wg.Add(3)
|
||||
go s1.commit(t, sb, wg.Done) //nolint: staticcheck
|
||||
go s2.commit(t, sb, wg.Done) //nolint: staticcheck
|
||||
go s3.commit(t, sb, wg.Done) //nolint: staticcheck
|
||||
go s1.commit(t, sb, wg.Done)
|
||||
go s2.commit(t, sb, wg.Done)
|
||||
go s3.commit(t, sb, wg.Done)
|
||||
wg.Wait()
|
||||
|
||||
post(t, sb, nil, s1, s2, s3)
|
||||
|
||||
Vendored
+62
-9
@@ -7,16 +7,17 @@ import (
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/filecoin-project/go-statestore"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/ipfs/go-cid"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"github.com/mitchellh/go-homedir"
|
||||
|
||||
"github.com/google/uuid"
|
||||
cid "github.com/ipfs/go-cid"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"go.uber.org/multierr"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-statestore"
|
||||
"github.com/filecoin-project/specs-storage/storage"
|
||||
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
|
||||
@@ -70,6 +71,8 @@ type Manager struct {
|
||||
workLk sync.Mutex
|
||||
work *statestore.StateStore
|
||||
|
||||
parallelCheckLimit int
|
||||
|
||||
callToWork map[storiface.CallID]WorkID
|
||||
// used when we get an early return and there's no callToWork mapping
|
||||
callRes map[storiface.CallID]chan result
|
||||
@@ -99,7 +102,7 @@ const (
|
||||
ResourceFilteringDisabled = ResourceFilteringStrategy("disabled")
|
||||
)
|
||||
|
||||
type SealerConfig struct {
|
||||
type Config struct {
|
||||
ParallelFetchLimit int
|
||||
|
||||
// Local worker config
|
||||
@@ -116,6 +119,9 @@ type SealerConfig struct {
|
||||
// to use when evaluating tasks against this worker. An empty value defaults
|
||||
// to "hardware".
|
||||
ResourceFiltering ResourceFilteringStrategy
|
||||
|
||||
// PoSt config
|
||||
ParallelCheckLimit int
|
||||
}
|
||||
|
||||
type StorageAuth http.Header
|
||||
@@ -123,7 +129,7 @@ type StorageAuth http.Header
|
||||
type WorkerStateStore *statestore.StateStore
|
||||
type ManagerStateStore *statestore.StateStore
|
||||
|
||||
func New(ctx context.Context, lstor *stores.Local, stor stores.Store, ls stores.LocalStorage, si stores.SectorIndex, sc SealerConfig, wss WorkerStateStore, mss ManagerStateStore) (*Manager, error) {
|
||||
func New(ctx context.Context, lstor *stores.Local, stor stores.Store, ls stores.LocalStorage, si stores.SectorIndex, sc Config, wss WorkerStateStore, mss ManagerStateStore) (*Manager, error) {
|
||||
prover, err := ffiwrapper.New(&readonlyProvider{stor: lstor, index: si})
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("creating prover instance: %w", err)
|
||||
@@ -142,6 +148,8 @@ func New(ctx context.Context, lstor *stores.Local, stor stores.Store, ls stores.
|
||||
|
||||
localProver: prover,
|
||||
|
||||
parallelCheckLimit: sc.ParallelCheckLimit,
|
||||
|
||||
work: mss,
|
||||
callToWork: map[storiface.CallID]WorkID{},
|
||||
callRes: map[storiface.CallID]chan result{},
|
||||
@@ -157,7 +165,7 @@ func New(ctx context.Context, lstor *stores.Local, stor stores.Store, ls stores.
|
||||
sealtasks.TTCommit1, sealtasks.TTProveReplicaUpdate1, sealtasks.TTFinalize, sealtasks.TTFetch, sealtasks.TTFinalizeReplicaUpdate,
|
||||
}
|
||||
if sc.AllowAddPiece {
|
||||
localTasks = append(localTasks, sealtasks.TTAddPiece)
|
||||
localTasks = append(localTasks, sealtasks.TTAddPiece, sealtasks.TTDataCid)
|
||||
}
|
||||
if sc.AllowPreCommit1 {
|
||||
localTasks = append(localTasks, sealtasks.TTPreCommit1)
|
||||
@@ -319,6 +327,27 @@ func (m *Manager) NewSector(ctx context.Context, sector storage.SectorRef) error
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Manager) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (abi.PieceInfo, error) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
selector := newTaskSelector()
|
||||
|
||||
var out abi.PieceInfo
|
||||
err := m.sched.Schedule(ctx, storage.NoSectorRef, sealtasks.TTDataCid, selector, schedNop, func(ctx context.Context, w Worker) error {
|
||||
p, err := m.waitSimpleCall(ctx)(w.DataCid(ctx, pieceSize, pieceData))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if p != nil {
|
||||
out = p.(abi.PieceInfo)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
return out, err
|
||||
}
|
||||
|
||||
func (m *Manager) AddPiece(ctx context.Context, sector storage.SectorRef, existingPieces []abi.UnpaddedPieceSize, sz abi.UnpaddedPieceSize, r io.Reader) (abi.PieceInfo, error) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
@@ -686,11 +715,31 @@ func (m *Manager) FinalizeReplicaUpdate(ctx context.Context, sector storage.Sect
|
||||
err = multierr.Append(err, move(moveUnsealed))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return xerrors.Errorf("moving sector to storage: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Manager) ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) error {
|
||||
return nil
|
||||
ssize, err := sector.ProofType.SectorSize()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(safeToFree) == 0 || safeToFree[0].Offset != 0 || safeToFree[0].Size.Padded() != abi.PaddedPieceSize(ssize) {
|
||||
// todo support partial free
|
||||
return nil
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
if err := m.index.StorageLock(ctx, sector.ID, storiface.FTNone, storiface.FTUnsealed); err != nil {
|
||||
return xerrors.Errorf("acquiring sector lock: %w", err)
|
||||
}
|
||||
|
||||
return m.storage.Remove(ctx, sector.ID, storiface.FTUnsealed, true, nil)
|
||||
}
|
||||
|
||||
func (m *Manager) ReleaseSectorKey(ctx context.Context, sector storage.SectorRef) error {
|
||||
@@ -882,7 +931,7 @@ func (m *Manager) ProveReplicaUpdate1(ctx context.Context, sector storage.Sector
|
||||
// NOTE: We set allowFetch to false in so that we always execute on a worker
|
||||
// with direct access to the data. We want to do that because this step is
|
||||
// generally very cheap / fast, and transferring data is not worth the effort
|
||||
selector := newExistingSelector(m.index, sector.ID, storiface.FTUpdate|storiface.FTUpdateCache|storiface.FTSealed|storiface.FTCache, false)
|
||||
selector := newExistingSelector(m.index, sector.ID, storiface.FTUpdate|storiface.FTUpdateCache, false)
|
||||
|
||||
err = m.sched.Schedule(ctx, sector, sealtasks.TTProveReplicaUpdate1, selector, m.schedFetch(sector, storiface.FTSealed|storiface.FTCache|storiface.FTUpdate|storiface.FTUpdateCache, storiface.PathSealing, storiface.AcquireCopy), func(ctx context.Context, w Worker) error {
|
||||
|
||||
@@ -947,6 +996,10 @@ func (m *Manager) ProveReplicaUpdate2(ctx context.Context, sector storage.Sector
|
||||
return out, waitErr
|
||||
}
|
||||
|
||||
func (m *Manager) ReturnDataCid(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error {
|
||||
return m.returnResult(ctx, callID, pi, err)
|
||||
}
|
||||
|
||||
func (m *Manager) ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error {
|
||||
return m.returnResult(ctx, callID, pi, err)
|
||||
}
|
||||
|
||||
Vendored
+8
@@ -80,6 +80,10 @@ func (mgr *SectorMgr) SectorsUnsealPiece(ctx context.Context, sector storage.Sec
|
||||
panic("SectorMgr: unsealing piece: implement me")
|
||||
}
|
||||
|
||||
func (mgr *SectorMgr) DataCid(ctx context.Context, size abi.UnpaddedPieceSize, r io.Reader) (abi.PieceInfo, error) {
|
||||
panic("todo")
|
||||
}
|
||||
|
||||
func (mgr *SectorMgr) AddPiece(ctx context.Context, sectorID storage.SectorRef, existingPieces []abi.UnpaddedPieceSize, size abi.UnpaddedPieceSize, r io.Reader) (abi.PieceInfo, error) {
|
||||
log.Warn("Add piece: ", sectorID, size, sectorID.ProofType)
|
||||
|
||||
@@ -537,6 +541,10 @@ func (mgr *SectorMgr) CheckProvable(ctx context.Context, pp abi.RegisteredPoStPr
|
||||
|
||||
var _ storiface.WorkerReturn = &SectorMgr{}
|
||||
|
||||
func (mgr *SectorMgr) ReturnDataCid(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error {
|
||||
panic("not supported")
|
||||
}
|
||||
|
||||
func (mgr *SectorMgr) ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error {
|
||||
panic("not supported")
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user