Compare commits

...
1577 Commits
Author SHA1 Message Date
Raúl Kripalani db6b94cf1e Merge commit '56d80030001b8c443f486a48e8c8ac70d8e1ba77' into feat/replace-multistore-carv2 2021-07-27 23:20:15 +01:00
Aayush Rajasekaran 56d8003000 Merge pull request #6890 from filecoin-project/jen/proof
Update to proof v8.0.3
2021-07-27 17:40:13 -04:00
Raúl Kripalani 7c2341b43c Merge branch 'master' into feat/replace-multistore-carv2 2021-07-27 22:23:28 +01:00
Jiaying Wang 90fa7ff057 Merge branch 'master' into jen/proof 2021-07-27 17:20:46 -04:00
raulk 35c90349ce Merge pull request #6840 from filecoin-project/nonsense/lotus-shed-support-rollback-for-mra
lotus-shed: initial export cmd for markets related metadata
2021-07-27 22:13:29 +01:00
raulk 505bc58530 Merge pull request #6888 from filecoin-project/feat/cli-super-verbose
add a very verbose -vv flag to lotus and lotus-miner.
2021-07-27 22:09:49 +01:00
raulk 38c91a28aa Merge branch 'master' into feat/cli-super-verbose 2021-07-27 22:09:35 +01:00
Jiaying Wang 2ba48a7581 Merge pull request #6880 from filecoin-project/jennijuju-patch-1
Update RELEASE_ISSUE_TEMPLATE.md
2021-07-27 17:09:03 -04:00
Jiaying Wang 4918a7c16f Merge branch 'master' into feat/cli-super-verbose 2021-07-27 17:07:16 -04:00
Raúl Kripalani 19182999dd Merge branch 'master' into feat/replace-multistore-carv2 2021-07-27 22:06:07 +01:00
Jiaying Wang 83f7dc8c96 Merge branch 'master' into jen/proof 2021-07-27 17:04:39 -04:00
vyzo 6751185d6f Merge pull request #6854 from filecoin-project/feat/moving-gc
Moving GC for badger
2021-07-27 23:27:04 +03:00
Raúl Kripalani 2a2b442aae pacify the linter. 2021-07-27 21:25:22 +01:00
Raúl Kripalani d0353d1ef1 Merge branch 'feat/cli-super-verbose' into feat/replace-multistore-carv2 2021-07-27 21:23:31 +01:00
Raúl Kripalani 1250f8009f upgrade go-fil-markets. 2021-07-27 21:15:24 +01:00
Raúl Kripalani 4b70d13a4b update dependencies. 2021-07-27 21:04:59 +01:00
Raúl Kripalani 987fc0b77d Merge branch 'master' into feat/replace-multistore-carv2 2021-07-27 21:02:52 +01:00
raulk e4b225f4ba Merge branch 'master' into feat/cli-super-verbose 2021-07-27 20:49:44 +01:00
Raúl Kripalani b04fb75a92 rename flag to very verbose. 2021-07-27 20:49:30 +01:00
Łukasz Magiera cef65cd989 Merge branch 'master' into jen/proof 2021-07-27 21:39:31 +02:00
vyzo 7c28ff3826 Merge branch 'master' into feat/moving-gc 2021-07-27 21:48:51 +03:00
Raúl Kripalani 6e9f480063 markets event logger: avoid creating a slice with every event. 2021-07-27 19:34:16 +01:00
Jiaying Wang 1d87ffcee4 Merge branch 'master' into jennijuju-patch-1 2021-07-27 13:45:03 -04:00
Jiaying Wang 0e99500b93 Merge pull request #6879 from filecoin-project/jen/stale-pr
Add github actions for staled pr
2021-07-27 13:43:25 -04:00
Jiaying Wang db12fd4a03 Merge branch 'master' into jen/stale-pr 2021-07-27 13:43:17 -04:00
Jennifer Wang 2790c9439f Update to proof v8.0.3 2021-07-27 13:29:07 -04:00
Raúl Kripalani 80b334d04f upgrade dagstore to v0.3.1. 2021-07-27 18:24:23 +01:00
aarshkshah1992 944aeed13e remove dead code 2021-07-27 22:16:45 +05:30
Raúl Kripalani 109a8242ae implement conditional throttling in lotus mount. 2021-07-27 17:24:48 +01:00
Jiaying Wang 2f03b456de Update RELEASE_ISSUE_TEMPLATE.md 2021-07-27 12:00:08 -04:00
Raúl Kripalani 3451acbc03 docgen. 2021-07-27 15:28:10 +01:00
Raúl Kripalani 18f5997d02 add throttling to dagstore; increase GC frequency to 1min. 2021-07-27 15:11:49 +01:00
Jiaying Wang bc82a48693 Merge pull request #4638 from filecoin-project/feat/vis-sector-alloc
Add allocated sectorid vis
2021-07-27 10:08:05 -04:00
Jiaying Wang e46f02f59d Merge branch 'master' into feat/vis-sector-alloc 2021-07-27 09:49:33 -04:00
Raúl Kripalani 48cddd3644 add a super verbose -vv flag to lotus and lotus-miner. 2021-07-27 14:25:28 +01:00
Łukasz Magiera e4ebbf106a Merge pull request #6886 from filecoin-project/fix/rename-lotus-storage-miner
rename `cmd/lotus{-storage=>}-miner` to match binary.
2021-07-27 14:20:35 +02:00
Łukasz Magiera 69f0b22f6a Merge branch 'master' into fix/rename-lotus-storage-miner 2021-07-27 13:57:17 +02:00
Łukasz Magiera c2575327c0 Merge pull request #6885 from filecoin-project/feat/update-market
update to go-fil-market v1.6.0
2021-07-27 13:00:38 +02:00
Raúl Kripalani e0522a6b1f rename cmd/lotus{-storage=>}-miner to match binary. 2021-07-27 11:54:46 +01:00
Jennifer Wang 06d01d7dc0 Add github actions for staled pr 2021-07-27 05:33:48 -04:00
vyzo 7c195245a1 make cfgdoc-gen 2021-07-27 12:13:26 +03:00
vyzo da3e36acdc Merge branch 'master' into feat/moving-gc 2021-07-27 12:12:38 +03:00
vyzo 8809707158 update README 2021-07-27 12:08:39 +03:00
vyzo c21c413695 remove db2 to dbNext 2021-07-27 12:06:40 +03:00
vyzo bb2d99908c make state constants typed 2021-07-27 12:03:26 +03:00
vyzo b82f953fd5 use the badger streaming interface in doCopy 2021-07-27 11:46:35 +03:00
vyzo 59aebba0d9 use a slab allocator for the copy 2021-07-27 11:35:21 +03:00
Jennifer Wang d24b2acc63 update to go-fil-market v1.6.0 2021-07-27 04:34:35 -04:00
vyzo 0baeec0686 remove filter from doCopy; it's not used
it was there to support a potential CopyTo interface; but we'll cross that bridge when we get there.
2021-07-27 11:18:24 +03:00
vyzo 649fc62863 panic if we fail to correctly setup the db paths.
we can't really continue and leave a ticking bomb for the next restart; the user might not see it.
2021-07-27 10:27:16 +03:00
vyzo d6ace68540 extend test to do a double move and check symlink following 2021-07-27 10:16:50 +03:00
vyzo cbaffab9dd use EvalSymlinks in deleteDB 2021-07-27 10:08:07 +03:00
vyzo c03859c1b5 resolve symlinks when constructing the new db path
so that the new path is adjacent to the old path, allowing the user to symlink the db in
a different file system.
2021-07-27 10:05:35 +03:00
vyzo 9d25464703 use functional options for hotstore gc, rename MovingGC to FullGC 2021-07-27 09:53:22 +03:00
vyzo 96c1123c33 use functional options in the BlockstoreGC interface 2021-07-27 09:52:06 +03:00
Jiaying Wang 0dd325866d Update RELEASE_ISSUE_TEMPLATE.md 2021-07-26 23:15:09 -04:00
Raúl Kripalani 160fab08aa fix lint and gen errors. 2021-07-26 23:32:51 +01:00
Raúl Kripalani 9bdbbf33cb Merge branch 'master' into feat/replace-multistore-carv2 2021-07-26 22:15:36 +01:00
Jiaying Wang 790f27d6a2 Merge branch 'master' into feat/vis-sector-alloc 2021-07-26 16:15:15 -04:00
Peter Rabbitson 2ca174482b Merge pull request #6674 from filecoin-project/chore/upgrade_go-multihash
Bump go-multihash, adjust test for supported version
2021-07-26 21:46:10 +02:00
Peter Rabbitson 20c5dd5bdc Merge remote-tracking branch 'origin/master' into chore/upgrade_go-multihash 2021-07-26 21:26:10 +02:00
Peter Rabbitson 7ffe63a358 Merge pull request #6683 from filecoin-project/feat/allow_padding_redux
Fix padding of deals, which only partially shipped in #5988
2021-07-26 21:12:40 +02:00
Peter Rabbitson 39325e5463 Merge branch 'master' into feat/allow_padding_redux 2021-07-26 20:53:27 +02:00
Jakub Sztandera acc38817ec Merge pull request #6862 from filecoin-project/fix/racy-TestSimultanenousTransferLimit
fix racy TestSimultanenousTransferLimit.
2021-07-26 20:33:28 +02:00
Jiaying Wang 2772b54eda Merge branch 'master' into fix/racy-TestSimultanenousTransferLimit 2021-07-26 14:09:05 -04:00
Jiaying Wang 98c8a2abe5 Merge branch 'master' into feat/allow_padding_redux 2021-07-26 13:59:33 -04:00
vyzo ef24593544 Merge pull request #6867 from filecoin-project/fix/splitstore-warmup
Improve splitstore warmup
2021-07-26 19:15:59 +03:00
vyzo c7e94beddc Merge branch 'master' into fix/splitstore-warmup 2021-07-26 18:56:53 +03:00
Peter Rabbitson ed387b43cc Bump go-multihash, adjust test for supported version 2021-07-26 17:50:19 +02:00
Steven Allen 26e961380a Merge pull request #6872 from filecoin-project/asr/block-height-fix
ValidateBlock: Assert that block header height's are greater than parents
2021-07-26 08:44:06 -07:00
vyzo c52c2738ab fix potential underflow 2021-07-26 18:38:42 +03:00
vyzo 18caefc4a1 fix missing object condition; short-circuit walk 2021-07-26 18:34:05 +03:00
vyzo 0fd8fc24e1 load a full finality worth of state during warmup 2021-07-26 18:34:05 +03:00
Aayush Rajasekaran 104626acb7 ValidateBlock: Assert that block header height's are greater than their parents 2021-07-26 11:09:23 -04:00
Anton EvangelatovandAayush Rajasekaran 9d61f91cdf Update cmd/lotus-shed/market.go
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-07-26 16:41:22 +02:00
Jakub Sztandera 7de866d881 lint = happy
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-07-26 16:39:12 +02:00
aarshkshah1992 50e1dc6b6e bubble up markets and dagstore changes for m1.1 2021-07-26 19:44:59 +05:30
Łukasz Magiera 11d3f19a5b Merge pull request #6857 from filecoin-project/mg/feat/graceful-lite-api-w-missing-methods
feat: Don't panic when api impl is nil
2021-07-26 14:26:26 +02:00
vyzo 938330e6c3 moveMx is not an RWMutex, just a regular mutex 2021-07-26 15:09:31 +03:00
vyzo aa0bd51b2c thread GCFrequency option into the splitstore config 2021-07-26 15:05:57 +03:00
vyzo 20f93a520f make cfgdoc-gen 2021-07-26 15:05:57 +03:00
vyzo 4cdb34e448 add docstrings for splitstore config 2021-07-26 15:05:57 +03:00
vyzo 21e7c188da use CollectGarbage in blockstore move test, as it is the real interface 2021-07-26 15:05:57 +03:00
vyzo b1f60e85e9 document moving GC frequency option in README 2021-07-26 15:05:57 +03:00
vyzo 5acae50e07 add config option for splitstore moving gc frequency 2021-07-26 15:05:57 +03:00
vyzo fb3986226f do hotstore moving GC in splitstore with a user-specified frequency 2021-07-26 15:05:57 +03:00
vyzo c747f2f1e2 do moving GC if the user asks for it 2021-07-26 15:05:57 +03:00
vyzo a843665132 add options to BlockstoreGC trait 2021-07-26 15:05:57 +03:00
vyzo 94509968a0 make moveTo a private method 2021-07-26 15:05:20 +03:00
vyzo 5cf6fdf81d don't heap allocate the cond, just set L 2021-07-26 15:04:46 +03:00
vyzo 524564e2cf add some more logging around move 2021-07-26 15:04:46 +03:00
vyzo f2c7b08be5 follow symbolic links when deleting old dbs 2021-07-26 15:04:46 +03:00
vyzo 608a9f84d2 fix copy: flush discards the transaction 2021-07-26 15:04:46 +03:00
vyzo 4b0b37a4ef fix lint
the great spellchecker strikes again
2021-07-26 15:04:46 +03:00
vyzo 4715b1f436 fix lotus-shed 2021-07-26 15:04:46 +03:00
vyzo aec126879e add MoveTo test 2021-07-26 15:04:46 +03:00
vyzo 001c04f2dd use pooled slices for the copy 2021-07-26 15:04:46 +03:00
vyzo b741d61b20 implement BlockstoreMover in badger 2021-07-26 15:04:46 +03:00
Mike Greenberg 76a9f4241b feat: Graceful error when api impl is nil 2021-07-26 13:51:37 +02:00
Łukasz Magiera 5048c3f717 Merge pull request #6811 from filecoin-project/feat/splitstore-shed-utils
splitstore shed utils
2021-07-26 13:44:27 +02:00
vyzo 1f6935f8c4 make gen 2021-07-26 12:15:01 +03:00
vyzo 3c409d5023 require admin for running checks on the splitstore. 2021-07-26 12:13:41 +03:00
vyzo 2cfd73c879 manually compute size when badger is being stupid 2021-07-26 09:46:21 +03:00
vyzo 74009bd67f document lotus-shed splitstore utiilities in the README 2021-07-26 08:52:32 +03:00
vyzo 221dc7024f add splitstore info command 2021-07-26 08:47:02 +03:00
vyzo ce528a1293 implement Info in splitstore 2021-07-26 08:45:46 +03:00
vyzo 30e4b405b7 implement BlockstoreSize for badger 2021-07-26 08:43:09 +03:00
vyzo baaa9a7738 add BlockstoreSize trait for reporting size 2021-07-26 08:42:54 +03:00
vyzo 77604db716 make gen 2021-07-26 08:33:25 +03:00
vyzo a0d6fdba33 add ChainBlockstoreInfo APIv1 endpoint 2021-07-26 08:30:07 +03:00
vyzo c00b86e8a8 stop the walk on missing references 2021-07-25 13:42:20 +03:00
vyzo 2dc72d5849 satisfy linter who wants to be a spell checker in comments 2021-07-25 11:47:21 +03:00
vyzo 5285a14d27 write check summary at the end 2021-07-25 11:42:13 +03:00
vyzo 5718da237f handle newlines consistently in check output 2021-07-25 11:30:58 +03:00
vyzo 21bb2bda09 make gen 2021-07-25 11:25:29 +03:00
vyzo 5b2e4d8ad4 add permission tag to ChainCheckBlockstore API 2021-07-25 11:24:06 +03:00
vyzo c99dc3e811 add splitstore check command 2021-07-25 11:24:06 +03:00
vyzo 3d2ae433ee add ChainCheckBlockstore API 2021-07-25 11:14:48 +03:00
vyzo 1918ffda4e implement splitstore check 2021-07-25 10:35:37 +03:00
vyzo e317c831a8 quiet excessive badger logs 2021-07-25 09:07:27 +03:00
vyzo ce6f410f2a add options to control compaction/gc of the coldstore and config rewrite during rollback 2021-07-25 09:01:34 +03:00
vyzoandraulk 254c489164 fix typo
Co-authored-by: raulk <raul@protocol.ai>
2021-07-25 09:01:34 +03:00
vyzoandraulk 33cdc90f13 fix typo
Co-authored-by: raulk <raul@protocol.ai>
2021-07-25 09:01:34 +03:00
vyzo da66e7a878 fix typo 2021-07-25 09:01:34 +03:00
vyzo e696a2c0cc fix newline in progres message 2021-07-25 09:01:34 +03:00
vyzo 36b209ca5c compact and gc coldstore after copying 2021-07-25 09:01:34 +03:00
vyzo 92b9d8c895 quiet linter 2021-07-25 09:01:34 +03:00
vyzo 0c68bccbda add splitstore rollback lotus-shed command 2021-07-25 09:01:34 +03:00
whyrusleeping 78f94c4c6b This pulls in forgotten parts properly implementing PR#5988
( previous testing focused exclusively on offline dealflow .cars )

Allows a workflow of:

~$ dd if=/dev/urandom bs=1M count=1 | ~/go-ipfs/cmd/ipfs/ipfs add --pin=false
added QmcFLqjyh2kvixuuvxgNUoHy55Rb6N6uuSq4CNfvtPoTJ2 QmcFLqjyh2kvixuuvxgNUoHy55Rb6N6uuSq4CNfvtPoTJ2

~$ ~/go-ipfs/cmd/ipfs/ipfs dag export QmcFLqjyh2kvixuuvxgNUoHy55Rb6N6uuSq4CNfvtPoTJ2 > test_mib.car

~$ lotus client import --car ~/test_mib.car
Import 2, Root QmcFLqjyh2kvixuuvxgNUoHy55Rb6N6uuSq4CNfvtPoTJ2

~$ ~/go/bin/stream-commp -p $(( 256 * 1024 * 1024 )) < test_mib.car
CommP:    54e4e75ddc3fffa8fd33d3ededc06e564603ac0fe62543ec6463d51b553be40b
CommPCid: baga6ea4seaqfjzhhlxod775i7uz5h3pnybxfmrqdvqh6mjkd5rsghvi3ku56icy
Raw bytes:           1049073 bytes
Unpadded piece:    266338304 bytes
Padded piece:      268435456 bytes
CARv1 detected in stream:
Blocks:         5
Roots:          1
    1: QmcFLqjyh2kvixuuvxgNUoHy55Rb6N6uuSq4CNfvtPoTJ2

~$ curl http://127.0.0.1:1234/rpc/v0 -X POST -H "Authorization: Bearer $(cat ~/.lotus/token)" -H "Content-Type: application/json" --data '
  { "jsonrpc": "2.0", "id":1, "method": "Filecoin.ClientStartDeal", "params": [
    {
      "Wallet":"t01004",
      "Miner":"t01005",
      "EpochPrice":"0",
      "MinBlocksDuration":518400,
      "Data": {
        "Root":{ "/":"QmcFLqjyh2kvixuuvxgNUoHy55Rb6N6uuSq4CNfvtPoTJ2" },
        "PieceCid":{ "/":"baga6ea4seaqfjzhhlxod775i7uz5h3pnybxfmrqdvqh6mjkd5rsghvi3ku56icy" },
        "PieceSize": 266338304
      }
    }
  ] }
'

~$ ~/go/bin/stream-commp -p $(( 128 * 1024 * 1024 )) < test_mib.car
CommP:    ed904105399ed346f6b03844abc14710a1748854c2781824d6bd1100e63b1807
CommPCid: baga6ea4seaqo3ecbau4z5u2g62ydqrflyfdrbilurbkme6ayetll2eia4y5rqby
Raw bytes:           1049073 bytes
Unpadded piece:    133169152 bytes
Padded piece:      134217728 bytes
CARv1 detected in stream:
Blocks:         5
Roots:          1
    1: QmcFLqjyh2kvixuuvxgNUoHy55Rb6N6uuSq4CNfvtPoTJ2

~$ curl http://127.0.0.1:1234/rpc/v0 -X POST -H "Authorization: Bearer $(cat ~/.lotus/token)" -H "Content-Type: application/json" --data '
  { "jsonrpc": "2.0", "id":1, "method": "Filecoin.ClientStatelessDeal", "params": [
    {
      "Wallet":"t01004",
      "Miner":"t01005",
      "EpochPrice":"0",
      "ProviderCollateral":"0",
      "MinBlocksDuration":518400,
      "Data": {
        "TransferType": "manual",
        "Root":{ "/":"QmcFLqjyh2kvixuuvxgNUoHy55Rb6N6uuSq4CNfvtPoTJ2" },
        "PieceCid":{ "/":"baga6ea4seaqo3ecbau4z5u2g62ydqrflyfdrbilurbkme6ayetll2eia4y5rqby" },
        "PieceSize": 133169152
      }
    }
  ] }
'
{"jsonrpc":"2.0","result":{"/":"bafyreianhjvev3w6q5lteap3h7tkxbe2jaobwlsi7vzbcoobjpicg3foqi"},"id":1}

~$ lotus-miner storage-deals import-data bafyreianhjvev3w6q5lteap3h7tkxbe2jaobwlsi7vzbcoobjpicg3foqi ~/test_mib.car
2021-07-24 18:17:13 +02:00
Peter Rabbitson 8d873e3edc Tests for online and offline dealpadding
Also bump the times on several flaky tests that can not complete in time
on a typical laptop ( and fail half the time on CircleCI )
2021-07-24 17:46:04 +02:00
Raúl Kripalani 8693df4656 fix racy TestSimultanenousTransferLimit. 2021-07-24 12:53:56 +01:00
Peter Rabbitson 2edf7fd25b Rewire itest's StartDeal to take the full API struct
This allows one to use the harness for much more versatile deal conditions
2021-07-24 04:17:42 +02:00
Jennifer Wang 5cb7411c2a docs fix 2021-07-23 19:11:26 -04:00
Jennifer Wang 7832545b7a Rebase onto master 2021-07-23 19:09:28 -04:00
Jakub Sztandera e615eecbea Skip also set sectors
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-07-23 19:01:50 -04:00
Jakub Sztandera 39cc536115 Add sectors vis
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-07-23 19:01:48 -04:00
Jennifer Wang f09c4733ad Fix links in issue templates 2021-07-23 18:39:41 -04:00
Jennifer d14b84cd11 Merge pull request #6856 from filecoin-project/misc/m1-form
Update issue templates and add templates for M1
2021-07-23 18:35:37 -04:00
Jennifer Wang 816ee0b004 Update issue templates and add templates for M1 2021-07-23 18:32:54 -04:00
Łukasz Magiera 02a37a1e22 Merge pull request #6833 from filecoin-project/feat/splitstore-badger-markset
Splitstore: support on-disk marksets using badger
2021-07-23 19:56:54 +02:00
Łukasz Magiera 5b4d5c2eb4 Merge branch 'master' into feat/splitstore-badger-markset 2021-07-23 19:37:45 +02:00
Łukasz Magiera 964df1a2ec Merge pull request #6848 from filecoin-project/feat/config-ux
Config UX improvements
2021-07-23 19:35:22 +02:00
Łukasz Magiera 91c6aca7e7 config: Add newlines consistently 2021-07-23 16:59:55 +02:00
Łukasz Magiera 80af6de316 config: Add note on codegen to types.go 2021-07-23 16:02:45 +02:00
Łukasz Magiera ac2a1bfeab fix lint 2021-07-23 15:53:31 +02:00
Łukasz Magiera 4b8a5068bd cli docsgen 2021-07-23 15:44:52 +02:00
Łukasz Magiera a26712ebc4 config: Bring some docs from filecoin-docs 2021-07-23 15:40:40 +02:00
vyzo d6ebead756 add comment about the necessity of FileIO 2021-07-23 16:30:55 +03:00
vyzo 1480c22447 improve README 2021-07-23 16:27:09 +03:00
Łukasz Magiera ed7f70e68e config doc gen: generate formatted code 2021-07-23 15:18:20 +02:00
Łukasz Magiera 3f4973cb41 config: Fix doc finding logic 2021-07-23 15:17:22 +02:00
Łukasz Magiera 4757b014bc Nicer lotus-miner config commands 2021-07-23 14:57:42 +02:00
Łukasz Magiera 8b1f19e94c Move doc-comment logic to the config pkg 2021-07-23 14:55:19 +02:00
Łukasz Magiera 97f5bb66c7 config: doc struct codegen 2021-07-23 13:55:50 +02:00
Łukasz Magiera cf65804883 lotus daemon config utils 2021-07-23 13:09:03 +02:00
vyzo 9faa3d5fd7 adjust compaction test with badger to hit the db 2021-07-23 12:47:18 +03:00
vyzo 9d5cf4177b add splitstore compaction test with badger markset 2021-07-23 12:47:18 +03:00
vyzo dec5e13c85 update README with configuration options 2021-07-23 12:47:18 +03:00
vyzo a8c0fd1654 tweak badger options 2021-07-23 12:47:18 +03:00
vyzo 4df6073382 some tweaks in badger markset 2021-07-23 12:47:18 +03:00
vyzo f492f8d450 track in flight writes in badger markste, as they happen outside the lock 2021-07-23 12:47:18 +03:00
vyzo f75d982c76 remove early occurs check from trackTxnRef
this happens inline, and it might block when using the badger markset
2021-07-23 12:47:18 +03:00
vyzo 2891a31c99 make badger markset concurrent close safe 2021-07-23 12:47:18 +03:00
vyzo f2b7c3e6f2 reduce scope of exclusive lock in badger markset 2021-07-23 12:47:18 +03:00
vyzo 12c3432b8d document the "badger" markset type option 2021-07-23 12:47:18 +03:00
vyzo be9530b66e finetune badger options 2021-07-23 12:47:18 +03:00
vyzo 2c26abc551 add badger markset test 2021-07-23 12:47:18 +03:00
vyzo 54a6968327 add badger-backed markset implementation 2021-07-23 12:47:18 +03:00
Łukasz Magiera db39323390 Merge pull request #6724 from filecoin-project/raulk/merge-gs-fix
fix deal concurrency test failures by upgrading graphsync and others
2021-07-23 11:20:04 +02:00
Łukasz Magiera d3564cc2a3 Merge branch 'master' into raulk/merge-gs-fix 2021-07-23 10:50:51 +02:00
Dirk McCormick 52498f78a1 feat: add import market datastore cmd 2021-07-23 10:30:58 +02:00
Dirk McCormick 7ef167b04f refactor: simplify market datastore backup 2021-07-23 09:33:26 +02:00
Jennifer b79690cef4 Merge pull request #6798 from filecoin-project/misc/issueform
Update issue templates to forms
2021-07-23 01:07:02 -04:00
Jennifer Wang e41bc229e3 Address the feedbacks 2021-07-23 00:36:31 -04:00
Jennifer Wang bda25dd6f2 Use forms for creating lotus issues. 2021-07-23 00:36:31 -04:00
Jennifer 19048e6a91 Merge pull request #6837 from Digital-MOB-Filecoin/master
Nerpa v13 upgrade
2021-07-22 23:56:09 -04:00
Raúl Kripalani 21f9dc8096 update graphsync to an actual release. 2021-07-22 23:47:47 +01:00
raulk 4ffbb03a82 Merge branch 'master' into raulk/merge-gs-fix 2021-07-22 23:37:17 +01:00
Cory Schwartz c08e547efa Merge pull request #6544 from filecoin-project/feat/docker-compose
add docker-compose file
2021-07-22 14:34:25 -07:00
Cory Schwartz f68b43a526 make work with go gen 2021-07-22 14:15:27 -07:00
Cory Schwartz ab02ca7e38 Merge branch 'master' into feat/docker-compose 2021-07-22 12:42:58 -07:00
Łukasz Magiera 0f21fcc87e Merge pull request #6841 from filecoin-project/fix/splitstore-warmup
fix warmup by decoupling state from message receipt walk
2021-07-22 21:22:06 +02:00
vyzo 5266b240b8 coalesce message and message receipt retention 2021-07-22 22:02:29 +03:00
vyzo 2a68ae8dad fix warmup by decoupling state from message receipt walk 2021-07-22 20:49:36 +03:00
Łukasz Magiera 2d40089b7e Merge pull request #4640 from filecoin-project/feat/compact-sectors-numbers-cmd
add a command for compacting sector numbers bitfield
2021-07-22 19:16:14 +02:00
Łukasz Magiera f9752d8a0a Merge branch 'master' into feat/compact-sectors-numbers-cmd 2021-07-22 19:00:33 +02:00
Anton Evangelatov adba595350 commit from @dirkmc - initial export cmd for martkers related metadata 2021-07-22 18:41:57 +02:00
Łukasz Magiera 15a6995cda fix lint 2021-07-22 16:31:04 +02:00
ZenGround0 e6eb51b2d5 Merge pull request #6766 from filecoin-project/feat/fix-pricelist
PriceListByVersion
2021-07-22 10:22:36 -04:00
Łukasz Magiera 0656b62176 Merge remote-tracking branch 'origin/master' into feat/compact-sectors-numbers-cmd 2021-07-22 16:04:25 +02:00
ZenGround0 e647d9913e Merge branch 'master' into feat/fix-pricelist 2021-07-22 09:52:45 -04:00
Łukasz Magiera 604e972e6e Merge pull request #5183 from filcloud/make-app
easy way to make install app
2021-07-22 15:51:43 +02:00
ZenGround0 c130d2cb87 Rebase fix 2021-07-22 09:50:43 -04:00
ZenGround0 3155609304 Finalize deps + fix after rebase 2021-07-22 09:49:56 -04:00
ZenGround0 09adc4d5e2 make docsgen changes 2021-07-22 09:49:47 -04:00
ZenGround0 fe5e1b23d5 Update api version to account for new network version 6.5 + new underlying repr 2021-07-22 09:49:47 -04:00
ZenGround0 d6a8a7aeb8 Remove validation because of sync TestDrandNull test 2021-07-22 09:49:47 -04:00
ZenGround0 4cd05fa39c Lint 2021-07-22 09:49:47 -04:00
ZenGround0 ed844c5283 Use current ntwk version in mpool message check 2021-07-22 09:49:47 -04:00
ZenGround0 9fc4a25bd1 Fix tests with bad network version refs 2021-07-22 09:49:47 -04:00
ZenGround0 56d71a190f Update versions to have more digits 2021-07-22 09:49:47 -04:00
ZenGround0 cbc07cb939 Add 6.5 to VersionForNetwork commit updated docs 2021-07-22 09:49:47 -04:00
ZenGround0 545cc723e0 Fix test 2021-07-22 09:49:47 -04:00
ZenGround0 aff7200b3e Add missing upgrade height 2021-07-22 09:49:47 -04:00
ZenGround0 47b5afa84b Add version six and a half 2021-07-22 09:49:47 -04:00
ZenGround0 f49a8248f0 PriceListByVersion 2021-07-22 09:49:47 -04:00
Łukasz Magiera 90ad0d85a5 Merge pull request #6627 from filecoin-project/feat/split-net-api
api: Separate the Net interface from Common
2021-07-22 15:48:28 +02:00
Łukasz Magiera 660829703a Merge remote-tracking branch 'origin/master' into feat/split-net-api 2021-07-22 15:38:06 +02:00
Liviu Damian e64626cdf3 Nerpa v13 upgrade 2021-07-22 16:31:28 +03:00
Aarsh Shah 48e8f54c6a Merge pull request #6835 from filecoin-project/feat/dag-store-ds
Create DAG store datastore under DAG store dir
2021-07-22 17:34:44 +05:30
Dirk McCormick 776c216072 feat: create DAG store datastore under DAG store dir 2021-07-22 13:58:25 +02:00
Łukasz Magiera 3006dda786 Merge pull request #6760 from ipfs-force-community/feat/cache_blkmsg_events
cache loaded block messages
2021-07-22 13:54:51 +02:00
Łukasz Magiera 1ebfc74657 Merge pull request #6805 from filecoin-project/fix/new-rand
fix: on randomness change, use new rand
2021-07-22 13:54:37 +02:00
Łukasz Magiera 4fc1dfacb4 Merge branch 'master' into fix/new-rand 2021-07-22 13:42:34 +02:00
Łukasz Magiera 0c02207fc9 Merge pull request #6775 from filecoin-project/feat/splitstore-hot-messages
Splitstore: add retention policy option for keeping messages in the hotstore
2021-07-22 13:41:45 +02:00
Łukasz Magiera da5aeda197 Merge branch 'master' into feat/splitstore-hot-messages 2021-07-22 12:58:06 +02:00
Łukasz Magiera 91107df701 Merge branch 'master' into fix/new-rand 2021-07-22 12:51:05 +02:00
Łukasz Magiera c8776d74ec Merge pull request #6817 from filecoin-project/feat/sync-less_chainstore
Introduce the LOTUS_CHAIN_BADGERSTORE_DISABLE_FSYNC envvar
2021-07-22 11:55:04 +02:00
Łukasz Magiera 9a12247840 Merge pull request #6818 from filecoin-project/feat/gateway-read-state
add StateReadState to gateway api
2021-07-22 11:52:14 +02:00
Łukasz Magiera bf066403e8 Merge branch 'master' into feat/gateway-read-state 2021-07-22 11:29:00 +02:00
Łukasz Magiera c9bc247732 api gen 2021-07-22 11:23:43 +02:00
Łukasz Magiera a3687a6cfa Merge pull request #6815 from filecoin-project/nonsense/add-sealproof-in-sectorbuilder-master
add SealProof in SectorBuilder
2021-07-22 11:21:06 +02:00
Łukasz Magiera e7f39a3179 Merge branch 'master' into nonsense/add-sealproof-in-sectorbuilder-master 2021-07-22 11:11:28 +02:00
Anton Evangelatov c60959ea9f fetch peer id from chain 2021-07-22 10:50:55 +02:00
Aarsh Shah 62044c34b1 Merge pull request #6826 from filecoin-project/fix/dagstore-wrapper-bugs
Fix bugs in the DAGStore wrapper
2021-07-22 11:30:38 +05:30
Jennifer ab4093fea0 Merge pull request #6828 from filecoin-project/misc/merge-release
release -> master
2021-07-22 01:51:54 -04:00
Jennifer Wang dfa57ffbc1 Merge branch 'master' into misc/merge-release 2021-07-22 01:49:16 -04:00
Jennifer 4b6258f2a2 Update CHANGELOG.md 2021-07-22 01:29:53 -04:00
JenniferandAayush Rajasekaran f972021b23 Update CHANGELOG.md
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-07-22 01:29:53 -04:00
JenniferandAayush Rajasekaran 8bf06bacfa Update CHANGELOG.md
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-07-22 01:29:53 -04:00
JenniferandŁukasz Magiera 067b45d9ab Update CHANGELOG.md
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-07-22 01:29:53 -04:00
Jennifer Wang 7531e543f3 bump the version to v1.10.1 2021-07-22 01:29:53 -04:00
aarshkshah1992 c8d328d386 fix bugs in the dagstore wrapper 2021-07-22 09:44:14 +05:30
whyrusleeping d89e2f065c add StateReadState to gateway api 2021-07-21 17:21:28 -07:00
Peter Rabbitson 4830a3406b Introduce the LOTUS_CHAIN_BADGERSTORE_DISABLE_FSYNC envvar
Allows the user to control the opts.SyncWrites option of BadgerDs
2021-07-21 22:38:14 +02:00
aarshkshah1992 fd879e0426 update ds 2021-07-22 00:21:39 +05:30
aarshkshah1992 27f3170022 update dagstore 2021-07-21 23:38:22 +05:30
aarshkshah1992 5b1241d213 fix dagstore errors 2021-07-21 23:15:39 +05:30
aarshkshah1992 eaee1578dd log more 2021-07-21 22:47:31 +05:30
aarshkshah1992 9e5c5b624b update dagstore logs 2021-07-21 22:22:26 +05:30
aarshkshah1992 640d69f5cb update dagstire 2021-07-21 21:54:28 +05:30
aarshkshah1992 36876c2601 update deps 2021-07-21 20:50:47 +05:30
Dirk McCormick 39c1594505 feat: add logs to wrapper load shard 2021-07-21 17:18:23 +02:00
Aarsh Shah 86e1c854fa Merge pull request #6814 from filecoin-project/nonsense/add-sealproof-in-sectorbuilder
add SealProof in sector builder
2021-07-21 20:44:01 +05:30
Anton Evangelatov 9ad408a0ba add SealProof in sector builder 2021-07-21 16:45:57 +02:00
Anton Evangelatov 1af89236da add SealProof in sector builder 2021-07-21 15:49:45 +02:00
Łukasz Magiera 90c8891f95 Merge pull request #6763 from filecoin-project/johnli-helloworld-fix/fsm-error
sealing: Handle preCommitParams errors more correctly
2021-07-21 15:18:29 +02:00
Łukasz Magiera 0236f2ec5d Merge pull request #6802 from filecoin-project/fix/6786-rest
fix: always check if StateSearchMessage returns nil
2021-07-21 15:05:57 +02:00
Łukasz Magiera c29f375a7a Merge pull request #6807 from filecoin-project/nonsense/fetch-peerid-from-chain
ClientFindData: always fetch peer id from chain
2021-07-21 15:04:25 +02:00
aarshkshah1992 9741867426 remove dev.gen 2021-07-21 17:55:53 +05:30
Aarsh Shah b7b98f94a6 Delete localnet.json 2021-07-21 17:50:52 +05:30
Aarsh Shah fb50d68c32 Merge pull request #6812 from filecoin-project/fix/ensure-mount-started
Ensure piece store starts before calling lotus accessor methods
2021-07-21 17:49:35 +05:30
aarshkshah1992 692961e019 fix error handling 2021-07-21 17:49:09 +05:30
aarshkshah1992 312cc94e6d Merge branch 'feat/replace-multistore-carv2' of github.com:filecoin-project/lotus into feat/replace-multistore-carv2 2021-07-21 17:42:52 +05:30
aarshkshah1992 ea71e4de60 update dagstore fix 2021-07-21 17:42:19 +05:30
aarshkshah1992 4ed9cd152c fix lotus accessor startup 2021-07-21 17:34:07 +05:30
Dirk McCormick 0dbb1940f0 fix: ensure piece store starts before calling lotus accessor methods 2021-07-21 13:31:20 +02:00
raulk 9d0596e6e8 Merge branch 'master' into nonsense/fetch-peerid-from-chain 2021-07-21 11:56:06 +01:00
Steven Allen 29195470d6 Merge pull request #6804 from filecoin-project/fix/flaky-window-post-test
test: fix flaky window post tests
2021-07-21 03:41:36 -07:00
Jakub Sztandera 2c5a867eab Merge branch 'master' into fix/6786-rest 2021-07-21 12:39:31 +02:00
dirkmc 1452a361a9 Merge pull request #6809 from filecoin-project/fix/dagstore-tests
fix dagstore tests
2021-07-21 12:24:53 +02:00
Dirk McCormick 503c08f999 fix: dagstore tests 2021-07-21 12:23:55 +02:00
aarshkshah1992 6bee14d6fa update dagstore and markets 2021-07-21 15:34:38 +05:30
dirkmc 839abdf910 Merge pull request #6808 from filecoin-project/fix/wait-piece-store-start
Wait for piece store to start before starting DAG store wrapper
2021-07-21 11:57:31 +02:00
Dirk McCormick 6057f2e6d9 fix: wait for piece store to start before starting DAG store wrapper 2021-07-21 11:56:48 +02:00
Anton Evangelatov fe31956713 fetch peer id from chain 2021-07-21 11:43:19 +02:00
aarshkshah1992 213dbc6bc8 update dagstore 2021-07-21 14:54:33 +05:30
Aarsh Shah fc77705229 Merge pull request #6806 from filecoin-project/fix/lotus-mount-caps
capitalize lotus mount fields for deserialization
2021-07-21 14:24:11 +05:30
Dirk McCormick 12d7db4efb fix: capitalize lotus mount fields for deserialization 2021-07-21 10:45:14 +02:00
aarshkshah1992 d7827da5bb update deps 2021-07-21 09:30:33 +05:30
Steven Allen c49dbf0999 fix: on randomness change, use new rand 2021-07-20 20:19:36 -07:00
Łukasz Magiera 8029a9ffe3 sealing: Address riview on preCommitParams send fix 2021-07-20 17:46:19 -07:00
johnli-helloworld aea338ecf0 fix handleSubmitPreCommitBatch() preCommitParams error 2021-07-20 17:46:19 -07:00
Steven Allen 38919f59ad test: fix flaky window post tests
Wait until the network upgrade is finished. If we try to seal while it's
happening, we have a few annoying edge cases that can fail if we try to
submit some messages right on the upgrade epoch (which is why everyone
turns that kind of stuff off for the upgrade epoch).
2021-07-20 16:31:14 -07:00
raulk c1f0ebbefa Merge pull request #6800 from filecoin-project/nonsense/fix-double-close-panic 2021-07-21 00:02:12 +01:00
Raúl Kripalani 8413c080e3 add godocs. 2021-07-20 15:43:03 -07:00
Anton Evangelatov cd4571f0b0 wrap close(wait) with sync.Once to avoid panic 2021-07-20 15:43:03 -07:00
Cory Schwartz 6c6df04112 publish to dockerhub circleci 2021-07-20 15:23:29 -07:00
Steven Allen 8ddd12d144 Merge pull request #6787 from xloem/fix/deal-segfault
fixes #6786 segfault
2021-07-20 13:53:26 -07:00
Steven Allen 865e7ca80a test(sealing): test message not found 2021-07-20 12:09:50 -07:00
Steven Allen f9c759fcb2 fix: always check if StateSearchMessage returns nil
It returns nil on "not found".

Fixes the cases not covered in:
https://github.com/filecoin-project/lotus/pull/6787
2021-07-20 11:28:27 -07:00
Steven Allen ad1dd36193 fix: better error message on missing message 2021-07-20 11:20:45 -07:00
xloem e0208e3595 fixes #6786 segfault 2021-07-20 11:20:45 -07:00
Steven Allen 591320dd44 Merge pull request #6777 from filecoin-project/feat/splitstore-protect
Splitstore: add support for protecting out of chain references in the blockstore
2021-07-20 11:11:45 -07:00
raulk bd7aa99175 Merge pull request #6770 from filecoin-project/raulk/merge-gs-fix-simultaneous-fix 2021-07-20 17:51:24 +01:00
Raúl Kripalani 5e66960ab6 fix merge error. 2021-07-20 17:51:09 +01:00
raulk 353ccf0c55 Merge branch 'raulk/merge-gs-fix' into raulk/merge-gs-fix-simultaneous-fix 2021-07-20 17:37:51 +01:00
Aarsh Shah b2ff2edd0c Merge branch 'master' into feat/replace-multistore-carv2 2021-07-20 22:03:18 +05:30
aarshkshah1992 13e845ae51 fix import test 2021-07-20 21:47:55 +05:30
aarshkshah1992 0c90868929 get it compiling 2021-07-20 21:44:25 +05:30
Aarsh Shah 44496afc66 Merge pull request #6793 from filecoin-project/refactor/mv-lotus-mount
move lotus mount, dag store etc from markets to lotus
2021-07-20 20:33:46 +05:30
Raúl Kripalani c1b304b633 update graphsync. 2021-07-20 15:43:44 +01:00
Raúl Kripalani 546d192439 Merge branch 'master' into raulk/merge-gs-fix-simultaneous-fix 2021-07-20 15:31:40 +01:00
Dirk McCormick 8becd922cf test: for dag store wrapper 2021-07-20 15:05:08 +02:00
Dirk McCormick 16be5b5478 fix: add comment about car path 2021-07-20 12:52:45 +02:00
Dirk McCormick 1e7095995b refactor: use concrete type in DI for dag store wrapper 2021-07-20 12:45:20 +02:00
Dirk McCormick ffb995035f feat: log trace events 2021-07-20 12:37:52 +02:00
Dirk McCormick ffe7185443 fix: simplify recover shard processing 2021-07-20 11:50:40 +02:00
Dirk McCormick 44036d9a4a fix: address review comments 2021-07-20 11:04:47 +02:00
vyzo c9930cb7db disable flaky test 2021-07-20 09:49:22 +03:00
vyzo 839b00ab40 rename messagepool ProtectMessages to ForEachPendingMessage 2021-07-20 09:23:36 +03:00
vyzo c47fce8d2d test protector support 2021-07-20 09:02:45 +03:00
vyzo ebbaf23af8 support out-of-chain reference protection 2021-07-20 09:02:40 +03:00
Cory Schwartz 4a93e3b8a8 Merge branch 'master' into feat/docker-compose 2021-07-19 14:41:15 -07:00
Dirk McCormick b6a7a8c987 refactor: move lotus mount, dag store etc from markets to lotus 2021-07-19 15:53:34 +02:00
aarshkshah1992 905592a3dc integrate unsealing changes with Lotus 2021-07-19 16:12:58 +05:30
hunjixin eef3fd5d7a cache loaded block messages 2021-07-19 15:13:53 +08:00
Aayush Rajasekaran 1c30d07d68 Merge pull request #6773 from filecoin-project/biglep/codeowners
Resurrect CODEOWNERS, but for maintainers group
2021-07-18 10:27:17 -04:00
vyzo 006050ed27 implement hotstore message retention policy 2021-07-17 08:59:43 +03:00
Steve Loeppky d8431da9b9 Resurrect CODEOWNERS, but for maintainers group
Per updated CR policies for this repo, we want non-draft PRs to be assigned to the filecoin-project/lotus-maintainers team.
2021-07-16 22:53:26 -07:00
vyzo 1b77361301 add option for hotstore message retention 2021-07-17 08:35:35 +03:00
hannahhoward 3b4df5e10d fix(itests): fix simultaneous transfer logic
limit parallelism on client side and also fix the issue with how ongoing transfers are detected
2021-07-16 11:46:03 -07:00
Raúl Kripalani 089bcceb33 remove test concurrency guardrails. 2021-07-16 19:09:56 +01:00
Raúl Kripalani 9042429abd Merge branch 'master' into raulk/merge-gs-fix 2021-07-16 18:19:50 +01:00
Raúl Kripalani aeb8e57eef use https://github.com/ipfs/go-graphsync/pull/176. 2021-07-16 18:17:34 +01:00
Raúl Kripalani b2feb7e960 upgrade go-fil-markets, go-data-transfer; add logging. 2021-07-16 17:30:45 +01:00
Łukasz Magiera d5c9cccf21 address net interface split review 2021-07-15 15:51:47 +02:00
Łukasz Magiera b20581bac2 api: check that only the top-level internal struct gets picked up 2021-07-15 15:45:41 +02:00
aarshkshah1992 9724248a49 update lotus soup go mod 2021-07-15 18:33:15 +05:30
Łukasz Magiera fd9f5dc83c Merge pull request #6764 from filecoin-project/deps/update-pubsub
update go-libp2p-pubsub to v0.5.0
2021-07-15 14:58:52 +02:00
aarshkshah1992 ed058ae193 update go mod 2021-07-15 18:21:35 +05:30
aarshkshah1992 ca5a2eaa74 update lotus soup and address nit 2021-07-15 18:08:41 +05:30
aarshkshah1992 35b39063ac add tests and merge master 2021-07-15 17:50:35 +05:30
vyzo 1d9dcef878 update go-libp2p-pubsub to v0.5.0 2021-07-15 15:07:14 +03:00
Łukasz Magiera 25cd577d06 Merge pull request #6762 from filecoin-project/feat/splitstore-exposed
Implement exposed splitstore
2021-07-15 13:11:45 +02:00
vyzo e003203bea implement exposed splitstore 2021-07-15 13:12:10 +03:00
Łukasz Magiera 812dc266cf builder: Don't require specific NetAPI impl in StorageMinerAPI 2021-07-15 12:01:13 +02:00
Łukasz Magiera 49e26cce7d api: Separate the Net interface from Common 2021-07-15 11:41:30 +02:00
aarshkshah1992 33c347956c rebased and fixed tests 2021-07-15 14:47:10 +05:30
Łukasz Magiera f07a370711 Merge pull request #6642 from hunjixin/feat/add_getmessagesints_api
Add ChainGetMessagesInTipset API
2021-07-15 11:12:51 +02:00
Łukasz Magiera a03c5ac3d2 Merge pull request #6758 from filecoin-project/test/deflake-fork-refuse-call
test: handle null blocks in TestForkRefuseCall
2021-07-15 11:01:15 +02:00
aarshkshah1992 a259ee307f resolve conflicts 2021-07-15 14:27:48 +05:30
aarshkshah1992 46b78406b1 replace badger in storage client 2021-07-15 14:26:02 +05:30
Łukasz Magiera ab2f159d54 Merge pull request #6757 from filecoin-project/jennijuju-patch-1
Master disclaimer
2021-07-15 10:37:55 +02:00
hunjixin d023026cb0 fix confilct 2021-07-15 14:55:03 +08:00
hunjixin b2f8b4011a fix imports 2021-07-15 14:52:12 +08:00
hunjixin 3e9ec01d04 rm fmt 2021-07-15 14:52:12 +08:00
hunjixin a48a6a168a add test for new api 2021-07-15 14:52:12 +08:00
hunjixin ac03c01e4a test for messages in tipset 2021-07-15 14:52:12 +08:00
hunjixin bdaa73a413 add ChainGetMessagesInTipset api 2021-07-15 14:52:09 +08:00
Steven Allen cf81c897df test: handle null blocks in TestForkRefuseCall
Otherwise, this fails on rare occasions.
2021-07-14 17:41:24 -07:00
Steven Allen 81d614a607 Merge pull request #6756 from filecoin-project/feat/splitstore-reorg
Splitstore code reorg
2021-07-14 16:57:11 -07:00
Jennifer 5e5b4b7191 Update README.md 2021-07-14 19:07:02 -04:00
Jennifer dd0f4dea81 Update README.md 2021-07-14 18:32:17 -04:00
Steven Allen c738d1f7ef Merge pull request #6747 from filecoin-project/action/stale
Create stale.yml
2021-07-14 13:50:38 -07:00
vyzo 5a23f64b3b code reorg: break splitstore.go into smaller logical units 2021-07-14 13:11:15 -07:00
Steven Allen 44d01712c8 Merge pull request #6754 from filecoin-project/feat/splitstore-refactor
Splitstore: Some small fixes
2021-07-14 13:09:59 -07:00
vyzo 3f3a12b75c remove BlockstoreMover interface
we decided it's premature
2021-07-14 22:59:53 +03:00
vyzo 023146803d use Broadcast for view barrier 2021-07-14 22:59:53 +03:00
vyzo 3d77ae1f4d make trackTxnRefMany consistent with trackTxnRef 2021-07-14 22:59:53 +03:00
vyzo 6f126c80bf remove redundant log, more descriptive error message for closing condition 2021-07-14 22:59:53 +03:00
vyzo ff093fae00 use a missing compactionIndex as an indicator for warmup
so that splitstore v0 nodes upgrading will get a fresh warmup.
2021-07-14 22:59:53 +03:00
vyzo 669b47cfc9 do moving gc for hotstore every 20 compactions
that's about once a week
2021-07-14 22:59:53 +03:00
vyzo 818b8de182 keep track of the compaction serial (index)
it is useful so that:
- we only do slow (but very effective) moving gc every 10 compactions
- we can detect a splitstore v0 upgrade and re-warm up
2021-07-14 22:59:53 +03:00
vyzo c93328b036 use the new traits for hotstore gc 2021-07-14 22:59:52 +03:00
vyzo 35180b4761 merge Compact and CollectGarbage in badger 2021-07-14 22:59:52 +03:00
vyzo dc81c0e6a2 add blockstore traits related to gc 2021-07-14 22:59:52 +03:00
Łukasz Magiera f0c9e4e8f2 Merge pull request #6746 from filecoin-project/chore/add_power_to_shed_storage-stats 2021-07-14 11:54:43 +02:00
Jennifer 71ddbdaf10 Update stale.yml 2021-07-14 02:52:39 -04:00
Jennifer 856cbb2ca0 Create stale.yml
Mark any issue thats labeled with `hint/needs-author-input` and has no activity more than 5 days as stale and give a 24 hours notice before closing.
2021-07-14 02:50:18 -04:00
Peter Rabbitson a37ababc20 Minor rearrange 2021-07-14 08:32:07 +02:00
Peter Rabbitson 677c193e6c Add current power to the stats 2021-07-14 08:11:23 +02:00
Łukasz Magiera dd09666399 Merge pull request #6743 from filecoin-project/chore/centralize_all_cli_color_handling
Handle the --color flag via proper global state
2021-07-13 17:34:25 +02:00
Łukasz Magiera 583a8a13d9 Merge pull request #6629 from filecoin-project/feat/pledge-from-miner-balance
Config for collateral from miner available balance
2021-07-13 17:22:00 +02:00
Łukasz Magiera 837322ea59 Merge pull request #6356 from filecoin-project/nonsense/split-market-miner-processes
Support standalone miner-market process
2021-07-13 17:16:07 +02:00
Łukasz Magiera 0678b3fa05 sealing: Cleanup DisableCollateralFallback handling 2021-07-13 17:06:41 +02:00
Łukasz Magiera 7526a074d9 sealing: collateral buffer / falback config 2021-07-13 17:04:58 +02:00
Anton Evangelatov 2af02af1c1 rename --name to --type; provide empty stores.StorageConfig when init new service 2021-07-13 12:57:43 +02:00
Łukasz Magiera c37401a1a3 Merge pull request #6474 from filecoin-project/feat/splitstore-redux
Splitstore Enhanchements
2021-07-13 12:43:57 +02:00
Peter Rabbitson 6efd2e7335 Handle the --color flag via proper global state
Use `color.NoColor` as a global progressively modified as one descends
down command flags. Allows non-surprising operation when --color is
accepted at multiple layers, and even makes this behave predictably:

    lotus-miner --color actor control list --color=false
2021-07-13 12:22:29 +02:00
vyzo af399529ec finetune view waiting 2021-07-13 09:06:40 +03:00
vyzo 257423e917 fix view waiting issues with the WaitGroup
We can add after Wait is called, which is problematic with WaitGroups.
This instead uses a mx/cond combo and waits while the count is > 0.
The only downside is that we might needlessly wait for (a bunch) of views
that started while the txn is active, but we can live with that.
2021-07-13 09:01:50 +03:00
Steven Allen 04abd190ab nit: remove useless goto
Because stebalien has allergies.
2021-07-12 21:46:50 -07:00
vyzo 60212c86cb put a mutex around HeadChange 2021-07-13 03:14:13 +03:00
vyzo 759594d01c always return the waitgroup in protectView
so that we preclude the following scenario:
    Start compaction.
    Start view.
    Finish compaction.
    Start compaction.

which would not wait for the view to complete.
2021-07-13 03:11:40 +03:00
raulk 5c3e79e8d0 Merge pull request #6739 from filecoin-project/fix/cancel-stops-retrieval 2021-07-12 23:22:35 +01:00
hannahhoward 92ec239202 fix(node): ClientRetrieve stops on cancel
When a deal is cancelled, any in progress calls to ClientRetrieve or ClientRetrieveWithEvents should
return
2021-07-12 14:46:18 -07:00
Łukasz Magiera 4433c3cd7c Merge pull request #6708 from filecoin-project/feat/miner-info-deals
Add more deal details to lotus-miner info
2021-07-12 22:18:56 +02:00
Anton Evangelatov 7728d6bfc3 remove --enable-markets flag; add --name string slice flag 2021-07-12 14:38:29 +02:00
Łukasz Magiera 83f2368507 Add CollateralFromMinerBalance config 2021-07-12 14:11:58 +02:00
Anton Evangelatov 4bc9fa04ba rename cfg.Subsystems.EnableStorageMarket to EnableMarkets 2021-07-12 12:12:29 +02:00
Anton Evangelatov 056136ef5a rename argument from url to apiInfo 2021-07-12 11:36:22 +02:00
Anton Evangelatov a423c46f2a rename mock.go to net.go 2021-07-12 11:35:03 +02:00
Anton Evangelatov d89ddb9315 resolve conflicts 2021-07-12 11:34:37 +02:00
Anton Evangelatov 16784aa2cc remove pieceProvider from DI; small refactors 2021-07-12 11:30:26 +02:00
Aayush Rajasekaran 88ac2ebc0c Merge pull request #6710 from filecoin-project/arajasek-patch-1
Release template: Update all testnet infra at once
2021-07-11 17:26:43 -04:00
Aayush Rajasekaran 13dcfec8fe Release template: Update all testnet infra at once 2021-07-11 17:26:21 -04:00
Aayush Rajasekaran 20582037c5 Fix Lotus shed 2021-07-11 14:03:22 -04:00
Aayush Rajasekaran e983d90a28 Merge pull request #6066 from chadwick2143/extend-v1-sectors
Fix bugs in sectors extend --v1-sectors
2021-07-11 13:19:35 -04:00
Aayush Rajasekaran ea9ad8c5a8 Update cmd/lotus-storage-miner/sectors.go 2021-07-11 13:01:19 -04:00
Aayush Rajasekaran 93d929a10a Merge pull request #5950 from zgfzgf/feat-shed-election-backtest
add election backtest
2021-07-11 12:08:21 -04:00
vyzo df9670c58d fix lint 2021-07-10 16:38:40 +03:00
vyzo 0c5e336ff1 address review comments 2021-07-10 16:30:27 +03:00
Raúl Kripalani cbf281d1ca go mod tidy. 2021-07-10 10:49:37 +01:00
Raúl Kripalani 71ddf73f44 check if merging ipfs/go-graphsync#177 fixes deal concurrency. 2021-07-10 10:48:18 +01:00
Aayush Rajasekaran f7f5fd4809 Merge pull request #6620 from filecoin-project/asr/no-filter
Envvar to disable slash filter
2021-07-09 17:12:16 -04:00
Aayush RajasekaranandPeter Rabbitson dff097a992 Update miner/miner.go
Co-authored-by: Peter Rabbitson <ribasushi@protocol.ai>
2021-07-09 17:07:23 -04:00
vyzo 870a47f55d handle id cids in internal versions of view/get 2021-07-09 20:07:17 +03:00
vyzo f5ae10e3d1 refactor debug log code to eliminate duplication 2021-07-09 19:53:51 +03:00
vyzo 41290383e2 fix test 2021-07-09 19:24:44 +03:00
vyzo b9a5ea8f7b update wording around discard store 2021-07-09 19:23:55 +03:00
vyzo c0a1cfffa1 rename noopstore to discardstore 2021-07-09 19:19:37 +03:00
vyzo 18161fee38 remove unused lookback constructs 2021-07-09 19:12:58 +03:00
vyzo 095d7427ba make view protection optimistic again, as there is a race window 2021-07-09 15:41:10 +03:00
vyzo da0feb3fa4 dont mark references inline; instad rely on the main compaction thread to do concurrent marking
The problem is that it is possible that an inline marking might take minutes for some objects
(infrequent, but still possible for state roots and prohibitive if that's a block validation).
So we simply track references continuously and rely on the main compaction thread to trigger
concurrent marking for all references at opportune moments.

Assumption: we can mark references faster than they are created during purge or else we'll
never purge anything.
2021-07-09 15:10:02 +03:00
vyzo acc4c374ef properly handle protecting long-running views 2021-07-09 13:20:18 +03:00
Dirk McCormick 872843e491 feat: integrate dag store into lotus 2021-07-09 10:59:10 +02:00
vyzo 565faff754 fix test 2021-07-09 11:38:09 +03:00
vyzo 4f89d260b0 kill isOldBlockHeader; it's dangerous. 2021-07-09 11:35:10 +03:00
vyzo de5e21bf1a correctly handle identity cids 2021-07-09 11:31:04 +03:00
vyzo 909f7039d4 make badger Close-safe 2021-07-09 09:54:12 +03:00
vyzo abdf4a161a explicitly switch marksets for concurrent marking
this has very noticeable impact in initial marking time; it also allows us
to get rid of the confusing ts monikers.
2021-07-09 04:26:36 +03:00
Łukasz Magiera 77a1a8a23f Merge pull request #6709 from filecoin-project/arajasek-patch-1
Release Template: remove binary validation step
2021-07-08 20:45:49 +02:00
Aayush Rajasekaran dbc721af3a Release Template: remove binary validation step 2021-07-08 14:45:24 -04:00
vyzo b6611125b6 add environment variables to turn on the debug log without recompiling 2021-07-08 21:30:39 +03:00
vyzo 60dd97c7fc fix potential deadlock in View
As pointed out by magik, it is possible to deadlock if the view callback performs
a blockstore operation while a Lock is pending.
This fixes the issue by optimistically tracking the reference before actually calling
the underlying View and limiting the scope of the lock.
2021-07-08 21:18:59 +03:00
Łukasz Magiera 44e81424f2 Print completed deal stats in miner info 2021-07-08 19:40:05 +02:00
Łukasz Magiera ed0cc0b56d Handle bad peerIDs in MarketListRetrievalDeals 2021-07-08 19:27:03 +02:00
Łukasz Magiera 10825e3a95 Add more info about deals to miner info 2021-07-08 19:02:18 +02:00
Łukasz Magiera 8f7bf1df86 Merge pull request #6697 from filecoin-project/feat/dealpublish-ctl-config
Config for deal publishing control addresses
2021-07-08 19:00:29 +02:00
Łukasz Magiera 79b0bfb272 policy: Add a docstring to SetProviderCollateralSupplyTarget 2021-07-08 18:56:03 +02:00
vyzoandŁukasz Magiera c0537848b3 fix typo
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-07-08 17:54:16 +03:00
vyzoandŁukasz Magiera fa30ac8c5d fix typo
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-07-08 17:53:59 +03:00
Łukasz Magiera 616fcb974c Merge pull request #6689 from filecoin-project/reset/interopnet
Reset of the interop network
2021-07-08 15:53:24 +02:00
vyzo 00d7772f57 move check for closure in walkChain
so that we don't do it too often and also cover warmup.
2021-07-08 13:12:19 +03:00
Łukasz Magiera e258e7c353 Merge pull request #6696 from filecoin-project/chore/even-less-color-on-cli
Enable color by default only if os.Stdout is a TTY
2021-07-08 12:05:10 +02:00
vyzo 5cf1e09e81 README: add instructions for how to enable 2021-07-08 13:00:31 +03:00
vyzo 9aa4f3b3b2 add README for documentation 2021-07-08 12:32:41 +03:00
Peter Rabbitson 4dd59b566c Respect GOLOG_LOG_FMT=color 2021-07-08 10:44:37 +02:00
Peter Rabbitson 140a2e0200 Stabilize default text and make gen docsgen-cli 2021-07-08 10:44:13 +02:00
vyzo e6eacbdd56 use RW mutexes in marksets 2021-07-08 10:20:29 +03:00
vyzo 48f13a43b7 intelligently close marksets and signal errors in concurrent operations 2021-07-08 10:18:43 +03:00
vyzo f5c45bd517 check the closing state variable often
so that we have a reasonably quick graceful shutdown
2021-07-08 10:13:44 +03:00
Łukasz Magiera 9bdea91a70 itests: Some kit cleanup 2021-07-07 21:40:44 +02:00
vyzo 4f808367f8 fix lint 2021-07-07 21:32:58 +03:00
vyzo fee50b13a2 check the closing state on each batch during the purge. 2021-07-07 21:32:05 +03:00
vyzo c6421f8a75 don't nil the mark sets on close, it's dangerous.
a concurrent marking can panic.
2021-07-07 21:27:36 +03:00
Łukasz Magiera d0e87a7487 dealpublisher: Fix provider address checks 2021-07-07 20:06:49 +02:00
Łukasz Magiera 2dc27d6ab4 itests: Fix deal provider collateral flakiness 2021-07-07 19:41:46 +02:00
Łukasz Magiera ee97aa0a8a dealpublisher: Use address selector 2021-07-07 19:12:03 +02:00
Peter Rabbitson c7bb326c78 Enable color by default only if os.Stdout is a TTY 2021-07-07 18:12:24 +02:00
Łukasz Magiera 8f5c0c60f5 Config for deal publishing control addresses 2021-07-07 18:00:54 +02:00
Anton Evangelatov 82efe01c70 fixup 2021-07-07 18:00:28 +02:00
Anton Evangelatov bb466ede66 fix cast on role_miner in testground lotus-soup plan 2021-07-07 16:04:01 +02:00
vyzo aec2ba2c82 nil map/bf on markset close 2021-07-07 16:46:14 +03:00
vyzo ec586a852a remove bbolt dependency from go.mod 2021-07-07 16:41:11 +03:00
vyzo 451ddf50ab RIP bbolt-backed markset 2021-07-07 16:39:37 +03:00
vyzo 9dbb2e0abd don't leak tracking errors through the API 2021-07-07 16:34:02 +03:00
Łukasz Magiera 49896afe9f Merge pull request #6694 from filecoin-project/chore/no-unexpected-color
Stop outputing ANSI color on non-TTY
2021-07-07 15:04:44 +02:00
Anton Evangelatov 1fe08f5973 refactor testkit in lotus-soup to include Subsystems when instantiating miner 2021-07-07 14:21:28 +02:00
Anton Evangelatov 6b014f57e5 pass Subsystems to StorageMiner option; add enableLibp2p bool in Settings 2021-07-07 13:56:37 +02:00
Anton Evangelatov caa366bc6a variadic WithSubsystems 2021-07-07 13:35:40 +02:00
Anton Evangelatov 42ae876711 remove ApplyIfEnableLibP2P 2021-07-07 13:31:56 +02:00
aarshkshah1992 a5ba556fff fix lint 2021-07-07 14:47:00 +05:30
aarshkshah1992 44d088be1e use filestore to create the Unixfs dag 2021-07-07 14:43:12 +05:30
Peter Rabbitson dcfbb1998f Stop outputing ANSI color on non-TTY
No more stuff like: https://circleci.com/gh/filecoin-project/lotus/189136
2021-07-07 11:06:20 +02:00
aarshkshah1992 b40985a57c Merge remote-tracking branch 'origin/nonsense/split-market-miner-processes' into feat/replace-multistore-carv2 2021-07-07 14:11:55 +05:30
aarshkshah1992 f8d32f5328 changes as per review 2021-07-07 14:10:59 +05:30
vyzo 83c30dc4c0 protect assignment of warmup epoch with the mutex 2021-07-07 11:31:27 +03:00
vyzo 6cc2112749 remove the curTs state variable; we don't need it 2021-07-07 09:55:25 +03:00
vyzo 05dbbe9681 rename som Txn methods for better readability 2021-07-07 09:52:31 +03:00
aarshkshah1992 ba236fe258 have a typed importID 2021-07-07 12:02:48 +05:30
aarshkshah1992 2b5164c956 Merge remote-tracking branch 'origin/feat/replace-multistore-carv2-rtrvl-pr' into feat/replace-multistore-carv2 2021-07-07 11:11:53 +05:30
aarshkshah1992 ca2d441b6d integrate dagstore 2021-07-07 11:11:29 +05:30
vyzo 90da6227b3 transactional protect incoming tipsets 2021-07-07 02:11:37 +03:00
vyzo 0e2af11f6a prepare the transaction before launching the compaction goroutine 2021-07-07 01:39:58 +03:00
Łukasz Magiera 88c578bc54 Merge pull request #6690 from filecoin-project/fix-gate-dollar
add dollar sign
2021-07-06 22:56:42 +02:00
Cory Schwartz f268068457 add dollar sign 2021-07-06 13:29:49 -07:00
Łukasz Magiera 251214dfd9 Merge pull request #6681 from jimpick/patch-1
get-actor cli spelling fix
2021-07-06 21:05:40 +02:00
Jim Pick a8ca7baa93 Run make docsgen-cli 2021-07-06 18:16:06 +00:00
Travis Person 9977a6d1d7 Add genesis for interop network 2021-07-06 17:06:55 +00:00
Travis Person 9d6d1f5715 Reset interop network 2021-07-06 17:06:55 +00:00
Anton Evangelatov 566a9d5541 fix signature 2021-07-06 18:12:30 +02:00
Łukasz Magiera 9f83da836d Merge pull request #6688 from turuslan/fix/seed-car
fix "lotus-seed genesis car" error "merkledag: not found"
2021-07-06 17:59:54 +02:00
Anton Evangelatov 2a7af38538 fix testServ to Start with correct listener 2021-07-06 17:57:08 +02:00
Anton Evangelatov 7a78527fde remove not used sa; cleanup 2021-07-06 17:46:21 +02:00
Anton Evangelatov b572c2b7bc fix IsUnsealed 2021-07-06 17:40:03 +02:00
Anton Evangelatov 10dc90f7fe addressing comments 2021-07-06 17:33:47 +02:00
Anton EvangelatovandŁukasz Magiera 898687ea2e Update node/modules/storageminer.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-07-06 17:28:52 +02:00
Anton EvangelatovandŁukasz Magiera 8cf3accc53 Update itests/kit/ensemble.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-07-06 17:25:33 +02:00
Anton EvangelatovandŁukasz Magiera 604be5fc82 Update extern/sector-storage/stores/remote.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-07-06 17:24:56 +02:00
Anton Evangelatov 51696bb35d fix SectorsStatus to query full node for on-chain data 2021-07-06 16:34:07 +02:00
vyzo f2f4af669d clean up: simplify debug log, get rid of ugly debug log 2021-07-06 17:13:38 +03:00
Anton Evangelatov ff2772a58c resolved conflicts 2021-07-06 16:00:41 +02:00
Anton Evangelatov 9839d5701b fix SectorsStatus to query full node for on-chain data 2021-07-06 15:41:14 +02:00
vyzo c1c25868cc improve comments 2021-07-06 15:09:04 +03:00
vyzo fdff1bebc9 move map markset implementation to its own file 2021-07-06 14:44:40 +03:00
vyzo 5c514504f7 remove unused GetGenesis method from ChainAccessor interface 2021-07-06 14:41:41 +03:00
vyzo dc8139a1d2 add some comments for debug only code 2021-07-06 13:23:12 +03:00
turuslan 8697edc8b7 fix "lotus-seed car" error "merkledag: not found" 2021-07-06 12:54:09 +03:00
Dirk McCormick bed4c03a50 feat: integrate go-fil-markets#560 2021-07-06 11:09:05 +02:00
aarshkshah1992 e041fe130b tests for storage client import impls 2021-07-06 12:40:57 +05:30
vyzo c4ae3e0c3d minor tweak 2021-07-06 09:17:35 +03:00
vyzo 169ab262f5 really optimize computing object weights
sort is still taking a long time, this should be as fast as it gets.
2021-07-06 09:02:44 +03:00
vyzo 55a9e0ccd1 short-circuit block headers on sort weight computation 2021-07-06 08:22:43 +03:00
vyzo bf7aeb3167 optimize sort a tad
it's taking a long time to compute weights...
2021-07-06 08:10:57 +03:00
vyzo 0659235e21 cache cid strings in sort
so as to avoid making a gazillion of strings
2021-07-06 07:26:13 +03:00
aarshkshah1992 a07a0935fe fix bug in CAR generation 2021-07-06 09:31:52 +05:30
vyzo 525a2c71dd use hashes as keys in weight map to avoid duplicate work
otherwise the root object will be raw, but internal references will be dag; duplicate work.
2021-07-06 01:27:56 +03:00
vyzo c6ad8fdaed use walkObjectRaw for computing object weights
cids that come out of the hotstore with ForEach are raw.
2021-07-06 01:08:44 +03:00
vyzo 2cbd3faf5a make sure to nil everything in txnEndProtect 2021-07-05 23:56:31 +03:00
vyzo 51ab891d5c quiet linter
it's a false positive, function doesn't escape.
2021-07-05 23:53:45 +03:00
vyzo bd436ab9de make endTxnProtect idempotent 2021-07-05 23:51:10 +03:00
vyzo e859942fa4 code cleanup: refactor txn state code into their own functions 2021-07-05 23:31:37 +03:00
vyzo 3477d265c6 unify the two marksets
really, it's concurrent marking and there is no reason to have two different marksets
2021-07-05 20:10:47 +03:00
Łukasz Magiera 97207df705 Merge pull request #6639 from filecoin-project/frrist/context-in-statetree-diff
polish(statetree): accept a context in statetree diff for timeouts
2021-07-05 17:30:31 +02:00
vyzo 73d07999bf dont needlessly wait 1 min in first retry for missing refs 2021-07-05 18:24:48 +03:00
vyzo af8cf712be handle all missing refs together
so that we wait 6min at most, not 12.
2021-07-05 18:16:54 +03:00
Jim Pick 17c0b9be44 Spelling fix
Change 'actorr' to 'actor'
2021-07-05 07:44:06 -07:00
Łukasz Magiera d76cbf805a Merge pull request #6672 from filecoin-project/asr/nit
Add helptext to lotus chain export
2021-07-05 16:22:16 +02:00
Łukasz Magiera 5e5de9b41b Merge pull request #6679 from filecoin-project/fix/get-retrieval-pricing-input-error
Get retrieval pricing input should not error out on a deal state fetch
2021-07-05 16:18:48 +02:00
Łukasz Magiera a56b6fea99 Merge pull request #6680 from filecoin-project/chore/double-encoded-cid
Fix more CID double-encoding as hex
2021-07-05 16:14:52 +02:00
vyzo 5a099b7d05 more commentary on the missing refs situation 2021-07-05 16:12:17 +03:00
vyzo 59639a0788 reinstate some better code for handling missing references. 2021-07-05 16:08:08 +03:00
Anton Evangelatov 5a87f04e71 fix finalize sectors early test 2021-07-05 13:36:23 +02:00
vyzo fa195bede2 get rid of ugly missing reference handling code
those missing objects don't seem to ever get there, are they from an abandoned fork?
2021-07-05 14:29:55 +03:00
Anton Evangelatov 4be0a7a215 resolve conflicts with master 2021-07-05 13:13:32 +02:00
Peter Rabbitson a544fa0f97 Fix more CID doucle-encoding as hex 2021-07-05 12:51:15 +02:00
aarshkshah1992 add113f585 use multierror 2021-07-05 16:08:51 +05:30
vyzo 59936ef468 fix log 2021-07-05 13:30:31 +03:00
aarshkshah1992 44985722d2 changes as per review 2021-07-05 15:53:41 +05:30
vyzo 0b7153be86 use internal version of has for occurs checks 2021-07-05 12:41:11 +03:00
vyzo d8b8d75e0f readd minute delay before trying for missing objects 2021-07-05 12:38:09 +03:00
vyzo d7709deb2b reduce memory pressure from marksets when the size is decreased 2021-07-05 11:51:22 +03:00
vyzo 3ec834b2e3 improve logs and error messages 2021-07-05 11:41:09 +03:00
vyzo 918a7ec749 a bit more fil commitment short-circuiting 2021-07-05 11:38:53 +03:00
vyzo 2ea2abc07d short-circuit fil commitments
they don't make it to the blockstore anyway
2021-07-05 11:32:52 +03:00
vyzo 839f7bd2b5 only occur check for DAGs 2021-07-05 11:11:08 +03:00
vyzo c81ae5fc20 add some comments about the missing business and anothre log 2021-07-05 10:42:14 +03:00
vyzo 4c41f52828 add warning for missing objects for marking for debug purposes 2021-07-05 10:35:04 +03:00
vyzo 3597192d58 remove the sleeps and busy loop more times when waiting for missing objects 2021-07-05 10:31:47 +03:00
vyzo 1726eb993c deal with incomplete objects that need to be marked and protected
seems that something is writing DAGs before its consituents, which causes problems.
2021-07-05 10:22:52 +03:00
aarshkshah1992 8ecdc929b4 get retrieval pricing input should not error out on a deal state fetch 2021-07-05 09:34:56 +05:30
vyzo db53859e7a reduce CompactionThreshold to 5 finalities
so that we run compaction every finality, once we've first compacted
2021-07-04 22:12:51 +03:00
vyzo b08e0b7102 fix lint 2021-07-04 21:24:15 +03:00
vyzo 94efae419e reduce length of critical section
Just the purge; the rest is not critical -- e.g. it's ok if we do some duplicate copies
to the coldstore, we'll have gc soon.
2021-07-04 21:21:53 +03:00
vyzo f33d4e79aa simplify transactional protection logic
Now that we delete objects heaviest first, we don't have to do deep walk and rescan gymnastics.
2021-07-04 20:49:39 +03:00
vyzo 40c271cda1 sort cold objects before deleting
so that we can't shoot ourselves in the foot by deleting the constituents of a DAG while it is
still in the hotstore.
2021-07-04 20:17:07 +03:00
vyzo 13d612f72f smarter trackTxnRefMany 2021-07-04 19:33:49 +03:00
vyzo f124389b66 recursively protect all references 2021-07-04 19:21:00 +03:00
vyzo 4d286da593 fix error message 2021-07-04 18:58:39 +03:00
vyzo 680af8eb09 use deep object walking for more robust handling of transactional references 2021-07-04 18:38:28 +03:00
vyzo 1f02428225 fix lint 2021-07-04 18:38:28 +03:00
vyzo 2c7a89a1db short-circuit rescanning on block headers 2021-07-04 18:38:28 +03:00
vyzo 028a5c4942 make test do something useful again 2021-07-04 18:38:28 +03:00
vyzo 8e56fffb33 walkChain should visit the genesis state root 2021-07-04 18:38:28 +03:00
vyzo 95c3aaec9a fix test 2021-07-04 18:38:28 +03:00
vyzo 190cb18ab0 housekeeping
- remove defunct tracking store implementations
- update splitstore node config
- use mark set type config option (defaulting to mapts); a memory constrained node
  may want to use an on-disk one
2021-07-04 18:38:28 +03:00
vyzo 19d1b1f532 deal with partially written objects 2021-07-04 18:38:28 +03:00
vyzo 0a1d7b3732 fix log 2021-07-04 18:38:28 +03:00
vyzo 08cad30be2 reuse key buffer in badger ForEachKey
cid copies the bytes so it's safe
2021-07-04 18:38:28 +03:00
vyzo eafffc1634 more efficient trackTxnRefMany 2021-07-04 18:38:28 +03:00
vyzo 36f93649ef fix panic from concurrent map writes in txnRefs 2021-07-04 18:38:28 +03:00
vyzo 6fa2cd232d simplify compaction model 2021-07-04 18:38:28 +03:00
vyzo 5f7ae1f489 update splistore DI constructor 2021-07-04 18:38:28 +03:00
vyzo 1f2b604c07 RIP tracking store 2021-07-04 18:38:28 +03:00
vyzo d476a3db2c BlockstoreIterator trait with implementation for badger 2021-07-04 18:38:28 +03:00
vyzo 68a83500bc fix bug that turned candidate filtering to dead code 2021-07-04 18:38:28 +03:00
vyzo 00fcf6dd72 add staging cache to bolt tracking store 2021-07-04 18:38:28 +03:00
vyzo 642f0e4740 deal with memory pressure, don't walk under the boundary 2021-07-04 18:38:28 +03:00
vyzo c5cf8e226b remove unnecessary code 2021-07-04 18:38:28 +03:00
vyzo d79e4da7aa more accurate stats about mark set updates 2021-07-04 18:38:28 +03:00
vyzo 6f58fdcb22 remove vm copy context detection hack
stack tracing is slow.
2021-07-04 18:38:28 +03:00
vyzo 2b03316cd9 fix log message 2021-07-04 18:38:28 +03:00
vyzo 184d3802b6 remove dead code 2021-07-04 18:38:28 +03:00
vyzo 228a435ba7 rework tracking logic; do it lazily and far more efficiently 2021-07-04 18:38:28 +03:00
vyzo 9d6cabd18a if it's not a dag, it's not a block 2021-07-04 18:38:28 +03:00
vyzo 8157f889ce short-circuit marking walks when encountering a block and more efficient walking 2021-07-04 18:38:28 +03:00
vyzo 736d6a3c19 only treat Has as an implicit write within vm.Copy context 2021-07-04 18:38:28 +03:00
vyzo 39723bbe60 use a single map for tracking pending writes, properly track implicits 2021-07-04 18:38:28 +03:00
vyzo 5834231e58 create the transactional protect filter before walking 2021-07-04 18:38:28 +03:00
vyzo e4bb4be855 fix some residual purge races 2021-07-04 18:38:28 +03:00
vyzo 68bc5d2291 skip moving cold blocks when running with a noop coldstore
it is a noop but it still takes (a lot of) time because it has to read all the cold blocks.
2021-07-04 18:38:28 +03:00
vyzo b87295db93 bubble up dependent txn ref errors
This cause Has to return false if it fails to traverse/protect all links, which would cause
the vm to recompute.
2021-07-04 18:38:28 +03:00
vyzo 637fbf6c5b fix faulty if/else logic for implicit txn protection 2021-07-04 18:38:28 +03:00
vyzo 9d6bcd7705 avoid clown shoes: only walk links for tracking in implicit writes/refs 2021-07-04 18:38:28 +03:00
vyzo 484dfaebce reused cidset across all walks when flushing pending writes 2021-07-04 18:38:28 +03:00
vyzo 1d41e1544a optimize transitive write tracking a bit 2021-07-04 18:38:28 +03:00
vyzo da00fc66ee downgrade a couple of logs to warnings 2021-07-04 18:38:28 +03:00
vyzo 4071488ef2 first write, then track 2021-07-04 18:38:28 +03:00
vyzo bd92c230da refactor txn reference tracking, do deep marking of DAGs 2021-07-04 18:38:28 +03:00
vyzo a98a062347 do the dag walk for deep write tracking during flush
avoid crawling everything to a halt
2021-07-04 18:38:28 +03:00
vyzo 13a674330f add pending write check before tracking the object in Has 2021-07-04 18:38:28 +03:00
vyzo 982867317e transitively track dags from implicit writes in Has 2021-07-04 18:38:28 +03:00
vyzo 4de0cd9fcb move write log back to flush so that we don't crawl to a halt 2021-07-04 18:38:28 +03:00
vyzo b3ddaa5f02 fix panic at startup
genesis is written (!) before starting the splitstore, so curTs is nil
2021-07-04 18:38:28 +03:00
vyzo 2faa4aa993 debug log writes at track so that we get correct stack traces 2021-07-04 18:38:28 +03:00
vyzo aeaa59d4b5 move comments about tracking perf issues into a more pertinent place 2021-07-04 18:38:28 +03:00
vyzo 3e8e9273ca track all writes using async batching, not just implicit ones 2021-07-04 18:38:28 +03:00
vyzo d0bfe421b5 flush implicit writes at the right time before starting compaction to avoid races 2021-07-04 18:38:28 +03:00
vyzo 7f473f56eb flush implicit writes before starting compaction 2021-07-04 18:38:28 +03:00
vyzo a29947d47c flush implicit writes in all paths in updateWriteEpoch 2021-07-04 18:38:28 +03:00
vyzo be6cc2c3e6 batch implicit write tracking
bolt performance leaves something to be desired; doing a single Put takes 10ms, about the same time
as batching thousands of them.
2021-07-04 18:38:28 +03:00
vyzo e472cacb3e add missing return 2021-07-04 18:38:28 +03:00
vyzo 6a3cbea790 treat Has as an implicit Write
Rationale: the VM uses the Has check to avoid issuing a duplicate Write in the blockstore.
This means that live objects that would be otherwise written are not actually written, resulting
in the first write epoch being considered the write epoch.
2021-07-04 18:38:28 +03:00
vyzo f97535d87e store the hash in map markset 2021-07-04 18:38:28 +03:00
vyzo 90dc274113 better logging for chain walk 2021-07-04 18:38:28 +03:00
vyzo 40f42db7fa walk tweaks 2021-07-04 18:38:28 +03:00
vyzo 09efed50fd check for lookback references to block headers in walk 2021-07-04 18:38:28 +03:00
vyzo 7de0771883 count txn live objects explicitly for logging 2021-07-04 18:38:28 +03:00
vyzo e29b64c5de check both markset and txn liveset before declaring an object cold 2021-07-04 18:38:28 +03:00
vyzo 4bed3161f0 fix broken purge count log 2021-07-04 18:38:28 +03:00
vyzo 7307eb54dc cache stack repr computation 2021-07-04 18:38:28 +03:00
vyzo 57e25ae1cd use succint timetamp in debug logs 2021-07-04 18:38:28 +03:00
vyzo b2b13bbe89 fix debug panic 2021-07-04 18:38:28 +03:00
vyzo 0b315e97c8 fix index out of range 2021-07-04 18:38:28 +03:00
vyzo dec61fa333 deduplicate stack logs and optionally trace write stacks 2021-07-04 18:38:28 +03:00
vyzo 7ebef6d838 better log message 2021-07-04 18:38:28 +03:00
vyzo 40ff5bf164 log put errors in splitstore log 2021-07-04 18:38:28 +03:00
vyzo 9fda61abec fix error check for unreachable cids 2021-07-04 18:38:28 +03:00
vyzo 4a71c68e06 move code around for better readability 2021-07-04 18:38:28 +03:00
vyzo 31497f4bd3 use internal get during walk to avoid blowing the compaction txn
otherwise the walk itself precludes purge... duh!
2021-07-04 18:38:28 +03:00
vyzo 6af3a23dd4 use a map for txn protection mark set 2021-07-04 18:38:28 +03:00
vyzo 65ccc99e79 minor tweaks in purge
- allocate once
- log purge count
2021-07-04 18:38:28 +03:00
vyzo cb665d07e0 fix transactional race during compaction
It is possible for an object to be written or recreated (and checked with Has)
after the mark completes and during the purge; if this happens we will purge
a live block.
2021-07-04 18:38:28 +03:00
vyzo 649b7dd162 add config option for hot headers 2021-07-04 18:38:28 +03:00
vyzo 50ebaf25aa don't log read misses before warmup 2021-07-04 18:38:28 +03:00
vyzo 375a1790e7 reset counters after flush 2021-07-04 18:38:28 +03:00
vyzo b187b5c301 fix lint 2021-07-04 18:38:28 +03:00
vyzo a53c4e1597 implement debug log 2021-07-04 18:38:28 +03:00
vyzo fce7b8dc9b flush move log when cold collection is done 2021-07-04 18:38:28 +03:00
vyzo fc247e4223 add debug log skeleton 2021-07-04 18:38:28 +03:00
vyzo 0390285c4e always do full walks, not only when there is a sync gap 2021-07-04 18:38:28 +03:00
vyzo 30dbe4978b adjust compaction range 2021-07-04 18:38:28 +03:00
vyzo a21f55919b CompactionThreshold should be 4 finalities
otherwise we'll wear clown shoes with the slack and end up in continuous compaction.
2021-07-04 18:38:28 +03:00
vyzo 79d21489df fix test 2021-07-04 18:38:28 +03:00
vyzo a25ac80777 reintroduce compaction slack 2021-07-04 18:38:28 +03:00
vyzo a178c1fb93 fix test 2021-07-04 18:38:28 +03:00
vyzo c4d95de987 coalesce back-to-back compactions
get rid of the CompactionCold construct, run a single compaction on catch up
2021-07-04 18:38:28 +03:00
vyzo b7897595eb augment current epoch by +1
to account for off by one conditions
2021-07-04 18:38:28 +03:00
vyzo 933c786421 update write epoch in the background every second 2021-07-04 18:38:28 +03:00
vyzo 66f1630f14 fix lint issue 2021-07-04 18:38:28 +03:00
vyzo bb17608ae0 track writeEpoch relative to current wall clock time
The issue: head change notifications are not emitted until after catching up,
which results in all writes during a catch up period being tracked at the base epoch.
2021-07-04 18:38:28 +03:00
vyzo 421f05eab9 save the warm up epoch only if successful in warming up 2021-07-04 18:38:28 +03:00
vyzo 9b6448518c refactor warmup to trigger at startup and not wait for sync 2021-07-04 18:38:28 +03:00
vyzo 3fe4261f12 don't attempt compaction while still syncing 2021-07-04 18:38:28 +03:00
vyzo 7b02673620 don't try to visit genesis parent blocks 2021-07-04 18:38:28 +03:00
vyzo 997f2c098b keep headers hot when running with a noop splitstore 2021-07-04 18:38:28 +03:00
vyzo 7c814cd2e3 refactor genesis state loading code into its own method 2021-07-04 18:38:28 +03:00
vyzo 41573f1fb2 also walk parent message receipts when including messages in the walk 2021-07-04 18:38:28 +03:00
vyzo fa6481401d reduce SyncGapTime to 1 minute
for maximal safety.
2021-07-04 18:38:28 +03:00
vyzo fda291b876 fix test 2021-07-04 18:38:28 +03:00
vyzo d33a44e67f first visit the cid, then short-circuit non dagcbor objects 2021-07-04 18:38:28 +03:00
vyzo bdb97d6186 more robust handling of sync gap walks 2021-07-04 18:38:28 +03:00
vyzo 7cf75e667d keep genesis-linked state hot 2021-07-04 18:38:28 +03:00
vyzo e9f531b4aa don't open bolt tracking store with NoSync, it might get corrupted 2021-07-04 18:38:28 +03:00
Raúl Kripalani b2b7eb2ded metrics: increment misses in View(). 2021-07-04 18:38:28 +03:00
vyzo 3a9b7c592d mark from current epoch to boundary epoch when necessary
this is necessary to avoid wearing clown shoes when the node stays
offline for an extended period of time (more than 1 finality).

Basically it gets quite slow if we do the full 2 finality walk, so we
try to avoid it unless necessary.
The conditions under which a full walk is necessary is if there is a
sync gap (most likely because the node was offline) during which the
tracking of writes is inaccurate because we have not yet delivered the
HeadChange notification.  In this case, it is possible to have
actually hot blocks to be tracked before the boundary and fail to mark
them accordingly.  So when we detect a sync gap, we do the full walk;
if there is no sync gap, we can just use the much faster boundary
epoch walk.
2021-07-04 18:38:28 +03:00
vyzo d7ceef104e decrease CompactionThreshold to 3 finalities 2021-07-04 18:38:28 +03:00
vyzo e3cbeec6ee implement chain walking 2021-07-04 18:38:28 +03:00
vyzo 04f2e102a1 kill full splitstore compaction, simplify splitstore configuration 2021-07-04 18:38:28 +03:00
vyzo 5cca29d1db hook noop blockstore for splitstore in DI 2021-07-04 18:38:28 +03:00
vyzo 4d3c73f4ca noop blockstore 2021-07-04 18:38:28 +03:00
Łukasz Magiera a577bf340e Merge pull request #6675 from filecoin-project/chore/remove_vestigial_replace
Remove leftover from the great de-submoduling
2021-07-04 12:11:54 +02:00
Peter Rabbitson 5c643d6141 Remove leftover from the great de-submoduling
This is no longer used anywhere in lotus
2021-07-04 09:40:47 +02:00
Aayush Rajasekaran 069fd0a244 Add helptext to lotus chain export 2021-07-03 12:41:43 -04:00
aarshkshah1992 de13b6edc5 dont upgrade multihash 2021-07-03 14:26:03 +05:30
aarshkshah1992 303d5d6ff6 removed combined blockstore 2021-07-03 14:12:08 +05:30
aarshkshah1992 40b30d1fb1 remove multistore from Lotus 2021-07-03 14:12:08 +05:30
aarshkshah1992 dae6c757b5 lotus changes for the DAG Store 2021-07-03 14:12:08 +05:30
aarshkshah1992 31ecce3a72 draft lotus storage client CARv2 changes 2021-07-03 14:12:08 +05:30
Cory Schwartz 5a7743214a Merge branch 'master' into feat/docker-compose 2021-07-02 17:00:13 -07:00
Łukasz Magiera 13d4563c25 Merge pull request #6663 from filecoin-project/raulk/test-incremental-nonce
add an incremental nonce itest.
2021-07-02 23:33:52 +02:00
Jennifer Wang 0b5d1551fe format fix and small clarification 2021-07-02 15:53:29 -04:00
Jennifer Wang a06ecde580 recommend to update 2021-07-02 15:33:58 -04:00
Jennifer Wang 94574447e6 Add v1.10.1-rc1 changelog 2021-07-02 15:30:58 -04:00
Łukasz Magiera 29763df433 set version to v1.10.1-rc1 2021-07-02 20:56:09 +02:00
Łukasz Magiera 0511770d53 storage: Fix FinalizeSector with sectors in stoage paths 2021-07-02 20:49:47 +02:00
Łukasz Magiera e2f48b21ab Merge pull request #6653 from filecoin-project/fix/finalize-in-storage
storage: Fix FinalizeSector with sectors in stoage paths
2021-07-02 20:38:25 +02:00
Łukasz Magiera 8a94ab676e storage: Fix FinalizeSector with sectors in stoage paths 2021-07-02 19:54:45 +02:00
Peter Rabbitson ebbfe03831 Fix tiny error in check-client-datacap 2021-07-02 18:24:43 +02:00
Łukasz Magiera bcb839a7d3 Merge pull request #6664 from filecoin-project/chore/fix_check-client-datacap
Fix tiny error in check-client-datacap
2021-07-02 18:24:18 +02:00
Peter Rabbitson 30efcf21f0 Fix tiny error in check-client-datacap 2021-07-02 18:15:08 +02:00
zhoutian527 c5ea17f838 Fix: precommit_batch method used the wrong cfg.PreCommitBatchWait 2021-07-02 18:09:13 +02:00
johnli-helloworld 4fe3ecb8fc to optimize the batchwait 2021-07-02 18:09:05 +02:00
llifezouandŁukasz Magiera db30d891c8 Update extern/storage-sealing/states_sealing.go
fix sector precommitted but expired judgment

Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-07-02 18:05:49 +02:00
llifezouandAayush Rajasekaran 4c3bcd121b Update extern/storage-sealing/states_sealing.go
fix log

Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-07-02 18:05:49 +02:00
llifezou 5aeacd2989 fix getTicket: sector precommitted but expired case 2021-07-02 18:05:49 +02:00
llifezou 504882e162 fix ticket expiration check, otherwise it may cause a large number of loops to retry GetTicket when retrying PreCommit1 2021-07-02 18:05:48 +02:00
Raúl Kripalani ca40234031 update circleci config. 2021-07-02 17:04:57 +01:00
Raúl Kripalani 592b8c4f4a add an incremental nonce itest. 2021-07-02 17:04:13 +01:00
Łukasz Magiera 3370450711 commit batch: Regression test nil FailedSectors map 2021-07-02 18:02:40 +02:00
Łukasz Magiera 6d555c9183 commit batch: AggregateAboveBaseFee config 2021-07-02 18:02:21 +02:00
johnli-helloworld c21e275ebd handleSubmitCommitAggregate() exception handling 2021-07-02 18:01:00 +02:00
Łukasz Magiera ab2503f446 gofmt 2021-07-02 17:59:45 +02:00
wangchao 76fff49266 remove precommit check in handleCommitFailed 2021-07-02 17:59:45 +02:00
Jerry 042166996b ensure agg fee is adequate 2021-07-02 17:58:30 +02:00
Jerry 1a869632f6 fix: miner balance is not enough, so that ProveCommitAggregate msg exec failed 2021-07-02 17:58:30 +02:00
Łukasz Magiera bb2b13430a commit batch: Initialize the FailedSectors map 2021-07-02 17:54:24 +02:00
Łukasz Magiera 38b476c507 set version to v1.10.1-dev 2021-07-02 17:53:36 +02:00
Łukasz Magiera 35c0e3cf8c Merge pull request #6658 from sunday527/master
Fix: precommit_batch method used the wrong cfg.CommitBatchWait
2021-07-02 15:18:48 +02:00
Łukasz Magiera 60ecbdee8f Merge pull request #6635 from llifezou/fix_checkTicketExpired
fix ticket expiration check
2021-07-02 15:18:04 +02:00
Anton Evangelatov adba1a792a add missing err check 2021-07-02 15:15:16 +02:00
Anton Evangelatov e9d0a25436 remove redundant flag from docs 2021-07-02 15:11:57 +02:00
Anton Evangelatov ab6e01e379 remove --enable-markets flag, read from repo 2021-07-02 15:08:25 +02:00
Anton Evangelatov 724f728f60 enable more tests 2021-07-02 14:54:09 +02:00
Anton Evangelatov 8dbae00847 fix lotus-soup 2021-07-02 12:45:56 +02:00
Anton Evangelatov 287e06995a missing flag, that will need to be refactored 2021-07-02 12:41:28 +02:00
Anton Evangelatov 9e85492b85 fix test 2021-07-02 12:24:07 +02:00
Anton Evangelatov 96245c3cfa lint 2021-07-02 12:02:36 +02:00
Anton Evangelatov 4194c7fa24 revert back optional for Miner; remove ActorAddress call in node.MinerHandler 2021-07-02 11:58:31 +02:00
zhoutian527 71e1577a62 Fix: precommit_batch method used the wrong cfg.PreCommitBatchWait 2021-07-02 15:53:21 +08:00
llifezouandŁukasz Magiera df53b97fe4 Update extern/storage-sealing/states_sealing.go
fix sector precommitted but expired judgment

Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-07-02 11:44:46 +08:00
llifezouandAayush Rajasekaran fe3ad4fd60 Update extern/storage-sealing/states_sealing.go
fix log

Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-07-02 11:38:04 +08:00
Łukasz Magiera 20c8250872 Merge pull request #6650 from filecoin-project/feat/agg-balancer-config
commit batch: AggregateAboveBaseFee config
2021-07-01 18:36:12 +02:00
Raúl Kripalani 1869de7662 unwire host from storage.Miner. 2021-07-01 13:53:20 +01:00
Łukasz Magiera 7c2c8b2a95 commit batch: Regression test nil FailedSectors map 2021-07-01 13:51:11 +02:00
Łukasz Magiera c094aa82ec commit batch: AggregateAboveBaseFee config 2021-07-01 13:33:54 +02:00
Łukasz Magiera 98a4be475c Merge pull request #6647 from filecoin-project/fix/nil-failedsectors-map
commit batch: Initialize the FailedSectors map
2021-07-01 12:40:15 +02:00
Łukasz Magiera 88bb9f422e commit batch: Initialize the FailedSectors map 2021-07-01 12:15:58 +02:00
llifezou 73e58f7af1 fix getTicket: sector precommitted but expired case 2021-07-01 10:53:42 +08:00
frrist d02a2a2cfa polish(statetree): accept a context in statetree diff for timeouts
- this operation can take a while, this changes gives users the option
to abort if it takes "too long".
2021-06-30 16:40:43 -07:00
Cory Schwartz d3ff5a2a4f Merge tag 'v1.11.0-rc1' into feat/docker-compose 2021-06-30 15:40:54 -07:00
Aayush RajasekaranandŁukasz Magiera 3091e2a771 Update miner/miner.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-06-30 12:15:43 -04:00
Anton Evangelatov 3aa6d03cc1 connect miner to full node , only when running markets 2021-06-30 16:45:11 +02:00
Łukasz Magiera 6a5b94ca3b Merge pull request #6638 from filecoin-project/feat/fastpath-aggsubmit-retry
Fast-path retry submitting commit aggregate if commit is still valid
2021-06-30 16:39:36 +02:00
johnli-helloworld 229d5e5c80 handleSubmitCommitAggregate() exception handling 2021-06-30 15:29:21 +02:00
Łukasz Magiera 2dad06d59f Merge pull request #6634 from GFZRZK/GFZRZK/correct_check_commit
remove precommit check in handleCommitFailed
2021-06-30 15:23:33 +02:00
Łukasz Magiera f45340461d gofmt 2021-06-30 15:19:29 +02:00
Łukasz Magiera 19a536d869 Merge pull request #6636 from johnli-helloworld/fix/batchwait
Reuse timers in sealing batch logic
2021-06-30 14:42:51 +02:00
Anton Evangelatov 4f0a96c9c7 resolved conflicts 2021-06-30 13:16:52 +02:00
Anton Evangelatov 9ec7cd7239 enable libp2p options 2021-06-30 12:55:43 +02:00
Łukasz Magiera ed2d7964ad Merge pull request #6631 from filecoin-project/feat/shed-agg-fees
shed tool to estimate aggregate network fees
2021-06-30 11:13:19 +02:00
johnli-helloworld b0b070ffe7 to optimize the batchwait 2021-06-30 16:56:40 +08:00
llifezou 3dd3476bfd fix ticket expiration check, otherwise it may cause a large number of loops to retry GetTicket when retrying PreCommit1 2021-06-30 16:32:44 +08:00
wangchao a4342f3997 remove precommit check in handleCommitFailed 2021-06-30 11:09:07 +08:00
Łukasz Magiera 022d4b548a shed tool to estimate aggregate network fees 2021-06-29 20:42:26 +02:00
Łukasz Magiera 49de60d33b Merge pull request #6625 from filecoin-project/firesWu-fix/prove-commit-aggregate
fix prove commit aggregate send token amount
2021-06-29 12:45:08 +02:00
Łukasz Magiera 7b1b082381 Merge branch 'master' into fix/prove-commit-aggregate 2021-06-29 11:48:52 +02:00
Łukasz Magiera 7d4887b1f1 Merge pull request #6621 from filecoin-project/arajasek-patch-1
Update version.go to 1.11.1
2021-06-29 11:31:22 +02:00
Łukasz Magiera df86efbd43 docsgen 2021-06-29 11:27:06 +02:00
Jerry 73704c92ba ensure agg fee is adequate 2021-06-29 14:36:26 +08:00
Jerry 5c3d67a811 fix: miner balance is not enough, so that ProveCommitAggregate msg exec failed 2021-06-29 14:06:41 +08:00
Aayush Rajasekaran 07487b6d20 Update version.go 2021-06-28 22:43:14 -04:00
Aayush Rajasekaran 6bbc5be1bd Lotus version 1.11.0 2021-06-28 22:39:39 -04:00
Aayush Rajasekaran b8866f1d16 Envvar to disable slash filter 2021-06-28 22:00:21 -04:00
Łukasz Magiera ba7e730d24 Merge pull request #6618 from filecoin-project/feat/gateway-version
gateway: Add support for Version method
2021-06-28 20:25:34 +02:00
Łukasz Magiera 49a709a123 Merge pull request #6612 from filecoin-project/feat/miner-par-transfers-cfg
Miner SimultaneousTransfers config
2021-06-28 20:08:35 +02:00
Łukasz Magiera c1303f1eac gateway: Add support for Version method 2021-06-28 19:05:27 +02:00
Łukasz Magiera 69e0dff56c api: Fix Wrap for nested proxy structs 2021-06-28 19:00:37 +02:00
Łukasz Magiera e9dd3e8650 Test Miner SimultaneousTransfers 2021-06-28 18:17:29 +02:00
Łukasz Magiera 37c5dd5afc Miner SimultaneousTransfers config 2021-06-28 14:24:14 +02:00
Łukasz Magiera cefd140e45 Merge pull request #6329 from filecoin-project/raulk/itests-refactor-kit
revamped integration test kit (aka. Operation Sparks Joy)
2021-06-28 13:20:49 +02:00
Łukasz Magiera ed5cd3a6df Merge pull request #6605 from filecoin-project/raulk/fix-downgrade-yamux
downgrade libp2p/go-libp2p-yamux to v0.5.1.
2021-06-26 08:57:21 +02:00
Raúl Kripalani ec69ac0b2c downgrade libp2p/go-libp2p-yamux to v0.5.1. 2021-06-25 22:39:26 +01:00
Łukasz Magiera 39979c07f5 Merge pull request #6594 from filecoin-project/fix/wallet-errors
Fix wallet error messages
2021-06-25 21:43:36 +02:00
Łukasz Magiera c10d99e3fd multiwallet: Don't fail if key is found in any wallet 2021-06-25 12:17:53 +02:00
Łukasz Magiera 3f3336340f Fix wallet error messages 2021-06-25 10:48:47 +02:00
Łukasz Magiera 4e7d17e889 Merge pull request #6589 from filecoin-project/fix/circle-gen
Fix CircleCI gen
2021-06-24 19:59:20 +02:00
Łukasz Magiera 1c025e49c4 Merge pull request #6590 from filecoin-project/asr/query-ask-cli
Make query-ask CLI more graceful
2021-06-24 19:59:08 +02:00
Aayush Rajasekaran cb4d7cb9e7 Make query-ask CLI more graceful 2021-06-24 12:57:54 -04:00
Łukasz Magiera 0517ef260b Fix CircleCI gen 2021-06-24 18:48:12 +02:00
Łukasz Magiera ebd746cdec Merge pull request #6406 from filecoin-project/feat/lotus-sim 2021-06-24 18:20:43 +02:00
Łukasz Magiera f113430f07 Merge pull request #6587 from filecoin-project/appimage-build-ci-fix
move with changed name
2021-06-24 15:52:33 +02:00
Cory Schwartz 3cea8b5e26 .Appimage 2021-06-24 06:39:05 -07:00
Cory Schwartz 2e5e2f4e0e move with changed name 2021-06-24 06:33:32 -07:00
Łukasz Magiera 84dbcb63d2 Merge pull request #6566 from GFZRZK/GFZRZK/correct_sector_expire_time
scale up sector expiration to avoid sector expire in batch-pre-commit waitting
2021-06-24 10:59:49 +02:00
Łukasz Magiera 04b25e09ea Merge pull request #6583 from filecoin-project/chore/merge-release
Merge release branch into master
2021-06-24 10:02:36 +02:00
Łukasz Magiera c3480dc0e8 Merge remote-tracking branch 'origin/releases' into chore/merge-release 2021-06-24 09:39:11 +02:00
Łukasz Magiera 64e05ac57c Merge pull request #6582 from IPFSUnion/master 2021-06-24 08:38:51 +02:00
IPFSUnion 7c07dc9ed1 fix an error in msigLockCancel 2021-06-24 14:07:15 +08:00
Raúl Kripalani 6a48fbbc11 increase suspension threshold to 300. 2021-06-23 19:21:42 +01:00
Raúl Kripalani 58f348cb7f add ability to suspend deal-making until CE is stable. 2021-06-23 19:14:27 +01:00
Raúl Kripalani fa4bcc6054 Merge branch 'master' into raulk/itests-refactor-kit 2021-06-23 18:31:28 +01:00
raulk ae38dfe3b9 Merge pull request #6573 from filecoin-project/fix/make-ci-good
fix circleci being out of sync.
2021-06-23 18:29:58 +01:00
Raúl Kripalani a1e57d35f9 circleci was out of sync. 2021-06-23 18:24:36 +01:00
Łukasz Magiera 643b35c0c9 Merge pull request #6561 from filecoin-project/raulk/circleci-dynamic
dynamic circleci config for streamlining test execution
2021-06-23 19:17:13 +02:00
Raúl Kripalani 9b3188d110 split deals tests. 2021-06-23 18:13:29 +01:00
Raúl Kripalani 779626ceec fix circleci. 2021-06-23 18:05:20 +01:00
Raúl Kripalani ef8f35510d Merge branch 'master' into raulk/itests-refactor-kit 2021-06-23 17:55:06 +01:00
Raúl Kripalani f4d0db83d8 Merge branch 'raulk/circleci-dynamic' into raulk/itests-refactor-kit 2021-06-23 17:33:17 +01:00
Raúl Kripalani f4341409a1 deterministic order for rest unit tests. 2021-06-23 17:08:46 +01:00
Raúl Kripalani 2c605e08f1 Revert "(test) deliberately check in an outdated .circleci/config.yml to test the gen-check CI target."
This reverts commit 6017715fd7.
2021-06-23 16:50:11 +01:00
Raúl Kripalani 0c31676bf8 Makefile: add circleci target as dependency of gen target. 2021-06-23 16:46:13 +01:00
Raúl Kripalani 6017715fd7 (test) deliberately check in an outdated .circleci/config.yml to test the gen-check CI target. 2021-06-23 16:40:20 +01:00
Raúl Kripalani 211751f8b8 declare some tests as expensive. 2021-06-23 16:37:43 +01:00
Aayush Rajasekaran f1ed13d1ef Merge pull request #6571 from filecoin-project/chore/merge-1.10
Merge 1.10 branch into master
2021-06-23 10:10:11 -04:00
Łukasz Magiera fa2be42eb0 Merge remote-tracking branch 'origin/release/v1.10.0' into chore/merge-1.10 2021-06-23 15:51:00 +02:00
Anton Evangelatov a8d5ae5213 enable more tests 2021-06-23 13:39:03 +02:00
Anton Evangelatov 4217ec5308 make auth on remote rpc server optional 2021-06-23 13:27:03 +02:00
Łukasz Magiera 8adfdfb0fb Merge pull request #6560 from filecoin-project/asr/fix-comment
Fix helptext
2021-06-23 12:49:02 +02:00
Anton Evangelatov 21b51328f9 adding TestDealWithMarketAndMinerNode 2021-06-23 12:44:52 +02:00
Anton Evangelatov 99646d209e fix TestFirstDealEnablesMining 2021-06-23 11:56:09 +02:00
Anton Evangelatov 7fb93d4585 refactor kit.NewDealHarness to include main miner and market node 2021-06-23 11:24:55 +02:00
Anton Evangelatov 51a4657ef7 fix SDR test 2021-06-23 11:19:25 +02:00
Anton Evangelatov d98eca7260 Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-miner-processes 2021-06-23 10:58:37 +02:00
wangchao 03261771e2 scale up sector expiration to avoid sector expire in batch-pre-commit waitting 2021-06-23 14:10:28 +08:00
Aayush RajasekaranandJennifer 4af59e0188 Apply suggestions from code review
Co-authored-by: Jennifer <42981373+jennijuju@users.noreply.github.com>
2021-06-22 19:23:24 -04:00
Steven Allen 63e2caae81 lint(lotus-sim): handle error 2021-06-22 15:06:44 -07:00
Steven Allen 87c306fd47 feat(lotus-sim): use current power instead of lookback
I'd _really_ like to use lookback, but don't have that when starting
from a snapshot.
2021-06-22 15:06:30 -07:00
Steven Allen 0b06de2bd3 fix(lotus-sim): unembed Node from Simulation
I wanted to expose the node's _fields_, but this also exposed the
methods. That got rather confusing.

(probably could have used a new type, but eh)

foo
2021-06-22 14:53:06 -07:00
Raúl Kripalani da96414bf8 switch test output format. 2021-06-22 21:39:20 +01:00
Raúl Kripalani b74ad796ce fix dangling import. 2021-06-22 21:39:20 +01:00
Raúl Kripalani c6c202d7d4 add makefile target. 2021-06-22 21:39:20 +01:00
Raúl Kripalani 539f8c1f61 fix test that references private symbols; avoid hacky test selection flags. 2021-06-22 21:39:20 +01:00
Raúl Kripalani ec6c394de7 remove dynamic circleci. 2021-06-22 21:39:20 +01:00
Aayush Rajasekaran 07fad6a201 Fix helptext 2021-06-22 16:02:06 -04:00
Raúl Kripalani 51e51d1b90 dynamic circleci config. 2021-06-22 20:55:10 +01:00
Raúl Kripalani 2e9e1c2330 avoid double BlockMiner instantiation. 2021-06-22 18:15:38 +01:00
Raúl Kripalani 120dd14979 avoid double close. 2021-06-22 17:18:07 +01:00
Raúl Kripalani 9b2efd5ace try to deflake window post itests. 2021-06-22 17:07:14 +01:00
Cory Schwartz accb03719a address some comments 2021-06-22 08:59:43 -07:00
Anton Evangelatov fc7feffaad Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-miner-processes 2021-06-22 17:37:50 +02:00
Raúl Kripalani 098eb6bfff try using bg context on constructor. 2021-06-22 16:36:06 +01:00
Raúl Kripalani 71a7270c98 cleanup gateway RPC. 2021-06-22 16:36:06 +01:00
Raúl Kripalani 2a58f830c0 fix sector_terminate_test.go flakiness. 2021-06-22 16:36:06 +01:00
Anton Evangelatov aa584475cc fix paych and sdr tests 2021-06-22 16:48:07 +02:00
Anton Evangelatov 218c9199f3 fix testNonGenesisMiner 2021-06-22 15:51:50 +02:00
Anton Evangelatov 4f2d8b0a85 add all subsystems to deadlines and wdpost_dispute tests 2021-06-22 15:35:46 +02:00
Anton Evangelatov a828b15fbe revert MockSectorMgr 2021-06-22 15:22:08 +02:00
Anton Evangelatov 9567807144 Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-miner-processes 2021-06-22 14:39:28 +02:00
Dirk McCormick da789939b1 fix: bump blocktime of TestQuotePriceForUnsealedRetrieval to 1 second 2021-06-22 14:33:44 +02:00
Anton Evangelatov e656aad298 regenerate docs 2021-06-22 13:36:24 +02:00
Anton Evangelatov b0d1668ab9 comment out preseal sectors 2021-06-22 13:34:45 +02:00
Anton Evangelatov 00618672f5 policy.SetPreCommitChallengeDelay to reduce WaitSeed stage time 2021-06-22 13:08:36 +02:00
Anton Evangelatov 5e10d53ca8 wip 2021-06-22 12:16:21 +02:00
Anton Evangelatov 6720463799 resolve merge conflicts 2021-06-22 11:28:23 +02:00
Raúl Kripalani bb032b526c switch back to ws API. 2021-06-21 23:24:59 +01:00
Raúl Kripalani 0e2d06fc39 switch to http API. 2021-06-21 23:10:17 +01:00
Raúl Kripalani 502e104e6a typo. 2021-06-21 21:35:39 +01:00
Raúl Kripalani e438ef99f8 fix merge error in window post dispute tests. 2021-06-21 21:25:55 +01:00
Raúl Kripalani e69335b35f Merge branch 'master' into raulk/itests-refactor-kit 2021-06-21 21:21:05 +01:00
Raúl Kripalani 4fcd0b7aca disable resource filtering on scheduler. 2021-06-21 21:20:45 +01:00
Łukasz Magiera 6e1cf6fdc9 Merge pull request #6542 from filecoin-project/raulk/worker-disable-resource-filtering
extern/storage: add ability to ignore worker resources when scheduling.
2021-06-21 22:11:14 +02:00
Raúl Kripalani b7a5e3cd0f Merge branch 'raulk/worker-disable-resource-filtering' into raulk/itests-refactor-kit 2021-06-21 21:09:04 +01:00
Raúl Kripalani c0a8a9f5b5 make gen. 2021-06-21 20:52:59 +01:00
Raúl Kripalani 684cce198f add a unit test. 2021-06-21 20:49:24 +01:00
Raúl Kripalani 59eab2df25 move scheduling filtering logic down. 2021-06-21 20:49:16 +01:00
Cory Schwartz 02f4182749 add docker-compose file 2021-06-21 12:48:07 -07:00
Raúl Kripalani 83839362c5 fix boolean condition. 2021-06-21 20:35:51 +01:00
Raúl Kripalani b6147fb27f extern/storage: retype resource filtering strategy to enum. 2021-06-21 20:28:15 +01:00
Raúl Kripalani f3b6f8de1a add ability to ignore worker resources when scheduling. 2021-06-21 20:08:18 +01:00
Steven Allen b7c36bc02c fix(lotus-sim): make NewNode take a repo
This is primarily for testing, so we can just pass an in-memory repo.
2021-06-21 11:32:19 -07:00
Steven Allen c532b1b819 fix(lotus-sim): remove unused field and function 2021-06-21 11:25:40 -07:00
Steven Allen 80eba1069a feat(lotus-sim): NewNode to construct a node without a repo 2021-06-21 11:25:40 -07:00
Steven Allen b5f9148748 build(lotus-sim): add a makefile target 2021-06-21 11:25:40 -07:00
Steven Allen ffb63a93ff fix(lotus-sim): make 'fund' easier to understand 2021-06-21 11:25:40 -07:00
Raúl Kripalani c22e10c4a4 use mock proofs in TestQuotePriceForUnsealedRetrieval. 2021-06-21 18:29:25 +01:00
Raúl Kripalani 132b49728c Merge branch 'master' into raulk/itests-refactor-kit 2021-06-21 18:26:04 +01:00
Raúl Kripalani 70929a99e6 speed up test. 2021-06-21 18:24:39 +01:00
Raúl Kripalani 00fa3878d4 remove debug statement. 2021-06-21 18:22:08 +01:00
Raúl Kripalani 0879ac496f uncomment lines in TestDealCyclesConcurrent. 2021-06-21 18:21:10 +01:00
Raúl Kripalani 83ee345b1c Merge branch 'master' into raulk/itests-refactor-kit 2021-06-21 18:19:26 +01:00
Steven AllenandŁukasz Magiera d6abcff63c fix(lotus-sim): apply code review from magik6k
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-06-21 09:05:48 -07:00
Łukasz Magiera fa2b247f75 Merge pull request #6540 from filecoin-project/chore/merge-1.10
Merge 1.10 branch into master
2021-06-21 17:19:51 +02:00
Łukasz Magiera b37a66c7c9 Merge remote-tracking branch 'origin/release/v1.10.0' into chore/merge-1.10 2021-06-21 17:03:03 +02:00
Raúl Kripalani d1b291de5e fix proof types. 2021-06-21 13:24:25 +01:00
Łukasz Magiera ae65e6595d Merge pull request #6498 from rjan90/patch-2
Initial draft: basic build instructions on Readme
2021-06-21 12:58:04 +02:00
Raúl Kripalani 7ee184e965 fix lotus-storage-miner tests. 2021-06-21 11:56:10 +01:00
Steven Allen 69a8a6bc0e fix(lotus-sim): lint 2021-06-18 15:44:37 -07:00
Jakub Sztandera 2fdf49e7da Add histogram and quantiles for message sizes
Resolves https://github.com/filecoin-project/lotus/issues/6513

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-18 15:44:37 -07:00
Steven Allen eb0a15faf0 fix(genesis): set initial balances to 0 2021-06-18 15:44:37 -07:00
Steven Allen b30b5dd629 fix: move actors changes to template files 2021-06-18 15:44:37 -07:00
Steven Allen eb2b706156 chore: fix lint errors in simulation 2021-06-18 15:44:37 -07:00
Steven Allen 2aedd82c72 fix(lotus-sim): correct window post batch sizes 2021-06-18 15:44:37 -07:00
Steven Allen bc2698a988 fix(lotus-sim): simulate using realistic gas numbers
Previously, we assumed the network was "optimal". Now, we're using real
numbers.
2021-06-18 15:44:37 -07:00
Steven Allen a26cd5a809 fix(lotus-sim): mark provecommit stage initialized 2021-06-18 15:44:37 -07:00
Steven Allen f0d0b40bd3 fix(lotus-sim): debug log mock 2021-06-18 15:44:37 -07:00
Steven Allen ce29a0ac17 fix(lotus-sim): initialize commit queue 2021-06-18 15:44:37 -07:00
Steven Allen 28e6fa5923 fix(lotus-sim): remove duplicate error handling 2021-06-18 15:44:37 -07:00
Steven Allen ec5fab09a1 feat(lotus-sim): log failing proofs 2021-06-18 15:44:37 -07:00
Steven Allen e41f0842b0 fix(lotus-sim): load prove-commits
(regression from refactor)
2021-06-18 15:44:37 -07:00
Steven Allen af33d69357 fix(lotus-sim): don't close node on list 2021-06-18 15:44:37 -07:00
Steven Allen 885062f712 fix(lotus-sim): fix info state imports 2021-06-18 15:44:37 -07:00
Steven Allen 73ae1924bc feat(lotus-sim): state size command 2021-06-18 15:44:37 -07:00
Steven Allen 22267eb45d feat(lotus-sim): split info command file 2021-06-18 15:44:36 -07:00
Steven Allen 5d7b7ce5c1 feat(lotus-sim): allow profile info 2021-06-18 15:44:36 -07:00
Steven Allen 95cf577447 fix(lotus-sim): really cancel walk immediately 2021-06-18 15:44:36 -07:00
Steven Allen 8fffaa5c47 fix(lotus-sim): average over 2 days
There's too much noise per day.
2021-06-18 15:44:36 -07:00
Steven Allen 63178ce982 feat(lotus-sim): daily capacity growth 2021-06-18 15:44:36 -07:00
Steven Allen 0af7dcdedb fix(lotus-sim): rename power to capacity 2021-06-18 15:44:36 -07:00
Steven Allen f9d2a23132 fix(lotus-sim): correctly handle cancellation in walk
1. Select order is not guaranteed, always check if the context has been
canceled explicitly.
2. Never close a work channel unless we're actually done. This can yield
out-of-order results due to buffering.
2021-06-18 15:44:36 -07:00
Steven Allen ec3f969e9a feat(lotus-sim): allow walking back past the start 2021-06-18 15:44:36 -07:00
Steven Allen f6043a0250 feat(lotus-sim): measure daily power growth 2021-06-18 15:44:36 -07:00
Steven Allen 52261fb814 refactor(lotus-sim): enterprise grade
While the previous version "worked", this version nicely separates out
the state for the separate stages. Hopefully, we'll be able to use this
to build different pipelines with different configs.
2021-06-18 15:44:36 -07:00
Steven Allen 8a215df46b fix(statetree): make StateTree.ForEach take layers into account
This likely isn't used anywhere, but this _should_ take layers into
account (and I kind of just assumed it did).
2021-06-18 15:44:36 -07:00
Jakub Sztandera 7dd58efb84 Add quantiles and histogram
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-18 15:44:36 -07:00
Steven Allen 2721279e87 fix(lotus-sim): describe info commands 2021-06-18 15:44:36 -07:00
Steven Allen 985994cc0f feat(lotus-sim): add command for analyzing post stats over time 2021-06-18 15:44:36 -07:00
Steven Allen 707b3bf08a fix(lotus-sim): refuse to start simulation with no miners 2021-06-18 15:44:36 -07:00
Steven Allen d551f2b4bd feat(lotus-sim): print duration info in days 2021-06-18 15:44:36 -07:00
Steven Allen 1df5445ed2 feat(lotus-sim): make walk parallel 2021-06-18 15:44:36 -07:00
Steven Allen fbaffe86da fix(lotus-sim): return error from walk 2021-06-18 15:44:36 -07:00
Steven Allen 500fae6a52 fix(lotus-sim): less indentation in info 2021-06-18 15:44:36 -07:00
Steven Allen ab59474c4c fix(lotus-sim): count single prove-commits when computing efficiency 2021-06-18 15:44:36 -07:00
Jakub Sztandera 3d3c26fa0c Add lookback limit
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-18 15:44:36 -07:00
Steven Allen 68593ce995 fix(lotus-sim): obey context in walk 2021-06-18 15:44:36 -07:00
Jakub Sztandera ca9eadd7c7 Add gas info command
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-18 15:44:36 -07:00
Steven Allen 16449007ab fix(lotus-sim): fix funding error check 2021-06-18 15:44:35 -07:00
Steven Allen 8d734d81d9 fix(lotus-sim): log failed pre-commits and continue 2021-06-18 15:44:35 -07:00
Steven Allen 783dc5a33d fix(lotus-sim): fund multiple times
Sometimes, a miner is deep in the red.
2021-06-18 15:44:35 -07:00
Steven Allen be713ec04a fix(lotus-sim): we always fill the block with pre-commits 2021-06-18 15:44:35 -07:00
Steven Allen c18ca60d28 fix(lotus-sim): specify ErrWriter
Apparently, it defaults to nil...
2021-06-18 15:44:35 -07:00
Steven Allen 977bf1cad9 fix(lotus-sim): write pprof profiles to a directory
We need to know the sizes up-front for tar, and that's not happening.
2021-06-18 15:44:35 -07:00
Steven Allen 7a8bfd8725 doc(lotus-sim): document signals 2021-06-18 15:44:35 -07:00
Steven Allen a3f64e0768 fix(lotus-sim): profile signal handling 2021-06-18 15:44:35 -07:00
Steven Allen 5766002370 fix(lotus-sim): guard info with dashes 2021-06-18 15:44:35 -07:00
Steven Allen 4a80c83533 fix(lotus-sim): fix spelling 2021-06-18 15:44:35 -07:00
Steven Allen 936659d087 feat(lotus-sim): print info on SIGUSR1 2021-06-18 15:44:35 -07:00
Steven Allen dcdb0abe27 feat(lotus-sim): profile on SIGUSR2 2021-06-18 15:44:35 -07:00
Steven Allen 2b77c17546 chore(lotus-sim): fix import grouping
I got a bit lazy when developing this.
2021-06-18 15:44:35 -07:00
Steven Allen 1802ae31a6 feat(lotus-sim): record timing information for pre/prove-commit packing 2021-06-18 15:44:35 -07:00
Steven Allen 868231adc7 fix(lotus-sim): don't take from the fund account when funding 2021-06-18 15:44:35 -07:00
Steven Allen 2b4f865665 feat(lotus-sim): fund from a funding account
Instead of funding the simulation from the burnt-funds actor, fund from
a custom account and take a "tax" to fund that account.

Otherwise, we run out of funds...
2021-06-18 15:44:35 -07:00
Steven Allen e7b1e09ade feat(multisig): expose ApproveReturn 2021-06-18 15:44:35 -07:00
Steven Allen 86e459f585 feat(lotus-sim): return receipt
Instead of returning a "full" boolean and an error, return a receipt and
an error. We now use the error to indicate if the block is "full".
2021-06-18 15:44:35 -07:00
Steven Allen 0075abea5e fix(vm): always specify an ActorErr when ApplyMessage fails.
This case shouldn't actually happen, but we might as well be consistent.
2021-06-18 15:44:35 -07:00
Steven Allen 88af350774 fix(lotus-sim): use global base-fee value 2021-06-18 15:44:35 -07:00
Steven Allen 747b3d3e57 fix(lotus-sim): skip miners without power when loading 2021-06-18 15:44:35 -07:00
Steven Allen ba65a1ba9b chore(lotus-sim): rename stat to info 2021-06-18 15:44:35 -07:00
Steven Allen e097ba8640 feat(lotus-sim): wire up signal handler 2021-06-18 15:44:35 -07:00
Steven Allen 4578e0dd8d chore(lotus-sim): remove dead code 2021-06-18 15:44:35 -07:00
Steven Allen 77f0fee58e chore(lotus-sim): fix comment about simulation block miner 2021-06-18 15:44:35 -07:00
Steven Allen bb4753ffbf feat(lotus-sim): add commands to rename and copy 2021-06-18 15:44:35 -07:00
Steven Allen 4f0b9eefc1 fix(lotus-sim): check for slash in names on copy 2021-06-18 15:44:35 -07:00
Steven Allen 8410b0f79f feat(lotus-sim): add a feature to copy/rename simulation.
Useful to backup old simulations before creating a new one.
2021-06-18 15:44:35 -07:00
Steven Allen c5dc67ccd8 feat(lotus-sim): add a walk function
This way, we can easily walk the chain and:

1. Inspect messages and their results.
2. Inspect tipset state.
2021-06-18 15:44:35 -07:00
Steven Allen ccdd660f0d feat(lotus-sim): more stats 2021-06-18 15:44:35 -07:00
Steven Allen 5f6733fe44 feat(lotus-sim): expose StateManager from Simulation 2021-06-18 15:44:35 -07:00
Steven Allen 0faacbe154 feat(lotus-sim): store start tipset 2021-06-18 15:44:35 -07:00
Steven Allen a57c509e1e fix(lotus-sim): cleanup and document pre-commit filtering 2021-06-18 15:44:35 -07:00
Steven Allen f9ebe3017d test(lotus-sim): test commit-queue rollover 2021-06-18 15:44:35 -07:00
Steven Allen 0725019bdb feat(lotus-sim): completely pack block
Instead of packing till we see "full". Prove-commits are large, we may
have room for some more pre-commits.
2021-06-18 15:44:34 -07:00
Steven Allen dfdafa3c15 fix(lotus-sim): pretend all messages are BLS
It doesn't really matter, and it ensures they all get executed in-order.
2021-06-18 15:44:34 -07:00
Steven Allen 5b31ae39ea fix: test commit queue 2021-06-18 15:44:34 -07:00
Steven Allen 82019ce474 fix(lotus-sim): correctly merge forward commit queue. 2021-06-18 15:44:34 -07:00
Steven Allen 2e4f526375 fix(lotus-sim): skip (and log) missing/expired pre-commits 2021-06-18 15:44:34 -07:00
Steven Allen 0ccf716989 fix(lotus-sim): refactor miner state loading
Add a helper function so we don't need to constantly repeat ourselves.
2021-06-18 15:44:34 -07:00
Steven Allen 7925b69573 doc(lotus-sim): document block generation logic 2021-06-18 15:44:34 -07:00
Steven Allen 2f7d7aed31 feat(lotus-sim): refactor and document
Hopefully, this'll make this code a bit easier to approach.
2021-06-18 15:44:34 -07:00
Steven Allen b7bfc06ebe feat(lotus-sim): add an info command 2021-06-18 15:44:34 -07:00
Steven Allen be9e30e39d fix(lotus-sim): rename step to run
And make it run forever by default.
2021-06-18 15:44:34 -07:00
Steven Allen 8000decac6 feat(lotus-sim): add command to list pending upgrades 2021-06-18 15:44:34 -07:00
Steven Allen e2f5c494b0 feat: implement lotus-sim 2021-06-18 15:44:34 -07:00
Raúl Kripalani 8a418bf982 rename {kit2=>kit}. 2021-06-18 19:45:29 +01:00
Raúl Kripalani a7d8d15c13 kill old kit 🎉 2021-06-18 19:42:06 +01:00
raulk a8bf7e7bad Merge pull request #6510 from filecoin-project/refactor/itest-wdpost-dispute 2021-06-18 19:40:12 +01:00
raulk 83de21e464 Merge pull request #6483 from filecoin-project/refactor/itest-multisig 2021-06-18 19:39:24 +01:00
Raúl Kripalani 718babd33a use miner owner address when posting proofs. 2021-06-18 19:38:17 +01:00
Raúl Kripalani 9604be6d2f Merge branch 'raulk/itests-refactor-kit' into refactor/itest-wdpost-dispute 2021-06-18 19:29:18 +01:00
Raúl Kripalani 3d8eb374bd cleaner instantiation of lite and gateway nodes + general cleanup. 2021-06-18 19:23:42 +01:00
Raúl Kripalani 3ae42d4648 Merge branch 'raulk/itests-refactor-kit' into refactor/itest-multisig 2021-06-18 19:08:07 +01:00
raulk 7c329d43f2 Merge pull request #6511 from filecoin-project/refactor/itest-deadling-toggling 2021-06-18 18:29:11 +01:00
Raúl Kripalani 5548541e1a fix default proof type to use for non-genesis miners.
We need to instantiate non-genesis miners with a _concrete_
proof type.
2021-06-18 18:10:42 +01:00
Anton Evangelatov 577b730415 wip 2021-06-18 18:42:34 +02:00
Raúl Kripalani 4c2cc8e5f7 Merge branch 'raulk/itests-refactor-kit' into refactor/itest-deadling-toggling 2021-06-18 16:20:15 +01:00
Raúl Kripalani e85af3cba7 fix merge error. 2021-06-18 16:19:58 +01:00
Raúl Kripalani 32327c7d43 Merge branch 'raulk/itests-refactor-kit' into refactor/itest-deadling-toggling 2021-06-18 11:22:12 +01:00
Anton Evangelatov 89df3cc207 Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-miner-processes 2021-06-18 12:07:15 +02:00
raulk 572277caf7 Merge pull request #6509 from filecoin-project/refactor/itest-wdpost 2021-06-18 10:27:57 +01:00
Raúl Kripalani 2548c224c7 switch to TestFullNode#WaitTillChain. 2021-06-18 10:27:20 +01:00
Raúl Kripalani 21848054d7 Merge branch 'raulk/itests-refactor-kit' into refactor/itest-wdpost 2021-06-18 10:26:17 +01:00
raulk c4e0ac21a0 Merge pull request #6507 from filecoin-project/refactor/itest-sector-terminate
refactor sector terminate test to use kit2
2021-06-18 10:23:06 +01:00
Rjan e56a171ab6 Use prebuilt proof binaries when building
Make the basic build instructions use the prebuilt proof binaries instead of building them from source. Removed rustup as a dependency, and linked to it in the full docs instead.
2021-06-18 10:59:53 +02:00
Łukasz Magiera 715176698f Merge pull request #6521 from yaohcn/fix-commit-finalize
fix commit finalize failed
2021-06-18 10:38:58 +02:00
yaohcn 7c6736b3ef fix commit finalize failed 2021-06-18 12:09:02 +08:00
Raúl Kripalani 9436be5ff0 introduce TestFullNode#WaitTillChain(predicate). 2021-06-17 22:02:20 +01:00
raulk 6562a23666 Merge pull request #6506 from filecoin-project/refactor/itest-sector-pledge
Refactor sector pledge test to use kit2
2021-06-17 17:52:13 +01:00
Anton Evangelatov 338bd042b9 Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-miner-processes 2021-06-17 18:12:48 +02:00
Dirk McCormick 7a9769b807 refactor: deadline toggling test to kit2 2021-06-17 14:58:35 +02:00
Dirk McCormick 3de6beabe3 refactor: wdpost dispute test to use kit2 2021-06-17 14:31:57 +02:00
Dirk McCormick e9325fecc5 refactor: wdpost test to kit2 2021-06-17 14:31:20 +02:00
Dirk McCormick 6567887e6e refactor: sector terminate test to kit2 2021-06-17 14:27:44 +02:00
Łukasz Magiera 44de67cf7d Merge pull request #6175 from filecoin-project/feat/dynamic-retreival-pricing
Dynamic Retrieval pricing
2021-06-17 10:25:48 +02:00
Dirk McCormick 8f608dff45 refactor: sector pledge test to use kit2 2021-06-17 09:37:35 +02:00
aarshkshah1992 9002fcbe47 local unsealed file wont have the unsealed piece 2021-06-17 09:46:29 +05:30
Aayush Rajasekaran d6dc081cfe Merge pull request #6501 from filecoin-project/asr/fix-soup
Fix soup
2021-06-16 22:01:55 -04:00
Aayush Rajasekaran f6fb41fce5 Merge pull request #6502 from filecoin-project/fix/max-part-per-post
fix: pick the correct partitions-per-post limit
2021-06-16 20:11:29 -04:00
Steven Allen 653b1d8231 fix: pick the correct partitions-per-post limit 2021-06-16 16:53:52 -07:00
Aayush Rajasekaran 514107a75b Fix soup 2021-06-16 18:04:45 -04:00
Aayush Rajasekaran 9c7db6d305 Fix the build 2021-06-16 17:53:53 -04:00
Aayush Rajasekaran 35f76f58df Merge pull request #6309 from filecoin-project/feat/better_mining_projection_and_accuracy
Adjust various CLI display ratios to arbitrary precision
2021-06-16 17:48:23 -04:00
Raúl Kripalani f1bf080e04 Merge branch 'raulk/itests-refactor-kit' into refactor/itest-multisig 2021-06-16 20:00:11 +01:00
raulk 2c30ac394d Merge pull request #6469 from filecoin-project/refactor/itest-verifreg 2021-06-16 19:46:38 +01:00
Raúl Kripalani 8ed753a712 rename RootVerifier option. 2021-06-16 18:16:59 +01:00
Raúl Kripalani a3015ca9c2 Merge branch 'raulk/itests-refactor-kit' into refactor/itest-verifreg 2021-06-16 18:12:51 +01:00
Raúl Kripalani d2ff0cd88e fix verifreg test; add VerifierRootKey() and Account() ensemble opts. 2021-06-16 18:11:34 +01:00
Anton Evangelatov d45bb14015 Merge branch 'master' into nonsense/split-market-miner-processes 2021-06-16 18:49:15 +02:00
raulk 30148477a7 Merge pull request #6470 from filecoin-project/refactor/ccupgrade-test 2021-06-16 16:20:54 +01:00
Dirk McCormick 4ea73b4088 refactor: use genesis preseals from kit2 2021-06-16 14:42:28 +02:00
Rjan ca4ca8cbcf Update README.md 2021-06-16 13:15:09 +02:00
Rjan 8b2d74bb2c Initial draft: basic build instructions on Readme
Inital draft for basic build instructions on the Readme page. Issue: #6348
2021-06-16 12:26:33 +02:00
Raúl Kripalani 305e3245b6 Merge branch 'master' into raulk/itests-refactor-kit 2021-06-16 11:02:16 +01:00
raulk fea5afd615 Merge pull request #6468 from filecoin-project/refactor/itest-tape
Refactor tape test to kit2
2021-06-16 10:58:08 +01:00
raulk 06cb3cf132 Merge pull request #6488 from filecoin-project/refactor/itest-sdr-upgrade 2021-06-16 10:49:03 +01:00
raulk 1d768a823f Merge pull request #6484 from filecoin-project/refactor/itest-paych-cli
refactor paych cli tests to use kit2
2021-06-16 10:45:53 +01:00
raulk a0894a866d Merge pull request #6464 from filecoin-project/refactor/itest-cli
Refactor cli test to kit2
2021-06-16 10:42:29 +01:00
raulk f0a8a85928 Merge pull request #6486 from filecoin-project/refactor/itest-batch-deal
refactor batch deal test to use kit2
2021-06-16 10:41:30 +01:00
Łukasz Magiera 719bb988c9 Merge pull request #6490 from filecoin-project/asr/miner-multisig-shed
Add utils to use multisigs as miner owners
2021-06-16 11:15:43 +02:00
Łukasz Magiera 4bd2587e47 Merge pull request #6479 from filecoin-project/test/multicore-sdr
Test multicore SDR support
2021-06-16 11:02:09 +02:00
Łukasz Magiera 0319ccbc4d Merge pull request #6495 from filecoin-project/asr/cherry-pick-rs
sealing: Fix restartSectors race
2021-06-15 23:57:42 +02:00
Łukasz Magiera 74db586fdf sealing: Fix restartSectors race 2021-06-15 17:43:32 -04:00
Aayush Rajasekaran bee548face Add utils to use multisigs as miner owners 2021-06-15 16:57:52 -04:00
Peter Rabbitson 4efc3f8db0 Copy latest version to lotus-soup 2021-06-15 22:00:17 +02:00
Łukasz Magiera c7c593c74e TestMulticoreSDR: Setup rust logger after envvar check 2021-06-15 17:59:46 +02:00
Łukasz Magiera 6b0aed9317 Setup rust logger in the test 2021-06-15 17:53:26 +02:00
Łukasz Magiera 265afd696e Run TestMulticoreSDR on Circle 2021-06-15 17:46:06 +02:00
Łukasz Magiera 9ae780902a Test multicore SDR support 2021-06-15 17:36:10 +02:00
Dirk McCormick cd903bec5e refactor: sdr upgrade test to use kit2 2021-06-15 17:30:51 +02:00
Łukasz Magiera d763dcf48b Merge pull request #6487 from filecoin-project/chore/merge-1.10
Merge 1.10 into master
2021-06-15 17:26:48 +02:00
Łukasz Magiera 20c4fe9bba Merge remote-tracking branch 'origin/release/v1.10.0' into chore/merge-1.10 2021-06-15 16:50:23 +02:00
Dirk McCormick cd53942525 refactor: batch deal test to use kit2 2021-06-15 15:38:09 +02:00
Anton Evangelatov 323c78ef44 comment for checkV1ApiSupport 2021-06-15 14:47:11 +02:00
Dirk McCormick 2267d15a0f refactor: update paych cli tests to use kit2 2021-06-15 14:37:03 +02:00
Anton Evangelatov 090a16316c bump miner version apiv0 2021-06-15 13:59:51 +02:00
Dirk McCormick 5ce482b817 refactor: change network upgrade NodeOption to node.Option 2021-06-15 13:53:41 +02:00
raulk c5b7e48cd1 Merge pull request #6467 from filecoin-project/refactor/itests-paych 2021-06-15 10:59:13 +01:00
Dirk McCormick 16cad0e01a refactor: convert gateway tests to kit2 2021-06-15 11:46:32 +02:00
Dirk McCormick 2d5b798763 refactor: cli test with kit2 2021-06-15 09:08:56 +02:00
Dirk McCormick 4cd0964ab1 refactor: replace if err with require 2021-06-15 08:27:02 +02:00
Dirk McCormick 803a3df6b4 refactor: ccupgrade test 2021-06-15 08:21:02 +02:00
Raúl Kripalani c27f3deadd start mining way more in the past. 2021-06-15 08:19:29 +02:00
Dirk McCormick 0bb5fffd88 refactor: clean up code 2021-06-15 08:09:14 +02:00
Peter Rabbitson ae2b089a5c Be even more precise - properly account for multi-win Poisson 2021-06-14 23:57:17 +02:00
Łukasz Magiera f9596dd730 Merge pull request #6432 from filecoin-project/tests/batching-unit
Unit tests for sector batchers
2021-06-14 21:05:34 +02:00
Raúl Kripalani dae8be0881 migrate to require; use t.Log* instead of fmt.Print*. 2021-06-14 18:59:15 +01:00
Raúl Kripalani 8a7dba11bd add comment. 2021-06-14 18:58:40 +01:00
Raúl Kripalani 6fb31a34b3 start mining way more in the past. 2021-06-14 18:58:12 +01:00
Łukasz Magiera 5008914846 Merge pull request #6466 from filecoin-project/chore/merge-1.10
Merge 1.10 changes into master
2021-06-14 17:58:10 +02:00
Peter Rabbitson 4d1fccd290 Better wolfram link 2021-06-14 17:54:38 +02:00
Łukasz Magiera 40efafb7cd Update ffi with fixed multicore sdr support 2021-06-14 17:29:21 +02:00
Dirk McCormick eb5a263d74 refactor: convert verifreg test to kit2 2021-06-14 16:19:20 +02:00
Dirk McCormick d2c35db0c9 refactor: convert tape test to kit2 2021-06-14 15:51:10 +02:00
Dirk McCormick 7b00b1828b refactor: convert paych to kit2 2021-06-14 15:28:05 +02:00
Dirk McCormick 86cca7303d refactor: convert multisig tests to kit2 2021-06-14 14:03:08 +02:00
Łukasz Magiera 6f2c2c04b0 Merge pull request #6465 from rjan90/patch-1
Update chain list with correct help instructions
2021-06-14 13:36:28 +02:00
Łukasz Magiera 0514f38dc4 Merge remote-tracking branch 'origin/master' into chore/merge-1.10 2021-06-14 13:27:53 +02:00
Rjan 932f3ce1d1 Update chain list with correct help instructions
Fixes #6293, changes the help text from (Default: 0) to (Default: current head)
2021-06-14 13:13:25 +02:00
Łukasz Magiera 0403fc416c Merge pull request #6451 from GFZRZK/GFZRZK/handle_failed_sector
clean failed sectors in batch commit
2021-06-14 12:33:20 +02:00
Dirk McCormick d94a19ff65 refactor: cli test with kit2 2021-06-14 12:07:50 +02:00
Anton Evangelatov c0feb36e70 add missing debug 2021-06-14 11:31:55 +02:00
Anton Evangelatov 31e6fb154e resolve conflicts 2021-06-14 11:27:54 +02:00
aarshkshah1992 4419205b0e fix compilation 2021-06-14 10:10:29 +05:30
Aarsh Shahandraulk bed2bc73a3 Update node/config/def.go
Co-authored-by: raulk <raul@protocol.ai>
2021-06-14 09:42:22 +05:30
aarshkshah1992 3d086dfb43 changes as per review 2021-06-14 09:40:34 +05:30
Raúl Kripalani ac67e466ec fix test. 2021-06-14 00:13:15 +01:00
Raúl Kripalani f1ec0d6094 fix lint. 2021-06-14 00:10:37 +01:00
Raúl Kripalani 958b6b54a8 go mod tidy. 2021-06-13 23:53:13 +01:00
Raúl Kripalani 183814a826 finish migrating deals test. 2021-06-13 23:43:22 +01:00
wangchao f392c1295c failed sectors should be added into res correctly 2021-06-12 23:22:32 +08:00
Raúl Kripalani e84b8ab3a0 move new kit into kit2, re-enable unmigrated tests against kit1. 2021-06-11 18:26:25 +01:00
aarshkshah1992 ea9bed2746 undo ffi change 2021-06-11 16:22:09 +05:30
aarshkshah1992 fed5afa704 merge master 2021-06-11 09:35:20 +05:30
Raúl Kripalani 8b037e2da3 deals tests: migrate deals cycles tests and add coverage. 2021-06-10 18:25:02 +01:00
Raúl Kripalani dcd6fc239b deals tests: migrate TestOfflineDealFlow. 2021-06-10 15:54:16 +01:00
Raúl Kripalani 4f2aaa54d2 deals tests: refactor/simplify TestDealMining; now TestFirstDealEnablesMining. 2021-06-10 14:04:39 +01:00
Raúl Kripalani 329970934a deals tests: begin migration. 2021-06-10 13:25:36 +01:00
Łukasz Magiera adaf78961f Merge pull request #6445 from filecoin-project/raulk/itests-init-guard
itests/kit: add guard to ensure imports from tests only.
2021-06-10 13:49:13 +02:00
Łukasz Magiera 06195bc8e1 Unit tests for sector batchers 2021-06-10 13:46:36 +02:00
Raúl Kripalani cf0150e057 deals harness: use require. 2021-06-10 12:23:27 +01:00
Raúl Kripalani c27fdc263c deals harness: more improvements. 2021-06-10 12:22:55 +01:00
Raúl Kripalani 0d69c03a8d deals harness: use require. 2021-06-10 12:17:39 +01:00
Raúl Kripalani 0303a0297d rename DealHarness.{TestRetrieval=>PerformRetrieval}. 2021-06-10 12:15:03 +01:00
Raúl Kripalani 019394b9e5 remove debug statements. 2021-06-10 12:14:37 +01:00
Raúl Kripalani d3fc6833a5 itests/kit: add guard to ensure imports from tests only. 2021-06-10 12:05:35 +01:00
Raúl Kripalani bcbbd73d65 Merge branch 'raulk/itests' into raulk/itests-refactor-kit 2021-06-10 12:02:08 +01:00
Łukasz Magiera 6f80d9f3c2 Merge pull request #6311 from filecoin-project/raulk/itests
consolidate integration tests into `itests` package; create test kit; cleanup
2021-06-10 12:33:29 +02:00
Łukasz Magiera f0f78cce97 Merge pull request #6444 from filecoin-project/fix/make-asr-happy
Remove rc changelog, compile the new changelog for final release only
2021-06-10 08:55:45 +02:00
Jennifer 3a1ad50da5 Merge pull request #6440 from filecoin-project/jen/miner-config-doc
updated configuration comments for docs
2021-06-09 23:35:04 -04:00
Jennifer Wang 83c465ca0f Remove rc changelog, compile the new changelog for final release only 2021-06-09 23:32:03 -04:00
Aayush Rajasekaran edf646d19c Merge pull request #6441 from filecoin-project/feat/ntwk13-hyperdrive
Set ntwk v13 HyperDrive Calibration upgrade epoch
2021-06-09 23:28:52 -04:00
Jennifer Wang 55b77a3c99 Set ntwk v13 HyperDrive Calibration upgrade epoch 2021-06-09 23:26:11 -04:00
Jennifer Wang 95ad74a156 updated configuration comments for docs 2021-06-09 20:44:20 -04:00
Raúl Kripalani fd783a6862 fix gateway URL. 2021-06-10 00:15:29 +01:00
Raúl Kripalani 39c19a0fe5 fix a merge error. 2021-06-10 00:15:29 +01:00
Raúl Kripalani 8ea7398d38 pacify gotestsum by adding a normal go file. 2021-06-10 00:15:29 +01:00
Raúl Kripalani 6d46be53bd make tests no longer create auth tokens. 2021-06-10 00:15:29 +01:00
Aayush Rajasekaran 8b9ae8414a Merge pull request #6439 from filecoin-project/asr/merge-release
Merge release/v1.10.10 into master
2021-06-09 19:05:03 -04:00
Łukasz Magiera c4a86ba684 Merge pull request #6405 from filecoin-project/steb/export-car
implement a command to export a car
2021-06-10 01:04:04 +02:00
Steven Allen a64a059780 implement a command to export a car 2021-06-09 15:52:32 -07:00
Aayush Rajasekaran 3766980331 Merge branch 'release/v1.10.0' into asr/merge-release 2021-06-09 18:41:10 -04:00
Raúl Kripalani 6e4eae69ac fix merge error that led to test failures. 2021-06-09 23:11:34 +01:00
Łukasz Magiera 3d09f468fe Merge pull request #6435 from filecoin-project/asr/merge-release
Merge v1.10 release branch into master
2021-06-10 00:00:17 +02:00
Aayush Rajasekaran dede1b4758 Merge branch 'release/v1.10.0' into asr/merge-release 2021-06-09 14:05:41 -04:00
Łukasz Magiera d09924d5ce Merge pull request #6420 from filecoin-project/feat/sector-batching-config
Fee config for sector batching
2021-06-09 19:24:43 +02:00
Raúl Kripalani 81b3c6e2ab Merge branch 'master' into raulk/itests 2021-06-09 17:34:46 +01:00
Raúl Kripalani 7df3f3755d itests: move init. 2021-06-09 17:32:08 +01:00
Łukasz Magiera b746dc2af1 Merge pull request #6430 from GFZRZK/GFZRZK/correct_message_size_check
Fix: correct the change of message size limit
2021-06-09 18:10:34 +02:00
Anton Evangelatov beb5bffaf6 fix log.Error; rename RemoteStore 2021-06-09 13:05:54 +02:00
Łukasz Magiera a0f1662a1b Merge pull request #6425 from filecoin-project/asr/state-power
UX: lotus state power CLI should fail if called with a not-miner
2021-06-09 12:18:58 +02:00
Łukasz MagieraandAayush Rajasekaran 92bb874327 Use correct batch fee config in commit batcher
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-06-09 12:17:18 +02:00
wangchao 4c87818de1 correct the change of message size limit 2021-06-09 15:19:35 +08:00
Raúl Kripalani d1f749a808 fix log. 2021-06-09 00:46:57 +01:00
Raúl Kripalani 9eecbb1b20 fix rpc tests. 2021-06-09 00:17:39 +01:00
Aayush Rajasekaran a44e91df4b UX: lotus state power CLI should fail if called with a not-miner 2021-06-08 18:46:21 -04:00
Cory Schwartz 4bff4f25ad network reset friday 2021-06-08 18:28:01 -04:00
Łukasz Magiera 227932f9ee Merge pull request #6419 from filecoin-project/feat/increase-msg-limit
Increase message size limit
2021-06-08 18:04:29 +02:00
Jakub Sztandera 39bab148b8 Create MaxMessageSize constant
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-08 16:07:43 +02:00
Anton Evangelatov 9ab84bdc0a upgrade docsgen 2021-06-08 15:59:37 +02:00
Łukasz Magiera 78171055e7 fee config for sector batching 2021-06-08 15:45:32 +02:00
Anton Evangelatov 30ba9a2751 remove double http handler decl 2021-06-08 15:36:54 +02:00
Jakub Sztandera 4c605c349f Increase message size limit
Add test

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-08 15:20:10 +02:00
Anton Evangelatov 3f5f96dcbd go mod tidy 2021-06-08 14:58:20 +02:00
Anton Evangelatov 4dd093b160 fix piece provider test 2021-06-08 14:57:45 +02:00
Anton Evangelatov c0607a0e2a Merge branch 'master' into nonsense/split-market-miner-processes 2021-06-08 14:54:59 +02:00
Anton Evangelatov 9f3ec82cc1 initial resolution of conflicts 2021-06-08 13:01:22 +02:00
Łukasz Magiera c98b6f6408 Merge pull request #6389 from filecoin-project/frrist/execmonitor-interface
polish(stmgr): define ExecMonitor for message application callback
2021-06-08 12:30:52 +02:00
Łukasz Magiera 3c205a46bb Merge pull request #6403 from filecoin-project/testground-update-action
upgrade testground action version
2021-06-08 12:10:53 +02:00
Łukasz Magiera d9ef2f3432 Merge pull request #6413 from filecoin-project/chore/fix-logging-double-cid-encoding
Fix logging of stringified CIDs double-encoded in hex
2021-06-08 11:57:22 +02:00
Łukasz Magiera 631fdaa217 Merge pull request #6404 from filecoin-project/fix/test-flake-race-conn
Update libp2p to 0.14.2
2021-06-08 11:44:13 +02:00
aarshkshah1992 4e9bb16532 changes as per review 2021-06-08 10:09:27 +05:30
aarshkshah1992 212d0fc264 fix remote store diff 2021-06-08 09:54:45 +05:30
aarshkshah1992 e4e60d7af4 fix mock 2021-06-08 09:37:12 +05:30
aarshkshah1992 16166504f4 merged master 2021-06-08 09:17:40 +05:30
Raúl Kripalani 40ea660cdd fix TestWorkerKeyChange. 2021-06-07 23:56:59 +01:00
Raúl Kripalani cd6f91ba6f fix lint. 2021-06-07 23:47:38 +01:00
Raúl Kripalani a274fcc533 Merge branch 'master' into raulk/itests 2021-06-07 23:44:22 +01:00
Raúl Kripalani db1a61852d Merge branch 'master' into raulk/itests 2021-06-07 23:17:44 +01:00
Peter Rabbitson 29d7561dd1 Fix logging of stringified CIDs double-encoded in hex 2021-06-08 00:05:48 +02:00
Steven Allen 4aecb83932 chore: update docs for new libp2p version 2021-06-07 12:17:05 -07:00
Steven Allen 5ef5680b98 chore: update to go-libp2p v0.14.2
This should fix test flakes due to a race in the go-libp2p mock network.
2021-06-07 12:14:01 -07:00
frrist 0519c77c24 polish(stmgr): define ExecMonitor for message applicaiton callback 2021-06-07 11:03:18 -07:00
Cory Schwartz e1242a20ee upgrade to v1.1 2021-06-07 09:54:08 -07:00
Jakub Sztandera f9acd07987 Update libp2p to 0.14.1
This does not resolve the CI issue but prepares us for it after https://github.com/libp2p/go-libp2p/pull/1116

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-07 18:51:48 +02:00
Cory Schwartz abf9bd0c4d test master 2021-06-07 09:38:06 -07:00
Łukasz Magiera fadc79a487 Merge pull request #6280 from filecoin-project/feat/pieceread-outside-scheduler
Bypass task scheduler for reading unsealed pieces
2021-06-07 18:11:44 +02:00
Łukasz Magiera 8625da3479 Bump miner/worker api versions 2021-06-07 16:57:24 +02:00
aarshkshah1992 7124cd5149 fix lotus soup build 2021-06-07 19:33:16 +05:30
Łukasz Magiera 0117584728 Merge pull request #6400 from filecoin-project/fix-lotus-soup-tests
testplans: lotus-soup: use default WPoStChallengeWindow
2021-06-07 13:40:06 +02:00
aarshkshah1992 ddd9bf610e fix CI 2021-06-07 16:45:52 +05:30
aarshkshah1992 1a90d3bbb5 update ffi 2021-06-07 16:12:39 +05:30
aarshkshah1992 21e6b50294 finished rebasing PR 2021-06-07 16:02:15 +05:30
Anton Evangelatov de646a5b93 fix node builder 2021-06-07 12:16:10 +02:00
Anton Evangelatov b0cb0c1a4a do not depend on filecoin-ffi in api package 2021-06-07 11:51:25 +02:00
Łukasz Magiera 1c26b7220e Merge pull request #6388 from filecoin-project/feat/ci-snap-release
build snapcraft
2021-06-07 11:46:08 +02:00
Łukasz Magiera 7b5a9a3b9c Merge pull request #6399 from lionsoul2014/master
Fix the doc errors of the sealing config funcs
2021-06-07 11:45:04 +02:00
Anton Evangelatov 042ac8240f testplans: lotus-soup: new images with filecoin-ffi ; use default WPoStChallengeWindow 2021-06-07 11:38:23 +02:00
aarshkshah1992 8d9cef17af changes as per review 2021-06-07 15:03:09 +05:30
aarshkshah1992 2a134887c3 logs to debug read & unseal 2021-06-07 15:03:09 +05:30
aarshkshah1992 ec6a49693f logs to debug read and unseal 2021-06-07 15:03:09 +05:30
aarshkshah1992 207f0d901a integration test should remove unsealed files 2021-06-07 15:03:09 +05:30
aarshkshah1992 73f7825fbb clean up logging 2021-06-07 15:03:09 +05:30
aarshkshah1992 3b792a32c3 better logging 2021-06-07 15:03:09 +05:30
aarshkshah1992 22f36483cb more logging 2021-06-07 15:03:09 +05:30
aarshkshah1992 acfa3d7370 finish integration tests 2021-06-07 15:03:09 +05:30
aarshkshah1992 ad4b182bfe remove read task type and run gen and docsgen 2021-06-07 15:03:06 +05:30
aarshkshah1992 35a0dbfa8c fix go mod 2021-06-07 15:02:52 +05:30
aarshkshah1992 4efaa8d688 unit tests for the remote store Reader 2021-06-07 15:02:52 +05:30
aarshkshah1992 0d88800eb9 use mockgen 2021-06-07 15:02:52 +05:30
aarshkshah1992 77b5e8d045 use an actual worker in the integration tests 2021-06-07 15:02:52 +05:30
Dirk McCormick 6879ae9e6a feat: TestPieceProviderReadPiece 2021-06-07 15:02:52 +05:30
aarshkshah1992 74372d3e81 fix linting problems 2021-06-07 15:02:52 +05:30
aarshkshah1992 759d8f090b test http handler 2021-06-07 15:02:52 +05:30
aarshkshah1992 db5c88196d address review comments 2021-06-07 15:02:52 +05:30
Aarsh Shahanddirkmc c853350bdf Apply suggestions from code review
Co-authored-by: dirkmc <dirkmdev@gmail.com>
2021-06-07 15:02:52 +05:30
aarshkshah1992 65eb610ec3 docs, logs and green ci 2021-06-07 15:02:49 +05:30
aarshkshah1992 670835fca0 bypass task scheduler for reading unsealed pieces 2021-06-07 15:02:04 +05:30
Anton Evangelatov c7c029ea91 testplans: lotus-soup: new images with filecoin-ffi ; use default WPoStChallengeWindow 2021-06-07 11:28:24 +02:00
Cory Schwartz becc2465a5 homeplug 2021-06-06 23:07:59 -07:00
Lion e4588aed5c Fix the doc errors of the sealing config funcs 2021-06-07 12:35:43 +08:00
Cory Schwartz 02b35bf978 remove tmp publish 2021-06-06 15:52:56 -07:00
Cory Schwartz e61ff4153f spaces between urls 2021-06-04 20:52:12 -07:00
Cory Schwartz 25080956a7 rm license 2021-06-04 20:35:55 -07:00
Cory Schwartz 52380fe7fc more detailed information 2021-06-04 20:28:12 -07:00
Cory Schwartz 3921ea6916 add icon 2021-06-04 20:13:37 -07:00
Cory Schwartz 10632d0131 missing colon 2021-06-04 16:50:23 -07:00
Cory Schwartz 8b06f51fb4 vartmp 2021-06-04 16:47:06 -07:00
Cory Schwartz c12318f413 missing colon 2021-06-04 16:25:02 -07:00
Cory Schwartz 39f3384e7c confine 2021-06-04 16:22:57 -07:00
Łukasz Magiera b8deee048e Merge pull request #6081 from filecoin-project/test/offline-deals
Integration tests for offline deals
2021-06-04 23:27:26 +02:00
Dirk McCormick 52b90e4c9d test: offline deals 2021-06-04 22:42:07 +02:00
Łukasz Magiera 91c87b7069 Merge pull request #5921 from filecoin-project/fix/retrieve-success-handling
Fix success handling in Retreival
2021-06-04 22:15:34 +02:00
Łukasz Magiera ba654285f0 Merge pull request #6397 from filecoin-project/fix/some-flaky-tests
Fix some flaky tests
2021-06-04 22:00:29 +02:00
aarshkshah1992 35a466f4c4 add new line 2021-06-04 21:41:09 +02:00
aarshkshah1992 ed4748e8ac fix bug 2021-06-04 21:41:09 +02:00
aarshkshah1992 182da9d4ef fix error handling 2021-06-04 21:41:09 +02:00
aarshkshah1992 8733cea902 fix success handling in retreival 2021-06-04 21:41:09 +02:00
Łukasz Magiera 0244dfd76c Merge pull request #6384 from filecoin-project/feat/ci-appimage-release
build appimage in CI
2021-06-04 21:30:13 +02:00
Łukasz Magiera 393b60fb7d Merge pull request #6392 from filecoin-project/docs/gas
Add doc on gas balancing
2021-06-04 21:25:51 +02:00
Łukasz Magiera 42ec5928e3 Merge pull request #6337 from filecoin-project/feat/list-retrievals
Add a command to list retrievals
2021-06-04 21:13:25 +02:00
Łukasz Magiera 8286c6bd17 Merge pull request #6387 from filecoin-project/feat/interopnet
Add interop network
2021-06-04 21:11:48 +02:00
Łukasz Magiera a7746961fb Merge remote-tracking branch 'origin/master' into feat/list-retrievals 2021-06-04 20:49:01 +02:00
Anton Evangelatov ded5341da0 fixup test node builder 2021-06-04 17:22:36 +02:00
Anton Evangelatov ed634bc3a4 rebuild docs 2021-06-04 17:06:55 +02:00
Anton Evangelatov c4d10bc44e apply messagepool.NewProviderLite to lite nodes 2021-06-04 16:51:07 +02:00
Anton Evangelatov 6f125cc129 add prover to fullnode and miner builders 2021-06-04 16:26:32 +02:00
Anton Evangelatov d9a7348ae1 use masters filecoin-ffi 2021-06-04 16:20:40 +02:00
Raúl Kripalani 71cd268502 fix. 2021-06-04 15:17:30 +01:00
Anton Evangelatov 8bd09e39ca resolve merge conflicts 2021-06-04 16:17:00 +02:00
Anton Evangelatov c877166b4a add messagepool to test node constructor 2021-06-04 15:53:33 +02:00
Anton Evangelatov 7f234809fc make linter happy 2021-06-04 15:44:13 +02:00
Anton Evangelatov 88756f3ebf fix TestAPIDeal tests 2021-06-04 15:41:38 +02:00
Jakub Sztandera 86ab3926c5 Add doc on gas balancing
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-04 15:32:52 +02:00
aarshkshah1992 303ef15a83 fix ci 2021-06-04 17:33:11 +05:30
aarshkshah1992 05ba3de5cc changes as per review 2021-06-04 10:27:43 +05:30
Cory Schwartz 4dde67750c uncomment build-all 2021-06-03 20:47:07 -07:00
Cory Schwartz 0fba816846 publish on snap 2021-06-03 20:45:54 -07:00
Travis Person e89e0679b5 Interop genesis 2021-06-03 23:27:45 +00:00
Travis Person 96e67b80c3 Add interop network 2021-06-03 22:43:27 +00:00
Aayush Rajasekaran c66d66dfcb Fix state manager::Call() 2021-06-03 17:09:42 -04:00
Aayush Rajasekaran a41a1cbd93 Gate runtime's GetRandomnessFromBeacon on HyperdriveHeight, not network version 2021-06-03 15:47:49 -04:00
Cory Schwartz 8b2b488d17 remove temporary edits 2021-06-03 10:44:48 -07:00
Cory Schwartz eafcc14f0b comment out filters 2021-06-03 10:20:49 -07:00
Cory Schwartz 92fdbd80d9 tmp: publish dry run 2021-06-03 10:18:13 -07:00
Łukasz Magiera c5797482b2 Revert CallWithGas hack 2021-06-03 18:51:01 +02:00
Łukasz Magiera 565bb4f589 mock: Log debug info on bad aggregates 2021-06-03 17:35:10 +02:00
Łukasz Magiera fd2d2d3ff4 Fix TestDeadlineToggling flakiness 2021-06-03 17:08:05 +02:00
Łukasz Magiera 78c128f6a3 chain: Better logging in sync tests 2021-06-03 10:42:26 +02:00
Łukasz Magiera bf468762b6 Merge pull request #6342 from filecoin-project/feat/nv13-1.11
Network version 13 (v1.11)
2021-06-03 09:58:43 +02:00
Cory Schwartz 65651099b6 remove extraneous comment 2021-06-03 00:11:36 -07:00
Cory Schwartz 9d3410d374 include appimage on release 2021-06-03 00:05:43 -07:00
aarshkshah1992 43453bb633 fix broken test 2021-06-03 10:15:23 +05:30
Aayush Rajasekaran cd4505dd63 Update to specs-actors v5-rc-2 2021-06-02 19:11:47 -04:00
Łukasz Magiera 40cc29d723 Skip FD check in TestDownloadParams 2021-06-02 19:50:17 +02:00
Łukasz Magiera 08b7ab90c1 mod tidy, fix testground build 2021-06-02 15:29:54 +02:00
Łukasz Magiera e1dc7ad6eb build: Use go embed for srs-inner-product.json 2021-06-02 15:12:26 +02:00
Łukasz Magiera 55f65702b2 Merge branch 'feat/nv13-1.11' of github.com:filecoin-project/lotus into feat/nv13-1.11 2021-06-02 15:07:40 +02:00
Łukasz Magiera 6d9779ecae Merge remote-tracking branch 'origin/master' into feat/nv13-1.11 2021-06-02 15:07:13 +02:00
Łukasz Magiera d77d3df698 Merge remote-tracking branch 'origin/feat/nv13' into feat/nv13-1.11 2021-06-02 15:06:50 +02:00
Łukasz Magiera f296385141 Merge pull request #6208 from filecoin-project/feat/appimage
Generate AppImage
2021-06-02 15:05:01 +02:00
Łukasz Magiera 6ead83b605 Go 1.16 in Dockerfile 2021-06-02 14:42:48 +02:00
Łukasz Magiera f1ebf320b5 Fix codeql with go 1.16 2021-06-02 12:49:11 +02:00
Łukasz Magiera cba5c34aef Fix lotus-soup build 2021-06-02 12:38:07 +02:00
Łukasz Magiera 6d7e0a57e4 fix lotus-gateway build 2021-06-02 12:34:48 +02:00
Łukasz Magiera 3ae817d549 Update required golang version to 1.16 2021-06-02 12:29:49 +02:00
Cory Schwartz ff82a4e9ec remove rice-box.go from gitignore 2021-06-02 12:16:09 +02:00
Cory Schwartz e13dea7da8 use go:embed 2021-06-02 12:16:09 +02:00
Cory Schwartz 16db46e6b9 rm generated file when clean 2021-06-02 12:16:09 +02:00
Cory Schwartz a7f7350c51 switch to go rice embedded 2021-06-02 12:16:09 +02:00
Cory Schwartz 2cf3674089 build on ubuntu 18.04 2021-06-02 12:16:09 +02:00
Cory Schwartz 56ce8fb293 appimage 2021-06-02 12:16:09 +02:00
Łukasz Magiera 07b025a54f Merge pull request #6373 from filecoin-project/feat/gateway-check
lotus-gateway: add check command
2021-06-02 12:13:39 +02:00
Łukasz Magiera ae90d7c3b5 Fix lint 2021-06-02 12:00:39 +02:00
Travis Person 07102ec686 lotus-gateway: add check command
The check command provides a quick way to try out different transports
and verify that a connection can be made to a running gateway.
2021-06-02 11:59:11 +02:00
Łukasz Magiera 1bc8c928b7 Merge pull request #6374 from filecoin-project/asr/warning
Add a warning to the release issue template
2021-06-02 11:07:33 +02:00
hannahhoward 93a2530803 fix(cli): make failed retrievals show by default 2021-06-01 16:02:35 -07:00
Aayush Rajasekaran f30b2dab66 Add a warning to the release issue template 2021-06-01 18:24:07 -04:00
Łukasz Magiera 2a787dd4a3 Merge pull request #6372 from filecoin-project/fix/nv11-tests
Fix nv13 1.11 tests
2021-06-02 00:17:05 +02:00
Aayush Rajasekaran cf18709100 Fix TestDeadlineToggling 2021-06-01 17:50:06 -04:00
Aayush Rajasekaran 964435a78c CLI docsgen 2021-06-01 17:39:45 -04:00
Łukasz Magiera aad13bae08 Merge pull request #6369 from filecoin-project/feat/markets-1.4.0
update to markets-v1.4.0
2021-06-01 23:35:58 +02:00
Aayush Rajasekaran f00cf70df0 Magik shouldn't write code at midnight 2021-06-01 17:31:44 -04:00
Dirk McCormick 06dbca24b4 feat: update to markets v1.4.0 2021-06-01 13:45:04 -06:00
Dirk McCormick 133459756b fix: update lotus-soup 2021-06-01 13:44:42 -06:00
Łukasz Magiera 2f0a9f6c40 Improve AddVerifiedClient test 2021-06-01 21:28:48 +02:00
Łukasz Magiera ee21351aa0 statetree: Add missing version defs 2021-06-01 21:16:01 +02:00
Łukasz Magiera a676da8a7e Merge remote-tracking branch 'origin/master' into feat/nv13-1.11 2021-06-01 21:07:04 +02:00
Łukasz Magiera dc642d0b7b Merge remote-tracking branch 'origin/feat/nv13' into feat/nv13-1.11 2021-06-01 21:06:58 +02:00
Dirk McCormick 6e92c43dd5 feat: add testground versions composition 2021-06-01 10:40:55 -06:00
Dirk McCormick 8997ed508b feat: update to markets-v1.4.0 2021-06-01 10:16:12 -06:00
Łukasz Magiera 5a7f97210f Merge pull request #6317 from filecoin-project/jen/test-datacap-topup
Add test for AddVerifiedClient
2021-06-01 14:41:05 +02:00
Anton Evangelatov 0a79f49dc5 fix tests 2021-06-01 11:45:34 +02:00
Anton Evangelatov e4136b0d42 add modules.StorageAuthWithURL to set correct token 2021-06-01 11:42:28 +02:00
Łukasz Magiera 9cfc275b3d Merge pull request #6365 from XMPPwocky/patch-1
Typo fix in error message: "pubusb" -> "pubsub"
2021-06-01 10:27:43 +02:00
Jennifer Wang fcfc214ed1 Use MockSbBuilder 2021-05-31 20:14:11 -04:00
Mimir ee508120d9 Typo fix in error message: "pubusb" -> "pubsub" 2021-05-31 15:30:10 -07:00
JenniferandŁukasz Magiera ac2887c01b Update api/test/verifreg.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-05-31 16:03:52 -04:00
Łukasz Magiera 3671f2a6ff fix 2k build 2021-05-31 21:52:23 +02:00
Łukasz Magiera 4bf03b485f mod tidy 2021-05-31 21:40:21 +02:00
Łukasz Magiera ffa47659a1 Merge remote-tracking branch 'origin/feat/nv13' into feat/nv13-1.11 2021-05-31 21:38:34 +02:00
Łukasz Magiera c3e8eddb9b Merge remote-tracking branch 'origin/master' into feat/nv13-1.11 2021-05-31 21:24:56 +02:00
Łukasz Magiera 9fd3c8c9af Merge pull request #6226 from filecoin-project/feat/cli-state-call-improvements
Improve the cli state call command
2021-05-31 21:22:45 +02:00
Łukasz Magiera d9aa1fad75 regen cli docs 2021-05-31 21:13:25 +02:00
Alex Wade 2782ea31d3 Improve the cli state call command to accept base64/hex params, and decode result according to method return type 2021-05-31 21:08:45 +02:00
Łukasz Magiera d86c8195dd Merge pull request #6358 from filecoin-project/chore/better_winning_log_harder
Upscale mineOne message to a WARN on unexpected ineligibility
2021-05-31 20:59:08 +02:00
Łukasz Magiera 2d6a159dcc Merge pull request #6041 from filecoin-project/fix/batch-deal-packing
storagefsm: Fix batch deal packing behavior
2021-05-31 20:45:12 +02:00
Łukasz Magiera 20d1523c81 Merge pull request #6359 from filecoin-project/chore/better_winning_log_harderer
Remove few useless variable assignments
2021-05-31 20:27:03 +02:00
Łukasz Magiera 53477c2eea Merge pull request #6360 from filecoin-project/feat/wallet-jwt
lotus-wallet: JWT Support
2021-05-31 20:10:27 +02:00
Peter Rabbitson b6d5b88e9f Pushed the wrong thing >:( 2021-05-31 15:31:40 +02:00
Peter Rabbitson c3a7b59bd1 Remove few useless variable assignments 2021-05-31 15:16:38 +02:00
Peter Rabbitson 039b88740d Upscale mineOne message to a WARN on unexpected ineligibility 2021-05-31 14:53:34 +02:00
Łukasz Magiera 937366f04a lotus-wallet: Describe setup with auth 2021-05-31 14:33:54 +02:00
Łukasz Magiera d7b2f8c0b7 Merge pull request #6357 from filecoin-project/chore/demote_different_genesis_log_message
Reduce noise from 'peer has different genesis' messages
2021-05-31 14:20:37 +02:00
Łukasz Magiera 7d1ae7daf5 lotus-wallet: Support permissioned api 2021-05-31 13:56:35 +02:00
Peter Rabbitson 1e72d8f14c Reduce noise from 'peer has different genesis' messages
After the unification of all networks behind a build-tag, the amount of these
warnings has risen sharply. Reduce it to a debug-level, since it isn't actionable
to an operator.
2021-05-31 13:43:24 +02:00
Łukasz Magiera 47608c1937 wallet: Handle jwt headers 2021-05-31 13:38:14 +02:00
Anton Evangelatov d195a12565 Merge branch 'master' into nonsense/split-market-miner-processes 2021-05-31 11:26:11 +02:00
Łukasz Magiera be3a8bd320 Merge pull request #6355 from filecoin-project/fix/evt-many-called-epoch
events: Fix handling of multiple matched events per epoch
2021-05-31 11:11:15 +02:00
Łukasz Magiera 670913261c Self-review cleanup 2021-05-30 19:37:33 +02:00
Łukasz Magiera f3bf773152 storagefsm: Fix too-long log handling 2021-05-30 19:24:42 +02:00
Łukasz Magiera 6e1919c67f storagefsm: Fix race spawning more than one new sector at once 2021-05-30 18:30:38 +02:00
Łukasz Magiera 9475079b97 Make batch deal input test less flaky 2021-05-30 17:46:22 +02:00
Łukasz Magiera c8d603557b storagefsm: Fix batch deal packing behavior 2021-05-30 17:46:22 +02:00
Łukasz Magiera 3ea39f76e1 events: Fix handling of multiple matched events per epoch 2021-05-30 17:20:14 +02:00
Steve Loeppky 5445b05d0d Merge pull request #6236 from filecoin-project/BigLep-RELEASE_ISSUE_TEMPLATE-patch-1
Update RELEASE_ISSUE_TEMPLATE.md
2021-05-28 17:38:50 -07:00
Jennifer Wang 2b08e9f3a6 Add test AddVerifiedClient 2021-05-28 15:41:57 -04:00
hannahhoward 3fbe2b320d feat(v0api): add list-retrievals to v0 2021-05-27 15:00:31 -07:00
hannahhoward 9e73e43272 fix(cli): add one more error state 2021-05-27 11:48:28 -07:00
hannahhoward 9c2467b17c fix(cli): patch for output given fil-markets IsTerminalError ahving a bug 2021-05-27 11:48:28 -07:00
hannahhoward 19b6dc8d1e feat(cli): add a list retrievals command
Currently, there is no way to inspect retrievals on a client. This adds said command, allow with
corresponding APIs
2021-05-27 11:48:25 -07:00
Anton Evangelatov 46a368d2b9 bump api ver 2021-05-27 13:35:54 +02:00
Łukasz Magiera 1e4456138e Merge master into feat/nv13 2021-05-27 12:28:20 +02:00
Łukasz Magiera 6267832504 Merge pull request #6339 from yaohcn/get-sp
Get current seal proof when necessary
2021-05-27 11:14:13 +02:00
Łukasz Magiera 83976cfd2d Merge pull request #6333 from filecoin-project/asr/genesis-actor
Allow starting networks from arbitrary actor versions
2021-05-27 11:07:43 +02:00
Anton Evangelatov c311520968 add missing messagepool override 2021-05-27 10:28:41 +02:00
yaohcn d04e7d98ce Get current seal proof when necessary 2021-05-27 11:53:33 +08:00
Aayush Rajasekaran d9e86afa24 Tweak client calcDealExpiration to consider genesis miners 2021-05-26 21:46:37 -04:00
Łukasz Magiera 3cdd06b719 Merge pull request #6334 from filecoin-project/del-tracing-log-line
Remove log line when tracing is not configured
2021-05-27 00:03:50 +02:00
Cory Schwartz e24f24bc71 Remove log line when tracing is not configured 2021-05-26 10:45:04 -07:00
Aayush Rajasekaran 1ad2c4dab0 Make devnets work again 2021-05-26 12:48:19 -04:00
Aayush Rajasekaran 7714537239 Allow starting networks from arbitrary actor versions 2021-05-26 12:48:14 -04:00
Anton Evangelatov 9979de24db logs and defaults 2021-05-26 12:47:21 +02:00
Łukasz Magiera d7e36b9610 Merge pull request #6330 from filecoin-project/revert-6305-asr/genesis-actor
Revert "Allow starting networks from arbitrary actor versions"
2021-05-26 12:37:31 +02:00
Łukasz Magiera 43c62f4406 Revert "Allow starting networks from arbitrary actor versions" 2021-05-26 12:33:08 +02:00
Łukasz Magiera 409f96d716 Merge pull request #6323 from filecoin-project/feat/separate-tracing-env-vars
separate tracing environment variables
2021-05-26 12:07:17 +02:00
Łukasz Magiera 930f2b4049 Merge pull request #6305 from filecoin-project/asr/genesis-actor
Allow starting networks from arbitrary actor versions
2021-05-26 10:19:23 +02:00
Cory Schwartz d50b59b4c7 don't scare the gosec linter 2021-05-25 23:55:46 -07:00
Cory Schwartz e6b631078f update jaeger documentation 2021-05-25 23:53:08 -07:00
Aayush Rajasekaran cf574ca9a1 Allow starting networks from arbitrary actor versions 2021-05-25 19:30:20 -04:00
Raúl Kripalani 2bcedcf55f initial version of the new itest kit.
Still need to migrate all integration tests, add godocs,
and probably zap bugs.
2021-05-26 00:04:13 +01:00
Aayush Rajasekaran 10927daa53 Merge pull request #6322 from filecoin-project/feat/dispute-log
feat: log dispute rate
2021-05-25 14:21:12 -04:00
Łukasz Magiera ef6db7de07 Merge pull request #6291 from filecoin-project/asr/min-power
Use new actor tags
2021-05-25 20:06:20 +02:00
Aayush Rajasekaran d42eda4336 Use new actor tags 2021-05-25 13:02:49 -04:00
Peter Rabbitson c2e5a837e6 Adjust various CLI display ratios to arbitrary precision
Originally the deviations from using float64 were insignificant, but at
exabyte scale they start to show up. Cleanup all displays, and clarify
the expectation text, adding an extra 99.9% probability calculator to
`lotus-miner info`
2021-05-25 14:09:01 +02:00
Cory Schwartz 273368ed6a separate tracing environment variables 2021-05-25 01:23:33 -07:00
Steven Allen 995efe4584 feat: log dispute rate
This way we can see if/when we need to optimize this code.
2021-05-24 16:31:50 -07:00
Łukasz Magiera 216fa5c965 Merge pull request #6310 from filecoin-project/chore/better_winning_log
Fix logging around mineOne
2021-05-24 19:38:06 +02:00
Jennifer Wang 391d6eca49 make lint happy 2021-05-24 10:04:37 -04:00
aarshkshah1992 1b5c1f0588 test unsealed ask 2021-05-24 18:25:12 +05:30
Łukasz Magiera 05082e262a Merge pull request #6316 from Aloxaf/fix_completion
Fix shell completions
2021-05-24 13:44:02 +02:00
aarshkshah1992 0f3ff9e06a fix typo 2021-05-24 15:22:11 +05:30
aarshkshah1992 ac443cd758 go mod tidy 2021-05-24 15:20:13 +05:30
aarshkshah1992 78255eac54 test unsealing prices for default pricing strategy 2021-05-24 15:11:50 +05:30
Aloxaf 559c76a214 Fix shell completions 2021-05-24 15:00:47 +08:00
Raúl Kripalani f6a7f21def Merge branch 'raulk/refactor-rpc' into raulk/itests 2021-05-23 22:00:49 +01:00
Raúl Kripalani 57dab5b71c remove previously redundant context. 2021-05-23 19:12:13 +01:00
Raúl Kripalani 75c88d0385 make gateway tests use gateway rpc setup methods. 2021-05-23 18:57:04 +01:00
Raúl Kripalani d8d48953d9 Merge branch 'raulk/refactor-rpc' into raulk/itests 2021-05-23 18:47:55 +01:00
Raúl Kripalani 188688c9ce refactor gateway rpc. 2021-05-23 18:37:53 +01:00
Raúl Kripalani c3f45cc836 Merge branch 'raulk/refactor-rpc' into raulk/itests 2021-05-23 14:56:54 +01:00
Raúl Kripalani 2337248aa5 rpc: separate handlers/server; refactor miner rpc. 2021-05-23 14:48:42 +01:00
Raúl Kripalani 627248d610 Merge branch 'raulk/refactor-rpc' into raulk/itests 2021-05-23 12:41:25 +01:00
Raúl Kripalani de454b8e26 add godocs to ServeRPC. 2021-05-23 12:40:33 +01:00
Peter Rabbitson 3a74ab8f82 Add a lateStart indicator, differentiate on Error/Warn/Info 2021-05-22 23:57:45 +02:00
aarshkshah1992 dc6dbc9a11 dpr changes and test based on new unsealing PR 2021-05-22 22:40:21 +05:30
Peter Rabbitson 888c63b79c Incorporate the 'Time delta between now...' log into the 'completed mineOne' 2021-05-22 17:39:56 +02:00
Raúl Kripalani 5b77dbd06f decouple rpc server and shutdown logic from cmd. 2021-05-21 21:34:17 +01:00
Raúl Kripalani f08c792686 minor renames. 2021-05-21 20:39:41 +01:00
Raúl Kripalani 416340d227 fix paych test; re-add pubsub bootstrapping. 2021-05-21 19:46:58 +01:00
Łukasz Magiera 0f83515a4a Merge pull request #6312 from filecoin-project/feat/8MB-devnet
Allow 8MB sectors in devnet
2021-05-21 19:54:31 +02:00
Dirk McCormick 714702f278 feat: allow 8MB sectors in devnet 2021-05-21 10:37:09 -06:00
Raúl Kripalani 63f929541f itests: fix gateway tests parameters. 2021-05-21 17:20:56 +01:00
Łukasz Magiera 58203559e7 Merge pull request #6304 from yaohcn/fix-ticket
fix ticket expired
2021-05-21 16:07:28 +02:00
Raúl Kripalani bf36891972 fix lint errors. 2021-05-21 15:02:03 +01:00
Raúl Kripalani 2e9b0f0895 adapt cmd/lotus-storage-miner tests. 2021-05-21 14:52:30 +01:00
aarshkshah1992 50e023edd3 changes as per review 2021-05-21 19:15:05 +05:30
aarshkshah1992 2c9f5922b5 logs to debug read & unseal 2021-05-21 19:02:37 +05:30
aarshkshah1992 8ff5bce7a3 logs to debug read and unseal 2021-05-21 19:01:17 +05:30
Peter Rabbitson aed7017ab2 Forgotten deadcode 2021-05-21 15:30:08 +02:00
Peter Rabbitson 308d1e9b7c Fix logging around mineOne
- A nil MiningBaseInfo is *NOT* unexpected: it happens when one is in penalty
  https://github.com/filecoin-project/lotus/blob/v1.9.0/chain/stmgr/utils.go#L500-L502

- Remove the log from IsRoundWinner(): all we care about is the randbase epoch
2021-05-21 15:00:21 +02:00
Raúl Kripalani b56568d720 fix client tests. 2021-05-21 13:56:04 +01:00
Raúl Kripalani 20dfe220f3 fix lifecycle of BlockMiner. 2021-05-21 13:39:09 +01:00
aarshkshah1992 fb29f782df integration test should remove unsealed files 2021-05-21 16:15:08 +05:30
aarshkshah1992 536d7c4275 clean up logging 2021-05-21 15:50:25 +05:30
aarshkshah1992 40642b2cad better logging 2021-05-21 15:16:20 +05:30
aarshkshah1992 85f2ac8789 more logging 2021-05-21 14:56:37 +05:30
Łukasz Magiera 2e279b2ba8 Merge pull request #6202 from filecoin-project/feat/snapcraft
oh, snap!
2021-05-21 11:26:16 +02:00
Łukasz Magiera 807c670184 Merge pull request #6135 from filecoin-project/asr/verifreg
Move verifreg shed utils to CLI
2021-05-21 11:21:38 +02:00
aarshkshah1992 78a0458ada finish integration tests 2021-05-21 11:00:17 +05:30
yaohcn 00a1e2c05b test ticket expired 2021-05-21 11:45:57 +08:00
aarshkshah1992 c17300dc1f remove read task type and run gen and docsgen 2021-05-20 15:25:46 -06:00
aarshkshah1992 50d7acfa0c fix go mod 2021-05-20 15:25:46 -06:00
aarshkshah1992 bd9959070e unit tests for the remote store Reader 2021-05-20 15:25:46 -06:00
aarshkshah1992 9b34494501 use mockgen 2021-05-20 15:25:46 -06:00
aarshkshah1992 31a5f68dfa use an actual worker in the integration tests 2021-05-20 15:25:46 -06:00
Dirk McCormick ec85a973b1 feat: TestPieceProviderReadPiece 2021-05-20 15:25:46 -06:00
aarshkshah1992 8c4c26ca4c fix linting problems 2021-05-20 15:25:46 -06:00
aarshkshah1992 dd9c9fd4fd test http handler 2021-05-20 15:25:46 -06:00
aarshkshah1992 c58048d16a address review comments 2021-05-20 15:25:46 -06:00
Aarsh Shahanddirkmc d33d426692 Apply suggestions from code review
Co-authored-by: dirkmc <dirkmdev@gmail.com>
2021-05-20 15:25:46 -06:00
aarshkshah1992 73613ee883 docs, logs and green ci 2021-05-20 15:25:46 -06:00
aarshkshah1992 2a40c802ea bypass task scheduler for reading unsealed pieces 2021-05-20 15:25:46 -06:00
Łukasz Magiera 2d4eaf08c4 Merge pull request #6233 from nonsense/fix-finalizesector-storage-req
consider storiface.PathStorage when calculating storage requirements
2021-05-20 21:43:55 +02:00
Łukasz Magiera 5f2e163bbb Merge pull request #6259 from filecoin-project/raulk/docs-storage
`storage` module: add go docs and minor code quality refactors
2021-05-20 21:42:30 +02:00
Łukasz Magiera 9ddeb5344f Merge pull request #6306 from filecoin-project/fix/revert-to-libp2p-v0.12.0
Revert "chore: update go-libp2p"
2021-05-20 21:25:47 +02:00
Dirk McCormick 885564fe24 Revert "chore: update go-libp2p"
This reverts commit f7fbaef361.
2021-05-20 11:22:19 -06:00
Raúl Kripalani 25daa0c8e4 itests: create deal harness. 2021-05-20 16:12:42 +01:00
yaohcn e21d4d7a7e fix ticket expired 2021-05-20 20:08:24 +08:00
Anton Evangelatov 8d3d3c88d4 introduce init service, refactor restore service 2021-05-20 13:25:54 +02:00
Anton Evangelatov 9a7b0b657e comment 2021-05-20 13:18:56 +02:00
Raúl Kripalani 1902c4c687 itests: rename Builder methods. 2021-05-20 12:17:41 +01:00
Anton Evangelatov 19bd5beb96 update remoteGetSector 2021-05-20 13:15:57 +02:00
Anton Evangelatov 1a9b5760a7 add remoteGetAllocated http handler 2021-05-20 13:14:25 +02:00
Anton Evangelatov 90928991b3 remove DealInfo and DealSchedule from storage-sealing gen/main.go 2021-05-20 13:11:10 +02:00
Anton Evangelatov 4693c61305 re-arrange NodeBuilder and add storageminer_svc 2021-05-20 13:10:14 +02:00
Anton Evangelatov 76bb424de0 update StorageMinerAPI 2021-05-20 13:01:14 +02:00
Raúl Kripalani 06b8ee5b95 Merge branch 'master' into raulk/itests 2021-05-20 11:56:43 +01:00
Anton Evangelatov cb603c62d9 update retrievaladapter ; add piece_provider 2021-05-20 12:49:53 +02:00
Anton Evangelatov c12d802811 update reader to use ReadAtLeast 2021-05-20 12:38:38 +02:00
Anton Evangelatov 2562f2e9a6 add ReaderParamDecoder to json rpc server to lotus-miner run 2021-05-20 12:36:24 +02:00
Anton Evangelatov 2aad7b6979 update sectorstorage.New (Manager) interface 2021-05-20 12:32:29 +02:00
Jennifer 6f55031faa Merge pull request #6300 from filecoin-project/feat/increase-data-transfer-timeouts
Increase data transfer timeouts
2021-05-20 01:03:00 -04:00
Łukasz Magiera e0a520cb65 Merge pull request #6294 from filecoin-project/raulk/refactor-gateway
gateway: spin off from cmd to package
2021-05-19 20:59:37 +02:00
Dirk McCormick 706fdcbb80 feat: increase data transfer timeouts 2021-05-19 12:56:07 -06:00
Łukasz Magiera 3a99f95f8e Merge pull request #6149 from filecoin-project/feat/markets-1.3
Update to markets 1.3
2021-05-19 20:51:33 +02:00
Raúl Kripalani ac4f3ab684 remove duplicated vars. 2021-05-19 18:17:38 +01:00
Raúl Kripalani 2a70ff96bf move the gateway test to itests package. 2021-05-19 17:34:48 +01:00
Raúl Kripalani 6f4349064a fix bad rename. 2021-05-19 17:30:43 +01:00
Raúl Kripalani 5d34c8b7da wip move MineUntilBlock under BlockMiner; other simplifications. 2021-05-19 17:30:43 +01:00
Raúl Kripalani 2a71c47397 simplify BlockMiner. 2021-05-19 17:30:43 +01:00
Raúl Kripalani 0cfef0fdbb wip extract test kit. 2021-05-19 17:30:43 +01:00
Raúl Kripalani 41d0818347 wip pull all integration tests under itests/ 2021-05-19 17:30:43 +01:00
Raúl Kripalani c46d4ae529 wip 2021-05-19 17:30:43 +01:00
Raúl Kripalani 625b18771d remove duplicated vars. 2021-05-19 17:30:06 +01:00
Aayush Rajasekaran 20a0d32e50 Merge pull request #6290 from filecoin-project/asr/power-state
Add a shed util to count 64 GiB miner stats
2021-05-19 11:37:30 -04:00
raulkanddirkmc 996feda1f7 typo.
Co-authored-by: dirkmc <dirkmdev@gmail.com>
2021-05-19 15:08:14 +01:00
Raúl Kripalani 88c6642330 restructure gateway.
Move the gateway implementation to the `gateway` top-level
package. cmd/lotus-gateway now contains only the entrypoint.

This separation is important for the testing refactors.
2021-05-19 12:45:55 +01:00
Anton Evangelatov 1295c924e1 confirm that Miner struct satisfies sectorblocks.SectorBuilder 2021-05-19 13:22:00 +02:00
Anton Evangelatov 83e55dc09e move handleProvingSector to correct file - states_proving.go 2021-05-19 13:17:59 +02:00
Anton Evangelatov 55401116bb add UnpaddedByteIndex.Valid() 2021-05-19 13:16:29 +02:00
Anton Evangelatov e275b54f55 export PartialFile and OpenPartialFile 2021-05-19 13:14:16 +02:00
Anton Evangelatov 87ed228fd3 extract pushUrl and fix return type for worker RPC v0 2021-05-19 13:10:56 +02:00
Anton Evangelatov a989f60e27 add SectorAddPieceToAny and SectorUnsealPiece to StorageMiner iface; model moved to api package - PieceDealInfo, DealSchedule 2021-05-19 13:05:07 +02:00
Łukasz Magiera 081a2ed89a Merge pull request #6289 from filecoin-project/asr/codeowners
Delete CODEOWNERS
2021-05-19 11:43:00 +02:00
Aayush Rajasekaran fc7ea8dfa3 Useful tool 2021-05-18 21:13:12 -04:00
Aayush Rajasekaran 9837fe27d7 Delete CODEOWNERS 2021-05-18 19:14:15 -04:00
Jennifer d3ad897fe9 Merge pull request #6275 from filecoin-project/releases
Merge v1.9.0 to master
2021-05-17 20:01:01 -04:00
Jennifer Wang 6e57c819e0 bump the master version to v1.11.0-dev 2021-05-17 17:41:11 -04:00
Jennifer Wang 9954577389 Merge branch 'master' into releases 2021-05-17 17:24:29 -04:00
Jennifer 987b9888d5 Merge pull request #6272 from filecoin-project/feat/proof-v7.0.1
Backport 6200 to master
2021-05-17 15:45:58 -04:00
Łukasz Magiera 71bd005594 wip 2021-05-17 13:31:43 -04:00
Aayush Rajasekaran 9a6e601754 Merge pull request #5961 from filecoin-project/feat/stateless-offline-dealflow
Introduce stateless offline dealflow, bypassing the FSM/deallists
2021-05-17 12:35:39 -04:00
Łukasz Magiera 867c52b8ed Merge pull request #6231 from filecoin-project/chore/update-libp2p
chore: update go-libp2p
2021-05-17 18:20:22 +02:00
Łukasz Magiera 6db2faea2c Merge pull request #6246 from filecoin-project/fix/6244
fix: wait-api should use GetAPI to acquire binary specific API
2021-05-17 17:41:59 +02:00
Raúl Kripalani 50360e68ae rename {changeHandlerAPI=>wdPoStCommands} + add docs. 2021-05-15 15:07:02 +01:00
Raúl Kripalani c77f8fb382 adopt clearer method names; fix typo. 2021-05-15 15:07:02 +01:00
Jennifer 72fc16e8a7 Update RELEASE_ISSUE_TEMPLATE.md 2021-05-14 23:18:04 -04:00
Jennifer 5611770639 Merge pull request #6256 from filecoin-project/mg/fix/ci-publish
fix(ci): Updates to lotus CI build process
2021-05-14 22:29:19 -04:00
Mike Greenberg eccdff459e fix(ci): Conditional announcement and prerelease on RC tag 2021-05-14 19:16:31 -04:00
Raúl Kripalani 9912212949 minor refactor to anonymize interface. 2021-05-14 20:08:22 +01:00
Raúl Kripalani 28efa9357c rename {setSender=>prepareMessage}. 2021-05-14 19:49:05 +01:00
Raúl Kripalani 0f4270126f rename {submitPost=>submitPoStMessage}. 2021-05-14 19:48:38 +01:00
Raúl Kripalani 89dfb0ba19 minor refactor, renames, docs in Miner#Run. 2021-05-14 19:47:50 +01:00
Raúl Kripalani 0187aa6d9c imports reorder. 2021-05-14 19:46:46 +01:00
Raúl Kripalani 2d7f4b1c61 docs: add godocs to storage module. 2021-05-14 19:45:47 +01:00
Mike Greenberg 314be51e1b fix(ci): Use recent ubuntu LTS release; Update release params 2021-05-14 14:15:08 -04:00
Aayush Rajasekaran 9ffd4ada29 Merge pull request #6247 from filecoin-project/feat/gateway-lookback-flags
add flags to control gateway lookback parameters
2021-05-14 11:18:01 -04:00
Jennifer b8eb2bec12 Merge pull request #6248 from filecoin-project/feat/nerpa-v4
Feat/nerpa v4
2021-05-13 17:47:51 -04:00
Jennifer Wang 3910d7cb4a Upgrade nerpa to actor v4 around May 27th 1600 ET 2021-05-13 16:04:38 -04:00
whyrusleeping b4b38788ef add flags to control gateway lookback parameters 2021-05-13 11:00:42 -07:00
Jakub Sztandera 624f5969b3 fix: wait-api should use GetAPI to acquire binary specific API
Fixes #6244

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-13 19:58:15 +02:00
Aayush Rajasekaran 7ce1312fc2 Merge pull request #6238 from filecoin-project/mg/chore/enable-build-on-rc-tags
chore(ci): Enable build on RC tags
2021-05-13 12:00:11 -04:00
Raúl Kripalani c7d50fe195 rename {storageMinerApi=>fullNodeFilteredAPI}; add docs. 2021-05-13 14:36:16 +01:00
Raúl Kripalani 1d6941b0eb rename storage/{sealing=>miner_sealing}.go 2021-05-13 14:33:35 +01:00
Raúl Kripalani 5daacc0f07 docs: add docs to chain store methods. 2021-05-13 13:08:52 +01:00
Raúl Kripalani df7631df77 docs: rename some wdpost methods; add docs. 2021-05-13 13:07:42 +01:00
Mike Greenberg 9fb4bea9ab chore(ci): Enable build on RC tags 2021-05-12 14:31:34 -04:00
Steve Loeppky 60dca635f4 Update RELEASE_ISSUE_TEMPLATE.md
Update RELEASE_ISSUE_TEMPLATE.md to account for binaries and improving along the way.
2021-05-12 09:55:52 -07:00
Aayush Rajasekaran 8d86dec653 Merge pull request #5913 from chadwick2143/lotus-shed-actor
Transplant some useful commands to lotus-shed actor
2021-05-12 07:22:06 -04:00
chenliang 3b7a5c70c3 Merge branch 'master' into lotus-shed-actor 2021-05-12 11:03:49 +08:00
Anton Evangelatov eb13c74dce panic on unknown pathType 2021-05-11 18:14:01 +02:00
Anton Evangelatov e07438417c consider storiface.PathStorage when calculating storage requirements 2021-05-11 13:19:26 +02:00
Peter Rabbitson d54ed1b0c6 Merge remote-tracking branch 'origin/master' into feat/stateless-offline-dealflow 2021-05-11 04:54:22 +02:00
Peter Rabbitson 0019187a4f Forgotten pre-API zero-price check 2021-05-11 04:44:07 +02:00
Steven Allen f7fbaef361 chore: update go-libp2p
From 0.12.0 to 0.14.0.

Headline for lotus: faster yamux.
2021-05-10 19:41:57 -07:00
Peter Rabbitson 6f71eab8ce Adjust lp2p retry params 2021-05-11 04:26:04 +02:00
Aayush Rajasekaran bf10b051ff Merge pull request #6108 from filecoin-project/feat/actors-codegen
wip actor wrapper codegen
2021-05-10 20:12:57 -04:00
Aayush Rajasekaran 8465a97c4b Merge pull request #5822 from filecoin-project/epic/robust-message-management
Robust message management
2021-05-10 19:58:33 -04:00
Aayush Rajasekaran 5f821cc733 Generate builtin.go 2021-05-10 19:53:07 -04:00
Aayush Rajasekaran c95206cde1 Add reminder for NewestNetworkVersion to actors version checklist 2021-05-10 19:46:44 -04:00
Aayush Rajasekaran 60446b46c8 Generate policy.go 2021-05-10 19:46:44 -04:00
Łukasz Magiera cd2b959a88 wip partial codegen 2021-05-10 19:46:44 -04:00
Łukasz Magiera a80259d986 Actor upgrade checklist 2021-05-10 19:46:44 -04:00
Łukasz Magiera 94d3c8bed7 fix lint 2021-05-10 19:46:44 -04:00
Łukasz Magiera c6cebb448f Cleanup actor adapter templates 2021-05-10 19:46:44 -04:00
Łukasz Magiera 715b3dccec Fix error message 2021-05-10 19:46:44 -04:00
Łukasz Magiera 1a84bd5842 chain actors: codegen templates for all actors 2021-05-10 19:46:44 -04:00
Łukasz Magiera 0db070779f wip actor wrapper codegen 2021-05-10 19:46:44 -04:00
Aayush Rajasekaran 9977cb2604 Merge pull request #6169 from filecoin-project/asr/shed-minertypes
Add a shed util to count miners by post type
2021-05-10 19:45:52 -04:00
Aayush Rajasekaran e5587119fe Merge pull request #5826 from filecoin-project/asr/release-template
Introduce a release issue template
2021-05-07 13:09:35 -04:00
Jakub Sztandera 18cbdcfc81 Disable checks API on Lotus Lite
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 17:19:17 +02:00
Jakub Sztandera d777680449 Fix mpool.GetActor for lite node
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:06 +02:00
Jakub Sztandera 61dbd443b8 Fix tests and verifreg
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:05 +02:00
Jakub Sztandera cbfb4770fd Add function to display nanoFIL
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:05 +02:00
Jakub Sztandera 5f638b4193 Print more details on test fail
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:05 +02:00
Jakub Sztandera 8d75da1629 Use MessagePrototype for check API
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:05 +02:00
Jakub Sztandera 3d8f641310 Plug in InteractiveSend to all adopted commands
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:05 +02:00
Jakub Sztandera 7535c5bb53 Add mpool manage command
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:05 +02:00
Jakub Sztandera 87df73a455 Fix get nonce check
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:05 +02:00
vyzo e2d0047a2a introduce message prototypes
This introduces message prototypes to applicable API endpoints, which
allows us to invert control of message sending and give the user a
chance to intervene with an interactive ui.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:05 +02:00
Jakub Sztandera 86e90dc6f1 Message sending UI
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:04 +02:00
vyzo d782250aba implement MessagePool.CheckReplaceMessages
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:04 +02:00
vyzo 91e774063e implement MessagePool.CheckMessages
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:04 +02:00
vyzo ed61642b3a implement NodeStatus API
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-07 15:30:04 +02:00
Jennifer e3948c851f Update documentation/misc/RELEASE_ISSUE_TEMPLATE.md 2021-05-07 00:09:11 -04:00
Jennifer fac9994c02 Update documentation/misc/RELEASE_ISSUE_TEMPLATE.md 2021-05-07 00:08:23 -04:00
Jennifer 25b4ffd09b Update documentation/misc/RELEASE_ISSUE_TEMPLATE.md 2021-05-07 00:06:46 -04:00
Cory Schwartz 838369229c downgrade to core18 2021-05-06 16:28:27 -07:00
Cory Schwartz 026cd103c2 add snapcraft 2021-05-06 15:36:11 -07:00
ZenGround0 d7cd8bae2c Merge pull request #6178 from filecoin-project/shed/count-crons-rebased
cron-wc
2021-05-06 11:08:57 -04:00
Aayush Rajasekaran 00ee0b1bbb Merge pull request #6196 from filecoin-project/feat/fwdport_more_logs_PR6183
This is a 1:1 forward-port of PR#6183 from 1.9.x to master
2021-05-06 10:55:57 -04:00
ZenGround0 5351db9da7 Lint 2021-05-06 10:17:25 -04:00
Peter Rabbitson e648b72d8d Merge remote-tracking branch 'origin/master' into feat/stateless-offline-dealflow 2021-05-06 15:57:10 +02:00
ZenGround0 e1185dd5b5 cron-wc 2021-05-06 09:53:29 -04:00
Dirk McCormick 312ad4abdc feat: update to markets v1.3.0 2021-05-06 10:58:23 +02:00
Peter Rabbitson de60229957 mining lookback is effectively a constant - make it so 2021-05-06 10:18:08 +02:00
Peter Rabbitson b1db3fee78 Log more ComputeVRF() inputs as per Why's request 2021-05-06 10:18:08 +02:00
Peter Rabbitson 72134ff458 Add a mining-heartbeat INFO line at every epoch 2021-05-06 10:18:08 +02:00
Dirk McCormick c17a340f2e feat: deals end to end test with restarts 2021-05-06 09:49:44 +02:00
Dirk McCormick 5b1fab8ffa feat: markets v1.3 2021-05-06 09:49:44 +02:00
Jennifer b14c467fb4 Update documentation/misc/RELEASE_ISSUE_TEMPLATE.md 2021-05-05 14:28:48 -04:00
Aayush Rajasekaran f6360c34dd Add verifreg utils to CLI 2021-05-03 22:16:12 -04:00
Aayush Rajasekaran c074031fa1 Merge pull request #6167 from filecoin-project/asr/state-tree-version
Allow creation of state tree v3s
2021-05-03 19:16:44 -04:00
Aayush Rajasekaran 2a90de30bd Merge pull request #6164 from filecoin-project/fix/drand-cache
drand: fix beacon cache
2021-05-01 12:21:38 -04:00
Aayush Rajasekaran edc6a63e93 Add a shed util to count miners by post type 2021-05-01 00:24:14 -04:00
Aayush Rajasekaran 4193235b59 Allow creation of state tree v3s 2021-04-30 22:41:02 -04:00
Łukasz Magiera 0d253c3e64 Merge pull request #6155 from filecoin-project/fix/cligen
Update cli gen
2021-04-30 18:04:10 +02:00
Łukasz Magiera 5cc94dcdf9 Merge pull request #6148 from filecoin-project/feat/mpool-nv12-clean
mpool: Cleanup pre-nv12 selection logic
2021-04-30 18:01:02 +02:00
Łukasz Magiera cad781c8ee Update cli gen 2021-04-30 17:59:01 +02:00
Łukasz Magiera dc475c2720 Merge pull request #6150 from filecoin-project/feat/proofs-v7
Update ffi to proofs v7
2021-04-30 17:57:55 +02:00
Łukasz Magiera 19ced50d81 Update ffi to proofs v7 2021-04-30 14:28:36 +02:00
Łukasz Magiera e855b80b01 Merge pull request #6145 from filecoin-project/feat/cli-doc-gen
Generate CLI docs
2021-04-30 12:44:05 +02:00
Łukasz Magiera 3574ec3d9d cli docsgen: Ignore build type too 2021-04-30 11:18:15 +02:00
Łukasz Magiera 04c71b2c6b mpool: Cleanup pre-nv12 selection logic 2021-04-30 10:10:42 +02:00
Łukasz Magiera ab811e2e19 drand: fix beacon cache 2021-04-30 09:35:38 +02:00
Steven Allen eb10918470 Merge pull request #6107 from filecoin-project/feat/checkpoint-sync
feat: allow checkpointing to forks
2021-04-29 16:30:52 -07:00
Łukasz Magiera 4db800473f Merge pull request #5988 from filecoin-project/feat/proper-padding
attempt to do better padding on pieces being written into sectors
2021-04-29 21:14:32 +02:00
Łukasz Magiera 462a44902e Merge pull request #5968 from filcloud/ping-ask
remove duplicate ask and calculate ping before lock
2021-04-29 21:12:37 +02:00
Łukasz Magiera a55168aa86 Merge pull request #5307 from filecoin-project/asr/deal-dues
Add a command to get the fees of a deal
2021-04-29 20:43:47 +02:00
Łukasz Magiera ed08366cac Run cli docsgen in CI 2021-04-29 20:01:23 +02:00
whyrusleeping 7e4d906f06 update commp utils import 2021-04-29 10:59:28 -07:00
Łukasz Magiera 483478d511 Generate cli docs 2021-04-29 19:45:01 +02:00
Łukasz Magiera 51ca7aa79a scripts: Some improvements to cli gen script 2021-04-29 19:44:39 +02:00
Aayush Rajasekaran e6779b0b6f Add a command to get the fees of a deal 2021-04-29 13:29:17 -04:00
whyrusleeping a590fb6a12 mod tidy for the magik 2021-04-29 10:28:33 -07:00
whyrusleeping ac77c51d5e address nit 2021-04-29 10:24:16 -07:00
Łukasz Magiera 12867a567b Merge branch 'master' of github.com:MitchellSoo/lotus into feat/cli-doc-gen 2021-04-29 19:23:33 +02:00
Łukasz Magiera 9b87566dbf Merge pull request #6141 from filecoin-project/split-TestBatchDealInput-from-TestAPIDealFlow
flaky tests improvement: separate TestBatchDealInput from TestAPIDealFlow
2021-04-29 19:01:35 +02:00
Łukasz Magiera 84d7565cee Merge pull request #5887 from filecoin-project/feat/gh-action-testground-prs
Testground checks on push
2021-04-29 19:00:21 +02:00
Łukasz Magiera dd2b44351c Drop graphsync testplan from CI 2021-04-29 18:50:13 +02:00
Łukasz Magiera c548bb3c4c Merge pull request #6132 from filecoin-project/asr/state-miner-cli
Add a CLI tool for miner proving deadline
2021-04-29 18:37:16 +02:00
Steven Allen f983fa8cd5 Merge pull request #6134 from filecoin-project/asr/emptytsk
Use EmptyTSK where appropriate
2021-04-29 09:35:43 -07:00
Łukasz Magiera 002eb4e812 Merge pull request #6142 from filecoin-project/fix/tipset-cli
fix: use a consistent tipset in commands
2021-04-29 18:35:17 +02:00
Cory Schwartz 05dbe5cbbe checks on push 2021-04-29 18:32:21 +02:00
Łukasz Magiera 492b026031 Merge pull request #6124 from filecoin-project/testplans-go-mod
go mod tidy for lotus-soup testplans
2021-04-29 18:31:32 +02:00
Łukasz Magiera f036abdff7 Merge pull request #6126 from filecoin-project/reduce-miners-pay-channel-tests
fix testground payment channel tests: use 1 miner
2021-04-29 18:30:41 +02:00
Łukasz Magiera 8929f767ff Merge pull request #6143 from filecoin-project/fix/list-actors-parent-state
fix: use the parent state when listing actors
2021-04-29 18:18:18 +02:00
Steven Allen 2857f6c0ed fix: use a consistent tipset in commands
It's very easy to write an incorrect command that operates over
different heads by using the "empty" tipset. This change makes the
`LoadTipSet` command helper get the latest head from the lotus daemon if
its unset.

The cost is an extra call to get the head. That should be trivial in
most cases.
2021-04-29 08:50:08 -07:00
Anton Evangelatov c7d74ef16e separate TestBatchDealInput from TestAPIDealFlow 2021-04-29 17:39:00 +02:00
Steven Allen 4867425685 fix: use the parent state when listing actors
To be consistent with other commands.
2021-04-28 23:35:27 -07:00
Łukasz Magiera a456f394ac Merge pull request #6007 from filecoin-project/asr/state-list-messages
Speed up StateListMessages in some cases
2021-04-29 07:47:26 +02:00
Łukasz Magiera 4b04cac219 Merge pull request #4938 from filecoin-project/asr/total-power
Return total power when GetPowerRaw doesn't find miner claim
2021-04-29 07:45:43 +02:00
Steven Allen 83ec2b53ee Merge pull request #6133 from filecoin-project/fix/head-change-panic-splitstore
fix(splitstore): fix a panic on revert-only head changes
2021-04-28 22:25:28 -07:00
Steven AllenandAayush Rajasekaran f353a794cb fix: spelling
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-04-28 22:08:37 -07:00
Aayush Rajasekaran d794b49df3 Use EmptyTSK where appropriate 2021-04-29 01:00:03 -04:00
Steven Allen 63db9e1633 fix(splitstore): fix a panic on revert-only head changes
Calling, e.g., `lotus chain sethead` on an ancestor tipset won't apply
any new blocks, it'll just revert a bunch. This will lead to HeadChange
calls with no new blocks to apply.

fixes #6125
2021-04-28 20:35:30 -07:00
Steven Allen b23837a7d6 Merge pull request #5847 from filecoin-project/steb/audit-dups
shed: command to list duplicate messages in tipsets (steb)
2021-04-28 18:31:01 -07:00
Steven Allen bcfad6b2bb fix(lotus-shed): sanity check start height for dup check 2021-04-28 17:51:25 -07:00
Steven Allen 701682c98a feat(lotus-shed): make it possible to filter by to/from when checking dups 2021-04-28 17:43:07 -07:00
Aayush Rajasekaran 895e968ff9 Add a CLI tool for miner proving deadline 2021-04-28 20:27:16 -04:00
lotus 77eefcd6d8 feat(lotus-shed): improve duplicate-messages audit command
- Allow a start/end epoch.
- Print one line per duplicate set.
- Allow filtering duplicate messages by method number.
- Make the number of threads configurable.
2021-04-28 17:03:37 -07:00
Łukasz Magiera c8fcab5d22 shed: Command to list duplicate messages in tipsets 2021-04-28 16:23:35 -07:00
Steven Allen 8f309b214b chain: move checkpoint logic into chainstore
That way, checkpoints can be enforced by the chainstore, removing a
potential race where an in-progress sync of a fork could bypass a sync
checkpoint.
2021-04-28 15:06:29 -07:00
Steven Allen 0ad51f8a14 test(sync): fix tipset check and re-enable checkpoint tests
We need to wait until the node _has_ the tipset, not until it doesn't.

This probably only worked before due to race conditions.

fixes #4716 (probably)
2021-04-28 15:06:29 -07:00
Steven Allen 69da6a2a29 feat: allow checkpointing to forks
Previously, `lotus sync checkpoint` would only checkpoint on the current
chain. Now, it can switch to a new fork.
2021-04-28 13:54:26 -07:00
Anton Evangelatov 5769a45380 use 1 miner for payment channel tests 2021-04-28 16:58:03 +02:00
Anton Evangelatov bc8d6a1d87 go mod tidy for lotus-soup testplans 2021-04-28 14:36:20 +02:00
Łukasz Magiera 4688da5178 Merge pull request #6122 from filecoin-project/fix-lotus-soup-3-1-deals-end-to-end
upgrade `lotus-soup` testplans and reduce deals concurrency to a single miner
2021-04-28 14:24:47 +02:00
Anton Evangelatov 0304bebf20 remove deals concurrency 2021-04-28 13:38:18 +02:00
whyrusleeping 48feb52cbf add a test for adding padded pieces 2021-04-27 16:28:25 -07:00
whyrusleeping 6daaf6ac2e attempt to do better padding on pieces being written into sectors 2021-04-27 11:39:06 -07:00
Anton Evangelatov a9e4a0d22b upgrade docker images 2021-04-27 16:28:57 +02:00
Łukasz Magiera 7e25a811c3 Merge pull request #6118 from filecoin-project/releases
Merge releases (1.8.0) into master
2021-04-27 10:15:17 +02:00
Steven Allen 26d14a6262 fix: partially support v2+ go modules
This patch supports branch-based v2 modules, but not
directory-based (i.e., not vN modules with `vN/` directories).
2021-04-21 13:00:19 -07:00
chadwick2143 2cb3c89570 Fix bugs in sectors extend --v1-sectors 2021-04-20 14:00:01 +08:00
Frank b9cd364535 update ping lock 2021-04-20 10:26:02 +08:00
Frank c915170b58 remove duplicate ask and calculate ping before lock 2021-04-20 10:20:30 +08:00
chadwick2143 cba911ab5e Add actorControlList command 2021-04-14 16:37:59 +08:00
chadwick2143 8972152eb1 Set MaxFee for lotus-shed actor withdraw to 0.1FIL 2021-04-14 16:34:57 +08:00
Łukasz Magiera 34aa267100 Make mkreleaselog work a bit more 2021-04-13 12:20:30 +02:00
Łukasz Magiera 0bc94b554c Refer to scripts/mkreleaselog 2021-04-13 12:02:10 +02:00
Aayush Rajasekaran ff48a70ed9 Speed up StateListMessages in some cases 2021-04-10 02:33:34 -04:00
Aayush Rajasekaran b6949aa4ba Incorporate feedback into release issue template 2021-04-08 01:36:24 -04:00
Aayush RajasekaranandJennifer 536d267cbb Update documentation/misc/RELEASE_ISSUE_TEMPLATE.md
Co-authored-by: Jennifer <42981373+jennijuju@users.noreply.github.com>
2021-04-08 01:36:04 -04:00
Aayush RajasekaranandJennifer 55aebd199b Update documentation/misc/RELEASE_ISSUE_TEMPLATE.md
Co-authored-by: Jennifer <42981373+jennijuju@users.noreply.github.com>
2021-04-08 01:36:04 -04:00
Aayush Rajasekaran e6045bba85 Introduce a release issue template 2021-04-08 01:36:04 -04:00
zgfzgf 640d6fa474 optimize code 2021-04-06 22:40:05 +08:00
Peter Rabbitson b8dff22a40 make gen 2021-04-05 19:15:32 +02:00
Peter Rabbitson b79be2a2c2 Merge remote-tracking branch 'origin/master' into feat/stateless-offline-dealflow 2021-04-05 16:06:44 +02:00
Peter Rabbitson 7fddbb528d Introduce stateless offline dealflow, bypassing the FSM/deallists
This is aproposal for an additional flag --manual-stateless-deal and a
corresponding API endpoint ClientStatelessDeal. This allows firing off
an offline-style deal against a miner without keeping further track of
it locally.

Not keeping any local state introduces the limitation of requiring free
storage deals, as there is nothing to tie the payment channel setup to.

Rationale/need for this type of flow is the case of incredibly large
sets of data nd deals, where the client and providers have prearranged
payment ahead of time, and the client has a separate-from-lotus database
of deal inventory. This way the client can use their lotus node merely
as a network gateway, without running into any limitations currently
present in both lotus as a whole and go-fil-markets in particular.

Specific context for this work is filecoin-discover, where the requirement
is to onboard ~ 12,000,000 individual deals against a pool of miners
with whom the client has prearranged a relationship.
2021-04-05 13:11:10 +02:00
zgfzgf ef08bd48b5 add election backtest 2021-04-03 11:52:30 +08:00
chadwick2143 4395f27143 Transplant some useful commands to lotus-shed actor
Transplant some useful commands from lotus-miner actor to lotus-shed actor,
so that you can excute them without miner api.
2021-03-29 12:27:08 +08:00
Frank 3be84787d4 easy way to make install app 2020-12-11 20:10:40 +08:00
Aayush Rajasekaran 526cd739f6 Return total power when GetPowerRaw doesn't find miner claim 2020-11-20 00:31:04 -05:00
Jakub Sztandera 87f2719195 Complete mask command
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-29 20:58:09 +01:00
whyrusleeping 77ec7caaad WIP: add a command for compacting sector numbers bitfield 2020-10-29 00:18:10 -07:00
mitchellsoo 74a9dfc99f Add script to generate lotus cli document.
Generate lotus command lines documents as text and markdown in folder "lotus/documentation/en".
2020-07-18 14:21:02 +08:00
605 changed files with 45336 additions and 14163 deletions
+287 -104
View File
@@ -7,7 +7,7 @@ orbs:
executors:
golang:
docker:
- image: circleci/golang:1.15.5
- image: circleci/golang:1.16.4
resource_class: 2xlarge
ubuntu:
docker:
@@ -112,7 +112,7 @@ jobs:
- run:
command: make debug
test: &test
test:
description: |
Run tests with gotestsum.
parameters: &test-params
@@ -123,23 +123,20 @@ jobs:
type: string
default: "-timeout 30m"
description: Flags passed to go test.
packages:
target:
type: string
default: "./..."
description: Import paths of packages to be tested.
winpost-test:
proofs-log-test:
type: string
default: "0"
deadline-test:
type: string
default: "0"
test-suite-name:
suite:
type: string
default: unit
description: Test suite name to report to CircleCI.
gotestsum-format:
type: string
default: pkgname-and-test-fails
default: standard-verbose
description: gotestsum format. https://github.com/gotestyourself/gotestsum#format
coverage:
type: string
@@ -147,7 +144,7 @@ jobs:
description: Coverage flag. Set to the empty string to disable.
codecov-upload:
type: boolean
default: false
default: true
description: |
Upload coverage report to https://codecov.io/. Requires the codecov API token to be
set as an environment variable for private projects.
@@ -165,25 +162,24 @@ jobs:
- run:
name: go test
environment:
LOTUS_TEST_WINDOW_POST: << parameters.winpost-test >>
LOTUS_TEST_DEADLINE_TOGGLING: << parameters.deadline-test >>
TEST_RUSTPROOFS_LOGS: << parameters.proofs-log-test >>
SKIP_CONFORMANCE: "1"
command: |
mkdir -p /tmp/test-reports/<< parameters.test-suite-name >>
mkdir -p /tmp/test-reports/<< parameters.suite >>
mkdir -p /tmp/test-artifacts
gotestsum \
--format << parameters.gotestsum-format >> \
--junitfile /tmp/test-reports/<< parameters.test-suite-name >>/junit.xml \
--jsonfile /tmp/test-artifacts/<< parameters.test-suite-name >>.json \
--junitfile /tmp/test-reports/<< parameters.suite >>/junit.xml \
--jsonfile /tmp/test-artifacts/<< parameters.suite >>.json \
-- \
<< parameters.coverage >> \
<< parameters.go-test-flags >> \
<< parameters.packages >>
<< parameters.target >>
no_output_timeout: 30m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-artifacts/<< parameters.test-suite-name >>.json
path: /tmp/test-artifacts/<< parameters.suite >>.json
- when:
condition: << parameters.codecov-upload >>
steps:
@@ -194,24 +190,6 @@ jobs:
command: |
bash <(curl -s https://codecov.io/bash)
test-chain:
<<: *test
test-node:
<<: *test
test-storage:
<<: *test
test-cli:
<<: *test
test-short:
<<: *test
test-window-post:
<<: *test
test-window-post-dispute:
<<: *test
test-deadline-toggling:
<<: *test
test-terminate:
<<: *test
test-conformance:
description: |
Run tests using a corpus of interoperable test vectors for Filecoin
@@ -331,7 +309,7 @@ jobs:
- run: cd extern/filecoin-ffi && make
- run:
name: "go get lotus@master"
command: cd testplans/lotus-soup && go mod edit -replace=github.com/filecoin-project/lotus=../..
command: cd testplans/lotus-soup && go mod edit -replace=github.com/filecoin-project/lotus=../.. && go mod tidy
- run:
name: "build lotus-soup testplan"
command: pushd testplans/lotus-soup && go build -tags=testground .
@@ -379,8 +357,8 @@ jobs:
- run:
name: Install go
command: |
curl -O https://dl.google.com/go/go1.15.5.darwin-amd64.pkg && \
sudo installer -pkg go1.15.5.darwin-amd64.pkg -target /
curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
- run:
name: Install pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
@@ -456,12 +434,13 @@ jobs:
name: prepare workspace
command: |
mkdir appimage
mv Lotus-latest-x86_64.AppImage appimage
mv Lotus-*.AppImage appimage
- persist_to_workspace:
root: "."
paths:
- appimage
gofmt:
executor: golang
steps:
@@ -470,7 +449,7 @@ jobs:
- run:
command: "! go fmt ./... 2>&1 | read"
cbor-gen-check:
gen-check:
executor: golang
steps:
- install-deps
@@ -478,7 +457,10 @@ jobs:
- run: make deps
- run: go install golang.org/x/tools/cmd/goimports
- run: go install github.com/hannahhoward/cbor-gen-for
- run: make type-gen
- run: make gen
- run: git --no-pager diff
- run: git --no-pager diff --quiet
- run: make docsgen-cli
- run: git --no-pager diff
- run: git --no-pager diff --quiet
@@ -561,6 +543,33 @@ jobs:
name: Publish release
command: ./scripts/publish-release.sh
publish-snapcraft:
description: build and push snapcraft
machine:
image: ubuntu-2004:202104-01
resource_class: 2xlarge
parameters:
channel:
type: string
default: "edge"
description: snapcraft channel
steps:
- checkout
- run:
name: install snapcraft
command: sudo snap install snapcraft --classic
- run:
name: create snapcraft config file
command: |
mkdir -p ~/.config/snapcraft
echo "$SNAPCRAFT_LOGIN_FILE" | base64 -d > ~/.config/snapcraft/snapcraft.cfg
- run:
name: build snap
command: snapcraft --use-lxd
- run:
name: publish snap
command: snapcraft push *.snap --release << parameters.channel >>
build-and-push-image:
description: build and push docker images to public AWS ECR registry
executor: aws-cli/default
@@ -726,6 +735,45 @@ jobs:
- packer/build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-nerpanet -var lotus_network=nerpanet -var git_tag=$CIRCLE_TAG"
publish-dockerhub:
description: publish to dockerhub
machine:
image: ubuntu-2004:202010-01
parameters:
tag:
type: string
default: latest
steps:
- checkout
- run:
name: dockerhub login
command: echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USERNAME --password-stdin
- run:
name: docker build
command: |
docker build --target lotus -t filecoin/lotus:<< parameters.tag >> -f Dockerfile.lotus .
docker build --target lotus-all-in-one -t filecoin/lotus-all-in-one:<< parameters.tag >> -f Dockerfile.lotus .
if [[ ! -z $CIRCLE_SHA1 ]]; then
docker build --target lotus -t filecoin/lotus:$CIRCLE_SHA1 -f Dockerfile.lotus .
docker build --target lotus-all-in-one -t filecoin/lotus-all-in-one:$CIRCLE_SHA1 -f Dockerfile.lotus .
fi
if [[ ! -z $CIRCLE_TAG ]]; then
docker build --target lotus -t filecoin/lotus:$CIRCLE_TAG -f Dockerfile.lotus .
docker build --target lotus-all-in-one -t filecoin/lotus-all-in-one:$CIRCLE_TAG -f Dockerfile.lotus .
fi
- run:
name: docker push
command: |
docker push filecoin/lotus:<< parameters.tag >>
docker push filecoin/lotus-all-in-one:<< parameters.tag >>
if [[ ! -z $CIRCLE_SHA1 ]]; then
docker push filecoin/lotus:$CIRCLE_SHA1
docker push filecoin/lotus-all-in-one:$CIRCLE_SHA1
fi
if [[ ! -z $CIRCLE_TAG ]]; then
docker push filecoin/lotus:$CIRCLE_TAG
docker push filecoin/lotus-all-in-one:$CIRCLE_TAG
fi
workflows:
version: 2.1
@@ -735,61 +783,173 @@ workflows:
concurrency: "16" # expend all docker 2xlarge CPUs.
- mod-tidy-check
- gofmt
- cbor-gen-check
- gen-check
- docs-check
- test:
codecov-upload: true
test-suite-name: full
- test-chain:
codecov-upload: true
test-suite-name: chain
packages: "./chain/..."
- test-node:
codecov-upload: true
test-suite-name: node
packages: "./node/..."
- test-storage:
codecov-upload: true
test-suite-name: storage
packages: "./storage/... ./extern/..."
- test-cli:
codecov-upload: true
test-suite-name: cli
packages: "./cli/... ./cmd/... ./api/..."
- test-window-post:
codecov-upload: true
go-test-flags: "-run=TestWindowedPost"
winpost-test: "1"
test-suite-name: window-post
- test-window-post-dispute:
codecov-upload: true
go-test-flags: "-run=TestWindowPostDispute"
winpost-test: "1"
test-suite-name: window-post-dispute
- test-terminate:
codecov-upload: true
go-test-flags: "-run=TestTerminate"
winpost-test: "1"
test-suite-name: terminate
- test-deadline-toggling:
codecov-upload: true
go-test-flags: "-run=TestDeadlineToggling"
deadline-test: "1"
test-suite-name: deadline-toggling
- test-short:
go-test-flags: "--timeout 10m --short"
test-suite-name: short
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
name: test-itest-api
suite: itest-api
target: "./itests/api_test.go"
- test:
name: test-itest-batch_deal
suite: itest-batch_deal
target: "./itests/batch_deal_test.go"
- test:
name: test-itest-ccupgrade
suite: itest-ccupgrade
target: "./itests/ccupgrade_test.go"
- test:
name: test-itest-cli
suite: itest-cli
target: "./itests/cli_test.go"
- test:
name: test-itest-deadlines
suite: itest-deadlines
target: "./itests/deadlines_test.go"
- test:
name: test-itest-deals_concurrent
suite: itest-deals_concurrent
target: "./itests/deals_concurrent_test.go"
- test:
name: test-itest-deals_offline
suite: itest-deals_offline
target: "./itests/deals_offline_test.go"
- test:
name: test-itest-deals_padding
suite: itest-deals_padding
target: "./itests/deals_padding_test.go"
- test:
name: test-itest-deals_power
suite: itest-deals_power
target: "./itests/deals_power_test.go"
- test:
name: test-itest-deals_pricing
suite: itest-deals_pricing
target: "./itests/deals_pricing_test.go"
- test:
name: test-itest-deals_publish
suite: itest-deals_publish
target: "./itests/deals_publish_test.go"
- test:
name: test-itest-deals
suite: itest-deals
target: "./itests/deals_test.go"
- test:
name: test-itest-gateway
suite: itest-gateway
target: "./itests/gateway_test.go"
- test:
name: test-itest-get_messages_in_ts
suite: itest-get_messages_in_ts
target: "./itests/get_messages_in_ts_test.go"
- test:
name: test-itest-multisig
suite: itest-multisig
target: "./itests/multisig_test.go"
- test:
name: test-itest-nonce
suite: itest-nonce
target: "./itests/nonce_test.go"
- test:
name: test-itest-paych_api
suite: itest-paych_api
target: "./itests/paych_api_test.go"
- test:
name: test-itest-paych_cli
suite: itest-paych_cli
target: "./itests/paych_cli_test.go"
- test:
name: test-itest-sdr_upgrade
suite: itest-sdr_upgrade
target: "./itests/sdr_upgrade_test.go"
- test:
name: test-itest-sector_finalize_early
suite: itest-sector_finalize_early
target: "./itests/sector_finalize_early_test.go"
- test:
name: test-itest-sector_miner_collateral
suite: itest-sector_miner_collateral
target: "./itests/sector_miner_collateral_test.go"
- test:
name: test-itest-sector_pledge
suite: itest-sector_pledge
target: "./itests/sector_pledge_test.go"
- test:
name: test-itest-sector_terminate
suite: itest-sector_terminate
target: "./itests/sector_terminate_test.go"
- test:
name: test-itest-tape
suite: itest-tape
target: "./itests/tape_test.go"
- test:
name: test-itest-verifreg
suite: itest-verifreg
target: "./itests/verifreg_test.go"
- test:
name: test-itest-wdpost_dispute
suite: itest-wdpost_dispute
target: "./itests/wdpost_dispute_test.go"
- test:
name: test-itest-wdpost
suite: itest-wdpost
target: "./itests/wdpost_test.go"
- test:
name: test-unit-cli
suite: utest-unit-cli
target: "./cli/... ./cmd/... ./api/..."
- test:
name: test-unit-node
suite: utest-unit-node
target: "./node/..."
- test:
name: test-unit-rest
suite: utest-unit-rest
target: "./api/... ./blockstore/... ./build/... ./chain/... ./cli/... ./cmd/... ./conformance/... ./extern/... ./gateway/... ./journal/... ./lib/... ./markets/... ./node/... ./paychmgr/... ./storage/... ./tools/..."
- test:
name: test-unit-storage
suite: utest-unit-storage
target: "./storage/... ./extern/..."
- test:
go-test-flags: "-run=TestMulticoreSDR"
suite: multicore-sdr-check
target: "./extern/sector-storage/ffiwrapper"
proofs-log-test: "1"
- test-conformance:
test-suite-name: conformance
packages: "./conformance"
suite: conformance
codecov-upload: false
target: "./conformance"
- test-conformance:
name: test-conformance-bleeding-edge
test-suite-name: conformance-bleeding-edge
packages: "./conformance"
codecov-upload: false
suite: conformance-bleeding-edge
target: "./conformance"
vectors-branch: master
- trigger-testplans:
filters:
@@ -798,37 +958,27 @@ workflows:
- master
- build-debug
- build-all:
requires:
- test-short
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-ntwk-calibration:
requires:
- test-short
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-ntwk-butterfly:
requires:
- test-short
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-ntwk-nerpa:
requires:
- test-short
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-lotus-soup
- build-macos:
requires:
- test-short
filters:
branches:
ignore:
@@ -837,8 +987,6 @@ workflows:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-appimage:
requires:
- test-short
filters:
branches:
ignore:
@@ -858,7 +1006,6 @@ workflows:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-and-push-image:
dockerfile: Dockerfile.lotus
path: .
@@ -904,3 +1051,39 @@ workflows:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- publish-snapcraft:
name: publish-snapcraft-stable
channel: stable
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- publish-dockerhub:
name: publish-dockerhub
tag: stable
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- publish-snapcraft:
name: publish-snapcraft-nightly
channel: edge
- publish-dockerhub:
name: publish-dockerhub-nightly
tag: nightly
+136
View File
@@ -0,0 +1,136 @@
package main
import (
"embed"
"fmt"
"os"
"path/filepath"
"sort"
"strings"
"text/template"
)
//go:generate go run ./gen.go ..
//go:embed template.yml
var templateFile embed.FS
type (
dirs = []string
suite = string
)
// groupedUnitTests maps suite names to top-level directories that should be
// included in that suite. The program adds an implicit group "rest" that
// includes all other top-level directories.
var groupedUnitTests = map[suite]dirs{
"unit-node": {"node"},
"unit-storage": {"storage", "extern"},
"unit-cli": {"cli", "cmd", "api"},
}
func main() {
if len(os.Args) != 2 {
panic("expected path to repo as argument")
}
repo := os.Args[1]
tmpl := template.New("template.yml")
tmpl.Delims("[[", "]]")
tmpl.Funcs(template.FuncMap{
"stripSuffix": func(in string) string {
return strings.TrimSuffix(in, "_test.go")
},
})
tmpl = template.Must(tmpl.ParseFS(templateFile, "*"))
// list all itests.
itests, err := filepath.Glob(filepath.Join(repo, "./itests/*_test.go"))
if err != nil {
panic(err)
}
// strip the dir from all entries.
for i, f := range itests {
itests[i] = filepath.Base(f)
}
// calculate the exclusion set of unit test directories to exclude because
// they are already included in a grouped suite.
var excluded = map[string]struct{}{}
for _, ss := range groupedUnitTests {
for _, s := range ss {
e, err := filepath.Abs(filepath.Join(repo, s))
if err != nil {
panic(err)
}
excluded[e] = struct{}{}
}
}
// all unit tests top-level dirs that are not itests, nor included in other suites.
var rest = map[string]struct{}{}
err = filepath.Walk(repo, func(path string, f os.FileInfo, err error) error {
// include all tests that aren't in the itests directory.
if strings.Contains(path, "itests") {
return filepath.SkipDir
}
// exclude all tests included in other suites
if f.IsDir() {
if _, ok := excluded[path]; ok {
return filepath.SkipDir
}
}
if strings.HasSuffix(path, "_test.go") {
rel, err := filepath.Rel(repo, path)
if err != nil {
panic(err)
}
// take the first directory
rest[strings.Split(rel, string(os.PathSeparator))[0]] = struct{}{}
}
return err
})
if err != nil {
panic(err)
}
// add other directories to a 'rest' suite.
for k := range rest {
groupedUnitTests["unit-rest"] = append(groupedUnitTests["unit-rest"], k)
}
// map iteration guarantees no order, so sort the array in-place.
sort.Strings(groupedUnitTests["unit-rest"])
// form the input data.
type data struct {
ItestFiles []string
UnitSuites map[string]string
}
in := data{
ItestFiles: itests,
UnitSuites: func() map[string]string {
ret := make(map[string]string)
for name, dirs := range groupedUnitTests {
for i, d := range dirs {
dirs[i] = fmt.Sprintf("./%s/...", d) // turn into package
}
ret[name] = strings.Join(dirs, " ")
}
return ret
}(),
}
out, err := os.Create("./config.yml")
if err != nil {
panic(err)
}
defer out.Close()
// execute the template.
if err := tmpl.Execute(out, in); err != nil {
panic(err)
}
}
+954
View File
@@ -0,0 +1,954 @@
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
resource_class: 2xlarge
ubuntu:
docker:
- image: ubuntu:20.04
commands:
install-deps:
steps:
- go/install-ssh
- go/install: {package: git}
prepare:
parameters:
linux:
default: true
description: is a linux build environment?
type: boolean
darwin:
default: false
description: is a darwin build environment?
type: boolean
steps:
- checkout
- git_fetch_all_tags
- checkout
- when:
condition: << parameters.linux >>
steps:
- run: sudo apt-get update
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
- run: git submodule sync
- run: git submodule update --init
download-params:
steps:
- restore_cache:
name: Restore parameters cache
keys:
- 'v25-2k-lotus-params'
paths:
- /var/tmp/filecoin-proof-parameters/
- run: ./lotus fetch-params 2048
- save_cache:
name: Save parameters cache
key: 'v25-2k-lotus-params'
paths:
- /var/tmp/filecoin-proof-parameters/
install_ipfs:
steps:
- 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)" ]
then
echo "ipfs failed checksum check"
exit 1
fi
tar -xf go-ipfs_v0.4.22_linux-amd64.tar.gz
mv go-ipfs/ipfs /usr/local/bin/ipfs
chmod +x /usr/local/bin/ipfs
git_fetch_all_tags:
steps:
- run:
name: fetch all tags
command: |
git fetch --all
jobs:
mod-tidy-check:
executor: golang
steps:
- install-deps
- prepare
- go/mod-tidy-check
build-all:
executor: golang
steps:
- install-deps
- prepare
- run: sudo apt-get update
- run: sudo apt-get install npm
- run:
command: make buildall
- store_artifacts:
path: lotus
- store_artifacts:
path: lotus-miner
- store_artifacts:
path: lotus-worker
- run: mkdir linux && mv lotus lotus-miner lotus-worker linux/
- persist_to_workspace:
root: "."
paths:
- linux
build-debug:
executor: golang
steps:
- install-deps
- prepare
- run:
command: make debug
test:
description: |
Run tests with gotestsum.
parameters: &test-params
executor:
type: executor
default: golang
go-test-flags:
type: string
default: "-timeout 30m"
description: Flags passed to go test.
target:
type: string
default: "./..."
description: Import paths of packages to be tested.
proofs-log-test:
type: string
default: "0"
suite:
type: string
default: unit
description: Test suite name to report to CircleCI.
gotestsum-format:
type: string
default: standard-verbose
description: gotestsum format. https://github.com/gotestyourself/gotestsum#format
coverage:
type: string
default: -coverprofile=coverage.txt -coverpkg=github.com/filecoin-project/lotus/...
description: Coverage flag. Set to the empty string to disable.
codecov-upload:
type: boolean
default: true
description: |
Upload coverage report to https://codecov.io/. Requires the codecov API token to be
set as an environment variable for private projects.
executor: << parameters.executor >>
steps:
- install-deps
- prepare
- run:
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:
TEST_RUSTPROOFS_LOGS: << parameters.proofs-log-test >>
SKIP_CONFORMANCE: "1"
command: |
mkdir -p /tmp/test-reports/<< parameters.suite >>
mkdir -p /tmp/test-artifacts
gotestsum \
--format << parameters.gotestsum-format >> \
--junitfile /tmp/test-reports/<< parameters.suite >>/junit.xml \
--jsonfile /tmp/test-artifacts/<< parameters.suite >>.json \
-- \
<< parameters.coverage >> \
<< parameters.go-test-flags >> \
<< parameters.target >>
no_output_timeout: 30m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-artifacts/<< parameters.suite >>.json
- when:
condition: << parameters.codecov-upload >>
steps:
- go/install: {package: bash}
- go/install: {package: curl}
- run:
shell: /bin/bash -eo pipefail
command: |
bash <(curl -s https://codecov.io/bash)
test-conformance:
description: |
Run tests using a corpus of interoperable test vectors for Filecoin
implementations to test their correctness and compliance with the Filecoin
specifications.
parameters:
<<: *test-params
vectors-branch:
type: string
default: ""
description: |
Branch on github.com/filecoin-project/test-vectors to checkout and
test with. If empty (the default) the commit defined by the git
submodule is used.
executor: << parameters.executor >>
steps:
- install-deps
- prepare
- run:
command: make deps lotus
no_output_timeout: 30m
- download-params
- when:
condition:
not:
equal: [ "", << parameters.vectors-branch >> ]
steps:
- run:
name: checkout vectors branch
command: |
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: |
## statediff is optional; we succeed even if compilation fails.
mkdir -p /tmp/statediff
git clone https://github.com/filecoin-project/statediff.git /tmp/statediff
cd /tmp/statediff
go install ./cmd/statediff || exit 0
- run:
name: go test
environment:
SKIP_CONFORMANCE: "0"
command: |
mkdir -p /tmp/test-reports
mkdir -p /tmp/test-artifacts
gotestsum \
--format pkgname-and-test-fails \
--junitfile /tmp/test-reports/junit.xml \
-- \
-v -coverpkg ./chain/vm/,github.com/filecoin-project/specs-actors/... -coverprofile=/tmp/conformance.out ./conformance/
go tool cover -html=/tmp/conformance.out -o /tmp/test-artifacts/conformance-coverage.html
no_output_timeout: 30m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-artifacts/conformance-coverage.html
build-ntwk-calibration:
description: |
Compile lotus binaries for the calibration network
parameters:
<<: *test-params
executor: << parameters.executor >>
steps:
- install-deps
- prepare
- run: make calibnet
- run: mkdir linux-calibrationnet && mv lotus lotus-miner lotus-worker linux-calibrationnet
- persist_to_workspace:
root: "."
paths:
- linux-calibrationnet
build-ntwk-butterfly:
description: |
Compile lotus binaries for the butterfly network
parameters:
<<: *test-params
executor: << parameters.executor >>
steps:
- install-deps
- prepare
- run: make butterflynet
- run: mkdir linux-butterflynet && mv lotus lotus-miner lotus-worker linux-butterflynet
- persist_to_workspace:
root: "."
paths:
- linux-butterflynet
build-ntwk-nerpa:
description: |
Compile lotus binaries for the nerpa network
parameters:
<<: *test-params
executor: << parameters.executor >>
steps:
- install-deps
- prepare
- run: make nerpanet
- run: mkdir linux-nerpanet && mv lotus lotus-miner lotus-worker linux-nerpanet
- persist_to_workspace:
root: "."
paths:
- linux-nerpanet
build-lotus-soup:
description: |
Compile `lotus-soup` Testground test plan
parameters:
<<: *test-params
executor: << parameters.executor >>
steps:
- install-deps
- prepare
- run: cd extern/filecoin-ffi && make
- run:
name: "go get lotus@master"
command: cd testplans/lotus-soup && go mod edit -replace=github.com/filecoin-project/lotus=../.. && go mod tidy
- run:
name: "build lotus-soup testplan"
command: pushd testplans/lotus-soup && go build -tags=testground .
trigger-testplans:
description: |
Trigger `lotus-soup` test cases on TaaS
parameters:
<<: *test-params
executor: << parameters.executor >>
steps:
- install-deps
- prepare
- run:
name: "download testground"
command: wget https://gist.github.com/nonsense/5fbf3167cac79945f658771aed32fc44/raw/2e17eb0debf7ec6bdf027c1bdafc2c92dd97273b/testground-d3e9603 -O ~/testground-cli && chmod +x ~/testground-cli
- run:
name: "prepare .env.toml"
command: pushd testplans/lotus-soup && mkdir -p $HOME/testground && cp env-ci.toml $HOME/testground/.env.toml && echo 'endpoint="https://ci.testground.ipfs.team"' >> $HOME/testground/.env.toml && echo 'user="circleci"' >> $HOME/testground/.env.toml
- run:
name: "prepare testground home dir and link test plans"
command: mkdir -p $HOME/testground/plans && ln -s $(pwd)/testplans/lotus-soup $HOME/testground/plans/lotus-soup && ln -s $(pwd)/testplans/graphsync $HOME/testground/plans/graphsync
- run:
name: "go get lotus@master"
command: cd testplans/lotus-soup && go get github.com/filecoin-project/lotus@master
- run:
name: "trigger deals baseline testplan on taas"
command: ~/testground-cli run composition -f $HOME/testground/plans/lotus-soup/_compositions/baseline-k8s-3-1.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
- run:
name: "trigger payment channel stress testplan on taas"
command: ~/testground-cli run composition -f $HOME/testground/plans/lotus-soup/_compositions/paych-stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
- run:
name: "trigger graphsync testplan on taas"
command: ~/testground-cli run composition -f $HOME/testground/plans/graphsync/_compositions/stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
build-macos:
description: build darwin lotus binary
macos:
xcode: "10.0.0"
working_directory: ~/go/src/github.com/filecoin-project/lotus
steps:
- prepare:
linux: false
darwin: true
- 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 /
- run:
name: Install pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
- run: go version
- run:
name: Install Rust
command: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
- run:
name: Install jq
command: |
curl --location https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64 --output /usr/local/bin/jq
chmod +x /usr/local/bin/jq
- run:
name: Install hwloc
command: |
mkdir ~/hwloc
curl --location https://download.open-mpi.org/release/hwloc/v2.4/hwloc-2.4.1.tar.gz --output ~/hwloc/hwloc-2.4.1.tar.gz
cd ~/hwloc
tar -xvzpf hwloc-2.4.1.tar.gz
cd hwloc-2.4.1
./configure && make && sudo make install
- 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
- store_artifacts:
path: lotus
- store_artifacts:
path: lotus-miner
- store_artifacts:
path: lotus-worker
- run: mkdir darwin && mv lotus lotus-miner lotus-worker darwin/
- persist_to_workspace:
root: "."
paths:
- darwin
- save_cache:
name: save cargo cache
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
paths:
- "~/.rustup"
- "~/.cargo"
build-appimage:
machine:
image: ubuntu-2004:202104-01
steps:
- checkout
- attach_workspace:
at: "."
- run:
name: install appimage-builder
command: |
# 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
sudo curl -Lo /usr/local/bin/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
sudo chmod +x /usr/local/bin/appimagetool
sudo pip3 install appimage-builder
- run:
name: install lotus dependencies
command: sudo apt install ocl-icd-opencl-dev libhwloc-dev
- run:
name: build appimage
command: |
sed -i "s/version: latest/version: ${CIRCLE_TAG:-latest}/" AppImageBuilder.yml
make appimage
- run:
name: prepare workspace
command: |
mkdir appimage
mv Lotus-*.AppImage appimage
- persist_to_workspace:
root: "."
paths:
- appimage
gofmt:
executor: golang
steps:
- install-deps
- prepare
- run:
command: "! go fmt ./... 2>&1 | read"
gen-check:
executor: golang
steps:
- install-deps
- prepare
- run: make deps
- run: go install golang.org/x/tools/cmd/goimports
- run: go install github.com/hannahhoward/cbor-gen-for
- run: make gen
- run: git --no-pager diff
- run: git --no-pager diff --quiet
- run: make docsgen-cli
- run: git --no-pager diff
- run: git --no-pager diff --quiet
docs-check:
executor: golang
steps:
- install-deps
- prepare
- run: go install golang.org/x/tools/cmd/goimports
- run: zcat build/openrpc/full.json.gz | jq > ../pre-openrpc-full
- run: zcat build/openrpc/miner.json.gz | jq > ../pre-openrpc-miner
- run: zcat build/openrpc/worker.json.gz | jq > ../pre-openrpc-worker
- run: make deps
- run: make docsgen
- run: zcat build/openrpc/full.json.gz | jq > ../post-openrpc-full
- run: zcat build/openrpc/miner.json.gz | jq > ../post-openrpc-miner
- run: zcat build/openrpc/worker.json.gz | jq > ../post-openrpc-worker
- run: git --no-pager diff
- run: diff ../pre-openrpc-full ../post-openrpc-full
- run: diff ../pre-openrpc-miner ../post-openrpc-miner
- run: diff ../pre-openrpc-worker ../post-openrpc-worker
- run: git --no-pager diff --quiet
lint: &lint
description: |
Run golangci-lint.
parameters:
executor:
type: executor
default: golang
golangci-lint-version:
type: string
default: 1.27.0
concurrency:
type: string
default: '2'
description: |
Concurrency used to run linters. Defaults to 2 because NumCPU is not
aware of container CPU limits.
args:
type: string
default: ''
description: |
Arguments to pass to golangci-lint
executor: << parameters.executor >>
steps:
- install-deps
- prepare
- 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 \
--concurrency << parameters.concurrency >> << parameters.args >>
lint-all:
<<: *lint
publish:
description: publish binary artifacts
executor: ubuntu
steps:
- run:
name: Install git jq curl
command: apt update && apt install -y git jq curl
- checkout
- git_fetch_all_tags
- checkout
- install_ipfs
- attach_workspace:
at: "."
- run:
name: Create bundles
command: ./scripts/build-bundle.sh
- run:
name: Publish release
command: ./scripts/publish-release.sh
publish-snapcraft:
description: build and push snapcraft
machine:
image: ubuntu-2004:202104-01
resource_class: 2xlarge
parameters:
channel:
type: string
default: "edge"
description: snapcraft channel
steps:
- checkout
- run:
name: install snapcraft
command: sudo snap install snapcraft --classic
- run:
name: create snapcraft config file
command: |
mkdir -p ~/.config/snapcraft
echo "$SNAPCRAFT_LOGIN_FILE" | base64 -d > ~/.config/snapcraft/snapcraft.cfg
- run:
name: build snap
command: snapcraft --use-lxd
- run:
name: publish snap
command: snapcraft push *.snap --release << parameters.channel >>
build-and-push-image:
description: build and push docker images to public AWS ECR registry
executor: aws-cli/default
parameters:
profile-name:
type: string
default: "default"
description: AWS profile name to be configured.
aws-access-key-id:
type: env_var_name
default: AWS_ACCESS_KEY_ID
description: >
AWS access key id for IAM role. Set this to the name of
the environment variable you will set to hold this
value, i.e. AWS_ACCESS_KEY.
aws-secret-access-key:
type: env_var_name
default: AWS_SECRET_ACCESS_KEY
description: >
AWS secret key for IAM role. Set this to the name of
the environment variable you will set to hold this
value, i.e. AWS_SECRET_ACCESS_KEY.
region:
type: env_var_name
default: AWS_REGION
description: >
Name of env var storing your AWS region information,
defaults to AWS_REGION
account-url:
type: env_var_name
default: AWS_ECR_ACCOUNT_URL
description: >
Env var storing Amazon ECR account URL that maps to an AWS account,
e.g. {awsAccountNum}.dkr.ecr.us-west-2.amazonaws.com
defaults to AWS_ECR_ACCOUNT_URL
dockerfile:
type: string
default: Dockerfile
description: Name of dockerfile to use. Defaults to Dockerfile.
path:
type: string
default: .
description: Path to the directory containing your Dockerfile and build context. Defaults to . (working directory).
extra-build-args:
type: string
default: ""
description: >
Extra flags to pass to docker build. For examples, see
https://docs.docker.com/engine/reference/commandline/build
repo:
type: string
description: Name of an Amazon ECR repository
tag:
type: string
default: "latest"
description: A comma-separated string containing docker image tags to build and push (default = latest)
steps:
- run:
name: Confirm that environment variables are set
command: |
if [ -z "$AWS_ACCESS_KEY_ID" ]; then
echo "No AWS_ACCESS_KEY_ID is set. Skipping build-and-push job ..."
circleci-agent step halt
fi
- aws-cli/setup:
profile-name: <<parameters.profile-name>>
aws-access-key-id: <<parameters.aws-access-key-id>>
aws-secret-access-key: <<parameters.aws-secret-access-key>>
aws-region: <<parameters.region>>
- run:
name: Log into Amazon ECR
command: |
aws ecr-public get-login-password --region $<<parameters.region>> --profile <<parameters.profile-name>> | docker login --username AWS --password-stdin $<<parameters.account-url>>
- checkout
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: false
- run:
name: Build docker image
command: |
registry_id=$(echo $<<parameters.account-url>> | sed "s;\..*;;g")
docker_tag_args=""
IFS="," read -ra DOCKER_TAGS \<<< "<< parameters.tag >>"
for tag in "${DOCKER_TAGS[@]}"; do
docker_tag_args="$docker_tag_args -t $<<parameters.account-url>>/<<parameters.repo>>:$tag"
done
docker build \
<<#parameters.extra-build-args>><<parameters.extra-build-args>><</parameters.extra-build-args>> \
-f <<parameters.path>>/<<parameters.dockerfile>> \
$docker_tag_args \
<<parameters.path>>
- run:
name: Push image to Amazon ECR
command: |
IFS="," read -ra DOCKER_TAGS \<<< "<< parameters.tag >>"
for tag in "${DOCKER_TAGS[@]}"; do
docker push $<<parameters.account-url>>/<<parameters.repo>>:${tag}
done
publish-packer-mainnet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG"
publish-packer-calibrationnet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG"
publish-packer-butterflynet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
publish-packer-nerpanet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-nerpanet -var lotus_network=nerpanet -var git_tag=$CIRCLE_TAG"
publish-dockerhub:
description: publish to dockerhub
machine:
image: ubuntu-2004:202010-01
parameters:
tag:
type: string
default: latest
steps:
- checkout
- run:
name: dockerhub login
command: echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USERNAME --password-stdin
- run:
name: docker build
command: |
docker build --target lotus -t filecoin/lotus:<< parameters.tag >> -f Dockerfile.lotus .
docker build --target lotus-all-in-one -t filecoin/lotus-all-in-one:<< parameters.tag >> -f Dockerfile.lotus .
if [["[[ ! -z $CIRCLE_SHA1 ]]"]]; then
docker build --target lotus -t filecoin/lotus:$CIRCLE_SHA1 -f Dockerfile.lotus .
docker build --target lotus-all-in-one -t filecoin/lotus-all-in-one:$CIRCLE_SHA1 -f Dockerfile.lotus .
fi
if [["[[ ! -z $CIRCLE_TAG ]]"]]; then
docker build --target lotus -t filecoin/lotus:$CIRCLE_TAG -f Dockerfile.lotus .
docker build --target lotus-all-in-one -t filecoin/lotus-all-in-one:$CIRCLE_TAG -f Dockerfile.lotus .
fi
- run:
name: docker push
command: |
docker push filecoin/lotus:<< parameters.tag >>
docker push filecoin/lotus-all-in-one:<< parameters.tag >>
if [["[[ ! -z $CIRCLE_SHA1 ]]"]]; then
docker push filecoin/lotus:$CIRCLE_SHA1
docker push filecoin/lotus-all-in-one:$CIRCLE_SHA1
fi
if [["[[ ! -z $CIRCLE_TAG ]]"]]; then
docker push filecoin/lotus:$CIRCLE_TAG
docker push filecoin/lotus-all-in-one:$CIRCLE_TAG
fi
workflows:
version: 2.1
ci:
jobs:
- lint-all:
concurrency: "16" # expend all docker 2xlarge CPUs.
- mod-tidy-check
- gofmt
- gen-check
- docs-check
[[- range $file := .ItestFiles -]]
[[ with $name := $file | stripSuffix ]]
- test:
name: test-itest-[[ $name ]]
suite: itest-[[ $name ]]
target: "./itests/[[ $file ]]"
[[ end ]]
[[- end -]]
[[range $suite, $pkgs := .UnitSuites]]
- test:
name: test-[[ $suite ]]
suite: utest-[[ $suite ]]
target: "[[ $pkgs ]]"
[[- end]]
- test:
go-test-flags: "-run=TestMulticoreSDR"
suite: multicore-sdr-check
target: "./extern/sector-storage/ffiwrapper"
proofs-log-test: "1"
- test-conformance:
suite: conformance
codecov-upload: false
target: "./conformance"
- test-conformance:
name: test-conformance-bleeding-edge
codecov-upload: false
suite: conformance-bleeding-edge
target: "./conformance"
vectors-branch: master
- trigger-testplans:
filters:
branches:
only:
- master
- build-debug
- build-all:
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-ntwk-calibration:
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-ntwk-butterfly:
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-ntwk-nerpa:
filters:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-lotus-soup
- build-macos:
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-appimage:
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- publish:
requires:
- build-all
- build-macos
- build-appimage
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- build-and-push-image:
dockerfile: Dockerfile.lotus
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+)?$/
- publish-packer-nerpanet:
requires:
- build-ntwk-nerpa
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- publish-snapcraft:
name: publish-snapcraft-stable
channel: stable
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- publish-dockerhub:
name: publish-dockerhub
tag: stable
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- publish-snapcraft:
name: publish-snapcraft-nightly
channel: edge
- publish-dockerhub:
name: publish-dockerhub-nightly
tag: nightly
+5 -15
View File
@@ -1,16 +1,6 @@
## filecoin-project/lotus CODEOWNERS
## Refer to https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners.
##
## These users or groups will be automatically assigned as reviewers every time
## a PR is submitted that modifies code in the specified locations.
##
## The Lotus repo configuration requires that at least ONE codeowner approves
## the PR before merging.
# Reference
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners
### Global owners.
* @magik6k @arajasek
### Conformance testing.
conformance/ @ZenGround0
extern/test-vectors @ZenGround0
cmd/tvx @ZenGround0
# Global owners
# Ensure maintainers team is a requested reviewer for non-draft PRs
* @filecoin-project/lotus-maintainers
-33
View File
@@ -1,33 +0,0 @@
---
name: Bug Report
about: Create a report to help us improve
title: "[BUG] "
labels: hint/needs-triaging, kind/bug
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
**Describe the bug**
A clear and concise description of what the bug is.
(If you are not sure what the bug is, try to figure it out via a [discussion](https://github.com/filecoin-project/lotus/discussions/new) first!
**Version (run `lotus version`):**
**To Reproduce**
Steps to reproduce the behavior:
1. Run '...'
2. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Logs**
Provide daemon/miner/worker logs, and goroutines(if available) for troubleshooting.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
+92
View File
@@ -0,0 +1,92 @@
name: "Bug Report"
description: "File a bug report to help us improve"
labels: [need/triage, kind/bug]
body:
- type: checkboxes
attributes:
label: Checklist
description: Please check off the following boxes before continuing to file a bug report!
options:
- label: This is **not** a security-related bug/issue. If it is, please follow please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
required: true
- label: This is **not** a question or a support request. If you have any lotus related questions, please ask in the [lotus forum](https://github.com/filecoin-project/lotus/discussions).
required: true
- label: This is **not** a new feature request. If it is, please file a [feature request](https://github.com/filecoin-project/lotus/issues/new?assignees=&labels=need%2Ftriage%2Ckind%2Ffeature&template=feature_request.yml) instead.
required: true
- label: This is **not** an enhancement request. If it is, please file a [improvement suggestion](https://github.com/filecoin-project/lotus/issues/new?assignees=&labels=need%2Ftriage%2Ckind%2Fenhancement&template=enhancement.yml) instead.
required: true
- label: I **have** searched on the [issue tracker](https://github.com/filecoin-project/lotus/issues) and the [lotus forum](https://github.com/filecoin-project/lotus/discussions), and there is no existing related issue or discussion.
required: true
- label: I am running the [`Latest release`](https://github.com/filecoin-project/lotus/releases), or the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.
required: true
- label: I did not make any code changes to lotus.
required: false
- type: dropdown
id: component-and-area
validations:
required: true
attributes:
label: Lotus component
description: Please select the lotus component you are filing a bug for
options:
- lotus daemon - chain sync
- lotus miner - mining and block production
- lotus miner/worker - sealing
- lotus miner - proving(WindowPoSt)
- lotus miner/market - storage deal
- lotus miner/market - retrieval deal
- lotus client
- lotus JSON-RPC API
- lotus message management (mpool)
- Other
- type: textarea
id: version
attributes:
label: Lotus Version
description: Enter the output of `lotus version` and `lotus-miner version` if applicable.
placeholder: |
e.g.
Daemon:1.11.0-rc2+debug+git.0519cd371.dirty+api1.3.0
Local: lotus version 1.11.0-rc2+debug+git.0519cd371.dirty
validations:
reuiqred: true
- type: textarea
id: Description
attributes:
label: Describe the Bug
description: |
This is where you get to tell us what went wrong, when doing so, please try to provide a clear and concise description of the bug with all related information:
* What you were doding when you experienced the bug?
* Any *error* messages you saw, *where* you saw them, and what you believe may have caused them (if you have any ideas).
* What is the expected behaviour?
* For sealing issues, include the output of `lotus-miner sectors status --log <sectorId>` for the failed sector(s).
* For proving issues, include the output of `lotus-miner proving` info.
* For deal making issues, include the output of `lotus client list-deals -v` and/or `lotus-miner storage-deals|retrieval-deals|data-transfers list [-v]` commands for the deal(s) in question.
render: bash
validations:
required: true
- type: textarea
id: extraInfo
attributes:
label: Logging Information
description: |
Please provide debug logs of the problem, remember you can get set log level control for:
* lotus: use `lotus log list` to get all log systems available and set level by `lotus log set-level`. An example can be found [here](https://docs.filecoin.io/get-started/lotus/configuration-and-advanced-usage/#log-level-control).
* lotus-miner:`lotus-miner log list` to get all log systems available and set level by `lotus-miner log set-level
If you don't provide detailed logs when you raise the issue it will almost certainly be the first request I make before furthur diagnosing the problem.
render: bash
validations:
required: true
- type: textarea
id: RepoSteps
attributes:
label: Repo Steps
description: "Steps to reproduce the behavior"
value: |
1. Run '...'
2. Do '...'
3. See error '...'
...
render: bash
validations:
required: false
@@ -1,49 +0,0 @@
---
name: Deal Making Issues
about: Create a report for help with deal making failures.
title: "[Deal Making Issue]"
labels: hint/needs-triaging, area/markets
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
Please provide all the information requested here to help us troubleshoot "deal making failed" issues.
If the information requested is missing, we will probably have to just ask you to provide it anyway,
before we can help debug.
**Basic Information**
Including information like, Are you the client or the miner? Is this a storage deal or a retrieval deal? Is it an offline deal?
**Describe the problem**
A brief description of the problem you encountered while trying to make a deal.
**Version**
The output of `lotus --version`.
**Setup**
You miner(if applicable) and daemon setup, i.e: What hardware do you use, how much ram and etc.
**To Reproduce**
Steps to reproduce the behavior:
1. Run '...'
2. See error
**Deal status**
The output of `lotus client list-deals -v` and/or `lotus-miner storage-deals|retrieval-deals|data-transfers list [-v]` commands for the deal(s) in question.
**Lotus daemon and miner logs**
Please go through the logs of your daemon and miner(if applicable), and include screenshots of any error/warning-like messages you find.
Alternatively please upload full log files and share a link here
** Code modifications **
If you have modified parts of lotus, please describe which areas were modified,
and the scope of those modifications
+44
View File
@@ -0,0 +1,44 @@
name: Enhancement
description: Suggest an improvement to an existing lotus feature.
labels: [need/triage, kind/enhancement]
body:
- type: checkboxes
attributes:
label: Checklist
description: Please check off the following boxes before continuing to create an improvement suggestion!
options:
- label: This is **not** a new feature or an enhancement to the Filecoin protocol. If it is, please open an [FIP issue](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0001.md).
required: true
- label: This is **not** a new feature request. If it is, please file a [feature request](https://github.com/filecoin-project/lotus/issues/new?assignees=&labels=need%2Ftriage%2Ckind%2Ffeature&template=feature_request.yml) instead.
required: true
- label: This is **not** brainstorming ideas. If you have an idea you'd like to discuss, please open a new discussion on [the lotus forum](https://github.com/filecoin-project/lotus/discussions/categories/ideas) and select the category as `Ideas`.
required: true
- label: I **have** a specific, actionable, and well motivated improvement to propose.
required: true
- type: dropdown
id: component
validations:
required: true
attributes:
label: Lotus component
description: Please select the lotus component you are propoing improvement for
options:
- lotus daemon - chain sync
- lotus miner - mining and block production
- lotus miner/worker - sealing
- lotus miner - proving(WindowPoSt)
- lotus miner/market - storage deal
- lotus miner/market - retrieval deal
- lotus client
- lotus JSON-RPC API
- lotus message management (mpool)
- Other
- type: textarea
id: request
attributes:
label: Improvement Suggestion
description: A clear and concise description of what the motivation or the current problem is and what is the suggested improvement?
placeholder: Ex. Currently lotus... However, as a storage provider, I'd like...
validations:
required: true
-20
View File
@@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature Request]"
labels: hint/needs-triaging
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
@@ -0,0 +1,63 @@
name: Feature request
description: Suggest an idea for lotus
labels: [need/triage, kind/feature]
body:
- type: checkboxes
attributes:
label: Checklist
description: Please check off the following boxes before continuing to create a new feature request!
options:
- label: This is **not** a new feature or an enhancement to the Filecoin protocol. If it is, please open an [FIP issue](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0001.md).
required: true
- label: This is **not** brainstorming ideas. If you have an idea you'd like to discuss, please open a new discussion on [the lotus forum](https://github.com/filecoin-project/lotus/discussions/categories/ideas) and select the category as `Ideas`.
required: true
- label: I **have** a specific, actionable, and well motivated feature request to propose.
required: true
- type: dropdown
id: component
validations:
required: true
attributes:
label: Lotus component
description: Please select the lotus component you are requesting a new feature for
options:
- lotus daemon - chain sync
- lotus miner - mining and block production
- lotus miner/worker - sealing
- lotus miner - proving(WindowPoSt)
- lotus miner/market - storage deal
- lotus miner/market - retrieval deal
- lotus client
- lotus JSON-RPC API
- lotus message management (mpool)
- Other
- type: textarea
id: request
attributes:
label: What is the motivation behind this feature request? Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the motivation or the problem is.
placeholder: Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternates
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
id: extra
attributes:
label: Additional context
description: Add any other context, design docs or screenshots about the feature request here.
validations:
required: false
@@ -0,0 +1,91 @@
name: "M1 Bug Report For Deal Making"
description: "File a bug report around deal making for the M1 releases"
labels: [need/triage, kind/bug, M1-release]
body:
- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Please check off the following boxes before continuing to file a bug report!
options:
- label: This is **not** a question or a support request. If you have any lotus related questions, please ask in the [lotus forum](https://github.com/filecoin-project/lotus/discussions).
required: true
- label: I **am** reporting a bug w.r.t one of the [M1 tags](https://github.com/filecoin-project/lotus/discussions/6852#discussioncomment-1043951). If not, choose another issue option [here](https://github.com/filecoin-project/lotus/issues/new/choose).
required: true
- label: I **am** reporting a bug around deal making. If not, create a [M1 Bug Report For Non Deal Making Issue](https://github.com/filecoin-project/lotus/issues/new?assignees=&labels=need%2Ftriage%2Ckind%2Fbug%2CM1-release&template=m1_bug_report_non_deal.yml).
required: true
- label: I have my log level set as instructed [here](https://github.com/filecoin-project/lotus/discussions/6852#discussioncomment-1043678) and have logs available for troubleshooting.
required: true
- label: The deal is coming from one of the M1 clients(communitcated in the coordination slack channel).
required: true
- label: I **have** searched on the [issue tracker](https://github.com/filecoin-project/lotus/issues) and the [lotus forum](https://github.com/filecoin-project/lotus/discussions), and there is no existing related issue or discussion.
required: true
- type: dropdown
id: lotus-componets
validations:
required: true
attributes:
label: Lotus Component
description: Please select the lotus component you are filing a bug for
options:
- lotus miner market subsystem - storage deal
- lotus miner market subsystem - retrieval deal
- lotus miner - storage deal
- lotus miner - retrieval deal
- type: textarea
id: version
attributes:
label: Lotus Tag and Version
description: Enter the lotus tag, output of `lotus version` and `lotus-miner version`.
validations:
reuiqred: true
- type: textarea
id: Description
attributes:
label: Describe the Bug
description: |
This is where you get to tell us what went wrong, when doing so, please try to provide a clear and concise description of the bug with all related information:
* What you were doding when you experienced the bug?
* Any *error* messages you saw, *where* you saw them, and what you believe may have caused them (if you have any ideas).
* What is the expected behaviour?
render: bash
validations:
required: true
- type: textarea
id: deal-status
attributes:
label: Deal Status
description: What's the status of the deal?
placeholder: |
Please share the output of `lotus-miner storage-deals|retrieval-deals list [-v]` commands for the deal(s) in question.
validations:
required: true
- type: textarea
id: data-transfer-status
attributes:
label: Data Transfer Status
description: What's the status of the data transfer?
placeholder: |
Please share the output of `lotus-miner data-transfers list -v` commands for the deal(s) in question.
validations:
required: true
- type: textarea
id: logging
attributes:
label: Logging Information
description: Please link to the whole of the miner logs on your side of the transaction. You can upload the logs to a [gist](https://gist.github.com).
validations:
required: true
- type: textarea
id: RepoSteps
attributes:
label: Repo Steps (optional)
description: "Steps to reproduce the behavior"
value: |
1. Run '...'
2. Do '...'
3. See error '...'
...
render: bash
validations:
required: false
@@ -0,0 +1,81 @@
name: "M1 Bug Report For Non Deal Making Issue"
description: "File a bug report around non deal making issue for the M1 releases"
labels: [need/triage, kind/bug, M1-release]
body:
- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Please check off the following boxes before continuing to file a bug report!
options:
- label: This is **not** a question or a support request. If you have any lotus related questions, please ask in the [lotus forum](https://github.com/filecoin-project/lotus/discussions).
required: true
- label: I **am** reporting a bug w.r.t one of the [M1 tags](https://github.com/filecoin-project/lotus/discussions/6852#discussioncomment-1043951). If not, choose another issue option [here](https://github.com/filecoin-project/lotus/issues/new/choose).
required: true
- label: I am **not** reporting a bug around deal making. If yes, create a [M1 Bug Report For Deal Making](https://github.com/filecoin-project/lotus/issues/new?assignees=&labels=need%2Ftriage%2Ckind%2Fbug%2CM1-release&template=m1_bug_report_deal.yml).
required: true
- label: I **have** searched on the [issue tracker](https://github.com/filecoin-project/lotus/issues) and the [lotus forum](https://github.com/filecoin-project/lotus/discussions), and there is no existing related issue or discussion.
required: true
- type: dropdown
id: component-and-area
validations:
required: true
attributes:
label: Lotus component
description: Please select the lotus component you are filing a bug for
options:
- lotus daemon - chain sync **with** splitstore enabled
- lotus daemon - chain sync **without** splitstore enabled
- lotus miner - mining and block production
- lotus miner/worker - sealing
- lotus miner - proving(WindowPoSt)
- lotus client
- lotus JSON-RPC API
- lotus message management (mpool)
- Other
- type: textarea
id: version
attributes:
label: Lotus Tag and Version
description: Enter the lotus tag, output of `lotus version` and `lotus-miner version`.
validations:
reuiqred: true
- type: textarea
id: Description
attributes:
label: Describe the Bug
description: |
This is where you get to tell us what went wrong, when doing so, please try to provide a clear and concise description of the bug with all related information:
* What you were doding when you experienced the bug?
* Any *error* messages you saw, *where* you saw them, and what you believe may have caused them (if you have any ideas).
* What is the expected behaviour?
* For sealing issues, include the output of `lotus-miner sectors status --log <sectorId>` for the failed sector(s).
* For proving issues, include the output of `lotus-miner proving` info.
render: bash
validations:
required: true
- type: textarea
id: extraInfo
attributes:
label: Logging Information
description: |
Please provide debug logs of the problem, remember you can get set log level control for:
* lotus: use `lotus log list` to get all log systems available and set level by `lotus log set-level`. An example can be found [here](https://docs.filecoin.io/get-started/lotus/configuration-and-advanced-usage/#log-level-control).
* lotus-miner:`lotus-miner log list` to get all log systems available and set level by `lotus-miner log set-level
If you don't provide detailed logs when you raise the issue it will almost certainly be the first request I make before furthur diagnosing the problem.
render: bash
validations:
required: true
- type: textarea
id: RepoSteps
attributes:
label: Repo Steps
description: "Steps to reproduce the behavior"
value: |
1. Run '...'
2. Do '...'
3. See error '...'
...
render: bash
validations:
required: false
-35
View File
@@ -1,35 +0,0 @@
---
name: Mining Issues
about: Create a report for help with mining failures.
title: "[Mining Issue]"
labels: hint/needs-triaging, area/mining
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
Please provide all the information requested here to help us troubleshoot "mining/WinningPoSt failed" issues.
If the information requested is missing, you may be asked you to provide it.
**Describe the problem**
A brief description of the problem you encountered while mining new blocks.
**Version**
The output of `lotus --version`.
**Setup**
You miner and daemon setup, including what hardware do you use, your environment variable settings, how do you run your miner and worker, do you use GPU and etc.
**Lotus daemon and miner logs**
Please go through the logs of your daemon and miner, and include screenshots of any error/warning-like messages you find, highlighting the one has "winning post" in it.
Alternatively please upload full log files and share a link here
** Code modifications **
If you have modified parts of lotus, please describe which areas were modified,
and the scope of those modifications
-46
View File
@@ -1,46 +0,0 @@
---
name: Proving Issues
about: Create a report for help with proving failures.
title: "[Proving Issue]"
labels: area/proving, hint/needs-triaging
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
Please provide all the information requested here to help us troubleshoot "proving/window PoSt failed" issues.
If the information requested is missing, we will probably have to just ask you to provide it anyway,
before we can help debug.
**Describe the problem**
A brief description of the problem you encountered while proving the storage.
**Version**
The output of `lotus --version`.
**Setup**
You miner and daemon setup, including what hardware do you use, your environment variable settings, how do you run your miner and worker, do you use GPU and etc.
**Proving status**
The output of `lotus-miner proving` info.
**Lotus miner logs**
Please go through the logs of your miner, and include screenshots of any error-like messages you find, highlighting the one has "window post" in it.
Alternatively please upload full log files and share a link here
**Lotus miner diagnostic info**
Please collect the following diagnostic information, and share a link here
* lotus-miner diagnostic info `lotus-miner info all > allinfo.txt`
** Code modifications **
If you have modified parts of lotus, please describe which areas were modified,
and the scope of those modifications
-50
View File
@@ -1,50 +0,0 @@
---
name: Sealing Issues
about: Create a report for help with sealing (commit) failures.
title: "[Sealing Issue]"
labels: hint/needs-triaging, area/sealing
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
Please provide all the information requested here to help us troubleshoot "commit failed" issues.
If the information requested is missing, we will probably have to just ask you to provide it anyway,
before we can help debug.
**Describe the problem**
A brief description of the problem you encountered while sealing a sector.
**Version**
The output of `lotus --version`.
**Setup**
You miner and daemon setup, including what hardware do you use, your environment variable settings, how do you run your miner and worker, do you use GPU and etc.
**Commands**
Commands you ran.
**Sectors status**
The output of `lotus-miner sectors status --log <sectorId>` for the failed sector(s).
**Lotus miner logs**
Please go through the logs of your miner, and include screenshots of any error-like messages you find.
Alternatively please upload full log files and share a link here
**Lotus miner diagnostic info**
Please collect the following diagnostic information, and share a link here
* lotus-miner diagnostic info `lotus-miner info all > allinfo`
** Code modifications **
If you have modified parts of lotus, please describe which areas were modified,
and the scope of those modifications
+4
View File
@@ -35,6 +35,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: '1.16.4'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
+33
View File
@@ -0,0 +1,33 @@
name: Close and mark stale issue
on:
schedule:
- cron: '0 12 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 24 hours.'
close-issue-message: 'This issue was closed because it is missing author input.'
stale-pr-message: 'Thank you for submitting the PR and contributing to lotus! Lotus maintainers need more of your input before merging it, please address the suggested changes or reply to the comments or this PR will be closed in 48 hours. You are always more than welcome to reopen the PR later as well!'
close-pr-message: 'This PR was closed because it is missing author input. Please feel free to reopen the PR when you get to it! Thank you for your interest in contributing to lotus!'
stale-issue-label: 'kind/stale'
stale-pr-label: 'kind/stale'
any-of-labels: 'need/author-input '
days-before-issue-stale: 3
days-before-issue-close: 1
days-before-pr-stale: 5
days-before-pr-close: 2
remove-stale-when-updated: true
enable-statistics: true
+29
View File
@@ -0,0 +1,29 @@
---
name: Testground PR Checker
on: [push]
jobs:
testground:
runs-on: ubuntu-latest
name: ${{ matrix.composition_file }}
strategy:
matrix:
include:
- backend_addr: ci.testground.ipfs.team
backend_proto: https
plan_directory: testplans/lotus-soup
composition_file: testplans/lotus-soup/_compositions/baseline-k8s-3-1.toml
- backend_addr: ci.testground.ipfs.team
backend_proto: https
plan_directory: testplans/lotus-soup
composition_file: testplans/lotus-soup/_compositions/paych-stress-k8s.toml
steps:
- uses: actions/checkout@v2
- name: testground run
uses: coryschwartz/testground-github-action@v1.1
with:
backend_addr: ${{ matrix.backend_addr }}
backend_proto: ${{ matrix.backend_proto }}
plan_directory: ${{ matrix.plan_directory }}
composition_file: ${{ matrix.composition_file }}
+4
View File
@@ -1,3 +1,6 @@
/AppDir
/appimage-builder-cache
*.AppImage
/lotus
/lotus-miner
/lotus-worker
@@ -5,6 +8,7 @@
/lotus-health
/lotus-chainwatch
/lotus-shed
/lotus-sim
/lotus-pond
/lotus-townhall
/lotus-fountain
+46 -150
View File
@@ -1,9 +1,42 @@
# Lotus changelog
# 1.10.1 / 2021-07-05
This is an optional but **highly recommended** release of Lotus for lotus miners that has many bug fixes and improvements based on the feedback we got from the community since HyperDrive.
## New Features
- commit batch: AggregateAboveBaseFee config #6650
- `AggregateAboveBaseFee` is added to miner sealing configuration for setting the network base fee to start aggregating proofs. When the network base fee is lower than this value, the prove commits will be submitted individually via `ProveCommitSector`. According to the [Batch Incentive Alignment](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0013.md#batch-incentive-alignment) introduced in FIP-0013, we recommend miners to set this value to 0.15 nanoFIL(which is the default value) to avoid unexpected aggregation fee in burn and enjoy the most benefits of aggregation!
## Bug Fixes
- storage: Fix FinalizeSector with sectors in storage paths #6652
- Fix tiny error in check-client-datacap #6664
- Fix: precommit_batch method used the wrong cfg.PreCommitBatchWait #6658
- to optimize the batchwait #6636
- fix getTicket: sector precommitted but expired case #6635
- handleSubmitCommitAggregate() exception handling #6595
- remove precommit check in handleCommitFailed #6634
- ensure agg fee is adequate
- fix: miner balance is not enough, so that ProveCommitAggregate msg exec failed #6623
- commit batch: Initialize the FailedSectors map #6647
Contributors
| Contributor | Commits | Lines ± | Files Changed |
|-------------|---------|---------|---------------|
| @magik6k| 7 | +151/-56 | 21 |
| @llifezou | 4 | +59/-20 | 4 |
| @johnli-helloworld | 2 | +45/-14 | 4 |
| @wangchao | 1 | +1/-27 | 1 |
| Jerry | 2 | +9/-4 | 2 |
| @zhoutian527 | 1 | +2/-2 | 1 |
| @ribasushi| 1 | +1/-1 | 1 |
# 1.10.0 / 2021-06-23
This is a mandatory release of Lotus that introduces Filecoin network v13, codenamed the HyperDrive upgrade. The
Filecoin mainnet will upgrade, which is epoch 892800, on 2021-06-30T22:00:00Z. The network upgrade introduces the
This is a mandatory release of Lotus that introduces Filecoin network v13, codenamed the HyperDrive upgrade. The
Filecoin mainnet will upgrade, which is epoch 892800, on 2021-06-30T22:00:00Z. The network upgrade introduces the
following FIPs:
- [FIP-0008](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0008.md): Add miner batched sector pre-commit method
@@ -20,10 +53,10 @@ FIPs [0008](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0008.m
**Check out the documentation [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#precommitsectorsbatch) for details on the new Lotus miner sealing config options, [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#fees-section) for fee config options, and explanations of the new features.**
Note:
Note:
- We recommend to keep `PreCommitSectorsBatch` as 1.
- We recommend miners to set `PreCommitBatchWait` lower than 30 hours.
- We recommend miners to set a longer `CommitBatchSlack` and `PreCommitBatchSlack` to prevent message failures
- We recommend miners to set a longer `CommitBatchSlack` and `PreCommitBatchSlack` to prevent message failures
due to expirations.
### Projected state tree growth
@@ -63,35 +96,35 @@ Included in the HyperDrive upgrade is [FIP-0015](https://github.com/filecoin-pro
- Always flush when timer goes off ([filecoin-project/lotus#6563](https://github.com/filecoin-project/lotus/pull/6563))
- Update default fees for aggregates ([filecoin-project/lotus#6548](https://github.com/filecoin-project/lotus/pull/6548))
- sealing: Early finalization option ([filecoin-project/lotus#6452](https://github.com/filecoin-project/lotus/pull/6452))
- `./lotus-miner/config.toml/[Sealing.FinalizeEarly]`: default to false. Enable if you want to FinalizeSector before commiting
- `./lotus-miner/config.toml/[Sealing.FinalizeEarly]`: default to false. Enable if you want to FinalizeSector before commiting
- Add filplus utils to CLI ([filecoin-project/lotus#6351](https://github.com/filecoin-project/lotus/pull/6351))
- cli doc can be found [here](https://github.com/filecoin-project/lotus/blob/master/documentation/en/cli-lotus.md#lotus-filplus)
- Add miner-side MaxDealStartDelay config ([filecoin-project/lotus#6576](https://github.com/filecoin-project/lotus/pull/6576))
### Bug Fixes
- chainstore: Don't take heaviestLk with backlogged reorgCh ([filecoin-project/lotus#6526](https://github.com/filecoin-project/lotus/pull/6526))
- Backport #6041 - storagefsm: Fix batch deal packing behavior ([filecoin-project/lotus#6519](https://github.com/filecoin-project/lotus/pull/6519))
- backport: pick the correct partitions-per-post limit ([filecoin-project/lotus#6503](https://github.com/filecoin-project/lotus/pull/6503))
- backport: pick the correct partitions-per-post limit ([filecoin-project/lotus#6503](https://github.com/filecoin-project/lotus/pull/6503))
- failed sectors should be added into res correctly ([filecoin-project/lotus#6472](https://github.com/filecoin-project/lotus/pull/6472))
- sealing: Fix restartSectors race ([filecoin-project/lotus#6491](https://github.com/filecoin-project/lotus/pull/6491))
- Fund miners with the aggregate fee when ProveCommitting ([filecoin-project/lotus#6428](https://github.com/filecoin-project/lotus/pull/6428))
- Fund miners with the aggregate fee when ProveCommitting ([filecoin-project/lotus#6428](https://github.com/filecoin-project/lotus/pull/6428))
- Commit and Precommit batcher cannot share a getSectorDeadline method ([filecoin-project/lotus#6416](https://github.com/filecoin-project/lotus/pull/6416))
- Fix supported proof type manipulations for v5 actors ([filecoin-project/lotus#6366](https://github.com/filecoin-project/lotus/pull/6366))
- events: Fix handling of multiple matched events per epoch ([filecoin-project/lotus#6362](https://github.com/filecoin-project/lotus/pull/6362))
- Fix randomness fetching around null blocks ([filecoin-project/lotus#6240](https://github.com/filecoin-project/lotus/pull/6240))
### Improvements
### Improvements
- Appimage v1.10.0 rc3 ([filecoin-project/lotus#6492](https://github.com/filecoin-project/lotus/pull/6492))
- Expand on Drand change testing ([filecoin-project/lotus#6500](https://github.com/filecoin-project/lotus/pull/6500))
- Backport Fix logging around mineOne ([filecoin-project/lotus#6499](https://github.com/filecoin-project/lotus/pull/6499))
- mpool: Add more metrics ([filecoin-project/lotus#6453](https://github.com/filecoin-project/lotus/pull/6453))
- mpool: Add more metrics ([filecoin-project/lotus#6453](https://github.com/filecoin-project/lotus/pull/6453))
- Merge backported PRs into v1.10 release branch ([filecoin-project/lotus#6436](https://github.com/filecoin-project/lotus/pull/6436))
- Fix tests ([filecoin-project/lotus#6371](https://github.com/filecoin-project/lotus/pull/6371))
- Extend the default deal start epoch delay ([filecoin-project/lotus#6350](https://github.com/filecoin-project/lotus/pull/6350))
- sealing: Wire up context to batchers ([filecoin-project/lotus#6497](https://github.com/filecoin-project/lotus/pull/6497))
- Improve address resolution for messages ([filecoin-project/lotus#6364](https://github.com/filecoin-project/lotus/pull/6364))
### Dependency Updates
- Proofs v8.0.2 ([filecoin-project/lotus#6524](https://github.com/filecoin-project/lotus/pull/6524))
- Update to fixed Bellperson ([filecoin-project/lotus#6480](https://github.com/filecoin-project/lotus/pull/6480))
@@ -102,7 +135,7 @@ Included in the HyperDrive upgrade is [FIP-0015](https://github.com/filecoin-pro
- github.com/filecoin-project/go-hamt-ipld/v3 (v3.0.1 -> v3.1.0)
- github.com/ipfs/go-log/v2 (v2.1.2-0.20200626104915-0016c0b4b3e4 -> v2.1.3)
- github.com/filecoin-project/go-amt-ipld/v3 (v3.0.0 -> v3.1.0)
### Network Version v13 HyperDrive Upgrade
- Set HyperDrive upgrade epoch ([filecoin-project/lotus#6565](https://github.com/filecoin-project/lotus/pull/6565))
- version bump to lotus v1.10.0-rc6 ([filecoin-project/lotus#6529](https://github.com/filecoin-project/lotus/pull/6529))
@@ -208,143 +241,6 @@ This is an optional Lotus release that introduces various improvements to the se
- fix health report (https://github.com/filecoin-project/lotus/pull/6011)
- fix(ci): Use recent ubuntu LTS release; Update release params ((https://github.com/filecoin-project/lotus/pull/6011))
# 1.9.0-rc4 / 2021-05-13
This is an optional Lotus release that introduces various improvements to the sealing, mining, and deal-making processes.
## Highlights
- OpenRPC Support (https://github.com/filecoin-project/lotus/pull/5843)
- Take latency into account when making interactive deals (https://github.com/filecoin-project/lotus/pull/5876)
- Update go-commp-utils for >10x faster client commp calculation (https://github.com/filecoin-project/lotus/pull/5892)
- add `lotus client cancel-retrieval` cmd to lotus CLI (https://github.com/filecoin-project/lotus/pull/5871)
- add `inspect-deal` command to `lotus client` (https://github.com/filecoin-project/lotus/pull/5833)
- Local retrieval support (https://github.com/filecoin-project/lotus/pull/5917)
- go-fil-markets v1.1.9 -> v1.2.5
- For a detailed changelog see https://github.com/filecoin-project/go-fil-markets/blob/master/CHANGELOG.md
- rust-fil-proofs v5.4.1 -> v7.0.1
- For a detailed changelog see https://github.com/filecoin-project/rust-fil-proofs/blob/master/CHANGELOG.md
## Changes
- storagefsm: Apply global events even in broken states (https://github.com/filecoin-project/lotus/pull/5962)
- Default the AlwaysKeepUnsealedCopy flag to true (https://github.com/filecoin-project/lotus/pull/5743)
- splitstore: compact hotstore prior to garbage collection (https://github.com/filecoin-project/lotus/pull/5778)
- ipfs-force bootstrapper update (https://github.com/filecoin-project/lotus/pull/5799)
- better logging when unsealing fails (https://github.com/filecoin-project/lotus/pull/5851)
- perf: add cache for gas permium estimation (https://github.com/filecoin-project/lotus/pull/5709)
- backupds: Compact log on restart (https://github.com/filecoin-project/lotus/pull/5875)
- backupds: Improve truncated log handling (https://github.com/filecoin-project/lotus/pull/5891)
- State CLI improvements (State CLI improvements)
- API proxy struct codegen (https://github.com/filecoin-project/lotus/pull/5854)
- move DI stuff for paychmgr into modules (https://github.com/filecoin-project/lotus/pull/5791)
- Implement Event observer and Settings for 3rd party dep injection (https://github.com/filecoin-project/lotus/pull/5693)
- Export developer and network commands for consumption by derivatives of Lotus (https://github.com/filecoin-project/lotus/pull/5864)
- mock sealer: Simulate randomness sideeffects (https://github.com/filecoin-project/lotus/pull/5805)
- localstorage: Demote reservation stat error to debug (https://github.com/filecoin-project/lotus/pull/5976)
- shed command to unpack miner info dumps (https://github.com/filecoin-project/lotus/pull/5800)
- Add two utils to Lotus-shed (https://github.com/filecoin-project/lotus/pull/5867)
- add shed election estimate command (https://github.com/filecoin-project/lotus/pull/5092)
- Add --actor flag in lotus-shed sectors terminate (https://github.com/filecoin-project/lotus/pull/5819)
- Move lotus mpool clear to lotus-shed (https://github.com/filecoin-project/lotus/pull/5900)
- Centralize everything on ipfs/go-log/v2 (https://github.com/filecoin-project/lotus/pull/5974)
- expose NextID from nice market actor interface (https://github.com/filecoin-project/lotus/pull/5850)
- add available options for perm on error (https://github.com/filecoin-project/lotus/pull/5814)
- API docs clarification: Document StateSearchMsg replaced message behavior (https://github.com/filecoin-project/lotus/pull/5838)
- api: Document StateReplay replaced message behavior (https://github.com/filecoin-project/lotus/pull/5840)
- add godocs to miner objects (https://github.com/filecoin-project/lotus/pull/2184)
- Add description to the client deal CLI command (https://github.com/filecoin-project/lotus/pull/5999)
- lint: don't skip builtin (https://github.com/filecoin-project/lotus/pull/5881)
- use deal duration from actors (https://github.com/filecoin-project/lotus/pull/5270)
- remote calc winningpost proof (https://github.com/filecoin-project/lotus/pull/5884)
- packer: other network images (https://github.com/filecoin-project/lotus/pull/5930)
- Convert the chainstore lock to RW (https://github.com/filecoin-project/lotus/pull/5971)
- Remove CachedBlockstore (https://github.com/filecoin-project/lotus/pull/5972)
- remove messagepool CapGasFee duplicate code (https://github.com/filecoin-project/lotus/pull/5992)
- Add a mining-heartbeat INFO line at every epoch (https://github.com/filecoin-project/lotus/pull/6183)
- chore(ci): Enable build on RC tags (https://github.com/filecoin-project/lotus/pull/6245)
- Upgrade nerpa to actor v4 and bump the version to rc4 (https://github.com/filecoin-project/lotus/pull/6249)
## Fixes
- return buffers after canceling badger operation (https://github.com/filecoin-project/lotus/pull/5796)
- avoid holding a lock while calling the View callback (https://github.com/filecoin-project/lotus/pull/5792)
- storagefsm: Trigger input processing when below limits (https://github.com/filecoin-project/lotus/pull/5801)
- After importing a previously deleted key, be able to delete it again (https://github.com/filecoin-project/lotus/pull/4653)
- fix StateManager.Replay on reward actor (https://github.com/filecoin-project/lotus/pull/5804)
- make sure atomic 64bit fields are 64bit aligned (https://github.com/filecoin-project/lotus/pull/5794)
- Import secp sigs in paych tests (https://github.com/filecoin-project/lotus/pull/5879)
- fix ci build-macos (https://github.com/filecoin-project/lotus/pull/5934)
- Fix creation of remainder account when it's not a multisig (https://github.com/filecoin-project/lotus/pull/5807)
- Fix fallback chainstore (https://github.com/filecoin-project/lotus/pull/6003)
- fix 4857: show help for set-addrs (https://github.com/filecoin-project/lotus/pull/5943)
- fix health report (https://github.com/filecoin-project/lotus/pull/6011)
# 1.9.0-rc2 / 2021-04-30
This is an optional Lotus release that introduces various improvements to the sealing, mining, and deal-making processes.
## Highlights
- OpenRPC Support (https://github.com/filecoin-project/lotus/pull/5843)
- Take latency into account when making interactive deals (https://github.com/filecoin-project/lotus/pull/5876)
- Update go-commp-utils for >10x faster client commp calculation (https://github.com/filecoin-project/lotus/pull/5892)
- add `lotus client cancel-retrieval` cmd to lotus CLI (https://github.com/filecoin-project/lotus/pull/5871)
- add `inspect-deal` command to `lotus client` (https://github.com/filecoin-project/lotus/pull/5833)
- Local retrieval support (https://github.com/filecoin-project/lotus/pull/5917)
- go-fil-markets v1.1.9 -> v1.2.5
- For a detailed changelog see https://github.com/filecoin-project/go-fil-markets/blob/master/CHANGELOG.md
- rust-fil-proofs v5.4.1 -> v7
- For a detailed changelog see https://github.com/filecoin-project/rust-fil-proofs/blob/master/CHANGELOG.md
## Changes
- storagefsm: Apply global events even in broken states (https://github.com/filecoin-project/lotus/pull/5962)
- Default the AlwaysKeepUnsealedCopy flag to true (https://github.com/filecoin-project/lotus/pull/5743)
- splitstore: compact hotstore prior to garbage collection (https://github.com/filecoin-project/lotus/pull/5778)
- ipfs-force bootstrapper update (https://github.com/filecoin-project/lotus/pull/5799)
- better logging when unsealing fails (https://github.com/filecoin-project/lotus/pull/5851)
- perf: add cache for gas permium estimation (https://github.com/filecoin-project/lotus/pull/5709)
- backupds: Compact log on restart (https://github.com/filecoin-project/lotus/pull/5875)
- backupds: Improve truncated log handling (https://github.com/filecoin-project/lotus/pull/5891)
- State CLI improvements (State CLI improvements)
- API proxy struct codegen (https://github.com/filecoin-project/lotus/pull/5854)
- move DI stuff for paychmgr into modules (https://github.com/filecoin-project/lotus/pull/5791)
- Implement Event observer and Settings for 3rd party dep injection (https://github.com/filecoin-project/lotus/pull/5693)
- Export developer and network commands for consumption by derivatives of Lotus (https://github.com/filecoin-project/lotus/pull/5864)
- mock sealer: Simulate randomness sideeffects (https://github.com/filecoin-project/lotus/pull/5805)
- localstorage: Demote reservation stat error to debug (https://github.com/filecoin-project/lotus/pull/5976)
- shed command to unpack miner info dumps (https://github.com/filecoin-project/lotus/pull/5800)
- Add two utils to Lotus-shed (https://github.com/filecoin-project/lotus/pull/5867)
- add shed election estimate command (https://github.com/filecoin-project/lotus/pull/5092)
- Add --actor flag in lotus-shed sectors terminate (https://github.com/filecoin-project/lotus/pull/5819)
- Move lotus mpool clear to lotus-shed (https://github.com/filecoin-project/lotus/pull/5900)
- Centralize everything on ipfs/go-log/v2 (https://github.com/filecoin-project/lotus/pull/5974)
- expose NextID from nice market actor interface (https://github.com/filecoin-project/lotus/pull/5850)
- add available options for perm on error (https://github.com/filecoin-project/lotus/pull/5814)
- API docs clarification: Document StateSearchMsg replaced message behavior (https://github.com/filecoin-project/lotus/pull/5838)
- api: Document StateReplay replaced message behavior (https://github.com/filecoin-project/lotus/pull/5840)
- add godocs to miner objects (https://github.com/filecoin-project/lotus/pull/2184)
- Add description to the client deal CLI command (https://github.com/filecoin-project/lotus/pull/5999)
- lint: don't skip builtin (https://github.com/filecoin-project/lotus/pull/5881)
- use deal duration from actors (https://github.com/filecoin-project/lotus/pull/5270)
- remote calc winningpost proof (https://github.com/filecoin-project/lotus/pull/5884)
- packer: other network images (https://github.com/filecoin-project/lotus/pull/5930)
- Convert the chainstore lock to RW (https://github.com/filecoin-project/lotus/pull/5971)
- Remove CachedBlockstore (https://github.com/filecoin-project/lotus/pull/5972)
- remove messagepool CapGasFee duplicate code (https://github.com/filecoin-project/lotus/pull/5992)
## Fixes
- return buffers after canceling badger operation (https://github.com/filecoin-project/lotus/pull/5796)
- avoid holding a lock while calling the View callback (https://github.com/filecoin-project/lotus/pull/5792)
- storagefsm: Trigger input processing when below limits (https://github.com/filecoin-project/lotus/pull/5801)
- After importing a previously deleted key, be able to delete it again (https://github.com/filecoin-project/lotus/pull/4653)
- fix StateManager.Replay on reward actor (https://github.com/filecoin-project/lotus/pull/5804)
- make sure atomic 64bit fields are 64bit aligned (https://github.com/filecoin-project/lotus/pull/5794)
- Import secp sigs in paych tests (https://github.com/filecoin-project/lotus/pull/5879)
- fix ci build-macos (https://github.com/filecoin-project/lotus/pull/5934)
- Fix creation of remainder account when it's not a multisig (https://github.com/filecoin-project/lotus/pull/5807)
- Fix fallback chainstore (https://github.com/filecoin-project/lotus/pull/6003)
- fix 4857: show help for set-addrs (https://github.com/filecoin-project/lotus/pull/5943)
- fix health report (https://github.com/filecoin-project/lotus/pull/6011)
# 1.8.0 / 2021-04-05
This is a mandatory release of Lotus that upgrades the network to version 12, which introduces various performance improvements to the cron processing of the power actor. The network will upgrade at height 712320, which is 2021-04-29T06:00:00Z.
+159 -5
View File
@@ -1,4 +1,4 @@
FROM golang:1.15.6 AS builder-deps
FROM golang:1.16.4 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
@@ -36,7 +36,7 @@ WORKDIR /opt/filecoin
ARG RUSTFLAGS=""
ARG GOFLAGS=""
RUN make deps lotus lotus-miner lotus-worker lotus-shed lotus-chainwatch lotus-stats
RUN make lotus lotus-miner lotus-worker lotus-shed lotus-wallet lotus-gateway
FROM ubuntu:20.04 AS base
@@ -56,19 +56,173 @@ COPY --from=builder /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /lib/
RUN useradd -r -u 532 -U fc
###
FROM base AS lotus
MAINTAINER Lotus Development Team
COPY --from=builder /opt/filecoin/lotus /usr/local/bin/
COPY --from=builder /opt/filecoin/lotus /usr/local/bin/
COPY --from=builder /opt/filecoin/lotus-shed /usr/local/bin/
COPY scripts/docker-lotus-entrypoint.sh /
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
ENV LOTUS_PATH /var/lib/lotus
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
ENV LOTUS_JAEGER_AGENT_PORT 6831
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
ENV DOCKER_LOTUS_IMPORT_WALLET ""
RUN mkdir /var/lib/lotus /var/tmp/filecoin-proof-parameters && chown fc /var/lib/lotus /var/tmp/filecoin-proof-parameters
RUN mkdir /var/lib/lotus /var/tmp/filecoin-proof-parameters
RUN chown fc: /var/lib/lotus /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/lotus
VOLUME /var/tmp/filecoin-proof-parameters
USER fc
ENTRYPOINT ["/usr/local/bin/lotus"]
EXPOSE 1234
ENTRYPOINT ["/docker-lotus-entrypoint.sh"]
CMD ["-help"]
###
FROM base AS lotus-wallet
MAINTAINER Lotus Development Team
COPY --from=builder /opt/filecoin/lotus-wallet /usr/local/bin/
ENV WALLET_PATH /var/lib/lotus-wallet
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
ENV LOTUS_JAEGER_AGENT_PORT 6831
RUN mkdir /var/lib/lotus-wallet
RUN chown fc: /var/lib/lotus-wallet
VOLUME /var/lib/lotus-wallet
USER fc
EXPOSE 1777
ENTRYPOINT ["/usr/local/bin/lotus-wallet"]
CMD ["-help"]
###
FROM base AS lotus-gateway
MAINTAINER Lotus Development Team
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
ENV LOTUS_JAEGER_AGENT_PORT 6831
ENV FULLNODE_API_INFO /ip4/127.0.0.1/tcp/1234/http
USER fc
EXPOSE 1234
ENTRYPOINT ["/usr/local/bin/lotus-gateway"]
CMD ["-help"]
###
FROM base AS lotus-miner
MAINTAINER Lotus Development Team
COPY --from=builder /opt/filecoin/lotus-miner /usr/local/bin/
COPY scripts/docker-lotus-miner-entrypoint.sh /
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
ENV FULLNODE_API_INFO /ip4/127.0.0.1/tcp/1234/http
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
ENV LOTUS_JAEGER_AGENT_PORT 6831
ENV DOCKER_LOTUS_MINER_INIT true
RUN mkdir /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
RUN chown fc: /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/lotus-miner
VOLUME /var/tmp/filecoin-proof-parameters
USER fc
EXPOSE 2345
ENTRYPOINT ["/docker-lotus-miner-entrypoint.sh"]
CMD ["-help"]
###
FROM base AS lotus-worker
MAINTAINER Lotus Development Team
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
ENV MINER_API_INFO /ip4/127.0.0.1/tcp/2345/http
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
ENV LOTUS_JAEGER_AGENT_PORT 6831
RUN mkdir /var/lib/lotus-worker
RUN chown fc: /var/lib/lotus-worker
VOLUME /var/lib/lotus-worker
USER fc
EXPOSE 3456
ENTRYPOINT ["/usr/local/bin/lotus-worker"]
CMD ["-help"]
###
from base as lotus-all-in-one
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
ENV FULLNODE_API_INFO /ip4/127.0.0.1/tcp/1234/http
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
ENV LOTUS_JAEGER_AGENT_PORT 6831
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
ENV LOTUS_PATH /var/lib/lotus
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
ENV MINER_API_INFO /ip4/127.0.0.1/tcp/2345/http
ENV WALLET_PATH /var/lib/lotus-wallet
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
ENV DOCKER_LOTUS_MINER_INIT true
COPY --from=builder /opt/filecoin/lotus /usr/local/bin/
COPY --from=builder /opt/filecoin/lotus-shed /usr/local/bin/
COPY --from=builder /opt/filecoin/lotus-wallet /usr/local/bin/
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
COPY --from=builder /opt/filecoin/lotus-miner /usr/local/bin/
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
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
+34 -27
View File
@@ -6,9 +6,9 @@ all: build
unexport GOFLAGS
GOVERSION:=$(shell go version | cut -d' ' -f 3 | sed 's/^go//' | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
ifeq ($(shell expr $(GOVERSION) \< 1015005), 1)
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.15.5)
$(error Update Golang to version to at least 1.16.0)
endif
# git modules that need to be loaded
@@ -47,7 +47,6 @@ BUILD_DEPS+=ffi-version-check
.PHONY: ffi-version-check
$(MODULES): build/.update-modules ;
# dummy file that marks the last time modules were updated
build/.update-modules:
@@ -81,32 +80,31 @@ nerpanet: build-devnets
butterflynet: GOFLAGS+=-tags=butterflynet
butterflynet: build-devnets
interopnet: GOFLAGS+=-tags=interopnet
interopnet: build-devnets
lotus: $(BUILD_DEPS)
rm -f lotus
go build $(GOFLAGS) -o lotus ./cmd/lotus
go run github.com/GeertJohan/go.rice/rice append --exec lotus -i ./build
.PHONY: lotus
BINS+=lotus
lotus-miner: $(BUILD_DEPS)
rm -f lotus-miner
go build $(GOFLAGS) -o lotus-miner ./cmd/lotus-storage-miner
go run github.com/GeertJohan/go.rice/rice append --exec lotus-miner -i ./build
go build $(GOFLAGS) -o lotus-miner ./cmd/lotus-miner
.PHONY: lotus-miner
BINS+=lotus-miner
lotus-worker: $(BUILD_DEPS)
rm -f lotus-worker
go build $(GOFLAGS) -o lotus-worker ./cmd/lotus-seal-worker
go run github.com/GeertJohan/go.rice/rice append --exec lotus-worker -i ./build
.PHONY: lotus-worker
BINS+=lotus-worker
lotus-shed: $(BUILD_DEPS)
rm -f lotus-shed
go build $(GOFLAGS) -o lotus-shed ./cmd/lotus-shed
go run github.com/GeertJohan/go.rice/rice append --exec lotus-shed -i ./build
.PHONY: lotus-shed
BINS+=lotus-shed
@@ -133,12 +131,14 @@ install-miner:
install-worker:
install -C ./lotus-worker /usr/local/bin/lotus-worker
install-app:
install -C ./$(APP) /usr/local/bin/$(APP)
# TOOLS
lotus-seed: $(BUILD_DEPS)
rm -f lotus-seed
go build $(GOFLAGS) -o lotus-seed ./cmd/lotus-seed
go run github.com/GeertJohan/go.rice/rice append --exec lotus-seed -i ./build
.PHONY: lotus-seed
BINS+=lotus-seed
@@ -172,13 +172,11 @@ lotus-townhall-front:
.PHONY: lotus-townhall-front
lotus-townhall-app: lotus-touch lotus-townhall-front
go run github.com/GeertJohan/go.rice/rice append --exec lotus-townhall -i ./cmd/lotus-townhall -i ./build
.PHONY: lotus-townhall-app
lotus-fountain:
rm -f lotus-fountain
go build -o lotus-fountain ./cmd/lotus-fountain
go run github.com/GeertJohan/go.rice/rice append --exec lotus-fountain -i ./cmd/lotus-fountain -i ./build
.PHONY: lotus-fountain
BINS+=lotus-fountain
@@ -191,28 +189,24 @@ BINS+=lotus-chainwatch
lotus-bench:
rm -f lotus-bench
go build -o lotus-bench ./cmd/lotus-bench
go run github.com/GeertJohan/go.rice/rice append --exec lotus-bench -i ./build
.PHONY: lotus-bench
BINS+=lotus-bench
lotus-stats:
rm -f lotus-stats
go build $(GOFLAGS) -o lotus-stats ./cmd/lotus-stats
go run github.com/GeertJohan/go.rice/rice append --exec lotus-stats -i ./build
.PHONY: lotus-stats
BINS+=lotus-stats
lotus-pcr:
rm -f lotus-pcr
go build $(GOFLAGS) -o lotus-pcr ./cmd/lotus-pcr
go run github.com/GeertJohan/go.rice/rice append --exec lotus-pcr -i ./build
.PHONY: lotus-pcr
BINS+=lotus-pcr
lotus-health:
rm -f lotus-health
go build -o lotus-health ./cmd/lotus-health
go run github.com/GeertJohan/go.rice/rice append --exec lotus-health -i ./build
.PHONY: lotus-health
BINS+=lotus-health
@@ -243,6 +237,12 @@ BINS+=tvx
install-chainwatch: lotus-chainwatch
install -C ./lotus-chainwatch /usr/local/bin/lotus-chainwatch
lotus-sim: $(BUILD_DEPS)
rm -f lotus-sim
go build $(GOFLAGS) -o lotus-sim ./cmd/lotus-sim
.PHONY: lotus-sim
BINS+=lotus-sim
# SYSTEMD
install-daemon-service: install-daemon
@@ -303,17 +303,10 @@ clean-services: clean-all-services
buildall: $(BINS)
completions:
./scripts/make-completions.sh lotus
./scripts/make-completions.sh lotus-miner
.PHONY: completions
install-completions:
mkdir -p /usr/share/bash-completion/completions /usr/local/share/zsh/site-functions/
install -C ./scripts/bash-completion/lotus /usr/share/bash-completion/completions/lotus
install -C ./scripts/bash-completion/lotus-miner /usr/share/bash-completion/completions/lotus-miner
install -C ./scripts/zsh-completion/lotus /usr/local/share/zsh/site-functions/_lotus
install -C ./scripts/zsh-completion/lotus-miner /usr/local/share/zsh/site-functions/_lotus-miner
clean:
rm -rf $(CLEAN) $(BINS)
@@ -343,17 +336,18 @@ api-gen:
goimports -w api
.PHONY: api-gen
appimage: $(BUILD_DEPS)
cfgdoc-gen:
go run ./node/config/cfgdocgen > ./node/config/doc_gen.go
appimage: lotus
rm -rf appimage-builder-cache || true
rm AppDir/io.filecoin.lotus.desktop || true
rm AppDir/icon.svg || true
rm Appdir/AppRun || true
mkdir -p AppDir/usr/bin
rm -rf lotus
go run github.com/GeertJohan/go.rice/rice embed-go -i ./build
go build $(GOFLAGS) -o lotus ./cmd/lotus
cp ./lotus AppDir/usr/bin/
appimage-builder
docsgen: docsgen-md docsgen-openrpc
docsgen-md-bin: api-gen actors-gen
@@ -382,8 +376,21 @@ docsgen-openrpc-worker: docsgen-openrpc-bin
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin
gen: actors-gen type-gen method-gen docsgen api-gen
gen: actors-gen type-gen method-gen cfgdoc-gen docsgen api-gen circleci
@echo ">>> IF YOU'VE MODIFIED THE CLI, REMEMBER TO ALSO MAKE docsgen-cli"
.PHONY: gen
snap: lotus lotus-miner lotus-worker
snapcraft
# snapcraft upload ./lotus_*.snap
# separate from gen because it needs binaries
docsgen-cli: lotus lotus-miner lotus-worker
python ./scripts/generate-lotus-cli.py
.PHONY: docsgen-cli
print-%:
@echo $*=$($*)
circleci:
go generate -x ./.circleci
+86 -2
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.15.5-blue.svg" /></a>
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.16-blue.svg" /></a>
<br>
</p>
@@ -18,7 +18,9 @@ Lotus is an implementation of the Filecoin Distributed Storage Network. For more
## Building & Documentation
For instructions on how to build, install and setup lotus, please visit [https://docs.filecoin.io/get-started/lotus](https://docs.filecoin.io/get-started/lotus/).
> Note: The default `master` branch is the dev branch, please use with caution. For the latest stable version, checkout the most recent [`Latest release`](https://github.com/filecoin-project/lotus/releases).
For complete instructions on how to build, install and setup lotus, please visit [https://docs.filecoin.io/get-started/lotus](https://docs.filecoin.io/get-started/lotus/). Basic build instructions can be found further down in this readme.
## Reporting a Vulnerability
@@ -50,6 +52,88 @@ When implementing a change:
7. Title the PR in a meaningful way and describe the rationale and the thought process in the PR description.
8. Write clean, thoughtful, and detailed [commit messages](https://chris.beams.io/posts/git-commit/). This is even more important than the PR description, because commit messages are stored _inside_ the Git history. One good rule is: if you are happy posting the commit message as the PR description, then it's a good commit message.
## Basic Build Instructions
**System-specific Software Dependencies**:
Building Lotus requires some system dependencies, usually provided by your distribution.
Ubuntu/Debian:
```
sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y && sudo apt upgrade -y
```
Fedora:
```
sudo dnf -y install gcc make git bzr jq pkgconfig mesa-libOpenCL mesa-libOpenCL-devel opencl-headers ocl-icd ocl-icd-devel clang llvm wget hwloc libhwloc-dev
```
For other distributions you can find the required dependencies [here.](https://docs.filecoin.io/get-started/lotus/installation/#system-specific) For instructions specific to macOS, you can find them [here.](https://docs.filecoin.io/get-started/lotus/installation/#macos)
#### Go
To build Lotus, you need a working installation of [Go 1.16.4 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
```
**TIP:**
You'll need to add `/usr/local/go/bin` to your path. For most Linux distributions you can run something like:
```shell
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc && source ~/.bashrc
```
See the [official Golang installation instructions](https://golang.org/doc/install) if you get stuck.
### Build and install Lotus
Once all the dependencies are installed, you can build and install the Lotus suite (`lotus`, `lotus-miner`, and `lotus-worker`).
1. Clone the repository:
```sh
git clone https://github.com/filecoin-project/lotus.git
cd lotus/
```
Note: The default branch `master` is the dev branch where the latest new features, bug fixes and improvement are in. However, if you want to run lotus on Filecoin mainnet and want to run a production-ready lotus, get the latest release[ here](https://github.com/filecoin-project/lotus/releases).
2. To join mainnet, checkout the [latest release](https://github.com/filecoin-project/lotus/releases).
If you are changing networks from a previous Lotus installation or there has been a network reset, read the [Switch networks guide](https://docs.filecoin.io/get-started/lotus/switch-networks/) before proceeding.
For networks other than mainnet, look up the current branch or tag/commit for the network you want to join in the [Filecoin networks dashboard](https://network.filecoin.io), then build Lotus for your specific network below.
```sh
git checkout <tag_or_branch>
# For example:
git checkout <vX.X.X> # tag for a release
```
Currently, the latest code on the _master_ branch corresponds to mainnet.
3. If you are in China, see "[Lotus: tips when running in China](https://docs.filecoin.io/get-started/lotus/tips-running-in-china/)".
4. This build instruction uses the prebuilt proofs binaries. If you want to build the proof binaries from source check the [complete instructions](https://docs.filecoin.io/get-started/lotus/installation/#build-and-install-lotus). Note, if you are building the proof binaries from source, [installing rustup](https://docs.filecoin.io/get-started/lotus/installation/#rustup) is also needed.
5. Build and install Lotus:
```sh
make clean all #mainnet
# Or to join a testnet or devnet:
make clean calibnet # Calibration with min 32GiB sectors
make clean nerpanet # Nerpa with min 512MiB sectors
sudo make install
```
This will put `lotus`, `lotus-miner` and `lotus-worker` in `/usr/local/bin`.
`lotus` will use the `$HOME/.lotus` folder by default for storage (configuration, chain data, wallets, etc). See [advanced options](https://docs.filecoin.io/get-started/lotus/configuration-and-advanced-usage/) for information on how to customize the Lotus folder.
6. You should now have Lotus installed. You can now [start the Lotus daemon and sync the chain](https://docs.filecoin.io/get-started/lotus/installation/#start-the-lotus-daemon-and-sync-the-chain).
## License
Dual-licensed under [MIT](https://github.com/filecoin-project/lotus/blob/master/LICENSE-MIT) + [Apache 2.0](https://github.com/filecoin-project/lotus/blob/master/LICENSE-APACHE)
+7 -48
View File
@@ -4,15 +4,11 @@ import (
"context"
"fmt"
apitypes "github.com/filecoin-project/lotus/api/types"
"github.com/google/uuid"
"github.com/filecoin-project/go-jsonrpc/auth"
metrics "github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
protocol "github.com/libp2p/go-libp2p-core/protocol"
apitypes "github.com/filecoin-project/lotus/api/types"
)
// MODIFYING THE API INTERFACE
@@ -27,55 +23,23 @@ import (
// * Generate openrpc blobs
type Common interface {
// MethodGroup: Auth
AuthVerify(ctx context.Context, token string) ([]auth.Permission, error) //perm:read
AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error) //perm:admin
// MethodGroup: Net
// MethodGroup: Log
NetConnectedness(context.Context, peer.ID) (network.Connectedness, error) //perm:read
NetPeers(context.Context) ([]peer.AddrInfo, 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
NetFindPeer(context.Context, peer.ID) (peer.AddrInfo, error) //perm:read
NetPubsubScores(context.Context) ([]PubsubScore, error) //perm:read
NetAutoNatStatus(context.Context) (NatInfo, error) //perm:read
NetAgentVersion(ctx context.Context, p peer.ID) (string, error) //perm:read
NetPeerInfo(context.Context, peer.ID) (*ExtendedPeerInfo, error) //perm:read
// NetBandwidthStats returns statistics about the nodes total bandwidth
// usage and current rate across all peers and protocols.
NetBandwidthStats(ctx context.Context) (metrics.Stats, error) //perm:read
// NetBandwidthStatsByPeer returns statistics about the nodes bandwidth
// usage and current rate per peer
NetBandwidthStatsByPeer(ctx context.Context) (map[string]metrics.Stats, error) //perm:read
// NetBandwidthStatsByProtocol returns statistics about the nodes bandwidth
// usage and current rate per protocol
NetBandwidthStatsByProtocol(ctx context.Context) (map[protocol.ID]metrics.Stats, error) //perm:read
// ConnectionGater API
NetBlockAdd(ctx context.Context, acl NetBlockList) error //perm:admin
NetBlockRemove(ctx context.Context, acl NetBlockList) error //perm:admin
NetBlockList(ctx context.Context) (NetBlockList, error) //perm:read
LogList(context.Context) ([]string, error) //perm:write
LogSetLevel(context.Context, string, string) error //perm:write
// MethodGroup: Common
// Discover returns an OpenRPC document describing an RPC API.
Discover(ctx context.Context) (apitypes.OpenRPCDocument, error) //perm:read
// ID returns peerID of libp2p node backing this API
ID(context.Context) (peer.ID, error) //perm:read
// Version provides information about API provider
Version(context.Context) (APIVersion, error) //perm:read
LogList(context.Context) ([]string, error) //perm:write
LogSetLevel(context.Context, string, string) error //perm:write
// Discover returns an OpenRPC document describing an RPC API.
Discover(ctx context.Context) (apitypes.OpenRPCDocument, error) //perm:read
// trigger graceful shutdown
Shutdown(context.Context) error //perm:admin
@@ -105,8 +69,3 @@ type APIVersion struct {
func (v APIVersion) String() string {
return fmt.Sprintf("%s+api%s", v.Version, v.APIVersion.String())
}
type NatInfo struct {
Reachability network.Reachability
PublicAddr string
}
+57 -20
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"time"
"github.com/filecoin-project/lotus/node/repo/importmgr"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
@@ -14,7 +15,6 @@ import (
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-multistore"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/crypto"
@@ -58,6 +58,7 @@ const LookbackNoLimit = abi.ChainEpoch(-1)
// FullNode API is a low-level interface to the Filecoin network full node
type FullNode interface {
Common
Net
// MethodGroup: Chain
// The Chain method group contains methods for interacting with the
@@ -104,6 +105,9 @@ type FullNode interface {
// specified block.
ChainGetParentMessages(ctx context.Context, blockCid cid.Cid) ([]Message, error) //perm:read
// ChainGetMessagesInTipset returns message stores in current tipset
ChainGetMessagesInTipset(ctx context.Context, tsk types.TipSetKey) ([]Message, error) //perm:read
// ChainGetTipSetByHeight looks back for a tipset at the specified epoch.
// If there are no blocks at the specified epoch, a tipset at an earlier epoch
// will be returned.
@@ -160,6 +164,13 @@ type FullNode interface {
// If oldmsgskip is set, messages from before the requested roots are also not included.
ChainExport(ctx context.Context, nroots abi.ChainEpoch, oldmsgskip bool, tsk types.TipSetKey) (<-chan []byte, error) //perm:read
// ChainCheckBlockstore performs an (asynchronous) health check on the chain/state blockstore
// if supported by the underlying implementation.
ChainCheckBlockstore(context.Context) error //perm:admin
// ChainBlockstoreInfo returns some basic information about the blockstore
ChainBlockstoreInfo(context.Context) (map[string]interface{}, error) //perm:read
// MethodGroup: Beacon
// The Beacon method group contains methods for interacting with the random beacon (DRAND)
@@ -252,6 +263,13 @@ type FullNode interface {
// MpoolBatchPushMessage batch pushes a unsigned message to mempool.
MpoolBatchPushMessage(context.Context, []*types.Message, *MessageSendSpec) ([]*types.SignedMessage, error) //perm:sign
// MpoolCheckMessages performs logical checks on a batch of messages
MpoolCheckMessages(context.Context, []*MessagePrototype) ([][]MessageCheckStatus, error) //perm:read
// MpoolCheckPendingMessages performs logical checks for all pending messages from a given address
MpoolCheckPendingMessages(context.Context, address.Address) ([][]MessageCheckStatus, error) //perm:read
// MpoolCheckReplaceMessages performs logical checks on pending messages with replacement
MpoolCheckReplaceMessages(context.Context, []*types.Message) ([][]MessageCheckStatus, error) //perm:read
// MpoolGetNonce gets next nonce for the specified sender.
// Note that this method may not be atomic. Use MpoolPushMessage instead.
MpoolGetNonce(context.Context, address.Address) (uint64, error) //perm:read
@@ -313,9 +331,11 @@ type FullNode interface {
// ClientImport imports file under the specified path into filestore.
ClientImport(ctx context.Context, ref FileRef) (*ImportRes, error) //perm:admin
// ClientRemoveImport removes file import
ClientRemoveImport(ctx context.Context, importID multistore.StoreID) error //perm:admin
ClientRemoveImport(ctx context.Context, importID importmgr.ImportID) error //perm:admin
// ClientStartDeal proposes a deal with a miner.
ClientStartDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error) //perm:admin
// ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking.
ClientStatelessDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error) //perm:write
// ClientGetDealInfo returns the latest information about a given deal.
ClientGetDealInfo(context.Context, cid.Cid) (*DealInfo, error) //perm:read
// ClientListDeals returns information about the deals made by the local client.
@@ -335,6 +355,10 @@ type FullNode interface {
// ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
// of status updates.
ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
// ClientListRetrievals returns information about retrievals made by the local client
ClientListRetrievals(ctx context.Context) ([]RetrievalInfo, error) //perm:write
// ClientGetRetrievalUpdates returns status of updated retrieval deals
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
// ClientCalcCommP calculates the CommP and data size of the specified CID
@@ -579,15 +603,16 @@ type FullNode interface {
// MsigCreate creates a multisig wallet
// It takes the following params: <required number of senders>, <approving addresses>, <unlock duration>
//<initial balance>, <sender address of the create msg>, <gas price>
MsigCreate(context.Context, uint64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) //perm:sign
MsigCreate(context.Context, uint64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (*MessagePrototype, error) //perm:sign
// MsigPropose proposes a multisig message
// It takes the following params: <multisig address>, <recipient address>, <value to transfer>,
// <sender address of the propose msg>, <method to call in the proposed message>, <params to include in the proposed message>
MsigPropose(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
MsigPropose(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
// MsigApprove approves a previously-proposed multisig message by transaction ID
// It takes the following params: <multisig address>, <proposed transaction ID> <signer address>
MsigApprove(context.Context, address.Address, uint64, address.Address) (cid.Cid, error) //perm:sign
MsigApprove(context.Context, address.Address, uint64, address.Address) (*MessagePrototype, error) //perm:sign
// MsigApproveTxnHash approves a previously-proposed multisig message, specified
// using both transaction ID and a hash of the parameters used in the
@@ -595,43 +620,49 @@ type FullNode interface {
// exactly the transaction you think you are.
// It takes the following params: <multisig address>, <proposed message ID>, <proposer address>, <recipient address>, <value to transfer>,
// <sender address of the approve msg>, <method to call in the proposed message>, <params to include in the proposed message>
MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
// MsigCancel cancels a previously-proposed multisig message
// It takes the following params: <multisig address>, <proposed transaction ID>, <recipient address>, <value to transfer>,
// <sender address of the cancel msg>, <method to call in the proposed message>, <params to include in the proposed message>
MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
// MsigAddPropose proposes adding a signer in the multisig
// It takes the following params: <multisig address>, <sender address of the propose msg>,
// <new signer>, <whether the number of required signers should be increased>
MsigAddPropose(context.Context, address.Address, address.Address, address.Address, bool) (cid.Cid, error) //perm:sign
MsigAddPropose(context.Context, address.Address, address.Address, address.Address, bool) (*MessagePrototype, error) //perm:sign
// MsigAddApprove approves a previously proposed AddSigner message
// It takes the following params: <multisig address>, <sender address of the approve msg>, <proposed message ID>,
// <proposer address>, <new signer>, <whether the number of required signers should be increased>
MsigAddApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, bool) (cid.Cid, error) //perm:sign
MsigAddApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, bool) (*MessagePrototype, error) //perm:sign
// MsigAddCancel cancels a previously proposed AddSigner message
// It takes the following params: <multisig address>, <sender address of the cancel msg>, <proposed message ID>,
// <new signer>, <whether the number of required signers should be increased>
MsigAddCancel(context.Context, address.Address, address.Address, uint64, address.Address, bool) (cid.Cid, error) //perm:sign
MsigAddCancel(context.Context, address.Address, address.Address, uint64, address.Address, bool) (*MessagePrototype, error) //perm:sign
// MsigSwapPropose proposes swapping 2 signers in the multisig
// It takes the following params: <multisig address>, <sender address of the propose msg>,
// <old signer>, <new signer>
MsigSwapPropose(context.Context, address.Address, address.Address, address.Address, address.Address) (cid.Cid, error) //perm:sign
MsigSwapPropose(context.Context, address.Address, address.Address, address.Address, address.Address) (*MessagePrototype, error) //perm:sign
// MsigSwapApprove approves a previously proposed SwapSigner
// It takes the following params: <multisig address>, <sender address of the approve msg>, <proposed message ID>,
// <proposer address>, <old signer>, <new signer>
MsigSwapApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, address.Address) (cid.Cid, error) //perm:sign
MsigSwapApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, address.Address) (*MessagePrototype, error) //perm:sign
// MsigSwapCancel cancels a previously proposed SwapSigner message
// It takes the following params: <multisig address>, <sender address of the cancel msg>, <proposed message ID>,
// <old signer>, <new signer>
MsigSwapCancel(context.Context, address.Address, address.Address, uint64, address.Address, address.Address) (cid.Cid, error) //perm:sign
MsigSwapCancel(context.Context, address.Address, address.Address, uint64, address.Address, address.Address) (*MessagePrototype, error) //perm:sign
// MsigRemoveSigner proposes the removal of a signer from the multisig.
// It accepts the multisig to make the change on, the proposer address to
// send the message from, the address to be removed, and a boolean
// indicating whether or not the signing threshold should be lowered by one
// along with the address removal.
MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) //perm:sign
MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (*MessagePrototype, error) //perm:sign
// MarketAddBalance adds funds to the market actor
MarketAddBalance(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign
@@ -664,6 +695,11 @@ type FullNode interface {
PaychVoucherList(context.Context, address.Address) ([]*paych.SignedVoucher, error) //perm:write
PaychVoucherSubmit(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (cid.Cid, error) //perm:sign
// MethodGroup: Node
// These methods are general node management and status commands
NodeStatus(ctx context.Context, inclChainStatus bool) (NodeStatus, error) //perm:read
// CreateBackup creates node backup onder the specified file name. The
// method requires that the lotus daemon is running with the
// LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that
@@ -687,16 +723,17 @@ type MinerSectors struct {
type ImportRes struct {
Root cid.Cid
ImportID multistore.StoreID
ImportID importmgr.ImportID
}
type Import struct {
Key multistore.StoreID
Key importmgr.ImportID
Err string
Root *cid.Cid
Source string
FilePath string
Root *cid.Cid
Source string
FilePath string
CARv2FilePath string
}
type DealInfo struct {
@@ -879,7 +916,7 @@ type RetrievalOrder struct {
Piece *cid.Cid
Size uint64
LocalStore *multistore.StoreID // if specified, get data from local store
LocalCARV2FilePath string // if specified, get data from a local CARv2 file.
// TODO: support offset
Total types.BigInt
UnsealPrice types.BigInt
+2
View File
@@ -45,6 +45,7 @@ type Gateway interface {
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)
StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*ActorState, error) //perm:read
StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (MarketBalance, error)
@@ -58,4 +59,5 @@ type Gateway interface {
StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error)
StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error)
WalletBalance(context.Context, address.Address) (types.BigInt, error)
Version(context.Context) (APIVersion, error)
}
+66
View File
@@ -0,0 +1,66 @@
package api
import (
"context"
metrics "github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
)
// MODIFYING THE API INTERFACE
//
// When adding / changing methods in this file:
// * Do the change here
// * Adjust implementation in `node/impl/`
// * Run `make gen` - this will:
// * Generate proxy structs
// * Generate mocks
// * Generate markdown docs
// * Generate openrpc blobs
type Net interface {
// MethodGroup: Net
NetConnectedness(context.Context, peer.ID) (network.Connectedness, error) //perm:read
NetPeers(context.Context) ([]peer.AddrInfo, 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
NetFindPeer(context.Context, peer.ID) (peer.AddrInfo, error) //perm:read
NetPubsubScores(context.Context) ([]PubsubScore, error) //perm:read
NetAutoNatStatus(context.Context) (NatInfo, error) //perm:read
NetAgentVersion(ctx context.Context, p peer.ID) (string, error) //perm:read
NetPeerInfo(context.Context, peer.ID) (*ExtendedPeerInfo, error) //perm:read
// NetBandwidthStats returns statistics about the nodes total bandwidth
// usage and current rate across all peers and protocols.
NetBandwidthStats(ctx context.Context) (metrics.Stats, error) //perm:read
// NetBandwidthStatsByPeer returns statistics about the nodes bandwidth
// usage and current rate per peer
NetBandwidthStatsByPeer(ctx context.Context) (map[string]metrics.Stats, error) //perm:read
// NetBandwidthStatsByProtocol returns statistics about the nodes bandwidth
// usage and current rate per protocol
NetBandwidthStatsByProtocol(ctx context.Context) (map[protocol.ID]metrics.Stats, error) //perm:read
// ConnectionGater API
NetBlockAdd(ctx context.Context, acl NetBlockList) error //perm:admin
NetBlockRemove(ctx context.Context, acl NetBlockList) error //perm:admin
NetBlockList(ctx context.Context) (NetBlockList, error) //perm:read
// ID returns peerID of libp2p node backing this API
ID(context.Context) (peer.ID, error) //perm:read
}
type CommonNet interface {
Common
Net
}
type NatInfo struct {
Reachability network.Reachability
PublicAddr string
}
+36 -4
View File
@@ -41,6 +41,7 @@ import (
// StorageMiner is a low-level interface to the Filecoin network storage miner node
type StorageMiner interface {
Common
Net
ActorAddress(context.Context) (address.Address, error) //perm:read
@@ -55,6 +56,13 @@ type StorageMiner interface {
// Get the status of a given sector by ID
SectorsStatus(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (SectorInfo, error) //perm:read
// Add piece to an open sector. If no sectors with enough space are open,
// either a new sector will be created, or this call will block until more
// sectors can be created.
SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, r storage.Data, d PieceDealInfo) (SectorOffset, error) //perm:admin
SectorsUnsealPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd *cid.Cid) error //perm:admin
// List all staged sectors
SectorsList(context.Context) ([]abi.SectorNumber, error) //perm:read
@@ -135,8 +143,8 @@ type StorageMiner interface {
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
StorageList(ctx context.Context) (map[stores.ID][]stores.Decl, 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
@@ -279,15 +287,17 @@ type AddrUse int
const (
PreCommitAddr AddrUse = iota
CommitAddr
DealPublishAddr
PoStAddr
TerminateSectorsAddr
)
type AddressConfig struct {
PreCommitControl []address.Address
CommitControl []address.Address
TerminateControl []address.Address
PreCommitControl []address.Address
CommitControl []address.Address
TerminateControl []address.Address
DealPublishControl []address.Address
DisableOwnerFallback bool
DisableWorkerFallback bool
@@ -300,3 +310,25 @@ type PendingDealInfo struct {
PublishPeriodStart time.Time
PublishPeriod time.Duration
}
type SectorOffset struct {
Sector abi.SectorNumber
Offset abi.PaddedPieceSize
}
// DealInfo is a tuple of deal identity and its schedule
type PieceDealInfo struct {
PublishCid *cid.Cid
DealID abi.DealID
DealProposal *market.DealProposal
DealSchedule DealSchedule
KeepUnsealed bool
}
// DealSchedule communicates the time interval of a storage deal. The deal must
// appear in a sealed (proven) sector no later than StartEpoch, otherwise it
// is invalid.
type DealSchedule struct {
StartEpoch abi.ChainEpoch
EndEpoch abi.ChainEpoch
}
+7 -7
View File
@@ -35,13 +35,13 @@ type MsgMeta struct {
}
type Wallet interface {
WalletNew(context.Context, types.KeyType) (address.Address, error)
WalletHas(context.Context, address.Address) (bool, error)
WalletList(context.Context) ([]address.Address, error)
WalletNew(context.Context, types.KeyType) (address.Address, error) //perm:admin
WalletHas(context.Context, address.Address) (bool, error) //perm:admin
WalletList(context.Context) ([]address.Address, error) //perm:admin
WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta MsgMeta) (*crypto.Signature, error)
WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta MsgMeta) (*crypto.Signature, error) //perm:admin
WalletExport(context.Context, address.Address) (*types.KeyInfo, error)
WalletImport(context.Context, *types.KeyInfo) (address.Address, error)
WalletDelete(context.Context, address.Address) error
WalletExport(context.Context, address.Address) (*types.KeyInfo, error) //perm:admin
WalletImport(context.Context, *types.KeyInfo) (address.Address, error) //perm:admin
WalletDelete(context.Context, address.Address) error //perm:admin
}
-2
View File
@@ -2,7 +2,6 @@ package api
import (
"context"
"io"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
@@ -43,7 +42,6 @@ type Worker interface {
ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (storiface.CallID, error) //perm:admin
MoveStorage(ctx context.Context, sector storage.SectorRef, types storiface.SectorFileType) (storiface.CallID, error) //perm:admin
UnsealPiece(context.Context, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (storiface.CallID, error) //perm:admin
ReadPiece(context.Context, io.Writer, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize) (storiface.CallID, error) //perm:admin
Fetch(context.Context, storage.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) //perm:admin
TaskDisable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
+381
View File
@@ -5,9 +5,11 @@ package api
import (
"fmt"
"io"
"math"
"sort"
abi "github.com/filecoin-project/go-state-types/abi"
market "github.com/filecoin-project/specs-actors/actors/builtin/market"
paych "github.com/filecoin-project/specs-actors/actors/builtin/paych"
cid "github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
@@ -16,6 +18,7 @@ import (
var _ = xerrors.Errorf
var _ = cid.Undef
var _ = math.E
var _ = sort.Sort
func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
@@ -738,3 +741,381 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) error {
return nil
}
func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{165}); err != nil {
return err
}
scratch := make([]byte, 9)
// t.PublishCid (cid.Cid) (struct)
if len("PublishCid") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"PublishCid\" was too long")
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("PublishCid"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("PublishCid")); err != nil {
return err
}
if t.PublishCid == nil {
if _, err := w.Write(cbg.CborNull); err != nil {
return err
}
} else {
if err := cbg.WriteCidBuf(scratch, w, *t.PublishCid); err != nil {
return xerrors.Errorf("failed to write cid field t.PublishCid: %w", err)
}
}
// t.DealID (abi.DealID) (uint64)
if len("DealID") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"DealID\" was too long")
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("DealID"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("DealID")); err != nil {
return err
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.DealID)); err != nil {
return err
}
// t.DealProposal (market.DealProposal) (struct)
if len("DealProposal") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"DealProposal\" was too long")
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("DealProposal"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("DealProposal")); err != nil {
return err
}
if err := t.DealProposal.MarshalCBOR(w); err != nil {
return err
}
// t.DealSchedule (api.DealSchedule) (struct)
if len("DealSchedule") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"DealSchedule\" was too long")
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("DealSchedule"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("DealSchedule")); err != nil {
return err
}
if err := t.DealSchedule.MarshalCBOR(w); err != nil {
return err
}
// t.KeepUnsealed (bool) (bool)
if len("KeepUnsealed") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"KeepUnsealed\" was too long")
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("KeepUnsealed"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("KeepUnsealed")); err != nil {
return err
}
if err := cbg.WriteBool(w, t.KeepUnsealed); err != nil {
return err
}
return nil
}
func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) error {
*t = PieceDealInfo{}
br := cbg.GetPeeker(r)
scratch := make([]byte, 8)
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
if err != nil {
return err
}
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra > cbg.MaxLength {
return fmt.Errorf("PieceDealInfo: map struct too large (%d)", extra)
}
var name string
n := extra
for i := uint64(0); i < n; i++ {
{
sval, err := cbg.ReadStringBuf(br, scratch)
if err != nil {
return err
}
name = string(sval)
}
switch name {
// t.PublishCid (cid.Cid) (struct)
case "PublishCid":
{
b, err := br.ReadByte()
if err != nil {
return err
}
if b != cbg.CborNull[0] {
if err := br.UnreadByte(); err != nil {
return err
}
c, err := cbg.ReadCid(br)
if err != nil {
return xerrors.Errorf("failed to read cid field t.PublishCid: %w", err)
}
t.PublishCid = &c
}
}
// t.DealID (abi.DealID) (uint64)
case "DealID":
{
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.DealID = abi.DealID(extra)
}
// t.DealProposal (market.DealProposal) (struct)
case "DealProposal":
{
b, err := br.ReadByte()
if err != nil {
return err
}
if b != cbg.CborNull[0] {
if err := br.UnreadByte(); err != nil {
return err
}
t.DealProposal = new(market.DealProposal)
if err := t.DealProposal.UnmarshalCBOR(br); err != nil {
return xerrors.Errorf("unmarshaling t.DealProposal pointer: %w", err)
}
}
}
// t.DealSchedule (api.DealSchedule) (struct)
case "DealSchedule":
{
if err := t.DealSchedule.UnmarshalCBOR(br); err != nil {
return xerrors.Errorf("unmarshaling t.DealSchedule: %w", err)
}
}
// t.KeepUnsealed (bool) (bool)
case "KeepUnsealed":
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
if err != nil {
return err
}
if maj != cbg.MajOther {
return fmt.Errorf("booleans must be major type 7")
}
switch extra {
case 20:
t.KeepUnsealed = false
case 21:
t.KeepUnsealed = true
default:
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
}
default:
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
return nil
}
func (t *DealSchedule) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
if _, err := w.Write([]byte{162}); err != nil {
return err
}
scratch := make([]byte, 9)
// t.StartEpoch (abi.ChainEpoch) (int64)
if len("StartEpoch") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"StartEpoch\" was too long")
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("StartEpoch"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("StartEpoch")); err != nil {
return err
}
if t.StartEpoch >= 0 {
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.StartEpoch)); err != nil {
return err
}
} else {
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajNegativeInt, uint64(-t.StartEpoch-1)); err != nil {
return err
}
}
// t.EndEpoch (abi.ChainEpoch) (int64)
if len("EndEpoch") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"EndEpoch\" was too long")
}
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("EndEpoch"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("EndEpoch")); err != nil {
return err
}
if t.EndEpoch >= 0 {
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.EndEpoch)); err != nil {
return err
}
} else {
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajNegativeInt, uint64(-t.EndEpoch-1)); err != nil {
return err
}
}
return nil
}
func (t *DealSchedule) UnmarshalCBOR(r io.Reader) error {
*t = DealSchedule{}
br := cbg.GetPeeker(r)
scratch := make([]byte, 8)
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
if err != nil {
return err
}
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra > cbg.MaxLength {
return fmt.Errorf("DealSchedule: map struct too large (%d)", extra)
}
var name string
n := extra
for i := uint64(0); i < n; i++ {
{
sval, err := cbg.ReadStringBuf(br, scratch)
if err != nil {
return err
}
name = string(sval)
}
switch name {
// t.StartEpoch (abi.ChainEpoch) (int64)
case "StartEpoch":
{
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
var extraI int64
if err != nil {
return err
}
switch maj {
case cbg.MajUnsignedInt:
extraI = int64(extra)
if extraI < 0 {
return fmt.Errorf("int64 positive overflow")
}
case cbg.MajNegativeInt:
extraI = int64(extra)
if extraI < 0 {
return fmt.Errorf("int64 negative oveflow")
}
extraI = -1 - extraI
default:
return fmt.Errorf("wrong type for int64 field: %d", maj)
}
t.StartEpoch = abi.ChainEpoch(extraI)
}
// t.EndEpoch (abi.ChainEpoch) (int64)
case "EndEpoch":
{
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
var extraI int64
if err != nil {
return err
}
switch maj {
case cbg.MajUnsignedInt:
extraI = int64(extra)
if extraI < 0 {
return fmt.Errorf("int64 positive overflow")
}
case cbg.MajNegativeInt:
extraI = int64(extra)
if extraI < 0 {
return fmt.Errorf("int64 negative oveflow")
}
extraI = -1 - extraI
default:
return fmt.Errorf("wrong type for int64 field: %d", maj)
}
t.EndEpoch = abi.ChainEpoch(extraI)
}
default:
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
return nil
}
+35
View File
@@ -0,0 +1,35 @@
// Code generated by "stringer -type=CheckStatusCode -trimprefix=CheckStatus"; DO NOT EDIT.
package api
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[CheckStatusMessageSerialize-1]
_ = x[CheckStatusMessageSize-2]
_ = x[CheckStatusMessageValidity-3]
_ = x[CheckStatusMessageMinGas-4]
_ = x[CheckStatusMessageMinBaseFee-5]
_ = x[CheckStatusMessageBaseFee-6]
_ = x[CheckStatusMessageBaseFeeLowerBound-7]
_ = x[CheckStatusMessageBaseFeeUpperBound-8]
_ = x[CheckStatusMessageGetStateNonce-9]
_ = x[CheckStatusMessageNonce-10]
_ = x[CheckStatusMessageGetStateBalance-11]
_ = x[CheckStatusMessageBalance-12]
}
const _CheckStatusCode_name = "MessageSerializeMessageSizeMessageValidityMessageMinGasMessageMinBaseFeeMessageBaseFeeMessageBaseFeeLowerBoundMessageBaseFeeUpperBoundMessageGetStateNonceMessageNonceMessageGetStateBalanceMessageBalance"
var _CheckStatusCode_index = [...]uint8{0, 16, 27, 42, 55, 72, 86, 110, 134, 154, 166, 188, 202}
func (i CheckStatusCode) String() string {
i -= 1
if i < 0 || i >= CheckStatusCode(len(_CheckStatusCode_index)-1) {
return "CheckStatusCode(" + strconv.FormatInt(int64(i+1), 10) + ")"
}
return _CheckStatusCode_name[_CheckStatusCode_index[i]:_CheckStatusCode_index[i+1]]
}
+39 -46
View File
@@ -16,14 +16,10 @@ import (
)
// NewCommonRPCV0 creates a new http jsonrpc client.
func NewCommonRPCV0(ctx context.Context, addr string, requestHeader http.Header) (api.Common, jsonrpc.ClientCloser, error) {
var res v0api.CommonStruct
func NewCommonRPCV0(ctx context.Context, addr string, requestHeader http.Header) (api.CommonNet, jsonrpc.ClientCloser, error) {
var res v0api.CommonNetStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
},
requestHeader,
)
api.GetInternalStructs(&res), requestHeader)
return &res, closer, err
}
@@ -31,11 +27,9 @@ func NewCommonRPCV0(ctx context.Context, addr string, requestHeader http.Header)
// NewFullNodeRPCV0 creates a new http jsonrpc client.
func NewFullNodeRPCV0(ctx context.Context, addr string, requestHeader http.Header) (v0api.FullNode, jsonrpc.ClientCloser, error) {
var res v0api.FullNodeStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.CommonStruct.Internal,
&res.Internal,
}, requestHeader)
api.GetInternalStructs(&res), requestHeader)
return &res, closer, err
}
@@ -44,51 +38,56 @@ func NewFullNodeRPCV0(ctx context.Context, addr string, requestHeader http.Heade
func NewFullNodeRPCV1(ctx context.Context, addr string, requestHeader http.Header) (api.FullNode, jsonrpc.ClientCloser, error) {
var res v1api.FullNodeStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.CommonStruct.Internal,
&res.Internal,
}, requestHeader)
api.GetInternalStructs(&res), requestHeader)
return &res, closer, err
}
func getPushUrl(addr string) (string, error) {
pushUrl, err := url.Parse(addr)
if err != nil {
return "", err
}
switch pushUrl.Scheme {
case "ws":
pushUrl.Scheme = "http"
case "wss":
pushUrl.Scheme = "https"
}
///rpc/v0 -> /rpc/streams/v0/push
pushUrl.Path = path.Join(pushUrl.Path, "../streams/v0/push")
return pushUrl.String(), nil
}
// NewStorageMinerRPCV0 creates a new http jsonrpc client for miner
func NewStorageMinerRPCV0(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (v0api.StorageMiner, jsonrpc.ClientCloser, error) {
pushUrl, err := getPushUrl(addr)
if err != nil {
return nil, nil, err
}
var res v0api.StorageMinerStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.CommonStruct.Internal,
&res.Internal,
},
requestHeader,
opts...,
)
api.GetInternalStructs(&res), requestHeader,
append([]jsonrpc.Option{
rpcenc.ReaderParamEncoder(pushUrl),
}, opts...)...)
return &res, closer, err
}
func NewWorkerRPCV0(ctx context.Context, addr string, requestHeader http.Header) (api.Worker, jsonrpc.ClientCloser, error) {
u, err := url.Parse(addr)
func NewWorkerRPCV0(ctx context.Context, addr string, requestHeader http.Header) (v0api.Worker, jsonrpc.ClientCloser, error) {
pushUrl, err := getPushUrl(addr)
if err != nil {
return nil, nil, err
}
switch u.Scheme {
case "ws":
u.Scheme = "http"
case "wss":
u.Scheme = "https"
}
///rpc/v0 -> /rpc/streams/v0/push
u.Path = path.Join(u.Path, "../streams/v0/push")
var res api.WorkerStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
},
api.GetInternalStructs(&res),
requestHeader,
rpcenc.ReaderParamEncoder(u.String()),
rpcenc.ReaderParamEncoder(pushUrl),
jsonrpc.WithNoReconnect(),
jsonrpc.WithTimeout(30*time.Second),
)
@@ -100,9 +99,7 @@ func NewWorkerRPCV0(ctx context.Context, addr string, requestHeader http.Header)
func NewGatewayRPCV1(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.Gateway, jsonrpc.ClientCloser, error) {
var res api.GatewayStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
},
api.GetInternalStructs(&res),
requestHeader,
opts...,
)
@@ -114,9 +111,7 @@ func NewGatewayRPCV1(ctx context.Context, addr string, requestHeader http.Header
func NewGatewayRPCV0(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (v0api.Gateway, jsonrpc.ClientCloser, error) {
var res v0api.GatewayStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
},
api.GetInternalStructs(&res),
requestHeader,
opts...,
)
@@ -127,9 +122,7 @@ func NewGatewayRPCV0(ctx context.Context, addr string, requestHeader http.Header
func NewWalletRPCV0(ctx context.Context, addr string, requestHeader http.Header) (api.Wallet, jsonrpc.ClientCloser, error) {
var res api.WalletStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
},
api.GetInternalStructs(&res),
requestHeader,
)
+1 -1
View File
@@ -34,7 +34,7 @@ func main() {
doc := docgen_openrpc.NewLotusOpenRPCDocument(Comments, GroupDocs)
i, _, _, _ := docgen.GetAPIType(os.Args[2], os.Args[3])
i, _, _ := docgen.GetAPIType(os.Args[2], os.Args[3])
doc.RegisterReceiverName("Filecoin", i)
out, err := doc.Discover()
+11 -6
View File
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"os"
"reflect"
"sort"
"strings"
@@ -15,7 +16,7 @@ func main() {
groups := make(map[string]*docgen.MethodGroup)
_, t, permStruct, commonPermStruct := docgen.GetAPIType(os.Args[2], os.Args[3])
_, t, permStruct := docgen.GetAPIType(os.Args[2], os.Args[3])
for i := 0; i < t.NumMethod(); i++ {
m := t.Method(i)
@@ -88,13 +89,17 @@ func main() {
fmt.Printf("### %s\n", m.Name)
fmt.Printf("%s\n\n", m.Comment)
meth, ok := permStruct.FieldByName(m.Name)
if !ok {
meth, ok = commonPermStruct.FieldByName(m.Name)
if !ok {
panic("no perms for method: " + m.Name)
var meth reflect.StructField
var ok bool
for _, ps := range permStruct {
meth, ok = ps.FieldByName(m.Name)
if ok {
break
}
}
if !ok {
panic("no perms for method: " + m.Name)
}
perms := meth.Tag.Get("perm")
+21 -11
View File
@@ -13,6 +13,8 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
"github.com/filecoin-project/go-multistore"
"github.com/filecoin-project/lotus/node/repo/importmgr"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-filestore"
@@ -27,7 +29,6 @@ import (
filestore2 "github.com/filecoin-project/go-fil-markets/filestore"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-multistore"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/crypto"
@@ -89,6 +90,7 @@ func init() {
addExample(&pid)
multistoreIDExample := multistore.StoreID(50)
storeIDExample := importmgr.ImportID(50)
addExample(bitfield.NewFromSet([]uint64{5}))
addExample(abi.RegisteredSealProof_StackedDrg32GiBV1_1)
@@ -119,6 +121,8 @@ func init() {
addExample(time.Minute)
addExample(datatransfer.TransferID(3))
addExample(datatransfer.Ongoing)
addExample(storeIDExample)
addExample(&storeIDExample)
addExample(multistoreIDExample)
addExample(&multistoreIDExample)
addExample(retrievalmarket.ClientEventDealAccepted)
@@ -175,7 +179,7 @@ func init() {
// miner specific
addExample(filestore2.Path(".lotusminer/fstmp123"))
si := multistore.StoreID(12)
si := uint64(12)
addExample(&si)
addExample(retrievalmarket.DealID(5))
addExample(abi.ActorID(1000))
@@ -261,27 +265,32 @@ func init() {
},
"methods": []interface{}{}},
)
addExample(api.CheckStatusCode(0))
addExample(map[string]interface{}{"abc": 123})
}
func GetAPIType(name, pkg string) (i interface{}, t, permStruct, commonPermStruct reflect.Type) {
func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
switch pkg {
case "api": // latest
switch name {
case "FullNode":
i = &api.FullNodeStruct{}
t = reflect.TypeOf(new(struct{ api.FullNode })).Elem()
permStruct = reflect.TypeOf(api.FullNodeStruct{}.Internal)
commonPermStruct = reflect.TypeOf(api.CommonStruct{}.Internal)
permStruct = append(permStruct, reflect.TypeOf(api.FullNodeStruct{}.Internal))
permStruct = append(permStruct, reflect.TypeOf(api.CommonStruct{}.Internal))
permStruct = append(permStruct, reflect.TypeOf(api.NetStruct{}.Internal))
case "StorageMiner":
i = &api.StorageMinerStruct{}
t = reflect.TypeOf(new(struct{ api.StorageMiner })).Elem()
permStruct = reflect.TypeOf(api.StorageMinerStruct{}.Internal)
commonPermStruct = reflect.TypeOf(api.CommonStruct{}.Internal)
permStruct = append(permStruct, reflect.TypeOf(api.StorageMinerStruct{}.Internal))
permStruct = append(permStruct, reflect.TypeOf(api.CommonStruct{}.Internal))
permStruct = append(permStruct, reflect.TypeOf(api.NetStruct{}.Internal))
case "Worker":
i = &api.WorkerStruct{}
t = reflect.TypeOf(new(struct{ api.Worker })).Elem()
permStruct = reflect.TypeOf(api.WorkerStruct{}.Internal)
commonPermStruct = reflect.TypeOf(api.WorkerStruct{}.Internal)
permStruct = append(permStruct, reflect.TypeOf(api.WorkerStruct{}.Internal))
default:
panic("unknown type")
}
@@ -290,8 +299,9 @@ func GetAPIType(name, pkg string) (i interface{}, t, permStruct, commonPermStruc
case "FullNode":
i = v0api.FullNodeStruct{}
t = reflect.TypeOf(new(struct{ v0api.FullNode })).Elem()
permStruct = reflect.TypeOf(v0api.FullNodeStruct{}.Internal)
commonPermStruct = reflect.TypeOf(v0api.CommonStruct{}.Internal)
permStruct = append(permStruct, reflect.TypeOf(v0api.FullNodeStruct{}.Internal))
permStruct = append(permStruct, reflect.TypeOf(v0api.CommonStruct{}.Internal))
permStruct = append(permStruct, reflect.TypeOf(v0api.NetStruct{}.Internal))
default:
panic("unknown type")
}
+571 -422
View File
File diff suppressed because it is too large Load Diff
+11 -6
View File
@@ -16,28 +16,33 @@ const (
var AllPermissions = []auth.Permission{PermRead, PermWrite, PermSign, PermAdmin}
var DefaultPerms = []auth.Permission{PermRead}
func permissionedProxies(in, out interface{}) {
outs := GetInternalStructs(out)
for _, o := range outs {
auth.PermissionedProxy(AllPermissions, DefaultPerms, in, o)
}
}
func PermissionedStorMinerAPI(a StorageMiner) StorageMiner {
var out StorageMinerStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.CommonStruct.Internal)
permissionedProxies(a, &out)
return &out
}
func PermissionedFullAPI(a FullNode) FullNode {
var out FullNodeStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.CommonStruct.Internal)
permissionedProxies(a, &out)
return &out
}
func PermissionedWorkerAPI(a Worker) Worker {
var out WorkerStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
permissionedProxies(a, &out)
return &out
}
func PermissionedWalletAPI(a Wallet) Wallet {
var out WalletStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
permissionedProxies(a, &out)
return &out
}
+1817 -562
View File
File diff suppressed because it is too large Load Diff
+30
View File
@@ -0,0 +1,30 @@
package api
import "reflect"
var _internalField = "Internal"
// GetInternalStructs extracts all pointers to 'Internal' sub-structs from the provided pointer to a proxy struct
func GetInternalStructs(in interface{}) []interface{} {
return getInternalStructs(reflect.ValueOf(in).Elem())
}
func getInternalStructs(rv reflect.Value) []interface{} {
var out []interface{}
internal := rv.FieldByName(_internalField)
ii := internal.Addr().Interface()
out = append(out, ii)
for i := 0; i < rv.NumField(); i++ {
if rv.Type().Field(i).Name == _internalField {
continue
}
sub := getInternalStructs(rv.Field(i))
out = append(out, sub...)
}
return out
}
+62
View File
@@ -0,0 +1,62 @@
package api
import (
"testing"
"github.com/stretchr/testify/require"
)
type StrA struct {
StrB
Internal struct {
A int
}
}
type StrB struct {
Internal struct {
B int
}
}
type StrC struct {
Internal struct {
Internal struct {
C int
}
}
}
func TestGetInternalStructs(t *testing.T) {
var proxy StrA
sts := GetInternalStructs(&proxy)
require.Len(t, sts, 2)
sa := sts[0].(*struct{ A int })
sa.A = 3
sb := sts[1].(*struct{ B int })
sb.B = 4
require.Equal(t, 3, proxy.Internal.A)
require.Equal(t, 4, proxy.StrB.Internal.B)
}
func TestNestedInternalStructs(t *testing.T) {
var proxy StrC
// check that only the top-level internal struct gets picked up
sts := GetInternalStructs(&proxy)
require.Len(t, sts, 1)
sa := sts[0].(*struct {
Internal struct {
C int
}
})
sa.Internal.C = 5
require.Equal(t, 5, proxy.Internal.Internal.C)
}
-61
View File
@@ -1,61 +0,0 @@
package test
import (
"context"
"fmt"
"sync/atomic"
"testing"
"time"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/miner"
)
type BlockMiner struct {
ctx context.Context
t *testing.T
miner TestStorageNode
blocktime time.Duration
mine int64
nulls int64
done chan struct{}
}
func NewBlockMiner(ctx context.Context, t *testing.T, miner TestStorageNode, blocktime time.Duration) *BlockMiner {
return &BlockMiner{
ctx: ctx,
t: t,
miner: miner,
blocktime: blocktime,
mine: int64(1),
done: make(chan struct{}),
}
}
func (bm *BlockMiner) MineBlocks() {
time.Sleep(time.Second)
go func() {
defer close(bm.done)
for atomic.LoadInt64(&bm.mine) == 1 {
select {
case <-bm.ctx.Done():
return
case <-time.After(bm.blocktime):
}
nulls := atomic.SwapInt64(&bm.nulls, 0)
if err := bm.miner.MineOne(bm.ctx, miner.MineReq{
InjectNulls: abi.ChainEpoch(nulls),
Done: func(bool, abi.ChainEpoch, error) {},
}); err != nil {
bm.t.Error(err)
}
}
}()
}
func (bm *BlockMiner) Stop() {
atomic.AddInt64(&bm.mine, -1)
fmt.Println("shutting down mining")
<-bm.done
}
-127
View File
@@ -1,127 +0,0 @@
package test
import (
"context"
"fmt"
"sync/atomic"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/impl"
)
func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {
for _, height := range []abi.ChainEpoch{
-1, // before
162, // while sealing
530, // after upgrade deal
5000, // after
} {
height := height // make linters happy by copying
t.Run(fmt.Sprintf("upgrade-%d", height), func(t *testing.T) {
testCCUpgrade(t, b, blocktime, height)
})
}
}
func testCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, upgradeHeight abi.ChainEpoch) {
ctx := context.Background()
n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(upgradeHeight)}, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
time.Sleep(time.Second)
mine := int64(1)
done := make(chan struct{})
go func() {
defer close(done)
for atomic.LoadInt64(&mine) == 1 {
time.Sleep(blocktime)
if err := sn[0].MineOne(ctx, MineNext); err != nil {
t.Error(err)
}
}
}()
maddr, err := miner.ActorAddress(ctx)
if err != nil {
t.Fatal(err)
}
CC := abi.SectorNumber(GenesisPreseals + 1)
Upgraded := CC + 1
pledgeSectors(t, ctx, miner, 1, 0, nil)
sl, err := miner.SectorsList(ctx)
if err != nil {
t.Fatal(err)
}
if len(sl) != 1 {
t.Fatal("expected 1 sector")
}
if sl[0] != CC {
t.Fatal("bad")
}
{
si, err := client.StateSectorGetInfo(ctx, maddr, CC, types.EmptyTSK)
require.NoError(t, err)
require.Less(t, 50000, int(si.Expiration))
}
if err := miner.SectorMarkForUpgrade(ctx, sl[0]); err != nil {
t.Fatal(err)
}
MakeDeal(t, ctx, 6, client, miner, false, false, 0)
// Validate upgrade
{
exp, err := client.StateSectorExpiration(ctx, maddr, CC, types.EmptyTSK)
require.NoError(t, err)
require.NotNil(t, exp)
require.Greater(t, 50000, int(exp.OnTime))
}
{
exp, err := client.StateSectorExpiration(ctx, maddr, Upgraded, types.EmptyTSK)
require.NoError(t, err)
require.Less(t, 50000, int(exp.OnTime))
}
dlInfo, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
// Sector should expire.
for {
// Wait for the sector to expire.
status, err := miner.SectorsStatus(ctx, CC, true)
require.NoError(t, err)
if status.OnTime == 0 && status.Early == 0 {
break
}
t.Log("waiting for sector to expire")
// wait one deadline per loop.
time.Sleep(time.Duration(dlInfo.WPoStChallengeWindow) * blocktime)
}
fmt.Println("shutting down mining")
atomic.AddInt64(&mine, -1)
<-done
}
-621
View File
@@ -1,621 +0,0 @@
package test
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"sort"
"testing"
"time"
"github.com/ipfs/go-cid"
files "github.com/ipfs/go-ipfs-files"
"github.com/ipld/go-car"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
"github.com/filecoin-project/lotus/chain/types"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
"github.com/filecoin-project/lotus/markets/storageadapter"
"github.com/filecoin-project/lotus/node"
"github.com/filecoin-project/lotus/node/impl"
"github.com/filecoin-project/lotus/node/modules/dtypes"
market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
ipld "github.com/ipfs/go-ipld-format"
dag "github.com/ipfs/go-merkledag"
dstest "github.com/ipfs/go-merkledag/test"
unixfile "github.com/ipfs/go-unixfs/file"
)
func TestDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, carExport, fastRet bool, startEpoch abi.ChainEpoch) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
MakeDeal(t, s.ctx, 6, s.client, s.miner, carExport, fastRet, startEpoch)
}
func TestDoubleDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
MakeDeal(t, s.ctx, 6, s.client, s.miner, false, false, startEpoch)
MakeDeal(t, s.ctx, 7, s.client, s.miner, false, false, startEpoch)
}
func MakeDeal(t *testing.T, ctx context.Context, rseed int, client api.FullNode, miner TestStorageNode, carExport, fastRet bool, startEpoch abi.ChainEpoch) {
res, data, err := CreateClientFile(ctx, client, rseed, 0)
if err != nil {
t.Fatal(err)
}
fcid := res.Root
fmt.Println("FILE CID: ", fcid)
deal := startDeal(t, ctx, miner, client, fcid, fastRet, startEpoch)
// TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
time.Sleep(time.Second)
waitDealSealed(t, ctx, miner, client, deal, false, false, nil)
// Retrieval
info, err := client.ClientGetDealInfo(ctx, *deal)
require.NoError(t, err)
testRetrieval(t, ctx, client, fcid, &info.PieceCID, carExport, data)
}
func CreateClientFile(ctx context.Context, client api.FullNode, rseed, size int) (*api.ImportRes, []byte, error) {
if size == 0 {
size = 1600
}
data := make([]byte, size)
rand.New(rand.NewSource(int64(rseed))).Read(data)
dir, err := ioutil.TempDir(os.TempDir(), "test-make-deal-")
if err != nil {
return nil, nil, err
}
path := filepath.Join(dir, "sourcefile.dat")
err = ioutil.WriteFile(path, data, 0644)
if err != nil {
return nil, nil, err
}
res, err := client.ClientImport(ctx, api.FileRef{Path: path})
if err != nil {
return nil, nil, err
}
return res, data, nil
}
func TestPublishDealsBatching(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
publishPeriod := 10 * time.Second
maxDealsPerMsg := uint64(2)
// Set max deals per publish deals message to 2
minerDef := []StorageMiner{{
Full: 0,
Opts: node.Override(
new(*storageadapter.DealPublisher),
storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{
Period: publishPeriod,
MaxDealsPerMsg: maxDealsPerMsg,
})),
Preseal: PresealGenesis,
}}
// Create a connect client and miner node
n, sn := b(t, OneFull, minerDef)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
s := connectAndStartMining(t, b, blocktime, client, miner)
defer s.blockMiner.Stop()
// Starts a deal and waits until it's published
runDealTillPublish := func(rseed int) {
res, _, err := CreateClientFile(s.ctx, s.client, rseed, 0)
require.NoError(t, err)
upds, err := client.ClientGetDealUpdates(s.ctx)
require.NoError(t, err)
startDeal(t, s.ctx, s.miner, s.client, res.Root, false, startEpoch)
// TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
time.Sleep(time.Second)
done := make(chan struct{})
go func() {
for upd := range upds {
if upd.DataRef.Root == res.Root && upd.State == storagemarket.StorageDealAwaitingPreCommit {
done <- struct{}{}
}
}
}()
<-done
}
// Run three deals in parallel
done := make(chan struct{}, maxDealsPerMsg+1)
for rseed := 1; rseed <= 3; rseed++ {
rseed := rseed
go func() {
runDealTillPublish(rseed)
done <- struct{}{}
}()
}
// Wait for two of the deals to be published
for i := 0; i < int(maxDealsPerMsg); i++ {
<-done
}
// Expect a single PublishStorageDeals message that includes the first two deals
msgCids, err := s.client.StateListMessages(s.ctx, &api.MessageMatch{To: market.Address}, types.EmptyTSK, 1)
require.NoError(t, err)
count := 0
for _, msgCid := range msgCids {
msg, err := s.client.ChainGetMessage(s.ctx, msgCid)
require.NoError(t, err)
if msg.Method == market.Methods.PublishStorageDeals {
count++
var pubDealsParams market2.PublishStorageDealsParams
err = pubDealsParams.UnmarshalCBOR(bytes.NewReader(msg.Params))
require.NoError(t, err)
require.Len(t, pubDealsParams.Deals, int(maxDealsPerMsg))
}
}
require.Equal(t, 1, count)
// The third deal should be published once the publish period expires.
// Allow a little padding as it takes a moment for the state change to
// be noticed by the client.
padding := 10 * time.Second
select {
case <-time.After(publishPeriod + padding):
require.Fail(t, "Expected 3rd deal to be published once publish period elapsed")
case <-done: // Success
}
}
func TestBatchDealInput(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
run := func(piece, deals, expectSectors int) func(t *testing.T) {
return func(t *testing.T) {
publishPeriod := 10 * time.Second
maxDealsPerMsg := uint64(deals)
// Set max deals per publish deals message to maxDealsPerMsg
minerDef := []StorageMiner{{
Full: 0,
Opts: node.Options(
node.Override(
new(*storageadapter.DealPublisher),
storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{
Period: publishPeriod,
MaxDealsPerMsg: maxDealsPerMsg,
})),
node.Override(new(dtypes.GetSealingConfigFunc), func() (dtypes.GetSealingConfigFunc, error) {
return func() (sealiface.Config, error) {
return sealiface.Config{
MaxWaitDealsSectors: 2,
MaxSealingSectors: 1,
MaxSealingSectorsForDeals: 3,
AlwaysKeepUnsealedCopy: true,
WaitDealsDelay: time.Hour,
}, nil
}, nil
}),
),
Preseal: PresealGenesis,
}}
// Create a connect client and miner node
n, sn := b(t, OneFull, minerDef)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
s := connectAndStartMining(t, b, blocktime, client, miner)
defer s.blockMiner.Stop()
err := miner.MarketSetAsk(s.ctx, big.Zero(), big.Zero(), 200, 128, 32<<30)
require.NoError(t, err)
checkNoPadding := func() {
sl, err := sn[0].SectorsList(s.ctx)
require.NoError(t, err)
sort.Slice(sl, func(i, j int) bool {
return sl[i] < sl[j]
})
for _, snum := range sl {
si, err := sn[0].SectorsStatus(s.ctx, snum, false)
require.NoError(t, err)
// fmt.Printf("S %d: %+v %s\n", snum, si.Deals, si.State)
for _, deal := range si.Deals {
if deal == 0 {
fmt.Printf("sector %d had a padding piece!\n", snum)
}
}
}
}
// Starts a deal and waits until it's published
runDealTillSeal := func(rseed int) {
res, _, err := CreateClientFile(s.ctx, s.client, rseed, piece)
require.NoError(t, err)
dc := startDeal(t, s.ctx, s.miner, s.client, res.Root, false, startEpoch)
waitDealSealed(t, s.ctx, s.miner, s.client, dc, false, true, checkNoPadding)
}
// Run maxDealsPerMsg deals in parallel
done := make(chan struct{}, maxDealsPerMsg)
for rseed := 0; rseed < int(maxDealsPerMsg); rseed++ {
rseed := rseed
go func() {
runDealTillSeal(rseed)
done <- struct{}{}
}()
}
// Wait for maxDealsPerMsg of the deals to be published
for i := 0; i < int(maxDealsPerMsg); i++ {
<-done
}
checkNoPadding()
sl, err := sn[0].SectorsList(s.ctx)
require.NoError(t, err)
require.Equal(t, len(sl), expectSectors)
}
}
t.Run("4-p1600B", run(1600, 4, 4))
t.Run("4-p513B", run(513, 4, 2))
if !testing.Short() {
t.Run("32-p257B", run(257, 32, 8))
t.Run("32-p10B", run(10, 32, 2))
// fixme: this appears to break data-transfer / markets in some really creative ways
//t.Run("128-p10B", run(10, 128, 8))
}
}
func TestFastRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
data := make([]byte, 1600)
rand.New(rand.NewSource(int64(8))).Read(data)
r := bytes.NewReader(data)
fcid, err := s.client.ClientImportLocal(s.ctx, r)
if err != nil {
t.Fatal(err)
}
fmt.Println("FILE CID: ", fcid)
deal := startDeal(t, s.ctx, s.miner, s.client, fcid, true, startEpoch)
waitDealPublished(t, s.ctx, s.miner, deal)
fmt.Println("deal published, retrieving")
// Retrieval
info, err := s.client.ClientGetDealInfo(s.ctx, *deal)
require.NoError(t, err)
testRetrieval(t, s.ctx, s.client, fcid, &info.PieceCID, false, data)
}
func TestSecondDealRetrieval(t *testing.T, b APIBuilder, blocktime time.Duration) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
{
data1 := make([]byte, 800)
rand.New(rand.NewSource(int64(3))).Read(data1)
r := bytes.NewReader(data1)
fcid1, err := s.client.ClientImportLocal(s.ctx, r)
if err != nil {
t.Fatal(err)
}
data2 := make([]byte, 800)
rand.New(rand.NewSource(int64(9))).Read(data2)
r2 := bytes.NewReader(data2)
fcid2, err := s.client.ClientImportLocal(s.ctx, r2)
if err != nil {
t.Fatal(err)
}
deal1 := startDeal(t, s.ctx, s.miner, s.client, fcid1, true, 0)
// TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
time.Sleep(time.Second)
waitDealSealed(t, s.ctx, s.miner, s.client, deal1, true, false, nil)
deal2 := startDeal(t, s.ctx, s.miner, s.client, fcid2, true, 0)
time.Sleep(time.Second)
waitDealSealed(t, s.ctx, s.miner, s.client, deal2, false, false, nil)
// Retrieval
info, err := s.client.ClientGetDealInfo(s.ctx, *deal2)
require.NoError(t, err)
rf, _ := s.miner.SectorsRefs(s.ctx)
fmt.Printf("refs: %+v\n", rf)
testRetrieval(t, s.ctx, s.client, fcid2, &info.PieceCID, false, data2)
}
}
func TestZeroPricePerByteRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
// Set price-per-byte to zero
ask, err := s.miner.MarketGetRetrievalAsk(s.ctx)
require.NoError(t, err)
ask.PricePerByte = abi.NewTokenAmount(0)
err = s.miner.MarketSetRetrievalAsk(s.ctx, ask)
require.NoError(t, err)
MakeDeal(t, s.ctx, 6, s.client, s.miner, false, false, startEpoch)
}
func startDeal(t *testing.T, ctx context.Context, miner TestStorageNode, client api.FullNode, fcid cid.Cid, fastRet bool, startEpoch abi.ChainEpoch) *cid.Cid {
maddr, err := miner.ActorAddress(ctx)
if err != nil {
t.Fatal(err)
}
addr, err := client.WalletDefaultAddress(ctx)
if err != nil {
t.Fatal(err)
}
deal, err := client.ClientStartDeal(ctx, &api.StartDealParams{
Data: &storagemarket.DataRef{
TransferType: storagemarket.TTGraphsync,
Root: fcid,
},
Wallet: addr,
Miner: maddr,
EpochPrice: types.NewInt(1000000),
DealStartEpoch: startEpoch,
MinBlocksDuration: uint64(build.MinDealDuration),
FastRetrieval: fastRet,
})
if err != nil {
t.Fatalf("%+v", err)
}
return deal
}
func waitDealSealed(t *testing.T, ctx context.Context, miner TestStorageNode, client api.FullNode, deal *cid.Cid, noseal, noSealStart bool, cb func()) {
loop:
for {
di, err := client.ClientGetDealInfo(ctx, *deal)
if err != nil {
t.Fatal(err)
}
switch di.State {
case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing:
if noseal {
return
}
if !noSealStart {
startSealingWaiting(t, ctx, miner)
}
case storagemarket.StorageDealProposalRejected:
t.Fatal("deal rejected")
case storagemarket.StorageDealFailing:
t.Fatal("deal failed")
case storagemarket.StorageDealError:
t.Fatal("deal errored", di.Message)
case storagemarket.StorageDealActive:
fmt.Println("COMPLETE", di)
break loop
}
mds, err := miner.MarketListIncompleteDeals(ctx)
if err != nil {
t.Fatal(err)
}
var minerState storagemarket.StorageDealStatus
for _, md := range mds {
if md.DealID == di.DealID {
minerState = md.State
break
}
}
fmt.Printf("Deal %d state: client:%s provider:%s\n", di.DealID, storagemarket.DealStates[di.State], storagemarket.DealStates[minerState])
time.Sleep(time.Second / 2)
if cb != nil {
cb()
}
}
}
func waitDealPublished(t *testing.T, ctx context.Context, miner TestStorageNode, deal *cid.Cid) {
subCtx, cancel := context.WithCancel(ctx)
defer cancel()
updates, err := miner.MarketGetDealUpdates(subCtx)
if err != nil {
t.Fatal(err)
}
for {
select {
case <-ctx.Done():
t.Fatal("context timeout")
case di := <-updates:
if deal.Equals(di.ProposalCid) {
switch di.State {
case storagemarket.StorageDealProposalRejected:
t.Fatal("deal rejected")
case storagemarket.StorageDealFailing:
t.Fatal("deal failed")
case storagemarket.StorageDealError:
t.Fatal("deal errored", di.Message)
case storagemarket.StorageDealFinalizing, storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing, storagemarket.StorageDealActive:
fmt.Println("COMPLETE", di)
return
}
fmt.Println("Deal state: ", storagemarket.DealStates[di.State])
}
}
}
}
func startSealingWaiting(t *testing.T, ctx context.Context, miner TestStorageNode) {
snums, err := miner.SectorsList(ctx)
require.NoError(t, err)
for _, snum := range snums {
si, err := miner.SectorsStatus(ctx, snum, false)
require.NoError(t, err)
t.Logf("Sector %d state: %s", snum, si.State)
if si.State == api.SectorState(sealing.WaitDeals) {
require.NoError(t, miner.SectorStartSealing(ctx, snum))
}
}
flushSealingBatches(t, ctx, miner)
}
func testRetrieval(t *testing.T, ctx context.Context, client api.FullNode, fcid cid.Cid, piece *cid.Cid, carExport bool, data []byte) {
offers, err := client.ClientFindData(ctx, fcid, piece)
if err != nil {
t.Fatal(err)
}
if len(offers) < 1 {
t.Fatal("no offers")
}
rpath, err := ioutil.TempDir("", "lotus-retrieve-test-")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(rpath) //nolint:errcheck
caddr, err := client.WalletDefaultAddress(ctx)
if err != nil {
t.Fatal(err)
}
ref := &api.FileRef{
Path: filepath.Join(rpath, "ret"),
IsCAR: carExport,
}
updates, err := client.ClientRetrieveWithEvents(ctx, offers[0].Order(caddr), ref)
if err != nil {
t.Fatal(err)
}
for update := range updates {
if update.Err != "" {
t.Fatalf("retrieval failed: %s", update.Err)
}
}
rdata, err := ioutil.ReadFile(filepath.Join(rpath, "ret"))
if err != nil {
t.Fatal(err)
}
if carExport {
rdata = extractCarData(t, ctx, rdata, rpath)
}
if !bytes.Equal(rdata, data) {
t.Fatal("wrong data retrieved")
}
}
func extractCarData(t *testing.T, ctx context.Context, rdata []byte, rpath string) []byte {
bserv := dstest.Bserv()
ch, err := car.LoadCar(bserv.Blockstore(), bytes.NewReader(rdata))
if err != nil {
t.Fatal(err)
}
b, err := bserv.GetBlock(ctx, ch.Roots[0])
if err != nil {
t.Fatal(err)
}
nd, err := ipld.Decode(b)
if err != nil {
t.Fatal(err)
}
dserv := dag.NewDAGService(bserv)
fil, err := unixfile.NewUnixfsFile(ctx, dserv, nd)
if err != nil {
t.Fatal(err)
}
outPath := filepath.Join(rpath, "retLoadedCAR")
if err := files.WriteTo(fil, outPath); err != nil {
t.Fatal(err)
}
rdata, err = ioutil.ReadFile(outPath)
if err != nil {
t.Fatal(err)
}
return rdata
}
type dealsScaffold struct {
ctx context.Context
client *impl.FullNodeAPI
miner TestStorageNode
blockMiner *BlockMiner
}
func setupOneClientOneMiner(t *testing.T, b APIBuilder, blocktime time.Duration) *dealsScaffold {
n, sn := b(t, OneFull, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
return connectAndStartMining(t, b, blocktime, client, miner)
}
func connectAndStartMining(t *testing.T, b APIBuilder, blocktime time.Duration, client *impl.FullNodeAPI, miner TestStorageNode) *dealsScaffold {
ctx := context.Background()
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
time.Sleep(time.Second)
blockMiner := NewBlockMiner(ctx, t, miner, blocktime)
blockMiner.MineBlocks()
return &dealsScaffold{
ctx: ctx,
client: client,
miner: miner,
blockMiner: blockMiner,
}
}
-240
View File
@@ -1,240 +0,0 @@
package test
import (
"bytes"
"context"
"fmt"
"math/rand"
"sync/atomic"
"testing"
"time"
logging "github.com/ipfs/go-log/v2"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/miner"
"github.com/filecoin-project/lotus/node/impl"
)
//nolint:deadcode,varcheck
var log = logging.Logger("apitest")
func (ts *testSuite) testMining(t *testing.T) {
ctx := context.Background()
apis, sn := ts.makeNodes(t, OneFull, OneMiner)
api := apis[0]
newHeads, err := api.ChainNotify(ctx)
require.NoError(t, err)
initHead := (<-newHeads)[0]
baseHeight := initHead.Val.Height()
h1, err := api.ChainHead(ctx)
require.NoError(t, err)
require.Equal(t, int64(h1.Height()), int64(baseHeight))
MineUntilBlock(ctx, t, apis[0], sn[0], nil)
require.NoError(t, err)
<-newHeads
h2, err := api.ChainHead(ctx)
require.NoError(t, err)
require.Greater(t, int64(h2.Height()), int64(h1.Height()))
}
func (ts *testSuite) testMiningReal(t *testing.T) {
build.InsecurePoStValidation = false
defer func() {
build.InsecurePoStValidation = true
}()
ctx := context.Background()
apis, sn := ts.makeNodes(t, OneFull, OneMiner)
api := apis[0]
newHeads, err := api.ChainNotify(ctx)
require.NoError(t, err)
at := (<-newHeads)[0].Val.Height()
h1, err := api.ChainHead(ctx)
require.NoError(t, err)
require.Equal(t, int64(at), int64(h1.Height()))
MineUntilBlock(ctx, t, apis[0], sn[0], nil)
require.NoError(t, err)
<-newHeads
h2, err := api.ChainHead(ctx)
require.NoError(t, err)
require.Greater(t, int64(h2.Height()), int64(h1.Height()))
MineUntilBlock(ctx, t, apis[0], sn[0], nil)
require.NoError(t, err)
<-newHeads
h3, err := api.ChainHead(ctx)
require.NoError(t, err)
require.Greater(t, int64(h3.Height()), int64(h2.Height()))
}
func TestDealMining(t *testing.T, b APIBuilder, blocktime time.Duration, carExport bool) {
// test making a deal with a fresh miner, and see if it starts to mine
ctx := context.Background()
n, sn := b(t, OneFull, []StorageMiner{
{Full: 0, Preseal: PresealGenesis},
{Full: 0, Preseal: 0}, // TODO: Add support for miners on non-first full node
})
client := n[0].FullNode.(*impl.FullNodeAPI)
provider := sn[1]
genesisMiner := sn[0]
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := provider.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
if err := genesisMiner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
time.Sleep(time.Second)
data := make([]byte, 600)
rand.New(rand.NewSource(5)).Read(data)
r := bytes.NewReader(data)
fcid, err := client.ClientImportLocal(ctx, r)
if err != nil {
t.Fatal(err)
}
fmt.Println("FILE CID: ", fcid)
var mine int32 = 1
done := make(chan struct{})
minedTwo := make(chan struct{})
m2addr, err := sn[1].ActorAddress(context.TODO())
if err != nil {
t.Fatal(err)
}
go func() {
defer close(done)
complChan := minedTwo
for atomic.LoadInt32(&mine) != 0 {
wait := make(chan int)
mdone := func(mined bool, _ abi.ChainEpoch, err error) {
n := 0
if mined {
n = 1
}
wait <- n
}
if err := sn[0].MineOne(ctx, miner.MineReq{Done: mdone}); err != nil {
t.Error(err)
}
if err := sn[1].MineOne(ctx, miner.MineReq{Done: mdone}); err != nil {
t.Error(err)
}
expect := <-wait
expect += <-wait
time.Sleep(blocktime)
if expect == 0 {
// null block
continue
}
var nodeOneMined bool
for _, node := range sn {
mb, err := node.MiningBase(ctx)
if err != nil {
t.Error(err)
return
}
for _, b := range mb.Blocks() {
if b.Miner == m2addr {
nodeOneMined = true
break
}
}
}
if nodeOneMined && complChan != nil {
close(complChan)
complChan = nil
}
}
}()
deal := startDeal(t, ctx, provider, client, fcid, false, 0)
// TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
time.Sleep(time.Second)
waitDealSealed(t, ctx, provider, client, deal, false, false, nil)
<-minedTwo
atomic.StoreInt32(&mine, 0)
fmt.Println("shutting down mining")
<-done
}
func (ts *testSuite) testNonGenesisMiner(t *testing.T) {
ctx := context.Background()
n, sn := ts.makeNodes(t, []FullNodeOpts{
FullNodeWithLatestActorsAt(-1),
}, []StorageMiner{
{Full: 0, Preseal: PresealGenesis},
})
full, ok := n[0].FullNode.(*impl.FullNodeAPI)
if !ok {
t.Skip("not testing with a full node")
return
}
genesisMiner := sn[0]
bm := NewBlockMiner(ctx, t, genesisMiner, 4*time.Millisecond)
bm.MineBlocks()
t.Cleanup(bm.Stop)
gaa, err := genesisMiner.ActorAddress(ctx)
require.NoError(t, err)
gmi, err := full.StateMinerInfo(ctx, gaa, types.EmptyTSK)
require.NoError(t, err)
testm := n[0].Stb(ctx, t, TestSpt, gmi.Owner)
ta, err := testm.ActorAddress(ctx)
require.NoError(t, err)
tid, err := address.IDFromAddress(ta)
require.NoError(t, err)
require.Equal(t, uint64(1001), tid)
}
-389
View File
@@ -1,389 +0,0 @@
package test
import (
"context"
"fmt"
"sort"
"strings"
"sync/atomic"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/stmgr"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
bminer "github.com/filecoin-project/lotus/miner"
"github.com/filecoin-project/lotus/node"
"github.com/filecoin-project/lotus/node/impl"
)
func TestSDRUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
n, sn := b(t, []FullNodeOpts{FullNodeWithSDRAt(500, 1000)}, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
build.Clock.Sleep(time.Second)
pledge := make(chan struct{})
mine := int64(1)
done := make(chan struct{})
go func() {
defer close(done)
round := 0
for atomic.LoadInt64(&mine) != 0 {
build.Clock.Sleep(blocktime)
if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
}}); err != nil {
t.Error(err)
}
// 3 sealing rounds: before, during after.
if round >= 3 {
continue
}
head, err := client.ChainHead(ctx)
assert.NoError(t, err)
// rounds happen every 100 blocks, with a 50 block offset.
if head.Height() >= abi.ChainEpoch(round*500+50) {
round++
pledge <- struct{}{}
ver, err := client.StateNetworkVersion(ctx, head.Key())
assert.NoError(t, err)
switch round {
case 1:
assert.Equal(t, network.Version6, ver)
case 2:
assert.Equal(t, network.Version7, ver)
case 3:
assert.Equal(t, network.Version8, ver)
}
}
}
}()
// before.
pledgeSectors(t, ctx, miner, 9, 0, pledge)
s, err := miner.SectorsList(ctx)
require.NoError(t, err)
sort.Slice(s, func(i, j int) bool {
return s[i] < s[j]
})
for i, id := range s {
info, err := miner.SectorsStatus(ctx, id, true)
require.NoError(t, err)
expectProof := abi.RegisteredSealProof_StackedDrg2KiBV1
if i >= 3 {
// after
expectProof = abi.RegisteredSealProof_StackedDrg2KiBV1_1
}
assert.Equal(t, expectProof, info.SealProof, "sector %d, id %d", i, id)
}
atomic.StoreInt64(&mine, 0)
<-done
}
func TestPledgeBatching(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(-1)}, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
build.Clock.Sleep(time.Second)
mine := int64(1)
done := make(chan struct{})
go func() {
defer close(done)
for atomic.LoadInt64(&mine) != 0 {
build.Clock.Sleep(blocktime)
if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
}}); err != nil {
t.Error(err)
}
}
}()
for {
h, err := client.ChainHead(ctx)
require.NoError(t, err)
if h.Height() > 10 {
break
}
}
toCheck := startPledge(t, ctx, miner, nSectors, 0, nil)
for len(toCheck) > 0 {
states := map[api.SectorState]int{}
for n := range toCheck {
st, err := miner.SectorsStatus(ctx, n, false)
require.NoError(t, err)
states[st.State]++
if st.State == api.SectorState(sealing.Proving) {
delete(toCheck, n)
}
if strings.Contains(string(st.State), "Fail") {
t.Fatal("sector in a failed state", st.State)
}
}
if states[api.SectorState(sealing.SubmitPreCommitBatch)] == nSectors ||
(states[api.SectorState(sealing.SubmitPreCommitBatch)] > 0 && states[api.SectorState(sealing.PreCommit1)] == 0 && states[api.SectorState(sealing.PreCommit2)] == 0) {
pcb, err := miner.SectorPreCommitFlush(ctx)
require.NoError(t, err)
if pcb != nil {
fmt.Printf("PRECOMMIT BATCH: %+v\n", pcb)
}
}
if states[api.SectorState(sealing.SubmitCommitAggregate)] == nSectors ||
(states[api.SectorState(sealing.SubmitCommitAggregate)] > 0 && states[api.SectorState(sealing.WaitSeed)] == 0 && states[api.SectorState(sealing.Committing)] == 0) {
cb, err := miner.SectorCommitFlush(ctx)
require.NoError(t, err)
if cb != nil {
fmt.Printf("COMMIT BATCH: %+v\n", cb)
}
}
build.Clock.Sleep(100 * time.Millisecond)
fmt.Printf("WaitSeal: %d %+v\n", len(toCheck), states)
}
atomic.StoreInt64(&mine, 0)
<-done
}
func TestPledgeBeforeNv13(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
n, sn := b(t, []FullNodeOpts{
{
Opts: func(nodes []TestNode) node.Option {
return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
Network: network.Version9,
Height: 1,
Migration: stmgr.UpgradeActorsV2,
}, {
Network: network.Version10,
Height: 2,
Migration: stmgr.UpgradeActorsV3,
}, {
Network: network.Version12,
Height: 3,
Migration: stmgr.UpgradeActorsV4,
}, {
Network: network.Version13,
Height: 1000000000,
Migration: stmgr.UpgradeActorsV5,
}})
},
},
}, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
build.Clock.Sleep(time.Second)
mine := int64(1)
done := make(chan struct{})
go func() {
defer close(done)
for atomic.LoadInt64(&mine) != 0 {
build.Clock.Sleep(blocktime)
if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
}}); err != nil {
t.Error(err)
}
}
}()
for {
h, err := client.ChainHead(ctx)
require.NoError(t, err)
if h.Height() > 10 {
break
}
}
toCheck := startPledge(t, ctx, miner, nSectors, 0, nil)
for len(toCheck) > 0 {
states := map[api.SectorState]int{}
for n := range toCheck {
st, err := miner.SectorsStatus(ctx, n, false)
require.NoError(t, err)
states[st.State]++
if st.State == api.SectorState(sealing.Proving) {
delete(toCheck, n)
}
if strings.Contains(string(st.State), "Fail") {
t.Fatal("sector in a failed state", st.State)
}
}
build.Clock.Sleep(100 * time.Millisecond)
fmt.Printf("WaitSeal: %d %+v\n", len(toCheck), states)
}
atomic.StoreInt64(&mine, 0)
<-done
}
func TestPledgeSector(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
n, sn := b(t, OneFull, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
build.Clock.Sleep(time.Second)
mine := int64(1)
done := make(chan struct{})
go func() {
defer close(done)
for atomic.LoadInt64(&mine) != 0 {
build.Clock.Sleep(blocktime)
if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
}}); err != nil {
t.Error(err)
}
}
}()
pledgeSectors(t, ctx, miner, nSectors, 0, nil)
atomic.StoreInt64(&mine, 0)
<-done
}
func flushSealingBatches(t *testing.T, ctx context.Context, miner TestStorageNode) {
pcb, err := miner.SectorPreCommitFlush(ctx)
require.NoError(t, err)
if pcb != nil {
fmt.Printf("PRECOMMIT BATCH: %+v\n", pcb)
}
cb, err := miner.SectorCommitFlush(ctx)
require.NoError(t, err)
if cb != nil {
fmt.Printf("COMMIT BATCH: %+v\n", cb)
}
}
func startPledge(t *testing.T, ctx context.Context, miner TestStorageNode, n, existing int, blockNotif <-chan struct{}) map[abi.SectorNumber]struct{} {
for i := 0; i < n; i++ {
if i%3 == 0 && blockNotif != nil {
<-blockNotif
log.Errorf("WAIT")
}
log.Errorf("PLEDGING %d", i)
_, err := miner.PledgeSector(ctx)
require.NoError(t, err)
}
for {
s, err := miner.SectorsList(ctx) // Note - the test builder doesn't import genesis sectors into FSM
require.NoError(t, err)
fmt.Printf("Sectors: %d\n", len(s))
if len(s) >= n+existing {
break
}
build.Clock.Sleep(100 * time.Millisecond)
}
fmt.Printf("All sectors is fsm\n")
s, err := miner.SectorsList(ctx)
require.NoError(t, err)
toCheck := map[abi.SectorNumber]struct{}{}
for _, number := range s {
toCheck[number] = struct{}{}
}
return toCheck
}
func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n, existing int, blockNotif <-chan struct{}) {
toCheck := startPledge(t, ctx, miner, n, existing, blockNotif)
for len(toCheck) > 0 {
flushSealingBatches(t, ctx, miner)
states := map[api.SectorState]int{}
for n := range toCheck {
st, err := miner.SectorsStatus(ctx, n, false)
require.NoError(t, err)
states[st.State]++
if st.State == api.SectorState(sealing.Proving) {
delete(toCheck, n)
}
if strings.Contains(string(st.State), "Fail") {
t.Fatal("sector in a failed state", st.State)
}
}
build.Clock.Sleep(100 * time.Millisecond)
fmt.Printf("WaitSeal: %d %+v\n", len(toCheck), states)
}
}
-323
View File
@@ -1,323 +0,0 @@
package test
import (
"context"
"fmt"
"os"
"strings"
"testing"
"time"
logging "github.com/ipfs/go-log/v2"
"github.com/multiformats/go-multiaddr"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/network"
lapi "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/miner"
"github.com/filecoin-project/lotus/node"
)
func init() {
logging.SetAllLoggers(logging.LevelInfo)
err := os.Setenv("BELLMAN_NO_GPU", "1")
if err != nil {
panic(fmt.Sprintf("failed to set BELLMAN_NO_GPU env variable: %s", err))
}
build.InsecurePoStValidation = true
}
type StorageBuilder func(context.Context, *testing.T, abi.RegisteredSealProof, address.Address) TestStorageNode
type TestNode struct {
v1api.FullNode
// ListenAddr is the address on which an API server is listening, if an
// API server is created for this Node
ListenAddr multiaddr.Multiaddr
Stb StorageBuilder
}
type TestStorageNode struct {
lapi.StorageMiner
// ListenAddr is the address on which an API server is listening, if an
// API server is created for this Node
ListenAddr multiaddr.Multiaddr
MineOne func(context.Context, miner.MineReq) error
Stop func(context.Context) error
}
var PresealGenesis = -1
const GenesisPreseals = 2
const TestSpt = abi.RegisteredSealProof_StackedDrg2KiBV1_1
// Options for setting up a mock storage miner
type StorageMiner struct {
Full int
Opts node.Option
Preseal int
}
type OptionGenerator func([]TestNode) node.Option
// Options for setting up a mock full node
type FullNodeOpts struct {
Lite bool // run node in "lite" mode
Opts OptionGenerator // generate dependency injection options
}
// APIBuilder is a function which is invoked in test suite to provide
// test nodes and networks
//
// fullOpts array defines options for each full node
// storage array defines storage nodes, numbers in the array specify full node
// index the storage node 'belongs' to
type APIBuilder func(t *testing.T, full []FullNodeOpts, storage []StorageMiner) ([]TestNode, []TestStorageNode)
type testSuite struct {
makeNodes APIBuilder
}
// TestApis is the entry point to API test suite
func TestApis(t *testing.T, b APIBuilder) {
ts := testSuite{
makeNodes: b,
}
t.Run("version", ts.testVersion)
t.Run("id", ts.testID)
t.Run("testConnectTwo", ts.testConnectTwo)
t.Run("testMining", ts.testMining)
t.Run("testMiningReal", ts.testMiningReal)
t.Run("testSearchMsg", ts.testSearchMsg)
t.Run("testNonGenesisMiner", ts.testNonGenesisMiner)
}
func DefaultFullOpts(nFull int) []FullNodeOpts {
full := make([]FullNodeOpts, nFull)
for i := range full {
full[i] = FullNodeOpts{
Opts: func(nodes []TestNode) node.Option {
return node.Options()
},
}
}
return full
}
var OneMiner = []StorageMiner{{Full: 0, Preseal: PresealGenesis}}
var OneFull = DefaultFullOpts(1)
var TwoFull = DefaultFullOpts(2)
var FullNodeWithLatestActorsAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
if upgradeHeight == -1 {
// Attention: Update this when introducing new actor versions or your tests will be sad
upgradeHeight = 4
}
return FullNodeOpts{
Opts: func(nodes []TestNode) node.Option {
return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
// prepare for upgrade.
Network: network.Version9,
Height: 1,
Migration: stmgr.UpgradeActorsV2,
}, {
Network: network.Version10,
Height: 2,
Migration: stmgr.UpgradeActorsV3,
}, {
Network: network.Version12,
Height: 3,
Migration: stmgr.UpgradeActorsV4,
}, {
Network: network.Version13,
Height: upgradeHeight,
Migration: stmgr.UpgradeActorsV5,
}})
},
}
}
var FullNodeWithSDRAt = func(calico, persian abi.ChainEpoch) FullNodeOpts {
return FullNodeOpts{
Opts: func(nodes []TestNode) node.Option {
return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
Network: network.Version6,
Height: 1,
Migration: stmgr.UpgradeActorsV2,
}, {
Network: network.Version7,
Height: calico,
Migration: stmgr.UpgradeCalico,
}, {
Network: network.Version8,
Height: persian,
}})
},
}
}
var FullNodeWithV4ActorsAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
if upgradeHeight == -1 {
upgradeHeight = 3
}
return FullNodeOpts{
Opts: func(nodes []TestNode) node.Option {
return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
// prepare for upgrade.
Network: network.Version9,
Height: 1,
Migration: stmgr.UpgradeActorsV2,
}, {
Network: network.Version10,
Height: 2,
Migration: stmgr.UpgradeActorsV3,
}, {
Network: network.Version12,
Height: upgradeHeight,
Migration: stmgr.UpgradeActorsV4,
}})
},
}
}
var MineNext = miner.MineReq{
InjectNulls: 0,
Done: func(bool, abi.ChainEpoch, error) {},
}
func (ts *testSuite) testVersion(t *testing.T) {
lapi.RunningNodeType = lapi.NodeFull
t.Cleanup(func() {
lapi.RunningNodeType = lapi.NodeUnknown
})
ctx := context.Background()
apis, _ := ts.makeNodes(t, OneFull, OneMiner)
napi := apis[0]
v, err := napi.Version(ctx)
if err != nil {
t.Fatal(err)
}
versions := strings.Split(v.Version, "+")
if len(versions) <= 0 {
t.Fatal("empty version")
}
require.Equal(t, versions[0], build.BuildVersion)
}
func (ts *testSuite) testSearchMsg(t *testing.T) {
apis, miners := ts.makeNodes(t, OneFull, OneMiner)
api := apis[0]
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
senderAddr, err := api.WalletDefaultAddress(ctx)
if err != nil {
t.Fatal(err)
}
msg := &types.Message{
From: senderAddr,
To: senderAddr,
Value: big.Zero(),
}
bm := NewBlockMiner(ctx, t, miners[0], 100*time.Millisecond)
bm.MineBlocks()
defer bm.Stop()
sm, err := api.MpoolPushMessage(ctx, msg, nil)
if err != nil {
t.Fatal(err)
}
res, err := api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true)
if err != nil {
t.Fatal(err)
}
if res.Receipt.ExitCode != 0 {
t.Fatal("did not successfully send message")
}
searchRes, err := api.StateSearchMsg(ctx, types.EmptyTSK, sm.Cid(), lapi.LookbackNoLimit, true)
if err != nil {
t.Fatal(err)
}
if searchRes.TipSet != res.TipSet {
t.Fatalf("search ts: %s, different from wait ts: %s", searchRes.TipSet, res.TipSet)
}
}
func (ts *testSuite) testID(t *testing.T) {
ctx := context.Background()
apis, _ := ts.makeNodes(t, OneFull, OneMiner)
api := apis[0]
id, err := api.ID(ctx)
if err != nil {
t.Fatal(err)
}
assert.Regexp(t, "^12", id.Pretty())
}
func (ts *testSuite) testConnectTwo(t *testing.T) {
ctx := context.Background()
apis, _ := ts.makeNodes(t, TwoFull, OneMiner)
p, err := apis[0].NetPeers(ctx)
if err != nil {
t.Fatal(err)
}
if len(p) != 0 {
t.Error("Node 0 has a peer")
}
p, err = apis[1].NetPeers(ctx)
if err != nil {
t.Fatal(err)
}
if len(p) != 0 {
t.Error("Node 1 has a peer")
}
addrs, err := apis[1].NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := apis[0].NetConnect(ctx, addrs); err != nil {
t.Fatal(err)
}
p, err = apis[0].NetPeers(ctx)
if err != nil {
t.Fatal(err)
}
if len(p) != 1 {
t.Error("Node 0 doesn't have 1 peer")
}
p, err = apis[1].NetPeers(ctx)
if err != nil {
t.Fatal(err)
}
if len(p) != 1 {
t.Error("Node 0 doesn't have 1 peer")
}
}
-87
View File
@@ -1,87 +0,0 @@
package test
import (
"context"
"testing"
"time"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-address"
lapi "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/miner"
)
func SendFunds(ctx context.Context, t *testing.T, sender TestNode, addr address.Address, amount abi.TokenAmount) {
senderAddr, err := sender.WalletDefaultAddress(ctx)
if err != nil {
t.Fatal(err)
}
msg := &types.Message{
From: senderAddr,
To: addr,
Value: amount,
}
sm, err := sender.MpoolPushMessage(ctx, msg, nil)
if err != nil {
t.Fatal(err)
}
res, err := sender.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true)
if err != nil {
t.Fatal(err)
}
if res.Receipt.ExitCode != 0 {
t.Fatal("did not successfully send money")
}
}
func MineUntilBlock(ctx context.Context, t *testing.T, fn TestNode, sn TestStorageNode, cb func(abi.ChainEpoch)) {
for i := 0; i < 1000; i++ {
var success bool
var err error
var epoch abi.ChainEpoch
wait := make(chan struct{})
mineErr := sn.MineOne(ctx, miner.MineReq{
Done: func(win bool, ep abi.ChainEpoch, e error) {
success = win
err = e
epoch = ep
wait <- struct{}{}
},
})
if mineErr != nil {
t.Fatal(mineErr)
}
<-wait
if err != nil {
t.Fatal(err)
}
if success {
// Wait until it shows up on the given full nodes ChainHead
nloops := 50
for i := 0; i < nloops; i++ {
ts, err := fn.ChainHead(ctx)
if err != nil {
t.Fatal(err)
}
if ts.Height() == epoch {
break
}
if i == nloops-1 {
t.Fatal("block never managed to sync to node")
}
time.Sleep(time.Millisecond * 10)
}
if cb != nil {
cb(epoch)
}
return
}
t.Log("did not mine block, trying again", i)
}
t.Fatal("failed to mine 1000 times in a row...")
}
File diff suppressed because it is too large Load Diff
+79
View File
@@ -5,6 +5,9 @@ import (
"fmt"
"time"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/lotus/chain/types"
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
@@ -116,3 +119,79 @@ type ConnMgrInfo struct {
Tags map[string]int
Conns map[string]time.Time
}
type NodeStatus struct {
SyncStatus NodeSyncStatus
PeerStatus NodePeerStatus
ChainStatus NodeChainStatus
}
type NodeSyncStatus struct {
Epoch uint64
Behind uint64
}
type NodePeerStatus struct {
PeersToPublishMsgs int
PeersToPublishBlocks int
}
type NodeChainStatus struct {
BlocksPerTipsetLast100 float64
BlocksPerTipsetLastFinality float64
}
type CheckStatusCode int
//go:generate go run golang.org/x/tools/cmd/stringer -type=CheckStatusCode -trimprefix=CheckStatus
const (
_ CheckStatusCode = iota
// Message Checks
CheckStatusMessageSerialize
CheckStatusMessageSize
CheckStatusMessageValidity
CheckStatusMessageMinGas
CheckStatusMessageMinBaseFee
CheckStatusMessageBaseFee
CheckStatusMessageBaseFeeLowerBound
CheckStatusMessageBaseFeeUpperBound
CheckStatusMessageGetStateNonce
CheckStatusMessageNonce
CheckStatusMessageGetStateBalance
CheckStatusMessageBalance
)
type CheckStatus struct {
Code CheckStatusCode
OK bool
Err string
Hint map[string]interface{}
}
type MessageCheckStatus struct {
Cid cid.Cid
CheckStatus
}
type MessagePrototype struct {
Message types.Message
ValidNonce bool
}
type RetrievalInfo struct {
PayloadCID cid.Cid
ID retrievalmarket.DealID
PieceCID *cid.Cid
PricePerByte abi.TokenAmount
UnsealPrice abi.TokenAmount
Status retrievalmarket.DealStatus
Message string // more information about deal state, particularly errors
Provider peer.ID
BytesReceived uint64
BytesPaidFor uint64
TotalPaid abi.TokenAmount
TransferChannelID *datatransfer.ChannelID
DataTransfer *DataTransferChannel
}
+13 -3
View File
@@ -8,10 +8,10 @@ import (
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-multistore"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/dline"
"github.com/filecoin-project/lotus/node/repo/importmgr"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
@@ -46,6 +46,7 @@ import (
// FullNode API is a low-level interface to the Filecoin network full node
type FullNode interface {
Common
Net
// MethodGroup: Chain
// The Chain method group contains methods for interacting with the
@@ -92,6 +93,9 @@ type FullNode interface {
// specified block.
ChainGetParentMessages(ctx context.Context, blockCid cid.Cid) ([]api.Message, error) //perm:read
// ChainGetMessagesInTipset returns message stores in current tipset
ChainGetMessagesInTipset(ctx context.Context, tsk types.TipSetKey) ([]api.Message, error) //perm:read
// ChainGetTipSetByHeight looks back for a tipset at the specified epoch.
// If there are no blocks at the specified epoch, a tipset at an earlier epoch
// will be returned.
@@ -301,9 +305,11 @@ type FullNode interface {
// ClientImport imports file under the specified path into filestore.
ClientImport(ctx context.Context, ref api.FileRef) (*api.ImportRes, error) //perm:admin
// ClientRemoveImport removes file import
ClientRemoveImport(ctx context.Context, importID multistore.StoreID) error //perm:admin
ClientRemoveImport(ctx context.Context, importID importmgr.ImportID) error //perm:admin
// ClientStartDeal proposes a deal with a miner.
ClientStartDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) //perm:admin
// ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking.
ClientStatelessDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) //perm:write
// ClientGetDealInfo returns the latest information about a given deal.
ClientGetDealInfo(context.Context, cid.Cid) (*api.DealInfo, error) //perm:read
// ClientListDeals returns information about the deals made by the local client.
@@ -324,6 +330,10 @@ type FullNode interface {
// of status updates.
ClientRetrieveWithEvents(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
// ClientQueryAsk returns a signed StorageAsk from the specified miner.
// ClientListRetrievals returns information about retrievals made by the local client
ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) //perm:write
// ClientGetRetrievalUpdates returns status of updated retrieval deals
ClientGetRetrievalUpdates(ctx context.Context) (<-chan api.RetrievalInfo, error) //perm:write
ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) //perm:read
// ClientCalcCommP calculates the CommP and data size of the specified CID
ClientDealPieceCID(ctx context.Context, root cid.Cid) (api.DataCIDSize, error) //perm:read
@@ -623,7 +633,7 @@ type FullNode interface {
// proposal. This method of approval can be used to ensure you only approve
// exactly the transaction you think you are.
// It takes the following params: <multisig address>, <proposed message ID>, <proposer address>, <recipient address>, <value to transfer>,
// <sender address of the approve msg>, <method to call in the proposed message>, <params to include in the proposed message>
// <sender address of the approve msg>, <method to call in the approved message>, <params to include in the proposed message>
MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
// MsigCancel cancels a previously-proposed multisig message
+1
View File
@@ -63,6 +63,7 @@ type Gateway interface {
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error)
WalletBalance(context.Context, address.Address) (types.BigInt, error)
Version(context.Context) (api.APIVersion, error)
}
var _ Gateway = *new(FullNode)
+7
View File
@@ -5,8 +5,15 @@ import (
)
type Common = api.Common
type Net = api.Net
type CommonNet = api.CommonNet
type CommonStruct = api.CommonStruct
type CommonStub = api.CommonStub
type NetStruct = api.NetStruct
type NetStub = api.NetStub
type CommonNetStruct = api.CommonNetStruct
type CommonNetStub = api.CommonNetStub
type StorageMiner = api.StorageMiner
type StorageMinerStruct = api.StorageMinerStruct
+887 -207
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+127
View File
@@ -3,7 +3,9 @@ package v0api
import (
"context"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/chain/types"
"golang.org/x/xerrors"
"github.com/ipfs/go-cid"
@@ -57,4 +59,129 @@ func (w *WrapperV1Full) Version(ctx context.Context) (api.APIVersion, error) {
return ver, nil
}
func (w *WrapperV1Full) executePrototype(ctx context.Context, p *api.MessagePrototype) (cid.Cid, error) {
sm, err := w.FullNode.MpoolPushMessage(ctx, &p.Message, nil)
if err != nil {
return cid.Undef, xerrors.Errorf("pushing message: %w", err)
}
return sm.Cid(), nil
}
func (w *WrapperV1Full) MsigCreate(ctx context.Context, req uint64, addrs []address.Address, duration abi.ChainEpoch, val types.BigInt, src address.Address, gp types.BigInt) (cid.Cid, error) {
p, err := w.FullNode.MsigCreate(ctx, req, addrs, duration, val, src, gp)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigPropose(ctx context.Context, msig address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
p, err := w.FullNode.MsigPropose(ctx, msig, to, amt, src, method, params)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigApprove(ctx context.Context, msig address.Address, txID uint64, src address.Address) (cid.Cid, error) {
p, err := w.FullNode.MsigApprove(ctx, msig, txID, src)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigApproveTxnHash(ctx context.Context, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
p, err := w.FullNode.MsigApproveTxnHash(ctx, msig, txID, proposer, to, amt, src, method, params)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
p, err := w.FullNode.MsigCancel(ctx, msig, txID, to, amt, src, method, params)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigAddPropose(ctx context.Context, msig address.Address, src address.Address, newAdd address.Address, inc bool) (cid.Cid, error) {
p, err := w.FullNode.MsigAddPropose(ctx, msig, src, newAdd, inc)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigAddApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, newAdd address.Address, inc bool) (cid.Cid, error) {
p, err := w.FullNode.MsigAddApprove(ctx, msig, src, txID, proposer, newAdd, inc)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigAddCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, newAdd address.Address, inc bool) (cid.Cid, error) {
p, err := w.FullNode.MsigAddCancel(ctx, msig, src, txID, newAdd, inc)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigSwapPropose(ctx context.Context, msig address.Address, src address.Address, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) {
p, err := w.FullNode.MsigSwapPropose(ctx, msig, src, oldAdd, newAdd)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigSwapApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) {
p, err := w.FullNode.MsigSwapApprove(ctx, msig, src, txID, proposer, oldAdd, newAdd)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigSwapCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) {
p, err := w.FullNode.MsigSwapCancel(ctx, msig, src, txID, oldAdd, newAdd)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
func (w *WrapperV1Full) MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) {
p, err := w.FullNode.MsigRemoveSigner(ctx, msig, proposer, toRemove, decrease)
if err != nil {
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
}
return w.executePrototype(ctx, p)
}
var _ FullNode = &WrapperV1Full{}
+4 -4
View File
@@ -54,11 +54,11 @@ func VersionForType(nodeType NodeType) (Version, error) {
// semver versions of the rpc api exposed
var (
FullAPIVersion0 = newVer(1, 3, 0)
FullAPIVersion1 = newVer(2, 1, 0)
FullAPIVersion0 = newVer(1, 3, 1)
FullAPIVersion1 = newVer(2, 1, 1)
MinerAPIVersion0 = newVer(1, 0, 1)
WorkerAPIVersion0 = newVer(1, 0, 0)
MinerAPIVersion0 = newVer(1, 2, 0)
WorkerAPIVersion0 = newVer(1, 1, 0)
)
//nolint:varcheck,deadcode
+21
View File
@@ -26,6 +26,27 @@ func Wrap(proxyT, wrapperT, impl interface{}) interface{} {
}))
}
for i := 0; i < proxy.Elem().NumField(); i++ {
if proxy.Elem().Type().Field(i).Name == "Internal" {
continue
}
subProxy := proxy.Elem().Field(i).FieldByName("Internal")
for i := 0; i < ri.NumMethod(); i++ {
mt := ri.Type().Method(i)
if subProxy.FieldByName(mt.Name).Kind() == reflect.Invalid {
continue
}
fn := ri.Method(i)
of := subProxy.FieldByName(mt.Name)
subProxy.FieldByName(mt.Name).Set(reflect.MakeFunc(of.Type(), func(args []reflect.Value) (results []reflect.Value) {
return fn.Call(args)
}))
}
}
wp := reflect.New(reflect.TypeOf(wrapperT).Elem())
wp.Elem().Field(0).Set(proxy)
return wp.Interface()
+531 -71
View File
@@ -4,11 +4,15 @@ import (
"context"
"fmt"
"io"
"os"
"path/filepath"
"runtime"
"sync/atomic"
"sync"
"time"
"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/pb"
"github.com/multiformats/go-base32"
"go.uber.org/zap"
@@ -72,23 +76,45 @@ func (b *badgerLogger) Warningf(format string, args ...interface{}) {
b.skip2.Warnf(format, args...)
}
// bsState is the current blockstore state
type bsState int
const (
stateOpen int64 = iota
// stateOpen signifies an open blockstore
stateOpen bsState = iota
// stateClosing signifies a blockstore that is currently closing
stateClosing
// stateClosed signifies a blockstore that has been colosed
stateClosed
)
// Blockstore is a badger-backed IPLD blockstore.
//
// NOTE: once Close() is called, methods will try their best to return
// ErrBlockstoreClosed. This will guaranteed to happen for all subsequent
// operation calls after Close() has returned, but it may not happen for
// operations in progress. Those are likely to fail with a different error.
type Blockstore struct {
// state is accessed atomically
state int64
type bsMoveState int
DB *badger.DB
const (
// moveStateNone signifies that there is no move in progress
moveStateNone bsMoveState = iota
// moveStateMoving signifies that there is a move in a progress
moveStateMoving
// moveStateCleanup signifies that a move has completed or aborted and we are cleaning up
moveStateCleanup
// moveStateLock signifies that an exclusive lock has been acquired
moveStateLock
)
// Blockstore is a badger-backed IPLD blockstore.
type Blockstore struct {
stateLk sync.RWMutex
state bsState
viewers sync.WaitGroup
moveMx sync.Mutex
moveCond sync.Cond
moveState bsMoveState
rlock int
db *badger.DB
dbNext *badger.DB // when moving
opts Options
prefixing bool
prefix []byte
@@ -97,6 +123,9 @@ type Blockstore struct {
var _ blockstore.Blockstore = (*Blockstore)(nil)
var _ blockstore.Viewer = (*Blockstore)(nil)
var _ blockstore.BlockstoreIterator = (*Blockstore)(nil)
var _ blockstore.BlockstoreGC = (*Blockstore)(nil)
var _ blockstore.BlockstoreSize = (*Blockstore)(nil)
var _ io.Closer = (*Blockstore)(nil)
// Open creates a new badger-backed blockstore, with the supplied options.
@@ -111,73 +140,377 @@ func Open(opts Options) (*Blockstore, error) {
return nil, fmt.Errorf("failed to open badger blockstore: %w", err)
}
bs := &Blockstore{DB: db}
bs := &Blockstore{db: db, opts: opts}
if p := opts.Prefix; p != "" {
bs.prefixing = true
bs.prefix = []byte(p)
bs.prefixLen = len(bs.prefix)
}
bs.moveCond.L = &bs.moveMx
return bs, nil
}
// Close closes the store. If the store has already been closed, this noops and
// returns an error, even if the first closure resulted in error.
func (b *Blockstore) Close() error {
if !atomic.CompareAndSwapInt64(&b.state, stateOpen, stateClosing) {
b.stateLk.Lock()
if b.state != stateOpen {
b.stateLk.Unlock()
return nil
}
b.state = stateClosing
b.stateLk.Unlock()
defer atomic.StoreInt64(&b.state, stateClosed)
return b.DB.Close()
defer func() {
b.stateLk.Lock()
b.state = stateClosed
b.stateLk.Unlock()
}()
// wait for all accesses to complete
b.viewers.Wait()
return b.db.Close()
}
// CollectGarbage runs garbage collection on the value log
func (b *Blockstore) CollectGarbage() error {
if atomic.LoadInt64(&b.state) != stateOpen {
func (b *Blockstore) access() error {
b.stateLk.RLock()
defer b.stateLk.RUnlock()
if b.state != stateOpen {
return ErrBlockstoreClosed
}
var err error
b.viewers.Add(1)
return nil
}
func (b *Blockstore) isOpen() bool {
b.stateLk.RLock()
defer b.stateLk.RUnlock()
return b.state == stateOpen
}
// lockDB/unlockDB implement a recursive lock contingent on move state
func (b *Blockstore) lockDB() {
b.moveMx.Lock()
defer b.moveMx.Unlock()
if b.rlock == 0 {
for b.moveState == moveStateLock {
b.moveCond.Wait()
}
}
b.rlock++
}
func (b *Blockstore) unlockDB() {
b.moveMx.Lock()
defer b.moveMx.Unlock()
b.rlock--
if b.rlock == 0 && b.moveState == moveStateLock {
b.moveCond.Broadcast()
}
}
// lockMove/unlockMove implement an exclusive lock of move state
func (b *Blockstore) lockMove() {
b.moveMx.Lock()
b.moveState = moveStateLock
for b.rlock > 0 {
b.moveCond.Wait()
}
}
func (b *Blockstore) unlockMove(state bsMoveState) {
b.moveState = state
b.moveCond.Broadcast()
b.moveMx.Unlock()
}
// movingGC moves the blockstore to a new path, adjacent to the current path, and creates
// a symlink from the current path to the new path; the old blockstore is deleted.
//
// The blockstore MUST accept new writes during the move and ensure that these
// are persisted to the new blockstore; if a failure occurs aboring the move,
// then they must be peristed to the old blockstore.
// In short, the blockstore must not lose data from new writes during the move.
func (b *Blockstore) movingGC() error {
// this inlines moveLock/moveUnlock for the initial state check to prevent a second move
// while one is in progress without clobbering state
b.moveMx.Lock()
if b.moveState != moveStateNone {
b.moveMx.Unlock()
return fmt.Errorf("move in progress")
}
b.moveState = moveStateLock
for b.rlock > 0 {
b.moveCond.Wait()
}
b.moveState = moveStateMoving
b.moveCond.Broadcast()
b.moveMx.Unlock()
var path string
defer func() {
b.lockMove()
db2 := b.dbNext
b.dbNext = nil
var state bsMoveState
if db2 != nil {
state = moveStateCleanup
} else {
state = moveStateNone
}
b.unlockMove(state)
if db2 != nil {
err := db2.Close()
if err != nil {
log.Warnf("error closing badger db: %s", err)
}
b.deleteDB(path)
b.lockMove()
b.unlockMove(moveStateNone)
}
}()
// we resolve symlinks to create the new path in the adjacent to the old path.
// this allows the user to symlink the db directory into a separate filesystem.
basePath := b.opts.Dir
linkPath, err := filepath.EvalSymlinks(basePath)
if err != nil {
return fmt.Errorf("error resolving symlink %s: %w", basePath, err)
}
if basePath == linkPath {
path = basePath
} else {
name := filepath.Base(basePath)
dir := filepath.Dir(linkPath)
path = filepath.Join(dir, name)
}
path = fmt.Sprintf("%s.%d", path, time.Now().UnixNano())
log.Infof("moving blockstore from %s to %s", b.opts.Dir, path)
opts := b.opts
opts.Dir = path
opts.ValueDir = path
db2, err := badger.Open(opts.Options)
if err != nil {
return fmt.Errorf("failed to open badger blockstore in %s: %w", path, err)
}
b.lockMove()
b.dbNext = db2
b.unlockMove(moveStateMoving)
log.Info("copying blockstore")
err = b.doCopy(b.db, b.dbNext)
if err != nil {
return fmt.Errorf("error moving badger blockstore to %s: %w", path, err)
}
b.lockMove()
db1 := b.db
b.db = b.dbNext
b.dbNext = nil
b.unlockMove(moveStateCleanup)
err = db1.Close()
if err != nil {
log.Warnf("error closing old badger db: %s", err)
}
dbpath := b.opts.Dir
oldpath := fmt.Sprintf("%s.old.%d", dbpath, time.Now().Unix())
if err = os.Rename(dbpath, oldpath); err != nil {
// this is not catastrophic in the sense that we have not lost any data.
// but it is pretty bad, as the db path points to the old db, while we are now using to the new
// db; we can't continue and leave a ticking bomb for the next restart.
// so a panic is appropriate and user can fix.
panic(fmt.Errorf("error renaming old badger db dir from %s to %s: %w; USER ACTION REQUIRED", dbpath, oldpath, err)) //nolint
}
if err = os.Symlink(path, dbpath); err != nil {
// same here; the db path is pointing to the void. panic and let the user fix.
panic(fmt.Errorf("error symlinking new badger db dir from %s to %s: %w; USER ACTION REQUIRED", path, dbpath, err)) //nolint
}
b.deleteDB(oldpath)
log.Info("moving blockstore done")
return nil
}
// doCopy copies a badger blockstore to another, with an optional filter; if the filter
// is not nil, then only cids that satisfy the filter will be copied.
func (b *Blockstore) doCopy(from, to *badger.DB) error {
workers := runtime.NumCPU() / 2
if workers < 2 {
workers = 2
}
stream := from.NewStream()
stream.NumGo = workers
stream.LogPrefix = "doCopy"
stream.Send = func(list *pb.KVList) error {
batch := to.NewWriteBatch()
defer batch.Cancel()
for _, kv := range list.Kv {
if kv.Key == nil || kv.Value == nil {
continue
}
if err := batch.Set(kv.Key, kv.Value); err != nil {
return err
}
}
return batch.Flush()
}
return stream.Orchestrate(context.Background())
}
func (b *Blockstore) deleteDB(path string) {
// follow symbolic links, otherwise the data wil be left behind
lpath, err := filepath.EvalSymlinks(path)
if err != nil {
log.Warnf("error resolving symlinks in %s", path)
return
}
log.Infof("removing data directory %s", lpath)
if err := os.RemoveAll(lpath); err != nil {
log.Warnf("error deleting db at %s: %s", lpath, err)
return
}
if path != lpath {
log.Infof("removing link %s", path)
if err := os.Remove(path); err != nil {
log.Warnf("error removing symbolic link %s", err)
}
}
}
func (b *Blockstore) onlineGC() error {
b.lockDB()
defer b.unlockDB()
// compact first to gather the necessary statistics for GC
nworkers := runtime.NumCPU() / 2
if nworkers < 2 {
nworkers = 2
}
err := b.db.Flatten(nworkers)
if err != nil {
return err
}
for err == nil {
err = b.DB.RunValueLogGC(0.125)
err = b.db.RunValueLogGC(0.125)
}
if err == badger.ErrNoRewrite {
// not really an error in this case
// not really an error in this case, it signals the end of GC
return nil
}
return err
}
// Compact runs a synchronous compaction
func (b *Blockstore) Compact() error {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
// CollectGarbage compacts and runs garbage collection on the value log;
// implements the BlockstoreGC trait
func (b *Blockstore) CollectGarbage(opts ...blockstore.BlockstoreGCOption) error {
if err := b.access(); err != nil {
return err
}
defer b.viewers.Done()
var options blockstore.BlockstoreGCOptions
for _, opt := range opts {
err := opt(&options)
if err != nil {
return err
}
}
nworkers := runtime.NumCPU() / 2
if nworkers < 2 {
nworkers = 2
if options.FullGC {
return b.movingGC()
}
return b.DB.Flatten(nworkers)
return b.onlineGC()
}
// Size returns the aggregate size of the blockstore
func (b *Blockstore) Size() (int64, error) {
if err := b.access(); err != nil {
return 0, err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
lsm, vlog := b.db.Size()
size := lsm + vlog
if size == 0 {
// badger reports a 0 size on symlinked directories... sigh
dir := b.opts.Dir
entries, err := os.ReadDir(dir)
if err != nil {
return 0, err
}
for _, e := range entries {
path := filepath.Join(dir, e.Name())
finfo, err := os.Stat(path)
if err != nil {
return 0, err
}
size += finfo.Size()
}
}
return size, nil
}
// 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 {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
if err := b.access(); err != nil {
return err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
k, pooled := b.PooledStorageKey(cid)
if pooled {
defer KeyPool.Put(k)
}
return b.DB.View(func(txn *badger.Txn) error {
return b.db.View(func(txn *badger.Txn) error {
switch item, err := txn.Get(k); err {
case nil:
return item.Value(fn)
@@ -191,16 +524,20 @@ 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) {
if atomic.LoadInt64(&b.state) != stateOpen {
return false, ErrBlockstoreClosed
if err := b.access(); err != nil {
return false, err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
k, pooled := b.PooledStorageKey(cid)
if pooled {
defer KeyPool.Put(k)
}
err := b.DB.View(func(txn *badger.Txn) error {
err := b.db.View(func(txn *badger.Txn) error {
_, err := txn.Get(k)
return err
})
@@ -221,9 +558,13 @@ func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error) {
return nil, blockstore.ErrNotFound
}
if atomic.LoadInt64(&b.state) != stateOpen {
return nil, ErrBlockstoreClosed
if err := b.access(); err != nil {
return nil, err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
k, pooled := b.PooledStorageKey(cid)
if pooled {
@@ -231,7 +572,7 @@ func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error) {
}
var val []byte
err := b.DB.View(func(txn *badger.Txn) error {
err := b.db.View(func(txn *badger.Txn) error {
switch item, err := txn.Get(k); err {
case nil:
val, err = item.ValueCopy(nil)
@@ -250,9 +591,13 @@ func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error) {
// GetSize implements Blockstore.GetSize.
func (b *Blockstore) GetSize(cid cid.Cid) (int, error) {
if atomic.LoadInt64(&b.state) != stateOpen {
return -1, ErrBlockstoreClosed
if err := b.access(); err != nil {
return 0, err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
k, pooled := b.PooledStorageKey(cid)
if pooled {
@@ -260,7 +605,7 @@ func (b *Blockstore) GetSize(cid cid.Cid) (int, error) {
}
var size int
err := b.DB.View(func(txn *badger.Txn) error {
err := b.db.View(func(txn *badger.Txn) error {
switch item, err := txn.Get(k); err {
case nil:
size = int(item.ValueSize())
@@ -279,29 +624,52 @@ func (b *Blockstore) GetSize(cid cid.Cid) (int, error) {
// Put implements Blockstore.Put.
func (b *Blockstore) Put(block blocks.Block) error {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
if err := b.access(); err != nil {
return err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
k, pooled := b.PooledStorageKey(block.Cid())
if pooled {
defer KeyPool.Put(k)
}
err := b.DB.Update(func(txn *badger.Txn) error {
return txn.Set(k, block.RawData())
})
if err != nil {
err = fmt.Errorf("failed to put block in badger blockstore: %w", err)
put := func(db *badger.DB) error {
err := db.Update(func(txn *badger.Txn) error {
return txn.Set(k, block.RawData())
})
if err != nil {
return fmt.Errorf("failed to put block in badger blockstore: %w", err)
}
return nil
}
return err
if err := put(b.db); err != nil {
return err
}
if b.dbNext != nil {
if err := put(b.dbNext); err != nil {
return err
}
}
return nil
}
// PutMany implements Blockstore.PutMany.
func (b *Blockstore) PutMany(blocks []blocks.Block) error {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
if err := b.access(); err != nil {
return err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
// toReturn tracks the byte slices to return to the pool, if we're using key
// prefixing. we can't return each slice to the pool after each Set, because
@@ -316,46 +684,75 @@ func (b *Blockstore) PutMany(blocks []blocks.Block) error {
}()
}
batch := b.DB.NewWriteBatch()
defer batch.Cancel()
keys := make([][]byte, 0, len(blocks))
for _, block := range blocks {
k, pooled := b.PooledStorageKey(block.Cid())
if pooled {
toReturn = append(toReturn, k)
}
if err := batch.Set(k, block.RawData()); err != nil {
keys = append(keys, k)
}
put := func(db *badger.DB) error {
batch := db.NewWriteBatch()
defer batch.Cancel()
for i, block := range blocks {
k := keys[i]
if err := batch.Set(k, block.RawData()); err != nil {
return err
}
}
err := batch.Flush()
if err != nil {
return fmt.Errorf("failed to put blocks in badger blockstore: %w", err)
}
return nil
}
if err := put(b.db); err != nil {
return err
}
if b.dbNext != nil {
if err := put(b.dbNext); err != nil {
return err
}
}
err := batch.Flush()
if err != nil {
err = fmt.Errorf("failed to put blocks in badger blockstore: %w", err)
}
return err
return nil
}
// DeleteBlock implements Blockstore.DeleteBlock.
func (b *Blockstore) DeleteBlock(cid cid.Cid) error {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
if err := b.access(); err != nil {
return err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
k, pooled := b.PooledStorageKey(cid)
if pooled {
defer KeyPool.Put(k)
}
return b.DB.Update(func(txn *badger.Txn) error {
return b.db.Update(func(txn *badger.Txn) error {
return txn.Delete(k)
})
}
func (b *Blockstore) DeleteMany(cids []cid.Cid) error {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
if err := b.access(); err != nil {
return err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
// toReturn tracks the byte slices to return to the pool, if we're using key
// prefixing. we can't return each slice to the pool after each Set, because
@@ -370,7 +767,7 @@ func (b *Blockstore) DeleteMany(cids []cid.Cid) error {
}()
}
batch := b.DB.NewWriteBatch()
batch := b.db.NewWriteBatch()
defer batch.Cancel()
for _, cid := range cids {
@@ -392,11 +789,14 @@ func (b *Blockstore) DeleteMany(cids []cid.Cid) error {
// AllKeysChan implements Blockstore.AllKeysChan.
func (b *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
if atomic.LoadInt64(&b.state) != stateOpen {
return nil, ErrBlockstoreClosed
if err := b.access(); err != nil {
return nil, err
}
txn := b.DB.NewTransaction(false)
b.lockDB()
defer b.unlockDB()
txn := b.db.NewTransaction(false)
opts := badger.IteratorOptions{PrefetchSize: 100}
if b.prefixing {
opts.Prefix = b.prefix
@@ -405,6 +805,7 @@ func (b *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
ch := make(chan cid.Cid)
go func() {
defer b.viewers.Done()
defer close(ch)
defer iter.Close()
@@ -415,7 +816,7 @@ func (b *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
if ctx.Err() != nil {
return // context has fired.
}
if atomic.LoadInt64(&b.state) != stateOpen {
if !b.isOpen() {
// open iterators will run even after the database is closed...
return // closing, yield.
}
@@ -442,6 +843,59 @@ func (b *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
return ch, nil
}
// Implementation of BlockstoreIterator interface
func (b *Blockstore) ForEachKey(f func(cid.Cid) error) error {
if err := b.access(); err != nil {
return err
}
defer b.viewers.Done()
b.lockDB()
defer b.unlockDB()
txn := b.db.NewTransaction(false)
defer txn.Discard()
opts := badger.IteratorOptions{PrefetchSize: 100}
if b.prefixing {
opts.Prefix = b.prefix
}
iter := txn.NewIterator(opts)
defer iter.Close()
var buf []byte
for iter.Rewind(); iter.Valid(); iter.Next() {
if !b.isOpen() {
return ErrBlockstoreClosed
}
k := iter.Item().Key()
if b.prefixing {
k = k[b.prefixLen:]
}
klen := base32.RawStdEncoding.DecodedLen(len(k))
if klen > len(buf) {
buf = make([]byte, klen)
}
n, err := base32.RawStdEncoding.Decode(buf, k)
if err != nil {
return err
}
c := cid.NewCidV1(cid.Raw, buf[:n])
err = f(c)
if err != nil {
return err
}
}
return nil
}
// HashOnRead implements Blockstore.HashOnRead. It is not supported by this
// blockstore.
func (b *Blockstore) HashOnRead(_ bool) {
@@ -494,3 +948,9 @@ func (b *Blockstore) StorageKey(dst []byte, cid cid.Cid) []byte {
}
return dst[:reqsize]
}
// this method is added for lotus-shed needs
// WARNING: THIS IS COMPLETELY UNSAFE; DONT USE THIS IN PRODUCTION CODE
func (b *Blockstore) DB() *badger.DB {
return b.db
}
+170 -1
View File
@@ -1,12 +1,19 @@
package badgerbs
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
blocks "github.com/ipfs/go-block-format"
"github.com/stretchr/testify/require"
"golang.org/x/sync/errgroup"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
"github.com/filecoin-project/lotus/blockstore"
)
@@ -89,3 +96,165 @@ func openBlockstore(optsSupplier func(path string) Options) func(tb testing.TB,
return Open(optsSupplier(path))
}
}
func testMove(t *testing.T, optsF func(string) Options) {
basePath, err := ioutil.TempDir("", "")
if err != nil {
t.Fatal(err)
}
dbPath := filepath.Join(basePath, "db")
t.Cleanup(func() {
_ = os.RemoveAll(basePath)
})
db, err := Open(optsF(dbPath))
if err != nil {
t.Fatal(err)
}
defer db.Close() //nolint
var have []blocks.Block
var deleted []cid.Cid
// add some blocks
for i := 0; i < 10; i++ {
blk := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
err := db.Put(blk)
if err != nil {
t.Fatal(err)
}
have = append(have, blk)
}
// delete some of them
for i := 5; i < 10; i++ {
c := have[i].Cid()
err := db.DeleteBlock(c)
if err != nil {
t.Fatal(err)
}
deleted = append(deleted, c)
}
have = have[:5]
// start a move concurrent with some more puts
g := new(errgroup.Group)
g.Go(func() error {
for i := 10; i < 1000; i++ {
blk := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
err := db.Put(blk)
if err != nil {
return err
}
have = append(have, blk)
}
return nil
})
g.Go(func() error {
return db.CollectGarbage(blockstore.WithFullGC(true))
})
err = g.Wait()
if err != nil {
t.Fatal(err)
}
// 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())
if err != nil {
t.Fatal(err)
}
if !has {
t.Fatal("missing block")
}
blk2, err := db.Get(blk.Cid())
if err != nil {
t.Fatal(err)
}
if !bytes.Equal(blk.RawData(), blk2.RawData()) {
t.Fatal("data mismatch")
}
}
for _, c := range deleted {
has, err := db.Has(c)
if err != nil {
t.Fatal(err)
}
if has {
t.Fatal("resurrected block")
}
}
}
checkBlocks()
// check the basePath -- it should contain a directory with name db.{timestamp}, soft-linked
// to db and nothing else
checkPath := func() {
entries, err := os.ReadDir(basePath)
if err != nil {
t.Fatal(err)
}
if len(entries) != 2 {
t.Fatalf("too many entries; expected %d but got %d", 2, len(entries))
}
var haveDB, haveDBLink bool
for _, e := range entries {
if e.Name() == "db" {
if (e.Type() & os.ModeSymlink) == 0 {
t.Fatal("found db, but it's not a symlink")
}
haveDBLink = true
continue
}
if strings.HasPrefix(e.Name(), "db.") {
if !e.Type().IsDir() {
t.Fatal("found db prefix, but it's not a directory")
}
haveDB = true
continue
}
}
if !haveDB {
t.Fatal("db directory is missing")
}
if !haveDBLink {
t.Fatal("db link is missing")
}
}
checkPath()
// now do another FullGC to test the double move and following of symlinks
if err := db.CollectGarbage(blockstore.WithFullGC(true)); err != nil {
t.Fatal(err)
}
checkBlocks()
checkPath()
}
func TestMoveNoPrefix(t *testing.T) {
testMove(t, DefaultOptions)
}
func TestMoveWithPrefix(t *testing.T) {
testMove(t, func(path string) Options {
opts := DefaultOptions(path)
opts.Prefix = "/prefixed/"
return opts
})
}
+30
View File
@@ -30,6 +30,36 @@ type BatchDeleter interface {
DeleteMany(cids []cid.Cid) error
}
// BlockstoreIterator is a trait for efficient iteration
type BlockstoreIterator interface {
ForEachKey(func(cid.Cid) error) error
}
// BlockstoreGC is a trait for blockstores that support online garbage collection
type BlockstoreGC interface {
CollectGarbage(options ...BlockstoreGCOption) error
}
// BlockstoreGCOption is a functional interface for controlling blockstore GC options
type BlockstoreGCOption = func(*BlockstoreGCOptions) error
// BlockstoreGCOptions is a struct with GC options
type BlockstoreGCOptions struct {
FullGC bool
}
func WithFullGC(fullgc bool) BlockstoreGCOption {
return func(opts *BlockstoreGCOptions) error {
opts.FullGC = fullgc
return nil
}
}
// BlockstoreSize is a trait for on-disk blockstores that can report their size
type BlockstoreSize interface {
Size() (int64, error)
}
// WrapIDStore wraps the underlying blockstore in an "identity" blockstore.
// The ID store filters out all puts for blocks with CIDs using the "identity"
// hash function. It also extracts inlined blocks from CIDs using the identity
+66
View File
@@ -0,0 +1,66 @@
package blockstore
import (
"context"
"io"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
)
var _ Blockstore = (*discardstore)(nil)
type discardstore struct {
bs Blockstore
}
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) 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) GetSize(cid cid.Cid) (int, error) {
return b.bs.GetSize(cid)
}
func (b *discardstore) View(cid cid.Cid, f func([]byte) error) error {
return b.bs.View(cid, f)
}
func (b *discardstore) Put(blk blocks.Block) error {
return nil
}
func (b *discardstore) PutMany(blks []blocks.Block) error {
return nil
}
func (b *discardstore) DeleteBlock(cid cid.Cid) error {
return nil
}
func (b *discardstore) DeleteMany(cids []cid.Cid) error {
return nil
}
func (b *discardstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
return b.bs.AllKeysChan(ctx)
}
func (b *discardstore) Close() error {
if c, ok := b.bs.(io.Closer); ok {
return c.Close()
}
return nil
}
+124
View File
@@ -0,0 +1,124 @@
# SplitStore: An actively scalable blockstore for the Filecoin chain
The SplitStore was first introduced in lotus v1.5.1, as an experiment
in reducing the performance impact of large blockstores.
With lotus v1.11.1, we introduce the next iteration in design and
implementation, which we call SplitStore v1.
The new design (see [#6474](https://github.com/filecoin-project/lotus/pull/6474)
evolves the splitstore to be a freestanding compacting blockstore that
allows us to keep a small (60-100GB) working set in a hot blockstore
and reliably archive out of scope objects in a coldstore. The
coldstore can also be a discard store, whereby out of scope objects
are discarded or a regular badger blockstore (the default), which can
be periodically garbage collected according to configurable user
retention policies.
To enable the splitstore, edit `.lotus/config.toml` and add the following:
```
[Chainstore]
EnableSplitstore = true
```
If you intend to use the discard coldstore, your also need to add the following:
```
[Chainstore.Splitstore]
ColdStoreType = "discard"
```
In general you _should not_ have to use the discard store, unless you
are running a network assistive node (like a bootstrapper or booster)
or have very constrained hardware with not enough disk space to
maintain a coldstore, even with garbage collection. It is also appropriate
for small nodes that are simply watching the chain.
*Warning:* Using the discard store for a general purpose node is discouraged, unless
you really know what you are doing. Use it at your own risk.
## Configuration Options
These are options in the `[Chainstore.Splitstore]` section of the configuration:
- `HotStoreType` -- specifies the type of hotstore to use.
The only currently supported option is `"badger"`.
- `ColdStoreType` -- specifies the type of coldstore to use.
The default value is `"universal"`, which will use the initial monolith blockstore
as the coldstore.
The other possible value is `"discard"`, as outlined above, which is specialized for
running without a coldstore. Note that the discard store wraps the initial monolith
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.
- `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
nodes beyond 4 finalities, while running with the discard coldstore option.
It is also useful for miners who accept deals and need to lookback messages beyond
the 4 finalities, which would otherwise hit the coldstore.
- `HotStoreFullGCFrequency` -- specifies how frequenty to garbage collect the hotstore
using full (moving) GC.
The default value is 20, which uses full GC every 20 compactions (about once a week);
set to 0 to disable full GC altogether.
Rationale: badger supports online GC, and this is used by default. However it has proven to
be ineffective in practice with the hotstore size slowly creeping up. In order to address this,
we have added moving GC support in our badger wrapper, which can effectively reclaim all space.
The downside is that it takes a bit longer to perform a moving GC and you also need enough
space to house the new hotstore while the old one is still live.
## Operation
When the splitstore is first enabled, the existing blockstore becomes
the coldstore and a fresh hotstore is initialized.
The hotstore is warmed up on first startup so as to load all chain
headers and state roots in the current head. This allows us to
immediately gain the performance benefits of a smallerblockstore which
can be substantial for full archival nodes.
All new writes are directed to the hotstore, while reads first hit the
hotstore, with fallback to the coldstore.
Once 5 finalities have ellapsed, and every finality henceforth, the
blockstore _compacts_. Compaction is the process of moving all
unreachable objects within the last 4 finalities from the hotstore to
the coldstore. If the system is configured with a discard coldstore,
these objects are discarded. Note that chain headers, all the way to
genesis, are considered reachable. Stateroots and messages are
considered reachable only within the last 4 finalities, unless there
is a live reference to them.
## Compaction
Compaction works transactionally with the following algorithm:
- We prepare a transaction, whereby all i/o referenced objects through the API are tracked.
- We walk the chain and mark reachable objects, keeping 4 finalities of state roots and messages and all headers all the way to genesis.
- Once the chain walk is complete, we begin full transaction protection with concurrent marking; we walk and mark all references created during the chain walk. On the same time, all I/O through the API concurrently marks objects as live references.
- We collect cold objects by iterating through the hotstore and checking the mark set; if an object is not marked, then it is candidate for purge.
- When running with a coldstore, we next copy all cold objects to the coldstore.
- At this point we are ready to begin purging:
- We sort cold objects heaviest first, so as to never delete the consituents of a DAG before the DAG itself (which would leave dangling references)
- 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.
## Garbage Collection
TBD -- see [#6577](https://github.com/filecoin-project/lotus/issues/6577)
## Utilities
`lotus-shed` has a `splitstore` command which provides some utilities:
- `rollback` -- rolls back a splitstore installation.
This command copies the hotstore on top of the coldstore, and then deletes the splitstore
directory and associated metadata keys.
It can also optionally compact/gc the coldstore after the copy (with the `--gc-coldstore` flag)
and automatically rewrite the lotus config to disable splitstore (with the `--rewrite-config` flag).
Note: the node *must be stopped* before running this command.
- `check` -- asynchronously runs a basic healthcheck on the splitstore.
The results are appended to `<lotus-repo>/datastore/splitstore/check.txt`.
- `info` -- prints some basic information about the splitstore.
+273
View File
@@ -0,0 +1,273 @@
package splitstore
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"os"
"os/exec"
"path/filepath"
"runtime/debug"
"strings"
"sync"
"time"
"go.uber.org/multierr"
"golang.org/x/xerrors"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
)
type debugLog struct {
readLog, writeLog, deleteLog, stackLog *debugLogOp
stackMx sync.Mutex
stackMap map[string]string
}
type debugLogOp struct {
path string
mx sync.Mutex
log *os.File
count int
}
func openDebugLog(path string) (*debugLog, error) {
basePath := filepath.Join(path, "debug")
err := os.MkdirAll(basePath, 0755)
if err != nil {
return nil, err
}
readLog, err := openDebugLogOp(basePath, "read.log")
if err != nil {
return nil, err
}
writeLog, err := openDebugLogOp(basePath, "write.log")
if err != nil {
_ = readLog.Close()
return nil, err
}
deleteLog, err := openDebugLogOp(basePath, "delete.log")
if err != nil {
_ = readLog.Close()
_ = writeLog.Close()
return nil, err
}
stackLog, err := openDebugLogOp(basePath, "stack.log")
if err != nil {
_ = readLog.Close()
_ = writeLog.Close()
_ = deleteLog.Close()
return nil, xerrors.Errorf("error opening stack log: %w", err)
}
return &debugLog{
readLog: readLog,
writeLog: writeLog,
deleteLog: deleteLog,
stackLog: stackLog,
stackMap: make(map[string]string),
}, nil
}
func (d *debugLog) LogReadMiss(cid cid.Cid) {
if d == nil {
return
}
stack := d.getStack()
err := d.readLog.Log("%s %s %s\n", d.timestamp(), cid, stack)
if err != nil {
log.Warnf("error writing read log: %s", err)
}
}
func (d *debugLog) LogWrite(blk blocks.Block) {
if d == nil {
return
}
var stack string
if enableDebugLogWriteTraces {
stack = " " + d.getStack()
}
err := d.writeLog.Log("%s %s%s\n", d.timestamp(), blk.Cid(), stack)
if err != nil {
log.Warnf("error writing write log: %s", err)
}
}
func (d *debugLog) LogWriteMany(blks []blocks.Block) {
if d == nil {
return
}
var stack string
if enableDebugLogWriteTraces {
stack = " " + d.getStack()
}
now := d.timestamp()
for _, blk := range blks {
err := d.writeLog.Log("%s %s%s\n", now, blk.Cid(), stack)
if err != nil {
log.Warnf("error writing write log: %s", err)
break
}
}
}
func (d *debugLog) LogDelete(cids []cid.Cid) {
if d == nil {
return
}
now := d.timestamp()
for _, c := range cids {
err := d.deleteLog.Log("%s %s\n", now, c)
if err != nil {
log.Warnf("error writing delete log: %s", err)
break
}
}
}
func (d *debugLog) Flush() {
if d == nil {
return
}
// rotate non-empty logs
d.readLog.Rotate()
d.writeLog.Rotate()
d.deleteLog.Rotate()
d.stackLog.Rotate()
}
func (d *debugLog) Close() error {
if d == nil {
return nil
}
err1 := d.readLog.Close()
err2 := d.writeLog.Close()
err3 := d.deleteLog.Close()
err4 := d.stackLog.Close()
return multierr.Combine(err1, err2, err3, err4)
}
func (d *debugLog) getStack() string {
sk := d.getNormalizedStackTrace()
hash := sha256.Sum256([]byte(sk))
key := string(hash[:])
d.stackMx.Lock()
repr, ok := d.stackMap[key]
if !ok {
repr = hex.EncodeToString(hash[:])
d.stackMap[key] = repr
err := d.stackLog.Log("%s\n%s\n", repr, sk)
if err != nil {
log.Warnf("error writing stack trace for %s: %s", repr, err)
}
}
d.stackMx.Unlock()
return repr
}
func (d *debugLog) getNormalizedStackTrace() string {
sk := string(debug.Stack())
// Normalization for deduplication
// skip first line -- it's the goroutine
// for each line that ends in a ), remove the call args -- these are the registers
lines := strings.Split(sk, "\n")[1:]
for i, line := range lines {
if len(line) > 0 && line[len(line)-1] == ')' {
idx := strings.LastIndex(line, "(")
if idx < 0 {
continue
}
lines[i] = line[:idx]
}
}
return strings.Join(lines, "\n")
}
func (d *debugLog) timestamp() string {
ts, _ := time.Now().MarshalText()
return string(ts)
}
func openDebugLogOp(basePath, name string) (*debugLogOp, error) {
path := filepath.Join(basePath, name)
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
if err != nil {
return nil, xerrors.Errorf("error opening %s: %w", name, err)
}
return &debugLogOp{path: path, log: file}, nil
}
func (d *debugLogOp) Close() error {
d.mx.Lock()
defer d.mx.Unlock()
return d.log.Close()
}
func (d *debugLogOp) Log(template string, arg ...interface{}) error {
d.mx.Lock()
defer d.mx.Unlock()
d.count++
_, err := fmt.Fprintf(d.log, template, arg...)
return err
}
func (d *debugLogOp) Rotate() {
d.mx.Lock()
defer d.mx.Unlock()
if d.count == 0 {
return
}
err := d.log.Close()
if err != nil {
log.Warnf("error closing log (file: %s): %s", d.path, err)
return
}
arxivPath := fmt.Sprintf("%s-%d", d.path, time.Now().Unix())
err = os.Rename(d.path, arxivPath)
if err != nil {
log.Warnf("error moving log (file: %s): %s", d.path, err)
return
}
go func() {
cmd := exec.Command("gzip", arxivPath)
err := cmd.Run()
if err != nil {
log.Warnf("error compressing log (file: %s): %s", arxivPath, err)
}
}()
d.count = 0
d.log, err = os.OpenFile(d.path, os.O_WRONLY|os.O_CREATE, 0644)
if err != nil {
log.Warnf("error opening log (file: %s): %s", d.path, err)
return
}
}
+10 -8
View File
@@ -1,26 +1,26 @@
package splitstore
import (
"path/filepath"
"errors"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
)
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 (default).
// * If a probabilistic result is acceptable, it can be backed by a bloom filter
type MarkSet interface {
Mark(cid.Cid) error
Has(cid.Cid) (bool, error)
Close() error
SetConcurrent()
}
// markBytes is deliberately a non-nil empty byte slice for serialization.
var markBytes = []byte{}
type MarkSetEnv interface {
Create(name string, sizeHint int64) (MarkSet, error)
Close() error
@@ -28,10 +28,12 @@ type MarkSetEnv interface {
func OpenMarkSetEnv(path string, mtype string) (MarkSetEnv, error) {
switch mtype {
case "", "bloom":
case "bloom":
return NewBloomMarkSetEnv()
case "bolt":
return NewBoltMarkSetEnv(filepath.Join(path, "markset.bolt"))
case "map":
return NewMapMarkSetEnv()
case "badger":
return NewBadgerMarkSetEnv(path)
default:
return nil, xerrors.Errorf("unknown mark set type %s", mtype)
}
+230
View File
@@ -0,0 +1,230 @@
package splitstore
import (
"os"
"path/filepath"
"sync"
"golang.org/x/xerrors"
"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/options"
"go.uber.org/zap"
cid "github.com/ipfs/go-cid"
)
type BadgerMarkSetEnv struct {
path string
}
var _ MarkSetEnv = (*BadgerMarkSetEnv)(nil)
type BadgerMarkSet struct {
mx sync.RWMutex
cond sync.Cond
pend map[string]struct{}
writing map[int]map[string]struct{}
writers int
seqno int
db *badger.DB
path string
}
var _ MarkSet = (*BadgerMarkSet)(nil)
var badgerMarkSetBatchSize = 16384
func NewBadgerMarkSetEnv(path string) (MarkSetEnv, error) {
msPath := filepath.Join(path, "markset.badger")
err := os.MkdirAll(msPath, 0755) //nolint:gosec
if err != nil {
return nil, xerrors.Errorf("error creating markset directory: %w", err)
}
return &BadgerMarkSetEnv{path: msPath}, nil
}
func (e *BadgerMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) {
path := filepath.Join(e.path, name)
// 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)
}
opts := badger.DefaultOptions(path)
opts.SyncWrites = false
opts.CompactL0OnClose = false
opts.Compression = options.None
// Note: We use FileIO for loading modes to avoid memory thrashing and interference
// between the system blockstore and the markset.
// It was observed that using the default memory mapped option resulted in
// significant interference and unacceptably high block validation times once the markset
// exceeded 1GB in size.
opts.TableLoadingMode = options.FileIO
opts.ValueLogLoadingMode = options.FileIO
opts.Logger = &badgerLogger{
SugaredLogger: log.Desugar().WithOptions(zap.AddCallerSkip(1)).Sugar(),
skip2: log.Desugar().WithOptions(zap.AddCallerSkip(2)).Sugar(),
}
db, err := badger.Open(opts)
if err != nil {
return nil, xerrors.Errorf("error creating badger markset: %w", err)
}
ms := &BadgerMarkSet{
pend: make(map[string]struct{}),
writing: make(map[int]map[string]struct{}),
db: db,
path: path,
}
ms.cond.L = &ms.mx
return ms, nil
}
func (e *BadgerMarkSetEnv) Close() error {
return os.RemoveAll(e.path)
}
func (s *BadgerMarkSet) Mark(c cid.Cid) error {
s.mx.Lock()
if s.pend == nil {
s.mx.Unlock()
return errMarkSetClosed
}
s.pend[string(c.Hash())] = struct{}{}
if len(s.pend) < badgerMarkSetBatchSize {
s.mx.Unlock()
return nil
}
pend := s.pend
seqno := s.seqno
s.seqno++
s.writing[seqno] = pend
s.pend = make(map[string]struct{})
s.writers++
s.mx.Unlock()
defer func() {
s.mx.Lock()
defer s.mx.Unlock()
delete(s.writing, seqno)
s.writers--
if s.writers == 0 {
s.cond.Broadcast()
}
}()
empty := []byte{} // not nil
batch := s.db.NewWriteBatch()
defer batch.Cancel()
for k := range pend {
if err := batch.Set([]byte(k), empty); err != nil {
return err
}
}
err := batch.Flush()
if err != nil {
return xerrors.Errorf("error flushing batch to badger markset: %w", err)
}
return nil
}
func (s *BadgerMarkSet) Has(c cid.Cid) (bool, error) {
s.mx.RLock()
defer s.mx.RUnlock()
if s.pend == nil {
return false, errMarkSetClosed
}
key := c.Hash()
pendKey := string(key)
_, ok := s.pend[pendKey]
if ok {
return true, nil
}
for _, wr := range s.writing {
_, ok := wr[pendKey]
if ok {
return true, nil
}
}
err := s.db.View(func(txn *badger.Txn) error {
_, err := txn.Get(key)
return err
})
switch err {
case nil:
return true, nil
case badger.ErrKeyNotFound:
return false, nil
default:
return false, xerrors.Errorf("error checking badger markset: %w", err)
}
}
func (s *BadgerMarkSet) Close() error {
s.mx.Lock()
defer s.mx.Unlock()
if s.pend == nil {
return nil
}
for s.writers > 0 {
s.cond.Wait()
}
s.pend = nil
db := s.db
s.db = nil
err := db.Close()
if err != nil {
return xerrors.Errorf("error closing badger markset: %w", err)
}
err = os.RemoveAll(s.path)
if err != nil {
return xerrors.Errorf("error deleting badger markset: %w", err)
}
return nil
}
func (s *BadgerMarkSet) SetConcurrent() {}
// badger logging through go-log
type badgerLogger struct {
*zap.SugaredLogger
skip2 *zap.SugaredLogger
}
func (b *badgerLogger) Warningf(format string, args ...interface{}) {}
func (b *badgerLogger) Infof(format string, args ...interface{}) {}
func (b *badgerLogger) Debugf(format string, args ...interface{}) {}
+30
View File
@@ -3,6 +3,7 @@ package splitstore
import (
"crypto/rand"
"crypto/sha256"
"sync"
"golang.org/x/xerrors"
@@ -21,7 +22,9 @@ var _ MarkSetEnv = (*BloomMarkSetEnv)(nil)
type BloomMarkSet struct {
salt []byte
mx sync.RWMutex
bf *bbloom.Bloom
ts bool
}
var _ MarkSet = (*BloomMarkSet)(nil)
@@ -64,14 +67,41 @@ func (s *BloomMarkSet) saltedKey(cid cid.Cid) []byte {
}
func (s *BloomMarkSet) Mark(cid cid.Cid) error {
if s.ts {
s.mx.Lock()
defer s.mx.Unlock()
}
if s.bf == nil {
return errMarkSetClosed
}
s.bf.Add(s.saltedKey(cid))
return nil
}
func (s *BloomMarkSet) Has(cid cid.Cid) (bool, error) {
if s.ts {
s.mx.RLock()
defer s.mx.RUnlock()
}
if s.bf == nil {
return false, errMarkSetClosed
}
return s.bf.Has(s.saltedKey(cid)), nil
}
func (s *BloomMarkSet) Close() error {
if s.ts {
s.mx.Lock()
defer s.mx.Unlock()
}
s.bf = nil
return nil
}
func (s *BloomMarkSet) SetConcurrent() {
s.ts = true
}
-81
View File
@@ -1,81 +0,0 @@
package splitstore
import (
"time"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
bolt "go.etcd.io/bbolt"
)
type BoltMarkSetEnv struct {
db *bolt.DB
}
var _ MarkSetEnv = (*BoltMarkSetEnv)(nil)
type BoltMarkSet struct {
db *bolt.DB
bucketId []byte
}
var _ MarkSet = (*BoltMarkSet)(nil)
func NewBoltMarkSetEnv(path string) (*BoltMarkSetEnv, error) {
db, err := bolt.Open(path, 0644,
&bolt.Options{
Timeout: 1 * time.Second,
NoSync: true,
})
if err != nil {
return nil, err
}
return &BoltMarkSetEnv{db: db}, nil
}
func (e *BoltMarkSetEnv) Create(name string, hint int64) (MarkSet, error) {
bucketId := []byte(name)
err := e.db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists(bucketId)
if err != nil {
return xerrors.Errorf("error creating bolt db bucket %s: %w", name, err)
}
return nil
})
if err != nil {
return nil, err
}
return &BoltMarkSet{db: e.db, bucketId: bucketId}, nil
}
func (e *BoltMarkSetEnv) Close() error {
return e.db.Close()
}
func (s *BoltMarkSet) Mark(cid cid.Cid) error {
return s.db.Update(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
return b.Put(cid.Hash(), markBytes)
})
}
func (s *BoltMarkSet) Has(cid cid.Cid) (result bool, err error) {
err = s.db.View(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
v := b.Get(cid.Hash())
result = v != nil
return nil
})
return result, err
}
func (s *BoltMarkSet) Close() error {
return s.db.Update(func(tx *bolt.Tx) error {
return tx.DeleteBucket(s.bucketId)
})
}
+75
View File
@@ -0,0 +1,75 @@
package splitstore
import (
"sync"
cid "github.com/ipfs/go-cid"
)
type MapMarkSetEnv struct{}
var _ MarkSetEnv = (*MapMarkSetEnv)(nil)
type MapMarkSet struct {
mx sync.RWMutex
set map[string]struct{}
ts bool
}
var _ MarkSet = (*MapMarkSet)(nil)
func NewMapMarkSetEnv() (*MapMarkSetEnv, error) {
return &MapMarkSetEnv{}, nil
}
func (e *MapMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) {
return &MapMarkSet{
set: make(map[string]struct{}, sizeHint),
}, 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()
}
if s.set == nil {
return errMarkSetClosed
}
s.set[string(cid.Hash())] = struct{}{}
return nil
}
func (s *MapMarkSet) Has(cid cid.Cid) (bool, error) {
if s.ts {
s.mx.RLock()
defer s.mx.RUnlock()
}
if s.set == nil {
return false, errMarkSetClosed
}
_, ok := s.set[string(cid.Hash())]
return ok, nil
}
func (s *MapMarkSet) Close() error {
if s.ts {
s.mx.Lock()
defer s.mx.Unlock()
}
s.set = nil
return nil
}
func (s *MapMarkSet) SetConcurrent() {
s.ts = true
}
+11 -2
View File
@@ -8,14 +8,23 @@ import (
"github.com/multiformats/go-multihash"
)
func TestBoltMarkSet(t *testing.T) {
testMarkSet(t, "bolt")
func TestMapMarkSet(t *testing.T) {
testMarkSet(t, "map")
}
func TestBloomMarkSet(t *testing.T) {
testMarkSet(t, "bloom")
}
func TestBadgerMarkSet(t *testing.T) {
bs := badgerMarkSetBatchSize
badgerMarkSetBatchSize = 1
t.Cleanup(func() {
badgerMarkSetBatchSize = bs
})
testMarkSet(t, "badger")
}
func testMarkSet(t *testing.T, lsType string) {
t.Helper()
File diff suppressed because it is too large Load Diff
+150
View File
@@ -0,0 +1,150 @@
package splitstore
import (
"fmt"
"os"
"path/filepath"
"sync/atomic"
"time"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
bstore "github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/types"
)
// performs an asynchronous health-check on the splitstore; results are appended to
// <splitstore-path>/check.txt
func (s *SplitStore) Check() error {
s.headChangeMx.Lock()
defer s.headChangeMx.Unlock()
// try to take compaction lock and inhibit compaction while the health-check is running
if !atomic.CompareAndSwapInt32(&s.compacting, 0, 1) {
return xerrors.Errorf("can't acquire compaction lock; compacting operation in progress")
}
if s.compactionIndex == 0 {
atomic.StoreInt32(&s.compacting, 0)
return xerrors.Errorf("splitstore hasn't compacted yet; health check is not meaningful")
}
// check if we are actually closing first
if err := s.checkClosing(); err != nil {
atomic.StoreInt32(&s.compacting, 0)
return err
}
curTs := s.chain.GetHeaviestTipSet()
go func() {
defer atomic.StoreInt32(&s.compacting, 0)
log.Info("checking splitstore health")
start := time.Now()
err := s.doCheck(curTs)
if err != nil {
log.Errorf("error checking splitstore health: %s", err)
return
}
log.Infow("health check done", "took", time.Since(start))
}()
return nil
}
func (s *SplitStore) doCheck(curTs *types.TipSet) error {
currentEpoch := curTs.Height()
boundaryEpoch := currentEpoch - CompactionBoundary
outputPath := filepath.Join(s.path, "check.txt")
output, err := os.OpenFile(outputPath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
if err != nil {
return xerrors.Errorf("error opening check output file %s: %w", outputPath, err)
}
defer output.Close() //nolint:errcheck
write := func(format string, args ...interface{}) {
_, err := fmt.Fprintf(output, format+"\n", args...)
if err != nil {
log.Warnf("error writing check output: %s", err)
}
}
ts, _ := time.Now().MarshalText()
write("---------------------------------------------")
write("start check at %s", ts)
write("current epoch: %d", currentEpoch)
write("boundary epoch: %d", boundaryEpoch)
write("compaction index: %d", s.compactionIndex)
write("--")
var coldCnt, missingCnt int64
err = s.walkChain(curTs, boundaryEpoch, boundaryEpoch,
func(c cid.Cid) error {
if isUnitaryObject(c) {
return errStopWalk
}
has, err := s.hot.Has(c)
if err != nil {
return xerrors.Errorf("error checking hotstore: %w", err)
}
if has {
return nil
}
has, err = s.cold.Has(c)
if err != nil {
return xerrors.Errorf("error checking coldstore: %w", err)
}
if has {
coldCnt++
write("cold object reference: %s", c)
} else {
missingCnt++
write("missing object reference: %s", c)
return errStopWalk
}
return nil
})
if err != nil {
err = xerrors.Errorf("error walking chain: %w", err)
write("ERROR: %s", err)
return err
}
log.Infow("check done", "cold", coldCnt, "missing", missingCnt)
write("--")
write("cold: %d missing: %d", coldCnt, missingCnt)
write("DONE")
return nil
}
// provides some basic information about the splitstore
func (s *SplitStore) Info() map[string]interface{} {
info := make(map[string]interface{})
info["base epoch"] = s.baseEpoch
info["warmup epoch"] = s.warmupEpoch
info["compactions"] = s.compactionIndex
sizer, ok := s.hot.(bstore.BlockstoreSize)
if ok {
size, err := sizer.Size()
if err != nil {
log.Warnf("error getting hotstore size: %s", err)
} else {
info["hotstore size"] = size
}
}
return info
}
File diff suppressed because it is too large Load Diff
+114
View File
@@ -0,0 +1,114 @@
package splitstore
import (
"context"
"errors"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
bstore "github.com/filecoin-project/lotus/blockstore"
)
type exposedSplitStore struct {
s *SplitStore
}
var _ bstore.Blockstore = (*exposedSplitStore)(nil)
func (s *SplitStore) Expose() bstore.Blockstore {
return &exposedSplitStore{s: s}
}
func (es *exposedSplitStore) DeleteBlock(_ cid.Cid) error {
return errors.New("DeleteBlock: operation not supported")
}
func (es *exposedSplitStore) DeleteMany(_ []cid.Cid) error {
return errors.New("DeleteMany: operation not supported")
}
func (es *exposedSplitStore) Has(c cid.Cid) (bool, error) {
if isIdentiyCid(c) {
return true, nil
}
has, err := es.s.hot.Has(c)
if has || err != nil {
return has, err
}
return es.s.cold.Has(c)
}
func (es *exposedSplitStore) Get(c cid.Cid) (blocks.Block, error) {
if isIdentiyCid(c) {
data, err := decodeIdentityCid(c)
if err != nil {
return nil, err
}
return blocks.NewBlockWithCid(data, c)
}
blk, err := es.s.hot.Get(c)
switch err {
case bstore.ErrNotFound:
return es.s.cold.Get(c)
default:
return blk, err
}
}
func (es *exposedSplitStore) GetSize(c cid.Cid) (int, error) {
if isIdentiyCid(c) {
data, err := decodeIdentityCid(c)
if err != nil {
return 0, err
}
return len(data), nil
}
size, err := es.s.hot.GetSize(c)
switch err {
case bstore.ErrNotFound:
return es.s.cold.GetSize(c)
default:
return size, err
}
}
func (es *exposedSplitStore) Put(blk blocks.Block) error {
return es.s.Put(blk)
}
func (es *exposedSplitStore) PutMany(blks []blocks.Block) error {
return es.s.PutMany(blks)
}
func (es *exposedSplitStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
return es.s.AllKeysChan(ctx)
}
func (es *exposedSplitStore) HashOnRead(enabled bool) {}
func (es *exposedSplitStore) View(c cid.Cid, f func([]byte) error) error {
if isIdentiyCid(c) {
data, err := decodeIdentityCid(c)
if err != nil {
return err
}
return f(data)
}
err := es.s.hot.View(c, f)
switch err {
case bstore.ErrNotFound:
return es.s.cold.View(c, f)
default:
return err
}
}
+35
View File
@@ -0,0 +1,35 @@
package splitstore
import (
"fmt"
"time"
bstore "github.com/filecoin-project/lotus/blockstore"
)
func (s *SplitStore) gcHotstore() {
var opts []bstore.BlockstoreGCOption
if s.cfg.HotStoreFullGCFrequency > 0 && s.compactionIndex%int64(s.cfg.HotStoreFullGCFrequency) == 0 {
opts = append(opts, bstore.WithFullGC(true))
}
if err := s.gcBlockstore(s.hot, opts); err != nil {
log.Warnf("error garbage collecting hostore: %s", err)
}
}
func (s *SplitStore) gcBlockstore(b bstore.Blockstore, opts []bstore.BlockstoreGCOption) error {
if gc, ok := b.(bstore.BlockstoreGC); ok {
log.Info("garbage collecting blockstore")
startGC := time.Now()
if err := gc.CollectGarbage(opts...); err != nil {
return err
}
log.Infow("garbage collecting hotstore done", "took", time.Since(startGC))
return nil
}
return fmt.Errorf("blockstore doesn't support garbage collection: %T", b)
}
+229 -93
View File
@@ -2,6 +2,7 @@ package splitstore
import (
"context"
"errors"
"fmt"
"sync"
"sync/atomic"
@@ -13,6 +14,7 @@ import (
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/types/mock"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
datastore "github.com/ipfs/go-datastore"
dssync "github.com/ipfs/go-datastore/sync"
@@ -21,22 +23,35 @@ import (
func init() {
CompactionThreshold = 5
CompactionCold = 1
CompactionBoundary = 2
WarmupBoundary = 0
logging.SetLogLevel("splitstore", "DEBUG")
}
func testSplitStore(t *testing.T, cfg *Config) {
chain := &mockChain{}
// genesis
genBlock := mock.MkBlock(nil, 0, 0)
genTs := mock.TipSet(genBlock)
chain.push(genTs)
chain := &mockChain{t: t}
// the myriads of stores
ds := dssync.MutexWrap(datastore.NewMapDatastore())
hot := blockstore.NewMemorySync()
cold := blockstore.NewMemorySync()
hot := newMockStore()
cold := newMockStore()
// this is necessary to avoid the garbage mock puts in the blocks
garbage := blocks.NewBlock([]byte{1, 2, 3})
err := cold.Put(garbage)
if err != nil {
t.Fatal(err)
}
// genesis
genBlock := mock.MkBlock(nil, 0, 0)
genBlock.Messages = garbage.Cid()
genBlock.ParentMessageReceipts = garbage.Cid()
genBlock.ParentStateRoot = garbage.Cid()
genBlock.Timestamp = uint64(time.Now().Unix())
genTs := mock.TipSet(genBlock)
chain.push(genTs)
// put the genesis block to cold store
blk, err := genBlock.ToStorageBlock()
@@ -49,6 +64,20 @@ func testSplitStore(t *testing.T, cfg *Config) {
t.Fatal(err)
}
// create a garbage block that is protected with a rgistered protector
protected := blocks.NewBlock([]byte("protected!"))
err = hot.Put(protected)
if err != nil {
t.Fatal(err)
}
// and another one that is not protected
unprotected := blocks.NewBlock([]byte("unprotected!"))
err = hot.Put(unprotected)
if err != nil {
t.Fatal(err)
}
// open the splitstore
ss, err := Open("", ds, hot, cold, cfg)
if err != nil {
@@ -56,18 +85,33 @@ func testSplitStore(t *testing.T, cfg *Config) {
}
defer ss.Close() //nolint
// register our protector
ss.AddProtector(func(protect func(cid.Cid) error) error {
return protect(protected.Cid())
})
err = ss.Start(chain)
if err != nil {
t.Fatal(err)
}
// make some tipsets, but not enough to cause compaction
mkBlock := func(curTs *types.TipSet, i int) *types.TipSet {
mkBlock := func(curTs *types.TipSet, i int, stateRoot blocks.Block) *types.TipSet {
blk := mock.MkBlock(curTs, uint64(i), uint64(i))
blk.Messages = garbage.Cid()
blk.ParentMessageReceipts = garbage.Cid()
blk.ParentStateRoot = stateRoot.Cid()
blk.Timestamp = uint64(time.Now().Unix())
sblk, err := blk.ToStorageBlock()
if err != nil {
t.Fatal(err)
}
err = ss.Put(stateRoot)
if err != nil {
t.Fatal(err)
}
err = ss.Put(sblk)
if err != nil {
t.Fatal(err)
@@ -78,18 +122,6 @@ func testSplitStore(t *testing.T, cfg *Config) {
return ts
}
mkGarbageBlock := func(curTs *types.TipSet, i int) {
blk := mock.MkBlock(curTs, uint64(i), uint64(i))
sblk, err := blk.ToStorageBlock()
if err != nil {
t.Fatal(err)
}
err = ss.Put(sblk)
if err != nil {
t.Fatal(err)
}
}
waitForCompaction := func() {
for atomic.LoadInt32(&ss.compacting) == 1 {
time.Sleep(100 * time.Millisecond)
@@ -98,100 +130,101 @@ func testSplitStore(t *testing.T, cfg *Config) {
curTs := genTs
for i := 1; i < 5; i++ {
curTs = mkBlock(curTs, i)
stateRoot := blocks.NewBlock([]byte{byte(i), 3, 3, 7})
curTs = mkBlock(curTs, i, stateRoot)
waitForCompaction()
}
mkGarbageBlock(genTs, 1)
// count objects in the cold and hot stores
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
countBlocks := func(bs blockstore.Blockstore) int {
count := 0
ch, err := bs.AllKeysChan(ctx)
if err != nil {
t.Fatal(err)
}
for range ch {
_ = bs.(blockstore.BlockstoreIterator).ForEachKey(func(_ cid.Cid) error {
count++
}
return nil
})
return count
}
coldCnt := countBlocks(cold)
hotCnt := countBlocks(hot)
if coldCnt != 1 {
t.Errorf("expected %d blocks, but got %d", 1, coldCnt)
if coldCnt != 2 {
t.Errorf("expected %d blocks, but got %d", 2, coldCnt)
}
if hotCnt != 5 {
t.Errorf("expected %d blocks, but got %d", 5, hotCnt)
if hotCnt != 12 {
t.Errorf("expected %d blocks, but got %d", 12, hotCnt)
}
// trigger a compaction
for i := 5; i < 10; i++ {
curTs = mkBlock(curTs, i)
stateRoot := blocks.NewBlock([]byte{byte(i), 3, 3, 7})
curTs = mkBlock(curTs, i, stateRoot)
waitForCompaction()
}
coldCnt = countBlocks(cold)
hotCnt = countBlocks(hot)
if !cfg.EnableFullCompaction {
if coldCnt != 5 {
t.Errorf("expected %d cold blocks, but got %d", 5, coldCnt)
}
if hotCnt != 5 {
t.Errorf("expected %d hot blocks, but got %d", 5, hotCnt)
}
if coldCnt != 6 {
t.Errorf("expected %d cold blocks, but got %d", 6, coldCnt)
}
if cfg.EnableFullCompaction && !cfg.EnableGC {
if coldCnt != 3 {
t.Errorf("expected %d cold blocks, but got %d", 3, coldCnt)
}
if hotCnt != 7 {
t.Errorf("expected %d hot blocks, but got %d", 7, hotCnt)
}
if hotCnt != 18 {
t.Errorf("expected %d hot blocks, but got %d", 18, hotCnt)
}
if cfg.EnableFullCompaction && cfg.EnableGC {
if coldCnt != 2 {
t.Errorf("expected %d cold blocks, but got %d", 2, coldCnt)
}
if hotCnt != 7 {
t.Errorf("expected %d hot blocks, but got %d", 7, hotCnt)
}
// ensure our protected block is still there
has, err := hot.Has(protected.Cid())
if err != nil {
t.Fatal(err)
}
if !has {
t.Fatal("protected block is missing from hotstore")
}
// ensure our unprotected block is in the coldstore now
has, err = hot.Has(unprotected.Cid())
if err != nil {
t.Fatal(err)
}
if has {
t.Fatal("unprotected block is still in hotstore")
}
has, err = cold.Has(unprotected.Cid())
if err != nil {
t.Fatal(err)
}
if !has {
t.Fatal("unprotected block is missing from coldstore")
}
// Make sure we can revert without panicking.
chain.revert(2)
}
func TestSplitStoreSimpleCompaction(t *testing.T) {
testSplitStore(t, &Config{TrackingStoreType: "mem"})
func TestSplitStoreCompaction(t *testing.T) {
testSplitStore(t, &Config{MarkSetType: "map"})
}
func TestSplitStoreFullCompactionWithoutGC(t *testing.T) {
testSplitStore(t, &Config{
TrackingStoreType: "mem",
EnableFullCompaction: true,
})
}
func TestSplitStoreFullCompactionWithGC(t *testing.T) {
testSplitStore(t, &Config{
TrackingStoreType: "mem",
EnableFullCompaction: true,
EnableGC: true,
func TestSplitStoreCompactionWithBadger(t *testing.T) {
bs := badgerMarkSetBatchSize
badgerMarkSetBatchSize = 1
t.Cleanup(func() {
badgerMarkSetBatchSize = bs
})
testSplitStore(t, &Config{MarkSetType: "badger"})
}
type mockChain struct {
t testing.TB
sync.Mutex
genesis *types.BlockHeader
tipsets []*types.TipSet
listener func(revert []*types.TipSet, apply []*types.TipSet) error
}
@@ -199,12 +232,34 @@ type mockChain struct {
func (c *mockChain) push(ts *types.TipSet) {
c.Lock()
c.tipsets = append(c.tipsets, ts)
if c.genesis == nil {
c.genesis = ts.Blocks()[0]
}
c.Unlock()
if c.listener != nil {
err := c.listener(nil, []*types.TipSet{ts})
if err != nil {
log.Errorf("mockchain: error dispatching listener: %s", err)
c.t.Errorf("mockchain: error dispatching listener: %s", err)
}
}
}
func (c *mockChain) revert(count int) {
c.Lock()
revert := make([]*types.TipSet, count)
if count > len(c.tipsets) {
c.Unlock()
c.t.Fatalf("not enough tipsets to revert")
}
copy(revert, c.tipsets[len(c.tipsets)-count:])
c.tipsets = c.tipsets[:len(c.tipsets)-count]
c.Unlock()
if c.listener != nil {
err := c.listener(revert, nil)
if err != nil {
c.t.Errorf("mockchain: error dispatching listener: %s", err)
}
}
}
@@ -218,7 +273,7 @@ func (c *mockChain) GetTipsetByHeight(_ context.Context, epoch abi.ChainEpoch, _
return nil, fmt.Errorf("bad epoch %d", epoch)
}
return c.tipsets[iEpoch-1], nil
return c.tipsets[iEpoch], nil
}
func (c *mockChain) GetHeaviestTipSet() *types.TipSet {
@@ -232,24 +287,105 @@ func (c *mockChain) SubscribeHeadChanges(change func(revert []*types.TipSet, app
c.listener = change
}
func (c *mockChain) WalkSnapshot(_ context.Context, ts *types.TipSet, epochs abi.ChainEpoch, _ bool, _ bool, f func(cid.Cid) error) error {
c.Lock()
defer c.Unlock()
type mockStore struct {
mx sync.Mutex
set map[cid.Cid]blocks.Block
}
start := int(ts.Height()) - 1
end := start - int(epochs)
if end < 0 {
end = -1
func newMockStore() *mockStore {
return &mockStore{set: make(map[cid.Cid]blocks.Block)}
}
func (b *mockStore) Has(cid cid.Cid) (bool, error) {
b.mx.Lock()
defer b.mx.Unlock()
_, ok := b.set[cid]
return ok, nil
}
func (b *mockStore) HashOnRead(hor bool) {}
func (b *mockStore) Get(cid cid.Cid) (blocks.Block, error) {
b.mx.Lock()
defer b.mx.Unlock()
blk, ok := b.set[cid]
if !ok {
return nil, blockstore.ErrNotFound
}
for i := start; i > end; i-- {
ts := c.tipsets[i]
for _, cid := range ts.Cids() {
err := f(cid)
if err != nil {
return err
}
}
return blk, nil
}
func (b *mockStore) GetSize(cid cid.Cid) (int, error) {
blk, err := b.Get(cid)
if err != nil {
return 0, err
}
return len(blk.RawData()), nil
}
func (b *mockStore) View(cid cid.Cid, f func([]byte) error) error {
blk, err := b.Get(cid)
if err != nil {
return err
}
return f(blk.RawData())
}
func (b *mockStore) Put(blk blocks.Block) error {
b.mx.Lock()
defer b.mx.Unlock()
b.set[blk.Cid()] = blk
return nil
}
func (b *mockStore) PutMany(blks []blocks.Block) error {
b.mx.Lock()
defer b.mx.Unlock()
for _, blk := range blks {
b.set[blk.Cid()] = blk
}
return nil
}
func (b *mockStore) DeleteBlock(cid cid.Cid) error {
b.mx.Lock()
defer b.mx.Unlock()
delete(b.set, cid)
return nil
}
func (b *mockStore) DeleteMany(cids []cid.Cid) error {
b.mx.Lock()
defer b.mx.Unlock()
for _, c := range cids {
delete(b.set, c)
}
return nil
}
func (b *mockStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
return nil, errors.New("not implemented")
}
func (b *mockStore) ForEachKey(f func(cid.Cid) error) error {
b.mx.Lock()
defer b.mx.Unlock()
for c := range b.set {
err := f(c)
if err != nil {
return err
}
}
return nil
}
func (b *mockStore) Close() error {
return nil
}
+67
View File
@@ -0,0 +1,67 @@
package splitstore
import (
"encoding/binary"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
mh "github.com/multiformats/go-multihash"
"github.com/filecoin-project/go-state-types/abi"
)
func epochToBytes(epoch abi.ChainEpoch) []byte {
return uint64ToBytes(uint64(epoch))
}
func bytesToEpoch(buf []byte) abi.ChainEpoch {
return abi.ChainEpoch(bytesToUint64(buf))
}
func int64ToBytes(i int64) []byte {
return uint64ToBytes(uint64(i))
}
func bytesToInt64(buf []byte) int64 {
return int64(bytesToUint64(buf))
}
func uint64ToBytes(i uint64) []byte {
buf := make([]byte, 16)
n := binary.PutUvarint(buf, i)
return buf[:n]
}
func bytesToUint64(buf []byte) uint64 {
i, _ := binary.Uvarint(buf)
return i
}
func isUnitaryObject(c cid.Cid) bool {
pre := c.Prefix()
switch pre.Codec {
case cid.FilCommitmentSealed, cid.FilCommitmentUnsealed:
return true
default:
return pre.MhType == mh.IDENTITY
}
}
func isIdentiyCid(c cid.Cid) bool {
return c.Prefix().MhType == mh.IDENTITY
}
func decodeIdentityCid(c cid.Cid) ([]byte, error) {
dmh, err := mh.Decode(c.Hash())
if err != nil {
return nil, xerrors.Errorf("error decoding identity cid %s: %w", c, err)
}
// sanity check
if dmh.Code != mh.IDENTITY {
return nil, xerrors.Errorf("error decoding identity cid %s: hash type is not identity", c)
}
return dmh.Digest, nil
}
+137
View File
@@ -0,0 +1,137 @@
package splitstore
import (
"sync/atomic"
"time"
"golang.org/x/xerrors"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
"github.com/filecoin-project/go-state-types/abi"
bstore "github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
)
var (
// WarmupBoundary is the number of epochs to load state during warmup.
WarmupBoundary = build.Finality
)
// warmup acuiqres the compaction lock and spawns a goroutine to warm up the hotstore;
// this is necessary when we sync from a snapshot or when we enable the splitstore
// on top of an existing blockstore (which becomes the coldstore).
func (s *SplitStore) warmup(curTs *types.TipSet) error {
if !atomic.CompareAndSwapInt32(&s.compacting, 0, 1) {
return xerrors.Errorf("error locking compaction")
}
go func() {
defer atomic.StoreInt32(&s.compacting, 0)
log.Info("warming up hotstore")
start := time.Now()
err := s.doWarmup(curTs)
if err != nil {
log.Errorf("error warming up hotstore: %s", err)
return
}
log.Infow("warm up done", "took", time.Since(start))
}()
return nil
}
// the actual warmup procedure; it walks the chain loading all state roots at the boundary
// and headers all the way up to genesis.
// objects are written in batches so as to minimize overhead.
func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
var boundaryEpoch abi.ChainEpoch
epoch := curTs.Height()
if WarmupBoundary < epoch {
boundaryEpoch = epoch - WarmupBoundary
}
batchHot := make([]blocks.Block, 0, batchSize)
count := int64(0)
xcount := int64(0)
missing := int64(0)
err := s.walkChain(curTs, boundaryEpoch, epoch+1, // we don't load messages/receipts in warmup
func(c cid.Cid) error {
if isUnitaryObject(c) {
return errStopWalk
}
count++
has, err := s.hot.Has(c)
if err != nil {
return err
}
if has {
return nil
}
blk, err := s.cold.Get(c)
if err != nil {
if err == bstore.ErrNotFound {
missing++
return errStopWalk
}
return err
}
xcount++
batchHot = append(batchHot, blk)
if len(batchHot) == batchSize {
err = s.hot.PutMany(batchHot)
if err != nil {
return err
}
batchHot = batchHot[:0]
}
return nil
})
if err != nil {
return err
}
if len(batchHot) > 0 {
err = s.hot.PutMany(batchHot)
if err != nil {
return err
}
}
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))
if err != nil {
log.Warnf("error saving mark set size: %s", err)
}
// save the warmup epoch
err = s.ds.Put(warmupEpochKey, epochToBytes(epoch))
if err != nil {
return xerrors.Errorf("error saving warm up epoch: %w", err)
}
s.mx.Lock()
s.warmupEpoch = epoch
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))
if err != nil {
return xerrors.Errorf("error saving compaction index: %w", err)
}
return nil
}
-109
View File
@@ -1,109 +0,0 @@
package splitstore
import (
"path/filepath"
"sync"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
cid "github.com/ipfs/go-cid"
)
// TrackingStore is a persistent store that tracks blocks that are added
// to the hotstore, tracking the epoch at which they are written.
type TrackingStore interface {
Put(cid.Cid, abi.ChainEpoch) error
PutBatch([]cid.Cid, abi.ChainEpoch) error
Get(cid.Cid) (abi.ChainEpoch, error)
Delete(cid.Cid) error
DeleteBatch([]cid.Cid) error
ForEach(func(cid.Cid, abi.ChainEpoch) error) error
Sync() error
Close() error
}
// OpenTrackingStore opens a tracking store of the specified type in the
// specified path.
func OpenTrackingStore(path string, ttype string) (TrackingStore, error) {
switch ttype {
case "", "bolt":
return OpenBoltTrackingStore(filepath.Join(path, "tracker.bolt"))
case "mem":
return NewMemTrackingStore(), nil
default:
return nil, xerrors.Errorf("unknown tracking store type %s", ttype)
}
}
// NewMemTrackingStore creates an in-memory tracking store.
// This is only useful for test or situations where you don't want to open the
// real tracking store (eg concurrent read only access on a node's datastore)
func NewMemTrackingStore() *MemTrackingStore {
return &MemTrackingStore{tab: make(map[cid.Cid]abi.ChainEpoch)}
}
// MemTrackingStore is a simple in-memory tracking store
type MemTrackingStore struct {
sync.Mutex
tab map[cid.Cid]abi.ChainEpoch
}
var _ TrackingStore = (*MemTrackingStore)(nil)
func (s *MemTrackingStore) Put(cid cid.Cid, epoch abi.ChainEpoch) error {
s.Lock()
defer s.Unlock()
s.tab[cid] = epoch
return nil
}
func (s *MemTrackingStore) PutBatch(cids []cid.Cid, epoch abi.ChainEpoch) error {
s.Lock()
defer s.Unlock()
for _, cid := range cids {
s.tab[cid] = epoch
}
return nil
}
func (s *MemTrackingStore) Get(cid cid.Cid) (abi.ChainEpoch, error) {
s.Lock()
defer s.Unlock()
epoch, ok := s.tab[cid]
if ok {
return epoch, nil
}
return 0, xerrors.Errorf("missing tracking epoch for %s", cid)
}
func (s *MemTrackingStore) Delete(cid cid.Cid) error {
s.Lock()
defer s.Unlock()
delete(s.tab, cid)
return nil
}
func (s *MemTrackingStore) DeleteBatch(cids []cid.Cid) error {
s.Lock()
defer s.Unlock()
for _, cid := range cids {
delete(s.tab, cid)
}
return nil
}
func (s *MemTrackingStore) ForEach(f func(cid.Cid, abi.ChainEpoch) error) error {
s.Lock()
defer s.Unlock()
for cid, epoch := range s.tab {
err := f(cid, epoch)
if err != nil {
return err
}
}
return nil
}
func (s *MemTrackingStore) Sync() error { return nil }
func (s *MemTrackingStore) Close() error { return nil }
-120
View File
@@ -1,120 +0,0 @@
package splitstore
import (
"time"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
bolt "go.etcd.io/bbolt"
"github.com/filecoin-project/go-state-types/abi"
)
type BoltTrackingStore struct {
db *bolt.DB
bucketId []byte
}
var _ TrackingStore = (*BoltTrackingStore)(nil)
func OpenBoltTrackingStore(path string) (*BoltTrackingStore, error) {
opts := &bolt.Options{
Timeout: 1 * time.Second,
NoSync: true,
}
db, err := bolt.Open(path, 0644, opts)
if err != nil {
return nil, err
}
bucketId := []byte("tracker")
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists(bucketId)
if err != nil {
return xerrors.Errorf("error creating bolt db bucket %s: %w", string(bucketId), err)
}
return nil
})
if err != nil {
_ = db.Close()
return nil, err
}
return &BoltTrackingStore{db: db, bucketId: bucketId}, nil
}
func (s *BoltTrackingStore) Put(cid cid.Cid, epoch abi.ChainEpoch) error {
val := epochToBytes(epoch)
return s.db.Batch(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
return b.Put(cid.Hash(), val)
})
}
func (s *BoltTrackingStore) PutBatch(cids []cid.Cid, epoch abi.ChainEpoch) error {
val := epochToBytes(epoch)
return s.db.Batch(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
for _, cid := range cids {
err := b.Put(cid.Hash(), val)
if err != nil {
return err
}
}
return nil
})
}
func (s *BoltTrackingStore) Get(cid cid.Cid) (epoch abi.ChainEpoch, err error) {
err = s.db.View(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
val := b.Get(cid.Hash())
if val == nil {
return xerrors.Errorf("missing tracking epoch for %s", cid)
}
epoch = bytesToEpoch(val)
return nil
})
return epoch, err
}
func (s *BoltTrackingStore) Delete(cid cid.Cid) error {
return s.db.Batch(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
return b.Delete(cid.Hash())
})
}
func (s *BoltTrackingStore) DeleteBatch(cids []cid.Cid) error {
return s.db.Batch(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
for _, cid := range cids {
err := b.Delete(cid.Hash())
if err != nil {
return xerrors.Errorf("error deleting %s", cid)
}
}
return nil
})
}
func (s *BoltTrackingStore) ForEach(f func(cid.Cid, abi.ChainEpoch) error) error {
return s.db.View(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
return b.ForEach(func(k, v []byte) error {
cid := cid.NewCidV1(cid.Raw, k)
epoch := bytesToEpoch(v)
return f(cid, epoch)
})
})
}
func (s *BoltTrackingStore) Sync() error {
return s.db.Sync()
}
func (s *BoltTrackingStore) Close() error {
return s.db.Close()
}
-130
View File
@@ -1,130 +0,0 @@
package splitstore
import (
"io/ioutil"
"testing"
cid "github.com/ipfs/go-cid"
"github.com/multiformats/go-multihash"
"github.com/filecoin-project/go-state-types/abi"
)
func TestBoltTrackingStore(t *testing.T) {
testTrackingStore(t, "bolt")
}
func testTrackingStore(t *testing.T, tsType string) {
t.Helper()
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 TrackingStore, cid cid.Cid, epoch abi.ChainEpoch) {
val, err := s.Get(cid)
if err != nil {
t.Fatal(err)
}
if val != epoch {
t.Fatal("epoch mismatch")
}
}
mustNotHave := func(s TrackingStore, cid cid.Cid) {
_, err := s.Get(cid)
if err == nil {
t.Fatal("expected error")
}
}
path, err := ioutil.TempDir("", "snoop-test.*")
if err != nil {
t.Fatal(err)
}
s, err := OpenTrackingStore(path, tsType)
if err != nil {
t.Fatal(err)
}
k1 := makeCid("a")
k2 := makeCid("b")
k3 := makeCid("c")
k4 := makeCid("d")
s.Put(k1, 1) //nolint
s.Put(k2, 2) //nolint
s.Put(k3, 3) //nolint
s.Put(k4, 4) //nolint
mustHave(s, k1, 1)
mustHave(s, k2, 2)
mustHave(s, k3, 3)
mustHave(s, k4, 4)
s.Delete(k1) // nolint
s.Delete(k2) // nolint
mustNotHave(s, k1)
mustNotHave(s, k2)
mustHave(s, k3, 3)
mustHave(s, k4, 4)
s.PutBatch([]cid.Cid{k1}, 1) //nolint
s.PutBatch([]cid.Cid{k2}, 2) //nolint
mustHave(s, k1, 1)
mustHave(s, k2, 2)
mustHave(s, k3, 3)
mustHave(s, k4, 4)
allKeys := map[string]struct{}{
k1.String(): {},
k2.String(): {},
k3.String(): {},
k4.String(): {},
}
err = s.ForEach(func(k cid.Cid, _ abi.ChainEpoch) error {
_, ok := allKeys[k.String()]
if !ok {
t.Fatal("unexpected key")
}
delete(allKeys, k.String())
return nil
})
if err != nil {
t.Fatal(err)
}
if len(allKeys) != 0 {
t.Fatal("not all keys were returned")
}
// no close and reopen and ensure the keys still exist
err = s.Close()
if err != nil {
t.Fatal(err)
}
s, err = OpenTrackingStore(path, tsType)
if err != nil {
t.Fatal(err)
}
mustHave(s, k1, 1)
mustHave(s, k2, 2)
mustHave(s, k3, 3)
mustHave(s, k4, 4)
s.Close() //nolint:errcheck
}
+11 -7
View File
@@ -2,28 +2,32 @@ package build
import (
"context"
"embed"
"path"
"strings"
"github.com/filecoin-project/lotus/lib/addrutil"
rice "github.com/GeertJohan/go.rice"
"github.com/libp2p/go-libp2p-core/peer"
)
//go:embed bootstrap
var bootstrapfs embed.FS
func BuiltinBootstrap() ([]peer.AddrInfo, error) {
if DisableBuiltinAssets {
return nil, nil
}
b := rice.MustFindBox("bootstrap")
if BootstrappersFile != "" {
spi := b.MustString(BootstrappersFile)
if spi == "" {
spi, err := bootstrapfs.ReadFile(path.Join("bootstrap", BootstrappersFile))
if err != nil {
return nil, err
}
if len(spi) == 0 {
return nil, nil
}
return addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(spi), "\n"))
return addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(string(spi)), "\n"))
}
return nil, nil
+2 -2
View File
@@ -1,2 +1,2 @@
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWRkaF18SR3E6qL6dkGrozT8QJUV5VbhE9E7BZtPmHqdWJ
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWJcJUc23WJjJHGSboGcU3t76z9Lb7CghrH2tiBiDCY4ux
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWBbZd7Su9XfLUQ12RynGQ3ZmGY1nGqFntmqop9pLNJE6g
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWGKRzEY4tJFTmAmrYUpa1CVVohmV9YjJbC9v5XWY2gUji
+2
View File
@@ -0,0 +1,2 @@
/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWLGPq9JL1xwL6gHok7HSNxtK1Q5kyfg4Hk69ifRPghn4i
/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWFYS1f31zafv8mqqYu8U3hEqYvaZ6avWzYU3BmZdpyH3h
+7 -7
View File
@@ -1,23 +1,23 @@
package build
import (
rice "github.com/GeertJohan/go.rice"
"embed"
"path"
logging "github.com/ipfs/go-log/v2"
)
// moved from now-defunct build/paramfetch.go
var log = logging.Logger("build")
//go:embed genesis
var genesisfs embed.FS
func MaybeGenesis() []byte {
builtinGen, err := rice.FindBox("genesis")
genBytes, err := genesisfs.ReadFile(path.Join("genesis", GenesisFile))
if err != nil {
log.Warnf("loading built-in genesis: %s", err)
return nil
}
genBytes, err := builtinGen.Bytes(GenesisFile)
if err != nil {
log.Warnf("loading built-in genesis: %s", err)
}
return genBytes
}
Binary file not shown.
Binary file not shown.
+16 -5
View File
@@ -3,13 +3,15 @@ package build
import (
"bytes"
"compress/gzip"
"embed"
"encoding/json"
rice "github.com/GeertJohan/go.rice"
apitypes "github.com/filecoin-project/lotus/api/types"
)
//go:embed openrpc
var openrpcfs embed.FS
func mustReadGzippedOpenRPCDocument(data []byte) apitypes.OpenRPCDocument {
zr, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil {
@@ -28,16 +30,25 @@ func mustReadGzippedOpenRPCDocument(data []byte) apitypes.OpenRPCDocument {
}
func OpenRPCDiscoverJSON_Full() apitypes.OpenRPCDocument {
data := rice.MustFindBox("openrpc").MustBytes("full.json.gz")
data, err := openrpcfs.ReadFile("openrpc/full.json.gz")
if err != nil {
panic(err)
}
return mustReadGzippedOpenRPCDocument(data)
}
func OpenRPCDiscoverJSON_Miner() apitypes.OpenRPCDocument {
data := rice.MustFindBox("openrpc").MustBytes("miner.json.gz")
data, err := openrpcfs.ReadFile("openrpc/miner.json.gz")
if err != nil {
panic(err)
}
return mustReadGzippedOpenRPCDocument(data)
}
func OpenRPCDiscoverJSON_Worker() apitypes.OpenRPCDocument {
data := rice.MustFindBox("openrpc").MustBytes("worker.json.gz")
data, err := openrpcfs.ReadFile("openrpc/worker.json.gz")
if err != nil {
panic(err)
}
return mustReadGzippedOpenRPCDocument(data)
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
+11 -3
View File
@@ -1,11 +1,19 @@
package build
import rice "github.com/GeertJohan/go.rice"
import (
_ "embed"
)
//go:embed proof-params/parameters.json
var params []byte
//go:embed proof-params/srs-inner-product.json
var srs []byte
func ParametersJSON() []byte {
return rice.MustFindBox("proof-params").MustBytes("parameters.json")
return params
}
func SrsJSON() []byte {
return rice.MustFindBox("proof-params").MustBytes("srs-inner-product.json")
return srs
}
+13 -12
View File
@@ -24,29 +24,30 @@ var UpgradeIgnitionHeight = abi.ChainEpoch(-2)
var UpgradeRefuelHeight = abi.ChainEpoch(-3)
var UpgradeTapeHeight = abi.ChainEpoch(-4)
var UpgradeAssemblyHeight = abi.ChainEpoch(5)
var UpgradeLiftoffHeight = abi.ChainEpoch(-5)
var UpgradeAssemblyHeight = abi.ChainEpoch(-5)
var UpgradeLiftoffHeight = abi.ChainEpoch(-6)
var UpgradeKumquatHeight = abi.ChainEpoch(6)
var UpgradeCalicoHeight = abi.ChainEpoch(7)
var UpgradePersianHeight = abi.ChainEpoch(8)
var UpgradeOrangeHeight = abi.ChainEpoch(9)
var UpgradeClausHeight = abi.ChainEpoch(10)
var UpgradeKumquatHeight = abi.ChainEpoch(-7)
var UpgradePricelistOopsHeight = abi.ChainEpoch(-8)
var UpgradeCalicoHeight = abi.ChainEpoch(-9)
var UpgradePersianHeight = abi.ChainEpoch(-10)
var UpgradeOrangeHeight = abi.ChainEpoch(-11)
var UpgradeClausHeight = abi.ChainEpoch(-12)
var UpgradeTrustHeight = abi.ChainEpoch(11)
var UpgradeTrustHeight = abi.ChainEpoch(-13)
var UpgradeNorwegianHeight = abi.ChainEpoch(12)
var UpgradeNorwegianHeight = abi.ChainEpoch(-14)
var UpgradeTurboHeight = abi.ChainEpoch(13)
var UpgradeTurboHeight = abi.ChainEpoch(-15)
var UpgradeHyperdriveHeight = abi.ChainEpoch(14)
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
func init() {
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1, abi.RegisteredSealProof_StackedDrg8MiBV1)
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
+1
View File
@@ -28,6 +28,7 @@ var UpgradeAssemblyHeight = abi.ChainEpoch(30)
const UpgradeTapeHeight = 60
const UpgradeLiftoffHeight = -5
const UpgradeKumquatHeight = 90
const UpgradePricelistOopsHeight = 119
const UpgradeCalicoHeight = 120
const UpgradePersianHeight = 150
const UpgradeClausHeight = 180
+2
View File
@@ -33,6 +33,8 @@ const UpgradeLiftoffHeight = -5
const UpgradeKumquatHeight = 90
const UpgradePricelistOopsHeight = 119
const UpgradeCalicoHeight = 120
const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 1)
+105
View File
@@ -0,0 +1,105 @@
// +build interopnet
package build
import (
"os"
"strconv"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
const BootstrappersFile = "interopnet.pi"
const GenesisFile = "interopnet.car"
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
const BreezeGasTampingDuration = 0
var UpgradeSmokeHeight = abi.ChainEpoch(-1)
var UpgradeIgnitionHeight = abi.ChainEpoch(-2)
var UpgradeRefuelHeight = abi.ChainEpoch(-3)
var UpgradeTapeHeight = abi.ChainEpoch(-4)
var UpgradeAssemblyHeight = abi.ChainEpoch(-5)
var UpgradeLiftoffHeight = abi.ChainEpoch(-6)
var UpgradeKumquatHeight = abi.ChainEpoch(-7)
var UpgradePricelistOopsHeight = abi.ChainEpoch(-8)
var UpgradeCalicoHeight = abi.ChainEpoch(-9)
var UpgradePersianHeight = abi.ChainEpoch(-10)
var UpgradeOrangeHeight = abi.ChainEpoch(-11)
var UpgradeClausHeight = abi.ChainEpoch(-12)
var UpgradeTrustHeight = abi.ChainEpoch(-13)
var UpgradeNorwegianHeight = abi.ChainEpoch(-14)
var UpgradeTurboHeight = abi.ChainEpoch(-15)
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
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))
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
hs, found := os.LookupEnv(ev)
if found {
h, err := strconv.Atoi(hs)
if err != nil {
log.Panicf("failed to parse %s env var", ev)
}
return abi.ChainEpoch(h)
}
return def
}
UpgradeBreezeHeight = getUpgradeHeight("LOTUS_BREEZE_HEIGHT", UpgradeBreezeHeight)
UpgradeSmokeHeight = getUpgradeHeight("LOTUS_SMOKE_HEIGHT", UpgradeSmokeHeight)
UpgradeIgnitionHeight = getUpgradeHeight("LOTUS_IGNITION_HEIGHT", UpgradeIgnitionHeight)
UpgradeRefuelHeight = getUpgradeHeight("LOTUS_REFUEL_HEIGHT", UpgradeRefuelHeight)
UpgradeTapeHeight = getUpgradeHeight("LOTUS_TAPE_HEIGHT", UpgradeTapeHeight)
UpgradeAssemblyHeight = getUpgradeHeight("LOTUS_ACTORSV2_HEIGHT", UpgradeAssemblyHeight)
UpgradeLiftoffHeight = getUpgradeHeight("LOTUS_LIFTOFF_HEIGHT", UpgradeLiftoffHeight)
UpgradeKumquatHeight = getUpgradeHeight("LOTUS_KUMQUAT_HEIGHT", UpgradeKumquatHeight)
UpgradeCalicoHeight = getUpgradeHeight("LOTUS_CALICO_HEIGHT", UpgradeCalicoHeight)
UpgradePersianHeight = getUpgradeHeight("LOTUS_PERSIAN_HEIGHT", UpgradePersianHeight)
UpgradeOrangeHeight = getUpgradeHeight("LOTUS_ORANGE_HEIGHT", UpgradeOrangeHeight)
UpgradeClausHeight = getUpgradeHeight("LOTUS_CLAUS_HEIGHT", UpgradeClausHeight)
UpgradeTrustHeight = getUpgradeHeight("LOTUS_ACTORSV3_HEIGHT", UpgradeTrustHeight)
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
BuildType |= BuildInteropnet
SetAddressNetwork(address.Testnet)
Devnet = true
}
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
const PropagationDelaySecs = uint64(6)
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
const BootstrapPeerThreshold = 2
var WhitelistedBlock = cid.Undef
+2 -3
View File
@@ -4,6 +4,7 @@
// +build !calibnet
// +build !nerpanet
// +build !butterflynet
// +build !interopnet
package build
@@ -13,7 +14,6 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/actors/policy"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
)
@@ -45,6 +45,7 @@ const UpgradeLiftoffHeight = 148888
const UpgradeKumquatHeight = 170000
const UpgradePricelistOopsHeight = 265199
const UpgradeCalicoHeight = 265200
const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 60)
@@ -66,8 +67,6 @@ const UpgradeTurboHeight = 712320
var UpgradeHyperdriveHeight = abi.ChainEpoch(892800)
func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(10 << 40))
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
SetAddressNetwork(address.Mainnet)
}
+2 -1
View File
@@ -32,6 +32,7 @@ const UpgradeTapeHeight = 60
const UpgradeKumquatHeight = 90
const UpgradePricelistOopsHeight = 99
const UpgradeCalicoHeight = 100
const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 1)
@@ -42,7 +43,7 @@ const UpgradeOrangeHeight = 300
const UpgradeTrustHeight = 600
const UpgradeNorwegianHeight = 201000
const UpgradeTurboHeight = 203000
const UpgradeHyperdriveHeight = 999999999
const UpgradeHyperdriveHeight = 379178
func init() {
// Minimum block production power is set to 4 TiB
+16 -15
View File
@@ -82,21 +82,22 @@ var (
UpgradeBreezeHeight abi.ChainEpoch = -1
BreezeGasTampingDuration abi.ChainEpoch = 0
UpgradeSmokeHeight abi.ChainEpoch = -1
UpgradeIgnitionHeight abi.ChainEpoch = -2
UpgradeRefuelHeight abi.ChainEpoch = -3
UpgradeTapeHeight abi.ChainEpoch = -4
UpgradeAssemblyHeight abi.ChainEpoch = 10
UpgradeLiftoffHeight abi.ChainEpoch = -5
UpgradeKumquatHeight abi.ChainEpoch = -6
UpgradeCalicoHeight abi.ChainEpoch = -7
UpgradePersianHeight abi.ChainEpoch = -8
UpgradeOrangeHeight abi.ChainEpoch = -9
UpgradeClausHeight abi.ChainEpoch = -10
UpgradeTrustHeight abi.ChainEpoch = -11
UpgradeNorwegianHeight abi.ChainEpoch = -12
UpgradeTurboHeight abi.ChainEpoch = -13
UpgradeHyperdriveHeight abi.ChainEpoch = -13
UpgradeSmokeHeight abi.ChainEpoch = -1
UpgradeIgnitionHeight abi.ChainEpoch = -2
UpgradeRefuelHeight abi.ChainEpoch = -3
UpgradeTapeHeight abi.ChainEpoch = -4
UpgradeAssemblyHeight abi.ChainEpoch = 10
UpgradeLiftoffHeight abi.ChainEpoch = -5
UpgradeKumquatHeight abi.ChainEpoch = -6
UpgradePricelistOopsHeight abi.ChainEpoch = -7
UpgradeCalicoHeight abi.ChainEpoch = -8
UpgradePersianHeight abi.ChainEpoch = -9
UpgradeOrangeHeight abi.ChainEpoch = -10
UpgradeClausHeight abi.ChainEpoch = -11
UpgradeTrustHeight abi.ChainEpoch = -12
UpgradeNorwegianHeight abi.ChainEpoch = -13
UpgradeTurboHeight abi.ChainEpoch = -14
UpgradeHyperdriveHeight abi.ChainEpoch = -15
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
+1
View File
@@ -6,4 +6,5 @@ import (
_ "github.com/GeertJohan/go.rice/rice"
_ "github.com/golang/mock/mockgen"
_ "github.com/whyrusleeping/bencher"
_ "golang.org/x/tools/cmd/stringer"
)

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