Compare commits

..
4271 Commits
Author SHA1 Message Date
Jennifer Wang 1757ffcb2c Merge branch 'releases' into jen/m1.1 2021-07-27 22:17:34 -04:00
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
Liviu Damian d6783736dc Nerpa v13 upgrade 2021-07-22 23:58:12 -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
Jennifer 283793f943 Merge pull request #6831 from filecoin-project/feat/v1.11.0
Feat/v1.11.0
2021-07-22 05:19:43 -04:00
Łukasz Magiera e7f39a3179 Merge branch 'master' into nonsense/add-sealproof-in-sectorbuilder-master 2021-07-22 11:11:28 +02:00
Jennifer Wang 395451b3e9 Merge branch 'releases' into feat/v1.11.0 2021-07-22 05:05:33 -04:00
Jennifer c9999f7ca2 Merge pull request #6829 from filecoin-project/feat/v11
Release v1.11.0
2021-07-22 04:56:51 -04:00
Anton Evangelatov c60959ea9f fetch peer id from chain 2021-07-22 10:50:55 +02:00
Jennifer Wang e52c639f02 Release v1.11.0 2021-07-22 04:50:31 -04: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 0519cd371e Merge pull request #6665 from filecoin-project/backports/v1.11.0-rc2
Backports for v1.11.0-rc2
2021-07-02 17:09:33 -04:00
Łukasz Magiera acc4888b13 Merge pull request #6667 from filecoin-project/jen/changelogv11
bump version to v1.11.0-rc2
2021-07-02 22:28:43 +02:00
Łukasz Magiera 83114546c6 Merge branch 'backports/v1.11.0-rc2' into jen/changelogv11 2021-07-02 22:28:24 +02:00
Jennifer Wang 68bde33977 update changelog and bump version to v1.11.0-rc2 2021-07-02 16:01:51 -04: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 947c86bd77 set version to v1.11.0-rc2 2021-07-02 20:59:35 +02:00
Łukasz Magiera 6610965f87 storage: Fix FinalizeSector with sectors in stoage paths 2021-07-02 20:57:36 +02: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 da0920584c Fix tiny error in check-client-datacap 2021-07-02 18:29:15 +02:00
zhoutian527 57d70e58f3 Fix: precommit_batch method used the wrong cfg.PreCommitBatchWait 2021-07-02 18:29:09 +02:00
johnli-helloworld dbdbb6f0dd to optimize the batchwait 2021-07-02 18:29:06 +02:00
llifezouandŁukasz Magiera d5b7e81b09 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:29:03 +02:00
llifezouandAayush Rajasekaran 101d152540 Update extern/storage-sealing/states_sealing.go
fix log

Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-07-02 18:29:03 +02:00
llifezou 21528c0a95 fix getTicket: sector precommitted but expired case 2021-07-02 18:29:02 +02:00
llifezou 31c929e7b7 fix ticket expiration check, otherwise it may cause a large number of loops to retry GetTicket when retrying PreCommit1 2021-07-02 18:29:02 +02:00
Łukasz Magiera 3875746f80 commit batch: Regression test nil FailedSectors map 2021-07-02 18:29:00 +02:00
Łukasz Magiera 22f183e8ef commit batch: AggregateAboveBaseFee config 2021-07-02 18:29:00 +02:00
johnli-helloworld e9f3a2f486 handleSubmitCommitAggregate() exception handling 2021-07-02 18:28:56 +02:00
Łukasz Magiera 5f3b21269d gofmt 2021-07-02 18:28:52 +02:00
wangchao 10e00b1ba9 remove precommit check in handleCommitFailed 2021-07-02 18:28:52 +02:00
Jerry c164a9fbdc ensure agg fee is adequate 2021-07-02 18:28:46 +02:00
Jerry a4f65bed41 fix: miner balance is not enough, so that ProveCommitAggregate msg exec failed 2021-07-02 18:28:20 +02:00
Łukasz Magiera af1dd7d2ed commit batch: Initialize the FailedSectors map 2021-07-02 18:28:01 +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 2d123aab47 Lotus version 1.11.0 2021-06-28 22:16:03 -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
Jennifer 764fa9dae6 Merge pull request #6580 from filecoin-project/release/v1.10.0
Release/v1.10.0
2021-06-23 23:37:57 -04:00
Jennifer b3a6dbb5d7 Merge pull request #6578 from filecoin-project/asr/release-v1.10.0
Lotus v1.10.0
2021-06-23 23:21:36 -04:00
Jennifer Wang 28f2f96b65 more edits 2021-06-23 22:29:03 -04:00
Steven Allen 7779d446ce remove hardware suggestion section
This isn't useful in its current state and isn't urgent at this point.
We can publish recommendations later.
2021-06-23 19:18:27 -07:00
Steven AllenandMollyM f5fad636cf Apply edits
Co-authored-by: MollyM <momack2@users.noreply.github.com>
2021-06-23 19:09:43 -07:00
Steven Allen 1411cff69e change mkreleaselog script to only include filecoin-project 2021-06-23 19:03:24 -07:00
Steven Allen efaa7b0d76 update contributors to include all filecoin projects 2021-06-23 19:02:14 -07:00
Steven Allen 64567d7f32 add simulation projections to changelog 2021-06-23 18:49:52 -07:00
Jennifer Wang 559f7f0cc3 add changelog 2021-06-23 20:54:52 -04:00
Aayush Rajasekaran a290982ca0 Lotus version 1.10.0 2021-06-23 20:50:18 -04:00
Jennifer 1c196e7e68 Merge pull request #6579 from filecoin-project/jennijuju-patch-1
Pull actor v5.0.1
2021-06-23 20:36:20 -04:00
Jennifer Wang 85f2fcf2c6 pull actor v5.0.1 2021-06-23 18:51:20 -04:00
Steven Allen 63626e1d0a feat(scripts): add the mkreleaselog script 2021-06-23 15:02:23 -07:00
Łukasz Magiera cb8149e047 Merge pull request #6576 from filecoin-project/feat/max-dealstart-config
Add miner-side MaxDealStartDelay config
2021-06-23 20:26:09 +02: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
Łukasz Magiera 9521c0b773 Add miner-side MaxDealStartDelay config 2021-06-23 19:45:13 +02: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 0e4cd3c599 Merge pull request #6563 from filecoin-project/asr/batch-starter
Always flush when timer goes off
2021-06-23 19:19:30 +02: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
Aayush Rajasekaran 616e5688fc Remove MinPreCommitBatch 2021-06-23 12:30:32 -04: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
Jennifer cd9f6724a5 Merge pull request #6565 from filecoin-project/asr/hyperdrive-epoch
Set HyperDrive upgrade epoch
2021-06-23 00:44:32 -04:00
Aayush Rajasekaran 2dd498297f Set HyperDrive upgrade epoch 2021-06-22 19:34:03 -04:00
Aayush Rajasekaran 93f7cbe587 Add a helpful comment 2021-06-22 19:31:36 -04: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
Aayush Rajasekaran 6ca2a14819 Always flush when timer goes off 2021-06-22 19:16:36 -04:00
Łukasz Magiera 32b986503d Merge pull request #6548 from filecoin-project/feat/maxprice-agg
Update default fees for aggregates
2021-06-23 01:13:48 +02: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
Aayush Rajasekaran 9e4875f210 Merge pull request #6492 from filecoin-project/appimage-v1.10.0-rc3
Appimage v1.10.0 rc3
2021-06-22 15:51:55 -04:00
Jakub Sztandera bf82b96fd8 Update default fees for aggregates
Resolves #6422

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-22 20:20:01 +02: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
Jennifer a641a03908 Merge pull request #6529 from filecoin-project/jen/rc6
version bump to lotus v1.10.0-rc6
2021-06-18 22:59:34 -04:00
Jennifer Wang e1c2567136 docs gen 2021-06-18 22:20:13 -04:00
Jennifer Wang b01189467a version bump to lotus v1.10.0-rc6 2021-06-18 22:05:19 -04:00
Jennifer fd15080ead Merge pull request #6528 from filecoin-project/ntwk/calibration-reset
Upgrade epochs for calibration reset
2021-06-18 22:00:08 -04:00
Travis Person c11a32cf69 Add calibration genesis 2021-06-19 00:53:21 +00:00
Travis Person 65844761b6 Calibration network reset 2021-06-18 23:55:01 +00: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
Łukasz Magiera e7fa8589da Merge pull request #6526 from filecoin-project/fix/reorgch-deadlock
chainstore: Don't take heaviestLk with backlogged reorgCh
2021-06-18 20:18:58 +02: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
Łukasz Magiera 2c2c37a138 chainstore: Don't take heaviestLk with backlogged reorgCh 2021-06-18 19:18:51 +02: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
Łukasz Magiera 085cabcda8 Merge pull request #6524 from filecoin-project/feat/proofs-v8.0.2
Update to proofs v8.0.2 with correct aggregate lengths
2021-06-18 17:15:56 +02:00
Łukasz Magiera 738ac926d1 Update ffi 2021-06-18 16:27:37 +02: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
Łukasz Magiera 5516f3492e ffiwrapper: Assert aggregate length 2021-06-18 12:02:42 +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
Łukasz Magiera 7f00a6e59c Proofs v8.0.2 with fixed aggregate lengths 2021-06-18 11:17:18 +02: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 00372e144d Merge pull request #6519 from filecoin-project/jen/bakcport-6041
Backport #6041 - storagefsm: Fix batch deal packing behavior
2021-06-18 10:43:32 +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
Cory Schwartz d35fcd926f remove temp edits 2021-06-18 00:02:04 -07:00
Cory Schwartz 7f744b2760 require deps 2021-06-17 23:52:34 -07:00
Cory Schwartz 6e8cf9061a temp name 2021-06-17 23:48:35 -07:00
Cory Schwartz 86baa11937 test: build appimage in ci 2021-06-17 23:47:08 -07:00
Cory Schwartz 87f2a41052 only use embed for appimage 2021-06-17 23:46:01 -07:00
yaohcn 7c6736b3ef fix commit finalize failed 2021-06-18 12:09:02 +08:00
Łukasz Magiera 7f247bf553 Self-review cleanup 2021-06-17 20:53:14 -04:00
Łukasz Magiera 0a5a7cf45d storagefsm: Fix too-long log handling 2021-06-17 20:52:46 -04:00
Łukasz Magiera b0128bd99e storagefsm: Fix race spawning more than one new sector at once 2021-06-17 20:52:42 -04:00
Łukasz Magiera 097baeb9b0 Make batch deal input test less flaky 2021-06-17 20:52:09 -04:00
Łukasz Magiera 5c8498b603 storagefsm: Fix batch deal packing behavior 2021-06-17 20:50:14 -04:00
Łukasz Magiera bc27602bea events: Fix handling of multiple matched events per epoch 2021-06-17 20:48:58 -04: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 d250a59576 Merge pull request #6504 from filecoin-project/asr/rc5
Lotus version 1.10.0-rc5
2021-06-16 22:30:29 -04:00
Aayush Rajasekaran 71785f9099 Lotus version 1.10.0-rc5 2021-06-16 22:15:11 -04:00
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 c41ccde73d Merge pull request #6503 from filecoin-project/backport/max-part-per-post
backport: pick the correct partitions-per-post limit
2021-06-16 20:12:14 -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 526674cefa fix: pick the correct partitions-per-post limit 2021-06-16 16:56:30 -07: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
Łukasz Magiera ae26e50682 Merge pull request #6500 from filecoin-project/asr/test-drand-more
Expand on Drand change testing
2021-06-16 21:32:42 +02: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
Aayush Rajasekaran b9f864ba9e Expand on Drand change testing 2021-06-16 14:17:55 -04:00
Łukasz Magiera 9ab9e2a970 Merge pull request #6499 from filecoin-project/asr/cherry-pick-log
Backport Fix logging around mineOne
2021-06-16 19:58:45 +02:00
Łukasz Magiera 55d5c11b03 Merge pull request #6497 from filecoin-project/feat/sealing-batcher-mctx
sealing: Wire up context to batchers
2021-06-16 19:58:10 +02:00
Aayush Rajasekaran 36bc96a6bc Fix docsgen 2021-06-16 13:41:52 -04:00
Jennifer Wang c198e7aa9a make lint happy 2021-06-16 13:39:05 -04:00
Peter Rabbitson ef3ef85960 Add a lateStart indicator, differentiate on Error/Warn/Info 2021-06-16 13:38:59 -04:00
Peter Rabbitson 4007806068 Incorporate the 'Time delta between now...' log into the 'completed mineOne' 2021-06-16 13:38:49 -04:00
Peter Rabbitson 429419f210 Forgotten deadcode 2021-06-16 13:38:39 -04:00
Peter Rabbitson 3acd846dcd 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-06-16 13:38:35 -04: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
Łukasz Magiera 7640ae47de docsgen 2021-06-16 14:51:40 +02: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
Łukasz Magiera 1f914053b4 sealing: Wire up context to batchers 2021-06-16 11:43:06 +02: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
Jennifer Wang c1529714e6 v1.10.0-rc4 have this version base off the right head = v1.9.0 tag 2021-06-15 22:16:41 -04:00
Jennifer 9cb7964a77 Merge pull request #6494 from filecoin-project/asr/merge-releases
Merge releases into v1.10 release
2021-06-15 22:03:13 -04: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 81b412399e sealing: Fix restartSectors race 2021-06-15 17:55:58 -04:00
Łukasz Magiera 74db586fdf sealing: Fix restartSectors race 2021-06-15 17:43:32 -04:00
Aayush Rajasekaran 520a0091f5 Merge branch 'releases' into release/v1.10.0 2021-06-15 17:40:36 -04:00
Łukasz Magiera d8e5359388 Merge pull request #6491 from filecoin-project/fix/fsm-startup-race2
sealing: Fix restartSectors race
2021-06-15 23:16:52 +02: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 21ba7408dd sealing: Fix restartSectors race 2021-06-15 21:20:40 +02:00
Cory Schwartz 2b7e809efe filter build-appimage 2021-06-15 12:20:19 -07:00
Cory Schwartz 9dc67abee6 add make appimage 2021-06-15 12:05:30 -07:00
Cory Schwartz 041bf9990e yaml syntax 2021-06-15 12:01:56 -07:00
Cory Schwartz 45b063648d tmp: test build in circleci 2021-06-15 11:59:47 -07:00
Cory Schwartz ad8b6baa03 bring appimage to v1.10.0-rc3 2021-06-15 11:58:59 -07: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
Jennifer fdd3a85033 Merge pull request #6481 from filecoin-project/hyperdriverc3
update lotus to v1.10.0-rc3
2021-06-14 22:21:12 -04:00
Jennifer Wang a79e6cb8c5 update changelog 2021-06-14 22:16:12 -04:00
Jennifer Wang 9d7f94bc67 make gen happy 2021-06-14 22:02:00 -04:00
Jennifer Wang ad6ddcb590 update lotus version to v1.10.0-rc3 2021-06-14 21:44:03 -04:00
Aayush Rajasekaran bffa716248 Merge pull request #6480 from filecoin-project/asr/ffi-update
Update to fixed Bellperson
2021-06-14 21:09:09 -04:00
Aayush Rajasekaran 18b13f6f58 Update to fixed Bellperson 2021-06-14 20:19:26 -04: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 471c365f36 Merge pull request #6473 from filecoin-project/deps/paramfetch-fslocks
Update to go-praamfetch with fslocks
2021-06-14 19:16:28 +02:00
Łukasz Magiera b00cbcaf5e Update to go-praamfetch with fslocks 2021-06-14 18:54:59 +02:00
Łukasz Magiera 88c49998a8 Merge pull request #6472 from filecoin-project/asr/backport
failed sectors should be added into res correctly
2021-06-14 17:58:32 +02: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
wangchao 4da30931c9 failed sectors should be added into res correctly 2021-06-14 11:33:38 -04:00
Łukasz Magiera 40efafb7cd Update ffi with fixed multicore sdr support 2021-06-14 17:29:21 +02:00
Łukasz Magiera d3594a014b Merge pull request #6471 from filecoin-project/deps/proofs-8.0.1
Update ffi with fixed multicore sdr support
2021-06-14 17:28:17 +02:00
Łukasz Magiera ff43d29bbd Update ffi with fixed multicore sdr support 2021-06-14 16:59:55 +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
Łukasz Magiera 38dc0eee32 Merge pull request #6453 from filecoin-project/feat/mpool-metrics
mpool: Add more metrics
2021-06-14 12:28:39 +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
Łukasz Magiera 7f8718d805 Merge pull request #6452 from filecoin-project/feat/early-finalize
sealing: Early finalization option
2021-06-11 18:16:43 +02:00
Łukasz Magiera 534badad2a mpool: Add more metrics 2021-06-11 13:19:26 +02:00
aarshkshah1992 ea9bed2746 undo ffi change 2021-06-11 16:22:09 +05:30
Łukasz Magiera 733240a2bb sealing: Test early finalization fsm planners 2021-06-11 11:52:00 +02:00
Łukasz Magiera 94be3a973a Don't enable early finalization by default 2021-06-11 11:45:20 +02:00
Łukasz Magiera 05d9b5ce0f sealing: Add missing planner for CommitFinalizeFailed 2021-06-11 11:44:37 +02:00
Łukasz Magiera ec06f086ef sealing: Early finalization option 2021-06-11 11:41:28 +02:00
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 Wang 8f426b49ec updated configuration comments for docs 2021-06-09 23:36:44 -04: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
Aayush Rajasekaran cdca6d09ea Merge pull request #6443 from filecoin-project/asr/rc2
Lotus version 1.10.0-rc2
2021-06-09 23:33:11 -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 c4c71802f2 Lotus version 1.10.0-rc2 2021-06-09 23:31:52 -04:00
Aayush Rajasekaran fa440a1ca6 Merge pull request #6442 from filecoin-project/feat/ntwk13-calib
Set ntwk v13 HyperDrive Calibration upgrade epoch
2021-06-09 23:30:48 -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 0379adc9f1 Set ntwk v13 HyperDrive Calibration upgrade epoch 2021-06-09 23:27:58 -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
Łukasz Magiera 126d5cdfb8 Merge pull request #6438 from filecoin-project/feat/proofs-v8.0.1
Proofs v8.0.1
2021-06-10 00:27:01 +02:00
Łukasz Magiera 52199c9af3 Proofs v8.0.1 2021-06-10 00:17:13 +02:00
Łukasz Magiera bb4eee41d0 Merge pull request #6437 from filecoin-project/asr/specs-update
Update to specs-actors v5-rc-3
2021-06-10 00:16:07 +02:00
Łukasz Magiera 567d5cf587 Merge pull request #6436 from filecoin-project/asr/merge-master
Merge backported PRs into v1.10 release branch
2021-06-10 00:15:47 +02:00
Raúl Kripalani 6e4eae69ac fix merge error that led to test failures. 2021-06-09 23:11:34 +01:00
Aayush Rajasekaran 29ebdc07c9 Update to specs-actors v5-rc-3 2021-06-09 18:07:46 -04:00
wangchao 626d482990 correct the change of message size limit 2021-06-09 18:05:16 -04: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
Jakub Sztandera 18043810c0 Create MaxMessageSize constant
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-09 14:24:42 -04:00
Jakub Sztandera 0cd0faa6fb Increase message size limit
Add test

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-09 14:24:38 -04:00
Łukasz Magiera f0a2e97cb5 fee config for sector batching 2021-06-09 14:23:06 -04:00
Aayush Rajasekaran dede1b4758 Merge branch 'release/v1.10.0' into asr/merge-release 2021-06-09 14:05:41 -04:00
Łukasz Magiera 69ec16f634 Merge pull request #6428 from filecoin-project/asr/aggregate-fee
Fund miners with the aggregate fee when ProveCommitting
2021-06-09 19:33:31 +02:00
Łukasz Magiera f75922fd3d Merge pull request #6416 from filecoin-project/asr/sector-cutoffs
Commit and Precommit batcher cannot share a getSectorDeadline method
2021-06-09 19:27:06 +02: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
Aayush Rajasekaran b0c9dd49f0 Fund miners with the aggregate fee when ProveCommitting 2021-06-09 13:08:54 -04: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
Aayush Rajasekaran dbb4e9fcc5 Drop soms logs 2021-06-09 12:26:20 -04: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
Aayush Rajasekaran 71909c5642 Fix nerpa build 2021-06-08 16:46:53 -04:00
Aayush Rajasekaran ba27d45214 Split the getSectorCutoff methods between precommit and commit batchers 2021-06-08 16:46:35 -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
Aayush Rajasekaran b13169f071 Rename deadlines to cutoffs in the batchers 2021-06-07 20:20:06 -04:00
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 4a321c6da2 Fix nerpa build 2021-06-02 19:19:32 -04:00
Aayush Rajasekaran cd4505dd63 Update to specs-actors v5-rc-2 2021-06-02 19:11:47 -04:00
Aayush Rajasekaran 1f10600f13 Lotus version 1.10.0-rc1 2021-06-02 19:04:17 -04:00
Łukasz Magiera d5002d7395 Merge pull request #6381 from filecoin-project/asr/specs-update
Update to actors v5rc2
2021-06-02 21:50:26 +02:00
Aayush Rajasekaran 55193bf36d Merge branch 'release/v1.9.0' into asr/specs-update 2021-06-02 14:58:14 -04:00
Aayush Rajasekaran 6854cc5944 Update to specs-actors v5-rc-2 2021-06-02 14:51:49 -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 f6963523f8 Use filecoin-ffi master 2021-06-02 11:13:24 +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
Łukasz Magiera fa8beeac2b Merge pull request #6371 from filecoin-project/fix/robustify-commit-batcher
Fix tests
2021-06-01 21:01:03 +02:00
Aayush Rajasekaran 39f2246ae6 Use build.UpgradeHyperDriveHeight directly when sourcing randomness in VM 2021-06-01 14:43:46 -04:00
Łukasz Magiera 8b84e499c5 storagefsm: Handle preCommitParams errors better 2021-06-01 20:36:20 +02:00
Łukasz Magiera b6b56320bf Fix StateComputeDataCommitment 2021-06-01 20:34:24 +02:00
Aayush Rajasekaran c8cef1cb7e Fix chain/gen randomness getting (test only) 2021-06-01 13:44:08 -04:00
Łukasz Magiera 66c1554670 vm syscalls: fix typo 2021-06-01 19:23:12 +02:00
Łukasz Magiera 5c5b8866c7 gofmt 2021-06-01 19:14:08 +02:00
Łukasz Magiera 8072573292 Fix TestWindowPostDispute 2021-06-01 19:11:32 +02:00
Aayush Rajasekaran 49fce48c3e Tweak CallVM to use current epoch, not future epoch 2021-06-01 12:43:16 -04: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 d69032b2f0 Merge pull request #6367 from filecoin-project/fix/robustify-commit-batcher
Robustify commit batcher
2021-06-01 17:49:46 +02: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
Łukasz Magiera 5a9e6c8142 Merge pull request #6364 from filecoin-project/asr/resolve-messages
Improve address resolution for messages
2021-06-01 14:38:31 +02:00
Łukasz Magiera 482e1110c2 precommit batcher: Improve error propagation 2021-06-01 14:35:30 +02:00
Łukasz Magiera 5c3ebd424c miner: Improve batching CLI UX 2021-06-01 12:33:24 +02:00
Łukasz Magiera cb4eb487f4 commit batcher: Fix min aggregate size check 2021-06-01 12:27:22 +02:00
Łukasz Magiera cd0a1c97fa Improve cli for flushing commit batches 2021-06-01 12:25:19 +02:00
Łukasz Magiera 084b0e7f60 Handle collateral when submitting aggregated commits 2021-06-01 12:09:15 +02:00
Łukasz Magiera 9fcb564bef Make commit batcher more robust 2021-06-01 11:56:19 +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
Łukasz Magiera b149eb8d02 Merge pull request #6366 from filecoin-project/asr/post-tests
Fix supported proof type manipulations for v5 actors
2021-06-01 10:25:26 +02:00
Jennifer Wang fcfc214ed1 Use MockSbBuilder 2021-05-31 20:14:11 -04:00
Aayush Rajasekaran 85873f6057 Wdpost run should respect AddressedPartitionsMax 2021-05-31 19:28:49 -04:00
Aayush Rajasekaran 2ab24b358d Fix supported proof type manipulations for v5 actors 2021-05-31 18:50:29 -04:00
Mimir ee508120d9 Typo fix in error message: "pubusb" -> "pubsub" 2021-05-31 15:30:10 -07:00
Aayush Rajasekaran 621e4eab0d Address review 2021-05-31 18:13:23 -04:00
Aayush Rajasekaran 9ceee6028b More tweaking of context handling in the messagepool 2021-05-31 18:13:23 -04:00
Aayush Rajasekaran 183c12db25 Make mempool reject ID addresses that are not reorg-stable 2021-05-31 18:13:23 -04:00
Aayush Rajasekaran ed93d0725f Protect mp.localAddrs and mp.pending behind helper functions 2021-05-31 18:13:23 -04:00
Aayush Rajasekaran 1f03a618f9 Plumb contexts through 2021-05-31 18:13:23 -04:00
Aayush Rajasekaran 8d991283f4 Resolve to ID addresses when handling message selection 2021-05-31 18:13:23 -04: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 e8825287d2 Merge pull request #6351 from filecoin-project/asr/verifreg-ux
Add verifreg utils to CLI
2021-05-31 21:06:27 +02:00
Aayush Rajasekaran 92f544d96c Add verifreg utils to CLI 2021-05-31 15:01:55 -04: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 2a1b35e694 Merge pull request #6361 from filecoin-project/asr/fip-0015
Implement FIP-0015
2021-05-31 20:58:21 +02:00
Łukasz Magiera 5349789a19 Merge pull request #6349 from filecoin-project/asr/runtime-basefee
Update to latest actors
2021-05-31 20:51:27 +02:00
Aayush Rajasekaran 61554cf3e0 Update to latest actors 2021-05-31 14:47:41 -04: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
Aayush Rajasekaran 7fca1c1ee7 Implement FIP-0015 2021-05-31 14:40:54 -04: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 0413022196 Merge pull request #6362 from filecoin-project/fix/evt-many-called-epoch-1.10
events: Fix handling of multiple matched events per epoch
2021-05-31 20:22:02 +02:00
Łukasz Magiera 8003a8a2d0 events: Fix handling of multiple matched events per epoch 2021-05-31 20:17:50 +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
Łukasz Magiera cc90b61dfc Merge pull request #6350 from filecoin-project/asr/deal-start
Extend the default deal start epoch delay
2021-05-31 12:51:31 +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
Aayush Rajasekaran fba5c65ffd Extend the default deal start epoch delay 2021-05-28 12:35:48 -04:00
Łukasz Magiera dd79c2c41a Merge pull request #6347 from filecoin-project/feat/agg-gas-price
Introduce gas prices for aggregate verifications
2021-05-28 12:40:16 +02:00
Łukasz Magiera 54e4cf564c Merge pull request #6240 from filecoin-project/asr/not-hack-drand
Fix randomness fetching around null blocks
2021-05-28 12:36:25 +02: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
Aayush Rajasekaran 10b931312b Fix edgecase in tipset skipcache 2021-05-27 13:44:37 -04:00
Jakub Sztandera cb59daf3c1 Introduce gas prices for aggregate verifications
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-05-27 17:51:01 +02: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
Aayush Rajasekaran 21b4741e30 Fix randomness fetching around null blocks 2021-05-26 21:06:06 -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 2b93bcde72 Merge pull request #6235 from filecoin-project/feat/fip-0013
WIP: Integrate FIP0013
2021-05-26 11:04:15 +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
Łukasz Magiera fc76a09b19 mock: Use real aggregate lengths 2021-05-26 10:06:41 +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
Łukasz Magiera 4c6c9a0edb Fix windowpost/deadline tests 2021-05-25 21:27:32 +02: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
Łukasz Magiera 7bd0fcbb24 sealing: Don't start batch timers with empty batches 2021-05-25 16:47:42 +02:00
Łukasz Magiera 04658e1cae fix lint 2021-05-25 16:26:59 +02:00
Łukasz Magiera d90ab2b81f config: Document batching fields 2021-05-25 16:20:49 +02:00
Łukasz Magiera f5409845b5 Some review addressing 2021-05-25 16:07:45 +02: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
Łukasz Magiera e3255a06ea sealing: Add missing states to SubmitPreCommitBatch planner 2021-05-20 18:39:59 +02:00
Łukasz Magiera 13ff6ed462 Test pledging before nv13 upgrade 2021-05-20 18:38:33 +02:00
Łukasz Magiera f3fda4ae7f Better asserts in TestPledgeBatching 2021-05-20 18:25:47 +02:00
Łukasz Magiera d71334cc24 Address self-review 2021-05-20 18:04:07 +02: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
Łukasz Magiera bb889a5976 sealing: Fix max commit batch size check 2021-05-20 12:11:11 +02:00
Łukasz Magiera 678812f35b gofmt, lint 2021-05-20 12:05:04 +02:00
Łukasz Magiera 7edffcd37b Update ffi 2021-05-20 11:06:40 +02:00
Łukasz Magiera 44bf9bf903 tests: Better state logging in pledgeSectors 2021-05-20 10:39:00 +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
Łukasz Magiera 51139361c7 sealing: Handle full batches correctly 2021-05-19 20:34:50 +02:00
Łukasz Magiera e088c71b9a marketadapter: Handle batch sealing messages 2021-05-19 20:07:20 +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
Łukasz Magiera 2a1b359ede config: fmt 2021-05-19 15:20:34 +02:00
Łukasz Magiera a5677d1b7a ffiwrapper: Separate Prover interface 2021-05-19 15:20:23 +02:00
Łukasz Magiera eafaf6d236 Don't block on batching in node tests 2021-05-19 14:33:15 +02:00
Łukasz Magiera 2a0c0e379b Working default batching config 2021-05-19 14:32:41 +02: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
Łukasz Magiera 5112b9fe2b Lower default batch slack 2021-05-18 21:04:47 +02:00
Łukasz Magiera dd393b470f Fix aggregation inputs 2021-05-18 20:36:47 +02:00
Łukasz Magiera 0419c64a06 CLI for precommit batching 2021-05-18 20:35:35 +02:00
Łukasz Magiera e400bdf87a Order proofs before aggregation 2021-05-18 18:58:41 +02:00
Łukasz Magiera 9690bc882c Test to trigger batching logic 2021-05-18 18:41:42 +02:00
Łukasz Magiera 1946d2ffd4 Wire up Precommit Batching 2021-05-18 17:37:52 +02:00
Łukasz Magiera f66b9c5663 Maybe working precommit batching 2021-05-18 17:21:16 +02:00
Łukasz Magiera d92c5e1001 Missing precommit batcher 2021-05-18 16:54:55 +02:00
Łukasz Magiera 81b5d8c671 Make things build with both batchers 2021-05-18 16:53:49 +02:00
Łukasz Magiera c7ba083fa4 Import precommit batcher 2021-05-18 16:51:06 +02:00
Łukasz Magiera 56145201db Merge pull request #6282 from filecoin-project/feat/fip-0013-addenda
FIP 13 addenda: correctly handle commit batch timer
2021-05-18 16:23:23 +02:00
vyzo c544f4ce44 avoid extraneous rpc call for storage start epoch 2021-05-18 16:59:11 +03:00
vyzo 7512748b56 wire in sealing config values 2021-05-18 15:31:52 +03:00
vyzo 6b3e04b9b1 cache sector deadlines. 2021-05-18 15:28:51 +03:00
vyzo 74bad49068 correctly handle commit batch timer 2021-05-18 14:30:47 +03:00
Łukasz Magiera fe9311e435 update ffi 2021-05-18 13:24:10 +02:00
Łukasz Magiera e56960f245 Merge pull request #6281 from filecoin-project/feat/fip-0013-addenda
FIP 0013 addenda
2021-05-18 12:45:40 +02:00
vyzo 357c0868b7 proper config for termination batching and commit wait 2021-05-18 12:20:19 +03:00
vyzo febf7cf28f sane config defaults 2021-05-18 12:02:53 +03: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 Wang ada7f97ba8 docsgen 2021-05-17 16:51:55 -04:00
Łukasz Magiera ba2032c642 Fix some aggregation bugs 2021-05-17 22:51:29 +02:00
Jennifer Wang 5af3af5a22 Merge branch 'release/v1.9.0' into releases 2021-05-17 16:16:34 -04:00
Łukasz Magiera 2afe725933 Get PreCommitting to work 2021-05-17 22:02:23 +02:00
Jennifer 3ac3396125 Merge pull request #6271 from filecoin-project/feat/v1.9.0-final
v1.9.0 release
2021-05-17 15:48:02 -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 578bef4f83 Update gen 2021-05-17 20:56:28 +02:00
Łukasz Magiera 6278bdc69a Make things build 2021-05-17 20:47:41 +02:00
Jennifer Wang 1cade911f6 docsgen 2021-05-17 14:08:36 -04:00
Łukasz Magiera 8f42f375cf Update ffi 2021-05-17 19:55:44 +02:00
Jennifer Wang 96c3401231 bump the version to v1.9.0 2021-05-17 13:55:05 -04:00
Łukasz Magiera 71bd005594 wip 2021-05-17 13:31:43 -04:00
Aayush Rajasekaran 5f8c80533a Update to latest actors and FFI 2021-05-17 13:15:07 -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 d434a62cd4 Merge pull request #6261 from filecoin-project/fix/ci-build
Bring 6256 to release branch and bump the version
2021-05-14 22:35:34 -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
Jennifer Wang a4b1dd0f88 docsgen 2021-05-14 22:26:11 -04:00
Jennifer Wang 7b95649cab bump the version to v1.9.0-rc5 2021-05-14 22:22:30 -04:00
Mike Greenberg 6c8c732104 fix(ci): Use recent ubuntu LTS release; Update release params 2021-05-14 22:21:16 -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 56c201348a Merge pull request #6249 from filecoin-project/jen/backport-to-rc
Upgrade nerpa to actor v4 and bump the version to rc4
2021-05-13 18:28:13 -04:00
Jennifer Wang 2191517786 update change log 2021-05-13 18:09:31 -04:00
Jennifer Wang 3535c2dba8 docsgen 2021-05-13 18:02:54 -04:00
Jennifer Wang 1c4ddcd409 Pull the nerpa upgrade pr and update the version to rc4 2021-05-13 17:48:55 -04:00
Jennifer Wang efb078947a Upgrade nerpa to actor v4 around May 27th 1600 ET 2021-05-13 17:48:03 -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 4c0ece20cc Merge pull request #6245 from filecoin-project/asr/cherry-pick-rcs
chore(ci): Enable build on RC tags
2021-05-13 16:09:44 -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
Mike Greenberg 1f651b84ce chore(ci): Enable build on RC tags 2021-05-13 12:36:54 -04: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
Łukasz Magiera 506f39b294 WIP: Integrate FIP0013 2021-05-11 22:10:29 -04: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 b19d6cde11 Merge pull request #6195 from filecoin-project/asr/v5-skeleton
Introduce v5 actors
2021-05-10 20:15:00 -04: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 b5da2655dc Introduce v5 actors 2021-05-10 19:44:28 -04:00
Łukasz Magiera 63189cd81d Generate wrappers for new actor versions 2021-05-09 21:04:50 -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
Jennifer 1e1e0cc93e Merge pull request #6210 from filecoin-project/fix/version
Bump the version to v1.9.0-rc3
2021-05-07 11:19:43 -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
Jennifer Wang 0398e556d4 Bump the version 2021-05-07 11:09:06 -04: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
Jennifer 16a9baa3bb Merge pull request #6200 from filecoin-project/feat/proofv7.0.1
Update to proof v7.0.1
2021-05-06 21:46:06 -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
Jennifer Wang b1d046ce16 Update to proof v7.0.1 2021-05-06 17:31:15 -04: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 19da73d56f Merge pull request #6183 from filecoin-project/feat/more_mining_log
Add a mining-heartbeat INFO line at every epoch
2021-05-05 19:59:20 -04:00
Peter Rabbitson 26841aa094 mining lookback is effectively a constant - make it so 2021-05-05 23:23:01 +02:00
Peter Rabbitson 3b0fc01e82 Log more ComputeVRF() inputs as per Why's request 2021-05-05 23:23:01 +02:00
Peter Rabbitson 14f6d170b2 Add a mining-heartbeat INFO line at every epoch 2021-05-05 23:23:01 +02:00
Jennifer b14c467fb4 Update documentation/misc/RELEASE_ISSUE_TEMPLATE.md 2021-05-05 14:28:48 -04:00
Jennifer d190b3a8a6 Merge pull request #6188 from filecoin-project/feat/gpu-enabled-proofs
Update to new proofs with gpu support enabled in release binaries
2021-05-05 13:55:56 -04:00
Travis Person 323bb02ca5 Update to new proofs with gpu support enabled in release binaries 2021-05-04 20:31:26 +00: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
Aayush Rajasekaran ba63b93026 Fix 1.9.0-rc2 date 2021-04-30 14:34:03 -04:00
Aayush Rajasekaran 84251b668a Merge pull request #6160 from filecoin-project/asr/changelog
Lotus version 1.9.0-rc2
2021-04-30 14:32:01 -04:00
Aayush Rajasekaran 8227085c37 Lotus version 1.9.0-rc2 2021-04-30 14:06:10 -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 15b8978805 Merge pull request #6151 from filecoin-project/release/v1.9.0-proofs-v7
Update ffi to proofs v7 (release v1.9.0)
2021-04-30 17:57:49 +02:00
Łukasz Magiera 7c37618b50 Update ffi to proofs v7 2021-04-30 14:30:12 +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 95e0c3df1d 1.9.0-rc1 2021-04-27 10:30:51 +02:00
Łukasz Magiera a24a73bb52 Merge tag 'v1.8.0' into release/v1.9.0 2021-04-27 10:30:33 +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
Aayush Rajasekaran b79861c1ad Merge branch 'master' into releases 2021-04-27 04:14:36 -04:00
Łukasz Magiera 5c56017dbb Merge pull request #6116 from filecoin-project/release/v1.8.0
Lotus v1.8.0
2021-04-27 09:01:34 +02:00
Łukasz Magiera dc75ad315f Merge pull request #6117 from filecoin-project/feat/nv12-1.11
Actors v4
2021-04-27 08:47:07 +02:00
Łukasz Magiera 1a980bf971 bump version 2021-04-27 08:39:05 +02:00
Łukasz Magiera c4137a438d Merge commit 'f1ded63d608e1b191d79c780b8065f8cff367c98' into feat/nv12-1.11 2021-04-27 08:22:55 +02:00
Aayush Rajasekaran 5019fa4cdd Lotus version 1.8.0 2021-04-27 02:02:49 -04:00
Aayush Rajasekaran f1ded63d60 v4 specs-actors integration, nv12 migration 2021-04-27 02:02:44 -04:00
Łukasz Magiera 86d9372b30 Merge pull request #6114 from filecoin-project/docs/api-makegen
api: Document API change process
2021-04-26 21:05:35 +02:00
Łukasz Magiera bfa332ca7d api: Document API change process 2021-04-26 20:36:20 +02:00
Łukasz Magiera c88eeaaf02 Merge pull request #6112 from filecoin-project/ux/inspect-deal-estimates
add "expected duration" label to inspect-deals output
2021-04-26 20:08:33 +02:00
Yusef Napora 66e8517769 add "expected duration" label to inspect-deals output 2021-04-26 13:02:29 -04:00
Łukasz Magiera abc88828f6 Merge pull request #6110 from filecoin-project/misc/update-codeowners
Update CODEOWNERS
2021-04-26 18:58:21 +02:00
Łukasz Magiera 17e5d61b96 Update CODEOWNERS 2021-04-26 18:54:23 +02:00
Łukasz Magiera bd753938f5 Update CODEOWNERS 2021-04-26 18:45:55 +02:00
Łukasz Magiera 86d4f5f738 Merge pull request #6075 from filecoin-project/feat/gateway-walletbalance
implement WalletBalance on gateway
2021-04-23 16:00:54 +02:00
Łukasz Magiera 21de8b2bd3 Merge pull request #6092 from filecoin-project/asr/shed-util-sanity
Shed util to sanity-check total balance is FilBase
2021-04-23 16:00:13 +02:00
Łukasz Magiera ad3c588582 Merge pull request #6090 from filecoin-project/feat/rtvl-prov-unseal-logging
Add more debug logging for unsealing
2021-04-23 15:59:14 +02:00
Łukasz Magiera e5d8ae7a9a Merge pull request #6096 from Reskorey/master
fix full node painc
2021-04-23 12:08:30 +02:00
Reskorey 58bee65bcb go fmt 2021-04-23 16:10:51 +08:00
Reskorey 7738886936 fix full node painc
fix: full node painc  when calling  RPC  Filecoin.ClientRetrieve without the order.Tatol pecified.
2021-04-23 15:43:41 +08:00
Aayush Rajasekaran 448b5cb2a3 Shed util to sanity-check total balance is FilBase 2021-04-22 19:45:35 -04:00
Dirk McCormick 61344644a4 feat: add more debug logging for unsealing 2021-04-22 11:33:28 +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
Cory Schwartz fbd003a22b add walletbalance to v0api 2021-04-21 09:46:44 -07:00
Cory Schwartz 39e49f1700 implement WalletBalance on gateway 2021-04-20 21:55:47 -07:00
Łukasz Magiera ad0fdd5ec5 Merge pull request #6072 from filecoin-project/fix/gateway-api-getter
gateway: Fix api getter
2021-04-20 22:07:09 +02:00
Łukasz Magiera 508e2d5c49 gateway: Fix api getter 2021-04-20 18:42:12 +02: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
Łukasz Magiera 2e63690125 Merge pull request #6056 from filecoin-project/feat/vm-metrics
stmgr: Improve ApplyBlocks metrics
2021-04-18 17:07:16 +02:00
Łukasz Magiera c7a67cf0e1 Merge pull request #6059 from filecoin-project/frrist/expose-filReserveDisbursed
polish(api): expose filReserveDisbursed via CirculatingSupply API
2021-04-18 16:31:03 +02:00
Łukasz Magiera 03df99f2f5 make gen 2021-04-18 16:27:23 +02:00
Łukasz Magiera c72eb0ccaf Merge pull request #6048 from filecoin-project/fix/nonce-getting
Fix nonce getting on Lotus lite
2021-04-18 16:25:47 +02:00
Łukasz Magiera bb7801e6b7 fix lint 2021-04-18 16:17:31 +02:00
Łukasz Magiera bfecc35e65 Merge pull request #6051 from filecoin-project/test/bls-vectors
sigs: vector tests for bls
2021-04-18 16:14:44 +02:00
Łukasz Magiera 5e71bcedc2 Merge pull request #6052 from filecoin-project/fix/miner-v1api-check
Fix v0/v1 API versions
2021-04-17 21:58:38 +02:00
Łukasz Magiera 6762f562d6 Merge pull request #6060 from filecoin-project/chore/raise-default-client-maxfee
Raise client MaxFee default
2021-04-17 19:11:11 +02:00
Peter Rabbitson dab2a41792 Raise client MaxFee default
The original value is too conservative for the current state of mainnet
Resolves (temporarily) #5543
2021-04-17 00:35:40 +02:00
frrist c118415b12 polish(api): expose filReserveDisbursed via CirculatingSupply API
- motivated by: https://github.com/filecoin-project/sentinel-visor/issues/462
2021-04-16 15:15:38 -07:00
Jakub Sztandera 66c408938b Fix signature in messagepool, wire in context
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-04-16 18:43:28 +02:00
Łukasz Magiera f97784ad48 Merge pull request #6053 from kwuaint/patch-1
Remove the usless commented code
2021-04-16 17:09:21 +02:00
Łukasz Magiera 1b696aae5f stmgr: Fix VMApplyEarly metric 2021-04-16 14:57:59 +02:00
Kwuaint 0e6fe26975 Remove the usless commented code
Remove the usless commented code
2021-04-16 11:43:18 +08:00
Łukasz Magiera 4436c184ed Fix v0/v1 API versions 2021-04-16 00:20:13 +02:00
Łukasz Magiera 35cf83d519 Merge pull request #6047 from filecoin-project/feat/client-collat-bounds
Adjust client deal collateral overestimation to 1.2
2021-04-15 23:51:32 +02:00
Łukasz Magiera 6a775dfe6e Merge pull request #6050 from filecoin-project/flake/checkpoint
Disable flaky checkpoint tests
2021-04-15 23:26:59 +02:00
Łukasz Magiera e006310c6f sigs: vector tests for bls 2021-04-15 23:02:21 +02:00
Jakub Sztandera fd0eb2ec8f Disable flaky checkpoint tests
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-04-15 19:59:25 +02:00
Jakub Sztandera 77d004ec06 Fix nonce getting on Lotus lite
Resolves #5593 #5995

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-04-15 19:57:09 +02:00
Łukasz Magiera 53537a0af2 stmgr: Improve ApplyBlocks metrics 2021-04-15 19:44:13 +02:00
Dirk McCormick 47145b6b82 fix: adjust client deal collateral overestimation to 1.2 2021-04-15 15:51:31 +02: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 50b4ea3083 Merge pull request #5685 from filecoin-project/feat/v1-api
V1 API staging branch
2021-04-13 15:44:01 +02:00
Łukasz Magiera cc55aba193 Docsgen 2021-04-13 14:25:03 +02:00
Łukasz Magiera e76935147f Merge remote-tracking branch 'origin/master' into feat/v1-api 2021-04-13 14:24:22 +02:00
Łukasz Magiera 9e600eac7e Merge pull request #6028 from filecoin-project/chore/bump-v1.8
Bump master version to 1.7.1-dev
2021-04-13 14:10:43 +02:00
Łukasz Magiera 578505427b Bump version to 1.7.1-dev 2021-04-13 13:32:26 +02:00
Łukasz Magiera 77f6d7c6b8 Merge pull request #6021 from jfcg/master
Create codeql-analysis.yml
2021-04-13 13:14:42 +02:00
Łukasz Magiera 7d8ee0d65a Lotus v1.7.0-rc1 2021-04-13 12:59:11 +02: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
Łukasz Magiera 8c27a6fdea Merge pull request #6024 from filecoin-project/asr/newest-network
Newest network version is now 11
2021-04-13 11:42:24 +02:00
Łukasz Magiera 335a2df062 Merge pull request #6006 from filecoin-project/asr/proofs-update
Update to latest proofs
2021-04-13 11:27:02 +02:00
Łukasz Magiera 8abd09e844 docsgen 2021-04-13 11:14:36 +02:00
Aayush Rajasekaran 732bccae59 Newest newtork version is now 11 2021-04-12 18:13:40 -04:00
Serhat Şevki Dinçer 8ce9412b2b rm schedule, python, js from codeql 2021-04-12 22:14:14 +03:00
Serhat Şevki Dinçer a9e8695e86 Create codeql-analysis.yml 2021-04-12 15:28:29 +03:00
Łukasz Magiera b54b1303f9 Merge pull request #5962 from filecoin-project/fix/storagefsm-allow-broken-global
storagefsm: Apply global events even in broken states
2021-04-11 22:30:56 +02:00
Łukasz Magiera 73bbd3d98a Merge pull request #6011 from yaohcn/fix-health-report
fix health report
2021-04-11 22:23:40 +02:00
Łukasz Magiera 3156bfd744 Merge pull request #5970 from filecoin-project/feat/v1api-msgwait-cleanup
V1 API: Support api changes, cleanup msg wait/search api
2021-04-11 12:12:21 +02:00
yaohcn 844d1d364d fix health report 2021-04-11 14:47:04 +08:00
Aayush Rajasekaran ff48a70ed9 Speed up StateListMessages in some cases 2021-04-10 02:33:34 -04:00
Aayush Rajasekaran c1e4eb3b20 Add a whitelisted block 2021-04-10 02:12:38 -04:00
Aayush Rajasekaran 470bd307c3 add a shed util to verify BLS signatures 2021-04-10 01:40:24 -04:00
Aayush Rajasekaran 738cc2555c Update FFI 2021-04-10 01:40:24 -04:00
Łukasz Magiera 1e6bba5388 Merge pull request #5943 from filcloud/4857-set-addrs
fix 4857: show help for set-addrs
2021-04-10 02:00:34 +02:00
Łukasz Magiera 88bdb591d5 Merge pull request #6003 from filecoin-project/fix/fbs-di
Fix fallback chainstore
2021-04-10 01:58:38 +02:00
Łukasz Magiera 8fc0aa0575 Merge pull request #5941 from filecoin-project/feat/markets-v1.2.5-rc1
Update to go-fil-markets-v1.2.5
2021-04-09 21:11:58 +02:00
Łukasz Magiera 9d4935a736 Merge pull request #5976 from filecoin-project/fix/storage-demote-stat-err
localstorage: Demote reservation stat error to debug
2021-04-09 21:08:08 +02:00
Łukasz Magiera 44fee61c62 Merge pull request #5999 from filecoin-project/asr/nits
Add description to the client deal CLI command
2021-04-09 19:03:34 +02:00
Łukasz Magiera 7e4cb9da84 Fix fallback chainstore 2021-04-09 16:11:02 +02:00
Aayush Rajasekaran 18d40e62f9 Add description to the client deal CLI command 2021-04-09 00:58:29 -04:00
Łukasz Magiera 8a19ddbb9f Merge pull request #5992 from FinnZhang/remove-CapGasFee-duplicate-code
remove messagepool CapGasFee duplicate code
2021-04-08 16:46:52 +02:00
Dirk McCormick 4a3261a986 feat: go-fil-markets-v1.2.5-rc1 2021-04-08 14:34:35 +02:00
FinnZhang 9805758e8a remove messagepool CapGasFee duplicate code 2021-04-08 17:50:19 +08: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
FrankandŁukasz Magiera 2dbd597f82 Update cmd/lotus-storage-miner/actor.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-04-08 11:14:53 +08:00
Peter Rabbitson a40fb1e1dd Merge pull request #5974 from filecoin-project/chore/move_to_ipfs_log_v2
Centralize everything on ipfs/go-log/v2
2021-04-06 18:01:36 +02:00
zgfzgf 640d6fa474 optimize code 2021-04-06 22:40:05 +08:00
Łukasz Magiera bed5ec81bd localstorage: Demote reservation stat error to debug 2021-04-06 16:06:47 +02:00
Łukasz Magiera 9fb345af67 storagefsm: Test applying global events in broken state 2021-04-06 15:38:13 +02:00
Łukasz Magiera be85e561e1 Merge pull request #5972 from filecoin-project/chore/rm_cached_bs
CachedBlockstore is not referenced as of 3795cc2bd2
2021-04-06 15:31:54 +02:00
Łukasz Magiera 2eda5e8284 Merge pull request #5971 from filecoin-project/chore/switch_lock_to_rw
Convert the chainstore lock to RW
2021-04-06 15:27:20 +02:00
Peter Rabbitson 25a77d905d Centralize everything on ipfs/go-log/v2
I am not entirely sure this is right, but everything seems to build...
2021-04-06 15:04:32 +02:00
Łukasz Magiera cf96ad4fdb fix lint 2021-04-06 14:30:49 +02:00
Łukasz Magiera a5921a9bf9 fix lotus-soup build 2021-04-06 13:30:36 +02:00
Peter Rabbitson a5fd552a0c CachedBlockstore is not referenced as of 3795cc2bd2 2021-04-06 13:24:49 +02:00
Peter Rabbitson 7bced1532b Convert the chainstore lock to RW
High read-API concurrency facilitates multiple calls to GetHeaviestTipSet
which in turn could slow down chainsync.
2021-04-06 13:01:48 +02:00
Łukasz Magiera c3736f40fe gateway: use correct path in serveRpc 2021-04-06 12:29:11 +02:00
Łukasz Magiera e8f28d7b9f Fix tests 2021-04-06 12:24:58 +02:00
Łukasz Magiera 79194ccad1 Merge pull request #5967 from filecoin-project/asr/release-master
Merge releases into master
2021-04-06 12:21:42 +02:00
Frank 4403158680 add unset for set-addrs 2021-04-06 11:24:32 +08:00
Aayush Rajasekaran 37ca23d9e2 Merge branch 'releases' into asr/release-master 2021-04-05 17:29:19 -04:00
Aayush Rajasekaran 3fc23a785c Update changelog to 1.6.0 2021-04-05 15:30:28 -04:00
Aayush Rajasekaran 96d7efee6e Merge pull request #5965 from filecoin-project/release/v1.6.0
Land Lotus v1.6.0
2021-04-05 15:27:43 -04:00
Aayush Rajasekaran 301b5a25fc Merge pull request #5959 from filecoin-project/asr/changelog
Lotus v1.6.0
2021-04-05 15:24:05 -04:00
Aayush Rajasekaran f7757376d0 Merge pull request #5924 from filecoin-project/asr/extend-v1-util
Util for miners to extend all v1 sectors
2021-04-05 15:17:02 -04:00
Łukasz Magiera eee50caaf1 Fix buildall 2021-04-05 20:12:47 +02:00
Łukasz Magiera 81bd27911f Propagate StateMsg api changes 2021-04-05 19:56:53 +02:00
Peter Rabbitson b8dff22a40 make gen 2021-04-05 19:15:32 +02:00
Łukasz Magiera 49f8b8df00 Merge pull request #5900 from filecoin-project/mg/chore/move-mpool-clear
chore: Move lotus mpool clear to lotus-shed
2021-04-05 18:43:57 +02:00
Łukasz Magiera f67bc0b0e7 Merge pull request #5930 from filecoin-project/feat/other-network-images
other network images
2021-04-05 18:28:57 +02:00
Łukasz Magiera 9a2ec07837 storagefsm: Apply global events even in broken states 2021-04-05 18:25:29 +02:00
Łukasz Magiera 0a8d20eb4e Merge pull request #5957 from filecoin-project/asr/nits
State CLI improvements
2021-04-05 18:09:01 +02:00
Peter Rabbitson b79be2a2c2 Merge remote-tracking branch 'origin/master' into feat/stateless-offline-dealflow 2021-04-05 16:06:44 +02:00
Łukasz Magiera d8bff4d19f Make gateway work with v1 api 2021-04-05 13:47:10 +02:00
Łukasz Magiera deb2b90b6a Fix lotus/miner build 2021-04-05 13:23:46 +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
Aayush Rajasekaran a49b21b94a Lotus version 1.6.0 2021-04-04 21:34:20 -04:00
Aayush Rajasekaran ea46a67550 State CLI: Clarify sector helptext 2021-04-03 22:56:39 -04:00
Aayush Rajasekaran d9dcc7845f State CLI: fix printMsg to not panic when message isn't found 2021-04-03 22:55:02 -04:00
Aayush Rajasekaran 72c410cd8f Address review on v1 sector extension tool 2021-04-03 22:19:36 -04:00
Aayush Rajasekaran 01bf3a89f4 Add checks to v1 extension util 2021-04-03 16:54:16 -04:00
Aayush Rajasekaran b734e5a232 Miner CLI: If performing read-only operations on a foreign miner, miner API isn't needed 2021-04-03 16:54:16 -04:00
Aayush Rajasekaran ded4ff43f4 Allow miners to extend all v1 sectors 2021-04-03 16:54:16 -04:00
Aayush Rajasekaran 4600b51330 Merge pull request #5929 from filecoin-project/update/ntwk-butterfly
Update butterfly network upgrade
2021-04-03 16:53:55 -04:00
Łukasz Magiera f4e46c9003 implement v1 api with api modules 2021-04-03 13:20:50 +02:00
Łukasz Magiera 09c374cdde api stub codegen 2021-04-03 13:12:59 +02:00
Łukasz Magiera 1b32d7f52f cli: fix build with v1 api changes 2021-04-03 12:55:29 +02:00
zgfzgf ef08bd48b5 add election backtest 2021-04-03 11:52:30 +08:00
Łukasz Magiera 0103d2f621 v1 api: Cleanup message wait/search apis 2021-04-02 13:52:24 +02:00
Frank 0fe705605e fix 4857: show help for set-addrs 2021-04-02 19:25:36 +08:00
Łukasz Magiera 64bf5b382b cliutil: cast full api to the v0 interface 2021-04-02 13:20:31 +02:00
Łukasz Magiera c9866da688 Merge remote-tracking branch 'origin/master' into feat/v1-api 2021-04-02 13:15:33 +02:00
Łukasz Magiera 3cac23b4a7 cli: get raw full api correctly 2021-04-02 13:07:56 +02:00
Łukasz Magiera eede19fb0b Merge pull request #5917 from filecoin-project/feat/local-retrieval
Local retrieval support
2021-04-02 13:07:00 +02:00
Łukasz Magiera 0cfc76c078 Merge pull request #5891 from filecoin-project/feat/backupds-trunc-log-handling
backupds: Improve truncated log handling
2021-04-02 13:04:11 +02:00
Łukasz Magiera b68eed906a fix lint 2021-04-02 12:37:20 +02:00
Łukasz Magiera 4538550999 Merge remote-tracking branch 'origin/master' into feat/local-retrieval 2021-04-02 12:36:28 +02:00
Łukasz Magiera a26ac3b6dc Merge pull request #5937 from filecoin-project/fix/stg-fetch-close
fix: stores.FetchHandler: defer close file and increase buffer size
2021-04-02 12:35:11 +02:00
Cory Schwartz 3cab4856b1 Merge branch 'master' into feat/other-network-images 2021-04-01 11:22:59 -07:00
Cory Schwartz 38a3aaf936 answer yes to ufw 2021-04-01 11:20:11 -07:00
Łukasz Magiera cf4128fc78 Merge pull request #5092 from zgfzgf/feat-shed-election
add shed election estimate command
2021-04-01 17:05:09 +02:00
Łukasz Magiera f372964a60 fix lint 2021-04-01 16:40:11 +02:00
Łukasz Magiera c7de7882a1 Merge branch 'master' of github.com:ppiaas/lotus-ppiaas into fix/stg-fetch-close 2021-04-01 16:38:17 +02:00
Łukasz Magiera 49be1f3fb9 Merge pull request #5833 from filecoin-project/nonsense/cli-show-deals
add `inspect-deal` command to `lotus client`
2021-04-01 16:33:11 +02:00
Łukasz Magiera 28a8636f0b Merge pull request #5807 from filecoin-project/asr/remainder-acct-fix
Fix creation of remainder account when it's not a multisig
2021-04-01 16:31:19 +02:00
Anton Evangelatov df003d44d2 include Stages and DealStages only on ClientDealInfo, not on ClientListDeals 2021-04-01 17:08:01 +03:00
Łukasz Magiera 1a5c4d70f4 Merge remote-tracking branch 'origin/master' into feat/v1-api 2021-04-01 15:33:37 +02:00
Łukasz Magiera 02d1ad8bf3 Merge pull request #5934 from diwufeiwen/fix/ci_build_macos
fix ci build-macos
2021-04-01 14:58:37 +02:00
Łukasz Magiera ba49c6206e cli: Default to v0 api for now 2021-04-01 14:17:22 +02:00
Anton Evangelatov 686c719bb1 move inspectDeal to cli package 2021-04-01 15:07:25 +03:00
一页素书 d441c5c0a6 fix ci build-macos 2021-04-01 17:14:57 +08:00
Cory Schwartz b9ce5254a3 restore filters 2021-03-31 16:12:33 -07:00
Cory Schwartz 99d2b31551 separate different networks 2021-03-31 15:07:55 -07:00
Cory Schwartz 49ca9bef41 temporary: build-all without waiting 2021-03-31 14:56:12 -07:00
Cory Schwartz c17e8b1a03 network init scripts 2021-03-31 14:41:44 -07:00
Cory Schwartz de586237f4 add other networks to build list 2021-03-31 14:12:58 -07:00
Cory Schwartz ed47c3654b temporary: remove packer build filters 2021-03-31 14:10:55 -07:00
Travis Person 37e0526918 Update butterfly network genesis 2021-03-31 21:09:22 +00:00
Cory Schwartz cbda4ff7bf other network images 2021-03-31 14:09:01 -07:00
Anton Evangelatov 1626dffd4c remove overwrite for go-data-transfer in testplans 2021-03-31 23:17:16 +03:00
Anton Evangelatov 03f4334d40 remove commented out code 2021-03-31 23:15:38 +03:00
Anton Evangelatov 967fbf52c6 resolve conflicts 2021-03-31 23:14:29 +03:00
Travis Person 41efbc000d New butterfly network info 2021-03-31 19:45:17 +00:00
Travis Person a59e36d213 Update butterfly network upgrade 2021-03-31 19:16:32 +00:00
Łukasz Magiera f10bb9e235 Merge pull request #5926 from yaohcn/fix-reserved
fix storage reservations
2021-03-31 20:40:36 +02:00
Łukasz Magiera 823c6600e3 docsgen 2021-03-31 19:38:34 +02:00
Łukasz Magiera dfe8a1c1e2 client: Set the client var in the correct scope 2021-03-31 19:38:02 +02:00
Łukasz Magiera 9adb30c560 Merge pull request #5871 from filecoin-project/nonsense/add-cancel-retrieval-deal-cmd
add `lotus client cancel-retrieval` cmd to lotus CLI
2021-03-31 19:20:03 +02:00
Łukasz Magiera ee04f9b71c Merge remote-tracking branch 'origin/master' into nonsense/add-cancel-retrieval-deal-cmd 2021-03-31 19:15:21 +02:00
Łukasz Magiera 10ac9039b4 Merge pull request #5853 from filecoin-project/feat/markets-v1.2.0
update to markets v1.2.x
2021-03-31 18:59:20 +02:00
yaohcn 3895b2ccca fix reservations 2021-03-31 14:30:24 +08:00
Aayush Rajasekaran 15e8ea1966 Lotus version 1.6.0-rc2 2021-03-31 00:01:40 -04:00
Aayush Rajasekaran 09ef832183 Merge pull request #5919 from filecoin-project/asr/network-configs
Debug mode: Make upgrade heights controllable by an envvar
2021-03-30 23:58:25 -04:00
Aayush Rajasekaran fd140c3eaf Debug mode: Make upgrade heights controllable by an envvar 2021-03-30 23:57:24 -04:00
Łukasz Magiera f2ab316fb1 Local retrieval support 2021-03-30 21:32:06 +02:00
Anton Evangelatov adaf3a2753 remove found boolean and use a pointer 2021-03-30 17:12:49 +03:00
Anton Evangelatov b661f51976 better description for inspect-deal 2021-03-30 17:08:47 +03:00
Anton Evangelatov 5014b1712e rebuild docs with make docsgen 2021-03-30 16:16:17 +03:00
Anton Evangelatov 139ff4ae64 resolved conflicts 2021-03-30 16:15:42 +03:00
Anton Evangelatov e79927a77b use go-fil-markets v1.2.4 2021-03-30 15:32:44 +03:00
Łukasz Magiera f4a2c8fa49 Merge pull request #5908 from filecoin-project/asr/master-bump
Bump master to 1.7.0-dev
2021-03-30 11:05:41 +02:00
Aayush Rajasekaran ea2e668b57 Bump master to 1.7.0-dev 2021-03-29 19:45:14 -04:00
Aayush Rajasekaran f357530efc Merge pull request #5907 from filecoin-project/asr/changelog
Lotus version 1.6.0-rc1
2021-03-29 19:43:33 -04:00
Aayush Rajasekaran b9f240e463 Merge pull request #5904 from filecoin-project/asr/specs-update
Introduce the v11 network upgrade
2021-03-29 19:40:09 -04:00
Aayush Rajasekaran 99a82d83aa Lotus version 1.6.0-rc1 2021-03-29 19:28:13 -04:00
Aayush Rajasekaran 0b3ca48c05 Introduce UpgradeNorwegianHeight to testground params 2021-03-29 19:20:20 -04:00
Aayush Rajasekaran 9c3f66bd8b Upgrade to actors v3.1.0 2021-03-29 19:17:55 -04:00
Aayush Rajasekaran cea46e5f53 Upgrade to version 11 at Norwegian height 2021-03-29 18:50:13 -04:00
Aayush Rajasekaran c1600ad6d1 Update specs-actors to latest master 2021-03-29 18:30:04 -04:00
Łukasz Magiera a7122d424b Merge pull request #5527 from filcloud/handle-ticket-expire
fix precommit ticket expiration handling
2021-03-29 22:55:43 +02:00
Łukasz Magiera 7ed390311e Merge pull request #5884 from hunjixin/feat/remote_calc_winning_proof
remote calc winningpost proof
2021-03-29 22:49:04 +02:00
Łukasz Magiera bf6ee88539 Merge pull request #5270 from filcloud/deal-duration
use deal duration from actors
2021-03-29 20:17:34 +02:00
Mike Greenberg c800211fbb chore: Move lotus mpool clear to lotus-shed 2021-03-29 12:54:08 -04:00
Aayush Rajasekaran 823a75a669 Merge pull request #5892 from filecoin-project/feat/fast-deal-commp
Update go-commp-utils for >10x faster client commp calculation
2021-03-29 12:47:18 -04:00
Anton Evangelatov a43f4b33d9 upgrade go-data-transfer 2021-03-29 19:25:35 +03:00
Anton Evangelatov 82fb81a33d short circuit deals with no stages 2021-03-29 19:11:40 +03:00
Anton Evangelatov f7eff6c728 go mod tidy 2021-03-29 18:45:54 +03:00
Anton Evangelatov 77bc8d6ca3 remove storedCounters 2021-03-29 18:39:07 +03:00
Anton Evangelatov fd6d8b302a commit full.json.gz and miner.json.gz docs 2021-03-29 18:32:09 +03:00
Anton Evangelatov 14e6ce843e use latest go-fil-markets and go-data-transfer 2021-03-29 18:31:10 +03:00
Anton Evangelatov 8ba0bcb375 Merge branch 'master' into nonsense/cli-show-deals-backup 2021-03-29 18:19:28 +03: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
hunjixin 896303c6a2 fix lint 2021-03-29 10:31:31 +08:00
hunjixin 869e6a76c1 update make gen 2021-03-29 10:28:25 +08:00
Łukasz Magiera 2c18921bce update go-commp-utils for >10x faster client commp calculation 2021-03-27 10:12:45 +01:00
Łukasz Magiera 089ff08d81 Merge pull request #5881 from filecoin-project/fix/lint-skip
lint: don't skip builtin
2021-03-27 10:09:44 +01:00
Łukasz Magiera 411f561db6 backupds: Improve truncated log handling 2021-03-27 10:05:12 +01:00
Raúl Kripalani fd91c095c4 rename command to cancel-retrieval; rename args to follow Lotus style. 2021-03-26 16:37:46 +00:00
Dirk McCormick 47f7208f38 fix: rename command to retrieve-cancel 2021-03-26 10:19:19 +01:00
Dirk McCormick 85eab9e00e fix: make docsgen 2021-03-26 09:53:01 +01:00
Dirk McCormick b13f6a3209 fix: cancel retrieval deal - disallow negative deal ID 2021-03-26 09:51:07 +01:00
hunjixin 449b33abee remote calc winningpost proof 2021-03-26 13:32:03 +08:00
aarshkshah1992 36c3086376 changes as per review 2021-03-26 09:48:50 +05:30
Steven Allen f5029a0187 lint: don't skip builtin 2021-03-25 17:21:56 -07:00
Łukasz Magiera 885ecb97ad Merge pull request #5879 from filecoin-project/feat/paychtest-secp
Import secp sigs in paych tests
2021-03-25 19:10:22 +01:00
Łukasz Magiera 1e10429326 api: Add basic package readme 2021-03-25 18:00:29 +01:00
Łukasz Magiera e003977559 apiclient: Version client funcs 2021-03-25 15:39:48 +01:00
Łukasz Magiera 9223a8e5ff Fix lotus-soup build 2021-03-25 15:29:20 +01:00
Łukasz Magiera 736c69784a make: Fix parallel gen 2021-03-25 15:21:57 +01:00
Łukasz Magiera c25190bd8c api: struct.go -> proxy_gen.go 2021-03-25 15:11:37 +01:00
Łukasz Magiera 7a23b411ae Merge apistruct with the api package 2021-03-25 15:10:08 +01:00
Dirk McCormick 0134099315 feat: markets v1.2.3 2021-03-25 15:07:42 +01:00
Łukasz Magiera 759ea5b14f Merge remote-tracking branch 'origin/master' into feat/v1-api 2021-03-25 14:13:21 +01:00
Łukasz Magiera 6d9ae1e28e Merge pull request #5819 from chadwick2143/lotus-shed
Add --actor flag in lotus-shed sectors terminate
2021-03-25 14:02:37 +01:00
Łukasz Magiera 312c69f1da Merge pull request #5814 from vasco-santos/chore/add-available-options-for-perm-on-error
chore: add available options for perm on error
2021-03-25 13:56:17 +01:00
Łukasz Magiera 5f80869fe0 Merge pull request #5794 from filecoin-project/fix/atomic-first
fix: make sure atomic 64bit fields are 64bit aligned
2021-03-25 13:29:59 +01:00
Łukasz Magiera 53cba157e2 Merge pull request #5804 from zl03jsj/fix/StateManager.Replay
fix: StateManager.Replay
2021-03-25 13:27:45 +01:00
Łukasz Magiera fc4f60e528 Merge pull request #5850 from filecoin-project/feat/markets-dealid
expose NextID from nice market actor interface
2021-03-25 13:26:29 +01:00
Cory Schwartz 01202c5276 digitalocean pass test (#5721)
* force packer build

* disable ami temporarially

* apt and ufw

* initial lotus config

* rename correctly

* apt-get instead of apt

* undo temporary edits

* install before upgrade

* tmp - force digitalocean

* reenable filters

* uncomment ebs

* tmp, remove filter for digitalocean build

* doc

* install ufw (for iams where it isn't installed)

* more amazon regions

* missing comma

* missing comma

* remove unavailable regions

* switch to ubuntu, not minimal

* pro server

* change owner

* change image

* uncomment circleci filters

* remove api from firewall

* tmp: remove circleci filter

* dpkg options

* confold

* try export

* re-add filter
2021-03-25 13:25:11 +01:00
Łukasz Magiera 4d01f8f30b Merge pull request #2184 from filecoin-project/godocs/miner
add godocs to miner objects.
2021-03-25 13:16:38 +01:00
Raúl Kripalani 87efc9d536 add godocs to miner objects. 2021-03-25 13:02:19 +01:00
Łukasz Magiera 53f915d155 Import secp sigs in paych tests 2021-03-25 12:28:53 +01:00
Łukasz Magiera 8f78066d4f Merge pull request #5875 from filecoin-project/feat/log-compact-restart
backupds: Compact log on restart
2021-03-25 10:42:39 +01:00
Łukasz Magiera 5d44ed0b23 Merge pull request #5876 from filecoin-project/feat/interactive-deal-latency
Take latency into account when making interactive deals
2021-03-24 23:04:20 +01:00
Łukasz Magiera fc087f3ac0 Take latency into account when making interactive deals 2021-03-24 22:42:17 +01:00
Łukasz Magiera 924c419e61 backupds: handle log bool in shed 2021-03-24 21:26:24 +01:00
Łukasz Magiera bb79eba74c backupds: Compact log on restart 2021-03-24 21:16:42 +01:00
Łukasz Magiera 16965f1b9e Merge pull request #5867 from filecoin-project/asr/shed-poll
Add two utils to Lotus-shed
2021-03-24 18:07:05 +01:00
Anton Evangelatov a202f9d19e add cancel-retrieval-deal cmd 2021-03-24 18:18:49 +02:00
Łukasz Magiera a2e87310b5 Merge pull request #5864 from filecoin-project/frrist/export-cli-commands
Export developer and network commands for consumption by derivatives of Lotus
2021-03-24 16:52:28 +01:00
Dirk McCormick 1359fb6cc4 fix: disable pull channel monitoring for now 2021-03-24 13:56:59 +01:00
Łukasz Magiera a227039dc1 Merge pull request #5868 from filecoin-project/releases
Merge release branch into master
2021-03-24 11:19:15 +01:00
Aayush Rajasekaran 4d3d00ede9 Merge branch 'master' into releases 2021-03-24 00:16:39 -04:00
Aayush Rajasekaran 197c9ac996 Fix CHANGELOG for Lotus v.1.5.3 2021-03-24 00:13:31 -04:00
Aayush Rajasekaran 3e6dcb578b Lotus version 1.5.3 2021-03-24 00:07:27 -04:00
Aayush Rajasekaran dac171a99b Add a util to validate FILPoll votes 2021-03-24 00:00:11 -04:00
Aayush Rajasekaran fdb69fdd71 Add a util to decode base64 inputs 2021-03-23 23:32:56 -04:00
frrist bcf7aab55d chore: export mpool cli commands 2021-03-23 16:28:27 -07:00
frrist a74e02e362 chore: export fetch cli command 2021-03-23 16:27:34 -07:00
frrist b34db8e432 chore: export pprof cli commands 2021-03-23 16:26:59 -07:00
frrist 1d50cdd85a chore: export wait cli command 2021-03-23 16:26:12 -07:00
frrist 14a809d291 chore: export auth cli command 2021-03-23 16:25:49 -07:00
frrist 89c45fe7ef chore: export sync cli commands 2021-03-23 16:23:22 -07:00
frrist 22329b96b4 chore: export state cli commands 2021-03-23 16:21:04 -07:00
frrist 8f6ea05d48 chore: export chain commands 2021-03-23 16:19:33 -07:00
frrist 1062117562 chore: export log cli commands 2021-03-23 16:19:22 -07:00
frrist 6827f2dce3 chore: export Net commands 2021-03-23 16:15:02 -07:00
Łukasz Magiera eed5840de3 fix lotus-shed 2021-03-23 19:37:30 +01:00
Łukasz Magiera 65dcec0ebc api client: Use versioned api packages 2021-03-23 19:15:53 +01:00
Łukasz Magiera b3774f8b87 openrpc: Don't use os.Args in init 2021-03-23 18:49:50 +01:00
Łukasz Magiera 421338b9f4 ci: Fix cbor gen check 2021-03-23 17:33:20 +01:00
Łukasz Magiera efccf7d730 Generate v0 mocks 2021-03-23 17:23:01 +01:00
Łukasz Magiera d198cf456e make docsgen work with versioned api 2021-03-23 17:20:56 +01:00
Łukasz Magiera 3fe4b50a13 apigen: Work with versioned apis 2021-03-23 17:01:56 +01:00
Łukasz Magiera 571114bc44 Scaffolding for API versioning 2021-03-23 16:40:22 +01:00
Łukasz Magiera c41777dcd2 API proxy struct codegen (#5854)
* mostly working api proxy gen

* api: Consistent api names

* fix docsgen

* regenerate api struct

* api: expand external interfaces

* Add missing gen files

* apigen: fix perm detection

* api: Move perm tags to the interface

* gofmt

* worker perms

* docsgen

* docsgen: ignore tag comments

* apigen: add codegen warning

* gofmt

* missing actor type

* docsgen

* make linter happy

* fix lint

* apigen: use directives for tags

* docsgen

* regen openrpc docs
2021-03-23 13:42:56 +01:00
Anton Evangelatov b4d4766615 use go-data-transfer from personal fork 2021-03-23 14:30:26 +02:00
Dirk McCormick aee9890ee7 feat: update go-data-transfer and go-fil-markets 2021-03-23 13:28:30 +01:00
Anton Evangelatov bbd0cdd212 fix linter and merge master 2021-03-23 13:59:41 +02:00
Anton Evangelatov 22217b7cae Merge branch 'master' into nonsense/cli-show-deals 2021-03-23 13:58:26 +02:00
Łukasz Magiera f145d4f46b Merge pull request #5693 from filecoin-project/sentinel/binary
Implement Event observer and Settings for 3rd party dep injection
2021-03-23 11:15:11 +01:00
Łukasz Magiera 4cae530d4a Merge pull request #5860 from filecoin-project/fix/update-openrpc-doc
Update generated docs
2021-03-23 10:49:51 +01:00
Łukasz Magiera be704cf0f0 docsgen 2021-03-23 10:39:56 +01:00
Łukasz Magiera 2f37b622f7 circle: output generated openrpc diffs 2021-03-23 10:38:14 +01:00
frrist 6caafaeee3 polish(node): define settings opts for 3rd party dep injection
- motivating use case running a lotus-sentinel node
2021-03-22 15:37:44 -07:00
frrist 0b579c1e03 feat(events): define Observer intreface for events
- allows tipset apply and revert to be observed
2021-03-22 15:37:44 -07:00
Łukasz Magiera 4c7df0ac38 Merge pull request #5709 from filecoin-project/feat/optim-gas-premium
perf: add cache for gas permium estimation
2021-03-22 20:14:19 +01:00
Łukasz Magiera caa1d5bba4 Merge pull request #5840 from filecoin-project/docs/replay-replace-note
api: Document StateReplay replaced message behavior
2021-03-22 19:21:02 +01:00
Jakub Sztandera 5f672c2ed0 perf: add cache for gas permium estimation
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-03-22 18:06:14 +01:00
Łukasz Magiera 897c5c7d82 Merge pull request #5851 from filecoin-project/fix/rtrvl-log
better logging when unsealing fails
2021-03-22 17:58:48 +01:00
Peter Rabbitson b55ca92d33 Merge pull request #5839 from filecoin-project/chore/backport_nerpa_reset_to_1_5_3
Chore/backport nerpa reset to 1 5 3
2021-03-22 16:38:32 +01:00
Dirk McCormick 9fb1dd43a9 feat: update to markets v1.2.0 2021-03-22 15:31:13 +01:00
dirkmc 14ede9b0e6 Fix unseal comment 2021-03-22 14:39:03 +01:00
Dirk McCormick 73d5225f3c fix: better logging when unsealing fails 2021-03-22 10:23:58 +01:00
whyrusleeping 6bcf92f71a expose NextID from nice market actor interface 2021-03-21 00:11:42 -07:00
Łukasz Magieraandmeows 43d9cc36a4 OpenRPC Support (#5843)
* main: init implement rpc.Discover RPC method

This implement the basic functionality for the method
over HTTP RPC.

Signed-off-by: meows <b5c6@protonmail.com>

* main,go.mod,go.sum: init example with go-openrpc-reflect lib

Signed-off-by: meows <b5c6@protonmail.com>

 Conflicts:
	go.mod
	go.sum

* main: make variable name human-friendly

Signed-off-by: meows <b5c6@protonmail.com>

* main,go.mod,go.sum: init impl of go-openrp-reflect printing document

Signed-off-by: meows <b5c6@protonmail.com>

 Conflicts:
	go.mod
	go.sum

* go.mod,go.sum: use go-openrpc-reflect and open-rpc/meta-schema hackforks

This is for development only.
Versions need to be bumped when they're ready for use
as canonical remotes.

Signed-off-by: meows <b5c6@protonmail.com>

* main,openrpc,main: refactor openrpc supporting code to own package

This eliminates code duplication.

Signed-off-by: meows <b5c6@protonmail.com>

* main: add rpc.Discover to openrpc document

Signed-off-by: meows <b5c6@protonmail.com>

* openrpc: fix rpc.discover method name casing

Also fixes casing stuff for the rest of Filecoin.
methods.

Signed-off-by: meows <b5c6@protonmail.com>

* Revert "main: add rpc.Discover to openrpc document"

This reverts commit 116898efb10f33e405ac74acb1aa6daefcd46a62.

* main: fix document creation method name

This fixes an issue caused with the latest reverting
commit.

Signed-off-by: meows <b5c6@protonmail.com>

* main,docgen,openrpc: refactor to share api parsing, etc as docgen exported stuff

Signed-off-by: meows <b5c6@protonmail.com>

Makefile: fix docgen refactoring for makefile use of command

Signed-off-by: meows <b5c6@protonmail.com>

* openrpc: add schema.examples to app reflector

There are quite of few of these already registered
for the docgen command, so it makes sense to use
those!

Signed-off-by: meows <b5c6@protonmail.com>

* openrpc: init method pairing examples

Signed-off-by: meows <b5c6@protonmail.com>

* go.mod,go.sum: bump go.mod to use latest meta-schema and openrpc-reflect versions

Signed-off-by: meows <b5c6@protonmail.com>

* openrpc: init SchemaType mapper function

This function will handle the manual configurations
for app-specific data types w/r/t their json schema
representation.

This is useful for cases where the reflect library
is unable to provide a sufficient representation
automatically.

Provided in this commit is an initial implementation
for the integerD type (assuming number are represented
in the API as hexs), and a commonly used cid.Cid type.

Signed-off-by: meows <b5c6@protonmail.com>

* go.mod,go.sum: tame dependencies by bumping etclabscore/go-openrpc-reflect

This removes a problematic dependency
on github.com/ethereum/go-ethereum, which was
imported as a dependency for a couple github.com/etclabscore/go-openrpc-reflect
tests.

etclabscore/go-openrpc-reflect v0.0.36 has removed this
dependency, so this commit is the result of bumping
that version and then running 'go mod tidy'

This is in response to a review at
https://github.com/filecoin-project/lotus/pull/4711#pullrequestreview-535686205

Date: 2020-11-21 06:52:48-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* main: add 'miner' arg to openrpc gen cmd

This allows the command to EITHER
generate the doc for Full or Miner APIs.

See comment for usage.

Date: 2020-11-21 07:48:05-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* docgen: add missing examples for Miner API

Generating the Miner API OpenRPC doc
(via 'go run ./api/openrpc/cmd miner') caused
the example logic to panic because some types
were missing.

This commit adds those missing types, although
I'm not an expert in the API so I can't
suggest that the example values provided are
ideal or well representative.

Date: 2020-11-21 07:50:21-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* build/openrpc/full.json,build/openrpc/miner.json: add build/openrpc/[full/miner].json docs

These will be used as static documents
provided by the rpc.discover method.

Date: 2020-11-21 07:51:39-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* build: init go-rice openrpc static assets

Date: 2020-11-21 08:23:06-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* main: remove rpc.discover implementation from runtime plugin

Instead of generating the doc on the fly,
we're going to serve a static asset.
Rel https://github.com/filecoin-project/lotus/pull/4711#pullrequestreview-535686205
This removes the runtime implementation from the
RPC server construction.

Date: 2020-11-21 08:41:20-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* api,apistruct,common: add Discover(ctx) method to CommonAPI interface and structs

Date: 2020-11-21 08:41:56-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* main: use rpc server method aliasing for rpc.discover

This depends on a currently-forked change at
filecoin-project/go-jsonrpc 8350f9463ee451b187d35c492e32f1b999e80210
which establishes this new method RPCServer.AliasMethod.

This solves the problem that the OpenRPC
spec says that the document should be served
at the system extension-prefixed endpoing
rpc.discover (not Filecoin.Discover).

In fact, the document will be available at BOTH
endpoints, but that duplicity is harmless.

Date: 2020-11-21 09:18:26-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* api,apistruct,build,common: rpc.discover: return json object instead of string

Instead of casting the JSON asset from bytes to string,
unmarshal it to a map[string]interface{} so the
server will provide it as a JSON object.

Date: 2020-11-21 09:27:11-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* Makefile: merge resolve: docsgen command path

Date: 2020-11-22 07:19:36-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* apistruct,main,docgen,openrpc: merge resolve: fix func exporteds, signatures

Date: 2020-11-22 07:31:03-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* go.mod,go.sum: 'get get' auto-bumps version

Date: 2020-11-22 07:31:44-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* Makefile,docgen,main,build/openrpc: refactor openrpc documentation generation

This creates Makefile command docsgen-openrpc-json,
and refactors the docsgen command to generate both
the markdown and openrpc json documents, redirecting
the output of the openrpc json documentation to
the build/openrpc/ directory, where those json
files will be compiled as static assets via go-rice
boxes.

The api/openrpc/cmd now uses usage argumentation
congruent to that of the docgen command (switching
on API context).

Date: 2020-11-22 08:01:18-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* main,docgen_openrpc: rename api/openrpc -> api/docgen-openrpc

Renames the package as well.

This is intended to parallel the
existing docgen package and command
namespacing.

Date: 2020-11-22 10:34:46-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* api,apistruct,docgen,build,build/openrpc: use typed Discover response

Instead of using a map[string]interface{}, use
a typed response for the Discover method implementation.

This avoids having to set a docgen Example for
the generic map[string]interface{} (as an openrpc document)
which both pollutes the generic type and lacks
useful information for the Discover method example.

Date: 2020-11-22 08:31:16-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* apistruct,build,main,impl: implement Discover method for Worker and StorageMiner APIs

Methods return static compiled assets respective
to the APIs.

Date: 2020-11-22 08:57:18-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* docgen_openrpc,build/openrpc: remove timestamping from openrpc doc info

This should allow openrpc docs generated at different
times to be equal. This is important because the CI
(Circle) runs the docgen command and tests that
the output and the source are unchanged (via git diff).

Date: 2020-11-22 10:47:07-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* main,docgen_openrpc,main,build: fix lint issues

Fixes goimports, staticcheck, golint issues.

Date: 2020-11-22 11:06:46-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* docgenopenrpc: fix: don't use an underscore in package name (golint)

Date: 2020-11-22 11:07:53-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* go.sum: fix: mod-tidy-check (run 'go mod tidy')

Date: 2020-11-22 11:09:48-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* go.mod,go.sum: bump filecoin-project/go-jsonrpc dep to latest

This version includes the necessary RPCServer.AliasMethod
method.

Date: 2020-11-23 12:16:15-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* Makefile,main,build,build/openrpc: init gzipped openrpc static docs

Date: 2020-11-24 06:15:06-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* build: refactor gzip reading

Date: 2020-11-24 06:18:34-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* build: add basic test for openrpc doc from static assets

Date: 2020-11-24 06:30:23-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* build: handle reader Close error

This keeps the errcheck linter happy.

Date: 2020-11-24 06:33:14-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* go.sum: run 'go mod tidy'

Date: 2020-11-24 06:36:07-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* go.mod,go.sum: go mod tidy

Tidying up after resolving the merge conflicts
with master at go.mod

Date: 2020-11-24 06:40:45-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* go.mod,go.sum: bump filecoin-project/go-jsonrpc to latest

This is a repeat of 76e6fd2, since the latest merge
to master seems to have reverted this.

Date: 2020-11-24 06:42:30-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* docgenopenrpc,build/openrpc: remove method example pairings, improve schema examples

Removing method example pairings since they were
redundant to schema examples and were not
implemented well.

Improved schema examples by using the ExampleValue
method instead of the map lookup.
Made a note in the comment here that this is
not ideal, since we have to make a shortcut assumption
/workaround by using 'unknown' as the method name
and the typea as its own parent.

Luckily these values aren't heavily used by the
method logic.

Date: 2020-11-27 12:57:36-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* docgenopenrpc: use generic number jsonschema for number types

Previously used an integer schema assuming
hex encoding. It appears, based on review some
of the examples, that this may not be the case.

Obvioussly this schema could be more descriptive,
but just shooting for mostly likely to be
not wrong at this point.

Date: 2020-12-15 14:44:37-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* cmd/lotus,go.mod,go.sum: maybe fix straggling merge resolution conflicts

Date: 2021-01-19 12:30:42-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* build/openrpc/full.json.gz,build/openrpc/miner.json.gz,build/openrpc/worker.json.gz: run 'make docsgen'

Date: 2021-01-19 12:33:55-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* api/apistruct,node/impl: (lint) gofmt

Date: 2021-01-19 12:39:48-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* api/docgen: maybe fix parse error:  open ./api: no such file or directory

Date: 2021-01-19 12:52:04-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* api/docgen,build/openrpc: maybe fix no such file error and run 'make docsgen'

Date: 2021-01-19 12:55:52-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* api/docgen: return if AST comment/groupdoc parsing encounters any error

This will returns empty comments/docs maps.
This should fix issues like:
https://app.circleci.com/pipelines/github/filecoin-project/lotus/12445/workflows/4ebadce9-a298-4ad1-939b-f19ef4c0a5bf/jobs/107218

where the environment makes file lookups hard or
impossible.

Date: 2021-01-19 13:04:58-06:00
Signed-off-by: meows <b5c6@protonmail.com>

* api: Don't depend on build/

* make: support parallel docsgen

* openrpc gen: Use simple build version

* methodgen

* goimports

Co-authored-by: meows <b5c6@protonmail.com>
2021-03-19 19:22:46 +01:00
Anton Evangelatov ac576c75d4 amend restart config 2021-03-19 14:08:50 +02:00
Łukasz Magiera da10ef2e36 api: Better StateCompute docs 2021-03-19 12:57:59 +01:00
Anton Evangelatov 86772a09c7 use new channelmonitor.Config 2021-03-19 13:53:03 +02:00
Łukasz Magiera d198bf9d6d Merge pull request #5828 from filecoin-project/asr/version
Bump master to 1.6.0-dev
2021-03-19 11:48:24 +01:00
Łukasz Magiera 82e019bd36 api: Note that ChainGetBlockMessages is not the method to use most of the time 2021-03-18 22:12:22 +01:00
Łukasz Magiera e74aa7ef09 api: Document StateReplay replaced message behavior 2021-03-18 21:54:35 +01:00
Peter Rabbitson b54a58c6e2 Build more binaries by default when a devnet tag is active
( cherry-pick of bc5ed9656c )
2021-03-18 20:55:17 +01:00
Peter Rabbitson c340750672 Nerpa reset backport/cherry-pick from 73eabc310f 2021-03-18 20:55:15 +01:00
Łukasz Magiera 887249afee Merge pull request #5837 from filecoin-project/chore/build_more_binaries_on_devnets
Build more binaries by default when a devnet tag is active
2021-03-18 19:50:25 +01:00
Łukasz Magiera 32a0c881ac Merge pull request #5838 from filecoin-project/docs/searchmsg-replace-note
api: Document StateSearchMsg replaced message behavior
2021-03-18 19:48:27 +01:00
Łukasz Magiera c5ba875fe3 api: Add replaced msg note on StateSearchMsg 2021-03-18 19:46:26 +01:00
Łukasz Magiera 80ecec7532 Merge branch 'docs/searchmsg-replace-note' of github.com:filecoin-project/lotus into docs/searchmsg-replace-note 2021-03-18 19:43:24 +01:00
Aayush Rajasekaran a0a4d3c462 Add a note to ChainGetParentReceipts 2021-03-18 14:35:32 -04:00
Łukasz Magiera ce127ec541 api: Document StateSearchMsg replaced message behavior 2021-03-18 19:18:43 +01:00
Łukasz Magiera 4fb4313ee7 api: Document StateSearchMsg replaced message behavior 2021-03-18 19:17:37 +01:00
Peter Rabbitson bc5ed9656c Build more binaries by default when a devnet tag is active 2021-03-18 16:11:43 +01:00
Anton Evangelatov af8104830c fixup 2021-03-18 16:03:24 +02:00
Peter Rabbitson 73eabc310f Merge pull request #5834 from Digital-MOB-Filecoin/nerpa/202103181-707219b7a
Nerpa reset based on 1.5.2
2021-03-18 15:02:07 +01:00
Anton Evangelatov 9d6c77d93f remove interactive UX; add inspect-deal cmd 2021-03-18 14:53:03 +02:00
Liviu Damian ef5b079b8f Nerpa reset 707219b7a 2021-03-18 12:33:54 +02:00
Aayush Rajasekaran 707219b7a1 Disable the Calico migration on not-mainnet 2021-03-17 20:46:00 -04:00
Peter Rabbitson 8c726cc4f9 Rollback the nerpa proofs upgrade: has to be conditional on upgrades 2021-03-17 12:00:45 +01:00
Aayush Rajasekaran 797d2b1ae8 Bump master to 1.6.0-dev 2021-03-17 02:49:06 -04:00
Aayush Rajasekaran 9afb5ff944 Lotus 1.5.3-rc2 2021-03-17 02:45:23 -04:00
Aayush Rajasekaran dc94d52084 Tweak upgrade heights 2021-03-17 00:24:17 -04:00
Aayush Rajasekaran 80ff0b0564 Improve setting of VRK multisigs 2021-03-17 00:18:50 -04:00
Peter Rabbitson 3c81576bfa Fix nerpa heights for a reset, swapout proof typs 2021-03-17 04:00:29 +01:00
chadwick2143 7417a13be3 Add --actor flag in lotus-shed sectors terminate
Can specify miner actor address when terminate sectors,
so that you can terminate sectors without miner api.
2021-03-16 14:09:46 +08:00
Vasco Santos 9120d6f82f chore: add available options for perm on error 2021-03-15 13:42:57 +01:00
Aayush Rajasekaran a54c6bfb05 Merge pull request #4653 from filecoin-project/4621-delete-wallet
Aftering importing a previously deleted key, be able to delete it again.
2021-03-14 20:36:56 -04:00
Aayush Rajasekaran c3d1534044 Merge pull request #5743 from filecoin-project/feat/keep-unsealed-by-default
Default the AlwaysKeepUnsealedCopy flag to true
2021-03-14 15:47:07 -04:00
Aayush Rajasekaran fe473e111c Fix creation of remainder account when it's not a multisig 2021-03-12 17:12:41 -05:00
Łukasz Magiera 09e78a0fe4 Merge pull request #5800 from filecoin-project/feat/allinfo-utils
shed command to unpack miner info dumps
2021-03-12 19:02:50 +01:00
Łukasz Magiera 1aea1ebb9d Merge pull request #5801 from filecoin-project/fix/fsm-input-stuck
storagefsm: Trigger input processing when below limits
2021-03-12 19:02:15 +01:00
Łukasz Magiera 0974e02089 storagefsm: common createSector method 2021-03-12 18:42:17 +01:00
Łukasz Magiera 5c1a01dc3c Merge pull request #5802 from filecoin-project/test/backupds-unit
backupds: Add unit tests
2021-03-12 18:28:15 +01:00
Łukasz Magiera 0c43b93d46 Merge pull request #5805 from filecoin-project/test/mack-rand-sideeffects
mock sealer: Simulate randomness sideeffects
2021-03-12 18:27:47 +01:00
Steven Allen 25725110e7 Merge pull request #5792 from filecoin-project/fix/timed-cache-locking
fix: avoid holding a lock while calling the View callback
2021-03-12 09:25:00 -08:00
Steven Allen b74b1658b2 test: mock proof side effects on verify as well 2021-03-12 09:06:41 -08:00
Łukasz Magiera d9923125ff mock sealer: Simulate randomness sideeffects 2021-03-12 17:33:43 +01:00
Łukasz Magiera e5b5bf1c1b storagefsm: Update sector stats atomically with sector creation 2021-03-12 17:25:24 +01:00
zl 6f64d5db6f bugfix: StateManager.Replay 2021-03-13 00:12:37 +08:00
Łukasz Magiera 679f5f7661 storagefsm: Helper stat functions in updateSector 2021-03-12 17:00:20 +01:00
Łukasz Magiera c69b26cfc6 Merge pull request #5778 from filecoin-project/feat/splitstore-compact-hotstore
splitstore: compact hotstore prior to garbage collection
2021-03-12 16:30:05 +01:00
Łukasz Magiera 067af44ed7 Merge pull request #5791 from filecoin-project/feat/paychmgr-imports
move DI stuff for paychmgr into modules
2021-03-12 16:29:23 +01:00
Łukasz Magiera a2ac26c4f6 backupds: Add unit tests 2021-03-12 16:20:27 +01:00
Łukasz Magiera 58213760b7 gofmt 2021-03-12 15:56:10 +01:00
Łukasz Magiera 08472f4fac batch deal input processing test 2021-03-12 15:41:46 +01:00
Łukasz Magiera 957d3f0636 storgefsm: Use locks correctly 2021-03-12 15:01:00 +01:00
Łukasz Magiera 5c605d99e2 storgefsm: Fix tests 2021-03-12 14:56:46 +01:00
Łukasz Magiera f5ed25371b storagefsm: Trigger input processing wheen below limits 2021-03-12 14:54:10 +01:00
Łukasz Magiera 88b0d551b9 shed command to unpack miner info dumps 2021-03-12 12:24:09 +01:00
Łukasz Magiera a373fc4c4c make lotus-miner info all more robust 2021-03-12 12:23:43 +01:00
Łukasz Magiera e5226412fb builder: set modules.PaychAPI correctly 2021-03-12 11:27:00 +01:00
Łukasz Magiera 06aaa668d6 Merge pull request #5796 from filecoin-project/fix/return-after-cancel
fix: return buffers after canceling badger operation
2021-03-12 11:13:50 +01:00
Łukasz Magiera ea11b827b8 Merge pull request #5799 from steven004/bootstrapper
ipfs-force bootstrapper update
2021-03-12 11:10:00 +01:00
whyrusleeping cbc7f1c244 fix paychmgr constructor to take an easier to implement interface 2021-03-12 00:39:20 -08:00
Steven Li a6e8c03f5c ipfs-force bootstrapper update 2021-03-12 15:05:00 +08:00
Steven Allen bba71da401 fix: return buffers after canceling badger operation
In theory, Delete/Put could fail. If it does, we'll return the buffers
to the pool before we're really done with them.

In practice, this is almost certainly not an issue as badger shouldn't
_use_ the buffer unless we flush. But I feel slightly safer this way.
2021-03-11 20:30:43 -08:00
Steven Allen 1c490f3fda fix: make sure atomic 64bit fields are 64bit aligned
Otherwise, this won't work on 32bit ARM.
2021-03-11 20:10:39 -08:00
Steven Allen a888ea0d1f fix: avoid holding a lock while calling the View callback
Interleaved puts/views could get really slow and there's no real reason
to use view under the covers here because the underlying blockstore is
always a "memstore".
2021-03-11 20:03:38 -08:00
whyrusleeping e0b650d4ec make rpcstatemanager its own package, for easy reuse 2021-03-11 18:21:18 -08:00
whyrusleeping bf42a3be5e move DI stuff for paychmgr into modules 2021-03-11 17:35:31 -08:00
Łukasz Magiera d0243904f7 Merge pull request #5779 from filecoin-project/feat/storagefsm-no-restart-log
storagefsm: Don't log the SectorRestart event
2021-03-11 15:18:32 +01:00
Łukasz Magiera 68d808705d Merge pull request #5783 from filecoin-project/fix/fsm-waitdeals-panic
storagefsm: Fix double unlock with ready WaitDeals sectors
2021-03-11 15:18:05 +01:00
Łukasz Magiera 189dc479c2 Merge pull request #5776 from filecoin-project/fix/backupds-len-checks
backupds: Allow larger values in write log
2021-03-11 15:17:41 +01:00
Łukasz Magiera 881c722025 storagefsm: Fix double unlock with ready WaitDeals sectors 2021-03-11 15:03:51 +01:00
Łukasz Magiera 8546e56d38 update go-statestore to avoid redundant log writes 2021-03-11 13:34:35 +01:00
Łukasz Magiera a1b6a2f011 storagefsm: Don't log the SectorRestart event 2021-03-11 12:52:34 +01:00
vyzo 1b1d3606cd make linter happy 2021-03-11 13:10:44 +02:00
Łukasz Magiera 31154ed294 fix lint 2021-03-11 12:05:32 +01:00
Łukasz Magiera ea58bee3f5 backupds: Allow larger values in write log 2021-03-11 12:03:24 +01:00
Łukasz Magiera 3be4984d9d Merge pull request #5775 from filecoin-project/feat/release-v1.5.2
Lotus v1.5.2
2021-03-11 10:48:02 +01:00
vyzo 353bb1881f compact hotstore if it provides the method 2021-03-11 11:45:19 +02:00
vyzo 01ce9b5c44 add Compact to badger blockstore 2021-03-11 11:45:05 +02:00
Łukasz Magiera 6d88ea83e7 v1.5.2 changelog, version bump 2021-03-11 10:28:40 +01:00
Łukasz Magiera 4f82421c7c Merge pull request #5771 from filecoin-project/asr/changelog
Reformat 1.5.1 changelog
2021-03-11 10:19:17 +01:00
Łukasz Magiera edccf2457f Merge pull request #5774 from filecoin-project/fix/post-fresh-rand
wdpost: Always use head tipset to get randomness
2021-03-11 10:17:46 +01:00
Łukasz Magiera 728d86cd36 wdpost: Always head tipset to get randomness 2021-03-11 09:59:26 +01:00
Łukasz Magiera 097c65d0bb Merge pull request #5773 from IPFSMain-Official/fix-window-post-rand-check
fix window post rand check
2021-03-11 09:51:47 +01:00
刘林欣 9095babf8c fix window post rand check 2021-03-11 15:10:19 +08:00
Aayush Rajasekaran ebc3556487 Reformat 1.5.1 chanegelog 2021-03-10 19:27:28 -05:00
Aayush Rajasekaran 3fbfb7a0d1 Merge pull request #5770 from filecoin-project/asr/changelog
Lotus 1.5.1
2021-03-10 19:09:50 -05:00
Aayush Rajasekaran a977cc2189 Lotus 1.5.1 2021-03-10 18:46:51 -05:00
Łukasz Magiera c0d1f4478a Merge pull request #5768 from filecoin-project/fix/retry-proof-on-rand-change
fix: retry proof when randomness changes
2021-03-10 21:23:55 +01:00
Steven Allen 84f721e373 fix: retry proof when randomness changes
Simply warning isn't enough.
2021-03-10 10:24:58 -08:00
Łukasz Magiera 1673362795 Merge pull request #5679 from filecoin-project/next
1.5.1 staging branch
2021-03-10 17:21:56 +01:00
Łukasz Magiera 6315523fe9 Merge remote-tracking branch 'origin/master' into next 2021-03-10 15:58:28 +01:00
Łukasz Magiera 504affd266 Merge pull request #5757 from filecoin-project/chore/sr2_stats_factored_out
Remove the SR2 stats, leave just the network totals
2021-03-10 14:15:35 +01:00
Łukasz Magiera bd8864ae43 Merge pull request #5755 from filecoin-project/feat/kvlog
Metadata datastore log
2021-03-10 14:13:01 +01:00
Łukasz Magiera 3f1054daf4 backupds kvlog: Address review 2021-03-10 13:58:41 +01:00
Łukasz Magiera 4abb333611 Merge pull request #5764 from filecoin-project/fix/wait-for-proof
fix: wait a bit before starting to compute window post proofs
2021-03-10 13:52:09 +01:00
Łukasz Magiera a0d7604e7c wdpost: Use chain head tsk in post rand check 2021-03-10 13:36:34 +01:00
Łukasz Magiera cc490b983a Merge pull request #5761 from filecoin-project/fix/testunpadreader-go116
Fix TestUnpadReader on Go 1.16
2021-03-10 13:13:27 +01:00
Łukasz Magiera 7fbb4bdd3b Fix TestUnpadReader on Go 1.16 2021-03-10 13:05:25 +01:00
Łukasz Magiera 5125aa05a5 Merge pull request #5544 from filecoin-project/jen/issue-templates
Update issue templates
2021-03-10 12:32:19 +01:00
Łukasz Magiera ca3d22683a gofmt 2021-03-10 12:27:37 +01:00
Łukasz Magiera 2b380c96a5 Exit from the kvlog goroutine when closing 2021-03-10 11:24:19 +01:00
Łukasz Magiera 05274943c9 Merge pull request #5620 from filecoin-project/feat/disable-owner-worker-fallback
miner: Config to disable owner/worker address fallback
2021-03-10 11:21:39 +01:00
Łukasz Magiera 40fdf6c180 Merge pull request #5624 from filecoin-project/feat/miner-storage-limit
Configurable storage path storage limit
2021-03-10 11:15:28 +01:00
Łukasz Magiera df0a8d9507 Merge pull request #5759 from filecoin-project/asr/terminate-livecheck
Check liveness of sectors when processing termination batches
2021-03-10 11:14:11 +01:00
Łukasz Magiera d11f2def6e Merge branch 'feat/max-deal-collateral-multiplier' into next 2021-03-10 11:13:15 +01:00
Łukasz Magiera ea4a54e083 wdpost: Fix tests 2021-03-10 10:01:28 +01:00
Łukasz Magiera 57fe04ba6e wdpost: double-check randomness 2021-03-10 09:19:38 +01:00
Łukasz Magiera 268abb5318 Merge pull request #5756 from filecoin-project/fix/bootstrapper-profile
Fix bootstrapper profile setting
2021-03-10 08:55:34 +01:00
Steven Allen b7fab5f937 fix: wait a bit before starting to compute window post proofs
Due to a (now consensus critical) bug in randomness selection, "beacon"
randomness depends on whether the epoch in which the beacon occurred was
a null block. Unfortunately, this means:

1. If a challenge lands on a non-null round but that non-null round gets
re-orged to a null round, the randomness will change to the beacon in
the first preceding non-null block.
2. If a challenge lands on a null round but that null round gets
re-orged to a non-null round, the randomness will change to the beacon
in the new non-null round.

The correct solution is to change the way the beacon is selected:

1. Wait until a non-null round.
2. The block in this round will contain all beacons from the null
   rounds, select the beacon from the target epoch.

Unfortunately, this requires a mandatory network upgrade.

Instead, this patch just waits a bit before beginning to compute window
post after passing the challenge round to wait-out any reorgs.
2021-03-09 22:03:05 -08:00
Aayush Rajasekaran 47064f987c Check liveness of sectors when processing termination batches 2021-03-09 23:36:30 -05:00
Peter Rabbitson bdafdf8060 Remove the SR2 stats, leave just the network totals
The SR2 aggregator now lives at https://github.com/filecoin-project/slingshot-stats
2021-03-09 23:36:03 +00:00
Łukasz Magiera 58cacda733 Fix bootstrapper profile setting 2021-03-09 23:46:13 +01:00
Łukasz Magiera 0a513952c8 better DisableWorkerFallback doc 2021-03-09 23:42:08 +01:00
Łukasz Magiera d4a981f327 fix lint 2021-03-09 23:38:28 +01:00
Łukasz Magiera b4eefd7220 backupds: make sure logfile matches datastore 2021-03-09 23:00:05 +01:00
Łukasz Magiera 9f7d3ed340 gofmt 2021-03-09 22:33:12 +01:00
Łukasz Magiera ca7e70bf3a Metadata datastore log 2021-03-09 22:33:01 +01:00
Łukasz Magiera 260ddacc47 Fix wallet import cycle, better trash key backup 2021-03-09 16:52:51 +01:00
jennijujuandAayush Rajasekaran 49c44b70c2 Aftering importing a previously deleted key, be able to delete it again.
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-03-09 16:43:01 +01:00
Łukasz Magiera 1c62d7a40f Merge pull request #5729 from filecoin-project/feat/api-no-dep-build
Feat/api no dep build
2021-03-09 16:01:53 +01:00
Łukasz Magiera 2642ddcf50 Merge pull request #5750 from filecoin-project/fix/splitstore-tests
test: attempt to make the splitstore test deterministic
2021-03-09 12:47:21 +01:00
vyzo ae6410d02f use compacting atomic to make the test deterministic 2021-03-09 09:05:36 +02:00
Łukasz Magiera 1755fc2d98 Merge pull request #5749 from filecoin-project/feat/netpeers-ext-connmgr
Add connmgr metadata to NetPeerInfo
2021-03-09 03:14:58 +01:00
Steven Allen 05e03dc259 revert change to generated file 2021-03-08 17:26:58 -08:00
Steven Allen 5304df52ca fix lotus-shed compile 2021-03-08 17:19:31 -08:00
Steven Allen dedf0bac16 fix docsgen 2021-03-08 17:16:07 -08:00
Steven Allen 6addd9afcc remove unused imports 2021-03-08 16:43:21 -08:00
Steven Allen 6d2e8d721d test: attempt to make the splitstore test deterministic
At a minimum, make it thread-safe.
2021-03-08 16:36:25 -08:00
Łukasz Magiera 4231e4396d docsgen funtimes 2021-03-09 00:24:22 +01:00
Łukasz Magiera 9f2015e850 docsgen 2021-03-09 00:22:48 +01:00
Łukasz Magiera 5388f3e6f8 Add connmgr metadata to NetPeerInfo 2021-03-09 00:22:48 +01:00
Łukasz Magiera c49c6fd514 Merge pull request #5746 from filecoin-project/chore/update-graphsync
chore: update go-graphsync to 0.6.0
2021-03-08 22:43:37 +01:00
Łukasz Magiera 58d7627168 Merge pull request #5730 from filecoin-project/asr/genesis-rootkey
Customize verifreg root key and remainder account when making genesis
2021-03-08 22:42:09 +01:00
Łukasz Magiera 06b360325a handle terminate control addrs in address selection correctly 2021-03-08 22:09:04 +01:00
Łukasz Magiera 6591af960f Merge pull request #4992 from filecoin-project/feat/splitstore
hot/cold blockstore segregation (aka. splitstore)
2021-03-08 22:01:06 +01:00
Łukasz Magiera 305c2ec77d miner: Config to disable owner/worker addcess fallback 2021-03-08 21:33:46 +01:00
Steven Allen 3a2e9887bd chore: update go-graphsync to 0.6.0
This fixes a bunch of bugs and should improve deal reliability.
2021-03-08 12:31:31 -08:00
Łukasz Magiera b13046293f Merge pull request #5735 from filecoin-project/feat/pubsub-ip-colocatio-whitelist
Add configuration option for pubsub IPColocationWhitelist subnets
2021-03-08 21:01:39 +01:00
Łukasz Magiera 51ed4c7b48 Merge pull request #5745 from filecoin-project/feat/splitstore-gc-tuning
tune badger gc to repeatedly gc the value log until there is no rewrite
2021-03-08 21:01:14 +01:00
Łukasz Magiera 7c7b107e97 Add max-storage flags to storage attach commands 2021-03-08 20:59:59 +01:00
vyzo 90741da019 tune badger gc to repeated gc the value log until there is no rewrite 2021-03-08 21:46:44 +02:00
vyzo c52dae45c5 Merge pull request #5744 from filecoin-project/feat/splitstore-gc
garbage collect hotstore after compaction
2021-03-08 20:09:27 +02:00
vyzo 3bd77701d8 deduplicate code 2021-03-08 19:46:21 +02:00
vyzo 3d1b855f20 rename GC to CollectGarbage, ignore badger.ErrNoRewrite 2021-03-08 19:42:38 +02:00
Łukasz Magiera 8a5cd21034 Merge pull request #5666 from filecoin-project/feat/extend-sectors-cmd
Command to extend sector expiration
2021-03-08 17:57:35 +01:00
vyzo 52de95d344 also gc in compactFull, not just compactSimple 2021-03-08 18:30:09 +02:00
vyzo 8562a9bb82 garbage collect hotstore after compaction 2021-03-08 18:12:09 +02:00
Dirk McCormick a6c8b56ab6 feat: Default the AlwaysKeepUnsealedCopy flag to true 2021-03-08 16:35:46 +01:00
Łukasz Magiera 5df45adb7a Merge pull request #5734 from filecoin-project/feat/net-peers-extended
Implement net peers --extended
2021-03-08 13:52:40 +01:00
Łukasz Magiera afb527ff30 fix lint 2021-03-08 13:31:06 +01:00
Łukasz Magiera 3ee87a8af8 gofmt 2021-03-08 13:24:24 +01:00
Łukasz Magiera 6d398f2507 make gen, docsgen 2021-03-08 13:23:58 +01:00
vyzo 64646de761 add configuration option for pubsub IPColocationWhitelist subnets 2021-03-06 20:05:32 +02:00
vyzo 667fffb302 go get go-libp2p-pubsub@master 2021-03-06 19:54:25 +02:00
vyzo 444b84d181 deduplicate peers in extended output 2021-03-06 19:25:11 +02:00
vyzo 4a74f752c0 implement extended peer info in net peers cli 2021-03-06 19:14:13 +02:00
Aayush Rajasekaran fc03a0773b gen/genesis: Allow remainder to be either account or msig 2021-03-06 01:43:48 -05:00
Aayush Rajasekaran 6534280673 lotus-seed: add a command to set the remainder 2021-03-06 01:43:48 -05:00
Aayush Rajasekaran 279f9e6fec gen/genesis: Allow verifreg rootkey to be either account or msig 2021-03-06 01:43:48 -05:00
Aayush Rajasekaran dbbcb1423f lotus-seed: add a command to set the verified registry root key 2021-03-06 01:43:48 -05:00
whyrusleeping e7a1d72ba8 extract build/version to api/version, remove api package dep on build 2021-03-05 14:28:13 -08:00
Łukasz Magiera b4ca7928f1 Merge pull request #5728 from filecoin-project/feat/cliutil-pkg
Move api client builders to a cliutil package
2021-03-05 21:41:06 +01:00
Łukasz Magiera a4a21b5b89 fix lint 2021-03-05 21:33:36 +01:00
Łukasz Magiera 58e49e3259 Move api client builders to a cliutil package 2021-03-05 21:08:41 +01:00
vyzo e85391b46c quiet stupid linter 2021-03-05 20:05:32 +02:00
vyzo 09f5ba177a add splitstore unit test 2021-03-05 19:55:32 +02:00
vyzo 0a2f2cf00d use the right condition for triggering the miss metric 2021-03-05 14:48:59 +02:00
vyzo 2b32c2e597 add some metrics 2021-03-05 14:48:57 +02:00
vyzo 99d21573da remove DEBUG log spam 2021-03-05 14:46:18 +02:00
vyzo c58df3f079 don't panic on compaction errors 2021-03-05 14:46:18 +02:00
vyzo 9bd009d795 use atomics to demarkate critical section and limit close delay 2021-03-05 14:46:18 +02:00
vyzo 17be7d3919 save markSetSize 2021-03-05 14:46:18 +02:00
vyzo aff0f1ed4c deduplicate code for batch deletion 2021-03-05 14:46:18 +02:00
vyzo 5fb6a907cb fix loop condition in batch deletion 2021-03-05 14:46:18 +02:00
vyzo 98a7b884fe implement DeleteMany in union blockstore 2021-03-05 14:46:18 +02:00
vyzo fdd877534f walk at boundary epoch, 2 finalities from current epoch, to find live objects
objects written after that are retained anyway.
2021-03-05 14:46:18 +02:00
vyzo 508fcb9d26 properly close snoop at shutdown 2021-03-05 14:46:18 +02:00
vyzo 47d8c87486 fix log 2021-03-05 14:46:18 +02:00
vyzo 11b2f41804 overestimate markSetSize a bit 2021-03-05 14:46:18 +02:00
vyzo 6b680d112b do tracker purge in smaller batches 2021-03-05 14:46:18 +02:00
vyzo 6b8c60a659 don't ID wrap the hotstore 2021-03-05 14:46:18 +02:00
vyzo d2d0980532 don't delete in one giant batch, use smaller chunks of batchSize 2021-03-05 14:46:18 +02:00
vyzo 70ebb2ad8d improve startup log 2021-03-05 14:46:18 +02:00
vyzo 006c55a7c9 add startup log 2021-03-05 14:46:18 +02:00
vyzo 06d8ea10b1 batch delete during the cold purge 2021-03-05 14:46:18 +02:00
vyzo 4c05ec28ba fix FromDatastore to not do double adapting 2021-03-05 14:46:18 +02:00
vyzoandraulk ab52e34e6a add comment
Co-authored-by: raulk <raul@protocol.ai>
2021-03-05 14:46:18 +02:00
vyzoandraulk 86fdad2e31 fix typo
Co-authored-by: raulk <raul@protocol.ai>
2021-03-05 14:46:18 +02:00
vyzo 2ff5aec80e satisfy linter, use Prefix for common path of non inline CIDs 2021-03-05 14:46:18 +02:00
vyzo 8a55b73146 fix the situation with WrapIDStore 2021-03-05 14:46:18 +02:00
vyzo 86b73d651e add DeleteMany to Blockstore interface 2021-03-05 14:46:18 +02:00
vyzo dd0c308427 move Blockstore config to FullNode, rename to Chainstore and add default for HotStoreType 2021-03-05 14:46:18 +02:00
vyzo 6014273e69 storage miner doesn't need a splitstore 2021-03-05 14:46:18 +02:00
vyzo c762536dcb deduplicate code 2021-03-05 14:46:18 +02:00
vyzo 5184bc5c40 log consistency for full compaction 2021-03-05 14:46:18 +02:00
vyzo 68213a92cb use ioutil.TempDir for test directories 2021-03-05 14:46:18 +02:00
vyzo 35d466d847 use sha256 for bloom key rehashing 2021-03-05 14:46:18 +02:00
vyzo f651f43c5e improve comment accuracy 2021-03-05 14:46:18 +02:00
Raúl Kripalani 4b1e1f4b52 rename liveset => markset; rename snoop => tracking store; docs. 2021-03-05 14:46:18 +02:00
vyzo 48f253328d increase batch size to 16K 2021-03-05 14:46:18 +02:00
vyzo ce68b9b229 batch writes during warm up 2021-03-05 14:46:18 +02:00
Raúl Kripalani 8cfba5b092 renames and polish. 2021-03-05 14:46:18 +02:00
Raúl Kripalani b1b452bc0f remove dependency from blockstore/splitstore => chain/store. 2021-03-05 14:46:18 +02:00
vyzo b9400c590f use crypto/rand for bloom salt 2021-03-05 14:46:18 +02:00
vyzo e612fff1fe also estimate liveset size during warm up 2021-03-05 14:46:18 +02:00
vyzo 748dd962d8 snake current tipset from head change notification 2021-03-05 14:46:18 +02:00
vyzo cb36d5b6a4 warm up splitstore at first head change notification 2021-03-05 14:46:18 +02:00
Raúl Kripalani 1a804fbdec move splitstore into blockstore package. 2021-03-05 14:46:18 +02:00
Raúl Kripalani 1b51c10d78 split off lmdb support to a different branch. 2021-03-05 14:46:18 +02:00
vyzo 3733456bca go mod tidy 2021-03-05 14:46:18 +02:00
vyzo 0fc2f3a26f fix post-rebase compilation errors 2021-03-05 14:46:18 +02:00
vyzo 3282f856ec fix tests 2021-03-05 14:46:18 +02:00
vyzo 99c6e4f48f adjust min bloom filter size 2021-03-05 14:46:18 +02:00
vyzo cae5ddce88 dynamically size bloom filters 2021-03-05 14:46:18 +02:00
vyzo 5639261e44 make compaction parameters variable 2021-03-05 14:46:18 +02:00
vyzo 7587ab6234 quiet the stupid linter 2021-03-05 14:46:18 +02:00
vyzo e582f0b713 remove references to splitstore from lotus-shed 2021-03-05 14:46:18 +02:00
vyzo 05fee27840 remove stale references to lmdb from splitstore implementation 2021-03-05 14:46:18 +02:00
vyzo f62999d2b8 use named constants for bloom filter parameters 2021-03-05 14:46:18 +02:00
vyzo 44aadb931a rehash salted keys in bloom filter 2021-03-05 14:46:17 +02:00
vyzo 88849201ff fix tests 2021-03-05 14:46:17 +02:00
vyzo f5ce7957f3 size bloom filter for 50M objects 2021-03-05 14:46:17 +02:00
vyzo f4c6bc6a86 comment nomenclature 2021-03-05 14:46:17 +02:00
vyzo 4cc672d0c5 batch move objects from coldstore to hotstore 2021-03-05 14:46:17 +02:00
vyzo 97abbe1eca add (salted) bloom filter liveset 2021-03-05 14:46:17 +02:00
vyzo aba6530411 batch deletion for purging the tracking store 2021-03-05 14:46:17 +02:00
vyzo 09cd1175a1 structured log for beginning of compaction 2021-03-05 14:46:17 +02:00
vyzo e52c709d8a more accurate setting of skip params 2021-03-05 14:46:17 +02:00
vyzo 2426ffb277 better logging plus moving some code around 2021-03-05 14:46:17 +02:00
vyzo 2f26026991 compactSimple should walk the cold epoch at depth 1
So that it finds reachable objects that should stay in the hotstore
2021-03-05 14:46:17 +02:00
vyzo 783dcda19c add Sync to the tracking store 2021-03-05 14:46:17 +02:00
vyzo 364076c1ea set NoSync option for bolt livesets 2021-03-05 14:46:17 +02:00
vyzo 73259aa350 add configuration for splitstore and default to a simple compaction algorithm 2021-03-05 14:46:17 +02:00
vyzo 2e4d45ef07 test for bolt backed tracking store 2021-03-05 14:46:17 +02:00
vyzo f1c61c4753 implement bolt backed tracking store 2021-03-05 14:46:17 +02:00
vyzo b83994797a separate LMDB options for hotstore and tracking stores 2021-03-05 14:46:17 +02:00
vyzo 2c1a9781cf add test for bolt liveset 2021-03-05 14:46:17 +02:00
vyzo 27a9b974db implement bolt-backed liveset 2021-03-05 14:46:17 +02:00
vyzo cb1789ea6e gomod: use bolt 2021-03-05 14:46:17 +02:00
vyzo 68b6f913c7 propagate useLMDB option to splitstore through DI 2021-03-05 14:46:17 +02:00
vyzo 923a3db4b0 abstract tracking store and live set construction 2021-03-05 14:46:17 +02:00
vyzo 8f0ddac41a add comment 2021-03-05 14:46:17 +02:00
vyzo e79445123f handle MDB_KEY_EXIST in tracking store Puts 2021-03-05 14:46:17 +02:00
vyzo 9977f5c3ec rewrite sweep logic to avoid doing writes/deletes nested in a read txn 2021-03-05 14:46:17 +02:00
vyzo ee751f88cd refactor lmdb specific snoop/liveset code into their own files
paves the way for different back ends
2021-03-05 14:46:17 +02:00
vyzo 99c7d8e3eb more informative names for the hotstore directories 2021-03-05 14:46:17 +02:00
vyzo 8e12377e69 handle consistency edge case 2021-03-05 14:46:17 +02:00
vyzo 31268ba685 walk snapshot the same way snapshot exporting does; skip old msgs and receipts by default.
so that we don't panic with missing blocks in non-archival nodes
2021-03-05 14:46:17 +02:00
vyzo 5068d51ac3 use CompactionCold epochs for delinating the cold epoch cliff
this allows us to change the thresholds for testing.
2021-03-05 14:46:17 +02:00
vyzo d44719dbd3 amend confusing comment 2021-03-05 14:46:17 +02:00
vyzo 842ec43c2f get rid of goroutine iteration in tracking store; long live ForEach 2021-03-05 14:46:17 +02:00
vyzo a586d42c3b make hot store DI injectable in the split store, default to badger. 2021-03-05 14:46:17 +02:00
vyzo 7044e623f9 flag to enable GC during compaction, disabled for now 2021-03-05 14:46:17 +02:00
vyzo f6c930d0aa crank up blockstore max readers to 16K, reduce retry delays to 10us 2021-03-05 14:46:17 +02:00
vyzo 95befa1e41 set lmdb max readers retry delay to 1ms 2021-03-05 14:46:17 +02:00
vyzo 723e48b399 gomod:update go-bs-lmdb to v1.0.3 2021-03-05 14:46:17 +02:00
vyzo 874ecd3573 adjust hot store options, redux. 2021-03-05 14:46:17 +02:00
vyzo ca8a673b5f adjust hot store options 2021-03-05 14:46:17 +02:00
vyzo 69a88d41b6 fix snoop test 2021-03-05 14:46:17 +02:00
vyzo cdf5bd0500 return annotated xerrors where appropriate 2021-03-05 14:46:17 +02:00
vyzo ea05fd9d86 use xerrors instead of fmt.Errorf 2021-03-05 14:46:17 +02:00
vyzo d91b60df91 fix potential panic with max readers retry and cursor channel 2021-03-05 14:46:17 +02:00
vyzo b9f8a3d587 log MDB_READERS_FULL retries 2021-03-05 14:46:17 +02:00
vyzo c89ab1a990 retry on MDB_READERS_FULL errors 2021-03-05 14:46:17 +02:00
vyzo 2080e467ba don't set MaxReaders for tracking store 2021-03-05 14:46:17 +02:00
vyzo 5872f246ff go get go-bs-lmdb@v1.0.2 2021-03-05 14:46:17 +02:00
Raúl Kripalani 877ecab960 update go-bs-lmdb and migrate to ledgerwatch/lmdb-go. 2021-03-05 14:46:17 +02:00
vyzo 5b4e6b7b26 don't set max readers for livesets 2021-03-05 14:46:17 +02:00
vyzo 58a8434825 temporary log level for splitstore to DEBUG 2021-03-05 14:46:17 +02:00
vyzo 8b0087524f adjust walk boundaries for marking 2021-03-05 14:46:17 +02:00
vyzo 76d6edbb52 fix max readers for tracking store 2021-03-05 14:46:17 +02:00
vyzo 1a23b1f6af make CompactionThreshold a var to fix lotus-soup build
finality is not a constant there!
2021-03-05 14:46:17 +02:00
vyzo 6e51e6db9a better handling of MDB_KEYEXIST in Put 2021-03-05 14:46:17 +02:00
vyzo 3f8da19a34 go get go-bs-lmdb@v0.0.3 2021-03-05 14:46:17 +02:00
vyzo ce41e394dc handle MDB_KEYEXIST in liveset marking 2021-03-05 14:46:17 +02:00
vyzo 843fd09a62 deal with MDB_KEY_EXIST errors 2021-03-05 14:46:17 +02:00
vyzo f44cf0f2c4 appease linter 2021-03-05 14:46:17 +02:00
vyzo facdc555b1 add nil check for curTs -- some tests don't have chain state 2021-03-05 14:46:17 +02:00
vyzo 3912694fb7 fix lotus-shed build 2021-03-05 14:46:17 +02:00
vyzo 622b4f7d9d hook splitstore into DI 2021-03-05 14:46:17 +02:00
vyzo e07c6c71c0 splitstore constructor 2021-03-05 14:46:17 +02:00
vyzo e87ce6cb60 go get go-bs-lmdb 2021-03-05 14:46:17 +02:00
vyzo b0f48b500f use CAS for compacting state 2021-03-05 14:46:17 +02:00
vyzo 0af7b16ad5 simplify Has 2021-03-05 14:46:17 +02:00
vyzo 37e391f133 add TODO note about map size 2021-03-05 14:46:17 +02:00
vyzo 5db314f422 fallback to coldstore if snooping fails. 2021-03-05 14:46:17 +02:00
vyzo d20cbc0c28 protect against potential data races
overkill, but let's not have race detectors scream at us.
2021-03-05 14:46:17 +02:00
vyzo da478832cb quiet linter 2021-03-05 14:46:17 +02:00
vyzo 4763397281 add tracking store test 2021-03-05 14:46:17 +02:00
vyzo 0d7476c5b2 implement LMDB-backed tracking store 2021-03-05 14:46:17 +02:00
vyzo 83f8a0ab12 quiet linter 2021-03-05 14:46:17 +02:00
vyzo 5043f31adf liveset unit test 2021-03-05 14:46:17 +02:00
vyzo 3f92a000c7 implement lmdb-backed LiveSet 2021-03-05 14:46:17 +02:00
vyzo df856b7315 gomod: get lmdb-go 2021-03-05 14:46:17 +02:00
vyzo 0bf1a78b39 stubs for tracking store and live set 2021-03-05 14:46:17 +02:00
vyzo 17bc5fcd85 move splitstore implementation to its own directory 2021-03-05 14:46:17 +02:00
vyzo 2c9b58aaec add some logging 2021-03-05 14:46:17 +02:00
vyzo c1b1a9ce2a avoid race with compacting state variable 2021-03-05 14:46:17 +02:00
vyzo 3083d80f5e no need to import go-ipfs-blockstore, lib/blockstore will do 2021-03-05 14:46:17 +02:00
vyzo 101e5c6540 close keys channel when dome emitting keys 2021-03-05 14:46:17 +02:00
vyzo b945747eb2 satisfy linter 2021-03-05 14:46:17 +02:00
vyzo 2bed6c94cd use dual live set marking algorithm to keep all hotly reachable objects in the hotstore 2021-03-05 14:46:17 +02:00
vyzo c2cc198316 fix off by 1 in marking 2021-03-05 14:46:17 +02:00
vyzo fd08786048 track base epoch in metadata ds 2021-03-05 14:46:17 +02:00
vyzo b192adfd2e trigger compaction from head changes 2021-03-05 14:46:17 +02:00
vyzo c8f1139e0d compaction algorithm 2021-03-05 14:46:17 +02:00
vyzo 6577cc8ea6 splitstore struct and Blockstore interface implementation 2021-03-05 14:46:17 +02:00
Łukasz Magiera d53c700d18 Merge pull request #5704 from filecoin-project/asr/log-large-delay
Log block CID in the large delay warning
2021-03-05 13:19:03 +01:00
Łukasz Magiera 9f721bfde5 Merge pull request #5716 from filecoin-project/fix/disputer-format-log
Correctly format disputer log
2021-03-05 13:16:53 +01:00
Łukasz Magiera 046eb284b9 Merge pull request #5648 from filecoin-project/feat/miner-worker-metrics
Collect worker task metrics
2021-03-05 13:04:46 +01:00
Łukasz Magiera fe230f901e Collect worker task metrics 2021-03-05 12:48:17 +01:00
Aayush Rajasekaranandraulk 374bd9b578 Update chain/sub/incoming.go
Co-authored-by: raulk <raul@protocol.ai>
2021-03-05 01:09:07 -05:00
Aayush Rajasekaran 92c55147c2 Merge pull request #5627 from filecoin-project/feat/update-butterflynet
Update butterfly network
2021-03-04 16:38:36 -05:00
Łukasz Magiera e05dc4ec80 Merge pull request #5718 from Rennbon/master
fix(multisig): The format of the amount is not correct in msigLockApp…
2021-03-04 19:20:44 +01:00
Dirk McCormick 84803f82ab feat: show deals CLI command 2021-03-04 16:56:49 +01:00
Rennbon 10076d5698 no message 2021-03-04 19:15:31 +08:00
Rennbon fb78d5095f no message 2021-03-04 19:12:29 +08:00
Rennbon d80b0d9c2e fix(multisig): The format of the amount is not correct in msigLockApproveCmd and msigLockCancelCmd 2021-03-04 19:04:54 +08:00
Travis Person 2d5a6dab30 Correctly format disputer log 2021-03-04 06:36:37 +00:00
Łukasz Magiera 448813d2fe Merge pull request #5695 from filecoin-project/feat/segregate-blockstores
segregate chain and state blockstores
2021-03-03 10:53:46 +01:00
Aayush Rajasekaran 22e465ba9c log block cid in the large delay warning 2021-03-02 16:46:10 -05:00
Raúl Kripalani 1ac0c9a926 address review comments. 2021-03-02 21:29:24 +00:00
Raúl Kripalani 68b8e8e9cb implement unionBlockstore#HashOnRead. 2021-03-02 21:22:24 +00:00
Raúl Kripalani 2047a74958 implement blockstore.Union, a union blockstore.
The union blockstore takes a list of blockstores. It returns the first
satisfying read, and broadcasts writes to all stores.

It can be used for operations that require reading from any two blockstores,
for example WalkSnapshot.
2021-03-02 17:03:11 +00:00
Raúl Kripalani b1c348b4a7 address review comments. 2021-03-02 16:31:01 +00:00
Łukasz Magiera 61005e61e9 Merge branch 'rvagg-rvagg/list-asks-output' into next 2021-03-02 13:59:18 +01:00
Rod Vagg b9d7de595a list-asks: add --output-format & omit progress if !stdout 2021-03-02 13:58:41 +01:00
Łukasz Magiera a39f4809a3 Merge pull request #5604 from filecoin-project/feat/packer-build
packer provisioner
2021-03-02 13:55:44 +01:00
Łukasz Magiera cd1a2e3413 Merge pull request #5702 from filecoin-project/asr/sync-stage-string
Add idle to sync stage's String()
2021-03-02 13:47:17 +01:00
Dirk McCormick ced455bba9 feat: add configurable max provider collateral 2021-03-02 10:24:57 +01:00
Aayush Rajasekaran 9850e786e8 Add idle to sync stage's String() 2021-03-01 23:56:51 -05:00
Łukasz Magiera 57642697bc Merge pull request #5484 from filecoin-project/refactor/lib/blockstore
refactor blockstores
2021-03-01 19:37:10 +01:00
Cory Schwartz 2f496b3ad7 tag in droplet image 2021-03-01 10:11:52 -08:00
Łukasz Magiera 8bd5173a54 Merge branch 'next' into refactor/lib/blockstore 2021-03-01 19:04:40 +01:00
Łukasz Magiera 5fe37404bc Merge remote-tracking branch 'origin/master' into next 2021-03-01 19:03:01 +01:00
Łukasz Magiera 3f5b17dcfc Merge pull request #5694 from filecoin-project/asr/nits
Correct some logs
2021-03-01 18:22:40 +01:00
Raúl Kripalani b34b4e0374 fix test compilation error. 2021-02-28 23:10:01 +00:00
Raúl Kripalani 3795cc2bd2 segregate chain and state blockstores.
This paves the way for better object lifetime management.

Concretely, it makes it possible to:
- have different stores backing chain and state data.
- having the same datastore library, but using different parameters.
- attach different caching layers/policies to each class of data, e.g.
  sizing caches differently.
- specifying different retention policies for chain and state data.

This separation is important because:
- access patterns/frequency of chain and state data are different.
- state is derivable from chain, so one could never expunge the chain
  store, and only retain state objects reachable from the last finality
  in the state store.
2021-02-28 22:49:44 +00:00
Raúl Kripalani 853de3daf7 fix TimedCacheBlockstore#View. 2021-02-28 22:39:00 +00:00
Raúl Kripalani 45a650c012 remove unnecessary View casting. 2021-02-28 22:20:29 +00:00
Raúl Kripalani 8b17a4766d fix CI for build-lotus-soup. 2021-02-28 21:07:25 +00:00
Raúl Kripalani 9f0c68bb70 fix unused import post-merge. 2021-02-28 19:57:37 +00:00
Raúl Kripalani 7f0f7d0b36 Merge branch 'master' into refactor/lib/blockstore 2021-02-28 19:55:23 +00:00
Raúl Kripalani 8601e5da3a address review comments. 2021-02-28 19:44:02 +00:00
Aayush Rajasekaran 191a05da48 Fixup get-cc-collateral command 2021-02-28 02:10:22 -05:00
Aayush Rajasekaran 48bce386cd Correct some logs 2021-02-28 01:18:29 -05:00
Jennifer 81fcffcf3c Update proving-issues.md 2021-02-27 00:55:55 -05:00
JenniferandŁukasz Magiera 31898af076 Update .github/ISSUE_TEMPLATE/proving-issues.md
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-02-27 00:54:52 -05:00
JenniferandŁukasz Magiera 5b4f93cffa Update .github/ISSUE_TEMPLATE/bug-report.md
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-02-27 00:54:27 -05:00
Łukasz Magiera fe69b561a6 Merge pull request #5676 from filecoin-project/feat/list-gas-stats
chain list --gas-stats display capacity
2021-02-26 19:35:32 +01:00
Jakub Sztandera 10e1b26580 chain list --gas-stats display capacity
Add tipset capacity display to `chain list`

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-26 14:05:51 +01:00
Łukasz Magiera 29c9fa3137 Merge pull request #5612 from filecoin-project/feat/cc-fsm-cleanup
storagefsm: Cleanup CC sector creation
2021-02-26 11:39:28 +01:00
Łukasz Magiera c69f884116 Merge pull request #5668 from filecoin-project/revert-5667-revert-5432-refac/send
reintroduce Refactor send command for better testability
2021-02-25 14:56:36 +01:00
Łukasz Magiera b48ea9610f Merge remote-tracking branch 'origin/master' into revert-5667-revert-5432-refac/send 2021-02-25 14:54:20 +01:00
Łukasz Magiera f5d819ba53 Merge pull request #5669 from ghoneycutt/import_error
Improve error message with importing a chain
2021-02-25 14:31:33 +01:00
Łukasz Magiera e49a412f6d Merge pull request #5375 from filecoin-project/feat/refactor-fsm-input
storagefsm: Rewrite input handling
2021-02-25 14:28:04 +01:00
Łukasz Magiera 247a086cbf Merge pull request #5658 from filecoin-project/fix/handle-recoverdealids
Remove sectors with all deals expired in RecoverDealIDs
2021-02-25 13:26:59 +01:00
Garrett Honeycutt 92b605466f Improve error message with importing a chain
Without this commit the error message does not provide much value as it
lacks context.
2021-02-24 19:29:29 -05:00
Cory Schwartz 9ceda488e1 motd 2021-02-24 11:16:41 -08:00
Cory Schwartz f697ca7e1e remove timeout 2021-02-24 11:16:41 -08:00
Cory Schwartz 481f17fd55 extra note about downloading the snapshot 2021-02-24 11:16:41 -08:00
Cory Schwartz 857cb815b1 public AMI 2021-02-24 11:16:41 -08:00
Cory Schwartz a1b1bb90e8 extra space 2021-02-24 11:16:41 -08:00
Cory Schwartz fca183161a use pre exec 2021-02-24 11:16:41 -08:00
Cory Schwartz 6b9478f862 use sudo for wallet 2021-02-24 11:16:41 -08:00
Cory Schwartz cec0a6e790 add calibrationnet 2021-02-24 11:16:41 -08:00
Cory Schwartz de80b1e433 mainnet packer provisioner 2021-02-24 11:16:41 -08:00
Łukasz Magiera c9c26ee282 Merge pull request #5675 from filecoin-project/fix/rice
Fix riceing by importing the main package
2021-02-24 16:38:25 +01:00
Jakub Sztandera ccebc4f53c Fix riceing by importing the main package
Go 1.16 elides dependencies from go.sum when you don't use a package
which has these dependencies.

This means dependencies for the `rice` command where not in our
`go.sum`.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-24 15:58:40 +01:00
Łukasz Magiera 3c9e376474 Merge pull request #5656 from filecoin-project/feat/state-search-replaced
Show replacing message CID is state search-msg cli
2021-02-24 12:59:39 +01:00
Aayush Rajasekaran 55b85f3148 Merge pull request #5670 from filecoin-project/asr/changelog
Lotus version 1.5.0
2021-02-23 16:42:49 -05:00
Aayush Rajasekaran d8bb112bcd Lotus version 1.5.0 2021-02-23 16:25:40 -05:00
Aayush Rajasekaran 4cec0375b9 Merge pull request #5663 from filecoin-project/asr/disable-v3
Add a LOTUS_DISABLE_V3_ACTOR_MIGRATION envvar
2021-02-23 14:09:21 -05:00
Jakub Sztandera 303a0fec87 Revert "Revert "Refactor send command for better testability"" 2021-02-23 15:50:47 +01:00
Łukasz Magiera 5dd7e418d6 Merge pull request #5667 from filecoin-project/revert-5432-refac/send
Revert "Refactor send command for better testability"
2021-02-23 15:29:22 +01:00
Jakub Sztandera bebc11522e Revert "Refactor send command for better testability" 2021-02-23 15:25:19 +01:00
Jakub Sztandera 7721ea20ba Merge pull request #5432 from filecoin-project/refac/send
Refactor send command for better testability
2021-02-23 13:18:11 +01:00
Łukasz Magiera a3a78fc705 Command to extend sector expiration 2021-02-23 09:27:14 +01:00
Aayush Rajasekaran ac06abb964 Add a LOTUS_DISABLE_V3_ACTOR_MIGRATION envvar 2021-02-23 01:57:42 -05:00
Łukasz Magiera 2b9ed9fa3d Remove sectors with all deals expired in RecoverDealIDs 2021-02-22 21:03:51 +01:00
Jakub Sztandera 7148a5558f Rename newMockCmd to newMockApp
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-22 20:31:39 +01:00
Jakub Sztandera 0de363131e fix typo
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-22 20:29:26 +01:00
Łukasz Magiera 6b8cbad31a Show replacing message CID is state search-msg cli 2021-02-22 19:11:38 +01:00
Łukasz Magiera 35759fa07e Merge pull request #5635 from filecoin-project/deps/cbg-soft-map
Update markets, cbor-gen with soft map decoding
2021-02-22 18:27:38 +01:00
Dirk McCormick a8b40b77fa update to go-fil-markets v1.1.9 2021-02-22 17:01:28 +01:00
Dirk McCormick 7046e2721a feat: update go-fil-markets version 2021-02-22 14:25:29 +01:00
Jennifer Wang a03506cf82 Mention security policy 2021-02-22 01:38:59 -05:00
Aayush Rajasekaran d1abc3cb5f Merge pull request #5643 from filecoin-project/chore/normalize-deps
chore: normalize deps
2021-02-19 18:43:43 -05:00
Steven Allen b177e67a7a chore: normalize deps 2021-02-19 15:27:38 -08:00
Aayush Rajasekaran 39a8edbe4b Merge pull request #5641 from filecoin-project/update/ntwk-calibration
Reset calibration network
2021-02-19 18:27:35 -05:00
Travis Person 5cf58e291b Add calibration genesis 2021-02-19 23:11:01 +00:00
Travis Person cf606196e3 Reset calibration network 2021-02-19 23:00:28 +00:00
Aayush Rajasekaran 7bb948dd8a Merge pull request #5640 from filecoin-project/asr/nv10-epochs
Set nv10 upgrade epochs
2021-02-19 17:50:55 -05:00
Aayush Rajasekaran b60a63ebd9 Set nv10 upgrade epochs 2021-02-19 17:43:01 -05:00
Aayush Rajasekaran c9ed293657 Merge pull request #5639 from filecoin-project/asr/specs-update
Update actors to v3.0.2
2021-02-19 17:42:45 -05:00
Aayush Rajasekaran f47dcfacde Merge pull request #5638 from filecoin-project/feat/rm-null-bls
Remove the null BLS actor
2021-02-19 17:42:29 -05:00
Aayush Rajasekaran 6732758d0f Tweak mock ProveCommits to respect proof sizes 2021-02-19 17:22:59 -05:00
Aayush Rajasekaran 60b7f56297 Code review 2021-02-19 15:10:56 -05:00
Aayush Rajasekaran df32f5d060 Update actors to v3.0.2 2021-02-19 15:08:30 -05:00
Łukasz Magiera 00f9cf3f2a docsgen 2021-02-19 20:13:47 +01:00
Łukasz Magiera 26399dba70 Update markets, cbor-gen with soft map decoding 2021-02-19 20:11:43 +01:00
Łukasz Magiera f2578a8e83 Merge pull request #5615 from filecoin-project/feat/disputer-logs
Disputer logs to its own logger
2021-02-19 12:10:18 +01:00
Łukasz Magiera 4f6700a4ee Merge pull request #5622 from yaohcn/fix-drop-sector
fix drop sector
2021-02-19 12:08:28 +01:00
Travis Person bb4609a764 Add butterfly genesis 2021-02-19 02:16:17 +00:00
Travis Person aee5edb904 Update butterfly network 2021-02-19 01:58:03 +00:00
Travis Person b756550ebf Update butterfly network 2021-02-19 00:27:53 +00:00
Aayush Rajasekaran 96b4b828f7 Remove the null bls actor from the init actor state 2021-02-18 19:01:28 -05:00
Aayush Rajasekaran a0fedf8bdb Only delete the zero BLS actor on mainnet 2021-02-18 19:01:21 -05:00
Aayush Rajasekaran 2ca70e600d Move the zero bls actor creation check into the VM 2021-02-18 19:01:11 -05:00
Aayush Rajasekaran 5aff54161a Delete the null-bls actor 2021-02-18 19:01:03 -05:00
Aayush Rajasekaran a8ae3a1909 Merge pull request #5475 from filecoin-project/feat/butterfly-network
Adds the butterfly network
2021-02-18 14:20:39 -05:00
Łukasz Magiera 1c4c9f262a docsgen 2021-02-18 16:48:53 +01:00
Łukasz Magiera 37b1fb97fb Configurable storage path storage limit 2021-02-18 16:44:34 +01:00
Jakub Sztandera 607d1bc6f7 Add Send CLI tests
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-18 15:21:31 +01:00
Jakub Sztandera afd5828d74 Make lint happy
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-18 15:21:31 +01:00
Jakub Sztandera 83bd8ebf65 Add nolint
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-18 15:21:31 +01:00
Jakub Sztandera 3de893542b Finish Send CLI service tests
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-18 15:21:31 +01:00
Jakub Sztandera bad67acb4b Generate mocks, integrate send service test
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-18 15:21:31 +01:00
Jakub Sztandera 9553b32d52 Implement services skeleton
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-18 15:21:31 +01:00
Jakub Sztandera b13428bf11 Make lint happy
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-18 15:21:31 +01:00
Jakub Sztandera 28bed9ac54 Refactor send command for better testability
Separate CLI parsing and interactions with the API.
`send` becomes its own function accepting only interfaces it needs.
Tests will follow.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-18 15:21:31 +01:00
yaohcn 3f66e731fa fix drop sector 2021-02-18 12:00:28 +08:00
Łukasz Magiera d8c9712383 Merge remote-tracking branch 'origin/master' into feat/refactor-fsm-input 2021-02-17 21:24:48 +01:00
Travis Person 6559cdfa6a Butterfly genesis 2021-02-17 19:45:27 +00:00
Travis Person a674062fa8 Update bootstraps 2021-02-17 19:45:27 +00:00
Travis Person 76349510eb Add butterfly network 2021-02-17 19:42:47 +00:00
Aayush Rajasekaran 61eb91ff37 Merge pull request #5618 from filecoin-project/asr/changelog
Lotus version 1.4.2
2021-02-17 14:29:01 -05:00
Łukasz Magiera d12545af6f Merge pull request #5469 from filecoin-project/feat/faucet-captcha
Add spam protection to fountain
2021-02-17 20:17:28 +01:00
Aayush Rajasekaran f76fcef3f8 Lotus version 1.4.2 2021-02-17 13:39:58 -05:00
Aayush Rajasekaran c2cb7d8911 Merge pull request #5621 from filecoin-project/deps/jsonrpc-45ea43a
Update go-jsonrpc
2021-02-17 13:32:06 -05:00
Łukasz Magiera 5f998038c7 Update go-jsonrpc 2021-02-17 18:59:31 +01:00
Aayush Rajasekaran f358af6f56 Fix typo 2021-02-16 19:35:35 -05:00
Łukasz Magiera 90b8612cf4 Merge remote-tracking branch 'origin/master' into feat/refactor-fsm-input 2021-02-16 22:39:06 +01:00
Łukasz Magiera bcd3e92281 Merge pull request #5616 from filecoin-project/deps/proofs-deadlock-fix
Update ffi with the bellman deadlock fix
2021-02-16 22:38:42 +01:00
Łukasz Magiera 0ffdc5df05 Merge pull request #5614 from filecoin-project/deps/update-jsonrpc-reconnect
Update go-jsonrpc fixing websocket reconnecting
2021-02-16 22:05:57 +01:00
Łukasz Magiera 9ebeafb174 Update ffi 2021-02-16 22:04:08 +01:00
Travis Person d1843ecca1 Disputer logs to its own logger 2021-02-16 20:38:11 +00:00
Łukasz Magiera 5ad4d72fe0 Update go-jsonrpc fixing websocket reconnecting 2021-02-16 21:16:13 +01:00
Łukasz Magiera b6c75d6b11 Merge pull request #5613 from filecoin-project/feat/client-commp-car
Check format in client commP util
2021-02-16 21:06:50 +01:00
Łukasz Magiera 39ad3d3b27 Check format in client commP util 2021-02-16 20:48:31 +01:00
Łukasz Magiera a8464a345b Fix tests 2021-02-16 19:19:31 +01:00
Łukasz Magiera fd90c03018 Roturn SectorID from PledgeSector 2021-02-16 19:16:35 +01:00
Łukasz Magiera f719765069 storageminer: exit PledgeSector after sectors enter sealing pipeline 2021-02-16 17:41:58 +01:00
Łukasz Magiera 46b880a6b9 storageminer: Skip uninitialized sectors in SectorsList 2021-02-16 17:34:06 +01:00
Łukasz Magiera fc5e243c92 storagefsm: Cleanup CC sector creation 2021-02-16 17:14:59 +01:00
Łukasz Magiera dd82729f60 Merge remote-tracking branch 'origin/master' into feat/refactor-fsm-input 2021-02-16 13:45:39 +01:00
Łukasz Magiera ea7ea72f60 Merge pull request #5608 from filecoin-project/revert/data-xfer-pct-5553
Revert "feat: deals - show data transfer %"
2021-02-16 13:45:14 +01:00
Dirk McCormick a6e3856776 Revert "feat: deals - show data transfer %"
This reverts commit b6c9ddccff.
2021-02-16 12:32:45 +01:00
Aayush Rajasekaran 6e14bd8f6d Merge pull request #5603 from filecoin-project/asr/nerpanet
Set nerpanet's upgrade epochs up to v3 actors
2021-02-16 01:59:04 -05:00
Aayush Rajasekaran dd26b68eec Set nerpanet's upgrade epochs up to v3 actors 2021-02-16 01:51:40 -05:00
Aayush Rajasekaran 95a542e45a Merge pull request #5599 from filecoin-project/chore/update-bitfield
update go-bitfield
2021-02-16 01:05:02 -05:00
Aayush Rajasekaran 1b21a718c4 Merge pull request #5600 from filecoin-project/asr/ffi-update
Update FFI
2021-02-16 01:04:24 -05:00
Aayush Rajasekaran bb7fabb439 Update FFI 2021-02-15 17:22:25 -05:00
Steven Allen 6b6f0acaf0 update go-bitfield
optimizes subtract operations
2021-02-15 13:14:13 -08:00
Łukasz Magiera 50d6db3978 Merge pull request #5592 from filecoin-project/feat/ffi-check
Verify FFI version before building
2021-02-15 20:27:16 +01:00
Jakub Sztandera 06cc1eb155 Revert unreleated cleanup
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-15 19:54:25 +01:00
Jakub Sztandera 59733da383 Verify FFI version before building
Resolves: #5003

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-02-15 13:30:56 +01:00
Łukasz Magiera 6907e5879d Fix WaitDeals sector accounting 2021-02-11 13:52:00 +01:00
Łukasz Magiera 7111e924cc Merge remote-tracking branch 'origin/master' into feat/refactor-fsm-input 2021-02-11 13:30:22 +01:00
Łukasz Magiera 95e47cf998 Merge pull request #5553 from filecoin-project/feat/data-xfer-percent
show data transfer % for storage deals
2021-02-11 13:29:43 +01:00
Łukasz Magiera cca076b05c Merge pull request #5582 from filecoin-project/fix/log-error-fmt
Fix error logging format strings
2021-02-11 13:26:28 +01:00
Łukasz Magiera 0c6aef221d Fix error logging format strings 2021-02-11 12:00:26 +01:00
Łukasz Magiera fcbd9950ca Merge pull request #5507 from filecoin-project/fix/coalescer
refactor coalescing logic into its own function, take both cancellation sets into account
2021-02-10 17:40:47 +01:00
Łukasz Magiera 332dc2154c Merge pull request #5571 from filecoin-project/feat/lotus-seed-genesis
lotus-seed command to generate lotus block
2021-02-10 17:33:07 +01:00
Łukasz Magiera cc0d281604 Merge pull request #5565 from filecoin-project/fix-lotus-soup-deals-e2e-testplan
lotus-soup testplan: add storageadapter.PublishMsgConfig to miner in testkit
2021-02-10 16:58:56 +01:00
Łukasz Magiera 39540b8a0a Merge pull request #5570 from filecoin-project/feat/read-state-code
add code cid to stateReadState output
2021-02-10 16:56:04 +01:00
Łukasz Magiera 577368ca03 Merge pull request #5574 from filecoin-project/nonsense/ux-categories-upper
ux/ui suggestion: make categories uppercase
2021-02-10 16:55:43 +01:00
Anton Evangelatov 044972ebdc make categories uppercase 2021-02-10 14:38:42 +01:00
Dirk McCormick b6c9ddccff feat: deals - show data transfer % 2021-02-10 09:56:23 +01:00
Cory Schwartz 039ca9f3b4 return the err 2021-02-09 17:05:56 -08:00
Cory Schwartz 6d4caa0163 lotus-seed command to generate lotus block
Currently devnet deployment requires spinning up a full daemon.
This would move the daemon `lotus-make-genesis` logic to lotus-seed
so it can be more easily executed in scripts, etc.
2021-02-09 16:54:32 -08:00
Łukasz Magiera b17f644ab9 docsgen 2021-02-10 00:46:33 +01:00
whyrusleeping e387f3810e add code cid to stateReadState output 2021-02-09 14:18:19 -08:00
Anton Evangelatov 59f814028f add storageadapter.PublishMsgConfig to miner in testkit 2021-02-09 19:12:59 +01:00
Łukasz Magiera e27a530cbc storagefsm: cleanup openSectors better; pendingPieces by pieceCid 2021-02-09 18:44:41 +01:00
Łukasz Magiera 5a3b983954 Merge pull request #5529 from filecoin-project/feat/shed-rpc-miner
shed: Support miner nodes in rpc util
2021-02-09 17:23:08 +01:00
Łukasz Magiera c77ce704cb Merge pull request #5564 from filecoin-project/nonsense/get-rid-of-gocheck
go.mod: do not depend on gocheck
2021-02-09 17:22:53 +01:00
Łukasz Magiera a4d953e2c3 Merge pull request #5555 from filecoin-project/feat/builder-cleanup
node builder: Cleanup and add some docstrings
2021-02-09 17:21:29 +01:00
Anton Evangelatov 307fc14093 go.mod: do not depend on gocheck 2021-02-09 17:08:19 +01:00
Łukasz Magiera e92b8b24b1 Merge remote-tracking branch 'origin/master' into feat/refactor-fsm-input 2021-02-09 14:04:21 +01:00
Łukasz Magiera adeb4cefee node builder: Cleanup and add some docstrings 2021-02-09 13:52:03 +01:00
Łukasz Magiera 811fb44dd0 Merge pull request #5549 from filecoin-project/feat/cli-pending-publish
Output more info in pending-publish CLI
2021-02-09 13:50:31 +01:00
Łukasz Magiera 55007a0c4e Merge pull request #5552 from nonsense/nonsense/circle-halt-step-gracefully
circleci: halt step gracefully
2021-02-09 13:49:20 +01:00
Jennifer e3bf42cf15 Update sealingfailed.md 2021-02-08 15:32:34 -05:00
Jennifer 2f1aef17cc Update proving-issues.md 2021-02-08 15:32:09 -05:00
Jennifer ff6216486e Update mining-issues.md 2021-02-08 15:31:52 -05:00
Jennifer 6c2762f7bb Update deal-making-issues.md 2021-02-08 15:30:03 -05:00
JenniferandŁukasz Magiera 8dcc008135 Update .github/ISSUE_TEMPLATE/proving-issues.md
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-02-08 15:19:53 -05:00
JenniferandŁukasz Magiera d09db15ddd Update .github/ISSUE_TEMPLATE/deal-making-issues.md
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-02-08 15:19:44 -05:00
JenniferandŁukasz Magiera d09f6f947a Update .github/ISSUE_TEMPLATE/deal-making-issues.md
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-02-08 15:19:29 -05:00
Anton Evangelatov 791267f72e circleci: halt step gracefully 2021-02-08 20:03:56 +01:00
Łukasz Magiera 3f112d065b Merge pull request #5554 from filecoin-project/fix-testplans-build
fix `build-lotus-soup` ci job
2021-02-08 19:57:44 +01:00
Dirk McCormick eb03422c93 feat: add ends-in to pending publish deals output 2021-02-08 18:06:50 +01:00
Anton Evangelatov 891971edec circleci: add task to get latest master for lotus 2021-02-08 17:48:37 +01:00
Anton Evangelatov cc91eab0fd fix lr.Datastore interface to include context 2021-02-08 17:38:51 +01:00
Anton Evangelatov 764a08b980 fix testplans build 2021-02-08 16:32:30 +01:00
Łukasz Magiera 0afe7325f6 Merge pull request #4995 from filecoin-project/lock-lotus-version-in-testplan
rename oni/lotus-soup imports to testplans/lotus-soup and go get lotus@master on trigger
2021-02-08 15:39:15 +01:00
Dirk McCormick 614844dc94 feat: output more info in pending-publish CLI 2021-02-08 12:08:42 +01:00
Dirk McCormick af45b299e7 fix: flaky TestForcePublish 2021-02-08 12:05:44 +01:00
Jennifer bdb85d6115 Update issue templates 2021-02-06 16:23:25 -05:00
Łukasz Magiera 6de62411c6 Merge pull request #5538 from filecoin-project/feat/deal-publisher-force
add commands to list pending deals and force publish
2021-02-05 23:00:52 +01:00
Łukasz Magiera 9f546c2d1c Merge pull request #5540 from austinabell/austin/beyondmaxio
Remove unnecessary database reads in validation check
2021-02-05 22:40:32 +01:00
Łukasz Magiera 3ff6a6f59f address review; flush tablewriter 2021-02-05 22:33:53 +01:00
Łukasz Magiera a4ddf9225f docsgen 2021-02-05 22:02:33 +01:00
Łukasz Magiera 1b65f48808 Fix build 2021-02-05 21:58:36 +01:00
Łukasz Magiera ec58099cc7 Merge pull request #4545 from filecoin-project/steb/refactor-consistent-tipset-methods
Make state tipset usage consistent in the API
2021-02-05 21:57:02 +01:00
Łukasz Magiera cfa73f34e4 market: miner CLI for managing pending deals 2021-02-05 21:55:43 +01:00
austinabell 3228ae5672 Remove unnecessary database reads in validation check 2021-02-05 15:46:46 -05:00
Łukasz Magiera b3f4e50c58 market: APIs to manage pending deals 2021-02-05 18:58:55 +01:00
Dirk McCormick 01e30e0665 test: add test for pending publish deals / force publish 2021-02-05 17:09:57 +01:00
Dirk McCormick 4676fd6753 feat: add methods to list pending deals and force publish 2021-02-05 15:56:50 +01:00
Łukasz Magiera 33c1283880 docsgen 2021-02-05 13:19:15 +01:00
Łukasz Magiera 2c772d6fda skip TestDealMining in short mode 2021-02-05 13:18:41 +01:00
Łukasz Magiera 8f603717a6 Merge remote-tracking branch 'origin/master' into steb/refactor-consistent-tipset-methods 2021-02-05 13:08:49 +01:00
Łukasz Magiera 52bfed1739 bump api version 2021-02-05 13:08:39 +01:00
Łukasz Magiera dc6392db49 Merge pull request #5219 from filecoin-project/feat/interactive-wallet
lotus-wallet: Add interactive mode
2021-02-05 13:07:25 +01:00
Łukasz Magiera 0760676f65 Merge pull request #5520 from filecoin-project/feat/msig-pending-api
add an api endpoint to get pending transactions for multisigs
2021-02-05 12:49:05 +01:00
Łukasz Magiera 641eeb4783 lotus-wallet: Better interactive prompts 2021-02-05 12:47:55 +01:00
Łukasz Magiera ab5345860c gofmt 2021-02-05 12:44:07 +01:00
Łukasz Magiera 06d3892e38 lotus-wallet: Add interactive mode 2021-02-05 12:44:01 +01:00
Łukasz Magiera 047de13929 docsgen 2021-02-05 12:34:28 +01:00
Łukasz Magiera a001033687 Merge pull request #5535 from filecoin-project/feat/mkts-1.1.7
update to go-fil-markets@1.1.7
2021-02-05 12:32:52 +01:00
Dirk McCormick e7a63b7dd5 feat: updated to go-fil-markets@1.1.7 2021-02-05 12:12:48 +01:00
Łukasz Magiera b938ac4cc8 Merge pull request #5428 from filecoin-project/refactor/mkts-wait-publish
Move waiting for publish deals from markets into lotus
2021-02-05 10:59:18 +01:00
Dirk McCormick 6baddccff2 feat: update to go-fil-markets v1.1.6 2021-02-05 09:41:42 +01:00
He Weidong 0e2e1125d3 fix precommit ticket expiration handling 2021-02-05 10:45:15 +08:00
Łukasz Magiera ebfde330dd shed: Support miner nodes in rpc util 2021-02-04 20:06:05 +01:00
whyrusleeping 0efb4ca3a7 add an api endpoint to get pending transactions for multisigs 2021-02-03 20:46:10 -08:00
Łukasz Magiera ba571794dc Merge pull request #5309 from filecoin-project/feat/deal-batch-publish
batch publish deal messages
2021-02-04 01:19:56 +01:00
Łukasz Magiera 2462f77711 Merge pull request #5515 from filecoin-project/fix/gateway-read-state
properly wire up StateReadState on gateway api
2021-02-04 01:17:57 +01:00
whyrusleeping 2505ed051e properly wire up StateReadState on gateway api 2021-02-03 15:31:09 -08:00
Łukasz Magiera 6e7fcb7ee6 Merge remote-tracking branch 'origin/master' into feat/refactor-fsm-input 2021-02-03 14:01:56 +01:00
Łukasz Magiera 9b65793509 Merge pull request #5404 from filecoin-project/feat/test-window-post
Retry proofs if we generate an incorrect one
2021-02-03 13:04:33 +01:00
Łukasz Magiera d64f4e84d5 add small cooldown if windowpost fails to verify 2021-02-03 12:42:19 +01:00
Łukasz Magiera 1e7a107484 Merge pull request #5433 from filecoin-project/feat/keep-unsealed-cfg
Add miner config to always keep ensealed deal copies
2021-02-03 12:40:02 +01:00
Łukasz Magiera fb6c4d5c76 Merge pull request #5506 from filecoin-project/fix/storageadapter-contexts
Use correct contexts in storageadapter
2021-02-03 12:38:32 +01:00
Łukasz Magiera c678822490 Merge pull request #5510 from filecoin-project/asr/nerpanet
Create a nerpanet build option
2021-02-03 12:38:00 +01:00
Dirk McCormick fc8ee481a8 refactor: move waiting for publish deals from markets into lotus 2021-02-03 10:36:38 +01:00
Dirk McCormick 05bf177686 feat: batch publish deal messages 2021-02-03 10:32:39 +01:00
Aayush Rajasekaran 6a63e6f448 Create a nerpanet build option 2021-02-02 22:10:22 -05:00
vyzo 5c6988a7c1 refactor coalescing logic into its own function, take both cancellation sets into account 2021-02-02 21:26:50 +02:00
Łukasz Magiera c59e2fea5b Use correct contexts in storageadapter 2021-02-02 18:43:49 +01:00
Łukasz Magiera 332ea8a126 Merge remote-tracking branch 'origin/master' into feat/deal-batch-publish 2021-02-02 18:21:14 +01:00
Łukasz Magiera 20e92da062 Merge pull request #5505 from filecoin-project/fix/dont-publish-expired-deals
Dont publish expired deals
2021-02-02 18:20:23 +01:00
Łukasz Magiera 2b0022f1a7 Merge pull request #5493 from filecoin-project/fix/zero-price-retrieval
Fix zero price-per-byte retrieval
2021-02-02 16:45:22 +01:00
Dirk McCormick 3ced11c31f fix: dont include expired deals in batch publish message 2021-02-02 10:22:12 +01:00
Łukasz Magiera fc6938badb Merge pull request #5497 from filecoin-project/feat/gateway-metrics
export metrics for lotus-gateway
2021-02-01 23:48:33 +01:00
whyrusleeping ed6ccef5cf export metrics for lotus-gateway 2021-02-01 13:13:20 -08:00
Dirk McCormick a19d6ce8a3 fix: zero price-per-byte retrieval 2021-02-01 16:55:18 +01:00
Łukasz Magiera b7555fdc22 Merge pull request #5492 from filecoin-project/fix/ipfsbstore-has-hang
ipfsbstore: Fix has for non-existing blocks
2021-02-01 15:46:40 +01:00
Łukasz Magiera b2eb014900 gofmt 2021-02-01 14:22:32 +01:00
Łukasz Magiera d4da53dda8 ipfsbstore: Fix has for non-existing blocks 2021-02-01 14:17:23 +01:00
Dirk McCormick 987f41011a refactor: move publish msg config inside deals config 2021-02-01 10:23:05 +01:00
Anton EvangelatovandŁukasz Magiera 6c045b4c43 Update .circleci/config.yml
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-01-30 23:45:35 +01:00
Steven AllenandŁukasz Magiera feb24c9684 choose the correct nonce
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-01-30 10:18:51 -08:00
Steven Allen 4937fb925e Merge pull request #5476 from filecoin-project/fix/verifreg-migration
fix verified registry migration
2021-01-30 09:11:55 -08:00
Łukasz Magiera fed3e82ff8 Merge pull request #5047 from zgfzgf/feat-shed-bitfield
shed bitfield: Cleanup, add merge command
2021-01-30 12:54:39 +01:00
Łukasz Magiera b1dfd41c19 Merge pull request #4950 from zgfzgf/feat-bench-policy
delete bench policy
2021-01-30 12:34:40 +01:00
Łukasz Magiera 56a9d05491 Merge remote-tracking branch 'origin/master' into steb/refactor-consistent-tipset-methods 2021-01-30 12:05:21 +01:00
Łukasz Magiera 9053efd344 Merge pull request #5472 from filecoin-project/feat/pond-method-gen
Generate v3 methods for pond
2021-01-30 12:02:45 +01:00
Łukasz Magiera a541a2500a Merge pull request #5282 from filecoin-project/chore/snake_context_through_blockstore_init
Snake a context through the Chain-blockstore creation
2021-01-30 11:55:17 +01:00
Łukasz Magiera 7c7301f701 Merge pull request #5350 from GFZRZK/GFZRZK/optmize/avoid_race_in_mpool_cfg
avoid use mp.cfg directly to avoid race
2021-01-30 11:31:56 +01:00
Łukasz Magiera 5cfae0f1e8 Merge pull request #5449 from filecoin-project/chore/document_blockheader_fields
Better document the block-header fields
2021-01-30 11:26:56 +01:00
Łukasz Magiera d9e0d474d1 Merge pull request #5470 from filecoin-project/feat/no-timing-compute-state
state compute-state ---html --no-timing flag
2021-01-30 11:23:21 +01:00
Łukasz Magiera bb4e3e49ea Merge remote-tracking branch 'origin/master' into feat/no-timing-compute-state 2021-01-30 10:57:32 +01:00
Łukasz Magiera 3df25df3ab Merge pull request #5473 from filecoin-project/staging/1.5.x
1.5.x staging branch
2021-01-30 10:57:09 +01:00
Raúl Kripalani 35d1e3d1e0 refine docs. 2021-01-29 23:24:44 +00:00
Raúl Kripalani d1104fec4c rename blockstores for consistency. 2021-01-29 23:17:25 +00:00
Raúl Kripalani af429dba0f Merge branch 'master' into chore/snake_context_through_blockstore_init 2021-01-29 21:21:46 +00:00
Raúl Kripalani e02fdf5064 Merge branch 'master' into refactor/lib/blockstore 2021-01-29 21:21:31 +00:00
Anton Evangelatov 52a610650a merge master; resolve conflicts 2021-01-29 22:20:10 +01:00
Łukasz Magiera 7e692a5dc9 Merge pull request #5425 from filecoin-project/fix/lotus-soup-deps
fix stale imports in testplans/lotus-soup.
2021-01-29 22:16:02 +01:00
Anton Evangelatov 1cca0ff9e2 upgrade docker; upgrade filecoin-ffi; bump up image versions 2021-01-29 22:02:45 +01:00
Anton Evangelatov 8ed726f9e3 bump up go to 1.15 2021-01-29 21:19:27 +01:00
Raúl Kripalani b0cbc932bd consolidate all blockstores in blockstore package. 2021-01-29 20:01:00 +00:00
Anton Evangelatov c09571984a remove blst replace; update go.mod to use lotus@master 2021-01-29 19:53:34 +01:00
Steven Allen b4ad2e5e93 Merge pull request #5477 from filecoin-project/fix/fork-logging
Tune Migration
2021-01-28 20:12:13 -08:00
Steven Allen 53271729b6 tweak migration perf 2021-01-28 16:15:23 -08:00
Steven Allen 2f3c912ad9 improve upgrade logging 2021-01-28 16:15:23 -08:00
Steven Allen e9eecad2c5 fix verified registry migration 2021-01-28 16:14:38 -08:00
Jakub Sztandera 0a0fc47655 Make lint happy
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-01-28 19:58:28 +01:00
Jakub Sztandera 608793314f Fix url Values
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-01-28 19:58:12 +01:00
Jakub Sztandera ba94f271db Add spam protection to fountain
Uses reCAPTCHAv3, `RECAPTCHA_SITE_KEY` and `RECAPTCHA_SECRET_KEY` need to be
set in env.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-01-28 19:58:09 +01:00
Łukasz Magiera 4f128accc4 Merge remote-tracking branch 'origin/master' into lock-lotus-version-in-testplan 2021-01-28 19:50:05 +01:00
Łukasz Magiera 389e6eb70b state compute-state ---html --no-timing flag 2021-01-28 19:37:32 +01:00
Łukasz Magiera 94009f247f Merge pull request #5411 from filecoin-project/feat/sealing-handle-batch-publish
Handle batch publish storage deals message in sealing recovery
2021-01-28 19:33:49 +01:00
Łukasz Magiera 3634bdcfa5 Merge pull request #5220 from filecoin-project/feat/verifpower-sector-list
Show verified power in miner sector list
2021-01-28 19:09:19 +01:00
Aayush Rajasekaran 7e55c44d4e Merge pull request #5471 from filecoin-project/asr/calibnet-upgrade
Calibnet V3 epoch
2021-01-28 13:02:00 -05:00
Łukasz Magiera 33336ab919 Generate v3 methods for pond 2021-01-28 19:01:28 +01:00
Aayush Rajasekaran a9ea06dc1e Calibnet V3 epoch 2021-01-28 12:53:53 -05:00
Jakub Sztandera e2eb3e6e35 Merge pull request #5459 from filecoin-project/fix/specs-actor-migration
fix: update specs-actors to fix a bug in the migration logic
2021-01-28 16:41:46 +01:00
Steven Allen 997e7d18d9 fix: update specs-actors to fix a bug in the migration logic 2021-01-27 21:53:11 -08:00
Steven Allen 9a3c24df1e Merge pull request #5457 from filecoin-project/feat/fast-addr-resolution
feat: avoid computing the tip-set state when looking up addresses
2021-01-27 19:54:27 -08:00
Steven Allen a9a65e05d8 feat: avoid computing the tip-set state when looking up addresses 2021-01-27 17:54:42 -08:00
Aayush Rajasekaran b76fae37e0 Merge pull request #5456 from filecoin-project/asr/calibnet-upgrade
Calibnet V3 epoch
2021-01-27 19:25:08 -05:00
Aayush Rajasekaran 887d40bcbb Merge pull request #5434 from filecoin-project/feat/pre-migrate
Implement pre-migration framework
2021-01-27 19:24:26 -05:00
Steven Allen 4890d83acb test: assert that pre-migrations are actually run 2021-01-27 16:12:08 -08:00
Steven Allen 39d4f6780d pre-migration: refactor timing specification
There are now three times:

1. StartWithin: start within X epochs of the upgrade.
2. DontStartWithin: don't start within X epochs of the upgrade.
3. StopWithin: stop within X epochs of the upgrade.
2021-01-27 16:09:07 -08:00
Steven Allen bceb246080 set worker counts for pre-migrations 2021-01-27 15:47:51 -08:00
Steven AllenandAayush Rajasekaran cffeb1a590 fix doc comments
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2021-01-27 15:41:26 -08:00
Aayush Rajasekaran f8ef6a41cb Calibnet V3 epoch 2021-01-27 18:36:44 -05:00
Steven Allen 9574db6d0a log in migration 2021-01-27 15:05:00 -08:00
Łukasz Magiera eab50e061a Merge pull request #5453 from filecoin-project/feat/ffi-blst-portable
Update ffi with portable blst
2021-01-27 23:49:43 +01:00
Łukasz Magiera aebf3cd64c Update ffi with more portable blst 2021-01-27 22:36:51 +01:00
Steven Allen 9a03c003fe fix sorted test 2021-01-27 13:05:14 -08:00
Steven Allen 56054b0ad3 sort pre-migrations 2021-01-27 12:57:47 -08:00
Steven Allen 854385168d add additional pre-migration validations 2021-01-27 12:57:47 -08:00
Steven Allen 716f10e570 remove unnecessary wrapper store in tests
This was causing a lot of warnings about not implementing View.
2021-01-27 12:57:47 -08:00
Steven Allen 35d6a40071 cleanup pre-migration code a bit 2021-01-27 12:57:17 -08:00
Steven Allen 4072f24bf2 test pre-migrations 2021-01-27 12:57:17 -08:00
Steven Allen ed3e0869c3 register tipsets with the chainstore when testing 2021-01-27 12:57:17 -08:00
Steven Allen 05026a23b9 actually use the temp cache for pre-migrations 2021-01-27 12:57:17 -08:00
Steven Allen 32059d0cbf stmgr: only persist the migration cache on success
Otherwise, we may end up referencing blocks we never wrote to disk.
2021-01-27 12:56:47 -08:00
Steven Allen b08abc12ba fix error message 2021-01-27 12:55:56 -08:00
Steven Allen 6362887ce3 rename Upgrade to Migration where applicable
This was really confusing.
2021-01-27 12:55:56 -08:00
Steven Allen 77117a0be5 wait for pre-upgrades to exit on stop 2021-01-27 12:55:56 -08:00
Steven Allen f65d179f2c make pre-migrations async 2021-01-27 12:55:56 -08:00
Steven Allen 8d05c5d62c validate pre-migrations 2021-01-27 12:55:56 -08:00
Steven Allen 8986a2002d wire up re-migration logic for nv10 2021-01-27 12:55:56 -08:00
Steven Allen 8d3cc632ac add support for running pre-migrations and caching their results
This can significantly speedup state migrations.
2021-01-27 12:55:53 -08:00
Steven Allen d443836e25 Merge pull request #5450 from filecoin-project/chore/update-deps
update deps
2021-01-27 12:53:30 -08:00
Steven Allen 7905c3bbd8 update deps
Most changes are just tagging deps. However,

* Updates go-ipld-hamt to fix a bug in the new V3 HAMT.
* Updates bitfield to save ~10% for some operations.
2021-01-27 11:52:32 -08:00
Peter Rabbitson ac616eb340 Better document the block-header fields 2021-01-27 20:52:18 +01:00
Łukasz Magiera d4c7b63aac Add miner config to always keep ensealed deal copies 2021-01-26 17:50:31 +01:00
Raúl Kripalani a1da1dab85 add context to LockedRepo#Datastore(). 2021-01-26 11:01:43 +00:00
Raúl Kripalani dbbd1d7a45 fix stale imports in testplans/lotus-soup. 2021-01-26 10:53:27 +00:00
Aayush Rajasekaran d5addf7173 Merge pull request #5419 from filecoin-project/asr/calibnet-upgrade
Set calibration net's ActorsV3 upgrade epoch
2021-01-25 23:25:58 -05:00
Aayush Rajasekaran 613df60f4a Set calibrationnet's ActorsV3 upgrade epoch 2021-01-25 23:06:20 -05:00
Łukasz Magiera 77fa3d6ca7 Merge pull request #5418 from filecoin-project/next
v3 actors staging branch
2021-01-26 01:59:12 +01:00
Łukasz Magiera fabcbb621d Merge remote-tracking branch 'origin/master' into next 2021-01-26 00:47:22 +01:00
Łukasz Magiera 422f0991e9 Merge pull request #5379 from filecoin-project/asr/disputer
Build a WindowPoSt disputer
2021-01-26 00:46:26 +01:00
Aayush RajasekaranandŁukasz Magiera fd68551d83 Don't be off by 1000000000000000000x
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-01-25 17:58:19 -05:00
Aayush Rajasekaran 29d3d746a3 Build a WindowPoSt disputer 2021-01-25 17:26:09 -05:00
Łukasz Magiera cb187ac093 Merge pull request #5417 from filecoin-project/feat/unseal-full
storagemgr: Always unseal full sectors
2021-01-25 23:15:59 +01:00
Łukasz Magiera 67780346e2 storagemgr: Always unseal full sectors 2021-01-25 21:39:15 +01:00
Łukasz Magiera 260908015f Merge pull request #5393 from filecoin-project/feat-refactor-bls
refactor: switch to filecoin-ffi bls api for bls signatures
2021-01-25 20:56:18 +01:00
Raúl Kripalani ce3af308ed Merge branch 'master' into chore/snake_context_through_blockstore_init 2021-01-25 19:31:41 +00:00
Łukasz Magiera e4f4fa2c7d Update FFI more, fix zero aggregate sigs 2021-01-25 20:05:03 +01:00
Steven Allen 519b5e191e Merge pull request #5407 from filecoin-project/chore/block-miner-addr-check
explicitly check miner address protocol
2021-01-25 10:23:54 -08:00
Łukasz Magiera a2b91a5627 Merge pull request #5387 from filcloud/build-network
add calibnet and mainnet in version
2021-01-25 18:26:17 +01:00
Łukasz Magiera 9827ec3730 Merge pull request #5406 from filecoin-project/feat/test-window-post-dispute-fail
ensure we can't dispute a correct window post
2021-01-25 16:34:33 +01:00
Łukasz Magiera bd6321d2c0 Fix lint 2021-01-25 15:35:00 +01:00
Dirk McCormick adac340f3f feat: batch publish deal messages 2021-01-25 14:25:57 +01:00
Dirk McCormick 1b494acc9e feat: handle batch publish storage deals message in sealing recovery 2021-01-25 14:10:05 +01:00
Łukasz Magiera 6d368179e1 Fix lint 2021-01-25 14:02:58 +01:00
Łukasz Magiera 9b62e224d5 Use filecoin-ffi master 2021-01-25 13:57:15 +01:00
Łukasz Magiera f235beeaf7 Merge pull request #5410 from filecoin-project/asr/calibnetfix
Make Calibnet Build Again
2021-01-25 11:17:26 +01:00
Łukasz Magiera 19fb40a72c ci: Build calibnet binaries 2021-01-25 11:10:07 +01:00
Aayush Rajasekaran a816d22538 Make Calibnet Build Again 2021-01-25 03:43:36 -05:00
wangchao ff62b64b4d avoid use mp.cfg directly to avoid race 2021-01-25 10:13:31 +08:00
Steven Allen 7c9b9e3657 explicitly check miner address protocol
This is implicitly checked when verifying the miner signature, but
explicitly checking it here makes it clear that this is a protocol
requirement, and reduces the chances that it will be accidentally
"refactored out".
2021-01-22 18:04:07 -08:00
Steven Allen 0a294f146f ensure we can't dispute a correct window post 2021-01-22 14:30:54 -08:00
Steven Allen 8de4e5e005 retry proofs if we generate an incorrect one 2021-01-22 13:31:47 -08:00
Steven Allen 735d30af55 Merge pull request #5363 from filecoin-project/asr/specs-update
Integrate specs-actors v3
2021-01-22 13:20:57 -08:00
Steven Allen 0131b077be re-enable watchdog 2021-01-22 11:19:37 -08:00
Steven Allen 94089a6a15 remove todos 2021-01-22 11:15:43 -08:00
Jakub Sztandera d6c06881ee Merge pull request #5403 from filecoin-project/fix/estim-limit-rbf
fix(gas): when estimating GasLimit only apply priors up to the nonce
2021-01-22 19:43:05 +01:00
Steven Allen fdbb1d8f3b tweak cc upgrade epoch 2021-01-22 10:04:06 -08:00
Jakub Sztandera 8c7fda4441 fix(gas): when estimating GasLimit only apply priors up to the nonce
The bug is applying all messages from given From address are priors
before appling the message that we are estimating.

If user tries replacing message in the middle with gas limit estimation
then message sequence is off and user will either get an execution error
or gas mis-esimation.

Resolves #5402

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-01-22 18:50:02 +01:00
Steven Allen db2a45d07a fix test window post test name 2021-01-22 09:41:21 -08:00
Steven Allen 9e611d5f4d test evil post on recover 2021-01-22 09:34:15 -08:00
Steven Allen cc423ee4d2 fix seal types length 2021-01-22 08:30:58 -08:00
Steven Allen 9e63e5979e test that the dispute worked, then recover 2021-01-22 08:29:00 -08:00
Steven Allen aa53f5b7d7 fix ci config 2021-01-22 08:28:32 -08:00
Steven Allen 1b67eed82c make the dispute test run by itself
It's kind of slow.
2021-01-21 20:16:03 -08:00
Frank d0a1c5251c fix test 2021-01-22 12:07:07 +08:00
Steven Allen 0ba1306969 test prove then dispute 2021-01-21 19:48:34 -08:00
Frank 46b92be281 fix debug and 2k mix 2021-01-22 11:27:05 +08:00
Frank 61aae567bb add calibnet and mainnet in version 2021-01-22 11:27:05 +08:00
Steven Allen d412ccdb3f disable the watchdog
It's causing the tests to flake.
2021-01-21 18:28:37 -08:00
Steven Allen c27ec4ed22 latest specs actors master 2021-01-21 15:21:20 -08:00
Steven Allen bd00c505b2 fix upgrade epoch for termiante test 2021-01-21 15:21:20 -08:00
Steven Allen f10b13ff32 register v3 methods 2021-01-21 15:21:20 -08:00
Steven Allen 5a5e49dcd7 support paych v3 messages 2021-01-21 15:21:20 -08:00
Steven Allen c5d3b979cb fix constructing new actors 2021-01-21 15:21:20 -08:00
Steven Allen b00efcd701 further fix tests 2021-01-21 15:21:20 -08:00
Steven Allen 6ce5f2736e update policy for v3 2021-01-21 15:21:20 -08:00
Steven Allen a1e6781f0c fix tests 2021-01-21 15:21:20 -08:00
Steven Allen ab4f135208 test actors v3 2021-01-21 15:21:20 -08:00
Steven Allen 026d236252 more reliably close in tests 2021-01-21 15:21:20 -08:00
Steven Allen fe5b5702f9 fix data race in test 2021-01-21 15:21:20 -08:00
Steven Allen f1719d1e23 mark v3 as expensive 2021-01-21 15:21:20 -08:00
Steven Allen bf48728875 move winning post proof type logic into a helper 2021-01-21 15:21:20 -08:00
Steven Allen 03cd3760bb correctly pick the seal type based on the network version
Of course, we should really just run all of our tests post actors v2.
2021-01-21 15:21:20 -08:00
Steven Allen fb5f3c5703 update specs actors 2021-01-21 15:21:19 -08:00
Steven AllenandŁukasz Magiera 82eee15955 fix state tree version comment
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-01-21 15:21:19 -08:00
Steven Allen dffa514518 update specs-actors for h/amt interface refactor 2021-01-21 15:21:19 -08:00
Steven Allen 64e805926f update specs-actors for migration name change
Actors v3 is network version 10.
2021-01-21 15:21:19 -08:00
Aayush Rajasekaran aa9eef48f0 Use temp commit of actors 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran 95f68d0161 Register the v3 actor CIDs in the actor registry 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran c8bfbd4f28 Apply actors v3 upgrade in devnets 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran f6a0da3751 Add the migrationLogger struct 2021-01-21 15:21:19 -08:00
Steven Allen 99ea5b62ea wire up v3 migration 2021-01-21 15:21:19 -08:00
Steven Allen 126a5c1cf8 chore: fix nolint comment 2021-01-21 15:21:19 -08:00
Steven Allen 1f62c07789 add back logging 2021-01-21 15:21:19 -08:00
Steven Allen 1a790f5ee3 use actors state-tree abstraction
Well, not fully, but this is enough to ensure we use the correct bitwidth and such.
2021-01-21 15:21:19 -08:00
Steven Allen 9d2c430138 remove abstract map constructor/loader
Different maps have different parameters now so we just construct/load them manually where needed.
2021-01-21 15:21:19 -08:00
Steven Allen 8dc49db30d window <-> winning 2021-01-21 15:21:19 -08:00
Steven Allen c05df6dc1d fix: use the correct proof type in winning proofs 2021-01-21 15:21:19 -08:00
Steven Allen 4de56d5eac docsgen 2021-01-21 15:21:19 -08:00
Steven Allen 7882b0163b update actor "is" functions for v3 2021-01-21 15:21:19 -08:00
Steven Allen c31f5130e3 update imports to v3 2021-01-21 15:21:19 -08:00
Steven Allen 95c57d0ce3 and actually hook up loading logic 2021-01-21 15:21:19 -08:00
Steven Allen be1f15052c register remaining state decoders 2021-01-21 15:21:19 -08:00
Steven Allen 9ce63c1211 simplify v3 claims map access 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran 06f13f8e00 Add v3 actors support for verifreg 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran 76abbb8938 Add v3 actors support for reward 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran ee99e68614 Add v3 actors support for power 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran abb388512e Add v3 actors support for paych 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran 9d06a8b116 Add v3 actors support for multisig 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran 0bb3aed53c Add v3 actors support for miner 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran ab90a3b2bc Actors update: MinerInfo.SealProofType has been removed 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran 82635f2515 Rename Deadline.PoStSubmissions to PartitionsPoSted 2021-01-21 15:21:19 -08:00
Aayush Rajasekaran b4f479affd Add v3 actors support for market 2021-01-21 15:21:18 -08:00
Aayush Rajasekaran 378f169f14 Add v3 actors support for init 2021-01-21 15:21:18 -08:00
Aayush Rajasekaran 3961e3daf8 Add v3 actors support for account 2021-01-21 15:21:18 -08:00
Aayush Rajasekaran ba3b32cfe7 Pull in actors v3 2021-01-21 15:21:18 -08:00
Łukasz Magiera 1070ad2289 storagefsm: Drop unused TargetWaitDealsSectors 2021-01-21 22:20:16 +01:00
Łukasz Magiera 29b076ad69 Merge pull request #5394 from filecoin-project/nonsense/circleci-aws-ecr-integration
add job to build Lotus docker image and push it to AWS ECR private (or public) repo
2021-01-21 20:10:34 +01:00
Łukasz Magiera ec4deb7e28 storagefsm: Fix unlocking in handleWaitDeals 2021-01-21 19:59:18 +01:00
Łukasz Magiera 1336d8855d storagefsm: Drop addpiece wait after fixing storageadapter 2021-01-21 17:40:50 +01:00
Łukasz Magiera df14f156e1 storagefsm: More logging for deal test debugging 2021-01-21 17:40:50 +01:00
Łukasz Magiera b9a9f23204 storagefsm: Add stub AddPieceFailed state 2021-01-21 17:40:50 +01:00
Łukasz Magiera f96f12c836 storagefsm: Add rest of checks in WaitDeals 2021-01-21 17:40:50 +01:00
Łukasz Magiera 069766ecc4 storagefsm: Don't persist piece assignment queue 2021-01-21 17:40:50 +01:00
Łukasz Magiera 270f2935a9 storagefsm: Check per-sector deal limits 2021-01-21 17:40:50 +01:00
Łukasz Magiera fd67a41c75 storagefsm: Change sector CreationTime to unix ts 2021-01-21 17:40:50 +01:00
Łukasz Magiera 9857ad8378 storagefsm: Fix some deadlock cases 2021-01-21 17:40:50 +01:00
Łukasz Magiera e5814dac4f cbor-gen 2021-01-21 17:40:50 +01:00
Łukasz Magiera 542357a1df storagefsm: Start packing correctly 2021-01-21 17:40:50 +01:00
Łukasz Magiera 239d6f8f4d storagefsm: Rewrite input handling 2021-01-21 17:40:50 +01:00
Łukasz Magiera e77df95157 Merge pull request #5398 from filecoin-project/fix/market-precommit-diff
storageadapter: Look at precommits on-chain since deal publish msg
2021-01-21 16:41:23 +01:00
Łukasz Magiera 143164fb70 Merge pull request #5399 from filecoin-project/fix/watchdog-heapprof
watchdog: increase heapprof capture threshold to 90%.
2021-01-21 15:46:19 +01:00
Łukasz Magiera ea85a2457e storageadapter: Address review 2021-01-21 15:44:27 +01:00
Raúl Kripalani b9adf95010 watchdog: increase heapprof capture threshold to 90%. 2021-01-21 14:06:18 +00:00
Łukasz Magiera de0a452282 storageadapter: Fix tests, more testable diff api 2021-01-21 12:21:26 +01:00
Łukasz Magiera 42b481fb61 storageadapter: Look at precommits on-chain since deal publish msg 2021-01-21 11:54:32 +01:00
Łukasz Magiera e5efe57c90 Merge pull request #5397 from filecoin-project/fix/sync-manager-test-flake
fix a flake in the sync manager edge case test
2021-01-21 10:18:27 +01:00
Aayush Rajasekaran 23ce0645ed Merge pull request #5342 from filecoin-project/asr/change-owner
Allow multisigs to be set as miner owner address
2021-01-20 21:30:37 -05:00
Steven Allen 4cdb7ba1d3 fix a flake in the sync manager edge case test
Depending on scheduling, we may see c2 before we see c1.
2021-01-20 16:08:29 -08:00
Łukasz Magiera fb27969d14 Merge pull request #5396 from filecoin-project/feat/watchdog-v1
upgrade to raulk/go-watchdog@v1.0.1
2021-01-20 20:54:55 +01:00
Anton Evangelatov 790bcc7830 change name of image to lotus-dev 2021-01-20 20:04:15 +01:00
Anton Evangelatov 24cc70f18e use ecr-public cmd 2021-01-20 20:00:16 +01:00
Anton Evangelatov e3262da915 remove circleci/aws-ecr orb and push built image to public registry 2021-01-20 19:59:47 +01:00
Anton Evangelatov a9c0263db6 fixup 2021-01-20 19:25:51 +01:00
Anton Evangelatov 5d89d6d3e7 example config.yml for public ECR registry 2021-01-20 19:10:49 +01:00
Raúl Kripalani 931cfe1ed1 upgrade to raulk/go-watchdog@v1.0.1
This pulls in the improvements introduced in:
  - https://github.com/raulk/go-watchdog/releases/tag/v1.0.0
  - https://github.com/raulk/go-watchdog/releases/tag/v1.0.1

Lotus tries to initialize the watchdog in the following order of precedence:
  1. If a max heap limit has been provided, initialize a heap-driven watchdog.
  2. Else, try to initialize a cgroup-driven watchdog.
  3. Else, try to initialize a system-driven watchdog.
  4. Else, log a warning that the system is flying solo, and return.

This PR also enabled automatic heap profile capture when memory usage
surpasses 90% of the limit. Profiles are written to <LOTUS_HOME>/heapprof.
A single heap profile is captured per episode, with a max of 10 episodes
captured during the lifetime of the process. Episode = instance of usage
climbing above the 90% threshold.
2021-01-20 18:09:19 +00:00
Anton Evangelatov 1a582230cb wip 2021-01-20 18:14:40 +01:00
Anton Evangelatov 0ca29acf22 add job to build docker image and push to AWS ECR private repo 2021-01-20 16:27:19 +01:00
dignifiedquire 3d9eb226fa refactor: switch to filecoin-ffi bls api for bls signatures 2021-01-20 16:19:07 +01:00
dignifiedquire 187a499cca remove extern/blst 2021-01-20 16:19:07 +01:00
Łukasz Magiera fb92e1d764 Merge pull request #5380 from filecoin-project/refactor/deals-api-test
refactor deals API tests
2021-01-20 13:39:35 +01:00
Łukasz Magiera 7a042ab21f Merge pull request #5210 from filecoin-project/feat/mkts-miner-dont-dial-client
Miner should not dial client on restart
2021-01-20 13:37:09 +01:00
Łukasz Magiera 46fb39c755 Merge pull request #5389 from filcloud/list-verified
add verified indicator for storage-deals list
2021-01-20 12:45:59 +01:00
Dirk McCormick 1206154718 feat: update to go-fil-markets v1.1.0 for better retry config 2021-01-20 10:00:02 +01:00
Aayush Rajasekaran ebaa721e44 Merge pull request #5390 from filecoin-project/asr/changelog
Lotus version 1.4.1
2021-01-20 03:47:42 -05:00
Aayush Rajasekaran 685a0fdc9c Lotus version 1.4.1 2021-01-20 03:46:05 -05:00
Frank e0209c74ad add verified indicator for storage-deals list 2021-01-20 15:14:51 +08:00
Łukasz Magiera 48c6c55f68 Merge pull request #5384 from filecoin-project/fix-storage-size-estimation
fix FileSize to return correct disk usage recursively
2021-01-19 19:22:47 +01:00
Łukasz Magiera 0a85dc6232 Merge pull request #5369 from filecoin-project/feat/gas-premium-55
Use 55th percentile instead of median for gas-price
2021-01-19 19:10:47 +01:00
Łukasz Magiera 560a127ce6 fsutil: Defensive check for Stat cast 2021-01-19 18:53:37 +01:00
Anton Evangelatov 834a6148b0 use stat.Blocks and not info.Size 2021-01-19 18:07:37 +01:00
Anton Evangelatov 16d07d3f18 fix FileSize to return correct disk usage recursively 2021-01-19 15:21:31 +01:00
Łukasz Magiera 0579aecac4 Merge pull request #5359 from yaohcn/jk
correct log in maybeUseAddress
2021-01-19 11:48:40 +01:00
Łukasz Magiera 388c53e637 Merge pull request #5352 from filcloud/color-amount
add color for token amount
2021-01-19 11:47:22 +01:00
Łukasz Magiera db45a848f5 Merge pull request #5382 from filecoin-project/refactor/state-search-msg-gateway
expose StateSearchMessage on gateway
2021-01-19 11:44:42 +01:00
Łukasz Magiera 6bccdcc177 Merge pull request #5378 from zgfzgf/feat-chain-consensus
add slash-consensus from flag
2021-01-19 11:39:45 +01:00
Łukasz Magiera 901079e880 Merge pull request #5366 from filecoin-project/fix/fsm-commfail-tkt
storagefsm: Send correct event on ErrExpiredTicket in CommitFailed
2021-01-19 11:39:16 +01:00
Dirk McCormick 827a473391 feat: expose StateSearchMessage on gateway 2021-01-19 11:27:43 +01:00
Dirk McCormick ab1a52c632 refactor: deals API tests 2021-01-19 11:07:28 +01:00
zgfzgf 29bdd94b12 add slash-consensus from flag 2021-01-19 14:18:46 +08:00
Jack YaoandJakub Sztandera 41e9345da0 Update storage/addresses.go
Co-authored-by: Jakub Sztandera <kubuxu@protonmail.ch>
2021-01-19 09:36:35 +08:00
Łukasz Magiera 2b3d66da3b Merge pull request #5362 from filecoin-project/feat/fullnode-restore
Implement full-node restore option
2021-01-18 23:42:20 +01:00
Lucas Molas 69eb2163d2 fix(sync): enforce fork len when changing head (#5244) 2021-01-18 12:34:25 -03:00
Jakub Sztandera eeadfedbe6 Use 55th percentile instead of median for gas-price
The aim is to put some negative pressure on gas-premium instead of
maintining status quo.

55th percentile instead of median should not make much difference for
block inclusion timing.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-01-18 15:44:20 +01:00
Łukasz Magiera 0eaa6d9983 storagefsm: Send correct event on ErrExpiredTicket in CommitFailed 2021-01-17 22:29:07 +01:00
Łukasz Magiera 38f9559080 Implement full-node restore option 2021-01-15 20:57:32 +01:00
yaohcn 10b2ec55b5 correct log in maybeUseAddress 2021-01-15 12:31:47 +08:00
Frank 7747bcd859 remove some colorTokenAmount 2021-01-15 11:48:07 +08:00
Łukasz Magiera 476df99179 Merge pull request #5341 from filecoin-project/feat/sectors-terminate
Sector termination support
2021-01-14 22:00:18 +01:00
Łukasz Magiera 80b8d4b9d7 Address review 2021-01-14 20:27:15 +01:00
Łukasz Magiera 1e53ed6a82 Print proving window info in pending termination list 2021-01-14 17:27:28 +01:00
Łukasz Magiera 32885e1129 termination batcher: Notify based on what was sent 2021-01-14 17:14:26 +01:00
Łukasz Magiera 9632a3836a Print msg cid in terminate flush 2021-01-14 16:47:30 +01:00
Dirk McCormick 835fd4b23c feat: markets - miner should not dial client on restart 2021-01-14 16:38:56 +01:00
Łukasz Magiera 4a114150f0 fix miner terminate cli arg checks 2021-01-14 16:14:24 +01:00
Łukasz Magiera 4015ddbb4f fsm: Fix panic in precommit check in handleTerminating 2021-01-14 16:13:32 +01:00
Łukasz Magiera 49abdd7d7d Sector termination support - address review 2021-01-14 15:46:57 +01:00
raulk 5453e70cab Merge pull request #5355 from iand/iand/export-vm-shouldburn
chore: export vm.ShouldBurn
2021-01-14 13:28:37 +00:00
Łukasz Magiera 18d38ca42f docsgen 2021-01-14 12:52:08 +01:00
Łukasz Magiera 7ddf1d1feb Add terminating states to state lists 2021-01-14 12:44:27 +01:00
Łukasz Magiera f01f1d377b Test pending terminations 2021-01-14 12:41:27 +01:00
Łukasz Magiera 785b660724 perning termination CLI 2021-01-14 12:37:31 +01:00
Łukasz Magiera 144b5a1350 perning termination API 2021-01-14 12:37:23 +01:00
Ian Davis 7d2adc383f chore: export vm.ShouldBurn 2021-01-14 11:29:57 +00:00
Frank 3224c84fb1 add color for token amount 2021-01-14 16:39:39 +08:00
Łukasz Magiera 1cfb73cc3b ci: Run sector termination tests 2021-01-14 00:14:43 +01:00
Łukasz Magiera 1564db1fce Sector termination test 2021-01-14 00:11:41 +01:00
Łukasz Magiera 3522c8d45a SectorTerminateFlush API 2021-01-13 23:32:04 +01:00
Łukasz Magiera db977a2f91 docsgen 2021-01-13 22:19:42 +01:00
Łukasz Magiera 174c595acc Don't declare in proving window 2021-01-13 22:19:10 +01:00
Łukasz Magiera c3d94f8aa9 Merge pull request #5347 from filecoin-project/cov/excl-shed
Add misc tooling to codecov ignore list
2021-01-13 20:09:53 +01:00
Jakub Sztandera 20c715d507 Add misc tooling to codecov ignore list
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-01-13 17:07:27 +01:00
Aayush Rajasekaran b6bcd978e7 Fix lotus msig approve 2021-01-13 03:21:50 -05:00
Aayush Rajasekaran b33bf16f70 Add a command to encode JSON params 2021-01-13 02:40:06 -05:00
Aayush Rajasekaran 02f33e2b8e Simplify the miner actor set owner command 2021-01-13 01:34:14 -05:00
Łukasz Magiera 52cc2cd3eb Initial sector termination support 2021-01-13 00:42:01 +01:00
Łukasz Magiera 96cb321eb5 Merge pull request #5331 from filecoin-project/raulk-patch-1
README: refine Contribute section.
2021-01-12 23:35:46 +01:00
Aayush Rajasekaran fc59294154 Merge pull request #5325 from filecoin-project/asr/calibnet-upgrade
Calibnet: Set Orange epoch
2021-01-12 14:14:15 -05:00
Peter Rabbitsonandraulk 47141042b6 Add comment
Co-authored-by: raulk <raul@protocol.ai>
2021-01-12 18:11:18 +01:00
raulk 951fc4e89d README: refine Contribute section.
This adds a bit more colour to prerequiste 3 to disambiguate the "subjective perferences" term.
2021-01-12 16:59:48 +00:00
Łukasz Magiera efd86876b4 Merge pull request #5329 from filecoin-project/deps/update-pubsub
update go-libp2p-pubsub to v0.4.1
2021-01-12 17:58:33 +01:00
Łukasz Magiera bef53fa263 Merge pull request #5330 from filecoin-project/readme-contribute
README: Contribute section
2021-01-12 17:49:34 +01:00
raulk 457ecad302 README.md: refine Contribute section. 2021-01-12 16:04:43 +00:00
raulk 64ebcb1b31 README.md: refine Contribute section. 2021-01-12 16:01:30 +00:00
raulk 1a61c028bc README: Contribute section. 2021-01-12 15:53:22 +00:00
vyzo 62e76bbcab update go-libp2p-pubsub to v0.4.1 2021-01-12 17:24:15 +02:00
Łukasz Magiera b0bb36909b Merge pull request #4192 from filecoin-project/schomatis/sync/remove-self-bypass
fix(sync): remove checks bypass when we submit the block
2021-01-12 14:52:50 +01:00
Łukasz Magiera 56277756a6 Merge pull request #5320 from filecoin-project/feat/multicore-addpiece
Multicore AddPiece CommP
2021-01-12 10:25:55 +01:00
Aayush Rajasekaran 50d1fae85f Calibnet: Set Orange epoch 2021-01-12 02:58:58 -05:00
Łukasz Magiera 5462ecf6da gofmt 2021-01-11 16:44:11 +01:00
Łukasz Magiera 9e74c3c4e8 Multicore AddPiece CommP 2021-01-11 16:44:11 +01:00
Łukasz Magiera 7d0296c409 Merge pull request #5319 from filecoin-project/fix/fsm-startup-race
storagefsm: Fix unsealedInfoMap.lk init race
2021-01-11 16:43:01 +01:00
Łukasz Magiera 3ce296489b Merge pull request #5252 from filcloud/send-fund-check
add fund sufficient check in send
2021-01-11 16:42:38 +01:00
Łukasz Magiera 9a0e552131 Merge pull request #5277 from filcloud/update-newest-version
update NewestNetworkVersion
2021-01-11 16:13:23 +01:00
Łukasz Magiera 994934a42b Merge pull request #5315 from filcloud/fix-fil-short
enable parse and shorten negative FIL values
2021-01-11 16:05:45 +01:00
Łukasz Magiera 6328f9c879 Merge pull request #4577 from zgfzgf/fix-chain-consensusfault
delete slash-consensus miner
2021-01-11 15:53:42 +01:00
Łukasz Magiera 3fb605a743 Merge pull request #5312 from filecoin-project/fix/client-balances-args
Fix client flag parsing in client balances cli
2021-01-11 15:46:16 +01:00
Łukasz Magiera 299e72458e storagefsm: Fix unsealedInfoMap.lk init race 2021-01-10 14:01:29 +01:00
He Weidong ab9b3b6851 enable parse and shorten negative FIL values 2021-01-09 17:48:36 +08:00
Frank 93c21a6d2d make docsgen 2021-01-09 14:53:14 +08:00
Łukasz Magiera c5a2cac06a Fix client flag parsing in client balances cli 2021-01-08 23:03:52 +01:00
Łukasz Magiera 32dcfb4842 Merge pull request #5303 from filecoin-project/feat/wallet-market-info
Better CLI for wallet market withdraw and client info
2021-01-08 22:54:12 +01:00
Łukasz Magiera afb9e5f672 Merge pull request #5275 from xgswust/lotout-state-call
lotus state call will panic
2021-01-08 21:40:11 +01:00
Łukasz Magiera 108afe08fb Merge pull request #5300 from filecoin-project/feat/wallet-market-add
feat: lotus wallet market add (adds funds to storage market actor)
2021-01-08 21:30:58 +01:00
Łukasz Magiera c6440677aa Merge pull request #5304 from filecoin-project/feat/cli-rename-client-info
cli - rename `client info` to `client balances`
2021-01-08 20:57:02 +01:00
Aayush Rajasekaran 92fb48d951 Merge pull request #5301 from filecoin-project/asr/devnet-fix
Skip bootstrapping if no peers specified
2021-01-08 14:13:47 -05:00
Dirk McCormick c58086ee27 feat: better CLI for wallet market withdraw and client info 2021-01-07 10:18:29 +01:00
Dirk McCormick 6da09235dc feat: cli - rename client info to client balances 2021-01-07 09:53:46 +01:00
Frank 9584c72026 if force specified will not check insufficient fund 2021-01-07 11:30:53 +08:00
FrankandŁukasz Magiera fef5d65c0f Update FIL format
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2021-01-07 11:22:23 +08:00
Aayush Rajasekaran 835b84b12a Skip bootstrapping if no peers specified 2021-01-06 16:03:29 -05:00
Łukasz Magiera 858994a630 Merge pull request #5297 from filecoin-project/fix/badger-test-race
Fix race in blockstore test suite
2021-01-06 20:26:05 +01:00
Łukasz Magiera 72871597cd Merge pull request #5293 from filecoin-project/fix/fund-mgr-nice-err
Better error message when withdrawing funds
2021-01-06 20:23:50 +01:00
Łukasz Magiera 8ac71f6d0a Merge pull request #5222 from filcloud/bench-env
add bench env print
2021-01-06 20:17:42 +01:00
Łukasz Magiera cbbe01eeb5 Merge pull request #5223 from filcloud/noise-limit
add limit and rate for chain noise
2021-01-06 20:17:29 +01:00
Łukasz Magiera cf299b39b0 Merge pull request #5259 from filcloud/verbose-transfer
add verbose for list transfers
2021-01-06 17:24:13 +01:00
Dirk McCormick c6820ec059 feat: lotus wallet market add (adds funds to storage market actor) 2021-01-06 14:32:46 +01:00
Dirk McCormick e8e4b559e9 fix: format fund manager message fil amounts 2021-01-06 09:23:54 +01:00
Frank fdc46ad5df update json format 2021-01-06 12:20:33 +08:00
Frank dbe580de10 update realdoit to force 2021-01-06 11:37:29 +08:00
Frank 25f3384939 go fmt 2021-01-06 11:30:51 +08:00
Łukasz Magiera a15080b563 Merge pull request #5254 from turuslan/fix/chainxchg-buffered
Chainxchg write response timeout
2021-01-05 20:40:05 +01:00
Jakub Sztandera cfcfd5d8fa Fix race in blockstore test suite
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-01-05 20:34:28 +01:00
Łukasz Magiera ab529f4641 Merge pull request #5288 from filecoin-project/asr/unify-networks
Create a calibnet build option
2021-01-05 20:15:13 +01:00
Łukasz Magiera 9b70fdbe9d Merge pull request #5289 from filecoin-project/asr/remove-env-var
Remove LOTUS_DISABLE_V2_ACTOR_MIGRATION envvar
2021-01-05 20:10:26 +01:00
Łukasz Magiera dba2df80da Merge pull request #5255 from filcloud/correct-replace-flags
correct flag usages for replace cmd
2021-01-05 19:38:09 +01:00
Łukasz Magiera 2c9f4ad5ad Merge pull request #5251 from liismn/master
Fix deadlock in runWorker in sched_worker.go
2021-01-05 19:35:49 +01:00
Łukasz Magiera 4f9fcd2b01 Merge pull request #5258 from filecoin-project/raulk/tvx-batch-tipset-diff
tvx extract: more tipset extraction goodness.
2021-01-05 18:57:21 +01:00
Łukasz Magiera f806822440 Merge pull request #5217 from shaodan/skip-check-terminated
Skip checking terminated sectors provable
2021-01-05 18:39:29 +01:00
Łukasz Magiera 44a56c7e33 Merge pull request #5208 from jsign/jsign/imprreadpiece
sector-storage/mock: improve mocked readpiece
2021-01-05 18:37:48 +01:00
Łukasz Magiera 61b7b86af5 Merge pull request #5242 from luqz/patch-1
update  weight canSeal and canStore when attach
2021-01-05 18:35:18 +01:00
Dirk McCormick 3287c621ad fix: better withdrawal error message 2021-01-05 16:58:12 +01:00
Aayush Rajasekaran 11d1e3cd5f Remove LOTUS_DISABLE_V2_ACTOR_MIGRATION envvar 2021-01-05 00:46:57 -05:00
Aayush Rajasekaran 1bd2ae034f Create a calibnet build option 2021-01-05 00:32:15 -05:00
Peter Rabbitson 446a24ef3f Fix forgotten test-call 2021-01-04 15:46:09 +01:00
Peter Rabbitson 9334e73396 Snake a context through the Chain-blockstore creation 2021-01-04 15:27:52 +01:00
Frank 4afef16ee6 update NewestNetworkVersion 2020-12-31 18:43:14 +08:00
eben.xie 72c1fa81db when use lotus state call method, in lotus/cli/state.go 1620 line, the paramObj needs struct type not a ptr type,
if use a ptr type, the program will panic in line 1621(paramObj.NumField())
2020-12-31 11:41:51 +08:00
Frank 7e0a2ca46e use deal duration from actor 2020-12-30 16:02:53 +08:00
15ho 5b235db366 fix: stores.FetchHandler: defer close file and increase buffer size 2020-12-29 10:07:28 +08:00
Frank 7583c4399a add verbose for list transfers 2020-12-28 16:36:19 +08:00
Frank a7a6f24ceb add value for all method 2020-12-28 11:08:19 +08:00
Raúl Kripalani cd032d5418 tvx extract: more tipset extraction goodness.
- ability to extract a tipset range into individual vectors.
- ability to extract a tipset range and squash into a single multi-tipset vector.
- mark statediff output deterministically, so it can be extracted by tooling.
- ability to execute callbacks between tipsets in the driver.
- implement save-balances callback.
2020-12-27 18:58:35 +00:00
He Weidong 8613454d1d correct flag usages for replace cmd 2020-12-27 23:46:03 +08:00
Ruslan Tushov f9aca39caf Buffered stream for chainxchg response 2020-12-25 16:03:46 +03:00
Frank 6b9daa4d14 update return error 2020-12-25 16:32:21 +08:00
Frank df973da748 add fund sufficient check in send 2020-12-25 16:25:46 +08:00
liismn e9cc697ee8 Update sched_worker.go
Avoid possible deadlock by sh.workersLk
2020-12-25 15:05:01 +08:00
Deep Kapur bb5a92e2f4 Update SECURITY.md (#5246)
Based on feedback from @zgfzgf and a few others - recommending that we make this change to offer more clarity on what is meant by security issues (which are not always "Critical" in severity).
2020-12-23 00:48:25 -03:00
Lucas Molas 461a3cdebc fix(sync): enforce ForkLengthThreshold for synced chain (#5182) 2020-12-22 12:29:36 -03:00
quanzhan lu d806fafee8 update weight canSeal and canStore when attach
update  weight canSeal and canStore when attach storage
2020-12-22 19:07:17 +08:00
Łukasz Magiera e9989d0e46 Merge pull request #5230 from filecoin-project/release/v1.4.0
Lotus version 1.4.0
2020-12-19 22:19:55 +01:00
Aayush Rajasekaran c01d9f05df Lotus version 1.4.0 2020-12-19 16:18:32 -05:00
Łukasz Magiera bdd6cea13f Merge pull request #5228 from filecoin-project/fix/orange-upgrade
V9 Upgrade
2020-12-19 22:17:05 +01:00
Jakub Sztandera e777b879a1 Add the missing file
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-12-19 22:10:45 +01:00
Jakub Sztandera c7e3e9fa7f Add IsNearUpgrade
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-12-19 21:51:07 +01:00
Jakub Sztandera 420888aeae Add UpgradeOrange to params_2k and params_testground
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-12-19 21:35:14 +01:00
Łukasz Magiera 594737ff6c Upgrade specs-actors 2020-12-19 21:34:57 +01:00
Łukasz Magiera c1aafb7b71 Add missing v9 to chain/actors/version 2020-12-19 21:29:12 +01:00
Jakub Sztandera a3b325db5d Disable consensus faults during upgrade orange
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-12-19 21:00:12 +01:00
Łukasz Magiera 24dd6e01d7 disable SF for finality epochs 2020-12-19 20:53:08 +01:00
Łukasz Magiera 22884f18f1 define v9 upgrade 2020-12-19 20:44:21 +01:00
Frank 984e4e9963 add limit and rate for chain noise 2020-12-18 19:35:11 +08:00
Frank f24d401b61 add bench env print 2020-12-18 17:57:32 +08:00
Łukasz Magiera 9892c60ed0 Show verified power in miner sector list 2020-12-17 17:17:07 +01:00
Łukasz Magiera 19d457ae5b Merge pull request #5216 from filecoin-project/fix/fix-dealexp-panic
markets: Fix deal expired panic
2020-12-17 16:44:32 +01:00
Anton Evangelatov 655277171b baseline 1 miner 1 cluster composition for local:docker 2020-12-17 16:19:41 +01:00
Dan Shao fda3b152bd Skip checking terminated sectors provable 2020-12-17 20:05:43 +08:00
Łukasz Magiera b8bba15ed2 markets: Fix deal expired panic 2020-12-17 12:01:51 +01:00
Łukasz Magiera c11803ad55 Merge pull request #5180 from zzx234234/fix-truncating-sector-log
fix a coding error in truncating sector log, issue #4746
2020-12-17 11:05:44 +01:00
Łukasz Magiera 5324440f7d Merge pull request #5202 from filecoin-project/release/v1.3.0
Lotus version 1.3.0
2020-12-16 20:20:55 +01:00
Ignacio Hagopian f6cf27c781 improve mocked readpiece
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2020-12-16 10:15:38 -03:00
Aayush Rajasekaran d04c01939d Lotus version 1.3.0 2020-12-16 00:34:34 -05:00
Aayush Rajasekaran f2aea11971 Merge pull request #5200 from filecoin-project/release/v1.3.0
Disable gas burning for window post messages
2020-12-16 00:23:50 -05:00
Steven Allen 1f754bdb78 disable gas burning for window post messages
While over-estimation fees and miner tips are still paid, gas is no longer burnt
for direct, successful window PoSt messages.

Usually, gas is burnt to prevent an attacker from spamming the network and to
allow clients to "price" messages (using the base fee cap) based on how urgently
they need them to be processed. However:

1. Window PoSt is already a "proof of work".
2. Miners need to submit WindowedPoSts on-time so all window post messages are urgent.
3. Work is already under way to move window post verification off-chain (making
it effectively free). This change simply introduces the "free" part a bit earlier.
2020-12-16 00:10:25 -05:00
Łukasz Magiera 46e5cc9317 Merge pull request #5197 from filecoin-project/fix/lock-propose
fix lock propose
2020-12-15 23:34:02 +01:00
whyrusleeping 6c6711e638 fix lock propose 2020-12-15 13:27:22 -08:00
Łukasz Magiera 3d52c087cc Merge pull request #5195 from filecoin-project/feat/v1.2.3-prep
v1.2.3 changelog, version bump
2020-12-15 20:06:39 +01:00
Łukasz Magiera 0d72d742b4 Merge pull request #5194 from filecoin-project/raulk/tvx-extract-tipset
tvx command to extract tipset vectors.
2020-12-15 19:53:10 +01:00
Łukasz Magiera 884e20f637 Merge pull request #5196 from filecoin-project/feat/shed-block-pubsub-id
lotus-shed blockmsgid command
2020-12-15 19:36:02 +01:00
vyzo 210216a94f lotus-shed blockmsgid command 2020-12-15 20:20:16 +02:00
Raúl Kripalani 2af1283c65 tvx exec: flag to fallback to API blockstore. 2020-12-15 17:44:56 +00:00
Łukasz Magiera d2b7e7b2ab v1.2.3 changelog, version bump 2020-12-15 18:39:50 +01:00
Raúl Kripalani 3fa51f08e1 fix lint error; stamp metadata on vector. 2020-12-15 17:08:49 +00:00
Raúl Kripalani 446b1cc883 tvx command to extract tipset vectors. 2020-12-15 16:56:01 +00:00
Łukasz Magiera 3c7f5f7629 Merge pull request #5189 from filecoin-project/fix/on-commit-ignore-failed-msgs
When waiting for deal commit messages, ignore unsuccessful messages
2020-12-14 12:57:27 +01:00
Dirk McCormick dc8ff27b36 fix: when waiting for deal commit messages, ignore unsuccessful messages 2020-12-14 12:30:52 +01:00
Frank 3be84787d4 easy way to make install app 2020-12-11 20:10:40 +08:00
Anton Evangelatov 4d69947eed resolve conflicts with master 2020-12-11 10:01:14 +01:00
zzx234234 7db5e8061d fix a coding error in truncating sector log 2020-12-11 11:31:36 +08:00
Łukasz Magiera 65b921c62c Merge pull request #5177 from filecoin-project/acautman-iosize
stores: Bigger copy buffer size
2020-12-10 22:28:47 +01:00
Łukasz Magiera c61f341b22 Merge pull request #5178 from filecoin-project/asr/ask-min-piece
Print MinPieceSize when querying ask
2020-12-10 22:27:48 +01:00
Aayush Rajasekaran e33f873df8 Print MinPieceSize when querying ask 2020-12-10 15:38:18 -05:00
Łukasz Magiera 46a5013dc1 stores: Simplify remote copy buf size logic 2020-12-10 20:54:42 +01:00
Łukasz Magiera 53a6c4eac6 Merge branch 'iosize' of github.com:acautman/lotus into acautman-iosize 2020-12-10 20:48:04 +01:00
Łukasz Magiera 2e154ef6d0 Merge pull request #5176 from filecoin-project/shaodan-miner-sectors-info
Shaodan miner sectors info
2020-12-10 20:09:15 +01:00
Łukasz Magiera 47346907dd docsgen: Add []abi.SectorNumber example 2020-12-10 20:00:48 +01:00
Łukasz Magiera 0cb2f51549 Merge pull request #5094 from filecoin-project/asr/verified-only
Allow miners to filter (un)verified deals
2020-12-10 19:48:22 +01:00
Łukasz Magiera 564b88af52 docsgen, lint 2020-12-10 19:36:02 +01:00
Łukasz Magiera d347e7ab8f Merge branch 'miner-sectors-info' of github.com:shaodan/lotus into shaodan-miner-sectors-info 2020-12-10 19:32:26 +01:00
Łukasz Magiera 46c7f047d4 Merge pull request #5166 from liyue201/patch-1
fix curSealing out of MaxSealingSectors limit
2020-12-10 19:18:30 +01:00
Łukasz Magiera 58729b7fd6 Merge pull request #5169 from filcloud/5141-mpoolpending
add mpoolpending from to filter
2020-12-10 17:31:48 +01:00
Łukasz Magiera 4767773d1b Merge pull request #5171 from filecoin-project/raulk/block-delay-metric
add metrics for delayed blocks.
2020-12-10 17:12:12 +01:00
Łukasz Magiera c9b489437d Merge pull request #5173 from filecoin-project/fix/mpool-push-untrusted
fix PushUntrusted publishing -- the message is local
2020-12-10 17:08:03 +01:00
vyzo e07059e73d fix PushUntrusted publishing -- the message is local 2020-12-10 17:26:41 +02:00
Raúl Kripalani 0570306bb6 add metrics for delayed blocks. 2020-12-10 14:52:05 +00:00
Frank 0f08da3272 add mpoolpending from to filter 2020-12-10 17:21:32 +08:00
caoao d4582fb32e write size according to RegisteredSealProof 2020-12-10 11:59:09 +08:00
stirlingx 3c50baaf5b fix curSealing out of MaxSealingSectors limit 2020-12-10 11:04:42 +08:00
Steven Allen b78b9a441b update docs 2020-12-09 11:29:41 -08:00
Steven Allen a47b063a24 Fix duplicate nonce test
StateGetActor now gets the actor at the tipset parent state.
2020-12-09 11:29:41 -08:00
Steven Allen e164dbb953 Compute the next nonce from the tipset, instead of actually executing the tipset
We could also do this in the message pool itself, but I'm not sure if it's worth it?
2020-12-09 11:29:41 -08:00
Steven Allen b8e3808c4f Make state tipset usage consistent in the API
_Always_ (almost) use the tipset's parent state, instead of computing.

Exceptions:

* MinerGetBaseInfo. Fixing this would break things so we need to be
careful (although we could bump the API version, fix it, then fix the call
sites).
* StateReplay. This is replaying a message on top of the given tipset.
* GasEstimateGasLimit. This executes the message on-top-of the tipset's
computed state (unlike call which executes it on the tipset's parent state).
  * Having this method and Call apply the message at different heights is really
  weird.
2020-12-09 11:29:40 -08:00
Łukasz Magiera e1be89b442 Merge pull request #5159 from iand/fix/event-hang
fix(events): avoid potential hang when starting event listener
2020-12-09 19:40:02 +01:00
Łukasz Magiera 2ce5a29004 Merge pull request #5150 from filecoin-project/feat/list-deals-xfer-id
show data transfer ID in list-deals
2020-12-09 19:39:46 +01:00
Łukasz Magiera 39e73e1cb4 Merge pull request #5158 from wangyancun/master
Remove extra spaces
2020-12-09 19:31:38 +01:00
Łukasz Magiera bc9b5cb5fc Merge pull request #5160 from iand/fix/unlock-event-mutex
fix(events): unlock mutex before error returns
2020-12-09 19:25:07 +01:00
Łukasz Magiera 9990d440e9 Merge pull request #5162 from filecoin-project/ref/mpool
Small message pool refactors
2020-12-09 19:23:22 +01:00
Ian Davis c6f5214657 fix(events): unlock mutex before error returns 2020-12-09 13:37:56 +00:00
Ian Davis 696469aae7 fix: avoid potential hang when starting event listener
It was possible for NewEvents to never return, blocked on waiting for a WaitGroup to be done.
The call to Done was in a goroutine that could exit before reaching the Done call.

Replace the WaitGroup with a channel that is closed to signal that initialisation is complete.
Also, while we are waiting on the channel, wait on the context so we can exit clealy if the
context is canceled.
2020-12-09 11:29:48 +00:00
beck d3fa728894 Remove extra spaces 2020-12-09 19:22:21 +08:00
Jakub Sztandera 6ca5caef31 Refactor DefaultMessageSendSpec
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-12-08 20:51:27 +01:00
Jakub Sztandera 689b93dc0e messagepool: small refactor
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-12-08 20:07:13 +01:00
Dirk McCormick 72cb130e17 feat: show data transfer ID in list-deals 2020-12-08 15:23:26 +01:00
Łukasz Magiera a999e41677 Merge pull request #5072 from zgfzgf/feat-shed-cid
Feat shed cid
2020-12-08 10:23:04 +01:00
Łukasz Magiera 6b1c54162a Merge pull request #5112 from filecoin-project/feat/use-fund-manager-to-withdraw-market-funds
Use FundManager to withdraw funds, add MarketWithdraw API
2020-12-08 10:08:40 +01:00
Anton Evangelatov 3c291dd23f go get lotus@master in circleci 2020-12-07 15:44:21 +01:00
Anton Evangelatov 1cfd9555d5 reduce sectors ; less verbose logging for some subsystems 2020-12-07 15:11:41 +01:00
Anton Evangelatov 064b036000 update debug image to use 8MiB sectors 2020-12-07 14:14:21 +01:00
Łukasz Magiera 5c37c9d8e9 Merge pull request #5118 from filcloud/keygen-outfile
add keygen outfile
2020-12-07 13:11:11 +01:00
Łukasz Magiera b7975dcd9a Merge pull request #5114 from filecoin-project/chore/update_sr2_stat_aggregation
Chore/update sr2 stat aggregation
2020-12-07 13:09:23 +01:00
Łukasz Magiera 3beebe5dc8 Merge pull request #5119 from filecoin-project/fix/ctl-address-lookup
miner: Fix control address lookup
2020-12-07 12:59:32 +01:00
Anton Evangelatov 2829245a46 baseline k8s configs 2020-12-07 11:48:22 +01:00
Anton Evangelatov b1dcf5fead 8MB sectors ; 5MB deal 2020-12-07 11:48:22 +01:00
Anton Evangelatov d0599ff1e3 dummy delay for everyone but first miner 2020-12-07 11:48:22 +01:00
Anton Evangelatov a53fd82379 add more time to miner to bootstrap 2020-12-07 11:48:22 +01:00
Anton Evangelatov 86af05ba6f update base image with latest filecoin-ffi 2020-12-07 11:48:22 +01:00
Anton Evangelatov c543a10ce7 rename oni/lotus-soup to testplans/lotus-soup and lock lotus version 2020-12-07 11:48:22 +01:00
Dan Shao d56170d70e Optimize sectors info loading 2020-12-07 13:42:37 +08:00
Peter Rabbitson d9e3cc0374 Add an extra filplus counter 2020-12-04 19:00:13 +01:00
Łukasz Magiera a5a72a41eb miner: Fix control address lookup 2020-12-04 17:02:23 +01:00
Peter Rabbitson 2514c96cff Count deals from sealed sectors only 2020-12-04 15:45:25 +01:00
Peter Rabbitson 88bd757024 Only count the first 10 copies of the same piece per project 2020-12-04 15:45:25 +01:00
Peter Rabbitson 1e6aa4b129 Only count phase2 deals ( start epoch 166560 ) 2020-12-04 15:45:25 +01:00
Frank daca99687c add keygen outfile 2020-12-04 18:39:35 +08:00
Ingar Shu 65abeb066d docs 2020-12-03 13:20:50 -08:00
Ingar Shu 13c8a235b6 Use FundManager to withdraw funds, add MarketWithdraw to API 2020-12-03 13:08:18 -08:00
Łukasz Magiera b13226bc2f Merge pull request #5111 from filecoin-project/fix/send-nonce-0
fix: send with declared nonce 0
2020-12-03 19:01:19 +01:00
Jakub Sztandera 07afd93443 fix: send with declared nonce 0
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-12-03 18:38:36 +01:00
Łukasz Magiera dc06d30f52 Merge pull request #5101 from filecoin-project/raulk/memory-watchdog
introduce memory watchdog; LOTUS_MAX_HEAP
2020-12-03 15:46:09 +01:00
Łukasz Magiera 90a31fde9f Merge pull request #5103 from filecoin-project/feat/miner-control-config
miner: Control address config for (pre)commits
2020-12-03 15:33:12 +01:00
Raúl Kripalani f9cbf6d526 watchdog: add LOTUS_DISABLE_WATCHDOG escape hatch. 2020-12-03 13:16:10 +00:00
Łukasz Magiera b190c3492a Merge pull request #5099 from zgfzgf/feat-chain-gen
delete repeat call func
2020-12-03 13:23:39 +01:00
Łukasz Magiera da5e1b319f Merge pull request #5098 from filecoin-project/feat/shed-ledger-show
shed: ledger show command
2020-12-03 13:22:06 +01:00
Łukasz Magiera ba7854d645 Merge pull request #5105 from filecoin-project/feat/log-insufficent-peers
sync: log a message when there aren't enough peers
2020-12-03 12:53:40 +01:00
Łukasz Magiera d844938a92 Merge pull request #5107 from zgfzgf/feat-miner-round
optimize code use existence var
2020-12-03 12:51:49 +01:00
Łukasz Magiera 58695dc1bc miner: fix tests 2020-12-03 12:37:11 +01:00
Łukasz Magiera 1502ca6460 storagefsm: Fix addr selection for commits 2020-12-03 12:30:41 +01:00
zgfzgf 178691e37f optimize code use existence var 2020-12-03 09:54:57 +08:00
Aayush Rajasekaran 93d26195f1 Merge pull request #5104 from filecoin-project/release/v1.2.2
Lotus version 1.2.2
2020-12-02 20:40:40 -05:00
Travis Person a584fcb935 sync: log a message when there aren't enough peers 2020-12-03 01:27:07 +00:00
Aayush Rajasekaran bf93dfbc3b Lotus version 1.2.2 2020-12-02 20:23:59 -05:00
Raúl Kripalani d033f8aab1 watchdog: remove silence period, reduce tick interval to 5 secs. 2020-12-02 22:31:57 +00:00
Raúl Kripalani e34a759889 avoid global ResourceConstraints. 2020-12-02 22:26:30 +00:00
Raúl Kripalani 2ef8acdfc8 back out index cache usage in badger blockstore. 2020-12-02 21:35:13 +00:00
Łukasz Magiera 562f5839b7 Fix lint 2020-12-02 22:01:09 +01:00
Łukasz Magiera c3a0feef96 miner: Improve default address config 2020-12-02 21:54:38 +01:00
Łukasz Magiera 2fd93a55ac plumb AddressSelector to stoage fsm 2020-12-02 21:47:54 +01:00
Łukasz Magiera 783971d2c8 docsgen, gofmt 2020-12-02 20:46:40 +01:00
Łukasz Magiera f74a1b70ab miner: Fix actor control list cli 2020-12-02 20:46:07 +01:00
Łukasz Magiera 7246ef273f miner: Control address config for (pre)commits 2020-12-02 19:58:00 +01:00
Raúl Kripalani e8a5e0d2fe integrate memory watchdog; impose limits on badger caches. 2020-12-02 16:40:28 +00:00
zgfzgf a415e49fdb delete repeat call func 2020-12-02 20:05:01 +08:00
Raúl Kripalani 655aea1018 Merge branch 'master' into raulk/badger-index-cache 2020-12-02 11:46:57 +00:00
Łukasz Magiera 9707c82285 shed: ledger show command 2020-12-02 10:37:17 +01:00
Aayush Rajasekaran 370817eb60 Allow miners to filter (un)verified deals 2020-12-02 01:32:34 -05:00
zgfzgf 7c8ab6977a add estimate command 2020-12-02 12:57:57 +08:00
zgfzgf 7d3e4c5d01 feat election error miner-power to network-power 2020-12-02 12:36:05 +08:00
zgfzgf 97dd082585 change flag codec value raw to id and default value is id 2020-12-02 08:41:58 +08:00
Łukasz Magiera 3196b2cfd5 Merge pull request #5086 from filecoin-project/feat/better-sector-check
miner: Add slow mode to proving check
2020-12-02 01:03:48 +01:00
Łukasz Magiera 289ef910a0 fix imports, docsgen 2020-12-02 00:39:55 +01:00
Łukasz Magiera 95eaf13b5a sectorstorage: Fix tests 2020-12-02 00:36:32 +01:00
Łukasz Magiera c6f85886bf miner: Add slow mode to proving check 2020-12-02 00:32:14 +01:00
Łukasz Magiera b6046924b3 Merge pull request #5083 from filecoin-project/feat/miner-info-improvements
miner info cli improvements
2020-12-01 22:46:50 +01:00
Łukasz Magiera bc14d0820f fix lint 2020-12-01 20:00:55 +01:00
Łukasz Magiera 64e30808f8 miner info: Print control and spendable balances 2020-12-01 19:56:47 +01:00
Łukasz Magiera 28420b9eb0 miner info: Make balances line up better 2020-12-01 19:43:22 +01:00
Łukasz Magiera b28ed5887c gofmt 2020-12-01 19:23:43 +01:00
Łukasz Magiera 827ec75f5f miner info: Don't print random config values 2020-12-01 19:23:29 +01:00
Łukasz Magiera c31774b08e miner info: Cleanup balance printing 2020-12-01 19:22:57 +01:00
Łukasz Magiera be9f7b88b2 uint64 is too small 2020-12-01 19:15:39 +01:00
Łukasz Magiera 15c4793fe0 miner info: More cleanup 2020-12-01 19:15:20 +01:00
Łukasz Magiera 42cecbd879 miner info: Collapse sector size line 2020-12-01 19:01:08 +01:00
Łukasz Magiera 00e5ace818 Print basefee in miner info 2020-12-01 18:56:43 +01:00
Łukasz Magiera 82b5cb89cd Merge pull request #5061 from filecoin-project/fix/err-late-deals
Error out deals that are not activated by proposed deal start epoch
2020-12-01 17:02:06 +01:00
dirkmcandŁukasz Magiera b7436cd300 Update markets/storageadapter/ondealsectorcommitted.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2020-12-01 16:48:48 +01:00
zgfzgf 715c32ff77 add flag codec 2020-12-01 22:53:24 +08:00
Dirk McCormick 44d929c084 fix: increase proposed deal start epoch for CLI test 2020-12-01 15:31:05 +01:00
Łukasz Magiera 4b1d6bfcca Merge pull request #5079 from zgfzgf/feat-shed-commp
add commp-to-cid base64 decode
2020-12-01 15:11:23 +01:00
Łukasz Magiera 614f45dcfb Merge pull request #5041 from filecoin-project/feat/5013
Sector check command
2020-12-01 14:59:01 +01:00
Łukasz Magiera 354b5af55a Merge pull request #5032 from filecoin-project/fix/cancel-transfer
Cancel transfer cancels storage deal
2020-12-01 14:57:58 +01:00
Łukasz Magiera fc5120621b Merge pull request #5080 from filecoin-project/feat/enable-stack-with-gas-tracing
Enable Callers tracing when GasTracing is enabled
2020-12-01 14:56:41 +01:00
Łukasz Magiera c4a6b94b9c Merge pull request #5023 from filecoin-project/feat/worker-set-task-types
worker: Support setting task types at runtime
2020-12-01 14:51:07 +01:00
Łukasz Magieraanddirkmc 054327b72a wdpost: Update comment
Co-authored-by: dirkmc <dirkmdev@gmail.com>
2020-12-01 14:50:51 +01:00
Dirk McCormick cb044f83a7 fix: ensure deal start is far enough in future for tests 2020-12-01 14:25:48 +01:00
Jakub Sztandera f1291f137c Enable Callers tracing when GasTracing is enabled
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-12-01 13:53:30 +01:00
Dirk McCormick 6bbb8ecafc refactor: simplify deal start epoch timeout handling 2020-12-01 12:40:02 +01:00
zgfzgf ec08e27af2 add base64 decode 2020-12-01 19:36:01 +08:00
Dirk McCormick c5a8b7076c feat: go-fil-markets v1.0.9 2020-12-01 11:58:28 +01:00
Łukasz Magiera 4d019f16e4 Merge pull request #5074 from filecoin-project/fix/deal-verified-helptext
Fix helptext for verified-deal default in client deal
2020-12-01 11:54:41 +01:00
Dirk McCormick ceea03cd40 fix: client test list-deals parsing 2020-12-01 11:48:14 +01:00
Łukasz Magiera 32065f551e Fix helptext for verified-deal default in client deal 2020-12-01 11:41:21 +01:00
Dirk McCormick 7bab281449 feat: go-data-transfer v1.2.2 / go-fil-markets v1.0.8 2020-12-01 11:12:41 +01:00
zgfzgf a8cdb8adc7 add abi Cid 2020-12-01 17:16:41 +08:00
Łukasz Magiera 2be9836196 Merge pull request #5068 from filecoin-project/zen/ledger-sign-print
Ledger signature verification
2020-12-01 09:59:36 +01:00
zgfzgf 0439e95aa3 add encoding flag 2020-12-01 16:50:53 +08:00
ZenGround0 2e5843a0ee Filecoin signature serialization 2020-11-30 23:14:21 -05:00
ZenGround0 751568a4dd Print hex 2020-11-30 22:50:41 -05:00
Łukasz Magiera 6dea0a6281 worker: fix math-related issue 2020-11-30 23:19:16 +01:00
Łukasz Magiera a4f3758f4c worker api: better grouping 2020-11-30 23:16:30 +01:00
Łukasz Magiera 3e143cac4b Merge pull request #5060 from filecoin-project/feat/listasks-ping
client list-asks --by-ping
2020-11-30 23:14:53 +01:00
Łukasz Magiera 0386cc5d48 Merge pull request #5059 from filecoin-project/feat/mpool-replace-opt-limit
Make --gas-limit optional in mpool replace cli
2020-11-30 20:07:09 +01:00
Dirk McCormick e02a366419 feat: error out deals that are not activated by proposed deal start epoch 2020-11-30 15:27:40 +01:00
Łukasz Magiera d15ef9ac9b Merge pull request #5036 from filecoin-project/feat/shed-rpc-args
shed rpc: Allow calling with args
2020-11-30 14:33:52 +01:00
Łukasz Magiera 70732ac423 Fix lint 2020-11-30 14:26:42 +01:00
Łukasz Magiera b18bc90dbc client list-asks --by-ping 2020-11-30 14:20:05 +01:00
Łukasz Magiera 8382977e21 Merge pull request #5037 from filecoin-project/fix/chainstr-tipset-leak
Fix chainstore tipset leak
2020-11-30 14:17:28 +01:00
Łukasz Magiera f4913c19b1 Make --gas-limit optional in mpool replace cli 2020-11-30 12:41:50 +01:00
zgfzgf 253e22d6ea add bitfield merge func 2020-11-28 21:54:30 +08:00
zgfzgf a7ed639c21 optimize bitfield use func 2020-11-28 21:44:12 +08:00
zgfzgf f4adf03ce5 optimize bitfield intersect 2020-11-28 21:07:14 +08:00
zgfzgf c016e34dbc bitfield add encode 2020-11-28 20:56:16 +08:00
zgfzgf 21835c785b optimize bitfield runs 2020-11-28 20:17:56 +08:00
zgfzgf 8007c1f9ae feat bitfield stat 2020-11-28 20:03:26 +08:00
zgfzgf 055795c4cc optimize bitfield decode 2020-11-28 19:14:48 +08:00
zgfzgf b03c4bc26b add bitfield hex encode 2020-11-28 17:29:15 +08:00
Łukasz Magiera 660ac26dd9 Merge pull request #5035 from filecoin-project/feat/mpool-stat-gas
Print gas limit sum in mpool stat
2020-11-27 20:05:03 +01:00
Jakub Sztandera 65d50c76d6 bonus: fix WalletSign using t0 addresses in WalletSignMessage
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-27 17:19:41 +01:00
Łukasz Magiera e8d2560581 Fix tests 2020-11-27 16:47:48 +01:00
Łukasz Magiera dc7c7608df docsgen 2020-11-27 16:37:06 +01:00
Łukasz Magiera 13a5b7f539 Merge pull request #5029 from GFZRZK/GFZRZK/patch/fix_ambiguous_display
fix: start a new line in print miner-info to avoid ambiguous display
2020-11-27 16:17:25 +01:00
Łukasz Magiera 0c1592f2d3 Merge pull request #5025 from filecoin-project/feat/accounting-tool
add a tooling to make filecoin accounting a little easier
2020-11-27 16:11:25 +01:00
Łukasz Magiera 61485beb22 fix lint 2020-11-27 16:02:01 +01:00
Łukasz Magiera 01ad4c0514 shed rpc: Allow calling with args 2020-11-27 15:57:00 +01:00
Łukasz Magiera 09b9dfc3ce Print gas limit sum in mpool stat 2020-11-27 15:55:59 +01:00
Dirk McCormick c66e594046 fix: cancel transfer cancels storage deal 2020-11-27 15:37:22 +01:00
wangchao 9ade05b33b fix: start a new line in print miner-info to avoid ambiguous display 2020-11-27 15:14:58 +08:00
Jakub Sztandera 13ff98416f Fix cs.tipsets being unbounded
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-26 23:37:59 +01:00
whyrusleeping 4f675b76ad add a tooling to make filecoin accounting a little easier 2020-11-26 13:46:19 -08:00
Łukasz Magiera a6658a858f Fix tests 2020-11-26 19:59:15 +01:00
Łukasz Magiera bfb5bad124 docsgen 2020-11-26 17:34:58 +01:00
Łukasz Magiera 3672053ae9 worker: Support setting task types at runtime 2020-11-26 17:33:34 +01:00
Łukasz Magiera 4dfec7b232 worker: Sort tasks in info 2020-11-26 16:37:11 +01:00
Łukasz Magiera 23c7728edb worker: Print task types in info 2020-11-26 16:34:51 +01:00
Łukasz Magiera aa278443d3 Merge pull request #5008 from filecoin-project/fix/worker-remote
worker: More robust remote checks
2020-11-26 16:29:51 +01:00
Łukasz Magiera 42173e29d6 Merge pull request #5019 from zgfzgf/fix-wallet-default-delete
fix wallet delete address where address is default
2020-11-26 16:10:39 +01:00
zgfzgf 32c159fa3a fix lint check 2020-11-26 21:36:40 +08:00
zgfzgf fad250058d fix wallet delete address where address is default 2020-11-26 20:55:29 +08:00
Łukasz Magiera 2304ea0077 Merge pull request #5016 from filecoin-project/fix/fsm-rm-unceroverable
storagefsm: Add missing planners
2020-11-26 12:22:48 +01:00
Łukasz Magiera 6df0340136 Merge pull request #4945 from filecoin-project/feat/deal-await-precommit
markets - separate watching for pre-commit from prove-commit
2020-11-26 12:22:00 +01:00
Łukasz Magiera 41d370557f Merge remote-tracking branch 'origin/master' into feat/deal-await-precommit 2020-11-26 12:09:52 +01:00
Łukasz Magiera dfb769c505 Merge pull request #5015 from filecoin-project/deps/jsonrpc-v0.1.2
Update go-jsonrpc to v0.1.2
2020-11-26 12:03:35 +01:00
Łukasz Magiera b916ac83cb Merge pull request #5002 from zgfzgf/fix-wallet-deadlock
fix wallet dead lock
2020-11-26 12:03:12 +01:00
Łukasz Magiera 74f040f9d5 storagefsm: Add SubmitCommit to toStatState switch 2020-11-26 12:02:35 +01:00
Łukasz Magiera fcec665267 Merge remote-tracking branch 'origin/master' into feat/deal-await-precommit 2020-11-26 11:51:36 +01:00
Łukasz Magiera 506624f509 Update go-jsonrpc to v0.1.2 2020-11-26 11:42:31 +01:00
Łukasz Magiera 1f9ca1958e Merge pull request #5005 from filecoin-project/feat/miner-slow-winpost-log
miner: log winningPoSt duration separately
2020-11-26 11:25:02 +01:00
Łukasz Magiera 91259c29d4 Merge pull request #4996 from filecoin-project/feat/configure-graphsync
Configure simultaneous requests
2020-11-26 11:24:39 +01:00
Łukasz Magiera e2278ebe6a Merge pull request #5007 from filecoin-project/fix/fsm-new-retry
storagefsm: Improve new deal sector logic
2020-11-26 11:19:25 +01:00
Łukasz Magiera eeb38fa649 storagefsm: Test fsmPlanners map 2020-11-26 10:58:07 +01:00
Łukasz Magiera ba87cb4fa9 storagefsm: Add missing planners 2020-11-26 10:57:47 +01:00
Łukasz Magiera 65653a1747 storagefsm: Add GetTicket to some maps 2020-11-26 10:53:31 +01:00
s1m0n21 663b3f4f21 add a sector check command 2020-11-26 15:02:43 +08:00
Jakub Sztandera d15d9b0fb9 Merge pull request #5010 from filecoin-project/fix/inspec-not-found
Fix actor not found in chain inspect-usage
2020-11-25 20:57:26 +01:00
Jakub Sztandera 86e25e7969 Fix actor not found in chain inspect-usage
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-25 20:04:27 +01:00
Łukasz Magiera 2e544e3e6a configure SimultaneousTransfers in node/builder 2020-11-25 19:57:38 +01:00
Łukasz Magiera 7904f135ff Merge pull request #4998 from filecoin-project/asr/json-deal
Default StartDealParams's fast retrieval field to true over JSON
2020-11-25 19:32:30 +01:00
Łukasz Magiera 89493fe2b8 storagefsm: newDealSector review 2020-11-25 18:55:58 +01:00
Łukasz Magiera 23bf3349d7 worker: More robust remote checks 2020-11-25 17:05:45 +01:00
Łukasz Magiera 6166204bac storagefsm: Improve new deal sector logic 2020-11-25 16:40:04 +01:00
Dirk McCormick 97a76a4b9a feat: update to go-graphsync v0.5.1 2020-11-25 13:18:41 +01:00
Łukasz Magiera f1948d54f0 miner: log winningPoSt duration separately 2020-11-25 11:05:06 +01:00
Dirk McCormick cd7580e6d8 refactor: no need to check for prove-commit from OnDealSectorPreCommitted 2020-11-25 10:39:42 +01:00
zgfzgf 15aa8e5253 fix wallet dead lock 2020-11-25 12:58:17 +08:00
Aayush Rajasekaran 0c7962ce5f Default StartDealParams's fast retrieval field to true when JSON unmarshalling 2020-11-24 18:13:13 -05:00
hannahhoward 694834e8d5 feat(graphsync): configure simultaneous requests
allow configuration of the number of simultaneous requests graphsync will process at once
2020-11-24 14:32:30 -08:00
hannahhoward 47a4128311 feat(markets): update to tagged go-fil-markets 2020-11-24 13:26:14 -08:00
Dirk McCormick 239e180683 feat: markets - separate watching for pre-commit from prove-commit 2020-11-24 13:24:41 -08:00
Łukasz Magiera 25070314ce Merge pull request #4989 from filecoin-project/graphsync-scale-measurements
add .sec scale to measurements; humanize for metric tags
2020-11-24 19:56:18 +01:00
Łukasz Magiera 214f46bc88 Merge pull request #4876 from filecoin-project/fix/miner-ticket-loop
storagefsm: Fix expired ticket retry loop
2020-11-24 19:54:41 +01:00
Łukasz Magiera a63ef1dcd5 Merge pull request #4984 from yaohcn/fix-log-warn
fix log format
2020-11-24 18:01:56 +01:00
Łukasz Magiera 5ed79fa73e Merge pull request #4987 from zgfzgf/feat-batch-verify-seal-print
update index to sectorNumber
2020-11-24 17:55:34 +01:00
Anton Evangelatov 2e85b42665 add .sec scale to measurements; humanize for metric tags 2020-11-24 17:52:37 +01:00
Łukasz Magiera eb2be69ace events: use %v to log errors 2020-11-24 17:51:19 +01:00
Łukasz Magiera 9cef300535 Merge pull request #4971 from filecoin-project/chore/new_sr2_deal_rollup_cmd
New SR-specific lotus-shed cmd
2020-11-24 17:50:10 +01:00
Łukasz Magiera 5f28c12f2e Merge pull request #4923 from filecoin-project/schomatis/fix/update-rpc-max-request-size
Update JSON RPC server to enforce a maximum request size
2020-11-24 17:45:47 +01:00
Łukasz Magiera f850d77f1e Merge pull request #4904 from filecoin-project/asr/genesis-remainder
Setup remainder msig signers when parsing genesis template
2020-11-24 17:06:17 +01:00
Łukasz Magiera 7c831101f3 Merge pull request #4727 from filecoin-project/nonsense/integrate-testplans-to-lotus
move testground/lotus-soup testplan from oni to lotus
2020-11-24 17:05:29 +01:00
Lucas Molas 8b8449faee update jsonrpc with max req size 2020-11-24 16:46:35 +01:00
Łukasz Magiera fe92a6e2d4 Merge pull request #4024 from zgfzgf/sector-sched
modify for unsafe
2020-11-24 16:19:17 +01:00
zgfzgf 1f9c0f8040 update index to sectorNumber 2020-11-24 20:27:35 +08:00
yaohcn 7c0b6f41d8 fix log format 2020-11-24 19:09:48 +08:00
Łukasz Magiera bb25eb980d Merge pull request #4980 from filecoin-project/feat/add-data-transfer-logging-to-miner
Add logging on data-transfer to miner
2020-11-23 22:20:14 +01:00
hannahhoward afec58f780 feat(markets): add logging on data-transfer to miner 2020-11-23 12:43:30 -08:00
Anton Evangelatov 52da5acc96 go mod replace lotus with ../../ 2020-11-23 20:43:18 +01:00
Anton Evangelatov fd640864cb Merge branch 'master' into nonsense/integrate-testplans-to-lotus 2020-11-23 20:20:44 +01:00
Anton Evangelatov 3f151351aa trigger testplans only on merge to master 2020-11-23 20:04:24 +01:00
Anton Evangelatov 844c0a3527 bump docker golang version to 1.15:buster 2020-11-23 20:00:20 +01:00
Łukasz Magiera 83b1009837 storagefsm: check getticket precommit expication correctly 2020-11-23 19:12:54 +01:00
Łukasz Magiera 85e592bbe2 storagefsm: Retry pushing messages when out-of-funds 2020-11-23 19:03:31 +01:00
Łukasz Magiera e2a6b99144 storagefsm: Fix expired ticket retry loop 2020-11-23 19:03:31 +01:00
Łukasz Magiera be2a5942fb Merge pull request #4082 from leviok/fix-nil-pointer
fix nil pointer in StateSectorPreCommitInfo
2020-11-23 18:58:32 +01:00
Łukasz Magiera ffa96389bc Merge pull request #4976 from filcloud/fix-get-sector
fix get sector bug
2020-11-23 18:58:04 +01:00
Peter Rabbitson a145819004 More linter... 2020-11-23 18:46:59 +01:00
Łukasz Magiera 0e39e760e5 Merge pull request #4929 from filecoin-project/feat/update-markets-commp-extraction
Remove all temp file generation for deals
2020-11-23 18:43:00 +01:00
zlhwdsz 721120fc60 fix get sector nil pointer bug 2020-11-24 00:00:14 +08:00
Dirk McCormick 3634ca50ca fix: sector-storage tests 2020-11-23 16:09:57 +01:00
Dirk McCormick c965696586 fix: ffiwrapper sealer test 2020-11-23 14:21:46 +01:00
Łukasz Magiera 53c39b1176 Merge pull request #4973 from shaodan/fix-workerid-format
Format workerID as string
2020-11-23 14:08:15 +01:00
Łukasz Magiera 7e2d05cfd7 Merge pull request #4975 from filecoin-project/feat/data-transfer-logging
add data transfer logging
2020-11-23 14:07:47 +01:00
Łukasz Magiera f601d1bf6b Merge pull request #4974 from zgfzgf/feat-readme-go
readme update golang version from 1.14.7 to 1.15.5
2020-11-23 13:23:29 +01:00
Łukasz Magiera 6ce14132cc Merge pull request #4956 from fireflyblock/bugfix/devnet-script
bugfix: fixup devnet script
2020-11-23 13:08:06 +01:00
zgfzgf c13ade3fbf Downgrade duplicate nonce logs to debug (#4933)
* add messagepool duplicate nonce print info

* update log.Info to log.debug and go fmt

* recover the grouping of imports

* update print from info to debug

* print format %w to %s
2020-11-23 13:03:41 +01:00
Łukasz Magiera 7d540905ac Don't return nil in StateSectorPreCommitInfo 2020-11-23 12:14:49 +01:00
Dirk McCormick 4a8df0c3fa feat: add data transfer logging 2020-11-23 10:31:39 +01:00
zgfzgf 2d2ebdcc4b readme update golang version 2020-11-23 16:15:17 +08:00
Dan Shao f3838a47c7 Format workerID as string 2020-11-23 15:07:50 +08:00
Peter Rabbitson e7f3554c62 The linter is *so* dumb:
- There is no way for me to check the error on defer ...Close(), why even ask?
- A sort function does not suffer arbitrary aliasing

Everything is terrible...
2020-11-23 06:51:52 +01:00
Peter Rabbitson 2609342356 New SR-specific lotus-shed cmd 2020-11-23 05:41:14 +00:00
leviok 9fe3649dd2 correct it 2020-11-23 11:08:21 +08:00
leviok 9b199f0476 fix nil pointer 2020-11-23 11:08:21 +08:00
zgfzgf b6893b0a3f solve merage problem 2020-11-22 16:15:30 +08:00
urugang 69bfe7b7a8 bugfix: fixup devnet script 2020-11-22 00:11:39 +08:00
zgfzgf e197038b9f delete policy useless code 2020-11-21 10:14:13 +08:00
zgfzgf 549afbaa5f add policy 8m and 512m 2020-11-21 10:04:07 +08:00
hannahhoward 218f7c2c5d feat(markets): update markets, extract commp 2020-11-20 13:29:14 -08:00
Łukasz Magiera 375b7a1c4c Merge pull request #4305 from zgfzgf/fix-lotus-bench
Fix lotus bench error
2020-11-20 19:22:22 +01:00
Łukasz Magiera 3113b15217 Merge pull request #4754 from filecoin-project/fix/issue-92
emit events for peer disconnections and act upon them in the blocksync tracker
2020-11-20 18:45:35 +01:00
Łukasz Magiera 34bca28416 Merge pull request #4943 from zgfzgf/fix-policy-v7-len
change typeV7 make len
2020-11-20 18:11:19 +01:00
Łukasz Magiera 99972c9e34 Merge pull request #4924 from s1m0n21/master
Remove unused key
2020-11-20 17:02:25 +01:00
Łukasz Magiera 91a3d1d34a Merge pull request #4919 from zgfzgf/fix-incoming-validateblock-record
bug:replace with func recordFailure
2020-11-20 16:57:07 +01:00
Łukasz Magiera 71dfc2e338 Merge pull request #4916 from filecoin-project/feat/go-fil-markets-1.0.5
upgrade to go-fil-markets 1.0.5
2020-11-20 16:50:12 +01:00
Łukasz Magiera e9fae0425f Merge pull request #4915 from filecoin-project/asr/predicate-message
Improve error for ActorsVersionPredicate
2020-11-20 16:49:51 +01:00
Łukasz Magiera 17597fdd8f Merge pull request #4914 from filecoin-project/asr/version-cli
CLI to get network version
2020-11-20 16:47:35 +01:00
Łukasz Magiera 9613acd46b Merge pull request #4913 from zgfzgf/feat-forks-schedule
optimize code UpgradeTapeHeight and go fmt
2020-11-20 16:45:09 +01:00
Łukasz Magiera 4b507f5be1 Merge pull request #4911 from filecoin-project/asr/seed-old
Use version0 when pre-sealing
2020-11-20 16:41:14 +01:00
Łukasz Magiera 8508cdc00b Merge pull request #4910 from zgfzgf/fix-makefile
add go main version
2020-11-20 16:40:48 +01:00
Łukasz Magiera 4483d94db3 Merge pull request #4902 from GFZRZK/GFZRZK/patch/remove_unuseful_code_in_newstorageask
just return storedask.NewStoredAsk to reduce unuseful code
2020-11-20 16:28:03 +01:00
Łukasz Magiera 94763c2aaa Merge pull request #4849 from filecoin-project/feat/conngater
Connection Gater support
2020-11-20 16:25:02 +01:00
zgfzgf d033042d6b update code 2020-11-20 23:20:26 +08:00
Łukasz Magiera 54637d5093 Merge pull request #4767 from zgfzgf/feat-print-multiple-blocks
print multiple blocks from miner cid
2020-11-20 16:14:37 +01:00
zgfzgf 7d4bc90d42 solve merge conflicts 2020-11-20 22:34:15 +08:00
Łukasz Magiera a13690dcf1 Merge pull request #4909 from zgfzgf/fix-go-mod
update go from 1.14 to 1.15
2020-11-20 15:28:12 +01:00
Łukasz Magiera f0eac01a3c Merge remote-tracking branch 'origin/master' into nonsense/integrate-testplans-to-lotus 2020-11-20 15:22:10 +01:00
vyzo ef444676c2 combine add and remove evts and use a single emitter
to reduce likelihood of races
2020-11-20 16:15:44 +02:00
Łukasz Magiera 853f9da457 Merge pull request #4583 from filecoin-project/fix/tvx-msg-cid
tvx extract: make it work with secp messages.
2020-11-20 15:13:06 +01:00
Raúl Kripalani bb9d2b5af4 finish comment. 2020-11-20 14:05:50 +00:00
vyzo 7aec500384 emit event for peer disconnectionsa and act upon them in the blocksync peer tracker 2020-11-20 15:58:27 +02:00
Łukasz Magiera b10b6fdd11 Merge pull request #4355 from filecoin-project/shed/post-find
Shed/post find
2020-11-20 14:52:42 +01:00
Łukasz Magiera 2d9123a618 Merge pull request #4140 from filecoin-project/feat/mutex-fraction
Add options to set BlockProfileRate and MutexProfileFraction
2020-11-20 14:22:58 +01:00
Łukasz Magiera 96f004032b Merge pull request #4217 from filecoin-project/fix/post-smaller-feecap
Set lower feecap on PoSt messages with low balance
2020-11-20 13:15:48 +01:00
zgfzgf 463a647118 change typeV7 make len 2020-11-20 17:24:52 +08:00
Aayush Rajasekaran 526cd739f6 Return total power when GetPowerRaw doesn't find miner claim 2020-11-20 00:31:04 -05:00
Aayush Rajasekaran df66f48f64 Merge pull request #4937 from filecoin-project/asr/changelog
Lotus version 1.2.1
2020-11-20 00:02:42 -05:00
Aayush Rajasekaran 89ffd368b8 Lotus version 1.2.1 2020-11-19 23:47:46 -05:00
Raúl Kripalani 44040f0f3f badger options: enable IndexCache and CompactL0OnClose. 2020-11-20 00:33:43 +00:00
Łukasz Magiera 1999156d06 wdpost: always pick least-bad address 2020-11-19 20:59:54 +01:00
Łukasz Magiera b4fa099257 wdpost: fix TestWDPostDoPost 2020-11-19 18:57:43 +01:00
Łukasz Magiera b7a282decc wdpost: fix build 2020-11-19 18:30:53 +01:00
Łukasz Magiera 9f807f4aeb storageminer: Simplify AddressFor 2020-11-19 18:02:20 +01:00
Łukasz Magiera 16dbbadddf Set lower feecap on PoSt messages with low balance 2020-11-19 18:02:20 +01:00
Łukasz Magiera 648f02cbd6 Merge pull request #4922 from filecoin-project/raulk/fix-fresh-blockstore
fix blockstore directory not created automatically.
2020-11-19 17:11:48 +01:00
Łukasz Magiera 880204045b Merge pull request #4918 from ppiaas/master
WindowPoStScheduler.checkSectors() delete useless judgment
2020-11-19 17:09:37 +01:00
Łukasz Magiera 9d2208e0e8 fix lint 2020-11-19 17:08:14 +01:00
Raúl Kripalani 55061ae6fb fix blockstore directory not created automatically. 2020-11-19 15:55:02 +00:00
S1M0N21 2b611b3a99 Remove unused key 2020-11-19 23:48:28 +08:00
zgfzgf de9cef62f7 replace code with func 2020-11-19 20:46:40 +08:00
15ho ba56d02a1c fix: WindowPoStScheduler.checkSectors() delete useless judgment 2020-11-19 19:48:32 +08:00
Dirk McCormick e7b8511622 feat: upgrade to go-fil-markets 1.0.5 2020-11-19 10:16:49 +01:00
Aayush Rajasekaran b1afa2022b Improve error for ActorsVersionPredicate 2020-11-19 02:27:35 -05:00
Aayush Rajasekaran 3737a8f3cc CLI to get network version 2020-11-19 02:24:32 -05:00
zgfzgf 7b39c3a907 optimize code UpgradeTapeHeight and go fmt 2020-11-19 14:47:13 +08:00
Aayush Rajasekaran 62d20f2191 Use version0 when pre-sealing 2020-11-18 23:10:05 -05:00
zgfzgf e9664a997e add go main version 2020-11-19 10:11:35 +08:00
zgfzgf 6d1bac7f70 update go from 1.14 to 1.15 2020-11-19 08:54:02 +08:00
Łukasz Magiera dc3d17c9ea Merge pull request #4871 from filecoin-project/release/v1.2.0
v1.2.0 staging branch
2020-11-18 23:01:41 +01:00
Aayush Rajasekaran e061a8d163 Lotus version 1.2.0 2020-11-18 15:41:55 -05:00
Łukasz Magiera 9f34f98368 Merge pull request #4889 from filecoin-project/asr/callico-epoch
Set Calico epoch
2020-11-18 20:47:28 +01:00
Łukasz Magiera 226efe28e5 Merge pull request #4905 from filecoin-project/feat/max-block-size
cap maximum number of messages per block in selection
2020-11-18 16:38:19 +01:00
vyzo 452c85de98 cap maximum number of messages per block in selection 2020-11-18 12:25:26 +02:00
Łukasz Magiera 09c996d572 Merge pull request #4903 from filecoin-project/asr/delete-fix
Tweak handling of bad beneficaries in DeleteActor
2020-11-18 11:09:39 +01:00
Aayush Rajasekaran adee4b2a5e Setup remainder msig signers when parsing genesis template 2020-11-18 02:56:30 -05:00
Aayush Rajasekaran 322f34c6c6 Tweak handling of bad beneficaries in DeleteActor 2020-11-18 01:52:46 -05:00
wangchao 49f8590578 just return storedask.NewStoredAsk to reduce unuseful code 2020-11-18 13:53:48 +08:00
Aayush Rajasekaran 016f5e44c0 Set Calico epoch 2020-11-17 21:13:43 -05:00
Łukasz Magiera 9305947547 Merge branch 'IPFSMain-Official-break-loop-when-found-warm-up-sector' 2020-11-18 02:04:01 +01:00
Łukasz Magiera b92ce76a78 gofmt 2020-11-18 02:03:52 +01:00
Łukasz Magiera 379100b470 Merge branch 'break-loop-when-found-warm-up-sector' of github.com:IPFSMain-Official/lotus into IPFSMain-Official-break-loop-when-found-warm-up-sector 2020-11-18 02:03:43 +01:00
Aayush Rajasekaran 8575f5518c Merge branch 'master' into release/v1.2.0 2020-11-17 19:49:46 -05:00
Łukasz Magiera 707f9e31df Merge pull request #4897 from filecoin-project/asr/blockstore-update
Update to ipfs-blockstore 1.0.3
2020-11-18 01:49:27 +01:00
Aayush Rajasekaran 52d34c8a5e Update to ipfs-blockstore 1.0.3 2020-11-17 19:43:20 -05:00
Aayush Rajasekaran 68a16afeda Merge branch 'master' into release/v1.2.0 2020-11-17 19:40:05 -05:00
Łukasz Magiera 50146fb9b9 Merge pull request #4872 from filecoin-project/raulk/fix-blockstore-import
fix badger double open on daemon --import-snapshot; chainstore lifecycle
2020-11-18 01:36:16 +01:00
Łukasz Magiera c5470ee17e Merge pull request #4830 from filecoin-project/time/vm-flush
Gas Balancing
2020-11-18 01:34:08 +01:00
Łukasz Magiera 00335878ab Merge pull request #4712 from filecoin-project/fix/commitfailed-checks
Check (pre)commit receipt before other checks in failed states
2020-11-18 01:26:02 +01:00
Aayush Rajasekaran 4982de89b2 Fix chaos 2020-11-17 19:18:57 -05:00
Łukasz Magiera 9328d98f84 Merge pull request #3171 from filecoin-project/feat/max-block-size-sanity-check
add sanity check for maximum block size
2020-11-18 00:49:35 +01:00
Łukasz Magiera 3536ec9f85 Merge pull request #4879 from filecoin-project/fix/4833
Fix MaxSealingSectrosForDeals getting reset to 0
2020-11-17 23:41:22 +01:00
vyzo 8191654089 track oversize block errors in metrics 2020-11-17 17:18:49 -05:00
vyzo e23170d194 add sanitcy check for maximum block size 2020-11-17 17:18:49 -05:00
Jakub Sztandera e7549dbf2c Merge pull request #4896 from filecoin-project/upg/go
Update go to 1.15.5
2020-11-17 21:35:13 +01:00
Łukasz Magiera 65202668af Merge pull request #4890 from filecoin-project/feat/worker-error-codes
Add error codes to worker return
2020-11-17 21:29:42 +01:00
Jakub Sztandera 51e93feb9a Update go to 1.15.5
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 21:20:33 +01:00
Łukasz Magiera c8d985b5c7 Merge pull request #4885 from filecoin-project/asr/worker-key
Speed up worker key retrieval
2020-11-17 20:57:35 +01:00
Jakub Sztandera 7ce4e5342b Upgrade actors to v2.3.2
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 20:43:32 +01:00
Jakub Sztandera f580892e9e Disable gas tracing
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 20:41:34 +01:00
Aayush Rajasekaran 080a1165ee create vm-flush key
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 20:41:34 +01:00
Jakub Sztandera 1413d6d4b7 Adjust gas values
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 20:41:34 +01:00
Jakub Sztandera 9b64dba4a1 Add background flushing
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 20:41:34 +01:00
Jakub Sztandera f9771c67fb Fix gas multi error in virtual gas
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 20:41:34 +01:00
Jakub Sztandera 238174cfca Adapt virtual gas
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 20:41:33 +01:00
Jakub Sztandera f130cd6fca Adjust virtual gas
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 20:41:33 +01:00
Jakub Sztandera 336aa95ab5 Add metrics for VM flush duration and obj count
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-17 20:41:33 +01:00
Aayush Rajasekaran c40c513508 Merge pull request #4862 from filecoin-project/asr/circ-supply
Modify vesting schedule post-calico
2020-11-17 13:32:55 -05:00
Łukasz Magiera bfbdbc04ba docgen 2020-11-17 16:38:37 +01:00
Łukasz Magiera b242d69805 Make storiface.CallError json-friendly 2020-11-17 16:28:41 +01:00
Łukasz Magiera b8853aa4d5 Add error codes to worker return 2020-11-17 16:17:55 +01:00
Łukasz Magiera fe448e706d Merge pull request #4874 from filecoin-project/feat/update-markets-fix-cid-recording
Fix cid recording issue
2020-11-17 14:39:47 +01:00
Łukasz Magiera 193630f7b6 Merge pull request #4884 from filecoin-project/asr/api-version
Bump API versions to 1.0.0
2020-11-17 12:51:31 +01:00
Łukasz Magiera c597c43724 Bump API versions to 1.0.0 2020-11-17 12:04:06 +01:00
Łukasz Magiera 425ad9c5fa Merge pull request #4888 from filecoin-project/asr/zero-address
Avoid sending messages to the zero BLS address
2020-11-17 11:57:47 +01:00
Łukasz Magiera 693bbee953 Merge pull request #4873 from filecoin-project/feat/sdr-upgrade
Support seal proof type switching
2020-11-17 10:57:28 +01:00
Aayush Rajasekaran 92b765bd21 Merge pull request #4783 from filecoin-project/asr/1.2.0
Small consensus-critical fixes in 1.2.0
2020-11-17 01:44:33 -05:00
Aayush Rajasekaran 7838752352 Avoid sending messages to the zero BLS address 2020-11-17 01:42:11 -05:00
Aayush Rajasekaran 596b31fb9e Speed up worker key retrieval 2020-11-17 00:53:26 -05:00
Aayush Rajasekaran 2219bff1c9 SerializeParams should return ErrSerialization 2020-11-17 00:28:27 -05:00
Aayush Rajasekaran 5c791cd93b Check parent runtime allowInternal when making a new Runtime 2020-11-17 00:22:50 -05:00
Aayush Rajasekaran ce9146916a fix: actor method params deserialization error exit code 2020-11-17 00:22:50 -05:00
Aayush Rajasekaran dff88b63b2 fix: guard against self beneficiary when deleting actor 2020-11-17 00:22:50 -05:00
hannahhoward a2abeef727 feat(markets): upgrade to fix cid recording issue 2020-11-16 17:57:57 -08:00
Łukasz Magiera dd9682f2be Fix MaxSealingSectrosForDeals getting reset to 0 2020-11-17 00:28:49 +01:00
Łukasz Magiera a152d98af8 Merge pull request #4875 from filecoin-project/frrist/fix-init-pred
Fix init actor address map diffing
2020-11-17 00:20:18 +01:00
Raúl Kripalani 27c0ce4a3a fix lint. 2020-11-16 22:39:08 +00:00
Raúl Kripalani 0c6072a1a0 chainstore lifecycle: close via Close() instead of context. 2020-11-16 22:28:59 +00:00
frrist d25e5d1c08 polish: add DeffAddressMap method to init wrapper
- replace logic in predicates
2020-11-16 11:45:25 -08:00
Łukasz Magiera e0ade92b29 Fix lint warnings 2020-11-16 19:20:18 +01:00
Łukasz Magiera 8db9c19e1c mod tidy 2020-11-16 19:19:17 +01:00
Łukasz Magiera bc05618fd1 docsgen 2020-11-16 19:19:03 +01:00
Łukasz Magiera 444239a643 update ffi 2020-11-16 19:17:07 +01:00
Steven Allen bead8ac38e use the miner's proof type when proposing storage deals 2020-11-16 19:04:17 +01:00
Steven Allen 638900f97f Remove static proof type configuration from market subsystem
Instead, use proof type from miner actor. This will, in turn, use the upgraded
proof type if/when it's switched at runtime.

TODO: Consider making this some form of config option instead?
2020-11-16 19:04:17 +01:00
Steven Allen d8afd71f4c add a test to demonstrate SDR upgrade while committing sectors 2020-11-16 19:04:17 +01:00
Steven Allen 869867e92e fix compile 2020-11-16 19:04:17 +01:00
Steven Allen 508375a55c Upgrade seal proof version in miner info after the upgrade.
This is terrible, but we don't (currently) update this in the miner info.

Q: Maybe we should delay this by a few epochs? Some pre-commits could fail if we
get a reorg.
2020-11-16 19:04:17 +01:00
Steven Allen 1f91e7267d correctly set seal proof types from tests 2020-11-16 19:04:17 +01:00
Steven Allen c8ff58aae1 add basic calico test 2020-11-16 19:04:17 +01:00
Steven Allen 4f33c91f81 fix calico upgrade logic 2020-11-16 19:04:17 +01:00
Steven Allen 423ff0631d fix genesis 2020-11-16 19:04:17 +01:00
Steven Allen 948ee53080 add upgrade height where SDR is required 2020-11-16 19:04:13 +01:00
Łukasz Magiera 4d8327c29a Fix miners with no sectors in node tests 2020-11-16 19:03:30 +01:00
Łukasz Magiera cd0cb1407d update ffi 2020-11-16 19:03:30 +01:00
Łukasz Magiera 915c5e0fdd Get most tests to pass 2020-11-16 19:03:30 +01:00
Łukasz Magiera 2a7e4af5ee Fix lotus-miner/lotus-worker build 2020-11-16 19:03:30 +01:00
Steven Allen 931979809f get lotus building 2020-11-16 19:03:30 +01:00
Steven Allen 584907269a make sector-storage compile 2020-11-16 19:03:30 +01:00
Steven Allen 05db5ce426 load proof types in window post logic
This is going to be inefficient, but it should be fine in practice.
2020-11-16 19:03:30 +01:00
Steven Allen 219c695967 fix storage adapter miner 2020-11-16 19:03:30 +01:00
Steven Allen 4544d2118e fix lotus seed for proof api changes 2020-11-16 19:03:30 +01:00
Steven Allen d7c2c073a3 update specs-storage to fix build 2020-11-16 19:03:30 +01:00
Łukasz Magiera 6bea9dd178 Making sealing logic work with multiple seal proof types 2020-11-16 19:03:30 +01:00
Łukasz Magiera 0a169357f7 docgen 2020-11-16 17:52:55 +01:00
Raúl Kripalani b13a41a44d go mod tidy. 2020-11-16 16:30:17 +00:00
Łukasz Magiera 470538b082 Merge pull request #4770 from filecoin-project/fix/winpost-sset
Don't use terminated sectors for winning PoSt
2020-11-16 17:16:08 +01:00
Raúl Kripalani bac51dd4e3 daemon --import-snapshot: force head silently, without triggering reorg. 2020-11-16 16:03:47 +00:00
Raúl Kripalani d7b4f92f1f add context to ChainStore. 2020-11-16 15:52:19 +00:00
Raúl Kripalani 87d6daf745 fix blockstore double open issue on --import-snapshot.
Fixes https://github.com/filecoin-project/lotus/issues/4850.
2020-11-16 15:21:47 +00:00
Łukasz Magiera 49d3bb9497 Merge pull request #4851 from filecoin-project/fix/daemon-test-mode-restart
Truncate genesis file before generating
2020-11-16 16:13:33 +01:00
Łukasz Magiera d4f6e1ddb4 Merge pull request #4853 from filecoin-project/feat/print-consensus-fault
Print Consensus Faults in miner info
2020-11-16 15:55:37 +01:00
刘林欣 b63687795d break loop when found warm up sector 2020-11-16 17:51:02 +08:00
Aayush Rajasekaran 96d56ec096 Modify vesting schedule post-calico 2020-11-15 19:27:45 -05:00
Aayush Rajasekaran 6d0b3978b9 Merge branch 'master' into release/v1.2.0 2020-11-15 19:03:18 -05:00
Jakub Sztandera afe6c51016 Merge pull request #4813 from filecoin-project/chore/blockstore_nits
Chore/blockstore nits
2020-11-15 19:52:10 +01:00
Jakub Sztandera 09be3f0a01 Merge pull request #4855 from filecoin-project/fix/bitswap-start-panic
chore(dep): update bitswap to fix an initialization race that could panic
2020-11-14 16:50:27 +01:00
Aayush Rajasekaran 6667220a27 Merge pull request #4748 from zgfzgf/fix-chain-decode-params
add chain base64 decode params
2020-11-13 18:54:03 -05:00
Aayush Rajasekaran 1af1ceb1e0 Merge pull request #3646 from filecoin-project/feat/delayed-pubsub-subscribe
delayed pubsub subscribe for messages topic
2020-11-13 17:44:32 -05:00
Steven Allen ae76711ab4 chore(dep): update bitswap to fix an initialization race that could panic
In rare cases, if bitswap receives a message before it finishes starting up, it
could panic. This release fixes that.
2020-11-13 14:11:29 -08:00
Jakub Sztandera fe339d46eb Print Consensus Faults in miner info
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-13 21:21:24 +01:00
vyzo 91e2530e11 remove dtypes dependency from api; move NetBlockList type to api/types.go 2020-11-13 21:11:17 +02:00
Dirk McCormick f9fc601567 fix: truncate genesis file before generating 2020-11-13 17:30:12 +01:00
vyzo 2b68ba5f1d fix command name 2020-11-13 14:43:18 +02:00
vyzo 4b187b85eb close existing connections that match the filters when adding rules to the connection gater 2020-11-13 14:38:13 +02:00
vyzo b8884adaf1 implement connection gating cli 2020-11-13 14:27:44 +02:00
vyzo b71f069854 implement connection gater API 2020-11-13 13:59:38 +02:00
vyzo 5a0b9f4197 connectiong gater API scaffolding 2020-11-13 12:17:48 +02:00
vyzo 4b1d1b6540 connection gater for libp2p host 2020-11-13 11:44:29 +02:00
Aayush Rajasekaran 15fe726e65 Correct CHANGELOG 2020-11-13 04:24:35 -05:00
Aayush Rajasekaran 17c2c0d1c8 Merge pull request #4845 from filecoin-project/asr/changelog
Lotus version 1.1.3
2020-11-13 04:23:21 -05:00
Aayush Rajasekaran 2971dd4317 Lotus version 1.1.3 2020-11-13 04:09:48 -05:00
Łukasz Magiera 6742a74260 Merge pull request #4814 from filecoin-project/feat/rw-close
update libp2p for stream interface changes
2020-11-13 00:23:29 +01:00
Łukasz Magiera 41af94f1b7 Merge pull request #4835 from filecoin-project/feat/fast-pred-wrap
predicates: Fast StateGetActor wrapper
2020-11-13 00:07:27 +01:00
Łukasz Magiera 6bb67f2fe9 Merge pull request #4834 from filecoin-project/feat/sector-gc
miner: Basic storage cleanup command
2020-11-13 00:03:17 +01:00
Łukasz Magiera 961a25298b predicates: Fast StateGetActor wrapper 2020-11-12 23:45:06 +01:00
Steven Allen 5f1737379a update libp2p for stream interface changes 2020-11-12 13:57:19 -08:00
Łukasz Magiera c5c0185943 miner: Basic storage cleanup command 2020-11-12 21:27:16 +01:00
Łukasz Magiera 8fdb9148e4 Merge pull request #4832 from filecoin-project/fix/logging-quieter
drop a few logs down to debug
2020-11-12 20:57:35 +01:00
Łukasz Magiera d3d5f8d7f0 Merge branch 'master' into fix/logging-quieter 2020-11-12 20:45:41 +01:00
Łukasz Magiera 99031bae17 Merge pull request #4709 from filecoin-project/feat/mute-logs
Make some logs quieter
2020-11-12 20:40:10 +01:00
Łukasz Magiera 56373b0d46 Merge pull request #4817 from filecoin-project/feat/docsgen-miner
docsgen: Support miner/worker
2020-11-12 20:31:48 +01:00
whyrusleeping 7921f8d713 drop a few logs down to debug 2020-11-12 11:25:22 -08:00
Łukasz Magiera 6d3e59e047 Merge pull request #4824 from filecoin-project/feat/winpost-warmup
miner: Winning PoSt Warmup
2020-11-12 20:23:07 +01:00
Łukasz Magiera 63f13977ce Make docsgen more deterministic 2020-11-12 20:18:39 +01:00
Łukasz Magiera 408183c7a6 docsgen: Fix CI 2020-11-12 20:15:57 +01:00
Łukasz Magiera 11b041224e fsm: Allow manually resurrecting removed sectors 2020-11-12 19:37:54 +01:00
Łukasz Magiera 36b78b1891 Merge pull request #4831 from filecoin-project/feat/miner-storagelistsectors
miner: Storage list sectors command
2020-11-12 19:26:01 +01:00
Łukasz Magiera a6d061d0f6 Merge pull request #4827 from filecoin-project/fix/startup-migration-crash
Fix: dont crash on startup if funds migration fails
2020-11-12 19:17:21 +01:00
Łukasz Magiera bf547112de miner: Storage list sectors command 2020-11-12 19:11:58 +01:00
Aayush Rajasekaran 5d9c79811f Update to actors v2.3.0
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-12 18:49:11 +01:00
Łukasz Magiera 28ffa8ca06 Merge pull request #4819 from liyue201/master
Delete the duplicate output
2020-11-12 18:13:51 +01:00
Łukasz Magiera 55240b3e07 Merge pull request #4826 from filecoin-project/test/stop-mining
Stop mining at the end of tests
2020-11-12 17:40:13 +01:00
Łukasz Magiera 697a0a3b95 Merge pull request #4825 from filecoin-project/test/fund-mgr-panic
test for FundManager panic to ensure it is fixed
2020-11-12 17:39:30 +01:00
Dirk McCormick 26e12e6f6a fix: dont crash on startup if funds migration fails 2020-11-12 17:15:05 +01:00
Dirk McCormick 0e3e449bf8 test: stop mining at the end of tests 2020-11-12 16:23:46 +01:00
Dirk McCormick f3922e7485 test: for FundManager panic to ensure it is fixed 2020-11-12 15:35:43 +01:00
Łukasz Magiera fb05bb7f07 miner: Winning PoSt Warmup 2020-11-12 15:34:16 +01:00
stirlingx 8246149544 Delete unnecessary output 2020-11-12 18:59:36 +08:00
Łukasz Magiera d525acdeda Merge pull request #4797 from zgfzgf/fix-2k-chain-syn
2k sync BootstrapPeerThreshold
2020-11-12 10:33:04 +01:00
Łukasz Magiera 2f0075752d docsgen: generate miner/worker docs 2020-11-12 10:31:12 +01:00
Łukasz Magiera 8409e155d4 docsgen: Support miner/worker structs 2020-11-12 10:29:42 +01:00
Aayush Rajasekaran 3a3986320c Merge pull request #4804 from filecoin-project/feat/storage-retwait-cleanup
Expand sched-diag; Command to abort sealing calls
2020-11-12 02:11:15 -05:00
Aayush Rajasekaran 498477da04 Nit: ArgsUsage param rename 2020-11-12 02:04:55 -05:00
Peter Rabbitson 29817b6617 Remove all Chain GC wrappings/types
There is no practical way to do GC against the chainstore given the current
state of affairs: remove all GC-related types for the time being.
2020-11-12 06:49:53 +01:00
Peter Rabbitson 7be7a9b5e3 Stop referring to github.com/ipfs/go-ipfs-blockstore outside of lib 2020-11-12 06:01:35 +01:00
Jakub Sztandera a389622ac6 Merge pull request #4811 from filecoin-project/raulk/badger-ctx-tests
badger blockstore: minor improvements
2020-11-12 03:55:31 +01:00
Raúl Kripalani 72547f9ec3 badger tests: fix fd leak. 2020-11-11 23:12:57 +00:00
Raúl Kripalani 04a866121e badger/AllKeysChan(): respect context. 2020-11-11 23:12:16 +00:00
Travis Person f4df58ed0f Merge pull request #4810 from filecoin-project/fix/lotus-stats-flags
lotus-stats: fix influx flags
2020-11-11 14:36:37 -08:00
Aayush Rajasekaran bc7eaee6d3 Merge pull request #4808 from filecoin-project/fix/fund-mgr-panic
Fix panic in FundManager
2020-11-11 16:43:13 -05:00
Travis Person ff7bdb5140 lotus-stats: fix influx flags 2020-11-11 21:17:36 +00:00
Dirk McCormick 6184d228c1 fix: panic in FundManager 2020-11-11 20:32:26 +01:00
Łukasz Magiera 8ac495723e gofmt 2020-11-11 17:42:23 +01:00
Łukasz Magiera 09f9f871a3 Create a command to abort sealing calls 2020-11-11 17:39:12 +01:00
Łukasz Magiera 2a3d930933 Hide ret-done tasks in sealing jobs by default 2020-11-11 16:48:04 +01:00
Łukasz Magiera bd71bf2379 Expand sched-diag 2020-11-11 16:47:44 +01:00
Łukasz Magiera 6f593d53d0 Merge pull request #4795 from liyue201/master
Modify printf format
2020-11-11 16:03:26 +01:00
Łukasz Magiera d1e4211f4b Merge pull request #4803 from filecoin-project/fix/paych-mgr-ctx-cancel-race
Fix race in paych manager when req context is cancelled
2020-11-11 15:58:16 +01:00
Dirk McCormick 9745f676ed fix: race in paych manager when req context is cancelled 2020-11-11 14:40:48 +01:00
Aayush Rajasekaran 90dd39d581 Merge pull request #4787 from filecoin-project/refactor/fund-mgr-integ
refactor: integrate new FundManager
2020-11-11 03:58:59 -05:00
Dirk McCormick 9011e88f9f fix: go mod tidy 2020-11-11 09:45:32 +01:00
Dirk McCormick 0e20a65a0b feat: upgrade markets to v1.0.4 2020-11-11 09:41:27 +01:00
Aayush Rajasekaran 28c4a2d8fa Merge pull request #4798 from filecoin-project/asr/address-update
Update to latest go-address
2020-11-11 03:39:02 -05:00
Dirk McCormick ea810ac806 fix: order of addresses in storage adapter reserve funds 2020-11-11 08:59:14 +01:00
zgfzgf 11ed015dca update BootstrapPeerThreshold = 1 2020-11-11 14:44:35 +08:00
Aayush Rajasekaran 029c516cbc Update to latest go-address 2020-11-11 00:46:02 -05:00
zgfzgf c6b9e4951f add testground BootstrapPeerThreshold 2020-11-11 13:20:59 +08:00
hannahhoward ebd6b0da49 fix(deps): update to tagged go-graphsync 2020-11-10 21:18:29 -08:00
hannahhoward cceb74a66e docs(apidocs): update for new funcs 2020-11-10 21:11:05 -08:00
hannahhoward 9f7204ee26 feat(builder): finish new FundManager setup
Finish setup of new FundManager and provide a migration for previously reserved funds
2020-11-10 21:11:05 -08:00
Dirk McCormick 0d243bb824 refactor: integrate new FundManager 2020-11-10 21:11:05 -08:00
Aayush Rajasekaran e53b0ef068 Merge pull request #4736 from filecoin-project/refactor/fund-mgr
Refactor FundManager
2020-11-10 23:36:56 -05:00
zgfzgf 1301fd6ddb 2k sync BootstrapPeerThreshold 2020-11-11 12:20:31 +08:00
Dirk McCormick 0101436933 fix: flaky TestFundManagerWithdrawalLimit test 2020-11-10 19:44:26 -08:00
Dirk McCormick 0e0ffc9c10 refactor: remove FundManager.Wait 2020-11-10 19:44:26 -08:00
Dirk McCormick a51a62cb42 fix: batch withdrawal requests by wallet 2020-11-10 19:44:26 -08:00
Dirk McCormick 86c204d8a8 refactor: improve FundManager naming and docs 2020-11-10 19:44:26 -08:00
Dirk McCormick 1182927fe5 refactor: add wallet param to FundManager methods 2020-11-10 19:44:26 -08:00
Dirk McCormick 4d3cd7dcb8 refactor: FundManager 2020-11-10 19:44:26 -08:00
stirlingx 8b889139e9 Modify printf format 2020-11-11 10:39:13 +08:00
Aayush Rajasekaran 1323dbddfe Merge pull request #4793 from filecoin-project/asr/bitfield-update
Update to latest go-bitfield
2020-11-10 20:36:08 -05:00
Aayush Rajasekaran c02341c85f Merge pull request #4788 from filecoin-project/feat/client-dealstats
Add client deal-stats CLI
2020-11-10 18:09:58 -05:00
Aayush Rajasekaran 735c04f999 Merge pull request #4681 from filecoin-project/badger-viewable
move to native badger blockstore; leverage zero-copy View() to deserialize in-place
2020-11-10 18:08:12 -05:00
Raúl Kripalani bc6965c86f skip callers in badger log for useful line info. 2020-11-10 22:50:53 +00:00
Aayush Rajasekaran 075297d8ad Update to latest go-bitfield 2020-11-10 17:43:50 -05:00
Raúl Kripalani 8f5847b8e3 fix condition. 2020-11-10 22:34:13 +00:00
Łukasz Magiera ab7ee2f8a9 Merge pull request #4730 from filecoin-project/feat/deal-id-change-in-sector-committed
Handle deal id changes in OnDealSectorCommitted
2020-11-10 22:18:28 +01:00
Łukasz Magiera 18aa97f962 Merge pull request #4779 from filecoin-project/feat/work-track-hostname
storage: Track worker hostnames with work
2020-11-10 20:38:44 +01:00
Łukasz Magiera 2ae0edc4df Merge pull request #4688 from filecoin-project/feat/head-change-coalscer
head change coalescer
2020-11-10 19:40:54 +01:00
Łukasz Magiera 89632416ba Merge pull request #4786 from zgfzgf/fix-sectors-cmd-list
cmd sectors commitIDs len debug
2020-11-10 19:18:17 +01:00
Łukasz Magiera 61fa94617d Merge pull request #4778 from filecoin-project/fix/miner-fixes
Fix scheduler lockups after storage is freed
2020-11-10 19:17:10 +01:00
Raúl Kripalani 659ceaabdd fix comment. 2020-11-10 17:51:11 +00:00
Raúl Kripalani d79ff24014 remove benchmark. 2020-11-10 17:50:21 +00:00
Łukasz Magiera 1df7318450 Merge pull request #4785 from strahe/fix/fast-connect-bootstrappers
async connect to bootstrappers
2020-11-10 17:45:06 +01:00
Łukasz Magiera 60debfb0a6 Add client deal-stats CLI 2020-11-10 17:33:05 +01:00
Raúl Kripalani 379dd02fb6 upgrade dependencies. 2020-11-10 16:32:23 +00:00
Raúl Kripalani 339391ecfb Revert "(to be reverted) add debug.PrintStack."
This reverts commit f8c3756ac0.
2020-11-10 16:08:41 +00:00
Raúl Kripalani 38c404e04e vm: construct CBOR store properly. 2020-11-10 15:49:33 +00:00
Raúl Kripalani f8c3756ac0 (to be reverted) add debug.PrintStack. 2020-11-10 15:22:17 +00:00
Raúl Kripalani 360194b29b fix comment. 2020-11-10 15:02:55 +00:00
Raúl Kripalani af7236f7e7 migrate direct usages blockstore.{Get=>View}. 2020-11-10 13:35:36 +00:00
Raúl Kripalani 6d78de95a1 remove unused and misleading cachebs store. 2020-11-10 13:34:56 +00:00
Raúl Kripalani 577476b8fe import Viewable non-terminal blockstores. 2020-11-10 13:16:24 +00:00
Raúl Kripalani 54bf7c99d7 add the viewable trait to our gazillion blockstores. 2020-11-10 12:40:32 +00:00
少爷 e340996919 delete new context 2020-11-10 17:40:48 +08:00
zgfzgf f5401317c9 cmd sectors commitIDs len 2020-11-10 17:37:36 +08:00
少爷 de2637b4fa async connect to bootstrappers 2020-11-10 17:23:46 +08:00
hannahhoward ea726c9f17 feat(markets): update to 1.0.1
update to tagged 1.0.1 release & also fix lint error
2020-11-09 20:02:02 -08:00
hannahhoward 314dda08e8 fix(markets): correct deal equality check
correct comparison of deal equality (a strict == is not enough)
2020-11-09 19:23:58 -08:00
hannahhoward b010ac21d3 style(lint): fix lint issues 2020-11-09 18:48:28 -08:00
hannahhoward 7519bdde42 feat(markets): check deal equality
in OnDealSectorCommitted, verify that deals looked up match the deal proposals which were made
2020-11-09 18:48:28 -08:00
hannahhoward 09a0d6e607 style(lint): fix lint issues 2020-11-09 18:48:28 -08:00
hannahhoward a3e93554e5 refactor(markets): refactor OnDealSectorCommitted
extract OnDealSectorCommitted from adapters and test
2020-11-09 18:48:28 -08:00
hannahhoward d2acc78787 feat(markets): handle deal ID changes
make OnDealSectorCommitted handle changes to deal ids
2020-11-09 18:48:28 -08:00
Lucas Molas 3ec25cbece restrict parse fil string length (#4780) 2020-11-09 22:12:32 -03:00
Łukasz Magiera 5caa277261 storage: Track abandoned work more correctly 2020-11-09 23:38:20 +01:00
Łukasz Magiera f819e71d12 storage: Separate returned jobs in jobs cli 2020-11-09 23:13:29 +01:00
Łukasz Magiera 27a9dd3bbb storage: Track worker hostnames with work 2020-11-09 23:09:04 +01:00
Łukasz Magiera 5b8f555221 sched: Update after tasks finish preparing 2020-11-09 21:44:28 +01:00
Łukasz Magiera fbc05fa5a8 stores: Report storage changes quickly 2020-11-09 21:43:52 +01:00
Łukasz Magiera 95d9084899 Merge pull request #4765 from zgfzgf/feat-sealing-garbage
optimize pledge sector
2020-11-09 21:06:33 +01:00
Łukasz Magiera f31383516e Merge pull request #4769 from zgfzgf/feat-storage-work-returntype
optimize code replace strings with constants
2020-11-09 21:05:23 +01:00
Łukasz Magiera 82e88a3239 Merge pull request #4775 from filecoin-project/fix/pond
Make pond work again
2020-11-09 21:03:58 +01:00
Łukasz Magiera 3a3270b37c nv7 upgrade: Don't use terminated sectors for winning PoSt 2020-11-09 18:52:10 +01:00
Łukasz Magiera 290414e935 wallet: Don't return null from WalletList 2020-11-09 18:42:43 +01:00
Łukasz Magiera e1122404d1 pond: Fix MpoolPushMessage call 2020-11-09 18:42:22 +01:00
vyzo 185653f85a improve coalescing 2020-11-09 13:35:42 +02:00
Łukasz Magiera 72a3b41315 Merge pull request #4764 from filecoin-project/asr/specs-update
Update to actors v2.3.0
2020-11-09 10:27:30 +01:00
zgfzgf 5bcc6339b4 optimize code replace strings with constants 2020-11-09 16:21:16 +08:00
zgfzgf 8c8396af59 print multiple blocks from miner 2020-11-09 10:57:36 +08:00
Aayush Rajasekaran 7b8158b1af Update to actors v2.3.0 2020-11-08 16:00:22 -05:00
zgfzgf 3665f90795 optimize pledge sector 2020-11-08 16:24:50 +08:00
Whyrusleeping f225b7b928 Merge pull request #4758 from filecoin-project/steb/update-yamux
update yamux
2020-11-06 13:34:11 -08:00
Steven Allen 4a3ff8ff9e update yamux
This new release:

* Ensures we send window updates on-time to avoid sawtooth bandwidth utilization.
* Limits the number of outgoing pings to 1 (no need to send any more at a time).
* Limits the number of buffered pongs to 32 (there should never be more than 1,
  maybe 2, at a time).
* Fast-tracks outgoing pings so they don't get stuck behind large queued writes.
2020-11-06 12:51:50 -08:00
vyzo 378d7a1ad9 stupid linter 2020-11-06 22:26:47 +02:00
vyzo 9a76c648f1 unit test for head change coalescer 2020-11-06 22:26:47 +02:00
vyzo 6660f81363 minimize coalesce delay for tests 2020-11-06 22:26:47 +02:00
vyzo 84c9d1dbb7 hook head change coalescer to mpool 2020-11-06 22:26:24 +02:00
vyzo 08aab1c48a make Close satisfy io.Closer 2020-11-06 22:26:24 +02:00
vyzo 9149ae2164 godoc and final dispatch when closing the coalescer 2020-11-06 22:26:24 +02:00
vyzo ec13c5f80d coalesce both reverts and applys in the same manner 2020-11-06 22:26:24 +02:00
vyzo 4058f5642f head change coalescer 2020-11-06 22:26:24 +02:00
Łukasz Magiera 48bdf79b5b Merge pull request #4756 from filecoin-project/feat/upgr-bitfield
Update go-bitfield
2020-11-06 21:18:47 +01:00
Anton Evangelatov bf500711b3 update Dockerfiles; integrate lotus-soup and graphsync in Lotus CI; update go.mod and references 2020-11-06 21:04:11 +01:00
Anton Evangelatov f7f5a27ebf remove oni submodule 2020-11-06 21:03:56 +01:00
Anton Evangelatov 1f678c17d3 merge filecoin-project/oni subtree in testplans/ 2020-11-06 21:02:06 +01:00
Jakub Sztandera 5a34e5b2bf Merge pull request #4599 from filecoin-project/feat/sync-manager-redux
rewrite sync manager
2020-11-06 21:01:26 +01:00
Raúl Kripalani 3577300aee Merge branch 'master' into badger-viewable 2020-11-06 19:34:25 +00:00
Jakub Sztandera 258cc0067b Update go-bitfield v0.2.2
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-06 20:16:05 +01:00
Raúl Kripalani 0b2a02c8ea remove redundant import. 2020-11-06 18:57:04 +00:00
Raúl Kripalani 7c442e1a98 godocs. 2020-11-06 18:55:13 +00:00
Raúl Kripalani 85e37e4b70 make the value log loading mode mmap, to leverage zero-copy access. 2020-11-06 18:39:08 +00:00
Raúl Kripalani de4a0725f3 rename files. 2020-11-06 18:32:44 +00:00
Łukasz Magiera 426c2e8c2b Merge pull request #4717 from filecoin-project/feat/optional-chain-bitswap
Optional chain Bitswap
2020-11-06 16:49:39 +01:00
Łukasz Magiera db1159414f Merge pull request #4734 from filecoin-project/asr/devnet-kumquat
Run kumquat upgrade on devnets
2020-11-06 16:48:29 +01:00
Łukasz Magiera 6bb8521a55 Merge pull request #4719 from filecoin-project/frrist/msig-diffing
polish: add msig pendingtxn diffing and comp
2020-11-06 16:47:29 +01:00
Łukasz Magiera 3c9e438a68 Merge pull request #4617 from filecoin-project/termination-penalty
Add `termination-estimate` to get an estimation for how much a termination penalty will be
2020-11-06 16:44:44 +01:00
Łukasz Magiera 2f9d19c42c Merge pull request #4726 from filecoin-project/feat/shed-id-cid
shed: Util for creating ID CIDs
2020-11-06 16:03:45 +01:00
Łukasz Magiera ee9df63221 shed: Util for creating ID CIDs 2020-11-06 15:42:09 +01:00
Łukasz Magiera 2076abf0c1 Merge pull request #4745 from filcloud/reward-data-type
match data type for reward state api
2020-11-06 15:29:38 +01:00
Łukasz Magiera 273da38bdd Merge pull request #4739 from filecoin-project/feat/gas-estim-limit-ts
Use TSK passed to GasEstimateGasLimit
2020-11-06 11:59:55 +01:00
zgfzgf d98e989417 chain decode params encoding 2020-11-06 15:02:08 +08:00
zgfzgf 7f47bf452a add chain base64 decode params 2020-11-06 13:36:24 +08:00
Frank a3f5d0f590 match data type for reward state api 2020-11-06 11:06:57 +08:00
Jakub Sztandera 94438bf3cd Use TSK passed to GasEstimateGasLimit
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-05 21:14:38 +01:00
Travis Person df7f13d069 Merge pull request #4718 from filecoin-project/feat/stats-update
Update lotus-stats with a richer cli
2020-11-05 11:55:31 -08:00
Raúl Kripalani 8befc0c1f5 export metrics from bench. 2020-11-05 19:09:47 +00:00
vyzo dab20efc99 add env var controlling msgs sync epochs 2020-11-05 18:09:04 +02:00
vyzo 0e40a04975 nicer check using Time objects 2020-11-05 18:08:52 +02:00
vyzo c6cd699f0d fix nearsync check 2020-11-05 18:08:35 +02:00
vyzo 3306bdec29 fix tests 2020-11-05 18:08:13 +02:00
vyzo 32b7797394 only subscribe to messages topic if we are synced within 10 epochs 2020-11-05 18:08:13 +02:00
Raúl Kripalani b1aa43741a remove file that sneaked in. 2020-11-05 13:34:41 +00:00
Jakub Sztandera c966054bf6 Merge pull request #4728 from filecoin-project/feat/storage-gas-multi-conf
Move gas multiplier as property of pricelist
2020-11-05 13:41:44 +01:00
Aayush Rajasekaran 105f0fd49a Run kumquat upgrade on devnets 2020-11-05 04:21:03 -05:00
Jakub Sztandera fe95d19e29 Move gas multiplier as property of pricelist
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-04 20:13:17 +01:00
Jakub Sztandera 2a294f048a Merge pull request #4713 from filecoin-project/fix/gitmodules
Fix .gitmodules
2020-11-04 19:58:37 +01:00
Travis Person bd4322f56f Update lotus-stats with a richer cli
This updates lotus stats to use urfave instead of the golang flags
package. This brings with it some common features from other lotus tools
such as the use of the `FULLNODE_API_INFO` env and other parts of the
lotus cli package.

This also includes the latest dashboard.
2020-11-04 18:06:17 +00:00
Raúl Kripalani a411342f0c export more metrics. 2020-11-04 17:09:01 +00:00
Raúl Kripalani 370ef93db6 chainstore: new ForceHeadSilent to support benchmarks. 2020-11-04 14:39:01 +00:00
frrist 7d540fc0d8 polish: add msig pendingtxn diffing and comp 2020-11-03 17:25:53 -08:00
Raúl Kripalani fd1439f284 fix lint. 2020-11-03 22:49:55 +00:00
Łukasz Magiera a1e1b03ca4 Optionally allow bitswap for chainstore 2020-11-03 23:44:44 +01:00
Raúl Kripalani 87ce2f774d lotus-bench: write separate profiles for import and validation. 2020-11-03 22:40:21 +00:00
Łukasz Magiera 9deda06ec6 Merge pull request #4710 from filecoin-project/feat/https-gh-blst
Use https for blst submodule
2020-11-03 23:05:42 +01:00
Łukasz Magiera b0824ada15 bufbs: Get from write blockstore first 2020-11-03 23:02:01 +01:00
Raúl Kripalani 5487356370 fix lint errors. 2020-11-03 21:23:41 +00:00
Jakub Sztandera 97a06444f2 Fix .gitmodules
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-03 20:21:55 +01:00
Raúl Kripalani 809111336a Merge branch 'master' into badger-viewable 2020-11-03 18:29:10 +00:00
Raúl Kripalani 18418128c3 lotus-bench: make start tipset walkback start from end tipset. 2020-11-03 18:15:59 +00:00
Raúl Kripalani 581ac5b019 lotus-bench: add ability to specify tipsets. 2020-11-03 18:11:43 +00:00
Łukasz Magiera cde0e58e39 Check (pre)commit receipt before other checks in failed states 2020-11-03 18:47:29 +01:00
Raúl Kripalani 842c8ca056 improve lotus-bench; support running validation on a store without a CAR. 2020-11-03 17:35:31 +00:00
Łukasz Magiera fe4298674f Use https for blst submodule 2020-11-03 15:51:33 +01:00
zgfzgf 3e7efad0fd modify lint error 2020-11-03 21:28:01 +08:00
Łukasz Magiera 9270ac6358 Make some logs quieter 2020-11-03 13:28:41 +01:00
Łukasz Magiera d421274dcd Merge pull request #4619 from filecoin-project/feat/fix-memory-leaks-data-transfer
Fix memory leaks in data transfer
2020-11-03 13:06:09 +01:00
zgfzgf 3c2cd506ec modify merge lotus-bench 2020-11-03 19:56:04 +08:00
Łukasz Magiera 1df02d5a93 Merge pull request #4691 from filecoin-project/fix/metrics
fix metrics wiring.
2020-11-03 11:50:43 +01:00
Łukasz Magiera fdd90e036f Merge pull request #4697 from filecoin-project/asr/rename-builtins
Rename builtin actor generators
2020-11-03 11:47:55 +01:00
Łukasz Magiera 761c9ee2b6 Merge pull request #4699 from blockchain-lib/master
struct name incorrect
2020-11-03 11:47:18 +01:00
Łukasz Magiera c215615da3 Merge pull request #4704 from zgfzgf/fix-runtime-gas-print
modify runtime gasUsed printf
2020-11-03 11:46:26 +01:00
Łukasz Magiera b7b6252048 Merge pull request #4705 from filecoin-project/asr/delete-default
Correctly delete the default wallet address
2020-11-03 11:44:25 +01:00
Łukasz Magiera 6d27531663 Merge pull request #4630 from filecoin-project/feat/new-blst
feat: integrate new optional blst backend and verification optimizations from proofs
2020-11-03 11:43:12 +01:00
Łukasz Magiera 3c44407c57 circle: Fix lotus-soup build 2020-11-03 11:29:54 +01:00
Łukasz Magiera bfa04da572 Merge pull request #4692 from filecoin-project/feat/shed-rpc
sched: Interactive RPC Shell
2020-11-03 11:24:05 +01:00
Łukasz Magiera e547710c6d Merge pull request #4696 from filecoin-project/feat/optim-heaviest-sync
Call GetHeaviestTipSet() only once when syncing
2020-11-03 11:23:23 +01:00
dignifiedquire 5c3055219c update filecoin-ffi to master 2020-11-03 11:02:58 +01:00
Aayush Rajasekaran 46619fbb8d Correctly delete the default wallet address 2020-11-03 03:00:18 -05:00
zgfzgf 4d9c90ed4a modify runtime gasUsed printf 2020-11-03 15:46:35 +08:00
hannahhoward af1743f9f3 fix(datatransfer): update with memory leak fixes 2020-11-02 17:25:02 -08:00
stirlingx b5d2f01993 Update selector_task.go 2020-11-03 09:20:48 +08:00
Aayush Rajasekaran af8cc3d29f Rename builtin actor generators 2020-11-02 18:42:30 -05:00
Jakub Sztandera e68f69b63b Call GetHeaviestTipSet() only once when syncing
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-11-02 22:56:26 +01:00
Łukasz Magiera a4cf6fa715 sched: Interactive RPC Shell 2020-11-02 20:38:15 +01:00
Raúl Kripalani 656ece06e5 fix metrics wiring.
Some components like go-ds-measure, go-ipfs-blockstore and go-bitswap
expose metrics via ipfs/go-metrics-interface, but Lotus never injects
the Prometheus exporter (ipfs/go-metrics-prometheus). Therefore, those
metrics never surface in instrumentation.

Instead, Lotus uses OpenCensus directly.

This commit injects the Prometheus exporter for go-metrics-interface, and
instructs the OpenCensus Prometheus exporter to use the DefaultRegistry.

This has the effect of exposing blending the metrics of both metrics
libraries.

With this patch, the datastore, cache utilisation, and bitswap metrics
are now exported via the /debug/metrics endpoint.

This commit also fixes an issue where the metrics scope was empty, making
go-metrics-interface default to "<no-scope>". Angle brackets are inadmissible
characters for Prometheus, so it was refusing to export the affected metrics.
(These were the ARC cache metrics.)
2020-11-02 17:56:49 +00:00
dignifiedquire 1d17d61dbc update filecoin-ffi 2020-11-02 17:05:52 +01:00
dignifiedquire d457b7a5e3 update filecoin-ffi 2020-11-02 17:05:52 +01:00
dignifiedquire 398a831701 update blst and filecoin-ffi 2020-11-02 17:05:52 +01:00
dignifiedquire 61fa03b1ad use supranation/blst@0.2.0 directly 2020-11-02 17:05:52 +01:00
dignifiedquire 56980ffc1f remove extern/fil-blst 2020-11-02 17:05:52 +01:00
Raúl Kripalani d1ebf3c769 introduce non-pooled StorageKey method. 2020-11-02 13:32:07 +00:00
Raúl Kripalani 7facdf63c9 support legacy keying: base32 multihashes *sigh*. 2020-11-02 12:55:56 +00:00
Raúl Kripalani f4e13ffd80 actually register prometheus gauge. 2020-11-01 20:01:57 +00:00
Raúl Kripalani 44e34d9606 lotus-bench: native badger SyncWrites=false. 2020-11-01 19:54:47 +00:00
Raúl Kripalani 35ccd73a86 lotus-bench: improve for observability. 2020-11-01 19:52:53 +00:00
Raúl Kripalani aece624d1c lotus-bench: add support for native badger blockstore. 2020-11-01 18:54:35 +00:00
Raúl Kripalani c2355b18f9 write heap and allocs profile in lotus-bench. 2020-11-01 18:00:08 +00:00
Raúl Kripalani 634467d24b go mod tidy. 2020-11-01 17:38:38 +00:00
Raúl Kripalani 0b8a21ee16 badger: restore prev. max table size (64MiB; default). 2020-11-01 17:26:37 +00:00
Raúl Kripalani 72e573d98d fix lint. 2020-11-01 17:09:14 +00:00
Raúl Kripalani 5a98660d1b make repo.Blockstore() idempotent; wrap in IDStore. 2020-11-01 16:56:20 +00:00
Raúl Kripalani d8d85373f5 fix lotus-shed datastore commands. 2020-11-01 13:50:41 +00:00
Raúl Kripalani a16d7f221e Merge branch 'master' into badger-viewable 2020-11-01 13:10:56 +00:00
Raúl Kripalani 95f512aa69 update/add dependencies. 2020-11-01 13:05:07 +00:00
Raúl Kripalani 099c4b5e1d migrate repo.Datastore(/chain) to repo.Blockstore(). 2020-11-01 13:03:21 +00:00
Raúl Kripalani 9437136f84 fixup. 2020-11-01 13:01:38 +00:00
Raúl Kripalani d2e2322fd2 make the lotus node use the new native badger blockstore. 2020-11-01 13:01:26 +00:00
Raúl Kripalani ce27b13076 add a native badger blockstore with View() method. 2020-11-01 12:55:49 +00:00
Łukasz Magiera a5c05f87f1 Merge pull request #4105 from filecoin-project/asr/decode-params
Add a StateDecodeParams method
2020-10-31 01:05:50 +01:00
Łukasz Magiera 7cba0b25fd Merge pull request #4618 from filecoin-project/4360
Add miner available balance and power info to state minor info
2020-10-31 01:03:39 +01:00
Łukasz Magiera 978192233d Merge pull request #4498 from filecoin-project/feat/try-election
Add election run-dummy command
2020-10-31 01:02:25 +01:00
Łukasz Magiera c6a8efff7d Merge pull request #4623 from filecoin-project/feat/cache-deal-state-matcher
Cache deal states for most recent old/new tipset
2020-10-31 01:00:11 +01:00
Łukasz Magiera 0f8dadadf5 Merge pull request #4664 from filecoin-project/refactor/events-api-call-matcher
Simplify chain event Called API
2020-10-31 00:48:45 +01:00
Łukasz Magiera 862c5b61a4 Merge pull request #4628 from filecoin-project/frrist/power-claims-changed
polish: add ClaimsChanged and DiffClaims method to power shim
2020-10-31 00:30:03 +01:00
Łukasz Magiera 6fcdf3c7ed Merge pull request #4615 from filecoin-project/feat/worker-pause
worker: Commands to pause/resume task processing
2020-10-31 00:26:37 +01:00
Łukasz Magiera 8eae921cbf Merge pull request #4633 from filecoin-project/steb/rick-roll
keep retrying the proof until we run out of sectors to skip
2020-10-31 00:15:04 +01:00
Łukasz Magiera 5a7863d21a Merge pull request #4626 from filecoin-project/fix/drand-peerid-loop
bootstrap: don't return early when one drand resolution fails
2020-10-30 23:53:11 +01:00
Steven Allen 077bc83f7f explicitly abort PoSt on context cancellation 2020-10-30 14:00:54 -07:00
Jakub Sztandera 22742a9ba0 bootstrap: don't return early when one drand resolution fails
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-30 21:58:17 +01:00
Łukasz Magiera 3b16faddad Merge pull request #4652 from filecoin-project/feat/default-max-fee-cfg
Config for default max gas fee
2020-10-30 21:35:10 +01:00
Łukasz Magiera 094ea3fe97 Merge pull request #4666 from filecoin-project/fix/sched-issues
Fix worker reenabling, handle multiple restarts in worker
2020-10-30 21:34:07 +01:00
Steven Allen 6985af5e88 keep retrying the proof until we run out of sectors to skip
If we have a bunch of corrupted but not missing sectors on disk, we may need to
retry many times before we get a proof to pass. Simply giving up doesn't help anyone.
2020-10-30 13:21:34 -07:00
Łukasz Magiera 6cdbf5216e Merge pull request #4629 from filecoin-project/fix/badger-lsm-trsh
Reduce badger ValueTreshold to 128
2020-10-30 21:10:18 +01:00
Łukasz Magiera f380d6be43 Merge pull request #4651 from filecoin-project/feat/prep-for-gasb
Prep for gas balancing
2020-10-30 20:18:03 +01:00
Łukasz Magiera fb492d9acb Merge pull request #4662 from filecoin-project/feat/force-sched-cli
Debug flag to force running sealing scheduler
2020-10-30 20:15:49 +01:00
Łukasz Magiera a7ff906e17 Merge pull request #4669 from filecoin-project/feat/minerinfo-sync
Add sync status to miner info command
2020-10-30 20:15:01 +01:00
Łukasz Magiera 696a6867dd Merge pull request #4668 from filecoin-project/fix/mpool-pricing
Fix messagepool accounting
2020-10-30 20:14:33 +01:00
vyzo 12f6119739 don't include messages that drop the balance below zero 2020-10-30 20:56:33 +02:00
Łukasz Magiera 885c6c94d3 Add sync status to miner info command 2020-10-30 19:39:31 +01:00
Jakub Sztandera 8afceee7a9 Fix messagepool accounting
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-30 19:21:25 +01:00
vyzo d6e2c80608 if noone is working pick the last worker in sync wait 2020-10-30 19:45:59 +02:00
jennijuju 2f4582147a Add termination-estimate to get an estimation for how much a termination penalty will be:
- Usage example: `./lotus-shed sectors termation-estimate 5 8 10`.
2020-10-30 13:34:03 -04:00
Łukasz Magiera 69e44ebf07 sched: re-register worker windows after re-enabling correctly 2020-10-30 18:32:59 +01:00
Łukasz Magiera f90a387f96 sched: Print worker UUIDs in shed-diag correctly 2020-10-30 18:32:16 +01:00
vyzo 5dcf339840 fix sync wait cli 2020-10-30 19:28:32 +02:00
Łukasz Magiera 774e2ecebf sched: Fix worker reenabling 2020-10-30 18:01:37 +01:00
Łukasz Magiera af1d45d969 worker: Handle multiple manager restarts while waiting for tasks 2020-10-30 18:00:48 +01:00
Dirk McCormick 79a8ff04fd refactor: simplify chain event Called API 2020-10-30 14:00:32 +01:00
Łukasz Magiera 7fbb868513 Debug flag to force running sealing scheduler 2020-10-30 11:07:35 +01:00
vyzo f6ecff0e26 check recent syncs in selectSyncTarget/selectDeferredSyncTarget 2020-10-30 07:50:26 +02:00
Aayush Rajasekaran 5ff42505e8 Add a StateDecodeParams method 2020-10-29 22:04:33 -04:00
Łukasz Magiera c3d00b0ac6 Merge pull request #4650 from jsign/jsign/offlinemode
make IPFS online mode configurable
2020-10-29 22:24:58 +01:00
Jakub Sztandera 87f2719195 Complete mask command
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-29 20:58:09 +01:00
Łukasz Magiera ae7889f830 Config for default max gas fee 2020-10-29 20:50:11 +01:00
Jakub Sztandera d8d9291402 Prep for gas balancing
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-29 20:34:48 +01:00
Łukasz Magiera 7d02cd6679 Merge pull request #4649 from filecoin-project/feat/sectorslist-utils
miner sectors list: flags for events/seal time
2020-10-29 19:55:16 +01:00
Ignacio Hagopian 7d0f279353 make IPFS online mode configurable
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2020-10-29 15:16:45 -03:00
Łukasz Magiera ad9a5acb7f miner sectors list: flags for events/seal time 2020-10-29 19:10:20 +01:00
vyzo 8d25fd39cf set BootstrapPeerThreshold to 1 for tests 2020-10-29 19:32:09 +02:00
Łukasz Magiera ee814fb48e Merge pull request #4643 from filecoin-project/fix/fsm-ticket-loop
storagefsm: Fix GetTicket loop when the sector is already precommitted
2020-10-29 18:25:14 +01:00
vyzo 57234d8ef3 fix spelling in comment to satisfy linter
this is ridiculous; since when do linters apply spellchecking on comments???
2020-10-29 19:13:45 +02:00
vyzo 47830efbf5 set BootstrapPeerThreshold to 4, add env variable to override 2020-10-29 19:08:58 +02:00
Łukasz Magiera dc5d6316c9 Merge pull request #4645 from filecoin-project/fix/miner-restart-edgecase
sectorstorage: Fix manager restart edge-case
2020-10-29 18:07:18 +01:00
vyzo a650641813 transition out of initial sync only if sync finishes within 15min 2020-10-29 17:27:13 +02:00
vyzo 8702ff8b7e rename initialSync to initialSyncDone 2020-10-29 17:12:47 +02:00
Łukasz Magiera c6b03ce62b sectorstorage: Missing unlock in waitWork 2020-10-29 15:18:51 +01:00
Łukasz Magiera ea5bb5cdab sectorstorage: Fix manager restart edge-case 2020-10-29 12:14:21 +01:00
Łukasz Magiera e168f7a917 cli: miner-info review 2020-10-29 10:33:08 +01:00
Łukasz Magiera 33459f1b36 storagefsm: Fix GetTicket loop when the sector is already precommitted 2020-10-29 10:26:02 +01:00
Łukasz Magiera f0f75e2d2c Merge pull request #4627 from karalabe/fix-gpu-usage-tracking
extern/sector-storage: fix GPU usage overwrite bug
2020-10-29 10:13:54 +01:00
vyzo a26420f6e8 add missing return for deferrals during initial sync 2020-10-29 09:40:41 +02:00
whyrusleeping 77ec7caaad WIP: add a command for compacting sector numbers bitfield 2020-10-29 00:18:10 -07:00
Jakub Sztandera ae905bd056 Fix closing
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-29 01:05:31 +01:00
frrist 7b8dae92d9 feat: add power actor claim diff method 2020-10-28 16:52:52 -07:00
jennijuju c80e8cb7d3 Add miner available balance and power info to state minor info 2020-10-28 19:04:03 -04:00
Jakub Sztandera a2c66dd102 make linter happy
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-28 23:30:28 +01:00
Jakub Sztandera 0297be4b9a Add lotus-shed datastore rewrite command
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-28 23:24:45 +01:00
Jakub Sztandera ecc1d94b3a Reduce badger ValueTreshold to 128
It should significntly size of the LSM index, and thus increase the
performance with bigger datastores

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-28 22:17:01 +01:00
Łukasz Magiera 553408d573 worker: Commands to pause/resume task processing 2020-10-28 22:10:17 +01:00
frrist e33cc5ee12 polish: add ClaimsChanged method to power shim 2020-10-28 13:56:02 -07:00
Łukasz Magiera 32ea060e99 Merge pull request #3618 from filecoin-project/feat/async-restartable-workers
Track sealing processes across lotus-miner restarts
2020-10-28 21:55:45 +01:00
Jakub Sztandera ad905fc310 Expose WorkerID
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-28 20:22:07 +01:00
Péter Szilágyi 5f657b4333 extern/sector-storage: fix GPU usage overwrite bug 2020-10-28 20:52:33 +02:00
Łukasz Magiera 704bef5dfc Merge pull request #4613 from filecoin-project/feat/proofs-5.2.3-1
Update FFI
2020-10-28 17:37:22 +01:00
Dirk McCormick f79652c28c feat: cache deal states for most recent old/new tipset 2020-10-28 16:55:48 +01:00
Jakub Sztandera e575b5fe8a Add error if weights are the same
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-28 16:53:13 +01:00
Łukasz Magiera da7ecc1527 Fix flaky sealing manager tests 2020-10-28 16:15:17 +01:00
Łukasz Magiera 86f9abda0d circle: Install hwloc 2020-10-28 15:46:57 +01:00
Łukasz Magiera 4475b9ac05 Use filecoin-ffi master 2020-10-28 15:31:15 +01:00
Łukasz Magiera 4100f6eead fix TestWDPostDoPost 2020-10-28 15:23:21 +01:00
Łukasz Magiera ed2f81da2f sched: Fix tests 2020-10-28 14:34:28 +01:00
Łukasz Magiera 4cf00b8b42 worker_local: address review 2020-10-28 14:29:17 +01:00
Łukasz Magiera 96c5ff7e7f sched: use more letters for variables 2020-10-28 14:23:38 +01:00
Łukasz Magiera 8731fe9112 sched: split worker handling into more funcs 2020-10-28 14:14:50 +01:00
Łukasz Magiera 84b567c790 sched: move worker funcs to a separate file 2020-10-28 13:39:28 +01:00
vyzo ba2512655e track last few worker states for debug purposes 2020-10-28 14:08:06 +02:00
vyzo 6266bae1d3 log worker spawning from initial sync deferrals 2020-10-28 11:44:16 +02:00
vyzo 188d1649d3 stop the ticker when done with it 2020-10-28 11:41:40 +02:00
vyzo 9ddf7bbd15 better handling of initial sync 2020-10-28 11:36:34 +02:00
vyzo 469666de82 limit max active sync workers 2020-10-28 10:33:22 +02:00
vyzo fc1ac3e752 simplify circular buffer code
we don't care about order of checks!
2020-10-28 00:02:08 +02:00
vyzo ab7a66b90d track recently synced tipsets to avoid unnecessary worker spawning 2020-10-27 23:48:31 +02:00
Jakub Sztandera 2b82e5a118 Fix tipset coalescing in case of repeated blocks
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-27 21:23:16 +01:00
Jakub Sztandera 16d2cb6309 Add flag to coalesce Tipsets in pending queue
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-27 18:00:34 +01:00
Łukasz Magiera 413643a712 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-27 16:56:29 +01:00
Łukasz Magiera 843c0719e0 Update FFI 2020-10-27 15:37:11 +01:00
Łukasz Magiera 3d02dba5dc Merge pull request #4609 from filecoin-project/fix/flaky-testMiningReal
Fix flaky testMiningReal
2020-10-27 14:27:52 +01:00
Łukasz Magiera efc8d90bc1 Fix flaky testMiningReal 2020-10-27 12:19:12 +01:00
Łukasz Magiera 1db69acbc0 Merge pull request #4608 from filecoin-project/fix/flaky-TestCLIDealFlow
Fix flaky TestCLIDealFlow
2020-10-27 12:07:02 +01:00
Dirk McCormick c0f6f834b7 fix: flaky TestCLIDealFlow 2020-10-27 11:07:54 +01:00
Łukasz Magiera 8c60069bb8 Merge pull request #4535 from filecoin-project/feat/clientdeal-cache-commd
client deal: Cache CommD when creating multiple deals
2020-10-27 03:58:25 +01:00
Łukasz Magiera e1da874258 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-27 03:31:07 +01:00
Łukasz Magiera 616e0e8eb5 Merge pull request #4569 from filecoin-project/feat/client-deal-size-cli
Expose ClientDealSize via CLI
2020-10-27 03:28:31 +01:00
Steven Allen 89f6da14bc Merge pull request #4513 from filecoin-project/steb/feat-change-worker-key
Add commands to change the worker key
2020-10-26 18:41:04 -07:00
Steven Allen 832c0998e4 validate that block propagation works after a worker key change 2020-10-26 18:16:25 -07:00
Steven Allen 0d06f8fa2b Add commands to change the worker key 2020-10-26 18:16:24 -07:00
Whyrusleeping 2b6bc7d59a Merge pull request #4604 from filecoin-project/frrist/miner-shim-info-equal
polish: add Equals method to MinerInfo shim
2020-10-26 17:54:30 -07:00
frrist 0d384050fa polish: add Equals method to MinerInfo shim 2020-10-26 14:45:02 -07:00
Ingar Shu 8141f7b6a6 Expose ClientDealSize API via client stat CLI 2020-10-26 11:28:01 -07:00
Jakub Sztandera cced3bf9ee Randomize seed
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-26 17:44:55 +01:00
Jakub Sztandera ea6afe84db Add election run-dummy command
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-26 17:44:51 +01:00
Łukasz Magiera 382dcf9a37 Merge pull request #4600 from filecoin-project/fix/sector-list-less-sracy
Make EarlyExpiration in sectors list less scary
2020-10-26 16:17:20 +01:00
Łukasz Magiera 8923524f6a Make EarlyExpiration in sectors list less scary 2020-10-26 15:33:15 +01:00
Łukasz Magiera 31a474a1ca Move CommPWriter to lib/ 2020-10-26 15:16:28 +01:00
Łukasz Magiera 1afd3a41cb Merge pull request #4595 from GFZRZK/GFZRZK/bugfix/fix_workerkey_error_in_wdpost_setsender
worker key should change when set sender found key not equal with the value on chain
2020-10-26 14:55:48 +01:00
Łukasz Magiera 5a6195feb6 Merge pull request #4598 from filecoin-project/refactor/paych-cli-test
refactor: share code between CLI tests
2020-10-26 14:51:03 +01:00
vyzo 2fd0d430c8 set BootstrapPeerThreshold to 1, to mimic old code
which incidentally fixes tests
2020-10-26 15:49:24 +02:00
vyzo f055681972 fix test 2020-10-26 15:43:22 +02:00
Dirk McCormick 1fefcc2b46 refactor: simplify cli test RunCmd 2020-10-26 14:26:46 +01:00
vyzo c0a039ee11 fix logging 2020-10-26 15:19:09 +02:00
Łukasz Magiera 09f1d00733 Merge pull request #4533 from filecoin-project/msig-inspect-jen
Updated msig inspect:
2020-10-26 14:11:21 +01:00
vyzo f26385d0c6 use weight as the sync target selector 2020-10-26 14:51:26 +02:00
Dirk McCormick b097a5fb0c refactor: share code between CLI tests 2020-10-26 13:50:07 +01:00
vyzo af53b72eb8 fix typo 2020-10-26 14:36:34 +02:00
Łukasz Magiera a37c372d06 Merge pull request #4572 from filecoin-project/feat/data-transfer-utils
Flesh out data transfer features
2020-10-26 13:29:26 +01:00
Łukasz Magiera 8fe7db107a Merge pull request #4584 from jsign/jsign/chffi
update filecoin-ffi in go mod
2020-10-26 13:17:19 +01:00
vyzo 5d34b7d618 rewrite sync manager 2020-10-26 14:11:19 +02:00
Łukasz Magiera 43b492204c Merge pull request #4597 from filecoin-project/fix/paych-mgr-add-funds-race
fix race in paych manager add funds
2020-10-26 13:09:47 +01:00
Łukasz Magiera ce9cce921d Merge pull request #4589 from cerblue/cerblue
Do not fail wallet delete because of pre-existing trashed key
2020-10-26 12:47:23 +01:00
Dirk McCormick 5ed57d34f0 fix: race in paych manager add funds 2020-10-26 11:09:56 +01:00
wangchao e65aa4cf17 worker key should change when set sender found key not equal with the value on chain 2020-10-26 15:20:09 +08:00
Jinsub Moon bfbf6a2711 Do not fail wallet delete because of pre-existing trashed key 2020-10-25 06:25:28 +00:00
Ignacio Hagopian 6b76371d64 update filecoin-ffi
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2020-10-24 17:15:44 -03:00
Raúl Kripalani cdfa869ea6 tvx extract: make it work with secp messages.
Unfortunately ChainGetMessage returns a *types.Message, which in
the case of secp messages is lacking the signature. The signature
is part of the input to calculate the CID on secp messages. Therefore,
calling `.Cid()` on the result of ChainGetMessage for this kind of
message will lead to an incorrect CID.

tvx was relying on that call to return the correct CID. Since this is
not the case (and this is a footgun that needs to be corrected, ideally
together with the *types.{,Signed}Message duality mess), I'm replacing
the comparison.
2020-10-24 20:16:14 +01:00
zgfzgf fe40a53e8f delete slash-consensus miner 2020-10-24 13:46:15 +08:00
hannahhoward b98b2d4310 docs(docsgen): update api docs 2020-10-23 18:35:01 -07:00
jennijuju f05b03f02c Updated msig inspect:
- Show account address of signer if the id address is corresponding to  an account address.
- When a message receiver is a new account, do not lookup method name.
2020-10-23 17:40:51 -04:00
Łukasz Magiera 4d87473053 Fix lint 2020-10-23 23:31:18 +02:00
Łukasz Magiera 660236b224 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-23 23:25:35 +02:00
Łukasz Magiera de2cbfa8a9 client deal: Cache CommD when creating multiple deals 2020-10-23 22:20:17 +02:00
hannahhoward 98297cef4d feat(data-transfer): fill in utils 2020-10-22 13:40:26 -07:00
Łukasz Magiera 268d29222a docsgen 2020-10-18 20:10:39 +02:00
Łukasz Magiera 1a10f95973 worker: Better miner connectivity check on startup 2020-10-18 19:53:23 +02:00
Łukasz Magiera 8c86ea6b75 localworker: Try very hard to get ruselts to manager 2020-10-18 19:45:11 +02:00
Łukasz Magiera dbb421c4f7 localworker: Use better context for calling returnFunc 2020-10-18 19:32:43 +02:00
Łukasz Magiera 879aa9512d worker: Use miner session for connectivity check 2020-10-18 17:56:29 +02:00
Łukasz Magiera cf4dfa3a05 worker: Use http rpc for miner API 2020-10-18 13:59:38 +02:00
Łukasz Magiera f933e1d2b7 miner cli: Update to uuid worker IDs 2020-10-18 13:03:17 +02:00
Łukasz Magiera 8d06cca073 sched: Handle workers using sessions instead of connections 2020-10-18 12:36:06 +02:00
Łukasz Magiera 7ac5dc55d0 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-17 13:45:11 +02:00
Łukasz Magiera 68be28ca6d Add Session API 2020-10-17 12:53:42 +02:00
Anton Evangelatov a8430088b2 --metadata cmd options for testground (#275)
* refactor user field

* upgrade sdk-go
2020-10-16 20:33:02 +02:00
Anton Evangelatov 881e37ec02 upgrade go-sdk (#274) 2020-10-14 16:51:07 +02:00
Anton Evangelatov 194c9d6e07 upgrade go-sdk (#273) 2020-10-14 15:46:06 +02:00
Aayush Rajasekaran 2613e837a9 Bugfix: Eligible miners should be computed based on start tipset, not end tipset 2020-10-14 03:01:41 -04:00
Łukasz Magiera b74a3229f8 fsm: process expired-ticket sectors 2020-10-13 21:35:41 +02:00
Łukasz Magiera 71b3b9075d Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-13 21:33:21 +02:00
Travis Person 20c57fcd0e lotus-shed: post-find use lookback 2020-10-13 19:00:37 +00:00
Łukasz MagieraandSteven Allen fbe76d0fa1 Update lotus with wallet changes (#271)
* update oni for specs-actors v2 upgrade

https://github.com/filecoin-project/lotus/pull/3936

* Update lotus with wallet changes

Co-authored-by: Steven Allen <steven@stebalien.com>
2020-10-13 18:42:23 +02:00
ZenGround0 619ee1e6f9 add comma 2020-10-13 00:49:32 -04:00
ZenGround0 0e88f32d66 Fix bug and add flag 2020-10-13 00:47:43 -04:00
ZenGround0 546614455f Fix print 2020-10-13 00:38:15 -04:00
ZenGround0 0b9499a00f withpower flag 2020-10-13 00:29:43 -04:00
ZenGround0 448ca6e43c less verbose 2020-10-13 00:17:09 -04:00
ZenGround0 c9955c0635 verbose flag 2020-10-12 23:59:30 -04:00
ZenGround0 768d2db114 Tipset traversal for speed 2020-10-12 23:53:14 -04:00
ZenGround0 79d94c4771 Hook up cmd 2020-10-12 23:09:40 -04:00
ZenGround0 a3e26233b2 Add postfind 2020-10-12 23:00:29 -04:00
zgfzgf bc1f18b73a lotus bench optimize 2020-10-11 18:55:12 +08:00
Anton Evangelatov cc8a0f8022 fix deals stress tests (#265) 2020-10-11 12:38:59 +02:00
zgfzgf c3a405eac7 add lotus bench print 2020-10-11 18:26:27 +08:00
zgfzgf e4209d86f6 lotus bench add ticket-preimage 2020-10-11 17:20:55 +08:00
zgfzgf fcb9dea501 add sum sealing time 2020-10-11 16:31:39 +08:00
zgfzgf c810b157cf lotus bench delete ix 2020-10-11 11:39:27 +08:00
zgfzgf c458f6e826 lotus bench replace abi.SectorID with sid 2020-10-11 11:25:19 +08:00
zgfzgf c99e223cb1 lotus bench change and add print 2020-10-11 10:48:09 +08:00
zgfzgf 5c27d6aeee lotus-bench UnsealPiece SectorID.Number error 2020-10-11 10:12:06 +08:00
Anton Evangelatov 1a64caaa4d record point for every fetch (#269) 2020-10-08 20:43:46 +02:00
Łukasz Magiera 0de3051821 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-08 13:10:41 +02:00
Anton Evangelatov 4cc1fcb37b graphsync - add composition for k8s (#267) 2020-10-08 01:08:30 +02:00
Raúl Kripalani 44af7e43b6 remove tvx and corpus from this repo; spun off elsewhere. (#268) 2020-10-07 19:24:46 +01:00
Anton Evangelatov 2a6e05b776 fix type on subscription channel (#264) 2020-10-07 00:30:58 +02:00
Steven Allen fe1ef154cf chore: update lotus to latest next (#266)
This completes the lotus upgrade dance.
2020-10-07 00:14:28 +02:00
Lucas Molas 7e3339820f fix(sync): remove checks bypass when we submit the block 2020-10-06 15:12:03 -03:00
Anton Evangelatov 6b3ffdbd3d fix lotus-soup/deals-e2e test case (#262) 2020-10-06 16:40:23 +02:00
Steven Allen 0017ea8fd0 update oni for specs-actors v2 upgrade (#263)
https://github.com/filecoin-project/lotus/pull/3936
2020-10-06 14:13:03 +02:00
Raúl Kripalani a5b57068d4 Merge pull request #252 from filecoin-project/graphsync 2020-10-05 13:58:27 +01:00
Łukasz Magiera 921d78f820 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-04 10:39:55 +02:00
Jakub Sztandera 6b5f8a6b1d Add options to set BlockProfileRate and MutexProfileFraction
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-02 19:06:41 +02:00
Łukasz Magiera 5932f28519 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-01 02:39:48 +02:00
Łukasz Magiera 79d2ddf24f Review 2020-09-30 21:18:12 +02:00
Łukasz Magiera 2cfe22d4e5 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-09-30 20:48:16 +02:00
Łukasz Magiera e3ee4e4718 Fix lint errors 2020-09-30 20:24:03 +02:00
Łukasz Magiera 2d16af6ee6 sectorstorage: Fix TestRedoPC1 2020-09-30 19:18:38 +02:00
Łukasz Magiera 4f97d9637e Fix storage-fsm tests 2020-09-30 19:11:58 +02:00
Łukasz Magiera c228598098 sectorstorage: Variable scopes are really hard 2020-09-30 18:16:07 +02:00
Łukasz Magiera a783bf9b8b storagefsm: Handle PC2 with missing replica 2020-09-30 17:53:15 +02:00
Łukasz Magiera 54fdd6ba5a sectorstorage: Variable scopes are hard 2020-09-30 17:48:48 +02:00
Łukasz Magiera 6ddea62d09 shed: gofmt 2020-09-30 17:26:24 +02:00
Łukasz Magiera 6855284d88 sectorstorage: Cancel non-running work in case of abort in sched 2020-09-30 17:26:09 +02:00
Łukasz Magiera 46a5beafe4 shed: Datastore utils 2020-09-30 17:25:33 +02:00
Łukasz Magiera 0f2dcf28b1 fsm: Reuse tickets in PC1 on retry 2020-09-29 10:07:49 +02:00
Raúl Kripalani bc7f20e179 Merge pull request #261 from filecoin-project/refactor-tvx 2020-09-28 22:00:28 +01:00
Łukasz Magiera 1e6a69f8aa localworker: Don't mark calls as returned when returning fails 2020-09-28 22:10:02 +02:00
Łukasz Magiera 9bd2537971 stores: Fix error printing in http handler 2020-09-28 22:06:03 +02:00
Łukasz Magiera bf554d0e43 worker: Redeclare storage early on reconnect 2020-09-28 21:11:25 +02:00
Łukasz Magiera 810c767200 worker: Redeclare storage on reconnect 2020-09-28 21:06:49 +02:00
Łukasz Magiera 4ba7af6061 worker: Mark return methods as retry-safe 2020-09-28 20:46:44 +02:00
Łukasz Magiera 86cf3c835e worker: Reconnect correctly 2020-09-28 18:30:45 +02:00
Łukasz Magiera 9e7d6823b1 sectorstorage: Cleanup callToWork mapping after work is done 2020-09-28 13:34:45 +02:00
Łukasz Magiera aa7090df49 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-09-28 12:55:57 +02:00
Łukasz Magiera a9d1ca4d83 Change order in miner sectors list 2020-09-28 12:08:09 +02:00
Raúl Kripalani 400af0d2fa wip accessed-cids retention. 2020-09-27 12:43:28 +01:00
Raúl Kripalani 41ab87e904 wip 2020-09-27 12:02:34 +01:00
Łukasz Magiera cf71f034dc Merge remote-tracking branch 'origin/dev' into feat/async-restartable-workers 2020-09-26 12:35:32 +02:00
zgfzgf 1a7aea1906 modify error 2020-09-25 22:59:21 +08:00
zgfzgf 3207bc4704 optimize trySched 2020-09-25 22:41:29 +08:00
zgfzgf 60e950015c modify for unsafe 2020-09-25 22:13:27 +08:00
hannahhoward 08fc0b7aec feat(graphsync): add comptability check between versions 2020-09-24 16:34:49 -07:00
Łukasz Magiera a8fcb86c10 miner allinfo: Don't fail if sector status fails 2020-09-24 22:17:20 +02:00
Raúl Kripalani 48b7945714 add circleci job for building tvx. 2020-09-24 14:08:44 +01:00
Raúl Kripalani c507f409a5 remove driver from tvx; use lotus driver. 2020-09-24 14:06:34 +01:00
Raúl Kripalani 72537b6614 Merge branch 'master' into refactor-tvx 2020-09-24 12:31:58 +01:00
Raúl Kripalani c839c5721c combine #260 and #246. 2020-09-24 12:31:03 +01:00
Łukasz Magiera 04ee53e061 sectorstorage: Show task type of ret-wait jobs 2020-09-24 11:55:11 +02:00
Łukasz Magiera f57652524c Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-09-23 22:31:27 +02:00
Łukasz Magiera d817dceb05 Show lost calls in sealing jobs cli 2020-09-23 19:26:35 +02:00
Łukasz Magiera c17f0d7e61 sectorstorage: Fix panic in returnResult 2020-09-23 17:37:05 +02:00
Łukasz Magiera 3003789288 worker: Use a real datastore for keeping track of calls 2020-09-23 16:12:15 +02:00
Łukasz Magiera 86c222ab58 sectorstorage: fix work tracking 2020-09-23 14:56:50 +02:00
Anton Evangelatov f21ca8591c trigger more test plans on CI (#258) 2020-09-23 12:46:45 +01:00
Łukasz Magiera ce6b92484f Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-09-23 11:31:21 +02:00
Will 80619fa8a0 Merge pull request #259 from filecoin-project/generalextraction-updated-deps
chore: update deps
2020-09-22 21:49:40 -07:00
Steven Allen 9a0d5cd739 update for lotus/actors network upgrade changes 2020-09-22 18:37:22 -07:00
Łukasz Magiera 6185e157e9 sectorstorage: calltracker: work around cbor-gen bytearray len limit 2020-09-23 00:29:10 +02:00
Łukasz Magiera 04ad1791b0 localworker: Fix contexts 2020-09-23 00:10:36 +02:00
Łukasz Magiera bb5cc06677 Fix workid param hash 2020-09-22 23:33:13 +02:00
Łukasz Magiera 706f4f2ef5 worker: Don't die with the connection 2020-09-22 18:36:44 +02:00
Alan Shaw 36b8a017bd chore: update deps 2020-09-22 11:56:32 +01:00
Łukasz Magiera b8865fb182 workers: Mark on-restart-failed returned tasks as returned 2020-09-22 01:00:28 +02:00
Łukasz Magiera 03c3d8bdb3 workers: Return unfinished tasks on restart 2020-09-22 00:52:33 +02:00
Łukasz Magiera aa5bd7bc17 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-09-21 22:36:16 +02:00
Anton Evangelatov 1c9257d537 nightly/hourly job to run testground testplans (#253)
* schedule a job every 5min.

* upgrade FFI again

* download testground with supervisor; run async job

* fixup
2020-09-17 18:22:09 +02:00
Anton Evangelatov ea56e56ec1 fix routing policy (#257) 2020-09-17 18:04:11 +02:00
Łukasz Magiera 17680fff55 gofmt 2020-09-17 00:35:57 +02:00
Łukasz Magiera d9d644b27f sectorstorage: handle restarting manager, test that 2020-09-17 00:35:09 +02:00
Łukasz Magiera 5e09581256 sectorstorage: get new work tracker to run 2020-09-16 22:33:58 +02:00
Will Scott ed7423b2b5 don't include not-yet-accessed blocks in car generation 2020-09-16 12:22:38 -07:00
Will Scott 77a956cda4 Merge branch 'master' of github.com:filecoin-project/oni into generalextraction 2020-09-16 10:39:50 -07:00
Will Scott a9253837ac checkpoint 2020-09-16 10:39:37 -07:00
Anton Evangelatov 63f903a3fb clone fil-blst in extra for the local:docker runner (#256) 2020-09-16 17:30:03 +02:00
Anton Evangelatov f702ce331a enable paych tests (#255)
* enable paych tests

* use new APIs and values
2020-09-16 17:29:37 +02:00
Łukasz Magiera b1361aaf8b sectorstorage: wip manager work tracker 2020-09-16 17:08:05 +02:00
Anton Evangelatov 8b7e7d438c upgrade lotus to master, and sync filecoin-ffi versions (#254)
* upgrade lotus to master, and sync filecoin-ffi versions

* git submodule for filecoin-project/fil-blst

* go mod tidy

* try docker golang executor
2020-09-16 14:52:51 +02:00
Anton Evangelatov 097d82535d upgrade lotus-soup (drand, lotus, stop/resume drand) (#249)
* wip

* commit with fewer error messages

* reduce headlag from 3 to 1

* fixes for params

* add composition for local:docker

* revert drand-halt plan

* initial monitor of miner power and chain epochs

* revert params to be same as filecoin mainnet

* increase timeout for drand resuming from 30sec to 120sec.

* increase log level

* upgrade lotus to v0.6.1

* upgrade drand to v1.1.1

* increase prepare node timeout from 1 min to 3 min

* upgrade drand to master. increase timeouts for prepare drand node

* nil the stmgr.ForksAtHeight map

* modify starting/stopping of drand within testplan

* increase drand outage to 45min. so that we miss windows

* upgrade proof parameters in docker images

* revert in-complete changes

* use correct runtime debug image
2020-09-16 12:51:23 +02:00
Łukasz Magiera 03cf6cca40 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-09-15 17:47:03 +02:00
Will Scott 20a0f7ac68 flip to test-vectors schema 2020-09-14 12:50:50 -07:00
Will Scott 6cff57ab43 Merge branch 'master' of github.com:filecoin-project/oni into generalextraction 2020-09-14 12:35:28 -07:00
Łukasz Magiera e9d25e5919 More fixes 2020-09-14 20:28:47 +02:00
Łukasz Magiera 381a6cdfac Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-09-14 19:11:50 +02:00
Łukasz Magiera 1ebca8f732 more working code 2020-09-14 19:09:01 +02:00
Raúl Kripalani 172204c933 increase chunk size; change composition. 2020-09-11 23:42:09 +01:00
Raúl Kripalani 77000db747 wip; add concurrency; make it work. 2020-09-11 22:36:38 +01:00
Raúl Kripalani 6563a68ae2 wip graphsync stress test. 2020-09-11 00:22:59 +01:00
Anton Evangelatov d9bcdfe61b Update README.md (#251) 2020-09-10 20:13:34 +02:00
Łukasz Magiera 5f08fe7ead Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-09-10 17:30:54 +02:00
Anton Evangelatov d3f6657032 Update README.md (#250) 2020-09-10 15:31:42 +02:00
Łukasz Magiera 554570f884 docsgen 2020-09-07 17:57:23 +02:00
Łukasz Magiera 231a9e4051 Fix sealing sched tests 2020-09-07 17:55:31 +02:00
Łukasz Magiera 9e6f974f3c storage: Fix build 2020-09-07 16:12:55 +02:00
Łukasz Magiera 06e3852cef storage: Integrate async workers in sealing manager 2020-09-07 12:20:50 +02:00
Łukasz Magiera 5d73943929 storage: Fix import cycle 2020-09-06 18:54:00 +02:00
Łukasz Magiera 159ce13f5e Async worker API 2020-09-06 18:47:16 +02:00
Will Scott ed12b83b4e Expand extraction / replay to
* allow preceeding messages
* use `stateCall` rather than state replay
* work on state root CID rather than tipset
2020-08-28 13:41:16 -07:00
dirkmc 6be293e848 payment channels tests improvements (#245)
* fix: payment channels tests

* fix: paych - signal to miners to stop mining when clients are done

* fix: go mod tidy
2020-08-28 13:36:20 +01:00
Alan Shaw 9cebb09a5f docs: add @willscott and @alanshaw to the team (#244)
Hooray \o/!
2020-08-26 11:15:36 +01:00
dirkmc f6f3ffc254 docs: remove reference to testground oni branch in README (#243) 2020-08-26 11:07:08 +01:00
Raúl Kripalani 497bda21b2 transfer builders and scripts to filecoin-project/test-vectors. (#242) 2020-08-16 20:36:49 +01:00
Raúl Kripalani 6164d16f19 migrate multisig suite. (#241) 2020-08-16 19:27:53 +01:00
Raúl Kripalani 328cd14897 migrate transfer suite. (#240) 2020-08-16 13:47:21 +01:00
Raúl Kripalani 6954e6cb0e migrate actor creation suite. (#239) 2020-08-16 13:40:02 +01:00
Raúl Kripalani ad17dc227c upgrade test vectors to latest lotus (#238) 2020-08-16 00:03:58 +01:00
Raúl Kripalani 955b445723 generator: stamp vectors with generation data; omitempty. (#237) 2020-08-14 21:30:50 +01:00
Raúl Kripalani b2adc12287 rm suite_messages_nested.go. (#236) 2020-08-14 19:48:09 +01:00
Anton Evangelatov 0afeed6108 nested and paych suites in generator format (#235) 2020-08-14 19:40:26 +01:00
Anton Evangelatov b2c2a7b5d0 nested test suite (#231) 2020-08-14 19:34:02 +02:00
Raúl Kripalani acbb80920b generator; single main() entrypoint for each suite. (#232) 2020-08-14 18:25:35 +01:00
Alan Shaw 9ba87d4613 refactor: switch to base64 encoding for binary data (#233) 2020-08-14 19:05:29 +02:00
Raúl KripalaniandAnton Evangelatov 99f466e35e test vector builder API + partial migration of suites (#229)
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
2020-08-14 13:51:43 +01:00
Anton Evangelatov ffe3019561 messages/nested suite (#215)
* wip

* print out failing test

* missing account in state

* enable puppet test

* add missing preroot

* add puppet actor to lvm

* refactor getting post root and serialize of test vector (#217)
2020-08-10 16:38:34 +02:00
Alan Shaw 47f0ef0eae test: port chain validation multisig test suite (#216) 2020-08-07 16:45:52 +01:00
Alan Shaw be5bd41640 feat: add test name to test vector meta (#214)
So we can more easily distinguish between test vectors.
2020-08-07 15:36:00 +01:00
Anton Evangelatov de62012a7f add messages/transfer suite (#213) 2020-08-07 16:25:58 +02:00
Alan Shaw a793824d2c feat: test driver automatically records applied messages in test vector (#212)
The `TestDriver` now records applied messages in it's `TestVector` whenever an `Apply*` method is called. This removes the need for manual message serialization and recording in the tests.
2020-08-07 15:12:38 +01:00
Alan Shaw 52cf367a92 feat: add MustMarshalJSON for more DRY outputting (#211)
Small change to make encoding and printing the test vector output a bit more succinct.
2020-08-07 14:09:10 +01:00
Alan Shaw 81ea0ec5f3 refactor: add default TestVector to TestDriver (#208)
This PR adds a `TestVector` to the `TestDriver` so that test driver methods that apply messages can be recorded in the test vector.

refs #194
2020-08-07 13:47:16 +01:00
Anton Evangelatov 7d118e1b12 fix two disabled tests (#207) 2020-08-06 18:57:15 +02:00
Raúl Kripalani fd35438a30 schema: add message receipts + description and comments informational fields (#209) 2020-08-06 17:20:17 +01:00
Raúl Kripalani 8203a5d2c3 various fixes: warn on predicted nonce mismatch, randomness length, add missing mocked verification calls (#199)
* warn when extracting a message from a tipset that contains
  more leading messages from the same sender, as this leads to
  nonce misalignment.
* fix mocked randomness being too short (must be 32 bytes).
* mock some further verification syscalls.
2020-08-06 10:43:10 +01:00
Anton Evangelatov 9c8ced1fc6 input from stdin functionality for exec-lotus ; initial test suites in ci (#196) 2020-08-05 20:59:57 +02:00
Anton Evangelatov f97c9e08c0 upgrade lotus-soup to use latest commit from next branch (#193) 2020-08-05 19:51:25 +02:00
Anton Evangelatov 8a59bf7c45 build tvx as part of ci (#192) 2020-08-05 19:45:57 +02:00
5353210814 generate test-vectors based on tests from chain-validation project (#181)
* Read a subset of filecoin state over the full node API

* wip

* import export wip

* extract actors from message

* generate car for any state

* library for providing a pruned statetree

* test vector schema draft + example 'message' class test vector.

* message => messages test vector class.

* fixup

* wip

* use lb.NewBlockstore with ID

* fixup lotus-soup, and generate

* fix deals

* magic params

* work on schema / export of test vector

* fixup

* wip deserialise state tree

* pass at building a test case from a message

* progress loading / serializing

* recreation of ipld nodes

* generation of vector creates json

* kick off tvx tool.

* wip

* wip

* retain init actor state.

* initial test with printed out state

* remove testing.T, but keep require and assert libraries

* wip refactor state tree plucking.

* simplified

* removed factories

* remove builder.Build ; remove interface - use concrete iface

* comment out validateState

* remove Validator

* remove TestDriverBuilder

* remove client

* remove box

* remove gen

* remove factories

* remove KeyManager interfafce

* moved stuff around

* remove ValidationConfig

* extract randomness

* extract config and key_manager

* extract statewrapper

* extract applier

* rename factories to various

* flatten chain-validation package

* initial marshal of test vector

* do not require schema package

* fixup

* run all messages tests

* better names

* run all messages tests

* remove Indent setting from JSON encoder for now

* refactor, and actually running successfully ;-)

* remove irrelevant files; rename extract-msg command.

* remove root CID from state_tree object in schema.

* add tvx/lotus package; adjust .gitignore.

* tidy up command flag management.

* add comment.

* remove validateState and trackState

* remove xerrors

* remove NewVM

* remove commented out RootCID sets

* enable more tests

* add all `message_application` tests

* delete all.json

* update Message struct

* fix message serialization

* support multiple messages

* gofmt

* remove custom Message and SignedMessage types

* update tests with gzip and adhere to new schema for compressed CAR

* improved iface for Marshal

* update Validation

* remove test-suites and utils

* better names for chain. methods

* go mod tidy

* remove top-level dummyT

Co-authored-by: Will Scott <will@cypherpunk.email>
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2020-08-05 19:40:09 +02:00
Anton Evangelatov 17f0b4a2e1 support multiple messages /1 (#185)
* support multiple messages

* update corpus/schema.json

* fix required
2020-08-05 17:00:14 +02:00
Raúl Kripalani 163721651a dedup state tree CARs from test vectors. (#187) 2020-08-05 15:52:57 +01:00
b7e3b4ff77 unified tvx tool; end-to-end MVP for extracting+running msg-class vectors (#177)
Co-authored-by: Will Scott <will@cypherpunk.email>
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
2020-08-05 13:20:13 +01:00
Anton Evangelatov 62a9982b76 fix lotus-soup deals baseline test (#172)
* fix lotus-soup deals baseline test

* remove comment

* go mod tidy
2020-07-30 16:22:43 +02:00
Anton Evangelatov 42ef5d3460 fix deps (#171) 2020-07-29 15:12:51 +02:00
Raúl Kripalani 700a121ccd add workstream labels. (#161) 2020-07-27 19:05:28 +01:00
Raúl Kripalani 0dc490979f readme: explain batch-run of randomized test cases. (#159) 2020-07-27 15:36:23 +01:00
0d0fc2d433 randomized network params & batch runner (#142)
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2020-07-27 14:58:27 +01:00
Anton Evangelatov 7af5ab5445 slashing/termination from failed windowed post + fast retrieval benchmarks (#95) 2020-07-27 13:57:01 +02:00
Anton Evangelatov 510f6bb830 upgrading to current version of next (#156) 2020-07-21 13:39:36 +02: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
Anton Evangelatov e0e4432703 upgrade to next and retrieval signature (#151)
* upgrade to next and retrieval signature

* upgrade buildbase image and bump up lotus version

* update extra/filecoin-ffi

* note on dependencies

* set expected seal delay
2020-07-17 14:28:52 +02:00
Lucas Molas 48a2161306 readme: update submodule command (#141) 2020-07-10 14:22:56 +02:00
Anton Evangelatov 2c3d473193 descriptive composition file names (#133) 2020-07-10 13:48:52 +02:00
Anton Evangelatov a50cdda7a5 improved readme - lotus-soup (#136) 2020-07-09 19:09:32 +02:00
Anton Evangelatov 58558f2e1d one more zero (#139) 2020-07-09 18:42:49 +02:00
Anton Evangelatov 36c722731b fix balance (#138) 2020-07-09 18:31:57 +02:00
Anton Evangelatov 1cf77d2172 baseline composition 5 clients 1 miner local:docker (#137) 2020-07-09 18:25:41 +02:00
Anton Evangelatov 5d40607cf9 move compositions to _compositions (#132) 2020-07-09 16:42:22 +02:00
Anton Evangelatov 4caecf34ae print auth token ; set seal delay ; disable permissioned api proxies ; bump balances (#122)
* print auth token ; set seal delay

* disable permissioned proxy /2 (#123)

* bump up balances (#124)

* upgrade go.mod to use latest lotus next

* make compiler happy due to change in APIs

* fix k8s compositions to use natural time mining

* add note for balances
2020-07-09 15:57:18 +02:00
Anton EvangelatovandRaúl Kripalani f20b25a123 improve readme with instructions on how to run test cases (#129)
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2020-07-09 14:41:27 +01:00
Yusef Napora f19148d765 Merge pull request #114 from filecoin-project/attofil
Attofil
2020-07-08 11:20:42 -04:00
Anton Evangelatov 6e45d6b68d Merge pull request #117 from filecoin-project/consistent-compositions
consistent compositions
2020-07-08 17:15:21 +02:00
Raúl Kripalani 3e06729877 readme: add links to testing topics labels. 2020-07-08 15:59:29 +01:00
Raúl Kripalani b6994b9615 add hint/needs-scoring label. 2020-07-08 15:28:37 +01:00
Yusef Napora 4227f2d9dc rename attoFil -> filToAttoFil 2020-07-08 10:25:50 -04:00
Raúl Kripalani 3dbea4b0b7 Update test-scenario-request.md 2020-07-08 15:05:21 +01:00
Raúl Kripalani 31af5419a2 Delete system-process.md 2020-07-08 15:05:01 +01:00
Raúl Kripalani 0efcf1b622 add topic/deals label. 2020-07-08 14:05:36 +01:00
Anton Evangelatov a1166d6fdb consistent compositions 2020-07-08 14:50:07 +02:00
Raúl Kripalani ac5fc72347 add some of @raulk's notes. 2020-07-08 13:29:39 +01:00
Raúl Kripalani 97a17bd587 fix labels. 2020-07-08 13:01:30 +01:00
Raúl Kripalani daee5ab1d3 update labels with topics. 2020-07-08 12:49:17 +01:00
Raúl Kripalani 645da2b749 readme: add testing topics covered by Oni. 2020-07-08 12:18:48 +01:00
Yusef Napora 4926a788c1 fix max fil check 2020-07-07 17:24:13 -04:00
Yusef Napora 735c1ecc2a update param type in manifest 2020-07-07 17:10:06 -04:00
Yusef Napora 8a2a5e7e85 allow fractional balance parameters 2020-07-07 17:03:05 -04:00
Raúl Kripalani 6a45211a00 Merge pull request #109 from filecoin-project/plan/payments 2020-07-07 17:51:25 +01:00
Raúl Kripalani f46375a50a rename ClientAddressesMsg#Peer{=>Net}Addr. 2020-07-07 17:38:15 +01:00
Raúl Kripalani 69332e1189 sanity check: make sure proof parameters are present; add Makefile for easy download. 2020-07-07 17:37:07 +01:00
Raúl Kripalani 6eb5e24988 move global var setting to init.go. 2020-07-07 17:37:07 +01:00
Raúl Kripalani cb3697cb5a make composition.toml use local:exec; mine in present. 2020-07-07 17:37:07 +01:00
Raúl Kripalani 5aac474737 Update DELVING.md 2020-07-07 16:54:55 +01:00
Raúl KripalaniandAnton Evangelatov 99b6bb324d fix exposed_ports in composition.
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
2020-07-07 14:25:39 +01:00
Raúl Kripalani 5d1d7335b0 WIP payments channels stress test (blocked). 2020-07-07 14:08:51 +01:00
Anton Evangelatov e899da0063 Merge pull request #81 from filecoin-project/plan/deal-stress-test
Basic deal stress test
2020-07-07 13:42:07 +02:00
Anton Evangelatov 0df9b57d48 revert runtime image to v2 2020-07-07 13:21:05 +02:00
Anton Evangelatov e244f8d3b2 delete original dashboard 2020-07-07 13:19:51 +02:00
Anton Evangelatov c77cd13c97 improved dashboards 2020-07-07 13:19:24 +02:00
Yusef Napora 300d401686 Merge pull request #104 from filecoin-project/fix/sync-mining
retry sync mining on error
2020-07-06 17:00:24 -04:00
Yusef NaporaandAnton Evangelatov 8a4b6473f4 fix exposed port syntax
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
2020-07-06 16:58:59 -04:00
Yusef Napora 00cc982bcb panic if we fail to mine 100x in a row 2020-07-06 16:10:53 -04:00
Anton Evangelatov 4dea3f41a2 use lotus master 2020-07-06 19:28:19 +02:00
Anton Evangelatov 1c9b867593 ERROR -> WARN ; bump up block delay and propagation delay 2020-07-06 19:27:18 +02:00
Anton Evangelatov 920e6f5049 add missing %s 2020-07-06 19:18:52 +02:00
Anton Evangelatov 00d837d454 add 2 panels for counters 2020-07-06 19:14:53 +02:00
Anton Evangelatov 733f2aa87f fixes 2020-07-06 18:24:11 +02:00
Yusef Napora 2ca9e9f937 loop and retry if mining a block fails 2020-07-06 12:09:53 -04:00
Anton Evangelatov dd3d04fed2 add basic timers 2020-07-06 17:49:42 +02:00
Anton Evangelatov 4ce21af7de go mod tidy 2020-07-06 17:07:21 +02:00
Anton Evangelatov db383b6a8b Merged with master (so that we get blockchain stats) 2020-07-06 17:06:44 +02:00
Anton Evangelatov b906c492a2 Merge pull request #85 from filecoin-project/dashboard-panels-lotus-metrics
add panels for metrics from lotus ; collect stats about chain
2020-07-06 16:58:09 +02:00
Raúl Kripalani 8d5a8b0927 make the testkit friends with local:exec. (#105) 2020-07-06 15:47:17 +01:00
Anton Evangelatov 887bf0511f fix signature for NewTestMiner 2020-07-06 13:49:27 +02:00
Anton Evangelatov f529f3b14d move ffi forward 2020-07-06 13:35:01 +02:00
Anton Evangelatov 75b842b430 upgrade lotus 2020-07-06 13:25:38 +02:00
Anton Evangelatov 1289bca9d8 merged master 2020-07-06 13:16:40 +02:00
Anton Evangelatov e7271cfd0b Merge pull request #103 from filecoin-project/upgrade-lotus
upgrade lotus and plans to use buildbase:v4
2020-07-06 13:14:47 +02:00
Anton Evangelatov f4568fc819 Merge pull request #102 from filecoin-project/upgrade-ffi
upgrade buildbase to v4
2020-07-06 13:14:23 +02:00
vyzo f062b55cfc gomod: update go-fil-markets for panic fix cherry-pick 2020-07-06 13:46:32 +03:00
Anton Evangelatov f7715ab1ba bump filecoin-ffi to 6a143 2020-07-03 21:36:57 +02:00
Anton Evangelatov 84cf7d8c14 revert specs-actors 2020-07-03 21:32:27 +02:00
Anton Evangelatov cd3dbf615f remove sleep 2020-07-03 21:29:04 +02:00
Anton Evangelatov 7a5f1390d1 revert build flags 2020-07-03 21:28:40 +02:00
Anton Evangelatov 027b80f5af revert soup main.go 2020-07-03 21:27:47 +02:00
Anton Evangelatov 89e413dba7 revert composition 2020-07-03 21:26:58 +02:00
Anton Evangelatov 9027161453 remove composition 2020-07-03 21:26:18 +02:00
Anton Evangelatov 20b4375f25 upgrade lotus to master 2020-07-03 21:24:31 +02:00
Anton Evangelatov aa90a8a989 upgrade lotus 2020-07-03 20:57:57 +02:00
Anton Evangelatov eadb49c56d works 2020-07-03 20:48:26 +02:00
Anton Evangelatov 9148b0f865 lotus at 3db96653 2020-07-03 20:35:53 +02:00
Anton Evangelatov 3aacb7c377 remove stats 2020-07-03 20:31:18 +02:00
Anton Evangelatov 1beb8faa26 upgrade buildbase to v4 2020-07-03 20:11:14 +02:00
Anton Evangelatov 8708f31c45 wip 2020-07-03 20:06:10 +02:00
vyzo d867f0c04e set the PropagationDelay to 2 2020-07-03 19:50:28 +03:00
Anton Evangelatov 84bc071179 wip 2020-07-03 15:38:19 +02:00
Anton Evangelatov 7258ad00f4 Merge pull request #99 from filecoin-project/docs/delving
initial DELVING.md document.
2020-07-03 15:30:27 +02:00
Raúl Kripalani 483a98fc8c Update test-scenario-request.md 2020-07-03 14:19:32 +01:00
Anton Evangelatov c3a13240ab add lsm commands 2020-07-03 14:26:32 +02:00
Anton Evangelatov a223f80992 commands for cluster:k8s ; automating setting up of envs 2020-07-03 14:24:10 +02:00
Raúl Kripalani 06e5c42541 add instruction on submitting issues upstream. 2020-07-03 12:28:09 +01:00
Raúl Kripalani 2ed7540dfb initial DELVING.md document. 2020-07-03 12:15:58 +01:00
vyzo 26ad4dabd1 Merge branch 'master' into plan/deal-stress-test 2020-07-03 13:04:49 +03:00
vyzo 6c14fdaca7 Merge pull request #97 from filecoin-project/fix/connect-miners
connect miners in a full mesh.
2020-07-03 13:03:30 +03:00
vyzo 91d389330e compositions for natural time mining in deal stress tests 2020-07-03 12:57:11 +03:00
vyzo 62f1e47bd1 expose rpc ports 2020-07-03 12:54:09 +03:00
vyzo 2b6c1e0187 add delay before starting deals 2020-07-03 12:20:16 +03:00
vyzo faeee03dd1 gomod: update lotus@master 2020-07-03 09:41:04 +03:00
Raúl Kripalani 7e63197e97 connect miners in a full mesh. 2020-07-02 22:49:59 +01:00
vyzo 65cc1a4c01 add testground build tag to circle ci 2020-07-02 18:53:51 +03:00
vyzo b6c830c254 Merge branch 'master' into plan/deal-stress-test 2020-07-02 18:52:25 +03:00
vyzo 19ce23e907 initialize block delay to its minimum value of 1 2020-07-02 18:44:13 +03:00
vyzo 122926ad49 add testground build selector to compositions 2020-07-02 18:38:57 +03:00
Anton Evangelatov 01d6554a00 Merge pull request #94 from filecoin-project/listen-to-all-ifaces
listen to all ifaces when exposing internal apis
2020-07-02 15:27:21 +02:00
Anton Evangelatov 22005d642f listen to all ifaces when exposing internal apis 2020-07-02 15:20:04 +02:00
Anton Evangelatov b601fd12f7 Merge pull request #90 from filecoin-project/hook-up-miner-rpc-apis
export both apis for miners
2020-07-02 14:20:10 +02:00
Anton Evangelatov 740741b129 add mining_mode to deals-e2e test case 2020-07-02 14:13:39 +02:00
Anton Evangelatov 6d0c0b4323 Merge pull request #92 from filecoin-project/rm-lotus-testground
remove deprecated lotus-testground.
2020-07-02 13:24:06 +02:00
Anton Evangelatov 1623917bc4 Merge branch 'master' into hook-up-miner-rpc-apis 2020-07-02 13:21:08 +02:00
vyzo 9c6b6e61fe remove duplicate miner addrs collection 2020-07-02 13:23:26 +03:00
vyzo bcd3e79557 Merge branch 'master' into plan/deal-stress-test 2020-07-02 12:50:49 +03:00
vyzo fee13a6daf rename test case to deals-stress-test 2020-07-02 12:49:27 +03:00
Raúl Kripalani 619f3fd60b update runtime image to v2. 2020-07-01 19:48:23 +01:00
Raúl Kripalani 4eb2218cf3 Update FFI and Lotus versions (#89) 2020-07-01 19:36:46 +01:00
Raúl Kripalani 45f20b8505 remove lotus-testground from CircleCI. 2020-07-01 19:20:36 +01:00
Raúl Kripalani 561b10a62b remove deprecated lotus-testground. 2020-07-01 19:11:36 +01:00
Yusef Napora e66d439cb4 Merge pull request #91 from filecoin-project/fix/drand-suspend
fix drand merge mess
2020-07-01 14:06:16 -04:00
Yusef Napora 83313ead4f fix drand merge mess 2020-07-01 13:57:27 -04:00
Anton Evangelatov e6bc6aafdf resolve merge conflicts 2020-07-01 19:40:48 +02:00
Anton Evangelatov c7f95280e4 update params for ports 2020-07-01 19:39:17 +02:00
Yusef Napora 459cd657d3 Merge pull request #70 from filecoin-project/plan/drand-halting
plan: drand halting
2020-07-01 13:06:14 -04:00
Yusef Napora ea6dbc912b merge origin/master into plan/drand-halting 2020-07-01 12:59:22 -04:00
Yusef Napora a8841a8b76 merge testkit into plan/drand-halting 2020-07-01 12:54:46 -04:00
Anton Evangelatov 167a30fcb9 export both apis for miners 2020-07-01 18:54:20 +02:00
Raúl Kripalani 274b07f50a Merge branch 'master' into plan/deal-stress-test 2020-07-01 17:38:56 +01:00
Raúl Kripalani e7488209c8 refactor soup: assemble testkit; separate test case logic from node templates. (#88) 2020-07-01 17:29:09 +01:00
Yusef Napora 11bde71b92 fix log message 2020-07-01 12:09:58 -04:00
Yusef Napora cecdb0c896 halt drand during lotus chain sync 2020-07-01 12:09:58 -04:00
Yusef Napora 4cd197cb13 wait for drand chain to catchup in Resume 2020-07-01 12:09:58 -04:00
Yusef Napora 72426d21fb use latest sdk-go 2020-07-01 12:09:58 -04:00
Yusef Napora 4ac2de1ee5 add genesis_timestamp_offset to drand-halting testcase 2020-07-01 12:09:10 -04:00
Yusef Napora e14b716643 add suspend_events param to manifest 2020-07-01 12:09:10 -04:00
Yusef Napora f0c636f243 enable go build cache 2020-07-01 12:09:10 -04:00
Yusef Napora 8aef427fd8 implement halting as state machine 2020-07-01 12:09:10 -04:00
Yusef Napora 6c4e83f8a2 use global params in drand compositions 2020-07-01 12:06:50 -04:00
Yusef Napora 04311d6c1a fix rebase cruft 2020-07-01 12:06:50 -04:00
Yusef Napora 9cb809ac60 add DebugSpew helper 2020-07-01 12:05:45 -04:00
Yusef Napora 79b0472924 set gossipRelay field 2020-07-01 12:04:19 -04:00
Yusef Napora 818bdd49b8 fix default log level 2020-07-01 12:04:19 -04:00
Yusef Napora 8ec4eb8030 fix log level in drand-halting 2020-07-01 12:04:19 -04:00
Yusef Napora 45068f601a use testground selector 2020-07-01 12:04:19 -04:00
Yusef Napora 406bd5da84 define new test case for drand-halting 2020-07-01 12:04:19 -04:00
Yusef Napora 0b386f21d5 refactor drand node and implement halting 2020-07-01 12:02:40 -04:00
Yusef Napora 8469f67a38 set drand_period=1s 2020-07-01 11:57:36 -04:00
Anton Evangelatov e01b887bc8 wip 2020-07-01 11:57:36 -04:00
Raúl Kripalani de6d927914 go mod tidy. 2020-07-01 14:54:59 +01:00
Raúl Kripalani e5d6751b09 rename testkit.{Run=>Handle}DefaultRole. 2020-07-01 14:53:34 +01:00
Raúl Kripalani 81f8451a23 iterate on testkit library. 2020-07-01 14:41:38 +01:00
Raúl Kripalani 436fe158c9 form testkit; separate test case logic from node templates. 2020-07-01 13:13:17 +01:00
Raúl Kripalani 7f3716504b refactor lotus recipes to make them more manageable. (#86)
- Each role now has its own file (role_*.go).
- Options have their own file (lotus_opts.go).
- Sync service constructions have their own file (sync.go).
- Utilities are functionally grouped in files ({deals,retrieval}.go).
2020-06-30 23:02:01 +01:00
Anton Evangelatov 035bf8b7db Merge pull request #82 from filecoin-project/sector-analysis-tools 2020-06-30 18:07:03 +02:00
Anton Evangelatov af582aff02 register and export lotus metrics (#84) 2020-06-30 18:02:02 +02:00
Anton Evangelatov 46beab3cf1 fixup 2020-06-30 17:59:42 +02:00
Anton Evangelatov 0a9af6ad5c extract startServer 2020-06-30 17:53:27 +02:00
Anton Evangelatov e3d2d2e7c1 extract withApiEndpoint 2020-06-30 17:50:21 +02:00
vyzo 903b1ea914 more logging for serial execution 2020-06-30 16:05:23 +03:00
Anton Evangelatov b62878c260 upgrade go-sdk 2020-06-30 14:47:09 +02:00
Anton Evangelatov 63bce1a426 extract starting of rpc servers 2020-06-30 13:56:24 +02:00
Anton Evangelatov 954ad1f396 fixup 2020-06-30 13:31:50 +02:00
Anton Evangelatov 33e60df301 resolved merge conflicts 2020-06-30 13:23:02 +02:00
Anton Evangelatov 204714a01f wip 2020-06-30 13:20:10 +02:00
Anton Evangelatov eec5c23671 working client rpc 2020-06-30 13:18:02 +02:00
vyzo 4595ded0d3 manifest and composition for deal stress test 2020-06-30 14:07:00 +03:00
vyzo 36f82ab9fe deal stress test 2020-06-30 13:57:54 +03:00
vyzo 62f63a29b5 remove useless error argument from retrieveData 2020-06-30 13:56:37 +03:00
vyzo 24730e158b Merge pull request #76 from filecoin-project/feat/mine-natural-time
Option to mine in natural time
2020-06-29 20:24:19 +03:00
vyzo 6b44e6d0d8 update composition-natural.toml 2020-06-29 20:06:38 +03:00
vyzo 79246e6ee9 record shutting down message in a more pertinent place 2020-06-29 20:05:44 +03:00
vyzo cced69e496 add composition for natural time test 2020-06-29 20:05:44 +03:00
vyzo da85855a6b option to turn on natural time mining 2020-06-29 20:05:43 +03:00
Anton Evangelatov 6c8abeb067 Merge pull request #78 from filecoin-project/fix-compositions
fix compositions
2020-06-29 19:04:08 +02:00
Anton Evangelatov b3b89b2072 Merge pull request #77 from filecoin-project/seq-num-for-all-miners
get seq num based on role, not based on group
2020-06-29 19:02:25 +02:00
Anton Evangelatov 05e5c42f33 fix compositions 2020-06-29 19:00:18 +02:00
Anton Evangelatov b47641f1c2 introduce 2 groups of miners 2020-06-29 18:48:10 +02:00
Anton Evangelatov 22ac7debb9 fixup 2020-06-29 18:42:05 +02:00
Anton Evangelatov 50b9a7f212 get seq num based on role, not based on group 2020-06-29 18:38:28 +02:00
vyzo ea2935e4d7 Merge pull request #75 from filecoin-project/synchronise-miners
sync miners
2020-06-29 19:01:49 +03:00
Anton Evangelatov 0ec247de8c fix broken counter 2020-06-29 17:21:50 +02:00
Anton Evangelatov c4347c0485 wip 2020-06-29 17:10:31 +02:00
Anton Evangelatov 909c12c6b4 sync miners 2020-06-29 17:06:04 +02:00
Anton Evangelatov 222d718ccd wip 2020-06-29 14:57:55 +02:00
Anton Evangelatov 666023f804 Merge pull request #72 from filecoin-project/basic-metrics
basic metrics to baseline tests
2020-06-29 13:41:50 +02:00
Anton Evangelatov 38132cdb94 go-sdk from master 2020-06-26 23:44:04 +02:00
Anton Evangelatov ba645cfbea better dashboard 2020-06-26 23:12:03 +02:00
Anton Evangelatov 2b9a6d8574 better dashboard 2020-06-26 22:56:43 +02:00
Anton Evangelatov 0d908c18b4 who mined block 2020-06-26 22:07:49 +02:00
Anton Evangelatov 0487d60d0e better metrics 2020-06-26 18:56:09 +02:00
Anton Evangelatov 018406b50c better dashboard 2020-06-26 18:27:23 +02:00
Anton Evangelatov e388d96073 metric for offer 2020-06-26 18:19:40 +02:00
Anton Evangelatov 5fa2c1c410 more compositions 2020-06-26 18:18:44 +02:00
Anton Evangelatov f91364fb3e extract common vars 2020-06-26 17:00:13 +02:00
Anton Evangelatov 943d9a27ec update dashboard data source 2020-06-26 17:00:13 +02:00
Anton Evangelatov 3ff084b720 baseline test dashboard 2020-06-26 17:00:13 +02:00
Anton Evangelatov d7631fb997 basic timers and counters 2020-06-26 17:00:13 +02:00
vyzo 2256a7237c Merge pull request #74 from filecoin-project/bug-fixes
A couple of bug fixes
2020-06-26 17:50:53 +03:00
vyzo b7403fd93c fix mining termination race condition 2020-06-26 17:44:40 +03:00
vyzo 3d5f58c8b8 sort preseals by miner GroupSeq 2020-06-26 17:30:44 +03:00
vyzo f7af27f1d2 fix miner synchronization 2020-06-26 17:27:10 +03:00
vyzo 119defc5e7 Merge pull request #71 from filecoin-project/pubsub-tracer
Pubsub tracing
2020-06-26 17:20:55 +03:00
vyzo 2a8333e0e4 gomod: update go-libp2p-pubsub-tracer@master 2020-06-26 17:16:50 +03:00
vyzo 95c3229f89 Merge branch 'pubsub-tracer' of github.com:filecoin-project/oni into pubsub-tracer 2020-06-26 14:12:58 +03:00
vyzo 909e0e401f define enable_pubsub_tracer in manifest.toml 2020-06-26 14:12:22 +03:00
vyzo b1159b657d log close errors with RecordMessage 2020-06-26 14:10:39 +03:00
vyzoandAnton Evangelatov 30a6361a8f fix typo
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
2020-06-26 14:06:45 +03:00
vyzo eb65f1e441 output the tracer logs under TestOutputPath 2020-06-26 13:14:28 +03:00
vyzo a612b77cee simplify code by removing extraneous conversion to multiaddr
just Cast to verify correctness and panic if something is wrong
2020-06-26 12:16:36 +03:00
vyzo 16149b9198 add composition with pubsub tracing 2020-06-26 12:05:08 +03:00
vyzo 00f137ba3e add pubsub-tracer role to baseline 2020-06-26 12:04:20 +03:00
vyzo 71503cce8b add pubsub tracer config to scaffolding 2020-06-26 11:58:56 +03:00
vyzo 1c2af85b20 pubsub tracer role 2020-06-26 11:49:24 +03:00
vyzo 3ff9045178 gomod: import go-libp2p-pubsub-tracer@feat/traced-lib and go-libp2p 2020-06-26 11:49:14 +03:00
Yusef Napora c66dfe1c03 Merge pull request #53 from filecoin-project/feat/drand-setup
initial drand setup
2020-06-25 13:07:26 -04:00
Yusef Napora 19f0aa75eb rm resources block from drand composition 2020-06-25 13:01:46 -04:00
Yusef Napora 8b0f6c355c read from sub.Done() 2020-06-25 13:00:55 -04:00
Yusef Napora 3cbf5efddd use temp dir for drand state 2020-06-25 12:38:40 -04:00
Yusef Napora fda66f5bd9 move drand to common_roles & fix mock randomness override 2020-06-25 12:18:08 -04:00
Yusef Napora 3f15146c19 add composition with mock randomness 2020-06-25 12:18:08 -04:00
Anton Evangelatov f11d726ddc Merge pull request #65 from filecoin-project/move-rolling-build-config-to-composition
move rolling build config to composition file, not manifest
2020-06-25 17:48:18 +02:00
Yusef Napora 75ff8d0689 add random_beacon_type param, default to mock randomness 2020-06-25 11:35:55 -04:00
Yusef Napora e225a644f4 run drand gossip relays alongside each drand node 2020-06-25 11:35:55 -04:00
Yusef Napora 4a337785b5 rebase drand setup onto master 2020-06-25 11:35:55 -04:00
vyzo 1230430c94 Merge pull request #66 from filecoin-project/plan/common-roles
extract common roles for bootstrapper and miner
2020-06-25 18:35:39 +03:00
vyzo b0c3963506 extract common roles for bootstrapper and miner 2020-06-25 18:29:01 +03:00
Anton Evangelatov 050a0c1000 add bzr to buildbase 2020-06-25 15:36:30 +02:00
Anton Evangelatov 8588cce4d5 move rolling build config to composition file, not manifest 2020-06-25 15:24:53 +02:00
Anton Evangelatov fa224271a1 Merge pull request #57 from filecoin-project/basic-deal-flow
baseline test: basic deal flow
2020-06-25 14:39:17 +02:00
Anton Evangelatov 7898451236 min 100ms between blocks 2020-06-25 14:37:59 +02:00
Anton Evangelatov 67b1bb6178 better default for k8s composition 2020-06-25 14:30:02 +02:00
vyzo 548ee4a206 Merge pull request #64 from filecoin-project/basic-deal-flow-api
Basic deal flow: use the full node api
2020-06-25 15:29:44 +03:00
vyzo 0c00b8b2ab use temporary file instead of hardcoding /tmp/data for deal data 2020-06-25 15:27:11 +03:00
vyzo 889b440bb1 use the full node api instead of breaking abstraction barriers 2020-06-25 15:14:27 +03:00
vyzo 6f298b929e Merge pull request #63 from filecoin-project/basic-deal-flow-cleanup
Basic deal flow: some clean up and multi client/miner test readiness
2020-06-25 14:50:30 +03:00
vyzo 1eeeff82d1 use a single context for miner 2020-06-25 14:26:43 +03:00
vyzo b476bc86ce synchronize all miners to mine next block 2020-06-25 14:16:04 +03:00
vyzo 58923fe2ff some baseline cleanup
1. Miners wait for all client's signal to stop mining
2. Miners don't care about client addresses
3. Moved collect methods to node.go
2020-06-25 14:10:00 +03:00
vyzo 5cccc81abf keep log level at WARN so that we see what's happening in the system 2020-06-25 13:52:02 +03:00
Anton Evangelatov 831cd2e71d move init to node.go 2020-06-25 12:33:52 +02:00
Anton Evangelatov 9f9c30d406 speed up block mining 2020-06-25 12:21:14 +02:00
Raúl Kripalani 1cb087c99e update issue templates + labels. 2020-06-25 11:14:49 +01:00
Anton Evangelatov ae3fcca543 barrier for stop mining, instead of sleep 2020-06-25 12:00:56 +02:00
Anton Evangelatov 801a4f79b9 completed deal 2020-06-24 18:15:52 +02:00
Anton Evangelatov 98bc576888 insecure post validation 2020-06-24 17:39:37 +02:00
Anton Evangelatov bb758854fb move init to main, add more logging 2020-06-24 16:46:12 +02:00
Anton Evangelatov f460d24f65 fixup 2020-06-24 16:12:10 +02:00
Anton Evangelatov b026160c5c mine longer 2020-06-24 15:48:15 +02:00
Anton Evangelatov fe842823a9 mine more blocks 2020-06-24 15:45:32 +02:00
Anton Evangelatov 65dff05008 bump up balances 2020-06-24 15:42:34 +02:00
Anton Evangelatov d4f883c1b0 connect miner node to its full node??? 2020-06-24 15:40:30 +02:00
Anton Evangelatov e8f037cac8 broken mining and deal sealing 2020-06-24 15:29:27 +02:00
Anton Evangelatov cca568112d start deal, need to add mining 2020-06-24 15:16:10 +02:00
Anton Evangelatov db19764130 generate random data, start deal 2020-06-24 15:10:05 +02:00
Anton Evangelatov 2379ff1740 composition for k8s, better error logging on collect addrs 2020-06-24 14:50:06 +02:00
Anton Evangelatov f6da7679b8 connect client to miner; fix topic bug 2020-06-24 14:40:29 +02:00
Anton Evangelatov b0d0a7a04a improvements 2020-06-24 14:34:19 +02:00
Anton Evangelatov f1181ce9c2 broadcast addrs, and connect miner and client 2020-06-24 14:34:19 +02:00
Anton Evangelatov e9402da131 fix ignored barrier (#58) 2020-06-24 14:33:31 +02:00
vyzo 04a945531c Merge pull request #56 from filecoin-project/extract-subscriptions-and-check-for-errors
extract subscriptions for balances, genesis and preseals
2020-06-24 15:07:12 +03:00
Anton Evangelatov ebd0e85d65 extract subscriptions 2020-06-24 13:10:35 +02:00
vyzo 2bfbc6a314 Merge pull request #55 from filecoin-project/fix/bug
use the role map, luke!
2020-06-24 14:07:21 +03:00
vyzo 0e924edf0e use the role map, luke! 2020-06-24 14:02:20 +03:00
vyzoandAnton Evangelatov 448bbf3710 generic test plan scaffolding, with baseline plan (#39)
* test plan scaffolding

* generify the testplan role dispatch

* manifest.toml

* initial go.mod and go.sum

* correct name

* gomod: update from build

* node construction in scaffolding

* fix test runner return type

* remove offending comments

* add initial composition, and fix context bug

* debug lines

* check errors from node construction

* specify Repo after Online option

* add power/proof type initialization code

* fix baseline composition

* use new docker-images (build/run) introduced in the #48 PR

* upgrade go-sdk to master (#51)

* fix types for run.InvokeMap

* fix miner actor sequence address

* explictly specify listen address for nodes on the data network

* make a separate full node for the miner

* initialize the wallet for the full node before creating the storage node

* go mod tidy

* also set the listen address for the miner node

* circleci to build the soup testplan

* extract topics

* test runner: pass the role map to doRun for generic runner

* use a wrapper TestEnvironment to encapsulate the runenv and initCtx

* embed RunEnv and InitContext into TestEnvironment for better ergonomics

* remove empty import

* extract stateReady

Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
2020-06-24 12:52:23 +02:00
Raúl Kripalani 1907fe2a91 update team in README.md. 2020-06-23 20:00:14 +01:00
Anton Evangelatov 021c0386f8 add circleci build job (#52) 2020-06-23 19:59:39 +01:00
Yusef Napora f72616981e Merge pull request #43 from filecoin-project/feat/composer
Add "composer" configuration UI
2020-06-23 11:20:47 -04:00
Anton Evangelatov 6eddd62a73 handle get_host_ip on macos 2020-06-23 10:02:05 -04:00
Anton Evangelatov 306efa66c7 random fixes 2020-06-23 10:02:05 -04:00
Yusef Napora 0bfaa46ce7 add readme 2020-06-23 10:02:05 -04:00
Yusef Napora 91b9cdfae5 make sure each group gets its own param objects 2020-06-23 10:02:05 -04:00
Yusef Napora 6f12d797d2 stringify test params 2020-06-23 10:02:05 -04:00
Yusef Napora 86a4d6f607 allow renaming groups via ui 2020-06-23 10:02:05 -04:00
Yusef Napora a60a4c507a fix groups for existing compositions 2020-06-23 10:02:05 -04:00
Yusef Napora 7bbde459f3 refactor groups ui 2020-06-23 10:02:05 -04:00
Yusef Napora 4a961401fc set default builder & runner from manifest 2020-06-23 10:02:05 -04:00
Yusef Napora 9eab4cfa0d new composition flow working e2e, some rough edges 2020-06-23 10:02:05 -04:00
Yusef Napora 92409c321c skip docker build if SKIP_BUILD is set 2020-06-23 10:02:05 -04:00
Yusef Napora 9e348c049b test runner working in docker 2020-06-23 10:02:05 -04:00
Yusef Napora c9dbf908b5 build testground and copy to run image 2020-06-23 10:02:05 -04:00
Yusef Napora 202cdda358 update global config with manifest 2020-06-23 10:02:05 -04:00
Yusef Napora 6eae66728b create new composition or load existing 2020-06-23 10:02:05 -04:00
Yusef Napora e262320348 launch panel server from docker 2020-06-23 10:02:05 -04:00
Yusef Napora 9323fd896a wip, jupyter in docker 2020-06-23 10:02:00 -04:00
Raúl Kripalani f29141b855 simplify the docker build base and runtime images + remove the go.rice trickery (#48)
* adjust the prototype for building oni test plans.

- We no longer clone the entire lotus codebase.
- We only clone and build the ffi module in the build image.
- The runtime image no longer builds the ffi module.
- The runtime image uses go-paramfetch to fetch the parameters
  (which are not expected to change).
- We use filecoin-project/lotus#2097 to not have to deal with
  go.rice trickery for things we don't actually need to use.

* add filecoin-ffi submodule (commit ca281af); fix replace directive.

* remove stale file.

* tag build base images.

* fix build.sh.

* delete filecoin-ffi submodule from root.

* add filecoin-ffi submodule under extra/filecoin-ffi.

* adjust everything to use extra sources TG feature.
2020-06-23 15:20:47 +02:00
Anton Evangelatov 6f8706818d move docker images (#47) 2020-06-22 19:14:45 +02:00
Anton Evangelatov 512915b4c9 use runtime image for lotus testplans (#35)
* use runtime image

* no need to compile with `make 2k`

* use new go-sdk /2 (#36)

* use new go-sdk

* use custom runtime image (#38)

* improve runtime image

* remove redundant runners

* enable go build cache

* remove replace lotus directive

* add git clone for lotus as part of manifest.toml

* use base build image

* compile `lotus-testground` on `current master` from Lotus (#41)

* automated scripts to build/push base build and runtime images

* go mod tidy and new version of lotus in manifest

* fix types

* fix storage miner (#42)

* fix storage miner

* update runtime image to ubuntu
2020-06-22 17:17:42 +02:00
Anton Evangelatov c176f24d05 correct commit (#34) 2020-06-18 15:52:29 +02:00
Anton Evangelatov 087e60299b Merge pull request #30 from filecoin-project/lotus-testground-initial
testplan instantiating lotus nodes in-memory
2020-06-18 14:54:44 +02:00
Anton Evangelatov 73c5153ef1 lock version for lotus, that testplan compiles with 2020-06-18 14:05:11 +02:00
Anton Evangelatov 2863b5a8c6 remove Dockerfile 2020-06-17 19:05:30 +02:00
Anton Evangelatov 1b92795d93 remove Makefile 2020-06-17 19:05:00 +02:00
Anton Evangelatov 3cc6fb6c6e compile and run lotus net with docker:go 2020-06-17 19:02:04 +02:00
Anton Evangelatov 3ca1593919 build with docker:generic 2020-06-17 18:17:28 +02:00
Anton Evangelatov 6f4599be9a initial commit 2020-06-17 16:36:11 +02:00
Raúl Kripalani 4b6a677b57 test scenario request issue template: fix markup. 2020-06-11 14:44:30 +01:00
Raúl Kripalani 6e9dbf4c18 Add "Test scenario request" issue template 2020-06-11 14:42:27 +01:00
Raúl Kripalani 3d891e26dd add declarative labels to repo. (#6) 2020-06-11 13:17:16 +01:00
Raúl Kripalani 139f7f6322 add a notes folder. 2020-06-11 11:02:41 +01:00
Rob Matarangas a5e4bf63c5 Delete label-syncer.yml 2020-06-10 16:29:07 -07:00
Rob Matarangas 2af3fd4a8c Merge pull request #3 from filecoin-project/Robmat05-patch-2
insert discomfort labels.yml
2020-06-10 16:01:34 -07:00
Rob Matarangas 69ae58f7ba Create labels.yml 2020-06-10 16:00:35 -07:00
Rob Matarangas 7e7b19b904 Merge pull request #2 from filecoin-project/Robmat05-patch-1
Create label-syncer.yml
2020-06-10 15:37:49 -07:00
Rob Matarangas f4e6231358 Create label-syncer.yml
Installing Labeler workflow
2020-06-10 15:37:32 -07:00
Raúl Kripalani 0c909251aa Update README.md 2020-06-10 21:04:31 +01:00
Raúl Kripalani 2ef46a3165 Initial commit 2020-06-09 14:19:25 +01:00
977 changed files with 137526 additions and 21060 deletions
+666 -80
View File
@@ -1,15 +1,17 @@
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.14.6
- image: circleci/golang:1.16.4
resource_class: 2xlarge
ubuntu:
docker:
- image: ubuntu:19.10
- image: ubuntu:20.04
commands:
install-deps:
@@ -34,7 +36,7 @@ commands:
condition: << parameters.linux >>
steps:
- run: sudo apt-get update
- run: sudo apt-get install ocl-icd-opencl-dev
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
- run: git submodule sync
- run: git submodule update --init
download-params:
@@ -110,7 +112,7 @@ jobs:
- run:
command: make debug
test: &test
test:
description: |
Run tests with gotestsum.
parameters: &test-params
@@ -121,20 +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"
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
@@ -142,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.
@@ -160,24 +162,24 @@ jobs:
- run:
name: go test
environment:
LOTUS_TEST_WINDOW_POST: << parameters.winpost-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:
@@ -188,18 +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-conformance:
description: |
Run tests using a corpus of interoperable test vectors for Filecoin
@@ -262,24 +252,97 @@ jobs:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-artifacts/conformance-coverage.html
build-lotus-soup:
build-ntwk-calibration:
description: |
Compile `lotus-soup` Testground test plan using the current version of Lotus.
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/oni && git submodule sync
- run: cd extern/oni && git submodule update --init
- run: cd extern/filecoin-ffi && make
- run:
name: "replace lotus, filecoin-ffi, blst and fil-blst deps"
command: cd extern/oni/lotus-soup && go mod edit -replace github.com/filecoin-project/lotus=../../../ && go mod edit -replace github.com/filecoin-project/filecoin-ffi=../../filecoin-ffi && go mod edit -replace github.com/supranational/blst=../../fil-blst/blst && go mod edit -replace github.com/filecoin-project/fil-blst=../../fil-blst
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 extern/oni/lotus-soup && go build -tags=testground .
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:
@@ -294,8 +357,8 @@ jobs:
- run:
name: Install go
command: |
curl -O https://dl.google.com/go/go1.14.2.darwin-amd64.pkg && \
sudo installer -pkg go1.14.2.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
@@ -309,6 +372,15 @@ jobs:
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" }}
@@ -334,6 +406,41 @@ jobs:
- "~/.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:
@@ -342,7 +449,7 @@ jobs:
- run:
command: "! go fmt ./... 2>&1 | read"
cbor-gen-check:
gen-check:
executor: golang
steps:
- install-deps
@@ -350,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: go generate ./...
- 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
@@ -359,8 +469,19 @@ jobs:
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
@@ -422,6 +543,237 @@ 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
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
@@ -431,73 +783,307 @@ 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:
go-test-flags: "-run=TestWindowedPost"
winpost-test: "1"
test-suite-name: window-post
- test-short:
go-test-flags: "--timeout 10m --short"
test-suite-name: short
filters:
tags:
only:
- /^v\d+\.\d+\.\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
- build-lotus-soup
- trigger-testplans:
filters:
branches:
only:
- master
- build-debug
- build-all:
requires:
- test-short
filters:
tags:
only:
- /^v\d+\.\d+\.\d+$/
- /^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:
requires:
- test-short
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+$/
- /^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+$/
- /^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
+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
+10
View File
@@ -5,5 +5,15 @@ ignore:
- "api/test/*"
- "gen/**/*"
- "gen/*"
- "cmd/lotus-shed/*"
- "cmd/tvx/*"
- "cmd/lotus-pcr/*"
- "cmd/tvx/*"
- "cmd/lotus-chainwatch/*"
- "cmd/lotus-health/*"
- "cmd/lotus-fountain/*"
- "cmd/lotus-townhall/*"
- "cmd/lotus-stats/*"
- "cmd/lotus-pcr/*"
github_checks:
annotations: false
+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 @whyrusleeping @Kubuxu
### Conformance testing.
conformance/ @raulk
extern/test-vectors @raulk
cmd/tvx @raulk
# Global owners
# Ensure maintainers team is a requested reviewer for non-draft PRs
* @filecoin-project/lotus-maintainers
-27
View File
@@ -1,27 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**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.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Version (run `lotus version`):**
**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
+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
@@ -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
-43
View File
@@ -1,43 +0,0 @@
---
name: Sealing Issues
about: Create a report for help with sealing (commit) failures.
title: ''
labels: 'sealing'
assignees: ''
---
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 proving (sealing) a sector.
Including what commands you ran, and a description of your setup, is very helpful.
**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
**Version**
The output of `lotus --version`.
+69
View File
@@ -0,0 +1,69 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- 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
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@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 }}
+7
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
@@ -13,6 +17,9 @@
/lotus-gateway
/lotus-pcr
/lotus-wallet
/lotus-keygen
/docgen-md
/docgen-openrpc
/bench.json
/lotuspond/front/node_modules
/lotuspond/front/build
+1 -8
View File
@@ -1,16 +1,9 @@
[submodule "extern/filecoin-ffi"]
path = extern/filecoin-ffi
url = https://github.com/filecoin-project/filecoin-ffi.git
branch = master
[submodule "extern/serialization-vectors"]
path = extern/serialization-vectors
url = https://github.com/filecoin-project/serialization-vectors
url = https://github.com/filecoin-project/serialization-vectors.git
[submodule "extern/test-vectors"]
path = extern/test-vectors
url = https://github.com/filecoin-project/test-vectors.git
[submodule "extern/fil-blst"]
path = extern/fil-blst
url = https://github.com/filecoin-project/fil-blst.git
[submodule "extern/oni"]
path = extern/oni
url = https://github.com/filecoin-project/oni
+6
View File
@@ -16,6 +16,12 @@ linters:
- deadcode
- scopelint
# We don't want to skip builtin/
skip-dirs-use-default: false
skip-dirs:
- vendor$
- testdata$
- examples$
issues:
exclude:
+1
View File
@@ -0,0 +1 @@
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" viewBox="0 0 127 127" xml:space="preserve" enable-background="new 0 0 127 127"><style type="text/css">.st0{fill:#00d2d6}.st1{fill:#fff}</style><g><path class="st0" d="M63.5,127C28.5,127.1-0.2,98.4,0,63.2C0.2,28.3,28.6-0.2,63.9,0c34.8,0.2,63.3,28.7,63.1,64 C126.7,98.7,98.5,127.1,63.5,127z M71.4,57.6c5.5,0.8,11,1.5,16.5,2.3c0.5-1.7,0.9-3.1,1.3-4.7c-5.7-0.8-11.2-1.7-17.1-2.5 c2-7,3.7-13.7,5.8-20.2c0.7-2.2,2.3-4.2,3.9-5.9c2.1-2.2,5-1.7,6.8,0.7c0.7,1,1.4,2.1,2.3,2.9c1.1,1.1,2.8,1.6,4,0.6 c0.8-0.7,0.7-2.4,0.8-3.6c0-0.5-0.6-1.1-1-1.6c-2-2.3-4.7-3.1-7.5-3.2c-6.3-0.3-10.9,3-14.5,7.8c-3.5,4.8-5.1,10.5-6.8,16.2 c-0.5,1.6-0.9,3.3-1.4,5.1c-6.2-0.9-12.1-1.7-18.2-2.6c-0.2,1.6-0.4,3.2-0.6,4.8c6,0.9,11.8,1.8,17.8,2.7c-0.8,3.4-1.5,6.5-2.3,9.7 c-5.8-0.8-11.4-1.6-17-2.4c-0.2,1.8-0.4,3.2-0.6,4.8c5.6,0.9,11,1.7,16.5,2.5c0,0.6,0.1,1,0,1.3c-1.7,7.4-3.4,14.8-5.3,22.2 c-0.9,3.5-2.4,6.9-5.3,9.3c-2.4,2-5,1.7-6.8-0.8c-0.8-1.1-1.5-2.5-2.6-3.3c-0.8-0.6-2.5-0.9-3.1-0.5c-0.9,0.7-1.5,2.2-1.4,3.3 c0.1,1,1,2.2,1.9,2.8c3,2.3,6.5,2.6,10,1.9c5.9-1.2,10.1-4.9,12.7-10.1c2-4.1,3.6-8.5,5-12.9c1.3-4,2.2-8,3.3-12.2 c5.8,0.8,11.5,1.7,17.3,2.5c0.5-1.7,0.9-3.2,1.4-4.8c-6.1-0.9-11.9-1.7-17.7-2.6C70.1,64,70.7,60.9,71.4,57.6z"/><path class="st1" d="M71.4,57.6c-0.7,3.3-1.3,6.4-2,9.8c5.9,0.9,11.7,1.7,17.7,2.6c-0.5,1.6-0.9,3.1-1.4,4.8 c-5.8-0.8-11.5-1.7-17.3-2.5c-1.1,4.2-2,8.3-3.3,12.2c-1.4,4.4-3,8.7-5,12.9c-2.6,5.2-6.8,8.9-12.7,10.1c-3.5,0.7-7,0.4-10-1.9 c-0.9-0.7-1.8-1.8-1.9-2.8c-0.1-1.1,0.5-2.7,1.4-3.3c0.6-0.5,2.3-0.1,3.1,0.5c1.1,0.8,1.8,2.1,2.6,3.3c1.8,2.5,4.4,2.9,6.8,0.8 c2.9-2.5,4.4-5.8,5.3-9.3c1.9-7.3,3.6-14.8,5.3-22.2c0.1-0.3,0-0.7,0-1.3c-5.4-0.8-10.8-1.7-16.5-2.5c0.2-1.6,0.4-3,0.6-4.8 c5.6,0.8,11.1,1.6,17,2.4c0.8-3.2,1.5-6.4,2.3-9.7c-6-0.9-11.7-1.8-17.8-2.7c0.2-1.6,0.4-3.2,0.6-4.8c6.1,0.9,12,1.7,18.2,2.6 c0.5-1.8,0.9-3.5,1.4-5.1c1.7-5.6,3.2-11.3,6.8-16.2c3.6-4.9,8.1-8.1,14.5-7.8c2.8,0.1,5.5,0.9,7.5,3.2c0.4,0.5,1,1.1,1,1.6 c-0.1,1.2,0,2.9-0.8,3.6c-1.1,1.1-2.8,0.5-4-0.6c-0.9-0.9-1.6-1.9-2.3-2.9c-1.8-2.4-4.7-2.9-6.8-0.7c-1.6,1.7-3.2,3.7-3.9,5.9 C75.7,39.4,74,46,72,53c5.9,0.9,11.4,1.7,17.1,2.5c-0.5,1.6-0.9,3.1-1.3,4.7C82.3,59.1,76.9,58.3,71.4,57.6z"/></g></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

+73
View File
@@ -0,0 +1,73 @@
version: 1
AppDir:
path: ./AppDir
app_info:
id: io.filecoin.lotus
name: Lotus
icon: icon
version: latest
exec: usr/bin/lotus
exec_args: $@
apt:
arch: amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted
universe multiverse
- sourceline: deb http://security.ubuntu.com/ubuntu focal-security main restricted
- sourceline: deb http://security.ubuntu.com/ubuntu focal-security universe
- sourceline: deb http://security.ubuntu.com/ubuntu focal-security multiverse
- sourceline: deb https://cli-assets.heroku.com/apt ./
- sourceline: deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu focal main
- sourceline: deb http://ppa.launchpad.net/git-core/ppa/ubuntu focal main
- sourceline: deb http://archive.canonical.com/ubuntu focal partner
include:
- ocl-icd-libopencl1
- libhwloc15
exclude: []
files:
include:
- /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
- /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
- /usr/lib/x86_64-linux-gnu/libm-2.31.so
- /usr/lib/x86_64-linux-gnu/libdl-2.31.so
- /usr/lib/x86_64-linux-gnu/libc-2.31.so
- /usr/lib/x86_64-linux-gnu/libudev.so.1.6.17
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
test:
fedora:
image: appimagecrafters/tests-env:fedora-30
command: ./AppRun
use_host_x: true
debian:
image: appimagecrafters/tests-env:debian-stable
command: ./AppRun
use_host_x: true
arch:
image: appimagecrafters/tests-env:archlinux-latest
command: ./AppRun
use_host_x: true
centos:
image: appimagecrafters/tests-env:centos-7
command: ./AppRun
use_host_x: true
ubuntu:
image: appimagecrafters/tests-env:ubuntu-xenial
command: ./AppRun
use_host_x: true
AppImage:
arch: x86_64
update-information: guess
sign-key: None
+1105 -28
View File
File diff suppressed because it is too large Load Diff
+228
View File
@@ -0,0 +1,228 @@
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
ARG RUST_VERSION=nightly
ENV XDG_CACHE_HOME="/tmp"
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN wget "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init"; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;
FROM builder-deps AS builder-local
MAINTAINER Lotus Development Team
COPY ./ /opt/filecoin
WORKDIR /opt/filecoin
RUN make clean deps
FROM builder-local AS builder
MAINTAINER Lotus Development Team
WORKDIR /opt/filecoin
ARG RUSTFLAGS=""
ARG GOFLAGS=""
RUN make lotus lotus-miner lotus-worker lotus-shed lotus-wallet lotus-gateway
FROM ubuntu:20.04 AS base
MAINTAINER Lotus Development Team
# Base resources
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
COPY --from=builder /lib/x86_64-linux-gnu/libdl.so.2 /lib/
COPY --from=builder /lib/x86_64-linux-gnu/librt.so.1 /lib/
COPY --from=builder /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/
COPY --from=builder /lib/x86_64-linux-gnu/libutil.so.1 /lib/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libltdl.so.7 /lib/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libnuma.so.1 /lib/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libhwloc.so.5 /lib/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /lib/
RUN useradd -r -u 532 -U fc
###
FROM base AS lotus
MAINTAINER Lotus Development Team
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
RUN chown fc: /var/lib/lotus /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/lotus
VOLUME /var/tmp/filecoin-proof-parameters
USER fc
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
+119 -33
View File
@@ -5,10 +5,10 @@ all: build
unexport GOFLAGS
GOVERSION:=$(shell go version | cut -d' ' -f 3 | cut -d. -f 2)
ifeq ($(shell expr $(GOVERSION) \< 14), 1)
$(warning Your Golang version is go 1.$(GOVERSION))
$(error Update Golang to version $(shell grep '^go' go.mod))
GOVERSION:=$(shell go version | cut -d' ' -f 3 | sed 's/^go//' | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
ifeq ($(shell expr $(GOVERSION) \< 1016000), 1)
$(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell expr $(GOVERSION) % 1000000 / 1000).$(shell expr $(GOVERSION) % 1000))
$(error Update Golang to version to at least 1.16.0)
endif
# git modules that need to be loaded
@@ -41,8 +41,13 @@ MODULES+=$(FFI_PATH)
BUILD_DEPS+=build/.filecoin-install
CLEAN+=build/.filecoin-install
$(MODULES): build/.update-modules ;
ffi-version-check:
@[[ "$$(awk '/const Version/{print $$5}' extern/filecoin-ffi/version.go)" -eq 3 ]] || (echo "FFI version mismatch, update submodules"; exit 1)
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:
git submodule update --init --recursive
@@ -57,38 +62,49 @@ CLEAN+=build/.update-modules
deps: $(BUILD_DEPS)
.PHONY: deps
build-devnets: build lotus-seed lotus-shed lotus-wallet lotus-gateway
.PHONY: build-devnets
debug: GOFLAGS+=-tags=debug
debug: lotus lotus-miner lotus-worker lotus-seed
debug: build-devnets
2k: GOFLAGS+=-tags=2k
2k: lotus lotus-miner lotus-worker lotus-seed
2k: build-devnets
calibnet: GOFLAGS+=-tags=calibnet
calibnet: build-devnets
nerpanet: GOFLAGS+=-tags=nerpanet
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
@@ -115,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
@@ -154,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
@@ -173,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 -o lotus-stats ./cmd/lotus-stats
go run github.com/GeertJohan/go.rice/rice append --exec lotus-stats -i ./build
go build $(GOFLAGS) -o lotus-stats ./cmd/lotus-stats
.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
@@ -204,14 +216,33 @@ lotus-wallet:
.PHONY: lotus-wallet
BINS+=lotus-wallet
lotus-keygen:
rm -f lotus-keygen
go build -o lotus-keygen ./cmd/lotus-keygen
.PHONY: lotus-keygen
BINS+=lotus-keygen
testground:
go build -tags testground -o /dev/null ./cmd/lotus
.PHONY: testground
BINS+=testground
tvx:
rm -f tvx
go build -o tvx ./cmd/tvx
.PHONY: tvx
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
@@ -272,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)
@@ -294,17 +318,79 @@ dist-clean:
git submodule deinit --all -f
.PHONY: dist-clean
type-gen:
type-gen: api-gen
go run ./gen/main.go
go generate ./...
go generate -x ./...
goimports -w api/
method-gen:
method-gen: api-gen
(cd ./lotuspond/front/src/chain && go run ./methodgen.go)
gen: type-gen method-gen
actors-gen:
go run ./chain/actors/agen
go fmt ./...
docsgen:
go run ./api/docgen > documentation/en/api-methods.md
api-gen:
go run ./gen/api
goimports -w api
goimports -w api
.PHONY: api-gen
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
cp ./lotus AppDir/usr/bin/
appimage-builder
docsgen: docsgen-md docsgen-openrpc
docsgen-md-bin: api-gen actors-gen
go build $(GOFLAGS) -o docgen-md ./api/docgen/cmd
docsgen-openrpc-bin: api-gen actors-gen
go build $(GOFLAGS) -o docgen-openrpc ./api/docgen-openrpc/cmd
docsgen-md: docsgen-md-full docsgen-md-storage docsgen-md-worker
docsgen-md-full: docsgen-md-bin
./docgen-md "api/api_full.go" "FullNode" "api" "./api" > documentation/en/api-v1-unstable-methods.md
./docgen-md "api/v0api/full.go" "FullNode" "v0api" "./api/v0api" > documentation/en/api-v0-methods.md
docsgen-md-storage: docsgen-md-bin
./docgen-md "api/api_storage.go" "StorageMiner" "api" "./api" > documentation/en/api-v0-methods-miner.md
docsgen-md-worker: docsgen-md-bin
./docgen-md "api/api_worker.go" "Worker" "api" "./api" > documentation/en/api-v0-methods-worker.md
docsgen-openrpc: docsgen-openrpc-full docsgen-openrpc-storage docsgen-openrpc-worker
docsgen-openrpc-full: docsgen-openrpc-bin
./docgen-openrpc "api/api_full.go" "FullNode" "api" "./api" -gzip > build/openrpc/full.json.gz
docsgen-openrpc-storage: docsgen-openrpc-bin
./docgen-openrpc "api/api_storage.go" "StorageMiner" "api" "./api" -gzip > build/openrpc/miner.json.gz
docsgen-openrpc-worker: docsgen-openrpc-bin
./docgen-openrpc "api/api_worker.go" "Worker" "api" "./api" -gzip > build/openrpc/worker.json.gz
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin
gen: actors-gen type-gen method-gen cfgdoc-gen docsgen api-gen circleci
@echo ">>> IF YOU'VE MODIFIED THE CLI, REMEMBER TO ALSO MAKE docsgen-cli"
.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
+108 -17
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.14.7-blue.svg" /></a>
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.16-blue.svg" /></a>
<br>
</p>
@@ -18,30 +18,121 @@ 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
Please send an email to security@filecoin.org. See our [security policy](SECURITY.md) for more details.
## Development
## Related packages
The main branches under development at the moment are:
* [`master`](https://github.com/filecoin-project/lotus): current testnet.
* [`next`](https://github.com/filecoin-project/lotus/tree/next): working branch with chain-breaking changes.
* [`ntwk-calibration`](https://github.com/filecoin-project/lotus/tree/ntwk-calibration): devnet running one of `next` commits.
These repos are independent and reusable modules, but are tightly integrated into Lotus to make up a fully featured Filecoin implementation:
### Tracker
All work is tracked via issues. An attempt at keeping an up-to-date view on remaining work towards Mainnet launch can be seen at the [lotus github project board](https://github.com/orgs/filecoin-project/projects/8). The issues labeled with `incentives` are there to identify the issues needed for Space Race launch.
### Packages
The lotus Filecoin implementation unfolds into the following packages:
- [This repo](https://github.com/filecoin-project/lotus)
- [go-fil-markets](https://github.com/filecoin-project/go-fil-markets) which has its own [kanban work tracker available here](https://app.zenhub.com/workspaces/markets-shared-components-5daa144a7046a60001c6e253/board)
- [spec-actors](https://github.com/filecoin-project/specs-actors) which has its own [kanban work tracker available here](https://app.zenhub.com/workspaces/actors-5ee6f3aa87591f0016c05685/board)
- [specs-actors](https://github.com/filecoin-project/specs-actors) which has its own [kanban work tracker available here](https://app.zenhub.com/workspaces/actors-5ee6f3aa87591f0016c05685/board)
## Contribute
Lotus is a universally open project and welcomes contributions of all kinds: code, docs, and more. However, before making a contribution, we ask you to heed these recommendations:
1. If the proposal entails a protocol change, please first submit a [Filecoin Improvement Proposal](https://github.com/filecoin-project/FIPs).
2. If the change is complex and requires prior discussion, [open an issue](github.com/filecoin-project/lotus/issues) or a [discussion](https://github.com/filecoin-project/lotus/discussions) to request feedback before you start working on a pull request. This is to avoid disappointment and sunk costs, in case the change is not actually needed or accepted.
3. Please refrain from submitting PRs to adapt existing code to subjective preferences. The changeset should contain functional or technical improvements/enhancements, bug fixes, new features, or some other clear material contribution. Simple stylistic changes are likely to be rejected in order to reduce code churn.
When implementing a change:
1. Adhere to the standard Go formatting guidelines, e.g. [Effective Go](https://golang.org/doc/effective_go.html). Run `go fmt`.
2. Stick to the idioms and patterns used in the codebase. Familiar-looking code has a higher chance of being accepted than eerie code. Pay attention to commonly used variable and parameter names, avoidance of naked returns, error handling patterns, etc.
3. Comments: follow the advice on the [Commentary](https://golang.org/doc/effective_go.html#commentary) section of Effective Go.
4. Minimize code churn. Modify only what is strictly necessary. Well-encapsulated changesets will get a quicker response from maintainers.
5. Lint your code with [`golangci-lint`](https://golangci-lint.run) (CI will reject your PR if unlinted).
6. Add tests.
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
+4 -4
View File
@@ -2,11 +2,11 @@
## Reporting a Vulnerability
For *critical* bugs, please consult our Security Policy and Responsible Disclosure Program information at https://github.com/filecoin-project/community/blob/master/SECURITY.md
For reporting security vulnerabilities/bugs, please consult our Security Policy and Responsible Disclosure Program information at https://github.com/filecoin-project/community/blob/master/SECURITY.md. Security vulnerabilities should be reported via our [Vulnerability Reporting channels](https://github.com/filecoin-project/community/blob/master/SECURITY.md#vulnerability-reporting) and will be eligible for a [Bug Bounty](https://security.filecoin.io/bug-bounty/).
Please try to provide a clear description of any bugs reported, along with how to reproduce the bug if possible. More detailed bug reports (especially those with a PoC included) will help us move forward much faster. Additionally, please avoid reporting bugs that already have open issues. Take a moment to search the issue list of the related GitHub repositories before writing up a new report.
Here are some examples of bugs we would consider 'critical':
Here are some examples of bugs we would consider to be security vulnerabilities:
* If you can spend from a `multisig` wallet you do not control the keys for.
* If you can cause a miner to be slashed without them actually misbehaving.
@@ -16,8 +16,8 @@ Here are some examples of bugs we would consider 'critical':
* If you can craft a message that causes a persistent fork in the network.
* If you can cause the total amount of Filecoin in the network to no longer be 2 billion.
This is not an exhaustive list, but should provide some idea of what we consider 'critical'.
This is not an exhaustive list, but should provide some idea of what we consider as a security vulnerability, .
## Reporting a non security bug
For non-critical bugs, please simply file a GitHub [issue](https://github.com/filecoin-project/lotus/issues/new?template=bug_report.md).
For non-security bugs, please simply file a GitHub [issue](https://github.com/filecoin-project/lotus/issues/new?template=bug_report.md).
+14
View File
@@ -0,0 +1,14 @@
## Lotus API
This package contains all lotus API definitions. Interfaces defined here are
exposed as JsonRPC 2.0 endpoints by lotus programs.
### Versions
| File | Alias File | Interface | Exposed by | Version | HTTP Endpoint | Status | Docs
|------------------|-------------------|----------------|--------------------|---------|---------------|------------------------------|------
| `api_common.go` | `v0api/latest.go` | `Common` | lotus; lotus-miner | v0 | `/rpc/v0` | Latest, Stable | [Methods](../documentation/en/api-v0-methods.md)
| `api_full.go` | `v1api/latest.go` | `FullNode` | lotus | v1 | `/rpc/v1` | Latest, **Work in progress** | [Methods](../documentation/en/api-v1-unstable-methods.md)
| `api_storage.go` | `v0api/latest.go` | `StorageMiner` | lotus-miner | v0 | `/rpc/v0` | Latest, Stable | [Methods](../documentation/en/api-v0-methods-miner.md)
| `api_worker.go` | `v0api/latest.go` | `Worker` | lotus-worker | v0 | `/rpc/v0` | Latest, Stable | [Methods](../documentation/en/api-v0-methods-worker.md)
| `v0api/full.go` | | `FullNode` | lotus | v0 | `/rpc/v0` | Stable | [Methods](../documentation/en/api-v0-methods.md)
+32 -48
View File
@@ -4,72 +4,61 @@ import (
"context"
"fmt"
"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"
"github.com/filecoin-project/lotus/build"
"github.com/google/uuid"
"github.com/filecoin-project/go-jsonrpc/auth"
)
type Common interface {
// 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 Common interface {
// MethodGroup: Auth
AuthVerify(ctx context.Context, token string) ([]auth.Permission, error)
AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)
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)
NetPeers(context.Context) ([]peer.AddrInfo, error)
NetConnect(context.Context, peer.AddrInfo) error
NetAddrsListen(context.Context) (peer.AddrInfo, error)
NetDisconnect(context.Context, peer.ID) error
NetFindPeer(context.Context, peer.ID) (peer.AddrInfo, error)
NetPubsubScores(context.Context) ([]PubsubScore, error)
NetAutoNatStatus(context.Context) (NatInfo, error)
NetAgentVersion(ctx context.Context, p peer.ID) (string, error)
// NetBandwidthStats returns statistics about the nodes total bandwidth
// usage and current rate across all peers and protocols.
NetBandwidthStats(ctx context.Context) (metrics.Stats, error)
// NetBandwidthStatsByPeer returns statistics about the nodes bandwidth
// usage and current rate per peer
NetBandwidthStatsByPeer(ctx context.Context) (map[string]metrics.Stats, error)
// NetBandwidthStatsByProtocol returns statistics about the nodes bandwidth
// usage and current rate per protocol
NetBandwidthStatsByProtocol(ctx context.Context) (map[protocol.ID]metrics.Stats, error)
LogList(context.Context) ([]string, error) //perm:write
LogSetLevel(context.Context, string, string) error //perm:write
// MethodGroup: Common
// ID returns peerID of libp2p node backing this API
ID(context.Context) (peer.ID, error)
// Version provides information about API provider
Version(context.Context) (Version, error)
Version(context.Context) (APIVersion, error) //perm:read
LogList(context.Context) ([]string, error)
LogSetLevel(context.Context, string, string) error
// 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
Shutdown(context.Context) error //perm:admin
Closing(context.Context) (<-chan struct{}, error)
// Session returns a random UUID of api provider session
Session(context.Context) (uuid.UUID, error) //perm:read
Closing(context.Context) (<-chan struct{}, error) //perm:read
}
// Version provides various build-time information
type Version struct {
// APIVersion provides various build-time information
type APIVersion struct {
Version string
// APIVersion is a binary encoded semver version of the remote implementing
// this api
//
// See APIVersion in build/version.go
APIVersion build.Version
APIVersion Version
// TODO: git commit / os / genesis cid?
@@ -77,11 +66,6 @@ type Version struct {
BlockDelay uint64
}
func (v Version) String() string {
func (v APIVersion) String() string {
return fmt.Sprintf("%s+api%s", v.Version, v.APIVersion.String())
}
type NatInfo struct {
Reachability network.Reachability
PublicAddr string
}
+408 -192
View File
File diff suppressed because it is too large Load Diff
+24 -5
View File
@@ -8,13 +8,27 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/dline"
"github.com/filecoin-project/go-state-types/network"
apitypes "github.com/filecoin-project/lotus/api/types"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
)
type GatewayAPI interface {
// MODIFYING THE API INTERFACE
//
// NOTE: This is the V1 (Unstable) API - to add methods to the V0 (Stable) API
// you'll have to add those methods to interfaces in `api/v0api`
//
// 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 Gateway interface {
ChainHasObj(context.Context, cid.Cid) (bool, error)
ChainHead(ctx context.Context) (*types.TipSet, error)
ChainGetBlockMessages(context.Context, cid.Cid) (*BlockMessages, error)
@@ -27,10 +41,11 @@ type GatewayAPI interface {
MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*MsigTransaction, error)
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)
StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, 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)
@@ -38,7 +53,11 @@ type GatewayAPI interface {
StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error)
StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*MinerPower, error)
StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error)
StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*MsgLookup, error)
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
}
+199 -53
View File
@@ -5,110 +5,205 @@ import (
"context"
"time"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/filecoin-project/go-address"
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-fil-markets/piecestore"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
"github.com/filecoin-project/specs-storage/storage"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
)
// 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
// StorageMiner is a low-level interface to the Filecoin network storage miner node
type StorageMiner interface {
Common
Net
ActorAddress(context.Context) (address.Address, error)
ActorAddress(context.Context) (address.Address, error) //perm:read
ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error)
ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error) //perm:read
ActorAddressConfig(ctx context.Context) (AddressConfig, error) //perm:read
MiningBase(context.Context) (*types.TipSet, error)
MiningBase(context.Context) (*types.TipSet, error) //perm:read
// Temp api for testing
PledgeSector(context.Context) error
PledgeSector(context.Context) (abi.SectorID, error) //perm:write
// Get the status of a given sector by ID
SectorsStatus(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (SectorInfo, error)
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)
SectorsList(context.Context) ([]abi.SectorNumber, error) //perm:read
SectorsRefs(context.Context) (map[string][]SealedRef, error)
// Get summary info of sectors
SectorsSummary(ctx context.Context) (map[SectorState]int, error) //perm:read
// List sectors in particular states
SectorsListInStates(context.Context, []SectorState) ([]abi.SectorNumber, error) //perm:read
SectorsRefs(context.Context) (map[string][]SealedRef, error) //perm:read
// SectorStartSealing can be called on sectors in Empty or WaitDeals states
// to trigger sealing early
SectorStartSealing(context.Context, abi.SectorNumber) error
SectorStartSealing(context.Context, abi.SectorNumber) error //perm:write
// SectorSetSealDelay sets the time that a newly-created sector
// waits for more deals before it starts sealing
SectorSetSealDelay(context.Context, time.Duration) error
SectorSetSealDelay(context.Context, time.Duration) error //perm:write
// SectorGetSealDelay gets the time that a newly-created sector
// waits for more deals before it starts sealing
SectorGetSealDelay(context.Context) (time.Duration, error)
SectorGetSealDelay(context.Context) (time.Duration, error) //perm:read
// SectorSetExpectedSealDuration sets the expected time for a sector to seal
SectorSetExpectedSealDuration(context.Context, time.Duration) error
SectorSetExpectedSealDuration(context.Context, time.Duration) error //perm:write
// SectorGetExpectedSealDuration gets the expected time for a sector to seal
SectorGetExpectedSealDuration(context.Context) (time.Duration, error)
SectorsUpdate(context.Context, abi.SectorNumber, SectorState) error
SectorRemove(context.Context, abi.SectorNumber) error
SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber) error
StorageList(ctx context.Context) (map[stores.ID][]stores.Decl, error)
StorageLocal(ctx context.Context) (map[stores.ID]string, error)
StorageStat(ctx context.Context, id stores.ID) (fsutil.FsStat, error)
SectorGetExpectedSealDuration(context.Context) (time.Duration, error) //perm:read
SectorsUpdate(context.Context, abi.SectorNumber, SectorState) error //perm:admin
// SectorRemove removes the sector from storage. It doesn't terminate it on-chain, which can
// be done with SectorTerminate. Removing and not terminating live sectors will cause additional penalties.
SectorRemove(context.Context, abi.SectorNumber) error //perm:admin
// SectorTerminate terminates the sector on-chain (adding it to a termination batch first), then
// automatically removes it from storage
SectorTerminate(context.Context, abi.SectorNumber) error //perm:admin
// SectorTerminateFlush immediately sends a terminate message with sectors batched for termination.
// Returns null if message wasn't sent
SectorTerminateFlush(ctx context.Context) (*cid.Cid, error) //perm:admin
// SectorTerminatePending returns a list of pending sector terminations to be sent in the next batch message
SectorTerminatePending(ctx context.Context) ([]abi.SectorID, error) //perm:admin
SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber) error //perm:admin
// SectorPreCommitFlush immediately sends a PreCommit message with sectors batched for PreCommit.
// Returns null if message wasn't sent
SectorPreCommitFlush(ctx context.Context) ([]sealiface.PreCommitBatchRes, error) //perm:admin
// SectorPreCommitPending returns a list of pending PreCommit sectors to be sent in the next batch message
SectorPreCommitPending(ctx context.Context) ([]abi.SectorID, error) //perm:admin
// SectorCommitFlush immediately sends a Commit message with sectors aggregated for Commit.
// Returns null if message wasn't sent
SectorCommitFlush(ctx context.Context) ([]sealiface.CommitBatchRes, error) //perm:admin
// SectorCommitPending returns a list of pending Commit sectors to be sent in the next aggregate message
SectorCommitPending(ctx context.Context) ([]abi.SectorID, error) //perm:admin
// WorkerConnect tells the node to connect to workers RPC
WorkerConnect(context.Context, string) error
WorkerStats(context.Context) (map[uint64]storiface.WorkerStats, error)
WorkerJobs(context.Context) (map[uint64][]storiface.WorkerJob, error)
WorkerConnect(context.Context, string) error //perm:admin retry:true
WorkerStats(context.Context) (map[uuid.UUID]storiface.WorkerStats, error) //perm:admin
WorkerJobs(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) //perm:admin
//storiface.WorkerReturn
ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error //perm:admin retry:true
ReturnSealPreCommit1(ctx context.Context, callID storiface.CallID, p1o storage.PreCommit1Out, err *storiface.CallError) error //perm:admin retry:true
ReturnSealPreCommit2(ctx context.Context, callID storiface.CallID, sealed storage.SectorCids, err *storiface.CallError) error //perm:admin retry:true
ReturnSealCommit1(ctx context.Context, callID storiface.CallID, out storage.Commit1Out, err *storiface.CallError) error //perm:admin retry:true
ReturnSealCommit2(ctx context.Context, callID storiface.CallID, proof storage.Proof, err *storiface.CallError) error //perm:admin retry:true
ReturnFinalizeSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnReleaseUnsealed(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnMoveStorage(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnUnsealPiece(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnReadPiece(ctx context.Context, callID storiface.CallID, ok bool, err *storiface.CallError) error //perm:admin retry:true
ReturnFetch(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
// SealingSchedDiag dumps internal sealing scheduler state
SealingSchedDiag(context.Context) (interface{}, error)
SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) //perm:admin
SealingAbort(ctx context.Context, call storiface.CallID) error //perm:admin
stores.SectorIndex
//stores.SectorIndex
StorageAttach(context.Context, stores.StorageInfo, fsutil.FsStat) error //perm:admin
StorageInfo(context.Context, stores.ID) (stores.StorageInfo, error) //perm:admin
StorageReportHealth(context.Context, stores.ID, stores.HealthReport) error //perm:admin
StorageDeclareSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error //perm:admin
StorageDropSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType) error //perm:admin
StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]stores.SectorStorageInfo, error) //perm:admin
StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType) ([]stores.StorageInfo, error) //perm:admin
StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error //perm:admin
StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error) //perm:admin
StorageList(ctx context.Context) (map[stores.ID][]stores.Decl, error) //perm:admin
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error
MarketListDeals(ctx context.Context) ([]MarketDeal, error)
MarketListRetrievalDeals(ctx context.Context) ([]retrievalmarket.ProviderDealState, error)
MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error)
MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error)
MarketSetAsk(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error
MarketGetAsk(ctx context.Context) (*storagemarket.SignedStorageAsk, error)
MarketSetRetrievalAsk(ctx context.Context, rask *retrievalmarket.Ask) error
MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error)
MarketListDataTransfers(ctx context.Context) ([]DataTransferChannel, error)
MarketDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error)
StorageLocal(ctx context.Context) (map[stores.ID]string, error) //perm:admin
StorageStat(ctx context.Context, id stores.ID) (fsutil.FsStat, error) //perm:admin
DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error
DealsList(ctx context.Context) ([]MarketDeal, error)
DealsConsiderOnlineStorageDeals(context.Context) (bool, error)
DealsSetConsiderOnlineStorageDeals(context.Context, bool) error
DealsConsiderOnlineRetrievalDeals(context.Context) (bool, error)
DealsSetConsiderOnlineRetrievalDeals(context.Context, bool) error
DealsPieceCidBlocklist(context.Context) ([]cid.Cid, error)
DealsSetPieceCidBlocklist(context.Context, []cid.Cid) error
DealsConsiderOfflineStorageDeals(context.Context) (bool, error)
DealsSetConsiderOfflineStorageDeals(context.Context, bool) error
DealsConsiderOfflineRetrievalDeals(context.Context) (bool, error)
DealsSetConsiderOfflineRetrievalDeals(context.Context, bool) error
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:write
MarketListDeals(ctx context.Context) ([]MarketDeal, error) //perm:read
MarketListRetrievalDeals(ctx context.Context) ([]retrievalmarket.ProviderDealState, error) //perm:read
MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) //perm:read
MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error) //perm:read
MarketSetAsk(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error //perm:admin
MarketGetAsk(ctx context.Context) (*storagemarket.SignedStorageAsk, error) //perm:read
MarketSetRetrievalAsk(ctx context.Context, rask *retrievalmarket.Ask) error //perm:admin
MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error) //perm:read
MarketListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) //perm:write
MarketDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) //perm:write
// MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer
MarketRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
// MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer
MarketCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
MarketPendingDeals(ctx context.Context) (PendingDealInfo, error) //perm:write
MarketPublishPendingDeals(ctx context.Context) error //perm:admin
StorageAddLocal(ctx context.Context, path string) error
DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error //perm:admin
DealsList(ctx context.Context) ([]MarketDeal, error) //perm:admin
DealsConsiderOnlineStorageDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderOnlineStorageDeals(context.Context, bool) error //perm:admin
DealsConsiderOnlineRetrievalDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderOnlineRetrievalDeals(context.Context, bool) error //perm:admin
DealsPieceCidBlocklist(context.Context) ([]cid.Cid, error) //perm:admin
DealsSetPieceCidBlocklist(context.Context, []cid.Cid) error //perm:admin
DealsConsiderOfflineStorageDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderOfflineStorageDeals(context.Context, bool) error //perm:admin
DealsConsiderOfflineRetrievalDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderOfflineRetrievalDeals(context.Context, bool) error //perm:admin
DealsConsiderVerifiedStorageDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderVerifiedStorageDeals(context.Context, bool) error //perm:admin
DealsConsiderUnverifiedStorageDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderUnverifiedStorageDeals(context.Context, bool) error //perm:admin
PiecesListPieces(ctx context.Context) ([]cid.Cid, error)
PiecesListCidInfos(ctx context.Context) ([]cid.Cid, error)
PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error)
PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error)
StorageAddLocal(ctx context.Context, path string) error //perm:admin
PiecesListPieces(ctx context.Context) ([]cid.Cid, error) //perm:read
PiecesListCidInfos(ctx context.Context) ([]cid.Cid, error) //perm:read
PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) //perm:read
PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) //perm:read
// CreateBackup creates node backup onder the specified file name. The
// method requires that the lotus-miner is running with the
// LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that
// the path specified when calling CreateBackup is within the base path
CreateBackup(ctx context.Context, fpath string) error
CreateBackup(ctx context.Context, fpath string) error //perm:admin
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) //perm:admin
ComputeProof(ctx context.Context, ssi []builtin.SectorInfo, rand abi.PoStRandomness) ([]builtin.PoStProof, error) //perm:read
}
var _ storiface.WorkerReturn = *new(StorageMiner)
var _ stores.SectorIndex = *new(StorageMiner)
type SealRes struct {
Err string
GoErr error `json:"-"`
@@ -186,3 +281,54 @@ func (st *SealSeed) Equals(ost *SealSeed) bool {
}
type SectorState string
type AddrUse int
const (
PreCommitAddr AddrUse = iota
CommitAddr
DealPublishAddr
PoStAddr
TerminateSectorsAddr
)
type AddressConfig struct {
PreCommitControl []address.Address
CommitControl []address.Address
TerminateControl []address.Address
DealPublishControl []address.Address
DisableOwnerFallback bool
DisableWorkerFallback bool
}
// PendingDealInfo has info about pending deals and when they are due to be
// published
type PendingDealInfo struct {
Deals []market.ClientDealProposal
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
}
+19 -1
View File
@@ -37,6 +37,18 @@ func TestDoesntDependOnFFI(t *testing.T) {
}
}
func TestDoesntDependOnBuild(t *testing.T) {
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
if err != nil {
t.Fatal(err)
}
for _, pkg := range strings.Fields(string(deps)) {
if pkg == "github.com/filecoin-project/build" {
t.Fatal("api depends on filecoin-ffi")
}
}
}
func TestReturnTypes(t *testing.T) {
errType := reflect.TypeOf(new(error)).Elem()
bareIface := reflect.TypeOf(new(interface{})).Elem()
@@ -99,5 +111,11 @@ func TestReturnTypes(t *testing.T) {
t.Run("common", tst(new(Common)))
t.Run("full", tst(new(FullNode)))
t.Run("miner", tst(new(StorageMiner)))
t.Run("worker", tst(new(WorkerAPI)))
t.Run("worker", tst(new(Worker)))
}
func TestPermTags(t *testing.T) {
_ = PermissionedFullAPI(&FullNodeStruct{})
_ = PermissionedStorMinerAPI(&StorageMinerStruct{})
_ = PermissionedWorkerAPI(&WorkerStruct{})
}
+8 -8
View File
@@ -34,14 +34,14 @@ type MsgMeta struct {
Extra []byte
}
type WalletAPI interface {
WalletNew(context.Context, types.KeyType) (address.Address, error)
WalletHas(context.Context, address.Address) (bool, error)
WalletList(context.Context) ([]address.Address, error)
type Wallet interface {
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
}
+49 -17
View File
@@ -2,8 +2,8 @@ package api
import (
"context"
"io"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-state-types/abi"
@@ -11,30 +11,62 @@ import (
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/specs-storage/storage"
"github.com/filecoin-project/lotus/build"
)
type WorkerAPI interface {
Version(context.Context) (build.Version, error)
// TODO: Info() (name, ...) ?
// 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
TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) // TaskType -> Weight
Paths(context.Context) ([]stores.StoragePath, error)
Info(context.Context) (storiface.WorkerInfo, error)
type Worker interface {
Version(context.Context) (Version, error) //perm:admin
AddPiece(ctx context.Context, sector abi.SectorID, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (abi.PieceInfo, error)
// TaskType -> Weight
TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) //perm:admin
Paths(context.Context) ([]stores.StoragePath, error) //perm:admin
Info(context.Context) (storiface.WorkerInfo, error) //perm:admin
storage.Sealer
// storiface.WorkerCalls
AddPiece(ctx context.Context, sector storage.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error) //perm:admin
SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (storiface.CallID, error) //perm:admin
SealPreCommit2(ctx context.Context, sector storage.SectorRef, pc1o storage.PreCommit1Out) (storiface.CallID, error) //perm:admin
SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storiface.CallID, error) //perm:admin
SealCommit2(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (storiface.CallID, error) //perm:admin
FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (storiface.CallID, error) //perm:admin
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
Fetch(context.Context, storage.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) //perm:admin
MoveStorage(ctx context.Context, sector abi.SectorID, types stores.SectorFileType) error
TaskDisable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
TaskEnable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
UnsealPiece(context.Context, abi.SectorID, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) error
ReadPiece(context.Context, io.Writer, abi.SectorID, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize) (bool, error)
// Storage / Other
Remove(ctx context.Context, sector abi.SectorID) error //perm:admin
StorageAddLocal(ctx context.Context, path string) error
StorageAddLocal(ctx context.Context, path string) error //perm:admin
Fetch(context.Context, abi.SectorID, stores.SectorFileType, stores.PathType, stores.AcquireMode) error
// SetEnabled marks the worker as enabled/disabled. Not that this setting
// may take a few seconds to propagate to task scheduler
SetEnabled(ctx context.Context, enabled bool) error //perm:admin
Closing(context.Context) (<-chan struct{}, error)
Enabled(ctx context.Context) (bool, error) //perm:admin
// WaitQuiet blocks until there are no tasks running
WaitQuiet(ctx context.Context) error //perm:admin
// returns a random UUID of worker session, generated randomly when worker
// process starts
ProcessSession(context.Context) (uuid.UUID, error) //perm:admin
// Like ProcessSession, but returns an error when worker is disabled
Session(context.Context) (uuid.UUID, error) //perm:admin
}
var _ storiface.WorkerCalls = *new(Worker)
-68
View File
@@ -1,68 +0,0 @@
package apibstore
import (
"context"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/lib/blockstore"
)
type ChainIO interface {
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
ChainHasObj(context.Context, cid.Cid) (bool, error)
}
type apiBStore struct {
api ChainIO
}
func NewAPIBlockstore(cio ChainIO) blockstore.Blockstore {
return &apiBStore{
api: cio,
}
}
func (a *apiBStore) DeleteBlock(cid.Cid) error {
return xerrors.New("not supported")
}
func (a *apiBStore) Has(c cid.Cid) (bool, error) {
return a.api.ChainHasObj(context.TODO(), c)
}
func (a *apiBStore) Get(c cid.Cid) (blocks.Block, error) {
bb, err := a.api.ChainReadObj(context.TODO(), c)
if err != nil {
return nil, err
}
return blocks.NewBlockWithCid(bb, c)
}
func (a *apiBStore) GetSize(c cid.Cid) (int, error) {
bb, err := a.api.ChainReadObj(context.TODO(), c)
if err != nil {
return 0, err
}
return len(bb), nil
}
func (a *apiBStore) Put(blocks.Block) error {
return xerrors.New("not supported")
}
func (a *apiBStore) PutMany([]blocks.Block) error {
return xerrors.New("not supported")
}
func (a *apiBStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
return nil, xerrors.New("not supported")
}
func (a *apiBStore) HashOnRead(enabled bool) {
return
}
var _ blockstore.Blockstore = &apiBStore{}
-44
View File
@@ -1,44 +0,0 @@
package apistruct
import (
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/lotus/api"
)
const (
// When changing these, update docs/API.md too
PermRead auth.Permission = "read" // default
PermWrite auth.Permission = "write"
PermSign auth.Permission = "sign" // Use wallet keys for signing
PermAdmin auth.Permission = "admin" // Manage permissions
)
var AllPermissions = []auth.Permission{PermRead, PermWrite, PermSign, PermAdmin}
var DefaultPerms = []auth.Permission{PermRead}
func PermissionedStorMinerAPI(a api.StorageMiner) api.StorageMiner {
var out StorageMinerStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.CommonStruct.Internal)
return &out
}
func PermissionedFullAPI(a api.FullNode) api.FullNode {
var out FullNodeStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.CommonStruct.Internal)
return &out
}
func PermissionedWorkerAPI(a api.WorkerAPI) api.WorkerAPI {
var out WorkerStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
return &out
}
func PermissionedWalletAPI(a api.WalletAPI) api.WalletAPI {
var out WalletStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
return &out
}
File diff suppressed because it is too large Load Diff
-9
View File
@@ -1,9 +0,0 @@
package apistruct
import "testing"
func TestPermTags(t *testing.T) {
_ = PermissionedFullAPI(&FullNodeStruct{})
_ = PermissionedStorMinerAPI(&StorageMinerStruct{})
_ = PermissionedWorkerAPI(&WorkerStruct{})
}
+395 -5
View File
@@ -5,14 +5,21 @@ 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"
xerrors "golang.org/x/xerrors"
)
var _ = xerrors.Errorf
var _ = cid.Undef
var _ = math.E
var _ = sort.Sort
func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
if t == nil {
@@ -171,7 +178,8 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
}
default:
return fmt.Errorf("unknown struct field %d: '%s'", i, name)
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
@@ -319,7 +327,8 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) error {
}
default:
return fmt.Errorf("unknown struct field %d: '%s'", i, name)
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
@@ -427,7 +436,8 @@ func (t *SealedRefs) UnmarshalCBOR(r io.Reader) error {
}
default:
return fmt.Errorf("unknown struct field %d: '%s'", i, name)
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
@@ -575,7 +585,8 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) error {
}
default:
return fmt.Errorf("unknown struct field %d: '%s'", i, name)
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
@@ -723,7 +734,386 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) error {
}
default:
return fmt.Errorf("unknown struct field %d: '%s'", i, name)
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
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) {})
}
}
+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]]
}
+69 -49
View File
@@ -10,72 +10,84 @@ import (
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/apistruct"
"github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/lib/rpcenc"
)
// NewCommonRPC creates a new http jsonrpc client.
func NewCommonRPC(ctx context.Context, addr string, requestHeader http.Header) (api.Common, jsonrpc.ClientCloser, error) {
var res apistruct.CommonStruct
// NewCommonRPCV0 creates a new http jsonrpc client.
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
}
// NewFullNodeRPC creates a new http jsonrpc client.
func NewFullNodeRPC(ctx context.Context, addr string, requestHeader http.Header) (api.FullNode, jsonrpc.ClientCloser, error) {
var res apistruct.FullNodeStruct
// 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
}
// NewStorageMinerRPC creates a new http jsonrpc client for miner
func NewStorageMinerRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.StorageMiner, jsonrpc.ClientCloser, error) {
var res apistruct.StorageMinerStruct
// NewFullNodeRPCV1 creates a new http jsonrpc client.
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,
opts...,
)
api.GetInternalStructs(&res), requestHeader)
return &res, closer, err
}
func NewWorkerRPC(ctx context.Context, addr string, requestHeader http.Header) (api.WorkerAPI, jsonrpc.ClientCloser, error) {
u, err := url.Parse(addr)
func getPushUrl(addr string) (string, error) {
pushUrl, err := url.Parse(addr)
if err != nil {
return nil, nil, err
return "", err
}
switch u.Scheme {
switch pushUrl.Scheme {
case "ws":
u.Scheme = "http"
pushUrl.Scheme = "http"
case "wss":
u.Scheme = "https"
pushUrl.Scheme = "https"
}
///rpc/v0 -> /rpc/streams/v0/push
u.Path = path.Join(u.Path, "../streams/v0/push")
pushUrl.Path = path.Join(pushUrl.Path, "../streams/v0/push")
return pushUrl.String(), nil
}
var res apistruct.WorkerStruct
// 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.Internal,
},
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) (v0api.Worker, jsonrpc.ClientCloser, error) {
pushUrl, err := getPushUrl(addr)
if err != nil {
return nil, nil, err
}
var res api.WorkerStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res),
requestHeader,
rpcenc.ReaderParamEncoder(u.String()),
rpcenc.ReaderParamEncoder(pushUrl),
jsonrpc.WithNoReconnect(),
jsonrpc.WithTimeout(30*time.Second),
)
@@ -83,13 +95,11 @@ func NewWorkerRPC(ctx context.Context, addr string, requestHeader http.Header) (
return &res, closer, err
}
// NewGatewayRPC creates a new http jsonrpc client for a gateway node.
func NewGatewayRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.GatewayAPI, jsonrpc.ClientCloser, error) {
var res apistruct.GatewayStruct
// NewGatewayRPCV1 creates a new http jsonrpc client for a gateway node.
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...,
)
@@ -97,12 +107,22 @@ func NewGatewayRPC(ctx context.Context, addr string, requestHeader http.Header,
return &res, closer, err
}
func NewWalletRPC(ctx context.Context, addr string, requestHeader http.Header) (api.WalletAPI, jsonrpc.ClientCloser, error) {
var res apistruct.WalletStruct
// NewGatewayRPCV0 creates a new http jsonrpc client for a gateway node.
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...,
)
return &res, closer, err
}
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",
api.GetInternalStructs(&res),
requestHeader,
)
+74
View File
@@ -0,0 +1,74 @@
package main
import (
"compress/gzip"
"encoding/json"
"io"
"log"
"os"
"github.com/filecoin-project/lotus/api/docgen"
docgen_openrpc "github.com/filecoin-project/lotus/api/docgen-openrpc"
)
/*
main defines a small program that writes an OpenRPC document describing
a Lotus API to stdout.
If the first argument is "miner", the document will describe the StorageMiner API.
If not (no, or any other args), the document will describe the Full API.
Use:
go run ./api/openrpc/cmd ["api/api_full.go"|"api/api_storage.go"|"api/api_worker.go"] ["FullNode"|"StorageMiner"|"Worker"]
With gzip compression: a '-gzip' flag is made available as an optional third argument. Note that position matters.
go run ./api/openrpc/cmd ["api/api_full.go"|"api/api_storage.go"|"api/api_worker.go"] ["FullNode"|"StorageMiner"|"Worker"] -gzip
*/
func main() {
Comments, GroupDocs := docgen.ParseApiASTInfo(os.Args[1], os.Args[2], os.Args[3], os.Args[4])
doc := docgen_openrpc.NewLotusOpenRPCDocument(Comments, GroupDocs)
i, _, _ := docgen.GetAPIType(os.Args[2], os.Args[3])
doc.RegisterReceiverName("Filecoin", i)
out, err := doc.Discover()
if err != nil {
log.Fatalln(err)
}
var jsonOut []byte
var writer io.WriteCloser
// Use os.Args to handle a somewhat hacky flag for the gzip option.
// Could use flags package to handle this more cleanly, but that requires changes elsewhere
// the scope of which just isn't warranted by this one use case which will usually be run
// programmatically anyways.
if len(os.Args) > 5 && os.Args[5] == "-gzip" {
jsonOut, err = json.Marshal(out)
if err != nil {
log.Fatalln(err)
}
writer = gzip.NewWriter(os.Stdout)
} else {
jsonOut, err = json.MarshalIndent(out, "", " ")
if err != nil {
log.Fatalln(err)
}
writer = os.Stdout
}
_, err = writer.Write(jsonOut)
if err != nil {
log.Fatalln(err)
}
err = writer.Close()
if err != nil {
log.Fatalln(err)
}
}
+161
View File
@@ -0,0 +1,161 @@
package docgenopenrpc
import (
"encoding/json"
"go/ast"
"net"
"reflect"
"github.com/alecthomas/jsonschema"
go_openrpc_reflect "github.com/etclabscore/go-openrpc-reflect"
"github.com/filecoin-project/lotus/api/docgen"
"github.com/filecoin-project/lotus/build"
"github.com/ipfs/go-cid"
meta_schema "github.com/open-rpc/meta-schema"
)
// schemaDictEntry represents a type association passed to the jsonschema reflector.
type schemaDictEntry struct {
example interface{}
rawJson string
}
const integerD = `{
"title": "number",
"type": "number",
"description": "Number is a number"
}`
const cidCidD = `{"title": "Content Identifier", "type": "string", "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash."}`
func OpenRPCSchemaTypeMapper(ty reflect.Type) *jsonschema.Type {
unmarshalJSONToJSONSchemaType := func(input string) *jsonschema.Type {
var js jsonschema.Type
err := json.Unmarshal([]byte(input), &js)
if err != nil {
panic(err)
}
return &js
}
if ty.Kind() == reflect.Ptr {
ty = ty.Elem()
}
if ty == reflect.TypeOf((*interface{})(nil)).Elem() {
return &jsonschema.Type{Type: "object", AdditionalProperties: []byte("true")}
}
// Second, handle other types.
// Use a slice instead of a map because it preserves order, as a logic safeguard/fallback.
dict := []schemaDictEntry{
{cid.Cid{}, cidCidD},
}
for _, d := range dict {
if reflect.TypeOf(d.example) == ty {
tt := unmarshalJSONToJSONSchemaType(d.rawJson)
return tt
}
}
// Handle primitive types in case there are generic cases
// specific to our services.
switch ty.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
// Return all integer types as the hex representation integer schemea.
ret := unmarshalJSONToJSONSchemaType(integerD)
return ret
case reflect.Uintptr:
return &jsonschema.Type{Type: "number", Title: "uintptr-title"}
case reflect.Struct:
case reflect.Map:
case reflect.Slice, reflect.Array:
case reflect.Float32, reflect.Float64:
case reflect.Bool:
case reflect.String:
case reflect.Ptr, reflect.Interface:
default:
}
return nil
}
// NewLotusOpenRPCDocument defines application-specific documentation and configuration for its OpenRPC document.
func NewLotusOpenRPCDocument(Comments, GroupDocs map[string]string) *go_openrpc_reflect.Document {
d := &go_openrpc_reflect.Document{}
// Register "Meta" document fields.
// These include getters for
// - Servers object
// - Info object
// - ExternalDocs object
//
// These objects represent server-specific data that cannot be
// reflected.
d.WithMeta(&go_openrpc_reflect.MetaT{
GetServersFn: func() func(listeners []net.Listener) (*meta_schema.Servers, error) {
return func(listeners []net.Listener) (*meta_schema.Servers, error) {
return nil, nil
}
},
GetInfoFn: func() (info *meta_schema.InfoObject) {
info = &meta_schema.InfoObject{}
title := "Lotus RPC API"
info.Title = (*meta_schema.InfoObjectProperties)(&title)
version := build.BuildVersion
info.Version = (*meta_schema.InfoObjectVersion)(&version)
return info
},
GetExternalDocsFn: func() (exdocs *meta_schema.ExternalDocumentationObject) {
return nil // FIXME
},
})
// Use a provided Ethereum default configuration as a base.
appReflector := &go_openrpc_reflect.EthereumReflectorT{}
// Install overrides for the json schema->type map fn used by the jsonschema reflect package.
appReflector.FnSchemaTypeMap = func() func(ty reflect.Type) *jsonschema.Type {
return OpenRPCSchemaTypeMapper
}
appReflector.FnIsMethodEligible = func(m reflect.Method) bool {
for i := 0; i < m.Func.Type().NumOut(); i++ {
if m.Func.Type().Out(i).Kind() == reflect.Chan {
return false
}
}
return go_openrpc_reflect.EthereumReflector.IsMethodEligible(m)
}
appReflector.FnGetMethodName = func(moduleName string, r reflect.Value, m reflect.Method, funcDecl *ast.FuncDecl) (string, error) {
if m.Name == "ID" {
return moduleName + "_ID", nil
}
if moduleName == "rpc" && m.Name == "Discover" {
return "rpc.discover", nil
}
return moduleName + "." + m.Name, nil
}
appReflector.FnGetMethodSummary = func(r reflect.Value, m reflect.Method, funcDecl *ast.FuncDecl) (string, error) {
if v, ok := Comments[m.Name]; ok {
return v, nil
}
return "", nil // noComment
}
appReflector.FnSchemaExamples = func(ty reflect.Type) (examples *meta_schema.Examples, err error) {
v := docgen.ExampleValue("unknown", ty, ty) // This isn't ideal, but seems to work well enough.
return &meta_schema.Examples{
meta_schema.AlwaysTrue(v),
}, nil
}
// Finally, register the configured reflector to the document.
d.WithReflector(appReflector)
return d
}
+121
View File
@@ -0,0 +1,121 @@
package main
import (
"encoding/json"
"fmt"
"os"
"reflect"
"sort"
"strings"
"github.com/filecoin-project/lotus/api/docgen"
)
func main() {
comments, groupComments := docgen.ParseApiASTInfo(os.Args[1], os.Args[2], os.Args[3], os.Args[4])
groups := make(map[string]*docgen.MethodGroup)
_, t, permStruct := docgen.GetAPIType(os.Args[2], os.Args[3])
for i := 0; i < t.NumMethod(); i++ {
m := t.Method(i)
groupName := docgen.MethodGroupFromName(m.Name)
g, ok := groups[groupName]
if !ok {
g = new(docgen.MethodGroup)
g.Header = groupComments[groupName]
g.GroupName = groupName
groups[groupName] = g
}
var args []interface{}
ft := m.Func.Type()
for j := 2; j < ft.NumIn(); j++ {
inp := ft.In(j)
args = append(args, docgen.ExampleValue(m.Name, inp, nil))
}
v, err := json.MarshalIndent(args, "", " ")
if err != nil {
panic(err)
}
outv := docgen.ExampleValue(m.Name, ft.Out(0), nil)
ov, err := json.MarshalIndent(outv, "", " ")
if err != nil {
panic(err)
}
g.Methods = append(g.Methods, &docgen.Method{
Name: m.Name,
Comment: comments[m.Name],
InputExample: string(v),
ResponseExample: string(ov),
})
}
var groupslice []*docgen.MethodGroup
for _, g := range groups {
groupslice = append(groupslice, g)
}
sort.Slice(groupslice, func(i, j int) bool {
return groupslice[i].GroupName < groupslice[j].GroupName
})
fmt.Printf("# Groups\n")
for _, g := range groupslice {
fmt.Printf("* [%s](#%s)\n", g.GroupName, g.GroupName)
for _, method := range g.Methods {
fmt.Printf(" * [%s](#%s)\n", method.Name, method.Name)
}
}
for _, g := range groupslice {
g := g
fmt.Printf("## %s\n", g.GroupName)
fmt.Printf("%s\n\n", g.Header)
sort.Slice(g.Methods, func(i, j int) bool {
return g.Methods[i].Name < g.Methods[j].Name
})
for _, m := range g.Methods {
fmt.Printf("### %s\n", m.Name)
fmt.Printf("%s\n\n", m.Comment)
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")
fmt.Printf("Perms: %s\n\n", perms)
if strings.Count(m.InputExample, "\n") > 0 {
fmt.Printf("Inputs:\n```json\n%s\n```\n\n", m.InputExample)
} else {
fmt.Printf("Inputs: `%s`\n\n", m.InputExample)
}
if strings.Count(m.ResponseExample, "\n") > 0 {
fmt.Printf("Response:\n```json\n%s\n```\n\n", m.ResponseExample)
} else {
fmt.Printf("Response: `%s`\n\n", m.ResponseExample)
}
}
}
}
+204 -152
View File
@@ -1,17 +1,21 @@
package main
package docgen
import (
"encoding/json"
"fmt"
"go/ast"
"go/parser"
"go/token"
"path/filepath"
"reflect"
"sort"
"strings"
"time"
"unicode"
"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"
metrics "github.com/libp2p/go-libp2p-core/metrics"
@@ -21,21 +25,24 @@ import (
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/multiformats/go-multiaddr"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer"
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"
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/apistruct"
apitypes "github.com/filecoin-project/lotus/api/types"
"github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
@@ -82,8 +89,11 @@ func init() {
addExample(pid)
addExample(&pid)
multistoreIDExample := multistore.StoreID(50)
storeIDExample := importmgr.ImportID(50)
addExample(bitfield.NewFromSet([]uint64{5}))
addExample(abi.RegisteredSealProof_StackedDrg32GiBV1)
addExample(abi.RegisteredSealProof_StackedDrg32GiBV1_1)
addExample(abi.RegisteredPoStProof_StackedDrgWindow32GiBV1)
addExample(abi.ChainEpoch(10101))
addExample(crypto.SigTypeBLS)
@@ -106,28 +116,33 @@ func init() {
addExample(network.Connected)
addExample(dtypes.NetworkName("lotus"))
addExample(api.SyncStateStage(1))
addExample(build.FullAPIVersion)
addExample(api.FullAPIVersion1)
addExample(api.PCHInbound)
addExample(time.Minute)
addExample(datatransfer.TransferID(3))
addExample(datatransfer.Ongoing)
addExample(multistore.StoreID(50))
addExample(storeIDExample)
addExample(&storeIDExample)
addExample(multistoreIDExample)
addExample(&multistoreIDExample)
addExample(retrievalmarket.ClientEventDealAccepted)
addExample(retrievalmarket.DealStatusNew)
addExample(network.ReachabilityPublic)
addExample(build.NewestNetworkVersion)
addExample(map[string]int{"name": 42})
addExample(map[string]time.Time{"name": time.Unix(1615243938, 0).UTC()})
addExample(&types.ExecutionTrace{
Msg: exampleValue(reflect.TypeOf(&types.Message{}), nil).(*types.Message),
MsgRct: exampleValue(reflect.TypeOf(&types.MessageReceipt{}), nil).(*types.MessageReceipt),
Msg: ExampleValue("init", reflect.TypeOf(&types.Message{}), nil).(*types.Message),
MsgRct: ExampleValue("init", reflect.TypeOf(&types.MessageReceipt{}), nil).(*types.MessageReceipt),
})
addExample(map[string]types.Actor{
"t01236": exampleValue(reflect.TypeOf(types.Actor{}), nil).(types.Actor),
"t01236": ExampleValue("init", reflect.TypeOf(types.Actor{}), nil).(types.Actor),
})
addExample(map[string]api.MarketDeal{
"t026363": exampleValue(reflect.TypeOf(api.MarketDeal{}), nil).(api.MarketDeal),
"t026363": ExampleValue("init", reflect.TypeOf(api.MarketDeal{}), nil).(api.MarketDeal),
})
addExample(map[string]api.MarketBalance{
"t026363": exampleValue(reflect.TypeOf(api.MarketBalance{}), nil).(api.MarketBalance),
"t026363": ExampleValue("init", reflect.TypeOf(api.MarketBalance{}), nil).(api.MarketBalance),
})
addExample(map[string]*pubsub.TopicScoreSnapshot{
"/blocks": {
@@ -162,9 +177,139 @@ func init() {
// because reflect.TypeOf(maddr) returns the concrete type...
ExampleValues[reflect.TypeOf(struct{ A multiaddr.Multiaddr }{}).Field(0).Type] = maddr
// miner specific
addExample(filestore2.Path(".lotusminer/fstmp123"))
si := uint64(12)
addExample(&si)
addExample(retrievalmarket.DealID(5))
addExample(abi.ActorID(1000))
addExample(map[string][]api.SealedRef{
"98000": {
api.SealedRef{
SectorID: 100,
Offset: 10 << 20,
Size: 1 << 20,
},
},
})
addExample(api.SectorState(sealing.Proving))
addExample(stores.ID("76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8"))
addExample(storiface.FTUnsealed)
addExample(storiface.PathSealing)
addExample(map[stores.ID][]stores.Decl{
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": {
{
SectorID: abi.SectorID{Miner: 1000, Number: 100},
SectorFileType: storiface.FTSealed,
},
},
})
addExample(map[stores.ID]string{
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": "/data/path",
})
addExample(map[uuid.UUID][]storiface.WorkerJob{
uuid.MustParse("ef8d99a2-6865-4189-8ffa-9fef0f806eee"): {
{
ID: storiface.CallID{
Sector: abi.SectorID{Miner: 1000, Number: 100},
ID: uuid.MustParse("76081ba0-61bd-45a5-bc08-af05f1c26e5d"),
},
Sector: abi.SectorID{Miner: 1000, Number: 100},
Task: sealtasks.TTPreCommit2,
RunWait: 0,
Start: time.Unix(1605172927, 0).UTC(),
Hostname: "host",
},
},
})
addExample(map[uuid.UUID]storiface.WorkerStats{
uuid.MustParse("ef8d99a2-6865-4189-8ffa-9fef0f806eee"): {
Info: storiface.WorkerInfo{
Hostname: "host",
Resources: storiface.WorkerResources{
MemPhysical: 256 << 30,
MemSwap: 120 << 30,
MemReserved: 2 << 30,
CPUs: 64,
GPUs: []string{"aGPU 1337"},
},
},
Enabled: true,
MemUsedMin: 0,
MemUsedMax: 0,
GpuUsed: false,
CpuUse: 0,
},
})
addExample(storiface.ErrorCode(0))
addExample(map[abi.SectorNumber]string{
123: "can't acquire read lock",
})
addExample(map[api.SectorState]int{
api.SectorState(sealing.Proving): 120,
})
addExample([]abi.SectorNumber{123, 124})
// worker specific
addExample(storiface.AcquireMove)
addExample(storiface.UnpaddedByteIndex(abi.PaddedPieceSize(1 << 20).Unpadded()))
addExample(map[sealtasks.TaskType]struct{}{
sealtasks.TTPreCommit2: {},
})
addExample(sealtasks.TTCommit2)
addExample(apitypes.OpenRPCDocument{
"openrpc": "1.2.6",
"info": map[string]interface{}{
"title": "Lotus RPC API",
"version": "1.2.1/generated=2020-11-22T08:22:42-06:00",
},
"methods": []interface{}{}},
)
addExample(api.CheckStatusCode(0))
addExample(map[string]interface{}{"abc": 123})
}
func exampleValue(t, parent reflect.Type) interface{} {
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 = 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 = 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 = append(permStruct, reflect.TypeOf(api.WorkerStruct{}.Internal))
default:
panic("unknown type")
}
case "v0api":
switch name {
case "FullNode":
i = v0api.FullNodeStruct{}
t = reflect.TypeOf(new(struct{ v0api.FullNode })).Elem()
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")
}
}
return
}
func ExampleValue(method string, t, parent reflect.Type) interface{} {
v, ok := ExampleValues[t]
if ok {
return v
@@ -173,25 +318,25 @@ func exampleValue(t, parent reflect.Type) interface{} {
switch t.Kind() {
case reflect.Slice:
out := reflect.New(t).Elem()
reflect.Append(out, reflect.ValueOf(exampleValue(t.Elem(), t)))
reflect.Append(out, reflect.ValueOf(ExampleValue(method, t.Elem(), t)))
return out.Interface()
case reflect.Chan:
return exampleValue(t.Elem(), nil)
return ExampleValue(method, t.Elem(), nil)
case reflect.Struct:
es := exampleStruct(t, parent)
es := exampleStruct(method, t, parent)
v := reflect.ValueOf(es).Elem().Interface()
ExampleValues[t] = v
return v
case reflect.Array:
out := reflect.New(t).Elem()
for i := 0; i < t.Len(); i++ {
out.Index(i).Set(reflect.ValueOf(exampleValue(t.Elem(), t)))
out.Index(i).Set(reflect.ValueOf(ExampleValue(method, t.Elem(), t)))
}
return out.Interface()
case reflect.Ptr:
if t.Elem().Kind() == reflect.Struct {
es := exampleStruct(t.Elem(), t)
es := exampleStruct(method, t.Elem(), t)
//ExampleValues[t] = es
return es
}
@@ -199,10 +344,10 @@ func exampleValue(t, parent reflect.Type) interface{} {
return struct{}{}
}
panic(fmt.Sprintf("No example value for type: %s", t))
panic(fmt.Sprintf("No example value for type: %s (method '%s')", t, method))
}
func exampleStruct(t, parent reflect.Type) interface{} {
func exampleStruct(method string, t, parent reflect.Type) interface{} {
ns := reflect.New(t)
for i := 0; i < t.NumField(); i++ {
f := t.Field(i)
@@ -210,7 +355,7 @@ func exampleStruct(t, parent reflect.Type) interface{} {
continue
}
if strings.Title(f.Name) == f.Name {
ns.Elem().Field(i).Set(reflect.ValueOf(exampleValue(f.Type, t)))
ns.Elem().Field(i).Set(reflect.ValueOf(ExampleValue(method, f.Type, t)))
}
}
@@ -218,6 +363,7 @@ func exampleStruct(t, parent reflect.Type) interface{} {
}
type Visitor struct {
Root string
Methods map[string]ast.Node
}
@@ -227,7 +373,7 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor {
return v
}
if st.Name.Name != "FullNode" {
if st.Name.Name != v.Root {
return nil
}
@@ -241,32 +387,43 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor {
return v
}
const noComment = "There are not yet any comments for this method."
const NoComment = "There are not yet any comments for this method."
func parseApiASTInfo() (map[string]string, map[string]string) { //nolint:golint
func ParseApiASTInfo(apiFile, iface, pkg, dir string) (comments map[string]string, groupDocs map[string]string) { //nolint:golint
fset := token.NewFileSet()
pkgs, err := parser.ParseDir(fset, "./api", nil, parser.AllErrors|parser.ParseComments)
apiDir, err := filepath.Abs(dir)
if err != nil {
fmt.Println("./api filepath absolute error: ", err)
return
}
apiFile, err = filepath.Abs(apiFile)
if err != nil {
fmt.Println("filepath absolute error: ", err, "file:", apiFile)
return
}
pkgs, err := parser.ParseDir(fset, apiDir, nil, parser.AllErrors|parser.ParseComments)
if err != nil {
fmt.Println("parse error: ", err)
return
}
ap := pkgs["api"]
ap := pkgs[pkg]
f := ap.Files["api/api_full.go"]
f := ap.Files[apiFile]
cmap := ast.NewCommentMap(fset, f, f.Comments)
v := &Visitor{make(map[string]ast.Node)}
ast.Walk(v, pkgs["api"])
v := &Visitor{iface, make(map[string]ast.Node)}
ast.Walk(v, ap)
groupDocs := make(map[string]string)
out := make(map[string]string)
comments = make(map[string]string)
groupDocs = make(map[string]string)
for mn, node := range v.Methods {
cs := cmap.Filter(node).Comments()
if len(cs) == 0 {
out[mn] = noComment
filteredComments := cmap.Filter(node).Comments()
if len(filteredComments) == 0 {
comments[mn] = NoComment
} else {
for _, c := range cs {
for _, c := range filteredComments {
if strings.HasPrefix(c.Text(), "MethodGroup:") {
parts := strings.Split(c.Text(), "\n")
groupName := strings.TrimSpace(parts[0][12:])
@@ -277,15 +434,19 @@ func parseApiASTInfo() (map[string]string, map[string]string) { //nolint:golint
}
}
last := cs[len(cs)-1].Text()
l := len(filteredComments) - 1
if len(filteredComments) > 1 {
l = len(filteredComments) - 2
}
last := filteredComments[l].Text()
if !strings.HasPrefix(last, "MethodGroup:") {
out[mn] = last
comments[mn] = last
} else {
out[mn] = noComment
comments[mn] = NoComment
}
}
}
return out, groupDocs
return comments, groupDocs
}
type MethodGroup struct {
@@ -301,7 +462,7 @@ type Method struct {
ResponseExample string
}
func methodGroupFromName(mn string) string {
func MethodGroupFromName(mn string) string {
i := strings.IndexFunc(mn[1:], func(r rune) bool {
return unicode.IsUpper(r)
})
@@ -310,112 +471,3 @@ func methodGroupFromName(mn string) string {
}
return mn[:i+1]
}
func main() {
comments, groupComments := parseApiASTInfo()
groups := make(map[string]*MethodGroup)
var api struct{ api.FullNode }
t := reflect.TypeOf(api)
for i := 0; i < t.NumMethod(); i++ {
m := t.Method(i)
groupName := methodGroupFromName(m.Name)
g, ok := groups[groupName]
if !ok {
g = new(MethodGroup)
g.Header = groupComments[groupName]
g.GroupName = groupName
groups[groupName] = g
}
var args []interface{}
ft := m.Func.Type()
for j := 2; j < ft.NumIn(); j++ {
inp := ft.In(j)
args = append(args, exampleValue(inp, nil))
}
v, err := json.MarshalIndent(args, "", " ")
if err != nil {
panic(err)
}
outv := exampleValue(ft.Out(0), nil)
ov, err := json.MarshalIndent(outv, "", " ")
if err != nil {
panic(err)
}
g.Methods = append(g.Methods, &Method{
Name: m.Name,
Comment: comments[m.Name],
InputExample: string(v),
ResponseExample: string(ov),
})
}
var groupslice []*MethodGroup
for _, g := range groups {
groupslice = append(groupslice, g)
}
sort.Slice(groupslice, func(i, j int) bool {
return groupslice[i].GroupName < groupslice[j].GroupName
})
fmt.Printf("# Groups\n")
for _, g := range groupslice {
fmt.Printf("* [%s](#%s)\n", g.GroupName, g.GroupName)
for _, method := range g.Methods {
fmt.Printf(" * [%s](#%s)\n", method.Name, method.Name)
}
}
permStruct := reflect.TypeOf(apistruct.FullNodeStruct{}.Internal)
commonPermStruct := reflect.TypeOf(apistruct.CommonStruct{}.Internal)
for _, g := range groupslice {
g := g
fmt.Printf("## %s\n", g.GroupName)
fmt.Printf("%s\n\n", g.Header)
sort.Slice(g.Methods, func(i, j int) bool {
return g.Methods[i].Name < g.Methods[j].Name
})
for _, m := range g.Methods {
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)
}
}
perms := meth.Tag.Get("perm")
fmt.Printf("Perms: %s\n\n", perms)
if strings.Count(m.InputExample, "\n") > 0 {
fmt.Printf("Inputs:\n```json\n%s\n```\n\n", m.InputExample)
} else {
fmt.Printf("Inputs: `%s`\n\n", m.InputExample)
}
if strings.Count(m.ResponseExample, "\n") > 0 {
fmt.Printf("Response:\n```json\n%s\n```\n\n", m.ResponseExample)
} else {
fmt.Printf("Response: `%s`\n\n", m.ResponseExample)
}
}
}
}
File diff suppressed because it is too large Load Diff
+48
View File
@@ -0,0 +1,48 @@
package api
import (
"github.com/filecoin-project/go-jsonrpc/auth"
)
const (
// When changing these, update docs/API.md too
PermRead auth.Permission = "read" // default
PermWrite auth.Permission = "write"
PermSign auth.Permission = "sign" // Use wallet keys for signing
PermAdmin auth.Permission = "admin" // Manage permissions
)
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
permissionedProxies(a, &out)
return &out
}
func PermissionedFullAPI(a FullNode) FullNode {
var out FullNodeStruct
permissionedProxies(a, &out)
return &out
}
func PermissionedWorkerAPI(a Worker) Worker {
var out WorkerStruct
permissionedProxies(a, &out)
return &out
}
func PermissionedWalletAPI(a Wallet) Wallet {
var out WalletStruct
permissionedProxies(a, &out)
return &out
}
+4877
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)
}
-56
View File
@@ -1,56 +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 {
time.Sleep(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
520, // 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{FullNodeWithUpgradeAt(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)
// 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
}
-458
View File
@@ -1,458 +0,0 @@
package test
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"sync/atomic"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/ipfs/go-cid"
files "github.com/ipfs/go-ipfs-files"
"github.com/ipld/go-car"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
dag "github.com/ipfs/go-merkledag"
dstest "github.com/ipfs/go-merkledag/test"
unixfile "github.com/ipfs/go-unixfs/file"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/impl"
ipld "github.com/ipfs/go-ipld-format"
)
func TestDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, carExport, fastRet bool) {
ctx := context.Background()
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)
}
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)
}
}
}()
MakeDeal(t, ctx, 6, client, miner, carExport, fastRet)
atomic.AddInt64(&mine, -1)
fmt.Println("shutting down mining")
<-done
}
func TestDoubleDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx := context.Background()
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)
}
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)
}
}
}()
MakeDeal(t, ctx, 6, client, miner, false, false)
MakeDeal(t, ctx, 7, client, miner, false, false)
atomic.AddInt64(&mine, -1)
fmt.Println("shutting down mining")
<-done
}
func MakeDeal(t *testing.T, ctx context.Context, rseed int, client api.FullNode, miner TestStorageNode, carExport, fastRet bool) {
res, data, err := CreateClientFile(ctx, client, rseed)
if err != nil {
t.Fatal(err)
}
fcid := res.Root
fmt.Println("FILE CID: ", fcid)
deal := startDeal(t, ctx, miner, client, fcid, fastRet)
// 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)
// 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 int) (*api.ImportRes, []byte, error) {
data := make([]byte, 1600)
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 TestFastRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx := context.Background()
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)
}
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)
}
}
}()
data := make([]byte, 1600)
rand.New(rand.NewSource(int64(8))).Read(data)
r := bytes.NewReader(data)
fcid, err := client.ClientImportLocal(ctx, r)
if err != nil {
t.Fatal(err)
}
fmt.Println("FILE CID: ", fcid)
deal := startDeal(t, ctx, miner, client, fcid, true)
waitDealPublished(t, ctx, miner, deal)
fmt.Println("deal published, retrieving")
// Retrieval
info, err := client.ClientGetDealInfo(ctx, *deal)
require.NoError(t, err)
testRetrieval(t, ctx, client, fcid, &info.PieceCID, false, data)
atomic.AddInt64(&mine, -1)
fmt.Println("shutting down mining")
<-done
}
func TestSenondDealRetrieval(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx := context.Background()
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)
}
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)
}
}
}()
{
data1 := make([]byte, 800)
rand.New(rand.NewSource(int64(3))).Read(data1)
r := bytes.NewReader(data1)
fcid1, err := client.ClientImportLocal(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 := client.ClientImportLocal(ctx, r2)
if err != nil {
t.Fatal(err)
}
deal1 := startDeal(t, ctx, miner, client, fcid1, true)
// 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, deal1, true)
deal2 := startDeal(t, ctx, miner, client, fcid2, true)
time.Sleep(time.Second)
waitDealSealed(t, ctx, miner, client, deal2, false)
// Retrieval
info, err := client.ClientGetDealInfo(ctx, *deal2)
require.NoError(t, err)
rf, _ := miner.SectorsRefs(ctx)
fmt.Printf("refs: %+v\n", rf)
testRetrieval(t, ctx, client, fcid2, &info.PieceCID, false, data2)
}
atomic.AddInt64(&mine, -1)
fmt.Println("shutting down mining")
<-done
}
func startDeal(t *testing.T, ctx context.Context, miner TestStorageNode, client api.FullNode, fcid cid.Cid, fastRet bool) *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),
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 bool) {
loop:
for {
di, err := client.ClientGetDealInfo(ctx, *deal)
if err != nil {
t.Fatal(err)
}
switch di.State {
case storagemarket.StorageDealSealing:
if noseal {
return
}
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
}
fmt.Println("Deal state: ", storagemarket.DealStates[di.State])
time.Sleep(time.Second / 2)
}
}
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.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 state: %s", si.State)
if si.State == api.SectorState(sealing.WaitDeals) {
require.NoError(t, miner.SectorStartSealing(ctx, snum))
}
}
}
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
}
-204
View File
@@ -1,204 +0,0 @@
package test
import (
"bytes"
"context"
"fmt"
"math/rand"
"sync/atomic"
"testing"
"time"
logging "github.com/ipfs/go-log/v2"
"github.com/filecoin-project/go-state-types/abi"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/lotus/build"
"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)
initHead := (<-newHeads)[0]
if initHead.Val.Height() != 2 {
<-newHeads
}
h1, err := api.ChainHead(ctx)
require.NoError(t, err)
require.Equal(t, abi.ChainEpoch(2), 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.Equal(t, abi.ChainEpoch(3), h2.Height())
MineUntilBlock(ctx, t, apis[0], sn[0], nil)
require.NoError(t, err)
<-newHeads
h2, err = api.ChainHead(ctx)
require.NoError(t, err)
require.Equal(t, abi.ChainEpoch(4), 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)
// 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)
<-minedTwo
atomic.StoreInt32(&mine, 0)
fmt.Println("shutting down mining")
<-done
}
-114
View File
@@ -1,114 +0,0 @@
package test
import (
"context"
"fmt"
"testing"
"time"
"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"
"github.com/filecoin-project/lotus/node"
"github.com/filecoin-project/lotus/node/impl"
"github.com/stretchr/testify/require"
)
func TestTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration) {
t.Run("before", func(t *testing.T) { testTapeFix(t, b, blocktime, false) })
t.Run("after", func(t *testing.T) { testTapeFix(t, b, blocktime, true) })
}
func testTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration, after bool) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
upgradeSchedule := stmgr.UpgradeSchedule{{
Network: build.ActorUpgradeNetworkVersion,
Height: 1,
Migration: stmgr.UpgradeActorsV2,
}}
if after {
upgradeSchedule = append(upgradeSchedule, stmgr.Upgrade{
Network: network.Version5,
Height: 2,
})
}
n, sn := b(t, []FullNodeOpts{{Opts: func(_ []TestNode) node.Option {
return node.Override(new(stmgr.UpgradeSchedule), upgradeSchedule)
}}}, 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)
done := make(chan struct{})
go func() {
defer close(done)
for ctx.Err() == nil {
build.Clock.Sleep(blocktime)
if err := sn[0].MineOne(ctx, MineNext); err != nil {
if ctx.Err() != nil {
// context was canceled, ignore the error.
return
}
t.Error(err)
}
}
}()
defer func() {
cancel()
<-done
}()
err = miner.PledgeSector(ctx)
require.NoError(t, err)
// Wait till done.
var sectorNo abi.SectorNumber
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) == 1 {
sectorNo = s[0]
break
}
build.Clock.Sleep(100 * time.Millisecond)
}
fmt.Printf("All sectors is fsm\n")
// If before, we expect the precommit to fail
successState := api.SectorState(sealing.CommitFailed)
failureState := api.SectorState(sealing.Proving)
if after {
// otherwise, it should succeed.
successState, failureState = failureState, successState
}
for {
st, err := miner.SectorsStatus(ctx, sectorNo, false)
require.NoError(t, err)
if st.State == successState {
break
}
require.NotEqual(t, failureState, st.State)
build.Clock.Sleep(100 * time.Millisecond)
fmt.Println("WaitSeal")
}
}
-243
View File
@@ -1,243 +0,0 @@
package test
import (
"context"
"fmt"
"os"
"testing"
"time"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
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-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"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/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 TestNode struct {
api.FullNode
// ListenAddr is the address on which an API server is listening, if an
// API server is created for this Node
ListenAddr multiaddr.Multiaddr
}
type TestStorageNode struct {
api.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
}
var PresealGenesis = -1
const GenesisPreseals = 2
// Options for setting up a mock storage miner
type StorageMiner struct {
Full int
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)
}
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 FullNodeWithUpgradeAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
return FullNodeOpts{
Opts: func(nodes []TestNode) node.Option {
return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
// Skip directly to tape height so precommits work.
Network: network.Version5,
Height: upgradeHeight,
Migration: stmgr.UpgradeActorsV2,
}})
},
}
}
var MineNext = miner.MineReq{
InjectNulls: 0,
Done: func(bool, abi.ChainEpoch, error) {},
}
func (ts *testSuite) testVersion(t *testing.T) {
build.RunningNodeType = build.NodeFull
ctx := context.Background()
apis, _ := ts.makeNodes(t, OneFull, OneMiner)
api := apis[0]
v, err := api.Version(ctx)
if err != nil {
t.Fatal(err)
}
require.Equal(t, v.Version, 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)
if err != nil {
t.Fatal(err)
}
if res.Receipt.ExitCode != 0 {
t.Fatal("did not successfully send message")
}
searchRes, err := api.StateSearchMsg(ctx, sm.Cid())
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")
}
}
-86
View File
@@ -1,86 +0,0 @@
package test
import (
"context"
"testing"
"time"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-address"
"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)
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...")
}
-336
View File
@@ -1,336 +0,0 @@
package test
import (
"context"
"fmt"
"sync/atomic"
"strings"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/extern/sector-storage/mock"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
bminer "github.com/filecoin-project/lotus/miner"
"github.com/filecoin-project/lotus/node/impl"
)
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 pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n, existing int, blockNotif <-chan struct{}) {
for i := 0; i < n; i++ {
err := miner.PledgeSector(ctx)
require.NoError(t, err)
if i%3 == 0 && blockNotif != nil {
<-blockNotif
}
}
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{}{}
}
for len(toCheck) > 0 {
for n := range toCheck {
st, err := miner.SectorsStatus(ctx, n, false)
require.NoError(t, err)
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\n", len(s))
}
}
func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
for _, height := range []abi.ChainEpoch{
1, // before
162, // while sealing
5000, // while proving
} {
height := height // copy to satisfy lints
t.Run(fmt.Sprintf("upgrade-%d", height), func(t *testing.T) {
testWindowPostUpgrade(t, b, blocktime, nSectors, height)
})
}
}
func testWindowPostUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int,
upgradeHeight abi.ChainEpoch) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
n, sn := b(t, []FullNodeOpts{FullNodeWithUpgradeAt(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)
}
build.Clock.Sleep(time.Second)
done := make(chan struct{})
go func() {
defer close(done)
for ctx.Err() == nil {
build.Clock.Sleep(blocktime)
if err := sn[0].MineOne(ctx, MineNext); err != nil {
if ctx.Err() != nil {
// context was canceled, ignore the error.
return
}
t.Error(err)
}
}
}()
defer func() {
cancel()
<-done
}()
pledgeSectors(t, ctx, miner, nSectors, 0, nil)
maddr, err := miner.ActorAddress(ctx)
require.NoError(t, err)
di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
mid, err := address.IDFromAddress(maddr)
require.NoError(t, err)
fmt.Printf("Running one proving period\n")
fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
for {
head, err := client.ChainHead(ctx)
require.NoError(t, err)
if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 {
fmt.Printf("Now head.Height = %d\n", head.Height())
break
}
build.Clock.Sleep(blocktime)
}
p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
ssz, err := miner.ActorSectorSize(ctx, maddr)
require.NoError(t, err)
require.Equal(t, p.MinerPower, p.TotalPower)
require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*uint64(nSectors+GenesisPreseals)))
fmt.Printf("Drop some sectors\n")
// Drop 2 sectors from deadline 2 partition 0 (full partition / deadline)
{
parts, err := client.StateMinerPartitions(ctx, maddr, 2, types.EmptyTSK)
require.NoError(t, err)
require.Greater(t, len(parts), 0)
secs := parts[0].AllSectors
n, err := secs.Count()
require.NoError(t, err)
require.Equal(t, uint64(2), n)
// Drop the partition
err = secs.ForEach(func(sid uint64) error {
return miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkCorrupted(abi.SectorID{
Miner: abi.ActorID(mid),
Number: abi.SectorNumber(sid),
}, true)
})
require.NoError(t, err)
}
var s abi.SectorID
// Drop 1 sectors from deadline 3 partition 0
{
parts, err := client.StateMinerPartitions(ctx, maddr, 3, types.EmptyTSK)
require.NoError(t, err)
require.Greater(t, len(parts), 0)
secs := parts[0].AllSectors
n, err := secs.Count()
require.NoError(t, err)
require.Equal(t, uint64(2), n)
// Drop the sector
sn, err := secs.First()
require.NoError(t, err)
all, err := secs.All(2)
require.NoError(t, err)
fmt.Println("the sectors", all)
s = abi.SectorID{
Miner: abi.ActorID(mid),
Number: abi.SectorNumber(sn),
}
err = miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkFailed(s, true)
require.NoError(t, err)
}
di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
fmt.Printf("Go through another PP, wait for sectors to become faulty\n")
fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
for {
head, err := client.ChainHead(ctx)
require.NoError(t, err)
if head.Height() > di.PeriodStart+(di.WPoStProvingPeriod)+2 {
fmt.Printf("Now head.Height = %d\n", head.Height())
break
}
build.Clock.Sleep(blocktime)
}
p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
require.Equal(t, p.MinerPower, p.TotalPower)
sectors := p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
require.Equal(t, nSectors+GenesisPreseals-3, int(sectors)) // -3 just removed sectors
fmt.Printf("Recover one sector\n")
err = miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkFailed(s, false)
require.NoError(t, err)
di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
for {
head, err := client.ChainHead(ctx)
require.NoError(t, err)
if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 {
fmt.Printf("Now head.Height = %d\n", head.Height())
break
}
build.Clock.Sleep(blocktime)
}
p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
require.Equal(t, p.MinerPower, p.TotalPower)
sectors = p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
require.Equal(t, nSectors+GenesisPreseals-2, int(sectors)) // -2 not recovered sectors
// pledge a sector after recovery
pledgeSectors(t, ctx, miner, 1, nSectors, nil)
{
// Wait until proven.
di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
waitUntil := di.PeriodStart + di.WPoStProvingPeriod + 2
fmt.Printf("End for head.Height > %d\n", waitUntil)
for {
head, err := client.ChainHead(ctx)
require.NoError(t, err)
if head.Height() > waitUntil {
fmt.Printf("Now head.Height = %d\n", head.Height())
break
}
}
}
p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
require.Equal(t, p.MinerPower, p.TotalPower)
sectors = p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
require.Equal(t, nSectors+GenesisPreseals-2+1, int(sectors)) // -2 not recovered sectors + 1 just pledged
}
+102 -14
View File
@@ -3,10 +3,13 @@ package api
import (
"encoding/json"
"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/filecoin-project/lotus/build"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
@@ -51,19 +54,6 @@ type MessageSendSpec struct {
MaxFee abi.TokenAmount
}
var DefaultMessageSendSpec = MessageSendSpec{
// MaxFee of 0.1FIL
MaxFee: abi.NewTokenAmount(int64(build.FilecoinPrecision) / 10),
}
func (ms *MessageSendSpec) Get() MessageSendSpec {
if ms == nil {
return DefaultMessageSendSpec
}
return *ms
}
type DataTransferChannel struct {
TransferID datatransfer.TransferID
Status datatransfer.Status
@@ -74,6 +64,7 @@ type DataTransferChannel struct {
Message string
OtherPeer peer.ID
Transferred uint64
Stages *datatransfer.ChannelStages
}
// NewDataTransferChannel constructs an API DataTransferChannel type from full channel state snapshot and a host id
@@ -107,3 +98,100 @@ func NewDataTransferChannel(hostID peer.ID, channelState datatransfer.ChannelSta
}
return channel
}
type NetBlockList struct {
Peers []peer.ID
IPAddrs []string
IPSubnets []string
}
type ExtendedPeerInfo struct {
ID peer.ID
Agent string
Addrs []string
Protocols []string
ConnMgrMeta *ConnMgrInfo
}
type ConnMgrInfo struct {
FirstSeen time.Time
Value int
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
}
+5
View File
@@ -0,0 +1,5 @@
package apitypes
import "github.com/filecoin-project/go-state-types/network"
type NetworkVersion = network.Version
+3
View File
@@ -0,0 +1,3 @@
package apitypes
type OpenRPCDocument map[string]interface{}
+711
View File
@@ -0,0 +1,711 @@
package v0api
import (
"context"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
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-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"
"github.com/filecoin-project/lotus/api"
apitypes "github.com/filecoin-project/lotus/api/types"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
"github.com/filecoin-project/lotus/chain/types"
marketevents "github.com/filecoin-project/lotus/markets/loggers"
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
//go:generate go run github.com/golang/mock/mockgen -destination=v0mocks/mock_full.go -package=v0mocks . FullNode
// MODIFYING THE API INTERFACE
//
// NOTE: This is the V0 (Stable) API - when adding methods to this interface,
// you'll need to make sure they are also present on the V1 (Unstable) API
//
// This API is implemented in `v1_wrapper.go` as a compatibility layer backed
// by the V1 api
//
// 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
// 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
// blockchain, but that do not require any form of state computation.
// ChainNotify returns channel with chain head updates.
// First message is guaranteed to be of len == 1, and type == 'current'.
ChainNotify(context.Context) (<-chan []*api.HeadChange, error) //perm:read
// ChainHead returns the current head of the chain.
ChainHead(context.Context) (*types.TipSet, error) //perm:read
// ChainGetRandomnessFromTickets is used to sample the chain for randomness.
ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read
// ChainGetRandomnessFromBeacon is used to sample the beacon for randomness.
ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read
// ChainGetBlock returns the block specified by the given CID.
ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error) //perm:read
// ChainGetTipSet returns the tipset specified by the given TipSetKey.
ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) //perm:read
// ChainGetBlockMessages returns messages stored in the specified block.
//
// Note: If there are multiple blocks in a tipset, it's likely that some
// messages will be duplicated. It's also possible for blocks in a tipset to have
// different messages from the same sender at the same nonce. When that happens,
// only the first message (in a block with lowest ticket) will be considered
// for execution
//
// NOTE: THIS METHOD SHOULD ONLY BE USED FOR GETTING MESSAGES IN A SPECIFIC BLOCK
//
// DO NOT USE THIS METHOD TO GET MESSAGES INCLUDED IN A TIPSET
// Use ChainGetParentMessages, which will perform correct message deduplication
ChainGetBlockMessages(ctx context.Context, blockCid cid.Cid) (*api.BlockMessages, error) //perm:read
// ChainGetParentReceipts returns receipts for messages in parent tipset of
// the specified block. The receipts in the list returned is one-to-one with the
// messages returned by a call to ChainGetParentMessages with the same blockCid.
ChainGetParentReceipts(ctx context.Context, blockCid cid.Cid) ([]*types.MessageReceipt, error) //perm:read
// ChainGetParentMessages returns messages stored in parent tipset of the
// 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.
ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) //perm:read
// ChainReadObj reads ipld nodes referenced by the specified CID from chain
// blockstore and returns raw bytes.
ChainReadObj(context.Context, cid.Cid) ([]byte, error) //perm:read
// ChainDeleteObj deletes node referenced by the given CID
ChainDeleteObj(context.Context, cid.Cid) error //perm:admin
// ChainHasObj checks if a given CID exists in the chain blockstore.
ChainHasObj(context.Context, cid.Cid) (bool, error) //perm:read
// ChainStatObj returns statistics about the graph referenced by 'obj'.
// If 'base' is also specified, then the returned stat will be a diff
// between the two objects.
ChainStatObj(ctx context.Context, obj cid.Cid, base cid.Cid) (api.ObjStat, error) //perm:read
// ChainSetHead forcefully sets current chain head. Use with caution.
ChainSetHead(context.Context, types.TipSetKey) error //perm:admin
// ChainGetGenesis returns the genesis tipset.
ChainGetGenesis(context.Context) (*types.TipSet, error) //perm:read
// ChainTipSetWeight computes weight for the specified tipset.
ChainTipSetWeight(context.Context, types.TipSetKey) (types.BigInt, error) //perm:read
ChainGetNode(ctx context.Context, p string) (*api.IpldObject, error) //perm:read
// ChainGetMessage reads a message referenced by the specified CID from the
// chain blockstore.
ChainGetMessage(context.Context, cid.Cid) (*types.Message, error) //perm:read
// ChainGetPath returns a set of revert/apply operations needed to get from
// one tipset to another, for example:
//```
// to
// ^
// from tAA
// ^ ^
// tBA tAB
// ^---*--^
// ^
// tRR
//```
// Would return `[revert(tBA), apply(tAB), apply(tAA)]`
ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*api.HeadChange, error) //perm:read
// ChainExport returns a stream of bytes with CAR dump of chain data.
// The exported chain data includes the header chain from the given tipset
// back to genesis, the entire genesis state, and the most recent 'nroots'
// state trees.
// 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
// MethodGroup: Beacon
// The Beacon method group contains methods for interacting with the random beacon (DRAND)
// BeaconGetEntry returns the beacon entry for the given filecoin epoch. If
// the entry has not yet been produced, the call will block until the entry
// becomes available
BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) //perm:read
// GasEstimateFeeCap estimates gas fee cap
GasEstimateFeeCap(context.Context, *types.Message, int64, types.TipSetKey) (types.BigInt, error) //perm:read
// GasEstimateGasLimit estimates gas used by the message and returns it.
// It fails if message fails to execute.
GasEstimateGasLimit(context.Context, *types.Message, types.TipSetKey) (int64, error) //perm:read
// GasEstimateGasPremium estimates what gas price should be used for a
// message to have high likelihood of inclusion in `nblocksincl` epochs.
GasEstimateGasPremium(_ context.Context, nblocksincl uint64,
sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) //perm:read
// GasEstimateMessageGas estimates gas values for unset message gas fields
GasEstimateMessageGas(context.Context, *types.Message, *api.MessageSendSpec, types.TipSetKey) (*types.Message, error) //perm:read
// MethodGroup: Sync
// The Sync method group contains methods for interacting with and
// observing the lotus sync service.
// SyncState returns the current status of the lotus sync system.
SyncState(context.Context) (*api.SyncState, error) //perm:read
// SyncSubmitBlock can be used to submit a newly created block to the.
// network through this node
SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error //perm:write
// SyncIncomingBlocks returns a channel streaming incoming, potentially not
// yet synced block headers.
SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) //perm:read
// SyncCheckpoint marks a blocks as checkpointed, meaning that it won't ever fork away from it.
SyncCheckpoint(ctx context.Context, tsk types.TipSetKey) error //perm:admin
// SyncMarkBad marks a blocks as bad, meaning that it won't ever by synced.
// Use with extreme caution.
SyncMarkBad(ctx context.Context, bcid cid.Cid) error //perm:admin
// SyncUnmarkBad unmarks a blocks as bad, making it possible to be validated and synced again.
SyncUnmarkBad(ctx context.Context, bcid cid.Cid) error //perm:admin
// SyncUnmarkAllBad purges bad block cache, making it possible to sync to chains previously marked as bad
SyncUnmarkAllBad(ctx context.Context) error //perm:admin
// SyncCheckBad checks if a block was marked as bad, and if it was, returns
// the reason.
SyncCheckBad(ctx context.Context, bcid cid.Cid) (string, error) //perm:read
// SyncValidateTipset indicates whether the provided tipset is valid or not
SyncValidateTipset(ctx context.Context, tsk types.TipSetKey) (bool, error) //perm:read
// MethodGroup: Mpool
// The Mpool methods are for interacting with the message pool. The message pool
// manages all incoming and outgoing 'messages' going over the network.
// MpoolPending returns pending mempool messages.
MpoolPending(context.Context, types.TipSetKey) ([]*types.SignedMessage, error) //perm:read
// MpoolSelect returns a list of pending messages for inclusion in the next block
MpoolSelect(context.Context, types.TipSetKey, float64) ([]*types.SignedMessage, error) //perm:read
// MpoolPush pushes a signed message to mempool.
MpoolPush(context.Context, *types.SignedMessage) (cid.Cid, error) //perm:write
// MpoolPushUntrusted pushes a signed message to mempool from untrusted sources.
MpoolPushUntrusted(context.Context, *types.SignedMessage) (cid.Cid, error) //perm:write
// MpoolPushMessage atomically assigns a nonce, signs, and pushes a message
// to mempool.
// maxFee is only used when GasFeeCap/GasPremium fields aren't specified
//
// When maxFee is set to 0, MpoolPushMessage will guess appropriate fee
// based on current chain conditions
MpoolPushMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) (*types.SignedMessage, error) //perm:sign
// MpoolBatchPush batch pushes a signed message to mempool.
MpoolBatchPush(context.Context, []*types.SignedMessage) ([]cid.Cid, error) //perm:write
// MpoolBatchPushUntrusted batch pushes a signed message to mempool from untrusted sources.
MpoolBatchPushUntrusted(context.Context, []*types.SignedMessage) ([]cid.Cid, error) //perm:write
// MpoolBatchPushMessage batch pushes a unsigned message to mempool.
MpoolBatchPushMessage(context.Context, []*types.Message, *api.MessageSendSpec) ([]*types.SignedMessage, error) //perm:sign
// 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
MpoolSub(context.Context) (<-chan api.MpoolUpdate, error) //perm:read
// MpoolClear clears pending messages from the mpool
MpoolClear(context.Context, bool) error //perm:write
// MpoolGetConfig returns (a copy of) the current mpool config
MpoolGetConfig(context.Context) (*types.MpoolConfig, error) //perm:read
// MpoolSetConfig sets the mpool config to (a copy of) the supplied config
MpoolSetConfig(context.Context, *types.MpoolConfig) error //perm:admin
// MethodGroup: Miner
MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error) //perm:read
MinerCreateBlock(context.Context, *api.BlockTemplate) (*types.BlockMsg, error) //perm:write
// // UX ?
// MethodGroup: Wallet
// WalletNew creates a new address in the wallet with the given sigType.
// Available key types: bls, secp256k1, secp256k1-ledger
// Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated
WalletNew(context.Context, types.KeyType) (address.Address, error) //perm:write
// WalletHas indicates whether the given address is in the wallet.
WalletHas(context.Context, address.Address) (bool, error) //perm:write
// WalletList lists all the addresses in the wallet.
WalletList(context.Context) ([]address.Address, error) //perm:write
// WalletBalance returns the balance of the given address at the current head of the chain.
WalletBalance(context.Context, address.Address) (types.BigInt, error) //perm:read
// WalletSign signs the given bytes using the given address.
WalletSign(context.Context, address.Address, []byte) (*crypto.Signature, error) //perm:sign
// WalletSignMessage signs the given message using the given address.
WalletSignMessage(context.Context, address.Address, *types.Message) (*types.SignedMessage, error) //perm:sign
// WalletVerify takes an address, a signature, and some bytes, and indicates whether the signature is valid.
// The address does not have to be in the wallet.
WalletVerify(context.Context, address.Address, []byte, *crypto.Signature) (bool, error) //perm:read
// WalletDefaultAddress returns the address marked as default in the wallet.
WalletDefaultAddress(context.Context) (address.Address, error) //perm:write
// WalletSetDefault marks the given address as as the default one.
WalletSetDefault(context.Context, address.Address) error //perm:write
// WalletExport returns the private key of an address in the wallet.
WalletExport(context.Context, address.Address) (*types.KeyInfo, error) //perm:admin
// WalletImport receives a KeyInfo, which includes a private key, and imports it into the wallet.
WalletImport(context.Context, *types.KeyInfo) (address.Address, error) //perm:admin
// WalletDelete deletes an address from the wallet.
WalletDelete(context.Context, address.Address) error //perm:admin
// WalletValidateAddress validates whether a given string can be decoded as a well-formed address
WalletValidateAddress(context.Context, string) (address.Address, error) //perm:read
// Other
// MethodGroup: Client
// The Client methods all have to do with interacting with the storage and
// retrieval markets as a client
// 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 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.
ClientListDeals(ctx context.Context) ([]api.DealInfo, error) //perm:write
// ClientGetDealUpdates returns the status of updated deals
ClientGetDealUpdates(ctx context.Context) (<-chan api.DealInfo, error) //perm:write
// ClientGetDealStatus returns status given a code
ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) //perm:read
// ClientHasLocal indicates whether a certain CID is locally stored.
ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error) //perm:write
// ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer).
ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) //perm:read
// ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.
ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) //perm:read
// ClientRetrieve initiates the retrieval of a file, as specified in the order.
ClientRetrieve(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error //perm:admin
// ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
// of status updates.
ClientRetrieveWithEvents(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
// 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
// ClientCalcCommP calculates the CommP for a specified file
ClientCalcCommP(ctx context.Context, inpath string) (*api.CommPRet, error) //perm:write
// ClientGenCar generates a CAR file for the specified file.
ClientGenCar(ctx context.Context, ref api.FileRef, outpath string) error //perm:write
// ClientDealSize calculates real deal data size
ClientDealSize(ctx context.Context, root cid.Cid) (api.DataSize, error) //perm:read
// ClientListTransfers returns the status of all ongoing transfers of data
ClientListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error) //perm:write
ClientDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error) //perm:write
// ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer
ClientRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
// ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer
ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
// ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel
// which are stuck due to insufficient funds
ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error //perm:write
// ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID
ClientCancelRetrievalDeal(ctx context.Context, dealid retrievalmarket.DealID) error //perm:write
// ClientUnimport removes references to the specified file from filestore
//ClientUnimport(path string)
// ClientListImports lists imported files and their root CIDs
ClientListImports(ctx context.Context) ([]api.Import, error) //perm:write
//ClientListAsks() []Ask
// MethodGroup: State
// The State methods are used to query, inspect, and interact with chain state.
// Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset.
// A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used.
// StateCall runs the given message and returns its result without any persisted changes.
//
// StateCall applies the message to the tipset's parent state. The
// message is not applied on-top-of the messages in the passed-in
// tipset.
StateCall(context.Context, *types.Message, types.TipSetKey) (*api.InvocResult, error) //perm:read
// StateReplay replays a given message, assuming it was included in a block in the specified tipset.
//
// If a tipset key is provided, and a replacing message is found on chain,
// the method will return an error saying that the message wasn't found
//
// If no tipset key is provided, the appropriate tipset is looked up, and if
// the message was gas-repriced, the on-chain message will be replayed - in
// that case the returned InvocResult.MsgCid will not match the Cid param
//
// If the caller wants to ensure that exactly the requested message was executed,
// they MUST check that InvocResult.MsgCid is equal to the provided Cid.
// Without this check both the requested and original message may appear as
// successfully executed on-chain, which may look like a double-spend.
//
// A replacing message is a message with a different CID, any of Gas values, and
// different signature, but with all other parameters matching (source/destination,
// nonce, params, etc.)
StateReplay(context.Context, types.TipSetKey, cid.Cid) (*api.InvocResult, error) //perm:read
// StateGetActor returns the indicated actor's nonce and balance.
StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) //perm:read
// StateReadState returns the indicated actor's state.
StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*api.ActorState, error) //perm:read
// StateListMessages looks back and returns all messages with a matching to or from address, stopping at the given height.
StateListMessages(ctx context.Context, match *api.MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) //perm:read
// StateDecodeParams attempts to decode the provided params, based on the recipient actor address and method number.
StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) //perm:read
// StateNetworkName returns the name of the network the node is synced to
StateNetworkName(context.Context) (dtypes.NetworkName, error) //perm:read
// StateMinerSectors returns info about the given miner's sectors. If the filter bitfield is nil, all sectors are included.
StateMinerSectors(context.Context, address.Address, *bitfield.BitField, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read
// StateMinerActiveSectors returns info about sectors that a given miner is actively proving.
StateMinerActiveSectors(context.Context, address.Address, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read
// StateMinerProvingDeadline calculates the deadline at some epoch for a proving period
// and returns the deadline-related calculations.
StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error) //perm:read
// StateMinerPower returns the power of the indicated miner
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error) //perm:read
// StateMinerInfo returns info about the indicated miner
StateMinerInfo(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) //perm:read
// StateMinerDeadlines returns all the proving deadlines for the given miner
StateMinerDeadlines(context.Context, address.Address, types.TipSetKey) ([]api.Deadline, error) //perm:read
// StateMinerPartitions returns all partitions in the specified deadline
StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]api.Partition, error) //perm:read
// StateMinerFaults returns a bitfield indicating the faulty sectors of the given miner
StateMinerFaults(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) //perm:read
// StateAllMinerFaults returns all non-expired Faults that occur within lookback epochs of the given tipset
StateAllMinerFaults(ctx context.Context, lookback abi.ChainEpoch, ts types.TipSetKey) ([]*api.Fault, error) //perm:read
// StateMinerRecoveries returns a bitfield indicating the recovering sectors of the given miner
StateMinerRecoveries(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) //perm:read
// StateMinerInitialPledgeCollateral returns the precommit deposit for the specified miner's sector
StateMinerPreCommitDepositForPower(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) //perm:read
// StateMinerInitialPledgeCollateral returns the initial pledge collateral for the specified miner's sector
StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) //perm:read
// StateMinerAvailableBalance returns the portion of a miner's balance that can be withdrawn or spent
StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) //perm:read
// StateMinerSectorAllocated checks if a sector is allocated
StateMinerSectorAllocated(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error) //perm:read
// StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector
StateSectorPreCommitInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) //perm:read
// StateSectorGetInfo returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found
// NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate
// expiration epoch
StateSectorGetInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error) //perm:read
// StateSectorExpiration returns epoch at which given sector will expire
StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error) //perm:read
// StateSectorPartition finds deadline/partition with the specified sector
StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error) //perm:read
// StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed
//
// NOTE: If a replacing message is found on chain, this method will return
// a MsgLookup for the replacing message - the MsgLookup.Message will be a different
// CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
// result of the execution of the replacing message.
//
// If the caller wants to ensure that exactly the requested message was executed,
// they MUST check that MsgLookup.Message is equal to the provided 'cid'.
// Without this check both the requested and original message may appear as
// successfully executed on-chain, which may look like a double-spend.
//
// A replacing message is a message with a different CID, any of Gas values, and
// different signature, but with all other parameters matching (source/destination,
// nonce, params, etc.)
StateSearchMsg(context.Context, cid.Cid) (*api.MsgLookup, error) //perm:read
// StateSearchMsgLimited looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed
//
// NOTE: If a replacing message is found on chain, this method will return
// a MsgLookup for the replacing message - the MsgLookup.Message will be a different
// CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
// result of the execution of the replacing message.
//
// If the caller wants to ensure that exactly the requested message was executed,
// they MUST check that MsgLookup.Message is equal to the provided 'cid'.
// Without this check both the requested and original message may appear as
// successfully executed on-chain, which may look like a double-spend.
//
// A replacing message is a message with a different CID, any of Gas values, and
// different signature, but with all other parameters matching (source/destination,
// nonce, params, etc.)
StateSearchMsgLimited(ctx context.Context, msg cid.Cid, limit abi.ChainEpoch) (*api.MsgLookup, error) //perm:read
// StateWaitMsg looks back in the chain for a message. If not found, it blocks until the
// message arrives on chain, and gets to the indicated confidence depth.
//
// NOTE: If a replacing message is found on chain, this method will return
// a MsgLookup for the replacing message - the MsgLookup.Message will be a different
// CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
// result of the execution of the replacing message.
//
// If the caller wants to ensure that exactly the requested message was executed,
// they MUST check that MsgLookup.Message is equal to the provided 'cid'.
// Without this check both the requested and original message may appear as
// successfully executed on-chain, which may look like a double-spend.
//
// A replacing message is a message with a different CID, any of Gas values, and
// different signature, but with all other parameters matching (source/destination,
// nonce, params, etc.)
StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*api.MsgLookup, error) //perm:read
// StateWaitMsgLimited looks back up to limit epochs in the chain for a message.
// If not found, it blocks until the message arrives on chain, and gets to the
// indicated confidence depth.
//
// NOTE: If a replacing message is found on chain, this method will return
// a MsgLookup for the replacing message - the MsgLookup.Message will be a different
// CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
// result of the execution of the replacing message.
//
// If the caller wants to ensure that exactly the requested message was executed,
// they MUST check that MsgLookup.Message is equal to the provided 'cid'.
// Without this check both the requested and original message may appear as
// successfully executed on-chain, which may look like a double-spend.
//
// A replacing message is a message with a different CID, any of Gas values, and
// different signature, but with all other parameters matching (source/destination,
// nonce, params, etc.)
StateWaitMsgLimited(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch) (*api.MsgLookup, error) //perm:read
// StateListMiners returns the addresses of every miner that has claimed power in the Power Actor
StateListMiners(context.Context, types.TipSetKey) ([]address.Address, error) //perm:read
// StateListActors returns the addresses of every actor in the state
StateListActors(context.Context, types.TipSetKey) ([]address.Address, error) //perm:read
// StateMarketBalance looks up the Escrow and Locked balances of the given address in the Storage Market
StateMarketBalance(context.Context, address.Address, types.TipSetKey) (api.MarketBalance, error) //perm:read
// StateMarketParticipants returns the Escrow and Locked balances of every participant in the Storage Market
StateMarketParticipants(context.Context, types.TipSetKey) (map[string]api.MarketBalance, error) //perm:read
// StateMarketDeals returns information about every deal in the Storage Market
StateMarketDeals(context.Context, types.TipSetKey) (map[string]api.MarketDeal, error) //perm:read
// StateMarketStorageDeal returns information about the indicated deal
StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error) //perm:read
// StateLookupID retrieves the ID address of the given address
StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
// StateAccountKey returns the public key address of the given ID address
StateAccountKey(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
// StateChangedActors returns all the actors whose states change between the two given state CIDs
// TODO: Should this take tipset keys instead?
StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) //perm:read
// StateGetReceipt returns the message receipt for the given message or for a
// matching gas-repriced replacing message
//
// NOTE: If the requested message was replaced, this method will return the receipt
// for the replacing message - if the caller needs the receipt for exactly the
// requested message, use StateSearchMsg().Receipt, and check that MsgLookup.Message
// is matching the requested CID
//
// DEPRECATED: Use StateSearchMsg, this method won't be supported in v1 API
StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) //perm:read
// StateMinerSectorCount returns the number of sectors in a miner's sector set and proving set
StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (api.MinerSectors, error) //perm:read
// StateCompute is a flexible command that applies the given messages on the given tipset.
// The messages are run as though the VM were at the provided height.
//
// When called, StateCompute will:
// - Load the provided tipset, or use the current chain head if not provided
// - Compute the tipset state of the provided tipset on top of the parent state
// - (note that this step runs before vmheight is applied to the execution)
// - Execute state upgrade if any were scheduled at the epoch, or in null
// blocks preceding the tipset
// - Call the cron actor on null blocks preceding the tipset
// - For each block in the tipset
// - Apply messages in blocks in the specified
// - Award block reward by calling the reward actor
// - Call the cron actor for the current epoch
// - If the specified vmheight is higher than the current epoch, apply any
// needed state upgrades to the state
// - Apply the specified messages to the state
//
// The vmheight parameter sets VM execution epoch, and can be used to simulate
// message execution in different network versions. If the specified vmheight
// epoch is higher than the epoch of the specified tipset, any state upgrades
// until the vmheight will be executed on the state before applying messages
// specified by the user.
//
// Note that the initial tipset state computation is not affected by the
// vmheight parameter - only the messages in the `apply` set are
//
// If the caller wants to simply compute the state, vmheight should be set to
// the epoch of the specified tipset.
//
// Messages in the `apply` parameter must have the correct nonces, and gas
// values set.
StateCompute(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*api.ComputeStateOutput, error) //perm:read
// StateVerifierStatus returns the data cap for the given address.
// Returns nil if there is no entry in the data cap table for the
// address.
StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read
// StateVerifiedClientStatus returns the data cap for the given address.
// Returns nil if there is no entry in the data cap table for the
// address.
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read
// StateVerifiedClientStatus returns the address of the Verified Registry's root key
StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) //perm:read
// StateDealProviderCollateralBounds returns the min and max collateral a storage provider
// can issue. It takes the deal size and verified status as parameters.
StateDealProviderCollateralBounds(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (api.DealCollateralBounds, error) //perm:read
// StateCirculatingSupply returns the exact circulating supply of Filecoin at the given tipset.
// This is not used anywhere in the protocol itself, and is only for external consumption.
StateCirculatingSupply(context.Context, types.TipSetKey) (abi.TokenAmount, error) //perm:read
// StateVMCirculatingSupplyInternal returns an approximation of the circulating supply of Filecoin at the given tipset.
// This is the value reported by the runtime interface to actors code.
StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (api.CirculatingSupply, error) //perm:read
// StateNetworkVersion returns the network version at the given tipset
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
// MethodGroup: Msig
// The Msig methods are used to interact with multisig wallets on the
// filecoin network
// MsigGetAvailableBalance returns the portion of a multisig's balance that can be withdrawn or spent
MsigGetAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) //perm:read
// MsigGetVestingSchedule returns the vesting details of a given multisig.
MsigGetVestingSchedule(context.Context, address.Address, types.TipSetKey) (api.MsigVesting, error) //perm:read
// MsigGetVested returns the amount of FIL that vested in a multisig in a certain period.
// It takes the following params: <multisig address>, <start epoch>, <end epoch>
MsigGetVested(context.Context, address.Address, types.TipSetKey, types.TipSetKey) (types.BigInt, error) //perm:read
//MsigGetPending returns pending transactions for the given multisig
//wallet. Once pending transactions are fully approved, they will no longer
//appear here.
MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*api.MsigTransaction, error) //perm:read
// 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
// 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
// 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
// MsigApproveTxnHash approves a previously-proposed multisig message, specified
// using both transaction ID and a hash of the parameters used in the
// 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 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// MarketAddBalance adds funds to the market actor
MarketAddBalance(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign
// MarketGetReserved gets the amount of funds that are currently reserved for the address
MarketGetReserved(ctx context.Context, addr address.Address) (types.BigInt, error) //perm:sign
// MarketReserveFunds reserves funds for a deal
MarketReserveFunds(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign
// MarketReleaseFunds releases funds reserved by MarketReserveFunds
MarketReleaseFunds(ctx context.Context, addr address.Address, amt types.BigInt) error //perm:sign
// MarketWithdraw withdraws unlocked funds from the market actor
MarketWithdraw(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign
// MethodGroup: Paych
// The Paych methods are for interacting with and managing payment channels
PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) //perm:sign
PaychGetWaitReady(context.Context, cid.Cid) (address.Address, error) //perm:sign
PaychAvailableFunds(ctx context.Context, ch address.Address) (*api.ChannelAvailableFunds, error) //perm:sign
PaychAvailableFundsByFromTo(ctx context.Context, from, to address.Address) (*api.ChannelAvailableFunds, error) //perm:sign
PaychList(context.Context) ([]address.Address, error) //perm:read
PaychStatus(context.Context, address.Address) (*api.PaychStatus, error) //perm:read
PaychSettle(context.Context, address.Address) (cid.Cid, error) //perm:sign
PaychCollect(context.Context, address.Address) (cid.Cid, error) //perm:sign
PaychAllocateLane(ctx context.Context, ch address.Address) (uint64, error) //perm:sign
PaychNewPayment(ctx context.Context, from, to address.Address, vouchers []api.VoucherSpec) (*api.PaymentInfo, error) //perm:sign
PaychVoucherCheckValid(context.Context, address.Address, *paych.SignedVoucher) error //perm:read
PaychVoucherCheckSpendable(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (bool, error) //perm:read
PaychVoucherCreate(context.Context, address.Address, types.BigInt, uint64) (*api.VoucherCreateResult, error) //perm:sign
PaychVoucherAdd(context.Context, address.Address, *paych.SignedVoucher, []byte, types.BigInt) (types.BigInt, error) //perm:write
PaychVoucherList(context.Context, address.Address) ([]*paych.SignedVoucher, error) //perm:write
PaychVoucherSubmit(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (cid.Cid, error) //perm:sign
// 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
// the path specified when calling CreateBackup is within the base path
CreateBackup(ctx context.Context, fpath string) error //perm:admin
}
+69
View File
@@ -0,0 +1,69 @@
package v0api
import (
"context"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/dline"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
)
// MODIFYING THE API INTERFACE
//
// NOTE: This is the V0 (Stable) API - when adding methods to this interface,
// you'll need to make sure they are also present on the V1 (Unstable) API
//
// This API is implemented in `v1_wrapper.go` as a compatibility layer backed
// by the V1 api
//
// 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 Gateway interface {
ChainHasObj(context.Context, cid.Cid) (bool, error)
ChainHead(ctx context.Context) (*types.TipSet, error)
ChainGetBlockMessages(context.Context, cid.Cid) (*api.BlockMessages, error)
ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
ChainNotify(context.Context) (<-chan []*api.HeadChange, error)
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*api.MsigTransaction, error)
StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error)
StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)
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) (api.MarketBalance, error)
StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error)
StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error)
StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)
StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error)
StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
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)
+32
View File
@@ -0,0 +1,32 @@
package v0api
import (
"github.com/filecoin-project/lotus/api"
)
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
type Worker = api.Worker
type WorkerStruct = api.WorkerStruct
type Wallet = api.Wallet
func PermissionedStorMinerAPI(a StorageMiner) StorageMiner {
return api.PermissionedStorMinerAPI(a)
}
func PermissionedWorkerAPI(a Worker) Worker {
return api.PermissionedWorkerAPI(a)
}
+13
View File
@@ -0,0 +1,13 @@
package v0api
import (
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/lotus/api"
)
func PermissionedFullAPI(a FullNode) FullNode {
var out FullNodeStruct
auth.PermissionedProxy(api.AllPermissions, api.DefaultPerms, a, &out.Internal)
auth.PermissionedProxy(api.AllPermissions, api.DefaultPerms, a, &out.CommonStruct.Internal)
return &out
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+187
View File
@@ -0,0 +1,187 @@
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"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/v1api"
)
type WrapperV1Full struct {
v1api.FullNode
}
func (w *WrapperV1Full) StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) {
return w.FullNode.StateSearchMsg(ctx, types.EmptyTSK, msg, api.LookbackNoLimit, true)
}
func (w *WrapperV1Full) StateSearchMsgLimited(ctx context.Context, msg cid.Cid, limit abi.ChainEpoch) (*api.MsgLookup, error) {
return w.FullNode.StateSearchMsg(ctx, types.EmptyTSK, msg, limit, true)
}
func (w *WrapperV1Full) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error) {
return w.FullNode.StateWaitMsg(ctx, msg, confidence, api.LookbackNoLimit, true)
}
func (w *WrapperV1Full) StateWaitMsgLimited(ctx context.Context, msg cid.Cid, confidence uint64, limit abi.ChainEpoch) (*api.MsgLookup, error) {
return w.FullNode.StateWaitMsg(ctx, msg, confidence, limit, true)
}
func (w *WrapperV1Full) StateGetReceipt(ctx context.Context, msg cid.Cid, from types.TipSetKey) (*types.MessageReceipt, error) {
ml, err := w.FullNode.StateSearchMsg(ctx, from, msg, api.LookbackNoLimit, true)
if err != nil {
return nil, err
}
if ml == nil {
return nil, nil
}
return &ml.Receipt, nil
}
func (w *WrapperV1Full) Version(ctx context.Context) (api.APIVersion, error) {
ver, err := w.FullNode.Version(ctx)
if err != nil {
return api.APIVersion{}, err
}
ver.APIVersion = api.FullAPIVersion0
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{}
+12
View File
@@ -0,0 +1,12 @@
package v1api
import (
"github.com/filecoin-project/lotus/api"
)
type FullNode = api.FullNode
type FullNodeStruct = api.FullNodeStruct
func PermissionedFullAPI(a FullNode) FullNode {
return api.PermissionedFullAPI(a)
}
+73
View File
@@ -0,0 +1,73 @@
package api
import (
"fmt"
xerrors "golang.org/x/xerrors"
)
type Version uint32
func newVer(major, minor, patch uint8) Version {
return Version(uint32(major)<<16 | uint32(minor)<<8 | uint32(patch))
}
// Ints returns (major, minor, patch) versions
func (ve Version) Ints() (uint32, uint32, uint32) {
v := uint32(ve)
return (v & majorOnlyMask) >> 16, (v & minorOnlyMask) >> 8, v & patchOnlyMask
}
func (ve Version) String() string {
vmj, vmi, vp := ve.Ints()
return fmt.Sprintf("%d.%d.%d", vmj, vmi, vp)
}
func (ve Version) EqMajorMinor(v2 Version) bool {
return ve&minorMask == v2&minorMask
}
type NodeType int
const (
NodeUnknown NodeType = iota
NodeFull
NodeMiner
NodeWorker
)
var RunningNodeType NodeType
func VersionForType(nodeType NodeType) (Version, error) {
switch nodeType {
case NodeFull:
return FullAPIVersion1, nil
case NodeMiner:
return MinerAPIVersion0, nil
case NodeWorker:
return WorkerAPIVersion0, nil
default:
return Version(0), xerrors.Errorf("unknown node type %d", nodeType)
}
}
// semver versions of the rpc api exposed
var (
FullAPIVersion0 = newVer(1, 3, 1)
FullAPIVersion1 = newVer(2, 1, 1)
MinerAPIVersion0 = newVer(1, 2, 0)
WorkerAPIVersion0 = newVer(1, 1, 0)
)
//nolint:varcheck,deadcode
const (
majorMask = 0xff0000
minorMask = 0xffff00
patchMask = 0xffffff
majorOnlyMask = 0xff0000
minorOnlyMask = 0x00ff00
patchOnlyMask = 0x0000ff
)
+53
View File
@@ -0,0 +1,53 @@
package api
import (
"reflect"
)
// Wrap adapts partial api impl to another version
// proxyT is the proxy type used as input in wrapperT
// Usage: Wrap(new(v1api.FullNodeStruct), new(v0api.WrapperV1Full), eventsApi).(EventAPI)
func Wrap(proxyT, wrapperT, impl interface{}) interface{} {
proxy := reflect.New(reflect.TypeOf(proxyT).Elem())
proxyMethods := proxy.Elem().FieldByName("Internal")
ri := reflect.ValueOf(impl)
for i := 0; i < ri.NumMethod(); i++ {
mt := ri.Type().Method(i)
if proxyMethods.FieldByName(mt.Name).Kind() == reflect.Invalid {
continue
}
fn := ri.Method(i)
of := proxyMethods.FieldByName(mt.Name)
proxyMethods.FieldByName(mt.Name).Set(reflect.MakeFunc(of.Type(), func(args []reflect.Value) (results []reflect.Value) {
return fn.Call(args)
}))
}
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()
}
+66
View File
@@ -0,0 +1,66 @@
package blockstore
import (
"context"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"golang.org/x/xerrors"
)
type ChainIO interface {
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
ChainHasObj(context.Context, cid.Cid) (bool, error)
}
type apiBlockstore struct {
api ChainIO
}
// This blockstore is adapted in the constructor.
var _ BasicBlockstore = (*apiBlockstore)(nil)
func NewAPIBlockstore(cio ChainIO) Blockstore {
bs := &apiBlockstore{api: cio}
return Adapt(bs) // return an adapted blockstore.
}
func (a *apiBlockstore) DeleteBlock(cid.Cid) error {
return xerrors.New("not supported")
}
func (a *apiBlockstore) Has(c cid.Cid) (bool, error) {
return a.api.ChainHasObj(context.TODO(), c)
}
func (a *apiBlockstore) Get(c cid.Cid) (blocks.Block, error) {
bb, err := a.api.ChainReadObj(context.TODO(), c)
if err != nil {
return nil, err
}
return blocks.NewBlockWithCid(bb, c)
}
func (a *apiBlockstore) GetSize(c cid.Cid) (int, error) {
bb, err := a.api.ChainReadObj(context.TODO(), c)
if err != nil {
return 0, err
}
return len(bb), nil
}
func (a *apiBlockstore) Put(blocks.Block) error {
return xerrors.New("not supported")
}
func (a *apiBlockstore) PutMany([]blocks.Block) error {
return xerrors.New("not supported")
}
func (a *apiBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
return nil, xerrors.New("not supported")
}
func (a *apiBlockstore) HashOnRead(enabled bool) {
return
}
+956
View File
@@ -0,0 +1,956 @@
package badgerbs
import (
"context"
"fmt"
"io"
"os"
"path/filepath"
"runtime"
"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"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
logger "github.com/ipfs/go-log/v2"
pool "github.com/libp2p/go-buffer-pool"
"github.com/filecoin-project/lotus/blockstore"
)
var (
// KeyPool is the buffer pool we use to compute storage keys.
KeyPool *pool.BufferPool = pool.GlobalPool
)
var (
// ErrBlockstoreClosed is returned from blockstore operations after
// the blockstore has been closed.
ErrBlockstoreClosed = fmt.Errorf("badger blockstore closed")
log = logger.Logger("badgerbs")
)
// aliases to mask badger dependencies.
const (
// FileIO is equivalent to badger/options.FileIO.
FileIO = options.FileIO
// MemoryMap is equivalent to badger/options.MemoryMap.
MemoryMap = options.MemoryMap
// LoadToRAM is equivalent to badger/options.LoadToRAM.
LoadToRAM = options.LoadToRAM
)
// Options embeds the badger options themselves, and augments them with
// blockstore-specific options.
type Options struct {
badger.Options
// Prefix is an optional prefix to prepend to keys. Default: "".
Prefix string
}
func DefaultOptions(path string) Options {
return Options{
Options: badger.DefaultOptions(path),
Prefix: "",
}
}
// badgerLogger is a local wrapper for go-log to make the interface
// compatible with badger.Logger (namely, aliasing Warnf to Warningf)
type badgerLogger struct {
*zap.SugaredLogger // skips 1 caller to get useful line info, skipping over badger.Options.
skip2 *zap.SugaredLogger // skips 2 callers, just like above + this logger.
}
// Warningf is required by the badger logger APIs.
func (b *badgerLogger) Warningf(format string, args ...interface{}) {
b.skip2.Warnf(format, args...)
}
// bsState is the current blockstore state
type bsState int
const (
// 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
)
type bsMoveState int
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
prefixLen int
}
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.
func Open(opts Options) (*Blockstore, error) {
opts.Logger = &badgerLogger{
SugaredLogger: log.Desugar().WithOptions(zap.AddCallerSkip(1)).Sugar(),
skip2: log.Desugar().WithOptions(zap.AddCallerSkip(2)).Sugar(),
}
db, err := badger.Open(opts.Options)
if err != nil {
return nil, fmt.Errorf("failed to open badger blockstore: %w", err)
}
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 {
b.stateLk.Lock()
if b.state != stateOpen {
b.stateLk.Unlock()
return nil
}
b.state = stateClosing
b.stateLk.Unlock()
defer func() {
b.stateLk.Lock()
b.state = stateClosed
b.stateLk.Unlock()
}()
// wait for all accesses to complete
b.viewers.Wait()
return b.db.Close()
}
func (b *Blockstore) access() error {
b.stateLk.RLock()
defer b.stateLk.RUnlock()
if b.state != stateOpen {
return ErrBlockstoreClosed
}
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)
}
if err == badger.ErrNoRewrite {
// not really an error in this case, it signals the end of GC
return nil
}
return err
}
// 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
}
}
if options.FullGC {
return b.movingGC()
}
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 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 {
switch item, err := txn.Get(k); err {
case nil:
return item.Value(fn)
case badger.ErrKeyNotFound:
return blockstore.ErrNotFound
default:
return fmt.Errorf("failed to view block from badger blockstore: %w", err)
}
})
}
// Has implements Blockstore.Has.
func (b *Blockstore) Has(cid cid.Cid) (bool, error) {
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 := txn.Get(k)
return err
})
switch err {
case badger.ErrKeyNotFound:
return false, nil
case nil:
return true, nil
default:
return false, fmt.Errorf("failed to check if block exists in badger blockstore: %w", err)
}
}
// Get implements Blockstore.Get.
func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error) {
if !cid.Defined() {
return nil, blockstore.ErrNotFound
}
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 {
defer KeyPool.Put(k)
}
var val []byte
err := b.db.View(func(txn *badger.Txn) error {
switch item, err := txn.Get(k); err {
case nil:
val, err = item.ValueCopy(nil)
return err
case badger.ErrKeyNotFound:
return blockstore.ErrNotFound
default:
return fmt.Errorf("failed to get block from badger blockstore: %w", err)
}
})
if err != nil {
return nil, err
}
return blocks.NewBlockWithCid(val, cid)
}
// GetSize implements Blockstore.GetSize.
func (b *Blockstore) GetSize(cid cid.Cid) (int, error) {
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 {
defer KeyPool.Put(k)
}
var size int
err := b.db.View(func(txn *badger.Txn) error {
switch item, err := txn.Get(k); err {
case nil:
size = int(item.ValueSize())
case badger.ErrKeyNotFound:
return blockstore.ErrNotFound
default:
return fmt.Errorf("failed to get block size from badger blockstore: %w", err)
}
return nil
})
if err != nil {
size = -1
}
return size, err
}
// Put implements Blockstore.Put.
func (b *Blockstore) Put(block blocks.Block) error {
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)
}
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
}
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 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
// badger holds on to the slice.
var toReturn [][]byte
if b.prefixing {
toReturn = make([][]byte, 0, len(blocks))
defer func() {
for _, b := range toReturn {
KeyPool.Put(b)
}
}()
}
keys := make([][]byte, 0, len(blocks))
for _, block := range blocks {
k, pooled := b.PooledStorageKey(block.Cid())
if pooled {
toReturn = append(toReturn, k)
}
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
}
}
return nil
}
// DeleteBlock implements Blockstore.DeleteBlock.
func (b *Blockstore) DeleteBlock(cid cid.Cid) error {
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 txn.Delete(k)
})
}
func (b *Blockstore) DeleteMany(cids []cid.Cid) error {
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
// badger holds on to the slice.
var toReturn [][]byte
if b.prefixing {
toReturn = make([][]byte, 0, len(cids))
defer func() {
for _, b := range toReturn {
KeyPool.Put(b)
}
}()
}
batch := b.db.NewWriteBatch()
defer batch.Cancel()
for _, cid := range cids {
k, pooled := b.PooledStorageKey(cid)
if pooled {
toReturn = append(toReturn, k)
}
if err := batch.Delete(k); err != nil {
return err
}
}
err := batch.Flush()
if err != nil {
err = fmt.Errorf("failed to delete blocks from badger blockstore: %w", err)
}
return err
}
// AllKeysChan implements Blockstore.AllKeysChan.
func (b *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
if err := b.access(); err != nil {
return nil, err
}
b.lockDB()
defer b.unlockDB()
txn := b.db.NewTransaction(false)
opts := badger.IteratorOptions{PrefetchSize: 100}
if b.prefixing {
opts.Prefix = b.prefix
}
iter := txn.NewIterator(opts)
ch := make(chan cid.Cid)
go func() {
defer b.viewers.Done()
defer close(ch)
defer iter.Close()
// NewCidV1 makes a copy of the multihash buffer, so we can reuse it to
// contain allocs.
var buf []byte
for iter.Rewind(); iter.Valid(); iter.Next() {
if ctx.Err() != nil {
return // context has fired.
}
if !b.isOpen() {
// open iterators will run even after the database is closed...
return // closing, yield.
}
k := iter.Item().Key()
if b.prefixing {
k = k[b.prefixLen:]
}
if reqlen := base32.RawStdEncoding.DecodedLen(len(k)); len(buf) < reqlen {
buf = make([]byte, reqlen)
}
if n, err := base32.RawStdEncoding.Decode(buf, k); err == nil {
select {
case ch <- cid.NewCidV1(cid.Raw, buf[:n]):
case <-ctx.Done():
return
}
} else {
log.Warnf("failed to decode key %s in badger AllKeysChan; err: %s", k, err)
}
}
}()
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) {
log.Warnf("called HashOnRead on badger blockstore; function not supported; ignoring")
}
// PooledStorageKey returns the storage key under which this CID is stored.
//
// The key is: prefix + base32_no_padding(cid.Hash)
//
// This method may return pooled byte slice, which MUST be returned to the
// KeyPool if pooled=true, or a leak will occur.
func (b *Blockstore) PooledStorageKey(cid cid.Cid) (key []byte, pooled bool) {
h := cid.Hash()
size := base32.RawStdEncoding.EncodedLen(len(h))
if !b.prefixing { // optimize for branch prediction.
k := pool.Get(size)
base32.RawStdEncoding.Encode(k, h)
return k, true // slicing upto length unnecessary; the pool has already done this.
}
size += b.prefixLen
k := pool.Get(size)
copy(k, b.prefix)
base32.RawStdEncoding.Encode(k[b.prefixLen:], h)
return k, true // slicing upto length unnecessary; the pool has already done this.
}
// Storage acts like PooledStorageKey, but attempts to write the storage key
// into the provided slice. If the slice capacity is insufficient, it allocates
// a new byte slice with enough capacity to accommodate the result. This method
// returns the resulting slice.
func (b *Blockstore) StorageKey(dst []byte, cid cid.Cid) []byte {
h := cid.Hash()
reqsize := base32.RawStdEncoding.EncodedLen(len(h)) + b.prefixLen
if reqsize > cap(dst) {
// passed slice is smaller than required size; create new.
dst = make([]byte, reqsize)
} else if reqsize > len(dst) {
// passed slice has enough capacity, but its length is
// restricted, expand.
dst = dst[:cap(dst)]
}
if b.prefixing { // optimize for branch prediction.
copy(dst, b.prefix)
base32.RawStdEncoding.Encode(dst[b.prefixLen:], h)
} else {
base32.RawStdEncoding.Encode(dst, h)
}
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
}
+260
View File
@@ -0,0 +1,260 @@
package badgerbs
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"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"
)
func TestBadgerBlockstore(t *testing.T) {
(&Suite{
NewBlockstore: newBlockstore(DefaultOptions),
OpenBlockstore: openBlockstore(DefaultOptions),
}).RunTests(t, "non_prefixed")
prefixed := func(path string) Options {
opts := DefaultOptions(path)
opts.Prefix = "/prefixed/"
return opts
}
(&Suite{
NewBlockstore: newBlockstore(prefixed),
OpenBlockstore: openBlockstore(prefixed),
}).RunTests(t, "prefixed")
}
func TestStorageKey(t *testing.T) {
bs, _ := newBlockstore(DefaultOptions)(t)
bbs := bs.(*Blockstore)
defer bbs.Close() //nolint:errcheck
cid1 := blocks.NewBlock([]byte("some data")).Cid()
cid2 := blocks.NewBlock([]byte("more data")).Cid()
cid3 := blocks.NewBlock([]byte("a little more data")).Cid()
require.NotEqual(t, cid1, cid2) // sanity check
require.NotEqual(t, cid2, cid3) // sanity check
// nil slice; let StorageKey allocate for us.
k1 := bbs.StorageKey(nil, cid1)
require.Len(t, k1, 55)
require.True(t, cap(k1) == len(k1))
// k1's backing array is reused.
k2 := bbs.StorageKey(k1, cid2)
require.Len(t, k2, 55)
require.True(t, cap(k2) == len(k1))
// bring k2 to len=0, and verify that its backing array gets reused
// (i.e. k1 and k2 are overwritten)
k3 := bbs.StorageKey(k2[:0], cid3)
require.Len(t, k3, 55)
require.True(t, cap(k3) == len(k3))
// backing array of k1 and k2 has been modified, i.e. memory is shared.
require.Equal(t, k3, k1)
require.Equal(t, k3, k2)
}
func newBlockstore(optsSupplier func(path string) Options) func(tb testing.TB) (bs blockstore.BasicBlockstore, path string) {
return func(tb testing.TB) (bs blockstore.BasicBlockstore, path string) {
tb.Helper()
path, err := ioutil.TempDir("", "")
if err != nil {
tb.Fatal(err)
}
db, err := Open(optsSupplier(path))
if err != nil {
tb.Fatal(err)
}
tb.Cleanup(func() {
_ = os.RemoveAll(path)
})
return db, path
}
}
func openBlockstore(optsSupplier func(path string) Options) func(tb testing.TB, path string) (bs blockstore.BasicBlockstore, err error) {
return func(tb testing.TB, path string) (bs blockstore.BasicBlockstore, err error) {
tb.Helper()
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
})
}
+313
View File
@@ -0,0 +1,313 @@
package badgerbs
import (
"context"
"fmt"
"io"
"reflect"
"strings"
"testing"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
u "github.com/ipfs/go-ipfs-util"
"github.com/filecoin-project/lotus/blockstore"
"github.com/stretchr/testify/require"
)
// TODO: move this to go-ipfs-blockstore.
type Suite struct {
NewBlockstore func(tb testing.TB) (bs blockstore.BasicBlockstore, path string)
OpenBlockstore func(tb testing.TB, path string) (bs blockstore.BasicBlockstore, err error)
}
func (s *Suite) RunTests(t *testing.T, prefix string) {
v := reflect.TypeOf(s)
f := func(t *testing.T) {
for i := 0; i < v.NumMethod(); i++ {
if m := v.Method(i); strings.HasPrefix(m.Name, "Test") {
f := m.Func.Interface().(func(*Suite, *testing.T))
t.Run(m.Name, func(t *testing.T) {
f(s, t)
})
}
}
}
if prefix == "" {
f(t)
} else {
t.Run(prefix, f)
}
}
func (s *Suite) TestGetWhenKeyNotPresent(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
c := cid.NewCidV0(u.Hash([]byte("stuff")))
bl, err := bs.Get(c)
require.Nil(t, bl)
require.Equal(t, blockstore.ErrNotFound, err)
}
func (s *Suite) TestGetWhenKeyIsNil(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
_, err := bs.Get(cid.Undef)
require.Equal(t, blockstore.ErrNotFound, err)
}
func (s *Suite) TestPutThenGetBlock(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
orig := blocks.NewBlock([]byte("some data"))
err := bs.Put(orig)
require.NoError(t, err)
fetched, err := bs.Get(orig.Cid())
require.NoError(t, err)
require.Equal(t, orig.RawData(), fetched.RawData())
}
func (s *Suite) TestHas(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
orig := blocks.NewBlock([]byte("some data"))
err := bs.Put(orig)
require.NoError(t, err)
ok, err := bs.Has(orig.Cid())
require.NoError(t, err)
require.True(t, ok)
ok, err = bs.Has(blocks.NewBlock([]byte("another thing")).Cid())
require.NoError(t, err)
require.False(t, ok)
}
func (s *Suite) TestCidv0v1(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
orig := blocks.NewBlock([]byte("some data"))
err := bs.Put(orig)
require.NoError(t, err)
fetched, err := bs.Get(cid.NewCidV1(cid.DagProtobuf, orig.Cid().Hash()))
require.NoError(t, err)
require.Equal(t, orig.RawData(), fetched.RawData())
}
func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
block := blocks.NewBlock([]byte("some data"))
missingBlock := blocks.NewBlock([]byte("missingBlock"))
emptyBlock := blocks.NewBlock([]byte{})
err := bs.Put(block)
require.NoError(t, err)
blockSize, err := bs.GetSize(block.Cid())
require.NoError(t, err)
require.Len(t, block.RawData(), blockSize)
err = bs.Put(emptyBlock)
require.NoError(t, err)
emptySize, err := bs.GetSize(emptyBlock.Cid())
require.NoError(t, err)
require.Zero(t, emptySize)
missingSize, err := bs.GetSize(missingBlock.Cid())
require.Equal(t, blockstore.ErrNotFound, err)
require.Equal(t, -1, missingSize)
}
func (s *Suite) TestAllKeysSimple(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
keys := insertBlocks(t, bs, 100)
ctx := context.Background()
ch, err := bs.AllKeysChan(ctx)
require.NoError(t, err)
actual := collect(ch)
require.ElementsMatch(t, keys, actual)
}
func (s *Suite) TestAllKeysRespectsContext(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
_ = insertBlocks(t, bs, 100)
ctx, cancel := context.WithCancel(context.Background())
ch, err := bs.AllKeysChan(ctx)
require.NoError(t, err)
// consume 2, then cancel context.
v, ok := <-ch
require.NotEqual(t, cid.Undef, v)
require.True(t, ok)
v, ok = <-ch
require.NotEqual(t, cid.Undef, v)
require.True(t, ok)
cancel()
// pull one value out to avoid race
_, _ = <-ch
v, ok = <-ch
require.Equal(t, cid.Undef, v)
require.False(t, ok)
}
func (s *Suite) TestDoubleClose(t *testing.T) {
bs, _ := s.NewBlockstore(t)
c, ok := bs.(io.Closer)
if !ok {
t.SkipNow()
}
require.NoError(t, c.Close())
require.NoError(t, c.Close())
}
func (s *Suite) TestReopenPutGet(t *testing.T) {
bs, path := s.NewBlockstore(t)
c, ok := bs.(io.Closer)
if !ok {
t.SkipNow()
}
orig := blocks.NewBlock([]byte("some data"))
err := bs.Put(orig)
require.NoError(t, err)
err = c.Close()
require.NoError(t, err)
bs, err = s.OpenBlockstore(t, path)
require.NoError(t, err)
fetched, err := bs.Get(orig.Cid())
require.NoError(t, err)
require.Equal(t, orig.RawData(), fetched.RawData())
err = bs.(io.Closer).Close()
require.NoError(t, err)
}
func (s *Suite) TestPutMany(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
blks := []blocks.Block{
blocks.NewBlock([]byte("foo1")),
blocks.NewBlock([]byte("foo2")),
blocks.NewBlock([]byte("foo3")),
}
err := bs.PutMany(blks)
require.NoError(t, err)
for _, blk := range blks {
fetched, err := bs.Get(blk.Cid())
require.NoError(t, err)
require.Equal(t, blk.RawData(), fetched.RawData())
ok, err := bs.Has(blk.Cid())
require.NoError(t, err)
require.True(t, ok)
}
ch, err := bs.AllKeysChan(context.Background())
require.NoError(t, err)
cids := collect(ch)
require.Len(t, cids, 3)
}
func (s *Suite) TestDelete(t *testing.T) {
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
}
blks := []blocks.Block{
blocks.NewBlock([]byte("foo1")),
blocks.NewBlock([]byte("foo2")),
blocks.NewBlock([]byte("foo3")),
}
err := bs.PutMany(blks)
require.NoError(t, err)
err = bs.DeleteBlock(blks[1].Cid())
require.NoError(t, err)
ch, err := bs.AllKeysChan(context.Background())
require.NoError(t, err)
cids := collect(ch)
require.Len(t, cids, 2)
require.ElementsMatch(t, cids, []cid.Cid{
cid.NewCidV1(cid.Raw, blks[0].Cid().Hash()),
cid.NewCidV1(cid.Raw, blks[2].Cid().Hash()),
})
has, err := bs.Has(blks[1].Cid())
require.NoError(t, err)
require.False(t, has)
}
func insertBlocks(t *testing.T, bs blockstore.BasicBlockstore, count int) []cid.Cid {
keys := make([]cid.Cid, count)
for i := 0; i < count; i++ {
block := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
err := bs.Put(block)
require.NoError(t, err)
// NewBlock assigns a CIDv0; we convert it to CIDv1 because that's what
// the store returns.
keys[i] = cid.NewCidV1(cid.Raw, block.Multihash())
}
return keys
}
func collect(ch <-chan cid.Cid) []cid.Cid {
var keys []cid.Cid
for k := range ch {
keys = append(keys, k)
}
return keys
}
+125
View File
@@ -0,0 +1,125 @@
package blockstore
import (
cid "github.com/ipfs/go-cid"
ds "github.com/ipfs/go-datastore"
logging "github.com/ipfs/go-log/v2"
blockstore "github.com/ipfs/go-ipfs-blockstore"
)
var log = logging.Logger("blockstore")
var ErrNotFound = blockstore.ErrNotFound
// Blockstore is the blockstore interface used by Lotus. It is the union
// of the basic go-ipfs blockstore, with other capabilities required by Lotus,
// e.g. View or Sync.
type Blockstore interface {
blockstore.Blockstore
blockstore.Viewer
BatchDeleter
}
// BasicBlockstore is an alias to the original IPFS Blockstore.
type BasicBlockstore = blockstore.Blockstore
type Viewer = blockstore.Viewer
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
// hash function and returns them on get/has, ignoring the contents of the
// blockstore.
func WrapIDStore(bstore blockstore.Blockstore) Blockstore {
if is, ok := bstore.(*idstore); ok {
// already wrapped
return is
}
if bs, ok := bstore.(Blockstore); ok {
// we need to wrap our own because we don't want to neuter the DeleteMany method
// the underlying blockstore has implemented an (efficient) DeleteMany
return NewIDStore(bs)
}
// The underlying blockstore does not implement DeleteMany, so we need to shim it.
// This is less efficient as it'll iterate and perform single deletes.
return NewIDStore(Adapt(bstore))
}
// FromDatastore creates a new blockstore backed by the given datastore.
func FromDatastore(dstore ds.Batching) Blockstore {
return WrapIDStore(blockstore.NewBlockstore(dstore))
}
type adaptedBlockstore struct {
blockstore.Blockstore
}
var _ Blockstore = (*adaptedBlockstore)(nil)
func (a *adaptedBlockstore) View(cid cid.Cid, callback func([]byte) error) error {
blk, err := a.Get(cid)
if err != nil {
return err
}
return callback(blk.RawData())
}
func (a *adaptedBlockstore) DeleteMany(cids []cid.Cid) error {
for _, cid := range cids {
err := a.DeleteBlock(cid)
if err != nil {
return err
}
}
return nil
}
// Adapt adapts a standard blockstore to a Lotus blockstore by
// enriching it with the extra methods that Lotus requires (e.g. View, Sync).
//
// View proxies over to Get and calls the callback with the value supplied by Get.
// Sync noops.
func Adapt(bs blockstore.Blockstore) Blockstore {
if ret, ok := bs.(Blockstore); ok {
return ret
}
return &adaptedBlockstore{bs}
}
+174
View File
@@ -0,0 +1,174 @@
package blockstore
import (
"context"
"os"
block "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
)
// buflog is a logger for the buffered blockstore. It is subscoped from the
// blockstore logger.
var buflog = log.Named("buf")
type BufferedBlockstore struct {
read Blockstore
write Blockstore
}
func NewBuffered(base Blockstore) *BufferedBlockstore {
var buf Blockstore
if os.Getenv("LOTUS_DISABLE_VM_BUF") == "iknowitsabadidea" {
buflog.Warn("VM BLOCKSTORE BUFFERING IS DISABLED")
buf = base
} else {
buf = NewMemory()
}
bs := &BufferedBlockstore{
read: base,
write: buf,
}
return bs
}
func NewTieredBstore(r Blockstore, w Blockstore) *BufferedBlockstore {
return &BufferedBlockstore{
read: r,
write: w,
}
}
var (
_ Blockstore = (*BufferedBlockstore)(nil)
_ Viewer = (*BufferedBlockstore)(nil)
)
func (bs *BufferedBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
a, err := bs.read.AllKeysChan(ctx)
if err != nil {
return nil, err
}
b, err := bs.write.AllKeysChan(ctx)
if err != nil {
return nil, err
}
out := make(chan cid.Cid)
go func() {
defer close(out)
for a != nil || b != nil {
select {
case val, ok := <-a:
if !ok {
a = nil
} else {
select {
case out <- val:
case <-ctx.Done():
return
}
}
case val, ok := <-b:
if !ok {
b = nil
} else {
select {
case out <- val:
case <-ctx.Done():
return
}
}
}
}
}()
return out, nil
}
func (bs *BufferedBlockstore) DeleteBlock(c cid.Cid) error {
if err := bs.read.DeleteBlock(c); err != nil {
return err
}
return bs.write.DeleteBlock(c)
}
func (bs *BufferedBlockstore) DeleteMany(cids []cid.Cid) error {
if err := bs.read.DeleteMany(cids); err != nil {
return err
}
return bs.write.DeleteMany(cids)
}
func (bs *BufferedBlockstore) View(c cid.Cid, callback func([]byte) error) error {
// both stores are viewable.
if err := bs.write.View(c, callback); err == ErrNotFound {
// not found in write blockstore; fall through.
} else {
return err // propagate errors, or nil, i.e. found.
}
return bs.read.View(c, callback)
}
func (bs *BufferedBlockstore) Get(c cid.Cid) (block.Block, error) {
if out, err := bs.write.Get(c); err != nil {
if err != ErrNotFound {
return nil, err
}
} else {
return out, nil
}
return bs.read.Get(c)
}
func (bs *BufferedBlockstore) GetSize(c cid.Cid) (int, error) {
s, err := bs.read.GetSize(c)
if err == ErrNotFound || s == 0 {
return bs.write.GetSize(c)
}
return s, err
}
func (bs *BufferedBlockstore) Put(blk block.Block) error {
has, err := bs.read.Has(blk.Cid()) // TODO: consider dropping this check
if err != nil {
return err
}
if has {
return nil
}
return bs.write.Put(blk)
}
func (bs *BufferedBlockstore) Has(c cid.Cid) (bool, error) {
has, err := bs.write.Has(c)
if err != nil {
return false, err
}
if has {
return true, nil
}
return bs.read.Has(c)
}
func (bs *BufferedBlockstore) HashOnRead(hor bool) {
bs.read.HashOnRead(hor)
bs.write.HashOnRead(hor)
}
func (bs *BufferedBlockstore) PutMany(blks []block.Block) error {
return bs.write.PutMany(blks)
}
func (bs *BufferedBlockstore) Read() Blockstore {
return bs.read
}
+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
}
+9
View File
@@ -0,0 +1,9 @@
// Package blockstore and subpackages contain most of the blockstore
// implementations used by Lotus.
//
// Blockstores not ultimately constructed out of the building blocks in this
// package may not work properly.
//
// This package re-exports parts of the go-ipfs-blockstore package such that
// no other package needs to import it directly, for ergonomics and traceability.
package blockstore
+106
View File
@@ -0,0 +1,106 @@
package blockstore
import (
"context"
"sync"
"time"
"golang.org/x/xerrors"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
)
// UnwrapFallbackStore takes a blockstore, and returns the underlying blockstore
// if it was a FallbackStore. Otherwise, it just returns the supplied store
// unmodified.
func UnwrapFallbackStore(bs Blockstore) (Blockstore, bool) {
if fbs, ok := bs.(*FallbackStore); ok {
return fbs.Blockstore, true
}
return bs, false
}
// FallbackStore is a read-through store that queries another (potentially
// remote) source if the block is not found locally. If the block is found
// during the fallback, it stores it in the local store.
type FallbackStore struct {
Blockstore
lk sync.RWMutex
// missFn is the function that will be invoked on a local miss to pull the
// block from elsewhere.
missFn func(context.Context, cid.Cid) (blocks.Block, error)
}
var _ Blockstore = (*FallbackStore)(nil)
func (fbs *FallbackStore) SetFallback(missFn func(context.Context, cid.Cid) (blocks.Block, error)) {
fbs.lk.Lock()
defer fbs.lk.Unlock()
fbs.missFn = missFn
}
func (fbs *FallbackStore) getFallback(c cid.Cid) (blocks.Block, error) {
log.Warnf("fallbackstore: block not found locally, fetching from the network; cid: %s", c)
fbs.lk.RLock()
defer fbs.lk.RUnlock()
if fbs.missFn == nil {
// FallbackStore wasn't configured yet (chainstore/bitswap aren't up yet)
// Wait for a bit and retry
fbs.lk.RUnlock()
time.Sleep(5 * time.Second)
fbs.lk.RLock()
if fbs.missFn == nil {
log.Errorw("fallbackstore: missFn not configured yet")
return nil, ErrNotFound
}
}
ctx, cancel := context.WithTimeout(context.TODO(), 120*time.Second)
defer cancel()
b, err := fbs.missFn(ctx, c)
if err != nil {
return nil, err
}
// chain bitswap puts blocks in temp blockstore which is cleaned up
// every few min (to drop any messages we fetched but don't want)
// in this case we want to keep this block around
if err := fbs.Put(b); err != nil {
return nil, xerrors.Errorf("persisting fallback-fetched block: %w", err)
}
return b, nil
}
func (fbs *FallbackStore) Get(c cid.Cid) (blocks.Block, error) {
b, err := fbs.Blockstore.Get(c)
switch err {
case nil:
return b, nil
case ErrNotFound:
return fbs.getFallback(c)
default:
return b, err
}
}
func (fbs *FallbackStore) GetSize(c cid.Cid) (int, error) {
sz, err := fbs.Blockstore.GetSize(c)
switch err {
case nil:
return sz, nil
case ErrNotFound:
b, err := fbs.getFallback(c)
if err != nil {
return 0, err
}
return len(b.RawData()), nil
default:
return sz, err
}
}
+174
View File
@@ -0,0 +1,174 @@
package blockstore
import (
"context"
"io"
"golang.org/x/xerrors"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
mh "github.com/multiformats/go-multihash"
)
var _ Blockstore = (*idstore)(nil)
type idstore struct {
bs Blockstore
}
func NewIDStore(bs Blockstore) Blockstore {
return &idstore{bs: bs}
}
func decodeCid(cid cid.Cid) (inline bool, data []byte, err error) {
if cid.Prefix().MhType != mh.IDENTITY {
return false, nil, nil
}
dmh, err := mh.Decode(cid.Hash())
if err != nil {
return false, nil, err
}
if dmh.Code == mh.IDENTITY {
return true, dmh.Digest, nil
}
return false, nil, err
}
func (b *idstore) Has(cid cid.Cid) (bool, error) {
inline, _, err := decodeCid(cid)
if err != nil {
return false, xerrors.Errorf("error decoding Cid: %w", err)
}
if inline {
return true, nil
}
return b.bs.Has(cid)
}
func (b *idstore) Get(cid cid.Cid) (blocks.Block, error) {
inline, data, err := decodeCid(cid)
if err != nil {
return nil, xerrors.Errorf("error decoding Cid: %w", err)
}
if inline {
return blocks.NewBlockWithCid(data, cid)
}
return b.bs.Get(cid)
}
func (b *idstore) GetSize(cid cid.Cid) (int, error) {
inline, data, err := decodeCid(cid)
if err != nil {
return 0, xerrors.Errorf("error decoding Cid: %w", err)
}
if inline {
return len(data), err
}
return b.bs.GetSize(cid)
}
func (b *idstore) View(cid cid.Cid, cb func([]byte) error) error {
inline, data, err := decodeCid(cid)
if err != nil {
return xerrors.Errorf("error decoding Cid: %w", err)
}
if inline {
return cb(data)
}
return b.bs.View(cid, cb)
}
func (b *idstore) Put(blk blocks.Block) error {
inline, _, err := decodeCid(blk.Cid())
if err != nil {
return xerrors.Errorf("error decoding Cid: %w", err)
}
if inline {
return nil
}
return b.bs.Put(blk)
}
func (b *idstore) PutMany(blks []blocks.Block) error {
toPut := make([]blocks.Block, 0, len(blks))
for _, blk := range blks {
inline, _, err := decodeCid(blk.Cid())
if err != nil {
return xerrors.Errorf("error decoding Cid: %w", err)
}
if inline {
continue
}
toPut = append(toPut, blk)
}
if len(toPut) > 0 {
return b.bs.PutMany(toPut)
}
return nil
}
func (b *idstore) DeleteBlock(cid cid.Cid) error {
inline, _, err := decodeCid(cid)
if err != nil {
return xerrors.Errorf("error decoding Cid: %w", err)
}
if inline {
return nil
}
return b.bs.DeleteBlock(cid)
}
func (b *idstore) DeleteMany(cids []cid.Cid) error {
toDelete := make([]cid.Cid, 0, len(cids))
for _, cid := range cids {
inline, _, err := decodeCid(cid)
if err != nil {
return xerrors.Errorf("error decoding Cid: %w", err)
}
if inline {
continue
}
toDelete = append(toDelete, cid)
}
if len(toDelete) > 0 {
return b.bs.DeleteMany(toDelete)
}
return nil
}
func (b *idstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
return b.bs.AllKeysChan(ctx)
}
func (b *idstore) HashOnRead(enabled bool) {
b.bs.HashOnRead(enabled)
}
func (b *idstore) Close() error {
if c, ok := b.bs.(io.Closer); ok {
return c.Close()
}
return nil
}
@@ -1,4 +1,4 @@
package ipfsbstore
package blockstore
import (
"bytes"
@@ -16,53 +16,75 @@ import (
iface "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/options"
"github.com/ipfs/interface-go-ipfs-core/path"
"github.com/filecoin-project/lotus/lib/blockstore"
)
type IpfsBstore struct {
ctx context.Context
api iface.CoreAPI
type IPFSBlockstore struct {
ctx context.Context
api, offlineAPI iface.CoreAPI
}
func NewIpfsBstore(ctx context.Context) (*IpfsBstore, error) {
var _ BasicBlockstore = (*IPFSBlockstore)(nil)
func NewLocalIPFSBlockstore(ctx context.Context, onlineMode bool) (Blockstore, error) {
localApi, err := httpapi.NewLocalApi()
if err != nil {
return nil, xerrors.Errorf("getting local ipfs api: %w", err)
}
api, err := localApi.WithOptions(options.Api.Offline(true))
api, err := localApi.WithOptions(options.Api.Offline(!onlineMode))
if err != nil {
return nil, xerrors.Errorf("setting offline mode: %s", err)
}
return &IpfsBstore{
ctx: ctx,
api: api,
}, nil
offlineAPI := api
if onlineMode {
offlineAPI, err = localApi.WithOptions(options.Api.Offline(true))
if err != nil {
return nil, xerrors.Errorf("applying offline mode: %s", err)
}
}
bs := &IPFSBlockstore{
ctx: ctx,
api: api,
offlineAPI: offlineAPI,
}
return Adapt(bs), nil
}
func NewRemoteIpfsBstore(ctx context.Context, maddr multiaddr.Multiaddr) (*IpfsBstore, error) {
func NewRemoteIPFSBlockstore(ctx context.Context, maddr multiaddr.Multiaddr, onlineMode bool) (Blockstore, error) {
httpApi, err := httpapi.NewApi(maddr)
if err != nil {
return nil, xerrors.Errorf("setting remote ipfs api: %w", err)
}
api, err := httpApi.WithOptions(options.Api.Offline(true))
api, err := httpApi.WithOptions(options.Api.Offline(!onlineMode))
if err != nil {
return nil, xerrors.Errorf("applying offline mode: %s", err)
}
return &IpfsBstore{
ctx: ctx,
api: api,
}, nil
offlineAPI := api
if onlineMode {
offlineAPI, err = httpApi.WithOptions(options.Api.Offline(true))
if err != nil {
return nil, xerrors.Errorf("applying offline mode: %s", err)
}
}
bs := &IPFSBlockstore{
ctx: ctx,
api: api,
offlineAPI: offlineAPI,
}
return Adapt(bs), nil
}
func (i *IpfsBstore) DeleteBlock(cid cid.Cid) error {
func (i *IPFSBlockstore) DeleteBlock(cid cid.Cid) error {
return xerrors.Errorf("not supported")
}
func (i *IpfsBstore) Has(cid cid.Cid) (bool, error) {
_, err := i.api.Block().Stat(i.ctx, path.IpldPath(cid))
func (i *IPFSBlockstore) Has(cid cid.Cid) (bool, error) {
_, err := i.offlineAPI.Block().Stat(i.ctx, path.IpldPath(cid))
if err != nil {
// The underlying client is running in Offline mode.
// Stat() will fail with an err if the block isn't in the
@@ -77,7 +99,7 @@ func (i *IpfsBstore) Has(cid cid.Cid) (bool, error) {
return true, nil
}
func (i *IpfsBstore) Get(cid cid.Cid) (blocks.Block, error) {
func (i *IPFSBlockstore) Get(cid cid.Cid) (blocks.Block, error) {
rd, err := i.api.Block().Get(i.ctx, path.IpldPath(cid))
if err != nil {
return nil, xerrors.Errorf("getting ipfs block: %w", err)
@@ -91,7 +113,7 @@ func (i *IpfsBstore) Get(cid cid.Cid) (blocks.Block, error) {
return blocks.NewBlockWithCid(data, cid)
}
func (i *IpfsBstore) GetSize(cid cid.Cid) (int, error) {
func (i *IPFSBlockstore) GetSize(cid cid.Cid) (int, error) {
st, err := i.api.Block().Stat(i.ctx, path.IpldPath(cid))
if err != nil {
return 0, xerrors.Errorf("getting ipfs block: %w", err)
@@ -100,7 +122,7 @@ func (i *IpfsBstore) GetSize(cid cid.Cid) (int, error) {
return st.Size(), nil
}
func (i *IpfsBstore) Put(block blocks.Block) error {
func (i *IPFSBlockstore) Put(block blocks.Block) error {
mhd, err := multihash.Decode(block.Cid().Hash())
if err != nil {
return err
@@ -112,7 +134,7 @@ func (i *IpfsBstore) Put(block blocks.Block) error {
return err
}
func (i *IpfsBstore) PutMany(blocks []blocks.Block) error {
func (i *IPFSBlockstore) PutMany(blocks []blocks.Block) error {
// TODO: could be done in parallel
for _, block := range blocks {
@@ -124,12 +146,10 @@ func (i *IpfsBstore) PutMany(blocks []blocks.Block) error {
return nil
}
func (i *IpfsBstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
func (i *IPFSBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
return nil, xerrors.Errorf("not supported")
}
func (i *IpfsBstore) HashOnRead(enabled bool) {
func (i *IPFSBlockstore) HashOnRead(enabled bool) {
return // TODO: We could technically support this, but..
}
var _ blockstore.Blockstore = &IpfsBstore{}
@@ -5,38 +5,60 @@ import (
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
blockstore "github.com/ipfs/go-ipfs-blockstore"
)
type MemStore map[cid.Cid]blocks.Block
// NewMemory returns a temporary memory-backed blockstore.
func NewMemory() MemBlockstore {
return make(MemBlockstore)
}
func (m MemStore) DeleteBlock(k cid.Cid) error {
// MemBlockstore is a terminal blockstore that keeps blocks in memory.
type MemBlockstore map[cid.Cid]blocks.Block
func (m MemBlockstore) DeleteBlock(k cid.Cid) error {
delete(m, k)
return nil
}
func (m MemStore) Has(k cid.Cid) (bool, error) {
func (m MemBlockstore) DeleteMany(ks []cid.Cid) error {
for _, k := range ks {
delete(m, k)
}
return nil
}
func (m MemBlockstore) Has(k cid.Cid) (bool, error) {
_, ok := m[k]
return ok, nil
}
func (m MemStore) Get(k cid.Cid) (blocks.Block, error) {
func (m MemBlockstore) View(k cid.Cid, callback func([]byte) error) error {
b, ok := m[k]
if !ok {
return nil, blockstore.ErrNotFound
return ErrNotFound
}
return callback(b.RawData())
}
func (m MemBlockstore) Get(k cid.Cid) (blocks.Block, error) {
b, ok := m[k]
if !ok {
return nil, ErrNotFound
}
return b, nil
}
// GetSize returns the CIDs mapped BlockSize
func (m MemStore) GetSize(k cid.Cid) (int, error) {
func (m MemBlockstore) GetSize(k cid.Cid) (int, error) {
b, ok := m[k]
if !ok {
return 0, blockstore.ErrNotFound
return 0, ErrNotFound
}
return len(b.RawData()), nil
}
// Put puts a given block to the underlying datastore
func (m MemStore) Put(b blocks.Block) error {
func (m MemBlockstore) Put(b blocks.Block) error {
// Convert to a basic block for safety, but try to reuse the existing
// block if it's already a basic block.
k := b.Cid()
@@ -54,7 +76,7 @@ func (m MemStore) Put(b blocks.Block) error {
// PutMany puts a slice of blocks at the same time using batching
// capabilities of the underlying datastore whenever possible.
func (m MemStore) PutMany(bs []blocks.Block) error {
func (m MemBlockstore) PutMany(bs []blocks.Block) error {
for _, b := range bs {
_ = m.Put(b) // can't fail
}
@@ -64,7 +86,7 @@ func (m MemStore) PutMany(bs []blocks.Block) error {
// AllKeysChan returns a channel from which
// the CIDs in the Blockstore can be read. It should respect
// the given context, closing the channel if it becomes Done.
func (m MemStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
func (m MemBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
ch := make(chan cid.Cid, len(m))
for k := range m {
ch <- k
@@ -75,6 +97,6 @@ func (m MemStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
// HashOnRead specifies if every read block should be
// rehashed to make sure it matches its CID.
func (m MemStore) HashOnRead(enabled bool) {
func (m MemBlockstore) HashOnRead(enabled bool) {
// no-op
}
+154
View File
@@ -0,0 +1,154 @@
package blockstore
import (
"time"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
)
//
// Currently unused, but kept in repo in case we introduce one of the candidate
// cache implementations (Freecache, Ristretto), both of which report these
// metrics.
//
// CacheMetricsEmitInterval is the interval at which metrics are emitted onto
// OpenCensus.
var CacheMetricsEmitInterval = 5 * time.Second
var (
CacheName, _ = tag.NewKey("cache_name")
)
// CacheMeasures groups all metrics emitted by the blockstore caches.
var CacheMeasures = struct {
HitRatio *stats.Float64Measure
Hits *stats.Int64Measure
Misses *stats.Int64Measure
Entries *stats.Int64Measure
QueriesServed *stats.Int64Measure
Adds *stats.Int64Measure
Updates *stats.Int64Measure
Evictions *stats.Int64Measure
CostAdded *stats.Int64Measure
CostEvicted *stats.Int64Measure
SetsDropped *stats.Int64Measure
SetsRejected *stats.Int64Measure
QueriesDropped *stats.Int64Measure
}{
HitRatio: stats.Float64("blockstore/cache/hit_ratio", "Hit ratio of blockstore cache", stats.UnitDimensionless),
Hits: stats.Int64("blockstore/cache/hits", "Total number of hits at blockstore cache", stats.UnitDimensionless),
Misses: stats.Int64("blockstore/cache/misses", "Total number of misses at blockstore cache", stats.UnitDimensionless),
Entries: stats.Int64("blockstore/cache/entry_count", "Total number of entries currently in the blockstore cache", stats.UnitDimensionless),
QueriesServed: stats.Int64("blockstore/cache/queries_served", "Total number of queries served by the blockstore cache", stats.UnitDimensionless),
Adds: stats.Int64("blockstore/cache/adds", "Total number of adds to blockstore cache", stats.UnitDimensionless),
Updates: stats.Int64("blockstore/cache/updates", "Total number of updates in blockstore cache", stats.UnitDimensionless),
Evictions: stats.Int64("blockstore/cache/evictions", "Total number of evictions from blockstore cache", stats.UnitDimensionless),
CostAdded: stats.Int64("blockstore/cache/cost_added", "Total cost (byte size) of entries added into blockstore cache", stats.UnitBytes),
CostEvicted: stats.Int64("blockstore/cache/cost_evicted", "Total cost (byte size) of entries evicted by blockstore cache", stats.UnitBytes),
SetsDropped: stats.Int64("blockstore/cache/sets_dropped", "Total number of sets dropped by blockstore cache", stats.UnitDimensionless),
SetsRejected: stats.Int64("blockstore/cache/sets_rejected", "Total number of sets rejected by blockstore cache", stats.UnitDimensionless),
QueriesDropped: stats.Int64("blockstore/cache/queries_dropped", "Total number of queries dropped by blockstore cache", stats.UnitDimensionless),
}
// CacheViews groups all cache-related default views.
var CacheViews = struct {
HitRatio *view.View
Hits *view.View
Misses *view.View
Entries *view.View
QueriesServed *view.View
Adds *view.View
Updates *view.View
Evictions *view.View
CostAdded *view.View
CostEvicted *view.View
SetsDropped *view.View
SetsRejected *view.View
QueriesDropped *view.View
}{
HitRatio: &view.View{
Measure: CacheMeasures.HitRatio,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
Hits: &view.View{
Measure: CacheMeasures.Hits,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
Misses: &view.View{
Measure: CacheMeasures.Misses,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
Entries: &view.View{
Measure: CacheMeasures.Entries,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
QueriesServed: &view.View{
Measure: CacheMeasures.QueriesServed,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
Adds: &view.View{
Measure: CacheMeasures.Adds,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
Updates: &view.View{
Measure: CacheMeasures.Updates,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
Evictions: &view.View{
Measure: CacheMeasures.Evictions,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
CostAdded: &view.View{
Measure: CacheMeasures.CostAdded,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
CostEvicted: &view.View{
Measure: CacheMeasures.CostEvicted,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
SetsDropped: &view.View{
Measure: CacheMeasures.SetsDropped,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
SetsRejected: &view.View{
Measure: CacheMeasures.SetsRejected,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
QueriesDropped: &view.View{
Measure: CacheMeasures.QueriesDropped,
Aggregation: view.LastValue(),
TagKeys: []tag.Key{CacheName},
},
}
// DefaultViews exports all default views for this package.
var DefaultViews = []*view.View{
CacheViews.HitRatio,
CacheViews.Hits,
CacheViews.Misses,
CacheViews.Entries,
CacheViews.QueriesServed,
CacheViews.Adds,
CacheViews.Updates,
CacheViews.Evictions,
CacheViews.CostAdded,
CacheViews.CostEvicted,
CacheViews.SetsDropped,
CacheViews.SetsRejected,
CacheViews.QueriesDropped,
}
+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
}
}
+40
View File
@@ -0,0 +1,40 @@
package splitstore
import (
"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
type MarkSet interface {
Mark(cid.Cid) error
Has(cid.Cid) (bool, error)
Close() error
SetConcurrent()
}
type MarkSetEnv interface {
Create(name string, sizeHint int64) (MarkSet, error)
Close() error
}
func OpenMarkSetEnv(path string, mtype string) (MarkSetEnv, error) {
switch mtype {
case "bloom":
return NewBloomMarkSetEnv()
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{}) {}
+107
View File
@@ -0,0 +1,107 @@
package splitstore
import (
"crypto/rand"
"crypto/sha256"
"sync"
"golang.org/x/xerrors"
bbloom "github.com/ipfs/bbloom"
cid "github.com/ipfs/go-cid"
)
const (
BloomFilterMinSize = 10_000_000
BloomFilterProbability = 0.01
)
type BloomMarkSetEnv struct{}
var _ MarkSetEnv = (*BloomMarkSetEnv)(nil)
type BloomMarkSet struct {
salt []byte
mx sync.RWMutex
bf *bbloom.Bloom
ts bool
}
var _ MarkSet = (*BloomMarkSet)(nil)
func NewBloomMarkSetEnv() (*BloomMarkSetEnv, error) {
return &BloomMarkSetEnv{}, nil
}
func (e *BloomMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) {
size := int64(BloomFilterMinSize)
for size < sizeHint {
size += BloomFilterMinSize
}
salt := make([]byte, 4)
_, err := rand.Read(salt)
if err != nil {
return nil, xerrors.Errorf("error reading salt: %w", err)
}
bf, err := bbloom.New(float64(size), BloomFilterProbability)
if err != nil {
return nil, xerrors.Errorf("error creating bloom filter: %w", err)
}
return &BloomMarkSet{salt: salt, bf: bf}, nil
}
func (e *BloomMarkSetEnv) Close() error {
return nil
}
func (s *BloomMarkSet) saltedKey(cid cid.Cid) []byte {
hash := cid.Hash()
key := make([]byte, len(s.salt)+len(hash))
n := copy(key, s.salt)
copy(key[n:], hash)
rehash := sha256.Sum256(key)
return rehash[:]
}
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
}
+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
}
+147
View File
@@ -0,0 +1,147 @@
package splitstore
import (
"io/ioutil"
"testing"
cid "github.com/ipfs/go-cid"
"github.com/multiformats/go-multihash"
)
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()
path, err := ioutil.TempDir("", "sweep-test.*")
if err != nil {
t.Fatal(err)
}
env, err := OpenMarkSetEnv(path, lsType)
if err != nil {
t.Fatal(err)
}
defer env.Close() //nolint:errcheck
hotSet, err := env.Create("hot", 0)
if err != nil {
t.Fatal(err)
}
coldSet, err := env.Create("cold", 0)
if err != nil {
t.Fatal(err)
}
makeCid := func(key string) cid.Cid {
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
if err != nil {
t.Fatal(err)
}
return cid.NewCidV1(cid.Raw, h)
}
mustHave := func(s MarkSet, cid cid.Cid) {
has, err := s.Has(cid)
if err != nil {
t.Fatal(err)
}
if !has {
t.Fatal("mark not found")
}
}
mustNotHave := func(s MarkSet, cid cid.Cid) {
has, err := s.Has(cid)
if err != nil {
t.Fatal(err)
}
if has {
t.Fatal("unexpected mark")
}
}
k1 := makeCid("a")
k2 := makeCid("b")
k3 := makeCid("c")
k4 := makeCid("d")
hotSet.Mark(k1) //nolint
hotSet.Mark(k2) //nolint
coldSet.Mark(k3) //nolint
mustHave(hotSet, k1)
mustHave(hotSet, k2)
mustNotHave(hotSet, k3)
mustNotHave(hotSet, k4)
mustNotHave(coldSet, k1)
mustNotHave(coldSet, k2)
mustHave(coldSet, k3)
mustNotHave(coldSet, k4)
// close them and reopen to redo the dance
err = hotSet.Close()
if err != nil {
t.Fatal(err)
}
err = coldSet.Close()
if err != nil {
t.Fatal(err)
}
hotSet, err = env.Create("hot", 0)
if err != nil {
t.Fatal(err)
}
coldSet, err = env.Create("cold", 0)
if err != nil {
t.Fatal(err)
}
hotSet.Mark(k3) //nolint
hotSet.Mark(k4) //nolint
coldSet.Mark(k1) //nolint
mustNotHave(hotSet, k1)
mustNotHave(hotSet, k2)
mustHave(hotSet, k3)
mustHave(hotSet, k4)
mustHave(coldSet, k1)
mustNotHave(coldSet, k2)
mustNotHave(coldSet, k3)
mustNotHave(coldSet, k4)
err = hotSet.Close()
if err != nil {
t.Fatal(err)
}
err = coldSet.Close()
if err != nil {
t.Fatal(err)
}
}
+580
View File
@@ -0,0 +1,580 @@
package splitstore
import (
"context"
"errors"
"os"
"sync"
"sync/atomic"
"time"
"go.uber.org/multierr"
"golang.org/x/xerrors"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
dstore "github.com/ipfs/go-datastore"
logging "github.com/ipfs/go-log/v2"
"github.com/filecoin-project/go-state-types/abi"
bstore "github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/metrics"
"go.opencensus.io/stats"
)
var (
// baseEpochKey stores the base epoch (last compaction epoch) in the
// metadata store.
baseEpochKey = dstore.NewKey("/splitstore/baseEpoch")
// warmupEpochKey stores whether a hot store warmup has been performed.
// On first start, the splitstore will walk the state tree and will copy
// all active blocks into the hotstore.
warmupEpochKey = dstore.NewKey("/splitstore/warmupEpoch")
// markSetSizeKey stores the current estimate for the mark set size.
// this is first computed at warmup and updated in every compaction
markSetSizeKey = dstore.NewKey("/splitstore/markSetSize")
// compactionIndexKey stores the compaction index (serial number)
compactionIndexKey = dstore.NewKey("/splitstore/compactionIndex")
log = logging.Logger("splitstore")
// set this to true if you are debugging the splitstore to enable debug logging
enableDebugLog = false
// set this to true if you want to track origin stack traces in the write log
enableDebugLogWriteTraces = false
)
func init() {
if os.Getenv("LOTUS_SPLITSTORE_DEBUG_LOG") == "1" {
enableDebugLog = true
}
if os.Getenv("LOTUS_SPLITSTORE_DEBUG_LOG_WRITE_TRACES") == "1" {
enableDebugLogWriteTraces = true
}
}
type Config struct {
// MarkSetType is the type of mark set to use.
//
// The default value is "map", which uses an in-memory map-backed markset.
// If you are constrained in memory (i.e. compaction runs out of memory), you
// can use "badger", which will use a disk-backed markset using badger.
// Note that compaction will take quite a bit longer when using the "badger" option,
// but that shouldn't really matter (as long as it is under 7.5hrs).
MarkSetType string
// DiscardColdBlocks indicates whether to skip moving cold blocks to the coldstore.
// If the splitstore is running with a noop coldstore then this option is set to true
// which skips moving (as it is a noop, but still takes time to read all the cold objects)
// and directly purges cold blocks.
DiscardColdBlocks bool
// HotstoreMessageRetention indicates the hotstore retention policy for messages.
// It has the following semantics:
// - a value of 0 will only retain messages within the compaction boundary (4 finalities)
// - a positive integer indicates the number of finalities, outside the compaction boundary,
// for which messages will be retained in the hotstore.
HotStoreMessageRetention uint64
// HotstoreFullGCFrequency indicates how frequently (in terms of compactions) to garbage collect
// the hotstore using full (moving) GC if supported by the hotstore.
// A value of 0 disables full GC entirely.
// A positive value is the number of compactions before a full GC is performed;
// a value of 1 will perform full GC in every compaction.
HotStoreFullGCFrequency uint64
}
// ChainAccessor allows the Splitstore to access the chain. It will most likely
// be a ChainStore at runtime.
type ChainAccessor interface {
GetTipsetByHeight(context.Context, abi.ChainEpoch, *types.TipSet, bool) (*types.TipSet, error)
GetHeaviestTipSet() *types.TipSet
SubscribeHeadChanges(change func(revert []*types.TipSet, apply []*types.TipSet) error)
}
// hotstore is the interface that must be satisfied by the hot blockstore; it is an extension
// of the Blockstore interface with the traits we need for compaction.
type hotstore interface {
bstore.Blockstore
bstore.BlockstoreIterator
}
type SplitStore struct {
compacting int32 // compaction/prune/warmup in progress
closing int32 // the splitstore is closing
cfg *Config
path string
mx sync.Mutex
warmupEpoch abi.ChainEpoch // protected by mx
baseEpoch abi.ChainEpoch // protected by compaction lock
headChangeMx sync.Mutex
coldPurgeSize int
chain ChainAccessor
ds dstore.Datastore
cold bstore.Blockstore
hot hotstore
markSetEnv MarkSetEnv
markSetSize int64
compactionIndex int64
ctx context.Context
cancel func()
debug *debugLog
// transactional protection for concurrent read/writes during compaction
txnLk sync.RWMutex
txnViewsMx sync.Mutex
txnViewsCond sync.Cond
txnViews int
txnViewsWaiting bool
txnActive bool
txnProtect MarkSet
txnRefsMx sync.Mutex
txnRefs map[cid.Cid]struct{}
txnMissing map[cid.Cid]struct{}
// registered protectors
protectors []func(func(cid.Cid) error) error
}
var _ bstore.Blockstore = (*SplitStore)(nil)
// Open opens an existing splistore, or creates a new splitstore. The splitstore
// is backed by the provided hot and cold stores. The returned SplitStore MUST be
// attached to the ChainStore with Start in order to trigger compaction.
func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Config) (*SplitStore, error) {
// hot blockstore must support the hotstore interface
hots, ok := hot.(hotstore)
if !ok {
// be specific about what is missing
if _, ok := hot.(bstore.BlockstoreIterator); !ok {
return nil, xerrors.Errorf("hot blockstore does not support efficient iteration: %T", hot)
}
return nil, xerrors.Errorf("hot blockstore does not support the necessary traits: %T", hot)
}
// the markset env
markSetEnv, err := OpenMarkSetEnv(path, cfg.MarkSetType)
if err != nil {
return nil, err
}
// and now we can make a SplitStore
ss := &SplitStore{
cfg: cfg,
path: path,
ds: ds,
cold: cold,
hot: hots,
markSetEnv: markSetEnv,
coldPurgeSize: defaultColdPurgeSize,
}
ss.txnViewsCond.L = &ss.txnViewsMx
ss.ctx, ss.cancel = context.WithCancel(context.Background())
if enableDebugLog {
ss.debug, err = openDebugLog(path)
if err != nil {
return nil, err
}
}
return ss, nil
}
// Blockstore interface
func (s *SplitStore) DeleteBlock(_ cid.Cid) error {
// afaict we don't seem to be using this method, so it's not implemented
return errors.New("DeleteBlock not implemented on SplitStore; don't do this Luke!") //nolint
}
func (s *SplitStore) DeleteMany(_ []cid.Cid) error {
// afaict we don't seem to be using this method, so it's not implemented
return errors.New("DeleteMany not implemented on SplitStore; don't do this Luke!") //nolint
}
func (s *SplitStore) Has(cid cid.Cid) (bool, error) {
if isIdentiyCid(cid) {
return true, nil
}
s.txnLk.RLock()
defer s.txnLk.RUnlock()
has, err := s.hot.Has(cid)
if err != nil {
return has, err
}
if has {
s.trackTxnRef(cid)
return true, nil
}
return s.cold.Has(cid)
}
func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
if isIdentiyCid(cid) {
data, err := decodeIdentityCid(cid)
if err != nil {
return nil, err
}
return blocks.NewBlockWithCid(data, cid)
}
s.txnLk.RLock()
defer s.txnLk.RUnlock()
blk, err := s.hot.Get(cid)
switch err {
case nil:
s.trackTxnRef(cid)
return blk, nil
case bstore.ErrNotFound:
if s.isWarm() {
s.debug.LogReadMiss(cid)
}
blk, err = s.cold.Get(cid)
if err == nil {
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
}
return blk, err
default:
return nil, err
}
}
func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
if isIdentiyCid(cid) {
data, err := decodeIdentityCid(cid)
if err != nil {
return 0, err
}
return len(data), nil
}
s.txnLk.RLock()
defer s.txnLk.RUnlock()
size, err := s.hot.GetSize(cid)
switch err {
case nil:
s.trackTxnRef(cid)
return size, nil
case bstore.ErrNotFound:
if s.isWarm() {
s.debug.LogReadMiss(cid)
}
size, err = s.cold.GetSize(cid)
if err == nil {
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
}
return size, err
default:
return 0, err
}
}
func (s *SplitStore) Put(blk blocks.Block) error {
if isIdentiyCid(blk.Cid()) {
return nil
}
s.txnLk.RLock()
defer s.txnLk.RUnlock()
err := s.hot.Put(blk)
if err != nil {
return err
}
s.debug.LogWrite(blk)
s.trackTxnRef(blk.Cid())
return nil
}
func (s *SplitStore) PutMany(blks []blocks.Block) error {
// filter identites
idcids := 0
for _, blk := range blks {
if isIdentiyCid(blk.Cid()) {
idcids++
}
}
if idcids > 0 {
if idcids == len(blks) {
// it's all identities
return nil
}
filtered := make([]blocks.Block, 0, len(blks)-idcids)
for _, blk := range blks {
if isIdentiyCid(blk.Cid()) {
continue
}
filtered = append(filtered, blk)
}
blks = filtered
}
batch := make([]cid.Cid, 0, len(blks))
for _, blk := range blks {
batch = append(batch, blk.Cid())
}
s.txnLk.RLock()
defer s.txnLk.RUnlock()
err := s.hot.PutMany(blks)
if err != nil {
return err
}
s.debug.LogWriteMany(blks)
s.trackTxnRefMany(batch)
return nil
}
func (s *SplitStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
ctx, cancel := context.WithCancel(ctx)
chHot, err := s.hot.AllKeysChan(ctx)
if err != nil {
cancel()
return nil, err
}
chCold, err := s.cold.AllKeysChan(ctx)
if err != nil {
cancel()
return nil, err
}
seen := cid.NewSet()
ch := make(chan cid.Cid, 8) // buffer is arbitrary, just enough to avoid context switches
go func() {
defer cancel()
defer close(ch)
for _, in := range []<-chan cid.Cid{chHot, chCold} {
for c := range in {
// ensure we only emit each key once
if !seen.Visit(c) {
continue
}
select {
case ch <- c:
case <-ctx.Done():
return
}
}
}
}()
return ch, nil
}
func (s *SplitStore) HashOnRead(enabled bool) {
s.hot.HashOnRead(enabled)
s.cold.HashOnRead(enabled)
}
func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error {
if isIdentiyCid(cid) {
data, err := decodeIdentityCid(cid)
if err != nil {
return err
}
return cb(data)
}
// views are (optimistically) protected two-fold:
// - if there is an active transaction, then the reference is protected.
// - if there is no active transaction, active views are tracked in a
// wait group and compaction is inhibited from starting until they
// have all completed. this is necessary to ensure that a (very) long-running
// view can't have its data pointer deleted, which would be catastrophic.
// Note that we can't just RLock for the duration of the view, as this could
// lead to deadlock with recursive views.
s.protectView(cid)
defer s.viewDone()
err := s.hot.View(cid, cb)
switch err {
case bstore.ErrNotFound:
if s.isWarm() {
s.debug.LogReadMiss(cid)
}
err = s.cold.View(cid, cb)
if err == nil {
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
}
return err
default:
return err
}
}
func (s *SplitStore) isWarm() bool {
s.mx.Lock()
defer s.mx.Unlock()
return s.warmupEpoch > 0
}
// State tracking
func (s *SplitStore) Start(chain ChainAccessor) error {
s.chain = chain
curTs := chain.GetHeaviestTipSet()
// should we warmup
warmup := false
// load base epoch from metadata ds
// if none, then use current epoch because it's a fresh start
bs, err := s.ds.Get(baseEpochKey)
switch err {
case nil:
s.baseEpoch = bytesToEpoch(bs)
case dstore.ErrNotFound:
if curTs == nil {
// this can happen in some tests
break
}
err = s.setBaseEpoch(curTs.Height())
if err != nil {
return xerrors.Errorf("error saving base epoch: %w", err)
}
default:
return xerrors.Errorf("error loading base epoch: %w", err)
}
// load warmup epoch from metadata ds
bs, err = s.ds.Get(warmupEpochKey)
switch err {
case nil:
s.warmupEpoch = bytesToEpoch(bs)
case dstore.ErrNotFound:
warmup = true
default:
return xerrors.Errorf("error loading warmup epoch: %w", err)
}
// load markSetSize from metadata ds to provide a size hint for marksets
bs, err = s.ds.Get(markSetSizeKey)
switch err {
case nil:
s.markSetSize = bytesToInt64(bs)
case dstore.ErrNotFound:
default:
return xerrors.Errorf("error loading mark set size: %w", err)
}
// load compactionIndex from metadata ds to provide a hint as to when to perform moving gc
bs, err = s.ds.Get(compactionIndexKey)
switch err {
case nil:
s.compactionIndex = bytesToInt64(bs)
case dstore.ErrNotFound:
// this is potentially an upgrade from splitstore v0; schedule a warmup as v0 has
// some issues with hot references leaking into the coldstore.
warmup = true
default:
return xerrors.Errorf("error loading compaction index: %w", err)
}
log.Infow("starting splitstore", "baseEpoch", s.baseEpoch, "warmupEpoch", s.warmupEpoch)
if warmup {
err = s.warmup(curTs)
if err != nil {
return xerrors.Errorf("error starting warmup: %w", err)
}
}
// watch the chain
chain.SubscribeHeadChanges(s.HeadChange)
return nil
}
func (s *SplitStore) AddProtector(protector func(func(cid.Cid) error) error) {
s.mx.Lock()
defer s.mx.Unlock()
s.protectors = append(s.protectors, protector)
}
func (s *SplitStore) Close() error {
if !atomic.CompareAndSwapInt32(&s.closing, 0, 1) {
// already closing
return nil
}
if atomic.LoadInt32(&s.compacting) == 1 {
log.Warn("close with ongoing compaction in progress; waiting for it to finish...")
for atomic.LoadInt32(&s.compacting) == 1 {
time.Sleep(time.Second)
}
}
s.cancel()
return multierr.Combine(s.markSetEnv.Close(), s.debug.Close())
}
func (s *SplitStore) checkClosing() error {
if atomic.LoadInt32(&s.closing) == 1 {
return xerrors.Errorf("splitstore is closing")
}
return nil
}
func (s *SplitStore) setBaseEpoch(epoch abi.ChainEpoch) error {
s.baseEpoch = epoch
return s.ds.Put(baseEpochKey, epochToBytes(epoch))
}
+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)
}
+391
View File
@@ -0,0 +1,391 @@
package splitstore
import (
"context"
"errors"
"fmt"
"sync"
"sync/atomic"
"testing"
"time"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/blockstore"
"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"
logging "github.com/ipfs/go-log/v2"
)
func init() {
CompactionThreshold = 5
CompactionBoundary = 2
WarmupBoundary = 0
logging.SetLogLevel("splitstore", "DEBUG")
}
func testSplitStore(t *testing.T, cfg *Config) {
chain := &mockChain{t: t}
// the myriads of stores
ds := dssync.MutexWrap(datastore.NewMapDatastore())
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()
if err != nil {
t.Fatal(err)
}
err = cold.Put(blk)
if err != nil {
t.Fatal(err)
}
// create a garbage block that is protected with a rgistered protector
protected := blocks.NewBlock([]byte("protected!"))
err = hot.Put(protected)
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 {
t.Fatal(err)
}
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, 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)
}
ts := mock.TipSet(blk)
chain.push(ts)
return ts
}
waitForCompaction := func() {
for atomic.LoadInt32(&ss.compacting) == 1 {
time.Sleep(100 * time.Millisecond)
}
}
curTs := genTs
for i := 1; i < 5; i++ {
stateRoot := blocks.NewBlock([]byte{byte(i), 3, 3, 7})
curTs = mkBlock(curTs, i, stateRoot)
waitForCompaction()
}
// count objects in the cold and hot stores
countBlocks := func(bs blockstore.Blockstore) int {
count := 0
_ = bs.(blockstore.BlockstoreIterator).ForEachKey(func(_ cid.Cid) error {
count++
return nil
})
return count
}
coldCnt := countBlocks(cold)
hotCnt := countBlocks(hot)
if coldCnt != 2 {
t.Errorf("expected %d blocks, but got %d", 2, coldCnt)
}
if hotCnt != 12 {
t.Errorf("expected %d blocks, but got %d", 12, hotCnt)
}
// trigger a compaction
for i := 5; i < 10; i++ {
stateRoot := blocks.NewBlock([]byte{byte(i), 3, 3, 7})
curTs = mkBlock(curTs, i, stateRoot)
waitForCompaction()
}
coldCnt = countBlocks(cold)
hotCnt = countBlocks(hot)
if coldCnt != 6 {
t.Errorf("expected %d cold blocks, but got %d", 6, coldCnt)
}
if hotCnt != 18 {
t.Errorf("expected %d hot blocks, but got %d", 18, 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 TestSplitStoreCompaction(t *testing.T) {
testSplitStore(t, &Config{MarkSetType: "map"})
}
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
}
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 {
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)
}
}
}
func (c *mockChain) GetTipsetByHeight(_ context.Context, epoch abi.ChainEpoch, _ *types.TipSet, _ bool) (*types.TipSet, error) {
c.Lock()
defer c.Unlock()
iEpoch := int(epoch)
if iEpoch > len(c.tipsets) {
return nil, fmt.Errorf("bad epoch %d", epoch)
}
return c.tipsets[iEpoch], nil
}
func (c *mockChain) GetHeaviestTipSet() *types.TipSet {
c.Lock()
defer c.Unlock()
return c.tipsets[len(c.tipsets)-1]
}
func (c *mockChain) SubscribeHeadChanges(change func(revert []*types.TipSet, apply []*types.TipSet) error) {
c.listener = change
}
type mockStore struct {
mx sync.Mutex
set map[cid.Cid]blocks.Block
}
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
}
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
}
+81
View File
@@ -0,0 +1,81 @@
package blockstore
import (
"context"
"sync"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
)
// NewMemorySync returns a thread-safe in-memory blockstore.
func NewMemorySync() *SyncBlockstore {
return &SyncBlockstore{bs: make(MemBlockstore)}
}
// SyncBlockstore is a terminal blockstore that is a synchronized version
// of MemBlockstore.
type SyncBlockstore struct {
mu sync.RWMutex
bs MemBlockstore // specifically use a memStore to save indirection overhead.
}
func (m *SyncBlockstore) DeleteBlock(k cid.Cid) error {
m.mu.Lock()
defer m.mu.Unlock()
return m.bs.DeleteBlock(k)
}
func (m *SyncBlockstore) DeleteMany(ks []cid.Cid) error {
m.mu.Lock()
defer m.mu.Unlock()
return m.bs.DeleteMany(ks)
}
func (m *SyncBlockstore) Has(k cid.Cid) (bool, error) {
m.mu.RLock()
defer m.mu.RUnlock()
return m.bs.Has(k)
}
func (m *SyncBlockstore) View(k cid.Cid, callback func([]byte) error) error {
m.mu.RLock()
defer m.mu.RUnlock()
return m.bs.View(k, callback)
}
func (m *SyncBlockstore) Get(k cid.Cid) (blocks.Block, error) {
m.mu.RLock()
defer m.mu.RUnlock()
return m.bs.Get(k)
}
func (m *SyncBlockstore) GetSize(k cid.Cid) (int, error) {
m.mu.RLock()
defer m.mu.RUnlock()
return m.bs.GetSize(k)
}
func (m *SyncBlockstore) Put(b blocks.Block) error {
m.mu.Lock()
defer m.mu.Unlock()
return m.bs.Put(b)
}
func (m *SyncBlockstore) PutMany(bs []blocks.Block) error {
m.mu.Lock()
defer m.mu.Unlock()
return m.bs.PutMany(bs)
}
func (m *SyncBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
m.mu.RLock()
defer m.mu.RUnlock()
// this blockstore implementation doesn't do any async work.
return m.bs.AllKeysChan(ctx)
}
func (m *SyncBlockstore) HashOnRead(enabled bool) {
// noop
}

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