Compare commits

...
1436 Commits
Author SHA1 Message Date
Jiaying Wang 2f6a383023 Merge pull request #8781 from filecoin-project/release/v1.15.3
build: release: v1.15.3
2022-06-01 22:46:43 -04:00
Jiaying Wang a7e8f5aa17 Merge pull request #8761 from filecoin-project/jen/1153prep
build: release: prep lotus v1.15.3
2022-06-01 15:35:25 -04:00
Jiaying WangandAayush Rajasekaran c095d101a1 Update CHANGELOG.md
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2022-06-01 14:09:13 -04:00
Jennifer Wang cec9425c83 prep lotus v1.15.3 2022-05-31 16:39:23 -04:00
Jiaying Wang 130ef04ca5 Merge pull request #8764 from filecoin-project/asr/storage
chore: deps: Use tagged version of specs-storage
2022-05-31 16:38:22 -04:00
Aayush Rajasekaran ff02a666bd Merge pull request #8763 from filecoin-project/jen/rmbundle
chore: bundle: remove wrongly committed bundle cars
2022-05-30 21:08:16 -04:00
Aayush 869f6abcd6 Use tagged version of specs-storage 2022-05-30 18:08:28 -04:00
Jennifer Wang 64709dd587 remove wrongly committed bundle cars 2022-05-30 17:24:46 -04:00
Aayush 8cbbee3a87 Revert "VM: Refactor pricelist to be based on network versions"
This reverts commit 25b2e144b8.
2022-05-30 16:17:41 -04:00
Jiaying Wang ddbcf1fc61 Merge pull request #8718 from filecoin-project/jen/1153prep
build: release: v1.15.3-rc2
2022-05-24 14:30:04 -04:00
Jennifer Wang 24474042f8 update the changelog 2022-05-24 14:01:54 -04:00
Jennifer Wang 4c6598e861 bump the version to v1.15.3-rc2 2022-05-24 14:01:01 -04:00
Łukasz Magiera b32e5e916b Merge pull request #8709 from filecoin-project/jen/butterfly
fix: deps: restore butterfly network genesis from v1.14.4
2022-05-23 21:49:31 +02:00
Łukasz Magiera 199f48d16a Merge pull request #8705 from filecoin-project/jen/libp2pbackpot
deps: libp2p: update to the latest golibp2p tag
2022-05-23 21:48:07 +02:00
Travis Person cd5b6e30fa fix: deps: restore butterfly network genesis from v1.14.4 2022-05-23 15:20:07 -04:00
Jennifer Wang d0c97e07f9 update to the latest golibp2p tag 2022-05-23 14:06:18 -04:00
Jiaying Wang e1dfccb542 Merge pull request #8649 from filecoin-project/jen/v153
build: version: release v1.15.3-rc1
2022-05-13 02:13:29 -04:00
jennijuju 5d65d9f7c8 release v1.15.3-rc1 2022-05-13 02:03:38 -04:00
Łukasz Magiera 33a05d33a9 Merge pull request #8622 from RobQuistNL/patch-7
fix: Make deal making logs much less noisy
2022-05-10 20:21:29 -04:00
Łukasz Magiera 03f412404a Merge pull request #8638 from filecoin-project/asr/merge-releases
chore: merge releases back into master
2022-05-10 20:07:37 -04:00
Aayush Rajasekaran c69b579201 Merge branch 'releases' into asr/merge-releases 2022-05-10 20:02:01 -04:00
Aayush Rajasekaran d6178993c2 Merge pull request #8635 from filecoin-project/asr/pubsub
fix: mpool: avoid deadlock on unsubscribe
2022-05-10 17:21:27 -04:00
Steven Allen 9da58c5f6a fix: mpool: avoid deadlock on unsubscribe
When unsubscribing _all_ topics, pubsub will drain the subscription
channel to avoid deadlocks. See
https://github.com/whyrusleeping/pubsub/pull/1.

fixes #7803
2022-05-10 16:52:17 -04:00
Aayush Rajasekaran ddc46fc059 Update to filecoin pubsub 2022-05-10 16:51:36 -04:00
Rob Quist c057ce10d1 Make deal making logs much less noisy
For each upgrade-marked sector, for each deal, this "info" log comes along but its not really "info" imho
2022-05-09 22:13:09 +02:00
Aayush Rajasekaran f22a0f9ec0 Merge pull request #8546 from simlecode/feat/state_network_params_api
feat: api: add StateGetNetworkParams api
2022-05-09 12:44:47 -04:00
Łukasz Magiera b9750087ce Merge pull request #8545 from swift-mx/mx_dev
fix: update StatApplied when fvm apply message
2022-05-06 14:23:30 -04:00
Jiaying Wang 518dc962ee Merge pull request #8612 from filecoin-project/release/v1.15.2
build: release: v1.15.2
2022-05-06 02:23:35 -04:00
Jiaying Wang abdaae7ece Merge pull request #8611 from filecoin-project/jen/1512
build: release: v1.15.2 prep
2022-05-06 02:04:49 -04:00
zenground0 f4931c6098 attempt to fix codecov 2022-05-06 02:00:03 -04:00
Travis Person 5efa364d50 fix: ci: build macos and linux assets on tagged releases 2022-05-06 01:59:57 -04:00
Jiaying Wang c1f1d3d093 Merge pull request #8597 from filecoin-project/fix/assert-build-on-tag
fix: ci: build macos and linux assets on tagged releases
2022-05-06 01:59:30 -04:00
Jennifer Wang 304fa02d59 v1.15.2 prep 2022-05-06 01:57:03 -04:00
Łukasz Magiera e75e864070 Merge pull request #8564 from RobQuistNL/patch-5
fix: Clean up vanilla proof fetching errors for proper display
2022-05-05 16:29:54 -04:00
Łukasz Magiera 3184eb9f4d Merge pull request #8604 from RobQuistNL/patch-6
fix: Make markets logger less noisy when doing retrievals
2022-05-05 11:31:24 -04:00
Rob Quist 767a53f8c3 Make markets logger less noise when doing retrievals
Logging each block causes a lot of useless information in the logs
2022-05-05 11:56:09 +02:00
simlecode 962e37e893 add StateGetNetworkParams api 2022-05-05 14:16:30 +08:00
Łukasz Magiera d8f1380ec9 Merge pull request #8601 from filecoin-project/gstuart/flaky-gateway-test
fix: test: Fix flaky TestGatewayWalletMsig
2022-05-04 17:12:45 -04:00
Łukasz Magiera 4fcc9a1b09 Merge pull request #8600 from filecoin-project/chore/codecov
chore:ci:make codecov quiet
2022-05-04 16:41:12 -04:00
zenground0 0b5e40f455 try another one 2022-05-04 16:09:10 -04:00
Aayush Rajasekaran 0de1b84f9a Merge pull request #8563 from filecoin-project/fix/lotus-wallet-version
fix: lotus-wallet: correct network in version
2022-05-04 15:54:45 -04:00
Geoff Stuart 23378f8710 Fix flaky test 2022-05-04 15:48:44 -04:00
zenground0 1740dcb90a try that 2022-05-04 15:45:55 -04:00
zenground0 b83824b28b attempt to fix codecov 2022-05-04 15:22:54 -04:00
zenground0 8ab23cbd5c try this 2022-05-04 15:14:49 -04:00
Geoff Stuart 27e99ff84f Merge pull request #8587 from filecoin-project/gstuart/cli-uniformity
chore: cli: Alias cli commands for uniformity
2022-05-04 13:21:17 -04:00
Travis Person 85be0aad1b fix: ci: build macos and linux assets on tagged releases 2022-05-04 16:24:54 +00:00
Jiaying Wang cfe201450c Merge pull request #8588 from filecoin-project/jen/v11523
build: release: v1.15.2-rc3
2022-05-03 16:35:43 -04:00
Jiaying Wang 2478814e5a Merge pull request #8590 from filecoin-project/jen/gitignore
chore: .gitignore: ignore built in actor bundles
2022-05-03 16:31:18 -04:00
jennijuju 69db877335 update changelog 2022-05-03 15:56:08 -04:00
jennijuju 7184c9a529 add actor bundles to gitignore 2022-05-03 15:56:01 -04:00
Geoff Stuart 0869bea026 make gen 2022-05-03 15:55:34 -04:00
jennijuju abf4957e18 ignore built in actor bundles 2022-05-03 15:54:47 -04:00
Geoff Stuart 514c756570 Alias cli commands 2022-05-03 15:46:46 -04:00
jennijuju 7020892631 v1.15.3-rc3 prep 2022-05-03 15:46:43 -04:00
Aayush Rajasekaran 662f7526c9 Update to FFI with logger bump 2022-05-03 15:12:48 -04:00
Łukasz Magiera 8863bdbfc0 sealing: Finalize snap sectors before submitting proofs 2022-05-03 15:12:30 -04:00
Travis Person 704833cd29 ci: build-all and build-macos on all ci runs 2022-05-03 15:12:12 -04:00
Travis Person 19ec0ef25d ci: deps: remove install-deps for macos builds 2022-05-03 15:12:01 -04:00
Aayush Rajasekaran 7036636fcf Merge pull request #8555 from filecoin-project/fix/worker-proofs-snapdeals
fix: worker: Download proofs if PRU2 is enabled
2022-05-03 15:08:19 -04:00
Aayush Rajasekaran 57198a2fba Merge pull request #8581 from filecoin-project/fix/macos-build-deps
ci: deps: macos build deps
2022-05-03 15:06:07 -04:00
Łukasz Magiera 002bdbf03a Merge pull request #8586 from filecoin-project/chore/remove-todo
chore:chore:chore
2022-05-03 16:55:29 +01:00
zenground0 33f190c9ce Unneeded todo 2022-05-03 11:48:22 -04:00
Jiaying Wang 4cfc73e17e Merge pull request #8583 from filecoin-project/asr/1552bump
Update to FFI with logger bump
2022-05-03 10:02:34 -04:00
Jiaying Wang e793d7e128 Merge pull request #8582 from filecoin-project/fix/snap-fin-first
fix: sealing: Finalize snap sectors before submitting proofs
2022-05-03 10:01:19 -04:00
Aayush Rajasekaran 3702d4be27 Update to FFI with logger bump 2022-05-02 16:51:15 -04:00
Travis Person 415b506a85 ci: build-all and build-macos on all ci runs 2022-05-02 20:37:49 +00:00
Travis Person d6618c75a0 ci: deps: remove install-deps for macos builds 2022-05-02 20:37:49 +00:00
Łukasz Magiera 3ab625fa4c sealing: Finalize snap sectors before submitting proofs 2022-05-02 16:18:31 -04:00
jennijuju 94d9dee0dd update changelog 2022-05-02 11:33:46 -04:00
Jiaying Wang 8d0b28bda4 Merge pull request #8577 from filecoin-project/jen/logfix
deps: ffi: update ffi that includes the log fix
2022-05-02 11:24:56 -04:00
jennijuju 4d5e850aa9 update ffi that includes the log fix 2022-05-02 10:59:21 -04:00
Jiaying Wang ece51c5372 Merge pull request #8533 from filecoin-project/jen/v1522
chore: release: v1.15.2-rc2
2022-05-02 10:54:58 -04:00
Steven Allen 88f8c7d166 Merge pull request #8524 from filecoin-project/steb/error-backtrace
feat: vm: add actor error backtraces to FVM
2022-04-29 16:44:57 +02:00
Steven Allen 6c0c111847 feat: vm: add actor error backtraces to FVM 2022-04-28 19:58:19 +02:00
Łukasz Magiera f9a4a400da Merge pull request #8557 from filecoin-project/feat/worker-commp
sealing: DataCid on workers
2022-04-28 17:45:32 +02:00
Rob Quist 562d4e0f85 Clean up vanilla fetching errors for proper display
Results;
```
2  0  2374  good
2  0  2409  good
2  0  2282  bad (generating vanilla proof: non-200 code from http://10.224.3.83:1123/remote/vanilla/single: 'fsstat: path not found
')
2  0  2579  good
2  0  2338  good
```

This PR should change that to;
```
2  0  2374  good
2  0  2409  good
2  0  2282  bad (generating vanilla proof: non-200 code from http://10.224.3.83:1123/remote/vanilla/single: 'fsstat: path not found')
2  0  2579  good
2  0  2338  good
```
2022-04-28 14:49:46 +02:00
Łukasz Magiera 43436f7bc8 rpcenc: Fix double read at eof 2022-04-28 11:50:51 +02:00
Rjan 04bb539502 fix: lotus-wallet: correct network in version
Adding $(GOFLAGS) so that when compiling on calibnet, the correct network is shown, instead of showing just `mainnet`. Should address 2. in #8459
2022-04-28 10:10:29 +02:00
Łukasz Magiera 779e923854 sealing: ComputeDataCid review 2022-04-27 20:44:02 +02:00
Łukasz Magiera a2d90625d2 sealing: Fix tests 2022-04-26 21:43:24 +02:00
Łukasz Magiera d7c52f8adf sealing: ComputeDataCid miner API 2022-04-26 21:37:48 +02:00
jennijuju 48c54605ae release v1.15.2-rc2 2022-04-26 21:19:03 +02:00
Łukasz Magiera 1aed631fe5 sealing: DataCid on workers 2022-04-26 20:36:23 +02:00
Rjan a50a20b5a7 fix: worker: Download proofs if PRU2 is enabled
The lotus-worker does not check or download the params if Prove Replica Update tasks are enabled.
2022-04-26 09:10:38 +02:00
Phi-rjan 1162b02e60 Merge pull request #8528 from rjan90/ux/description-lotus-wallet
fix: ux: update `lotus-wallet run` description
2022-04-25 15:57:50 +02:00
Steven Allen 5b1800556b ci: fix linting 2022-04-25 14:13:16 +02:00
Phi-rjanandAayush Rajasekaran 825cdb8db9 Update cmd/lotus-wallet/main.go
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2022-04-25 08:56:34 +02:00
swift-mx 6c40d363f5 fix: update StatApplied when fvm apply message 2022-04-24 11:50:54 +08:00
jennijuju bd9e8c7663 update go version thats needed by the new libp2p 2022-04-23 22:20:07 +02:00
Jiaying Wang 2be9452ced Merge pull request #8526 from masih/idxprov-topic-by-netname
fix: market: Infer index provider topic from network name by default
2022-04-22 15:32:58 +02:00
vyzo efad692353 go mod tidy 2022-04-22 02:54:30 +02:00
vyzo 357da15e5c update go-libp2p@v0.19 2022-04-22 02:53:05 +02:00
vyzo cc328689e1 dear linter, using xerrors is what we want to do. 2022-04-22 02:51:15 +02:00
Masih H. Derkani d044e30e12 Infer index provider topic from network name by default
Index provider integration uses a gossipsub topic to announce changes to
the advertised content. The topic name was fixed to the default topic
which is `/indexer/ingest/mainnet`.

In the case of lotus, the gossipsub validators enforce a list of topics
the instance is permitted to join by setting subscription filter option
when `PubSub` instance is constructed via DI.

Having the fixed topic name meant that any SP starting up a node on a
network other than `mainnet` would have to override the default config
to avoid the node crashing when index provider is enabled.

Instead of a fixed default, the changes here infer the allowed indexer
topic name from network name automatically if the topic configuration is
left empty.

Fixes #8510
2022-04-22 02:46:05 +02:00
Jiaying Wang ff987e0b9d Merge pull request #8511 from filecoin-project/deps/update-libp2p
deps: update go-libp2p@v0.19
2022-04-22 02:44:45 +02:00
vyzo cc294496ab go mod tidy 2022-04-22 02:20:45 +02:00
vyzo ed0b4b0bfa update go-libp2p@v0.19 2022-04-22 02:20:45 +02:00
Jiaying Wang bab500bec5 Merge pull request #8531 from filecoin-project/fix/lint
chore: fix lint issue
2022-04-21 13:24:13 -04:00
vyzo 1c8880ed2c dear linter, using xerrors is what we want to do. 2022-04-21 20:10:34 +03:00
Masih H. Derkani f273a440f0 Infer index provider topic from network name by default
Index provider integration uses a gossipsub topic to announce changes to
the advertised content. The topic name was fixed to the default topic
which is `/indexer/ingest/mainnet`.

In the case of lotus, the gossipsub validators enforce a list of topics
the instance is permitted to join by setting subscription filter option
when `PubSub` instance is constructed via DI.

Having the fixed topic name meant that any SP starting up a node on a
network other than `mainnet` would have to override the default config
to avoid the node crashing when index provider is enabled.

Instead of a fixed default, the changes here infer the allowed indexer
topic name from network name automatically if the topic configuration is
left empty.

Fixes #8510
2022-04-21 14:00:53 +01:00
Rjan 295bf03e4d fix: ux: update lotus-wallet run description
Update the `lotus-wallet run` to include that a `FULLNODE_API_INFO` env variable needs to be set before running
2022-04-21 14:21:09 +02:00
Jakub Sztandera 48ffb15901 Merge pull request #8512 from filecoin-project/ci/update-go
chore: ci: update golang and go-ipfs
2022-04-20 13:18:13 +02:00
Steven Allen e0d2b9526e ci: fix linting 2022-04-20 12:06:28 +02:00
Steven Allen 5f5bd31f58 chore: update golang and go-ipfs
1. go 1.16.4 is not supported.
2. go-ipfs 0.4.22 is NOT SUPPORTED!
3. switch go cimg/go
4. Remove unnecessary CI dependencies.
2022-04-20 12:06:25 +02:00
Aayush Rajasekaran 2410cf3d84 Merge pull request #8514 from filecoin-project/asr/exec-trace
feat: FVM: Support exectraces
2022-04-19 18:03:25 -04:00
Aayush 36a8d9716e FVM: Support exectraces 2022-04-19 15:24:40 -04:00
Geoff Stuart a3a3fefb1c Merge pull request #8486 from filecoin-project/gstuart/robust-address-endpoint
Feat: API: Implement StateLookupRobustAddress
2022-04-19 11:37:23 -04:00
Łukasz Magiera eb894b0dd2 Merge pull request #8475 from filecoin-project/fix/deal-idx-oob
fix:sealing:check index out of bounds against correct param length not return length
2022-04-18 18:56:23 +02:00
Łukasz Magiera 1922e76349 Merge pull request #8495 from 1475-IPFS/new-bootstrapper
add 1475 bootstrapper
2022-04-18 13:23:46 +02:00
Łukasz Magiera 4bd039902c Merge pull request #8494 from filecoin-project/gstuart/bump-xtools
Bump version for xtools
2022-04-15 17:23:06 +02:00
lifei 77615e9583 add 1475 bootstrapper 2022-04-15 12:38:07 +08:00
Geoff Stuart 49d6c07280 Implemented StateLoockupRobustAddress 2022-04-14 17:41:18 -04:00
Geoff Stuart 0db46dfeaa Bump version for xtools 2022-04-14 17:26:08 -04:00
Łukasz Magiera 06f8637485 Merge pull request #8481 from filecoin-project/fix/snap-fsoverhead
fix: storiface: Make FSOverhead numbers more accurate
2022-04-14 15:36:19 +02:00
zenground0 5bdcc7d7e0 make gen 2022-04-13 22:16:05 -04:00
zenground0 db5082552d Fix sorting bug to deflake test 2022-04-13 22:06:38 -04:00
Jiaying Wang dcf6f64143 Merge pull request #8482 from filecoin-project/jen/11521
build: release: v1.15.2-rc1
2022-04-13 19:29:24 +02:00
jennijuju 372dd2ced9 v1.15.2-rc1 2022-04-13 19:11:02 +02:00
Łukasz Magiera 0c8828514e Merge pull request #8480 from Icarus9913/fix/indexProvider-comments
fix: node: fix comment for IndexProvider
2022-04-13 12:01:33 +02:00
Łukasz Magiera 0a4b49d3b3 fix: storiface: Make FSOverhead numbers more accurate 2022-04-13 11:59:48 +02:00
Łukasz Magiera 84470e9c64 Merge pull request #8442 from rjan90/ux/soft-delete-wallet
ux: wallet: update delete usage
2022-04-13 11:51:09 +02:00
Łukasz Magiera 88142d246c Merge pull request #8479 from filecoin-project/asr/expired-cutoff
Fail to add expired precommits to a batch
2022-04-13 11:44:31 +02:00
Icarus9913 98c861e3c9 fix the IndexProviderConfig comment 2022-04-13 17:44:06 +08:00
Aayush Rajasekaran 42a79d52a2 Fail to add expired precommits to a batch 2022-04-12 23:41:52 -04:00
zenground0 563dc8e59a Fix up tests 2022-04-12 18:31:31 -04:00
Jiaying Wang 02a6176bd0 Merge pull request #8477 from filecoin-project/fix/disable-kvlog
chore: config: default-disable kvlog
2022-04-13 00:03:11 +02:00
Łukasz Magiera cc7055774d chore: config: default-disable kvlog 2022-04-12 23:17:13 +02:00
zenground0 d540f7af72 Fix typo 2022-04-12 15:41:56 -04:00
zenground0 239274cb1d Properly handle output index 2022-04-12 15:34:45 -04:00
zenground0 fe6c25353c Fix assumptions about return value 2022-04-12 14:46:01 -04:00
Jiaying Wang aca9496437 Merge pull request #8473 from filecoin-project/jen/bumpmaster
chore: version: bump the version to v1.15.3-dev
2022-04-12 17:36:07 +02:00
Jiaying Wang ce3c6472fb Merge pull request #8470 from filecoin-project/feat/enable-rcmgr-by-default
enable rcmgr by default
2022-04-12 16:12:03 +02:00
jennijuju 787bcef130 bump the version to v1.15.3 2022-04-12 15:53:45 +02:00
Łukasz Magiera cf92776c64 Merge pull request #8468 from filecoin-project/jen/mergeback
chore: merge releases back to master
2022-04-12 15:41:36 +02:00
Jiaying WangandŁukasz Magiera 1fc94e33b2 Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
fix merge error
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2022-04-12 15:29:54 +02:00
jennijuju 137f494619 tidy and gen 2022-04-12 13:53:03 +02:00
Łukasz Magiera df7e2a884b Merge pull request #8469 from filecoin-project/update-libp2p-rcmgr-optout
Update libp2p to v0.18.1
2022-04-12 12:02:24 +02:00
Łukasz Magiera ac57797904 Merge pull request #8464 from filecoin-project/feat/getask-protos
feat: cli: lotus client list-asks --protocols
2022-04-12 10:47:52 +02:00
vyzo 3c8aa18f70 enabled rcmgr by default; disable with LOTUS_RCMGR=0 2022-04-12 11:32:37 +03:00
vyzo 0f4019cbb7 update go-libp2p@v0.18.1 2022-04-12 11:30:24 +03:00
Rjan c3f2f12cb2 Revert soft-delete cmd
Revert `soft-delete` cmd back to `delete`. Keeps the updated usage
2022-04-12 08:31:54 +02:00
Aayush Rajasekaran 656a33863f Fixup merge 2022-04-11 20:45:13 -04:00
jennijuju 0dcad9cc18 Merge branch 'releases' into jen/mergeback 2022-04-12 01:25:02 +02:00
Łukasz Magiera 6bef1aeb82 feat: cli: lotus client list-asks --protocols 2022-04-11 19:49:52 +02:00
Łukasz Magiera 3cd563622e Merge pull request #8439 from filecoin-project/revert-appimage-removal
Revert appimage removal
2022-04-11 19:24:36 +02:00
Łukasz Magiera 66f88773c0 Merge pull request #8461 from filecoin-project/fix/release-unseal-nosnap-panic
sealing: Don't panic in ReleaseUnsealed with no ranges
2022-04-09 21:40:35 +02:00
Łukasz Magiera 3ecb1fd5d9 sealing: Don't panic in ReleaseUnsealed with no ranges 2022-04-09 20:58:47 +02:00
Łukasz Magiera 7900479e9c Merge pull request #8447 from filecoin-project/feat/sched-better
feat: sched: Improve worker assigning logic
2022-04-09 20:50:31 +02:00
Jiaying Wang 731da455d4 Merge pull request #8457 from filecoin-project/release/v1.15.1
build: release: v1.15.1
2022-04-07 18:14:15 -04:00
Aayush Rajasekaran b5791d4442 Merge pull request #8456 from filecoin-project/jen/v1.15.1
chore: release: v1.15.1 prep
2022-04-07 18:04:15 -04:00
Jennifer Wang af7e301867 bump the version to v1.15.1 2022-04-07 17:40:58 -04:00
Jennifer Wang 681c255bc5 update changelog 2022-04-07 17:40:47 -04:00
Jiaying Wang 8a30448fa7 Merge pull request #8455 from filecoin-project/jen/v1516prep
build: release: v1.15.1-rc6
2022-04-07 14:52:20 -04:00
Jennifer Wang fa6389a7e7 add missing item to changelog 2022-04-07 14:43:38 -04:00
Jennifer Wang 0c099dfbd0 bump the version to v1.15.1-rc6 2022-04-07 14:10:01 -04:00
Jennifer Wang fd40280300 update changelog 2022-04-07 14:08:36 -04:00
Jiaying Wang 5a48c3a921 Merge pull request #8451 from filecoin-project/jen/v1516
chore: backport: #8443 #8444 #8446
2022-04-07 13:27:17 -04:00
Aayush Rajasekaran 68b6190c12 Merge pull request #8453 from filecoin-project/asr/backport
fix: FVM: add finality check for consensus faults
2022-04-07 13:16:47 -04:00
Łukasz Magiera e2f4c70b70 Merge pull request #8452 from filecoin-project/asr/fvm-consensus-fault
fix: FVM: add finality check for consensus faults
2022-04-07 13:07:40 -04:00
Aayush 7518854625 fix: FVM: add finality check for consensus faults 2022-04-07 12:27:33 -04:00
Aayush d1c0b8b0c9 fix: FVM: add finality check for consensus faults 2022-04-07 12:22:07 -04:00
Masih H. Derkani 0a2429b467 Fix DI of PubSub in markets by binding dependencies it needs
Bind drand and bootstrap peers config so that `PubSub` instantiated by
`ConfigCommon` has all the dependencies it needs when `PubSub` instance
is needed in markets. In ths case, the instance is needed by the index
provider engine to announce new indexing advertisements.
2022-04-07 11:06:29 -04:00
Masih H. Derkani e37c54f38e Reuse the market process PubSub instance in index provider engine
The markets process instantiates its own `PubSub` instance with all
validators, peer scoring, etc. set up. Use that instane to join the
indexing topic, otherwise the default topic instantiated by
index-provider internally (via go-legs) has no validators.
2022-04-07 11:06:23 -04:00
Masih H. Derkani 4043923e56 Set index provider options based on lotus config
Always set index provider options based on the lotus configuration.
Otherwise, they will have no effect.
2022-04-07 11:05:09 -04:00
Cory Schwartz 76c10807d6 disable publish-packer 2022-04-07 11:04:45 -04:00
Łukasz Magiera 20698a7843 Merge pull request #8446 from filecoin-project/disable-publish-packer
chore: ci: disable publish-packer
2022-04-07 10:44:13 -04:00
Cory Schwartz a4c24985e8 disable publish-packer 2022-04-07 10:32:15 -04:00
Łukasz Magiera b26ac2bd0e Merge pull request #8450 from filecoin-project/fix/testkit-rpc-shutdown
testkit: give up on waiting for the RPC server to shutdown after 1s
2022-04-07 08:06:46 -04:00
dirkmcandAnton Evangelatov c34ade9ffb Update itests/kit/rpc.go
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
2022-04-07 13:32:00 +02:00
Dirk McCormick 5f0489ace0 fix: testkit: give up on waiting for the RPC server to shutdown after 1 second 2022-04-07 12:22:36 +02:00
Rjan 96ee416b96 Fix TestWalletDelete-test
Change from `delete` to `soft-delete` in the TestWalleteDelete test.
2022-04-07 10:25:49 +02:00
Łukasz Magiera 80133aaa79 feat: sched: Improve worker assigning logic 2022-04-06 18:24:14 -04:00
Łukasz Magiera 6de4e3d4cd feat: sched: Cache worker tasks 2022-04-06 18:24:14 -04:00
Łukasz Magiera f652dd3436 Merge pull request #8441 from filecoin-project/frrist/observer-deregister
chore: events: implement event observer deregister method
2022-04-06 18:22:41 -04:00
Łukasz Magiera 9f98d0ae4a Merge pull request #8443 from filecoin-project/masih/idxprov-reuse-pubsub
fix: market: Reuse the market `PubSub` in index provider
2022-04-06 17:51:46 -04:00
Masih H. Derkani f369d99138 Fix DI of PubSub in markets by binding dependencies it needs
Bind drand and bootstrap peers config so that `PubSub` instantiated by
`ConfigCommon` has all the dependencies it needs when `PubSub` instance
is needed in markets. In ths case, the instance is needed by the index
provider engine to announce new indexing advertisements.
2022-04-06 20:04:39 +01:00
Masih H. Derkani 7e7e88e330 Reuse the market process PubSub instance in index provider engine
The markets process instantiates its own `PubSub` instance with all
validators, peer scoring, etc. set up. Use that instane to join the
indexing topic, otherwise the default topic instantiated by
index-provider internally (via go-legs) has no validators.
2022-04-06 19:39:12 +01:00
frrist 20bf46f309 chore: events: implement event observer deregister method 2022-04-06 11:01:18 -07:00
Łukasz Magiera f378c6d3ee Merge pull request #8444 from filecoin-project/masih/fix-idxprov-config
fix: market: set all index provider options based on lotus config
2022-04-06 11:59:37 -04:00
Masih H. Derkani b88307f875 Set index provider options based on lotus config
Always set index provider options based on the lotus configuration.
Otherwise, they will have no effect.
2022-04-06 16:08:10 +01:00
Rjan 255ff1a4b7 ux: wallet: soft-delete wallet
Renaming the function to soft-delete to better reflect what it does - and specify that a hard deletion is needed for permanent removal.
2022-04-06 10:23:03 +02:00
Łukasz Magiera 696659d6bc Merge pull request #8437 from filecoin-project/fix/fvm-aarch64-build
chore: ffi: update the FFI to fix the aarch64 build
2022-04-05 21:56:08 -04:00
Łukasz Magiera 8a16e1ca7d Merge pull request #8440 from filecoin-project/chore/update-fvm
chore: ffi: update the FFI to update the FVM
2022-04-05 21:36:42 -04:00
Steven Allen 39dee1410b chore: ffi: update the FFI to update the FVM
This fixes the build on aarch64.
2022-04-05 21:25:00 -04:00
Cory Schwartz c715254d54 Revert "stop publishing appimagine since its disabled by #7707"
This reverts commit 6b0868089b.
2022-04-05 17:26:44 -07:00
Cory Schwartz d1f3ab5dec Revert "remove from the bundlde"
This reverts commit 7d65a2664d.
2022-04-05 17:26:39 -07:00
Łukasz Magiera 0fa74a7712 Merge pull request #8438 from filecoin-project/fix/release-unseal-snap-abort
fix: sealing: Release unsealed sector files after snapdeals abort
2022-04-05 18:26:20 -04:00
Steven Allen e69cc545b3 chore: ffi: update to fix build on aarch64 2022-04-05 17:59:30 -04:00
Łukasz Magiera 68f3e4483f fix: sealing: Release unsealed sector files after snapdeals abort 2022-04-05 16:45:07 -04:00
Łukasz Magiera e1ef1b759e Merge pull request #8206 from firesWu/fix/optimize-worker-tracker-lock
release worker tracker lock when call cb func
2022-04-05 12:53:09 -04:00
Łukasz Magiera 1bd0f55945 Merge pull request #8425 from filecoin-project/fix/market-node-startup
fix: node: Fix market node startup
2022-04-03 14:55:19 -04:00
Łukasz Magiera a40381a700 Merge pull request #8426 from filecoin-project/feat/multi-vlog2car
feat: shed: Multi-file vlog2car
2022-04-02 18:00:21 -04:00
Łukasz Magiera 9a34f5803c feat: shed: Multi-file vlog2car 2022-04-02 13:25:14 -04:00
Jiaying Wang 913478b21e Merge pull request #8421 from filecoin-project/jen/v1515
build: release: v1.15.1-rc5
2022-04-01 17:57:21 -04:00
Łukasz Magiera 2b3fad1261 fix: node: Fix market node startup 2022-04-01 17:32:55 -04:00
Jennifer Wang bba2ee92bd update dockerfile 2022-04-01 17:08:27 -04:00
Jennifer Wang c4aece4ab4 pull ffi that includes the latest fvm 2022-04-01 17:02:32 -04:00
Jiaying Wang e74e56947b Merge pull request #8424 from filecoin-project/jen/ffibump
deps: ffi: pull ffi that includes the latest fvm
2022-04-01 17:01:49 -04:00
Jennifer Wang ce0b8149e9 pull ffi that includes the latest fvm 2022-04-01 15:58:15 -04:00
Jennifer Wang 5915d4ac6a fix ci 2022-04-01 15:31:10 -04:00
Aayush Rajasekaran 940505569c Merge pull request #8422 from filecoin-project/asr/log
Update to go-log 2.5.1
2022-04-01 09:41:26 -04:00
Aayush Rajasekaran 8c46d00ee7 Update to go-log 2.5.1 2022-04-01 01:13:55 -04:00
Cory Schwartz cc57f732d2 fix template 2022-04-01 00:07:48 -04:00
Cory Schwartz f410da2a0a restore filters 2022-04-01 00:07:28 -04:00
Cory Schwartz cb39ce66bc add packer executor 2022-04-01 00:07:10 -04:00
Cory Schwartz eb0d52a249 copy packer_build source 2022-04-01 00:05:27 -04:00
Cory Schwartz 2804c2ca99 tmp: remove filters 2022-04-01 00:05:23 -04:00
Cory Schwartz 71614bd639 add debug 2022-04-01 00:05:19 -04:00
Cory Schwartz 78187ab8d1 fix template 2022-04-01 00:05:10 -04:00
Cory Schwartz 6b4cc44060 fix template 2022-04-01 00:05:06 -04:00
Cory Schwartz 61742f5d5a restore filters 2022-04-01 00:05:02 -04:00
Cory Schwartz c330641866 use 1.8 2022-04-01 00:04:58 -04:00
Cory Schwartz 33019ee496 add packer executor 2022-04-01 00:04:53 -04:00
Cory Schwartz b40b7cc40e copy packer_build source 2022-04-01 00:04:38 -04:00
Cory Schwartz 17bcf91910 tmp: remove filters 2022-04-01 00:04:29 -04:00
Cory Schwartz f04b5f2963 add debug 2022-04-01 00:04:23 -04:00
Jennifer Wang 6ff99568cf pull the latest ffi 2022-03-31 23:52:08 -04:00
Jennifer Wang 0a220a3efb update the changelog 2022-03-31 23:51:57 -04:00
Jennifer Wang 0bc3e26090 bump the version to v1.15.1-rc5 2022-03-31 23:13:35 -04:00
Łukasz Magiera 257bc70c2e fix lotus-sim build 2022-03-31 23:08:05 -04:00
koalacxr 6c1651cb3d modify quantile imports error 2022-03-31 23:08:00 -04:00
zl 01efb3b1a7 fix: dead loop on removing a sector 2022-03-31 23:06:54 -04:00
Łukasz Magiera 2ad3a117f1 fix: sealing: Fix PR1 worker selection 2022-03-31 23:06:17 -04:00
Łukasz Magiera e19c5bfcd7 Merge pull request #8413 from filecoin-project/packer-publish-copy-orb
Packer publish copy orb
2022-03-31 18:45:40 -04:00
Łukasz Magiera f9ae5c0cb3 Merge pull request #8420 from filecoin-project/fix/8226
fix: sealing: Fix PR1 worker selection
2022-03-31 17:52:45 -04:00
Łukasz Magiera ac82366b9e fix: sealing: Fix PR1 worker selection 2022-03-31 17:01:33 -04:00
Cory Schwartz b493855195 fix template 2022-03-30 23:10:17 -07:00
Cory Schwartz 4bb8865e2f fix template 2022-03-30 22:57:02 -07:00
Cory Schwartz 9c25aea327 restore filters 2022-03-30 22:53:57 -07:00
Cory Schwartz cc5e96b23f use 1.8 2022-03-30 22:35:20 -07:00
Cory Schwartz 0095d93686 add packer executor 2022-03-30 22:30:17 -07:00
Cory Schwartz 1da3e2c711 copy packer_build source 2022-03-30 22:27:18 -07:00
Cory Schwartz 73468e706e tmp: remove filters 2022-03-30 22:03:41 -07:00
Cory Schwartz 4894e0b18d add debug 2022-03-30 22:02:43 -07:00
Łukasz Magiera f155b3003b Merge pull request #8411 from filecoin-project/deps/update-data-transfer-fix-master
chore(deps): update go-data-transfer with fixes (master edition)
2022-03-30 15:11:26 -04:00
hannahhoward 4974b6874e chore(deps): update go-data-transfer with fixes 2022-03-30 14:59:31 -04:00
Łukasz Magiera 1fac7981a4 Merge pull request #8410 from filecoin-project/feat/go-1.18
fix: go: make Go 1.18 builds work
2022-03-30 14:56:19 -04:00
Łukasz Magiera b244277ff2 Merge pull request #8403 from filecoin-project/deps/update-data-transfer-fix
Update go-data-transfer with fixes
2022-03-30 14:54:45 -04:00
Łukasz Magiera 0c6f3ee19c fix lotus-sim build 2022-03-30 14:34:20 -04:00
Łukasz Magiera 12752c6970 Merge github.com:koalacxr/lotus into feat/go-1.18 2022-03-30 14:31:32 -04:00
Łukasz Magiera 39c38c44a3 Merge pull request #8404 from simlecode/fix/not_check_error
fix: sealing: Added error checking
2022-03-29 22:57:35 -04:00
simlecode f0944030b7 Added error checking 2022-03-30 10:28:56 +08:00
Aayush Rajasekaran 7eb7edb950 Merge pull request #8402 from filecoin-project/jen/ffiupdate
deps: update ffi with actor v7.1.0 and fvm that uses the bundle that includes the new manifest
2022-03-29 21:17:33 -04:00
Jiaying Wang 6a88a94a8b Merge pull request #8401 from filecoin-project/jen/v1514
chore: release: v1.15.1-rc4
2022-03-29 21:15:34 -04:00
hannahhoward 7e86f7196e chore(deps): update go-data-transfer with fixes 2022-03-29 18:12:42 -07:00
Jiaying WangandAayush Rajasekaran eeeb33c9ac Update CHANGELOG.md
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2022-03-29 20:59:16 -04:00
Jennifer Wang b8e412884b deps: update ffi with actor v7.1.0 and fvm that uses the bundle that includes the new manifest 2022-03-29 20:49:40 -04:00
Jennifer Wang 4d2691a2e1 build: release: v1.15.1-rc4 2022-03-29 20:36:39 -04:00
Łukasz Magiera 3ce467a25f Merge pull request #8391 from filecoin-project/feat/parallel-fault-check
feat: storage: Parallel proving checks
2022-03-29 16:36:12 -04:00
Łukasz Magiera 0710342317 fix waiting in sector proving checks 2022-03-29 15:28:37 -04:00
Łukasz Magiera d95f24b9d2 config: Sane default parallel sector read defaults 2022-03-29 14:52:37 -04:00
Łukasz Magiera c456836ad5 Merge pull request #8400 from filecoin-project/asr/update
Update to specs-storage v0.2.2
2022-03-29 14:23:07 -04:00
Aayush be418e77f9 Update to specs-storage v0.2.2 2022-03-29 14:08:55 -04:00
Jennifer Wang 21a1f3a34d deps: update ffi 2022-03-29 12:02:41 -04:00
Łukasz Magiera ebd34f1884 feat: storage: Parallel proving checks 2022-03-29 11:45:08 -04:00
Łukasz Magiera ba2596e318 Merge pull request #8397 from filecoin-project/feat/thread-safe-piecereader
Thread safe piecereader
2022-03-29 11:22:19 -04:00
Aarsh Shah d0af0eff9f thread safe piecereader 2022-03-29 19:41:06 +05:30
Łukasz Magiera d502eeba2b Merge pull request #8389 from filecoin-project/feat/manual-wdpost
feat: miner: API/CLI to compute window-post
2022-03-28 21:20:06 -04:00
Łukasz Magiera 064c3d473c Merge pull request #8390 from filecoin-project/feat/worker-ulimitn-check
feat: worker: check fd limit on startup
2022-03-28 18:33:26 -04:00
Łukasz Magiera 5a42083abd feat: worker: check fd limit on startup 2022-03-28 18:07:54 -04:00
Łukasz Magiera 54cb55a7ae feat: miner: API/CLI to compute window-post 2022-03-28 17:06:51 -04:00
Łukasz Magiera a709a0a682 Merge pull request #8384 from rjan90/fix/change-worker-msg
fix: ux: Change Propose-worker msg
2022-03-28 12:57:01 -04:00
Łukasz Magiera 029610fb40 Merge pull request #8386 from zl03jsj/fix/dead_loop_on_remove_sector
fix: miner: dead loop on removing sector
2022-03-28 12:51:53 -04:00
zl 1646edf513 fix: dead loop on removing a sector 2022-03-28 20:51:57 +08:00
Rjan e2781ea0f2 Change test to reflect renaming
Change what string the TestWorkerKeyChange-test is looking for, to reflect the new Propose-worker msg-changes
2022-03-28 10:04:47 +02:00
Rjan 555ff81cbf Add punctuation. 2022-03-28 09:46:08 +02:00
Jiaying Wang 003df89edf Merge pull request #8383 from filecoin-project/jen/v1512
chore: build: v1.15.1-rc3
2022-03-28 02:54:15 -04:00
Rjan bfc2cc3aa3 fix: ux: Change Propose-worker msg
Changes the message so it´s clear that it´s only Storage Providers without active deadlines that needs to call 'confirm-change-worker'.
2022-03-28 08:18:30 +02:00
jennijuju eeab118a05 chore: build: v1.15.1-rc3 2022-03-27 19:36:10 -04:00
Jiaying Wang 04458ea12b Merge pull request #8382 from filecoin-project/jen/v1513
chore: backport: #8381 #8378
2022-03-27 19:17:28 -04:00
Łukasz Magiera c951e348b4 feat: config: Move MakeNewSectorForDeals config into the Sealing sectoin 2022-03-26 23:45:48 -04:00
Jennifer Wang 2a988d453c chore: ffi: the latest fvm release 2022-03-26 23:25:02 -04:00
Jiaying Wang b8b33c4f06 Merge pull request #8381 from filecoin-project/jen/ffi
chore: ffi: the latest fvm release
2022-03-26 22:57:02 -04:00
Jennifer Wang f2fa2f5067 chore: ffi: the latest fvm release 2022-03-26 22:45:47 -04:00
Łukasz Magiera 001de1a915 Merge pull request #8379 from filecoin-project/feat/proving-workers-cli
feat: miner cli: Separate proving workers command
2022-03-26 16:36:00 -04:00
Łukasz Magiera f0f0fe38a3 Merge pull request #8380 from filecoin-project/feat/worker-type-logic
fix: worker: Fix default value handling
2022-03-26 16:35:38 -04:00
Łukasz Magiera 2498da742d fix: worker: Fix default value handling 2022-03-26 16:26:19 -04:00
Łukasz Magiera ad684ed0ea feat: miner cli: Separate proving workers command 2022-03-26 16:16:25 -04:00
Łukasz Magiera 0d7d02da35 Merge pull request #8378 from filecoin-project/feat/move-makedealsector-cfg
feat: config: Move MakeNewSectorForDeals config into the Sealing sectoin
2022-03-26 16:08:21 -04:00
Łukasz Magiera b78892934b feat: config: Move MakeNewSectorForDeals config into the Sealing sectoin 2022-03-26 15:50:21 -04:00
Aayush Rajasekaran c50b63c5f6 Merge pull request #8374 from filecoin-project/revert-8119-travis/fvm-interopnet
Revert "Update params for interopnet for fvm"
2022-03-25 22:26:35 -04:00
Aayush Rajasekaran b0ff3dfb90 Revert "Update params for interopnet for fvm" 2022-03-25 22:21:36 -04:00
Łukasz Magiera 7401fa234e Merge pull request #7971 from filecoin-project/feat/post-worker
feat: PoSt workers
2022-03-25 20:31:49 -04:00
Łukasz Magiera 7a009abcdd sealing: Fix TaskType.WorkerType 2022-03-25 18:54:59 -04:00
Aayush Rajasekaran b305244405 Merge pull request #8119 from filecoin-project/travis/fvm-interopnet
Update params for interopnet for fvm
2022-03-25 17:28:41 -04:00
Aayush 02a0770436 Caterpillarnet 2022-03-25 17:05:45 -04:00
Florian Ruen 196030bee2 fix: cli: Reset miner/ask lists in interactive deal 'miner' step (#8155)
* Update client.go

Bug fixed : if hitting return instead of filling with a valid value, the CLI crashed (line 796)
Change return err by continue to ask a valid value again

* Fix #8100

Bug fixed : if hitting return instead of filling with a valid value, the CLI crashed (line 796)
Change return err by continue to ask a valid value again

* lint reported errors on CircleCI

Commit to fix lint reported errors during tests on CircleCI
(remove blank lines x2)

* lint reported errors on CircleCI

Commit to fix lint reported errors during tests on CircleCI
(remove trailling whitespace)

* Fix #8095
Clear the list of miner addresses and successfull get-asked before asking for new ones
Previous behavior : if get-ask failed for miner(s), the faulty miner will be retried each time,
so you have to stop the command and start again to change this faulty miner (instead of removing from the list on the new attempt)

* Clear the list of miner addresses and successfull get-asked before asking for new ones
Previous behavior : if get-ask failed for miner(s), the faulty miner will be retried each time,
so you have to stop the command and start again to change this faulty miner (instead of removing from the list on the new attempt)
2022-03-25 17:05:19 -04:00
Łukasz Magiera d49297f898 Merge pull request #8371 from filecoin-project/raulk/shed-compute-state-range
feat: lotus-shed: add command to compute state over a range of tipsets.
2022-03-25 17:00:35 -04:00
Łukasz Magiera b5ce847579 Merge pull request #8372 from filecoin-project/chore/gomock-temp-cleanup
chore: Remove temp gomock reflect file
2022-03-25 16:57:13 -04:00
Łukasz Magiera 7dc19bb26e Merge pull request #8369 from filecoin-project/asr/pricelist
VM: Refactor pricelist to be based on network versions
2022-03-25 16:50:52 -04:00
Łukasz Magiera 82343a06e7 Merge remote-tracking branch 'origin/master' into feat/post-worker 2022-03-25 16:49:46 -04:00
Łukasz Magiera 5f9753933a chore: Remove temp gomock reflect file 2022-03-25 16:46:50 -04:00
Łukasz Magiera fcaad20ecc cli: Update docs 2022-03-25 16:28:08 -04:00
Łukasz Magiera f1ddb55252 worker: Fix challengeThrottle 2022-03-25 16:07:47 -04:00
Łukasz Magiera 69e8516d1f stores: log 404 in remote.GenerateSingleVanillaProof 2022-03-25 15:37:35 -04:00
Łukasz Magiera d437f19aae Merge pull request #8349 from filecoin-project/feat/faulty-cli-utils
feat: miner cli: proving check --faulty, faults in storage list sectors
2022-03-25 15:29:27 -04:00
Raúl Kripalani 977e302e0c lotus-shed: add command to compute state over a range of tipsets. 2022-03-25 19:12:16 +00:00
Aayush 0bfbcfb5e9 stmgr: GetNtwkVersion: return genesis network version before the first upgrade 2022-03-25 15:09:14 -04:00
Łukasz Magiera 7c4d3a457c Merge pull request #8343 from filecoin-project/feat/more-snap-config
feat: sealing: More SnapDeals config knobs
2022-03-25 15:07:00 -04:00
Aayush 25b2e144b8 VM: Refactor pricelist to be based on network versions 2022-03-25 15:06:10 -04:00
Łukasz Magiera 11db419735 Merge pull request #8357 from filecoin-project/feat/net-ping
feat: cli/net: implement 'net ping' command
2022-03-25 14:57:21 -04:00
Łukasz Magiera 4e2d7fe1db Merge pull request #8370 from rjan90/ux/sectors-snap-up
fix:snapup: Rename error message
2022-03-25 14:33:20 -04:00
Rjan 910d3caacf fix:snapup: Rename error message
Renaming the the error-message you get if you try to snap-up the same sector twice, to better reflect that you are snapping a sector, and not marki-for-upgrade, which now has been deprecated.
2022-03-25 16:39:53 +01:00
Jiaying Wang a449937682 Merge pull request #8368 from rjan90/fix/ux-msig-create
fix: multisig: Print "waiting for confirmation.."
2022-03-25 11:15:15 -04:00
Łukasz Magiera 0b3144f566 workers: PoSt challenge throttle/timeout config 2022-03-24 19:42:44 -04:00
Łukasz Magiera 13701c7ce2 wdpost: Lock update files in snapped sectors 2022-03-24 18:43:08 -04:00
Łukasz Magiera 3f152ae2bf workers: cmd/lotus-seal-worker->cmd/lotus-worker 2022-03-24 18:37:01 -04:00
Łukasz Magiera a53dc5a7c7 workers: WorkerType mehdod on SealTask 2022-03-24 18:28:45 -04:00
Rjan da64f241eb Print "waiting for confirmation.." in msigCreateCmd
Prints an addition "waiting for confirmation.." when running `lotus msig create [address1 address2]` to indicate that command is waiting for the msg to be mined into block, and not just hanging.

Should fix #4053
2022-03-24 16:11:24 +01:00
Jiaying Wang b2dbe8dfef Merge pull request #8365 from filecoin-project/jen/v1512prep
chore: build: v1.15.1-rc2
2022-03-23 16:32:49 -04:00
Jennifer Wang 9436b15528 chore: release: v1.15.1-rc2 2022-03-23 16:22:51 -04:00
Jiaying Wang d6e6bfbb5a Merge pull request #8364 from filecoin-project/jen/v1512
chore: backport:  #8355 #8353 #8363
2022-03-23 16:20:07 -04:00
Aayush 3fbf765605 FVM: log when fvm is used 2022-03-23 14:05:43 -04:00
Łukasz Magiera 8e75a8d12d fix: sealing: always do cooldown in handleSubmitReplicaUpdateFailed 2022-03-23 14:05:43 -04:00
vyzo 450d4b256a update go-libp2p to v0.18 2022-03-23 14:05:43 -04:00
Aayush 595e29186e stmgr: call: use a buffered concurrent-access blockstore 2022-03-23 14:05:43 -04:00
Jiaying Wang caeeb6a7d9 Merge pull request #8363 from filecoin-project/asr/fvm-log
chore: FVM: log when fvm is used
2022-03-23 13:43:35 -04:00
Jiaying Wang c070f253ac Merge pull request #8359 from filecoin-project/asr/vm-memstore
stmgr: call: use a buffered concurrent-access blockstore
2022-03-23 13:22:56 -04:00
Aayush 694c45cd65 FVM: log when fvm is used 2022-03-23 13:19:28 -04:00
Aayush 46447ef55c stmgr: call: use a buffered concurrent-access blockstore 2022-03-23 12:30:27 -04:00
Łukasz Magiera dbc6b32a4c Merge pull request #8361 from filecoin-project/gstuart/set-ask-optional-params
--max-piece-size in set-ask is no longer required
2022-03-23 16:08:35 +01:00
Geoff Stuart 5ba4a78657 --max-piece-size in set-ask is no longer required 2022-03-22 22:05:06 -04:00
Jiaying Wang 6861705354 Merge pull request #8360 from filecoin-project/asr/v7-actors-bump
FFI: Bump v7 actors to v7.0.6
2022-03-22 21:14:22 -04:00
Aayush 7d0f5dd4f9 FFI: Bump v7 actors to v7.0.6 2022-03-22 20:44:51 -04:00
Steven Allen 1609317ac8 Merge pull request #8358 from filecoin-project/asr/vm-memstore
feat: stmgr: call: use a buffered concurrent-access blockstore
2022-03-21 21:08:12 -04:00
Aayush 3a121f99c7 stmgr: call: use a buffered concurrent-access blockstore 2022-03-21 19:32:18 -04:00
Łukasz Magiera 56b97e1386 lotus-worker: default non-exclusive flags to false when exclusive flag is set 2022-03-21 19:53:43 +01:00
Aayush Rajasekaran 3a62c8b4a2 Merge pull request #8356 from filecoin-project/fix/wallet-init-type
fix: lotus-wallet: pass correct repo type to repo.Init
2022-03-21 11:59:39 -04:00
Łukasz Magiera 1a0fc75325 Merge pull request #8353 from filecoin-project/fix/ru-retry-loop
fix: sealing: always do cooldown in handleSubmitReplicaUpdateFailed
2022-03-21 16:38:44 +01:00
Łukasz Magiera 945b93590d ping: Match go-ipfs in cmd output 2022-03-21 15:11:19 +01:00
Łukasz Magiera 701d0a111e Merge branch 'feat/net-ping' of github.com:ychiaoli18/lotus into feat/net-ping 2022-03-21 13:06:11 +01:00
Łukasz Magiera 3c1edca902 Merge pull request #8351 from filecoin-project/asr/vm-memstore
fix: avoid racy memstores when estimating gas
2022-03-21 12:12:28 +01:00
Łukasz Magiera 92e4caa151 Merge remote-tracking branch 'origin/master' into feat/post-worker 2022-03-21 12:09:47 +01:00
Łukasz Magiera e767981aaf itests: Fix ccupgrade post test 2022-03-21 12:07:00 +01:00
Łukasz Magiera 0536eb898d itests: Share WaitForSectorActive correctly 2022-03-21 12:07:00 +01:00
Łukasz Magiera 433e9c351d config: Fix doc on PreferNewSectorsForDeals; gofmt 2022-03-21 12:07:00 +01:00
Łukasz Magiera 49a6d7ebcc itests: Breakup ccupgrade_test.go 2022-03-21 12:07:00 +01:00
Łukasz Magiera 4c25358a08 itests: Test Sealing.MakeCCSectorsAvailable 2022-03-21 12:07:00 +01:00
Łukasz Magiera ecd1ab4b42 itests: Test Sealing.PreferNewSectorsForDeals 2022-03-21 12:07:00 +01:00
Łukasz Magiera 97a73f1c29 sealing: More SnapDeals config knobs 2022-03-21 12:04:23 +01:00
Łukasz Magiera d118ef9202 Merge pull request #8355 from filecoin-project/deps/update-libp2p
deps: update go-libp2p to v0.18 release
2022-03-21 12:00:49 +01:00
Łukasz Magiera 3cd17f0ee4 fix: lotus-wallet: pass correct repo type to repo.Init 2022-03-21 12:00:37 +01:00
Łukasz Magiera fc34d9ba1c Merge pull request #8086 from filecoin-project/nonsense/refactor-nodetype
refactor: convert RepoType from int to interface
2022-03-21 11:57:39 +01:00
Łukasz Magiera 1eb101d70e Merge pull request #8354 from filecoin-project/nonsense/extract-unixfs-filestore
lib: extract unixfs filestore into lib
2022-03-21 11:47:14 +01:00
vyzo 7fea2e4d6c update go-libp2p to v0.18 2022-03-21 12:33:07 +02:00
Łukasz Magiera cca69a6c16 gen 2022-03-21 10:49:30 +01:00
Anton Evangelatov 0ed8647b6f extract unixfs filestore into lib 2022-03-21 10:48:52 +01:00
Łukasz Magiera 58843857e5 fix: sealing: always do cooldown in handleSubmitReplicaUpdateFailed 2022-03-21 10:32:03 +01:00
Łukasz Magiera efdcd00da4 Merge pull request #7956 from filecoin-project/nonsense/add-lotus-test-image-building
feat: infra/ci: add `lotus-test` image as CI build step
2022-03-21 10:26:37 +01:00
Anton Evangelatov fee69a889b modify .circleci/template.yml 2022-03-21 08:41:30 +01:00
Aayush 4af8b8ecf3 fix: avoid racy memstores when estimating gas 2022-03-20 16:25:38 -04:00
Łukasz Magiera 9a31b65cd0 feat: miner cli: proving check --faulty, faults in storage list sectors 2022-03-19 12:55:52 +01:00
Łukasz Magiera 5365ccfdb1 cli: Show separate worker types in miner info 2022-03-18 21:31:15 +01:00
Łukasz Magiera 36f1dd7bb3 itests: Fix flaky TestWindowPostWorkerSkipBadSector 2022-03-18 20:51:47 +01:00
Łukasz Magiera 7b81369c8c wdpost: Don't attempt to snark with skipped sectors 2022-03-18 19:45:25 +01:00
Łukasz Magiera 7a1beacd00 ffiwrapper: Test some assumptions about GeneratePoStFallbackSectorChallenges 2022-03-18 13:11:14 +01:00
Łukasz Magiera 32818c528f wdpost: Test repro broken challenge skipping 2022-03-18 12:32:16 +01:00
Anton Evangelatov 0d6493ec3f resolve merge conflicts with master 2022-03-18 12:28:22 +01:00
Łukasz Magiera 8715745feb wdpost: Dedupe skipped sectors in generateWindowPoSt 2022-03-18 12:10:42 +01:00
Łukasz Magiera aa124cf414 fix lint issues 2022-03-18 11:38:27 +01:00
Łukasz Magiera a94e47c6be Merge pull request #8345 from filecoin-project/fix/itest-minepost-hang
fix: itests: Don't hang on exit in MineBlocksMustPost
2022-03-18 11:27:51 +01:00
Łukasz Magiera 6ddbe41376 Merge remote-tracking branch 'origin/master' into feat/post-worker 2022-03-18 10:54:44 +01:00
Łukasz Magiera 42b2adddee fix: itests: Don't hang on exit in MineBlocksMustPost 2022-03-18 10:42:21 +01:00
Jiaying Wang cd499e3ab8 Merge pull request #8342 from filecoin-project/jen/v151rc1prep
chore: release: v1.15.1-rc1
2022-03-17 17:46:30 -04:00
Jiaying Wang 7244ff9e14 Update CHANGELOG.md 2022-03-17 17:42:45 -04:00
Jennifer Wang 3c252e1d87 bump the version to v1.15.1-rc1 2022-03-17 17:42:45 -04:00
Jennifer Wang 84896f4790 update the change log for v1.15.1 2022-03-17 17:42:45 -04:00
Łukasz Magiera d4cbb0803b Merge pull request #8339 from filecoin-project/backport/v1.15.1/smallfixes
backport: #8338, #8337
2022-03-17 19:50:21 +01:00
Łukasz Magiera 18987f92ee Merge pull request #8340 from filecoin-project/arajasek-patch-1
Shed: fix error message
2022-03-17 17:48:02 +01:00
Łukasz Magiera b26405226e Merge pull request #8336 from filecoin-project/fix/snap-list-estimate
fix: miner cli: Estimate deal weight in sector list when upgrading
2022-03-17 17:30:41 +01:00
Aayush Rajasekaran e1c7f30e60 Shed: fix error message 2022-03-17 12:24:32 -04:00
Aayush Rajasekaran ff244fba6c Merge pull request #8332 from filecoin-project/feat/fvm
FVM integration
2022-03-17 12:20:05 -04:00
Łukasz Magiera 49a4c06a88 fix: sealing: FinalizeSector doesn't need sealed replica access 2022-03-17 17:08:25 +01:00
Łukasz Magiera 361dc55dfd fix: storagefsm: Fix error loop on bad event 2022-03-17 17:08:25 +01:00
Łukasz Magiera b366e2c91f Merge pull request #8337 from filecoin-project/fix/fin-sealed-acc
fix: sealing: FinalizeSector doesn't need sealed replica access
2022-03-17 16:58:51 +01:00
Łukasz Magiera eb4bda2302 Merge pull request #8338 from filecoin-project/fix/fsm-badevt-loop
fix: storagefsm: Fix error loop on bad event
2022-03-17 16:58:17 +01:00
Aayush Rajasekaran 2ed2ee1da7 Merge branch 'release/v1.15.1' into feat/fvm 2022-03-17 11:31:56 -04:00
Aayush Rajasekaran 58876aefa3 Update FFI 2022-03-17 11:31:47 -04:00
Aayush 77b123b02f CircSupply: Remove unused method 2022-03-17 11:31:39 -04:00
Łukasz Magiera d9a1ecd387 fix: storagefsm: Fix error loop on bad event 2022-03-17 15:40:11 +01:00
Łukasz Magiera 9debd14b6c fix: sealing: FinalizeSector doesn't need sealed replica access 2022-03-17 15:15:54 +01:00
Łukasz Magiera ff14cd3f9d fix: Estimate deal weight in sector list when upgrading 2022-03-17 14:52:54 +01:00
Łukasz Magiera e0481bbeca Merge pull request #8281 from spark8899/change-worker
feat:  multisig: lotus-sheed miner-multisig change-worker command.
2022-03-17 13:55:30 +01:00
Łukasz Magiera 73ab064137 Merge pull request #8295 from Juneezee/test/t.TempDir
test: use `T.TempDir` to create temporary test directory
2022-03-17 12:30:41 +01:00
Łukasz Magiera 2cf0e4cb32 #8281: Apply suggestions from code review 2022-03-17 12:30:02 +01:00
Łukasz Magiera 7123b29f06 Merge pull request #8241 from rjan90/master
fix: cli: add ArgsUsage field to clientGetDealCmd
2022-03-17 12:19:49 +01:00
Łukasz Magiera 037e80c70c gofmt 2022-03-17 12:10:24 +01:00
Łukasz Magiera 1c055fe83b Merge branch 'master' into test/t.TempDir 2022-03-17 12:06:52 +01:00
Łukasz Magiera 858538284f Merge pull request #8305 from filecoin-project/asr/shed-label
Shed: Add a tool to check UTF-8 validity of labels
2022-03-17 12:05:52 +01:00
Łukasz Magiera 114cb4e0d5 Merge pull request #8333 from filecoin-project/backport/v1.15.1/feat/snap-queue
backport: v1.15.1: feat: sealing: Sector upgrade queue
2022-03-16 22:50:33 +01:00
Łukasz Magiera 4a1b211876 miner cli: Treat Activating sectors like Proving in sectors list 2022-03-16 22:30:59 +01:00
Łukasz Magiera d78f1e4eee sealing: Rename Sealing.creating to a less confusing name 2022-03-16 22:30:58 +01:00
Łukasz Magiera 5e14892ef8 sealing: fix lint issues 2022-03-16 22:30:57 +01:00
Aayush Rajasekaran 97c95a4e82 Update FFI 2022-03-16 17:30:47 -04:00
Łukasz Magiera 9e4c8881b6 sealing: regenerate mocks 2022-03-16 22:30:09 +01:00
Łukasz Magiera b8ba5274e2 sealing: Enforce minimum expiration in tryGetUpgradeSector 2022-03-16 22:30:09 +01:00
Łukasz Magiera aa4adb0dfd sealing: Fix build 2022-03-16 22:30:09 +01:00
Łukasz Magiera 62a393bf12 sealing: Address snap queue review 2022-03-16 22:30:09 +01:00
Łukasz Magiera a440339548 sealing: Run more checks when considering Available sectors 2022-03-16 22:30:07 +01:00
Łukasz Magiera 3c15314ed5 sealing: Use bitfields in sectorActive 2022-03-16 22:29:40 +01:00
Łukasz Magiera d3cec2f0d1 sealing: Add MakeCCSectorsAvailable config 2022-03-16 22:29:40 +01:00
Łukasz Magiera 1158a928ec itests: Test reverting Available sectors to Proving 2022-03-16 22:29:40 +01:00
Łukasz Magiera 1bd2cbbef6 sealing: Support abort uprade for Available sectors 2022-03-16 22:29:40 +01:00
Łukasz Magiera a9d757f3a0 itests: TestTooManyMarkedForUpgrade is not applicable anymore 2022-03-16 22:29:40 +01:00
Łukasz Magiera 9a854e9ab7 feat: sealing: Linter did have a good point 2022-03-16 22:29:40 +01:00
Łukasz Magiera 2cef55a4f6 feat: sealing: Sector upgrade queue 2022-03-16 22:29:37 +01:00
Łukasz Magiera a3bdd29615 Merge pull request #8330 from filecoin-project/feat/snap-queue
feat: sealing: Sector upgrade queue
2022-03-16 22:24:45 +01:00
Łukasz Magiera a431fdbdde miner cli: Treat Activating sectors like Proving in sectors list 2022-03-16 22:16:39 +01:00
Łukasz Magiera 60ba133fc8 sealing: Rename Sealing.creating to a less confusing name 2022-03-16 21:29:57 +01:00
Aayush Rajasekaran 90d78f924f Merge pull request #8293 from filecoin-project/feat/fvm
Filecoin Virtual Machine integration
2022-03-16 15:51:56 -04:00
Łukasz Magiera 3b2a1ea41d sealing: fix lint issues 2022-03-16 20:28:15 +01:00
Łukasz Magiera 2961f3b864 sealing: regenerate mocks 2022-03-16 20:20:07 +01:00
Łukasz Magiera 3f23cf0c1e sealing: Enforce minimum expiration in tryGetUpgradeSector 2022-03-16 20:17:20 +01:00
Łukasz Magiera aac1f5abef sealing: Fix build 2022-03-16 20:09:18 +01:00
Łukasz Magiera 724d80cf02 sealing: Address snap queue review 2022-03-16 20:04:48 +01:00
Łukasz Magiera e7ee5b5932 sealing: Run more checks when considering Available sectors 2022-03-16 19:57:37 +01:00
Łukasz Magiera 4d4739497d sealing: Use bitfields in sectorActive 2022-03-16 19:53:00 +01:00
Łukasz Magiera 4ded059a1c sealing: Add MakeCCSectorsAvailable config 2022-03-16 19:29:47 +01:00
Jiaying Wang 5ea1502b02 Merge pull request #8331 from filecoin-project/backport/v1.15.1/fix/snap-worker-cleanup
backport: v1.15.1: feat: sealing: Sector upgrade queue
2022-03-16 14:20:53 -04:00
Łukasz Magiera 99c6ef564e worker: RemoveCopies expects one type at a time 2022-03-16 19:07:42 +01:00
Łukasz Magiera 39e3ddb0ed storagemgr: MoveStorage in separate steps 2022-03-16 19:07:42 +01:00
Łukasz Magiera defdea7b49 worker: Call RemoveCopies in MoveStorage 2022-03-16 19:07:42 +01:00
Łukasz Magiera d249eb3f93 stores: Support RemoveCopies on remote store 2022-03-16 19:07:42 +01:00
Łukasz Magiera 668c33fdcd stores: http: Support multiple storage IDs in ?keep 2022-03-16 19:07:42 +01:00
Łukasz Magiera 799d3ebe5e itests: Test reverting Available sectors to Proving 2022-03-16 19:05:53 +01:00
Łukasz Magiera 628102ab6c sealing: Support abort uprade for Available sectors 2022-03-16 18:53:54 +01:00
Łukasz Magiera f2c0ba1df5 Merge pull request #8329 from filecoin-project/fix/snap-worker-cleanup
fix: sealing: Remove sector copies from workers after snapdeals
2022-03-16 18:48:21 +01:00
79453663b3 feat: Add additional test annotations (#8272)
* Annotate api,proxy_util,blockstore_badger, policy tests

* Annotate splitstore: bsbadger / markset

* Annotate splitstore feature

* Annotate union/timed blockstore tests

* Annotate openrpc, diff_adt tests

* Annotate error,drand,events tests

* Annotate predicates_test

* Fix annotations

* Annotate tscache, gen tests

* Annotate fundmanager test

* Annotate repub and selection tests

* Annotate statetree_test

* Annotate forks_test

* Annotate searchwait_test.go

* Fix duplicated @@ symbols

* Annotate chain stmgr/store tests

* Annotate more (types) tests

* More tests annotated

* Annotate conformance chaos actor tests

* Annotate more integration tests

* Annotate journal system tests

* Annotate more tests.

* Annotate gas,head buffer behaviors

* Fix markset annotations

* doc: test annotations for the markets dagstore wrapper

* Annotate miner_api test in dagstore

* Annotate more test files

* Remove bad annotations from fsrepo

* Annotate wdpost system

* Remove bad annotations

* Renamce "conformance" to "chaos_actor" tests

* doc: stm annotations for blockheader & election proof tests

* Annotate remaining "A" tests

* annotate: stm for error_test

* memrepo_test.go

* Annotate "b" file tests

* message_test.go

* doc: stm annotate for fsrepo_test

* Annotate "c" file tests

* Annotate "D" test files

* message_test.go

* doc: stm annotate for chain, node/config & client

* docs: stm annotate node_test

* Annotate u,v,wl tests

* doc: stm annotations for various test files

* Annotate "T" test files

* doc: stm annotate for proxy_util_test & policy_test

* doc: stm annotate for various tests

* doc: final few stm annotations

* Add mempool unit tests

* Add two more memPool Add tests

* Update submodules

* Add check function tests

* Add stm annotations, refactor test helper

* Annotate api,proxy_util,blockstore_badger, policy tests

* Annotate splitstore: bsbadger / markset

solving merge conflicts

* Annotate splitstore feature

* Annotate union/timed blockstore tests

* Annotate openrpc, diff_adt tests

* Annotate error,drand,events tests

* Annotate predicates_test

* Fix annotations

* Annotate tscache, gen tests

* Annotate fundmanager test

* Annotate statetree_test

* Annotate forks_test

* Annotate searchwait_test.go

* Fix duplicated @@ symbols

* Annotate chain stmgr/store tests

* Annotate more (types) tests

* More tests annotated

* Annotate conformance chaos actor tests

* Annotate more integration tests

* Annotate journal system tests

* Annotate more tests.

* Annotate gas,head buffer behaviors

solve merge conflict

* Fix markset annotations

* Annotate miner_api test in dagstore

* Annotate more test files

* doc: test annotations for the markets dagstore wrapper

* Annotate wdpost system

* Renamce "conformance" to "chaos_actor" tests

* Annotate remaining "A" tests

* doc: stm annotations for blockheader & election proof tests

* annotate: stm for error_test

* Annotate "b" file tests

* memrepo_test.go

* Annotate "c" file tests

* message_test.go

* Annotate "D" test files

* doc: stm annotate for fsrepo_test

* Annotate u,v,wl tests

* message_test.go

* doc: stm annotate for chain, node/config & client

* docs: stm annotate node_test

* Annotate "T" test files

* doc: stm annotations for various test files

* Add mempool unit tests

solve merge conflict

* doc: stm annotate for proxy_util_test & policy_test

* doc: stm annotate for various tests

* doc: final few stm annotations

* Add two more memPool Add tests

* Update submodules

* Add check function tests

solve conflict

* Add stm annotations, refactor test helper

solve merge conflict

* Change CLI test kinds to "unit"

* Fix double merged test

* Fix ccupgrade_test merge

* Fix lint issues

* Add stm annotation to types_Test

* Test vectors submodule

* Add file annotation to burn_test

Co-authored-by: Nikola Divic <divicnikola@gmail.com>
Co-authored-by: TheMenko <themenkoprojects@gmail.com>
2022-03-16 18:37:34 +01:00
Łukasz Magiera 8600ae2ac4 itests: TestTooManyMarkedForUpgrade is not applicable anymore 2022-03-16 17:48:02 +01:00
Łukasz Magiera 193c84811a feat: sealing: Linter did have a good point 2022-03-16 17:45:22 +01:00
Łukasz Magiera aef2ec513f feat: sealing: Sector upgrade queue 2022-03-16 17:33:05 +01:00
Aayush 37539ccb84 CircSupply: Remove unused method 2022-03-16 11:58:23 -04:00
Aayush 16128a0212 Merge branch 'master' into feat/fvm 2022-03-16 11:57:46 -04:00
KAYUII 159da73fcd Update Dockerfile.lotus
fix docker can't find gpus
2022-03-16 09:19:47 -06:00
Łukasz Magiera 9f6f94bd02 Merge pull request #8215 from filecoin-project/feat/remove-mark-for-upgrade
chore:sealing:remove endpoint from cli
2022-03-16 15:33:21 +01:00
Łukasz Magiera c4259cb594 worker: RemoveCopies expects one type at a time 2022-03-16 12:28:56 +01:00
Łukasz Magiera 5ed5744cb6 storagemgr: MoveStorage in separate steps 2022-03-16 12:28:56 +01:00
Łukasz Magiera a88edeb79d worker: Call RemoveCopies in MoveStorage 2022-03-16 12:28:56 +01:00
Łukasz Magiera 4d65e0101d stores: Support RemoveCopies on remote store 2022-03-16 12:28:56 +01:00
Łukasz Magiera 45b07674e5 stores: http: Support multiple storage IDs in ?keep 2022-03-16 12:28:56 +01:00
Łukasz Magiera 4906962da0 Merge pull request #8322 from filecoin-project/jen/versionbump
chore: build: bump the master version to v1.15.2-dev
2022-03-16 11:34:02 +01:00
Rjan 3ad1ea386c Merge branch 'filecoin-project:master' into master 2022-03-16 09:09:20 +01:00
koalacxr 7f26ce614b modify quantile imports error 2022-03-16 13:10:03 +08:00
Aayush 9ea623e125 Rename the Lotus VM to LegacyVM 2022-03-15 19:40:17 -04:00
Aayush e6117c49ef Address review 2022-03-15 19:34:59 -04:00
Aayush 673f558ba5 Rename vm.VMI to vm.Interface 2022-03-15 19:34:39 -04:00
Jiaying Wang ada499ef14 Merge pull request #8314 from filecoin-project/jen/indexsetting
feat: config: enable indexer providing by default
2022-03-15 19:33:49 -04:00
Jennifer Wang 56b80c41b6 bump the master version to v1.15.2-dev 2022-03-15 19:32:28 -04:00
Jiaying Wang c98ef0aaf8 Merge pull request #8317 from filecoin-project/jen/backport
chore: backport: release to master
2022-03-15 19:12:20 -04:00
Aayush 2170b4deb5 Fixup merge 2022-03-15 18:58:32 -04:00
Łukasz Magiera 913cab2785 Merge pull request #8320 from filecoin-project/fix/listsectors-primary
fix: storage cli: Output primary sector status correctly
2022-03-15 17:41:41 +01:00
Aayush 6c51adc334 Update FFI: fix cargo.lock 2022-03-15 11:07:25 -04:00
Łukasz Magiera c6bda0e5d4 fix: storage cli: Output primary sector status correctly 2022-03-15 14:29:21 +01:00
Łukasz Magiera c3cadcba0e Merge pull request #8318 from filecoin-project/feat/rcmgr-limits-envvar
improve resource manager integration
2022-03-15 12:07:43 +01:00
vyzo 9fcafff847 adjust conns to 2x maxconns for duplicate connections 2022-03-15 10:02:27 +02:00
vyzo 53c525f0ed improve resource manager integration
- add opt-in env var to control instantation, until we are comfortable with testing to enble by default.
- adjust default limits if the connection manager high mark is higher than the default inbound conn limit.
2022-03-15 09:43:18 +02:00
Jennifer Wang 8a2a2d065d Merge branch 'releases' into jen/backport 2022-03-15 02:07:35 -04:00
Jennifer Wang 6240729ee4 enable indexer providing by default 2022-03-14 23:24:52 -04:00
Eng Zer Jun c229842f57 test: use T.TempDir to create temporary test directory
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-03-15 00:21:31 +08:00
Aayush 9a1a89d98c Shed: Add a tool to check UTF-8 validity of labels 2022-03-12 18:11:10 -05:00
Aayush 1bf40ad9df Fix broken go.sum 2022-03-12 14:31:04 -05:00
Aayush 67889b473c Merge branch 'master' into feat/fvm 2022-03-12 11:12:23 -05:00
Aayush 05fa9c81de Rename FVM envvar to LOTUS_USE_FVM_EXPERIMENTAL 2022-03-12 11:03:43 -05:00
Aayush Rajasekaran 6d4fb8866e Merge pull request #8197 from filecoin-project/asr/fvm/nv15
FVM: support nv15
2022-03-11 17:35:20 -05:00
Aayush d2054e8653 FVM: support nv15 2022-03-11 17:03:34 -05:00
Łukasz Magiera 6401363ef1 docsgen 2022-03-11 18:17:29 +01:00
Łukasz Magiera ce99aad438 Fix provingCheckProvableCmd 2022-03-11 18:13:51 +01:00
Łukasz Magiera 135aef78d7 Merge remote-tracking branch 'origin/master' into feat/post-worker 2022-03-11 17:04:58 +01:00
Aayush Rajasekaran 362c73bfbd Merge pull request #8291 from filecoin-project/fix/fsm-input-locking
fix: sealing fsm: Handle inputLk correctly
2022-03-11 10:02:26 -05:00
Łukasz Magiera ad66ad4f7d fix: sealing fsm: Handle inputLk correctly 2022-03-11 13:34:14 +01:00
Łukasz Magiera 9fc6242e5b Merge pull request #8289 from filecoin-project/deps/update-libp2p-things
deps: update go-libp2p and go-libp2p-resource-manager
2022-03-11 10:36:50 +01:00
Jiaying Wang 0ac1bbc7ae Merge pull request #8279 from filecoin-project/release/v1.15.0
build: release: v1.15.0
2022-03-11 00:33:18 -05:00
Jiaying Wang 61a1a172fa Merge pull request #8277 from filecoin-project/jen/v15prep
chore: release: v1.15.0 prep
2022-03-11 00:19:42 -05:00
spark8899 3c96dcaec7 add minerMultisigs ProposeControlSet 2022-03-11 09:37:38 +08:00
Jennifer Wang 98642ec4b5 fix the change log 2022-03-10 17:28:40 -05:00
Łukasz Magiera 81f0cfdd1e Merge pull request #8276 from filecoin-project/feat/faster-clientcalccommp
feat: api: Make ClientCalcCommP multithreaded
2022-03-10 23:22:48 +01:00
Łukasz Magiera b248097b42 Merge pull request #8283 from filecoin-project/feat/loglvl-config
feat: config: Persistent subsystem log level config
2022-03-10 23:22:26 +01:00
Łukasz Magiera 9ce6a15edc Merge pull request #8265 from filecoin-project/feat/shed-car-tools
feat: shed: blockstore/vlog to car export cmds
2022-03-10 23:21:47 +01:00
Łukasz Magiera 55189fbe53 Merge pull request #8287 from filecoin-project/fix/dont-log-binary-cids
fix: piece provider: Don't log CIDs as binary
2022-03-10 22:44:59 +01:00
Łukasz Magiera 0d9e34d651 client impl: Fix typo in ClientCalcCommP CopyBuffer error 2022-03-10 22:41:45 +01:00
Łukasz Magiera e1ac3f641b Merge pull request #8290 from filecoin-project/feat/itestd
feat: shed: ItestD
2022-03-10 20:00:37 +01:00
Łukasz Magiera 231893a794 feat: shed: ItestD 2022-03-10 19:39:10 +01:00
vyzo 65e599fb8e update go-libp2p and go-libp2p-resource-manager
- go-libp2p at v0.18.0-rc6, which includes fixes for some severe bugs in mplex
- go-libp2p-resource-manager at v0.1.5, which improves debug logging
2022-03-10 18:20:11 +02:00
Łukasz Magiera 4421bf2fa1 feat: config: Persistent subsystem log level config 2022-03-10 14:44:56 +01:00
Łukasz Magiera 91ccb7fbda fix: piece provider: Don't log CIDs as binary 2022-03-10 14:28:18 +01:00
Łukasz Magiera 9c4f8254ee post workers: Fix build post-merge 2022-03-10 14:20:07 +01:00
Łukasz Magiera 326a9b673e Merge pull request #8273 from filecoin-project/feat/graphsync-20-protocol-update
feat(deps): update to graphsync v0.13.0 with 2.0 protocol
2022-03-10 11:11:20 +01:00
spark8899 b6278d2a6c add miner-multisig change-worker command. 2022-03-10 14:11:30 +08:00
Jennifer Wang 1daaba9224 bump the version to v1.15.0 2022-03-09 18:32:02 -05:00
Jennifer Wang 3ecc58d036 update v1.15.0 changelog 2022-03-09 18:28:30 -05:00
Łukasz Magiera a715fb3063 feat: Make ClientCalcCommP multithreaded 2022-03-09 23:25:29 +01:00
hannahhoward 49742f8fdc feat(deps): update to graphsync v0.13.0 with 2.0 protocol 2022-03-09 18:06:35 +00:00
Łukasz Magiera 046a9f8af0 Merge remote-tracking branch 'origin/master' into feat/post-worker 2022-03-09 16:27:03 +01:00
Łukasz Magiera ffabb015ef shed: fix lint 2022-03-09 10:26:02 +01:00
Łukasz Magiera 84dbb229b6 shed: blockstore/vlog to car export cmds 2022-03-09 10:21:36 +01:00
zenground0 c192637741 Fix warmup 2022-03-08 21:01:57 -07:00
zenground0 61f453fcd3 Print sector key in state sector command 2022-03-08 21:01:57 -07:00
Anton Evangelatov 7cdf6dc680 remove .Type() now that we have singletons for repos 2022-03-07 13:00:26 +01:00
Anton Evangelatov b9fe61f9da Merge branch 'master' into nonsense/refactor-nodetype 2022-03-07 11:51:28 +01:00
Jiaying Wang 4525395cc5 Merge pull request #8245 from filecoin-project/jen/v15backport
chore: backport: release
2022-03-04 15:44:08 -05:00
Jennifer Wang 9b838f515b Merge branch 'releases' into jen/v15backport 2022-03-04 13:58:56 -05:00
Jiaying Wang 5b33555fda Merge pull request #8243 from filecoin-project/release/v1.14.4
chore: build: v1.14.4
2022-03-03 21:28:31 -05:00
Jiaying Wang 8d737a1428 Merge pull request #8242 from filecoin-project/jen/v144prep
build: release: v1.14.4
2022-03-03 21:03:36 -05:00
Jennifer Wang e51b10e6a5 release v1.14.4 2022-03-03 20:52:03 -05:00
zenground0 93e22da539 Log instead of error normal shutdown of state machine 2022-03-03 18:17:09 -05:00
zenground0 8ec7da0dee Handle finalize failures in fsm 2022-03-03 18:17:01 -05:00
Łukasz Magiera 5416ce5443 Merge pull request #7313 from filecoin-project/feat/cid-to-piece-idx
feat: markets: Integrate index ingest protocol and retrieve by any CID
2022-03-03 16:50:35 +00:00
Masih H. Derkani 4c8015c0a1 Update deps in lotus-soup mod and remove replace directive
Update dependency to go-fil-markets in `lotus-soup` module and remove
the redundant replace directive.
2022-03-03 16:05:50 +00:00
Anton Evangelatov 5734a39e8e move DealmakingConfiger and SealingConfiger away from config/types.go 2022-03-03 16:51:47 +01:00
Anton Evangelatov 62e352ef88 move APIInfoEnvVars, RepoFlags, APIFlags under RepoType 2022-03-03 16:45:11 +01:00
Anton Evangelatov e1c2cf446e add lotus-test image as CI build step 2022-03-03 15:50:23 +01:00
Rjan c5dc898ed0 fix: cli: add ArgsUsage field to clientGetDealCmd
Adds [proposalCID] as ArgsUsage field in the 'lotus client get-deal' command. Fixes #8133
2022-03-03 15:40:16 +01:00
Anton Evangelatov acbfc879aa config: extract DealmakingConfig and Sealing config from Lotus for Boost (#8172)
* refactor sealingCfg and dealmakingCfg to be able to abstract Config

* fix error messages
2022-03-03 15:37:23 +01:00
Anton Evangelatov 066d0edf51 add SupportsStagingDeals trait 2022-03-03 15:37:23 +01:00
Anton Evangelatov 949ec65118 drop defConfForType 2022-03-03 15:37:23 +01:00
Anton Evangelatov f1f878a000 unexport repo types; use a global var for every repo type 2022-03-03 15:37:23 +01:00
Anton Evangelatov e3edab66e3 refactor RepoType 2022-03-03 15:37:23 +01:00
Łukasz Magiera 28d751b2e0 mod tidy 2022-03-03 14:21:28 +00:00
Łukasz Magiera 7dcfeee0ea use old go-path 2022-03-03 14:17:25 +00:00
Masih H. Derkani 1bb65189af Upgrade to go-path v0.2.1 and remove replace directive
The dependency was used in the chain API. Integrated the new fetcher
factory.
2022-03-03 13:29:32 +00:00
Łukasz Magiera 6b06c1b5d3 Merge pull request #8232 from filecoin-project/fix/not-so-normal-shutdown-of-state-machine
fix:sealing:Log instead of error normal shutdown of state machine
2022-03-03 13:28:57 +00:00
Masih H. Derkani 8cf6f24f4d Upgrade go-fil-markets to include index provider metadata changes
Upgrade to the latest `go-fil-markets` that integrates concrete
multicodec for the indexing metadata.
2022-03-03 12:57:09 +00:00
Aayush Rajasekaran b7e1548041 Merge pull request #8236 from filecoin-project/asr/backport
Lotus release v1.15.0-rc3
2022-03-02 17:06:56 -05:00
Aayush 2e1bb7e8cc Lotus release v1.15.0-rc3 2022-03-02 16:55:33 -05:00
Aayush Rajasekaran 1c21690dfe Merge pull request #8235 from filecoin-project/asr/backport
Handle finalize failures in fsm
2022-03-02 16:50:03 -05:00
zenground0 7073f31f84 Handle finalize failures in fsm 2022-03-02 16:48:24 -05:00
Aayush Rajasekaran 5ac1c59527 Merge pull request #8234 from filecoin-project/asr/backport
pay for the collateral difference needed if the miner available balance is insufficient
2022-03-02 16:47:48 -05:00
Jiaying Wang c9799e1369 pay for the collateral difference needed if the miner available balance is insufficient 2022-03-02 16:44:27 -05:00
Aayush Rajasekaran 91d773451b Merge pull request #8233 from filecoin-project/asr/libp2p-downgrade
Downgrade libp2p to 0.17.0
2022-03-02 16:42:17 -05:00
Aayush ebe1ca7c77 make gen 2022-03-02 15:48:07 -05:00
Aayush 1bc1cd3366 Upgrade to go-fil-markets 1.19.2 2022-03-02 15:41:53 -05:00
Aayush 898f523162 Upgrade to go-data-transfer 1.14.1 2022-03-02 15:41:41 -05:00
Aayush 08bbfed825 Revert "go mod: go-libp2p@v0.18.0-rc1"
This reverts commit 2fb5837a55.
2022-03-02 15:39:24 -05:00
Aayush 04f2d3543b Revert "go mod: go-libp2p-resource-manager"
This reverts commit c394fbdfc3.
2022-03-02 15:39:23 -05:00
Aayush 85886287b4 Revert "use the libp2p connmgr"
This reverts commit 826cdb2186.
2022-03-02 15:39:23 -05:00
Aayush b5912d1543 Revert "instantiate resource manager in DI"
This reverts commit 8d3f98fe38.
2022-03-02 15:39:22 -05:00
Aayush e9e28f75e2 Revert "add resource manager NetStat api"
This reverts commit d05d5bcb70.
2022-03-02 15:39:22 -05:00
Aayush b8747e3afc Revert "add resource manager Net(Set)Limit api"
This reverts commit 554848fe6b.
2022-03-02 15:39:21 -05:00
Aayush bac17061d4 Revert "add examples to docgen"
This reverts commit 39bf59d372.
2022-03-02 15:39:21 -05:00
Aayush 99e1b9e2aa Revert "add net stat and limit cli"
This reverts commit 0de1566eaf.
2022-03-02 15:39:20 -05:00
Aayush 11fc068cfe Revert "go mod: go-libp2p-resource-manager@v0.1.1"
This reverts commit 62c0f35b5a.
2022-03-02 15:39:19 -05:00
Aayush f9f6f35b93 Revert "go mod: update go-libp2p-pubsub"
This reverts commit aa599bfaf9.
2022-03-02 15:39:19 -05:00
Aayush f281027a1c Revert "fix mocknet.New invocation"
This reverts commit c3fb68545a.
2022-03-02 15:39:19 -05:00
Aayush e49d499bb5 Revert "fix mocknet.New invocation"
This reverts commit 0870f48b5c.
2022-03-02 15:39:18 -05:00
Aayush 581cb34b11 Revert "go mod: update go-yamux@v3.0.2"
This reverts commit 83427c478f.
2022-03-02 15:39:18 -05:00
Aayush 4968babb32 Revert "go mod: update go-libp2p-resource-manager@v0.1.2"
This reverts commit 6260271b78.
2022-03-02 15:39:17 -05:00
Aayush ce040b7d33 Revert "add description for net stat and limit commands"
This reverts commit 19c8ea3288.
2022-03-02 15:39:17 -05:00
Aayush a7e02f7207 Revert "update go-fil-markets@v0.19.0-rc1"
This reverts commit 2e5474e864.
2022-03-02 15:39:16 -05:00
Aayush bf0470ad09 Revert "fix issues with fil-markets/data-transfer updates"
This reverts commit ca4ee1e8cf.
2022-03-02 15:39:15 -05:00
Aayush 7dbf0ced82 Revert "make gen and friends"
This reverts commit b360c9403f.
2022-03-02 15:39:14 -05:00
Aayush 48e28898a6 Revert "fix lint"
This reverts commit 325a4c0e5b.
2022-03-02 15:29:27 -05:00
Aayush 17ac583508 Revert "close the rcmgr on shutdown"
This reverts commit 73ec10a49e.
2022-03-02 15:29:26 -05:00
Aayush 6dc696b745 Revert "feat: update to go-fil-markets v1.19.0"
This reverts commit 8a47a71772.
2022-03-02 15:29:25 -05:00
Aayush 2aab4d4f05 Revert "update go-libp2p to v0.18.0-rc2"
This reverts commit 6e5f521463.
2022-03-02 15:22:06 -05:00
Aayush 94678bacea Revert "update go-libp2p to v0.18.0-rc3"
This reverts commit e78c4ab9b3.
2022-03-02 15:21:31 -05:00
Aayush 7207740af4 Revert "update libp2p to v0.18.0-rc4"
This reverts commit 80e9f76261.
2022-03-02 15:21:10 -05:00
Aayush 5329f18938 Revert "update go-libp2p to v0.18.0-rc5"
This reverts commit a575947294.
2022-03-02 15:20:18 -05:00
zenground0 b81d189ec1 Log instead of error normal shutdown of state machine 2022-03-02 13:03:03 -07:00
Łukasz Magiera a52b4b72e9 gomod: Use latest cbor-gen 2022-03-02 20:23:47 +01:00
ZenGround0 14b76743c6 Merge pull request #8229 from filecoin-project/fix/handle-finalize-ru-failure
fix:sealing:Handle finalize replica update failures in fsm
2022-03-02 10:40:18 -07:00
zenground0 874124c4e7 Handle finalize failures in fsm 2022-03-02 09:33:33 -07:00
Aayush 0a67b6e222 Merge branch 'master' into feat/fvm 2022-03-02 11:24:48 -05:00
Łukasz Magiera 6d464c478e Merge pull request #8160 from filecoin-project/fix/addpiece-idempotent
feat: Make add piece idempotent
2022-03-02 15:10:16 +00:00
Masih H. Derkani eb83001bbc Fix wrong ffi commit 2022-03-02 15:07:05 +00:00
Masih H. Derkani aacc246ba3 Merge branch 'master' into feat/cid-to-piece-idx 2022-03-02 14:06:30 +00:00
Masih H. Derkani 444a2bf355 Integrate the latest index-provider with config to disable announcements
Integrate the latest `index-provider` and reflect the changes to engine
configuration. Note that this commit disables announcements of indices
on the network by default as requested for initial merge to master.

Introduce dedicated index provider configuration parameters with
documentation and defaults that match the defaults in index-provider.

Re-generate code as needed.
2022-03-02 13:45:09 +00:00
Łukasz Magiera b8473aeedd Merge pull request #7883 from filecoin-project/feat/paych-avail-reuse
feat: paychmgr: Support paych funding (a.k.a. fast paid retrieval)
2022-03-02 13:28:12 +00:00
Łukasz Magiera 91ae72d47a Merge pull request #7819 from filecoin-project/digitalocean-use-snap
feat: ci: packer snap
2022-03-02 13:17:48 +00:00
Łukasz Magiera 74e6260fbd Merge pull request #7560 from EmadMF/emad22552-patch-1
add check manual-stateless-deal with interactive deal making
2022-03-02 13:16:14 +00:00
Łukasz Magiera a6892f956e Merge pull request #7844 from llifezou/add_workerName_in_sealing_err
feat: #6147: Include worker name in sealing errors
2022-03-02 13:13:34 +00:00
Łukasz Magiera c018dac13a Merge pull request #8079 from filecoin-project/cli_wallet_tests
test: cli: adding wallet tests
2022-03-02 12:59:09 +00:00
Łukasz Magiera e9a6f5f287 Merge remote-tracking branch 'origin/master' into feat/paych-avail-reuse 2022-03-02 12:56:56 +00:00
Łukasz Magiera a74c466b50 Merge pull request #7943 from filecoin-project/fix/restore-appimage
ci: appimage: re-install appimage CI
2022-03-02 12:54:14 +00:00
Łukasz Magiera 97cda51fcf Merge pull request #8219 from filecoin-project/jennijuju-patch-2
fix: sealing: PRU insufficient collateral
2022-03-02 12:24:34 +00:00
Masih H. Derkani 963caf2e9d Fix gen-check 2022-03-02 11:40:02 +00:00
Masih H. Derkani 769b0f30ef Address review comments
- Add comment to clarify the reason for loop in testkit
- Trim common prefix in state printed in CLI commands for better
  readability
- Upgrade to a tagged release of `go-fil-markets` that includes indexing
  work; see: https://github.com/filecoin-project/go-fil-markets/pull/673
- Fix typo in CLI usage.
- Add comments to note that it is safe to use fx `OnStart` context when
  starting the provider engine.
- Fix string concatenation in error message formatting.
2022-03-02 11:04:50 +00:00
Jiaying Wang e0922a7dd2 pay for the collateral difference needed if the miner available balance is insufficient 2022-03-01 21:56:12 -05:00
Aayush Rajasekaran 9c22065459 Merge pull request #8072 from filecoin-project/bloxico/syncer-tests
test: chain: unit tests for the syncer & sync manager
2022-03-01 19:32:42 -05:00
ZenGround0 8091e7086e Merge pull request #8202 from filecoin-project/arajasek-patch-1
fix: shed: diff command
2022-03-01 11:54:26 -07:00
ZenGround0 00e52296ce Merge pull request #8207 from rjan90/patch-4
Make `--lite` option visible in the lotus daemon help text
2022-03-01 11:51:38 -07:00
zenground0 59ef2fe1b8 Remove unused fields from sealing 2022-03-01 11:46:36 -07:00
Łukasz Magiera 714ce54135 Merge pull request #8213 from filecoin-project/fix/overlog-manager-ru
fix:sealing:Less verbose sector manager logging
2022-03-01 18:34:10 +00:00
zenground0 a463c90057 remove endpoint from cli 2022-03-01 11:27:03 -07:00
zenground0 f138ae8882 Less verbose sector manager logging 2022-03-01 10:52:09 -07:00
Aayush Rajasekaran bc5be0c30e Merge pull request #8211 from filecoin-project/asr/rc2
Lotus release v1.15.0-rc2
2022-03-01 09:49:34 -05:00
Aayush 30ae1dd8e8 Lotus release v1.15.0-rc2 2022-03-01 09:48:19 -05:00
Aayush dd91857bf6 Merge branch 'master' into feat/fvm 2022-02-28 22:17:20 -05:00
TheMenko 4a5b0b87ea add assert to output for wallet sign 2022-03-01 02:34:52 +01:00
TheMenko 0708268c75 add assert to output for wallet list 2022-03-01 02:21:22 +01:00
zenground0 77a954c7c3 Merge branch 'master' into feat/cid-to-piece-idx 2022-02-28 12:57:11 -07:00
zenground0 992a01617a Merge branch 'releases' into release/v1.15.0 2022-02-28 12:18:55 -07:00
Rjan c9e2c1b1d7 Make --lite 2022-02-28 17:14:05 +01:00
Rjan 686ada0582 Make --lite option visibile in the cli 2022-02-28 15:19:53 +01:00
Łukasz Magiera 6291c0c581 Merge pull request #8205 from s1mple1122/master
avoid panic
2022-02-28 13:31:33 +00:00
Łukasz Magiera f9900ba426 Merge pull request #8204 from bhaskarvilles/patch-2
A package is vulnerable to Exposure of Sensitive Information
2022-02-28 13:31:25 +00:00
Jerry 8f95cd4149 release worker tracker lock when call cb func 2022-02-28 16:55:04 +08:00
duzy555666 296ae4305f avoid panic 2022-02-28 16:51:15 +08:00
Bhaskara Ram 8a9ea66bdf node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor
upgrade to node-fetch npm package
2022-02-28 12:40:43 +05:30
Aayush Rajasekaran 92c07f877b fix: shed: diff command 2022-02-27 20:03:45 -05:00
Aayush Rajasekaran 6d0066eafa Merge pull request #8194 from filecoin-project/jen/actor
dep: actor: get v7
2022-02-27 19:25:35 -05:00
Łukasz Magiera a49ec594ca Merge pull request #8080 from filecoin-project/bloxico/cli-sync-tests
test: cli: unit tests for sync related commands
2022-02-27 11:54:03 +00:00
Łukasz Magiera 40ed266617 Merge pull request #8192 from filecoin-project/jen/releasesbacktomaster
chore: build: backport releases
2022-02-26 19:37:59 +00:00
Jiaying Wang b8eb4ddb0b Merge pull request #8193 from filecoin-project/jen/v15
chore: build: backport releases
2022-02-25 21:13:42 -05:00
Jiaying Wang d495c3cc16 Merge pull request #8190 from filecoin-project/jen/flagfix
fix: sealing: add flag usage
2022-02-25 21:13:18 -05:00
Jiaying Wang a92981c967 Merge pull request #8171 from filecoin-project/asr/libp2p-update
update go-libp2p to v0.18.0-rc5
2022-02-25 21:13:01 -05:00
jennijuju 254f821564 get actor v7 (same commit as v7-rc1) 2022-02-25 21:03:46 -05:00
jennijuju c6361b391c Merge branch 'releases' into jen/v15 2022-02-25 21:01:31 -05:00
Jiaying Wang 6347daf847 Merge pull request #8189 from filecoin-project/jen/reallydoitflag
fix: sealing: add flag usage
2022-02-25 20:55:11 -05:00
jennijuju f21ddf0c50 Merge branch 'releases' into jen/releasesbacktomaster 2022-02-25 20:54:11 -05:00
jennijuju 865c7e587c make gen 2022-02-25 17:34:14 -05:00
Łukasz Magiera 949a046432 Merge pull request #7928 from filecoin-project/bloxico/basic_wallet_tests
misc: wallet: wallet tests with annotations for system test matrix
2022-02-25 19:29:50 +00:00
Łukasz Magiera 69470db596 Merge pull request #8162 from filecoin-project/cli-mempool-tests
test: Cli: add mempool tests
2022-02-25 16:09:32 +00:00
jennijuju 52756128da add flag usage 2022-02-25 10:49:18 -05:00
jennijuju 433f9f8a13 make gen 2022-02-25 10:48:08 -05:00
jennijuju 79562a7175 add flag usage 2022-02-25 10:28:47 -05:00
llifezouandŁukasz Magiera dac5518005 Update extern/sector-storage/worker_local.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2022-02-25 11:12:18 +08:00
Aayush Rajasekaran 64b13afee5 Merge pull request #8163 from filecoin-project/steb/fix-inclusion-price-at-upgrade
Fix the epoch used for gas in the message pool & validation
2022-02-24 18:06:08 -05:00
Jiaying Wang d054340f13 Merge pull request #8181 from filecoin-project/fix/really-do-it-for-abort
fix:sealing:really-do-it flag for abort upgrade
2022-02-24 17:50:12 -05:00
zenground0 77bf46d018 Tiny clean up 2022-02-24 15:46:15 -07:00
zenground0 367146f032 add rdi flag for abort upgrade 2022-02-24 15:20:21 -07:00
Aayush Rajasekaran 755ce8cb91 Merge pull request #8174 from filecoin-project/asr/consistent-vm
Use either Lotus VM or FVM consistently
2022-02-24 16:19:29 -05:00
Aayush Rajasekaran b8cd154516 Merge pull request #8175 from filecoin-project/gstuart/remove-verified-data-cap-cli
Feat: cli: Remove verified data cap
2022-02-24 13:33:47 -05:00
ZenGround0 d711775cdf Merge pull request #8177 from filecoin-project/fix/fault-tracker-snap-deals
fix:proving:post check sector handles snap deals replica faults
2022-02-24 11:30:10 -07:00
Geoff StuartandAayush Rajasekaran e0382c546d Update cmd/lotus-shed/verifreg.go
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2022-02-24 13:07:10 -05:00
Geoff Stuart 4293023731 Updated cli docs 2022-02-24 12:43:02 -05:00
Geoff Stuart 83bf0c5a11 Review fixes 2022-02-24 12:40:13 -05:00
Aayush 2ba34add2a stmgr: call needs to flush VM before fetching nonce 2022-02-24 12:19:59 -05:00
Aayush d58babe32c fix: set FilVested when constructing VmOpts 2022-02-24 12:04:05 -05:00
Aayush b6682f4bbe feat: use either lotus vm or fvm consistently 2022-02-24 12:04:05 -05:00
Aayush 9bb936b75c chore: refactor: rename NewVM to NewLotusVM 2022-02-24 12:04:05 -05:00
Aayush Rajasekaran c940727cb4 Merge pull request #8179 from filecoin-project/asr/comm-p-fix
fix: client: calculate commps for pieces bigger than 32GB
2022-02-24 11:56:12 -05:00
Aayush fd8cb44e67 fix: client: calculate commps for pieces bigger than 32GB 2022-02-24 10:27:37 -05:00
Łukasz Magiera 7c2f653323 Merge pull request #8168 from filecoin-project/feat/ufs-selectors
feat: market utils: Support unixfsnode in TraverseDag
2022-02-23 22:35:24 +01:00
Steven Allen 420c5fb568 fvm: time message execution 2022-02-23 19:23:20 +00:00
Steven Allen aad376296e fvm: set gas costs to nil for implicit messages
This is what the lotus VM does.
2022-02-23 19:22:47 +00:00
Geoff StuartandAayush Rajasekaran ef68fdb261 Update cmd/lotus-shed/verifreg.go
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2022-02-23 12:16:42 -05:00
Geoff StuartandAayush Rajasekaran 25912e72a1 Update cli/filplus.go
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2022-02-23 12:14:26 -05:00
Geoff Stuart 22760f0922 Handle pre-v7 case more gracefully 2022-02-23 12:02:26 -05:00
zenground0 abe04c33c1 Fix fault tracker to handle snap deals 2022-02-23 09:56:47 -07:00
ZenGround0 ba65d1e1e3 Merge pull request #8173 from xgswust/lotus-bench-fix
[Describe]: when excute cmd "lotus-bench sealing" without "benchmark-…
2022-02-23 09:07:57 -07:00
TheMenko 5ece3d4c10 Merge branch 'master' into bloxico/basic_wallet_tests
merge master to update the branch
2022-02-23 15:48:53 +01:00
Masih H. Derkani b802ddb848 Upgrade dependency to markets 2022-02-23 14:41:55 +00:00
Masih H. Derkani c3b406c5c2 Update indexing and markets dependencies
Update indexing dependencies to latest along with go-fil-markets
dependency, to the head of:
- https://github.com/filecoin-project/go-fil-markets/pull/673
2022-02-23 14:10:38 +00:00
Geoff Stuart e9715cae3b Small fixes 2022-02-22 22:58:51 -05:00
Geoff Stuart 5a5d1bf9aa Updated cli docs 2022-02-22 22:07:20 -05:00
Geoff Stuart 23147378a3 Added cli command for vrk to send RemoveVerifiedClientDataCap message 2022-02-22 22:07:20 -05:00
Geoff Stuart 375d9fdfc9 Added cli command for verifier to sing RemoveDataCapProposal 2022-02-22 22:07:20 -05:00
eben.xie e2cbad6ff4 [Describe]: when excute cmd "lotus-bench sealing" without "benchmark-existing-sectorbuilder", panic will occur
[BugFix]:

[FeatureAdd]:

[CodeReview]:

[ModifyDesc]:

[Author]:

[BugID]:
2022-02-23 10:49:53 +08:00
Darko Brdareski a54d2fd19d Update cli docs 2022-02-22 17:08:04 +01:00
vyzo a575947294 update go-libp2p to v0.18.0-rc5 2022-02-22 11:04:21 -05:00
Darko Brdareski 79ba74ce71 Merge branch 'master' into cli-mempool-tests 2022-02-22 16:27:38 +01:00
Darko Brdareski 0a03ec569a Merge branch 'master' into bloxico/syncer-tests 2022-02-22 16:17:04 +01:00
TheMenko cd64eba76c add stm annotations 2022-02-22 16:00:01 +01:00
TheMenko de68f1e5fe Merge branch 'master' into cli_wallet_tests
update branch from master
2022-02-22 15:37:09 +01:00
TheMenko fce9ff237a add fmt output checks 2022-02-22 15:35:46 +01:00
Darko Brdareski 10c939bc36 Remove leftover logging from sync_manager_test 2022-02-22 14:54:56 +01:00
Darko Brdareski e753e7a66e Merge branch 'master' into bloxico/cli-sync-tests 2022-02-22 14:03:44 +01:00
Łukasz Magiera 5d416de32e Merge pull request #8169 from filecoin-project/deps/update-libp2p
deps: update go-libp2p to v0.18.0-rc5
2022-02-22 11:47:42 +01:00
Aarsh Shah f0f2b3e1f4 changes as per review 2022-02-22 14:22:51 +04:00
vyzo 012cf96d60 update go-libp2p to v0.18.0-rc5 2022-02-22 12:19:26 +02:00
Łukasz Magiera a0cb6094c6 Merge remote-tracking branch 'origin/master' into feat/paych-avail-reuse 2022-02-22 10:55:03 +01:00
Łukasz Magiera a05a462c8c market utils: Support unixfsnode in TraverseDag 2022-02-22 10:51:57 +01:00
Aarsh Shah 8e62fec1d3 address review 2022-02-22 13:48:39 +04:00
ZenGround0 6123aa2ed4 Merge pull request #8048 from filecoin-project/cli-chain-tests
test: cli: chain category unit tests
2022-02-21 19:12:18 -07:00
Steven Allen 1234fcfd4f fix: mempool: check messages against the next block's height
Previously, we checked message gas/validity with the previous block's
height. This doesn't affect consensus, but will help us avoid adding
messages to the message pool that shouldn't be there.
2022-02-21 18:13:07 +00:00
Steven Allen 04bc4405c7 fix: chain: check against the inclusion price at the correct height
We need to use the height at which the messages will be executed, not
the height of the previous tipset. This brings the gas checking for
validation with the gas we actually _charge_ during message execution.

This only matters for the Calico upgrade (the only upgrade where we
changed the gas prices).

This change could potentially cause a block at that height to be
rejected if it includes a message with insufficient gas for inclusion.
However, that _should_ have shown up as a miner penalty when we executed
the blocks in the following tipset. Given that there were no miner
penalties at 265199-265201, this change should be "safe".
2022-02-21 18:12:51 +00:00
Darko Brdareski 7b203eae1b More lint issues fixed 2022-02-21 18:35:31 +01:00
Darko Brdareski 76157c5e03 Merge branch 'master' into cli-mempool-tests 2022-02-21 18:08:15 +01:00
Darko Brdareski ad4acf3baa Fix lint issues 2022-02-21 17:58:00 +01:00
Darko Brdareski 580fa86ea3 Change annotation to #cli 2022-02-21 17:57:01 +01:00
Darko Brdareski 675012fe1c Fix matching for TestInspectUsage 2022-02-21 16:49:07 +01:00
Aarsh Shah 56926b349a changes as per review 2022-02-21 18:27:51 +04:00
Darko Brdareski 87c63e2cb7 Add stm file annotation 2022-02-21 12:33:07 +01:00
Darko Brdareski c8cd8bb591 Add stm annotations 2022-02-21 12:32:53 +01:00
Darko Brdareski c3817652dc Add cli tests for mempool 2022-02-21 11:28:45 +01:00
Aarsh Shah 3fd83e9345 dagstore size bloating fix 2022-02-21 13:57:29 +04:00
Aarsh Shah c2522e8ca9 idempotent add piece 2022-02-21 13:51:43 +04:00
Aarsh Shah 1245871004 guard with ctx 2022-02-21 11:56:49 +04:00
Aarsh Shah 26707a5e03 make add piece idempotent 2022-02-21 11:51:25 +04:00
Łukasz Magiera 214c32d2ef Merge pull request #8131 from FlorianRuen/master
fix:cli:Continue instead of return error if no valid value is filled
2022-02-21 00:43:25 +01:00
Łukasz Magiera 051ff5d205 Merge pull request #8149 from filecoin-project/fix/reify-limit
fix: limit reification sizes
2022-02-21 00:09:06 +01:00
Łukasz Magiera 31ad8e647a Merge pull request #8104 from ychiaoli18/feat/gateway-msig-get-vesting-schedule
feat: gateway: add MsigGetVestingSchedule to gateway api
2022-02-21 00:06:18 +01:00
Łukasz Magiera 7351939053 Merge pull request #8157 from elijaharita/feat/ensemble-mocknet-getter
feat: itests: add itests ensemble mocknet getter
2022-02-21 00:04:20 +01:00
Peter Rabbitson 2d1ebee139 Merge pull request #8159 from filecoin-project/chore/retract_1_14_0
Retract force-pushed v1.14.0 to work around stale gomod caches
2022-02-19 23:59:59 +01:00
Peter Rabbitson 9bb9bb5682 Retract force-pushed v1.14.0 to work around stale gomod caches 2022-02-19 16:25:18 +01:00
Cory Schwartz cdd2d5cc6a update template 2022-02-18 15:37:53 -08:00
Cory Schwartz 6ec82b7446 Merge branch 'master' into digitalocean-use-snap 2022-02-18 15:26:13 -08:00
Elijah Seed-Arita e2a93a3feb add itests ensemble mocknet getter 2022-02-18 11:09:56 -10:00
Aayush Rajasekaran 942922960e Merge pull request #8156 from filecoin-project/asr/releases-master
chore: Merge releases into master
2022-02-18 13:57:47 -05:00
Aayush 9ba7bcea23 Merge branch 'releases' into release/v1.15.0 2022-02-18 13:57:07 -05:00
Aayush d35216434f Merge branch 'releases' into asr/releases-master 2022-02-18 13:45:08 -05:00
Aayush 6e1d5c5733 Merge branch 'master' into feat/fvm 2022-02-18 13:33:06 -05:00
Aayush Rajasekaran 562c59b6c1 Merge pull request #8101 from filecoin-project/asr/fault
Fvm: impl VerifyConsensusFault
2022-02-18 13:27:25 -05:00
Aayush 5be125ad1a address review feedback 2022-02-18 13:21:17 -05:00
Aayush 393479ea69 Fvm: impl VerifyConsensusFault 2022-02-18 13:21:01 -05:00
florian@eyesr.fr 623272aa96 Merge branch 'master' of https://github.com/FlorianRuen/lotus 2022-02-18 15:51:19 +00:00
florian@eyesr.fr 1c39730531 Fix #8095
Clear the list of miner addresses and successfull get-asked before asking for new ones
Previous behavior : if get-ask failed for miner(s), the faulty miner will be retried each time,
so you have to stop the command and start again to change this faulty miner (instead of removing from the list on the new attempt)
2022-02-18 15:46:40 +00:00
vyzo a7b1d86533 make cidset (in memory) visitors smarter; no need to ever visit unitary objects 2022-02-18 12:35:42 +02:00
vyzo 2795995989 add reification limit test 2022-02-18 12:19:19 +02:00
vyzo cbd23c2b1b add reification limit 2022-02-18 12:19:09 +02:00
Aarsh Shah e3f5b7c59f update dagstore top level index db 2022-02-18 14:00:01 +04:00
Aayush Rajasekaran cf7a0415c1 Merge pull request #8130 from filecoin-project/feat/lm-snap-clis
feat: Snapdeals support in `storage find` CLI
2022-02-17 14:49:08 -05:00
Aayush Rajasekaran bf36363109 Merge pull request #8136 from filecoin-project/asr/backport
sealer: fix error message
2022-02-17 14:31:43 -05:00
Aayush 3399f72113 sealer: fix error message 2022-02-17 14:24:32 -05:00
Aayush Rajasekaran 8c0b4a5132 Merge pull request #8135 from filecoin-project/asr/backport
typo in  variable name
2022-02-17 14:22:04 -05:00
Jennifer Wang f6e545bce5 typo in variable name 2022-02-17 14:09:10 -05:00
Aayush Rajasekaran c6c5cdd1dc Merge pull request #8134 from filecoin-project/asr/backport
typo in  variable name
2022-02-17 14:08:31 -05:00
Jennifer Wang ae7e5f4b2c typo in variable name 2022-02-17 14:07:45 -05:00
Łukasz Magiera 81d2fd615d Merge pull request #8132 from filecoin-project/fix/disable-reify
temporarily disable reification
2022-02-17 19:30:17 +01:00
vyzo 899a65ae87 fix test 2022-02-17 20:13:46 +02:00
Florian Ruen 6ce9321094 lint reported errors on CircleCI
Commit to fix lint reported errors during tests on CircleCI
(remove trailling whitespace)
2022-02-17 19:01:52 +01:00
vyzo a20c6cb04b temporarily disable reification
big reifications can use a lot of memory during sync apparently.
2022-02-17 19:56:50 +02:00
Florian Ruen ddd369e731 lint reported errors on CircleCI
Commit to fix lint reported errors during tests on CircleCI
(remove blank lines x2)
2022-02-17 18:53:21 +01:00
Florian Ruen 78817bd001 Fix #8100
Bug fixed : if hitting return instead of filling with a valid value, the CLI crashed (line 796)
Change return err by continue to ask a valid value again
2022-02-17 17:57:42 +01:00
Florian Ruen 6d32a2f299 Update client.go
Bug fixed : if hitting return instead of filling with a valid value, the CLI crashed (line 796)
Change return err by continue to ask a valid value again
2022-02-17 17:35:33 +01:00
Aayush Rajasekaran 72021b3221 Merge pull request #8111 from filecoin-project/travis/set-current-network-version
feat: cli: set current network version from params
2022-02-17 11:25:07 -05:00
Aayush Rajasekaran 5e4e7c6d34 Merge pull request #8122 from filecoin-project/asr/make-jen
makefile: add make jen
2022-02-17 10:56:39 -05:00
Łukasz Magiera c974872494 lotus-miner: More sector-related data in info all 2022-02-17 16:35:09 +01:00
Łukasz Magiera 7823363bba lotus-miner: Support update files in storage find 2022-02-17 16:29:27 +01:00
Darko Brdareski 6feae1993d Fix PR comments.
Refactor random addr generation to use a rand seed.
Remove unused lines in tests.
2022-02-17 14:24:42 +01:00
Łukasz Magiera 93bc3af7c6 Merge pull request #8128 from filecoin-project/fix/splitstore-reify-incomplete
don't fail reification on missing references
2022-02-17 13:16:34 +01:00
vyzo 74556edcff don't fail reification on missing references 2022-02-17 12:52:52 +02:00
Łukasz Magiera 36224838dd Merge pull request #8121 from filecoin-project/asr/nil-update
sealer: fix error message
2022-02-17 11:30:53 +01:00
Kevin Li bc88a02fe2 fix docsgen-cli 2022-02-17 17:29:09 +08:00
Kevin Li ba72eff3e6 feat: cli/net: implement 'net ping' command 2022-02-17 17:22:52 +08:00
Steven Allen d835cade15 chore: update FFI
Updates the FVM
2022-02-16 17:47:25 -08:00
Aayush 355b73843c makefile: add make jen 2022-02-16 19:34:45 -05:00
Aayush Rajasekaran 4767f3d87e Merge pull request #8120 from filecoin-project/travis/set-current-network-version
feat: cli: set current network version from params
2022-02-16 19:28:59 -05:00
Aayush 36aa243c56 sealer: fix error message 2022-02-16 19:26:00 -05:00
Aayush Rajasekaran 9df5ce1fb7 Merge pull request #8116 from filecoin-project/asr/migration-tweak
feat: tweak v15 migration params
2022-02-16 17:54:46 -05:00
Aayush 71f0f4c335 feat: tweak v15 migration params 2022-02-16 17:53:59 -05:00
Aayush Rajasekaran f17bbc9eac Merge pull request #8108 from filecoin-project/asr/migration-tweak
feat: tweak v15 migration params
2022-02-16 17:50:10 -05:00
Travis Person ca9bcc90a5 lotus-seed: set current network version from params
allows automation to correctly set the network version for the currently
built network with no variable inputs.
2022-02-16 21:02:51 +00:00
Łukasz Magiera 384999556c paychmgr: AvailableAmt -> NonReservedAmt 2022-02-16 20:39:43 +01:00
Aayush afc29ed445 feat: tweak v15 migration params 2022-02-16 13:04:48 -05:00
Masih H. Derkani a09f386537 Remove redundant IndexProvider config now that host is shared
Now that host is shared having separate config for listen and announce
addresses along with graphsync limit makes no sense since all of that is
shared with the markets host and datatransfer manager.
2022-02-16 13:46:44 +00:00
Masih H. Derkani 2ebc111b70 Use the same host and datatransfer as markets for index provider
Remove the bespoke instantiation of libp2p host and datatransfer manager
for index provider and reuse the existing instances used by markets.

The rationale for reuse is the following:
 1. Separation of host introduces a discovery problem, where without
    gossipsub the index provider endpoint will not be discoverable.
    Using the same host as markets would mean the chain can be used to
    discover addresses, putting less empassis on criticality of
    gossipsub considering its set-up cost and lack of message delivery
    guarantees.

 2. Only a single instance of graphsync/datatransfer can be instantiated
    per libp2p host; therefore, if the host is shared, so should
    datatransfer manager.

 3. it is not clear if the assumptions under which separation was
    decided still hold.
2022-02-16 13:46:44 +00:00
Łukasz Magiera e961766e4b fix lotus-soup build 2022-02-16 10:08:44 +01:00
Łukasz Magiera 681b90768a Merge remote-tracking branch 'origin/master' into feat/paych-avail-reuse 2022-02-16 10:06:36 +01:00
Łukasz Magiera cdca1a46b1 Merge pull request #8102 from filecoin-project/feat/paych-avail-reuse-updated-markets
feat(markets): update markets to simplify client adapter
2022-02-16 10:01:10 +01:00
Kevin Li f677995603 feat: add MsigGetVestingSchedule to gateway api
expose MsigGetVestingSchedule method to gateway api
2022-02-16 16:11:46 +08:00
hannahhoward e1a36058b4 feat(markets): update markets to simplify client adapter 2022-02-15 21:52:06 -08:00
Aayush Rajasekaran 439b424261 Merge pull request #8093 from filecoin-project/asr/enabler15
fix: sealer: allow enable/disabling ReplicaUpdate tasks
2022-02-15 14:57:20 -05:00
Łukasz Magiera 6f21a10a56 Merge pull request #8098 from filecoin-project/feat/sectorlist-pledge
feat: lotus-miner sectors list --initial-pledge
2022-02-15 16:44:49 +01:00
Łukasz Magiera fd66c0dcf6 Merge pull request #8099 from filecoin-project/feat/rcmgr-metrics-redux
don't track peer ids in rcmgr metrics
2022-02-15 15:52:26 +01:00
vyzo 9c00af1b86 don't track peer ids in rcmgr metrics 2022-02-15 16:12:17 +02:00
Łukasz Magiera a3e785cb4a Merge pull request #8057 from mtelka/info-noadmin
fix: state: Allow lotus-miner info to complete without admin permission
2022-02-15 15:00:29 +01:00
Łukasz Magiera 6926d63655 Merge pull request #8088 from filecoin-project/fix/flakey-paychapi-test
fix:paychan:deflake integration test
2022-02-15 14:45:14 +01:00
Łukasz Magiera 48dea93c7e Merge pull request #8089 from filecoin-project/feat/rcmgr-metrics
Resource Manager Metrics
2022-02-15 14:40:44 +01:00
Łukasz Magiera 0b7addc031 lotus-miner sectors list --initial-pledge 2022-02-15 14:21:30 +01:00
Masih H. Derkani 031bfaf120 Update to the head of go-fil-markets#673
Update to the head of the PR that introduces indexing integration in
`go-fil-markets` so that failure to connect to full node is logged only
instead of crashing markets process.

Relates to:
 - https://github.com/filecoin-project/go-fil-markets/pull/673
 - https://github.com/filecoin-project/index-provider/issues/177
2022-02-15 12:37:13 +00:00
Masih H. Derkani f15a1edbf2 Protect index provider peer ID before connecting to full node
Add the peer ID of index provider host to the list of protected peers
before connecting to full node. Otherwise, it is possible for the
connection to be reset by full node before we reach the line that adds
the ID to list of protected peers via JsonRPC API.

Relates to:
 - https://github.com/filecoin-project/index-provider/issues/177
2022-02-15 11:49:29 +00:00
Aayush 75b8e4c981 fix: sealer: allow enable/disabling ReplicaUpdate tasks 2022-02-14 15:25:52 -05:00
Aayush Rajasekaran bcaeb83fef Merge pull request #8090 from filecoin-project/asr/snap-tasks
fix: worker: allow enable/disabling ReplicaUpdate tasks
2022-02-14 15:23:42 -05:00
Łukasz Magiera 60b9acc09d gen 2022-02-14 21:16:41 +01:00
Łukasz Magiera deb9882520 Merge branch 'feat/paych-avail-reuse' of github.com:filecoin-project/lotus into feat/paych-avail-reuse 2022-02-14 21:11:48 +01:00
Łukasz Magiera da5ae1efe1 paychmgr: erlier checks in completeAmount 2022-02-14 21:11:31 +01:00
Aayush eebe784191 fix: sealer: allow enable/disabling ReplicaUpdate tasks 2022-02-14 15:08:28 -05:00
Łukasz Magieraanddirkmc f9485eb9c2 Update paychmgr/store.go
Co-authored-by: dirkmc <dirkmdev@gmail.com>
2022-02-14 20:42:45 +01:00
Łukasz Magiera 36a1934845 paychmgr: Fix tests after api changes 2022-02-14 20:16:30 +01:00
df5bd147fa paychmgr: Review comments
Co-authored-by: Hannah Howard <hannah@hannahhoward.net>
Co-authored-by: dirkmc <dirkmdev@gmail.com>
2022-02-14 20:07:13 +01:00
zenground0 977351f419 Fix from Magik to remove hanging behavior 2022-02-14 14:00:41 -05:00
Łukasz Magiera f61eb23f8f api: separate method for paych funding 2022-02-14 19:56:02 +01:00
Łukasz Magiera 10af768c60 Merge commit 'origin/release/v1.15.0~2' into feat/paych-avail-reuse 2022-02-14 19:27:12 +01:00
Łukasz Magiera 7efed6617c Merge pull request #8029 from filecoin-project/feat/splistore-cold-object-reification-redux
splistore cold object reification redux
2022-02-14 19:04:02 +01:00
vyzo a9ec408844 collect resource manager metrics 2022-02-14 19:46:05 +02:00
vyzo b260c849f7 deps: update go-libp2p-resource-manager to v0.1.4 2022-02-14 19:43:07 +02:00
zenground0 2c06eb76d6 Improve MineBlocksMustPost use it in PaychAPI itest 2022-02-14 09:47:18 -05:00
vyzo 6bcade5e6d add comment about bigness of reification batch 2022-02-14 16:13:54 +02:00
vyzo 4524fbe936 wait for reify workers to finish when closing 2022-02-14 16:10:54 +02:00
vyzo 6c7ababd3f add comment about trackTxnRefs being noops if txnActive is false 2022-02-14 16:06:12 +02:00
vyzo a428f44793 don't reify objects while still warming up 2022-02-14 16:04:39 +02:00
vyzo b576785aac rename GetHotView to IsHotView 2022-02-14 16:03:17 +02:00
ZenGround0 3b5b55de19 Merge pull request #8017 from filecoin-project/bloxico/mempool_tests
test: mempool: Add unit and integration tests
2022-02-14 08:46:45 -05:00
Aayush ee6989970f Merge branch 'master' into feat/fvm 2022-02-13 14:25:39 -05:00
Aayush Rajasekaran bac708fa34 Merge pull request #8081 from filecoin-project/feat/shed-state-diff
add a state-tree diff command to lotus shed
2022-02-13 14:03:22 -05:00
Nikola Divic 93d9bfb682 doc: stm test annotations for cli/sync category 2022-02-13 18:39:37 +01:00
Nikola Divic e6c8c9a6ab doc: add stm annotation to cli chain tests 2022-02-13 17:14:27 +01:00
Nikola Divic 34387326d1 test: fix flaky message pool integration tests
Using the same pattern described in my previous commit.
I also added the CircuitBreaker to the itests kit as it may be useful
for other integration tests when debugging flakyness caused by timeouts.
2022-02-12 19:52:51 +01:00
Nikola Divic aca2a0fd1b test: fix flake in TestMemPoolBatchPushUntrusted integration test
The flake was caused by improper waiting for certain chain operations
to finish:

- We didn't wait for messages to be registered as pushed
- We improperly waited for a fixed time (10 seconds) for messages to be
mined, which in the best case would wait longer than necessary and in the
worst case would cause the test to break.

What I did:
- fixed by waiting in a loop for "just enough time". This fixed the flake
and made the test run faster, on average, because we don't have unnecessary
waiting.
- I added a "circuit-breaker" where the wait loop will timeout after 10 seconds.
2022-02-12 17:48:45 +01:00
Nikola Divic 0e8a709f92 Merge branch 'master' of https://github.com/filecoin-project/lotus into bloxico/mempool_tests 2022-02-12 17:11:24 +01:00
Nikola Divic d50a26f4ae Revert "test: (kinda) fix flaky test"
This reverts commit baee4a1576.
2022-02-12 17:10:00 +01:00
Nikola Divic baee4a1576 test: (kinda) fix flaky test
deals_retry_deal_no_funds_test.go:TestDealsRetryLackOfFunds seems to be
flaky, sometimes it passes and sometimes it doesn't.
The first suspect for me was time.Sleep(), which I replaced with waiting
until a deal state where you can restart is reached.
2022-02-11 21:56:28 +01:00
Masih H. Derkani 1bf7e6a408 Fix gen-check 2022-02-11 20:02:56 +00:00
Masih H. Derkani 59351c8cb8 Add lotus net CLI command to add/remove/list protected peers
Add CLI commands under `lotus net` to add/ remove/list protected peers.
2022-02-11 19:54:59 +00:00
Masih H. Derkani 230b8554f6 Override testnetnet to mainnet in indexer ingest topic
Override `testnetnet` to `mainnet` when constructing indexer ingestion
topic.
2022-02-11 19:52:19 +00:00
Masih H. Derkani b47cde70fa Decode gossip extra data as []bytes
The type of extra data in go-legs gossip is bytes. But when it is parsed
as miner ID, it is cast to string then parsed. Instead, it should be
decoded from bytes.
2022-02-11 18:59:00 +00:00
Steven Allen e89f7d9023 feat: shed: add a state-tree diff command to lotus shed
This makes it easier to debug state mismatches by providing a nice way
to figure out which actors differ between two state-trees and
how (balance, nonce, state, etc.).

It doesn't provide a way to actually _diff_ those state-trees, but one
can use `lotus chain get` to figure that out (although it would be
_nice_ to provide something a bit smarter).
2022-02-11 10:35:56 -08:00
Nikola Divic 94374aa93d test: sync checkpoint cli command 2022-02-11 18:30:07 +01:00
Nikola Divic 05c8635749 test: sync check-bad cli command 2022-02-11 18:08:36 +01:00
Nikola Divic 0f79a0024c test: sync unmark-bad cli command 2022-02-11 18:00:01 +01:00
Nikola Divic 7fc2f9dc29 test: sync mark-bad cli command 2022-02-11 17:54:53 +01:00
Nikola Divic ec0607900d test: sync state cli command 2022-02-11 17:45:19 +01:00
TheMenko 8a2d27309d adding cli wallet tests 2022-02-11 16:30:28 +01:00
TheMenko d77e59309d Merge remote-tracking branch 'origin/cli-chain-tests' into cli_wallet_tests
merging cli-chain-tests for mock full api function dependency
2022-02-11 16:17:30 +01:00
Nikola Divic 2a1f18b6ab Merge branch 'cli-chain-tests' into bloxico/cli-sync-tests 2022-02-11 15:56:49 +01:00
Nikola Divic 34bfd13548 doc: add stm annotations to the syncer tests
Add annotations for the test crawler for the lotus.systemtestmatrix.com
dashboard.
2022-02-11 15:06:06 +01:00
Masih H. Derkani 7e7844f169 Fix log message formatting when instantiating index provider 2022-02-11 12:15:21 +00:00
Łukasz Magiera 2e22781f8f Merge pull request #8073 from filecoin-project/jen/v151
feat: build: bump the version to v1.15.1-dev
2022-02-11 09:51:21 +00:00
Jennifer Wang 99d5ad097c Merge remote-tracking branch 'origin/master' into jen/v151 2022-02-11 00:16:52 -05:00
Jennifer Wang 1b2bbd3888 bump master version to v1.15.1-dev 2022-02-11 00:13:18 -05:00
Jennifer Wang 095d5d2e31 add changelog 2022-02-10 23:56:42 -05:00
Jennifer Wang 1916561e60 bump the version to v1.15.0-rc1 2022-02-10 23:38:41 -05:00
Nikola Divic ae66f57fa0 test: chain syncer & sync manager
Added a few tests for some uncovered methods of the syncer and sync
manager. Deleted some dead code (sync.go:getLatestBeaconEntry).
2022-02-11 00:46:59 +01:00
Nikola Divic 107eb76b20 cleanup: small cleanup before final push 2022-02-11 00:09:07 +01:00
Will 296eab3045 Merge pull request #8045 from gammazero/feat/cid-to-piece-idx
Add indexer pubsub message authentication and rate limiting
2022-02-10 13:49:58 -08:00
Nikola Divic e5ac8662c8 test: chain gas-price cli command
Contains some funny mocking logic, because estimate gas price is called
multiple times (for various nblocks) and I wanted to make it as flexible
as possible.
2022-02-10 21:55:09 +01:00
gammazero c1b2080f4e spelling in comment 2022-02-10 11:25:30 -08:00
gammazero eedcf910eb change scoring based on review 2022-02-10 10:53:07 -08:00
gammazero b72cd90c19 Add indexer message scoring 2022-02-10 09:21:21 -08:00
Nikola Divic c0f89e5b2d test: chain export cli command
Modified ChainExportCmd to use io.WriterCloser instead of os.File so
it the file can be mocked in unit tests, without side effects to the FS.
2022-02-10 18:18:31 +01:00
gammazero 1e37185d74 Ignore, not regect, indexer messages from self. 2022-02-10 08:44:40 -08:00
gammazero 3f3d61b043 Service creation takes interface, not implementation 2022-02-10 08:41:18 -08:00
Steven Allen 7ef1513f9b ffi: update fvm 2022-02-10 07:56:27 -08:00
Nikola Divic b536dfa552 test: chain bisect cli command 2022-02-10 15:46:06 +01:00
Masih H. Derkani f0accce286 Upgrade index-provider and go-fil-markets to latest
See: https://github.com/filecoin-project/go-fil-markets/pull/680
2022-02-10 14:04:11 +00:00
Nikola Divic 6bc2ee2735 test: chain get cli command
Cover the essential function execution paths, no time for every -as-type
combination.
2022-02-10 14:49:38 +01:00
Marcel Telka 3c82ee49c0 Allow lotus-miner info to complete without admin permission 2022-02-10 12:45:57 +01:00
Łukasz Magiera e435b42426 Merge pull request #8053 from filecoin-project/jen/v15
chore: build: v1.14.0 -> master
2022-02-10 11:06:01 +00:00
gammazero 9481fa0a4b Use new indexer pubsub message encoding 2022-02-09 16:40:27 -08:00
Jennifer Wang 1d67b7ffb6 undo ffi 2022-02-09 19:31:50 -05:00
Jennifer Wang de1f4792cd Merge remote-tracking branch 'origin/master' into jen/v15 2022-02-09 19:27:34 -05:00
gammazero 681ce94a34 Correctly handle seqno check 2022-02-09 16:21:05 -08:00
Jiaying WangandŁukasz Magiera cd3772bf4f Update go.mod
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2022-02-09 19:08:00 -05:00
Nikola Divic b3f7db7a15 test: chain list (love) cli command
Some "funky" string matching in this one, but I think that's ok.

Chain is love. ❤️
2022-02-10 00:36:38 +01:00
Nikola Divic 4e37131602 test: chain inspect-usage cli command 2022-02-09 23:47:40 +01:00
Steven Allen 0d6eb7fefc ffi: update for fixed FVM lifetime management 2022-02-09 14:13:58 -08:00
Jennifer Wang 7b7733077a update the proofs in test plans` 2022-02-09 15:11:29 -05:00
Nikola Divic ae49729afb test: chain sethead cli command
Also moved the mock definition to a separate file (mocks_test.go)
because it's gonna be used in other test files, and it didn't make sense
for it to stay inside chain_test.go.
2022-02-09 20:46:51 +01:00
gammazero 3ff209d95d Add replay rejection 2022-02-09 11:06:56 -08:00
Nikola Divic 7d2810abbc test: don't parse err messages in messagepool_test
Per @vyzo's feedback, we shouldn't parse err messages but figure out
a way to do this smarter. I updated the code just check for error
existence and @brdji should figure out what to do next.
2022-02-09 19:54:45 +01:00
Jennifer Wang 8b68d37e84 remove change log 2022-02-09 13:33:47 -05:00
gammazero a62e027002 review changes 2022-02-09 10:29:49 -08:00
Łukasz Magiera e7038d286d Merge pull request #8018 from filecoin-project/feat/fru
FinalizeReplicaUpdate
2022-02-09 17:40:47 +00:00
Łukasz Magiera 44fd0e3349 Merge pull request #8008 from filecoin-project/feat/splitstore-sortless-compaction
splitstore sortless compaction
2022-02-09 17:17:57 +00:00
Łukasz Magiera 84d70caa87 sealing: Use ChainAt in handleUpdateActivating 2022-02-09 17:50:56 +01:00
vyzo e129ae3706 refactor nextBatch in badger markset 2022-02-09 18:34:50 +02:00
Nikola Divic e797ec138d test: chain getmessage cli command
I also added some helper functions for mocking in the types/mock pkg
2022-02-09 17:29:29 +01:00
Nikola Divic a923d7c884 test: chain stat-obj cli command
Test expected output with respect to the --base flag
2022-02-09 16:22:52 +01:00
Łukasz Magiera cce77196cd proofs v11.0.2 2022-02-09 16:22:35 +01:00
Nikola Divic c0f47e5eed test: chain delete-obj cli command
Contains two subtests, that check if the --really-do-it flag (force)
is respected, since removing wrong objects may lead to sync issues.
2022-02-09 15:56:13 +01:00
Nikola Divic 1cd590ace9 test: chain read-obj
Simple test that checks if this CLI method prints the IPLD node referenced
by the given CID encoded in hexadecimal.
2022-02-09 15:29:10 +01:00
Łukasz Magiera f33cf74d0f ffiwrapper: Use ClearCache for update cache cleanup 2022-02-09 14:54:36 +01:00
Łukasz Magiera 6cb411e5bb proofs master 2022-02-09 14:46:29 +01:00
Łukasz Magiera b1a74d71f1 Fix CheckProvable with updated sectors 2022-02-09 14:41:36 +01:00
Rob Quist 026c51033c perf: chain: Make drand logs in daemon less noisy (#7955)
Makes logs less noisy
2022-02-09 13:34:55 +01:00
Łukasz Magiera eff73c9728 Merge pull request #7941 from filecoin-project/chore/more_detailed_network-wide_shed_stats
chore: shed: storage stats 2.0
2022-02-09 12:03:49 +00:00
Łukasz Magiera 947000c94f fsm: Call ReleaseSectorKey after WinningPoSt lookback period 2022-02-09 12:41:39 +01:00
Łukasz Magiera 67e3f182f5 Use tagged specs-storage 2022-02-09 11:28:48 +01:00
Jennifer Wang 6ed97f0d04 Merge branch 'release/v1.14.0' into jen/v15 2022-02-09 03:17:38 -05:00
Steven Allen 743862857e ffi: update FFI for fvm changes 2022-02-08 20:57:20 -08:00
Steven Allen e8bdf8171b chore: cleanup fil vested calculation
1. Move lock, loading, etc into GetFilVested.
2. Call it directly when creating the FVM.
3. Detach GetFilLocked from state manager.

Really, this just makes it a bit easier to reason about this code.
2022-02-08 20:54:53 -08:00
Jiaying Wang 7319420c8f Merge pull request #7905 from filecoin-project/feat/snap-deals-add-ons
StartEpochSealingBuffer triggers packing on timer
2022-02-08 21:06:11 -05:00
Steven Allen e8d771fcac pass only fil-vested into FVM 2022-02-08 15:26:20 -08:00
Steven Allen 32b3618c74 fvm: feed in correct "base" circulating supply 2022-02-08 13:20:03 -08:00
Łukasz Magiera 22e72e19b3 Merge pull request #8050 from filecoin-project/asr/dep-master
deps: update go-paramfetch to v0.0.4
2022-02-08 19:04:34 +00:00
zenground0 485568d460 make docsgen-cli 2022-02-08 13:52:24 -05:00
zenground0 e32704e7f6 Update node doc gen 2022-02-08 12:56:32 -05:00
zenground0 03bc45a26a Update ci config to match auto gen 2022-02-08 12:47:23 -05:00
zenground0 1e524b7210 Review Response 2022-02-08 12:39:35 -05:00
zenground0 5a09b6496d Actually read config value 2022-02-08 12:39:35 -05:00
zenground0 2aa5911fb9 config gen 2022-02-08 12:39:35 -05:00
zenground0 a19c0a8255 Remove extra file 2022-02-08 12:39:35 -05:00
zenground0 4d8b912acc New config for turning off auto deal creation 2022-02-08 12:39:35 -05:00
zenground0 1af8987c79 StartEpochSealingBuffer triggers packing on timer 2022-02-08 12:39:35 -05:00
Nikola Divic 78649d45b9 test: cli chain getblock command
Unit test for the cli `chain getblock` command.
Tests if output is JSON  in the expected format.
2022-02-08 18:24:45 +01:00
Aayush Rajasekaran 899ae8aa8e Merge pull request #8014 from filecoin-project/fix/8011
fix: sealing: Stop recovery attempts after fault
2022-02-08 12:06:55 -05:00
Aayush Rajasekaran b6c141c059 nit: edit a comment 2022-02-08 12:06:33 -05:00
Aayush Rajasekaran 316836f43b deps: update go-paramfetch to v0.0.4 2022-02-08 12:00:55 -05:00
Łukasz Magiera 6123339baf Make FinalizeReplicaUpdate actually do cleanup 2022-02-08 17:45:26 +01:00
Nikola Divic 35918cbd7e Merge branch 'master' of https://github.com/filecoin-project/lotus into cli-chain-tests 2022-02-08 17:25:45 +01:00
Łukasz Magiera c8e0341248 Fix missing FinalizeReplicaUpdate in tests 2022-02-08 17:22:41 +01:00
Łukasz Magiera 4ad97f6a36 make gen 2022-02-08 17:22:41 +01:00
Łukasz Magiera 09cfad9d71 Add FinalizeReplicaUpdate into some more places 2022-02-08 17:22:41 +01:00
Łukasz Magiera 7fa84518c8 itests: Print API info env vars in ThroughRPC tests 2022-02-08 17:22:41 +01:00
Łukasz Magiera 6675aec686 mod tidy 2022-02-08 17:22:41 +01:00
Łukasz Magiera e271bae5ec try ClearCache for update cache 2022-02-08 17:22:41 +01:00
Łukasz Magiera 142ba6660a wip FinalizeReplicaUpdate 2022-02-08 17:22:41 +01:00
Łukasz Magiera b27196b770 Merge pull request #8047 from filecoin-project/asr/params
chore: update build and deps
2022-02-08 16:22:12 +00:00
Nikola Divic 811bc62d65 test: cli test setup & test chain head
CLI actions lack unit tests. I decided to use the approach similar to
what I found in `send_test.go` using gomock, but I don't rely on custom
"service" implementations but mock the whole FullNode API.
This first commit validates the test setup by testing the simplest method
of the chain category, e.g. `chain head`.

This requires a minor refactor of the CLI action code:
- The constructor (`GetFullNodeAPI`) checks if there's an injected mock
API in the app Metadata and uses that in unit tests.
- Actions shouldn't use raw `fmt.*` but instead write to the `app.Writer`
so the CLI output is testable
2022-02-08 17:15:45 +01:00
Aayush Rajasekaran f476aa937e update to latest FFI 2022-02-08 10:45:58 -05:00
Jennifer Wang 932110fb93 update the param version 2022-02-08 10:44:36 -05:00
Jennifer Wang 1865e8f088 reset butterfly net 2022-02-08 10:43:51 -05:00
Jennifer Wang fdae1face5 Set Calib OhSnap upgrade epoch 2022-02-08 10:43:43 -05:00
Aayush Rajasekaran ad39d8707d build: add empty sector update params 2022-02-08 10:41:18 -05:00
Masih H. Derkani cc61650f86 Upgrade to latest index-provider and set miner ID as extra gossip data
Upgrade to the latest `index-provider` which upgrades the go-legs
protocol to allow the inclusion of extra gossip data that may be used
for gossip validation purposes. In the case of lotus gossip message
validators the miner ID is used to verify the sender's peer ID on chain.

Relates to:
- https://github.com/filecoin-project/lotus/pull/8045
2022-02-08 14:32:03 +00:00
gammazero b2805823ce Pass to validator the interfaces needed to get miner info 2022-02-08 04:55:59 -08:00
gammazero 1dc6a2fea6 Add indexer pubsub message authentication and rate limiting 2022-02-08 02:53:25 -08:00
Łukasz Magiera b38adaa736 Merge pull request #8044 from filecoin-project/deps/update-libp2p
update libp2p to v0.18.0-rc4
2022-02-08 10:52:56 +00:00
vyzo 80e9f76261 update libp2p to v0.18.0-rc4 2022-02-08 11:51:14 +02:00
Aarsh Shah 399a1afd94 Merge remote-tracking branch 'origin/master' into feat/cid-to-piece-idx 2022-02-08 12:37:57 +04:00
vyzo 8ddf4766ea update README
Adds note about 3k IOPs requirement with badger markset, updates the memory requirement for
map to 48G based on observed behaviour of test nodes.
2022-02-08 10:10:51 +02:00
Łukasz Magiera 966071d437 Merge pull request #8034 from filecoin-project/feat/splitstore-default-markset-badger
splitstore: set badger as the default default markset type
2022-02-07 19:27:13 +00:00
Steven Allen 279cdd0760 fvm: fix implicit messages and message inclusion gas charging 2022-02-07 10:33:57 -08:00
zenground0 1ab2744c84 Fix log 2022-02-07 09:15:23 -05:00
zenground0 47ffceef0d Check sector is active before PRU 2022-02-07 07:41:48 -05:00
vyzo 0ad1f0e233 moar make gen 2022-02-06 12:48:49 +02:00
vyzo 1221c0ba3f make gen 2022-02-06 12:28:21 +02:00
vyzo d45e2074a6 update README for map as the default 2022-02-06 11:25:27 +02:00
vyzo 03352ea863 make badger the default splitstore markset type 2022-02-06 11:21:16 +02:00
vyzo 713edd565c fix lint 2022-02-05 21:30:53 +02:00
vyzo a32b7a32f3 directly mark objects in cold object reification 2022-02-05 20:00:15 +02:00
Steven Allen 04092f3e6b update ffi 2022-02-04 12:46:15 -08:00
Steven Allen fc74a6c8ca update fvm/ffi bindings 2022-02-04 12:46:15 -08:00
Aayush Rajasekaran 2a669b95fb :Hook up the FVM 2022-02-04 12:46:15 -08:00
vyzo 9d92b6eb92 correctly wrap hotview in the context for compute_state 2022-02-04 16:57:08 +02:00
vyzo 73c741f20c reify cold objects on block validation/application 2022-02-04 16:19:28 +02:00
vyzo 929a05e898 add reification test 2022-02-04 16:16:34 +02:00
vyzo 268366e446 cold object reification context option 2022-02-04 16:07:58 +02:00
vyzo 4cddfd1074 background cold object reification 2022-02-04 14:29:50 +02:00
Aarsh Shah eb8296120b changes to mesh creation code 2022-02-04 13:58:47 +04:00
Aarsh Shah daac7f2988 fix lint 2022-02-04 13:55:26 +04:00
Aarsh Shah ca46a79144 protect full node connection 2022-02-04 13:04:07 +04:00
Aarsh Shah e155eb9fa3 Merge pull request #8016 from filecoin-project/nonsense/add-fullnode-api
add indexProvider host to markets
2022-02-04 12:56:36 +04:00
Aarsh Shah 4691b2b809 changes to the indexer message relay PR 2022-02-04 12:15:01 +04:00
Aarsh Shah 3ecf478ff0 Merge pull request #8026 from gammazero/feat/cid-to-piece-idx
Lotus chain nodes relay indexer pubsub messages
2022-02-04 12:05:46 +04:00
gammazero c084130d3e Lotus chain nodes relay indexer pubsub messages
Content providers announce the availability of indexer data using gossip pubsub.  The content providers are not connected directly to indexers, so the pubsub messages are relayed to indexers via chain nodes. This PR makes chain nodes relay gossip pubsub messages, on the /indexer/ingest/<netname> topic.
2022-02-03 14:56:21 -08:00
Jiaying Wang f4af6b670c Merge pull request #8021 from filecoin-project/willscott/net-protect-api
add net protect api methods
2022-02-03 17:54:33 -05:00
Łukasz Magiera d9c763437e Merge pull request #8022 from filecoin-project/deps/update-libp2p
update go-libp2p to v0.18.0-rc3
2022-02-03 18:42:04 +00:00
vyzo e78c4ab9b3 update go-libp2p to v0.18.0-rc3 2022-02-03 19:32:30 +02:00
Will Scott 7247f8e41f add net protect api methods
fix #8015
2022-02-03 17:24:49 +01:00
Anton Evangelatov b6b5046cce upgrade go-fil-markets 2022-02-03 16:26:04 +01:00
Anton Evangelatov dde2ab59ae fixup 2022-02-03 15:53:46 +01:00
Anton Evangelatov bb6235733d go mod tidy 2022-02-03 15:48:05 +01:00
Anton Evangelatov 595ad44ee7 refactor indexprovider libp2p host connection to fullnode with meshcreator 2022-02-03 15:44:18 +01:00
Anton Evangelatov 20fc5ffa38 fixing tests 2022-02-03 14:43:20 +01:00
Masih H. Derkani 6ef0c382c3 Fix typos in default miner config 2022-02-03 13:24:46 +00:00
Masih H. Derkani 575e6add43 Rename IndexerProvider to IndexProvider and add more docs
Rename the config section corresponding to indexing to `IndexProvider`
for better readability.

Update existing docs for better clarity and add docs for config
parameters embedded from `index-provider` `Ingest` config library.
2022-02-03 13:10:47 +00:00
Masih H. Derkani 235377585d Clarify the purpose of MaxSimultaneousTransfers config
Clarify the documentation of `MaxSimultaneousTransfers` to state that
the "transfer" refers to multihash syncing only and not the data itself.
2022-02-03 11:51:01 +00:00
Łukasz Magiera b74e085272 don't sort 2022-02-02 19:08:21 +00:00
Darko Brdareski 008fbbd652 Add unit and integration tests for mempool 2022-02-02 17:08:50 +01:00
Anton Evangelatov c3d41d4e17 upgrade go-fil-markets 2022-02-02 16:14:44 +01:00
Anton Evangelatov faa3a79a5f use NetAddrListener iface 2022-02-02 16:01:19 +01:00
Anton Evangelatov 03dd33dbbe upgrade go-fil-markets 2022-02-02 14:07:41 +01:00
vyzo 049b48928f add note about compaction algorithm changes in README 2022-02-02 14:39:21 +02:00
vyzo 75ad0c3c2d badger markset option tweaks 2022-02-02 14:34:30 +02:00
Anton Evangelatov 79403f169e fix autogenerated docs 2022-02-02 13:18:53 +01:00
Anton Evangelatov 2790cf35af change fullnodeApi to listen addrs 2022-02-02 13:06:53 +01:00
Anton Evangelatov f9b63c5f8c add idxProvHost to StorageProvider 2022-02-02 13:03:41 +01:00
Anton Evangelatov db5e4da268 add fullnodeApi to StorageProvider 2022-02-02 13:03:41 +01:00
vyzo c1d8368fdc share a concurrent visitor between workers in markLiveRefs 2022-02-01 21:40:09 +02:00
vyzo 4b4104e400 fix comment 2022-02-01 12:10:30 +02:00
Masih H. Derkani ad348c8e2f Upgrade to the latest index provider
Upgrade to the latest index provider which rolls out a more compact ad
signature mechanism along with dependency updates.
2022-02-01 09:53:57 +00:00
vyzo b13aa8f172 unblock waitForSync on close 2022-02-01 11:30:21 +02:00
vyzo 9c92d77b64 improve robustness of waitForSync 2022-02-01 11:25:07 +02:00
vyzo cd95892bf0 fix test 2022-02-01 11:13:01 +02:00
vyzo 7b4ab2077b wait for sync in a non racey way 2022-02-01 11:10:51 +02:00
vyzo 578b5691bc check for closing after the sync wait 2022-02-01 10:59:08 +02:00
vyzo 6353fa72d8 decouple SyncGapTime from wait time 2022-02-01 10:55:15 +02:00
vyzo fd07ca87ce wait for the sync gap time befor starting the purge 2022-02-01 10:46:42 +02:00
vyzo 11ae85645b optimize single object marking in markLiveRefs 2022-02-01 09:13:21 +02:00
vyzo 3aabb0314a synchronously mark live refs on put/putmany 2022-02-01 09:07:14 +02:00
zenground0 13ccb8cbfe Stop recovery attempts after fault 2022-02-01 11:39:42 +05:30
Łukasz Magiera efdb854a7c fix some races 2022-01-31 20:53:25 +00:00
Łukasz Magiera 98f4d37f1a Merge remote-tracking branch 'origin/master' into feat/post-worker 2022-01-31 19:50:52 +00:00
vyzo 37673c6de6 downgrade marking log to debug 2022-01-31 21:44:10 +02:00
vyzo 7896af731f use walkObjectIncomplete for marking live refs 2022-01-31 21:41:42 +02:00
vyzo 877dfbe992 hold the lock in the second protect call 2022-01-31 19:21:03 +02:00
vyzo 5b9ea1b4e0 avoid races in beginCriticalSection 2022-01-31 18:48:53 +02:00
vyzo 710fda49f0 fix putmany marking 2022-01-31 17:35:30 +02:00
vyzo 2b14bda6b8 recursively mark puts during the critical section 2022-01-31 17:26:08 +02:00
vyzo 1abfc5b1cf fix comment 2022-01-31 15:00:03 +02:00
vyzo c9bd5ec452 mark tipset references to protect them during critical section 2022-01-31 14:54:23 +02:00
Łukasz Magiera 51643caf60 Merge pull request #7835 from filecoin-project/bloxico/system-test-matrix
misc: api: Annotate lotus tests according to listed behaviors
2022-01-31 12:23:09 +01:00
vyzo ee63be26a1 fix race in protectView 2022-01-31 12:40:26 +02:00
vyzo 1900c907fd account for missing refs in the markset in Has 2022-01-31 09:44:51 +02:00
vyzo a9d4495d83 use both hot and cold when doing fetches for markset positive objects 2022-01-30 22:47:20 +02:00
vyzo 7b8447a95a reinstante waitForMissingRefs 2022-01-30 19:00:52 +02:00
vyzo 7931f1f8f9 fix lint 2022-01-30 15:43:52 +02:00
vyzo 20b75022aa fix mockStore for splitstore tests 2022-01-30 15:33:30 +02:00
vyzo dbc8903bac sortless compaction 2022-01-30 15:33:15 +02:00
vyzo a4f720d866 coldset test 2022-01-30 15:11:25 +02:00
vyzo 4b8369c071 fix buffered reads 2022-01-30 15:11:18 +02:00
vyzo 72333147d3 prettier checkpoint close 2022-01-30 15:00:03 +02:00
vyzo 64cda4aeda on disk coldsets 2022-01-30 14:19:05 +02:00
vyzo 6ede77b254 checkpoint test 2022-01-30 14:10:11 +02:00
vyzo c94eee5fc3 on disk checkpoints 2022-01-30 12:47:30 +02:00
vyzo 322b85898f make markSets synchronous in critical section 2022-01-30 12:10:08 +02:00
vyzo cf09dd044a moar markset tests 2022-01-30 11:45:12 +02:00
vyzo a4c1a34163 check for existence of badger db in recover 2022-01-30 11:44:27 +02:00
vyzo d140909562 add MarkMany to MarkSet interface 2022-01-30 11:43:45 +02:00
vyzo f9fd47e7d0 use temporary dir for splitstore test path 2022-01-29 13:11:58 +02:00
vyzo 67fbf9eb00 improve peristence test 2022-01-28 15:55:34 +02:00
vyzo 730aceac6d immediately flush pending writes when entering critical section 2022-01-28 15:55:10 +02:00
vyzo 1bf396f9af add test for markset persistence 2022-01-28 15:49:41 +02:00
vyzo 45c2f34295 refactor marksets for critical section on-disk persistence 2022-01-28 15:41:33 +02:00
vyzo ff10e0eaf1 Merge pull request #7999 from filecoin-project/feat/splistore-refactors
some basic splitstore refactors
2022-01-28 13:55:16 +02:00
Darko Brdareski 6b8f526df3 Fix merge 2022-01-27 11:06:04 +01:00
Darko Brdareski e51ce5c508 Merge remote-tracking branch 'upstream/master' into bloxico/system-test-matrix 2022-01-27 10:57:56 +01:00
Darko Brdareski 8c41e17c93 Fix typo in client_test annotations 2022-01-27 10:56:33 +01:00
Masih H. Derkani 5d72ebe0cc Upgrade index-provider and update topic name
Update the topic name to be consistent with default
configured in storetheindex.

Upgrade to the latest `index-provider`.
2022-01-27 09:48:10 +00:00
vyzo f07ce297f6 optimize slice allocations in walk 2022-01-26 21:55:24 +02:00
vyzo a87239e802 avoid extraneous assignment 2022-01-26 21:48:03 +02:00
Łukasz Magiera 3e6c482229 Merge pull request #8005 from filecoin-project/feat/mpool-cache-statenonces
feat: mpool: Cache state nonces
2022-01-26 16:22:12 +01:00
Łukasz Magiera 176ecd4c3b mpool: Cache state nonces 2022-01-26 15:39:58 +01:00
Aarsh Shah 211ad166af update markets deps 2022-01-26 15:53:27 +04:00
vyzo fe47d6a1a4 fix check and warmup for parallel walk 2022-01-26 09:01:51 +02:00
Aarsh Shah 4dd93e5bbb update deps 2022-01-26 10:58:44 +04:00
vyzo 10f2445a99 use minimum of 2 workers 2022-01-25 21:37:48 +02:00
Aayush Rajasekaran f1b24598f5 Merge pull request #7998 from filecoin-project/arajasek-patch-3
chore: sealer: quieten a log
2022-01-25 12:56:30 -05:00
Aayush Rajasekaran 2d0929e305 remove a log 2022-01-25 12:55:56 -05:00
vyzo 8e01e73de4 dynamically compute number of workers for parallel chain walk 2022-01-25 19:47:58 +02:00
vyzo 7c8edf5632 parallelize walkChain 2022-01-25 17:29:02 +02:00
vyzo 25284b5325 refactor: eliminate distinction between markset and markset visitors 2022-01-25 16:31:45 +02:00
Łukasz Magiera 06d2ac65b5 Merge pull request #7995 from filecoin-project/arajasek-patch-2
chore: build: make the OhSnap epoch configurable by an envvar for devnets
2022-01-25 10:51:26 +01:00
Łukasz Magiera e3888b38bb Merge pull request #7993 from filecoin-project/arajasek-patch-1
chore: chain: fix log
2022-01-25 10:50:47 +01:00
Masih H. Derkani 5da2995bcd Upgrade to index-provider v0.2.3
Upgrade index provider to latest so that on engine restart the head
advertisement is published.
2022-01-25 09:37:44 +00:00
Aayush Rajasekaran 92e6f29cc8 chore: sealer: quieten a log 2022-01-24 18:28:52 -05:00
raulk a2468656e4 Merge pull request #7996 from filecoin-project/raulk/tvx-network-version
tvx: supply network version when extracting messages.
2022-01-24 20:50:51 +00:00
Aayush Rajasekaran 0358ad83cb Update params_2k.go 2022-01-24 15:44:20 -05:00
Raúl Kripalani 3aab77af8d tvx: add missing network upgrade names. 2022-01-24 20:13:04 +00:00
Raúl Kripalani 85447abe7f tvx: supply network version when extracting messages. 2022-01-24 20:06:07 +00:00
Aayush Rajasekaran 71c6d05902 chore: chain: fix log 2022-01-24 11:18:01 -05:00
Aarsh Shah 8d062bc880 update index provider 2022-01-24 14:26:17 +04:00
Aarsh Shah 9e2d46b33f Merge remote-tracking branch 'origin/master' into feat/cid-to-piece-idx 2022-01-23 10:32:54 +04:00
Łukasz Magiera 6080431383 Merge pull request #7986 from filecoin-project/asr/more-fixes-master
fix: sealer: manager should lock Unsealed for ReplicaUpdate
2022-01-21 17:38:23 +01:00
Aayush 5cafdc2f29 fix: sealer: manager should lock Unsealed for ReplicaUpdate 2022-01-21 11:12:12 -05:00
Aayush Rajasekaran ff845aa793 Merge pull request #7977 from filecoin-project/chore/sealtasks-comment
chore: remove inaccurate comment in sealtasks
2022-01-21 10:53:04 -05:00
Łukasz Magiera 55c9271695 post workers: Test skips 2022-01-21 13:33:47 +01:00
Łukasz Magiera f148397e1b post workers: Fix race in setting vproofs 2022-01-21 12:31:24 +01:00
Łukasz Magiera 82c9e72aab post workers: Fix skipped handling 2022-01-21 10:39:14 +01:00
Łukasz Magiera cdeac2bca0 Merge pull request #7984 from filecoin-project/deps/update-libp2p
update go-libp2p to v0.18.0-rc2
2022-01-21 10:11:27 +01:00
Łukasz Magiera 4682e72cf4 Address review 2022-01-21 10:11:04 +01:00
Łukasz MagieraandAayush Rajasekaran 1e5e69ec9d Typos
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2022-01-21 10:02:00 +01:00
vyzo 6e5f521463 update go-libp2p to v0.18.0-rc2 2022-01-21 10:45:45 +02:00
Aayush Rajasekaran abdad1f6d3 Merge pull request #7983 from filecoin-project/asr/snap-paths-master
Fix: sealer: ReplicaUpdate should fetch the correct files
2022-01-20 15:21:18 -05:00
Aayush 752f4a3d67 Fix: sealer: ReplicaUpdate should fetch the correct files 2022-01-20 15:06:53 -05:00
Łukasz Magiera 550e2743d7 paych: Don't return settling/collected chennals from OutboundActiveByFromTo 2022-01-20 18:24:01 +01:00
Łukasz Magiera 8f9e730ad6 paych: Better off-chain errors 2022-01-20 18:19:27 +01:00
Łukasz Magiera 4235a97cf4 retrieval: OffChainRetrieval config 2022-01-20 18:19:27 +01:00
Łukasz Magiera 8b19b84140 paych: option to force off-chain get 2022-01-20 18:19:26 +01:00
Łukasz Magiera 5b585c0285 paych: reset fundsReqQueue correctly 2022-01-20 18:17:19 +01:00
Łukasz Magiera b0e7bc15c2 paych: Cleanup available fund logic 2022-01-20 18:17:19 +01:00
Łukasz Magiera 533349cc0d paych: Fix cli tests 2022-01-20 18:17:18 +01:00
Łukasz Magiera eab8fecd26 gen stuff 2022-01-20 18:17:17 +01:00
Łukasz Magiera 1f2621b574 Make retrieval work with reused channels 2022-01-20 18:16:00 +01:00
Łukasz Magiera ff8b95df93 paych: Reserve flag for add-funds cli 2022-01-20 18:16:00 +01:00
Łukasz Magiera 8f6f21c94c paych: Print available amounts in paych status 2022-01-20 18:16:00 +01:00
Łukasz Magiera 7a938b2dea paych: Output FIL in cli 2022-01-20 18:16:00 +01:00
Łukasz Magiera 2e76375e8a Fix paych itests 2022-01-20 18:16:00 +01:00
Łukasz Magiera 9715113898 paych: Test pre-funding 2022-01-20 18:15:59 +01:00
Łukasz Magiera 8e46b9ea5d paych: API to pre-fund channels 2022-01-20 18:15:46 +01:00
Łukasz Magiera 33dfcf2663 stores: Fix single post proof reading with updated sectors 2022-01-20 15:27:42 +01:00
Aarsh Shah 7508d96327 fix lint 2022-01-20 16:47:15 +04:00
Aarsh Shah b8bf2af3e3 upgrade on master 2022-01-20 16:34:13 +04:00
Aarsh Shah 9ee940098d Merge remote-tracking branch 'origin/master' into feat/cid-to-piece-idx 2022-01-20 16:21:48 +04:00
Łukasz Magiera e476cf7968 Merge remote-tracking branch 'origin/master' into feat/post-worker 2022-01-20 13:15:48 +01:00
Łukasz Magiera c315111bc7 Merge pull request #7969 from filecoin-project/feat/libp2p18
libp2p v0.18.0-rc1 and initial resource manager integration
2022-01-20 12:59:39 +01:00
Dirk McCormick 8a47a71772 feat: update to go-fil-markets v1.19.0 2022-01-20 11:46:17 +01:00
Łukasz Magiera b115e2879a don't defer in a loop 2022-01-20 11:19:57 +01:00
vyzo 73ec10a49e close the rcmgr on shutdown 2022-01-20 11:47:39 +02:00
vyzo 325a4c0e5b fix lint 2022-01-20 11:46:39 +02:00
vyzo b360c9403f make gen and friends 2022-01-20 11:44:01 +02:00
vyzo ca4ee1e8cf fix issues with fil-markets/data-transfer updates 2022-01-20 11:38:37 +02:00
vyzo 2e5474e864 update go-fil-markets@v0.19.0-rc1 2022-01-20 11:37:08 +02:00
vyzo 19c8ea3288 add description for net stat and limit commands 2022-01-20 11:36:11 +02:00
vyzo 6260271b78 go mod: update go-libp2p-resource-manager@v0.1.2 2022-01-20 11:36:11 +02:00
vyzo 83427c478f go mod: update go-yamux@v3.0.2 2022-01-20 11:36:11 +02:00
vyzo 0870f48b5c fix mocknet.New invocation 2022-01-20 11:36:11 +02:00
vyzo c3fb68545a fix mocknet.New invocation 2022-01-20 11:36:11 +02:00
vyzo aa599bfaf9 go mod: update go-libp2p-pubsub 2022-01-20 11:36:11 +02:00
vyzo 62c0f35b5a go mod: go-libp2p-resource-manager@v0.1.1 2022-01-20 11:36:11 +02:00
vyzo 0de1566eaf add net stat and limit cli 2022-01-20 11:36:11 +02:00
vyzo 39bf59d372 add examples to docgen 2022-01-20 11:36:11 +02:00
vyzo 554848fe6b add resource manager Net(Set)Limit api 2022-01-20 11:36:11 +02:00
vyzo d05d5bcb70 add resource manager NetStat api 2022-01-20 11:36:11 +02:00
vyzo 8d3f98fe38 instantiate resource manager in DI 2022-01-20 11:36:11 +02:00
vyzo 826cdb2186 use the libp2p connmgr 2022-01-20 11:36:11 +02:00
vyzo c394fbdfc3 go mod: go-libp2p-resource-manager 2022-01-20 11:36:11 +02:00
vyzo 2fb5837a55 go mod: go-libp2p@v0.18.0-rc1 2022-01-20 11:36:11 +02:00
Cory Schwartz 8cbf1a3e1b undo tmp edits 2022-01-19 12:30:36 -08:00
Łukasz Magiera 04ce49130a Merge pull request #7979 from filecoin-project/asr/cherry-picks
chore: merge release/v1.14.0 PRs into master
2022-01-19 18:17:21 +01:00
Aayush Rajasekaran 3ff23ecbfa :fix: checkReplica incorrectly returns ErrBadPR 2022-01-19 12:00:27 -05:00
Aayush Rajasekaran ab8bf393c2 create replica update paths in acquireSectors 2022-01-19 11:41:38 -05:00
Aayush Rajasekaran d0390181ec feat: sealing: Add ReplicaUpdate work to Resource table 2022-01-19 11:41:32 -05:00
Łukasz Magiera 2f5c036faa Merge pull request #7918 from filecoin-project/jennijuju-patch-1
chore: update PR template
2022-01-19 10:48:24 +01:00
Łukasz Magiera c41ccb6c37 chore: remove inaccurate comment in sealtasks 2022-01-19 10:46:37 +01:00
Aarsh Shah 9e40e246ec deps update 2022-01-19 11:36:07 +04:00
Cory Schwartz afac38e492 spelling 2022-01-18 17:36:44 -08:00
Cory Schwartz 1cd93e63fd edge 2022-01-18 17:35:34 -08:00
Cory Schwartz a3458213f4 Merge branch 'master' into digitalocean-use-snap 2022-01-18 17:02:41 -08:00
Aayush Rajasekaran c0f29ea9c6 Merge pull request #7966 from filecoin-project/asr/compute-state-vm
Fix: chain: create a new VM for each epoch
2022-01-18 14:11:02 -05:00
Łukasz Magiera fa09b9afb1 post workers: Share resource accounting code 2022-01-18 16:02:37 +01:00
Łukasz Magiera 7dba12fc81 Merge pull request #7967 from filecoin-project/chore/mod-comments
chore: Cleanup go.mod
2022-01-18 15:18:19 +01:00
Łukasz Magiera 95442094df Merge pull request #7959 from filecoin-project/feat/update-data-transfer-graphsync
feat(deps): update markets stack
2022-01-18 15:08:59 +01:00
Dirk McCormick 1ce1dbbc50 feat: update go-fil-markets to tagged release 2022-01-18 14:29:59 +01:00
Łukasz Magiera 8ac20305df Fix double unlock in WorkerStats 2022-01-18 12:40:04 +01:00
Łukasz Magiera 98fed009d7 docsgen 2022-01-18 12:21:30 +01:00
Łukasz Magiera c79f2b9d38 post workers: Fix lint 2022-01-18 12:11:59 +01:00
Łukasz Magiera b38141601c Untangle ffi from api 2022-01-18 11:57:04 +01:00
Łukasz Magiera 03fa955e9e Cleanup imports 2022-01-18 11:37:24 +01:00
Łukasz Magiera f41dd4feb6 gen 2022-01-18 11:28:55 +01:00
Łukasz Magiera f2496d87c9 post workers: Snapdeals updates 2022-01-18 11:25:04 +01:00
Łukasz Magiera 0c062f9c08 Merge remote-tracking branch 'origin/master' into feat/post-worker 2022-01-18 10:49:42 +01:00
Łukasz Magiera d677826312 Cleanup go.mod 2022-01-18 10:24:43 +01:00
Aayush 9ec1abf880 :Fix: create a new VM for each epoch 2022-01-17 16:28:22 -05:00
hannahhoward 92d56d82f4 feat(deps): update markets stack
update go-fil-markets, go-data-transfer 1.13.0, go-graphsync 0.12.0
2022-01-14 17:21:04 -08:00
Aayush Rajasekaran f628e121df Merge pull request #7957 from filecoin-project/asr/conn-mgr-revert
Use go-libp2p-connmgr v0.3.1
2022-01-14 17:57:51 -05:00
Aayush 2b29ceab83 Use go-libp2p-connmgr v0.3.1 2022-01-14 17:38:56 -05:00
Łukasz Magiera 4a874eff70 post workers: Cleanup, tests 2022-01-14 14:17:52 +01:00
Peter Rabbitson e3c250f240 Force float in output to remain decimal 2022-01-14 13:17:45 +01:00
Cory Schwartz 899db1f7c3 fix template 2022-01-14 03:07:20 -08:00
Cory Schwartz d9562e2aee restore appiamge 2022-01-14 03:01:12 -08:00
Peter Rabbitson d568d6fabc As per Why&Aayush: slashing deals is not really a thing 2022-01-13 20:03:33 +01:00
c r da6752eccb feat: #7747 sealing: Adding conf variable for capping number of concurrent unsealing jobs (#7884)
* adding the new variables- now time for logic

* putting parameters into right placeS

* adding unsealing throttle

* fixing linter issues

* removing one last thing...
2022-01-13 12:26:13 -06:00
Peter Rabbitson 9a5b13b7c8 Storage stats 2.0 2022-01-13 17:21:13 +01:00
Aarsh Shah 8459d75597 update index provider config 2022-01-13 16:15:43 +04:00
Aarsh Shah b780a64ed9 send markets multiaddrs to the engine 2022-01-13 15:31:15 +04:00
Jiaying Wang 60fae3a59d Merge pull request #7922 from filecoin-project/build/15dev
build: release: bump master version to v1.15.0-dev
2022-01-12 20:11:02 -05:00
Jennifer Wang c1d04a9d13 bump master version to v1.15.0-dev 2022-01-12 19:28:08 -05:00
Aayush Rajasekaran 424c27bada Merge pull request #7932 from filecoin-project/ntwk-butterfly-snapnet
feat: build: butterfly SNAPNET
2022-01-12 19:24:31 -05:00
Aayush Rajasekaran 3c57b980e5 Merge pull request #7940 from filecoin-project/steb/buffered-blockstore-correctness
correctness fixes for the autobatch blockstore
2022-01-12 19:17:03 -05:00
Aayush Rajasekaran 52411b12e3 Resolve conflict 2022-01-12 19:15:56 -05:00
Aayush Rajasekaran 6f8d00310b Merge branch 'master' into ntwk-butterfly-snapnet 2022-01-12 19:12:02 -05:00
Aayush Rajasekaran f955084572 Merge pull request #7871 from filecoin-project/jen/7869
fix: #7869 sealing: Add more deal expiration checks during PRU pipeline
2022-01-12 18:50:50 -05:00
Aayush Rajasekaran d923620d5a go mod tidy 2022-01-12 18:49:24 -05:00
Steven Allen 2a862d497f correctness fixes for the autobatch blockstore
1. Simplify shutdown and make it idempotent by using a context.
2. Make sure `Flush` actually _fully_ flushes if the previous flush failed.
3. Don't clear the flush batch if flushing fails.
2022-01-12 15:19:44 -08:00
Aayush Rajasekaran bda4e5be95 Appease the linter 2022-01-12 18:10:07 -05:00
Aayush Rajasekaran ae12c70afe Merge pull request #7939 from filecoin-project/asr/migration-autobatch
fix: blockstore: Add missing locks to autobatch::Get()
2022-01-12 17:55:31 -05:00
Aayush Rajasekaran efe9ec4906 Add missing locks to Get() 2022-01-12 17:22:54 -05:00
Aayush Rajasekaran b161f56bd2 Merge pull request #7933 from filecoin-project/asr/migration-autobatch
feat: state: Fast migration for v15
2022-01-12 17:17:49 -05:00
Aayush Rajasekaran 3464dc2fdf Don't lock in Get 2022-01-12 16:04:47 -05:00
Aayush Rajasekaran 893998cb70 Address review part 2 2022-01-12 15:03:34 -05:00
Aayush Rajasekaran 083c5b003c Address review 2022-01-12 12:57:34 -05:00
Aarsh Shah 8c8652e7bb add a new cli 2022-01-12 18:06:48 +04:00
Aarsh Shah 051d993d62 update markets 2022-01-12 17:48:12 +04:00
Aarsh Shah 07c842d6e0 lotus soup green 2022-01-12 17:43:56 +04:00
Aarsh Shah b9d3585f4c get tests working 2022-01-12 16:55:45 +04:00
Aarsh Shah 05afaf6094 make gen 2022-01-12 16:03:39 +04:00
Aarsh Shah 3a52f05692 green ci 2022-01-12 15:53:15 +04:00
Aarsh Shah 64bf3fccd2 update index provider dep 2022-01-12 15:05:27 +04:00
Aarsh Shah dec79c70a1 fix compilation 2022-01-12 15:03:46 +04:00
Aarsh Shah 21a8f71859 compiles 2022-01-12 14:59:09 +04:00
Aarsh Shah edfc2c215c Merge remote-tracking branch 'origin/main' into feat/cid-to-piece-idx 2022-01-12 12:48:54 +04:00
Jiaying Wang 16d491a134 update snap net upgrade epoch 2022-01-11 21:41:58 -05:00
Aayush Rajasekaran 7559e4311e Support faster Get, retry flushes on error 2022-01-11 20:30:34 -05:00
Aayush Rajasekaran a41b4acec3 Use channels to trigger flushes in a dedicated goroutine 2022-01-11 19:44:56 -05:00
Jennifer Wang fd50cd128a fix lint 2022-01-11 18:34:26 -05:00
Jennifer Wang e99b98873c Check piece before PRU2 instead of PRU1 as PRU2 is the heavy computation part 2022-01-11 18:34:20 -05:00
Jennifer Wang 6b953a03d0 just use checkPiece 2022-01-11 18:34:15 -05:00
Jennifer Wang 37a3e610b7 Add more deal expiration handling for snap deals 2022-01-11 18:34:10 -05:00
Aayush Rajasekaran f87d8d0b7f Merge pull request #7900 from filecoin-project/7891
enhancement: #7891 sectors: disable existing existing cc upgrade path 2 days before the upgrade epoch
2022-01-11 18:12:16 -05:00
Aayush Rajasekaran 5ff6148444 implement stubs 2022-01-11 18:03:37 -05:00
Jiaying Wang 0130b28879 Merge pull request #7923 from filecoin-project/jen/proofv11
chore: deps: Integrate proof v11.0.0
2022-01-11 17:49:43 -05:00
Jennifer Wang 4cdd830003 update network version for test ground 2022-01-11 17:46:49 -05:00
Jennifer Wang f1425dcb26 go mod tidy 2022-01-11 17:43:03 -05:00
Jennifer Wang cd8d3a0c88 Update the ntwk v15 name to OhSnap 2022-01-11 17:41:20 -05:00
Jennifer Wang 8729ee4fa2 add butterfly ohsnap epoch 2022-01-11 17:37:06 -05:00
Aayush Rajasekaran 544cfa63ab cache added cids 2022-01-11 17:22:36 -05:00
Jiaying Wang 0b9a2cc11c Merge branch 'master' into ntwk-butterfly-snapnet 2022-01-11 17:22:16 -05:00
Aayush Rajasekaran 25768a291e Implement an autobatcher 2022-01-11 17:20:10 -05:00
Aayush Rajasekaran 19bd9cf945 Update to actors v7.0.0-rc1 2022-01-11 17:20:08 -05:00
Aayush Rajasekaran 8aabe1b488 Fast migration for v15 2022-01-11 17:19:38 -05:00
Jiaying Wang 3a0f80da74 Merge pull request #7899 from filecoin-project/asr/butterfly
build: butterflynet: update genesis and bootstrappers
2022-01-11 17:06:14 -05:00
TheMenko 5911780735 remove test files since they have been split to other PR 2022-01-11 19:55:54 +01:00
Aayush Rajasekaran 1e24ef4d0d format 2022-01-11 12:50:34 -05:00
Aayush Rajasekaran 207d33eaba Merge pull request #7810 from filecoin-project/feat/snap-deals
Snap Deals Lotus Integration: FSM Posting and integration test
2022-01-11 12:46:55 -05:00
Aayush Rajasekaran d645c5fbab Remove unnecessary params from VerifyWinningPost 2022-01-11 12:06:39 -05:00
Łukasz Magiera 960759d22b address review 2022-01-11 17:31:27 +01:00
Jennifer Wang 5b7da270c9 Integrate proof v11.0.0 2022-01-10 23:45:04 -05:00
Jiaying Wang 58edb1b15d remove log change 2022-01-10 22:24:25 -05:00
Jiaying Wang 655051ef98 Update default-lotus-miner-config.toml 2022-01-10 22:23:55 -05:00
Jiaying Wang 93653d9a58 Merge branch 'feat/snap-deals' into 7891 2022-01-10 22:22:46 -05:00
TheMenko 492fb9d054 wallet basic tests with annotations for system test matrix 2022-01-11 02:16:53 +01:00
Aayush Rajasekaran 4e16d600b0 Merge pull request #7917 from filecoin-project/asr/params
chore: deps: Update go-paramfetch
2022-01-10 19:30:53 -05:00
Jiaying Wang fa8372a83b Update pull_request_template.md
- remove misc, can use chore instead
- add deps for area
2022-01-10 19:07:54 -05:00
Aayush Rajasekaran 9614f6db8d Update go-paramfetch 2022-01-10 19:03:26 -05:00
Łukasz Magiera e216aefd23 fix make gen 2022-01-10 18:24:00 +01:00
Łukasz Magiera cf7dd36829 Merge branch 'feat/decoupling-post-worker' of github.com:wusirdcenter/lotus into feat/decoupling-post-worker 2022-01-10 15:06:04 +01:00
Łukasz Magiera 3fb71cdfea Merge pull request #7897 from filecoin-project/feat/snap-gas
feat: #7880 gas: add gas charge for VerifyReplicaUpdate
2022-01-10 13:27:59 +01:00
Łukasz Magiera a01f5d4495 Merge pull request #7910 from filecoin-project/jen/releasetomaster
misc: build: v1.13.2 back to master
2022-01-10 13:26:25 +01:00
zenground0 d16c5d0e93 Fix hande deal recover return value bug 2022-01-10 15:47:20 +05:30
zenground0 825e2c9527 doscgen cli 2022-01-10 15:39:38 +05:30
zenground0 c309686679 Fix TooManyMarkedForUpgrade 2022-01-10 15:39:38 +05:30
zenground0 3dc3f55ecb Deflake more practically 2022-01-10 15:39:38 +05:30
zenground0 f59bfd65da Deflake snap deals integration test 2022-01-10 15:39:38 +05:30
zenground0 33f2d24f54 Snap Deals Integration
- FSM handles the actual cc upgrade process including error states
- PoSting (winning and window) works over upgraded and upgrading sectors
- Integration test and changes to itest framework to reduce flakes
- Update CLI to handle new upgrade
- Update dependencies
2022-01-10 15:39:38 +05:30
Jennifer Wang 03a4316dcd Merge branch 'releases' into jen/releasetomaster 2022-01-09 23:26:27 -05:00
Jiaying Wang 4cb5622d18 Merge pull request #7903 from filecoin-project/fix/conformance-bleeding-edge
FIX: #7904 CI: generated vectors from v7 for bleeding edge
2022-01-09 23:00:06 -05:00
Jiaying Wang 4abcdd80bf Merge pull request #7902 from filecoin-project/jennijuju-patch-1
misc: docs: remove issue number from the pr title
2022-01-09 22:49:58 -05:00
zenground0 4963fe7809 Fix template 2022-01-09 09:41:53 +05:30
zenground0 a64cf77e84 generated vectors from v7 for bleeding edge 2022-01-09 09:33:07 +05:30
Jiaying Wang 57fa377730 Update pull_request_template.md 2022-01-07 19:02:51 -05:00
Jiaying Wang d4f46122f7 Remove ticket number from the title
issue number in PR title is not that useful because reader cannot click it and need to mention the issue in the body for auto close either way.
2022-01-07 19:01:32 -05:00
Jennifer Wang bf23e59900 fix lint 2022-01-07 18:24:57 -05:00
Jennifer Wang c578efaabd Disable mark-for-upgrade two days before the network v15 OhSnap upgrade to avoid unexpected edge cases that may cause deal/sector failure 2022-01-07 18:05:36 -05:00
Aayush Rajasekaran a98ca86a45 Update butterflynet params 2022-01-07 16:54:15 -05:00
zenground0 b26d952d09 Deflake more practically 2022-01-07 22:20:49 +05:30
Jakub Sztandera 736fb5c5b0 Add gas charge for VerifyReplicaUpdate
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2022-01-07 15:18:08 +01:00
Jennifer Wang a777cf7166 remove power change 2022-01-07 00:37:14 -05:00
Aayush Rajasekaran 6ff889c8d6 Merge pull request #7890 from filecoin-project/asr/circsupply-fix
Fix: state: circsuypply calc around null blocks
2022-01-06 15:48:09 -05:00
Aayush Rajasekaran 5ec5ebac31 Fix circsuypply calc around null blocks 2022-01-05 14:17:40 -05:00
mz-sirius 793b5c7cc3 fix ci err 2022-01-05 21:41:21 +08:00
zenground0 237d0bb1b0 Deflake snap deals integration test 2022-01-05 08:24:46 -05:00
zenground0 61e173215b Snap Deals Integration
- FSM handles the actual cc upgrade process including error states
- PoSting (winning and window) works over upgraded and upgrading sectors
- Integration test and changes to itest framework to reduce flakes
- Update CLI to handle new upgrade
- Update dependencies
2022-01-05 03:10:31 -05:00
Łukasz Magiera 6f316cddbb Merge pull request #7881 from filecoin-project/raulk/fix/test-vector-runner
test vector runner fixes for v6 vectors
2022-01-04 22:46:10 +01:00
Raúl Kripalani 75d8c52004 tvx runner: exec: add support for multiple-level dirs. 2022-01-04 18:13:24 +00:00
mz-sirius 6867f017ec update ffi 2022-01-05 01:50:53 +08:00
mz-sirius 3fd55fa56b decoupling winningpost and windowpost from lotus-miner 2022-01-05 01:50:49 +08:00
Raúl Kripalani 572114b8ba Merge branch 'master' into raulk/fix/test-vector-runner 2022-01-04 17:34:16 +00:00
Raúl Kripalani 1215f26a84 tvx runner: improve error reporting. 2022-01-04 17:32:57 +00:00
Raúl Kripalani d4fa5a0f1d tvx runner: adjust gas pricing to cope with synthetic epochs. 2022-01-04 17:32:57 +00:00
Raúl Kripalani 2c3d0d826d tvx runner: use network version from variant. 2022-01-04 17:23:17 +00:00
Łukasz Magiera 100e198eb3 Merge pull request #7667 from filecoin-project/asr/shed-balances
Shed: Add a util to send a batch of messages
2022-01-04 17:15:13 +01:00
Łukasz Magiera 63d7ca328f Merge branch 'master' into asr/shed-balances 2022-01-04 16:52:37 +01:00
Łukasz Magiera b72b12a960 Merge pull request #7802 from filecoin-project/snapcraft-grade-no-develgrade
Snapcraft grade no develgrade
2022-01-04 11:14:28 +01:00
Łukasz Magiera 0523c946f9 Merge pull request #7851 from zl03jsj/fix/goc-gen-slice
fix: doc generation struct slice example value
2022-01-04 10:34:23 +01:00
zl 4172a3c8b7 ExampleValue for a silce is nil 2022-01-04 14:27:10 +08:00
Łukasz Magiera 9b11c4b319 Merge pull request #7852 from pefish/patch-1
fix: returned error not be accept correctly
2022-01-03 19:57:43 +01:00
emad22552 135186e33d go fmt ./client.go 2022-01-02 19:08:22 +03:30
pefish f82a262ffe Update wdpost_run.go 2021-12-29 17:37:37 +08:00
llifezou 4b685c5e26 Include worker name in sealing errors 2021-12-23 17:44:43 +08:00
Jiaying Wang 921fda94c7 Merge pull request #7759 from filecoin-project/feat/transfer-diagnostics
Add api for transfer diagnostics
2021-12-22 17:07:54 -05:00
hannahhoward 1078dff3a9 feat(storageminer): also list data transfers with no id 2021-12-22 13:41:56 -08:00
hannahhoward 8a923fb420 fix(storageminer): fix conditional 2021-12-22 13:41:56 -08:00
hannahhoward ced22687eb fix(cmd): fix cli peer decoding 2021-12-22 13:41:56 -08:00
hannahhoward 177282d9f9 fix(storageminer): lint/mod-tidy/extra checks 2021-12-22 13:41:55 -08:00
hannahhoward cddf63efe9 feat(storageminer): add api for transfer diagnostics
Add API + CLI for inspecting in depth diagnostics on graphsync transfers with a given peer
2021-12-22 13:41:29 -08:00
Aayush Rajasekaran 1bc987772c Merge pull request #7818 from filecoin-project/asr/vm-nvfactor
Refactor: VM: Remove the NetworkVersionGetter
2021-12-21 12:19:53 -05:00
Łukasz Magiera c755ceeffa Merge pull request #7812 from filecoin-project/feat/retry-ap-seek-start
fix: #7577 markets: When retrying Add Piece, first seek to start of reader
2021-12-21 18:06:47 +01:00
Dirk McCormick 6db8a862bb feat: update to go-fil-markets v1.14.1 2021-12-21 16:36:47 +01:00
Dirk McCormick 6311e53a76 feat: update to go-fil-markets v1.14.0 2021-12-21 11:23:38 +01:00
Łukasz Magiera ef65ddf351 Merge pull request #7814 from filecoin-project/feat/retrieval-ask-cli
feat: #6017 market: retrieval ask CLI command
2021-12-20 18:04:21 +01:00
Darko Brdareski a54ac2ef79 Remove FS, MEM, GAS leftover test anotations. 2021-12-20 17:00:01 +01:00
Darko Brdareski 86cf17c1f4 Remove bad annotation from gas_test.go 2021-12-20 16:51:09 +01:00
Łukasz Magiera daa2d89ef5 Merge pull request #7831 from shotcollin/master
misc: n/a sealing: Fix grammatical error in a log warning message
2021-12-20 16:03:58 +01:00
Dirk McCormick 0e53275d40 feat: retrieval-ask - if size param is zero use QueryOffer.Size 2021-12-20 16:03:03 +01:00
Darko Brdareski dda1a42a2a Merge branch 'bloxico/system-test-matrix' of https://github.com/filecoin-project/lotus into merge_lotus 2021-12-20 15:48:16 +01:00
shotcollin a259c7bd75 Merge pull request #1 from shotcollin/typo-fixes
fix typo in log warning
2021-12-19 17:10:39 -07:00
shotcollin d10d0a20b1 fix typo in log warning
very minor but this warning comes up a lot so it'd be nicer if it wasn't a grammatical error too
2021-12-19 17:07:11 -07:00
Cory Schwartz 70b8557b63 tmp, don't stop 2021-12-17 18:12:23 -08:00
Cory Schwartz 0e7e252951 set +e before cleanup 2021-12-17 18:07:54 -08:00
Cory Schwartz d53a9e877a cleanup script 2021-12-17 17:49:32 -08:00
Cory Schwartz a03e9e34ab reinstall snapd 2021-12-17 17:30:23 -08:00
Cory Schwartz d874c633d7 set -e after switch user 2021-12-17 17:14:53 -08:00
Cory Schwartz dedf46ed1f use correct snap name 2021-12-17 17:12:10 -08:00
Cory Schwartz d42f7e4a1c packer snap 2021-12-17 17:06:32 -08:00
Aayush Rajasekaran dd20829dbe Merge pull request #7762 from filecoin-project/feat/sectors-update-state-guard
sectors update-state checks if sector exists before changing its state
2021-12-17 19:21:26 -05:00
Aayush Rajasekaran 670bd993f3 Refactor: VM: Remove the NetworkVersionGetter 2021-12-17 19:14:21 -05:00
Aayush Rajasekaran 6f6f5d79fb Refactor: State: Let Rand get network versions 2021-12-17 18:54:17 -05:00
Aayush Rajasekaran 3f4eaa99d5 Refactor: State: Rename stmgr::GetNtwkVersion to GetNetworkVersion 2021-12-17 18:43:39 -05:00
Aayush Rajasekaran 94e1a833d6 Merge pull request #7816 from filecoin-project/asr/rand-refactor
refactor: state: Move randomness versioning out of the VM
2021-12-17 15:57:10 -05:00
gstuart 27e48d73dd Check if sector exists before changing its state 2021-12-17 14:32:18 -05:00
Aayush Rajasekaran aa1b770974 Rand: Refactor so that versioning lives in StateRand 2021-12-17 13:58:53 -05:00
Dirk McCormick bb56e97177 fix: rename query-retrieval-ask to retrieval-ask 2021-12-17 18:01:12 +01:00
dirkmcandŁukasz Magiera 0f22d51309 Update cli/client.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-12-17 17:54:32 +01:00
Dirk McCormick b1734f84b3 feat: retrieval ask CLI command 2021-12-17 15:55:12 +01:00
Dirk McCormick 839fc8df7d fix: when retrying Add Piece, first seek to start of reader 2021-12-17 14:44:51 +01:00
Łukasz Magiera a4728d3c72 Merge pull request #7578 from filecoin-project/rvagg/SimultaneousTransfersForStoragePerClient
feat(graphsync): allow setting of per-peer incoming requests for miners
2021-12-17 14:27:15 +01:00
Łukasz Magiera 6806bff57b Merge pull request #7646 from filecoin-project/deps/update-ctx-dsbs
updating to new datastore/blockstore code with contexts
2021-12-17 13:50:46 +01:00
Łukasz Magiera 66f8f8aff2 fix shed 2021-12-17 13:05:44 +01:00
Łukasz Magiera bc384c01e3 Merge remote-tracking branch 'origin/master' into deps/update-ctx-dsbs 2021-12-17 13:01:22 +01:00
vyzo 976a3a5e7b fix blockstore test contexts 2021-12-17 13:44:05 +02:00
Łukasz Magiera 122b319520 don't update ffi 2021-12-17 11:45:40 +01:00
Łukasz Magiera 29d5976c01 Merge pull request #7774 from filecoin-project/asr/shed-pieces
Shed: Add a util to list terminated deals
2021-12-17 11:26:01 +01:00
vyzo cd266a05d2 fix tests 2021-12-17 12:04:04 +02:00
vyzo 6ba2533e2b fix lotus-shed 2021-12-17 11:47:28 +02:00
vyzo dd327f0b22 plumb more contexts 2021-12-17 11:42:09 +02:00
Aayush Rajasekaran 927448601c Merge pull request #7811 from filecoin-project/asr/vm-circ
VM: Circ supply should be constant per epoch
2021-12-17 01:03:26 -05:00
Aayush Rajasekaran 1f04cc1f23 VM: Circ supply should be constant per epoch 2021-12-17 00:29:55 -05:00
Jiaying Wang ec6580d840 Merge pull request #7726 from filecoin-project/jen/pull-request-template
chore: create pull_request_template.md
2021-12-17 00:07:01 -05:00
Rod Vagg 9e7d9affbe feat(graphsync): allow setting of per-peer incoming requests for miners 2021-12-17 15:04:16 +11:00
Jiaying Wang 52fbee6749 Update .github/pull_request_template.md 2021-12-16 23:01:03 -05:00
Jiaying Wang 0f0a70e251 Update .github/pull_request_template.md 2021-12-16 23:00:58 -05:00
Jennifer Wang fac769ff17 i forced pushed and brought a bug that was fixed back so im fixing it back 2021-12-16 22:25:00 -05:00
Aayush Rajasekaran 690be5bf7f Merge pull request #7321 from filecoin-project/asr/msg-limit
Mempool msg selection should respect block message limits
2021-12-16 22:13:07 -05:00
Aayush Rajasekaran 1d8de2791a Merge pull request #7784 from filecoin-project/next
Merge v15 work into master
2021-12-16 22:12:14 -05:00
Darko Brdareski 3e32aa896c Annotate client storage deals feature 2021-12-16 14:36:02 +01:00
Cory Schwartz 65ecca2904 restore .circleci 2021-12-15 15:54:40 -08:00
Aayush Rajasekaran 62de84d5b6 Deps: Update drand to 1.3.0 2021-12-15 18:34:21 -05:00
Cory Schwartz 2f30322a4e try stable 2021-12-15 15:01:42 -08:00
Cory Schwartz 145c862ee0 tmp: publish to snapcraft edge 2021-12-15 14:49:56 -08:00
Cory Schwartz bd1bec5c93 remove devel grade 2021-12-15 14:48:19 -08:00
Darko Brdareski 2f1f35cc71 Annotate storage miner features 2021-12-15 15:30:42 +01:00
Darko Brdareski be1123b5df Merge branch 'wallet_tests_stm' 2021-12-15 12:28:06 +01:00
TheMenko 5ccb4586b5 add header annotations 2021-12-15 12:27:19 +01:00
TheMenko d8d708704d Merge branch 'msgpool_tests_stm'
message pool tests
2021-12-15 12:20:57 +01:00
TheMenko 063eefe896 Merge branch 'wallet_tests_stm'
wallet tests
2021-12-15 12:20:22 +01:00
TheMenko 65819140dd annotated tests for messagepool 2021-12-15 00:56:05 +01:00
Aayush Rajasekaran 0e2278cc76 Merge branch 'master' into deps/update-ctx-dsbs 2021-12-14 18:08:29 -05:00
Aayush Rajasekaran bdd56d2516 Deps: Update go-car to v0.3.3 2021-12-14 18:06:28 -05:00
Aayush Rajasekaran 7fb590208c Deps: Update lotus-soup to point to tagged releases 2021-12-14 18:05:52 -05:00
Aayush Rajasekaran 02b00c025a Deps: Update go-fil-markets to v1.13.5 2021-12-14 17:55:55 -05:00
Aayush Rajasekaran 8935c4386c Deps: Update go-ipld-cbor to v0.0.6 2021-12-14 17:53:11 -05:00
Aayush Rajasekaran bcd2c71031 Deps: Update go-storedcounter to v0.1.0 2021-12-14 17:51:49 -05:00
Aayush Rajasekaran 69495f5b59 Deps: Update dagstore to v0.4.4 2021-12-14 17:50:18 -05:00
Aayush Rajasekaran 3f703ff8a4 Deps: Update go-car/v2 to v2.1.1 2021-12-14 16:54:22 -05:00
Aayush Rajasekaran 46d8ae47dc Deps: Update go-ipld-prime to v0.14.3 2021-12-14 16:41:34 -05:00
Aayush Rajasekaran 5bc4ee257f Deps: Update go-ds-badger2 to v0.1.2 2021-12-14 16:33:38 -05:00
Aayush Rajasekaran aac6d88f72 Deps: Update actors v2 to v2.3.6 2021-12-14 12:49:18 -05:00
vyzo f00698aafd fix more paychmgr tests 2021-12-14 19:01:51 +02:00
vyzo e1634128c1 fix paychmgr test 2021-12-14 18:48:17 +02:00
Aayush Rajasekaran a3ea3ad911 Deps: Update actors v2 2021-12-14 11:39:06 -05:00
vyzo 0eec00055f fix lotus-soup build 2021-12-14 18:23:43 +02:00
vyzo e8df325796 update lotus-soup deps 2021-12-14 18:23:33 +02:00
Darko Brdareski ec8baf23d8 Annotate message signer subsystem 2021-12-14 17:21:01 +01:00
vyzo 63487e1d69 fix checkpoint test 2021-12-14 18:05:23 +02:00
vyzo a0353c8627 fix messagepool selection test 2021-12-14 18:01:34 +02:00
vyzo 6ecbcebd44 fix messagepool repub test 2021-12-14 17:57:37 +02:00
Darko Brdareski 0f83a0a634 Annotate paych tests 2021-12-14 16:56:16 +01:00
vyzo e6a8c278f5 fix messagepool test mock provider 2021-12-14 17:53:31 +02:00
vyzo 780dfa0c7c fix ReorgOps incantation in events test 2021-12-14 17:49:34 +02:00
vyzo 5e692f9071 fix more tests 2021-12-14 17:45:38 +02:00
vyzo 40c61a310f fix splitstore test 2021-12-14 17:17:30 +02:00
vyzo 22ce395130 fix some unit tests 2021-12-14 17:05:10 +02:00
vyzo 716b4a3b09 hook a great context in the sky to satisfy DI; sigh... 2021-12-14 16:57:09 +02:00
vyzo eb48dc9b68 fix issues with new peerstore constructor signature in DI 2021-12-14 16:21:55 +02:00
vyzo fc7d4a13b0 fix itests 2021-12-14 16:06:59 +02:00
vyzo 73ca65a6ff update drand 2021-12-14 15:55:00 +02:00
vyzo f157ac9b68 update for new ConnManager constructor 2021-12-14 15:30:29 +02:00
vyzo 773f896bcd update go-libp2p-connmgr to v0.3 2021-12-14 15:27:34 +02:00
vyzo 0001a6bad0 update go-libp2p to v0.17 2021-12-14 15:26:15 +02:00
Darko Brdareski a64f2421d2 Annotate 'incoming' subsystem 2021-12-14 11:33:33 +01:00
Aayush Rajasekaran 8a42462271 Merge pull request #7781 from filecoin-project/asr/update-ffi
Update FFI
2021-12-13 18:38:17 -05:00
Aayush Rajasekaran b08bf32040 Add a log for when message selection fails 2021-12-13 18:31:31 -05:00
Aayush Rajasekaran a45803d8a0 Mempool: add selection tests 2021-12-13 18:28:05 -05:00
Aayush Rajasekaran ec00e73c9d Mempool: Selection should respect CBOR limits 2021-12-13 18:28:05 -05:00
Aayush Rajasekaran dd20cb7301 Consensus: Safety check against unknown sig types 2021-12-13 18:28:05 -05:00
Aayush Rajasekaran ac3cdf75fa Mempool: Selection logic should respect block message limits 2021-12-13 18:28:05 -05:00
Aayush Rajasekaran 3e288f1066 Update FFI 2021-12-13 15:47:17 -05:00
Aayush Rajasekaran 80d5e52923 Merge branch 'master' into next 2021-12-13 13:24:28 -05:00
Dirk McCormick a51b08e386 feat: add IndexerProvider AnnounceAddress config 2021-12-13 18:24:05 +01:00
Masih H. Derkani 6b7b9793ab Set default index provider ingest config values
Set default values for index-provider ingest config.

Leave a TODO to use provider config APIs once defaults exposed.

Run `go mod tidy`
2021-12-13 14:44:56 +00:00
vyzo e4233e45be plumb contexts in lotus-sim 2021-12-13 15:15:38 +02:00
vyzo 47bac4a0c9 plumb context in tvx 2021-12-13 15:03:54 +02:00
vyzo b31480232b plumb contexts in conformance 2021-12-13 14:59:52 +02:00
vyzo 73c7e9edf1 go mod tidy 2021-12-13 14:47:01 +02:00
vyzo 5eb5fcd0f4 fix lotus-bench 2021-12-13 14:46:49 +02:00
Darko Brdareski fbcb05388e Remove last bad annotations 2021-12-13 13:44:15 +01:00
Darko Brdareski 0addca1070 Fix bad annotations 2021-12-13 13:41:04 +01:00
vyzo a8fcaeb141 plumb contexts in lotus-shed 2021-12-13 14:35:24 +02:00
vyzo 2e057b8f52 plumb contexts in lotus-miner 2021-12-13 14:28:29 +02:00
vyzo 84710cf27e plumb more contexts in lotus 2021-12-13 14:26:59 +02:00
vyzo 7ed40c1ec7 go get drand@release/v1.3 2021-12-13 14:17:05 +02:00
vyzo 97a91f23f1 update go-ds-measure and go-filestore 2021-12-13 14:12:14 +02:00
Darko Brdareski 5065626984 Merge remote-tracking branch 'origin/wallet_tests_stm' into syncer_tests 2021-12-13 11:17:03 +01:00
TheMenko 15263bc0d7 basic tests for local and multi wallets 2021-12-13 11:16:06 +01:00
Jennifer Wang 8c4c2eeffc add client address 2021-12-13 04:02:53 -05:00
Aayush Rajasekaran d7528557df Shed: Add a util to list terminated deals 2021-12-12 22:37:05 -05:00
Łukasz Magiera dc26f3bd74 Merge pull request #7750 from filecoin-project/gstuart/lotus-vm-gas-tracing-env-var
Expose EnableGasTracing as an env_var
2021-12-12 12:16:24 +01:00
Łukasz Magiera 8652f80ab3 Merge pull request #7760 from filecoin-project/feat/open-telemetry-fix
Minor improvement for OpenTelemetry
2021-12-12 12:14:55 +01:00
Aayush Rajasekaran e5895af4a2 Update go-ipld-cbor 2021-12-11 18:15:35 -05:00
Aayush Rajasekaran dfb65ed89f Plumb contexts through 2021-12-11 17:04:00 -05:00
Aayush Rajasekaran 6c31cecc7d Update markets 2021-12-11 14:37:37 -05:00
Aayush Rajasekaran 095361bead Update carv2 2021-12-10 19:15:53 -05:00
gstuart 9108828aeb Make Lotus vm gas tracing an env var 2021-12-10 17:27:44 -05:00
hannahhoward 8e376c84cf feat(tracing): setup logging 2021-12-10 13:50:12 -08:00
Darko Brdareski 0169d0dafd Annotate state feature tests 2021-12-10 16:08:25 +01:00
Łukasz Magiera a0d76bda99 Merge pull request #7749 from filecoin-project/gstuart/sort-lotus-miner-retrieval-deals
Sort lotus-miner retrieval-deals by dealId
2021-12-10 12:16:00 +01:00
Łukasz Magiera 36f1a8f3ca Merge pull request #7746 from filecoin-project/feat/faster-retrieval
Make retrieval even faster
2021-12-10 12:01:01 +01:00
Darko Brdareski f04bae3f0b Annotate rand_test 2021-12-10 11:41:24 +01:00
Darko Brdareski 95f86f9de0 Annotate feature syncer 2021-12-10 11:33:29 +01:00
Łukasz Magiera e8ef39e734 stores: Reduce log spam during retrievals 2021-12-10 11:28:04 +01:00
Aayush Rajasekaran 702a7815b9 Update go-car 2021-12-09 22:46:30 -05:00
Aayush Rajasekaran 276eabd4e5 Update go-storedcounter and go-ds-versioning 2021-12-09 22:31:46 -05:00
Jiaying Wang 509aea5d04 Merge pull request #7751 from filecoin-project/fix/getnode
dep/fix 7701 Dependency: update to ipld-legacy to v0.1.1
2021-12-09 21:16:53 -05:00
Jennifer Wang f7a49e7be7 update to ipld-legacy to v0.1.1 2021-12-09 21:02:24 -05:00
gstuart 21e6c963ab Sort lotus-miner retrieval-deals by dealId 2021-12-09 19:53:13 -05:00
Łukasz Magiera 74d3ba6b5e fix lint 2021-12-09 18:10:34 +01:00
Masih H. Derkani 43cde484f4 Upgrade go-legs to a version with debugging features
In order to debug the gossipsub issue, upgrade go-legs to a branch that
implments an admin HTTP API to allow checking peerstate connecting to a
host and explicitly publishing CIDs.

This is to reduce the roundtrip time we have to wait for a deal to be
made and advertisement published to debug issues.

Admin server runs on localhost only and will not be present in the final
version of go-legs or will be disabled.

See:
- https://github.com/filecoin-project/go-legs/pull/47
2021-12-09 16:23:12 +00:00
Łukasz Magiera c31f4de7d5 Fix mock ReadPiece 2021-12-09 16:26:59 +01:00
Łukasz Magiera 6fd1609410 fr32: Reduce MTTresh from 32M to 512k per core
This results in 64x less bytes allocated when spawning new readers
for larger pieces.

Results in about 30% speedup in 1G unpad benchmark on AMD TR 2950x
2021-12-09 16:14:47 +01:00
Łukasz Magiera 9c75a3aaa8 piecereader: Avoid allocating 1024MB slices per read 2021-12-09 15:49:43 +01:00
Łukasz Magiera a3d8494a04 piecereader: Avoid redundant roundtrips when seeking 2021-12-09 14:52:33 +01:00
vyzo a9e22df765 update deps 2021-12-09 15:14:48 +02:00
Aayush Rajasekaran b9b4a2659d Update go-data-transfer 2021-12-09 14:12:25 +02:00
whyrusleeping 072297e661 WIP: updating to new datastore/blockstore code with contexts 2021-12-09 14:12:25 +02:00
Łukasz Magiera 13b260e7f7 piecereader: Move closer to storage 2021-12-08 23:20:20 +01:00
ZenGround0 ac31651a42 Merge pull request #7730 from filecoin-project/feat/sector-storage-unseal
Feat/sector storage unseal
2021-12-08 10:10:21 -05:00
Łukasz Magiera 49c619d65d Merge pull request #7735 from filecoin-project/feat/storlocks-cmd
Command to list active sector locks
2021-12-08 00:11:17 +01:00
Aayush Rajasekaran b0a9a27288 Shed: Allow send-csv to specify params and method 2021-12-07 17:14:29 -05:00
Aayush Rajasekaran c9a557e0d9 Address review 2021-12-07 17:09:07 -05:00
Aayush Rajasekaran fcb7cd0eb0 Shed: Add a util to send a batch of messages 2021-12-07 17:09:07 -05:00
Łukasz Magiera 9ccd4ee240 Merge pull request #7737 from filecoin-project/feat/opt-ds-pr
dagstore pieceReader: Always read full in ReadAt
2021-12-06 23:14:21 +01:00
Łukasz Magiera 84c48de5d9 CARv2 v2.1.0 2021-12-06 15:39:03 +01:00
Łukasz Magiera 9f6265e0b4 dagstore pieceReader: Fix wrong ErrUnexpectedEOF return in ReadAt 2021-12-03 23:36:36 +01:00
zenground0 a5be80828a RemoveData and Decode
- Unsealing replica update with sector key works and tested
- Sector key generation added and tested
2021-12-03 15:21:06 -05:00
Łukasz Magiera 3969d6b767 dagstore pieceReader: Always read full in ReadAt 2021-12-03 20:14:35 +01:00
Łukasz Magiera dad9190142 Add metrics to dagstore piecereader 2021-12-03 17:07:14 +01:00
Łukasz Magiera 9d143426ee Merge pull request #7734 from filecoin-project/feat/splitstore-upgrade-protection
SplitStore: supress compaction near upgrades
2021-12-03 15:18:07 +01:00
Łukasz Magiera 727765b248 Command to list active sector locks 2021-12-03 12:33:23 +01:00
Masih H. Derkani 780c40329e Upgrade to the latest indexer dependencies
Do not upgrade to the latest storetheindex, because it uses go-ipfs for
bootstrapping mechanism and that comes with dependencies that we don not
wish to upgrade in lotus just now; namely:
- go-bitswap
- go-path
- interface-go-ipfs-core
- go-libp2p-kad-dht
- go-libp2p-quic-transport
2021-12-03 10:29:17 +00:00
vyzo 489782e21b satisfy the spellchecker that masquarades as a linter 2021-12-03 12:15:28 +02:00
vyzo 5d6398f20e hook the upgrade schedule to splitstore start 2021-12-03 12:11:54 +02:00
vyzo 6ce5879071 add unit test for compaction supression 2021-12-03 12:05:15 +02:00
vyzo 05c1325885 add logic for supressing compaction near upgrade boundaries 2021-12-03 11:50:35 +02:00
Łukasz Magiera 9331714089 Merge pull request #7707 from filecoin-project/fix/app-image-build
Disable appimage
2021-12-02 14:39:48 +01:00
Łukasz Magiera d5e1cc095c Merge pull request #7725 from filecoin-project/feat/open-telemetry
Initial switch to OpenTelemetry
2021-12-02 14:39:20 +01:00
Jiaying Wang c2437b7bf2 Create pull_request_template.md
This is the very first iteration of the lotus PR template. The goal of adding PR template is to standardize PR requests and encourage contributors to:
- come up with good PR descriptions to give code reviewers a clear overview of what's in the PR 
- have a clear PR title as lotus generates a change log based on it
- check that tests and documentation for the codes that changed are icnluded 

The PR type follows the https://www.conventionalcommits.org/en/v1.0.0-beta.2/.  The [contribution guideline](https://github.com/filecoin-project/lotus#contribute) should be updated with how to create a pr after the template is accepted.
2021-12-01 22:37:22 -05:00
hannahhoward bfd1099ef3 fix(main): fix bug in startup when tracing is not present 2021-12-01 18:53:00 -08:00
hannahhoward f3b691d618 feat(tracing): switch to OpenTelemetry
Switch the underlying tracing library to OpenTelemetry, with a bridge to OpenCensus for
compatibility
2021-12-01 16:19:47 -08:00
Travis Person 66c8c66f40 disable building of appimage on release
appimage testing is currently broken due to a requirement to have access
to /dev/snd, which is not present on the image we are using in circleci.
2021-12-01 19:15:35 +00:00
Jiaying Wang 0cfc344f82 Merge pull request #7717 from filecoin-project/jen/bumpmaster
Bump the master version to v1.13.3-dev
2021-11-30 19:06:46 -05:00
Jennifer Wang c3ecf8355d docs gen 2021-11-30 18:29:13 -05:00
Jennifer Wang a09aa0aa72 Bump the master version to v1.13.3-dev 2021-11-30 18:24:34 -05:00
ZenGround0 91f6d4b013 Merge pull request #7615 from filecoin-project/feat/snap-deals-storage
Feat/snap deals storage
2021-11-30 14:18:24 -05:00
zenground0 40d16a8f88 Review Response 2021-11-30 13:53:37 -05:00
zenground0 f88fcdbcfc WIP 2021-11-30 12:40:14 -05:00
c r e16e9ad343 reorder transfer checks so as to ensure sending more money than you have to yourself fails with an error (fixing issue 7596)
PR #7637, also adds tests to make sure behavior is correct across versions.
2021-11-29 17:26:47 -05:00
zenground0 7d2b3f05db WIP sector storage and integration test 2021-11-29 10:24:00 -05:00
Aayush Rajasekaran 9d4489360b Merge pull request #7617 from filecoin-project/asr/v7-actors
Integrate v7 actors
2021-11-19 15:25:45 -05:00
Aayush Rajasekaran 5f1783c9a5 Address review 2021-11-19 15:11:13 -05:00
Aarsh Shah 7655e660f3 integrate store-the-hash 2021-11-18 12:07:12 +04:00
Aayush Rajasekaran a5847fd06f Update actors 2021-11-17 20:33:18 -05:00
Aayush Rajasekaran 91fb111462 Update FFI 2021-11-17 17:50:36 -05:00
Aayush Rajasekaran 8665e32221 Update deps 2021-11-17 15:55:14 -05:00
Aayush Rajasekaran 07f1be0ff6 Plug in the FFI call 2021-11-17 15:55:14 -05:00
Aayush Rajasekaran 1449644c34 Integrate v7 actors 2021-11-17 15:55:14 -05:00
Anton Evangelatov 5454aebf13 CLI tools for the DAGStore inverted index (#7361)
* cli commands for dagstore

* address comments from Dirk

* rename inverted index to piece index
2021-11-17 15:39:45 +02:00
dirkmc a4fd3de0b0 Merge pull request #7634 from filecoin-project/feat/cli-announce-index
CLI command to announce deal to indexers
2021-11-17 13:55:15 +01:00
Dirk McCormick 599a6bfb24 fix: err message 2021-11-17 12:37:15 +01:00
Aarsh Shah 60fe55cdc0 fix lint and gen 2021-11-17 15:25:25 +04:00
Dirk McCormick 501308239f feat: CLI command to announce deal to indexers 2021-11-17 12:16:22 +01:00
Aarsh Shah 21e27b8034 Merge pull request #7622 from filecoin-project/feat/indexer-provider
Integrate indexer provider
2021-11-17 15:11:51 +04:00
Aarsh Shah 8d3017febb make gen should work 2021-11-17 15:02:11 +04:00
Aarsh Shah d196c236b8 fix lint 2021-11-17 14:55:09 +04:00
Aarsh Shah f8c675bc5e green tests 2021-11-17 14:48:28 +04:00
Aarsh Shah caf3cfa7d8 Merge branch 'feat/cid-to-piece-idx' into feat/indexer-provider 2021-11-17 11:43:49 +04:00
Aarsh Shah bfee6699d2 update go mod and inject store the hash index in dagstore 2021-11-17 11:42:14 +04:00
Dirk McCormick 627d4fbf74 wip: storage miner index provider 2021-11-16 17:45:42 +01:00
Anton Evangelatov a633f93707 upgrade go modules 2021-11-12 12:28:43 +01:00
Dirk McCormick 588d6ec828 fix: docs-gen 2021-11-12 09:43:42 +01:00
Dirk McCormick 025d8ebc59 feat: include TestDealRetrieveByAnyCid in CI 2021-11-12 09:43:42 +01:00
Aarsh Shah 189f5f8aae fix deals test 2021-11-12 09:43:42 +01:00
Dirk McCormick 3c37078a85 fix: dagstore wrapper test 2021-11-12 09:43:42 +01:00
Dirk McCormick e309293a47 fix: lint fixes 2021-11-12 09:43:42 +01:00
Aarsh Shah 4d87f16e95 better comparision in test 2021-11-12 09:43:42 +01:00
Aarsh Shah 053317e334 test for retrieval by any cid 2021-11-12 09:43:42 +01:00
Dirk McCormick 662c51605f feat: retrieve from any cid (not just root cid) 2021-11-12 09:43:42 +01:00
Menko f01015bac5 Merge pull request #1 from Bloxico/repo_test
Tests
2021-11-03 21:44:04 +01:00
TheMenko ad16bafa66 annotated paych_test 2021-11-03 21:31:33 +01:00
TheMenko b45924a234 annotated repo_test 2021-11-01 10:49:30 +01:00
TheMenko fb911a4542 annotated repo_test 2021-11-01 01:24:26 +01:00
TheMenko 9297e1b90d annotated repo_test 2021-10-31 12:24:07 +01:00
emad22552 4eaf89666f fix manual-stateless-deal with interactive
fix checking manual-stateless-deal with interactive deal making as --manual-stateless-deal can not be combined with interactive deal mode.
2021-10-26 14:00:41 +03:30
566 changed files with 30986 additions and 6345 deletions
+127 -91
View File
@@ -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
@@ -390,7 +414,7 @@ jobs:
build-appimage:
machine:
image: ubuntu-2004:202104-01
image: ubuntu-2004:202111-02
steps:
- checkout
- attach_workspace:
@@ -398,6 +422,16 @@ jobs:
- run:
name: install appimage-builder
command: |
# appimage-builder requires /dev/snd to exist. It creates containers during the testing phase
# that pass sound devices from the host to the testing container. (hard coded!)
# https://github.com/AppImageCrafters/appimage-builder/blob/master/appimagebuilder/modules/test/execution_test.py#L54
# Circleci doesn't provide a working sound device; this is enough to fake it.
if [ ! -e /dev/snd ]
then
sudo mkdir /dev/snd
sudo mknod /dev/snd/ControlC0 c 1 2
fi
# docs: https://appimage-builder.readthedocs.io/en/latest/intro/install.html
sudo apt update
sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace
@@ -473,9 +507,6 @@ jobs:
executor:
type: executor
default: golang
golangci-lint-version:
type: string
default: 1.27.0
concurrency:
type: string
default: '2'
@@ -494,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
@@ -618,6 +646,11 @@ jobs:
default: "latest"
description: A comma-separated string containing docker image tags to build and push (default = latest)
target:
type: string
default: "lotus-all-in-one"
description: Docker target to build
steps:
- run:
name: Confirm that environment variables are set
@@ -657,6 +690,7 @@ jobs:
docker build \
<<#parameters.extra-build-args>><<parameters.extra-build-args>><</parameters.extra-build-args>> \
--target <<parameters.target>> \
-f <<parameters.path>>/<<parameters.dockerfile>> \
$docker_tag_args \
<<parameters.path>>
@@ -669,42 +703,16 @@ jobs:
docker push $<<parameters.account-url>>/<<parameters.repo>>:${tag}
done
publish-packer-mainnet:
description: build and push AWS IAM and DigitalOcean droplet.
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:
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"
- packer_build:
template: tools/packer/lotus-snap.pkr.hcl
publish-dockerhub:
description: publish to dockerhub
machine:
@@ -785,6 +793,11 @@ workflows:
suite: itest-deals_512mb
target: "./itests/deals_512mb_test.go"
- test:
name: test-itest-deals_anycid
suite: itest-deals_anycid
target: "./itests/deals_anycid_test.go"
- test:
name: test-itest-deals_concurrent
suite: itest-deals_concurrent
@@ -850,6 +863,16 @@ 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
target: "./itests/mempool_test.go"
- test:
name: test-itest-multisig
suite: itest-multisig
@@ -880,6 +903,11 @@ workflows:
suite: itest-sector_finalize_early
target: "./itests/sector_finalize_early_test.go"
- test:
name: test-itest-sector_make_cc_avail
suite: itest-sector_make_cc_avail
target: "./itests/sector_make_cc_avail_test.go"
- test:
name: test-itest-sector_miner_collateral
suite: itest-sector_miner_collateral
@@ -890,6 +918,16 @@ workflows:
suite: itest-sector_pledge
target: "./itests/sector_pledge_test.go"
- test:
name: test-itest-sector_prefer_no_upgrade
suite: itest-sector_prefer_no_upgrade
target: "./itests/sector_prefer_no_upgrade_test.go"
- test:
name: test-itest-sector_revert_available
suite: itest-sector_revert_available
target: "./itests/sector_revert_available_test.go"
- test:
name: test-itest-sector_terminate
suite: itest-sector_terminate
@@ -920,6 +958,11 @@ workflows:
suite: itest-wdpost
target: "./itests/wdpost_test.go"
- test:
name: test-itest-worker
suite: itest-worker
target: "./itests/worker_test.go"
- test:
name: test-unit-cli
suite: utest-unit-cli
@@ -974,6 +1017,11 @@ workflows:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-lotus-soup
- build-macos:
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-appimage:
filters:
branches:
ignore:
@@ -985,6 +1033,7 @@ workflows:
requires:
- build-all
- build-macos
- build-appimage
filters:
branches:
ignore:
@@ -997,36 +1046,13 @@ workflows:
path: .
repo: lotus-dev
tag: '${CIRCLE_SHA1:0:8}'
- 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+)?$/
target: lotus-all-in-one
- build-and-push-image:
dockerfile: Dockerfile.lotus
path: .
repo: lotus-test
tag: '${CIRCLE_SHA1:0:8}'
target: lotus-test
- publish-snapcraft:
name: publish-snapcraft-stable
channel: stable
@@ -1063,3 +1089,13 @@ workflows:
- publish-dockerhub:
name: publish-dockerhub-nightly
tag: nightly
monthly:
triggers:
- schedule:
cron: "0 0 1 * *"
filters:
branches:
only:
- master
jobs:
- publish-packer-snap
+92 -91
View File
@@ -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
@@ -390,7 +414,7 @@ jobs:
build-appimage:
machine:
image: ubuntu-2004:202104-01
image: ubuntu-2004:202111-02
steps:
- checkout
- attach_workspace:
@@ -398,6 +422,16 @@ jobs:
- run:
name: install appimage-builder
command: |
# appimage-builder requires /dev/snd to exist. It creates containers during the testing phase
# that pass sound devices from the host to the testing container. (hard coded!)
# https://github.com/AppImageCrafters/appimage-builder/blob/master/appimagebuilder/modules/test/execution_test.py#L54
# Circleci doesn't provide a working sound device; this is enough to fake it.
if [ ! -e /dev/snd ]
then
sudo mkdir /dev/snd
sudo mknod /dev/snd/ControlC0 c 1 2
fi
# docs: https://appimage-builder.readthedocs.io/en/latest/intro/install.html
sudo apt update
sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace
@@ -473,9 +507,6 @@ jobs:
executor:
type: executor
default: golang
golangci-lint-version:
type: string
default: 1.27.0
concurrency:
type: string
default: '2'
@@ -494,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
@@ -618,6 +646,11 @@ jobs:
default: "latest"
description: A comma-separated string containing docker image tags to build and push (default = latest)
target:
type: string
default: "lotus-all-in-one"
description: Docker target to build
steps:
- run:
name: Confirm that environment variables are set
@@ -657,6 +690,7 @@ jobs:
docker build \
<<#parameters.extra-build-args>><<parameters.extra-build-args>><</parameters.extra-build-args>> \
--target <<parameters.target>> \
-f <<parameters.path>>/<<parameters.dockerfile>> \
$docker_tag_args \
<<parameters.path>>
@@ -669,42 +703,16 @@ jobs:
docker push $<<parameters.account-url>>/<<parameters.repo>>:${tag}
done
publish-packer-mainnet:
description: build and push AWS IAM and DigitalOcean droplet.
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:
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"
- packer_build:
template: tools/packer/lotus-snap.pkr.hcl
publish-dockerhub:
description: publish to dockerhub
machine:
@@ -809,6 +817,11 @@ workflows:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-lotus-soup
- build-macos:
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-appimage:
filters:
branches:
ignore:
@@ -820,6 +833,7 @@ workflows:
requires:
- build-all
- build-macos
- build-appimage
filters:
branches:
ignore:
@@ -832,36 +846,13 @@ workflows:
path: .
repo: lotus-dev
tag: '${CIRCLE_SHA1:0:8}'
- 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+)?$/
target: lotus-all-in-one
- build-and-push-image:
dockerfile: Dockerfile.lotus
path: .
repo: lotus-test
tag: '${CIRCLE_SHA1:0:8}'
target: lotus-test
- publish-snapcraft:
name: publish-snapcraft-stable
channel: stable
@@ -898,3 +889,13 @@ workflows:
- publish-dockerhub:
name: publish-dockerhub-nightly
tag: nightly
monthly:
triggers:
- schedule:
cron: "0 0 1 * *"
filters:
branches:
only:
- master
jobs:
- publish-packer-snap
+5 -4
View File
@@ -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"
+3 -3
View File
@@ -12,10 +12,10 @@
Before you mark the PR ready for review, please make sure that:
- [ ] All commits have a clear commit message.
- [ ] The PR title is in the form of `<PR type>: <area>: <change being made>`
- [ ] The PR title is in the form of of `<PR type>: <area>: <change being made>`
- example: ` fix: mempool: Introduce a cache for valid signatures`
- `PR type`: _fix_, _feat_, _INTERFACE BREAKING CHANGE_, _CONSENSUS BREAKING_, _build_, _chore_, _ci_, _docs_, _misc_,_perf_, _refactor_, _revert_, _style_, _test_
- `area`: _api_, _chain_, _state_, _vm_, _data transfer_, _market_, _mempool_, _message_, _block production_, _multisig_, _networking_, _paychan_, _proving_, _sealing_, _wallet_
- `PR type`: _fix_, _feat_, _INTERFACE BREAKING CHANGE_, _CONSENSUS BREAKING_, _build_, _chore_, _ci_, _docs_,_perf_, _refactor_, _revert_, _style_, _test_
- `area`: _api_, _chain_, _state_, _vm_, _data transfer_, _market_, _mempool_, _message_, _block production_, _multisig_, _networking_, _paychan_, _proving_, _sealing_, _wallet_, _deps_
- [ ] This PR has tests for new functionality or change in behaviour
- [ ] If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or [Discussion Tutorials.](https://github.com/filecoin-project/lotus/discussions/categories/tutorials)
- [ ] CI is green
+1 -1
View File
@@ -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
+2
View File
@@ -40,6 +40,8 @@ build/paramfetch.sh
/bundle
/darwin
/linux
*.snap
build/builtin-actors
*-fuzz.zip
/chain/types/work_msg/
+5 -2
View File
@@ -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
+5 -5
View File
@@ -49,23 +49,23 @@ AppDir:
fedora:
image: appimagecrafters/tests-env:fedora-30
command: ./AppRun
use_host_x: true
use_host_x: false
debian:
image: appimagecrafters/tests-env:debian-stable
command: ./AppRun
use_host_x: true
use_host_x: false
arch:
image: appimagecrafters/tests-env:archlinux-latest
command: ./AppRun
use_host_x: true
use_host_x: false
centos:
image: appimagecrafters/tests-env:centos-7
command: ./AppRun
use_host_x: true
use_host_x: false
ubuntu:
image: appimagecrafters/tests-env:ubuntu-xenial
command: ./AppRun
use_host_x: true
use_host_x: false
AppImage:
arch: x86_64
update-information: guess
+676 -200
View File
File diff suppressed because it is too large Load Diff
+50 -3
View File
@@ -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
@@ -28,6 +28,14 @@ WORKDIR /opt/filecoin
RUN make clean deps
FROM builder-local AS builder-test
MAINTAINER Lotus Development Team
WORKDIR /opt/filecoin
RUN make debug
FROM builder-local AS builder
MAINTAINER Lotus Development Team
@@ -53,8 +61,9 @@ COPY --from=builder /usr/lib/x86_64-linux-gnu/libnuma.so.1 /lib/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libhwloc.so.5 /lib/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /lib/
RUN useradd -r -u 532 -U fc
RUN useradd -r -u 532 -U fc \
&& mkdir -p /etc/OpenCL/vendors \
&& echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
###
FROM base AS lotus
@@ -207,3 +216,41 @@ EXPOSE 1234
EXPOSE 2345
EXPOSE 3456
EXPOSE 1777
###
from base as lotus-test
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
ENV LOTUS_PATH /var/lib/lotus
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
ENV WALLET_PATH /var/lib/lotus-wallet
COPY --from=builder-test /opt/filecoin/lotus /usr/local/bin/
COPY --from=builder-test /opt/filecoin/lotus-miner /usr/local/bin/
COPY --from=builder-test /opt/filecoin/lotus-worker /usr/local/bin/
COPY --from=builder-test /opt/filecoin/lotus-seed /usr/local/bin/
RUN mkdir /var/tmp/filecoin-proof-parameters
RUN mkdir /var/lib/lotus
RUN mkdir /var/lib/lotus-miner
RUN mkdir /var/lib/lotus-worker
RUN mkdir /var/lib/lotus-wallet
RUN chown fc: /var/tmp/filecoin-proof-parameters
RUN chown fc: /var/lib/lotus
RUN chown fc: /var/lib/lotus-miner
RUN chown fc: /var/lib/lotus-worker
RUN chown fc: /var/lib/lotus-wallet
VOLUME /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/lotus
VOLUME /var/lib/lotus-miner
VOLUME /var/lib/lotus-worker
VOLUME /var/lib/lotus-wallet
EXPOSE 1234
EXPOSE 2345
EXPOSE 3456
EXPOSE 1777
+6 -4
View File
@@ -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
@@ -97,7 +97,7 @@ BINS+=lotus-miner
lotus-worker: $(BUILD_DEPS)
rm -f lotus-worker
$(GOCC) build $(GOFLAGS) -o lotus-worker ./cmd/lotus-seal-worker
$(GOCC) build $(GOFLAGS) -o lotus-worker ./cmd/lotus-worker
.PHONY: lotus-worker
BINS+=lotus-worker
@@ -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
@@ -345,6 +345,8 @@ gen: actors-gen type-gen method-gen cfgdoc-gen docsgen api-gen circleci
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli"
.PHONY: gen
jen: gen
snap: lotus lotus-miner lotus-worker
snapcraft
# snapcraft upload ./lotus_*.snap
@@ -360,4 +362,4 @@ print-%:
@echo $*=$($*)
circleci:
go generate -x ./.circleci
go generate -x ./.circleci
+3 -3
View File
@@ -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:**
+38 -5
View File
@@ -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
@@ -689,7 +694,17 @@ type FullNode interface {
// MethodGroup: Paych
// The Paych methods are for interacting with and managing payment channels
PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*ChannelInfo, error) //perm:sign
// PaychGet gets or creates a payment channel between address pair
// The specified amount will be reserved for use. If there aren't enough non-reserved funds
// available, funds will be added through an on-chain message.
// - When opts.OffChain is true, this call will not cause any messages to be sent to the chain (no automatic
// channel creation/funds adding). If the operation can't be performed without sending a message an error will be
// returned. Note that even when this option is specified, this call can be blocked by previous operations on the
// channel waiting for on-chain operations.
PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt, opts PaychGetOpts) (*ChannelInfo, error) //perm:sign
// PaychFund gets or creates a payment channel between address pair.
// The specified amount will be added to the channel through on-chain send for future use
PaychFund(ctx context.Context, from, to address.Address, amt types.BigInt) (*ChannelInfo, error) //perm:sign
PaychGetWaitReady(context.Context, cid.Cid) (address.Address, error) //perm:sign
PaychAvailableFunds(ctx context.Context, ch address.Address) (*ChannelAvailableFunds, error) //perm:sign
PaychAvailableFundsByFromTo(ctx context.Context, from, to address.Address) (*ChannelAvailableFunds, error) //perm:sign
@@ -718,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
@@ -828,6 +849,10 @@ const (
PCHOutbound
)
type PaychGetOpts struct {
OffChain bool
}
type PaychStatus struct {
ControlAddr address.Address
Direction PCHDir
@@ -845,16 +870,23 @@ type ChannelAvailableFunds struct {
From address.Address
// To is the to address of the channel
To address.Address
// ConfirmedAmt is the amount of funds that have been confirmed on-chain
// for the channel
// ConfirmedAmt is the total amount of funds that have been confirmed on-chain for the channel
ConfirmedAmt types.BigInt
// PendingAmt is the amount of funds that are pending confirmation on-chain
PendingAmt types.BigInt
// NonReservedAmt is part of ConfirmedAmt that is available for use (e.g. when the payment channel was pre-funded)
NonReservedAmt types.BigInt
// PendingAvailableAmt is the amount of funds that are pending confirmation on-chain that will become available once confirmed
PendingAvailableAmt types.BigInt
// PendingWaitSentinel can be used with PaychGetWaitReady to wait for
// confirmation of pending funds
PendingWaitSentinel *cid.Cid
// QueuedAmt is the amount that is queued up behind a pending request
QueuedAmt types.BigInt
// VoucherRedeemedAmt is the amount that is redeemed by vouchers on-chain
// and in the local datastore
VoucherReedeemedAmt types.BigInt
@@ -900,6 +932,7 @@ type QueryOffer struct {
Size uint64
MinPrice types.BigInt
UnsealPrice types.BigInt
PricePerByte abi.TokenAmount
PaymentInterval uint64
PaymentIntervalIncrease uint64
Miner address.Address
+2 -1
View File
@@ -45,8 +45,9 @@ type Gateway interface {
GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*MsigTransaction, error)
MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
MsigGetVestingSchedule(ctx context.Context, addr address.Address, tsk types.TipSetKey) (MsigVesting, error)
StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (DealCollateralBounds, error)
StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
+11
View File
@@ -2,6 +2,7 @@ package api
import (
"context"
"time"
metrics "github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
@@ -25,6 +26,7 @@ type Net interface {
NetConnectedness(context.Context, peer.ID) (network.Connectedness, error) //perm:read
NetPeers(context.Context) ([]peer.AddrInfo, error) //perm:read
NetPing(context.Context, peer.ID) (time.Duration, error) //perm:read
NetConnect(context.Context, peer.AddrInfo) error //perm:write
NetAddrsListen(context.Context) (peer.AddrInfo, error) //perm:read
NetDisconnect(context.Context, peer.ID) error //perm:write
@@ -51,6 +53,15 @@ type Net interface {
NetBlockRemove(ctx context.Context, acl NetBlockList) error //perm:admin
NetBlockList(ctx context.Context) (NetBlockList, error) //perm:read
NetProtectAdd(ctx context.Context, acl []peer.ID) error //perm:admin
NetProtectRemove(ctx context.Context, acl []peer.ID) error //perm:admin
NetProtectList(ctx context.Context) ([]peer.ID, error) //perm:read
// ResourceManager API
NetStat(ctx context.Context, scope string) (NetStat, error) //perm:read
NetLimit(ctx context.Context, scope string) (NetLimit, error) //perm:read
NetSetLimit(ctx context.Context, scope string, limit NetLimit) error //perm:admin
// ID returns peerID of libp2p node backing this API
ID(context.Context) (peer.ID, error) //perm:read
}
+50 -32
View File
@@ -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"
@@ -24,7 +25,6 @@ import (
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
)
@@ -52,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
@@ -92,7 +96,8 @@ type StorageMiner interface {
SectorsUpdate(context.Context, abi.SectorNumber, SectorState) error //perm:admin
// SectorRemove removes the sector from storage. It doesn't terminate it on-chain, which can
// be done with SectorTerminate. Removing and not terminating live sectors will cause additional penalties.
SectorRemove(context.Context, abi.SectorNumber) error //perm:admin
SectorRemove(context.Context, abi.SectorNumber) error //perm:admin
SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber, snap bool) error //perm:admin
// SectorTerminate terminates the sector on-chain (adding it to a termination batch first), then
// automatically removes it from storage
SectorTerminate(context.Context, abi.SectorNumber) error //perm:admin
@@ -100,8 +105,7 @@ type StorageMiner interface {
// Returns null if message wasn't sent
SectorTerminateFlush(ctx context.Context) (*cid.Cid, error) //perm:admin
// SectorTerminatePending returns a list of pending sector terminations to be sent in the next batch message
SectorTerminatePending(ctx context.Context) ([]abi.SectorID, error) //perm:admin
SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber, snap bool) error //perm:admin
SectorTerminatePending(ctx context.Context) ([]abi.SectorID, error) //perm:admin
// SectorPreCommitFlush immediately sends a PreCommit message with sectors batched for PreCommit.
// Returns null if message wasn't sent
SectorPreCommitFlush(ctx context.Context) ([]sealiface.PreCommitBatchRes, error) //perm:admin
@@ -122,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
@@ -143,20 +148,21 @@ type StorageMiner interface {
SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) //perm:admin
SealingAbort(ctx context.Context, call storiface.CallID) error //perm:admin
//stores.SectorIndex
StorageAttach(context.Context, stores.StorageInfo, fsutil.FsStat) error //perm:admin
StorageInfo(context.Context, stores.ID) (stores.StorageInfo, error) //perm:admin
StorageReportHealth(context.Context, stores.ID, stores.HealthReport) error //perm:admin
StorageDeclareSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error //perm:admin
StorageDropSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType) error //perm:admin
StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]stores.SectorStorageInfo, error) //perm:admin
StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType) ([]stores.StorageInfo, error) //perm:admin
StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error //perm:admin
StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error) //perm:admin
StorageList(ctx context.Context) (map[stores.ID][]stores.Decl, error) //perm:admin
// SectorIndex
StorageAttach(context.Context, storiface.StorageInfo, fsutil.FsStat) error //perm:admin
StorageInfo(context.Context, storiface.ID) (storiface.StorageInfo, error) //perm:admin
StorageReportHealth(context.Context, storiface.ID, storiface.HealthReport) error //perm:admin
StorageDeclareSector(ctx context.Context, storageID storiface.ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error //perm:admin
StorageDropSector(ctx context.Context, storageID storiface.ID, s abi.SectorID, ft storiface.SectorFileType) error //perm:admin
StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]storiface.SectorStorageInfo, error) //perm:admin
StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType) ([]storiface.StorageInfo, error) //perm:admin
StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error //perm:admin
StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error) //perm:admin
StorageList(ctx context.Context) (map[storiface.ID][]storiface.Decl, error) //perm:admin
StorageGetLocks(ctx context.Context) (storiface.SectorLocks, error) //perm:admin
StorageLocal(ctx context.Context) (map[stores.ID]string, error) //perm:admin
StorageStat(ctx context.Context, id stores.ID) (fsutil.FsStat, error) //perm:admin
StorageLocal(ctx context.Context) (map[storiface.ID]string, error) //perm:admin
StorageStat(ctx context.Context, id storiface.ID) (fsutil.FsStat, error) //perm:admin
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:write
MarketListDeals(ctx context.Context) ([]MarketDeal, error) //perm:read
@@ -169,6 +175,8 @@ type StorageMiner interface {
MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error) //perm:read
MarketListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) //perm:write
MarketDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) //perm:write
// MarketDataTransferDiagnostics generates debugging information about current data transfers over graphsync
MarketDataTransferDiagnostics(ctx context.Context, p peer.ID) (*TransferDiagnostics, error) //perm:write
// MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer
MarketRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
// MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer
@@ -219,6 +227,16 @@ type StorageMiner interface {
// DagstoreGC runs garbage collection on the DAG store.
DagstoreGC(ctx context.Context) ([]DagstoreShardResult, error) //perm:admin
// IndexerAnnounceDeal informs indexer nodes that a new deal was received,
// so they can download its index
IndexerAnnounceDeal(ctx context.Context, proposalCid cid.Cid) error //perm:admin
// IndexerAnnounceAllDeals informs the indexer nodes aboutall active deals.
IndexerAnnounceAllDeals(ctx context.Context) error //perm:admin
// DagstoreLookupPieces returns information about shards that contain the given CID.
DagstoreLookupPieces(ctx context.Context, cid cid.Cid) ([]DagstoreShardInfo, error) //perm:admin
// RuntimeSubsystems returns the subsystems that are enabled
// in this instance.
RuntimeSubsystems(ctx context.Context) (MinerSubsystems, error) //perm:read
@@ -253,13 +271,12 @@ type StorageMiner interface {
// the path specified when calling CreateBackup is within the base path
CreateBackup(ctx context.Context, fpath string) error //perm:admin
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, update []bool, expensive bool) (map[abi.SectorNumber]string, error) //perm:admin
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) //perm:admin
ComputeProof(ctx context.Context, ssi []builtin.ExtendedSectorInfo, rand abi.PoStRandomness, poStEpoch abi.ChainEpoch, nv abinetwork.Version) ([]builtin.PoStProof, error) //perm:read
}
var _ storiface.WorkerReturn = *new(StorageMiner)
var _ stores.SectorIndex = *new(StorageMiner)
type SealRes struct {
Err string
@@ -283,19 +300,20 @@ type SectorPiece struct {
}
type SectorInfo struct {
SectorID abi.SectorNumber
State SectorState
CommD *cid.Cid
CommR *cid.Cid
Proof []byte
Deals []abi.DealID
Pieces []SectorPiece
Ticket SealTicket
Seed SealSeed
PreCommitMsg *cid.Cid
CommitMsg *cid.Cid
Retries uint64
ToUpgrade bool
SectorID abi.SectorNumber
State SectorState
CommD *cid.Cid
CommR *cid.Cid
Proof []byte
Deals []abi.DealID
Pieces []SectorPiece
Ticket SealTicket
Seed SealSeed
PreCommitMsg *cid.Cid
CommitMsg *cid.Cid
Retries uint64
ToUpgrade bool
ReplicaUpdateMessage *cid.Cid
LastErr string
+5
View File
@@ -1,3 +1,4 @@
//stm: #unit
package api
import (
@@ -26,6 +27,7 @@ func goCmd() string {
}
func TestDoesntDependOnFFI(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_001
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
if err != nil {
t.Fatal(err)
@@ -38,6 +40,7 @@ func TestDoesntDependOnFFI(t *testing.T) {
}
func TestDoesntDependOnBuild(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_002
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
if err != nil {
t.Fatal(err)
@@ -50,6 +53,7 @@ func TestDoesntDependOnBuild(t *testing.T) {
}
func TestReturnTypes(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_001
errType := reflect.TypeOf(new(error)).Elem()
bareIface := reflect.TypeOf(new(interface{})).Elem()
jmarsh := reflect.TypeOf(new(json.Marshaler)).Elem()
@@ -115,6 +119,7 @@ func TestReturnTypes(t *testing.T) {
}
func TestPermTags(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_PERM_TAGS_001
_ = PermissionedFullAPI(&FullNodeStruct{})
_ = PermissionedStorMinerAPI(&StorageMinerStruct{})
_ = PermissionedWorkerAPI(&WorkerStruct{})
+7 -2
View File
@@ -7,8 +7,9 @@ import (
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-actors/v5/actors/runtime/proof"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/specs-storage/storage"
)
@@ -29,10 +30,11 @@ type Worker interface {
// TaskType -> Weight
TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) //perm:admin
Paths(context.Context) ([]stores.StoragePath, error) //perm:admin
Paths(context.Context) ([]storiface.StoragePath, error) //perm:admin
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
@@ -49,6 +51,9 @@ type Worker interface {
UnsealPiece(context.Context, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (storiface.CallID, error) //perm:admin
Fetch(context.Context, storage.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) //perm:admin
GenerateWinningPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []storiface.PostSectorChallenge, randomness abi.PoStRandomness) ([]proof.PoStProof, error) //perm:admin
GenerateWindowPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []storiface.PostSectorChallenge, partitionIdx int, randomness abi.PoStRandomness) (storiface.WindowPoStResult, error) //perm:admin
TaskDisable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
TaskEnable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
+43 -5
View File
@@ -1,6 +1,7 @@
package docgen
import (
"encoding/json"
"fmt"
"go/ast"
"go/parser"
@@ -15,6 +16,7 @@ import (
"github.com/filecoin-project/go-bitfield"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-graphsync"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
@@ -38,7 +40,6 @@ import (
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
"github.com/filecoin-project/lotus/node/modules/dtypes"
@@ -120,6 +121,7 @@ func init() {
addExample(api.FullAPIVersion1)
addExample(api.PCHInbound)
addExample(time.Minute)
addExample(graphsync.NewRequestID())
addExample(datatransfer.TransferID(3))
addExample(datatransfer.Ongoing)
addExample(storeIDExample)
@@ -196,10 +198,10 @@ func init() {
},
})
addExample(api.SectorState(sealing.Proving))
addExample(stores.ID("76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8"))
addExample(storiface.ID("76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8"))
addExample(storiface.FTUnsealed)
addExample(storiface.PathSealing)
addExample(map[stores.ID][]stores.Decl{
addExample(map[storiface.ID][]storiface.Decl{
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": {
{
SectorID: abi.SectorID{Miner: 1000, Number: 100},
@@ -207,7 +209,7 @@ func init() {
},
},
})
addExample(map[stores.ID]string{
addExample(map[storiface.ID]string{
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": "/data/path",
})
addExample(map[uuid.UUID][]storiface.WorkerJob{
@@ -250,10 +252,18 @@ func init() {
addExample(map[abi.SectorNumber]string{
123: "can't acquire read lock",
})
addExample(json.RawMessage(`"json raw message"`))
addExample(map[api.SectorState]int{
api.SectorState(sealing.Proving): 120,
})
addExample([]abi.SectorNumber{123, 124})
addExample([]storiface.SectorLock{
{
Sector: abi.SectorID{Number: 123, Miner: 1000},
Write: [storiface.FileTypes]uint{0, 0, 1},
Read: [storiface.FileTypes]uint{2, 3, 0},
},
})
// worker specific
addExample(storiface.AcquireMove)
@@ -289,6 +299,34 @@ func init() {
Error: "<error>",
})
addExample(storiface.ResourceTable)
addExample(network.ScopeStat{
Memory: 123,
NumStreamsInbound: 1,
NumStreamsOutbound: 2,
NumConnsInbound: 3,
NumConnsOutbound: 4,
NumFD: 5,
})
addExample(map[string]network.ScopeStat{
"abc": {
Memory: 123,
NumStreamsInbound: 1,
NumStreamsOutbound: 2,
NumConnsInbound: 3,
NumConnsOutbound: 4,
NumFD: 5,
}})
addExample(api.NetLimit{
Memory: 123,
StreamsInbound: 1,
StreamsOutbound: 2,
Streams: 3,
ConnsInbound: 3,
ConnsOutbound: 4,
Conns: 4,
FD: 5,
})
}
func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
@@ -339,7 +377,7 @@ func ExampleValue(method string, t, parent reflect.Type) interface{} {
switch t.Kind() {
case reflect.Slice:
out := reflect.New(t).Elem()
reflect.Append(out, reflect.ValueOf(ExampleValue(method, t.Elem(), t)))
out = reflect.Append(out, reflect.ValueOf(ExampleValue(method, t.Elem(), t)))
return out.Interface()
case reflect.Chan:
return ExampleValue(method, t.Elem(), nil)
+155 -8
View File
@@ -8,12 +8,12 @@ import (
context "context"
json "encoding/json"
reflect "reflect"
time "time"
address "github.com/filecoin-project/go-address"
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"
@@ -745,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
}
@@ -1811,6 +1811,21 @@ func (mr *MockFullNodeMockRecorder) NetFindPeer(arg0, arg1 interface{}) *gomock.
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
}
// NetLimit mocks base method.
func (m *MockFullNode) NetLimit(arg0 context.Context, arg1 string) (api.NetLimit, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetLimit", arg0, arg1)
ret0, _ := ret[0].(api.NetLimit)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetLimit indicates an expected call of NetLimit.
func (mr *MockFullNodeMockRecorder) NetLimit(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetLimit", reflect.TypeOf((*MockFullNode)(nil).NetLimit), arg0, arg1)
}
// NetPeerInfo mocks base method.
func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
m.ctrl.T.Helper()
@@ -1841,6 +1856,64 @@ func (mr *MockFullNodeMockRecorder) NetPeers(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeers", reflect.TypeOf((*MockFullNode)(nil).NetPeers), arg0)
}
// NetPing mocks base method.
func (m *MockFullNode) NetPing(arg0 context.Context, arg1 peer.ID) (time.Duration, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetPing", arg0, arg1)
ret0, _ := ret[0].(time.Duration)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetPing indicates an expected call of NetPing.
func (mr *MockFullNodeMockRecorder) NetPing(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPing", reflect.TypeOf((*MockFullNode)(nil).NetPing), arg0, arg1)
}
// NetProtectAdd mocks base method.
func (m *MockFullNode) NetProtectAdd(arg0 context.Context, arg1 []peer.ID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetProtectAdd", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// NetProtectAdd indicates an expected call of NetProtectAdd.
func (mr *MockFullNodeMockRecorder) NetProtectAdd(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectAdd", reflect.TypeOf((*MockFullNode)(nil).NetProtectAdd), arg0, arg1)
}
// NetProtectList mocks base method.
func (m *MockFullNode) NetProtectList(arg0 context.Context) ([]peer.ID, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetProtectList", arg0)
ret0, _ := ret[0].([]peer.ID)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetProtectList indicates an expected call of NetProtectList.
func (mr *MockFullNodeMockRecorder) NetProtectList(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectList", reflect.TypeOf((*MockFullNode)(nil).NetProtectList), arg0)
}
// NetProtectRemove mocks base method.
func (m *MockFullNode) NetProtectRemove(arg0 context.Context, arg1 []peer.ID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetProtectRemove", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// NetProtectRemove indicates an expected call of NetProtectRemove.
func (mr *MockFullNodeMockRecorder) NetProtectRemove(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectRemove", reflect.TypeOf((*MockFullNode)(nil).NetProtectRemove), arg0, arg1)
}
// NetPubsubScores mocks base method.
func (m *MockFullNode) NetPubsubScores(arg0 context.Context) ([]api.PubsubScore, error) {
m.ctrl.T.Helper()
@@ -1856,6 +1929,35 @@ func (mr *MockFullNodeMockRecorder) NetPubsubScores(arg0 interface{}) *gomock.Ca
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
}
// NetSetLimit mocks base method.
func (m *MockFullNode) NetSetLimit(arg0 context.Context, arg1 string, arg2 api.NetLimit) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetSetLimit", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// NetSetLimit indicates an expected call of NetSetLimit.
func (mr *MockFullNodeMockRecorder) NetSetLimit(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetSetLimit", reflect.TypeOf((*MockFullNode)(nil).NetSetLimit), arg0, arg1, arg2)
}
// NetStat mocks base method.
func (m *MockFullNode) NetStat(arg0 context.Context, arg1 string) (api.NetStat, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetStat", arg0, arg1)
ret0, _ := ret[0].(api.NetStat)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetStat indicates an expected call of NetStat.
func (mr *MockFullNodeMockRecorder) NetStat(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetStat", reflect.TypeOf((*MockFullNode)(nil).NetStat), arg0, arg1)
}
// NodeStatus mocks base method.
func (m *MockFullNode) NodeStatus(arg0 context.Context, arg1 bool) (api.NodeStatus, error) {
m.ctrl.T.Helper()
@@ -1931,19 +2033,34 @@ func (mr *MockFullNodeMockRecorder) PaychCollect(arg0, arg1 interface{}) *gomock
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychCollect", reflect.TypeOf((*MockFullNode)(nil).PaychCollect), arg0, arg1)
}
// PaychGet mocks base method.
func (m *MockFullNode) PaychGet(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (*api.ChannelInfo, error) {
// PaychFund mocks base method.
func (m *MockFullNode) PaychFund(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (*api.ChannelInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychGet", arg0, arg1, arg2, arg3)
ret := m.ctrl.Call(m, "PaychFund", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(*api.ChannelInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// PaychFund indicates an expected call of PaychFund.
func (mr *MockFullNodeMockRecorder) PaychFund(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychFund", reflect.TypeOf((*MockFullNode)(nil).PaychFund), arg0, arg1, arg2, arg3)
}
// PaychGet mocks base method.
func (m *MockFullNode) PaychGet(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int, arg4 api.PaychGetOpts) (*api.ChannelInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychGet", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(*api.ChannelInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// PaychGet indicates an expected call of PaychGet.
func (mr *MockFullNodeMockRecorder) PaychGet(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockFullNodeMockRecorder) PaychGet(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychGet", reflect.TypeOf((*MockFullNode)(nil).PaychGet), arg0, arg1, arg2, arg3)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychGet", reflect.TypeOf((*MockFullNode)(nil).PaychGet), arg0, arg1, arg2, arg3, arg4)
}
// PaychGetWaitReady mocks base method.
@@ -2289,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()
@@ -2379,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()
+343 -57
View File
@@ -25,12 +25,12 @@ import (
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
"github.com/filecoin-project/lotus/journal/alerting"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/repo/imports"
"github.com/filecoin-project/specs-actors/v5/actors/runtime/proof"
"github.com/filecoin-project/specs-storage/storage"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
@@ -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"`
@@ -306,7 +306,9 @@ type FullNodeStruct struct {
PaychCollect func(p0 context.Context, p1 address.Address) (cid.Cid, error) `perm:"sign"`
PaychGet func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*ChannelInfo, error) `perm:"sign"`
PaychFund func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*ChannelInfo, error) `perm:"sign"`
PaychGet func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 PaychGetOpts) (*ChannelInfo, error) `perm:"sign"`
PaychGetWaitReady func(p0 context.Context, p1 cid.Cid) (address.Address, error) `perm:"sign"`
@@ -350,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"`
@@ -362,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"`
@@ -516,6 +522,8 @@ type GatewayStruct struct {
MsigGetVested func(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) ``
MsigGetVestingSchedule func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MsigVesting, error) ``
StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) ``
StateDealProviderCollateralBounds func(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (DealCollateralBounds, error) ``
@@ -587,11 +595,25 @@ type NetStruct struct {
NetFindPeer func(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) `perm:"read"`
NetLimit func(p0 context.Context, p1 string) (NetLimit, error) `perm:"read"`
NetPeerInfo func(p0 context.Context, p1 peer.ID) (*ExtendedPeerInfo, error) `perm:"read"`
NetPeers func(p0 context.Context) ([]peer.AddrInfo, error) `perm:"read"`
NetPing func(p0 context.Context, p1 peer.ID) (time.Duration, error) `perm:"read"`
NetProtectAdd func(p0 context.Context, p1 []peer.ID) error `perm:"admin"`
NetProtectList func(p0 context.Context) ([]peer.ID, error) `perm:"read"`
NetProtectRemove func(p0 context.Context, p1 []peer.ID) error `perm:"admin"`
NetPubsubScores func(p0 context.Context) ([]PubsubScore, error) `perm:"read"`
NetSetLimit func(p0 context.Context, p1 string, p2 NetLimit) error `perm:"admin"`
NetStat func(p0 context.Context, p1 string) (NetStat, error) `perm:"read"`
}
}
@@ -619,10 +641,14 @@ type StorageMinerStruct struct {
ActorSectorSize func(p0 context.Context, p1 address.Address) (abi.SectorSize, error) `perm:"read"`
CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 []bool, p4 bool) (map[abi.SectorNumber]string, error) `perm:"admin"`
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"`
@@ -633,6 +659,8 @@ type StorageMinerStruct struct {
DagstoreListShards func(p0 context.Context) ([]DagstoreShardInfo, error) `perm:"read"`
DagstoreLookupPieces func(p0 context.Context, p1 cid.Cid) ([]DagstoreShardInfo, error) `perm:"admin"`
DagstoreRecoverShard func(p0 context.Context, p1 string) error `perm:"write"`
DealsConsiderOfflineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"`
@@ -667,8 +695,14 @@ type StorageMinerStruct struct {
DealsSetPieceCidBlocklist func(p0 context.Context, p1 []cid.Cid) error `perm:"admin"`
IndexerAnnounceAllDeals func(p0 context.Context) error `perm:"admin"`
IndexerAnnounceDeal func(p0 context.Context, p1 cid.Cid) error `perm:"admin"`
MarketCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
MarketDataTransferDiagnostics func(p0 context.Context, p1 peer.ID) (*TransferDiagnostics, error) `perm:"write"`
MarketDataTransferUpdates func(p0 context.Context) (<-chan DataTransferChannel, error) `perm:"write"`
MarketGetAsk func(p0 context.Context) (*storagemarket.SignedStorageAsk, error) `perm:"read"`
@@ -713,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"`
@@ -799,27 +835,29 @@ type StorageMinerStruct struct {
StorageAddLocal func(p0 context.Context, p1 string) error `perm:"admin"`
StorageAttach func(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error `perm:"admin"`
StorageAttach func(p0 context.Context, p1 storiface.StorageInfo, p2 fsutil.FsStat) error `perm:"admin"`
StorageBestAlloc func(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) `perm:"admin"`
StorageBestAlloc func(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]storiface.StorageInfo, error) `perm:"admin"`
StorageDeclareSector func(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error `perm:"admin"`
StorageDeclareSector func(p0 context.Context, p1 storiface.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error `perm:"admin"`
StorageDropSector func(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error `perm:"admin"`
StorageDropSector func(p0 context.Context, p1 storiface.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error `perm:"admin"`
StorageFindSector func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) `perm:"admin"`
StorageFindSector func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]storiface.SectorStorageInfo, error) `perm:"admin"`
StorageInfo func(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) `perm:"admin"`
StorageGetLocks func(p0 context.Context) (storiface.SectorLocks, error) `perm:"admin"`
StorageList func(p0 context.Context) (map[stores.ID][]stores.Decl, error) `perm:"admin"`
StorageInfo func(p0 context.Context, p1 storiface.ID) (storiface.StorageInfo, error) `perm:"admin"`
StorageLocal func(p0 context.Context) (map[stores.ID]string, error) `perm:"admin"`
StorageList func(p0 context.Context) (map[storiface.ID][]storiface.Decl, error) `perm:"admin"`
StorageLocal func(p0 context.Context) (map[storiface.ID]string, error) `perm:"admin"`
StorageLock func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) error `perm:"admin"`
StorageReportHealth func(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error `perm:"admin"`
StorageReportHealth func(p0 context.Context, p1 storiface.ID, p2 storiface.HealthReport) error `perm:"admin"`
StorageStat func(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) `perm:"admin"`
StorageStat func(p0 context.Context, p1 storiface.ID) (fsutil.FsStat, error) `perm:"admin"`
StorageTryLock func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) (bool, error) `perm:"admin"`
@@ -862,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"`
@@ -872,11 +912,15 @@ type WorkerStruct struct {
GenerateSectorKeyFromData func(p0 context.Context, p1 storage.SectorRef, p2 cid.Cid) (storiface.CallID, error) `perm:"admin"`
GenerateWindowPoSt func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 abi.ActorID, p3 []storiface.PostSectorChallenge, p4 int, p5 abi.PoStRandomness) (storiface.WindowPoStResult, error) `perm:"admin"`
GenerateWinningPoSt func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 abi.ActorID, p3 []storiface.PostSectorChallenge, p4 abi.PoStRandomness) ([]proof.PoStProof, error) `perm:"admin"`
Info func(p0 context.Context) (storiface.WorkerInfo, error) `perm:"admin"`
MoveStorage func(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType) (storiface.CallID, error) `perm:"admin"`
Paths func(p0 context.Context) ([]stores.StoragePath, error) `perm:"admin"`
Paths func(p0 context.Context) ([]storiface.StoragePath, error) `perm:"admin"`
ProcessSession func(p0 context.Context) (uuid.UUID, error) `perm:"admin"`
@@ -1537,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
}
@@ -2175,14 +2219,25 @@ func (s *FullNodeStub) PaychCollect(p0 context.Context, p1 address.Address) (cid
return *new(cid.Cid), ErrNotSupported
}
func (s *FullNodeStruct) PaychGet(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*ChannelInfo, error) {
func (s *FullNodeStruct) PaychFund(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*ChannelInfo, error) {
if s.Internal.PaychFund == nil {
return nil, ErrNotSupported
}
return s.Internal.PaychFund(p0, p1, p2, p3)
}
func (s *FullNodeStub) PaychFund(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*ChannelInfo, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) PaychGet(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 PaychGetOpts) (*ChannelInfo, error) {
if s.Internal.PaychGet == nil {
return nil, ErrNotSupported
}
return s.Internal.PaychGet(p0, p1, p2, p3)
return s.Internal.PaychGet(p0, p1, p2, p3, p4)
}
func (s *FullNodeStub) PaychGet(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*ChannelInfo, error) {
func (s *FullNodeStub) PaychGet(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 PaychGetOpts) (*ChannelInfo, error) {
return nil, ErrNotSupported
}
@@ -2417,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
@@ -2483,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
@@ -3275,6 +3352,17 @@ func (s *GatewayStub) MsigGetVested(p0 context.Context, p1 address.Address, p2 t
return *new(types.BigInt), ErrNotSupported
}
func (s *GatewayStruct) MsigGetVestingSchedule(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MsigVesting, error) {
if s.Internal.MsigGetVestingSchedule == nil {
return *new(MsigVesting), ErrNotSupported
}
return s.Internal.MsigGetVestingSchedule(p0, p1, p2)
}
func (s *GatewayStub) MsigGetVestingSchedule(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MsigVesting, error) {
return *new(MsigVesting), ErrNotSupported
}
func (s *GatewayStruct) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
if s.Internal.StateAccountKey == nil {
return *new(address.Address), ErrNotSupported
@@ -3627,6 +3715,17 @@ func (s *NetStub) NetFindPeer(p0 context.Context, p1 peer.ID) (peer.AddrInfo, er
return *new(peer.AddrInfo), ErrNotSupported
}
func (s *NetStruct) NetLimit(p0 context.Context, p1 string) (NetLimit, error) {
if s.Internal.NetLimit == nil {
return *new(NetLimit), ErrNotSupported
}
return s.Internal.NetLimit(p0, p1)
}
func (s *NetStub) NetLimit(p0 context.Context, p1 string) (NetLimit, error) {
return *new(NetLimit), ErrNotSupported
}
func (s *NetStruct) NetPeerInfo(p0 context.Context, p1 peer.ID) (*ExtendedPeerInfo, error) {
if s.Internal.NetPeerInfo == nil {
return nil, ErrNotSupported
@@ -3649,6 +3748,50 @@ func (s *NetStub) NetPeers(p0 context.Context) ([]peer.AddrInfo, error) {
return *new([]peer.AddrInfo), ErrNotSupported
}
func (s *NetStruct) NetPing(p0 context.Context, p1 peer.ID) (time.Duration, error) {
if s.Internal.NetPing == nil {
return *new(time.Duration), ErrNotSupported
}
return s.Internal.NetPing(p0, p1)
}
func (s *NetStub) NetPing(p0 context.Context, p1 peer.ID) (time.Duration, error) {
return *new(time.Duration), ErrNotSupported
}
func (s *NetStruct) NetProtectAdd(p0 context.Context, p1 []peer.ID) error {
if s.Internal.NetProtectAdd == nil {
return ErrNotSupported
}
return s.Internal.NetProtectAdd(p0, p1)
}
func (s *NetStub) NetProtectAdd(p0 context.Context, p1 []peer.ID) error {
return ErrNotSupported
}
func (s *NetStruct) NetProtectList(p0 context.Context) ([]peer.ID, error) {
if s.Internal.NetProtectList == nil {
return *new([]peer.ID), ErrNotSupported
}
return s.Internal.NetProtectList(p0)
}
func (s *NetStub) NetProtectList(p0 context.Context) ([]peer.ID, error) {
return *new([]peer.ID), ErrNotSupported
}
func (s *NetStruct) NetProtectRemove(p0 context.Context, p1 []peer.ID) error {
if s.Internal.NetProtectRemove == nil {
return ErrNotSupported
}
return s.Internal.NetProtectRemove(p0, p1)
}
func (s *NetStub) NetProtectRemove(p0 context.Context, p1 []peer.ID) error {
return ErrNotSupported
}
func (s *NetStruct) NetPubsubScores(p0 context.Context) ([]PubsubScore, error) {
if s.Internal.NetPubsubScores == nil {
return *new([]PubsubScore), ErrNotSupported
@@ -3660,6 +3803,28 @@ func (s *NetStub) NetPubsubScores(p0 context.Context) ([]PubsubScore, error) {
return *new([]PubsubScore), ErrNotSupported
}
func (s *NetStruct) NetSetLimit(p0 context.Context, p1 string, p2 NetLimit) error {
if s.Internal.NetSetLimit == nil {
return ErrNotSupported
}
return s.Internal.NetSetLimit(p0, p1, p2)
}
func (s *NetStub) NetSetLimit(p0 context.Context, p1 string, p2 NetLimit) error {
return ErrNotSupported
}
func (s *NetStruct) NetStat(p0 context.Context, p1 string) (NetStat, error) {
if s.Internal.NetStat == nil {
return *new(NetStat), ErrNotSupported
}
return s.Internal.NetStat(p0, p1)
}
func (s *NetStub) NetStat(p0 context.Context, p1 string) (NetStat, error) {
return *new(NetStat), ErrNotSupported
}
func (s *SignableStruct) Sign(p0 context.Context, p1 SignFunc) error {
if s.Internal.Sign == nil {
return ErrNotSupported
@@ -3704,17 +3869,28 @@ func (s *StorageMinerStub) ActorSectorSize(p0 context.Context, p1 address.Addres
return *new(abi.SectorSize), ErrNotSupported
}
func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 []bool, p4 bool) (map[abi.SectorNumber]string, error) {
func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) {
if s.Internal.CheckProvable == nil {
return *new(map[abi.SectorNumber]string), ErrNotSupported
}
return s.Internal.CheckProvable(p0, p1, p2, p3, p4)
return s.Internal.CheckProvable(p0, p1, p2, p3)
}
func (s *StorageMinerStub) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 []bool, p4 bool) (map[abi.SectorNumber]string, error) {
func (s *StorageMinerStub) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) {
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
@@ -3726,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
@@ -3781,6 +3968,17 @@ func (s *StorageMinerStub) DagstoreListShards(p0 context.Context) ([]DagstoreSha
return *new([]DagstoreShardInfo), ErrNotSupported
}
func (s *StorageMinerStruct) DagstoreLookupPieces(p0 context.Context, p1 cid.Cid) ([]DagstoreShardInfo, error) {
if s.Internal.DagstoreLookupPieces == nil {
return *new([]DagstoreShardInfo), ErrNotSupported
}
return s.Internal.DagstoreLookupPieces(p0, p1)
}
func (s *StorageMinerStub) DagstoreLookupPieces(p0 context.Context, p1 cid.Cid) ([]DagstoreShardInfo, error) {
return *new([]DagstoreShardInfo), ErrNotSupported
}
func (s *StorageMinerStruct) DagstoreRecoverShard(p0 context.Context, p1 string) error {
if s.Internal.DagstoreRecoverShard == nil {
return ErrNotSupported
@@ -3968,6 +4166,28 @@ func (s *StorageMinerStub) DealsSetPieceCidBlocklist(p0 context.Context, p1 []ci
return ErrNotSupported
}
func (s *StorageMinerStruct) IndexerAnnounceAllDeals(p0 context.Context) error {
if s.Internal.IndexerAnnounceAllDeals == nil {
return ErrNotSupported
}
return s.Internal.IndexerAnnounceAllDeals(p0)
}
func (s *StorageMinerStub) IndexerAnnounceAllDeals(p0 context.Context) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) IndexerAnnounceDeal(p0 context.Context, p1 cid.Cid) error {
if s.Internal.IndexerAnnounceDeal == nil {
return ErrNotSupported
}
return s.Internal.IndexerAnnounceDeal(p0, p1)
}
func (s *StorageMinerStub) IndexerAnnounceDeal(p0 context.Context, p1 cid.Cid) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) MarketCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
if s.Internal.MarketCancelDataTransfer == nil {
return ErrNotSupported
@@ -3979,6 +4199,17 @@ func (s *StorageMinerStub) MarketCancelDataTransfer(p0 context.Context, p1 datat
return ErrNotSupported
}
func (s *StorageMinerStruct) MarketDataTransferDiagnostics(p0 context.Context, p1 peer.ID) (*TransferDiagnostics, error) {
if s.Internal.MarketDataTransferDiagnostics == nil {
return nil, ErrNotSupported
}
return s.Internal.MarketDataTransferDiagnostics(p0, p1)
}
func (s *StorageMinerStub) MarketDataTransferDiagnostics(p0 context.Context, p1 peer.ID) (*TransferDiagnostics, error) {
return nil, ErrNotSupported
}
func (s *StorageMinerStruct) MarketDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) {
if s.Internal.MarketDataTransferUpdates == nil {
return nil, ErrNotSupported
@@ -4221,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
@@ -4694,92 +4936,103 @@ func (s *StorageMinerStub) StorageAddLocal(p0 context.Context, p1 string) error
return ErrNotSupported
}
func (s *StorageMinerStruct) StorageAttach(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error {
func (s *StorageMinerStruct) StorageAttach(p0 context.Context, p1 storiface.StorageInfo, p2 fsutil.FsStat) error {
if s.Internal.StorageAttach == nil {
return ErrNotSupported
}
return s.Internal.StorageAttach(p0, p1, p2)
}
func (s *StorageMinerStub) StorageAttach(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error {
func (s *StorageMinerStub) StorageAttach(p0 context.Context, p1 storiface.StorageInfo, p2 fsutil.FsStat) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) StorageBestAlloc(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) {
func (s *StorageMinerStruct) StorageBestAlloc(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]storiface.StorageInfo, error) {
if s.Internal.StorageBestAlloc == nil {
return *new([]stores.StorageInfo), ErrNotSupported
return *new([]storiface.StorageInfo), ErrNotSupported
}
return s.Internal.StorageBestAlloc(p0, p1, p2, p3)
}
func (s *StorageMinerStub) StorageBestAlloc(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) {
return *new([]stores.StorageInfo), ErrNotSupported
func (s *StorageMinerStub) StorageBestAlloc(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]storiface.StorageInfo, error) {
return *new([]storiface.StorageInfo), ErrNotSupported
}
func (s *StorageMinerStruct) StorageDeclareSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error {
func (s *StorageMinerStruct) StorageDeclareSector(p0 context.Context, p1 storiface.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error {
if s.Internal.StorageDeclareSector == nil {
return ErrNotSupported
}
return s.Internal.StorageDeclareSector(p0, p1, p2, p3, p4)
}
func (s *StorageMinerStub) StorageDeclareSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error {
func (s *StorageMinerStub) StorageDeclareSector(p0 context.Context, p1 storiface.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) StorageDropSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error {
func (s *StorageMinerStruct) StorageDropSector(p0 context.Context, p1 storiface.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error {
if s.Internal.StorageDropSector == nil {
return ErrNotSupported
}
return s.Internal.StorageDropSector(p0, p1, p2, p3)
}
func (s *StorageMinerStub) StorageDropSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error {
func (s *StorageMinerStub) StorageDropSector(p0 context.Context, p1 storiface.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) StorageFindSector(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) {
func (s *StorageMinerStruct) StorageFindSector(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]storiface.SectorStorageInfo, error) {
if s.Internal.StorageFindSector == nil {
return *new([]stores.SectorStorageInfo), ErrNotSupported
return *new([]storiface.SectorStorageInfo), ErrNotSupported
}
return s.Internal.StorageFindSector(p0, p1, p2, p3, p4)
}
func (s *StorageMinerStub) StorageFindSector(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) {
return *new([]stores.SectorStorageInfo), ErrNotSupported
func (s *StorageMinerStub) StorageFindSector(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]storiface.SectorStorageInfo, error) {
return *new([]storiface.SectorStorageInfo), ErrNotSupported
}
func (s *StorageMinerStruct) StorageInfo(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) {
func (s *StorageMinerStruct) StorageGetLocks(p0 context.Context) (storiface.SectorLocks, error) {
if s.Internal.StorageGetLocks == nil {
return *new(storiface.SectorLocks), ErrNotSupported
}
return s.Internal.StorageGetLocks(p0)
}
func (s *StorageMinerStub) StorageGetLocks(p0 context.Context) (storiface.SectorLocks, error) {
return *new(storiface.SectorLocks), ErrNotSupported
}
func (s *StorageMinerStruct) StorageInfo(p0 context.Context, p1 storiface.ID) (storiface.StorageInfo, error) {
if s.Internal.StorageInfo == nil {
return *new(stores.StorageInfo), ErrNotSupported
return *new(storiface.StorageInfo), ErrNotSupported
}
return s.Internal.StorageInfo(p0, p1)
}
func (s *StorageMinerStub) StorageInfo(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) {
return *new(stores.StorageInfo), ErrNotSupported
func (s *StorageMinerStub) StorageInfo(p0 context.Context, p1 storiface.ID) (storiface.StorageInfo, error) {
return *new(storiface.StorageInfo), ErrNotSupported
}
func (s *StorageMinerStruct) StorageList(p0 context.Context) (map[stores.ID][]stores.Decl, error) {
func (s *StorageMinerStruct) StorageList(p0 context.Context) (map[storiface.ID][]storiface.Decl, error) {
if s.Internal.StorageList == nil {
return *new(map[stores.ID][]stores.Decl), ErrNotSupported
return *new(map[storiface.ID][]storiface.Decl), ErrNotSupported
}
return s.Internal.StorageList(p0)
}
func (s *StorageMinerStub) StorageList(p0 context.Context) (map[stores.ID][]stores.Decl, error) {
return *new(map[stores.ID][]stores.Decl), ErrNotSupported
func (s *StorageMinerStub) StorageList(p0 context.Context) (map[storiface.ID][]storiface.Decl, error) {
return *new(map[storiface.ID][]storiface.Decl), ErrNotSupported
}
func (s *StorageMinerStruct) StorageLocal(p0 context.Context) (map[stores.ID]string, error) {
func (s *StorageMinerStruct) StorageLocal(p0 context.Context) (map[storiface.ID]string, error) {
if s.Internal.StorageLocal == nil {
return *new(map[stores.ID]string), ErrNotSupported
return *new(map[storiface.ID]string), ErrNotSupported
}
return s.Internal.StorageLocal(p0)
}
func (s *StorageMinerStub) StorageLocal(p0 context.Context) (map[stores.ID]string, error) {
return *new(map[stores.ID]string), ErrNotSupported
func (s *StorageMinerStub) StorageLocal(p0 context.Context) (map[storiface.ID]string, error) {
return *new(map[storiface.ID]string), ErrNotSupported
}
func (s *StorageMinerStruct) StorageLock(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) error {
@@ -4793,25 +5046,25 @@ func (s *StorageMinerStub) StorageLock(p0 context.Context, p1 abi.SectorID, p2 s
return ErrNotSupported
}
func (s *StorageMinerStruct) StorageReportHealth(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error {
func (s *StorageMinerStruct) StorageReportHealth(p0 context.Context, p1 storiface.ID, p2 storiface.HealthReport) error {
if s.Internal.StorageReportHealth == nil {
return ErrNotSupported
}
return s.Internal.StorageReportHealth(p0, p1, p2)
}
func (s *StorageMinerStub) StorageReportHealth(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error {
func (s *StorageMinerStub) StorageReportHealth(p0 context.Context, p1 storiface.ID, p2 storiface.HealthReport) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) StorageStat(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) {
func (s *StorageMinerStruct) StorageStat(p0 context.Context, p1 storiface.ID) (fsutil.FsStat, error) {
if s.Internal.StorageStat == nil {
return *new(fsutil.FsStat), ErrNotSupported
}
return s.Internal.StorageStat(p0, p1)
}
func (s *StorageMinerStub) StorageStat(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) {
func (s *StorageMinerStub) StorageStat(p0 context.Context, p1 storiface.ID) (fsutil.FsStat, error) {
return *new(fsutil.FsStat), ErrNotSupported
}
@@ -4947,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
@@ -5002,6 +5266,28 @@ func (s *WorkerStub) GenerateSectorKeyFromData(p0 context.Context, p1 storage.Se
return *new(storiface.CallID), ErrNotSupported
}
func (s *WorkerStruct) GenerateWindowPoSt(p0 context.Context, p1 abi.RegisteredPoStProof, p2 abi.ActorID, p3 []storiface.PostSectorChallenge, p4 int, p5 abi.PoStRandomness) (storiface.WindowPoStResult, error) {
if s.Internal.GenerateWindowPoSt == nil {
return *new(storiface.WindowPoStResult), ErrNotSupported
}
return s.Internal.GenerateWindowPoSt(p0, p1, p2, p3, p4, p5)
}
func (s *WorkerStub) GenerateWindowPoSt(p0 context.Context, p1 abi.RegisteredPoStProof, p2 abi.ActorID, p3 []storiface.PostSectorChallenge, p4 int, p5 abi.PoStRandomness) (storiface.WindowPoStResult, error) {
return *new(storiface.WindowPoStResult), ErrNotSupported
}
func (s *WorkerStruct) GenerateWinningPoSt(p0 context.Context, p1 abi.RegisteredPoStProof, p2 abi.ActorID, p3 []storiface.PostSectorChallenge, p4 abi.PoStRandomness) ([]proof.PoStProof, error) {
if s.Internal.GenerateWinningPoSt == nil {
return *new([]proof.PoStProof), ErrNotSupported
}
return s.Internal.GenerateWinningPoSt(p0, p1, p2, p3, p4)
}
func (s *WorkerStub) GenerateWinningPoSt(p0 context.Context, p1 abi.RegisteredPoStProof, p2 abi.ActorID, p3 []storiface.PostSectorChallenge, p4 abi.PoStRandomness) ([]proof.PoStProof, error) {
return *new([]proof.PoStProof), ErrNotSupported
}
func (s *WorkerStruct) Info(p0 context.Context) (storiface.WorkerInfo, error) {
if s.Internal.Info == nil {
return *new(storiface.WorkerInfo), ErrNotSupported
@@ -5024,15 +5310,15 @@ func (s *WorkerStub) MoveStorage(p0 context.Context, p1 storage.SectorRef, p2 st
return *new(storiface.CallID), ErrNotSupported
}
func (s *WorkerStruct) Paths(p0 context.Context) ([]stores.StoragePath, error) {
func (s *WorkerStruct) Paths(p0 context.Context) ([]storiface.StoragePath, error) {
if s.Internal.Paths == nil {
return *new([]stores.StoragePath), ErrNotSupported
return *new([]storiface.StoragePath), ErrNotSupported
}
return s.Internal.Paths(p0)
}
func (s *WorkerStub) Paths(p0 context.Context) ([]stores.StoragePath, error) {
return *new([]stores.StoragePath), ErrNotSupported
func (s *WorkerStub) Paths(p0 context.Context) ([]storiface.StoragePath, error) {
return *new([]storiface.StoragePath), ErrNotSupported
}
func (s *WorkerStruct) ProcessSession(p0 context.Context) (uuid.UUID, error) {
+3
View File
@@ -1,3 +1,4 @@
//stm: #unit
package api
import (
@@ -29,6 +30,7 @@ type StrC struct {
}
func TestGetInternalStructs(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001
var proxy StrA
sts := GetInternalStructs(&proxy)
@@ -44,6 +46,7 @@ func TestGetInternalStructs(t *testing.T) {
}
func TestNestedInternalStructs(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001
var proxy StrC
// check that only the top-level internal struct gets picked up
+82 -2
View File
@@ -5,19 +5,21 @@ import (
"fmt"
"time"
"github.com/libp2p/go-libp2p-core/network"
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-graphsync"
"github.com/libp2p/go-libp2p-core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub"
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) {
@@ -53,6 +55,30 @@ type MessageSendSpec struct {
MaxFee abi.TokenAmount
}
// GraphSyncDataTransfer provides diagnostics on a data transfer happening over graphsync
type GraphSyncDataTransfer struct {
// GraphSync request id for this transfer
RequestID *graphsync.RequestID
// Graphsync state for this transfer
RequestState string
// If a channel ID is present, indicates whether this is the current graphsync request for this channel
// (could have changed in a restart)
IsCurrentChannelRequest bool
// Data transfer channel ID for this transfer
ChannelID *datatransfer.ChannelID
// Data transfer state for this transfer
ChannelState *DataTransferChannel
// Diagnostic information about this request -- and unexpected inconsistencies in
// request state
Diagnostics []string
}
// TransferDiagnostics give current information about transfers going over graphsync that may be helpful for debugging
type TransferDiagnostics struct {
ReceivingTransfers []*GraphSyncDataTransfer
SendingTransfers []*GraphSyncDataTransfer
}
type DataTransferChannel struct {
TransferID datatransfer.TransferID
Status datatransfer.Status
@@ -98,6 +124,28 @@ func NewDataTransferChannel(hostID peer.ID, channelState datatransfer.ChannelSta
return channel
}
type NetStat struct {
System *network.ScopeStat `json:",omitempty"`
Transient *network.ScopeStat `json:",omitempty"`
Services map[string]network.ScopeStat `json:",omitempty"`
Protocols map[string]network.ScopeStat `json:",omitempty"`
Peers map[string]network.ScopeStat `json:",omitempty"`
}
type NetLimit struct {
Dynamic bool `json:",omitempty"`
// set if Dynamic is false
Memory int64 `json:",omitempty"`
// set if Dynamic is true
MemoryFraction float64 `json:",omitempty"`
MinMemory int64 `json:",omitempty"`
MaxMemory int64 `json:",omitempty"`
Streams, StreamsInbound, StreamsOutbound int
Conns, ConnsInbound, ConnsOutbound int
FD int
}
type NetBlockList struct {
Peers []peer.ID
IPAddrs []string
@@ -237,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
}
+3
View File
@@ -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
+13
View File
@@ -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
+118
View File
@@ -7,6 +7,7 @@ package v0mocks
import (
context "context"
reflect "reflect"
time "time"
address "github.com/filecoin-project/go-address"
bitfield "github.com/filecoin-project/go-bitfield"
@@ -1724,6 +1725,21 @@ func (mr *MockFullNodeMockRecorder) NetFindPeer(arg0, arg1 interface{}) *gomock.
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
}
// NetLimit mocks base method.
func (m *MockFullNode) NetLimit(arg0 context.Context, arg1 string) (api.NetLimit, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetLimit", arg0, arg1)
ret0, _ := ret[0].(api.NetLimit)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetLimit indicates an expected call of NetLimit.
func (mr *MockFullNodeMockRecorder) NetLimit(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetLimit", reflect.TypeOf((*MockFullNode)(nil).NetLimit), arg0, arg1)
}
// NetPeerInfo mocks base method.
func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
m.ctrl.T.Helper()
@@ -1754,6 +1770,64 @@ func (mr *MockFullNodeMockRecorder) NetPeers(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeers", reflect.TypeOf((*MockFullNode)(nil).NetPeers), arg0)
}
// NetPing mocks base method.
func (m *MockFullNode) NetPing(arg0 context.Context, arg1 peer.ID) (time.Duration, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetPing", arg0, arg1)
ret0, _ := ret[0].(time.Duration)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetPing indicates an expected call of NetPing.
func (mr *MockFullNodeMockRecorder) NetPing(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPing", reflect.TypeOf((*MockFullNode)(nil).NetPing), arg0, arg1)
}
// NetProtectAdd mocks base method.
func (m *MockFullNode) NetProtectAdd(arg0 context.Context, arg1 []peer.ID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetProtectAdd", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// NetProtectAdd indicates an expected call of NetProtectAdd.
func (mr *MockFullNodeMockRecorder) NetProtectAdd(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectAdd", reflect.TypeOf((*MockFullNode)(nil).NetProtectAdd), arg0, arg1)
}
// NetProtectList mocks base method.
func (m *MockFullNode) NetProtectList(arg0 context.Context) ([]peer.ID, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetProtectList", arg0)
ret0, _ := ret[0].([]peer.ID)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetProtectList indicates an expected call of NetProtectList.
func (mr *MockFullNodeMockRecorder) NetProtectList(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectList", reflect.TypeOf((*MockFullNode)(nil).NetProtectList), arg0)
}
// NetProtectRemove mocks base method.
func (m *MockFullNode) NetProtectRemove(arg0 context.Context, arg1 []peer.ID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetProtectRemove", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// NetProtectRemove indicates an expected call of NetProtectRemove.
func (mr *MockFullNodeMockRecorder) NetProtectRemove(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectRemove", reflect.TypeOf((*MockFullNode)(nil).NetProtectRemove), arg0, arg1)
}
// NetPubsubScores mocks base method.
func (m *MockFullNode) NetPubsubScores(arg0 context.Context) ([]api.PubsubScore, error) {
m.ctrl.T.Helper()
@@ -1769,6 +1843,35 @@ func (mr *MockFullNodeMockRecorder) NetPubsubScores(arg0 interface{}) *gomock.Ca
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
}
// NetSetLimit mocks base method.
func (m *MockFullNode) NetSetLimit(arg0 context.Context, arg1 string, arg2 api.NetLimit) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetSetLimit", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// NetSetLimit indicates an expected call of NetSetLimit.
func (mr *MockFullNodeMockRecorder) NetSetLimit(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetSetLimit", reflect.TypeOf((*MockFullNode)(nil).NetSetLimit), arg0, arg1, arg2)
}
// NetStat mocks base method.
func (m *MockFullNode) NetStat(arg0 context.Context, arg1 string) (api.NetStat, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetStat", arg0, arg1)
ret0, _ := ret[0].(api.NetStat)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// NetStat indicates an expected call of NetStat.
func (mr *MockFullNodeMockRecorder) NetStat(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetStat", reflect.TypeOf((*MockFullNode)(nil).NetStat), arg0, arg1)
}
// PaychAllocateLane mocks base method.
func (m *MockFullNode) PaychAllocateLane(arg0 context.Context, arg1 address.Address) (uint64, error) {
m.ctrl.T.Helper()
@@ -2172,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()
+15
View File
@@ -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"
@@ -337,4 +340,16 @@ func (w *WrapperV1Full) clientRetrieve(ctx context.Context, order RetrievalOrder
finish(w.ClientExport(ctx, eref, *ref))
}
func (w *WrapperV1Full) PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) {
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{}
+2 -2
View File
@@ -57,8 +57,8 @@ var (
FullAPIVersion0 = newVer(1, 5, 0)
FullAPIVersion1 = newVer(2, 2, 0)
MinerAPIVersion0 = newVer(1, 4, 0)
WorkerAPIVersion0 = newVer(1, 5, 0)
MinerAPIVersion0 = newVer(1, 5, 0)
WorkerAPIVersion0 = newVer(1, 6, 0)
)
//nolint:varcheck,deadcode
+9 -9
View File
@@ -25,35 +25,35 @@ func NewAPIBlockstore(cio ChainIO) Blockstore {
return Adapt(bs) // return an adapted blockstore.
}
func (a *apiBlockstore) DeleteBlock(cid.Cid) error {
func (a *apiBlockstore) DeleteBlock(context.Context, cid.Cid) error {
return xerrors.New("not supported")
}
func (a *apiBlockstore) Has(c cid.Cid) (bool, error) {
return a.api.ChainHasObj(context.TODO(), c)
func (a *apiBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error) {
return a.api.ChainHasObj(ctx, c)
}
func (a *apiBlockstore) Get(c cid.Cid) (blocks.Block, error) {
bb, err := a.api.ChainReadObj(context.TODO(), c)
func (a *apiBlockstore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) {
bb, err := a.api.ChainReadObj(ctx, c)
if err != nil {
return nil, err
}
return blocks.NewBlockWithCid(bb, c)
}
func (a *apiBlockstore) GetSize(c cid.Cid) (int, error) {
bb, err := a.api.ChainReadObj(context.TODO(), c)
func (a *apiBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
bb, err := a.api.ChainReadObj(ctx, c)
if err != nil {
return 0, err
}
return len(bb), nil
}
func (a *apiBlockstore) Put(blocks.Block) error {
func (a *apiBlockstore) Put(context.Context, blocks.Block) error {
return xerrors.New("not supported")
}
func (a *apiBlockstore) PutMany([]blocks.Block) error {
func (a *apiBlockstore) PutMany(context.Context, []blocks.Block) error {
return xerrors.New("not supported")
}
+21 -21
View File
@@ -64,7 +64,7 @@ func NewAutobatch(ctx context.Context, backingBs Blockstore, bufferCapacity int)
return bs
}
func (bs *AutobatchBlockstore) Put(blk block.Block) error {
func (bs *AutobatchBlockstore) Put(ctx context.Context, blk block.Block) error {
bs.stateLock.Lock()
defer bs.stateLock.Unlock()
@@ -94,19 +94,19 @@ func (bs *AutobatchBlockstore) flushWorker(ctx context.Context) {
case <-bs.flushCh:
// TODO: check if we _should_ actually flush. We could get a spurious wakeup
// here.
putErr := bs.doFlush(false)
putErr := bs.doFlush(ctx, false)
for putErr != nil {
select {
case <-ctx.Done():
return
case <-time.After(bs.flushRetryDelay):
autolog.Errorf("FLUSH ERRORED: %w, retrying after %v", putErr, bs.flushRetryDelay)
putErr = bs.doFlush(true)
putErr = bs.doFlush(ctx, true)
}
}
case <-ctx.Done():
// Do one last flush.
_ = bs.doFlush(false)
_ = bs.doFlush(ctx, false)
return
}
}
@@ -114,13 +114,13 @@ func (bs *AutobatchBlockstore) flushWorker(ctx context.Context) {
// caller must NOT hold stateLock
// set retryOnly to true to only retry a failed flush and not flush anything new.
func (bs *AutobatchBlockstore) doFlush(retryOnly bool) error {
func (bs *AutobatchBlockstore) doFlush(ctx context.Context, retryOnly bool) error {
bs.doFlushLock.Lock()
defer bs.doFlushLock.Unlock()
// If we failed to flush last time, try flushing again.
if bs.flushErr != nil {
bs.flushErr = bs.backingBs.PutMany(bs.flushingBatch.blockList)
bs.flushErr = bs.backingBs.PutMany(ctx, bs.flushingBatch.blockList)
}
// If we failed, or we're _only_ retrying, bail.
@@ -137,7 +137,7 @@ func (bs *AutobatchBlockstore) doFlush(retryOnly bool) error {
bs.stateLock.Unlock()
// And try to flush it.
bs.flushErr = bs.backingBs.PutMany(bs.flushingBatch.blockList)
bs.flushErr = bs.backingBs.PutMany(ctx, bs.flushingBatch.blockList)
// If we succeeded, reset the batch. Otherwise, we'll try again next time.
if bs.flushErr == nil {
@@ -151,7 +151,7 @@ func (bs *AutobatchBlockstore) doFlush(retryOnly bool) error {
// caller must NOT hold stateLock
func (bs *AutobatchBlockstore) Flush(ctx context.Context) error {
return bs.doFlush(false)
return bs.doFlush(ctx, false)
}
func (bs *AutobatchBlockstore) Shutdown(ctx context.Context) error {
@@ -169,9 +169,9 @@ func (bs *AutobatchBlockstore) Shutdown(ctx context.Context) error {
return bs.flushErr
}
func (bs *AutobatchBlockstore) Get(c cid.Cid) (block.Block, error) {
func (bs *AutobatchBlockstore) Get(ctx context.Context, c cid.Cid) (block.Block, error) {
// may seem backward to check the backingBs first, but that is the likeliest case
blk, err := bs.backingBs.Get(c)
blk, err := bs.backingBs.Get(ctx, c)
if err == nil {
return blk, nil
}
@@ -192,10 +192,10 @@ func (bs *AutobatchBlockstore) Get(c cid.Cid) (block.Block, error) {
return v, nil
}
return bs.Get(c)
return bs.Get(ctx, c)
}
func (bs *AutobatchBlockstore) DeleteBlock(cid.Cid) error {
func (bs *AutobatchBlockstore) DeleteBlock(context.Context, cid.Cid) error {
// if we wanted to support this, we would have to:
// - flush
// - delete from the backingBs (if present)
@@ -204,13 +204,13 @@ func (bs *AutobatchBlockstore) DeleteBlock(cid.Cid) error {
return xerrors.New("deletion is unsupported")
}
func (bs *AutobatchBlockstore) DeleteMany(cids []cid.Cid) error {
func (bs *AutobatchBlockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
// see note in DeleteBlock()
return xerrors.New("deletion is unsupported")
}
func (bs *AutobatchBlockstore) Has(c cid.Cid) (bool, error) {
_, err := bs.Get(c)
func (bs *AutobatchBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error) {
_, err := bs.Get(ctx, c)
if err == nil {
return true, nil
}
@@ -221,8 +221,8 @@ func (bs *AutobatchBlockstore) Has(c cid.Cid) (bool, error) {
return false, err
}
func (bs *AutobatchBlockstore) GetSize(c cid.Cid) (int, error) {
blk, err := bs.Get(c)
func (bs *AutobatchBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
blk, err := bs.Get(ctx, c)
if err != nil {
return 0, err
}
@@ -230,9 +230,9 @@ func (bs *AutobatchBlockstore) GetSize(c cid.Cid) (int, error) {
return len(blk.RawData()), nil
}
func (bs *AutobatchBlockstore) PutMany(blks []block.Block) error {
func (bs *AutobatchBlockstore) PutMany(ctx context.Context, blks []block.Block) error {
for _, blk := range blks {
if err := bs.Put(blk); err != nil {
if err := bs.Put(ctx, blk); err != nil {
return err
}
}
@@ -252,8 +252,8 @@ func (bs *AutobatchBlockstore) HashOnRead(enabled bool) {
bs.backingBs.HashOnRead(enabled)
}
func (bs *AutobatchBlockstore) View(cid cid.Cid, callback func([]byte) error) error {
blk, err := bs.Get(cid)
func (bs *AutobatchBlockstore) View(ctx context.Context, cid cid.Cid, callback func([]byte) error) error {
blk, err := bs.Get(ctx, cid)
if err != nil {
return err
}
+6 -6
View File
@@ -13,19 +13,19 @@ func TestAutobatchBlockstore(t *testing.T) {
ab := NewAutobatch(ctx, NewMemory(), len(b0.RawData())+len(b1.RawData())-1)
require.NoError(t, ab.Put(b0))
require.NoError(t, ab.Put(b1))
require.NoError(t, ab.Put(b2))
require.NoError(t, ab.Put(ctx, b0))
require.NoError(t, ab.Put(ctx, b1))
require.NoError(t, ab.Put(ctx, b2))
v0, err := ab.Get(b0.Cid())
v0, err := ab.Get(ctx, b0.Cid())
require.NoError(t, err)
require.Equal(t, b0.RawData(), v0.RawData())
v1, err := ab.Get(b1.Cid())
v1, err := ab.Get(ctx, b1.Cid())
require.NoError(t, err)
require.Equal(t, b1.RawData(), v1.RawData())
v2, err := ab.Get(b2.Cid())
v2, err := ab.Get(ctx, b2.Cid())
require.NoError(t, err)
require.Equal(t, b2.RawData(), v2.RawData())
+8 -8
View File
@@ -525,7 +525,7 @@ func (b *Blockstore) Size() (int64, error) {
// View implements blockstore.Viewer, which leverages zero-copy read-only
// access to values.
func (b *Blockstore) View(cid cid.Cid, fn func([]byte) error) error {
func (b *Blockstore) View(ctx context.Context, cid cid.Cid, fn func([]byte) error) error {
if err := b.access(); err != nil {
return err
}
@@ -552,7 +552,7 @@ func (b *Blockstore) View(cid cid.Cid, fn func([]byte) error) error {
}
// Has implements Blockstore.Has.
func (b *Blockstore) Has(cid cid.Cid) (bool, error) {
func (b *Blockstore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
if err := b.access(); err != nil {
return false, err
}
@@ -582,7 +582,7 @@ func (b *Blockstore) Has(cid cid.Cid) (bool, error) {
}
// Get implements Blockstore.Get.
func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error) {
func (b *Blockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
if !cid.Defined() {
return nil, blockstore.ErrNotFound
}
@@ -619,7 +619,7 @@ func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error) {
}
// GetSize implements Blockstore.GetSize.
func (b *Blockstore) GetSize(cid cid.Cid) (int, error) {
func (b *Blockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
if err := b.access(); err != nil {
return 0, err
}
@@ -652,7 +652,7 @@ func (b *Blockstore) GetSize(cid cid.Cid) (int, error) {
}
// Put implements Blockstore.Put.
func (b *Blockstore) Put(block blocks.Block) error {
func (b *Blockstore) Put(ctx context.Context, block blocks.Block) error {
if err := b.access(); err != nil {
return err
}
@@ -691,7 +691,7 @@ func (b *Blockstore) Put(block blocks.Block) error {
}
// PutMany implements Blockstore.PutMany.
func (b *Blockstore) PutMany(blocks []blocks.Block) error {
func (b *Blockstore) PutMany(ctx context.Context, blocks []blocks.Block) error {
if err := b.access(); err != nil {
return err
}
@@ -755,7 +755,7 @@ func (b *Blockstore) PutMany(blocks []blocks.Block) error {
}
// DeleteBlock implements Blockstore.DeleteBlock.
func (b *Blockstore) DeleteBlock(cid cid.Cid) error {
func (b *Blockstore) DeleteBlock(ctx context.Context, cid cid.Cid) error {
if err := b.access(); err != nil {
return err
}
@@ -774,7 +774,7 @@ func (b *Blockstore) DeleteBlock(cid cid.Cid) error {
})
}
func (b *Blockstore) DeleteMany(cids []cid.Cid) error {
func (b *Blockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
if err := b.access(); err != nil {
return err
}
+21 -23
View File
@@ -1,9 +1,10 @@
//stm: #unit
package badgerbs
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
@@ -19,6 +20,8 @@ import (
)
func TestBadgerBlockstore(t *testing.T) {
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
(&Suite{
NewBlockstore: newBlockstore(DefaultOptions),
OpenBlockstore: openBlockstore(DefaultOptions),
@@ -37,6 +40,8 @@ func TestBadgerBlockstore(t *testing.T) {
}
func TestStorageKey(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_STORAGE_KEY_001
bs, _ := newBlockstore(DefaultOptions)(t)
bbs := bs.(*Blockstore)
defer bbs.Close() //nolint:errcheck
@@ -72,20 +77,13 @@ func newBlockstore(optsSupplier func(path string) Options) func(tb testing.TB) (
return func(tb testing.TB) (bs blockstore.BasicBlockstore, path string) {
tb.Helper()
path, err := ioutil.TempDir("", "")
if err != nil {
tb.Fatal(err)
}
path = tb.TempDir()
db, err := Open(optsSupplier(path))
if err != nil {
tb.Fatal(err)
}
tb.Cleanup(func() {
_ = os.RemoveAll(path)
})
return db, path
}
}
@@ -98,17 +96,11 @@ func openBlockstore(optsSupplier func(path string) Options) func(tb testing.TB,
}
func testMove(t *testing.T, optsF func(string) Options) {
basePath, err := ioutil.TempDir("", "")
if err != nil {
t.Fatal(err)
}
ctx := context.Background()
basePath := t.TempDir()
dbPath := filepath.Join(basePath, "db")
t.Cleanup(func() {
_ = os.RemoveAll(basePath)
})
db, err := Open(optsF(dbPath))
if err != nil {
t.Fatal(err)
@@ -122,7 +114,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
// add some blocks
for i := 0; i < 10; i++ {
blk := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
err := db.Put(blk)
err := db.Put(ctx, blk)
if err != nil {
t.Fatal(err)
}
@@ -132,7 +124,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
// delete some of them
for i := 5; i < 10; i++ {
c := have[i].Cid()
err := db.DeleteBlock(c)
err := db.DeleteBlock(ctx, c)
if err != nil {
t.Fatal(err)
}
@@ -145,7 +137,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
g.Go(func() error {
for i := 10; i < 1000; i++ {
blk := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
err := db.Put(blk)
err := db.Put(ctx, blk)
if err != nil {
return err
}
@@ -165,7 +157,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
// now check that we have all the blocks in have and none in the deleted lists
checkBlocks := func() {
for _, blk := range have {
has, err := db.Has(blk.Cid())
has, err := db.Has(ctx, blk.Cid())
if err != nil {
t.Fatal(err)
}
@@ -174,7 +166,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
t.Fatal("missing block")
}
blk2, err := db.Get(blk.Cid())
blk2, err := db.Get(ctx, blk.Cid())
if err != nil {
t.Fatal(err)
}
@@ -185,7 +177,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
}
for _, c := range deleted {
has, err := db.Has(c)
has, err := db.Has(ctx, c)
if err != nil {
t.Fatal(err)
}
@@ -263,10 +255,16 @@ func testMove(t *testing.T, optsF func(string) Options) {
}
func TestMoveNoPrefix(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001
testMove(t, DefaultOptions)
}
func TestMoveWithPrefix(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001
testMove(t, func(path string) Options {
opts := DefaultOptions(path)
opts.Prefix = "/prefixed/"
+68 -24
View File
@@ -1,3 +1,4 @@
//stm: #unit
package badgerbs
import (
@@ -44,28 +45,38 @@ func (s *Suite) RunTests(t *testing.T, prefix string) {
}
func (s *Suite) TestGetWhenKeyNotPresent(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_GET_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
c := cid.NewCidV0(u.Hash([]byte("stuff")))
bl, err := bs.Get(c)
bl, err := bs.Get(ctx, c)
require.Nil(t, bl)
require.Equal(t, blockstore.ErrNotFound, err)
}
func (s *Suite) TestGetWhenKeyIsNil(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_GET_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
_, err := bs.Get(cid.Undef)
_, err := bs.Get(ctx, cid.Undef)
require.Equal(t, blockstore.ErrNotFound, err)
}
func (s *Suite) TestPutThenGetBlock(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
@@ -73,15 +84,18 @@ func (s *Suite) TestPutThenGetBlock(t *testing.T) {
orig := blocks.NewBlock([]byte("some data"))
err := bs.Put(orig)
err := bs.Put(ctx, orig)
require.NoError(t, err)
fetched, err := bs.Get(orig.Cid())
fetched, err := bs.Get(ctx, orig.Cid())
require.NoError(t, err)
require.Equal(t, orig.RawData(), fetched.RawData())
}
func (s *Suite) TestHas(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_HAS_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
@@ -89,19 +103,23 @@ func (s *Suite) TestHas(t *testing.T) {
orig := blocks.NewBlock([]byte("some data"))
err := bs.Put(orig)
err := bs.Put(ctx, orig)
require.NoError(t, err)
ok, err := bs.Has(orig.Cid())
ok, err := bs.Has(ctx, orig.Cid())
require.NoError(t, err)
require.True(t, ok)
ok, err = bs.Has(blocks.NewBlock([]byte("another thing")).Cid())
ok, err = bs.Has(ctx, blocks.NewBlock([]byte("another thing")).Cid())
require.NoError(t, err)
require.False(t, ok)
}
func (s *Suite) TestCidv0v1(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
@@ -109,15 +127,20 @@ func (s *Suite) TestCidv0v1(t *testing.T) {
orig := blocks.NewBlock([]byte("some data"))
err := bs.Put(orig)
err := bs.Put(ctx, orig)
require.NoError(t, err)
fetched, err := bs.Get(cid.NewCidV1(cid.DagProtobuf, orig.Cid().Hash()))
fetched, err := bs.Get(ctx, cid.NewCidV1(cid.DagProtobuf, orig.Cid().Hash()))
require.NoError(t, err)
require.Equal(t, orig.RawData(), fetched.RawData())
}
func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_SIZE_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
@@ -127,26 +150,28 @@ func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) {
missingBlock := blocks.NewBlock([]byte("missingBlock"))
emptyBlock := blocks.NewBlock([]byte{})
err := bs.Put(block)
err := bs.Put(ctx, block)
require.NoError(t, err)
blockSize, err := bs.GetSize(block.Cid())
blockSize, err := bs.GetSize(ctx, block.Cid())
require.NoError(t, err)
require.Len(t, block.RawData(), blockSize)
err = bs.Put(emptyBlock)
err = bs.Put(ctx, emptyBlock)
require.NoError(t, err)
emptySize, err := bs.GetSize(emptyBlock.Cid())
emptySize, err := bs.GetSize(ctx, emptyBlock.Cid())
require.NoError(t, err)
require.Zero(t, emptySize)
missingSize, err := bs.GetSize(missingBlock.Cid())
missingSize, err := bs.GetSize(ctx, missingBlock.Cid())
require.Equal(t, blockstore.ErrNotFound, err)
require.Equal(t, -1, missingSize)
}
func (s *Suite) TestAllKeysSimple(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
@@ -163,6 +188,9 @@ func (s *Suite) TestAllKeysSimple(t *testing.T) {
}
func (s *Suite) TestAllKeysRespectsContext(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
@@ -193,6 +221,7 @@ func (s *Suite) TestAllKeysRespectsContext(t *testing.T) {
}
func (s *Suite) TestDoubleClose(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
bs, _ := s.NewBlockstore(t)
c, ok := bs.(io.Closer)
if !ok {
@@ -203,6 +232,10 @@ func (s *Suite) TestDoubleClose(t *testing.T) {
}
func (s *Suite) TestReopenPutGet(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_001
ctx := context.Background()
bs, path := s.NewBlockstore(t)
c, ok := bs.(io.Closer)
if !ok {
@@ -210,7 +243,7 @@ func (s *Suite) TestReopenPutGet(t *testing.T) {
}
orig := blocks.NewBlock([]byte("some data"))
err := bs.Put(orig)
err := bs.Put(ctx, orig)
require.NoError(t, err)
err = c.Close()
@@ -219,7 +252,7 @@ func (s *Suite) TestReopenPutGet(t *testing.T) {
bs, err = s.OpenBlockstore(t, path)
require.NoError(t, err)
fetched, err := bs.Get(orig.Cid())
fetched, err := bs.Get(ctx, orig.Cid())
require.NoError(t, err)
require.Equal(t, orig.RawData(), fetched.RawData())
@@ -228,6 +261,11 @@ func (s *Suite) TestReopenPutGet(t *testing.T) {
}
func (s *Suite) TestPutMany(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_HAS_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_001, @SPLITSTORE_BADGER_PUT_MANY_001
//stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
@@ -238,15 +276,15 @@ func (s *Suite) TestPutMany(t *testing.T) {
blocks.NewBlock([]byte("foo2")),
blocks.NewBlock([]byte("foo3")),
}
err := bs.PutMany(blks)
err := bs.PutMany(ctx, blks)
require.NoError(t, err)
for _, blk := range blks {
fetched, err := bs.Get(blk.Cid())
fetched, err := bs.Get(ctx, blk.Cid())
require.NoError(t, err)
require.Equal(t, blk.RawData(), fetched.RawData())
ok, err := bs.Has(blk.Cid())
ok, err := bs.Has(ctx, blk.Cid())
require.NoError(t, err)
require.True(t, ok)
}
@@ -259,6 +297,12 @@ func (s *Suite) TestPutMany(t *testing.T) {
}
func (s *Suite) TestDelete(t *testing.T) {
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_POOLED_STORAGE_HAS_001
//stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001, @SPLITSTORE_BADGER_HAS_001
//stm: @SPLITSTORE_BADGER_PUT_MANY_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
@@ -269,10 +313,10 @@ func (s *Suite) TestDelete(t *testing.T) {
blocks.NewBlock([]byte("foo2")),
blocks.NewBlock([]byte("foo3")),
}
err := bs.PutMany(blks)
err := bs.PutMany(ctx, blks)
require.NoError(t, err)
err = bs.DeleteBlock(blks[1].Cid())
err = bs.DeleteBlock(ctx, blks[1].Cid())
require.NoError(t, err)
ch, err := bs.AllKeysChan(context.Background())
@@ -285,17 +329,17 @@ func (s *Suite) TestDelete(t *testing.T) {
cid.NewCidV1(cid.Raw, blks[2].Cid().Hash()),
})
has, err := bs.Has(blks[1].Cid())
has, err := bs.Has(ctx, blks[1].Cid())
require.NoError(t, err)
require.False(t, has)
}
func insertBlocks(t *testing.T, bs blockstore.BasicBlockstore, count int) []cid.Cid {
ctx := context.Background()
keys := make([]cid.Cid, count)
for i := 0; i < count; i++ {
block := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
err := bs.Put(block)
err := bs.Put(ctx, block)
require.NoError(t, err)
// NewBlock assigns a CIDv0; we convert it to CIDv1 because that's what
// the store returns.
+7 -5
View File
@@ -1,6 +1,8 @@
package blockstore
import (
"context"
cid "github.com/ipfs/go-cid"
ds "github.com/ipfs/go-datastore"
logging "github.com/ipfs/go-log/v2"
@@ -27,7 +29,7 @@ type BasicBlockstore = blockstore.Blockstore
type Viewer = blockstore.Viewer
type BatchDeleter interface {
DeleteMany(cids []cid.Cid) error
DeleteMany(ctx context.Context, cids []cid.Cid) error
}
// BlockstoreIterator is a trait for efficient iteration
@@ -93,17 +95,17 @@ type adaptedBlockstore struct {
var _ Blockstore = (*adaptedBlockstore)(nil)
func (a *adaptedBlockstore) View(cid cid.Cid, callback func([]byte) error) error {
blk, err := a.Get(cid)
func (a *adaptedBlockstore) View(ctx context.Context, cid cid.Cid, callback func([]byte) error) error {
blk, err := a.Get(ctx, cid)
if err != nil {
return err
}
return callback(blk.RawData())
}
func (a *adaptedBlockstore) DeleteMany(cids []cid.Cid) error {
func (a *adaptedBlockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
for _, cid := range cids {
err := a.DeleteBlock(cid)
err := a.DeleteBlock(ctx, cid)
if err != nil {
return err
}
+23 -23
View File
@@ -88,34 +88,34 @@ func (bs *BufferedBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid,
return out, nil
}
func (bs *BufferedBlockstore) DeleteBlock(c cid.Cid) error {
if err := bs.read.DeleteBlock(c); err != nil {
func (bs *BufferedBlockstore) DeleteBlock(ctx context.Context, c cid.Cid) error {
if err := bs.read.DeleteBlock(ctx, c); err != nil {
return err
}
return bs.write.DeleteBlock(c)
return bs.write.DeleteBlock(ctx, c)
}
func (bs *BufferedBlockstore) DeleteMany(cids []cid.Cid) error {
if err := bs.read.DeleteMany(cids); err != nil {
func (bs *BufferedBlockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
if err := bs.read.DeleteMany(ctx, cids); err != nil {
return err
}
return bs.write.DeleteMany(cids)
return bs.write.DeleteMany(ctx, cids)
}
func (bs *BufferedBlockstore) View(c cid.Cid, callback func([]byte) error) error {
func (bs *BufferedBlockstore) View(ctx context.Context, c cid.Cid, callback func([]byte) error) error {
// both stores are viewable.
if err := bs.write.View(c, callback); err == ErrNotFound {
if err := bs.write.View(ctx, c, callback); err == ErrNotFound {
// not found in write blockstore; fall through.
} else {
return err // propagate errors, or nil, i.e. found.
}
return bs.read.View(c, callback)
return bs.read.View(ctx, c, callback)
}
func (bs *BufferedBlockstore) Get(c cid.Cid) (block.Block, error) {
if out, err := bs.write.Get(c); err != nil {
func (bs *BufferedBlockstore) Get(ctx context.Context, c cid.Cid) (block.Block, error) {
if out, err := bs.write.Get(ctx, c); err != nil {
if err != ErrNotFound {
return nil, err
}
@@ -123,20 +123,20 @@ func (bs *BufferedBlockstore) Get(c cid.Cid) (block.Block, error) {
return out, nil
}
return bs.read.Get(c)
return bs.read.Get(ctx, c)
}
func (bs *BufferedBlockstore) GetSize(c cid.Cid) (int, error) {
s, err := bs.read.GetSize(c)
func (bs *BufferedBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
s, err := bs.read.GetSize(ctx, c)
if err == ErrNotFound || s == 0 {
return bs.write.GetSize(c)
return bs.write.GetSize(ctx, c)
}
return s, err
}
func (bs *BufferedBlockstore) Put(blk block.Block) error {
has, err := bs.read.Has(blk.Cid()) // TODO: consider dropping this check
func (bs *BufferedBlockstore) Put(ctx context.Context, blk block.Block) error {
has, err := bs.read.Has(ctx, blk.Cid()) // TODO: consider dropping this check
if err != nil {
return err
}
@@ -145,11 +145,11 @@ func (bs *BufferedBlockstore) Put(blk block.Block) error {
return nil
}
return bs.write.Put(blk)
return bs.write.Put(ctx, blk)
}
func (bs *BufferedBlockstore) Has(c cid.Cid) (bool, error) {
has, err := bs.write.Has(c)
func (bs *BufferedBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error) {
has, err := bs.write.Has(ctx, c)
if err != nil {
return false, err
}
@@ -157,7 +157,7 @@ func (bs *BufferedBlockstore) Has(c cid.Cid) (bool, error) {
return true, nil
}
return bs.read.Has(c)
return bs.read.Has(ctx, c)
}
func (bs *BufferedBlockstore) HashOnRead(hor bool) {
@@ -165,8 +165,8 @@ func (bs *BufferedBlockstore) HashOnRead(hor bool) {
bs.write.HashOnRead(hor)
}
func (bs *BufferedBlockstore) PutMany(blks []block.Block) error {
return bs.write.PutMany(blks)
func (bs *BufferedBlockstore) PutMany(ctx context.Context, blks []block.Block) error {
return bs.write.PutMany(ctx, blks)
}
func (bs *BufferedBlockstore) Read() Blockstore {
+21
View File
@@ -0,0 +1,21 @@
package blockstore
import (
"context"
)
type hotViewKey struct{}
var hotView = hotViewKey{}
// WithHotView constructs a new context with an option that provides a hint to the blockstore
// (e.g. the splitstore) that the object (and its ipld references) should be kept hot.
func WithHotView(ctx context.Context) context.Context {
return context.WithValue(ctx, hotView, struct{}{})
}
// IsHotView returns true if the hot view option is set in the context
func IsHotView(ctx context.Context) bool {
v := ctx.Value(hotView)
return v != nil
}
+12 -12
View File
@@ -18,39 +18,39 @@ func NewDiscardStore(bs Blockstore) Blockstore {
return &discardstore{bs: bs}
}
func (b *discardstore) Has(cid cid.Cid) (bool, error) {
return b.bs.Has(cid)
func (b *discardstore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
return b.bs.Has(ctx, cid)
}
func (b *discardstore) HashOnRead(hor bool) {
b.bs.HashOnRead(hor)
}
func (b *discardstore) Get(cid cid.Cid) (blocks.Block, error) {
return b.bs.Get(cid)
func (b *discardstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
return b.bs.Get(ctx, cid)
}
func (b *discardstore) GetSize(cid cid.Cid) (int, error) {
return b.bs.GetSize(cid)
func (b *discardstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
return b.bs.GetSize(ctx, cid)
}
func (b *discardstore) View(cid cid.Cid, f func([]byte) error) error {
return b.bs.View(cid, f)
func (b *discardstore) View(ctx context.Context, cid cid.Cid, f func([]byte) error) error {
return b.bs.View(ctx, cid, f)
}
func (b *discardstore) Put(blk blocks.Block) error {
func (b *discardstore) Put(ctx context.Context, blk blocks.Block) error {
return nil
}
func (b *discardstore) PutMany(blks []blocks.Block) error {
func (b *discardstore) PutMany(ctx context.Context, blks []blocks.Block) error {
return nil
}
func (b *discardstore) DeleteBlock(cid cid.Cid) error {
func (b *discardstore) DeleteBlock(ctx context.Context, cid cid.Cid) error {
return nil
}
func (b *discardstore) DeleteMany(cids []cid.Cid) error {
func (b *discardstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
return nil
}
+5 -5
View File
@@ -71,14 +71,14 @@ func (fbs *FallbackStore) getFallback(c cid.Cid) (blocks.Block, error) {
// chain bitswap puts blocks in temp blockstore which is cleaned up
// every few min (to drop any messages we fetched but don't want)
// in this case we want to keep this block around
if err := fbs.Put(b); err != nil {
if err := fbs.Put(ctx, b); err != nil {
return nil, xerrors.Errorf("persisting fallback-fetched block: %w", err)
}
return b, nil
}
func (fbs *FallbackStore) Get(c cid.Cid) (blocks.Block, error) {
b, err := fbs.Blockstore.Get(c)
func (fbs *FallbackStore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) {
b, err := fbs.Blockstore.Get(ctx, c)
switch err {
case nil:
return b, nil
@@ -89,8 +89,8 @@ func (fbs *FallbackStore) Get(c cid.Cid) (blocks.Block, error) {
}
}
func (fbs *FallbackStore) GetSize(c cid.Cid) (int, error) {
sz, err := fbs.Blockstore.GetSize(c)
func (fbs *FallbackStore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
sz, err := fbs.Blockstore.GetSize(ctx, c)
switch err {
case nil:
return sz, nil
+16 -16
View File
@@ -38,7 +38,7 @@ func decodeCid(cid cid.Cid) (inline bool, data []byte, err error) {
return false, nil, err
}
func (b *idstore) Has(cid cid.Cid) (bool, error) {
func (b *idstore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
inline, _, err := decodeCid(cid)
if err != nil {
return false, xerrors.Errorf("error decoding Cid: %w", err)
@@ -48,10 +48,10 @@ func (b *idstore) Has(cid cid.Cid) (bool, error) {
return true, nil
}
return b.bs.Has(cid)
return b.bs.Has(ctx, cid)
}
func (b *idstore) Get(cid cid.Cid) (blocks.Block, error) {
func (b *idstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
inline, data, err := decodeCid(cid)
if err != nil {
return nil, xerrors.Errorf("error decoding Cid: %w", err)
@@ -61,10 +61,10 @@ func (b *idstore) Get(cid cid.Cid) (blocks.Block, error) {
return blocks.NewBlockWithCid(data, cid)
}
return b.bs.Get(cid)
return b.bs.Get(ctx, cid)
}
func (b *idstore) GetSize(cid cid.Cid) (int, error) {
func (b *idstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
inline, data, err := decodeCid(cid)
if err != nil {
return 0, xerrors.Errorf("error decoding Cid: %w", err)
@@ -74,10 +74,10 @@ func (b *idstore) GetSize(cid cid.Cid) (int, error) {
return len(data), err
}
return b.bs.GetSize(cid)
return b.bs.GetSize(ctx, cid)
}
func (b *idstore) View(cid cid.Cid, cb func([]byte) error) error {
func (b *idstore) View(ctx context.Context, cid cid.Cid, cb func([]byte) error) error {
inline, data, err := decodeCid(cid)
if err != nil {
return xerrors.Errorf("error decoding Cid: %w", err)
@@ -87,10 +87,10 @@ func (b *idstore) View(cid cid.Cid, cb func([]byte) error) error {
return cb(data)
}
return b.bs.View(cid, cb)
return b.bs.View(ctx, cid, cb)
}
func (b *idstore) Put(blk blocks.Block) error {
func (b *idstore) Put(ctx context.Context, blk blocks.Block) error {
inline, _, err := decodeCid(blk.Cid())
if err != nil {
return xerrors.Errorf("error decoding Cid: %w", err)
@@ -100,10 +100,10 @@ func (b *idstore) Put(blk blocks.Block) error {
return nil
}
return b.bs.Put(blk)
return b.bs.Put(ctx, blk)
}
func (b *idstore) PutMany(blks []blocks.Block) error {
func (b *idstore) PutMany(ctx context.Context, blks []blocks.Block) error {
toPut := make([]blocks.Block, 0, len(blks))
for _, blk := range blks {
inline, _, err := decodeCid(blk.Cid())
@@ -118,13 +118,13 @@ func (b *idstore) PutMany(blks []blocks.Block) error {
}
if len(toPut) > 0 {
return b.bs.PutMany(toPut)
return b.bs.PutMany(ctx, toPut)
}
return nil
}
func (b *idstore) DeleteBlock(cid cid.Cid) error {
func (b *idstore) DeleteBlock(ctx context.Context, cid cid.Cid) error {
inline, _, err := decodeCid(cid)
if err != nil {
return xerrors.Errorf("error decoding Cid: %w", err)
@@ -134,10 +134,10 @@ func (b *idstore) DeleteBlock(cid cid.Cid) error {
return nil
}
return b.bs.DeleteBlock(cid)
return b.bs.DeleteBlock(ctx, cid)
}
func (b *idstore) DeleteMany(cids []cid.Cid) error {
func (b *idstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
toDelete := make([]cid.Cid, 0, len(cids))
for _, cid := range cids {
inline, _, err := decodeCid(cid)
@@ -152,7 +152,7 @@ func (b *idstore) DeleteMany(cids []cid.Cid) error {
}
if len(toDelete) > 0 {
return b.bs.DeleteMany(toDelete)
return b.bs.DeleteMany(ctx, toDelete)
}
return nil
+11 -11
View File
@@ -79,12 +79,12 @@ func NewRemoteIPFSBlockstore(ctx context.Context, maddr multiaddr.Multiaddr, onl
return Adapt(bs), nil
}
func (i *IPFSBlockstore) DeleteBlock(cid cid.Cid) error {
func (i *IPFSBlockstore) DeleteBlock(ctx context.Context, cid cid.Cid) error {
return xerrors.Errorf("not supported")
}
func (i *IPFSBlockstore) Has(cid cid.Cid) (bool, error) {
_, err := i.offlineAPI.Block().Stat(i.ctx, path.IpldPath(cid))
func (i *IPFSBlockstore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
_, err := i.offlineAPI.Block().Stat(ctx, path.IpldPath(cid))
if err != nil {
// The underlying client is running in Offline mode.
// Stat() will fail with an err if the block isn't in the
@@ -99,8 +99,8 @@ func (i *IPFSBlockstore) Has(cid cid.Cid) (bool, error) {
return true, nil
}
func (i *IPFSBlockstore) Get(cid cid.Cid) (blocks.Block, error) {
rd, err := i.api.Block().Get(i.ctx, path.IpldPath(cid))
func (i *IPFSBlockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
rd, err := i.api.Block().Get(ctx, path.IpldPath(cid))
if err != nil {
return nil, xerrors.Errorf("getting ipfs block: %w", err)
}
@@ -113,8 +113,8 @@ func (i *IPFSBlockstore) Get(cid cid.Cid) (blocks.Block, error) {
return blocks.NewBlockWithCid(data, cid)
}
func (i *IPFSBlockstore) GetSize(cid cid.Cid) (int, error) {
st, err := i.api.Block().Stat(i.ctx, path.IpldPath(cid))
func (i *IPFSBlockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
st, err := i.api.Block().Stat(ctx, path.IpldPath(cid))
if err != nil {
return 0, xerrors.Errorf("getting ipfs block: %w", err)
}
@@ -122,23 +122,23 @@ func (i *IPFSBlockstore) GetSize(cid cid.Cid) (int, error) {
return st.Size(), nil
}
func (i *IPFSBlockstore) Put(block blocks.Block) error {
func (i *IPFSBlockstore) Put(ctx context.Context, block blocks.Block) error {
mhd, err := multihash.Decode(block.Cid().Hash())
if err != nil {
return err
}
_, err = i.api.Block().Put(i.ctx, bytes.NewReader(block.RawData()),
_, err = i.api.Block().Put(ctx, bytes.NewReader(block.RawData()),
options.Block.Hash(mhd.Code, mhd.Length),
options.Block.Format(cid.CodecToStr[block.Cid().Type()]))
return err
}
func (i *IPFSBlockstore) PutMany(blocks []blocks.Block) error {
func (i *IPFSBlockstore) PutMany(ctx context.Context, blocks []blocks.Block) error {
// TODO: could be done in parallel
for _, block := range blocks {
if err := i.Put(block); err != nil {
if err := i.Put(ctx, block); err != nil {
return err
}
}
+9 -9
View File
@@ -15,24 +15,24 @@ func NewMemory() MemBlockstore {
// MemBlockstore is a terminal blockstore that keeps blocks in memory.
type MemBlockstore map[cid.Cid]blocks.Block
func (m MemBlockstore) DeleteBlock(k cid.Cid) error {
func (m MemBlockstore) DeleteBlock(ctx context.Context, k cid.Cid) error {
delete(m, k)
return nil
}
func (m MemBlockstore) DeleteMany(ks []cid.Cid) error {
func (m MemBlockstore) DeleteMany(ctx context.Context, ks []cid.Cid) error {
for _, k := range ks {
delete(m, k)
}
return nil
}
func (m MemBlockstore) Has(k cid.Cid) (bool, error) {
func (m MemBlockstore) Has(ctx context.Context, k cid.Cid) (bool, error) {
_, ok := m[k]
return ok, nil
}
func (m MemBlockstore) View(k cid.Cid, callback func([]byte) error) error {
func (m MemBlockstore) View(ctx context.Context, k cid.Cid, callback func([]byte) error) error {
b, ok := m[k]
if !ok {
return ErrNotFound
@@ -40,7 +40,7 @@ func (m MemBlockstore) View(k cid.Cid, callback func([]byte) error) error {
return callback(b.RawData())
}
func (m MemBlockstore) Get(k cid.Cid) (blocks.Block, error) {
func (m MemBlockstore) Get(ctx context.Context, k cid.Cid) (blocks.Block, error) {
b, ok := m[k]
if !ok {
return nil, ErrNotFound
@@ -49,7 +49,7 @@ func (m MemBlockstore) Get(k cid.Cid) (blocks.Block, error) {
}
// GetSize returns the CIDs mapped BlockSize
func (m MemBlockstore) GetSize(k cid.Cid) (int, error) {
func (m MemBlockstore) GetSize(ctx context.Context, k cid.Cid) (int, error) {
b, ok := m[k]
if !ok {
return 0, ErrNotFound
@@ -58,7 +58,7 @@ func (m MemBlockstore) GetSize(k cid.Cid) (int, error) {
}
// Put puts a given block to the underlying datastore
func (m MemBlockstore) Put(b blocks.Block) error {
func (m MemBlockstore) Put(ctx context.Context, b blocks.Block) error {
// Convert to a basic block for safety, but try to reuse the existing
// block if it's already a basic block.
k := b.Cid()
@@ -76,9 +76,9 @@ func (m MemBlockstore) Put(b blocks.Block) error {
// PutMany puts a slice of blocks at the same time using batching
// capabilities of the underlying datastore whenever possible.
func (m MemBlockstore) PutMany(bs []blocks.Block) error {
func (m MemBlockstore) PutMany(ctx context.Context, bs []blocks.Block) error {
for _, b := range bs {
_ = m.Put(b) // can't fail
_ = m.Put(ctx, b) // can't fail
}
return nil
}
+11 -4
View File
@@ -49,10 +49,11 @@ These are options in the `[Chainstore.Splitstore]` section of the configuration:
blockstore and discards writes; this is necessary to support syncing from a snapshot.
- `MarkSetType` -- specifies the type of markset to use during compaction.
The markset is the data structure used by compaction/gc to track live objects.
The default value is `"map"`, which will use an in-memory map; if you are limited
in memory (or indeed see compaction run out of memory), you can also specify
`"badger"` which will use an disk backed markset, using badger. This will use
much less memory, but will also make compaction slower.
The default value is "badger", which will use a disk backed markset using badger.
If you have a lot of memory (48G or more) you can also use "map", which will use
an in memory markset, speeding up compaction at the cost of higher memory usage.
Note: If you are using a VPS with a network volume, you need to provision at least
3000 IOPs with the badger markset.
- `HotStoreMessageRetention` -- specifies how many finalities, beyond the 4
finalities maintained by default, to maintain messages and message receipts in the
hotstore. This is useful for assistive nodes that want to support syncing for other
@@ -105,6 +106,12 @@ Compaction works transactionally with the following algorithm:
- We delete in small batches taking a lock; each batch is checked again for marks, from the concurrent transactional mark, so as to never delete anything live
- We then end the transaction and compact/gc the hotstore.
As of [#8008](https://github.com/filecoin-project/lotus/pull/8008) the compaction algorithm has been
modified to eliminate sorting and maintain the cold object set on disk. This drastically reduces
memory usage; in fact, when using badger as the markset compaction uses very little memory, and
it should be now possible to run splitstore with 32GB of RAM or less without danger of running out of
memory during compaction.
## Garbage Collection
TBD -- see [#6577](https://github.com/filecoin-project/lotus/issues/6577)
+118
View File
@@ -0,0 +1,118 @@
package splitstore
import (
"bufio"
"io"
"os"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
mh "github.com/multiformats/go-multihash"
)
type Checkpoint struct {
file *os.File
buf *bufio.Writer
}
func NewCheckpoint(path string) (*Checkpoint, error) {
file, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY|os.O_SYNC, 0644)
if err != nil {
return nil, xerrors.Errorf("error creating checkpoint: %w", err)
}
buf := bufio.NewWriter(file)
return &Checkpoint{
file: file,
buf: buf,
}, nil
}
func OpenCheckpoint(path string) (*Checkpoint, cid.Cid, error) {
filein, err := os.Open(path)
if err != nil {
return nil, cid.Undef, xerrors.Errorf("error opening checkpoint for reading: %w", err)
}
defer filein.Close() //nolint:errcheck
bufin := bufio.NewReader(filein)
start, err := readRawCid(bufin, nil)
if err != nil && err != io.EOF {
return nil, cid.Undef, xerrors.Errorf("error reading cid from checkpoint: %w", err)
}
fileout, err := os.OpenFile(path, os.O_WRONLY|os.O_SYNC, 0644)
if err != nil {
return nil, cid.Undef, xerrors.Errorf("error opening checkpoint for writing: %w", err)
}
bufout := bufio.NewWriter(fileout)
return &Checkpoint{
file: fileout,
buf: bufout,
}, start, nil
}
func (cp *Checkpoint) Set(c cid.Cid) error {
if _, err := cp.file.Seek(0, io.SeekStart); err != nil {
return xerrors.Errorf("error seeking beginning of checkpoint: %w", err)
}
if err := writeRawCid(cp.buf, c, true); err != nil {
return xerrors.Errorf("error writing cid to checkpoint: %w", err)
}
return nil
}
func (cp *Checkpoint) Close() error {
if cp.file == nil {
return nil
}
err := cp.file.Close()
cp.file = nil
cp.buf = nil
return err
}
func readRawCid(buf *bufio.Reader, hbuf []byte) (cid.Cid, error) {
sz, err := buf.ReadByte()
if err != nil {
return cid.Undef, err // don't wrap EOF as it is not an error here
}
if hbuf == nil {
hbuf = make([]byte, int(sz))
} else {
hbuf = hbuf[:int(sz)]
}
if _, err := io.ReadFull(buf, hbuf); err != nil {
return cid.Undef, xerrors.Errorf("error reading hash: %w", err) // wrap EOF, it's corrupt
}
hash, err := mh.Cast(hbuf)
if err != nil {
return cid.Undef, xerrors.Errorf("error casting multihash: %w", err)
}
return cid.NewCidV1(cid.Raw, hash), nil
}
func writeRawCid(buf *bufio.Writer, c cid.Cid, flush bool) error {
hash := c.Hash()
if err := buf.WriteByte(byte(len(hash))); err != nil {
return err
}
if _, err := buf.Write(hash); err != nil {
return err
}
if flush {
return buf.Flush()
}
return nil
}
+138
View File
@@ -0,0 +1,138 @@
package splitstore
import (
"path/filepath"
"testing"
"github.com/ipfs/go-cid"
"github.com/multiformats/go-multihash"
)
func TestCheckpoint(t *testing.T) {
dir := t.TempDir()
path := filepath.Join(dir, "checkpoint")
makeCid := func(key string) cid.Cid {
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
if err != nil {
t.Fatal(err)
}
return cid.NewCidV1(cid.Raw, h)
}
k1 := makeCid("a")
k2 := makeCid("b")
k3 := makeCid("c")
k4 := makeCid("d")
cp, err := NewCheckpoint(path)
if err != nil {
t.Fatal(err)
}
if err := cp.Set(k1); err != nil {
t.Fatal(err)
}
if err := cp.Set(k2); err != nil {
t.Fatal(err)
}
if err := cp.Close(); err != nil {
t.Fatal(err)
}
cp, start, err := OpenCheckpoint(path)
if err != nil {
t.Fatal(err)
}
if !start.Equals(k2) {
t.Fatalf("expected start to be %s; got %s", k2, start)
}
if err := cp.Set(k3); err != nil {
t.Fatal(err)
}
if err := cp.Set(k4); err != nil {
t.Fatal(err)
}
if err := cp.Close(); err != nil {
t.Fatal(err)
}
cp, start, err = OpenCheckpoint(path)
if err != nil {
t.Fatal(err)
}
if !start.Equals(k4) {
t.Fatalf("expected start to be %s; got %s", k4, start)
}
if err := cp.Close(); err != nil {
t.Fatal(err)
}
// also test correct operation with an empty checkpoint
cp, err = NewCheckpoint(path)
if err != nil {
t.Fatal(err)
}
if err := cp.Close(); err != nil {
t.Fatal(err)
}
cp, start, err = OpenCheckpoint(path)
if err != nil {
t.Fatal(err)
}
if start.Defined() {
t.Fatal("expected start to be undefined")
}
if err := cp.Set(k1); err != nil {
t.Fatal(err)
}
if err := cp.Set(k2); err != nil {
t.Fatal(err)
}
if err := cp.Close(); err != nil {
t.Fatal(err)
}
cp, start, err = OpenCheckpoint(path)
if err != nil {
t.Fatal(err)
}
if !start.Equals(k2) {
t.Fatalf("expected start to be %s; got %s", k2, start)
}
if err := cp.Set(k3); err != nil {
t.Fatal(err)
}
if err := cp.Set(k4); err != nil {
t.Fatal(err)
}
if err := cp.Close(); err != nil {
t.Fatal(err)
}
cp, start, err = OpenCheckpoint(path)
if err != nil {
t.Fatal(err)
}
if !start.Equals(k4) {
t.Fatalf("expected start to be %s; got %s", k4, start)
}
if err := cp.Close(); err != nil {
t.Fatal(err)
}
}
+102
View File
@@ -0,0 +1,102 @@
package splitstore
import (
"bufio"
"io"
"os"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
)
type ColdSetWriter struct {
file *os.File
buf *bufio.Writer
}
type ColdSetReader struct {
file *os.File
buf *bufio.Reader
}
func NewColdSetWriter(path string) (*ColdSetWriter, error) {
file, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
if err != nil {
return nil, xerrors.Errorf("error creating coldset: %w", err)
}
buf := bufio.NewWriter(file)
return &ColdSetWriter{
file: file,
buf: buf,
}, nil
}
func NewColdSetReader(path string) (*ColdSetReader, error) {
file, err := os.Open(path)
if err != nil {
return nil, xerrors.Errorf("error opening coldset: %w", err)
}
buf := bufio.NewReader(file)
return &ColdSetReader{
file: file,
buf: buf,
}, nil
}
func (s *ColdSetWriter) Write(c cid.Cid) error {
return writeRawCid(s.buf, c, false)
}
func (s *ColdSetWriter) Close() error {
if s.file == nil {
return nil
}
err1 := s.buf.Flush()
err2 := s.file.Close()
s.buf = nil
s.file = nil
if err1 != nil {
return err1
}
return err2
}
func (s *ColdSetReader) ForEach(f func(cid.Cid) error) error {
hbuf := make([]byte, 256)
for {
next, err := readRawCid(s.buf, hbuf)
if err != nil {
if err == io.EOF {
return nil
}
return xerrors.Errorf("error reading coldset: %w", err)
}
if err := f(next); err != nil {
return err
}
}
}
func (s *ColdSetReader) Reset() error {
_, err := s.file.Seek(0, io.SeekStart)
return err
}
func (s *ColdSetReader) Close() error {
if s.file == nil {
return nil
}
err := s.file.Close()
s.file = nil
s.buf = nil
return err
}
+90
View File
@@ -0,0 +1,90 @@
package splitstore
import (
"fmt"
"path/filepath"
"testing"
"github.com/ipfs/go-cid"
"github.com/multiformats/go-multihash"
)
func TestColdSet(t *testing.T) {
dir := t.TempDir()
path := filepath.Join(dir, "coldset")
makeCid := func(i int) cid.Cid {
h, err := multihash.Sum([]byte(fmt.Sprintf("cid.%d", i)), multihash.SHA2_256, -1)
if err != nil {
t.Fatal(err)
}
return cid.NewCidV1(cid.Raw, h)
}
const count = 1000
cids := make([]cid.Cid, 0, count)
for i := 0; i < count; i++ {
cids = append(cids, makeCid(i))
}
cw, err := NewColdSetWriter(path)
if err != nil {
t.Fatal(err)
}
for _, c := range cids {
if err := cw.Write(c); err != nil {
t.Fatal(err)
}
}
if err := cw.Close(); err != nil {
t.Fatal(err)
}
cr, err := NewColdSetReader(path)
if err != nil {
t.Fatal(err)
}
index := 0
err = cr.ForEach(func(c cid.Cid) error {
if index >= count {
t.Fatal("too many cids")
}
if !c.Equals(cids[index]) {
t.Fatalf("wrong cid %d; expected %s but got %s", index, cids[index], c)
}
index++
return nil
})
if err != nil {
t.Fatal(err)
}
if err := cr.Reset(); err != nil {
t.Fatal(err)
}
index = 0
err = cr.ForEach(func(c cid.Cid) error {
if index >= count {
t.Fatal("too many cids")
}
if !c.Equals(cids[index]) {
t.Fatalf("wrong cid; expected %s but got %s", cids[index], c)
}
index++
return nil
})
if err != nil {
t.Fatal(err)
}
}
+15 -18
View File
@@ -10,39 +10,36 @@ import (
var errMarkSetClosed = errors.New("markset closed")
// MarkSet is a utility to keep track of seen CID, and later query for them.
//
// * If the expected dataset is large, it can be backed by a datastore (e.g. bbolt).
// * If a probabilistic result is acceptable, it can be backed by a bloom filter
// MarkSet is an interface for tracking CIDs during chain and object walks
type MarkSet interface {
ObjectVisitor
Mark(cid.Cid) error
MarkMany([]cid.Cid) error
Has(cid.Cid) (bool, error)
Close() error
SetConcurrent()
}
type MarkSetVisitor interface {
MarkSet
ObjectVisitor
// BeginCriticalSection ensures that the markset is persisted to disk for recovery in case
// of abnormal termination during the critical section span.
BeginCriticalSection() error
// EndCriticalSection ends the critical section span.
EndCriticalSection()
}
type MarkSetEnv interface {
// Create creates a new markset within the environment.
// name is a unique name for this markset, mapped to the filesystem in disk-backed environments
// New creates a new markset within the environment.
// name is a unique name for this markset, mapped to the filesystem for on-disk persistence.
// sizeHint is a hint about the expected size of the markset
Create(name string, sizeHint int64) (MarkSet, error)
// CreateVisitor is like Create, but returns a wider interface that supports atomic visits.
// It may not be supported by some markset types (e.g. bloom).
CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error)
// SupportsVisitor returns true if the marksets created by this environment support the visitor interface.
SupportsVisitor() bool
New(name string, sizeHint int64) (MarkSet, error)
// Recover recovers an existing markset persisted on-disk.
Recover(name string) (MarkSet, error)
// Close closes the markset
Close() error
}
func OpenMarkSetEnv(path string, mtype string) (MarkSetEnv, error) {
switch mtype {
case "map":
return NewMapMarkSetEnv()
return NewMapMarkSetEnv(path)
case "badger":
return NewBadgerMarkSetEnv(path)
default:
+142 -29
View File
@@ -3,6 +3,7 @@ package splitstore
import (
"os"
"path/filepath"
"runtime"
"sync"
"golang.org/x/xerrors"
@@ -28,13 +29,13 @@ type BadgerMarkSet struct {
writers int
seqno int
version int
persist bool
db *badger.DB
path string
}
var _ MarkSet = (*BadgerMarkSet)(nil)
var _ MarkSetVisitor = (*BadgerMarkSet)(nil)
var badgerMarkSetBatchSize = 16384
@@ -48,11 +49,10 @@ func NewBadgerMarkSetEnv(path string) (MarkSetEnv, error) {
return &BadgerMarkSetEnv{path: msPath}, nil
}
func (e *BadgerMarkSetEnv) create(name string, sizeHint int64) (*BadgerMarkSet, error) {
name += ".tmp"
func (e *BadgerMarkSetEnv) New(name string, sizeHint int64) (MarkSet, error) {
path := filepath.Join(e.path, name)
db, err := openTransientBadgerDB(path)
db, err := openBadgerDB(path, false)
if err != nil {
return nil, xerrors.Errorf("error creating badger db: %w", err)
}
@@ -68,18 +68,72 @@ func (e *BadgerMarkSetEnv) create(name string, sizeHint int64) (*BadgerMarkSet,
return ms, nil
}
func (e *BadgerMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) {
return e.create(name, sizeHint)
}
func (e *BadgerMarkSetEnv) Recover(name string) (MarkSet, error) {
path := filepath.Join(e.path, name)
func (e *BadgerMarkSetEnv) CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error) {
return e.create(name, sizeHint)
}
if _, err := os.Stat(path); err != nil {
return nil, xerrors.Errorf("error stating badger db path: %w", err)
}
func (e *BadgerMarkSetEnv) SupportsVisitor() bool { return true }
db, err := openBadgerDB(path, true)
if err != nil {
return nil, xerrors.Errorf("error creating badger db: %w", err)
}
ms := &BadgerMarkSet{
pend: make(map[string]struct{}),
writing: make(map[int]map[string]struct{}),
db: db,
path: path,
persist: true,
}
ms.cond.L = &ms.mx
return ms, nil
}
func (e *BadgerMarkSetEnv) Close() error {
return os.RemoveAll(e.path)
return nil
}
func (s *BadgerMarkSet) BeginCriticalSection() error {
s.mx.Lock()
if s.persist {
s.mx.Unlock()
return nil
}
var write bool
var seqno int
if len(s.pend) > 0 {
write = true
seqno = s.nextBatch()
}
s.persist = true
s.mx.Unlock()
if write {
// all writes sync once perist is true
return s.write(seqno)
}
// wait for any pending writes and sync
s.mx.Lock()
for s.writers > 0 {
s.cond.Wait()
}
s.mx.Unlock()
return s.db.Sync()
}
func (s *BadgerMarkSet) EndCriticalSection() {
s.mx.Lock()
defer s.mx.Unlock()
s.persist = false
}
func (s *BadgerMarkSet) Mark(c cid.Cid) error {
@@ -99,6 +153,23 @@ func (s *BadgerMarkSet) Mark(c cid.Cid) error {
return nil
}
func (s *BadgerMarkSet) MarkMany(batch []cid.Cid) error {
s.mx.Lock()
if s.pend == nil {
s.mx.Unlock()
return errMarkSetClosed
}
write, seqno := s.putMany(batch)
s.mx.Unlock()
if write {
return s.write(seqno)
}
return nil
}
func (s *BadgerMarkSet) Has(c cid.Cid) (bool, error) {
s.mx.RLock()
defer s.mx.RUnlock()
@@ -204,16 +275,34 @@ func (s *BadgerMarkSet) tryDB(key []byte) (has bool, err error) {
// writer holds the exclusive lock
func (s *BadgerMarkSet) put(key string) (write bool, seqno int) {
s.pend[key] = struct{}{}
if len(s.pend) < badgerMarkSetBatchSize {
if !s.persist && len(s.pend) < badgerMarkSetBatchSize {
return false, 0
}
seqno = s.seqno
seqno = s.nextBatch()
return true, seqno
}
func (s *BadgerMarkSet) putMany(batch []cid.Cid) (write bool, seqno int) {
for _, c := range batch {
key := string(c.Hash())
s.pend[key] = struct{}{}
}
if !s.persist && len(s.pend) < badgerMarkSetBatchSize {
return false, 0
}
seqno = s.nextBatch()
return true, seqno
}
func (s *BadgerMarkSet) nextBatch() int {
seqno := s.seqno
s.seqno++
s.writing[seqno] = s.pend
s.pend = make(map[string]struct{})
return true, seqno
return seqno
}
func (s *BadgerMarkSet) write(seqno int) (err error) {
@@ -258,6 +347,14 @@ func (s *BadgerMarkSet) write(seqno int) (err error) {
return xerrors.Errorf("error flushing batch to badger markset: %w", err)
}
s.mx.RLock()
persist := s.persist
s.mx.RUnlock()
if persist {
return s.db.Sync()
}
return nil
}
@@ -277,26 +374,29 @@ func (s *BadgerMarkSet) Close() error {
db := s.db
s.db = nil
return closeTransientBadgerDB(db, s.path)
return closeBadgerDB(db, s.path, s.persist)
}
func (s *BadgerMarkSet) SetConcurrent() {}
func openBadgerDB(path string, recover bool) (*badger.DB, error) {
// if it is not a recovery, clean up first
if !recover {
err := os.RemoveAll(path)
if err != nil {
return nil, xerrors.Errorf("error clearing markset directory: %w", err)
}
func openTransientBadgerDB(path string) (*badger.DB, error) {
// clean up first
err := os.RemoveAll(path)
if err != nil {
return nil, xerrors.Errorf("error clearing markset directory: %w", err)
}
err = os.MkdirAll(path, 0755) //nolint:gosec
if err != nil {
return nil, xerrors.Errorf("error creating markset directory: %w", err)
err = os.MkdirAll(path, 0755) //nolint:gosec
if err != nil {
return nil, xerrors.Errorf("error creating markset directory: %w", err)
}
}
opts := badger.DefaultOptions(path)
// we manually sync when we are in critical section
opts.SyncWrites = false
// no need to do that
opts.CompactL0OnClose = false
// we store hashes, not much to gain by compression
opts.Compression = options.None
// Note: We use FileIO for loading modes to avoid memory thrashing and interference
// between the system blockstore and the markset.
@@ -305,6 +405,15 @@ func openTransientBadgerDB(path string) (*badger.DB, error) {
// exceeded 1GB in size.
opts.TableLoadingMode = options.FileIO
opts.ValueLogLoadingMode = options.FileIO
// We increase the number of L0 tables before compaction to make it unlikely to
// be necessary.
opts.NumLevelZeroTables = 20 // default is 5
opts.NumLevelZeroTablesStall = 30 // default is 10
// increase the number of compactors from default 2 so that if we ever have to
// compact, it is fast
if runtime.NumCPU()/2 > opts.NumCompactors {
opts.NumCompactors = runtime.NumCPU() / 2
}
opts.Logger = &badgerLogger{
SugaredLogger: log.Desugar().WithOptions(zap.AddCallerSkip(1)).Sugar(),
skip2: log.Desugar().WithOptions(zap.AddCallerSkip(2)).Sugar(),
@@ -313,12 +422,16 @@ func openTransientBadgerDB(path string) (*badger.DB, error) {
return badger.Open(opts)
}
func closeTransientBadgerDB(db *badger.DB, path string) error {
func closeBadgerDB(db *badger.DB, path string, persist bool) error {
err := db.Close()
if err != nil {
return xerrors.Errorf("error closing badger markset: %w", err)
}
if persist {
return nil
}
err = os.RemoveAll(path)
if err != nil {
return xerrors.Errorf("error deleting badger markset: %w", err)
+218 -34
View File
@@ -1,12 +1,20 @@
package splitstore
import (
"bufio"
"io"
"os"
"path/filepath"
"sync"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
)
type MapMarkSetEnv struct{}
type MapMarkSetEnv struct {
path string
}
var _ MarkSetEnv = (*MapMarkSetEnv)(nil)
@@ -14,55 +22,194 @@ type MapMarkSet struct {
mx sync.RWMutex
set map[string]struct{}
ts bool
persist bool
file *os.File
buf *bufio.Writer
path string
}
var _ MarkSet = (*MapMarkSet)(nil)
var _ MarkSetVisitor = (*MapMarkSet)(nil)
func NewMapMarkSetEnv() (*MapMarkSetEnv, error) {
return &MapMarkSetEnv{}, nil
func NewMapMarkSetEnv(path string) (*MapMarkSetEnv, error) {
msPath := filepath.Join(path, "markset.map")
err := os.MkdirAll(msPath, 0755) //nolint:gosec
if err != nil {
return nil, xerrors.Errorf("error creating markset directory: %w", err)
}
return &MapMarkSetEnv{path: msPath}, nil
}
func (e *MapMarkSetEnv) create(name string, sizeHint int64) (*MapMarkSet, error) {
func (e *MapMarkSetEnv) New(name string, sizeHint int64) (MarkSet, error) {
path := filepath.Join(e.path, name)
return &MapMarkSet{
set: make(map[string]struct{}, sizeHint),
set: make(map[string]struct{}, sizeHint),
path: path,
}, nil
}
func (e *MapMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) {
return e.create(name, sizeHint)
}
func (e *MapMarkSetEnv) Recover(name string) (MarkSet, error) {
path := filepath.Join(e.path, name)
s := &MapMarkSet{
set: make(map[string]struct{}),
path: path,
}
func (e *MapMarkSetEnv) CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error) {
return e.create(name, sizeHint)
}
in, err := os.Open(path)
if err != nil {
return nil, xerrors.Errorf("error opening markset file for read: %w", err)
}
defer in.Close() //nolint:errcheck
func (e *MapMarkSetEnv) SupportsVisitor() bool { return true }
// wrap a buffered reader to make this faster
buf := bufio.NewReader(in)
for {
var sz byte
if sz, err = buf.ReadByte(); err != nil {
break
}
key := make([]byte, int(sz))
if _, err = io.ReadFull(buf, key); err != nil {
break
}
s.set[string(key)] = struct{}{}
}
if err != io.EOF {
return nil, xerrors.Errorf("error reading markset file: %w", err)
}
file, err := os.OpenFile(s.path, os.O_WRONLY|os.O_APPEND, 0)
if err != nil {
return nil, xerrors.Errorf("error opening markset file for write: %w", err)
}
s.persist = true
s.file = file
s.buf = bufio.NewWriter(file)
return s, nil
}
func (e *MapMarkSetEnv) Close() error {
return nil
}
func (s *MapMarkSet) Mark(cid cid.Cid) error {
if s.ts {
s.mx.Lock()
defer s.mx.Unlock()
}
func (s *MapMarkSet) BeginCriticalSection() error {
s.mx.Lock()
defer s.mx.Unlock()
if s.set == nil {
return errMarkSetClosed
}
s.set[string(cid.Hash())] = struct{}{}
if s.persist {
return nil
}
file, err := os.OpenFile(s.path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
if err != nil {
return xerrors.Errorf("error opening markset file: %w", err)
}
// wrap a buffered writer to make this faster
s.buf = bufio.NewWriter(file)
for key := range s.set {
if err := s.writeKey([]byte(key), false); err != nil {
_ = file.Close()
s.buf = nil
return err
}
}
if err := s.buf.Flush(); err != nil {
_ = file.Close()
s.buf = nil
return xerrors.Errorf("error flushing markset file buffer: %w", err)
}
s.file = file
s.persist = true
return nil
}
func (s *MapMarkSet) EndCriticalSection() {
s.mx.Lock()
defer s.mx.Unlock()
if !s.persist {
return
}
_ = s.file.Close()
_ = os.Remove(s.path)
s.file = nil
s.buf = nil
s.persist = false
}
func (s *MapMarkSet) Mark(c cid.Cid) error {
s.mx.Lock()
defer s.mx.Unlock()
if s.set == nil {
return errMarkSetClosed
}
hash := c.Hash()
s.set[string(hash)] = struct{}{}
if s.persist {
if err := s.writeKey(hash, true); err != nil {
return err
}
if err := s.file.Sync(); err != nil {
return xerrors.Errorf("error syncing markset: %w", err)
}
}
return nil
}
func (s *MapMarkSet) MarkMany(batch []cid.Cid) error {
s.mx.Lock()
defer s.mx.Unlock()
if s.set == nil {
return errMarkSetClosed
}
for _, c := range batch {
hash := c.Hash()
s.set[string(hash)] = struct{}{}
if s.persist {
if err := s.writeKey(hash, false); err != nil {
return err
}
}
}
if s.persist {
if err := s.buf.Flush(); err != nil {
return xerrors.Errorf("error flushing markset buffer to disk: %w", err)
}
if err := s.file.Sync(); err != nil {
return xerrors.Errorf("error syncing markset: %w", err)
}
}
return nil
}
func (s *MapMarkSet) Has(cid cid.Cid) (bool, error) {
if s.ts {
s.mx.RLock()
defer s.mx.RUnlock()
}
s.mx.RLock()
defer s.mx.RUnlock()
if s.set == nil {
return false, errMarkSetClosed
@@ -73,33 +220,70 @@ func (s *MapMarkSet) Has(cid cid.Cid) (bool, error) {
}
func (s *MapMarkSet) Visit(c cid.Cid) (bool, error) {
if s.ts {
s.mx.Lock()
defer s.mx.Unlock()
}
s.mx.Lock()
defer s.mx.Unlock()
if s.set == nil {
return false, errMarkSetClosed
}
key := string(c.Hash())
hash := c.Hash()
key := string(hash)
if _, ok := s.set[key]; ok {
return false, nil
}
s.set[key] = struct{}{}
if s.persist {
if err := s.writeKey(hash, true); err != nil {
return false, err
}
if err := s.file.Sync(); err != nil {
return false, xerrors.Errorf("error syncing markset: %w", err)
}
}
return true, nil
}
func (s *MapMarkSet) Close() error {
if s.ts {
s.mx.Lock()
defer s.mx.Unlock()
s.mx.Lock()
defer s.mx.Unlock()
if s.set == nil {
return nil
}
s.set = nil
if s.file != nil {
if err := s.file.Close(); err != nil {
log.Warnf("error closing markset file: %s", err)
}
if !s.persist {
if err := os.Remove(s.path); err != nil {
log.Warnf("error removing markset file: %s", err)
}
}
}
return nil
}
func (s *MapMarkSet) SetConcurrent() {
s.ts = true
func (s *MapMarkSet) writeKey(k []byte, flush bool) error {
if err := s.buf.WriteByte(byte(len(k))); err != nil {
return xerrors.Errorf("error writing markset key length to disk: %w", err)
}
if _, err := s.buf.Write(k); err != nil {
return xerrors.Errorf("error writing markset key to disk: %w", err)
}
if flush {
if err := s.buf.Flush(); err != nil {
return xerrors.Errorf("error flushing markset buffer to disk: %w", err)
}
}
return nil
}
+323 -27
View File
@@ -1,8 +1,7 @@
//stm: #unit
package splitstore
import (
"io/ioutil"
"os"
"testing"
cid "github.com/ipfs/go-cid"
@@ -10,31 +9,32 @@ import (
)
func TestMapMarkSet(t *testing.T) {
//stm: @SPLITSTORE_MARKSET_CREATE_001, @SPLITSTORE_MARKSET_HAS_001, @@SPLITSTORE_MARKSET_MARK_001
//stm: @SPLITSTORE_MARKSET_CLOSE_001, @SPLITSTORE_MARKSET_CREATE_VISITOR_001
testMarkSet(t, "map")
testMarkSetRecovery(t, "map")
testMarkSetMarkMany(t, "map")
testMarkSetVisitor(t, "map")
testMarkSetVisitorRecovery(t, "map")
}
func TestBadgerMarkSet(t *testing.T) {
//stm: @SPLITSTORE_MARKSET_CREATE_001, @SPLITSTORE_MARKSET_HAS_001, @@SPLITSTORE_MARKSET_MARK_001
//stm: @SPLITSTORE_MARKSET_CLOSE_001, @SPLITSTORE_MARKSET_CREATE_VISITOR_001
bs := badgerMarkSetBatchSize
badgerMarkSetBatchSize = 1
t.Cleanup(func() {
badgerMarkSetBatchSize = bs
})
testMarkSet(t, "badger")
testMarkSetRecovery(t, "badger")
testMarkSetMarkMany(t, "badger")
testMarkSetVisitor(t, "badger")
testMarkSetVisitorRecovery(t, "badger")
}
func testMarkSet(t *testing.T, lsType string) {
t.Helper()
path, err := ioutil.TempDir("", "markset.*")
if err != nil {
t.Fatal(err)
}
t.Cleanup(func() {
_ = os.RemoveAll(path)
})
path := t.TempDir()
env, err := OpenMarkSetEnv(path, lsType)
if err != nil {
@@ -42,12 +42,13 @@ func testMarkSet(t *testing.T, lsType string) {
}
defer env.Close() //nolint:errcheck
hotSet, err := env.Create("hot", 0)
// stm: @SPLITSTORE_MARKSET_CREATE_001
hotSet, err := env.New("hot", 0)
if err != nil {
t.Fatal(err)
}
coldSet, err := env.Create("cold", 0)
coldSet, err := env.New("cold", 0)
if err != nil {
t.Fatal(err)
}
@@ -61,7 +62,9 @@ func testMarkSet(t *testing.T, lsType string) {
return cid.NewCidV1(cid.Raw, h)
}
// stm: @SPLITSTORE_MARKSET_HAS_001
mustHave := func(s MarkSet, cid cid.Cid) {
t.Helper()
has, err := s.Has(cid)
if err != nil {
t.Fatal(err)
@@ -73,6 +76,7 @@ func testMarkSet(t *testing.T, lsType string) {
}
mustNotHave := func(s MarkSet, cid cid.Cid) {
t.Helper()
has, err := s.Has(cid)
if err != nil {
t.Fatal(err)
@@ -88,6 +92,7 @@ func testMarkSet(t *testing.T, lsType string) {
k3 := makeCid("c")
k4 := makeCid("d")
// stm: @SPLITSTORE_MARKSET_MARK_001
hotSet.Mark(k1) //nolint
hotSet.Mark(k2) //nolint
coldSet.Mark(k3) //nolint
@@ -114,12 +119,12 @@ func testMarkSet(t *testing.T, lsType string) {
t.Fatal(err)
}
hotSet, err = env.Create("hot", 0)
hotSet, err = env.New("hot", 0)
if err != nil {
t.Fatal(err)
}
coldSet, err = env.Create("cold", 0)
coldSet, err = env.New("cold", 0)
if err != nil {
t.Fatal(err)
}
@@ -138,6 +143,7 @@ func testMarkSet(t *testing.T, lsType string) {
mustNotHave(coldSet, k3)
mustNotHave(coldSet, k4)
//stm: @SPLITSTORE_MARKSET_CLOSE_001
err = hotSet.Close()
if err != nil {
t.Fatal(err)
@@ -150,16 +156,7 @@ func testMarkSet(t *testing.T, lsType string) {
}
func testMarkSetVisitor(t *testing.T, lsType string) {
t.Helper()
path, err := ioutil.TempDir("", "markset.*")
if err != nil {
t.Fatal(err)
}
t.Cleanup(func() {
_ = os.RemoveAll(path)
})
path := t.TempDir()
env, err := OpenMarkSetEnv(path, lsType)
if err != nil {
@@ -167,7 +164,8 @@ func testMarkSetVisitor(t *testing.T, lsType string) {
}
defer env.Close() //nolint:errcheck
visitor, err := env.CreateVisitor("test", 0)
//stm: @SPLITSTORE_MARKSET_CREATE_VISITOR_001
visitor, err := env.New("test", 0)
if err != nil {
t.Fatal(err)
}
@@ -219,3 +217,301 @@ func testMarkSetVisitor(t *testing.T, lsType string) {
mustNotVisit(visitor, k3)
mustNotVisit(visitor, k4)
}
func testMarkSetVisitorRecovery(t *testing.T, lsType string) {
path := t.TempDir()
env, err := OpenMarkSetEnv(path, lsType)
if err != nil {
t.Fatal(err)
}
defer env.Close() //nolint:errcheck
visitor, err := env.New("test", 0)
if err != nil {
t.Fatal(err)
}
defer visitor.Close() //nolint:errcheck
makeCid := func(key string) cid.Cid {
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
if err != nil {
t.Fatal(err)
}
return cid.NewCidV1(cid.Raw, h)
}
mustVisit := func(v ObjectVisitor, cid cid.Cid) {
visit, err := v.Visit(cid)
if err != nil {
t.Fatal(err)
}
if !visit {
t.Fatal("object should be visited")
}
}
mustNotVisit := func(v ObjectVisitor, cid cid.Cid) {
visit, err := v.Visit(cid)
if err != nil {
t.Fatal(err)
}
if visit {
t.Fatal("unexpected visit")
}
}
k1 := makeCid("a")
k2 := makeCid("b")
k3 := makeCid("c")
k4 := makeCid("d")
mustVisit(visitor, k1)
mustVisit(visitor, k2)
if err := visitor.BeginCriticalSection(); err != nil {
t.Fatal(err)
}
mustVisit(visitor, k3)
mustVisit(visitor, k4)
mustNotVisit(visitor, k1)
mustNotVisit(visitor, k2)
mustNotVisit(visitor, k3)
mustNotVisit(visitor, k4)
if err := visitor.Close(); err != nil {
t.Fatal(err)
}
visitor, err = env.Recover("test")
if err != nil {
t.Fatal(err)
}
mustNotVisit(visitor, k1)
mustNotVisit(visitor, k2)
mustNotVisit(visitor, k3)
mustNotVisit(visitor, k4)
visitor.EndCriticalSection()
if err := visitor.Close(); err != nil {
t.Fatal(err)
}
_, err = env.Recover("test")
if err == nil {
t.Fatal("expected recovery to fail")
}
}
func testMarkSetRecovery(t *testing.T, lsType string) {
path := t.TempDir()
env, err := OpenMarkSetEnv(path, lsType)
if err != nil {
t.Fatal(err)
}
defer env.Close() //nolint:errcheck
markSet, err := env.New("test", 0)
if err != nil {
t.Fatal(err)
}
makeCid := func(key string) cid.Cid {
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
if err != nil {
t.Fatal(err)
}
return cid.NewCidV1(cid.Raw, h)
}
mustHave := func(s MarkSet, cid cid.Cid) {
t.Helper()
has, err := s.Has(cid)
if err != nil {
t.Fatal(err)
}
if !has {
t.Fatal("mark not found")
}
}
mustNotHave := func(s MarkSet, cid cid.Cid) {
t.Helper()
has, err := s.Has(cid)
if err != nil {
t.Fatal(err)
}
if has {
t.Fatal("unexpected mark")
}
}
k1 := makeCid("a")
k2 := makeCid("b")
k3 := makeCid("c")
k4 := makeCid("d")
if err := markSet.Mark(k1); err != nil {
t.Fatal(err)
}
if err := markSet.Mark(k2); err != nil {
t.Fatal(err)
}
mustHave(markSet, k1)
mustHave(markSet, k2)
mustNotHave(markSet, k3)
mustNotHave(markSet, k4)
if err := markSet.BeginCriticalSection(); err != nil {
t.Fatal(err)
}
if err := markSet.Mark(k3); err != nil {
t.Fatal(err)
}
if err := markSet.Mark(k4); err != nil {
t.Fatal(err)
}
mustHave(markSet, k1)
mustHave(markSet, k2)
mustHave(markSet, k3)
mustHave(markSet, k4)
if err := markSet.Close(); err != nil {
t.Fatal(err)
}
markSet, err = env.Recover("test")
if err != nil {
t.Fatal(err)
}
mustHave(markSet, k1)
mustHave(markSet, k2)
mustHave(markSet, k3)
mustHave(markSet, k4)
markSet.EndCriticalSection()
if err := markSet.Close(); err != nil {
t.Fatal(err)
}
_, err = env.Recover("test")
if err == nil {
t.Fatal("expected recovery to fail")
}
}
func testMarkSetMarkMany(t *testing.T, lsType string) {
path := t.TempDir()
env, err := OpenMarkSetEnv(path, lsType)
if err != nil {
t.Fatal(err)
}
defer env.Close() //nolint:errcheck
markSet, err := env.New("test", 0)
if err != nil {
t.Fatal(err)
}
makeCid := func(key string) cid.Cid {
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
if err != nil {
t.Fatal(err)
}
return cid.NewCidV1(cid.Raw, h)
}
mustHave := func(s MarkSet, cid cid.Cid) {
t.Helper()
has, err := s.Has(cid)
if err != nil {
t.Fatal(err)
}
if !has {
t.Fatal("mark not found")
}
}
mustNotHave := func(s MarkSet, cid cid.Cid) {
t.Helper()
has, err := s.Has(cid)
if err != nil {
t.Fatal(err)
}
if has {
t.Fatal("unexpected mark")
}
}
k1 := makeCid("a")
k2 := makeCid("b")
k3 := makeCid("c")
k4 := makeCid("d")
if err := markSet.MarkMany([]cid.Cid{k1, k2}); err != nil {
t.Fatal(err)
}
mustHave(markSet, k1)
mustHave(markSet, k2)
mustNotHave(markSet, k3)
mustNotHave(markSet, k4)
if err := markSet.BeginCriticalSection(); err != nil {
t.Fatal(err)
}
if err := markSet.MarkMany([]cid.Cid{k3, k4}); err != nil {
t.Fatal(err)
}
mustHave(markSet, k1)
mustHave(markSet, k2)
mustHave(markSet, k3)
mustHave(markSet, k4)
if err := markSet.Close(); err != nil {
t.Fatal(err)
}
markSet, err = env.Recover("test")
if err != nil {
t.Fatal(err)
}
mustHave(markSet, k1)
mustHave(markSet, k2)
mustHave(markSet, k3)
mustHave(markSet, k4)
markSet.EndCriticalSection()
if err := markSet.Close(); err != nil {
t.Fatal(err)
}
_, err = env.Recover("test")
if err == nil {
t.Fatal("expected recovery to fail")
}
}
+146 -32
View File
@@ -129,8 +129,6 @@ type SplitStore struct {
headChangeMx sync.Mutex
coldPurgeSize int
chain ChainAccessor
ds dstore.Datastore
cold bstore.Blockstore
@@ -158,6 +156,17 @@ type SplitStore struct {
txnRefsMx sync.Mutex
txnRefs map[cid.Cid]struct{}
txnMissing map[cid.Cid]struct{}
txnMarkSet MarkSet
txnSyncMx sync.Mutex
txnSyncCond sync.Cond
txnSync bool
// background cold object reification
reifyWorkers sync.WaitGroup
reifyMx sync.Mutex
reifyCond sync.Cond
reifyPend map[cid.Cid]struct{}
reifyInProgress map[cid.Cid]struct{}
// registered protectors
protectors []func(func(cid.Cid) error) error
@@ -186,10 +195,6 @@ func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Co
return nil, err
}
if !markSetEnv.SupportsVisitor() {
return nil, xerrors.Errorf("markset type does not support atomic visitors")
}
// and now we can make a SplitStore
ss := &SplitStore{
cfg: cfg,
@@ -198,13 +203,16 @@ func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Co
cold: cold,
hot: hots,
markSetEnv: markSetEnv,
coldPurgeSize: defaultColdPurgeSize,
}
ss.txnViewsCond.L = &ss.txnViewsMx
ss.txnSyncCond.L = &ss.txnSyncMx
ss.ctx, ss.cancel = context.WithCancel(context.Background())
ss.reifyCond.L = &ss.reifyMx
ss.reifyPend = make(map[cid.Cid]struct{})
ss.reifyInProgress = make(map[cid.Cid]struct{})
if enableDebugLog {
ss.debug, err = openDebugLog(path)
if err != nil {
@@ -212,21 +220,29 @@ func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Co
}
}
if ss.checkpointExists() {
log.Info("found compaction checkpoint; resuming compaction")
if err := ss.completeCompaction(); err != nil {
markSetEnv.Close() //nolint:errcheck
return nil, xerrors.Errorf("error resuming compaction: %w", err)
}
}
return ss, nil
}
// Blockstore interface
func (s *SplitStore) DeleteBlock(_ cid.Cid) error {
func (s *SplitStore) DeleteBlock(_ context.Context, _ cid.Cid) error {
// afaict we don't seem to be using this method, so it's not implemented
return errors.New("DeleteBlock not implemented on SplitStore; don't do this Luke!") //nolint
}
func (s *SplitStore) DeleteMany(_ []cid.Cid) error {
func (s *SplitStore) DeleteMany(_ context.Context, _ []cid.Cid) error {
// afaict we don't seem to be using this method, so it's not implemented
return errors.New("DeleteMany not implemented on SplitStore; don't do this Luke!") //nolint
}
func (s *SplitStore) Has(cid cid.Cid) (bool, error) {
func (s *SplitStore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
if isIdentiyCid(cid) {
return true, nil
}
@@ -234,7 +250,21 @@ func (s *SplitStore) Has(cid cid.Cid) (bool, error) {
s.txnLk.RLock()
defer s.txnLk.RUnlock()
has, err := s.hot.Has(cid)
// critical section
if s.txnMarkSet != nil {
has, err := s.txnMarkSet.Has(cid)
if err != nil {
return false, err
}
if has {
return s.has(cid)
}
return s.cold.Has(ctx, cid)
}
has, err := s.hot.Has(ctx, cid)
if err != nil {
return has, err
@@ -245,10 +275,16 @@ func (s *SplitStore) Has(cid cid.Cid) (bool, error) {
return true, nil
}
return s.cold.Has(cid)
has, err = s.cold.Has(ctx, cid)
if has && bstore.IsHotView(ctx) {
s.reifyColdObject(cid)
}
return has, err
}
func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
func (s *SplitStore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
if isIdentiyCid(cid) {
data, err := decodeIdentityCid(cid)
if err != nil {
@@ -261,7 +297,21 @@ func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
s.txnLk.RLock()
defer s.txnLk.RUnlock()
blk, err := s.hot.Get(cid)
// critical section
if s.txnMarkSet != nil {
has, err := s.txnMarkSet.Has(cid)
if err != nil {
return nil, err
}
if has {
return s.get(cid)
}
return s.cold.Get(ctx, cid)
}
blk, err := s.hot.Get(ctx, cid)
switch err {
case nil:
@@ -273,10 +323,13 @@ func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
s.debug.LogReadMiss(cid)
}
blk, err = s.cold.Get(cid)
blk, err = s.cold.Get(ctx, cid)
if err == nil {
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
if bstore.IsHotView(ctx) {
s.reifyColdObject(cid)
}
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
}
return blk, err
@@ -285,7 +338,7 @@ func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
}
}
func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
func (s *SplitStore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
if isIdentiyCid(cid) {
data, err := decodeIdentityCid(cid)
if err != nil {
@@ -298,7 +351,21 @@ func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
s.txnLk.RLock()
defer s.txnLk.RUnlock()
size, err := s.hot.GetSize(cid)
// critical section
if s.txnMarkSet != nil {
has, err := s.txnMarkSet.Has(cid)
if err != nil {
return 0, err
}
if has {
return s.getSize(cid)
}
return s.cold.GetSize(ctx, cid)
}
size, err := s.hot.GetSize(ctx, cid)
switch err {
case nil:
@@ -310,8 +377,12 @@ func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
s.debug.LogReadMiss(cid)
}
size, err = s.cold.GetSize(cid)
size, err = s.cold.GetSize(ctx, cid)
if err == nil {
if bstore.IsHotView(ctx) {
s.reifyColdObject(cid)
}
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
}
return size, err
@@ -321,7 +392,7 @@ func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
}
}
func (s *SplitStore) Put(blk blocks.Block) error {
func (s *SplitStore) Put(ctx context.Context, blk blocks.Block) error {
if isIdentiyCid(blk.Cid()) {
return nil
}
@@ -329,18 +400,24 @@ func (s *SplitStore) Put(blk blocks.Block) error {
s.txnLk.RLock()
defer s.txnLk.RUnlock()
err := s.hot.Put(blk)
err := s.hot.Put(ctx, blk)
if err != nil {
return err
}
s.debug.LogWrite(blk)
// critical section
if s.txnMarkSet != nil {
s.markLiveRefs([]cid.Cid{blk.Cid()})
return nil
}
s.trackTxnRef(blk.Cid())
return nil
}
func (s *SplitStore) PutMany(blks []blocks.Block) error {
func (s *SplitStore) PutMany(ctx context.Context, blks []blocks.Block) error {
// filter identites
idcids := 0
for _, blk := range blks {
@@ -374,13 +451,19 @@ func (s *SplitStore) PutMany(blks []blocks.Block) error {
s.txnLk.RLock()
defer s.txnLk.RUnlock()
err := s.hot.PutMany(blks)
err := s.hot.PutMany(ctx, blks)
if err != nil {
return err
}
s.debug.LogWriteMany(blks)
// critical section
if s.txnMarkSet != nil {
s.markLiveRefs(batch)
return nil
}
s.trackTxnRefMany(batch)
return nil
}
@@ -430,7 +513,7 @@ func (s *SplitStore) HashOnRead(enabled bool) {
s.cold.HashOnRead(enabled)
}
func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error {
func (s *SplitStore) View(ctx context.Context, cid cid.Cid, cb func([]byte) error) error {
if isIdentiyCid(cid) {
data, err := decodeIdentityCid(cid)
if err != nil {
@@ -440,6 +523,23 @@ func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error {
return cb(data)
}
// critical section
s.txnLk.RLock() // the lock is released in protectView if we are not in critical section
if s.txnMarkSet != nil {
has, err := s.txnMarkSet.Has(cid)
s.txnLk.RUnlock()
if err != nil {
return err
}
if has {
return s.view(cid, cb)
}
return s.cold.View(ctx, cid, cb)
}
// views are (optimistically) protected two-fold:
// - if there is an active transaction, then the reference is protected.
// - if there is no active transaction, active views are tracked in a
@@ -451,15 +551,19 @@ func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error {
s.protectView(cid)
defer s.viewDone()
err := s.hot.View(cid, cb)
err := s.hot.View(ctx, cid, cb)
switch err {
case bstore.ErrNotFound:
if s.isWarm() {
s.debug.LogReadMiss(cid)
}
err = s.cold.View(cid, cb)
err = s.cold.View(ctx, cid, cb)
if err == nil {
if bstore.IsHotView(ctx) {
s.reifyColdObject(cid)
}
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
}
return err
@@ -502,7 +606,7 @@ func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error
// load base epoch from metadata ds
// if none, then use current epoch because it's a fresh start
bs, err := s.ds.Get(baseEpochKey)
bs, err := s.ds.Get(s.ctx, baseEpochKey)
switch err {
case nil:
s.baseEpoch = bytesToEpoch(bs)
@@ -523,7 +627,7 @@ func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error
}
// load warmup epoch from metadata ds
bs, err = s.ds.Get(warmupEpochKey)
bs, err = s.ds.Get(s.ctx, warmupEpochKey)
switch err {
case nil:
s.warmupEpoch = bytesToEpoch(bs)
@@ -536,7 +640,7 @@ func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error
}
// load markSetSize from metadata ds to provide a size hint for marksets
bs, err = s.ds.Get(markSetSizeKey)
bs, err = s.ds.Get(s.ctx, markSetSizeKey)
switch err {
case nil:
s.markSetSize = bytesToInt64(bs)
@@ -547,7 +651,7 @@ func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error
}
// load compactionIndex from metadata ds to provide a hint as to when to perform moving gc
bs, err = s.ds.Get(compactionIndexKey)
bs, err = s.ds.Get(s.ctx, compactionIndexKey)
switch err {
case nil:
s.compactionIndex = bytesToInt64(bs)
@@ -569,6 +673,9 @@ func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error
}
}
// spawn the reifier
go s.reifyOrchestrator()
// watch the chain
chain.SubscribeHeadChanges(s.HeadChange)
@@ -589,12 +696,19 @@ func (s *SplitStore) Close() error {
}
if atomic.LoadInt32(&s.compacting) == 1 {
s.txnSyncMx.Lock()
s.txnSync = true
s.txnSyncCond.Broadcast()
s.txnSyncMx.Unlock()
log.Warn("close with ongoing compaction in progress; waiting for it to finish...")
for atomic.LoadInt32(&s.compacting) == 1 {
time.Sleep(time.Second)
}
}
s.reifyCond.Broadcast()
s.reifyWorkers.Wait()
s.cancel()
return multierr.Combine(s.markSetEnv.Close(), s.debug.Close())
}
@@ -609,5 +723,5 @@ func (s *SplitStore) checkClosing() error {
func (s *SplitStore) setBaseEpoch(epoch abi.ChainEpoch) error {
s.baseEpoch = epoch
return s.ds.Put(baseEpochKey, epochToBytes(epoch))
return s.ds.Put(s.ctx, baseEpochKey, epochToBytes(epoch))
}
+13 -8
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path/filepath"
"sync"
"sync/atomic"
"time"
@@ -67,7 +68,10 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
}
defer output.Close() //nolint:errcheck
var mx sync.Mutex
write := func(format string, args ...interface{}) {
mx.Lock()
defer mx.Unlock()
_, err := fmt.Fprintf(output, format+"\n", args...)
if err != nil {
log.Warnf("error writing check output: %s", err)
@@ -82,9 +86,10 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
write("compaction index: %d", s.compactionIndex)
write("--")
var coldCnt, missingCnt int64
coldCnt := new(int64)
missingCnt := new(int64)
visitor, err := s.markSetEnv.CreateVisitor("check", 0)
visitor, err := s.markSetEnv.New("check", 0)
if err != nil {
return xerrors.Errorf("error creating visitor: %w", err)
}
@@ -96,7 +101,7 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
return errStopWalk
}
has, err := s.hot.Has(c)
has, err := s.hot.Has(s.ctx, c)
if err != nil {
return xerrors.Errorf("error checking hotstore: %w", err)
}
@@ -105,16 +110,16 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
return nil
}
has, err = s.cold.Has(c)
has, err = s.cold.Has(s.ctx, c)
if err != nil {
return xerrors.Errorf("error checking coldstore: %w", err)
}
if has {
coldCnt++
atomic.AddInt64(coldCnt, 1)
write("cold object reference: %s", c)
} else {
missingCnt++
atomic.AddInt64(missingCnt, 1)
write("missing object reference: %s", c)
return errStopWalk
}
@@ -128,9 +133,9 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
return err
}
log.Infow("check done", "cold", coldCnt, "missing", missingCnt)
log.Infow("check done", "cold", *coldCnt, "missing", *missingCnt)
write("--")
write("cold: %d missing: %d", coldCnt, missingCnt)
write("cold: %d missing: %d", *coldCnt, *missingCnt)
write("DONE")
return nil
File diff suppressed because it is too large Load Diff
+18 -18
View File
@@ -20,28 +20,28 @@ func (s *SplitStore) Expose() bstore.Blockstore {
return &exposedSplitStore{s: s}
}
func (es *exposedSplitStore) DeleteBlock(_ cid.Cid) error {
func (es *exposedSplitStore) DeleteBlock(_ context.Context, _ cid.Cid) error {
return errors.New("DeleteBlock: operation not supported")
}
func (es *exposedSplitStore) DeleteMany(_ []cid.Cid) error {
func (es *exposedSplitStore) DeleteMany(_ context.Context, _ []cid.Cid) error {
return errors.New("DeleteMany: operation not supported")
}
func (es *exposedSplitStore) Has(c cid.Cid) (bool, error) {
func (es *exposedSplitStore) Has(ctx context.Context, c cid.Cid) (bool, error) {
if isIdentiyCid(c) {
return true, nil
}
has, err := es.s.hot.Has(c)
has, err := es.s.hot.Has(ctx, c)
if has || err != nil {
return has, err
}
return es.s.cold.Has(c)
return es.s.cold.Has(ctx, c)
}
func (es *exposedSplitStore) Get(c cid.Cid) (blocks.Block, error) {
func (es *exposedSplitStore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) {
if isIdentiyCid(c) {
data, err := decodeIdentityCid(c)
if err != nil {
@@ -51,16 +51,16 @@ func (es *exposedSplitStore) Get(c cid.Cid) (blocks.Block, error) {
return blocks.NewBlockWithCid(data, c)
}
blk, err := es.s.hot.Get(c)
blk, err := es.s.hot.Get(ctx, c)
switch err {
case bstore.ErrNotFound:
return es.s.cold.Get(c)
return es.s.cold.Get(ctx, c)
default:
return blk, err
}
}
func (es *exposedSplitStore) GetSize(c cid.Cid) (int, error) {
func (es *exposedSplitStore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
if isIdentiyCid(c) {
data, err := decodeIdentityCid(c)
if err != nil {
@@ -70,21 +70,21 @@ func (es *exposedSplitStore) GetSize(c cid.Cid) (int, error) {
return len(data), nil
}
size, err := es.s.hot.GetSize(c)
size, err := es.s.hot.GetSize(ctx, c)
switch err {
case bstore.ErrNotFound:
return es.s.cold.GetSize(c)
return es.s.cold.GetSize(ctx, c)
default:
return size, err
}
}
func (es *exposedSplitStore) Put(blk blocks.Block) error {
return es.s.Put(blk)
func (es *exposedSplitStore) Put(ctx context.Context, blk blocks.Block) error {
return es.s.Put(ctx, blk)
}
func (es *exposedSplitStore) PutMany(blks []blocks.Block) error {
return es.s.PutMany(blks)
func (es *exposedSplitStore) PutMany(ctx context.Context, blks []blocks.Block) error {
return es.s.PutMany(ctx, blks)
}
func (es *exposedSplitStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
@@ -93,7 +93,7 @@ func (es *exposedSplitStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, e
func (es *exposedSplitStore) HashOnRead(enabled bool) {}
func (es *exposedSplitStore) View(c cid.Cid, f func([]byte) error) error {
func (es *exposedSplitStore) View(ctx context.Context, c cid.Cid, f func([]byte) error) error {
if isIdentiyCid(c) {
data, err := decodeIdentityCid(c)
if err != nil {
@@ -103,10 +103,10 @@ func (es *exposedSplitStore) View(c cid.Cid, f func([]byte) error) error {
return f(data)
}
err := es.s.hot.View(c, f)
err := es.s.hot.View(ctx, c, f)
switch err {
case bstore.ErrNotFound:
return es.s.cold.View(c, f)
return es.s.cold.View(ctx, c, f)
default:
return err
+214
View File
@@ -0,0 +1,214 @@
package splitstore
import (
"errors"
"runtime"
"sync/atomic"
"golang.org/x/xerrors"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
)
var (
errReifyLimit = errors.New("reification limit reached")
ReifyLimit = 16384
)
func (s *SplitStore) reifyColdObject(c cid.Cid) {
if !s.isWarm() {
return
}
if isUnitaryObject(c) {
return
}
s.reifyMx.Lock()
defer s.reifyMx.Unlock()
_, ok := s.reifyInProgress[c]
if ok {
return
}
s.reifyPend[c] = struct{}{}
s.reifyCond.Broadcast()
}
func (s *SplitStore) reifyOrchestrator() {
workers := runtime.NumCPU() / 4
if workers < 2 {
workers = 2
}
workch := make(chan cid.Cid, workers)
defer close(workch)
for i := 0; i < workers; i++ {
s.reifyWorkers.Add(1)
go s.reifyWorker(workch)
}
for {
s.reifyMx.Lock()
for len(s.reifyPend) == 0 && atomic.LoadInt32(&s.closing) == 0 {
s.reifyCond.Wait()
}
if atomic.LoadInt32(&s.closing) != 0 {
s.reifyMx.Unlock()
return
}
reifyPend := s.reifyPend
s.reifyPend = make(map[cid.Cid]struct{})
s.reifyMx.Unlock()
for c := range reifyPend {
select {
case workch <- c:
case <-s.ctx.Done():
return
}
}
}
}
func (s *SplitStore) reifyWorker(workch chan cid.Cid) {
defer s.reifyWorkers.Done()
for c := range workch {
s.doReify(c)
}
}
func (s *SplitStore) doReify(c cid.Cid) {
var toreify, totrack, toforget []cid.Cid
defer func() {
s.reifyMx.Lock()
defer s.reifyMx.Unlock()
for _, c := range toreify {
delete(s.reifyInProgress, c)
}
for _, c := range totrack {
delete(s.reifyInProgress, c)
}
for _, c := range toforget {
delete(s.reifyInProgress, c)
}
}()
s.txnLk.RLock()
defer s.txnLk.RUnlock()
count := 0
err := s.walkObjectIncomplete(c, newTmpVisitor(),
func(c cid.Cid) error {
if isUnitaryObject(c) {
return errStopWalk
}
count++
if count > ReifyLimit {
return errReifyLimit
}
s.reifyMx.Lock()
_, inProgress := s.reifyInProgress[c]
if !inProgress {
s.reifyInProgress[c] = struct{}{}
}
s.reifyMx.Unlock()
if inProgress {
return errStopWalk
}
has, err := s.hot.Has(s.ctx, c)
if err != nil {
return xerrors.Errorf("error checking hotstore: %w", err)
}
if has {
if s.txnMarkSet != nil {
hasMark, err := s.txnMarkSet.Has(c)
if err != nil {
log.Warnf("error checking markset: %s", err)
} else if hasMark {
toforget = append(toforget, c)
return errStopWalk
}
} else {
totrack = append(totrack, c)
return errStopWalk
}
}
toreify = append(toreify, c)
return nil
},
func(missing cid.Cid) error {
log.Warnf("missing reference while reifying %s: %s", c, missing)
return errStopWalk
})
if err != nil {
if xerrors.Is(err, errReifyLimit) {
log.Debug("reification aborted; reify limit reached")
return
}
log.Warnf("error walking cold object for reification (cid: %s): %s", c, err)
return
}
log.Debugf("reifying %d objects rooted at %s", len(toreify), c)
// this should not get too big, maybe some 100s of objects.
batch := make([]blocks.Block, 0, len(toreify))
for _, c := range toreify {
blk, err := s.cold.Get(s.ctx, c)
if err != nil {
log.Warnf("error retrieving cold object for reification (cid: %s): %s", c, err)
continue
}
if err := s.checkClosing(); err != nil {
return
}
batch = append(batch, blk)
}
if len(batch) > 0 {
err = s.hot.PutMany(s.ctx, batch)
if err != nil {
log.Warnf("error reifying cold object (cid: %s): %s", c, err)
return
}
}
if s.txnMarkSet != nil {
if len(toreify) > 0 {
if err := s.txnMarkSet.MarkMany(toreify); err != nil {
log.Warnf("error marking reified objects: %s", err)
}
}
if len(totrack) > 0 {
if err := s.txnMarkSet.MarkMany(totrack); err != nil {
log.Warnf("error marking tracked objects: %s", err)
}
}
} else {
// if txnActive is false these are noops
if len(toreify) > 0 {
s.trackTxnRefMany(toreify)
}
if len(totrack) > 0 {
s.trackTxnRefMany(totrack)
}
}
}
+284 -34
View File
@@ -1,9 +1,11 @@
//stm: #unit
package splitstore
import (
"context"
"errors"
"fmt"
"math/rand"
"sync"
"sync/atomic"
"testing"
@@ -20,16 +22,19 @@ import (
datastore "github.com/ipfs/go-datastore"
dssync "github.com/ipfs/go-datastore/sync"
logging "github.com/ipfs/go-log/v2"
mh "github.com/multiformats/go-multihash"
)
func init() {
CompactionThreshold = 5
CompactionBoundary = 2
WarmupBoundary = 0
SyncWaitTime = time.Millisecond
logging.SetLogLevel("splitstore", "DEBUG")
}
func testSplitStore(t *testing.T, cfg *Config) {
ctx := context.Background()
chain := &mockChain{t: t}
// the myriads of stores
@@ -39,7 +44,7 @@ func testSplitStore(t *testing.T, cfg *Config) {
// this is necessary to avoid the garbage mock puts in the blocks
garbage := blocks.NewBlock([]byte{1, 2, 3})
err := cold.Put(garbage)
err := cold.Put(ctx, garbage)
if err != nil {
t.Fatal(err)
}
@@ -60,27 +65,29 @@ func testSplitStore(t *testing.T, cfg *Config) {
t.Fatal(err)
}
err = cold.Put(blk)
err = cold.Put(ctx, blk)
if err != nil {
t.Fatal(err)
}
// create a garbage block that is protected with a rgistered protector
protected := blocks.NewBlock([]byte("protected!"))
err = hot.Put(protected)
err = hot.Put(ctx, protected)
if err != nil {
t.Fatal(err)
}
// and another one that is not protected
unprotected := blocks.NewBlock([]byte("unprotected!"))
err = hot.Put(unprotected)
err = hot.Put(ctx, unprotected)
if err != nil {
t.Fatal(err)
}
path := t.TempDir()
// open the splitstore
ss, err := Open("", ds, hot, cold, cfg)
ss, err := Open(path, ds, hot, cold, cfg)
if err != nil {
t.Fatal(err)
}
@@ -109,11 +116,11 @@ func testSplitStore(t *testing.T, cfg *Config) {
if err != nil {
t.Fatal(err)
}
err = ss.Put(stateRoot)
err = ss.Put(ctx, stateRoot)
if err != nil {
t.Fatal(err)
}
err = ss.Put(sblk)
err = ss.Put(ctx, sblk)
if err != nil {
t.Fatal(err)
}
@@ -124,6 +131,10 @@ func testSplitStore(t *testing.T, cfg *Config) {
}
waitForCompaction := func() {
ss.txnSyncMx.Lock()
ss.txnSync = true
ss.txnSyncCond.Broadcast()
ss.txnSyncMx.Unlock()
for atomic.LoadInt32(&ss.compacting) == 1 {
time.Sleep(100 * time.Millisecond)
}
@@ -176,7 +187,7 @@ func testSplitStore(t *testing.T, cfg *Config) {
}
// ensure our protected block is still there
has, err := hot.Has(protected.Cid())
has, err := hot.Has(ctx, protected.Cid())
if err != nil {
t.Fatal(err)
}
@@ -186,7 +197,7 @@ func testSplitStore(t *testing.T, cfg *Config) {
}
// ensure our unprotected block is in the coldstore now
has, err = hot.Has(unprotected.Cid())
has, err = hot.Has(ctx, unprotected.Cid())
if err != nil {
t.Fatal(err)
}
@@ -195,7 +206,7 @@ func testSplitStore(t *testing.T, cfg *Config) {
t.Fatal("unprotected block is still in hotstore")
}
has, err = cold.Has(unprotected.Cid())
has, err = cold.Has(ctx, unprotected.Cid())
if err != nil {
t.Fatal(err)
}
@@ -209,10 +220,16 @@ func testSplitStore(t *testing.T, cfg *Config) {
}
func TestSplitStoreCompaction(t *testing.T) {
//stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001
//stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001
//stm: @SPLITSTORE_SPLITSTORE_CLOSE_001
testSplitStore(t, &Config{MarkSetType: "map"})
}
func TestSplitStoreCompactionWithBadger(t *testing.T) {
//stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001
//stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001
//stm: @SPLITSTORE_SPLITSTORE_CLOSE_001
bs := badgerMarkSetBatchSize
badgerMarkSetBatchSize = 1
t.Cleanup(func() {
@@ -222,6 +239,10 @@ func TestSplitStoreCompactionWithBadger(t *testing.T) {
}
func TestSplitStoreSuppressCompactionNearUpgrade(t *testing.T) {
//stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001
//stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001
//stm: @SPLITSTORE_SPLITSTORE_CLOSE_001
ctx := context.Background()
chain := &mockChain{t: t}
// the myriads of stores
@@ -231,7 +252,7 @@ func TestSplitStoreSuppressCompactionNearUpgrade(t *testing.T) {
// this is necessary to avoid the garbage mock puts in the blocks
garbage := blocks.NewBlock([]byte{1, 2, 3})
err := cold.Put(garbage)
err := cold.Put(ctx, garbage)
if err != nil {
t.Fatal(err)
}
@@ -252,13 +273,15 @@ func TestSplitStoreSuppressCompactionNearUpgrade(t *testing.T) {
t.Fatal(err)
}
err = cold.Put(blk)
err = cold.Put(ctx, blk)
if err != nil {
t.Fatal(err)
}
path := t.TempDir()
// open the splitstore
ss, err := Open("", ds, hot, cold, &Config{MarkSetType: "map"})
ss, err := Open(path, ds, hot, cold, &Config{MarkSetType: "map"})
if err != nil {
t.Fatal(err)
}
@@ -288,11 +311,11 @@ func TestSplitStoreSuppressCompactionNearUpgrade(t *testing.T) {
if err != nil {
t.Fatal(err)
}
err = ss.Put(stateRoot)
err = ss.Put(ctx, stateRoot)
if err != nil {
t.Fatal(err)
}
err = ss.Put(sblk)
err = ss.Put(ctx, sblk)
if err != nil {
t.Fatal(err)
}
@@ -303,6 +326,10 @@ func TestSplitStoreSuppressCompactionNearUpgrade(t *testing.T) {
}
waitForCompaction := func() {
ss.txnSyncMx.Lock()
ss.txnSync = true
ss.txnSyncCond.Broadcast()
ss.txnSyncMx.Unlock()
for atomic.LoadInt32(&ss.compacting) == 1 {
time.Sleep(100 * time.Millisecond)
}
@@ -355,6 +382,221 @@ func TestSplitStoreSuppressCompactionNearUpgrade(t *testing.T) {
}
}
func testSplitStoreReification(t *testing.T, f func(context.Context, blockstore.Blockstore, cid.Cid) error) {
ds := dssync.MutexWrap(datastore.NewMapDatastore())
hot := newMockStore()
cold := newMockStore()
mkRandomBlock := func() blocks.Block {
data := make([]byte, 128)
_, err := rand.Read(data)
if err != nil {
t.Fatal(err)
}
return blocks.NewBlock(data)
}
block1 := mkRandomBlock()
block2 := mkRandomBlock()
block3 := mkRandomBlock()
hdr := mock.MkBlock(nil, 0, 0)
hdr.Messages = block1.Cid()
hdr.ParentMessageReceipts = block2.Cid()
hdr.ParentStateRoot = block3.Cid()
block4, err := hdr.ToStorageBlock()
if err != nil {
t.Fatal(err)
}
allBlocks := []blocks.Block{block1, block2, block3, block4}
for _, blk := range allBlocks {
err := cold.Put(context.Background(), blk)
if err != nil {
t.Fatal(err)
}
}
path := t.TempDir()
ss, err := Open(path, ds, hot, cold, &Config{MarkSetType: "map"})
if err != nil {
t.Fatal(err)
}
defer ss.Close() //nolint
ss.warmupEpoch = 1
go ss.reifyOrchestrator()
waitForReification := func() {
for {
ss.reifyMx.Lock()
ready := len(ss.reifyPend) == 0 && len(ss.reifyInProgress) == 0
ss.reifyMx.Unlock()
if ready {
return
}
time.Sleep(time.Millisecond)
}
}
// first access using the standard view
err = f(context.Background(), ss, block4.Cid())
if err != nil {
t.Fatal(err)
}
// nothing should be reified
waitForReification()
for _, blk := range allBlocks {
has, err := hot.Has(context.Background(), blk.Cid())
if err != nil {
t.Fatal(err)
}
if has {
t.Fatal("block unexpectedly reified")
}
}
// now make the hot/reifying view and ensure access reifies
err = f(blockstore.WithHotView(context.Background()), ss, block4.Cid())
if err != nil {
t.Fatal(err)
}
// everything should be reified
waitForReification()
for i, blk := range allBlocks {
has, err := hot.Has(context.Background(), blk.Cid())
if err != nil {
t.Fatal(err)
}
if !has {
t.Fatalf("block%d was not reified", i+1)
}
}
}
func testSplitStoreReificationLimit(t *testing.T, f func(context.Context, blockstore.Blockstore, cid.Cid) error) {
ds := dssync.MutexWrap(datastore.NewMapDatastore())
hot := newMockStore()
cold := newMockStore()
mkRandomBlock := func() blocks.Block {
data := make([]byte, 128)
_, err := rand.Read(data)
if err != nil {
t.Fatal(err)
}
return blocks.NewBlock(data)
}
block1 := mkRandomBlock()
block2 := mkRandomBlock()
block3 := mkRandomBlock()
hdr := mock.MkBlock(nil, 0, 0)
hdr.Messages = block1.Cid()
hdr.ParentMessageReceipts = block2.Cid()
hdr.ParentStateRoot = block3.Cid()
block4, err := hdr.ToStorageBlock()
if err != nil {
t.Fatal(err)
}
allBlocks := []blocks.Block{block1, block2, block3, block4}
for _, blk := range allBlocks {
err := cold.Put(context.Background(), blk)
if err != nil {
t.Fatal(err)
}
}
path := t.TempDir()
ss, err := Open(path, ds, hot, cold, &Config{MarkSetType: "map"})
if err != nil {
t.Fatal(err)
}
defer ss.Close() //nolint
ss.warmupEpoch = 1
go ss.reifyOrchestrator()
waitForReification := func() {
for {
ss.reifyMx.Lock()
ready := len(ss.reifyPend) == 0 && len(ss.reifyInProgress) == 0
ss.reifyMx.Unlock()
if ready {
return
}
time.Sleep(time.Millisecond)
}
}
// do a hot access -- nothing should be reified as the limit should be exceeded
oldReifyLimit := ReifyLimit
ReifyLimit = 2
t.Cleanup(func() {
ReifyLimit = oldReifyLimit
})
err = f(blockstore.WithHotView(context.Background()), ss, block4.Cid())
if err != nil {
t.Fatal(err)
}
waitForReification()
for _, blk := range allBlocks {
has, err := hot.Has(context.Background(), blk.Cid())
if err != nil {
t.Fatal(err)
}
if has {
t.Fatal("block unexpectedly reified")
}
}
}
func TestSplitStoreReification(t *testing.T) {
t.Log("test reification with Has")
testSplitStoreReification(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
_, err := s.Has(ctx, c)
return err
})
t.Log("test reification with Get")
testSplitStoreReification(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
_, err := s.Get(ctx, c)
return err
})
t.Log("test reification with GetSize")
testSplitStoreReification(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
_, err := s.GetSize(ctx, c)
return err
})
t.Log("test reification with View")
testSplitStoreReification(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
return s.View(ctx, c, func(_ []byte) error { return nil })
})
t.Log("test reification limit")
testSplitStoreReificationLimit(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
_, err := s.Has(ctx, c)
return err
})
}
type mockChain struct {
t testing.TB
@@ -424,35 +666,43 @@ func (c *mockChain) SubscribeHeadChanges(change func(revert []*types.TipSet, app
type mockStore struct {
mx sync.Mutex
set map[cid.Cid]blocks.Block
set map[string]blocks.Block
}
func newMockStore() *mockStore {
return &mockStore{set: make(map[cid.Cid]blocks.Block)}
return &mockStore{set: make(map[string]blocks.Block)}
}
func (b *mockStore) Has(cid cid.Cid) (bool, error) {
func (b *mockStore) keyOf(c cid.Cid) string {
return string(c.Hash())
}
func (b *mockStore) cidOf(k string) cid.Cid {
return cid.NewCidV1(cid.Raw, mh.Multihash([]byte(k)))
}
func (b *mockStore) Has(_ context.Context, cid cid.Cid) (bool, error) {
b.mx.Lock()
defer b.mx.Unlock()
_, ok := b.set[cid]
_, ok := b.set[b.keyOf(cid)]
return ok, nil
}
func (b *mockStore) HashOnRead(hor bool) {}
func (b *mockStore) Get(cid cid.Cid) (blocks.Block, error) {
func (b *mockStore) Get(_ context.Context, cid cid.Cid) (blocks.Block, error) {
b.mx.Lock()
defer b.mx.Unlock()
blk, ok := b.set[cid]
blk, ok := b.set[b.keyOf(cid)]
if !ok {
return nil, blockstore.ErrNotFound
}
return blk, nil
}
func (b *mockStore) GetSize(cid cid.Cid) (int, error) {
blk, err := b.Get(cid)
func (b *mockStore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
blk, err := b.Get(ctx, cid)
if err != nil {
return 0, err
}
@@ -460,46 +710,46 @@ func (b *mockStore) GetSize(cid cid.Cid) (int, error) {
return len(blk.RawData()), nil
}
func (b *mockStore) View(cid cid.Cid, f func([]byte) error) error {
blk, err := b.Get(cid)
func (b *mockStore) View(ctx context.Context, cid cid.Cid, f func([]byte) error) error {
blk, err := b.Get(ctx, cid)
if err != nil {
return err
}
return f(blk.RawData())
}
func (b *mockStore) Put(blk blocks.Block) error {
func (b *mockStore) Put(_ context.Context, blk blocks.Block) error {
b.mx.Lock()
defer b.mx.Unlock()
b.set[blk.Cid()] = blk
b.set[b.keyOf(blk.Cid())] = blk
return nil
}
func (b *mockStore) PutMany(blks []blocks.Block) error {
func (b *mockStore) PutMany(_ context.Context, blks []blocks.Block) error {
b.mx.Lock()
defer b.mx.Unlock()
for _, blk := range blks {
b.set[blk.Cid()] = blk
b.set[b.keyOf(blk.Cid())] = blk
}
return nil
}
func (b *mockStore) DeleteBlock(cid cid.Cid) error {
func (b *mockStore) DeleteBlock(_ context.Context, cid cid.Cid) error {
b.mx.Lock()
defer b.mx.Unlock()
delete(b.set, cid)
delete(b.set, b.keyOf(cid))
return nil
}
func (b *mockStore) DeleteMany(cids []cid.Cid) error {
func (b *mockStore) DeleteMany(_ context.Context, cids []cid.Cid) error {
b.mx.Lock()
defer b.mx.Unlock()
for _, c := range cids {
delete(b.set, c)
delete(b.set, b.keyOf(c))
}
return nil
}
@@ -513,7 +763,7 @@ func (b *mockStore) ForEachKey(f func(cid.Cid) error) error {
defer b.mx.Unlock()
for c := range b.set {
err := f(c)
err := f(b.cidOf(c))
if err != nil {
return err
}
+21 -16
View File
@@ -1,6 +1,7 @@
package splitstore
import (
"sync"
"sync/atomic"
"time"
@@ -55,12 +56,13 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
if WarmupBoundary < epoch {
boundaryEpoch = epoch - WarmupBoundary
}
var mx sync.Mutex
batchHot := make([]blocks.Block, 0, batchSize)
count := int64(0)
xcount := int64(0)
missing := int64(0)
count := new(int64)
xcount := new(int64)
missing := new(int64)
visitor, err := s.markSetEnv.CreateVisitor("warmup", 0)
visitor, err := s.markSetEnv.New("warmup", 0)
if err != nil {
return xerrors.Errorf("error creating visitor: %w", err)
}
@@ -73,9 +75,9 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
return errStopWalk
}
count++
atomic.AddInt64(count, 1)
has, err := s.hot.Has(c)
has, err := s.hot.Has(s.ctx, c)
if err != nil {
return err
}
@@ -84,25 +86,28 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
return nil
}
blk, err := s.cold.Get(c)
blk, err := s.cold.Get(s.ctx, c)
if err != nil {
if err == bstore.ErrNotFound {
missing++
atomic.AddInt64(missing, 1)
return errStopWalk
}
return err
}
xcount++
atomic.AddInt64(xcount, 1)
mx.Lock()
batchHot = append(batchHot, blk)
if len(batchHot) == batchSize {
err = s.hot.PutMany(batchHot)
err = s.hot.PutMany(s.ctx, batchHot)
if err != nil {
mx.Unlock()
return err
}
batchHot = batchHot[:0]
}
mx.Unlock()
return nil
})
@@ -112,22 +117,22 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
}
if len(batchHot) > 0 {
err = s.hot.PutMany(batchHot)
err = s.hot.PutMany(s.ctx, batchHot)
if err != nil {
return err
}
}
log.Infow("warmup stats", "visited", count, "warm", xcount, "missing", missing)
log.Infow("warmup stats", "visited", *count, "warm", *xcount, "missing", *missing)
s.markSetSize = count + count>>2 // overestimate a bit
err = s.ds.Put(markSetSizeKey, int64ToBytes(s.markSetSize))
s.markSetSize = *count + *count>>2 // overestimate a bit
err = s.ds.Put(s.ctx, markSetSizeKey, int64ToBytes(s.markSetSize))
if err != nil {
log.Warnf("error saving mark set size: %s", err)
}
// save the warmup epoch
err = s.ds.Put(warmupEpochKey, epochToBytes(epoch))
err = s.ds.Put(s.ctx, warmupEpochKey, epochToBytes(epoch))
if err != nil {
return xerrors.Errorf("error saving warm up epoch: %w", err)
}
@@ -136,7 +141,7 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
s.mx.Unlock()
// also save the compactionIndex, as this is used as an indicator of warmup for upgraded nodes
err = s.ds.Put(compactionIndexKey, int64ToBytes(s.compactionIndex))
err = s.ds.Put(s.ctx, compactionIndexKey, int64ToBytes(s.compactionIndex))
if err != nil {
return xerrors.Errorf("error saving compaction index: %w", err)
}
+33 -5
View File
@@ -1,6 +1,8 @@
package splitstore
import (
"sync"
cid "github.com/ipfs/go-cid"
)
@@ -17,16 +19,42 @@ func (v *noopVisitor) Visit(_ cid.Cid) (bool, error) {
return true, nil
}
type cidSetVisitor struct {
type tmpVisitor struct {
set *cid.Set
}
var _ ObjectVisitor = (*cidSetVisitor)(nil)
var _ ObjectVisitor = (*tmpVisitor)(nil)
func (v *tmpVisitor) Visit(c cid.Cid) (bool, error) {
if isUnitaryObject(c) {
return false, nil
}
func (v *cidSetVisitor) Visit(c cid.Cid) (bool, error) {
return v.set.Visit(c), nil
}
func tmpVisitor() ObjectVisitor {
return &cidSetVisitor{set: cid.NewSet()}
func newTmpVisitor() ObjectVisitor {
return &tmpVisitor{set: cid.NewSet()}
}
type concurrentVisitor struct {
mx sync.Mutex
set *cid.Set
}
var _ ObjectVisitor = (*concurrentVisitor)(nil)
func newConcurrentVisitor() *concurrentVisitor {
return &concurrentVisitor{set: cid.NewSet()}
}
func (v *concurrentVisitor) Visit(c cid.Cid) (bool, error) {
if isUnitaryObject(c) {
return false, nil
}
v.mx.Lock()
defer v.mx.Unlock()
return v.set.Visit(c), nil
}
+16 -16
View File
@@ -20,53 +20,53 @@ type SyncBlockstore struct {
bs MemBlockstore // specifically use a memStore to save indirection overhead.
}
func (m *SyncBlockstore) DeleteBlock(k cid.Cid) error {
func (m *SyncBlockstore) DeleteBlock(ctx context.Context, k cid.Cid) error {
m.mu.Lock()
defer m.mu.Unlock()
return m.bs.DeleteBlock(k)
return m.bs.DeleteBlock(ctx, k)
}
func (m *SyncBlockstore) DeleteMany(ks []cid.Cid) error {
func (m *SyncBlockstore) DeleteMany(ctx context.Context, ks []cid.Cid) error {
m.mu.Lock()
defer m.mu.Unlock()
return m.bs.DeleteMany(ks)
return m.bs.DeleteMany(ctx, ks)
}
func (m *SyncBlockstore) Has(k cid.Cid) (bool, error) {
func (m *SyncBlockstore) Has(ctx context.Context, k cid.Cid) (bool, error) {
m.mu.RLock()
defer m.mu.RUnlock()
return m.bs.Has(k)
return m.bs.Has(ctx, k)
}
func (m *SyncBlockstore) View(k cid.Cid, callback func([]byte) error) error {
func (m *SyncBlockstore) View(ctx context.Context, k cid.Cid, callback func([]byte) error) error {
m.mu.RLock()
defer m.mu.RUnlock()
return m.bs.View(k, callback)
return m.bs.View(ctx, k, callback)
}
func (m *SyncBlockstore) Get(k cid.Cid) (blocks.Block, error) {
func (m *SyncBlockstore) Get(ctx context.Context, k cid.Cid) (blocks.Block, error) {
m.mu.RLock()
defer m.mu.RUnlock()
return m.bs.Get(k)
return m.bs.Get(ctx, k)
}
func (m *SyncBlockstore) GetSize(k cid.Cid) (int, error) {
func (m *SyncBlockstore) GetSize(ctx context.Context, k cid.Cid) (int, error) {
m.mu.RLock()
defer m.mu.RUnlock()
return m.bs.GetSize(k)
return m.bs.GetSize(ctx, k)
}
func (m *SyncBlockstore) Put(b blocks.Block) error {
func (m *SyncBlockstore) Put(ctx context.Context, b blocks.Block) error {
m.mu.Lock()
defer m.mu.Unlock()
return m.bs.Put(b)
return m.bs.Put(ctx, b)
}
func (m *SyncBlockstore) PutMany(bs []blocks.Block) error {
func (m *SyncBlockstore) PutMany(ctx context.Context, bs []blocks.Block) error {
m.mu.Lock()
defer m.mu.Unlock()
return m.bs.PutMany(bs)
return m.bs.PutMany(ctx, bs)
}
func (m *SyncBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
+20 -20
View File
@@ -92,28 +92,28 @@ func (t *TimedCacheBlockstore) rotate() {
t.mu.Unlock()
}
func (t *TimedCacheBlockstore) Put(b blocks.Block) error {
func (t *TimedCacheBlockstore) Put(ctx context.Context, b blocks.Block) error {
// Don't check the inactive set here. We want to keep this block for at
// least one interval.
t.mu.Lock()
defer t.mu.Unlock()
return t.active.Put(b)
return t.active.Put(ctx, b)
}
func (t *TimedCacheBlockstore) PutMany(bs []blocks.Block) error {
func (t *TimedCacheBlockstore) PutMany(ctx context.Context, bs []blocks.Block) error {
t.mu.Lock()
defer t.mu.Unlock()
return t.active.PutMany(bs)
return t.active.PutMany(ctx, bs)
}
func (t *TimedCacheBlockstore) View(k cid.Cid, callback func([]byte) error) error {
func (t *TimedCacheBlockstore) View(ctx context.Context, k cid.Cid, callback func([]byte) error) error {
// The underlying blockstore is always a "mem" blockstore so there's no difference,
// from a performance perspective, between view & get. So we call Get to avoid
// calling an arbitrary callback while holding a lock.
t.mu.RLock()
block, err := t.active.Get(k)
block, err := t.active.Get(ctx, k)
if err == ErrNotFound {
block, err = t.inactive.Get(k)
block, err = t.inactive.Get(ctx, k)
}
t.mu.RUnlock()
@@ -123,51 +123,51 @@ func (t *TimedCacheBlockstore) View(k cid.Cid, callback func([]byte) error) erro
return callback(block.RawData())
}
func (t *TimedCacheBlockstore) Get(k cid.Cid) (blocks.Block, error) {
func (t *TimedCacheBlockstore) Get(ctx context.Context, k cid.Cid) (blocks.Block, error) {
t.mu.RLock()
defer t.mu.RUnlock()
b, err := t.active.Get(k)
b, err := t.active.Get(ctx, k)
if err == ErrNotFound {
b, err = t.inactive.Get(k)
b, err = t.inactive.Get(ctx, k)
}
return b, err
}
func (t *TimedCacheBlockstore) GetSize(k cid.Cid) (int, error) {
func (t *TimedCacheBlockstore) GetSize(ctx context.Context, k cid.Cid) (int, error) {
t.mu.RLock()
defer t.mu.RUnlock()
size, err := t.active.GetSize(k)
size, err := t.active.GetSize(ctx, k)
if err == ErrNotFound {
size, err = t.inactive.GetSize(k)
size, err = t.inactive.GetSize(ctx, k)
}
return size, err
}
func (t *TimedCacheBlockstore) Has(k cid.Cid) (bool, error) {
func (t *TimedCacheBlockstore) Has(ctx context.Context, k cid.Cid) (bool, error) {
t.mu.RLock()
defer t.mu.RUnlock()
if has, err := t.active.Has(k); err != nil {
if has, err := t.active.Has(ctx, k); err != nil {
return false, err
} else if has {
return true, nil
}
return t.inactive.Has(k)
return t.inactive.Has(ctx, k)
}
func (t *TimedCacheBlockstore) HashOnRead(_ bool) {
// no-op
}
func (t *TimedCacheBlockstore) DeleteBlock(k cid.Cid) error {
func (t *TimedCacheBlockstore) DeleteBlock(ctx context.Context, k cid.Cid) error {
t.mu.Lock()
defer t.mu.Unlock()
return multierr.Combine(t.active.DeleteBlock(k), t.inactive.DeleteBlock(k))
return multierr.Combine(t.active.DeleteBlock(ctx, k), t.inactive.DeleteBlock(ctx, k))
}
func (t *TimedCacheBlockstore) DeleteMany(ks []cid.Cid) error {
func (t *TimedCacheBlockstore) DeleteMany(ctx context.Context, ks []cid.Cid) error {
t.mu.Lock()
defer t.mu.Unlock()
return multierr.Combine(t.active.DeleteMany(ks), t.inactive.DeleteMany(ks))
return multierr.Combine(t.active.DeleteMany(ctx, ks), t.inactive.DeleteMany(ctx, ks))
}
func (t *TimedCacheBlockstore) AllKeysChan(_ context.Context) (<-chan cid.Cid, error) {
+17 -11
View File
@@ -1,3 +1,4 @@
//stm: #unit
package blockstore
import (
@@ -13,12 +14,17 @@ import (
)
func TestTimedCacheBlockstoreSimple(t *testing.T) {
//stm: @SPLITSTORE_TIMED_BLOCKSTORE_START_001
//stm: @SPLITSTORE_TIMED_BLOCKSTORE_PUT_001, @SPLITSTORE_TIMED_BLOCKSTORE_HAS_001, @SPLITSTORE_TIMED_BLOCKSTORE_GET_001
//stm: @SPLITSTORE_TIMED_BLOCKSTORE_ALL_KEYS_CHAN_001
tc := NewTimedCacheBlockstore(10 * time.Millisecond)
mClock := clock.NewMock()
mClock.Set(time.Now())
tc.clock = mClock
tc.doneRotatingCh = make(chan struct{})
ctx := context.Background()
_ = tc.Start(context.Background())
mClock.Add(1) // IDK why it is needed but it makes it work
@@ -27,18 +33,18 @@ func TestTimedCacheBlockstoreSimple(t *testing.T) {
}()
b1 := blocks.NewBlock([]byte("foo"))
require.NoError(t, tc.Put(b1))
require.NoError(t, tc.Put(ctx, b1))
b2 := blocks.NewBlock([]byte("bar"))
require.NoError(t, tc.Put(b2))
require.NoError(t, tc.Put(ctx, b2))
b3 := blocks.NewBlock([]byte("baz"))
b1out, err := tc.Get(b1.Cid())
b1out, err := tc.Get(ctx, b1.Cid())
require.NoError(t, err)
require.Equal(t, b1.RawData(), b1out.RawData())
has, err := tc.Has(b1.Cid())
has, err := tc.Has(ctx, b1.Cid())
require.NoError(t, err)
require.True(t, has)
@@ -46,17 +52,17 @@ func TestTimedCacheBlockstoreSimple(t *testing.T) {
<-tc.doneRotatingCh
// We should still have everything.
has, err = tc.Has(b1.Cid())
has, err = tc.Has(ctx, b1.Cid())
require.NoError(t, err)
require.True(t, has)
has, err = tc.Has(b2.Cid())
has, err = tc.Has(ctx, b2.Cid())
require.NoError(t, err)
require.True(t, has)
// extend b2, add b3.
require.NoError(t, tc.Put(b2))
require.NoError(t, tc.Put(b3))
require.NoError(t, tc.Put(ctx, b2))
require.NoError(t, tc.Put(ctx, b3))
// all keys once.
allKeys, err := tc.AllKeysChan(context.Background())
@@ -71,15 +77,15 @@ func TestTimedCacheBlockstoreSimple(t *testing.T) {
<-tc.doneRotatingCh
// should still have b2, and b3, but not b1
has, err = tc.Has(b1.Cid())
has, err = tc.Has(ctx, b1.Cid())
require.NoError(t, err)
require.False(t, has)
has, err = tc.Has(b2.Cid())
has, err = tc.Has(ctx, b2.Cid())
require.NoError(t, err)
require.True(t, has)
has, err = tc.Has(b3.Cid())
has, err = tc.Has(ctx, b3.Cid())
require.NoError(t, err)
require.True(t, has)
}
+16 -16
View File
@@ -19,72 +19,72 @@ func Union(stores ...Blockstore) Blockstore {
return unionBlockstore(stores)
}
func (m unionBlockstore) Has(cid cid.Cid) (has bool, err error) {
func (m unionBlockstore) Has(ctx context.Context, cid cid.Cid) (has bool, err error) {
for _, bs := range m {
if has, err = bs.Has(cid); has || err != nil {
if has, err = bs.Has(ctx, cid); has || err != nil {
break
}
}
return has, err
}
func (m unionBlockstore) Get(cid cid.Cid) (blk blocks.Block, err error) {
func (m unionBlockstore) Get(ctx context.Context, cid cid.Cid) (blk blocks.Block, err error) {
for _, bs := range m {
if blk, err = bs.Get(cid); err == nil || err != ErrNotFound {
if blk, err = bs.Get(ctx, cid); err == nil || err != ErrNotFound {
break
}
}
return blk, err
}
func (m unionBlockstore) View(cid cid.Cid, callback func([]byte) error) (err error) {
func (m unionBlockstore) View(ctx context.Context, cid cid.Cid, callback func([]byte) error) (err error) {
for _, bs := range m {
if err = bs.View(cid, callback); err == nil || err != ErrNotFound {
if err = bs.View(ctx, cid, callback); err == nil || err != ErrNotFound {
break
}
}
return err
}
func (m unionBlockstore) GetSize(cid cid.Cid) (size int, err error) {
func (m unionBlockstore) GetSize(ctx context.Context, cid cid.Cid) (size int, err error) {
for _, bs := range m {
if size, err = bs.GetSize(cid); err == nil || err != ErrNotFound {
if size, err = bs.GetSize(ctx, cid); err == nil || err != ErrNotFound {
break
}
}
return size, err
}
func (m unionBlockstore) Put(block blocks.Block) (err error) {
func (m unionBlockstore) Put(ctx context.Context, block blocks.Block) (err error) {
for _, bs := range m {
if err = bs.Put(block); err != nil {
if err = bs.Put(ctx, block); err != nil {
break
}
}
return err
}
func (m unionBlockstore) PutMany(blks []blocks.Block) (err error) {
func (m unionBlockstore) PutMany(ctx context.Context, blks []blocks.Block) (err error) {
for _, bs := range m {
if err = bs.PutMany(blks); err != nil {
if err = bs.PutMany(ctx, blks); err != nil {
break
}
}
return err
}
func (m unionBlockstore) DeleteBlock(cid cid.Cid) (err error) {
func (m unionBlockstore) DeleteBlock(ctx context.Context, cid cid.Cid) (err error) {
for _, bs := range m {
if err = bs.DeleteBlock(cid); err != nil {
if err = bs.DeleteBlock(ctx, cid); err != nil {
break
}
}
return err
}
func (m unionBlockstore) DeleteMany(cids []cid.Cid) (err error) {
func (m unionBlockstore) DeleteMany(ctx context.Context, cids []cid.Cid) (err error) {
for _, bs := range m {
if err = bs.DeleteMany(cids); err != nil {
if err = bs.DeleteMany(ctx, cids); err != nil {
break
}
}
+26 -19
View File
@@ -1,3 +1,4 @@
//stm: #unit
package blockstore
import (
@@ -15,79 +16,85 @@ var (
)
func TestUnionBlockstore_Get(t *testing.T) {
//stm: @SPLITSTORE_UNION_BLOCKSTORE_GET_001
ctx := context.Background()
m1 := NewMemory()
m2 := NewMemory()
_ = m1.Put(b1)
_ = m2.Put(b2)
_ = m1.Put(ctx, b1)
_ = m2.Put(ctx, b2)
u := Union(m1, m2)
v1, err := u.Get(b1.Cid())
v1, err := u.Get(ctx, b1.Cid())
require.NoError(t, err)
require.Equal(t, b1.RawData(), v1.RawData())
v2, err := u.Get(b2.Cid())
v2, err := u.Get(ctx, b2.Cid())
require.NoError(t, err)
require.Equal(t, b2.RawData(), v2.RawData())
}
func TestUnionBlockstore_Put_PutMany_Delete_AllKeysChan(t *testing.T) {
//stm: @SPLITSTORE_UNION_BLOCKSTORE_PUT_001, @SPLITSTORE_UNION_BLOCKSTORE_HAS_001
//stm: @SPLITSTORE_UNION_BLOCKSTORE_PUT_MANY_001, @SPLITSTORE_UNION_BLOCKSTORE_DELETE_001
//stm: @SPLITSTORE_UNION_BLOCKSTORE_ALL_KEYS_CHAN_001
ctx := context.Background()
m1 := NewMemory()
m2 := NewMemory()
u := Union(m1, m2)
err := u.Put(b0)
err := u.Put(ctx, b0)
require.NoError(t, err)
var has bool
// write was broadcasted to all stores.
has, _ = m1.Has(b0.Cid())
has, _ = m1.Has(ctx, b0.Cid())
require.True(t, has)
has, _ = m2.Has(b0.Cid())
has, _ = m2.Has(ctx, b0.Cid())
require.True(t, has)
has, _ = u.Has(b0.Cid())
has, _ = u.Has(ctx, b0.Cid())
require.True(t, has)
// put many.
err = u.PutMany([]blocks.Block{b1, b2})
err = u.PutMany(ctx, []blocks.Block{b1, b2})
require.NoError(t, err)
// write was broadcasted to all stores.
has, _ = m1.Has(b1.Cid())
has, _ = m1.Has(ctx, b1.Cid())
require.True(t, has)
has, _ = m1.Has(b2.Cid())
has, _ = m1.Has(ctx, b2.Cid())
require.True(t, has)
has, _ = m2.Has(b1.Cid())
has, _ = m2.Has(ctx, b1.Cid())
require.True(t, has)
has, _ = m2.Has(b2.Cid())
has, _ = m2.Has(ctx, b2.Cid())
require.True(t, has)
// also in the union store.
has, _ = u.Has(b1.Cid())
has, _ = u.Has(ctx, b1.Cid())
require.True(t, has)
has, _ = u.Has(b2.Cid())
has, _ = u.Has(ctx, b2.Cid())
require.True(t, has)
// deleted from all stores.
err = u.DeleteBlock(b1.Cid())
err = u.DeleteBlock(ctx, b1.Cid())
require.NoError(t, err)
has, _ = u.Has(b1.Cid())
has, _ = u.Has(ctx, b1.Cid())
require.False(t, has)
has, _ = m1.Has(b1.Cid())
has, _ = m1.Has(ctx, b1.Cid())
require.False(t, has)
has, _ = m2.Has(b1.Cid())
has, _ = m2.Has(ctx, b1.Cid())
require.False(t, has)
// check that AllKeysChan returns b0 and b2, twice (once per backing store)
+1
View File
@@ -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.
+2
View File
@@ -1,3 +1,4 @@
//stm: #unit
package build
import (
@@ -7,6 +8,7 @@ import (
)
func TestOpenRPCDiscoverJSON_Version(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_OPENRPC_VERSION_001
// openRPCDocVersion is the current OpenRPC version of the API docs.
openRPCDocVersion := "1.2.6"
+12 -4
View File
@@ -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)
+13 -6
View File
@@ -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)
+12 -5
View File
@@ -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)
+13 -8
View File
@@ -53,15 +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.SetSupportedProofTypes(
abi.RegisteredSealProof_StackedDrg2KiBV1,
abi.RegisteredSealProof_StackedDrg8MiBV1,
abi.RegisteredSealProof_StackedDrg512MiBV1,
)
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)
+8
View File
@@ -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
View File
@@ -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)
+11
View File
@@ -13,6 +13,17 @@ import (
func BlocksTopic(netName dtypes.NetworkName) string { return "/fil/blocks/" + string(netName) }
func MessagesTopic(netName dtypes.NetworkName) string { return "/fil/msgs/" + string(netName) }
func IndexerIngestTopic(netName dtypes.NetworkName) string {
nn := string(netName)
// The network name testnetnet is here for historical reasons.
// Going forward we aim to use the name `mainnet` where possible.
if nn == "testnetnet" {
nn = "mainnet"
}
return "/indexer/ingest/" + nn
}
func DhtProtocolName(netName dtypes.NetworkName) protocol.ID {
return protocol.ID("/fil/kad/" + string(netName))
}
+6
View File
@@ -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
View File
@@ -37,7 +37,7 @@ func BuildTypeString() string {
}
// BuildVersion is the local build version
const BuildVersion = "1.14.2"
const BuildVersion = "1.15.3"
func UserVersion() string {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
+3
View File
@@ -1,3 +1,4 @@
//stm: #unit
package adt
import (
@@ -44,6 +45,7 @@ func TestDiffAdtArray(t *testing.T) {
changes := new(TestDiffArray)
//stm: @CHAIN_ADT_ARRAY_DIFF_001
assert.NoError(t, DiffAdtArray(arrA, arrB, changes))
assert.NotNil(t, changes)
@@ -98,6 +100,7 @@ func TestDiffAdtMap(t *testing.T) {
changes := new(TestDiffMap)
//stm: @CHAIN_ADT_MAP_DIFF_001
assert.NoError(t, DiffAdtMap(mapA, mapB, changes))
assert.NotNil(t, changes)
+3
View File
@@ -1,3 +1,4 @@
//stm: #unit
package aerrors_test
import (
@@ -11,6 +12,7 @@ import (
)
func TestFatalError(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_ACTOR_ERRORS_001
e1 := xerrors.New("out of disk space")
e2 := xerrors.Errorf("could not put node: %w", e1)
e3 := xerrors.Errorf("could not save head: %w", e2)
@@ -24,6 +26,7 @@ func TestFatalError(t *testing.T) {
assert.True(t, IsFatal(aw4), "should be fatal")
}
func TestAbsorbeError(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_ACTOR_ERRORS_001
e1 := xerrors.New("EOF")
e2 := xerrors.Errorf("could not decode: %w", e1)
ae := Absorb(e2, 35, "failed to decode CBOR")
@@ -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) {
+1 -1
View File
@@ -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) {
+25 -3
View File
@@ -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}}
}
+2 -2
View File
@@ -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
}
+2 -2
View File
@@ -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
}
+2 -2
View File
@@ -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
}
+2 -2
View File
@@ -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
}
+2 -2
View File
@@ -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
}
+22 -2
View File
@@ -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
}
+22 -2
View File
@@ -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
}
@@ -16,6 +16,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/types"
verifreg7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/verifreg"
)
func init() {
@@ -62,6 +63,11 @@ func GetActorCodeID(av actors.Version) (cid.Cid, error) {
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
}
type RemoveDataCapProposal = verifreg{{.latestVersion}}.RemoveDataCapProposal
type RemoveDataCapRequest = verifreg{{.latestVersion}}.RemoveDataCapRequest
type RemoveDataCapParams = verifreg{{.latestVersion}}.RemoveDataCapParams
type RmDcProposalID = verifreg{{.latestVersion}}.RmDcProposalID
const SignatureDomainSeparation_RemoveDataCap = verifreg{{.latestVersion}}.SignatureDomainSeparation_RemoveDataCap
type State interface {
cbor.Marshaler
@@ -69,6 +75,7 @@ type State interface {
RootKey() (address.Address, error)
VerifiedClientDataCap(address.Address) (bool, abi.StoragePower, error)
VerifierDataCap(address.Address) (bool, abi.StoragePower, error)
RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error)
ForEachVerifier(func(addr address.Address, dcap abi.StoragePower) error) error
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
GetState() interface{}
@@ -61,6 +61,10 @@ func (s *state{{.v}}) VerifierDataCap(addr address.Address) (bool, abi.StoragePo
return getDataCap(s.store, actors.Version{{.v}}, s.verifiers, addr)
}
func (s *state{{.v}}) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
return getRemoveDataCapProposalID(s.store, actors.Version{{.v}}, s.removeDataCapProposalIDs, verifier, client)
}
func (s *state{{.v}}) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachCap(s.store, actors.Version{{.v}}, s.verifiers, cb)
}
@@ -77,6 +81,11 @@ func (s *state{{.v}}) verifiers() (adt.Map, error) {
return adt{{.v}}.AsMap(s.store, s.Verifiers{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}})
}
func (s *state{{.v}}) removeDataCapProposalIDs() (adt.Map, error) {
{{if le .v 6}}return nil, nil
{{else}}return adt{{.v}}.AsMap(s.store, s.RemoveDataCapProposalIDs, builtin{{.v}}.DefaultHamtBitwidth){{end}}
}
func (s *state{{.v}}) GetState() interface{} {
return &s.State
}
+26
View File
@@ -6,6 +6,7 @@ import (
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/specs-actors/v7/actors/builtin/verifreg"
"golang.org/x/xerrors"
)
@@ -50,3 +51,28 @@ func forEachCap(store adt.Store, ver actors.Version, root rootFunc, cb func(addr
return cb(a, dcap)
})
}
func getRemoveDataCapProposalID(store adt.Store, ver actors.Version, root rootFunc, verifier address.Address, client address.Address) (bool, uint64, error) {
if verifier.Protocol() != address.ID {
return false, 0, xerrors.Errorf("can only look up ID addresses")
}
if client.Protocol() != address.ID {
return false, 0, xerrors.Errorf("can only look up ID addresses")
}
vh, err := root()
if err != nil {
return false, 0, xerrors.Errorf("loading verifreg: %w", err)
}
if vh == nil {
return false, 0, xerrors.Errorf("remove data cap proposal hamt not found. you are probably using an incompatible version of actors")
}
var id verifreg.RmDcProposalID
if found, err := vh.Get(abi.NewAddrPairKey(verifier, client), &id); err != nil {
return false, 0, xerrors.Errorf("looking up addr pair: %w", err)
} else if !found {
return false, 0, nil
}
return true, id.ProposalID, nil
}
+9
View File
@@ -53,6 +53,10 @@ func (s *state0) VerifierDataCap(addr address.Address) (bool, abi.StoragePower,
return getDataCap(s.store, actors.Version0, s.verifiers, addr)
}
func (s *state0) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
return getRemoveDataCapProposalID(s.store, actors.Version0, s.removeDataCapProposalIDs, verifier, client)
}
func (s *state0) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachCap(s.store, actors.Version0, s.verifiers, cb)
}
@@ -69,6 +73,11 @@ func (s *state0) verifiers() (adt.Map, error) {
return adt0.AsMap(s.store, s.Verifiers)
}
func (s *state0) removeDataCapProposalIDs() (adt.Map, error) {
return nil, nil
}
func (s *state0) GetState() interface{} {
return &s.State
}
+9
View File
@@ -53,6 +53,10 @@ func (s *state2) VerifierDataCap(addr address.Address) (bool, abi.StoragePower,
return getDataCap(s.store, actors.Version2, s.verifiers, addr)
}
func (s *state2) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
return getRemoveDataCapProposalID(s.store, actors.Version2, s.removeDataCapProposalIDs, verifier, client)
}
func (s *state2) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachCap(s.store, actors.Version2, s.verifiers, cb)
}
@@ -69,6 +73,11 @@ func (s *state2) verifiers() (adt.Map, error) {
return adt2.AsMap(s.store, s.Verifiers)
}
func (s *state2) removeDataCapProposalIDs() (adt.Map, error) {
return nil, nil
}
func (s *state2) GetState() interface{} {
return &s.State
}
+9
View File
@@ -54,6 +54,10 @@ func (s *state3) VerifierDataCap(addr address.Address) (bool, abi.StoragePower,
return getDataCap(s.store, actors.Version3, s.verifiers, addr)
}
func (s *state3) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
return getRemoveDataCapProposalID(s.store, actors.Version3, s.removeDataCapProposalIDs, verifier, client)
}
func (s *state3) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachCap(s.store, actors.Version3, s.verifiers, cb)
}
@@ -70,6 +74,11 @@ func (s *state3) verifiers() (adt.Map, error) {
return adt3.AsMap(s.store, s.Verifiers, builtin3.DefaultHamtBitwidth)
}
func (s *state3) removeDataCapProposalIDs() (adt.Map, error) {
return nil, nil
}
func (s *state3) GetState() interface{} {
return &s.State
}
+9
View File
@@ -54,6 +54,10 @@ func (s *state4) VerifierDataCap(addr address.Address) (bool, abi.StoragePower,
return getDataCap(s.store, actors.Version4, s.verifiers, addr)
}
func (s *state4) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
return getRemoveDataCapProposalID(s.store, actors.Version4, s.removeDataCapProposalIDs, verifier, client)
}
func (s *state4) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachCap(s.store, actors.Version4, s.verifiers, cb)
}
@@ -70,6 +74,11 @@ func (s *state4) verifiers() (adt.Map, error) {
return adt4.AsMap(s.store, s.Verifiers, builtin4.DefaultHamtBitwidth)
}
func (s *state4) removeDataCapProposalIDs() (adt.Map, error) {
return nil, nil
}
func (s *state4) GetState() interface{} {
return &s.State
}
+9
View File
@@ -54,6 +54,10 @@ func (s *state5) VerifierDataCap(addr address.Address) (bool, abi.StoragePower,
return getDataCap(s.store, actors.Version5, s.verifiers, addr)
}
func (s *state5) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
return getRemoveDataCapProposalID(s.store, actors.Version5, s.removeDataCapProposalIDs, verifier, client)
}
func (s *state5) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachCap(s.store, actors.Version5, s.verifiers, cb)
}
@@ -70,6 +74,11 @@ func (s *state5) verifiers() (adt.Map, error) {
return adt5.AsMap(s.store, s.Verifiers, builtin5.DefaultHamtBitwidth)
}
func (s *state5) removeDataCapProposalIDs() (adt.Map, error) {
return nil, nil
}
func (s *state5) GetState() interface{} {
return &s.State
}
+9
View File
@@ -54,6 +54,10 @@ func (s *state6) VerifierDataCap(addr address.Address) (bool, abi.StoragePower,
return getDataCap(s.store, actors.Version6, s.verifiers, addr)
}
func (s *state6) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
return getRemoveDataCapProposalID(s.store, actors.Version6, s.removeDataCapProposalIDs, verifier, client)
}
func (s *state6) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachCap(s.store, actors.Version6, s.verifiers, cb)
}
@@ -70,6 +74,11 @@ func (s *state6) verifiers() (adt.Map, error) {
return adt6.AsMap(s.store, s.Verifiers, builtin6.DefaultHamtBitwidth)
}
func (s *state6) removeDataCapProposalIDs() (adt.Map, error) {
return nil, nil
}
func (s *state6) GetState() interface{} {
return &s.State
}
+8
View File
@@ -54,6 +54,10 @@ func (s *state7) VerifierDataCap(addr address.Address) (bool, abi.StoragePower,
return getDataCap(s.store, actors.Version7, s.verifiers, addr)
}
func (s *state7) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
return getRemoveDataCapProposalID(s.store, actors.Version7, s.removeDataCapProposalIDs, verifier, client)
}
func (s *state7) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachCap(s.store, actors.Version7, s.verifiers, cb)
}
@@ -70,6 +74,10 @@ func (s *state7) verifiers() (adt.Map, error) {
return adt7.AsMap(s.store, s.Verifiers, builtin7.DefaultHamtBitwidth)
}
func (s *state7) removeDataCapProposalIDs() (adt.Map, error) {
return adt7.AsMap(s.store, s.RemoveDataCapProposalIDs, builtin7.DefaultHamtBitwidth)
}
func (s *state7) GetState() interface{} {
return &s.State
}

Some files were not shown because too many files have changed in this diff Show More