Compare commits

...
2537 Commits
Author SHA1 Message Date
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
Aayush Rajasekaran a49b21b94a Lotus version 1.6.0 2021-04-04 21:34:20 -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
Travis Person 37e0526918 Update butterfly network genesis 2021-03-31 21:09:22 +00: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
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
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
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
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
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
Aayush Rajasekaran 9afb5ff944 Lotus 1.5.3-rc2 2021-03-17 02:45:23 -04: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
Ł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
Ł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 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
Ł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
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
Ł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 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
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 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 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
Ł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
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
Łukasz Magiera d4cdc6d334 Merge pull request #4580 from filecoin-project/asr/changelog
Lotus version 1.1.2
2020-10-24 12:37:40 +02:00
Aayush Rajasekaran 7b3f1c2b85 Lotus version 1.1.2 2020-10-24 06:33:31 -04:00
Łukasz Magiera 9972f19240 Merge pull request #4579 from filecoin-project/steb/worker-key-change-runtime
Handle worker key changes correctly in runtime
2020-10-24 12:28:01 +02:00
Steven Allen f23034305f Handle worker key changes correctly in runtime 2020-10-24 02:57:17 -07:00
zgfzgf fe40a53e8f delete slash-consensus miner 2020-10-24 13:46:15 +08:00
Aayush Rajasekaran 2663d6c3cb Merge pull request #4574 from filecoin-project/asr/changelog
Lotus version 1.1.1
2020-10-24 00:24:26 -04:00
Aayush Rajasekaran 8b8d81e767 Lotus version 1.1.1 2020-10-24 00:22:20 -04:00
Aayush Rajasekaran d43bc79050 Merge pull request #4573 from filecoin-project/steb/remove-worker-key-cache
Fetch worker key from correct block on sync
2020-10-23 23:59:43 -04:00
Steven Allen 06af2fb52b Remove the worker key cache and use the correct worker key
We need to use the worker key from the lookback tipset state. We can't
reasonably maintain this cache, unfortunately (unless we kept some form of
"per-height" cache).
2020-10-23 19:40:05 -07:00
Steven Allen 8bb69f1e9c Use pre-computed parent state root for lookback info
There's no need to call TipSetState and recompute it.
2020-10-23 19:40:01 -07: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 194f56377e Merge pull request #4565 from filecoin-project/feat/shed-msg-decode
shed: Commad to decode messages
2020-10-23 22:35:24 +02:00
Łukasz Magiera 2023615f55 Merge pull request #4563 from filecoin-project/steb/post-lookback
Use older randomness for the PoSt commit on specs-actors version 2
2020-10-23 22:21:51 +02:00
Łukasz Magiera de2cbfa8a9 client deal: Cache CommD when creating multiple deals 2020-10-23 22:20:17 +02:00
Łukasz Magiera 067de4508b shed: Commad to decode messages 2020-10-23 22:17:46 +02:00
Łukasz Magiera 74bf4c5e71 Merge pull request #4556 from filecoin-project/fix/marketwithdraw-miner
Make wallet market withdraw usable with miner addresses
2020-10-23 22:15:28 +02:00
Jakub Sztandera 099bb2cbaa Merge pull request #4561 from filecoin-project/fix/timedbs-flaky
Fix flaky TestTimedBSSimple
2020-10-23 22:14:32 +02:00
Łukasz Magiera e395559f75 Merge pull request #4564 from filecoin-project/fix/chain-import-flake
Fix flaky TestChainExportImportFull
2020-10-23 22:00:03 +02:00
Łukasz Magiera b7b6ab779a Make wallet market withdraw usable with miner addresses 2020-10-23 21:54:41 +02:00
Steven Allen 109b326ae2 Use older randomness for the PoSt commit on specs-actors version 2
After the upgrade, we're allowed to use randomness up to the challenge epoch.
This safe-guards us against very large reorgs where a miner computes a PoSt very
quickly.
2020-10-23 12:45:11 -07:00
Jakub Sztandera c7e6c8eacc Fix flaky TestChainExportImportFull
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 21:45:08 +02:00
Jakub Sztandera 9fbd2a50ff Fix lint
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 20:50:17 +02:00
Jakub Sztandera ea69386519 Fix flaky TestTimedBSSimple
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 20:46:06 +02:00
Łukasz Magiera 8124fe98c7 Merge pull request #4559 from filecoin-project/fix/beyond-genesis
Fix random test failures
2020-10-23 19:52:10 +02:00
Jakub Sztandera 16a911bc39 Fix random test failures
If block 1 was a null block then blockSet would include genesis which
would lead to us trying to load parent of a genesis block.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 19:33:30 +02:00
Łukasz Magiera c81db5a21c Merge pull request #4420 from filecoin-project/deps/drand-v1.2.0
Chore: update drand to v1.2.0
2020-10-23 18:25:00 +02:00
Łukasz Magiera dbcba6477e Merge pull request #4263 from filecoin-project/feat/lite-market-client
lite-mode - market storage and retrieval clients
2020-10-23 17:23:06 +02:00
Łukasz Magiera 36816fb4f3 Fix list-asks, deals with non-genesis miners in lite-mode 2020-10-23 17:08:21 +02:00
Łukasz Magiera 1ec8252412 Merge pull request #4497 from filecoin-project/feat/lite-market-client-cli
lotus-lite: CLI tests for `lotus client` commands
2020-10-23 16:18:23 +02:00
Łukasz Magiera 91fae36b86 Merge pull request #4554 from filecoin-project/tvx-simulate-2
tvx simulate command; tvx extract --ignore-sanity-checks
2020-10-23 15:58:22 +02:00
Łukasz Magiera 623ffebe62 Merge pull request #4555 from filecoin-project/feat/walletlist-id-market
wallet list: Add market balance and ID address flags
2020-10-23 15:35:03 +02:00
Dirk McCormick 906286fdbe feat: lite-mode - CLI tests for lotus client commands 2020-10-23 15:02:49 +02:00
Dirk McCormick 92942d44d1 feat: lite-mode - market storage and retrieval clients 2020-10-23 15:02:26 +02:00
Łukasz Magiera 9caa6ae69c wallet list: Add market balance and ID address flags 2020-10-23 14:42:19 +02:00
Raúl Kripalani 39d9150175 fix tvx init. 2020-10-23 13:30:04 +01:00
Raúl Kripalani 5301c416bc tvx extract: --ignore-sanity-checks flag. 2020-10-23 10:47:22 +01:00
Raúl Kripalani 92395745d3 tvx simulate: execute raw message against height. 2020-10-23 10:46:32 +01:00
Łukasz Magiera 7d9e8f9d92 Merge pull request #4524 from filecoin-project/feat/withdraw-market-funds-cli
Add a market WithdrawBalance CLI
2020-10-23 11:33:38 +02:00
Łukasz Magiera 6842c03399 wallet cli: rename withdraw-market-funds -> market withdraw 2020-10-23 11:17:03 +02:00
Łukasz Magiera 2c3d80494f Merge pull request #4538 from filecoin-project/steb/test-cleanup-proofs
Cleanup test initialization and always validate VRFs in tests
2020-10-23 10:53:54 +02:00
Steven Allen 2cf770cc91 Merge pull request #4539 from filecoin-project/steb/fix-worker-key-lookback
Use the correct lookback for the worker key when creating blocks
2020-10-22 21:10:25 -07:00
Jakub Sztandera bfdb74bfee Merge pull request #4541 from filecoin-project/feat/maybe-fix-something
Fix chain sync stopping to sync
2020-10-23 02:10:43 +02:00
Jakub Sztandera 580a2f4dc6 Add option to join by common parents
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 01:35:26 +02:00
Jakub Sztandera c8fe21c1ef PopRelated aggretates the bucket
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 01:18:13 +02:00
Steven Allen 59cfabf8a4 don't resolve the worker key twice 2020-10-22 15:48:09 -07:00
Jakub Sztandera 810feee5a1 PopRelated should pop all
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 00:39:08 +02:00
Jakub Sztandera 24fc7d4cbd Add reproduction test and fix the issue
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 00:34:04 +02:00
Jakub Sztandera 5edfc527b0 More than one bucket
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-23 00:34:03 +02:00
Jakub Sztandera febc28f83f Add log and Insert
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-22 23:39:54 +02:00
hannahhoward 98297cef4d feat(data-transfer): fill in utils 2020-10-22 13:40:26 -07:00
Łukasz Magiera 0289c39850 Merge pull request #4516 from filecoin-project/feat/api-request-metrics-wrapper
Feat/api request metrics wrapper
2020-10-22 21:40:47 +02:00
Łukasz Magiera 29e334de54 Merge pull request #4511 from filecoin-project/steb/generalize-window-post
Manage sectors by size instead of proof type.
2020-10-22 21:27:48 +02:00
Łukasz Magiera f9723ca3c1 Merge pull request #4521 from filecoin-project/feat/fix-shed-ledger-list
Fix lotus-shed ledger list
2020-10-22 19:59:18 +02:00
Łukasz Magiera c17e8e778d Merge pull request #4526 from filecoin-project/wallet-4464
Delete wallet from local wallet cache
2020-10-22 19:50:01 +02:00
Łukasz Magiera b2510e5fc5 Merge pull request #4508 from filecoin-project/fix/actor-not-found-mininig-base
MinerGetBaseInfo: if miner is not found in lookback, check current
2020-10-22 19:45:43 +02:00
Łukasz Magiera 6c800bd0e3 Merge pull request #4501 from filecoin-project/feat/gateway-oni-needs
add some methods that oni needs
2020-10-22 19:44:47 +02:00
Łukasz Magiera 88ac85b6ae Merge pull request #4500 from filecoin-project/fix/mpool-push-atomicity
make push and addLocal atomic
2020-10-22 19:43:52 +02:00
Łukasz Magiera 6bdf9935bf Merge pull request #4475 from filecoin-project/fix/miner-init-createworker
miner: fix init --create-worker-key
2020-10-22 18:55:25 +02:00
Łukasz Magiera 29cda82eac Merge pull request #4449 from austinabell/austin/confcircsupplyfix
Fix circ supply default in conformance
2020-10-22 18:53:10 +02:00
Steven Allen b05613445e Sign blocks with the worker key from the correct lookback epoch 2020-10-22 09:26:58 -07:00
Steven Allen defeba5576 Fix lookback for worker key when computing ticket
We need to compute the ticket based on our worker key from the lookback epoch,
not the current epoch.
2020-10-22 09:26:58 -07:00
Steven Allen 4a550d12d4 Always validate VRFs, even when insecure post validation is enabled
We always generate them, we might as well validate them.
2020-10-22 09:19:46 -07:00
Steven Allen 70c39fe78c Fix global test options
Set BELLMAN_NO_GPU on init.
Set InsecurePoStValidation once in an obvious place.
2020-10-22 09:19:46 -07:00
Łukasz Magiera 6fc8550c19 Merge pull request #4314 from filecoin-project/feat/lotus-pcr-block-list
Add block list to pcr
2020-10-22 17:59:23 +02:00
Łukasz Magiera 6b9a4c4a34 Merge pull request #4536 from filecoin-project/zgfzgf-fix-chain-export
Small chain export optimization
2020-10-22 17:35:58 +02:00
Łukasz Magiera 041762a34f Merge pull request #4383 from filecoin-project/steb/actor-v2-imports
Remove most v0 actor imports
2020-10-22 17:17:56 +02:00
Łukasz Magiera 25c4a1bd8d Merge pull request #4523 from filecoin-project/misc/remove-log-sync
heaviestTipSet reurning nil is a ok
2020-10-22 17:16:02 +02:00
Łukasz Magiera 05b459e4c5 Merge pull request #4379 from zgfzgf/feat-mining
optimize mining code
2020-10-22 16:12:40 +02:00
Łukasz Magiera 1665d61c89 Merge pull request #4339 from filecoin-project/shed/borked-cmd
Shed/borked cmd
2020-10-22 16:10:05 +02:00
Łukasz Magiera 9a58763a4e shed: Rename the command to frozen-miners 2020-10-22 16:07:42 +02:00
ZenGround0 f9707ba344 add borked inspection command
hook up new command

Fix head call

Debug internal error

Debug moa

Debug 0

Fix 0

Fix 1

Better print

Don't ignore error
2020-10-22 16:03:11 +02:00
Łukasz Magiera ae04f3029b chain: Add more robust test for ChainExport 2020-10-22 16:01:11 +02:00
Łukasz Magiera 40872e9d90 Merge branch 'fix-chain-export' of github.com:zgfzgf/lotus into zgfzgf-fix-chain-export 2020-10-22 15:56:42 +02:00
Łukasz Magiera ee8d8bf5e5 pcr: Fix lint 2020-10-22 15:42:46 +02:00
Łukasz Magiera b85bf82d00 Merge pull request #4318 from filecoin-project/asr/shed-won-power
Add a shed util to determine % of power that has won a block
2020-10-22 15:40:55 +02:00
Travis Person 6fb3dafa95 lotus-pcr: add blocklist 2020-10-22 15:35:01 +02:00
Łukasz Magiera f5960df544 Merge pull request #4313 from filecoin-project/fix/pcr-basefee
Look at block base fee for PCR
2020-10-22 15:32:01 +02:00
Łukasz Magiera 93227bfd4d Merge pull request #4302 from filecoin-project/feat/import-bench-ds-measure
add measure datastore wrapper around bench chain datastore
2020-10-22 15:16:31 +02:00
Łukasz Magiera 0832d5a7d5 bench: Fix lint warnings 2020-10-22 15:00:31 +02:00
whyrusleeping 602d2b8ad5 record datastore metrics after successful run 2020-10-22 14:57:06 +02:00
Jakub Sztandera 0341944350 Inject prometheus
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-22 14:57:05 +02:00
whyrusleeping 00d1e6b549 add measure datastore wrapper around bench chain datastore 2020-10-22 14:57:04 +02:00
Łukasz Magiera 9c17ac5bde Merge branch 'hunjixin-hunjixin/feat/batchmsg' into master 2020-10-22 14:46:23 +02:00
Łukasz Magiera 90ce1c018e docsgen 2020-10-22 14:46:10 +02:00
Łukasz Magiera 618fed75fe Merge branch 'hunjixin/feat/batchmsg' of github.com:hunjixin/lotus into hunjixin-hunjixin/feat/batchmsg 2020-10-22 14:45:33 +02:00
Łukasz Magiera ef9eea470c Merge branch 'animesh2049-animesh2049/status-api' into master 2020-10-22 14:16:15 +02:00
Łukasz Magiera 9d9da1a3e8 docsgen 2020-10-22 14:15:11 +02:00
Łukasz Magiera 7c16f2182c Merge branch 'animesh2049/status-api' of github.com:animesh2049/lotus into animesh2049-animesh2049/status-api 2020-10-22 14:14:50 +02:00
Will Scott 9dc9bf5eb0 go mod tidy 2020-10-21 19:49:38 -07:00
Will Scott 035a762358 update drand to v1.2.1
* stop autowatching
* set user-agent
2020-10-21 16:49:59 -07:00
jennijuju 7f98be2920 Delete wallet from local wallet cache 2020-10-21 17:53:26 -04:00
Ingar Shu 7bdc7aa527 Add a market WithdrawBalance CLI 2020-10-21 14:09:39 -07:00
Jakub Sztandera 5c9c08ef85 heaviestTipSet reurning nil is a ok
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-21 22:16:01 +02:00
Steven Allen 5e23933757 fix import of v0 for test
We're still on actors v0 in this test.
2020-10-21 12:18:38 -07:00
Steven Allen 9d15a08d27 correctly mark new actors as "important" 2020-10-21 12:18:38 -07:00
Steven Allen 0c2ec04c09 use upgrade schedule from node when getting the network name
It doesn't matter now, but may in the future.
2020-10-21 12:18:38 -07:00
Steven Allen 30bda0b4c4 set network name everywhere 2020-10-21 12:18:38 -07:00
Steven Allen 710ac9d544 use the correct network version in genesis
1. Version 0 upgrades happen _after_ genesis.
2. Get rid of UseNewestNetwork. It's not useful and quite dangerous.
2020-10-21 12:18:38 -07:00
Steven Allen bcabe7b3b5 migrate methods to abstracted methods
Method numbers never change anyways. At worst, we'll deprecate old methods and
have to explicitly import them from the correct actors version to use them.
2020-10-21 12:18:37 -07:00
Steven Allen 4e730b5ec8 port to v2 imports 2020-10-21 12:16:23 -07:00
Jakub Sztandera f0d966a595 Fix lotus-shed ledger list
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-21 19:40:51 +02:00
Łukasz Magiera 8cad245f80 Merge pull request #4512 from filecoin-project/feat/disable-bloom
Disable blockstore bloom filter
2020-10-21 17:27:33 +02:00
lanzafame 7cbd4d49c3 gofmt 2020-10-21 18:39:57 +10:00
lanzafame 7a33d5bb34 register all apis with metric wrapper 2020-10-21 18:37:50 +10:00
lanzafame 3e767ca5c8 wrap api in metrics proxy 2020-10-21 18:27:13 +10:00
Łukasz Magiera c767399fc6 Merge pull request #4504 from filecoin-project/feat/clientdeal-miner-picker
Miner finder for interactive client deal CLI
2020-10-21 05:46:07 +02:00
Jakub Sztandera 3a46c15c4a Disable blockstore bloom filter
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-21 04:22:49 +02:00
Steven Allen 00dcb1bce9 Manage sectors by size instead of proof type.
* We may have multiple sectors with the same size and different proof types, but all these management functions stay the same.
* This simplifies PoSt logic.
2020-10-20 18:30:56 -07:00
Aayush Rajasekaran 420ec18c5b Merge pull request #4509 from filecoin-project/asr/changelog
Lotus version 1.1.0
2020-10-20 18:35:12 -04:00
Aayush Rajasekaran d78dd42ed4 Lotus version 1.1.0 2020-10-20 18:30:41 -04:00
Aayush Rajasekaran 547c01f5ff Merge pull request #4506 from filecoin-project/release/1.1.0
Introduce Network version 6
2020-10-20 18:29:49 -04:00
Aayush Rajasekaran 75eb644108 Merge pull request #4507 from filecoin-project/lotus-shed-terminate-1475
Add a terminate sectors command to lotus-shed
2020-10-20 18:28:09 -04:00
jennijuju ee5dcbc1d8 Add wait message 2020-10-20 18:26:17 -04:00
Aayush Rajasekaran 7f46ad19ac VM: Enforce a call depth limit 2020-10-20 18:19:50 -04:00
Jakub Sztandera 6530431995 MinerGetBaseInfo: if miner is not found in lookback, check current
If miner is found in current state, just return nil base info as miner
cannot mine if he is not found in the lookback.

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-20 23:54:35 +02:00
Steven Allen ed1645109a Add lotus storage miner API support to lotus-shed 2020-10-20 17:38:15 -04:00
jennijuju 277d3e9ab4 Add terminate sectors based on 1475's #4433 implementation in lotus-shed:
-  Moving the cmd to lotus-shed so that miners can use this right away without waiting for fsm changes.- Note: this should only be used when the miner is 100% sure that they want to terminate the sector on chain and they will be lose the power and pay a big one-time termination penalty for the sectors.
- Only live sectors can be terminated.
- To use, run `./lotus-shed sectors terminate --really-do-it=true sectorNum1 sectorNum2`.
- A message will be sent and after the message is landed on chain, miner can run `lotus-miner sectors status --on-chain-info <terminated sector number>`, and check Expiration Info at the bottom. Both `OnTime` and `Early` are 0 indicates the sector is terminated.
2020-10-20 17:38:09 -04:00
Aayush Rajasekaran 556f92a823 Update to actors v2.2.0 at PostLiftoff epoch 2020-10-20 17:23:35 -04:00
Aayush Rajasekaran ef32449309 Merge pull request #4505 from filecoin-project/feat/markets-1.0.0
Update markets v1.0.0
2020-10-20 17:22:57 -04:00
hannahhoward e08032da93 feat(markets): update markets v1.0.0 2020-10-20 13:56:13 -07:00
Łukasz Magiera dc40469cb3 Miner finder for interactive client deal CLI 2020-10-20 21:54:39 +02:00
whyrusleeping abc3e783ff bump lookback cap to 24 hours 2020-10-20 10:09:21 -07:00
whyrusleeping 6bc56c549a add some methods that oni needs 2020-10-20 10:04:51 -07:00
vyzo 580980d149 make push and addLocal atomic 2020-10-20 19:13:17 +03:00
Łukasz Magiera c779e4e8ee Merge pull request #4496 from filecoin-project/ci/address-flaky-tests
circle: Run tests for some subsystems separately
2020-10-20 14:18:54 +02:00
Łukasz Magiera ee0078f7c1 make: Drop npm calls from buildall 2020-10-20 13:48:32 +02:00
Łukasz Magiera da044d8b00 Merge pull request #4486 from filecoin-project/feat/better-sync-logs
add some extra logging to try and debug sync issues
2020-10-20 13:29:20 +02:00
Łukasz Magiera 09e92f98ff circle: Run tests for some subsystems separately 2020-10-20 13:11:53 +02:00
Łukasz Magiera 0dbf10ce69 Merge pull request #4491 from filecoin-project/one-liner
Add a comment to BlockMessages to address #4446.
2020-10-20 12:49:37 +02:00
jennijuju e7a68dba58 Add a comment to BlockMessages to address #4446. 2020-10-20 02:28:43 -04:00
whyrusleeping 608010c35d add some extra logging to try and debug sync issues 2020-10-19 19:09:49 -07:00
Aayush Rajasekaran 1c6ea75f4b Merge pull request #4456 from filecoin-project/asr/changelog
Lotus version 1.0.0
2020-10-19 20:12:21 -04:00
Aayush Rajasekaran 1ee9fb44e2 Lotus version 1.0.0 2020-10-19 20:09:35 -04:00
Łukasz Magiera 473afc41e7 Merge pull request #4481 from filecoin-project/feat/optim-state-cache
state: optimize state snapshot address cache
2020-10-20 02:03:37 +02:00
Jakub Sztandera a055540c25 Fix lint
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-20 01:32:51 +02:00
Jakub Sztandera cb0513f4c1 Add test
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-20 01:30:40 +02:00
Jakub Sztandera be42dd824b state: optimize state snapshot address cache
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-20 00:43:51 +02:00
Łukasz Magiera 06c0444d45 Merge pull request #4480 from filecoin-project/fix/max-piece-size-reverting-to-default
Don't overwrite previously-configured maxPieceSize for a persisted ask
2020-10-19 22:55:55 +02:00
Łukasz Magiera bae735447d Merge pull request #4477 from filecoin-project/asr/state-api-fix
Fix StateReplay to use provided tipset
2020-10-19 22:54:03 +02:00
Ingar Shu 1974490ab0 Don't overwrite previously-configured maxPieceSize for a persisted ask 2020-10-19 13:12:28 -07:00
Aayush Rajasekaran d24d3e420d Fix StateReplay to use provided tipset 2020-10-19 14:27:04 -04:00
Łukasz Magiera 869d71446d miner: fix init --create-worker-key 2020-10-19 16:08:46 +02: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 0f5aa9ba5c Merge pull request #4447 from filecoin-project/feat/mainnet-bootstrap-peers
replace bootstrap peers
2020-10-17 13:27:09 +02:00
Łukasz Magiera 68be28ca6d Add Session API 2020-10-17 12:53:42 +02:00
austinabell 70e2170e3e Fix circ supply default in conformance 2020-10-16 21:14:36 -04:00
Travis Person 4de8f50642 replace bootstrap peers 2020-10-16 19:13:33 +00:00
Łukasz Magiera 4a057d84b8 Merge pull request #4422 from filecoin-project/fix/message-list
fix message list api
2020-10-16 20:52:34 +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
Łukasz Magiera 111942b50b Merge pull request #4424 from filecoin-project/feat/retrieval-cli-deal-filter
Custom filters for retrieval deals
2020-10-16 18:41:40 +02:00
Łukasz Magiera 40e34b334a Merge pull request #4423 from filecoin-project/asr/shed-robust
Make audit balances capable of printing robust addresses
2020-10-16 17:52:10 +02:00
Łukasz Magiera 1a049a4f8e Merge pull request #4426 from filecoin-project/feat/lotus-gateway-spacegap
add endpoints needed by spacegap
2020-10-16 17:50:43 +02:00
Ingar Shu d0e4150cea Use separate config for Retrieval Filter 2020-10-16 08:30:55 -07:00
Aayush Rajasekaran 0775c6c9d5 Merge pull request #4429 from filecoin-project/asr/state-apis
Improve StateMsg APIs
2020-10-16 00:51:34 -04:00
Aayush Rajasekaran 2fd4a97698 Remove StateTransplant, modify StateReplay 2020-10-15 22:54:29 -04:00
Aayush Rajasekaran 89f46cb5cc Make ApplyRet's GasOutputs a pointer, return nil when unused 2020-10-15 21:20:53 -04:00
Aayush Rajasekaran 6f86b95f62 Remove StateMsgGasCost 2020-10-15 21:03:02 -04:00
whyrusleeping a71fbee2d1 bump lookback limit to 12 hours 2020-10-15 16:49:25 -07:00
Aayush Rajasekaran 99c07703f8 Add a new StateReplay CLI/API endpoint 2020-10-15 19:47:02 -04:00
whyrusleeping af1a422ddd statevminternal circ supply 2020-10-15 16:36:45 -07:00
whyrusleeping 8351420404 Add more endpoints for spacegap 2020-10-15 16:27:49 -07:00
Aayush Rajasekaran 7826cc0bab Rename StateReplay to StateTransplant 2020-10-15 19:14:53 -04:00
Aayush Rajasekaran cb801d47c7 Add GasCost to InvocResult 2020-10-15 18:48:51 -04:00
whyrusleeping 726eacbe03 add endpoints needed by spacegap 2020-10-15 13:54:58 -07:00
Whyrusleeping 17fcf30edd Merge pull request #4373 from filecoin-project/feat/gateway-wallet-verify
add WalletVerify to lotus-gateway
2020-10-15 15:42:38 -05:00
whyrusleeping eae7d62a2b docsgen 2020-10-15 12:07:41 -07:00
whyrusleeping 5bee85d57a incremental output for list-messages 2020-10-15 09:38:27 -07:00
Ingar Shu 0b7dc6971d Rebasing 2020-10-15 09:33:01 -07:00
Aayush Rajasekaran 8c7d2efe72 Make audit balances capable of printing robust addresses 2020-10-15 12:17:54 -04:00
whyrusleeping a931ff94e9 fix message list api 2020-10-15 08:54:36 -07:00
Łukasz Magiera c56ef260d5 Merge pull request #4421 from filecoin-project/fix/lite-msig-inspect
Ensure msig inspect cli works with lotus-lite
2020-10-15 15:11:34 +02:00
Łukasz Magiera 955d7f9c54 Merge pull request #4393 from filecoin-project/vectors/support-multiple-versions
conformance: support multiple protocol versions.
2020-10-15 14:29:23 +02:00
Raúl Kripalani 1fb9ed1c9a remove TODO. 2020-10-15 12:58:43 +01:00
Raúl Kripalani 7e6ede7563 update schema; test-vectors submodule. 2020-10-15 12:49:23 +01:00
Raúl Kripalani 4e659e30c5 fix lint errors. 2020-10-15 12:14:16 +01:00
Dirk McCormick f5d48b0e86 fix: lotus-gateway api tests 2020-10-15 12:47:24 +02:00
Dirk McCormick f74852bd73 test: add more msig cli tests 2020-10-15 12:45:02 +02:00
Dirk McCormick 9c99171cb8 fix: ensure msig inspect cli works with lotus-lite 2020-10-15 12:15:21 +02:00
Hector Sanjuan 925606ff26 Chore: update drand to v1.2.0 2020-10-15 12:02:12 +02:00
Łukasz Magiera 90d2a92a2d Merge pull request #4415 from filecoin-project/feat/use-build-seconds-delay
Use build.BlockDelaySecs for deal start buffer
2020-10-15 11:56:43 +02:00
Łukasz Magiera 2818353418 Merge pull request #4398 from filecoin-project/feat/improve-msig-ux
improve the UX of multisig approves
2020-10-15 11:54:12 +02:00
whyrusleeping ccc780f35a fix wrong index 2020-10-14 23:16:31 -07:00
whyrusleeping fdb115e369 add command to propose changing multisig threshold 2020-10-14 23:10:00 -07:00
whyrusleeping 3bd2e2f777 fix typo 2020-10-14 23:04:15 -07:00
whyrusleeping 6d771d29c7 improve the UX of multisig approves 2020-10-14 23:04:15 -07:00
hannahhoward b29e3b5242 feat(markets): use build.BlockDelaySecs for start buffer
instead of constant from spec-actors which uses hardcoded start epoch, use one that factors in
possibility of different block time
2020-10-14 21:28:36 -07:00
Łukasz Magiera 8340124786 Merge pull request #4411 from filecoin-project/fix/slow-mpool-stortup
mpool: Don't block node startup loading messages
2020-10-15 03:58:36 +02:00
Łukasz Magiera 8f98c7d960 Merge pull request #4410 from filecoin-project/steb/fix-codecov-ignore
Increase code coverage!
2020-10-15 03:37:06 +02:00
Łukasz Magiera 3fb5334959 mpool: Don't block node startup loading messages 2020-10-15 03:36:55 +02:00
Steven Allen a40fc98e56 fix code coverage ignore
It looks like we need to use globs.
2020-10-14 18:21:16 -07:00
Aayush Rajasekaran 8bb84acbc5 Merge pull request #4409 from filecoin-project/asr/changelog
Lotus version 0.10.2
2020-10-14 21:18:53 -04:00
Łukasz Magiera 22f49f8946 Merge pull request #4366 from zgfzgf/feat-applyblocks-map
optimize map use struct{}
2020-10-15 03:04:57 +02:00
Łukasz Magiera 1350079503 Merge pull request #4353 from zgfzgf/feat-compute-tipSet-state
optimize code use ts.Cids
2020-10-15 03:03:39 +02:00
Aayush Rajasekaran 251374eca7 Lotus version 0.10.2 2020-10-14 21:01:26 -04:00
Łukasz Magiera a50a5366b2 Merge pull request #4392 from filecoin-project/daviddias-patch-1
Update SECURITY.md
2020-10-15 02:58:52 +02:00
Łukasz Magiera 52800f5dca Merge pull request #4222 from filecoin-project/feat/increase-inclusion-premium
Change default gas premium to for 10 block inclusion
2020-10-15 02:57:12 +02:00
Łukasz Magiera 958f169267 Merge pull request #4408 from filecoin-project/feat/better-gas-defaults
Improve gas defaults
2020-10-15 02:54:07 +02:00
Jakub Sztandera df6f4a572c Change default gas premium to for 6 block inclusion
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-15 02:53:40 +02:00
Łukasz Magiera 698b49b7ef Improve gas defaults 2020-10-15 02:46:47 +02:00
Łukasz Magiera 7e5b1ac272 Merge pull request #4407 from filecoin-project/steb/fix-blockcache-test-flake
give the TimeCacheBS tests a bit more time
2020-10-15 02:06:11 +02:00
Steven Allen 86e30729bf give the TimeCacheBS tests a bit more time
Otherwise, they flake once in a while.
2020-10-14 16:51:26 -07:00
Łukasz Magiera 7ccb2aabf0 Merge pull request #4406 from filecoin-project/steb/reduce-garbage
reduce garbage in blockstore
2020-10-15 01:49:01 +02:00
Steven Allen 811f1304e6 test timed cache blockstore 2020-10-14 16:17:55 -07:00
Łukasz Magiera 6de82364e9 Merge pull request #4396 from filecoin-project/feat/syncwait-watch
sync wait --watch
2020-10-15 00:14:02 +02:00
Łukasz Magiera d02d4bc275 Merge pull request #4403 from filecoin-project/frrist/fix-miner-shim-impls
fix: return true when deadlines changed
2020-10-15 00:13:36 +02:00
Łukasz Magiera 39670df6af Merge pull request #4125 from filecoin-project/feat/drand-cloudflare
Update drand endpoints
2020-10-15 00:01:06 +02:00
frrist 28823fb8e9 fix: bad indirection of deadline diffing 2020-10-14 14:50:59 -07:00
Steven Allen ddade32bd3 write bitswap blocks into a temporary, in-memory block cache
If they end up validating, we'll write them back to the underlying blockstore.
Otherwise, there's no reason to keep them.
2020-10-14 14:43:58 -07:00
Steven Allen 15fe998c68 add an timed-cache blockstore
This blockstore lets us write to a temporary scratch location where blocks older
than the specified cache time are automatically cleared.
2020-10-14 14:43:58 -07:00
Steven Allen 4b38809c0b in-memory blockstore
Instead of using an in-memory datastore and dealing with the overhead of
computing datastore keys, creating new blocks, etc, use an in-memory blockstore.
2020-10-14 14:43:58 -07:00
Steven Allen e2fbbdcb15 reject messages with invalid CIDs
These can't possibly be valid messages, so we should just drop the block.
2020-10-14 14:43:58 -07:00
Steven Allen bbc6de94fc write messages to a temp blockstore when validating 2020-10-14 14:43:52 -07:00
frrist ea1349205b fix: return true when partitions changed 2020-10-14 14:37:33 -07:00
frrist 470a565c34 fix: return true when deadlines changed 2020-10-14 14:27:35 -07:00
Łukasz Magiera 04bbeface6 Merge pull request #4402 from filecoin-project/feat/upgrade-markets-v0.9.1
Update to 0.9.1 bugfix release
2020-10-14 23:22:17 +02:00
hannahhoward 8df58064e3 feat(markets): update to 0.9.1 bugfix release 2020-10-14 13:20:18 -07:00
Łukasz Magiera 01de4cb2ec Merge pull request #4397 from filecoin-project/revert-4391-feat/https-api
Revert "Add support for /https, /http, /wss API multiaddresses."
2020-10-14 19:56:52 +02:00
Łukasz Magiera b060569fe9 Revert "Add support for /https, /http, /wss API multiaddresses." 2020-10-14 19:55:36 +02:00
Whyrusleeping dfd6fbfaa4 Merge pull request #4311 from filecoin-project/feat/msig-remove-cmd
Add propose remove
2020-10-14 11:36:55 -05:00
Łukasz Magiera d3d304bfd7 Merge pull request #4391 from filecoin-project/feat/https-api
Add support for /https, /http, /wss API multiaddresses.
2020-10-14 18:22:29 +02:00
Łukasz Magiera ab4f051b83 sync wait --watch 2020-10-14 18:17:18 +02:00
Anton Evangelatov 881e37ec02 upgrade go-sdk (#274) 2020-10-14 16:51:07 +02:00
Whyrusleepinganddirkmc 12f36c5bda Update cmd/lotus-gateway/api.go
Co-authored-by: dirkmc <dirkmdev@gmail.com>
2020-10-14 09:22:25 -05:00
Anton Evangelatov 194c9d6e07 upgrade go-sdk (#273) 2020-10-14 15:46:06 +02:00
Raúl Kripalani 45cd510da1 conformance: support multiple protocol versions.
This PR introduces support for running multiple variants of a vector,
each of which targets a unique protocol version.

tvx tooling has been adapted to produce and parse the new version
of the schema.
2020-10-14 14:39:43 +01:00
David Dias 00a5083146 Update SECURITY.md 2020-10-14 15:11:30 +02:00
Hector Sanjuan c6ed6a0d65 Add support for /https, /http, /wss API multiaddresses.
Lotus API endpoint are by default expressed as multiaddresses (i.e. lotus auth
api-info) which end in /http, although they can be provided as standard URLs too.

There is an inconsistency here because despite the "http" part, Lotus will use "ws" protocol.

This lets lotus default to "ws" but honor whatever the user puts in the multiaddress (i.e.
/dns4/my.lotus.node/tcp/443/https) would work now using https, where before it uses "ws".
2020-10-14 14:58:58 +02:00
Łukasz Magiera 4ad8d85b13 Merge pull request #4278 from filecoin-project/tvx/trace-puts
tvx: trace puts to blockstore for inclusion in CAR.
2020-10-14 12:08:06 +02:00
Łukasz Magiera 465703b618 Merge pull request #4384 from filecoin-project/feat/4220
Use updated stored ask API
2020-10-14 12:03:07 +02:00
Aarsh Shah 30dd5d9644 use updated stored ask api 2020-10-14 11:39:57 +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
Aayush Rajasekaran 41bfeb56e2 Merge pull request #4386 from filecoin-project/asr/changelog
Lotus version 0.10.1
2020-10-14 02:34:18 -04:00
Aayush Rajasekaran 2e7cd024df Lotus version 0.10.1 2020-10-14 02:22:02 -04:00
Aayush Rajasekaran bf619862c3 Merge pull request #4382 from filecoin-project/asr/invoc-result
Add message CID to InvocResult
2020-10-14 02:06:09 -04:00
Aayush Rajasekaran 29e54c40be Merge pull request #4363 from filecoin-project/feat/update-markets-0.9.0
feat(markets): update markets 0.9.0 and add data transfer restart com…
2020-10-14 01:38:05 -04:00
Aayush Rajasekaran 308144ee6a Merge pull request #4350 from filecoin-project/asr/improve-fork
Avoid having the same message CID show up in execution traces
2020-10-14 01:22:16 -04:00
Aayush Rajasekaran ce54110228 Add message CID to InvocResult 2020-10-14 00:06:22 -04:00
Aayush Rajasekaran 458ea277fc Aggregate irregular state transitions into a single EexcutionTrace 2020-10-13 22:59:42 -04:00
hannahhoward 58662b79b3 fix(deps): use tagged go-fil-markets 0.9.0 2020-10-13 19:50:13 -07:00
Aayush Rajasekaran 7dbc8965be Apply nonces to implicit messages 2020-10-13 22:06:06 -04:00
Aayush Rajasekaran 2426700821 Don't transfer zero FIL during rebalancing fork 2020-10-13 22:06:06 -04:00
zgfzgf 51aca86e98 optimize mining code 2020-10-14 08:44:42 +08:00
Łukasz Magiera 9c6ee802cc Merge pull request #4376 from filecoin-project/steb/fix-load-panic
fix a panic on startup when we fail to load the tipset
2020-10-14 01:02:01 +02:00
Steven Allen b61281ba4b fix a panic on startup when we fail to load the tipset
There may be a deeper issue here, but we need to handle this more gracefully
somehow. See #4358.
2020-10-13 15:06:47 -07:00
whyrusleeping 3d80c38064 support stateReadState in gateway 2020-10-13 14:23:08 -07:00
whyrusleeping 98c1aa7988 add WalletVerify to lotus-gateway 2020-10-13 13:31:20 -07:00
Łukasz Magiera d5cea9f402 Merge pull request #4367 from filecoin-project/fix/msg-search-off-by-one
Fix off by one tipset in searchBackForMsg
2020-10-13 22:11:24 +02: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
Jakub Sztandera ce548c8f95 Add test
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-13 20:02:43 +02:00
Jakub Sztandera 8987defb9d Fix BLS message ChainLength add more detail to ValidForBlockInclusion
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-13 20:02:42 +02: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
Łukasz Magiera 1a70dbe37d Merge pull request #4347 from filecoin-project/fix/sync/message-validation-state-height
fix(sync state): set state height to actual tipset height
2020-10-13 17:55:51 +02:00
Jakub Sztandera 87cd8c6725 Fix off by one tipset in searchBackForMsg
This way we will return the tipset the message was executed in

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-13 17:48:54 +02:00
zgfzgf 1eb2d0ae50 optimize map use struct{} 2020-10-13 22:34:07 +08:00
Jakub Sztandera 5fd0bf11ba Merge pull request #4338 from filecoin-project/feat/message-json-cids
types: Add CID fields to messages in json marshalers
2020-10-13 14:59:22 +02:00
hannahhoward 4edebcec2b feat(markets): update markets 0.9.0 and add data transfer restart command 2020-10-13 03:41:08 -07: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 07d0b67628 optimize code use ts.Cids 2020-10-13 10:46:41 +08:00
Lucas Molas 9b4cac9612 fix(sync state): set state height to actual tipset height 2020-10-12 21:14:16 -03:00
Travis Person 8232cc8415 Merge pull request #4341 from filecoin-project/fix/lotus-pcr-skip-non-processes
lotus-pcr: ignore all other market messages
2020-10-12 16:07:57 -07:00
Travis Person be74a13736 lotus-pcr: ignore all other market messages 2020-10-12 21:41:48 +00:00
Aayush Rajasekaran 195d96ccc0 Merge pull request #4148 from filecoin-project/asr/circ-supply
Add a StateExactCirculatingSupply command
2020-10-12 17:02:07 -04:00
Ingar Shu 49155ace62 Use seal-duration in calculating the earliest StartEpoch that we will consider (#4337) 2020-10-12 17:45:37 -03:00
Aayush Rajasekaran 83624a8858 Rename StateVMCirculatingSupply to StateVMCirculatingSupplyInternal 2020-10-12 16:41:27 -04:00
Aayush Rajasekaran 96e1dfd8d7 Add an endpoint for precise circulating supply 2020-10-12 16:38:29 -04:00
Łukasz Magiera 61661fb1f0 docsgen 2020-10-12 20:47:09 +02:00
Łukasz Magiera 6c08120628 types: Add CID fields to messages in json marshalers 2020-10-12 20:46:47 +02:00
Łukasz Magiera 8d769f0c07 Merge pull request #4336 from filecoin-project/steb/params-mainnet
Rename params_testnet to params_mainnet
2020-10-12 20:18:23 +02:00
Steven Allen 79c5d2c6d2 Rename params_testnet to params_mainnet 2020-10-12 11:04:46 -07:00
Łukasz Magiera 224a96431f Merge pull request #4319 from filecoin-project/asr/repay-debt-cli
Add a CLI tool for miner's to repay debt
2020-10-12 19:24:40 +02:00
Hector Sanjuan 8001ed3030 Drand: add cloudflare. Use HTTP for PL nodes.
Adding Cloudflare ensures additional redundancy.

Switching to HTTP for PL nodes reduces latency and cost. Randomness is
verified after being received.
2020-10-12 19:15:56 +02:00
Łukasz Magiera 2855c2bc49 Merge pull request #4329 from shaodan/ux-workers-cores
Improve the UX for `lotus-miner sealing workers`
2020-10-12 16:45:26 +02:00
Łukasz Magiera 65883cbb6b Merge pull request #4290 from filecoin-project/feat/ledger-integration
adding in ledger support
2020-10-12 15:09:27 +02:00
zgfzgf b7726c4ca8 optimize walkSnapshot recurseLinks 2020-10-12 16:44:39 +08:00
Steven Allen 443131b214 Merge pull request #4328 from filecoin-project/steb/test-tape-upgrade
Test the tape upgrade
2020-10-12 00:27:18 -07:00
Łukasz Magiera 8b648cf77c ledger: Close device in WalletNew 2020-10-12 09:21:42 +02:00
Dan Shao c0961fb63d Improve the UX for lotus-miner sealing workers: add total number of cores 2020-10-12 15:07:56 +08:00
Steven Allen dc4e73c737 Test the tape upgrade 2020-10-12 00:01:25 -07:00
Aayush Rajasekaran a6b2180756 Merge pull request #4323 from filecoin-project/asr/changelog
Lotus version 0.10.0
2020-10-12 02:27:55 -04:00
Aayush Rajasekaran 160f209f6a Lotus version 0.10.0 2020-10-12 02:14:36 -04:00
Aayush Rajasekaran a9d8bc7c45 Merge pull request #4322 from filecoin-project/steb/tape-upgrade
implement tape upgrade
2020-10-12 02:14:13 -04:00
Steven Allen 92177b5738 implement tape upgrade
Upgrade to specs-actors v2.1 and network version 5. This fixes the bug where
prove commits were not accepted.
2020-10-12 02:00:27 -04:00
Łukasz Magiera 4ac2bee81c Update oni 2020-10-12 06:34:45 +02:00
Łukasz Magiera a2e0832a12 Fix lint 2020-10-12 06:17:00 +02:00
Łukasz Magiera 8fd9b5f235 Merge pull request #4315 from filecoin-project/feat/stats-ops
lotus-stats: optmize getting miner power
2020-10-12 06:01:52 +02:00
Jakub Sztandera a95e343dee Merge pull request #4321 from filecoin-project/feat/love
Chain is love
2020-10-12 05:44:34 +02:00
Steven Allen c296e1bbca use actor abstraction in metrics command 2020-10-11 20:31:20 -07:00
Jakub Sztandera ae366972a9 Chain is love
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 05:11:04 +02:00
Aayush Rajasekaran b4215e5f46 Add a CLI tool for miner's to repay debt 2020-10-11 19:57:30 -04:00
Jakub Sztandera df7ee610cd Re-enable repub
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 01:29:19 +02:00
Jakub Sztandera fda8b932ba Ask for confirmation when creating a key
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 01:27:15 +02:00
Aayush Rajasekaran bae3b7d594 add a shed util to determine % of power that has won a block 2020-10-11 19:05:54 -04:00
Jakub Sztandera 7b4a5fc7ca Fixup off by one
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:50:29 +02:00
Jakub Sztandera d6c8276c7a Add support for WalletNew to ledger
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:48:23 +02:00
Jakub Sztandera 2b21fdef33 Refactor from crypto.SigType to types.KeyType
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:53 +02:00
Łukasz Magiera 6a232e7214 Basic multi-wallet support
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:41 +02:00
Jakub Sztandera 7ee6bafd23 Fix lint warn
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:41 +02:00
Jakub Sztandera 753d7b71a9 Fix hardened path printing, show 20 addresses after empty
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:40 +02:00
Łukasz Magiera bb6a354b62 chain cli: decode params command
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:40 +02:00
Łukasz Magiera 8ae66d6c6a Fix lint warnings
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:40 +02:00
Łukasz Magiera 2c92157233 shed ledger: Some UX improvements
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:40 +02:00
Łukasz Magiera 66d6113340 ledgerwallet: Validate signing bytes
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:40 +02:00
Łukasz Magiera 99791a6953 lotus-wallet: ledger flag
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:40 +02:00
whyrusleeping b35f9b56b4 WIP: adding in ledger support
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-12 00:07:40 +02:00
Travis Person 23470bc38f lotus-stats: optmize getting miner power 2020-10-11 20:27:36 +00:00
Jakub Sztandera a36ec27230 Look at block base fee
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-11 21:14:51 +02:00
Whyrusleeping 40b2e2d0c1 Merge pull request #4312 from filecoin-project/feat/msig-inspect-decode
decode parameters for multisig transactions in inspect
2020-10-11 11:51:32 -05:00
Jakub Sztandera 85be11fb75 Add propose remove
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-11 18:10:02 +02: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
Łukasz Magiera 00620aac57 Merge pull request #4296 from filecoin-project/feat/sync-unmarkbad-all
sync unmark-bad --all
2020-10-10 22:35:56 +02:00
Łukasz Magiera 32d95fc97a docsgen, gofmt 2020-10-10 20:46:06 +02:00
Łukasz Magiera a491fc97b9 Merge pull request #4301 from filecoin-project/steb/fix-two-races
Fix two races
2020-10-10 20:37:13 +02:00
Łukasz Magiera 151577f04e Merge pull request #4287 from filecoin-project/feat/flush_validation_cache_on_chain_import
Dump the block validation cache whenever we perform an import
2020-10-10 20:33:17 +02:00
Steven Allen c463582528 fix a race and optimize hello messages
LifecycleCtx can _only_ be called during startup as it appends an fx hook.
Worse, this was causing us to append an fx hook on every single hello message,
leaking memory (and probably causing other shutdown issues...).
2020-10-10 08:33:06 -07:00
Steven Allen 7245ac2b69 fix a race in the sync manager
1. SyncerState contains a mutex and should never be copied. Honestly, this case
was probably fine but it's just as easy to create a separate snapshot type and
easier to reason about.

2. We need to initialize the syncStates array once at start, before accessing
it. By each syncer state inside each worker, we were racing with calls to
`State()`. Again, this was probably benign, but I don't trust optimizing
compilers.
2020-10-10 08:31:04 -07:00
Łukasz Magiera 58f13a7d5a Merge pull request #4299 from filecoin-project/fix/wallet-export-panic
Fix panic in wallet export when key is not found
2020-10-10 16:25:40 +02:00
Peter Rabbitson e7d3b2503e Merge tag 'v0.9.1' 2020-10-10 15:54:51 +02:00
Łukasz Magiera ee8b8b8174 Merge pull request #4298 from filecoin-project/fix/cli-stderr-errors
cli: Don't output errors to stdout
2020-10-10 15:52:43 +02:00
Łukasz Magiera 4fa6afad13 Fix panic in wallet export when key is not found 2020-10-10 15:44:22 +02:00
Łukasz Magiera a80e98dc05 cli: Don't output errors to stdout 2020-10-10 15:38:14 +02:00
Peter Rabbitson 23f5a99117 Add comment clarifying current codepath 2020-10-10 15:36:32 +02:00
Łukasz Magiera 651522cbaa Merge pull request #4274 from filecoin-project/feat/msig-remove-api
add an api for removing multisig signers
2020-10-10 12:56:07 +02:00
Łukasz Magiera 388c9afce0 docsgen 2020-10-10 12:28:59 +02:00
Łukasz Magiera 9a26896c69 Merge pull request #4282 from filecoin-project/steb/fix-tipset-cache-race
fix a race in tipset cache usage
2020-10-10 12:27:15 +02:00
Łukasz Magiera 2db8b7efa7 Merge pull request #4291 from filecoin-project/steb/node-test-races
make pledge test pass with the race detector
2020-10-10 11:54:25 +02:00
Łukasz Magiera 18e58467f8 sync unmark-bad --all 2020-10-10 10:26:42 +02:00
Łukasz Magiera 1401efb115 Merge pull request #4294 from filecoin-project/feat/v0.9.1
Bump the version to 0.9.1
2020-10-10 09:15:04 +02:00
Łukasz Magiera f417d39a08 Bump the version to 0.9.1 2020-10-10 09:13:52 +02:00
Łukasz Magiera 11e35cf911 Merge pull request #4293 from filecoin-project/steb/actors-fixes
upgrade specs-actors
2020-10-10 08:53:20 +02:00
Steven Allen 10d464a1eb upgrade to specs-actors v2.0.3 2020-10-09 21:52:01 -07:00
Steven Allen d84f5dabab remove upgrade invariant checks
These checks may be _too_ strict and could cause the upgrade to fail unnecessarily.
2020-10-09 21:51:58 -07:00
Steven Allen f3abd1ae82 make pledge test pass with the race detector 2020-10-09 20:32:09 -07:00
Peter Rabbitson 85abca4b16 Delint 2020-10-10 04:00:12 +02:00
Peter Rabbitson 6610a247cf Dump the block validation cache whenever we perform an import
This solves a problem with folks resurrecting long-out-of-sync nodes via
snapshot imports.

The interface switch to Batching is necessary: startup is too long otherwise
( 8 minutes just to clear everything on a relatively old node )
2020-10-10 03:41:04 +02:00
Łukasz Magiera a6d9b302fa Merge pull request #3583 from filecoin-project/feat/signing-backends
Remote wallet backends
2020-10-10 02:58:02 +02:00
Steven Allen f32b3bf99b fix a race in tipset cache usage
This tipset cache is shared between multiple services and is called from
multiple places.
2020-10-09 17:32:45 -07:00
Łukasz Magiera 114a1aaffd Merge pull request #4281 from filecoin-project/steb/seal-race
fix race in unseal
2020-10-10 02:23:02 +02:00
Łukasz Magiera 83ba7ec8cc Merge pull request #4280 from filecoin-project/fix/market-deal-race
fix a race when retrieving pieces
2020-10-10 02:15:47 +02:00
Steven Allen 83dfc460d4 fix race in unseal
1. Remove an invalid error check.
2. Make sure to shadow the outer error type from within the goroutine instead or
reading the outer type.

This may have been causing test issues (caught in TestMinerAllInfo with the race
detector).
2020-10-09 15:39:41 -07:00
Steven Allen 283fd054e8 fix a race when retrieving pieces
We'd read the deal ID without synchronizing. This could (and probably did given
the history of flaky deal tests) cause us to miss events.

This patch also makes sure to always unsubscribe from events, even on error.
2020-10-09 15:35:44 -07:00
Łukasz Magiera 09bff14d85 Merge pull request #4269 from filecoin-project/steb/simplify-sync
simplify message syncing logic
2020-10-10 00:00:26 +02:00
Łukasz Magiera 3cb1abba4f Merge pull request #4276 from filecoin-project/steb/fix-bad-error
return the correct err from iterFullTipset
2020-10-09 23:26:54 +02:00
Raúl Kripalani e0dcb0ec49 tvx: trace puts to blockstore for inclusion in CAR. 2020-10-09 22:20:15 +01:00
Łukasz Magiera d4c92942e7 Merge pull request #4275 from filecoin-project/steb/unshare-journal
unshare the journal
2020-10-09 23:16:27 +02:00
Aayush Rajasekaran f773ab4b28 Correct docs 2020-10-09 17:14:21 -04:00
Steven Allen c0182f8301 return the correct err from iterFullTipset 2020-10-09 13:59:56 -07:00
Łukasz Magiera c06f394b81 Merge pull request #4273 from filecoin-project/fix/fundsmgr-incorrect-cached-value
Revert cached "available" amount if the AddFunds message send fails
2020-10-09 22:52:40 +02:00
Steven Allen 748d2e82a7 unshare the journal
Motivation:

* Run lotus with the race detector enabled (primary motivation).
* Allow multiple lotus nodes in a process (not a high priority).

Previously, the journal was shared between all lotus instances, but it was
initialized for every new node. This caused safety problems in tests (at a
minimum).

This patch explicitly passes the journal to all services that need it.
2020-10-09 13:23:07 -07:00
Steven Allen a5c78371fd Merge pull request #4270 from filecoin-project/steb/test-fix-paychstatus-race
fix a race in the payment channel status test
2020-10-09 13:22:16 -07:00
Ingar Shu d80e7eda93 Revert cached "available" amount if the AddFunds message send fails 2020-10-09 13:18:43 -07:00
Steven Allen 9f9d5cb2a5 fix a race in the payment channel status test
We should not be clobbering the cmd variable.
2020-10-09 11:50:16 -07:00
Łukasz Magiera fdaa9c14ad Merge remote-tracking branch 'origin/master' into feat/signing-backends 2020-10-09 20:36:51 +02:00
Łukasz Magiera 9d8932d395 Merge pull request #4268 from iand/fix/rewardv2-cumsumrealized
fix: spec actors 2 reward shim uses correct field for CumsumRealized
2020-10-09 20:32:14 +02:00
Steven Allen 105aa40007 simplify message syncing logic
1. Allow duplicate blocks from bitswap. This shouldn't happen, but there's no
reason to bail (just log loudly).
2. Simplify logic to very explicitly check to make sure we're fetching every
block.
2020-10-09 11:06:49 -07:00
Łukasz Magiera 110f033c83 Merge pull request #4095 from filecoin-project/feat/daemon-lite
lotus-lite: replace wallet / msig calls with thin client to gateway
2020-10-09 19:22:43 +02:00
Ian Davis f87d325b6f fix: spec actors 2 reward shim uses correct field for CumsumRealized 2020-10-09 17:48:20 +01:00
Łukasz Magiera ab8286fa38 Fix docsgen, lotus-soup build 2020-10-09 18:43:22 +02:00
whyrusleeping 4cca3f19a3 add an api for removing multisig signers 2020-10-09 09:40:25 -07:00
Łukasz Magiera feb4b3c8b4 Merge remote-tracking branch 'origin/master' into feat/signing-backends 2020-10-09 15:51:25 +02:00
Dirk McCormick 7f7c9e978f feat: hide lite mode flag 2020-10-09 11:56:25 +02:00
Dirk McCormick 200a95f824 refactor: unify test builder full node options 2020-10-09 11:56:25 +02:00
Dirk McCormick d69e4c7cf2 refactor: lite-mode - simplify organization of dep injection 2020-10-09 11:54:42 +02:00
Dirk McCormick b2834baa4b feat: add msig available balance and vested to lite mode 2020-10-09 11:51:20 +02:00
Dirk McCormick e9e27cbbb0 feat: put gateway in middle of end-to-end test for lite mode 2020-10-09 11:48:35 +02:00
Dirk McCormick ef73b964fb feat: add end-to-end test for lite mode 2020-10-09 11:48:35 +02:00
Dirk McCormick 7b1bec91ed feat: add tests for gateway ChainGetTipsetByHeight 2020-10-09 11:45:16 +02:00
Dirk McCormick b32d25c562 feat: add RPC for GasEstimateMessageGas 2020-10-09 11:45:16 +02:00
Dirk McCormick 767611247c feat: add RPC for StateWaitMsg 2020-10-09 11:45:16 +02:00
Dirk McCormick be09a8a00a feat: lite-mode - check that gateway API implements required chain, mpool, state methods 2020-10-09 11:43:03 +02:00
Dirk McCormick 2719adc1b1 feat: lite-mode - thin client for chan & state 2020-10-09 11:43:03 +02:00
Dirk McCormick f1b1d8cec6 fix: MpoolAPI DI 2020-10-09 11:43:03 +02:00
Dirk McCormick 8fa4c0a970 feat: gateway - MpoolPush 2020-10-09 11:43:03 +02:00
Dirk McCormick 00a14de094 feat: gateway - StateLookupID 2020-10-09 11:43:03 +02:00
Dirk McCormick eec13ff8dc refactor: daemon - simplify gateway cleanup 2020-10-09 11:43:03 +02:00
Dirk McCormick 1ffdd7d5b3 fix: gateway - remove tracing (JsonRPC automatically traces all calls) 2020-10-09 11:43:03 +02:00
Dirk McCormick e19cd9ed01 feat: lotus-lite - replace wallet StateManager with thin client to gateway 2020-10-09 11:43:03 +02:00
Łukasz Magiera bacac245c7 Merge pull request #4256 from filecoin-project/steb/call-stop
cleanup tests on finish
2020-10-09 10:20:33 +02:00
Łukasz Magiera e1792ffe4d Merge pull request #4260 from filecoin-project/asr/wallet-abstract
Fix deletion of addresses from wallet
2020-10-09 09:55:25 +02:00
Aayush Rajasekaran 9c35762966 Fix deletion of addresses from wallet 2020-10-09 03:26:51 -04:00
Animesh 4832cad1f1 sanity fix 2020-10-09 10:18:32 +05:30
Animesh 5930bf6d93 minor fix 2020-10-09 10:00:53 +05:30
Animesh d37389162e Add docs 2020-10-09 09:55:38 +05:30
Łukasz Magiera 356137439f apistruct: Drop unused WalletSignMessage 2020-10-09 03:12:33 +02:00
Łukasz Magiera 6cc7559b04 Fix APIInfo import cycle in tests 2020-10-09 02:58:12 +02:00
Łukasz Magiera 3cd53ad9d9 Use APIInfo parser for RemoteBacked wallet config 2020-10-09 02:21:37 +02:00
Łukasz Magiera 6c54d2445d Appease the linter 2020-10-09 01:53:12 +02:00
Łukasz Magiera 6a10af626c Nicer message logging in lotus-wallet 2020-10-09 01:50:46 +02:00
Łukasz Magiera 597d065e05 Update go-jsonrpc with http(s) client support 2020-10-09 01:39:06 +02:00
Łukasz Magiera 791aa5c6c8 Add lotus-wallet to Makefile 2020-10-09 01:37:17 +02:00
Steven Allen 82b15d2637 cleanup tests on finish 2020-10-08 16:36:02 -07:00
Łukasz Magiera 7d2f06cfbd Fix WalletSign in tests 2020-10-09 01:34:48 +02:00
Łukasz Magiera 6e8efb9d2c gofmt 2020-10-09 01:27:49 +02:00
Łukasz Magiera f3dc730b05 wallet: Add metadata to WalletAPI.WalletSign 2020-10-09 01:27:38 +02:00
Łukasz Magiera 114776f2c5 wallet: Drop WalletSignMessage from WalletAPI 2020-10-09 01:04:59 +02:00
Łukasz Magiera 4835109470 wallet: Post-merge fixes 2020-10-09 00:51:04 +02:00
Łukasz Magiera 8783c7434e Merge remote-tracking branch 'origin/master' into feat/signing-backends 2020-10-09 00:50:41 +02:00
Łukasz Magiera 2d3b61675b Merge pull request #3444 from IPFSMain-Official/fix-GetBestMiningCandidate-bug
fix GetBestMiningCandidate bug
2020-10-08 23:55:19 +02:00
刘林欣 a23ab123d7 fix GetBestMiningCandidate bug
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-08 23:39:33 +02:00
Łukasz Magiera 26ed6af040 Merge pull request #4227 from filecoin-project/par-upper-bounds
Increase the message fee cap upper bounds in PCR.
2020-10-08 23:34:32 +02:00
Łukasz Magiera 82bd7bd2ec Merge pull request #4224 from filecoin-project/fix/repub-journal
Fix Messages field in MessagePoolEvtMessage journal entry
2020-10-08 23:33:57 +02:00
Łukasz Magiera cd0a43b7f4 Merge pull request #4253 from filecoin-project/fix/syncwait-applied-offset
sync wait: Handle processed message offset
2020-10-08 23:30:55 +02:00
Łukasz Magiera b14632b750 Merge pull request #4250 from filecoin-project/asr/vesting-params-api
Add some new endpoints for querying Msig info
2020-10-08 23:25:23 +02:00
Łukasz Magiera ebcf77e830 Merge pull request #4254 from filecoin-project/feat/update-markets-0.7.1
Update markets v0.7.1
2020-10-08 23:24:08 +02:00
Łukasz Magiera 344d30e960 Merge pull request #4252 from filecoin-project/devnet-jennijuju
Update address prefix in client cli.
2020-10-08 23:23:40 +02:00
Łukasz Magiera efb13a0d9b Merge pull request #4246 from filecoin-project/feat/optim-search-msg
Optimize SearchForMessage and GetReceipt
2020-10-08 23:22:49 +02:00
Łukasz Magiera 0223582d41 sync wait: Handle processed message offset 2020-10-08 23:14:12 +02:00
Jakub Sztandera 973f61bc10 Optimize chain and message sync
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-08 23:10:07 +02:00
Jakub Sztandera 60768f4863 Optimize SearchForMessage and GetReceipt
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-08 23:10:06 +02:00
hannahhoward c60d13ee56 feat(markets): update markets v0.7.1 2020-10-08 13:52:39 -07:00
jennijuju 0f8fc119f3 Update address prefix in client cli. 2020-10-08 16:45:24 -04:00
Łukasz Magiera e4d2e6e01d Merge pull request #4249 from filecoin-project/feat/ux-enhancements
Feat/ux enhancements
2020-10-08 22:30:20 +02:00
Łukasz Magiera d55f10bed6 Merge pull request #4251 from filecoin-project/upgrade/noise
upgrade go-libp2p-noise to v0.1.2.
2020-10-08 22:26:46 +02:00
Raúl Kripalani 21de538d09 upgrade go-libp2p-noise to v0.1.2.
Improves throughput in large and/or fast transfers
and reduces syscalls when data is queued in receive
buffer, by using bufio.Reader.
2020-10-08 21:19:09 +01:00
Aayush Rajasekaran fe5b32026a Add some new endpoints for querying Msig info 2020-10-08 15:51:21 -04:00
Łukasz Magiera 91c10c2df5 Merge pull request #4248 from filecoin-project/feat/update-libp2p
Update libp2p things
2020-10-08 21:08:38 +02:00
Ingar Shu c3420c0ceb Display price, verified-price with units in lotus-miner storage-deals get-ask 2020-10-08 12:08:01 -07:00
vyzo 7933cf094f allow all drand topics 2020-10-08 21:48:55 +03:00
Anton Evangelatov 1a64caaa4d record point for every fetch (#269) 2020-10-08 20:43:46 +02:00
vyzo 4cd73f1560 use subscription filter in pubsub 2020-10-08 21:40:36 +03:00
vyzo 8a175a7465 update go-libp2p-pubsub and go-libp2p-quic-transport 2020-10-08 21:32:10 +03:00
Ingar Shu f7f229ae54 Show verified status in client list-deals 2020-10-08 11:31:33 -07:00
Ingar Shu 1323e07a2c Don't show failed deals by default in client list-deals, add option to to show failed deals. 2020-10-08 11:31:33 -07:00
Ingar Shu 2ad671649c Use FIL units for miner set-ask 2020-10-08 11:31:32 -07:00
Łukasz Magiera d26ece10b8 Merge pull request #4241 from filecoin-project/fix/daemon-flag-clash
fix: clash between daemon --api flag and cli tests
2020-10-08 18:30:47 +02:00
Raúl Kripalani 4c8084dcb0 Merge pull request #4243 from filecoin-project/conformance/rm-faked-syscalls 2020-10-08 17:06:25 +01:00
Raúl Kripalani 98d702fb5a add signature imports. 2020-10-08 16:44:20 +01:00
Łukasz Magiera 17f61ac212 Merge pull request #4245 from filecoin-project/debug/chain-sync-lookback
add more info to chain sync lookback failure
2020-10-08 17:05:08 +02:00
Łukasz Magiera df67576b89 Merge pull request #4233 from filecoin-project/fix/balances-audit-no-suffix
Some improvements to the lotus-shed balance audit commands
2020-10-08 17:02:21 +02:00
whyrusleeping cdc2f86f5a add more info to chain sync lookback failure 2020-10-08 09:45:07 -05:00
Raúl Kripalani 67b3a55e30 update test-vectors submodule. 2020-10-08 15:44:11 +01:00
Raúl Kripalani 3201e0eb8f Merge branch 'master' into conformance/rm-faked-syscalls 2020-10-08 15:17:26 +01:00
Raúl Kripalani 8d2d74438b Merge pull request #4221 from filecoin-project/conformance/randomness 2020-10-08 15:16:32 +01:00
Raúl Kripalani 1f9446f91f upgrade to test vectors schema v0.0.4. 2020-10-08 15:00:35 +01:00
Raúl Kripalani 4937ca1a96 conformance: remove usage of fake syscalls. 2020-10-08 14:55:03 +01:00
Łukasz Magiera 264fe4edb9 Merge pull request #4230 from filecoin-project/feat/inspect-counts
Add message counts to inspect chain output
2020-10-08 15:12:28 +02:00
Dirk McCormick cb7d99fcc7 fix: clash between daemon --api flag and cli tests 2020-10-08 14:24:50 +02:00
Łukasz Magiera 7332a39f00 Merge remote-tracking branch 'origin/master' into fix/balances-audit-no-suffix 2020-10-08 13:58:40 +02:00
Łukasz Magiera 0de3051821 Merge remote-tracking branch 'origin/master' into feat/async-restartable-workers 2020-10-08 13:10:41 +02:00
hunjixin 0f53eca883 add batch api for push messages 2020-10-08 10:04:43 +08:00
whyrusleeping cd9af278b4 more info in audit outputs 2020-10-07 17:01:01 -07:00
Anton Evangelatov 4cc1fcb37b graphsync - add composition for k8s (#267) 2020-10-08 01:08:30 +02:00
whyrusleeping 8f4911ac0d dont print fil suffix in lotus shed audit balances 2020-10-07 16:00:52 -07:00
whyrusleeping 12cd478e11 Add message counts to inspect chain output 2020-10-07 15:14:46 -07:00
Jennifer e55b00f358 Increase the message fee cap upper bounds in PCR. 2020-10-07 17:07:19 -04:00
Jakub Sztandera 6f4a762664 Fix Messages field in MessagePoolEvtMessage journal entry
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2020-10-07 21:13:04 +02:00
Raúl Kripalani c02daca9e9 work around #4223. 2020-10-07 20:12:35 +01:00
Raúl Kripalani 5bd6a3cdad conformance: record randomness in tvx; replay in driver. 2020-10-07 19:57:42 +01:00
Raúl Kripalani 44af7e43b6 remove tvx and corpus from this repo; spun off elsewhere. (#268) 2020-10-07 19:24:46 +01:00
Animesh 673de6aeb6 Add perm tag to ClientGetDealStatus 2020-10-07 12:35:42 +05:30
Animesh bf959e45fb Add api for getting status given a code 2020-10-07 11:43:30 +05:30
Animesh ce247bcab3 Add api for getting status given a code 2020-10-07 10:27:51 +05:30
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
whyrusleeping ef3987e2ab decode parameters for multisig transactions in inspect 2020-10-02 14:51:32 -07: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
Łukasz Magiera 780f6dba34 Remote wallet backends 2020-09-05 21:39:09 +02:00
Łukasz Magiera f90cfda2e6 wallet: Add interface layer 2020-09-04 22:18:03 +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
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
654 changed files with 71601 additions and 11899 deletions
+251 -11
View File
@@ -1,11 +1,13 @@
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.15.5
resource_class: 2xlarge
ubuntu:
docker:
@@ -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:
@@ -188,10 +190,22 @@ jobs:
command: |
bash <(curl -s https://codecov.io/bash)
test-chain:
<<: *test
test-node:
<<: *test
test-storage:
<<: *test
test-cli:
<<: *test
test-short:
<<: *test
test-window-post:
<<: *test
test-window-post-dispute:
<<: *test
test-terminate:
<<: *test
test-conformance:
description: |
Run tests using a corpus of interoperable test vectors for Filecoin
@@ -254,24 +268,67 @@ 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-calibnet && mv lotus lotus-miner lotus-worker linux-calibnet
- persist_to_workspace:
root: "."
paths:
- linux-calibnet
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=../..
- 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:
@@ -286,8 +343,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.15.5.darwin-amd64.pkg && \
sudo installer -pkg go1.15.5.darwin-amd64.pkg -target /
- run:
name: Install pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
@@ -351,6 +408,7 @@ jobs:
steps:
- install-deps
- prepare
- run: make deps
- run: make docsgen
- run: git --no-pager diff
- run: git --no-pager diff --quiet
@@ -414,6 +472,138 @@ jobs:
name: Publish release
command: ./scripts/publish-release.sh
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:
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"
- packer/build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-calibnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG"
workflows:
version: 2.1
@@ -428,10 +618,37 @@ workflows:
- test:
codecov-upload: true
test-suite-name: full
- test-chain:
codecov-upload: true
test-suite-name: chain
packages: "./chain/..."
- test-node:
codecov-upload: true
test-suite-name: node
packages: "./node/..."
- test-storage:
codecov-upload: true
test-suite-name: storage
packages: "./storage/... ./extern/..."
- test-cli:
codecov-upload: true
test-suite-name: cli
packages: "./cli/... ./cmd/... ./api/..."
- test-window-post:
codecov-upload: true
go-test-flags: "-run=TestWindowedPost"
winpost-test: "1"
test-suite-name: window-post
- test-window-post-dispute:
codecov-upload: true
go-test-flags: "-run=TestWindowPostDispute"
winpost-test: "1"
test-suite-name: window-post-dispute
- test-terminate:
codecov-upload: true
go-test-flags: "-run=TestTerminate"
winpost-test: "1"
test-suite-name: terminate
- test-short:
go-test-flags: "--timeout 10m --short"
test-suite-name: short
@@ -447,7 +664,13 @@ workflows:
test-suite-name: conformance-bleeding-edge
packages: "./conformance"
vectors-branch: master
- build-ntwk-calibration
- build-lotus-soup
- trigger-testplans:
filters:
branches:
only:
- master
- build-debug
- build-all:
requires:
@@ -477,3 +700,20 @@ workflows:
tags:
only:
- /^v\d+\.\d+\.\d+$/
- build-and-push-image:
dockerfile: Dockerfile.lotus
path: .
repo: lotus-dev
tag: '${CIRCLE_SHA1:0:8}'
- publish-packer:
requires:
- build-all
- build-ntwk-calibration
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+$/
+15 -1
View File
@@ -1,5 +1,19 @@
comment: off
ignore:
- "cbor_gen.go"
- "**/cbor_gen.go"
- "api/test/**/*"
- "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
+33
View File
@@ -0,0 +1,33 @@
---
name: Bug Report
about: Create a report to help us improve
title: "[BUG] "
labels: hint/needs-triaging, kind/bug
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
**Describe the bug**
A clear and concise description of what the bug is.
(If you are not sure what the bug is, try to figure it out via a [discussion](https://github.com/filecoin-project/lotus/discussions/new) first!
**Version (run `lotus version`):**
**To Reproduce**
Steps to reproduce the behavior:
1. Run '...'
2. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Logs**
Provide daemon/miner/worker logs, and goroutines(if available) for troubleshooting.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
-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.
@@ -0,0 +1,49 @@
---
name: Deal Making Issues
about: Create a report for help with deal making failures.
title: "[Deal Making Issue]"
labels: hint/needs-triaging, area/markets
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
Please provide all the information requested here to help us troubleshoot "deal making failed" issues.
If the information requested is missing, we will probably have to just ask you to provide it anyway,
before we can help debug.
**Basic Information**
Including information like, Are you the client or the miner? Is this a storage deal or a retrieval deal? Is it an offline deal?
**Describe the problem**
A brief description of the problem you encountered while trying to make a deal.
**Version**
The output of `lotus --version`.
**Setup**
You miner(if applicable) and daemon setup, i.e: What hardware do you use, how much ram and etc.
**To Reproduce**
Steps to reproduce the behavior:
1. Run '...'
2. See error
**Deal status**
The output of `lotus client list-deals -v` and/or `lotus-miner storage-deals|retrieval-deals|data-transfers list [-v]` commands for the deal(s) in question.
**Lotus daemon and miner logs**
Please go through the logs of your daemon and miner(if applicable), and include screenshots of any error/warning-like messages you find.
Alternatively please upload full log files and share a link here
** Code modifications **
If you have modified parts of lotus, please describe which areas were modified,
and the scope of those modifications
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature Request]"
labels: hint/needs-triaging
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+35
View File
@@ -0,0 +1,35 @@
---
name: Mining Issues
about: Create a report for help with mining failures.
title: "[Mining Issue]"
labels: hint/needs-triaging, area/mining
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
Please provide all the information requested here to help us troubleshoot "mining/WinningPoSt failed" issues.
If the information requested is missing, you may be asked you to provide it.
**Describe the problem**
A brief description of the problem you encountered while mining new blocks.
**Version**
The output of `lotus --version`.
**Setup**
You miner and daemon setup, including what hardware do you use, your environment variable settings, how do you run your miner and worker, do you use GPU and etc.
**Lotus daemon and miner logs**
Please go through the logs of your daemon and miner, and include screenshots of any error/warning-like messages you find, highlighting the one has "winning post" in it.
Alternatively please upload full log files and share a link here
** Code modifications **
If you have modified parts of lotus, please describe which areas were modified,
and the scope of those modifications
+46
View File
@@ -0,0 +1,46 @@
---
name: Proving Issues
about: Create a report for help with proving failures.
title: "[Proving Issue]"
labels: area/proving, hint/needs-triaging
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
Please provide all the information requested here to help us troubleshoot "proving/window PoSt failed" issues.
If the information requested is missing, we will probably have to just ask you to provide it anyway,
before we can help debug.
**Describe the problem**
A brief description of the problem you encountered while proving the storage.
**Version**
The output of `lotus --version`.
**Setup**
You miner and daemon setup, including what hardware do you use, your environment variable settings, how do you run your miner and worker, do you use GPU and etc.
**Proving status**
The output of `lotus-miner proving` info.
**Lotus miner logs**
Please go through the logs of your miner, and include screenshots of any error-like messages you find, highlighting the one has "window post" in it.
Alternatively please upload full log files and share a link here
**Lotus miner diagnostic info**
Please collect the following diagnostic information, and share a link here
* lotus-miner diagnostic info `lotus-miner info all > allinfo.txt`
** Code modifications **
If you have modified parts of lotus, please describe which areas were modified,
and the scope of those modifications
@@ -1,21 +1,32 @@
---
name: Sealing Issues
about: Create a report for help with sealing (commit) failures.
title: ''
labels: 'sealing'
title: "[Sealing Issue]"
labels: hint/needs-triaging, area/sealing
assignees: ''
---
> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy).
Please provide all the information requested here to help us troubleshoot "commit failed" issues.
If the information requested is missing, we will probably have to just ask you to provide it anyway,
before we can help debug.
**Describe the problem**
A brief description of the problem you encountered while sealing a sector.
A brief description of the problem you encountered while proving (sealing) a sector.
**Version**
Including what commands you ran, and a description of your setup, is very helpful.
The output of `lotus --version`.
**Setup**
You miner and daemon setup, including what hardware do you use, your environment variable settings, how do you run your miner and worker, do you use GPU and etc.
**Commands**
Commands you ran.
**Sectors status**
@@ -37,7 +48,3 @@ Please collect the following diagnostic information, and share a link here
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`.
+2
View File
@@ -12,6 +12,8 @@
/lotus-bench
/lotus-gateway
/lotus-pcr
/lotus-wallet
/lotus-keygen
/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
+785
View File
@@ -1,5 +1,790 @@
# Lotus changelog
# 1.6.0 / 2021-04-05
This is a mandatory release of Lotus that upgrades the network to version 11, which implements [FIP-0014](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0014.md). The network will upgrade at height 665280, which is 2021-04-12T22:00:00Z.
## v1 sector extension CLI
This release also expands the `lotus-miner sectors extend` CLI, with a new option that automatically extends all extensible v1 sectors. The option can be run using `lotus-miner sectors extend --v1-sectors`.
- The `tolerance` flag can be passed to indicate what durations aren't "worth" extending. It defaults to one week, which means that sectors whose current lifetime's are within one week of the maximum possible lifetime will not be extended.
- The `expiration-cutoff` flag can be passed to skip sectors whose expiration is past a certain point from the current head. It defaults to infinity (no cutoff), but if, say, 28800 was specified, then only sectors expiring in the next 10 days would be extended (2880 epochs in 1 day).
## Changes
- Util for miners to extend all v1 sectors (https://github.com/filecoin-project/lotus/pull/5924)
- Upgrade the butterfly network (https://github.com/filecoin-project/lotus/pull/5929)
- Introduce the v11 network upgrade (https://github.com/filecoin-project/lotus/pull/5904)
- Debug mode: Make upgrade heights controllable by an envvar (https://github.com/filecoin-project/lotus/pull/5919)
# 1.5.3 / 2021-03-24
This is a patch release of Lotus that introduces small fixes to the Storage FSM.
## Changes
- storagefsm: Fix double unlock with ready WaitDeals sectors (https://github.com/filecoin-project/lotus/pull/5783)
- backupds: Allow larger values in write log (https://github.com/filecoin-project/lotus/pull/5776)
- storagefsm: Don't log the SectorRestart event (https://github.com/filecoin-project/lotus/pull/5779)
# 1.5.2 / 2021-03-11
This is an hotfix release of Lotus that fixes a critical bug introduced in v1.5.1 in the miner windowPoSt logic. This upgrade is only affecting miner nodes.
## Changes
- fix window post rand check (https://github.com/filecoin-project/lotus/pull/5773)
- wdpost: Always use head tipset to get randomness (https://github.com/filecoin-project/lotus/pull/5774)
# 1.5.1 / 2021-03-10
This is an optional release of Lotus that introduces an important fix to the WindowPoSt computation process. The change is to wait for some confidence before drawing beacon randomness for the proof. Without this, invalid proofs might be generated as the result of a null tipset.
## Splitstore
This release also introduces the splitstore, a new optional blockstore that segregates the monolithic blockstore into cold and hot regions. The hot region contains objects from the last 4-5 finalities plus all reachable objects from two finalities away. All other objects are moved to the cold region using a compaction process that executes every finality, once 5 finalities have elapsed.
The splitstore allows us to separate the two regions quite effectively, using two separate badger blockstores. The separation
means that the live working set is much smaller, which results in potentially significant performance improvements. In addition, it means that the coldstore can be moved to a separate (bigger, slower, cheaper) disk without loss of performance.
The design also allows us to use different implementations for the two blockstores; for example, an append-only blockstore could be used for coldstore and a faster memory mapped blockstore could be used for the hotstore (eg LMDB). We plan to experiment with these options in the future.
Once the splitstore has been enabled, the existing monolithic blockstore becomes the coldstore. On the first head change notification, the splitstore will warm up the hotstore by copying all reachable objects from the current tipset into the hotstore. All new writes go into the hotstore, with the splitstore tracking the write epoch. Once 5 finalities have elapsed, and every finality thereafter, the splitstore compacts by moving cold objects into the coldstore. There is also experimental support for garbage collection, whereby nunreachable objects are simply discarded.
To enable the splitstore, add the following to config.toml:
```
[Chainstore]
EnableSplitstore = true
```
## Highlights
Other highlights include:
- Improved deal data handling - now multiple deals can be adding to sectors in parallel
- Rewriten sector pledging - it now actually cares about max sealing sector limits
- Better handling for sectors stuck in the RecoverDealIDs state
- lotus-miner sectors extend command
- Optional configurable storage path size limit
- Config to disable owner/worker fallback from control addresses (useful when owner is a key on a hardware wallet)
- A write log for node metadata, which can be restored as a backup when the metadata leveldb becomes corrupted (e.g. when you run out of disk space / system crashes in some bad way)
## Changes
- avoid use mp.cfg directly to avoid race (https://github.com/filecoin-project/lotus/pull/5350)
- Show replacing message CID is state search-msg cli (https://github.com/filecoin-project/lotus/pull/5656)
- Fix riceing by importing the main package (https://github.com/filecoin-project/lotus/pull/5675)
- Remove sectors with all deals expired in RecoverDealIDs (https://github.com/filecoin-project/lotus/pull/5658)
- storagefsm: Rewrite input handling (https://github.com/filecoin-project/lotus/pull/5375)
- reintroduce Refactor send command for better testability (https://github.com/filecoin-project/lotus/pull/5668)
- Improve error message with importing a chain (https://github.com/filecoin-project/lotus/pull/5669)
- storagefsm: Cleanup CC sector creation (https://github.com/filecoin-project/lotus/pull/5612)
- chain list --gas-stats display capacity (https://github.com/filecoin-project/lotus/pull/5676)
- Correct some logs (https://github.com/filecoin-project/lotus/pull/5694)
- refactor blockstores (https://github.com/filecoin-project/lotus/pull/5484)
- Add idle to sync stage's String() (https://github.com/filecoin-project/lotus/pull/5702)
- packer provisioner (https://github.com/filecoin-project/lotus/pull/5604)
- add DeleteMany to Blockstore interface (https://github.com/filecoin-project/lotus/pull/5703)
- segregate chain and state blockstores (https://github.com/filecoin-project/lotus/pull/5695)
- fix(multisig): The format of the amount is not correct in msigLockApp (https://github.com/filecoin-project/lotus/pull/5718)
- Update butterfly network (https://github.com/filecoin-project/lotus/pull/5627)
- Collect worker task metrics (https://github.com/filecoin-project/lotus/pull/5648)
- Correctly format disputer log (https://github.com/filecoin-project/lotus/pull/5716)
- Log block CID in the large delay warning (https://github.com/filecoin-project/lotus/pull/5704)
- Move api client builders to a cliutil package (https://github.com/filecoin-project/lotus/pull/5728)
- Implement net peers --extended (https://github.com/filecoin-project/lotus/pull/5734)
- Command to extend sector expiration (https://github.com/filecoin-project/lotus/pull/5666)
- garbage collect hotstore after compaction (https://github.com/filecoin-project/lotus/pull/5744)
- tune badger gc to repeatedly gc the value log until there is no rewrite (https://github.com/filecoin-project/lotus/pull/5745)
- Add configuration option for pubsub IPColocationWhitelist subnets (https://github.com/filecoin-project/lotus/pull/5735)
- hot/cold blockstore segregation (aka. splitstore) (https://github.com/filecoin-project/lotus/pull/4992)
- Customize verifreg root key and remainder account when making genesis (https://github.com/filecoin-project/lotus/pull/5730)
- chore: update go-graphsync to 0.6.0 (https://github.com/filecoin-project/lotus/pull/5746)
- Add connmgr metadata to NetPeerInfo (https://github.com/filecoin-project/lotus/pull/5749)
- test: attempt to make the splitstore test deterministic (https://github.com/filecoin-project/lotus/pull/5750)
- Feat/api no dep build (https://github.com/filecoin-project/lotus/pull/5729)
- Fix bootstrapper profile setting (https://github.com/filecoin-project/lotus/pull/5756)
- Check liveness of sectors when processing termination batches (https://github.com/filecoin-project/lotus/pull/5759)
- Configurable storage path storage limit (https://github.com/filecoin-project/lotus/pull/5624)
- miner: Config to disable owner/worker address fallback (https://github.com/filecoin-project/lotus/pull/5620)
- Fix TestUnpadReader on Go 1.16 (https://github.com/filecoin-project/lotus/pull/5761)
- Metadata datastore log (https://github.com/filecoin-project/lotus/pull/5755)
- Remove the SR2 stats, leave just the network totals (https://github.com/filecoin-project/lotus/pull/5757)
- fix: wait a bit before starting to compute window post proofs (https://github.com/filecoin-project/lotus/pull/5764)
- fix: retry proof when randomness changes (https://github.com/filecoin-project/lotus/pull/5768)
# 1.5.0 / 2021-02-23
This is a mandatory release of Lotus that introduces the fifth upgrade to the Filecoin network. The network upgrade occurs at height 550321, before which time all nodes must have updated to this release (or later). At this height, [v3 specs-actors](https://github.com/filecoin-project/specs-actors/releases/tag/v3.0.0) will take effect, which in turn implements the following two FIPs:
- [FIP-0007 h/amt-v3](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0007.md) which improves the performance of the Filecoin HAMT and AMT.
- [FIP-0010 off-chain Window PoSt Verification](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0010.md) which reduces the gas consumption of `SubmitWindowedPoSt` messages significantly by optimistically accepting Window PoSt proofs without verification, and allowing them to be disputed later by off-chain verifiers.
Note that the integration of v3 actors was already completed in 1.4.2, this upgrade simply sets the epoch for the upgrade to occur.
## Disputer
FIP-0010 introduces the ability to dispute bad Window PoSts. Node operators are encouraged to run the new Lotus disputer alongside their Lotus daemons. For more information, see the announcement [here](https://github.com/filecoin-project/lotus/discussions/5617#discussioncomment-387333).
## Changes
- [#5341](https://github.com/filecoin-project/lotus/pull/5341) Add a `LOTUS_DISABLE_V3_ACTOR_MIGRATION` envvar
- Setting this envvar to 1 disables the v3 actor migration, should only be used in the event of a failed migration
# 1.4.2 / 2021-02-17
This is a large, and highly recommended, optional release with new features and improvements for lotus miner and deal-making UX. The release also integrates [v3 specs-actors](https://github.com/filecoin-project/specs-actors/releases/tag/v3.0.0), which implements two FIPs:
- [FIP-0007 h/amt-v3](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0007.md) which improves the performance of the Filecoin HAMT and AMT.
- [FIP-0010 off-chain Window PoSt Verification](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0010.md) which reduces the gas consumption of `SubmitWindowedPoSt` messages significantly by optimistically accepting Window PoSt proofs without verification, and allowing them to be disputed later by off-chain verifiers.
Note that this release does NOT set an upgrade epoch for v3 actors to take effect. That will be done in the upcoming 1.5.0 release.
## New Features
- [#5341](https://github.com/filecoin-project/lotus/pull/5341) Added sector termination API and CLI
- Run `lotus-miner sectors terminate`
- [#5342](https://github.com/filecoin-project/lotus/pull/5342) Added CLI for using a multisig wallet as miner's owner address
- See how to set it up [here](https://github.com/filecoin-project/lotus/pull/5342#issue-554009129)
- [#5363](https://github.com/filecoin-project/lotus/pull/5363), [#5418](https://github.com/filecoin-project/lotus/pull/), [#5476](https://github.com/filecoin-project/lotus/pull/5476), [#5459](https://github.com/filecoin-project/lotus/pull/5459) Integrated [spec-actor v3](https://github.com/filecoin-pro5418ject/specs-actors/releases/tag/v3.0.0)
- [#5472](https://github.com/filecoin-project/lotus/pull/5472) Generate actor v3 methods for pond
- [#5379](https://github.com/filecoin-project/lotus/pull/5379) Added WindowPoSt disputer
- This is to support [FIP-0010 off-chian Window PoSt verification](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0010.md)
- See how to run a disputer [here](https://github.com/filecoin-project/lotus/pull/5379#issuecomment-776482445)
- [#5309](https://github.com/filecoin-project/lotus/pull/5309) Batch multiple deals in one `PublishStorageMessages`
- [#5411](https://github.com/filecoin-project/lotus/pull/5411) Handle batch `PublishStorageDeals` message in sealing recovery
- [#5505](https://github.com/filecoin-project/lotus/pull/5505) Exclude expired deals from batching in `PublishStorageDeals` messages
- Added `PublishMsgPeriod` and `MaxDealsPerPublishMsg` to miner `Dealmaking` [configuration](https://docs.filecoin.io/mine/lotus/miner-configuration/#dealmaking-section). See how they work [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#publishing-several-deals-in-one-message).
- [#5538](https://github.com/filecoin-project/lotus/pull/5538), [#5549](https://github.com/filecoin-project/lotus/pull/5549) Added a command to list pending deals and force publish messages.
- Run `lotus-miner market pending-publish`
- [#5428](https://github.com/filecoin-project/lotus/pull/5428) Moved waiting for `PublishStorageDeals` messages' receipt from markets to lotus
- [#5510](https://github.com/filecoin-project/lotus/pull/5510) Added `nerpanet` build option
- To build `nerpanet`, run `make nerpanet`
- [#5433](https://github.com/filecoin-project/lotus/pull/5433) Added `AlwaysKeepUnsealedCopy` option to the miner configuration
- [#5520](https://github.com/filecoin-project/lotus/pull/5520) Added `MsigGetPending` to get pending transactions for multisig wallets
- [#5219](https://github.com/filecoin-project/lotus/pull/5219) Added interactive mode for lotus-wallet
- [5529](https://github.com/filecoin-project/lotus/pull/5529) Added support for minder nodes in `lotus-shed rpc` util
## Bug Fixes
- [#5210](https://github.com/filecoin-project/lotus/pull/5210) Miner should not dial client on restart
- [#5403](https://github.com/filecoin-project/lotus/pull/5403) When estimating GasLimit only apply prior messages up to the nonce
- [#5410](https://github.com/filecoin-project/lotus/pull/510) Fix the calibnet build option
- [#5492](https://github.com/filecoin-project/lotus/pull/5492) Fixed `has` for ipfsbstore for non-existing blocks
- [#5361](https://github.com/filecoin-project/lotus/pull/5361) Fixed retrieval hangs when using `IpfsOnlineMode=true`
- [#5493](https://github.com/filecoin-project/lotus/pull/5493) Fixed retrieval failure when price-per-byte is zero
- [#5506](https://github.com/filecoin-project/lotus/pull/5506) Fixed contexts in the storage adpater
- [#5515](https://github.com/filecoin-project/lotus/pull/5515) Properly wire up `StateReadState` on gateway API
- [#5582](https://github.com/filecoin-project/lotus/pull/5582) Fixed error logging format strings
- [#5614](https://github.com/filecoin-project/lotus/pull/5614) Fixed websocket reconnecting handling
## Improvements
- [#5389](https://github.com/filecoin-project/lotus/pull/5389) Show verified indicator for `./lotus-miner storage-deals list`
- [#5229](https://github.com/filecoin-project/lotus/pull/5220) Show power for verified deals in `./lotus-miner setocr list`
- [#5407](https://github.com/filecoin-project/lotus/pull/5407) Added explicit check of the miner address protocol
- [#5399](https://github.com/filecoin-project/lotus/pull/5399) watchdog: increase heapprof capture threshold to 90%
- [#5398](https://github.com/filecoin-project/lotus/pull/5398) storageadapter: Look at precommits on-chain since deal publish msg
- [#5470](https://github.com/filecoin-project/lotus/pull/5470) Added `--no-timing` option for `./lotus state compute-state --html`
- [#5417](https://github.com/filecoin-project/lotus/pull/5417) Storage Manager: Always unseal full sectors
- [#5393](https://github.com/filecoin-project/lotus/pull/5393) Switched to [filecoin-ffi bls api ](https://github.com/filecoin-project/filecoin-ffi/pull/159)for bls signatures
- [#5380](https://github.com/filecoin-project/lotus/pull/5210) Refactor deals API tests
- [#5397](https://github.com/filecoin-project/lotus/pull/5397) Fixed a flake in the sync manager edge case test
- [#5406](https://github.com/filecoin-project/lotus/pull/5406) Added a test to ensure a correct window post cannot be disputed
- [#5294](https://github.com/filecoin-project/lotus/pull/5394) Added jobs to build Lotus docker image and push it to AWS ECR
- [#5387](https://github.com/filecoin-project/lotus/pull/5387) Added network info(mainnet|calibnet) in version
- [#5497](https://github.com/filecoin-project/lotus/pull/5497) Export metric for lotus-gateaway
- [#4950](https://github.com/filecoin-project/lotus/pull/4950) Removed bench policy
- [#5047](https://github.com/filecoin-project/lotus/pull/5047) Improved the UX for `./lotus-shed bitfield enc`
- [#5282](https://github.com/filecoin-project/lotus/pull/5282) Snake a context through the chian blockstore creation
- [#5350](https://github.com/filecoin-project/lotus/pull/5350) Avoid using `mp.cfg` directrly to prevent race condition
- [#5449](https://github.com/filecoin-project/lotus/pull/5449) Documented the block-header better
- [#5404](https://github.com/filecoin-project/lotus/pull/5404) Added retrying proofs if an incorrect one is generated
- [#4545](https://github.com/filecoin-project/lotus/pull/4545) Made state tipset usage consistent in the API
- [#5540](https://github.com/filecoin-project/lotus/pull/5540) Removed unnecessary database reads in validation check
- [#5554](https://github.com/filecoin-project/lotus/pull/5554) Fixed `build lotus-soup` CI job
- [#5552](https://github.com/filecoin-project/lotus/pull/5552) Updated CircleCI to halt gracefully
- [#5555](https://github.com/filecoin-project/lotus/pull/5555) Cleanup and add docstrings of node builder
- [#5564](https://github.com/filecoin-project/lotus/pull/5564) Stopped depending on gocheck with gomod
- [#5574](https://github.com/filecoin-project/lotus/pull/5574) Updated CLI UI
- [#5570](https://github.com/filecoin-project/lotus/pull/5570) Added code CID to `StateReadState` return object
- [#5565](https://github.com/filecoin-project/lotus/pull/5565) Added storageadapter.PublishMsgConfig to miner in testkit for lotus-soup testplan
- [#5571](https://github.com/filecoin-project/lotus/pull/5571) Added `lotus-seed gensis car` to generate lotus block for devnets
- [#5613](https://github.com/filecoin-project/lotus/pull/5613) Check format in client commP util
- [#5507](https://github.com/filecoin-project/lotus/pull/5507) Refactored coalescing logic into its own function and take both cancellation sets into account
- [#5592](https://github.com/filecoin-project/lotus/pull/5592) Verify FFI version before building
## Dependency Updates
- [#5296](https://github.com/filecoin-project/lotus/pull/5396) Upgraded to [raulk/go-watchdog@v1.0.1](https://github.com/raulk/go-watchdog/releases/tag/v1.0.1)
- [#5450](https://github.com/filecoin-project/lotus/pull/5450) Dependency updates
- [#5425](https://github.com/filecoin-project/lotus/pull/5425) Fixed stale imports in testplans/lotus-soup
- [#5535](https://github.com/filecoin-project/lotus/pull/5535) Updated to [go-fil-markets@v1.1.7](https://github.com/filecoin-project/go-fil-markets/releases/tag/v1.1.7)
- [#5616](https://github.com/filecoin-project/lotus/pull/5600) Updated to [filecoin-ffi@b6e0b35fb49ed0fe](https://github.com/filecoin-project/filecoin-ffi/releases/tag/b6e0b35fb49ed0fe)
- [#5599](https://github.com/filecoin-project/lotus/pull/5599) Updated to [go-bitfield@v0.2.4](https://github.com/filecoin-project/go-bitfield/releases/tag/v0.2.4)
- [#5614](https://github.com/filecoin-project/lotus/pull/5614), , [#5621](https://github.com/filecoin-project/lotus/pull/5621) Updated to [go-jsonrpc@v0.1.3](https://github.com/filecoin-project/go-jsonrpc/releases/tag/v0.1.3)
- [#5459](https://github.com/filecoin-project/lotus/pull/5459) Updated to [spec-actors@v3.0.1](https://github.com/filecoin-project/specs-actors/releases/tag/v3.0.1)
## Network Version v10 Upgrade
- [#5473](https://github.com/filecoin-project/lotus/pull/5473) Merged staging branch for v1.5.0
- [#5603](https://github.com/filecoin-project/lotus/pull/5603) Set nerpanet's upgrade epochs up to v3 actors
- [#5471](https://github.com/filecoin-project/lotus/pull/5471), [#5456](https://github.com/filecoin-project/lotus/pull/5456) Set calibration net actor v3 migration epochs for testing
- [#5434](https://github.com/filecoin-project/lotus/pull/5434) Implemented pre-migration framework
- [#5476](https://github.com/filecoin-project/lotus/pull/5477) Tune migration
# 1.4.1 / 2021-01-20
This is an optional Lotus release that introduces various improvements to the sealing, mining, and deal-making processes. In particular, [#5341](https://github.com/filecoin-project/lotus/pull/5341) introduces the ability for Lotus miners to terminate sectors.
## Changes
#### Core Lotus
- fix(sync): enforce ForkLengthThreshold for synced chain (https://github.com/filecoin-project/lotus/pull/5182)
- introduce memory watchdog; LOTUS_MAX_HEAP (https://github.com/filecoin-project/lotus/pull/5101)
- Skip bootstrapping if no peers specified (https://github.com/filecoin-project/lotus/pull/5301)
- Chainxchg write response timeout (https://github.com/filecoin-project/lotus/pull/5254)
- update NewestNetworkVersion (https://github.com/filecoin-project/lotus/pull/5277)
- fix(sync): remove checks bypass when we submit the block (https://github.com/filecoin-project/lotus/pull/4192)
- chore: export vm.ShouldBurn (https://github.com/filecoin-project/lotus/pull/5355)
- fix(sync): enforce fork len when changing head (https://github.com/filecoin-project/lotus/pull/5244)
- Use 55th percentile instead of median for gas-price (https://github.com/filecoin-project/lotus/pull/5369)
- update go-libp2p-pubsub to v0.4.1 (https://github.com/filecoin-project/lotus/pull/5329)
#### Sealing
- Sector termination support (https://github.com/filecoin-project/lotus/pull/5341)
- update weight canSeal and canStore when attach (https://github.com/filecoin-project/lotus/pull/5242/files)
- sector-storage/mock: improve mocked readpiece (https://github.com/filecoin-project/lotus/pull/5208)
- Fix deadlock in runWorker in sched_worker.go (https://github.com/filecoin-project/lotus/pull/5251)
- Skip checking terminated sectors provable (https://github.com/filecoin-project/lotus/pull/5217)
- storagefsm: Fix unsealedInfoMap.lk init race (https://github.com/filecoin-project/lotus/pull/5319)
- Multicore AddPiece CommP (https://github.com/filecoin-project/lotus/pull/5320)
- storagefsm: Send correct event on ErrExpiredTicket in CommitFailed (https://github.com/filecoin-project/lotus/pull/5366)
- expose StateSearchMessage on gateway (https://github.com/filecoin-project/lotus/pull/5382)
- fix FileSize to return correct disk usage recursively (https://github.com/filecoin-project/lotus/pull/5384)
#### Dealmaking
- Better error message when withdrawing funds (https://github.com/filecoin-project/lotus/pull/5293)
- add verbose for list transfers (https://github.com/filecoin-project/lotus/pull/5259)
- cli - rename `client info` to `client balances` (https://github.com/filecoin-project/lotus/pull/5304)
- Better CLI for wallet market withdraw and client info (https://github.com/filecoin-project/lotus/pull/5303)
#### UX
- correct flag usages for replace cmd (https://github.com/filecoin-project/lotus/pull/5255)
- lotus state call will panic (https://github.com/filecoin-project/lotus/pull/5275)
- fix get sector bug (https://github.com/filecoin-project/lotus/pull/4976)
- feat: lotus wallet market add (adds funds to storage market actor) (https://github.com/filecoin-project/lotus/pull/5300)
- Fix client flag parsing in client balances cli (https://github.com/filecoin-project/lotus/pull/5312)
- delete slash-consensus miner (https://github.com/filecoin-project/lotus/pull/4577)
- add fund sufficient check in send (https://github.com/filecoin-project/lotus/pull/5252)
- enable parse and shorten negative FIL values (https://github.com/filecoin-project/lotus/pull/5315)
- add limit and rate for chain noise (https://github.com/filecoin-project/lotus/pull/5223)
- add bench env print (https://github.com/filecoin-project/lotus/pull/5222)
- Implement full-node restore option (https://github.com/filecoin-project/lotus/pull/5362)
- add color for token amount (https://github.com/filecoin-project/lotus/pull/5352)
- correct log in maybeUseAddress (https://github.com/filecoin-project/lotus/pull/5359)
- add slash-consensus from flag (https://github.com/filecoin-project/lotus/pull/5378)
#### Testing
- tvx extract: more tipset extraction goodness (https://github.com/filecoin-project/lotus/pull/5258)
- Fix race in blockstore test suite (https://github.com/filecoin-project/lotus/pull/5297)
#### Build & Networks
- Remove LOTUS_DISABLE_V2_ACTOR_MIGRATION envvar (https://github.com/filecoin-project/lotus/pull/5289)
- Create a calibnet build option (https://github.com/filecoin-project/lotus/pull/5288)
- Calibnet: Set Orange epoch (https://github.com/filecoin-project/lotus/pull/5325)
#### Management
- Update SECURITY.md (https://github.com/filecoin-project/lotus/pull/5246)
- README: Contribute section (https://github.com/filecoin-project/lotus/pull/5330)
- README: refine Contribute section (https://github.com/filecoin-project/lotus/pull/5331)
- Add misc tooling to codecov ignore list (https://github.com/filecoin-project/lotus/pull/5347)
# 1.4.0 / 2020-12-19
This is a MANDATORY hotfix release of Lotus that resolves a chain halt at height 336,459 caused by nondeterminism in specs-actors. The fix is to update actors to 2.3.3 in order to incorporate this fix https://github.com/filecoin-project/specs-actors/pull/1334.
# 1.3.0 / 2020-12-16
This is a mandatory release of Lotus that introduces the third post-liftoff upgrade to the Filecoin network. The network upgrade occurs at height 343200, before which time all nodes must have updated to this release (or later). The change that breaks consensus is an implementation of FIP-0009(https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0009.md).
## Changes
- Disable gas burning for window post messages (https://github.com/filecoin-project/lotus/pull/5200)
- fix lock propose (https://github.com/filecoin-project/lotus/pull/5197)
# 1.2.3 / 2020-12-15
This is an optional Lotus release that introduces many performance improvements, bugfixes, and UX improvements.
## Changes
- When waiting for deal commit messages, ignore unsuccessful messages (https://github.com/filecoin-project/lotus/pull/5189)
- Bigger copy buffer size for stores (https://github.com/filecoin-project/lotus/pull/5177)
- Print MinPieceSize when querying ask (https://github.com/filecoin-project/lotus/pull/5178)
- Optimize miner info & sectors list loading (https://github.com/filecoin-project/lotus/pull/5176)
- Allow miners to filter (un)verified deals (https://github.com/filecoin-project/lotus/pull/5094)
- Fix curSealing out of MaxSealingSectors limit (https://github.com/filecoin-project/lotus/pull/5166)
- Add mpool pending from / to filter (https://github.com/filecoin-project/lotus/pull/5169)
- Add metrics for delayed blocks (https://github.com/filecoin-project/lotus/pull/5171)
- Fix PushUntrusted publishing -- the message is local (https://github.com/filecoin-project/lotus/pull/5173)
- Avoid potential hang in events API when starting event listener (https://github.com/filecoin-project/lotus/pull/5159)
- Show data transfer ID in list-deals (https://github.com/filecoin-project/lotus/pull/5150)
- Fix events API mutex locking (https://github.com/filecoin-project/lotus/pull/5160)
- Message pool refactors (https://github.com/filecoin-project/lotus/pull/5162)
- Fix lotus-shed cid output (https://github.com/filecoin-project/lotus/pull/5072)
- Use FundManager to withdraw funds, add MarketWithdraw API (https://github.com/filecoin-project/lotus/pull/5112)
- Add keygen outfile (https://github.com/filecoin-project/lotus/pull/5118)
- Update sr2 stat aggregation (https://github.com/filecoin-project/lotus/pull/5114)
- Fix miner control address lookup (https://github.com/filecoin-project/lotus/pull/5119)
- Fix send with declared nonce 0 (https://github.com/filecoin-project/lotus/pull/5111)
- Introduce memory watchdog; LOTUS_MAX_HEAP (https://github.com/filecoin-project/lotus/pull/5101)
- Miner control address config for (pre)commits (https://github.com/filecoin-project/lotus/pull/5103)
- Delete repeated call func (https://github.com/filecoin-project/lotus/pull/5099)
- lotus-shed ledger show command (https://github.com/filecoin-project/lotus/pull/5098)
- Log a message when there aren't enough peers for sync (https://github.com/filecoin-project/lotus/pull/5105)
- Miner code cleanup (https://github.com/filecoin-project/lotus/pull/5107)
# 1.2.2 / 2020-12-03
This is an optional Lotus release that introduces various improvements to the mining logic and deal-making workflow, as well as several new UX features.
## Changes
- Set lower feecap on PoSt messages with low balance (https://github.com/filecoin-project/lotus/pull/4217)
- Add options to set BlockProfileRate and MutexProfileFraction (https://github.com/filecoin-project/lotus/pull/4140)
- Shed/post find (https://github.com/filecoin-project/lotus/pull/4355)
- tvx extract: make it work with secp messages.(https://github.com/filecoin-project/lotus/pull/4583)
- update go from 1.14 to 1.15 (https://github.com/filecoin-project/lotus/pull/4909)
- print multiple blocks from miner cid (https://github.com/filecoin-project/lotus/pull/4767)
- Connection Gater support (https://github.com/filecoin-project/lotus/pull/4849)
- just return storedask.NewStoredAsk to reduce unuseful code (https://github.com/filecoin-project/lotus/pull/4902)
- add go main version (https://github.com/filecoin-project/lotus/pull/4910)
- Use version0 when pre-sealing (https://github.com/filecoin-project/lotus/pull/4911)
- optimize code UpgradeTapeHeight and go fmt (https://github.com/filecoin-project/lotus/pull/4913)
- CLI to get network version (https://github.com/filecoin-project/lotus/pull/4914)
- Improve error for ActorsVersionPredicate (https://github.com/filecoin-project/lotus/pull/4915)
- upgrade to go-fil-markets 1.0.5 (https://github.com/filecoin-project/lotus/pull/4916)
- bug:replace with func recordFailure (https://github.com/filecoin-project/lotus/pull/4919)
- Remove unused key (https://github.com/filecoin-project/lotus/pull/4924)
- change typeV7 make len (https://github.com/filecoin-project/lotus/pull/4943)
- emit events for peer disconnections and act upon them in the blocksync tracker (https://github.com/filecoin-project/lotus/pull/4754)
- Fix lotus bench error (https://github.com/filecoin-project/lotus/pull/4305)
- Reduce badger ValueTreshold to 128 (https://github.com/filecoin-project/lotus/pull/4629)
- Downgrade duplicate nonce logs to debug (https://github.com/filecoin-project/lotus/pull/4933)
- readme update golang version from 1.14.7 to 1.15.5 (https://github.com/filecoin-project/lotus/pull/4974)
- add data transfer logging (https://github.com/filecoin-project/lotus/pull/4975)
- Remove all temp file generation for deals (https://github.com/filecoin-project/lotus/pull/4929)
- fix get sector bug (https://github.com/filecoin-project/lotus/pull/4976)
- fix nil pointer in StateSectorPreCommitInfo (https://github.com/filecoin-project/lotus/pull/4082)
- Add logging on data-transfer to miner (https://github.com/filecoin-project/lotus/pull/4980)
- bugfix: fixup devnet script (https://github.com/filecoin-project/lotus/pull/4956)
- modify for unsafe (https://github.com/filecoin-project/lotus/pull/4024)
- move testground/lotus-soup testplan from oni to lotus (https://github.com/filecoin-project/lotus/pull/4727)
- Setup remainder msig signers when parsing genesis template (https://github.com/filecoin-project/lotus/pull/4904)
- Update JSON RPC server to enforce a maximum request size (https://github.com/filecoin-project/lotus/pull/4923)
- New SR-specific lotus-shed cmd (https://github.com/filecoin-project/lotus/pull/4971)
- update index to sectorNumber (https://github.com/filecoin-project/lotus/pull/4987)
- storagefsm: Fix expired ticket retry loop (https://github.com/filecoin-project/lotus/pull/4876)
- add .sec scale to measurements; humanize for metric tags (https://github.com/filecoin-project/lotus/pull/4989)
- Support seal proof type switching (https://github.com/filecoin-project/lotus/pull/4873)
- fix log format (https://github.com/filecoin-project/lotus/pull/4984)
- Format workerID as string (https://github.com/filecoin-project/lotus/pull/4973)
- miner: Winning PoSt Warmup (https://github.com/filecoin-project/lotus/pull/4824)
- Default StartDealParams's fast retrieval field to true over JSON (https://github.com/filecoin-project/lotus/pull/4998)
- Fix actor not found in chain inspect-usage (https://github.com/filecoin-project/lotus/pull/5010)
- storagefsm: Improve new deal sector logic (https://github.com/filecoin-project/lotus/pull/5007)
- Configure simultaneous requests (https://github.com/filecoin-project/lotus/pull/4996)
- miner: log winningPoSt duration separately (https://github.com/filecoin-project/lotus/pull/5005)
- fix wallet dead lock (https://github.com/filecoin-project/lotus/pull/5002)
- Update go-jsonrpc to v0.1.2 (https://github.com/filecoin-project/lotus/pull/5015)
- markets - separate watching for pre-commit from prove-commit (https://github.com/filecoin-project/lotus/pull/4945)
- storagefsm: Add missing planners (https://github.com/filecoin-project/lotus/pull/5016)
- fix wallet delete address where address is default (https://github.com/filecoin-project/lotus/pull/5019)
- worker: More robust remote checks (https://github.com/filecoin-project/lotus/pull/5008)
- Add new booststrappers (https://github.com/filecoin-project/lotus/pull/4007)
- add a tooling to make filecoin accounting a little easier (https://github.com/filecoin-project/lotus/pull/5025)
- fix: start a new line in print miner-info to avoid ambiguous display (https://github.com/filecoin-project/lotus/pull/5029)
- Print gas limit sum in mpool stat (https://github.com/filecoin-project/lotus/pull/5035)
- Fix chainstore tipset leak (https://github.com/filecoin-project/lotus/pull/5037)
- shed rpc: Allow calling with args (https://github.com/filecoin-project/lotus/pull/5036)
- Make --gas-limit optional in mpool replace cli (https://github.com/filecoin-project/lotus/pull/5059)
- client list-asks --by-ping (https://github.com/filecoin-project/lotus/pull/5060)
- Ledger signature verification (https://github.com/filecoin-project/lotus/pull/5068)
- Fix helptext for verified-deal default in client deal (https://github.com/filecoin-project/lotus/pull/5074)
- worker: Support setting task types at runtime (https://github.com/filecoin-project/lotus/pull/5023)
- Enable Callers tracing when GasTracing is enabled (https://github.com/filecoin-project/lotus/pull/5080)
- Cancel transfer cancels storage deal (https://github.com/filecoin-project/lotus/pull/5032)
- Sector check command (https://github.com/filecoin-project/lotus/pull/5041)
- add commp-to-cid base64 decode (https://github.com/filecoin-project/lotus/pull/5079)
- miner info cli improvements (https://github.com/filecoin-project/lotus/pull/5083)
- miner: Add slow mode to proving check (https://github.com/filecoin-project/lotus/pull/5086)
- Error out deals that are not activated by proposed deal start epoch (https://github.com/filecoin-project/lotus/pull/5061)
# 1.2.1 / 2020-11-20
This is a very small release of Lotus that fixes an issue users are experiencing when importing snapshots. There is no need to upgrade unless you experience an issue with creating a new datastore directory in the Lotus repo.
## Changes
- fix blockstore directory not created automatically (https://github.com/filecoin-project/lotus/pull/4922)
- WindowPoStScheduler.checkSectors() delete useless judgment (https://github.com/filecoin-project/lotus/pull/4918)
# 1.2.0 / 2020-11-18
This is a mandatory release of Lotus that introduces the second post-liftoff upgrade to the Filecoin network. The network upgrade occurs at height 265200, before which time all nodes must have updated to this release (or later). This release also bumps the required version of Go to 1.15.
The changes that break consensus are:
- Upgrading to sepcs-actors 2.3.2 (https://github.com/filecoin-project/specs-actors/releases/tag/v2.3.2)
- Introducing proofs v5.4.0 (https://github.com/filecoin-project/rust-fil-proofs/releases/tag/storage-proofs-v5.4.0), and switching between the proof types (https://github.com/filecoin-project/lotus/pull/4873)
- Don't use terminated sectors for winning PoSt (https://github.com/filecoin-project/lotus/pull/4770)
- Various small VM-level edge-case handling (https://github.com/filecoin-project/lotus/pull/4783)
- Correction of the VM circulating supply calculation (https://github.com/filecoin-project/lotus/pull/4862)
- Retuning gas costs (https://github.com/filecoin-project/lotus/pull/4830)
- Avoid sending messages to the zero BLS address (https://github.com/filecoin-project/lotus/pull/4888)
## Other Changes
- delayed pubsub subscribe for messages topic (https://github.com/filecoin-project/lotus/pull/3646)
- add chain base64 decode params (https://github.com/filecoin-project/lotus/pull/4748)
- chore(dep): update bitswap to fix an initialization race that could panic (https://github.com/filecoin-project/lotus/pull/4855)
- Chore/blockstore nits (https://github.com/filecoin-project/lotus/pull/4813)
- Print Consensus Faults in miner info (https://github.com/filecoin-project/lotus/pull/4853)
- Truncate genesis file before generating (https://github.com/filecoin-project/lotus/pull/4851)
- miner: Winning PoSt Warmup (https://github.com/filecoin-project/lotus/pull/4824)
- Fix init actor address map diffing (https://github.com/filecoin-project/lotus/pull/4875)
- Bump API versions to 1.0.0 (https://github.com/filecoin-project/lotus/pull/4884)
- Fix cid recording issue (https://github.com/filecoin-project/lotus/pull/4874)
- Speed up worker key retrieval (https://github.com/filecoin-project/lotus/pull/4885)
- Add error codes to worker return (https://github.com/filecoin-project/lotus/pull/4890)
- Update go to 1.15.5 (https://github.com/filecoin-project/lotus/pull/4896)
- Fix MaxSealingSectrosForDeals getting reset to 0 (https://github.com/filecoin-project/lotus/pull/4879)
- add sanity check for maximum block size (https://github.com/filecoin-project/lotus/pull/3171)
- Check (pre)commit receipt before other checks in failed states (https://github.com/filecoin-project/lotus/pull/4712)
- fix badger double open on daemon --import-snapshot; chainstore lifecycle (https://github.com/filecoin-project/lotus/pull/4872)
- Update to ipfs-blockstore 1.0.3 (https://github.com/filecoin-project/lotus/pull/4897)
- break loop when found warm up sector (https://github.com/filecoin-project/lotus/pull/4869)
- Tweak handling of bad beneficaries in DeleteActor (https://github.com/filecoin-project/lotus/pull/4903)
- cap maximum number of messages per block in selection (https://github.com/filecoin-project/lotus/pull/4905)
- Set Calico epoch (https://github.com/filecoin-project/lotus/pull/4889)
# 1.1.3 / 2020-11-13
This is an optional release of Lotus that upgrades Lotus dependencies, and includes many performance enhancements, bugfixes, and UX improvements.
## Highlights
- Refactored much of the miner code (https://github.com/filecoin-project/lotus/pull/3618), improving its recovery from restarts and overall sector success rate
- Updated [proofs](https://github.com/filecoin-project/rust-fil-proofs) to v5.3.0, which brings significant performance improvements
- Updated [markets](https://github.com/filecoin-project/go-fil-markets/releases/tag/v1.0.4) to v1.0.4, which reduces failures due to reorgs (https://github.com/filecoin-project/lotus/pull/4730) and uses the newly refactored fund manager (https://github.com/filecoin-project/lotus/pull/4736)
## Changes
#### Core Lotus
- polish: add Equals method to MinerInfo shim (https://github.com/filecoin-project/lotus/pull/4604)
- Fix messagepool accounting (https://github.com/filecoin-project/lotus/pull/4668)
- Prep for gas balancing (https://github.com/filecoin-project/lotus/pull/4651)
- Reduce badger ValueThreshold to 128 (https://github.com/filecoin-project/lotus/pull/4629)
- Config for default max gas fee (https://github.com/filecoin-project/lotus/pull/4652)
- bootstrap: don't return early when one drand resolution fails (https://github.com/filecoin-project/lotus/pull/4626)
- polish: add ClaimsChanged and DiffClaims method to power shim (https://github.com/filecoin-project/lotus/pull/4628)
- Simplify chain event Called API (https://github.com/filecoin-project/lotus/pull/4664)
- Cache deal states for most recent old/new tipset (https://github.com/filecoin-project/lotus/pull/4623)
- Add miner available balance and power info to state miner info (https://github.com/filecoin-project/lotus/pull/4618)
- Call GetHeaviestTipSet() only once when syncing (https://github.com/filecoin-project/lotus/pull/4696)
- modify runtime gasUsed printf (https://github.com/filecoin-project/lotus/pull/4704)
- Rename builtin actor generators (https://github.com/filecoin-project/lotus/pull/4697)
- Move gas multiplier as property of pricelist (https://github.com/filecoin-project/lotus/pull/4728)
- polish: add msig pendingtxn diffing and comp (https://github.com/filecoin-project/lotus/pull/4719)
- Optional chain Bitswap (https://github.com/filecoin-project/lotus/pull/4717)
- rewrite sync manager (https://github.com/filecoin-project/lotus/pull/4599)
- async connect to bootstrappers (https://github.com/filecoin-project/lotus/pull/4785)
- head change coalescer (https://github.com/filecoin-project/lotus/pull/4688)
- move to native badger blockstore; leverage zero-copy View() to deserialize in-place (https://github.com/filecoin-project/lotus/pull/4681)
- badger blockstore: minor improvements (https://github.com/filecoin-project/lotus/pull/4811)
- Do not fail wallet delete because of pre-existing trashed key (https://github.com/filecoin-project/lotus/pull/4589)
- Correctly delete the default wallet address (https://github.com/filecoin-project/lotus/pull/4705)
- Reduce badger ValueTreshold to 128 (https://github.com/filecoin-project/lotus/pull/4629)
- predicates: Fast StateGetActor wrapper (https://github.com/filecoin-project/lotus/pull/4835)
#### Mining
- worker key should change when set sender found key not equal with the value on chain (https://github.com/filecoin-project/lotus/pull/4595)
- extern/sector-storage: fix GPU usage overwrite bug (https://github.com/filecoin-project/lotus/pull/4627)
- sectorstorage: Fix manager restart edge-case (https://github.com/filecoin-project/lotus/pull/4645)
- storagefsm: Fix GetTicket loop when the sector is already precommitted (https://github.com/filecoin-project/lotus/pull/4643)
- Debug flag to force running sealing scheduler (https://github.com/filecoin-project/lotus/pull/4662)
- Fix worker reenabling, handle multiple restarts in worker (https://github.com/filecoin-project/lotus/pull/4666)
- keep retrying the proof until we run out of sectors to skip (https://github.com/filecoin-project/lotus/pull/4633)
- worker: Commands to pause/resume task processing (https://github.com/filecoin-project/lotus/pull/4615)
- struct name incorrect (https://github.com/filecoin-project/lotus/pull/4699)
- optimize code replace strings with constants (https://github.com/filecoin-project/lotus/pull/4769)
- optimize pledge sector (https://github.com/filecoin-project/lotus/pull/4765)
- Track sealing processes across lotus-miner restarts (https://github.com/filecoin-project/lotus/pull/3618)
- Fix scheduler lockups after storage is freed (https://github.com/filecoin-project/lotus/pull/4778)
- storage: Track worker hostnames with work (https://github.com/filecoin-project/lotus/pull/4779)
- Expand sched-diag; Command to abort sealing calls (https://github.com/filecoin-project/lotus/pull/4804)
- miner: Winning PoSt Warmup (https://github.com/filecoin-project/lotus/pull/4824)
- docsgen: Support miner/worker (https://github.com/filecoin-project/lotus/pull/4817)
- miner: Basic storage cleanup command (https://github.com/filecoin-project/lotus/pull/4834)
#### Markets and Data Transfer
- Flesh out data transfer features (https://github.com/filecoin-project/lotus/pull/4572)
- Fix memory leaks in data transfer (https://github.com/filecoin-project/lotus/pull/4619)
- Handle deal id changes in OnDealSectorCommitted (https://github.com/filecoin-project/lotus/pull/4730)
- Refactor FundManager (https://github.com/filecoin-project/lotus/pull/4736)
- refactor: integrate new FundManager (https://github.com/filecoin-project/lotus/pull/4787)
- Fix race in paych manager when req context is cancelled (https://github.com/filecoin-project/lotus/pull/4803)
- fix race in paych manager add funds (https://github.com/filecoin-project/lotus/pull/4597)
- Fix panic in FundManager (https://github.com/filecoin-project/lotus/pull/4808)
- Fix: dont crash on startup if funds migration fails (https://github.com/filecoin-project/lotus/pull/4827)
#### UX
- Make EarlyExpiration in sectors list less scary (https://github.com/filecoin-project/lotus/pull/4600)
- Add commands to change the worker key (https://github.com/filecoin-project/lotus/pull/4513)
- Expose ClientDealSize via CLI (https://github.com/filecoin-project/lotus/pull/4569)
- client deal: Cache CommD when creating multiple deals (https://github.com/filecoin-project/lotus/pull/4535)
- miner sectors list: flags for events/seal time (https://github.com/filecoin-project/lotus/pull/4649)
- make IPFS online mode configurable (https://github.com/filecoin-project/lotus/pull/4650)
- Add sync status to miner info command (https://github.com/filecoin-project/lotus/pull/4669)
- Add a StateDecodeParams method (https://github.com/filecoin-project/lotus/pull/4105)
- sched: Interactive RPC Shell (https://github.com/filecoin-project/lotus/pull/4692)
- Add api for getting status given a code (https://github.com/filecoin-project/lotus/pull/4210)
- Update lotus-stats with a richer cli (https://github.com/filecoin-project/lotus/pull/4718)
- Use TSK passed to GasEstimateGasLimit (https://github.com/filecoin-project/lotus/pull/4739)
- match data type for reward state api (https://github.com/filecoin-project/lotus/pull/4745)
- Add `termination-estimate` to get an estimation for how much a termination penalty will be (https://github.com/filecoin-project/lotus/pull/4617)
- Restrict `ParseFIL` input length (https://github.com/filecoin-project/lotus/pull/4780)
- cmd sectors commitIDs len debug (https://github.com/filecoin-project/lotus/pull/4786)
- Add client deal-stats CLI (https://github.com/filecoin-project/lotus/pull/4788)
- Modify printf format (https://github.com/filecoin-project/lotus/pull/4795)
- Updated msig inspect (https://github.com/filecoin-project/lotus/pull/4533)
- Delete the duplicate output (https://github.com/filecoin-project/lotus/pull/4819)
- miner: Storage list sectors command (https://github.com/filecoin-project/lotus/pull/4831)
- drop a few logs down to debug (https://github.com/filecoin-project/lotus/pull/4832)
#### Testing and Tooling
- refactor: share code between CLI tests (https://github.com/filecoin-project/lotus/pull/4598)
- Fix flaky TestCLIDealFlow (https://github.com/filecoin-project/lotus/pull/4608)
- Fix flaky testMiningReal (https://github.com/filecoin-project/lotus/pull/4609)
- Add election run-dummy command (https://github.com/filecoin-project/lotus/pull/4498)
- Fix .gitmodules (https://github.com/filecoin-project/lotus/pull/4713)
- fix metrics wiring.(https://github.com/filecoin-project/lotus/pull/4691)
- shed: Util for creating ID CIDs (https://github.com/filecoin-project/lotus/pull/4726)
- Run kumquat upgrade on devnets (https://github.com/filecoin-project/lotus/pull/4734)
- Make pond work again (https://github.com/filecoin-project/lotus/pull/4775)
- lotus-stats: fix influx flags (https://github.com/filecoin-project/lotus/pull/4810)
- 2k sync BootstrapPeerThreshold (https://github.com/filecoin-project/lotus/pull/4797)
- test for FundManager panic to ensure it is fixed (https://github.com/filecoin-project/lotus/pull/4825)
- Stop mining at the end of tests (https://github.com/filecoin-project/lotus/pull/4826)
- Make some logs quieter (https://github.com/filecoin-project/lotus/pull/4709)
#### Dependencies
- update filecoin-ffi in go mod (https://github.com/filecoin-project/lotus/pull/4584)
- Update FFI (https://github.com/filecoin-project/lotus/pull/4613)
- feat: integrate new optional blst backend and verification optimizations from proofs (https://github.com/filecoin-project/lotus/pull/4630)
- Use https for blst submodule (https://github.com/filecoin-project/lotus/pull/4710)
- Update go-bitfield (https://github.com/filecoin-project/lotus/pull/4756)
- Update Yamux (https://github.com/filecoin-project/lotus/pull/4758)
- Update to latest go-bitfield (https://github.com/filecoin-project/lotus/pull/4793)
- Update to latest go-address (https://github.com/filecoin-project/lotus/pull/4798)
- update libp2p for stream interface changes (https://github.com/filecoin-project/lotus/pull/4814)
# 1.1.2 / 2020-10-24
This is a patch release of Lotus that builds on the fixes involving worker keys that was introduced in v1.1.1. Miners and node operators should update to this release as soon as possible in order to ensure their blocks are propagated and validated.
## Changes
- Handle worker key changes correctly in runtime (https://github.com/filecoin-project/lotus/pull/4579)
# 1.1.1 / 2020-10-24
This is a patch release of Lotus that addresses some issues caused by when miners change their worker keys. Miners and node operators should update to this release as soon as possible, especially any miner who has changed their worker key recently.
## Changes
- Miner finder for interactive client deal CLI (https://github.com/filecoin-project/lotus/pull/4504)
- Disable blockstore bloom filter (https://github.com/filecoin-project/lotus/pull/4512)
- Add api for getting status given a code (https://github.com/filecoin-project/lotus/pull/4210)
- add batch api for push messages (https://github.com/filecoin-project/lotus/pull/4236)
- add measure datastore wrapper around bench chain datastore (https://github.com/filecoin-project/lotus/pull/4302)
- Look at block base fee for PCR (https://github.com/filecoin-project/lotus/pull/4313)
- Add a shed util to determine % of power that has won a block (https://github.com/filecoin-project/lotus/pull/4318)
- Shed/borked cmd (https://github.com/filecoin-project/lotus/pull/4339)
- optimize mining code (https://github.com/filecoin-project/lotus/pull/4379)
- heaviestTipSet reurning nil is a ok (https://github.com/filecoin-project/lotus/pull/4523)
- Remove most v0 actor imports (https://github.com/filecoin-project/lotus/pull/4383)
- Small chain export optimization (https://github.com/filecoin-project/lotus/pull/4536)
- Add block list to pcr (https://github.com/filecoin-project/lotus/pull/4314)
- Fix circ supply default in conformance (https://github.com/filecoin-project/lotus/pull/4449)
- miner: fix init --create-worker-key (https://github.com/filecoin-project/lotus/pull/4475)
- make push and addLocal atomic (https://github.com/filecoin-project/lotus/pull/4500)
- add some methods that oni needs (https://github.com/filecoin-project/lotus/pull/4501)
- MinerGetBaseInfo: if miner is not found in lookback, check current (https://github.com/filecoin-project/lotus/pull/4508)
- Delete wallet from local wallet cache (https://github.com/filecoin-project/lotus/pull/4526)
- Fix lotus-shed ledger list (https://github.com/filecoin-project/lotus/pull/4521)
- Manage sectors by size instead of proof type (https://github.com/filecoin-project/lotus/pull/4511)
- Feat/api request metrics wrapper (https://github.com/filecoin-project/lotus/pull/4516)
- Fix chain sync stopping to sync (https://github.com/filecoin-project/lotus/pull/4541)
- Use the correct lookback for the worker key when creating blocks (https://github.com/filecoin-project/lotus/pull/4539)
- Cleanup test initialization and always validate VRFs in tests (https://github.com/filecoin-project/lotus/pull/4538)
- Add a market WithdrawBalance CLI (https://github.com/filecoin-project/lotus/pull/4524)
- wallet list: Add market balance and ID address flags (https://github.com/filecoin-project/lotus/pull/4555)
- tvx simulate command; tvx extract --ignore-sanity-checks (https://github.com/filecoin-project/lotus/pull/4554)
- lotus-lite: CLI tests for `lotus client` commands (https://github.com/filecoin-project/lotus/pull/4497)
- lite-mode - market storage and retrieval clients (https://github.com/filecoin-project/lotus/pull/4263)
- Chore: update drand to v1.2.0 (https://github.com/filecoin-project/lotus/pull/4420)
- Fix random test failures (https://github.com/filecoin-project/lotus/pull/4559)
- Fix flaky TestTimedBSSimple (https://github.com/filecoin-project/lotus/pull/4561)
- Make wallet market withdraw usable with miner addresses (https://github.com/filecoin-project/lotus/pull/4556)
- Fix flaky TestChainExportImportFull (https://github.com/filecoin-project/lotus/pull/4564)
- Use older randomness for the PoSt commit on specs-actors version 2 (https://github.com/filecoin-project/lotus/pull/4563)
- shed: Commad to decode messages (https://github.com/filecoin-project/lotus/pull/4565)
- Fetch worker key from correct block on sync (https://github.com/filecoin-project/lotus/pull/4573)
# 1.1.0 / 2020-10-20
This is a mandatory release that introduces the first post-liftoff upgrade to the Filecoin network. The changes that break consensus are an upgrade to specs-actors v2.2.0 at epoch 170000.
## Changes
- Introduce Network version 6 (https://github.com/filecoin-project/lotus/pull/4506)
- Update markets v1.0.0 (https://github.com/filecoin-project/lotus/pull/4505)
- Add some extra logging to try and debug sync issues (https://github.com/filecoin-project/lotus/pull/4486)
- Circle: Run tests for some subsystems separately (https://github.com/filecoin-project/lotus/pull/4496)
- Add a terminate sectors command to lotus-shed (https://github.com/filecoin-project/lotus/pull/4507)
- Add a comment to BlockMessages to address #4446 (https://github.com/filecoin-project/lotus/pull/4491)
# 1.0.0 / 2020-10-19
It's 1.0.0! This is an optional release of Lotus that introduces some UX improvements to the 0.10 series.
This very small release is largely cosmetic, and intended to flag the code that the Filecoin mainnet was launched with.
## API changes
- `StateMsgGasCost` has been removed. The equivalent information can be gained by calling `StateReplay`.
- A `GasCost` field has been added to the `InvocResult` type, meaning detailed gas costs will be returned when calling `StateReplay`, `StateCompute`, and `StateCall`.
- The behaviour of `StateReplay` in response to an empty tipset key has been changed. Instead of simply using the heaviest tipset (which is almost guaranteed to be an unsuccessful replay), we search now search the chain for the tipset that included the message, and replay the message in that tipset (we fail if no such tipset is found).
## Changes
- Increase code coverage! (https://github.com/filecoin-project/lotus/pull/4410)
- Mpool: Don't block node startup loading messages (https://github.com/filecoin-project/lotus/pull/4411)
- Improve the UX of multisig approves (https://github.com/filecoin-project/lotus/pull/4398)
- Use build.BlockDelaySecs for deal start buffer (https://github.com/filecoin-project/lotus/pull/4415)
- Conformance: support multiple protocol versions (https://github.com/filecoin-project/lotus/pull/4393)
- Ensure msig inspect cli works with lotus-lite (https://github.com/filecoin-project/lotus/pull/4421)
- Add command to (slowly) prune lotus chain datastore (https://github.com/filecoin-project/lotus/pull/3876)
- Add WalletVerify to lotus-gateway (https://github.com/filecoin-project/lotus/pull/4373)
- Improve StateMsg APIs (https://github.com/filecoin-project/lotus/pull/4429)
- Add endpoints needed by spacegap (https://github.com/filecoin-project/lotus/pull/4426)
- Make audit balances capable of printing robust addresses (https://github.com/filecoin-project/lotus/pull/4423)
- Custom filters for retrieval deals (https://github.com/filecoin-project/lotus/pull/4424)
- Fix message list api (https://github.com/filecoin-project/lotus/pull/4422)
- Replace bootstrap peers (https://github.com/filecoin-project/lotus/pull/4447)
- Don't overwrite previously-configured maxPieceSize for a persisted ask (https://github.com/filecoin-project/lotus/pull/4480)
- State: optimize state snapshot address cache (https://github.com/filecoin-project/lotus/pull/4481)
# 0.10.2 / 2020-10-14
This is an optional release of Lotus that updates markets to 0.9.1, which fixes an issue affecting deals that were mid-transfer when the node was upgraded to 0.9.0. This release also includes some tweaks to default gas values and minor performance improvements.
## Changes
- Use updated stored ask API (https://github.com/filecoin-project/lotus/pull/4384)
- tvx: trace puts to blockstore for inclusion in CAR. (https://github.com/filecoin-project/lotus/pull/4278)
- Add propose remove (https://github.com/filecoin-project/lotus/pull/4311)
- Update to 0.9.1 bugfix release (https://github.com/filecoin-project/lotus/pull/4402)
- Update drand endpoints (https://github.com/filecoin-project/lotus/pull/4125)
- fix: return true when deadlines changed (https://github.com/filecoin-project/lotus/pull/4403)
- sync wait --watch (https://github.com/filecoin-project/lotus/pull/4396)
- reduce garbage in blockstore (https://github.com/filecoin-project/lotus/pull/4406)
- give the TimeCacheBS tests a bit more time (https://github.com/filecoin-project/lotus/pull/4407)
- Improve gas defaults (https://github.com/filecoin-project/lotus/pull/4408)
- Change default gas premium to for 10 block inclusion (https://github.com/filecoin-project/lotus/pull/4222)
# 0.10.1 / 2020-10-14
This is an optional release of Lotus that updates markets to 0.9.0, which adds the ability to restart data transfers. This release also introduces Ledger support, and various UX improvements.
## Changes
- Test the tape upgrade (https://github.com/filecoin-project/lotus/pull/4328)
- Adding in Ledger support (https://github.com/filecoin-project/lotus/pull/4290)
- Improve the UX for lotus-miner sealing workers (https://github.com/filecoin-project/lotus/pull/4329)
- Add a CLI tool for miner's to repay debt (https://github.com/filecoin-project/lotus/pull/4319)
- Rename params_testnet to params_mainnet (https://github.com/filecoin-project/lotus/pull/4336)
- Use seal-duration in calculating the earliest StartEpoch (https://github.com/filecoin-project/lotus/pull/4337)
- Reject deals that are > 7 days in the future in the BasicDealFilter (https://github.com/filecoin-project/lotus/pull/4173)
- Add an API endpoint to calculate the exact circulating supply (https://github.com/filecoin-project/lotus/pull/4148)
- lotus-pcr: ignore all other market messages (https://github.com/filecoin-project/lotus/pull/4341)
- Add message CID to InvocResult (https://github.com/filecoin-project/lotus/pull/4382)
- types: Add CID fields to messages in json marshalers (https://github.com/filecoin-project/lotus/pull/4338)
- fix(sync state): set state height to actual tipset height (https://github.com/filecoin-project/lotus/pull/4347)
- Fix off by one tipset in searchBackForMsg (https://github.com/filecoin-project/lotus/pull/4367)
- fix a panic on startup when we fail to load the tipset (https://github.com/filecoin-project/lotus/pull/4376)
- Avoid having the same message CID show up in execution traces (https://github.com/filecoin-project/lotus/pull/4350)
- feat(markets): update markets 0.9.0 and add data transfer restart (https://github.com/filecoin-project/lotus/pull/4363)
# 0.10.0 / 2020-10-12
This is a consensus-breaking hotfix that addresses an issue in specs-actors v2.0.3 that made it impossible to pledge new 32GiB sectors. The change in Lotus is to update to actors v2.1.0, behind the new network version 5.
## Changes
- make pledge test pass with the race detector (https://github.com/filecoin-project/lotus/pull/4291)
- fix a race in tipset cache usage (https://github.com/filecoin-project/lotus/pull/4282)
- add an api for removing multisig signers (https://github.com/filecoin-project/lotus/pull/4274)
- cli: Don't output errors to stdout (https://github.com/filecoin-project/lotus/pull/4298)
- Fix panic in wallet export when key is not found (https://github.com/filecoin-project/lotus/pull/4299)
- Dump the block validation cache whenever we perform an import (https://github.com/filecoin-project/lotus/pull/4287)
- Fix two races (https://github.com/filecoin-project/lotus/pull/4301)
- sync unmark-bad --all (https://github.com/filecoin-project/lotus/pull/4296)
- decode parameters for multisig transactions in inspect (https://github.com/filecoin-project/lotus/pull/4312)
- Chain is love (https://github.com/filecoin-project/lotus/pull/4321)
- lotus-stats: optmize getting miner power (https://github.com/filecoin-project/lotus/pull/4315)
- implement tape upgrade (https://github.com/filecoin-project/lotus/pull/4322)
# 0.9.1 / 2020-10-10
This release fixes an issue which may cause the actors v2 migration to compute the state incorrectly when more than one migration is running in parallel.
## Changes
- Make concurrent actor migrations safe (https://github.com/filecoin-project/lotus/pull/4293)
- Remote wallet backends (https://github.com/filecoin-project/lotus/pull/3583)
- Track funds in FundMgr correctly in case of AddFunds failing (https://github.com/filecoin-project/lotus/pull/4273)
- Partial lite-node mode (https://github.com/filecoin-project/lotus/pull/4095)
- Fix potential infinite loop in GetBestMiningCandidate (https://github.com/filecoin-project/lotus/pull/3444)
- sync wait: Handle processed message offset (https://github.com/filecoin-project/lotus/pull/4253)
- Add some new endpoints for querying Msig info (https://github.com/filecoin-project/lotus/pull/4250)
- Update markets v0.7.1 (https://github.com/filecoin-project/lotus/pull/4254)
- Optimize SearchForMessage and GetReceipt (https://github.com/filecoin-project/lotus/pull/4246)
- Use FIL instead of attoFIL in CLI more consistently (https://github.com/filecoin-project/lotus/pull/4249)
- fix: clash between daemon --api flag and cli tests (https://github.com/filecoin-project/lotus/pull/4241)
- add more info to chain sync lookback failure (https://github.com/filecoin-project/lotus/pull/4245)
- Add message counts to inspect chain output (https://github.com/filecoin-project/lotus/pull/4230)
# 0.9.0 / 2020-10-07
This consensus-breaking release of Lotus upgrades the actors version to v2.0.0. This requires migrating actor state from v0 to v2. The changes that break consensus are:
+74
View File
@@ -0,0 +1,74 @@
FROM golang:1.15.6 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 deps lotus lotus-miner lotus-worker lotus-shed lotus-chainwatch lotus-stats
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/
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
ENV LOTUS_PATH /var/lib/lotus
RUN mkdir /var/lib/lotus /var/tmp/filecoin-proof-parameters && chown fc /var/lib/lotus /var/tmp/filecoin-proof-parameters
USER fc
ENTRYPOINT ["/usr/local/bin/lotus"]
CMD ["-help"]
+56 -12
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) \< 1015005), 1)
$(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell expr $(GOVERSION) % 1000000 / 1000).$(shell expr $(GOVERSION) % 1000))
$(error Update Golang to version to at least 1.15.5)
endif
# git modules that need to be loaded
@@ -41,8 +41,14 @@ 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 2 ]] || (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,11 +63,23 @@ 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
lotus: $(BUILD_DEPS)
rm -f lotus
@@ -133,18 +151,30 @@ benchmarks:
lotus-pond: 2k
go build -o lotus-pond ./lotuspond
(cd lotuspond/front && npm i && CI=false npm run build)
.PHONY: lotus-pond
BINS+=lotus-pond
lotus-pond-front:
(cd lotuspond/front && npm i && CI=false npm run build)
.PHONY: lotus-pond-front
lotus-pond-app: lotus-pond-front lotus-pond
.PHONY: lotus-pond-app
lotus-townhall:
rm -f lotus-townhall
go build -o lotus-townhall ./cmd/lotus-townhall
(cd ./cmd/lotus-townhall/townhall && npm i && npm run build)
go run github.com/GeertJohan/go.rice/rice append --exec lotus-townhall -i ./cmd/lotus-townhall -i ./build
.PHONY: lotus-townhall
BINS+=lotus-townhall
lotus-townhall-front:
(cd ./cmd/lotus-townhall/townhall && npm i && npm run build)
.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
@@ -167,7 +197,7 @@ BINS+=lotus-bench
lotus-stats:
rm -f lotus-stats
go build -o lotus-stats ./cmd/lotus-stats
go build $(GOFLAGS) -o lotus-stats ./cmd/lotus-stats
go run github.com/GeertJohan/go.rice/rice append --exec lotus-stats -i ./build
.PHONY: lotus-stats
BINS+=lotus-stats
@@ -186,6 +216,18 @@ lotus-health:
.PHONY: lotus-health
BINS+=lotus-health
lotus-wallet:
rm -f lotus-wallet
go build -o lotus-wallet ./cmd/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
@@ -286,7 +328,9 @@ method-gen:
gen: type-gen method-gen
docsgen:
go run ./api/docgen > documentation/en/api-methods.md
go run ./api/docgen "api/api_full.go" "FullNode" > documentation/en/api-methods.md
go run ./api/docgen "api/api_storage.go" "StorageMiner" > documentation/en/api-methods-miner.md
go run ./api/docgen "api/api_worker.go" "WorkerAPI" > documentation/en/api-methods-worker.md
print-%:
@echo $*=$($*)
+23 -16
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.15.5-blue.svg" /></a>
<br>
</p>
@@ -24,24 +24,31 @@ For instructions on how to build, install and setup lotus, please visit [https:/
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.
## License
+5 -11
View File
@@ -2,13 +2,11 @@
## Reporting a Vulnerability
For *critical* bugs, please send an email to security@filecoin.org.
The bug reporting process differs between bugs that are critical and may crash the network, and others that are unlikely to cause problems if malicious parties know about it. For non-critical bugs, please simply file a GitHub [issue](https://github.com/filecoin-project/lotus/issues/new?template=bug_report.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.
@@ -18,12 +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, .
## Supported Versions
## Reporting a non security bug
* TODO: This should be defined and set up by Mainnet launch.
| Version | Supported |
| ------- | ------------------ |
| Testnet | :white_check_mark: |
For non-security bugs, please simply file a GitHub [issue](https://github.com/filecoin-project/lotus/issues/new?template=bug_report.md).
+16 -7
View File
@@ -4,13 +4,13 @@ import (
"context"
"fmt"
"github.com/google/uuid"
"github.com/filecoin-project/go-jsonrpc/auth"
metrics "github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
protocol "github.com/libp2p/go-libp2p-core/protocol"
"github.com/filecoin-project/lotus/build"
)
type Common interface {
@@ -31,6 +31,7 @@ type Common interface {
NetPubsubScores(context.Context) ([]PubsubScore, error)
NetAutoNatStatus(context.Context) (NatInfo, error)
NetAgentVersion(ctx context.Context, p peer.ID) (string, error)
NetPeerInfo(context.Context, peer.ID) (*ExtendedPeerInfo, error)
// NetBandwidthStats returns statistics about the nodes total bandwidth
// usage and current rate across all peers and protocols.
@@ -44,13 +45,18 @@ type Common interface {
// usage and current rate per protocol
NetBandwidthStatsByProtocol(ctx context.Context) (map[protocol.ID]metrics.Stats, error)
// ConnectionGater API
NetBlockAdd(ctx context.Context, acl NetBlockList) error
NetBlockRemove(ctx context.Context, acl NetBlockList) error
NetBlockList(ctx context.Context) (NetBlockList, error)
// 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)
LogList(context.Context) ([]string, error)
LogSetLevel(context.Context, string, string) error
@@ -58,18 +64,21 @@ type Common interface {
// trigger graceful shutdown
Shutdown(context.Context) error
// Session returns a random UUID of api provider session
Session(context.Context) (uuid.UUID, error)
Closing(context.Context) (<-chan struct{}, error)
}
// 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,7 +86,7 @@ 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())
}
+158 -16
View File
@@ -2,9 +2,11 @@ package api
import (
"context"
"encoding/json"
"fmt"
"time"
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-state-types/network"
"github.com/ipfs/go-cid"
@@ -30,6 +32,14 @@ import (
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
//go:generate go run github.com/golang/mock/mockgen -destination=mocks/mock_full.go -package=mocks . FullNode
// ChainIO abstracts operations for accessing raw IPLD objects.
type ChainIO interface {
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
ChainHasObj(context.Context, cid.Cid) (bool, error)
}
// FullNode API is a low-level interface to the Filecoin network full node
type FullNode interface {
Common
@@ -172,6 +182,9 @@ type FullNode interface {
// SyncUnmarkBad unmarks a blocks as bad, making it possible to be validated and synced again.
SyncUnmarkBad(ctx context.Context, bcid cid.Cid) error
// SyncUnmarkAllBad purges bad block cache, making it possible to sync to chains previously marked as bad
SyncUnmarkAllBad(ctx context.Context) error
// 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)
@@ -203,6 +216,15 @@ type FullNode interface {
// based on current chain conditions
MpoolPushMessage(ctx context.Context, msg *types.Message, spec *MessageSendSpec) (*types.SignedMessage, error)
// MpoolBatchPush batch pushes a signed message to mempool.
MpoolBatchPush(context.Context, []*types.SignedMessage) ([]cid.Cid, error)
// MpoolBatchPushUntrusted batch pushes a signed message to mempool from untrusted sources.
MpoolBatchPushUntrusted(context.Context, []*types.SignedMessage) ([]cid.Cid, error)
// MpoolBatchPushMessage batch pushes a unsigned message to mempool.
MpoolBatchPushMessage(context.Context, []*types.Message, *MessageSendSpec) ([]*types.SignedMessage, error)
// 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)
@@ -226,7 +248,9 @@ type FullNode interface {
// MethodGroup: Wallet
// WalletNew creates a new address in the wallet with the given sigType.
WalletNew(context.Context, crypto.SigType) (address.Address, error)
// 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)
// WalletHas indicates whether the given address is in the wallet.
WalletHas(context.Context, address.Address) (bool, error)
// WalletList lists all the addresses in the wallet.
@@ -271,6 +295,8 @@ type FullNode interface {
ClientListDeals(ctx context.Context) ([]DealInfo, error)
// ClientGetDealUpdates returns the status of updated deals
ClientGetDealUpdates(ctx context.Context) (<-chan DealInfo, error)
// ClientGetDealStatus returns status given a code
ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error)
// ClientHasLocal indicates whether a certain CID is locally stored.
ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error)
// ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer).
@@ -284,6 +310,8 @@ type FullNode interface {
ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *FileRef) (<-chan marketevents.RetrievalEvent, error)
// ClientQueryAsk returns a signed StorageAsk from the specified miner.
ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error)
// ClientCalcCommP calculates the CommP and data size of the specified CID
ClientDealPieceCID(ctx context.Context, root cid.Cid) (DataCIDSize, error)
// ClientCalcCommP calculates the CommP for a specified file
ClientCalcCommP(ctx context.Context, inpath string) (*CommPRet, error)
// ClientGenCar generates a CAR file for the specified file.
@@ -293,6 +321,10 @@ type FullNode interface {
// ClientListTransfers returns the status of all ongoing transfers of data
ClientListDataTransfers(ctx context.Context) ([]DataTransferChannel, error)
ClientDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error)
// 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
// 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
// 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
@@ -307,19 +339,26 @@ type FullNode interface {
// MethodGroup: State
// The State methods are used to query, inspect, and interact with chain state.
// All methods take a TipSetKey as a parameter. The state looked up is the state at that tipset.
// 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) (*InvocResult, error)
// StateReplay returns the result of executing the indicated message, assuming it was executed in the indicated tipset.
// StateReplay replays a given message, assuming it was included in a block in the specified tipset.
// If no tipset key is provided, the appropriate tipset is looked up.
StateReplay(context.Context, types.TipSetKey, cid.Cid) (*InvocResult, error)
// StateGetActor returns the indicated actor's nonce and balance.
StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error)
// StateReadState returns the indicated actor's state.
StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*ActorState, error)
// StateListMessages looks back and returns all messages with a matching to or from address, stopping at the given height.
StateListMessages(ctx context.Context, match *types.Message, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error)
StateListMessages(ctx context.Context, match *MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error)
// 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)
// StateNetworkName returns the name of the network the node is synced to
StateNetworkName(context.Context) (dtypes.NetworkName, error)
@@ -350,6 +389,8 @@ type FullNode interface {
StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error)
// 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)
// StateMinerSectorAllocated checks if a sector is allocated
StateMinerSectorAllocated(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error)
// StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector
StateSectorPreCommitInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error)
// StateSectorGetInfo returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found
@@ -362,11 +403,15 @@ type FullNode interface {
StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error)
// StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed
StateSearchMsg(context.Context, cid.Cid) (*MsgLookup, error)
// StateMsgGasCost searches for a message in the chain, and returns details of the messages gas costs, including the penalty and miner tip
StateMsgGasCost(context.Context, cid.Cid, types.TipSetKey) (*MsgGasCost, error)
// StateSearchMsgLimited looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed
StateSearchMsgLimited(ctx context.Context, msg cid.Cid, limit abi.ChainEpoch) (*MsgLookup, error)
// 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.
StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*MsgLookup, error)
// 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.
StateWaitMsgLimited(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch) (*MsgLookup, error)
// StateListMiners returns the addresses of every miner that has claimed power in the Power Actor
StateListMiners(context.Context, types.TipSetKey) ([]address.Address, error)
// StateListActors returns the addresses of every actor in the state
@@ -407,8 +452,12 @@ type FullNode interface {
// can issue. It takes the deal size and verified status as parameters.
StateDealProviderCollateralBounds(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (DealCollateralBounds, error)
// StateCirculatingSupply returns the circulating supply of Filecoin at the given tipset
StateCirculatingSupply(context.Context, types.TipSetKey) (CirculatingSupply, error)
// 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)
// 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) (CirculatingSupply, error)
// StateNetworkVersion returns the network version at the given tipset
StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
@@ -418,9 +467,17 @@ type FullNode interface {
// 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)
// MsigGetVestingSchedule returns the vesting details of a given multisig.
MsigGetVestingSchedule(context.Context, address.Address, types.TipSetKey) (MsigVesting, error)
// 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)
//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) ([]*MsigTransaction, error)
// 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>
@@ -429,12 +486,21 @@ type FullNode interface {
// 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)
// MsigApprove approves a previously-proposed multisig message
// 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)
// 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 proposed message>, <params to include in the proposed message>
MsigApprove(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error)
MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error)
// MsigCancel cancels a previously-proposed multisig message
// It takes the following params: <multisig address>, <proposed message ID>, <recipient address>, <value to transfer>,
// 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)
// MsigAddPropose proposes adding a signer in the multisig
@@ -462,8 +528,23 @@ type FullNode interface {
// <old signer>, <new signer>
MsigSwapCancel(context.Context, address.Address, address.Address, uint64, address.Address, address.Address) (cid.Cid, error)
MarketEnsureAvailable(context.Context, address.Address, address.Address, types.BigInt) (cid.Cid, error)
// MarketFreeBalance
// 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)
// MarketAddBalance adds funds to the market actor
MarketAddBalance(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error)
// MarketGetReserved gets the amount of funds that are currently reserved for the address
MarketGetReserved(ctx context.Context, addr address.Address) (types.BigInt, error)
// MarketReserveFunds reserves funds for a deal
MarketReserveFunds(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error)
// MarketReleaseFunds releases funds reserved by MarketReserveFunds
MarketReleaseFunds(ctx context.Context, addr address.Address, amt types.BigInt) error
// MarketWithdraw withdraws unlocked funds from the market actor
MarketWithdraw(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error)
// MethodGroup: Paych
// The Paych methods are for interacting with and managing payment channels
@@ -537,6 +618,9 @@ type DealInfo struct {
CreationTime time.Time
Verified bool
TransferChannelID *datatransfer.ChannelID
DataTransfer *DataTransferChannel
}
type MsgLookup struct {
@@ -558,6 +642,8 @@ type MsgGasCost struct {
TotalCost abi.TokenAmount
}
// BlsMessages[x].cid = Cids[x]
// SecpkMessages[y].cid = Cids[BlsMessages.length + y]
type BlockMessages struct {
BlsMessages []*types.Message
SecpkMessages []*types.SignedMessage
@@ -572,6 +658,7 @@ type Message struct {
type ActorState struct {
Balance types.BigInt
Code cid.Cid
State interface{}
}
@@ -703,8 +790,10 @@ type RetrievalOrder struct {
}
type InvocResult struct {
MsgCid cid.Cid
Msg *types.Message
MsgRct *types.MessageReceipt
GasCost MsgGasCost
ExecutionTrace types.ExecutionTrace
Error string
Duration time.Duration
@@ -727,14 +816,31 @@ type StartDealParams struct {
VerifiedDeal bool
}
func (s *StartDealParams) UnmarshalJSON(raw []byte) (err error) {
type sdpAlias StartDealParams
sdp := sdpAlias{
FastRetrieval: true,
}
if err := json.Unmarshal(raw, &sdp); err != nil {
return err
}
*s = StartDealParams(sdp)
return nil
}
type IpldObject struct {
Cid cid.Cid
Obj interface{}
}
type ActiveSync struct {
Base *types.TipSet
Target *types.TipSet
WorkerID uint64
Base *types.TipSet
Target *types.TipSet
Stage SyncStateStage
Height abi.ChainEpoch
@@ -764,6 +870,8 @@ const (
func (v SyncStateStage) String() string {
switch v {
case StageIdle:
return "idle"
case StageHeaders:
return "header sync"
case StagePersistHeaders:
@@ -839,6 +947,12 @@ type DataSize struct {
PieceSize abi.PaddedPieceSize
}
type DataCIDSize struct {
PayloadSize int64
PieceSize abi.PaddedPieceSize
PieceCID cid.Cid
}
type CommPRet struct {
Root cid.Cid
Size abi.UnpaddedPieceSize
@@ -856,7 +970,8 @@ const (
)
type Deadline struct {
PostSubmissions bitfield.BitField
PostSubmissions bitfield.BitField
DisputableProofCount uint64
}
type Partition struct {
@@ -871,3 +986,30 @@ type Fault struct {
Miner address.Address
Epoch abi.ChainEpoch
}
var EmptyVesting = MsigVesting{
InitialBalance: types.EmptyInt,
StartEpoch: -1,
UnlockDuration: -1,
}
type MsigVesting struct {
InitialBalance abi.TokenAmount
StartEpoch abi.ChainEpoch
UnlockDuration abi.ChainEpoch
}
type MessageMatch struct {
To address.Address
From address.Address
}
type MsigTransaction struct {
ID int64
To address.Address
Value abi.TokenAmount
Method abi.MethodNum
Params []byte
Approved []address.Address
}
+47
View File
@@ -0,0 +1,47 @@
package api
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/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
)
type GatewayAPI interface {
ChainHasObj(context.Context, cid.Cid) (bool, error)
ChainHead(ctx context.Context) (*types.TipSet, error)
ChainGetBlockMessages(context.Context, cid.Cid) (*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 []*HeadChange, error)
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
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)
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)
StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*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) (*MinerPower, error)
StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
StateSearchMsg(ctx context.Context, msg cid.Cid) (*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) (*MsgLookup, error)
}
+68 -4
View File
@@ -5,13 +5,19 @@ import (
"context"
"time"
"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"
@@ -25,11 +31,12 @@ type StorageMiner interface {
ActorAddress(context.Context) (address.Address, error)
ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error)
ActorAddressConfig(ctx context.Context) (AddressConfig, error)
MiningBase(context.Context) (*types.TipSet, error)
// Temp api for testing
PledgeSector(context.Context) error
PledgeSector(context.Context) (abi.SectorID, error)
// Get the status of a given sector by ID
SectorsStatus(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (SectorInfo, error)
@@ -37,6 +44,12 @@ type StorageMiner interface {
// List all staged sectors
SectorsList(context.Context) ([]abi.SectorNumber, error)
// Get summary info of sectors
SectorsSummary(ctx context.Context) (map[SectorState]int, error)
// List sectors in particular states
SectorsListInStates(context.Context, []SectorState) ([]abi.SectorNumber, error)
SectorsRefs(context.Context) (map[string][]SealedRef, error)
// SectorStartSealing can be called on sectors in Empty or WaitDeals states
@@ -53,7 +66,17 @@ type StorageMiner interface {
// SectorGetExpectedSealDuration gets the expected time for a sector to seal
SectorGetExpectedSealDuration(context.Context) (time.Duration, error)
SectorsUpdate(context.Context, abi.SectorNumber, SectorState) error
// 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
// 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
// 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)
// SectorTerminatePending returns a list of pending sector terminations to be sent in the next batch message
SectorTerminatePending(ctx context.Context) ([]abi.SectorID, error)
SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber) error
StorageList(ctx context.Context) (map[stores.ID][]stores.Decl, error)
@@ -62,11 +85,13 @@ type StorageMiner interface {
// 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)
WorkerStats(context.Context) (map[uuid.UUID]storiface.WorkerStats, error)
WorkerJobs(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error)
storiface.WorkerReturn
// SealingSchedDiag dumps internal sealing scheduler state
SealingSchedDiag(context.Context) (interface{}, error)
SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error)
SealingAbort(ctx context.Context, call storiface.CallID) error
stores.SectorIndex
@@ -81,6 +106,12 @@ type StorageMiner interface {
MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error)
MarketListDataTransfers(ctx context.Context) ([]DataTransferChannel, error)
MarketDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error)
// 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
// 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
MarketPendingDeals(ctx context.Context) (PendingDealInfo, error)
MarketPublishPendingDeals(ctx context.Context) error
DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error
DealsList(ctx context.Context) ([]MarketDeal, error)
@@ -94,6 +125,10 @@ type StorageMiner interface {
DealsSetConsiderOfflineStorageDeals(context.Context, bool) error
DealsConsiderOfflineRetrievalDeals(context.Context) (bool, error)
DealsSetConsiderOfflineRetrievalDeals(context.Context, bool) error
DealsConsiderVerifiedStorageDeals(context.Context) (bool, error)
DealsSetConsiderVerifiedStorageDeals(context.Context, bool) error
DealsConsiderUnverifiedStorageDeals(context.Context) (bool, error)
DealsSetConsiderUnverifiedStorageDeals(context.Context, bool) error
StorageAddLocal(ctx context.Context, path string) error
@@ -107,6 +142,8 @@ type StorageMiner interface {
// 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
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error)
}
type SealRes struct {
@@ -186,3 +223,30 @@ func (st *SealSeed) Equals(ost *SealSeed) bool {
}
type SectorState string
type AddrUse int
const (
PreCommitAddr AddrUse = iota
CommitAddr
PoStAddr
TerminateSectorsAddr
)
type AddressConfig struct {
PreCommitControl []address.Address
CommitControl []address.Address
TerminateControl []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
}
+47
View File
@@ -0,0 +1,47 @@
package api
import (
"context"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/lotus/chain/types"
)
type MsgType string
const (
MTUnknown = "unknown"
// Signing message CID. MsgMeta.Extra contains raw cbor message bytes
MTChainMsg = "message"
// Signing a blockheader. signing raw cbor block bytes (MsgMeta.Extra is empty)
MTBlock = "block"
// Signing a deal proposal. signing raw cbor proposal bytes (MsgMeta.Extra is empty)
MTDealProposal = "dealproposal"
// TODO: Deals, Vouchers, VRF
)
type MsgMeta struct {
Type MsgType
// Additional data related to what is signed. Should be verifiable with the
// signed bytes (e.g. CID(Extra).Bytes() == toSign)
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)
WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta MsgMeta) (*crypto.Signature, error)
WalletExport(context.Context, address.Address) (*types.KeyInfo, error)
WalletImport(context.Context, *types.KeyInfo) (address.Address, error)
WalletDelete(context.Context, address.Address) error
}
+21 -14
View File
@@ -2,39 +2,46 @@ package api
import (
"context"
"io"
"github.com/ipfs/go-cid"
"github.com/google/uuid"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/specs-storage/storage"
"github.com/filecoin-project/lotus/build"
)
type WorkerAPI interface {
Version(context.Context) (build.Version, error)
Version(context.Context) (Version, error)
// TODO: Info() (name, ...) ?
TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) // TaskType -> Weight
Paths(context.Context) ([]stores.StoragePath, error)
Info(context.Context) (storiface.WorkerInfo, error)
AddPiece(ctx context.Context, sector abi.SectorID, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (abi.PieceInfo, error)
storiface.WorkerCalls
storage.Sealer
TaskDisable(ctx context.Context, tt sealtasks.TaskType) error
TaskEnable(ctx context.Context, tt sealtasks.TaskType) error
MoveStorage(ctx context.Context, sector abi.SectorID, types stores.SectorFileType) error
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
StorageAddLocal(ctx context.Context, path string) error
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
Closing(context.Context) (<-chan struct{}, error)
Enabled(ctx context.Context) (bool, error)
// WaitQuiet blocks until there are no tasks running
WaitQuiet(ctx context.Context) error
// returns a random UUID of worker session, generated randomly when worker
// process starts
ProcessSession(context.Context) (uuid.UUID, error)
// Like ProcessSession, but returns an error when worker is disabled
Session(context.Context) (uuid.UUID, error)
}
-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{}
+6
View File
@@ -36,3 +36,9 @@ func PermissionedWorkerAPI(a api.WorkerAPI) api.WorkerAPI {
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
}
+596 -103
View File
File diff suppressed because it is too large Load Diff
+14 -5
View File
@@ -5,14 +5,18 @@ package api
import (
"fmt"
"io"
"sort"
abi "github.com/filecoin-project/go-state-types/abi"
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 _ = sort.Sort
func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
if t == nil {
@@ -171,7 +175,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 +324,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 +433,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 +582,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 +731,8 @@ 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) {})
}
}
+26
View File
@@ -82,3 +82,29 @@ 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
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
},
requestHeader,
opts...,
)
return &res, closer, err
}
func NewWalletRPC(ctx context.Context, addr string, requestHeader http.Header) (api.WalletAPI, jsonrpc.ClientCloser, error) {
var res apistruct.WalletStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
},
requestHeader,
)
return &res, closer, err
}
+134 -29
View File
@@ -6,12 +6,14 @@ import (
"go/ast"
"go/parser"
"go/token"
"os"
"reflect"
"sort"
"strings"
"time"
"unicode"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-filestore"
metrics "github.com/libp2p/go-libp2p-core/metrics"
@@ -24,6 +26,7 @@ import (
"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"
@@ -36,6 +39,10 @@ import (
"github.com/filecoin-project/lotus/api/apistruct"
"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"
)
@@ -83,10 +90,11 @@ func init() {
addExample(&pid)
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)
addExample(types.KTBLS)
addExample(int64(9))
addExample(12.3)
addExample(123)
@@ -105,7 +113,7 @@ func init() {
addExample(network.Connected)
addExample(dtypes.NetworkName("lotus"))
addExample(api.SyncStateStage(1))
addExample(build.FullAPIVersion)
addExample(api.FullAPIVersion)
addExample(api.PCHInbound)
addExample(time.Minute)
addExample(datatransfer.TransferID(3))
@@ -115,18 +123,20 @@ func init() {
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": {
@@ -161,9 +171,89 @@ 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 := multistore.StoreID(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)
}
func exampleValue(t, parent reflect.Type) interface{} {
func exampleValue(method string, t, parent reflect.Type) interface{} {
v, ok := ExampleValues[t]
if ok {
return v
@@ -172,25 +262,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
}
@@ -198,10 +288,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)
@@ -209,7 +299,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)))
}
}
@@ -217,6 +307,7 @@ func exampleStruct(t, parent reflect.Type) interface{} {
}
type Visitor struct {
Root string
Methods map[string]ast.Node
}
@@ -226,7 +317,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
}
@@ -242,7 +333,7 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor {
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 string) (map[string]string, map[string]string) { //nolint:golint
fset := token.NewFileSet()
pkgs, err := parser.ParseDir(fset, "./api", nil, parser.AllErrors|parser.ParseComments)
if err != nil {
@@ -251,11 +342,11 @@ func parseApiASTInfo() (map[string]string, map[string]string) { //nolint:golint
ap := pkgs["api"]
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)}
v := &Visitor{iface, make(map[string]ast.Node)}
ast.Walk(v, pkgs["api"])
groupDocs := make(map[string]string)
@@ -311,13 +402,30 @@ func methodGroupFromName(mn string) string {
}
func main() {
comments, groupComments := parseApiASTInfo()
comments, groupComments := parseApiASTInfo(os.Args[1], os.Args[2])
groups := make(map[string]*MethodGroup)
var api struct{ api.FullNode }
t := reflect.TypeOf(api)
var t reflect.Type
var permStruct, commonPermStruct reflect.Type
switch os.Args[2] {
case "FullNode":
t = reflect.TypeOf(new(struct{ api.FullNode })).Elem()
permStruct = reflect.TypeOf(apistruct.FullNodeStruct{}.Internal)
commonPermStruct = reflect.TypeOf(apistruct.CommonStruct{}.Internal)
case "StorageMiner":
t = reflect.TypeOf(new(struct{ api.StorageMiner })).Elem()
permStruct = reflect.TypeOf(apistruct.StorageMinerStruct{}.Internal)
commonPermStruct = reflect.TypeOf(apistruct.CommonStruct{}.Internal)
case "WorkerAPI":
t = reflect.TypeOf(new(struct{ api.WorkerAPI })).Elem()
permStruct = reflect.TypeOf(apistruct.WorkerStruct{}.Internal)
commonPermStruct = reflect.TypeOf(apistruct.WorkerStruct{}.Internal)
default:
panic("unknown type")
}
for i := 0; i < t.NumMethod(); i++ {
m := t.Method(i)
@@ -335,7 +443,7 @@ func main() {
ft := m.Func.Type()
for j := 2; j < ft.NumIn(); j++ {
inp := ft.In(j)
args = append(args, exampleValue(inp, nil))
args = append(args, exampleValue(m.Name, inp, nil))
}
v, err := json.MarshalIndent(args, "", " ")
@@ -343,7 +451,7 @@ func main() {
panic(err)
}
outv := exampleValue(ft.Out(0), nil)
outv := exampleValue(m.Name, ft.Out(0), nil)
ov, err := json.MarshalIndent(outv, "", " ")
if err != nil {
@@ -376,9 +484,6 @@ func main() {
}
}
permStruct := reflect.TypeOf(apistruct.FullNodeStruct{}.Internal)
commonPermStruct := reflect.TypeOf(apistruct.CommonStruct{}.Internal)
for _, g := range groupslice {
g := g
fmt.Printf("## %s\n", g.GroupName)
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -37,7 +37,12 @@ func (bm *BlockMiner) MineBlocks() {
go func() {
defer close(bm.done)
for atomic.LoadInt64(&bm.mine) == 1 {
time.Sleep(bm.blocktime)
select {
case <-bm.ctx.Done():
return
case <-time.After(bm.blocktime):
}
nulls := atomic.SwapInt64(&bm.nulls, 0)
if err := bm.miner.MineOne(bm.ctx, miner.MineReq{
InjectNulls: abi.ChainEpoch(nulls),
+4 -14
View File
@@ -3,7 +3,6 @@ package test
import (
"context"
"fmt"
"os"
"sync/atomic"
"testing"
"time"
@@ -12,20 +11,15 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node"
"github.com/filecoin-project/lotus/node/impl"
)
func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
for _, height := range []abi.ChainEpoch{
1, // before
2, // before
162, // while sealing
520, // after upgrade deal
530, // after upgrade deal
5000, // after
} {
height := height // make linters happy by copying
@@ -37,11 +31,7 @@ func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {
func testCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, upgradeHeight abi.ChainEpoch) {
ctx := context.Background()
n, sn := b(t, 1, OneMiner, node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
Network: build.ActorUpgradeNetworkVersion,
Height: upgradeHeight,
Migration: stmgr.UpgradeActorsV2,
}}))
n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV3At(upgradeHeight)}, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
@@ -99,7 +89,7 @@ func testCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, upgradeH
t.Fatal(err)
}
makeDeal(t, ctx, 6, client, miner, false, false)
MakeDeal(t, ctx, 6, client, miner, false, false, 0)
// Validate upgrade
+206 -175
View File
@@ -8,131 +8,56 @@ import (
"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"
logging "github.com/ipfs/go-log/v2"
"github.com/ipld/go-car"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
"github.com/filecoin-project/lotus/chain/types"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
"github.com/filecoin-project/lotus/miner"
"github.com/filecoin-project/lotus/markets/storageadapter"
"github.com/filecoin-project/lotus/node"
"github.com/filecoin-project/lotus/node/impl"
market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
ipld "github.com/ipfs/go-ipld-format"
dag "github.com/ipfs/go-merkledag"
dstest "github.com/ipfs/go-merkledag/test"
unixfile "github.com/ipfs/go-unixfs/file"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/impl"
ipld "github.com/ipfs/go-ipld-format"
)
var MineNext = miner.MineReq{
InjectNulls: 0,
Done: func(bool, abi.ChainEpoch, error) {},
func TestDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, carExport, fastRet bool, startEpoch abi.ChainEpoch) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
MakeDeal(t, s.ctx, 6, s.client, s.miner, carExport, fastRet, startEpoch)
}
func init() {
logging.SetAllLoggers(logging.LevelInfo)
build.InsecurePoStValidation = true
func TestDoubleDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
MakeDeal(t, s.ctx, 6, s.client, s.miner, false, false, startEpoch)
MakeDeal(t, s.ctx, 7, s.client, s.miner, false, false, startEpoch)
}
func TestDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, carExport, fastRet bool) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
ctx := context.Background()
n, sn := b(t, 1, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
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) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
ctx := context.Background()
n, sn := b(t, 1, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
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 *impl.FullNodeAPI, miner TestStorageNode, carExport, fastRet bool) {
data := make([]byte, 1600)
rand.New(rand.NewSource(int64(rseed))).Read(data)
r := bytes.NewReader(data)
fcid, err := client.ClientImportLocal(ctx, r)
func MakeDeal(t *testing.T, ctx context.Context, rseed int, client api.FullNode, miner TestStorageNode, carExport, fastRet bool, startEpoch abi.ChainEpoch) {
res, data, err := CreateClientFile(ctx, client, rseed)
if err != nil {
t.Fatal(err)
}
fcid := res.Root
fmt.Println("FILE CID: ", fcid)
deal := startDeal(t, ctx, miner, client, fcid, fastRet)
deal := startDeal(t, ctx, miner, client, fcid, fastRet, startEpoch)
// TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
time.Sleep(time.Second)
@@ -145,98 +70,155 @@ func makeDeal(t *testing.T, ctx context.Context, rseed int, client *impl.FullNod
testRetrieval(t, ctx, client, fcid, &info.PieceCID, carExport, data)
}
func TestFastRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
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)
ctx := context.Background()
n, sn := b(t, 1, OneMiner)
dir, err := ioutil.TempDir(os.TempDir(), "test-make-deal-")
if err != nil {
return nil, nil, err
}
path := filepath.Join(dir, "sourcefile.dat")
err = ioutil.WriteFile(path, data, 0644)
if err != nil {
return nil, nil, err
}
res, err := client.ClientImport(ctx, api.FileRef{Path: path})
if err != nil {
return nil, nil, err
}
return res, data, nil
}
func TestPublishDealsBatching(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
publishPeriod := 10 * time.Second
maxDealsPerMsg := uint64(2)
// Set max deals per publish deals message to 2
minerDef := []StorageMiner{{
Full: 0,
Opts: node.Override(
new(*storageadapter.DealPublisher),
storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{
Period: publishPeriod,
MaxDealsPerMsg: maxDealsPerMsg,
})),
Preseal: PresealGenesis,
}}
// Create a connect client and miner node
n, sn := b(t, OneFull, minerDef)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
s := connectAndStartMining(t, b, blocktime, client, miner)
defer s.blockMiner.Stop()
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
// Starts a deal and waits until it's published
runDealTillPublish := func(rseed int) {
res, _, err := CreateClientFile(s.ctx, s.client, rseed)
require.NoError(t, err)
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
time.Sleep(time.Second)
upds, err := client.ClientGetDealUpdates(s.ctx)
require.NoError(t, err)
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)
startDeal(t, s.ctx, s.miner, s.client, res.Root, false, startEpoch)
// TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
time.Sleep(time.Second)
done := make(chan struct{})
go func() {
for upd := range upds {
if upd.DataRef.Root == res.Root && upd.State == storagemarket.StorageDealAwaitingPreCommit {
done <- struct{}{}
}
}
}()
<-done
}
// Run three deals in parallel
done := make(chan struct{}, maxDealsPerMsg+1)
for rseed := 1; rseed <= 3; rseed++ {
rseed := rseed
go func() {
runDealTillPublish(rseed)
done <- struct{}{}
}()
}
// Wait for two of the deals to be published
for i := 0; i < int(maxDealsPerMsg); i++ {
<-done
}
// Expect a single PublishStorageDeals message that includes the first two deals
msgCids, err := s.client.StateListMessages(s.ctx, &api.MessageMatch{To: market.Address}, types.EmptyTSK, 1)
require.NoError(t, err)
count := 0
for _, msgCid := range msgCids {
msg, err := s.client.ChainGetMessage(s.ctx, msgCid)
require.NoError(t, err)
if msg.Method == market.Methods.PublishStorageDeals {
count++
var pubDealsParams market2.PublishStorageDealsParams
err = pubDealsParams.UnmarshalCBOR(bytes.NewReader(msg.Params))
require.NoError(t, err)
require.Len(t, pubDealsParams.Deals, int(maxDealsPerMsg))
}
}()
}
require.Equal(t, 1, count)
// The third deal should be published once the publish period expires.
// Allow a little padding as it takes a moment for the state change to
// be noticed by the client.
padding := 10 * time.Second
select {
case <-time.After(publishPeriod + padding):
require.Fail(t, "Expected 3rd deal to be published once publish period elapsed")
case <-done: // Success
}
}
func TestFastRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
data := make([]byte, 1600)
rand.New(rand.NewSource(int64(8))).Read(data)
r := bytes.NewReader(data)
fcid, err := client.ClientImportLocal(ctx, r)
fcid, err := s.client.ClientImportLocal(s.ctx, r)
if err != nil {
t.Fatal(err)
}
fmt.Println("FILE CID: ", fcid)
deal := startDeal(t, ctx, miner, client, fcid, true)
deal := startDeal(t, s.ctx, s.miner, s.client, fcid, true, startEpoch)
waitDealPublished(t, ctx, miner, deal)
waitDealPublished(t, s.ctx, s.miner, deal)
fmt.Println("deal published, retrieving")
// Retrieval
info, err := client.ClientGetDealInfo(ctx, *deal)
info, err := s.client.ClientGetDealInfo(s.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
testRetrieval(t, s.ctx, s.client, fcid, &info.PieceCID, false, data)
}
func TestSenondDealRetrieval(t *testing.T, b APIBuilder, blocktime time.Duration) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
ctx := context.Background()
n, sn := b(t, 1, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
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)
}
}
}()
func TestSecondDealRetrieval(t *testing.T, b APIBuilder, blocktime time.Duration) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
{
data1 := make([]byte, 800)
rand.New(rand.NewSource(int64(3))).Read(data1)
r := bytes.NewReader(data1)
fcid1, err := client.ClientImportLocal(ctx, r)
fcid1, err := s.client.ClientImportLocal(s.ctx, r)
if err != nil {
t.Fatal(err)
}
@@ -245,38 +227,49 @@ func TestSenondDealRetrieval(t *testing.T, b APIBuilder, blocktime time.Duration
rand.New(rand.NewSource(int64(9))).Read(data2)
r2 := bytes.NewReader(data2)
fcid2, err := client.ClientImportLocal(ctx, r2)
fcid2, err := s.client.ClientImportLocal(s.ctx, r2)
if err != nil {
t.Fatal(err)
}
deal1 := startDeal(t, ctx, miner, client, fcid1, true)
deal1 := startDeal(t, s.ctx, s.miner, s.client, fcid1, true, 0)
// TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
time.Sleep(time.Second)
waitDealSealed(t, ctx, miner, client, deal1, true)
waitDealSealed(t, s.ctx, s.miner, s.client, deal1, true)
deal2 := startDeal(t, ctx, miner, client, fcid2, true)
deal2 := startDeal(t, s.ctx, s.miner, s.client, fcid2, true, 0)
time.Sleep(time.Second)
waitDealSealed(t, ctx, miner, client, deal2, false)
waitDealSealed(t, s.ctx, s.miner, s.client, deal2, false)
// Retrieval
info, err := client.ClientGetDealInfo(ctx, *deal2)
info, err := s.client.ClientGetDealInfo(s.ctx, *deal2)
require.NoError(t, err)
rf, _ := miner.SectorsRefs(ctx)
rf, _ := s.miner.SectorsRefs(s.ctx)
fmt.Printf("refs: %+v\n", rf)
testRetrieval(t, ctx, client, fcid2, &info.PieceCID, false, data2)
testRetrieval(t, s.ctx, s.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 *impl.FullNodeAPI, fcid cid.Cid, fastRet bool) *cid.Cid {
func TestZeroPricePerByteRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
s := setupOneClientOneMiner(t, b, blocktime)
defer s.blockMiner.Stop()
// Set price-per-byte to zero
ask, err := s.miner.MarketGetRetrievalAsk(s.ctx)
require.NoError(t, err)
ask.PricePerByte = abi.NewTokenAmount(0)
err = s.miner.MarketSetRetrievalAsk(s.ctx, ask)
require.NoError(t, err)
MakeDeal(t, s.ctx, 6, s.client, s.miner, false, false, startEpoch)
}
func startDeal(t *testing.T, ctx context.Context, miner TestStorageNode, client api.FullNode, fcid cid.Cid, fastRet bool, startEpoch abi.ChainEpoch) *cid.Cid {
maddr, err := miner.ActorAddress(ctx)
if err != nil {
t.Fatal(err)
@@ -294,6 +287,7 @@ func startDeal(t *testing.T, ctx context.Context, miner TestStorageNode, client
Wallet: addr,
Miner: maddr,
EpochPrice: types.NewInt(1000000),
DealStartEpoch: startEpoch,
MinBlocksDuration: uint64(build.MinDealDuration),
FastRetrieval: fastRet,
})
@@ -303,7 +297,7 @@ func startDeal(t *testing.T, ctx context.Context, miner TestStorageNode, client
return deal
}
func waitDealSealed(t *testing.T, ctx context.Context, miner TestStorageNode, client *impl.FullNodeAPI, deal *cid.Cid, noseal bool) {
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)
@@ -311,7 +305,7 @@ loop:
t.Fatal(err)
}
switch di.State {
case storagemarket.StorageDealSealing:
case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing:
if noseal {
return
}
@@ -351,7 +345,7 @@ func waitDealPublished(t *testing.T, ctx context.Context, miner TestStorageNode,
t.Fatal("deal failed")
case storagemarket.StorageDealError:
t.Fatal("deal errored", di.Message)
case storagemarket.StorageDealFinalizing, storagemarket.StorageDealSealing, storagemarket.StorageDealActive:
case storagemarket.StorageDealFinalizing, storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing, storagemarket.StorageDealActive:
fmt.Println("COMPLETE", di)
return
}
@@ -376,7 +370,7 @@ func startSealingWaiting(t *testing.T, ctx context.Context, miner TestStorageNod
}
}
func testRetrieval(t *testing.T, ctx context.Context, client *impl.FullNodeAPI, fcid cid.Cid, piece *cid.Cid, carExport bool, data []byte) {
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)
@@ -454,3 +448,40 @@ func extractCarData(t *testing.T, ctx context.Context, rdata []byte, rpath strin
}
return rdata
}
type dealsScaffold struct {
ctx context.Context
client *impl.FullNodeAPI
miner TestStorageNode
blockMiner *BlockMiner
}
func setupOneClientOneMiner(t *testing.T, b APIBuilder, blocktime time.Duration) *dealsScaffold {
n, sn := b(t, OneFull, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
return connectAndStartMining(t, b, blocktime, client, miner)
}
func connectAndStartMining(t *testing.T, b APIBuilder, blocktime time.Duration, client *impl.FullNodeAPI, miner TestStorageNode) *dealsScaffold {
ctx := context.Background()
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := miner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
time.Sleep(time.Second)
blockMiner := NewBlockMiner(ctx, t, miner, blocktime)
blockMiner.MineBlocks()
return &dealsScaffold{
ctx: ctx,
client: client,
miner: miner,
blockMiner: blockMiner,
}
}
+9 -15
View File
@@ -5,7 +5,6 @@ import (
"context"
"fmt"
"math/rand"
"os"
"sync/atomic"
"testing"
"time"
@@ -25,7 +24,7 @@ var log = logging.Logger("apitest")
func (ts *testSuite) testMining(t *testing.T) {
ctx := context.Background()
apis, sn := ts.makeNodes(t, 1, OneMiner)
apis, sn := ts.makeNodes(t, OneFull, OneMiner)
api := apis[0]
newHeads, err := api.ChainNotify(ctx)
@@ -54,19 +53,16 @@ func (ts *testSuite) testMiningReal(t *testing.T) {
}()
ctx := context.Background()
apis, sn := ts.makeNodes(t, 1, OneMiner)
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
}
at := (<-newHeads)[0].Val.Height()
h1, err := api.ChainHead(ctx)
require.NoError(t, err)
require.Equal(t, abi.ChainEpoch(2), h1.Height())
require.Equal(t, int64(at), int64(h1.Height()))
MineUntilBlock(ctx, t, apis[0], sn[0], nil)
require.NoError(t, err)
@@ -75,25 +71,23 @@ func (ts *testSuite) testMiningReal(t *testing.T) {
h2, err := api.ChainHead(ctx)
require.NoError(t, err)
require.Equal(t, abi.ChainEpoch(3), h2.Height())
require.Greater(t, int64(h2.Height()), int64(h1.Height()))
MineUntilBlock(ctx, t, apis[0], sn[0], nil)
require.NoError(t, err)
<-newHeads
h2, err = api.ChainHead(ctx)
h3, err := api.ChainHead(ctx)
require.NoError(t, err)
require.Equal(t, abi.ChainEpoch(4), h2.Height())
require.Greater(t, int64(h3.Height()), int64(h2.Height()))
}
func TestDealMining(t *testing.T, b APIBuilder, blocktime time.Duration, carExport bool) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
// test making a deal with a fresh miner, and see if it starts to mine
ctx := context.Background()
n, sn := b(t, 1, []StorageMiner{
n, sn := b(t, OneFull, []StorageMiner{
{Full: 0, Preseal: PresealGenesis},
{Full: 0, Preseal: 0}, // TODO: Add support for miners on non-first full node
})
@@ -192,7 +186,7 @@ func TestDealMining(t *testing.T, b APIBuilder, blocktime time.Duration, carExpo
}
}()
deal := startDeal(t, ctx, provider, client, fcid, false)
deal := startDeal(t, ctx, provider, client, fcid, false, 0)
// TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
time.Sleep(time.Second)
+8 -13
View File
@@ -3,14 +3,10 @@ package test
import (
"context"
"fmt"
"os"
"sync/atomic"
"testing"
"time"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
paych0 "github.com/filecoin-project/specs-actors/actors/builtin/paych"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/ipfs/go-cid"
@@ -19,21 +15,20 @@ import (
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/apibstore"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/chain/events"
"github.com/filecoin-project/lotus/chain/events/state"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/wallet"
)
func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
ctx := context.Background()
n, sn := b(t, 2, OneMiner)
n, sn := b(t, TwoFull, OneMiner)
paymentCreator := n[0]
paymentReceiver := n[1]
@@ -58,7 +53,7 @@ func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
bm.MineBlocks()
// send some funds to register the receiver
receiverAddr, err := paymentReceiver.WalletNew(ctx, wallet.ActSigType("secp256k1"))
receiverAddr, err := paymentReceiver.WalletNew(ctx, types.KTSecp256k1)
if err != nil {
t.Fatal(err)
}
@@ -137,7 +132,7 @@ func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
t.Fatal("Unable to settle payment channel")
}
creatorStore := adt.WrapStore(ctx, cbor.NewCborStore(apibstore.NewAPIBlockstore(paymentCreator)))
creatorStore := adt.WrapStore(ctx, cbor.NewCborStore(blockstore.NewAPIBlockstore(paymentCreator)))
// wait for the receiver to submit their vouchers
ev := events.NewEvents(ctx, paymentCreator)
@@ -228,7 +223,7 @@ func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
}
// wait for the settlement period to pass before collecting
waitForBlocks(ctx, t, bm, paymentReceiver, receiverAddr, paych0.SettleDelay)
waitForBlocks(ctx, t, bm, paymentReceiver, receiverAddr, policy.PaychSettleDelay)
creatorPreCollectBalance, err := paymentCreator.WalletBalance(ctx, createrAddr)
if err != nil {
@@ -284,7 +279,7 @@ func waitForBlocks(ctx context.Context, t *testing.T, bm *BlockMiner, paymentRec
// Add a real block
m, err := paymentReceiver.MpoolPushMessage(ctx, &types.Message{
To: builtin0.BurntFundsActorAddr,
To: builtin.BurntFundsActorAddr,
From: receiverAddr,
Value: types.NewInt(0),
}, nil)
+101
View File
@@ -0,0 +1,101 @@
package test
import (
"context"
"fmt"
"testing"
"time"
"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) {
// The "before" case is disabled, because we need the builder to mock 32 GiB sectors to accurately repro this case
// TODO: Make the mock sector size configurable and reenable this
//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
}()
sid, err := miner.PledgeSector(ctx)
require.NoError(t, err)
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, sid.Number, 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")
}
}
+144 -8
View File
@@ -2,19 +2,39 @@ package test
import (
"context"
"fmt"
"os"
"strings"
"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
@@ -29,23 +49,35 @@ type TestStorageNode struct {
ListenAddr multiaddr.Multiaddr
MineOne func(context.Context, miner.MineReq) error
Stop func(context.Context) error
}
var PresealGenesis = -1
const GenesisPreseals = 2
// Options for setting up a mock storage miner
type StorageMiner struct {
Full int
Opts node.Option
Preseal int
}
type OptionGenerator func([]TestNode) node.Option
// Options for setting up a mock full node
type FullNodeOpts struct {
Lite bool // run node in "lite" mode
Opts OptionGenerator // generate dependency injection options
}
// APIBuilder is a function which is invoked in test suite to provide
// test nodes and networks
//
// fullOpts array defines options for each full node
// storage array defines storage nodes, numbers in the array specify full node
// index the storage node 'belongs' to
type APIBuilder func(t *testing.T, nFull int, storage []StorageMiner, opts ...node.Option) ([]TestNode, []TestStorageNode)
type APIBuilder func(t *testing.T, full []FullNodeOpts, storage []StorageMiner) ([]TestNode, []TestStorageNode)
type testSuite struct {
makeNodes APIBuilder
}
@@ -61,27 +93,131 @@ func TestApis(t *testing.T, b APIBuilder) {
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 FullNodeWithActorsV3At = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
return FullNodeOpts{
Opts: func(nodes []TestNode) node.Option {
return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
// prepare for upgrade.
Network: network.Version9,
Height: 1,
Migration: stmgr.UpgradeActorsV2,
}, {
// Skip directly to tape height so precommits work.
Network: network.Version10,
Height: upgradeHeight,
Migration: stmgr.UpgradeActorsV3,
}})
},
}
}
var FullNodeWithSDRAt = func(calico, persian abi.ChainEpoch) FullNodeOpts {
return FullNodeOpts{
Opts: func(nodes []TestNode) node.Option {
return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
Network: network.Version6,
Height: 1,
Migration: stmgr.UpgradeActorsV2,
}, {
Network: network.Version7,
Height: calico,
Migration: stmgr.UpgradeCalico,
}, {
Network: network.Version8,
Height: persian,
}})
},
}
}
var MineNext = miner.MineReq{
InjectNulls: 0,
Done: func(bool, abi.ChainEpoch, error) {},
}
func (ts *testSuite) testVersion(t *testing.T) {
build.RunningNodeType = build.NodeFull
api.RunningNodeType = api.NodeFull
ctx := context.Background()
apis, _ := ts.makeNodes(t, 1, OneMiner)
api := apis[0]
apis, _ := ts.makeNodes(t, OneFull, OneMiner)
napi := apis[0]
v, err := api.Version(ctx)
v, err := napi.Version(ctx)
if err != nil {
t.Fatal(err)
}
require.Equal(t, v.Version, build.BuildVersion)
versions := strings.Split(v.Version, "+")
if len(versions) <= 0 {
t.Fatal("empty version")
}
require.Equal(t, versions[0], build.BuildVersion)
}
func (ts *testSuite) testSearchMsg(t *testing.T) {
apis, miners := ts.makeNodes(t, OneFull, OneMiner)
api := apis[0]
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
senderAddr, err := api.WalletDefaultAddress(ctx)
if err != nil {
t.Fatal(err)
}
msg := &types.Message{
From: senderAddr,
To: senderAddr,
Value: big.Zero(),
}
bm := NewBlockMiner(ctx, t, miners[0], 100*time.Millisecond)
bm.MineBlocks()
defer bm.Stop()
sm, err := api.MpoolPushMessage(ctx, msg, nil)
if err != nil {
t.Fatal(err)
}
res, err := api.StateWaitMsg(ctx, sm.Cid(), 1)
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, 1, OneMiner)
apis, _ := ts.makeNodes(t, OneFull, OneMiner)
api := apis[0]
id, err := api.ID(ctx)
@@ -93,7 +229,7 @@ func (ts *testSuite) testID(t *testing.T) {
func (ts *testSuite) testConnectTwo(t *testing.T) {
ctx := context.Background()
apis, _ := ts.makeNodes(t, 2, OneMiner)
apis, _ := ts.makeNodes(t, TwoFull, OneMiner)
p, err := apis[0].NetPeers(ctx)
if err != nil {
+709 -30
View File
@@ -3,38 +3,41 @@ package test
import (
"context"
"fmt"
"sort"
"sync/atomic"
"os"
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
"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/go-state-types/network"
"github.com/filecoin-project/lotus/extern/sector-storage/mock"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
"github.com/filecoin-project/lotus/node"
proof3 "github.com/filecoin-project/specs-actors/v3/actors/runtime/proof"
"github.com/filecoin-project/specs-storage/storage"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/actors"
minerActor "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
bminer "github.com/filecoin-project/lotus/miner"
"github.com/filecoin-project/lotus/node/impl"
)
func init() {
err := os.Setenv("BELLMAN_NO_GPU", "1")
if err != nil {
panic(fmt.Sprintf("failed to set BELLMAN_NO_GPU env variable: %s", err))
}
}
func TestSDRUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
func TestPledgeSector(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
ctx := context.Background()
n, sn := b(t, 1, OneMiner)
n, sn := b(t, []FullNodeOpts{FullNodeWithSDRAt(500, 1000)}, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
@@ -48,11 +51,95 @@ func TestPledgeSector(t *testing.T, b APIBuilder, blocktime time.Duration, nSect
}
build.Clock.Sleep(time.Second)
mine := true
pledge := make(chan struct{})
mine := int64(1)
done := make(chan struct{})
go func() {
defer close(done)
for mine {
round := 0
for atomic.LoadInt64(&mine) != 0 {
build.Clock.Sleep(blocktime)
if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
}}); err != nil {
t.Error(err)
}
// 3 sealing rounds: before, during after.
if round >= 3 {
continue
}
head, err := client.ChainHead(ctx)
assert.NoError(t, err)
// rounds happen every 100 blocks, with a 50 block offset.
if head.Height() >= abi.ChainEpoch(round*500+50) {
round++
pledge <- struct{}{}
ver, err := client.StateNetworkVersion(ctx, head.Key())
assert.NoError(t, err)
switch round {
case 1:
assert.Equal(t, network.Version6, ver)
case 2:
assert.Equal(t, network.Version7, ver)
case 3:
assert.Equal(t, network.Version8, ver)
}
}
}
}()
// before.
pledgeSectors(t, ctx, miner, 9, 0, pledge)
s, err := miner.SectorsList(ctx)
require.NoError(t, err)
sort.Slice(s, func(i, j int) bool {
return s[i] < s[j]
})
for i, id := range s {
info, err := miner.SectorsStatus(ctx, id, true)
require.NoError(t, err)
expectProof := abi.RegisteredSealProof_StackedDrg2KiBV1
if i >= 3 {
// after
expectProof = abi.RegisteredSealProof_StackedDrg2KiBV1_1
}
assert.Equal(t, expectProof, info.SealProof, "sector %d, id %d", i, id)
}
atomic.StoreInt64(&mine, 0)
<-done
}
func 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) {
@@ -64,17 +151,19 @@ func TestPledgeSector(t *testing.T, b APIBuilder, blocktime time.Duration, nSect
pledgeSectors(t, ctx, miner, nSectors, 0, nil)
mine = false
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
log.Errorf("WAIT")
}
log.Errorf("PLEDGING %d", i)
_, err := miner.PledgeSector(ctx)
require.NoError(t, err)
}
for {
@@ -117,7 +206,7 @@ func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n,
func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
for _, height := range []abi.ChainEpoch{
1, // before
2, // before
162, // while sealing
5000, // while proving
} {
@@ -128,16 +217,13 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector
}
}
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, 1, OneMiner, node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
Network: build.ActorUpgradeNetworkVersion,
Height: upgradeHeight,
Migration: stmgr.UpgradeActorsV2,
}}))
n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV3At(upgradeHeight)}, OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
@@ -220,15 +306,17 @@ func testWindowPostUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration,
// 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),
return miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkCorrupted(storage.SectorRef{
ID: abi.SectorID{
Miner: abi.ActorID(mid),
Number: abi.SectorNumber(sid),
},
}, true)
})
require.NoError(t, err)
}
var s abi.SectorID
var s storage.SectorRef
// Drop 1 sectors from deadline 3 partition 0
{
@@ -249,9 +337,11 @@ func testWindowPostUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration,
require.NoError(t, err)
fmt.Println("the sectors", all)
s = abi.SectorID{
Miner: abi.ActorID(mid),
Number: abi.SectorNumber(sn),
s = storage.SectorRef{
ID: abi.SectorID{
Miner: abi.ActorID(mid),
Number: abi.SectorNumber(sn),
},
}
err = miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkFailed(s, true)
@@ -345,3 +435,592 @@ func testWindowPostUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration,
sectors = p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
require.Equal(t, nSectors+GenesisPreseals-2+1, int(sectors)) // -2 not recovered sectors + 1 just pledged
}
func TestTerminate(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
nSectors := uint64(2)
n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV3At(2)}, []StorageMiner{{Full: 0, Preseal: int(nSectors)}})
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
}()
maddr, err := miner.ActorAddress(ctx)
require.NoError(t, err)
ssz, err := miner.ActorSectorSize(ctx, maddr)
require.NoError(t, err)
p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
require.Equal(t, p.MinerPower, p.TotalPower)
require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*nSectors))
fmt.Printf("Seal a sector\n")
pledgeSectors(t, ctx, miner, 1, 0, nil)
fmt.Printf("wait for power\n")
{
// 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
}
}
}
nSectors++
p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
require.Equal(t, p.MinerPower, p.TotalPower)
require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*nSectors))
fmt.Println("Terminate a sector")
toTerminate := abi.SectorNumber(3)
err = miner.SectorTerminate(ctx, toTerminate)
require.NoError(t, err)
msgTriggerred := false
loop:
for {
si, err := miner.SectorsStatus(ctx, toTerminate, false)
require.NoError(t, err)
fmt.Println("state: ", si.State, msgTriggerred)
switch sealing.SectorState(si.State) {
case sealing.Terminating:
if !msgTriggerred {
{
p, err := miner.SectorTerminatePending(ctx)
require.NoError(t, err)
require.Len(t, p, 1)
require.Equal(t, abi.SectorNumber(3), p[0].Number)
}
c, err := miner.SectorTerminateFlush(ctx)
require.NoError(t, err)
if c != nil {
msgTriggerred = true
fmt.Println("terminate message:", c)
{
p, err := miner.SectorTerminatePending(ctx)
require.NoError(t, err)
require.Len(t, p, 0)
}
}
}
case sealing.TerminateWait, sealing.TerminateFinality, sealing.Removed:
break loop
}
time.Sleep(100 * time.Millisecond)
}
// check power decreased
p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
require.Equal(t, p.MinerPower, p.TotalPower)
require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*(nSectors-1)))
// check in terminated set
{
parts, err := client.StateMinerPartitions(ctx, maddr, 1, types.EmptyTSK)
require.NoError(t, err)
require.Greater(t, len(parts), 0)
bflen := func(b bitfield.BitField) uint64 {
l, err := b.Count()
require.NoError(t, err)
return l
}
require.Equal(t, uint64(1), bflen(parts[0].AllSectors))
require.Equal(t, uint64(0), bflen(parts[0].LiveSectors))
}
di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
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)
}
require.NoError(t, err)
fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
require.Equal(t, p.MinerPower, p.TotalPower)
require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*(nSectors-1)))
}
func TestWindowPostDispute(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
// First, we configure two miners. After sealing, we're going to turn off the first miner so
// it doesn't submit proofs.
///
// Then we're going to manually submit bad proofs.
n, sn := b(t, []FullNodeOpts{
FullNodeWithActorsV3At(2),
}, []StorageMiner{
{Full: 0, Preseal: PresealGenesis},
{Full: 0},
})
client := n[0].FullNode.(*impl.FullNodeAPI)
chainMiner := sn[0]
evilMiner := sn[1]
{
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := chainMiner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
if err := evilMiner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
}
defaultFrom, err := client.WalletDefaultAddress(ctx)
require.NoError(t, err)
build.Clock.Sleep(time.Second)
// Mine with the _second_ node (the good one).
done := make(chan struct{})
go func() {
defer close(done)
for ctx.Err() == nil {
build.Clock.Sleep(blocktime)
if err := chainMiner.MineOne(ctx, MineNext); err != nil {
if ctx.Err() != nil {
// context was canceled, ignore the error.
return
}
t.Error(err)
}
}
}()
defer func() {
cancel()
<-done
}()
// Give the chain miner enough sectors to win every block.
pledgeSectors(t, ctx, chainMiner, 10, 0, nil)
// And the evil one 1 sector. No cookie for you.
pledgeSectors(t, ctx, evilMiner, 1, 0, nil)
// Let the evil miner's sectors gain power.
evilMinerAddr, err := evilMiner.ActorAddress(ctx)
require.NoError(t, err)
di, err := client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
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, evilMinerAddr, types.EmptyTSK)
require.NoError(t, err)
ssz, err := evilMiner.ActorSectorSize(ctx, evilMinerAddr)
require.NoError(t, err)
// make sure it has gained power.
require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)))
evilSectors, err := evilMiner.SectorsList(ctx)
require.NoError(t, err)
evilSectorNo := evilSectors[0] // only one.
evilSectorLoc, err := client.StateSectorPartition(ctx, evilMinerAddr, evilSectorNo, types.EmptyTSK)
require.NoError(t, err)
fmt.Println("evil miner stopping")
// Now stop the evil miner, and start manually submitting bad proofs.
require.NoError(t, evilMiner.Stop(ctx))
fmt.Println("evil miner stopped")
// Wait until we need to prove our sector.
for {
di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
require.NoError(t, err)
if di.Index == evilSectorLoc.Deadline {
break
}
build.Clock.Sleep(blocktime)
}
err = submitBadProof(ctx, client, evilMinerAddr, di, evilSectorLoc.Deadline, evilSectorLoc.Partition)
require.NoError(t, err, "evil proof not accepted")
// Wait until after the proving period.
for {
di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
require.NoError(t, err)
if di.Index != evilSectorLoc.Deadline {
break
}
build.Clock.Sleep(blocktime)
}
fmt.Println("accepted evil proof")
// Make sure the evil node didn't lose any power.
p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK)
require.NoError(t, err)
require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)))
// OBJECTION! The good miner files a DISPUTE!!!!
{
params := &minerActor.DisputeWindowedPoStParams{
Deadline: evilSectorLoc.Deadline,
PoStIndex: 0,
}
enc, aerr := actors.SerializeParams(params)
require.NoError(t, aerr)
msg := &types.Message{
To: evilMinerAddr,
Method: minerActor.Methods.DisputeWindowedPoSt,
Params: enc,
Value: types.NewInt(0),
From: defaultFrom,
}
sm, err := client.MpoolPushMessage(ctx, msg, nil)
require.NoError(t, err)
fmt.Println("waiting dispute")
rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence)
require.NoError(t, err)
require.Zero(t, rec.Receipt.ExitCode, "dispute not accepted: %s", rec.Receipt.ExitCode.Error())
}
// Objection SUSTAINED!
// Make sure the evil node lost power.
p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK)
require.NoError(t, err)
require.True(t, p.MinerPower.RawBytePower.IsZero())
// Now we begin the redemption arc.
require.True(t, p.MinerPower.RawBytePower.IsZero())
// First, recover the sector.
{
minerInfo, err := client.StateMinerInfo(ctx, evilMinerAddr, types.EmptyTSK)
require.NoError(t, err)
params := &minerActor.DeclareFaultsRecoveredParams{
Recoveries: []minerActor.RecoveryDeclaration{{
Deadline: evilSectorLoc.Deadline,
Partition: evilSectorLoc.Partition,
Sectors: bitfield.NewFromSet([]uint64{uint64(evilSectorNo)}),
}},
}
enc, aerr := actors.SerializeParams(params)
require.NoError(t, aerr)
msg := &types.Message{
To: evilMinerAddr,
Method: minerActor.Methods.DeclareFaultsRecovered,
Params: enc,
Value: types.FromFil(30), // repay debt.
From: minerInfo.Owner,
}
sm, err := client.MpoolPushMessage(ctx, msg, nil)
require.NoError(t, err)
rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence)
require.NoError(t, err)
require.Zero(t, rec.Receipt.ExitCode, "recovery not accepted: %s", rec.Receipt.ExitCode.Error())
}
// Then wait for the deadline.
for {
di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
require.NoError(t, err)
if di.Index == evilSectorLoc.Deadline {
break
}
build.Clock.Sleep(blocktime)
}
// Now try to be evil again
err = submitBadProof(ctx, client, evilMinerAddr, di, evilSectorLoc.Deadline, evilSectorLoc.Partition)
require.Error(t, err)
require.Contains(t, err.Error(), "message execution failed: exit 16, reason: window post failed: invalid PoSt")
// It didn't work because we're recovering.
}
func submitBadProof(
ctx context.Context,
client api.FullNode, maddr address.Address,
di *dline.Info, dlIdx, partIdx uint64,
) error {
head, err := client.ChainHead(ctx)
if err != nil {
return err
}
from, err := client.WalletDefaultAddress(ctx)
if err != nil {
return err
}
minerInfo, err := client.StateMinerInfo(ctx, maddr, head.Key())
if err != nil {
return err
}
commEpoch := di.Open
commRand, err := client.ChainGetRandomnessFromTickets(
ctx, head.Key(), crypto.DomainSeparationTag_PoStChainCommit,
commEpoch, nil,
)
if err != nil {
return err
}
params := &minerActor.SubmitWindowedPoStParams{
ChainCommitEpoch: commEpoch,
ChainCommitRand: commRand,
Deadline: dlIdx,
Partitions: []minerActor.PoStPartition{{Index: partIdx}},
Proofs: []proof3.PoStProof{{
PoStProof: minerInfo.WindowPoStProofType,
ProofBytes: []byte("I'm soooo very evil."),
}},
}
enc, aerr := actors.SerializeParams(params)
if aerr != nil {
return aerr
}
msg := &types.Message{
To: maddr,
Method: minerActor.Methods.SubmitWindowedPoSt,
Params: enc,
Value: types.NewInt(0),
From: from,
}
sm, err := client.MpoolPushMessage(ctx, msg, nil)
if err != nil {
return err
}
rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence)
if err != nil {
return err
}
if rec.Receipt.ExitCode.IsError() {
return rec.Receipt.ExitCode
}
return nil
}
func TestWindowPostDisputeFails(t *testing.T, b APIBuilder, blocktime time.Duration) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
n, sn := b(t, []FullNodeOpts{FullNodeWithActorsV3At(2)}, 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)
}
}
defaultFrom, err := client.WalletDefaultAddress(ctx)
require.NoError(t, err)
maddr, err := miner.ActorAddress(ctx)
require.NoError(t, err)
build.Clock.Sleep(time.Second)
// Mine with the _second_ node (the good one).
done := make(chan struct{})
go func() {
defer close(done)
for ctx.Err() == nil {
build.Clock.Sleep(blocktime)
if err := miner.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, 10, 0, nil)
di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
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)
}
ssz, err := miner.ActorSectorSize(ctx, maddr)
require.NoError(t, err)
expectedPower := types.NewInt(uint64(ssz) * (GenesisPreseals + 10))
p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
// make sure it has gained power.
require.Equal(t, p.MinerPower.RawBytePower, expectedPower)
// Wait until a proof has been submitted.
var targetDeadline uint64
waitForProof:
for {
deadlines, err := client.StateMinerDeadlines(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
for dlIdx, dl := range deadlines {
nonEmpty, err := dl.PostSubmissions.IsEmpty()
require.NoError(t, err)
if nonEmpty {
targetDeadline = uint64(dlIdx)
break waitForProof
}
}
build.Clock.Sleep(blocktime)
}
for {
di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
// wait until the deadline finishes.
if di.Index == ((targetDeadline + 1) % di.WPoStPeriodDeadlines) {
break
}
build.Clock.Sleep(blocktime)
}
// Try to object to the proof. This should fail.
{
params := &minerActor.DisputeWindowedPoStParams{
Deadline: targetDeadline,
PoStIndex: 0,
}
enc, aerr := actors.SerializeParams(params)
require.NoError(t, aerr)
msg := &types.Message{
To: maddr,
Method: minerActor.Methods.DisputeWindowedPoSt,
Params: enc,
Value: types.NewInt(0),
From: defaultFrom,
}
_, err := client.MpoolPushMessage(ctx, msg, nil)
require.Error(t, err)
require.Contains(t, err.Error(), "failed to dispute valid post (RetCode=16)")
}
}
+22 -14
View File
@@ -3,10 +3,10 @@ package api
import (
"encoding/json"
"fmt"
"time"
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 +51,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
@@ -107,3 +94,24 @@ 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
}
+71
View File
@@ -0,0 +1,71 @@
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 FullAPIVersion, nil
case NodeMiner:
return MinerAPIVersion, nil
case NodeWorker:
return WorkerAPIVersion, nil
default:
return Version(0), xerrors.Errorf("unknown node type %d", nodeType)
}
}
// semver versions of the rpc api exposed
var (
FullAPIVersion = newVer(1, 1, 0)
MinerAPIVersion = newVer(1, 0, 1)
WorkerAPIVersion = newVer(1, 0, 0)
)
//nolint:varcheck,deadcode
const (
majorMask = 0xff0000
minorMask = 0xffff00
patchMask = 0xffffff
majorOnlyMask = 0xff0000
minorOnlyMask = 0x00ff00
patchOnlyMask = 0x0000ff
)
+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
}
+481
View File
@@ -0,0 +1,481 @@
package badgerbs
import (
"context"
"fmt"
"io"
"sync/atomic"
"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/options"
"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...)
}
const (
stateOpen int64 = iota
stateClosing
stateClosed
)
// Blockstore is a badger-backed IPLD blockstore.
//
// NOTE: once Close() is called, methods will try their best to return
// ErrBlockstoreClosed. This will guaranteed to happen for all subsequent
// operation calls after Close() has returned, but it may not happen for
// operations in progress. Those are likely to fail with a different error.
type Blockstore struct {
DB *badger.DB
// state is guarded by atomic.
state int64
prefixing bool
prefix []byte
prefixLen int
}
var _ blockstore.Blockstore = (*Blockstore)(nil)
var _ blockstore.Viewer = (*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}
if p := opts.Prefix; p != "" {
bs.prefixing = true
bs.prefix = []byte(p)
bs.prefixLen = len(bs.prefix)
}
return bs, nil
}
// Close closes the store. If the store has already been closed, this noops and
// returns an error, even if the first closure resulted in error.
func (b *Blockstore) Close() error {
if !atomic.CompareAndSwapInt64(&b.state, stateOpen, stateClosing) {
return nil
}
defer atomic.StoreInt64(&b.state, stateClosed)
return b.DB.Close()
}
// CollectGarbage runs garbage collection on the value log
func (b *Blockstore) CollectGarbage() error {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
}
var err error
for err == nil {
err = b.DB.RunValueLogGC(0.125)
}
if err == badger.ErrNoRewrite {
// not really an error in this case
return nil
}
return err
}
// View implements blockstore.Viewer, which leverages zero-copy read-only
// access to values.
func (b *Blockstore) View(cid cid.Cid, fn func([]byte) error) error {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
}
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 atomic.LoadInt64(&b.state) != stateOpen {
return false, ErrBlockstoreClosed
}
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 atomic.LoadInt64(&b.state) != stateOpen {
return nil, ErrBlockstoreClosed
}
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 atomic.LoadInt64(&b.state) != stateOpen {
return -1, ErrBlockstoreClosed
}
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 atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
}
k, pooled := b.PooledStorageKey(block.Cid())
if pooled {
defer KeyPool.Put(k)
}
err := b.DB.Update(func(txn *badger.Txn) error {
return txn.Set(k, block.RawData())
})
if err != nil {
err = fmt.Errorf("failed to put block in badger blockstore: %w", err)
}
return err
}
// PutMany implements Blockstore.PutMany.
func (b *Blockstore) PutMany(blocks []blocks.Block) error {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
}
batch := b.DB.NewWriteBatch()
defer batch.Cancel()
// 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)
}
}()
}
for _, block := range blocks {
k, pooled := b.PooledStorageKey(block.Cid())
if pooled {
toReturn = append(toReturn, k)
}
if err := batch.Set(k, block.RawData()); err != nil {
return err
}
}
err := batch.Flush()
if err != nil {
err = fmt.Errorf("failed to put blocks in badger blockstore: %w", err)
}
return err
}
// DeleteBlock implements Blockstore.DeleteBlock.
func (b *Blockstore) DeleteBlock(cid cid.Cid) error {
if atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
}
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 atomic.LoadInt64(&b.state) != stateOpen {
return ErrBlockstoreClosed
}
batch := b.DB.NewWriteBatch()
defer batch.Cancel()
// 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)
}
}()
}
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 atomic.LoadInt64(&b.state) != stateOpen {
return nil, ErrBlockstoreClosed
}
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 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 atomic.LoadInt64(&b.state) != stateOpen {
// 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
}
// 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]
}
+91
View File
@@ -0,0 +1,91 @@
package badgerbs
import (
"io/ioutil"
"os"
"testing"
blocks "github.com/ipfs/go-block-format"
"github.com/stretchr/testify/require"
"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))
}
}
+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
}
+95
View File
@@ -0,0 +1,95 @@
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
}
// 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
}
+25
View File
@@ -0,0 +1,25 @@
package blockstore
import (
"context"
blockstore "github.com/ipfs/go-ipfs-blockstore"
)
type CacheOpts = blockstore.CacheOpts
func DefaultCacheOpts() CacheOpts {
return CacheOpts{
HasBloomFilterSize: 0,
HasBloomFilterHashes: 0,
HasARCCacheSize: 512 << 10,
}
}
func CachedBlockstore(ctx context.Context, bs Blockstore, opts CacheOpts) (Blockstore, error) {
cached, err := blockstore.CachedBlockstore(ctx, bs, opts)
if err != nil {
return nil, err
}
return WrapIDStore(cached), 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{}
+102
View File
@@ -0,0 +1,102 @@
package blockstore
import (
"context"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
)
// NewMemory returns a temporary memory-backed blockstore.
func NewMemory() MemBlockstore {
return make(MemBlockstore)
}
// MemBlockstore is a terminal blockstore that keeps blocks in memory.
type MemBlockstore map[cid.Cid]blocks.Block
func (m MemBlockstore) DeleteBlock(k cid.Cid) error {
delete(m, k)
return nil
}
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 MemBlockstore) View(k cid.Cid, callback func([]byte) error) error {
b, ok := m[k]
if !ok {
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 MemBlockstore) GetSize(k cid.Cid) (int, error) {
b, ok := m[k]
if !ok {
return 0, ErrNotFound
}
return len(b.RawData()), nil
}
// Put puts a given block to the underlying datastore
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()
if _, ok := b.(*blocks.BasicBlock); !ok {
// If we already have the block, abort.
if _, ok := m[k]; ok {
return nil
}
// the error is only for debugging.
b, _ = blocks.NewBlockWithCid(b.RawData(), b.Cid())
}
m[b.Cid()] = b
return nil
}
// PutMany puts a slice of blocks at the same time using batching
// capabilities of the underlying datastore whenever possible.
func (m MemBlockstore) PutMany(bs []blocks.Block) error {
for _, b := range bs {
_ = m.Put(b) // can't fail
}
return nil
}
// 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 MemBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
ch := make(chan cid.Cid, len(m))
for k := range m {
ch <- k
}
close(ch)
return ch, nil
}
// HashOnRead specifies if every read block should be
// rehashed to make sure it matches its CID.
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,
}
+38
View File
@@ -0,0 +1,38 @@
package splitstore
import (
"path/filepath"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
)
// MarkSet is a utility to keep track of seen CID, and later query for them.
//
// * If the expected dataset is large, it can be backed by a datastore (e.g. bbolt).
// * If a probabilistic result is acceptable, it can be backed by a bloom filter (default).
type MarkSet interface {
Mark(cid.Cid) error
Has(cid.Cid) (bool, error)
Close() error
}
// markBytes is deliberately a non-nil empty byte slice for serialization.
var markBytes = []byte{}
type MarkSetEnv interface {
Create(name string, sizeHint int64) (MarkSet, error)
Close() error
}
func OpenMarkSetEnv(path string, mtype string) (MarkSetEnv, error) {
switch mtype {
case "", "bloom":
return NewBloomMarkSetEnv()
case "bolt":
return NewBoltMarkSetEnv(filepath.Join(path, "markset.bolt"))
default:
return nil, xerrors.Errorf("unknown mark set type %s", mtype)
}
}
+77
View File
@@ -0,0 +1,77 @@
package splitstore
import (
"crypto/rand"
"crypto/sha256"
"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
bf *bbloom.Bloom
}
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 {
s.bf.Add(s.saltedKey(cid))
return nil
}
func (s *BloomMarkSet) Has(cid cid.Cid) (bool, error) {
return s.bf.Has(s.saltedKey(cid)), nil
}
func (s *BloomMarkSet) Close() error {
return nil
}
+81
View File
@@ -0,0 +1,81 @@
package splitstore
import (
"time"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
bolt "go.etcd.io/bbolt"
)
type BoltMarkSetEnv struct {
db *bolt.DB
}
var _ MarkSetEnv = (*BoltMarkSetEnv)(nil)
type BoltMarkSet struct {
db *bolt.DB
bucketId []byte
}
var _ MarkSet = (*BoltMarkSet)(nil)
func NewBoltMarkSetEnv(path string) (*BoltMarkSetEnv, error) {
db, err := bolt.Open(path, 0644,
&bolt.Options{
Timeout: 1 * time.Second,
NoSync: true,
})
if err != nil {
return nil, err
}
return &BoltMarkSetEnv{db: db}, nil
}
func (e *BoltMarkSetEnv) Create(name string, hint int64) (MarkSet, error) {
bucketId := []byte(name)
err := e.db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists(bucketId)
if err != nil {
return xerrors.Errorf("error creating bolt db bucket %s: %w", name, err)
}
return nil
})
if err != nil {
return nil, err
}
return &BoltMarkSet{db: e.db, bucketId: bucketId}, nil
}
func (e *BoltMarkSetEnv) Close() error {
return e.db.Close()
}
func (s *BoltMarkSet) Mark(cid cid.Cid) error {
return s.db.Update(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
return b.Put(cid.Hash(), markBytes)
})
}
func (s *BoltMarkSet) Has(cid cid.Cid) (result bool, err error) {
err = s.db.View(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
v := b.Get(cid.Hash())
result = v != nil
return nil
})
return result, err
}
func (s *BoltMarkSet) Close() error {
return s.db.Update(func(tx *bolt.Tx) error {
return tx.DeleteBucket(s.bucketId)
})
}
+138
View File
@@ -0,0 +1,138 @@
package splitstore
import (
"io/ioutil"
"testing"
cid "github.com/ipfs/go-cid"
"github.com/multiformats/go-multihash"
)
func TestBoltMarkSet(t *testing.T) {
testMarkSet(t, "bolt")
}
func TestBloomMarkSet(t *testing.T) {
testMarkSet(t, "bloom")
}
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)
}
}
File diff suppressed because it is too large Load Diff
+255
View File
@@ -0,0 +1,255 @@
package splitstore
import (
"context"
"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"
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
CompactionCold = 1
CompactionBoundary = 2
logging.SetLogLevel("splitstore", "DEBUG")
}
func testSplitStore(t *testing.T, cfg *Config) {
chain := &mockChain{}
// genesis
genBlock := mock.MkBlock(nil, 0, 0)
genTs := mock.TipSet(genBlock)
chain.push(genTs)
// the myriads of stores
ds := dssync.MutexWrap(datastore.NewMapDatastore())
hot := blockstore.NewMemorySync()
cold := blockstore.NewMemorySync()
// 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)
}
// open the splitstore
ss, err := Open("", ds, hot, cold, cfg)
if err != nil {
t.Fatal(err)
}
defer ss.Close() //nolint
err = ss.Start(chain)
if err != nil {
t.Fatal(err)
}
// make some tipsets, but not enough to cause compaction
mkBlock := func(curTs *types.TipSet, i int) *types.TipSet {
blk := mock.MkBlock(curTs, uint64(i), uint64(i))
sblk, err := blk.ToStorageBlock()
if err != nil {
t.Fatal(err)
}
err = ss.Put(sblk)
if err != nil {
t.Fatal(err)
}
ts := mock.TipSet(blk)
chain.push(ts)
return ts
}
mkGarbageBlock := func(curTs *types.TipSet, i int) {
blk := mock.MkBlock(curTs, uint64(i), uint64(i))
sblk, err := blk.ToStorageBlock()
if err != nil {
t.Fatal(err)
}
err = ss.Put(sblk)
if err != nil {
t.Fatal(err)
}
}
waitForCompaction := func() {
for atomic.LoadInt32(&ss.compacting) == 1 {
time.Sleep(100 * time.Millisecond)
}
}
curTs := genTs
for i := 1; i < 5; i++ {
curTs = mkBlock(curTs, i)
waitForCompaction()
}
mkGarbageBlock(genTs, 1)
// count objects in the cold and hot stores
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
countBlocks := func(bs blockstore.Blockstore) int {
count := 0
ch, err := bs.AllKeysChan(ctx)
if err != nil {
t.Fatal(err)
}
for range ch {
count++
}
return count
}
coldCnt := countBlocks(cold)
hotCnt := countBlocks(hot)
if coldCnt != 1 {
t.Errorf("expected %d blocks, but got %d", 1, coldCnt)
}
if hotCnt != 5 {
t.Errorf("expected %d blocks, but got %d", 5, hotCnt)
}
// trigger a compaction
for i := 5; i < 10; i++ {
curTs = mkBlock(curTs, i)
waitForCompaction()
}
coldCnt = countBlocks(cold)
hotCnt = countBlocks(hot)
if !cfg.EnableFullCompaction {
if coldCnt != 5 {
t.Errorf("expected %d cold blocks, but got %d", 5, coldCnt)
}
if hotCnt != 5 {
t.Errorf("expected %d hot blocks, but got %d", 5, hotCnt)
}
}
if cfg.EnableFullCompaction && !cfg.EnableGC {
if coldCnt != 3 {
t.Errorf("expected %d cold blocks, but got %d", 3, coldCnt)
}
if hotCnt != 7 {
t.Errorf("expected %d hot blocks, but got %d", 7, hotCnt)
}
}
if cfg.EnableFullCompaction && cfg.EnableGC {
if coldCnt != 2 {
t.Errorf("expected %d cold blocks, but got %d", 2, coldCnt)
}
if hotCnt != 7 {
t.Errorf("expected %d hot blocks, but got %d", 7, hotCnt)
}
}
}
func TestSplitStoreSimpleCompaction(t *testing.T) {
testSplitStore(t, &Config{TrackingStoreType: "mem"})
}
func TestSplitStoreFullCompactionWithoutGC(t *testing.T) {
testSplitStore(t, &Config{
TrackingStoreType: "mem",
EnableFullCompaction: true,
})
}
func TestSplitStoreFullCompactionWithGC(t *testing.T) {
testSplitStore(t, &Config{
TrackingStoreType: "mem",
EnableFullCompaction: true,
EnableGC: true,
})
}
type mockChain struct {
sync.Mutex
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)
c.Unlock()
if c.listener != nil {
err := c.listener(nil, []*types.TipSet{ts})
if err != nil {
log.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-1], 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
}
func (c *mockChain) WalkSnapshot(_ context.Context, ts *types.TipSet, epochs abi.ChainEpoch, _ bool, _ bool, f func(cid.Cid) error) error {
c.Lock()
defer c.Unlock()
start := int(ts.Height()) - 1
end := start - int(epochs)
if end < 0 {
end = -1
}
for i := start; i > end; i-- {
ts := c.tipsets[i]
for _, cid := range ts.Cids() {
err := f(cid)
if err != nil {
return err
}
}
}
return nil
}
+109
View File
@@ -0,0 +1,109 @@
package splitstore
import (
"path/filepath"
"sync"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
cid "github.com/ipfs/go-cid"
)
// TrackingStore is a persistent store that tracks blocks that are added
// to the hotstore, tracking the epoch at which they are written.
type TrackingStore interface {
Put(cid.Cid, abi.ChainEpoch) error
PutBatch([]cid.Cid, abi.ChainEpoch) error
Get(cid.Cid) (abi.ChainEpoch, error)
Delete(cid.Cid) error
DeleteBatch([]cid.Cid) error
ForEach(func(cid.Cid, abi.ChainEpoch) error) error
Sync() error
Close() error
}
// OpenTrackingStore opens a tracking store of the specified type in the
// specified path.
func OpenTrackingStore(path string, ttype string) (TrackingStore, error) {
switch ttype {
case "", "bolt":
return OpenBoltTrackingStore(filepath.Join(path, "tracker.bolt"))
case "mem":
return NewMemTrackingStore(), nil
default:
return nil, xerrors.Errorf("unknown tracking store type %s", ttype)
}
}
// NewMemTrackingStore creates an in-memory tracking store.
// This is only useful for test or situations where you don't want to open the
// real tracking store (eg concurrent read only access on a node's datastore)
func NewMemTrackingStore() *MemTrackingStore {
return &MemTrackingStore{tab: make(map[cid.Cid]abi.ChainEpoch)}
}
// MemTrackingStore is a simple in-memory tracking store
type MemTrackingStore struct {
sync.Mutex
tab map[cid.Cid]abi.ChainEpoch
}
var _ TrackingStore = (*MemTrackingStore)(nil)
func (s *MemTrackingStore) Put(cid cid.Cid, epoch abi.ChainEpoch) error {
s.Lock()
defer s.Unlock()
s.tab[cid] = epoch
return nil
}
func (s *MemTrackingStore) PutBatch(cids []cid.Cid, epoch abi.ChainEpoch) error {
s.Lock()
defer s.Unlock()
for _, cid := range cids {
s.tab[cid] = epoch
}
return nil
}
func (s *MemTrackingStore) Get(cid cid.Cid) (abi.ChainEpoch, error) {
s.Lock()
defer s.Unlock()
epoch, ok := s.tab[cid]
if ok {
return epoch, nil
}
return 0, xerrors.Errorf("missing tracking epoch for %s", cid)
}
func (s *MemTrackingStore) Delete(cid cid.Cid) error {
s.Lock()
defer s.Unlock()
delete(s.tab, cid)
return nil
}
func (s *MemTrackingStore) DeleteBatch(cids []cid.Cid) error {
s.Lock()
defer s.Unlock()
for _, cid := range cids {
delete(s.tab, cid)
}
return nil
}
func (s *MemTrackingStore) ForEach(f func(cid.Cid, abi.ChainEpoch) error) error {
s.Lock()
defer s.Unlock()
for cid, epoch := range s.tab {
err := f(cid, epoch)
if err != nil {
return err
}
}
return nil
}
func (s *MemTrackingStore) Sync() error { return nil }
func (s *MemTrackingStore) Close() error { return nil }
+120
View File
@@ -0,0 +1,120 @@
package splitstore
import (
"time"
"golang.org/x/xerrors"
cid "github.com/ipfs/go-cid"
bolt "go.etcd.io/bbolt"
"github.com/filecoin-project/go-state-types/abi"
)
type BoltTrackingStore struct {
db *bolt.DB
bucketId []byte
}
var _ TrackingStore = (*BoltTrackingStore)(nil)
func OpenBoltTrackingStore(path string) (*BoltTrackingStore, error) {
opts := &bolt.Options{
Timeout: 1 * time.Second,
NoSync: true,
}
db, err := bolt.Open(path, 0644, opts)
if err != nil {
return nil, err
}
bucketId := []byte("tracker")
err = db.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists(bucketId)
if err != nil {
return xerrors.Errorf("error creating bolt db bucket %s: %w", string(bucketId), err)
}
return nil
})
if err != nil {
_ = db.Close()
return nil, err
}
return &BoltTrackingStore{db: db, bucketId: bucketId}, nil
}
func (s *BoltTrackingStore) Put(cid cid.Cid, epoch abi.ChainEpoch) error {
val := epochToBytes(epoch)
return s.db.Batch(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
return b.Put(cid.Hash(), val)
})
}
func (s *BoltTrackingStore) PutBatch(cids []cid.Cid, epoch abi.ChainEpoch) error {
val := epochToBytes(epoch)
return s.db.Batch(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
for _, cid := range cids {
err := b.Put(cid.Hash(), val)
if err != nil {
return err
}
}
return nil
})
}
func (s *BoltTrackingStore) Get(cid cid.Cid) (epoch abi.ChainEpoch, err error) {
err = s.db.View(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
val := b.Get(cid.Hash())
if val == nil {
return xerrors.Errorf("missing tracking epoch for %s", cid)
}
epoch = bytesToEpoch(val)
return nil
})
return epoch, err
}
func (s *BoltTrackingStore) Delete(cid cid.Cid) error {
return s.db.Batch(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
return b.Delete(cid.Hash())
})
}
func (s *BoltTrackingStore) DeleteBatch(cids []cid.Cid) error {
return s.db.Batch(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
for _, cid := range cids {
err := b.Delete(cid.Hash())
if err != nil {
return xerrors.Errorf("error deleting %s", cid)
}
}
return nil
})
}
func (s *BoltTrackingStore) ForEach(f func(cid.Cid, abi.ChainEpoch) error) error {
return s.db.View(func(tx *bolt.Tx) error {
b := tx.Bucket(s.bucketId)
return b.ForEach(func(k, v []byte) error {
cid := cid.NewCidV1(cid.Raw, k)
epoch := bytesToEpoch(v)
return f(cid, epoch)
})
})
}
func (s *BoltTrackingStore) Sync() error {
return s.db.Sync()
}
func (s *BoltTrackingStore) Close() error {
return s.db.Close()
}
+130
View File
@@ -0,0 +1,130 @@
package splitstore
import (
"io/ioutil"
"testing"
cid "github.com/ipfs/go-cid"
"github.com/multiformats/go-multihash"
"github.com/filecoin-project/go-state-types/abi"
)
func TestBoltTrackingStore(t *testing.T) {
testTrackingStore(t, "bolt")
}
func testTrackingStore(t *testing.T, tsType string) {
t.Helper()
makeCid := func(key string) cid.Cid {
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
if err != nil {
t.Fatal(err)
}
return cid.NewCidV1(cid.Raw, h)
}
mustHave := func(s TrackingStore, cid cid.Cid, epoch abi.ChainEpoch) {
val, err := s.Get(cid)
if err != nil {
t.Fatal(err)
}
if val != epoch {
t.Fatal("epoch mismatch")
}
}
mustNotHave := func(s TrackingStore, cid cid.Cid) {
_, err := s.Get(cid)
if err == nil {
t.Fatal("expected error")
}
}
path, err := ioutil.TempDir("", "snoop-test.*")
if err != nil {
t.Fatal(err)
}
s, err := OpenTrackingStore(path, tsType)
if err != nil {
t.Fatal(err)
}
k1 := makeCid("a")
k2 := makeCid("b")
k3 := makeCid("c")
k4 := makeCid("d")
s.Put(k1, 1) //nolint
s.Put(k2, 2) //nolint
s.Put(k3, 3) //nolint
s.Put(k4, 4) //nolint
mustHave(s, k1, 1)
mustHave(s, k2, 2)
mustHave(s, k3, 3)
mustHave(s, k4, 4)
s.Delete(k1) // nolint
s.Delete(k2) // nolint
mustNotHave(s, k1)
mustNotHave(s, k2)
mustHave(s, k3, 3)
mustHave(s, k4, 4)
s.PutBatch([]cid.Cid{k1}, 1) //nolint
s.PutBatch([]cid.Cid{k2}, 2) //nolint
mustHave(s, k1, 1)
mustHave(s, k2, 2)
mustHave(s, k3, 3)
mustHave(s, k4, 4)
allKeys := map[string]struct{}{
k1.String(): {},
k2.String(): {},
k3.String(): {},
k4.String(): {},
}
err = s.ForEach(func(k cid.Cid, _ abi.ChainEpoch) error {
_, ok := allKeys[k.String()]
if !ok {
t.Fatal("unexpected key")
}
delete(allKeys, k.String())
return nil
})
if err != nil {
t.Fatal(err)
}
if len(allKeys) != 0 {
t.Fatal("not all keys were returned")
}
// no close and reopen and ensure the keys still exist
err = s.Close()
if err != nil {
t.Fatal(err)
}
s, err = OpenTrackingStore(path, tsType)
if err != nil {
t.Fatal(err)
}
mustHave(s, k1, 1)
mustHave(s, k2, 2)
mustHave(s, k3, 3)
mustHave(s, k4, 4)
s.Close() //nolint:errcheck
}
+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
}
+178
View File
@@ -0,0 +1,178 @@
package blockstore
import (
"context"
"fmt"
"sync"
"time"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/raulk/clock"
"go.uber.org/multierr"
)
// TimedCacheBlockstore is a blockstore that keeps blocks for at least the
// specified caching interval before discarding them. Garbage collection must
// be started and stopped by calling Start/Stop.
//
// Under the covers, it's implemented with an active and an inactive blockstore
// that are rotated every cache time interval. This means all blocks will be
// stored at most 2x the cache interval.
//
// Create a new instance by calling the NewTimedCacheBlockstore constructor.
type TimedCacheBlockstore struct {
mu sync.RWMutex
active, inactive MemBlockstore
clock clock.Clock
interval time.Duration
closeCh chan struct{}
doneRotatingCh chan struct{}
}
func NewTimedCacheBlockstore(interval time.Duration) *TimedCacheBlockstore {
b := &TimedCacheBlockstore{
active: NewMemory(),
inactive: NewMemory(),
interval: interval,
clock: clock.New(),
}
return b
}
func (t *TimedCacheBlockstore) Start(_ context.Context) error {
t.mu.Lock()
defer t.mu.Unlock()
if t.closeCh != nil {
return fmt.Errorf("already started")
}
t.closeCh = make(chan struct{})
go func() {
ticker := t.clock.Ticker(t.interval)
defer ticker.Stop()
for {
select {
case <-ticker.C:
t.rotate()
if t.doneRotatingCh != nil {
t.doneRotatingCh <- struct{}{}
}
case <-t.closeCh:
return
}
}
}()
return nil
}
func (t *TimedCacheBlockstore) Stop(_ context.Context) error {
t.mu.Lock()
defer t.mu.Unlock()
if t.closeCh == nil {
return fmt.Errorf("not started")
}
select {
case <-t.closeCh:
// already closed
default:
close(t.closeCh)
}
return nil
}
func (t *TimedCacheBlockstore) rotate() {
newBs := NewMemory()
t.mu.Lock()
t.inactive, t.active = t.active, newBs
t.mu.Unlock()
}
func (t *TimedCacheBlockstore) Put(b blocks.Block) error {
// Don't check the inactive set here. We want to keep this block for at
// least one interval.
t.mu.Lock()
defer t.mu.Unlock()
return t.active.Put(b)
}
func (t *TimedCacheBlockstore) PutMany(bs []blocks.Block) error {
t.mu.Lock()
defer t.mu.Unlock()
return t.active.PutMany(bs)
}
func (t *TimedCacheBlockstore) View(k cid.Cid, callback func([]byte) error) error {
t.mu.RLock()
defer t.mu.RUnlock()
err := t.active.View(k, callback)
if err == ErrNotFound {
err = t.inactive.View(k, callback)
}
return err
}
func (t *TimedCacheBlockstore) Get(k cid.Cid) (blocks.Block, error) {
t.mu.RLock()
defer t.mu.RUnlock()
b, err := t.active.Get(k)
if err == ErrNotFound {
b, err = t.inactive.Get(k)
}
return b, err
}
func (t *TimedCacheBlockstore) GetSize(k cid.Cid) (int, error) {
t.mu.RLock()
defer t.mu.RUnlock()
size, err := t.active.GetSize(k)
if err == ErrNotFound {
size, err = t.inactive.GetSize(k)
}
return size, err
}
func (t *TimedCacheBlockstore) Has(k cid.Cid) (bool, error) {
t.mu.RLock()
defer t.mu.RUnlock()
if has, err := t.active.Has(k); err != nil {
return false, err
} else if has {
return true, nil
}
return t.inactive.Has(k)
}
func (t *TimedCacheBlockstore) HashOnRead(_ bool) {
// no-op
}
func (t *TimedCacheBlockstore) DeleteBlock(k cid.Cid) error {
t.mu.Lock()
defer t.mu.Unlock()
return multierr.Combine(t.active.DeleteBlock(k), t.inactive.DeleteBlock(k))
}
func (t *TimedCacheBlockstore) DeleteMany(ks []cid.Cid) error {
t.mu.Lock()
defer t.mu.Unlock()
return multierr.Combine(t.active.DeleteMany(ks), t.inactive.DeleteMany(ks))
}
func (t *TimedCacheBlockstore) AllKeysChan(_ context.Context) (<-chan cid.Cid, error) {
t.mu.RLock()
defer t.mu.RUnlock()
ch := make(chan cid.Cid, len(t.active)+len(t.inactive))
for c := range t.active {
ch <- c
}
for c := range t.inactive {
if _, ok := t.active[c]; ok {
continue
}
ch <- c
}
close(ch)
return ch, nil
}
+85
View File
@@ -0,0 +1,85 @@
package blockstore
import (
"context"
"testing"
"time"
"github.com/raulk/clock"
"github.com/stretchr/testify/require"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
)
func TestTimedCacheBlockstoreSimple(t *testing.T) {
tc := NewTimedCacheBlockstore(10 * time.Millisecond)
mClock := clock.NewMock()
mClock.Set(time.Now())
tc.clock = mClock
tc.doneRotatingCh = make(chan struct{})
_ = tc.Start(context.Background())
mClock.Add(1) // IDK why it is needed but it makes it work
defer func() {
_ = tc.Stop(context.Background())
}()
b1 := blocks.NewBlock([]byte("foo"))
require.NoError(t, tc.Put(b1))
b2 := blocks.NewBlock([]byte("bar"))
require.NoError(t, tc.Put(b2))
b3 := blocks.NewBlock([]byte("baz"))
b1out, err := tc.Get(b1.Cid())
require.NoError(t, err)
require.Equal(t, b1.RawData(), b1out.RawData())
has, err := tc.Has(b1.Cid())
require.NoError(t, err)
require.True(t, has)
mClock.Add(10 * time.Millisecond)
<-tc.doneRotatingCh
// We should still have everything.
has, err = tc.Has(b1.Cid())
require.NoError(t, err)
require.True(t, has)
has, err = tc.Has(b2.Cid())
require.NoError(t, err)
require.True(t, has)
// extend b2, add b3.
require.NoError(t, tc.Put(b2))
require.NoError(t, tc.Put(b3))
// all keys once.
allKeys, err := tc.AllKeysChan(context.Background())
var ks []cid.Cid
for k := range allKeys {
ks = append(ks, k)
}
require.NoError(t, err)
require.ElementsMatch(t, ks, []cid.Cid{b1.Cid(), b2.Cid(), b3.Cid()})
mClock.Add(10 * time.Millisecond)
<-tc.doneRotatingCh
// should still have b2, and b3, but not b1
has, err = tc.Has(b1.Cid())
require.NoError(t, err)
require.False(t, has)
has, err = tc.Has(b2.Cid())
require.NoError(t, err)
require.True(t, has)
has, err = tc.Has(b3.Cid())
require.NoError(t, err)
require.True(t, has)
}
+119
View File
@@ -0,0 +1,119 @@
package blockstore
import (
"context"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
)
type unionBlockstore []Blockstore
// Union returns an unioned blockstore.
//
// * Reads return from the first blockstore that has the value, querying in the
// supplied order.
// * Writes (puts and deltes) are broadcast to all stores.
//
func Union(stores ...Blockstore) Blockstore {
return unionBlockstore(stores)
}
func (m unionBlockstore) Has(cid cid.Cid) (has bool, err error) {
for _, bs := range m {
if has, err = bs.Has(cid); has || err != nil {
break
}
}
return has, err
}
func (m unionBlockstore) Get(cid cid.Cid) (blk blocks.Block, err error) {
for _, bs := range m {
if blk, err = bs.Get(cid); err == nil || err != ErrNotFound {
break
}
}
return blk, err
}
func (m unionBlockstore) View(cid cid.Cid, callback func([]byte) error) (err error) {
for _, bs := range m {
if err = bs.View(cid, callback); err == nil || err != ErrNotFound {
break
}
}
return err
}
func (m unionBlockstore) GetSize(cid cid.Cid) (size int, err error) {
for _, bs := range m {
if size, err = bs.GetSize(cid); err == nil || err != ErrNotFound {
break
}
}
return size, err
}
func (m unionBlockstore) Put(block blocks.Block) (err error) {
for _, bs := range m {
if err = bs.Put(block); err != nil {
break
}
}
return err
}
func (m unionBlockstore) PutMany(blks []blocks.Block) (err error) {
for _, bs := range m {
if err = bs.PutMany(blks); err != nil {
break
}
}
return err
}
func (m unionBlockstore) DeleteBlock(cid cid.Cid) (err error) {
for _, bs := range m {
if err = bs.DeleteBlock(cid); err != nil {
break
}
}
return err
}
func (m unionBlockstore) DeleteMany(cids []cid.Cid) (err error) {
for _, bs := range m {
if err = bs.DeleteMany(cids); err != nil {
break
}
}
return err
}
func (m unionBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
// this does not deduplicate; this interface needs to be revisited.
outCh := make(chan cid.Cid)
go func() {
defer close(outCh)
for _, bs := range m {
ch, err := bs.AllKeysChan(ctx)
if err != nil {
return
}
for cid := range ch {
outCh <- cid
}
}
}()
return outCh, nil
}
func (m unionBlockstore) HashOnRead(enabled bool) {
for _, bs := range m {
bs.HashOnRead(enabled)
}
}
+102
View File
@@ -0,0 +1,102 @@
package blockstore
import (
"context"
"testing"
blocks "github.com/ipfs/go-block-format"
"github.com/stretchr/testify/require"
)
var (
b0 = blocks.NewBlock([]byte("abc"))
b1 = blocks.NewBlock([]byte("foo"))
b2 = blocks.NewBlock([]byte("bar"))
)
func TestUnionBlockstore_Get(t *testing.T) {
m1 := NewMemory()
m2 := NewMemory()
_ = m1.Put(b1)
_ = m2.Put(b2)
u := Union(m1, m2)
v1, err := u.Get(b1.Cid())
require.NoError(t, err)
require.Equal(t, b1.RawData(), v1.RawData())
v2, err := u.Get(b2.Cid())
require.NoError(t, err)
require.Equal(t, b2.RawData(), v2.RawData())
}
func TestUnionBlockstore_Put_PutMany_Delete_AllKeysChan(t *testing.T) {
m1 := NewMemory()
m2 := NewMemory()
u := Union(m1, m2)
err := u.Put(b0)
require.NoError(t, err)
var has bool
// write was broadcasted to all stores.
has, _ = m1.Has(b0.Cid())
require.True(t, has)
has, _ = m2.Has(b0.Cid())
require.True(t, has)
has, _ = u.Has(b0.Cid())
require.True(t, has)
// put many.
err = u.PutMany([]blocks.Block{b1, b2})
require.NoError(t, err)
// write was broadcasted to all stores.
has, _ = m1.Has(b1.Cid())
require.True(t, has)
has, _ = m1.Has(b2.Cid())
require.True(t, has)
has, _ = m2.Has(b1.Cid())
require.True(t, has)
has, _ = m2.Has(b2.Cid())
require.True(t, has)
// also in the union store.
has, _ = u.Has(b1.Cid())
require.True(t, has)
has, _ = u.Has(b2.Cid())
require.True(t, has)
// deleted from all stores.
err = u.DeleteBlock(b1.Cid())
require.NoError(t, err)
has, _ = u.Has(b1.Cid())
require.False(t, has)
has, _ = m1.Has(b1.Cid())
require.False(t, has)
has, _ = m2.Has(b1.Cid())
require.False(t, has)
// check that AllKeysChan returns b0 and b2, twice (once per backing store)
ch, err := u.AllKeysChan(context.Background())
require.NoError(t, err)
var i int
for range ch {
i++
}
require.Equal(t, 4, i)
}
+9 -19
View File
@@ -2,11 +2,9 @@ package build
import (
"context"
"os"
"strings"
"github.com/filecoin-project/lotus/lib/addrutil"
"golang.org/x/xerrors"
rice "github.com/GeertJohan/go.rice"
"github.com/libp2p/go-libp2p-core/peer"
@@ -17,24 +15,16 @@ func BuiltinBootstrap() ([]peer.AddrInfo, error) {
return nil, nil
}
var out []peer.AddrInfo
b := rice.MustFindBox("bootstrap")
err := b.Walk("", func(path string, info os.FileInfo, err error) error {
if err != nil {
return xerrors.Errorf("failed to walk box: %w", err)
if BootstrappersFile != "" {
spi := b.MustString(BootstrappersFile)
if spi == "" {
return nil, nil
}
if !strings.HasSuffix(path, ".pi") {
return nil
}
spi := b.MustString(path)
if spi == "" {
return nil
}
pi, err := addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(spi), "\n"))
out = append(out, pi...)
return err
})
return out, err
return addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(spi), "\n"))
}
return nil, nil
}
-12
View File
@@ -1,12 +0,0 @@
/dns4/bootstrap-0.testnet.fildev.network/tcp/1347/p2p/12D3KooWJTUBUjtzWJGWU1XSiY21CwmHaCNLNYn2E7jqHEHyZaP7
/dns4/bootstrap-1.testnet.fildev.network/tcp/1347/p2p/12D3KooW9yeKXha4hdrJKq74zEo99T8DhriQdWNoojWnnQbsgB3v
/dns4/bootstrap-2.testnet.fildev.network/tcp/1347/p2p/12D3KooWCrx8yVG9U9Kf7w8KLN3Edkj5ZKDhgCaeMqQbcQUoB6CT
/dns4/bootstrap-4.testnet.fildev.network/tcp/1347/p2p/12D3KooWPkL9LrKRQgHtq7kn9ecNhGU9QaziG8R5tX8v9v7t3h34
/dns4/bootstrap-3.testnet.fildev.network/tcp/1347/p2p/12D3KooWKYSsbpgZ3HAjax5M1BXCwXLa6gVkUARciz7uN3FNtr7T
/dns4/bootstrap-5.testnet.fildev.network/tcp/1347/p2p/12D3KooWQYzqnLASJAabyMpPb1GcWZvNSe7JDcRuhdRqonFoiK9W
/dns4/lotus-bootstrap.forceup.cn/tcp/41778/p2p/12D3KooWFQsv3nRMUevZNWWsY1Wu6NUzUbawnWU5NcRhgKuJA37C
/dns4/bootstrap-0.starpool.in/tcp/12757/p2p/12D3KooWGHpBMeZbestVEWkfdnC9u7p6uFHXL1n7m1ZBqsEmiUzz
/dns4/bootstrap-1.starpool.in/tcp/12757/p2p/12D3KooWQZrGH1PxSNZPum99M1zNvjNFM33d1AAu5DcvdHptuU7u
/dns4/node.glif.io/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt
/dns4/bootstrap-0.ipfsmain.cn/tcp/34721/p2p/12D3KooWQnwEGNqcM2nAcPtRR9rAX8Hrg4k9kJLCHoTR5chJfz6d
/dns4/bootstrap-1.ipfsmain.cn/tcp/34723/p2p/12D3KooWMKxMkD5DMpSWsW7dBddKxKT7L2GgbNuckz9otxvkvByP
+2
View File
@@ -0,0 +1,2 @@
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWRkaF18SR3E6qL6dkGrozT8QJUV5VbhE9E7BZtPmHqdWJ
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWJcJUc23WJjJHGSboGcU3t76z9Lb7CghrH2tiBiDCY4ux
+4
View File
@@ -0,0 +1,4 @@
/dns4/bootstrap-0.calibration.fildev.network/tcp/1347/p2p/12D3KooWRLZAseMo9h7fRD6ojn6YYDXHsBSavX5YmjBZ9ngtAEec
/dns4/bootstrap-1.calibration.fildev.network/tcp/1347/p2p/12D3KooWJFtDXgZEQMEkjJPSrbfdvh2xfjVKrXeNFG1t8ioJXAzv
/dns4/bootstrap-2.calibration.fildev.network/tcp/1347/p2p/12D3KooWP1uB9Lo7yCA3S17TD4Y5wStP5Nk7Vqh53m8GsFjkyujD
/dns4/bootstrap-3.calibration.fildev.network/tcp/1347/p2p/12D3KooWLrPM4WPK1YRGPCUwndWcDX8GCYgms3DiuofUmxwvhMCn
+15
View File
@@ -0,0 +1,15 @@
/dns4/bootstrap-0.mainnet.filops.net/tcp/1347/p2p/12D3KooWCVe8MmsEMes2FzgTpt9fXtmCY7wrq91GRiaC8PHSCCBj
/dns4/bootstrap-1.mainnet.filops.net/tcp/1347/p2p/12D3KooWCwevHg1yLCvktf2nvLu7L9894mcrJR4MsBCcm4syShVc
/dns4/bootstrap-2.mainnet.filops.net/tcp/1347/p2p/12D3KooWEWVwHGn2yR36gKLozmb4YjDJGerotAPGxmdWZx2nxMC4
/dns4/bootstrap-3.mainnet.filops.net/tcp/1347/p2p/12D3KooWKhgq8c7NQ9iGjbyK7v7phXvG6492HQfiDaGHLHLQjk7R
/dns4/bootstrap-4.mainnet.filops.net/tcp/1347/p2p/12D3KooWL6PsFNPhYftrJzGgF5U18hFoaVhfGk7xwzD8yVrHJ3Uc
/dns4/bootstrap-5.mainnet.filops.net/tcp/1347/p2p/12D3KooWLFynvDQiUpXoHroV1YxKHhPJgysQGH2k3ZGwtWzR4dFH
/dns4/bootstrap-6.mainnet.filops.net/tcp/1347/p2p/12D3KooWP5MwCiqdMETF9ub1P3MbCvQCcfconnYHbWg6sUJcDRQQ
/dns4/bootstrap-7.mainnet.filops.net/tcp/1347/p2p/12D3KooWRs3aY1p3juFjPy8gPN95PEQChm2QKGUCAdcDCC4EBMKf
/dns4/bootstrap-8.mainnet.filops.net/tcp/1347/p2p/12D3KooWScFR7385LTyR4zU1bYdzSiiAb5rnNABfVahPvVSzyTkR
/dns4/lotus-bootstrap.forceup.cn/tcp/41778/p2p/12D3KooWFQsv3nRMUevZNWWsY1Wu6NUzUbawnWU5NcRhgKuJA37C
/dns4/bootstrap-0.starpool.in/tcp/12757/p2p/12D3KooWGHpBMeZbestVEWkfdnC9u7p6uFHXL1n7m1ZBqsEmiUzz
/dns4/bootstrap-1.starpool.in/tcp/12757/p2p/12D3KooWQZrGH1PxSNZPum99M1zNvjNFM33d1AAu5DcvdHptuU7u
/dns4/node.glif.io/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt
/dns4/bootstrap-0.ipfsmain.cn/tcp/34721/p2p/12D3KooWQnwEGNqcM2nAcPtRR9rAX8Hrg4k9kJLCHoTR5chJfz6d
/dns4/bootstrap-1.ipfsmain.cn/tcp/34723/p2p/12D3KooWMKxMkD5DMpSWsW7dBddKxKT7L2GgbNuckz9otxvkvByP
+4
View File
@@ -0,0 +1,4 @@
/dns4/bootstrap-2.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWQcL6ReWmR6ASWx4iT7EiAmxKDQpvgq1MKNTQZp5NPnWW
/dns4/bootstrap-0.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWGyJCwCm7EfupM15CFPXM4c7zRVHwwwjcuy9umaGeztMX
/dns4/bootstrap-3.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWNK9RmfksKXSCQj7ZwAM7L6roqbN4kwJteihq7yPvSgPs
/dns4/bootstrap-1.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWCWSaH6iUyXYspYxELjDfzToBsyVGVz3QvC7ysXv7wESo
+1 -10
View File
@@ -35,6 +35,7 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{
"https://api.drand.sh",
"https://api2.drand.sh",
"https://api3.drand.sh",
"https://drand.cloudflare.com",
},
Relays: []string{
"/dnsaddr/api.drand.sh/",
@@ -68,16 +69,6 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{
ChainInfoJSON: `{"public_key":"8cda589f88914aa728fd183f383980b35789ce81b274e5daee1f338b77d02566ef4d3fb0098af1f844f10f9c803c1827","period":25,"genesis_time":1595348225,"hash":"e73b7dc3c4f6a236378220c0dd6aa110eb16eed26c11259606e07ee122838d4f","groupHash":"567d4785122a5a3e75a9bc9911d7ea807dd85ff76b78dc4ff06b075712898607"}`,
},
DrandIncentinet: {
Servers: []string{
"https://pl-eu.incentinet.drand.sh",
"https://pl-us.incentinet.drand.sh",
"https://pl-sin.incentinet.drand.sh",
},
Relays: []string{
"/dnsaddr/pl-eu.incentinet.drand.sh/",
"/dnsaddr/pl-us.incentinet.drand.sh/",
"/dnsaddr/pl-sin.incentinet.drand.sh/",
},
ChainInfoJSON: `{"public_key":"8cad0c72c606ab27d36ee06de1d5b2db1faf92e447025ca37575ab3a8aac2eaae83192f846fc9e158bc738423753d000","period":30,"genesis_time":1595873820,"hash":"80c8b872c714f4c00fdd3daa465d5514049f457f01f85a4caf68cdcd394ba039","groupHash":"d9406aaed487f7af71851b4399448e311f2328923d454e971536c05398ce2d9b"}`,
},
}
+1 -1
View File
@@ -14,7 +14,7 @@ func MaybeGenesis() []byte {
log.Warnf("loading built-in genesis: %s", err)
return nil
}
genBytes, err := builtinGen.Bytes("devnet.car")
genBytes, err := builtinGen.Bytes(GenesisFile)
if err != nil {
log.Warnf("loading built-in genesis: %s", err)
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
package build
import (
"github.com/filecoin-project/go-state-types/abi"
)
func IsNearUpgrade(epoch, upgradeEpoch abi.ChainEpoch) bool {
return epoch > upgradeEpoch-Finality && epoch < upgradeEpoch+Finality
}
+50 -10
View File
@@ -3,23 +3,37 @@
package build
import (
"math"
"os"
"strconv"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
const UpgradeBreezeHeight = -1
const BootstrappersFile = ""
const GenesisFile = ""
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
const BreezeGasTampingDuration = 0
const UpgradeSmokeHeight = -1
const UpgradeIgnitionHeight = -2
const UpgradeRefuelHeight = -3
var UpgradeSmokeHeight = abi.ChainEpoch(-1)
var UpgradeIgnitionHeight = abi.ChainEpoch(-2)
var UpgradeRefuelHeight = abi.ChainEpoch(-3)
var UpgradeTapeHeight = abi.ChainEpoch(-4)
var UpgradeActorsV2Height = abi.ChainEpoch(10)
var UpgradeLiftoffHeight = abi.ChainEpoch(-4)
var UpgradeLiftoffHeight = abi.ChainEpoch(-5)
var UpgradeKumquatHeight = abi.ChainEpoch(15)
var UpgradeCalicoHeight = abi.ChainEpoch(20)
var UpgradePersianHeight = abi.ChainEpoch(25)
var UpgradeOrangeHeight = abi.ChainEpoch(27)
var UpgradeClausHeight = abi.ChainEpoch(30)
var UpgradeActorsV3Height = abi.ChainEpoch(35)
var UpgradeNorwegianHeight = abi.ChainEpoch(40)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
@@ -30,11 +44,35 @@ func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
if os.Getenv("LOTUS_DISABLE_V2_ACTOR_MIGRATION") == "1" {
UpgradeActorsV2Height = math.MaxInt64
UpgradeLiftoffHeight = 11
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
hs, found := os.LookupEnv(ev)
if found {
h, err := strconv.Atoi(hs)
if err != nil {
log.Panicf("failed to parse %s env var", ev)
}
return abi.ChainEpoch(h)
}
return def
}
UpgradeBreezeHeight = getUpgradeHeight("LOTUS_BREEZE_HEIGHT", UpgradeBreezeHeight)
UpgradeSmokeHeight = getUpgradeHeight("LOTUS_SMOKE_HEIGHT", UpgradeSmokeHeight)
UpgradeIgnitionHeight = getUpgradeHeight("LOTUS_IGNITION_HEIGHT", UpgradeIgnitionHeight)
UpgradeRefuelHeight = getUpgradeHeight("LOTUS_REFUEL_HEIGHT", UpgradeRefuelHeight)
UpgradeTapeHeight = getUpgradeHeight("LOTUS_TAPE_HEIGHT", UpgradeTapeHeight)
UpgradeActorsV2Height = getUpgradeHeight("LOTUS_ACTORSV2_HEIGHT", UpgradeActorsV2Height)
UpgradeLiftoffHeight = getUpgradeHeight("LOTUS_LIFTOFF_HEIGHT", UpgradeLiftoffHeight)
UpgradeKumquatHeight = getUpgradeHeight("LOTUS_KUMQUAT_HEIGHT", UpgradeKumquatHeight)
UpgradeCalicoHeight = getUpgradeHeight("LOTUS_CALICO_HEIGHT", UpgradeCalicoHeight)
UpgradePersianHeight = getUpgradeHeight("LOTUS_PERSIAN_HEIGHT", UpgradePersianHeight)
UpgradeOrangeHeight = getUpgradeHeight("LOTUS_ORANGE_HEIGHT", UpgradeOrangeHeight)
UpgradeClausHeight = getUpgradeHeight("LOTUS_CLAUS_HEIGHT", UpgradeClausHeight)
UpgradeActorsV3Height = getUpgradeHeight("LOTUS_ACTORSV3_HEIGHT", UpgradeActorsV3Height)
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
BuildType |= Build2k
}
@@ -50,3 +88,5 @@ const SlashablePowerDelay = 20
// Epochs
const InteractivePoRepConfidence = 6
const BootstrapPeerThreshold = 1
+53
View File
@@ -0,0 +1,53 @@
// +build butterflynet
package build
import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/actors/policy"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
const BootstrappersFile = "butterflynet.pi"
const GenesisFile = "butterflynet.car"
const UpgradeBreezeHeight = -1
const BreezeGasTampingDuration = 120
const UpgradeSmokeHeight = -2
const UpgradeIgnitionHeight = -3
const UpgradeRefuelHeight = -4
var UpgradeActorsV2Height = abi.ChainEpoch(30)
const UpgradeTapeHeight = 60
const UpgradeLiftoffHeight = -5
const UpgradeKumquatHeight = 90
const UpgradeCalicoHeight = 120
const UpgradePersianHeight = 150
const UpgradeClausHeight = 180
const UpgradeOrangeHeight = 210
const UpgradeActorsV3Height = 240
const UpgradeNorwegianHeight = UpgradeActorsV3Height + (builtin2.EpochsInHour * 12)
func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
policy.SetSupportedProofTypes(
abi.RegisteredSealProof_StackedDrg512MiBV1,
)
SetAddressNetwork(address.Testnet)
Devnet = true
}
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
const PropagationDelaySecs = uint64(6)
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
const BootstrapPeerThreshold = 2
+64
View File
@@ -0,0 +1,64 @@
// +build calibnet
package build
import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/actors/policy"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
const BootstrappersFile = "calibnet.pi"
const GenesisFile = "calibnet.car"
const UpgradeBreezeHeight = -1
const BreezeGasTampingDuration = 120
const UpgradeSmokeHeight = -2
const UpgradeIgnitionHeight = -3
const UpgradeRefuelHeight = -4
var UpgradeActorsV2Height = abi.ChainEpoch(30)
const UpgradeTapeHeight = 60
const UpgradeLiftoffHeight = -5
const UpgradeKumquatHeight = 90
const UpgradeCalicoHeight = 100
const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 1)
const UpgradeClausHeight = 250
const UpgradeOrangeHeight = 300
const UpgradeActorsV3Height = 600
const UpgradeNorwegianHeight = 114000
func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(32 << 30))
policy.SetSupportedProofTypes(
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
)
SetAddressNetwork(address.Testnet)
Devnet = true
BuildType = BuildCalibnet
}
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
const PropagationDelaySecs = uint64(6)
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
const BootstrapPeerThreshold = 4
@@ -1,6 +1,9 @@
// +build !debug
// +build !2k
// +build !testground
// +build !calibnet
// +build !nerpanet
// +build !butterflynet
package build
@@ -11,8 +14,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/actors/policy"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
@@ -20,7 +22,11 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
UpgradeSmokeHeight: DrandMainnet,
}
const BootstrappersFile = "mainnet.pi"
const GenesisFile = "mainnet.car"
const UpgradeBreezeHeight = 41280
const BreezeGasTampingDuration = 120
const UpgradeSmokeHeight = 51000
@@ -28,31 +34,50 @@ const UpgradeSmokeHeight = 51000
const UpgradeIgnitionHeight = 94000
const UpgradeRefuelHeight = 130800
var UpgradeActorsV2Height = abi.ChainEpoch(138720)
const UpgradeActorsV2Height = 138720
const UpgradeTapeHeight = 140760
// This signals our tentative epoch for mainnet launch. Can make it later, but not earlier.
// Miners, clients, developers, custodians all need time to prepare.
// We still have upgrades and state changes to do, but can happen after signaling timing here.
const UpgradeLiftoffHeight = 148888
const UpgradeKumquatHeight = 170000
const UpgradeCalicoHeight = 265200
const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 60)
const UpgradeOrangeHeight = 336458
// 2020-12-22T02:00:00Z
const UpgradeClausHeight = 343200
// 2021-03-04T00:00:30Z
var UpgradeActorsV3Height = abi.ChainEpoch(550321)
// 2021-04-12T22:00:00Z
const UpgradeNorwegianHeight = 665280
func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(10 << 40))
policy.SetSupportedProofTypes(
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
)
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
SetAddressNetwork(address.Mainnet)
}
if os.Getenv("LOTUS_DISABLE_V2_ACTOR_MIGRATION") == "1" {
UpgradeActorsV2Height = math.MaxInt64
if os.Getenv("LOTUS_DISABLE_V3_ACTOR_MIGRATION") == "1" {
UpgradeActorsV3Height = math.MaxInt64
}
Devnet = false
BuildType = BuildMainnet
}
const BlockDelaySecs = uint64(builtin0.EpochDurationSeconds)
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
const PropagationDelaySecs = uint64(6)
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
const BootstrapPeerThreshold = 4
+73
View File
@@ -0,0 +1,73 @@
// +build nerpanet
package build
import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/actors/policy"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
const BootstrappersFile = "nerpanet.pi"
const GenesisFile = "nerpanet.car"
const UpgradeBreezeHeight = -1
const BreezeGasTampingDuration = 0
const UpgradeSmokeHeight = -1
const UpgradeIgnitionHeight = -2
const UpgradeRefuelHeight = -3
const UpgradeLiftoffHeight = -5
const UpgradeActorsV2Height = 30 // critical: the network can bootstrap from v1 only
const UpgradeTapeHeight = 60
const UpgradeKumquatHeight = 90
const UpgradeCalicoHeight = 100
const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 1)
const UpgradeClausHeight = 250
const UpgradeOrangeHeight = 300
const UpgradeActorsV3Height = 600
const UpgradeNorwegianHeight = 999999
func init() {
// Minimum block production power is set to 4 TiB
// Rationale is to discourage small-scale miners from trying to take over the network
// One needs to invest in ~2.3x the compute to break consensus, making it not worth it
//
// DOWNSIDE: the fake-seals need to be kept alive/protected, otherwise network will seize
//
policy.SetConsensusMinerMinPower(abi.NewStoragePower(4 << 40))
policy.SetSupportedProofTypes(
abi.RegisteredSealProof_StackedDrg512MiBV1,
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
)
// Lower the most time-consuming parts of PoRep
policy.SetPreCommitChallengeDelay(10)
// TODO - make this a variable
//miner.WPoStChallengeLookback = abi.ChainEpoch(2)
Devnet = false
}
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
const PropagationDelaySecs = uint64(6)
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
const BootstrapPeerThreshold = 4
+9 -31
View File
@@ -1,36 +1,13 @@
package build
import (
"sort"
"github.com/filecoin-project/go-address"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/filecoin-project/go-state-types/abi"
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
func DefaultSectorSize() abi.SectorSize {
szs := make([]abi.SectorSize, 0, len(miner0.SupportedProofTypes))
for spt := range miner0.SupportedProofTypes {
ss, err := spt.SectorSize()
if err != nil {
panic(err)
}
szs = append(szs, ss)
}
sort.Slice(szs, func(i, j int) bool {
return szs[i] < szs[j]
})
return szs[0]
}
// Core network constants
func BlocksTopic(netName dtypes.NetworkName) string { return "/fil/blocks/" + string(netName) }
@@ -39,14 +16,15 @@ func DhtProtocolName(netName dtypes.NetworkName) protocol.ID {
return protocol.ID("/fil/kad/" + string(netName))
}
func UseNewestNetwork() bool {
// TODO: Put these in a container we can iterate over
if UpgradeBreezeHeight <= 0 && UpgradeSmokeHeight <= 0 && UpgradeActorsV2Height <= 0 {
return true
}
return false
}
func SetAddressNetwork(n address.Network) {
address.CurrentNetwork = n
}
func MustParseAddress(addr string) address.Address {
ret, err := address.NewFromString(addr)
if err != nil {
panic(err)
}
return ret
}
+10 -7
View File
@@ -7,12 +7,12 @@ import (
"os"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
// /////
@@ -25,14 +25,14 @@ const UnixfsLinksPerLevel = 1024
// Consensus / Network
const AllowableClockDriftSecs = uint64(1)
const NewestNetworkVersion = network.Version4
const NewestNetworkVersion = network.Version9
const ActorUpgradeNetworkVersion = network.Version4
// Epochs
const ForkLengthThreshold = Finality
// Blocks (e)
var BlocksPerEpoch = uint64(builtin.ExpectedLeadersPerEpoch)
var BlocksPerEpoch = uint64(builtin2.ExpectedLeadersPerEpoch)
// Epochs
const Finality = policy.ChainFinality
@@ -61,6 +61,9 @@ const TicketRandomnessLookback = abi.ChainEpoch(1)
const AddressMainnetEnvVar = "_mainnet_"
// the 'f' prefix doesn't matter
var ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a")
// /////
// Devnet settings
@@ -116,4 +119,4 @@ const PackingEfficiencyDenom = 5
// Actor consts
// TODO: Pull from actors when its made not private
var MinDealDuration = abi.ChainEpoch(180 * builtin.EpochsInDay)
var MinDealDuration = abi.ChainEpoch(180 * builtin2.EpochsInDay)
+26 -11
View File
@@ -12,7 +12,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
@@ -21,14 +22,14 @@ var (
UnixfsChunkSize = uint64(1 << 20)
UnixfsLinksPerLevel = 1024
BlocksPerEpoch = uint64(builtin.ExpectedLeadersPerEpoch)
BlocksPerEpoch = uint64(builtin2.ExpectedLeadersPerEpoch)
BlockMessageLimit = 512
BlockGasLimit = int64(100_000_000_000)
BlockGasTarget = int64(BlockGasLimit / 2)
BaseFeeMaxChangeDenom = int64(8) // 12.5%
InitialBaseFee = int64(100e6)
MinimumBaseFee = int64(100)
BlockDelaySecs = uint64(builtin.EpochDurationSeconds)
BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
PropagationDelaySecs = uint64(6)
AllowableClockDriftSecs = uint64(1)
@@ -72,7 +73,7 @@ var (
// Actor consts
// TODO: Pull from actors when its made not private
MinDealDuration = abi.ChainEpoch(180 * builtin.EpochsInDay)
MinDealDuration = abi.ChainEpoch(180 * builtin2.EpochsInDay)
PackingEfficiencyNum int64 = 4
PackingEfficiencyDenom int64 = 5
@@ -80,18 +81,32 @@ var (
UpgradeBreezeHeight abi.ChainEpoch = -1
BreezeGasTampingDuration abi.ChainEpoch = 0
UpgradeSmokeHeight abi.ChainEpoch = -1
UpgradeIgnitionHeight abi.ChainEpoch = -2
UpgradeRefuelHeight abi.ChainEpoch = -3
UpgradeActorsV2Height abi.ChainEpoch = 10
UpgradeLiftoffHeight abi.ChainEpoch = -4
UpgradeSmokeHeight abi.ChainEpoch = -1
UpgradeIgnitionHeight abi.ChainEpoch = -2
UpgradeRefuelHeight abi.ChainEpoch = -3
UpgradeTapeHeight abi.ChainEpoch = -4
UpgradeActorsV2Height abi.ChainEpoch = 10
UpgradeLiftoffHeight abi.ChainEpoch = -5
UpgradeKumquatHeight abi.ChainEpoch = -6
UpgradeCalicoHeight abi.ChainEpoch = -7
UpgradePersianHeight abi.ChainEpoch = -8
UpgradeOrangeHeight abi.ChainEpoch = -9
UpgradeClausHeight abi.ChainEpoch = -10
UpgradeActorsV3Height abi.ChainEpoch = -11
UpgradeNorwegianHeight abi.ChainEpoch = -12
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
NewestNetworkVersion = network.Version4
NewestNetworkVersion = network.Version9
ActorUpgradeNetworkVersion = network.Version4
Devnet = true
Devnet = true
ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a")
BootstrappersFile = ""
GenesisFile = ""
)
const BootstrapPeerThreshold = 1
+2
View File
@@ -3,5 +3,7 @@
package build
import (
_ "github.com/GeertJohan/go.rice/rice"
_ "github.com/golang/mock/mockgen"
_ "github.com/whyrusleeping/bencher"
)
+12 -76
View File
@@ -1,100 +1,36 @@
package build
import (
"fmt"
"golang.org/x/xerrors"
)
var CurrentCommit string
var BuildType int
const (
BuildDefault = 0
Build2k = 0x1
BuildDebug = 0x3
BuildDefault = 0
BuildMainnet = 0x1
Build2k = 0x2
BuildDebug = 0x3
BuildCalibnet = 0x4
)
func buildType() string {
switch BuildType {
case BuildDefault:
return ""
case BuildDebug:
return "+debug"
case BuildMainnet:
return "+mainnet"
case Build2k:
return "+2k"
case BuildDebug:
return "+debug"
case BuildCalibnet:
return "+calibnet"
default:
return "+huh?"
}
}
// BuildVersion is the local build version, set by build system
const BuildVersion = "0.9.0"
const BuildVersion = "1.6.0"
func UserVersion() string {
return BuildVersion + buildType() + CurrentCommit
}
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 FullAPIVersion, nil
case NodeMiner:
return MinerAPIVersion, nil
case NodeWorker:
return WorkerAPIVersion, nil
default:
return Version(0), xerrors.Errorf("unknown node type %d", nodeType)
}
}
// semver versions of the rpc api exposed
var (
FullAPIVersion = newVer(0, 16, 0)
MinerAPIVersion = newVer(0, 15, 0)
WorkerAPIVersion = newVer(0, 15, 0)
)
//nolint:varcheck,deadcode
const (
majorMask = 0xff0000
minorMask = 0xffff00
patchMask = 0xffffff
majorOnlyMask = 0xff0000
minorOnlyMask = 0x00ff00
patchOnlyMask = 0x0000ff
)
-47
View File
@@ -2,16 +2,9 @@ package adt
import (
"github.com/ipfs/go-cid"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/chain/actors"
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
)
type Map interface {
@@ -24,26 +17,6 @@ type Map interface {
ForEach(v cbor.Unmarshaler, fn func(key string) error) error
}
func AsMap(store Store, root cid.Cid, version actors.Version) (Map, error) {
switch version {
case actors.Version0:
return adt0.AsMap(store, root)
case actors.Version2:
return adt2.AsMap(store, root)
}
return nil, xerrors.Errorf("unknown network version: %d", version)
}
func NewMap(store Store, version actors.Version) (Map, error) {
switch version {
case actors.Version0:
return adt0.MakeEmptyMap(store), nil
case actors.Version2:
return adt2.MakeEmptyMap(store), nil
}
return nil, xerrors.Errorf("unknown network version: %d", version)
}
type Array interface {
Root() (cid.Cid, error)
@@ -54,23 +27,3 @@ type Array interface {
ForEach(v cbor.Unmarshaler, fn func(idx int64) error) error
}
func AsArray(store Store, root cid.Cid, version network.Version) (Array, error) {
switch actors.VersionForNetwork(version) {
case actors.Version0:
return adt0.AsArray(store, root)
case actors.Version2:
return adt2.AsArray(store, root)
}
return nil, xerrors.Errorf("unknown network version: %d", version)
}
func NewArray(store Store, version actors.Version) (Array, error) {
switch version {
case actors.Version0:
return adt0.MakeEmptyArray(store), nil
case actors.Version2:
return adt2.MakeEmptyArray(store), nil
}
return nil, xerrors.Errorf("unknown network version: %d", version)
}
+39 -38
View File
@@ -12,34 +12,35 @@ import (
typegen "github.com/whyrusleeping/cbor-gen"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-actors/actors/runtime"
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
bstore "github.com/filecoin-project/lotus/lib/blockstore"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
bstore "github.com/filecoin-project/lotus/blockstore"
)
func TestDiffAdtArray(t *testing.T) {
ctxstoreA := newContextStore()
ctxstoreB := newContextStore()
arrA := adt0.MakeEmptyArray(ctxstoreA)
arrB := adt0.MakeEmptyArray(ctxstoreB)
arrA := adt2.MakeEmptyArray(ctxstoreA)
arrB := adt2.MakeEmptyArray(ctxstoreB)
require.NoError(t, arrA.Set(0, runtime.CBORBytes([]byte{0}))) // delete
require.NoError(t, arrA.Set(0, builtin2.CBORBytes([]byte{0}))) // delete
require.NoError(t, arrA.Set(1, runtime.CBORBytes([]byte{0}))) // modify
require.NoError(t, arrB.Set(1, runtime.CBORBytes([]byte{1})))
require.NoError(t, arrA.Set(1, builtin2.CBORBytes([]byte{0}))) // modify
require.NoError(t, arrB.Set(1, builtin2.CBORBytes([]byte{1})))
require.NoError(t, arrA.Set(2, runtime.CBORBytes([]byte{1}))) // delete
require.NoError(t, arrA.Set(2, builtin2.CBORBytes([]byte{1}))) // delete
require.NoError(t, arrA.Set(3, runtime.CBORBytes([]byte{0}))) // noop
require.NoError(t, arrB.Set(3, runtime.CBORBytes([]byte{0})))
require.NoError(t, arrA.Set(3, builtin2.CBORBytes([]byte{0}))) // noop
require.NoError(t, arrB.Set(3, builtin2.CBORBytes([]byte{0})))
require.NoError(t, arrA.Set(4, runtime.CBORBytes([]byte{0}))) // modify
require.NoError(t, arrB.Set(4, runtime.CBORBytes([]byte{6})))
require.NoError(t, arrA.Set(4, builtin2.CBORBytes([]byte{0}))) // modify
require.NoError(t, arrB.Set(4, builtin2.CBORBytes([]byte{6})))
require.NoError(t, arrB.Set(5, runtime.CBORBytes{8})) // add
require.NoError(t, arrB.Set(6, runtime.CBORBytes{9})) // add
require.NoError(t, arrB.Set(5, builtin2.CBORBytes{8})) // add
require.NoError(t, arrB.Set(6, builtin2.CBORBytes{9})) // add
changes := new(TestDiffArray)
@@ -76,24 +77,24 @@ func TestDiffAdtMap(t *testing.T) {
ctxstoreA := newContextStore()
ctxstoreB := newContextStore()
mapA := adt0.MakeEmptyMap(ctxstoreA)
mapB := adt0.MakeEmptyMap(ctxstoreB)
mapA := adt2.MakeEmptyMap(ctxstoreA)
mapB := adt2.MakeEmptyMap(ctxstoreB)
require.NoError(t, mapA.Put(abi.UIntKey(0), runtime.CBORBytes([]byte{0}))) // delete
require.NoError(t, mapA.Put(abi.UIntKey(0), builtin2.CBORBytes([]byte{0}))) // delete
require.NoError(t, mapA.Put(abi.UIntKey(1), runtime.CBORBytes([]byte{0}))) // modify
require.NoError(t, mapB.Put(abi.UIntKey(1), runtime.CBORBytes([]byte{1})))
require.NoError(t, mapA.Put(abi.UIntKey(1), builtin2.CBORBytes([]byte{0}))) // modify
require.NoError(t, mapB.Put(abi.UIntKey(1), builtin2.CBORBytes([]byte{1})))
require.NoError(t, mapA.Put(abi.UIntKey(2), runtime.CBORBytes([]byte{1}))) // delete
require.NoError(t, mapA.Put(abi.UIntKey(2), builtin2.CBORBytes([]byte{1}))) // delete
require.NoError(t, mapA.Put(abi.UIntKey(3), runtime.CBORBytes([]byte{0}))) // noop
require.NoError(t, mapB.Put(abi.UIntKey(3), runtime.CBORBytes([]byte{0})))
require.NoError(t, mapA.Put(abi.UIntKey(3), builtin2.CBORBytes([]byte{0}))) // noop
require.NoError(t, mapB.Put(abi.UIntKey(3), builtin2.CBORBytes([]byte{0})))
require.NoError(t, mapA.Put(abi.UIntKey(4), runtime.CBORBytes([]byte{0}))) // modify
require.NoError(t, mapB.Put(abi.UIntKey(4), runtime.CBORBytes([]byte{6})))
require.NoError(t, mapA.Put(abi.UIntKey(4), builtin2.CBORBytes([]byte{0}))) // modify
require.NoError(t, mapB.Put(abi.UIntKey(4), builtin2.CBORBytes([]byte{6})))
require.NoError(t, mapB.Put(abi.UIntKey(5), runtime.CBORBytes{8})) // add
require.NoError(t, mapB.Put(abi.UIntKey(6), runtime.CBORBytes{9})) // add
require.NoError(t, mapB.Put(abi.UIntKey(5), builtin2.CBORBytes{8})) // add
require.NoError(t, mapB.Put(abi.UIntKey(6), builtin2.CBORBytes{9})) // add
changes := new(TestDiffMap)
@@ -144,7 +145,7 @@ func (t *TestDiffMap) AsKey(key string) (abi.Keyer, error) {
}
func (t *TestDiffMap) Add(key string, val *typegen.Deferred) error {
v := new(runtime.CBORBytes)
v := new(builtin2.CBORBytes)
err := v.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return err
@@ -161,13 +162,13 @@ func (t *TestDiffMap) Add(key string, val *typegen.Deferred) error {
}
func (t *TestDiffMap) Modify(key string, from, to *typegen.Deferred) error {
vFrom := new(runtime.CBORBytes)
vFrom := new(builtin2.CBORBytes)
err := vFrom.UnmarshalCBOR(bytes.NewReader(from.Raw))
if err != nil {
return err
}
vTo := new(runtime.CBORBytes)
vTo := new(builtin2.CBORBytes)
err = vTo.UnmarshalCBOR(bytes.NewReader(to.Raw))
if err != nil {
return err
@@ -194,7 +195,7 @@ func (t *TestDiffMap) Modify(key string, from, to *typegen.Deferred) error {
}
func (t *TestDiffMap) Remove(key string, val *typegen.Deferred) error {
v := new(runtime.CBORBytes)
v := new(builtin2.CBORBytes)
err := v.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return err
@@ -212,7 +213,7 @@ func (t *TestDiffMap) Remove(key string, val *typegen.Deferred) error {
type adtMapDiffResult struct {
key uint64
val runtime.CBORBytes
val builtin2.CBORBytes
}
type TestAdtMapDiffModified struct {
@@ -222,7 +223,7 @@ type TestAdtMapDiffModified struct {
type adtArrayDiffResult struct {
key uint64
val runtime.CBORBytes
val builtin2.CBORBytes
}
type TestDiffArray struct {
@@ -239,7 +240,7 @@ type TestAdtArrayDiffModified struct {
}
func (t *TestDiffArray) Add(key uint64, val *typegen.Deferred) error {
v := new(runtime.CBORBytes)
v := new(builtin2.CBORBytes)
err := v.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return err
@@ -252,13 +253,13 @@ func (t *TestDiffArray) Add(key uint64, val *typegen.Deferred) error {
}
func (t *TestDiffArray) Modify(key uint64, from, to *typegen.Deferred) error {
vFrom := new(runtime.CBORBytes)
vFrom := new(builtin2.CBORBytes)
err := vFrom.UnmarshalCBOR(bytes.NewReader(from.Raw))
if err != nil {
return err
}
vTo := new(runtime.CBORBytes)
vTo := new(builtin2.CBORBytes)
err = vTo.UnmarshalCBOR(bytes.NewReader(to.Raw))
if err != nil {
return err
@@ -280,7 +281,7 @@ func (t *TestDiffArray) Modify(key uint64, from, to *typegen.Deferred) error {
}
func (t *TestDiffArray) Remove(key uint64, val *typegen.Deferred) error {
v := new(runtime.CBORBytes)
v := new(builtin2.CBORBytes)
err := v.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return err
@@ -294,7 +295,7 @@ func (t *TestDiffArray) Remove(key uint64, val *typegen.Deferred) error {
func newContextStore() Store {
ctx := context.Background()
bs := bstore.NewTemporarySync()
bs := bstore.NewMemorySync()
store := cbornode.NewCborStore(bs)
return WrapStore(ctx, store)
}
+8
View File
@@ -13,6 +13,7 @@ import (
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
)
func init() {
@@ -22,14 +23,21 @@ func init() {
builtin.RegisterActorState(builtin2.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
return load2(store, root)
})
builtin.RegisterActorState(builtin3.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
return load3(store, root)
})
}
var Methods = builtin3.MethodsAccount
func Load(store adt.Store, act *types.Actor) (State, error) {
switch act.Code {
case builtin0.AccountActorCodeID:
return load0(store, act.Head)
case builtin2.AccountActorCodeID:
return load2(store, act.Head)
case builtin3.AccountActorCodeID:
return load3(store, act.Head)
}
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
+30
View File
@@ -0,0 +1,30 @@
package account
import (
"github.com/filecoin-project/go-address"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/lotus/chain/actors/adt"
account3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/account"
)
var _ State = (*state3)(nil)
func load3(store adt.Store, root cid.Cid) (State, error) {
out := state3{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
type state3 struct {
account3.State
store adt.Store
}
func (s *state3) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}
+51 -13
View File
@@ -5,26 +5,48 @@ import (
"github.com/ipfs/go-cid"
"golang.org/x/xerrors"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
smoothing0 "github.com/filecoin-project/specs-actors/actors/util/smoothing"
smoothing2 "github.com/filecoin-project/specs-actors/v2/actors/util/smoothing"
smoothing3 "github.com/filecoin-project/specs-actors/v3/actors/util/smoothing"
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
proof0 "github.com/filecoin-project/specs-actors/actors/runtime/proof"
smoothing0 "github.com/filecoin-project/specs-actors/actors/util/smoothing"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
smoothing2 "github.com/filecoin-project/specs-actors/v2/actors/util/smoothing"
)
var SystemActorAddr = builtin0.SystemActorAddr
var BurntFundsActorAddr = builtin0.BurntFundsActorAddr
var CronActorAddr = builtin0.CronActorAddr
var SaftAddress = makeAddress("t0122")
var ReserveAddress = makeAddress("t090")
var RootVerifierAddress = makeAddress("t080")
// TODO: Why does actors have 2 different versions of this?
var (
ExpectedLeadersPerEpoch = builtin0.ExpectedLeadersPerEpoch
)
const (
EpochDurationSeconds = builtin0.EpochDurationSeconds
EpochsInDay = builtin0.EpochsInDay
SecondsInDay = builtin0.SecondsInDay
)
const (
MethodSend = builtin3.MethodSend
MethodConstructor = builtin3.MethodConstructor
)
// These are all just type aliases across actor versions 0, 2, & 3. In the future, that might change
// and we might need to do something fancier.
type SectorInfo = proof0.SectorInfo
type PoStProof = proof0.PoStProof
type FilterEstimate = smoothing0.FilterEstimate
@@ -33,13 +55,17 @@ func FromV0FilterEstimate(v0 smoothing0.FilterEstimate) FilterEstimate {
return (FilterEstimate)(v0)
}
// Doesn't change between actors v0 and v1
// Doesn't change between actors v0, v2, and v3.
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
return miner0.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
}
func FromV2FilterEstimate(v1 smoothing2.FilterEstimate) FilterEstimate {
return (FilterEstimate)(v1)
func FromV2FilterEstimate(v2 smoothing2.FilterEstimate) FilterEstimate {
return (FilterEstimate)(v2)
}
func FromV3FilterEstimate(v3 smoothing3.FilterEstimate) FilterEstimate {
return (FilterEstimate)(v3)
}
type ActorStateLoader func(store adt.Store, root cid.Cid) (cbor.Marshaler, error)
@@ -64,30 +90,42 @@ func ActorNameByCode(c cid.Cid) string {
return builtin0.ActorNameByCode(c)
case builtin2.IsBuiltinActor(c):
return builtin2.ActorNameByCode(c)
case builtin3.IsBuiltinActor(c):
return builtin3.ActorNameByCode(c)
default:
return "<unknown>"
}
}
func IsBuiltinActor(c cid.Cid) bool {
return builtin0.IsBuiltinActor(c) || builtin2.IsBuiltinActor(c)
return builtin0.IsBuiltinActor(c) ||
builtin2.IsBuiltinActor(c) ||
builtin3.IsBuiltinActor(c)
}
func IsAccountActor(c cid.Cid) bool {
return c == builtin0.AccountActorCodeID || c == builtin2.AccountActorCodeID
return c == builtin0.AccountActorCodeID ||
c == builtin2.AccountActorCodeID ||
c == builtin3.AccountActorCodeID
}
func IsStorageMinerActor(c cid.Cid) bool {
return c == builtin0.StorageMinerActorCodeID || c == builtin2.StorageMinerActorCodeID
return c == builtin0.StorageMinerActorCodeID ||
c == builtin2.StorageMinerActorCodeID ||
c == builtin3.StorageMinerActorCodeID
}
func IsMultisigActor(c cid.Cid) bool {
return c == builtin0.MultisigActorCodeID || c == builtin2.MultisigActorCodeID
return c == builtin0.MultisigActorCodeID ||
c == builtin2.MultisigActorCodeID ||
c == builtin3.MultisigActorCodeID
}
func IsPaymentChannelActor(c cid.Cid) bool {
return c == builtin0.PaymentChannelActorCodeID || c == builtin2.PaymentChannelActorCodeID
return c == builtin0.PaymentChannelActorCodeID ||
c == builtin2.PaymentChannelActorCodeID ||
c == builtin3.PaymentChannelActorCodeID
}
func makeAddress(addr string) address.Address {
+10
View File
@@ -0,0 +1,10 @@
package cron
import (
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
)
var (
Address = builtin3.CronActorAddr
Methods = builtin3.MethodsCron
)
+152
View File
@@ -0,0 +1,152 @@
package init
import (
"bytes"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
typegen "github.com/whyrusleeping/cbor-gen"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
func DiffAddressMap(pre, cur State) (*AddressMapChanges, error) {
prem, err := pre.addressMap()
if err != nil {
return nil, err
}
curm, err := cur.addressMap()
if err != nil {
return nil, err
}
preRoot, err := prem.Root()
if err != nil {
return nil, err
}
curRoot, err := curm.Root()
if err != nil {
return nil, err
}
results := new(AddressMapChanges)
// no change.
if curRoot.Equals(preRoot) {
return results, nil
}
err = adt.DiffAdtMap(prem, curm, &addressMapDiffer{results, pre, cur})
if err != nil {
return nil, err
}
return results, nil
}
type addressMapDiffer struct {
Results *AddressMapChanges
pre, adter State
}
type AddressMapChanges struct {
Added []AddressPair
Modified []AddressChange
Removed []AddressPair
}
func (i *addressMapDiffer) AsKey(key string) (abi.Keyer, error) {
addr, err := address.NewFromBytes([]byte(key))
if err != nil {
return nil, err
}
return abi.AddrKey(addr), nil
}
func (i *addressMapDiffer) Add(key string, val *typegen.Deferred) error {
pkAddr, err := address.NewFromBytes([]byte(key))
if err != nil {
return err
}
id := new(typegen.CborInt)
if err := id.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
return err
}
idAddr, err := address.NewIDAddress(uint64(*id))
if err != nil {
return err
}
i.Results.Added = append(i.Results.Added, AddressPair{
ID: idAddr,
PK: pkAddr,
})
return nil
}
func (i *addressMapDiffer) Modify(key string, from, to *typegen.Deferred) error {
pkAddr, err := address.NewFromBytes([]byte(key))
if err != nil {
return err
}
fromID := new(typegen.CborInt)
if err := fromID.UnmarshalCBOR(bytes.NewReader(from.Raw)); err != nil {
return err
}
fromIDAddr, err := address.NewIDAddress(uint64(*fromID))
if err != nil {
return err
}
toID := new(typegen.CborInt)
if err := toID.UnmarshalCBOR(bytes.NewReader(to.Raw)); err != nil {
return err
}
toIDAddr, err := address.NewIDAddress(uint64(*toID))
if err != nil {
return err
}
i.Results.Modified = append(i.Results.Modified, AddressChange{
From: AddressPair{
ID: fromIDAddr,
PK: pkAddr,
},
To: AddressPair{
ID: toIDAddr,
PK: pkAddr,
},
})
return nil
}
func (i *addressMapDiffer) Remove(key string, val *typegen.Deferred) error {
pkAddr, err := address.NewFromBytes([]byte(key))
if err != nil {
return err
}
id := new(typegen.CborInt)
if err := id.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
return err
}
idAddr, err := address.NewIDAddress(uint64(*id))
if err != nil {
return err
}
i.Results.Removed = append(i.Results.Removed, AddressPair{
ID: idAddr,
PK: pkAddr,
})
return nil
}
type AddressChange struct {
From AddressPair
To AddressPair
}
type AddressPair struct {
ID address.Address
PK address.Address
}
+12 -1
View File
@@ -15,6 +15,7 @@ import (
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
)
func init() {
@@ -24,9 +25,15 @@ func init() {
builtin.RegisterActorState(builtin2.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
return load2(store, root)
})
builtin.RegisterActorState(builtin3.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
return load3(store, root)
})
}
var Address = builtin0.InitActorAddr
var (
Address = builtin3.InitActorAddr
Methods = builtin3.MethodsInit
)
func Load(store adt.Store, act *types.Actor) (State, error) {
switch act.Code {
@@ -34,6 +41,8 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
return load0(store, act.Head)
case builtin2.InitActorCodeID:
return load2(store, act.Head)
case builtin3.InitActorCodeID:
return load3(store, act.Head)
}
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
@@ -54,4 +63,6 @@ type State interface {
// Sets the network's name. This should only be used on upgrade/fork.
SetNetworkName(name string) error
addressMap() (adt.Map, error)
}
+4
View File
@@ -79,3 +79,7 @@ func (s *state0) Remove(addrs ...address.Address) (err error) {
s.State.AddressMap = amr
return nil
}
func (s *state0) addressMap() (adt.Map, error) {
return adt0.AsMap(s.store, s.AddressMap)
}
+4
View File
@@ -79,3 +79,7 @@ func (s *state2) Remove(addrs ...address.Address) (err error) {
s.State.AddressMap = amr
return nil
}
func (s *state2) addressMap() (adt.Map, error) {
return adt2.AsMap(s.store, s.AddressMap)
}
+86
View File
@@ -0,0 +1,86 @@
package init
import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/node/modules/dtypes"
init3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/init"
adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt"
)
var _ State = (*state3)(nil)
func load3(store adt.Store, root cid.Cid) (State, error) {
out := state3{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
type state3 struct {
init3.State
store adt.Store
}
func (s *state3) ResolveAddress(address address.Address) (address.Address, bool, error) {
return s.State.ResolveAddress(s.store, address)
}
func (s *state3) MapAddressToNewID(address address.Address) (address.Address, error) {
return s.State.MapAddressToNewID(s.store, address)
}
func (s *state3) ForEachActor(cb func(id abi.ActorID, address address.Address) error) error {
addrs, err := adt3.AsMap(s.store, s.State.AddressMap, builtin3.DefaultHamtBitwidth)
if err != nil {
return err
}
var actorID cbg.CborInt
return addrs.ForEach(&actorID, func(key string) error {
addr, err := address.NewFromBytes([]byte(key))
if err != nil {
return err
}
return cb(abi.ActorID(actorID), addr)
})
}
func (s *state3) NetworkName() (dtypes.NetworkName, error) {
return dtypes.NetworkName(s.State.NetworkName), nil
}
func (s *state3) SetNetworkName(name string) error {
s.State.NetworkName = name
return nil
}
func (s *state3) Remove(addrs ...address.Address) (err error) {
m, err := adt3.AsMap(s.store, s.State.AddressMap, builtin3.DefaultHamtBitwidth)
if err != nil {
return err
}
for _, addr := range addrs {
if err = m.Delete(abi.AddrKey(addr)); err != nil {
return xerrors.Errorf("failed to delete entry for address: %s; err: %w", addr, err)
}
}
amr, err := m.Root()
if err != nil {
return xerrors.Errorf("failed to get address map root: %w", err)
}
s.State.AddressMap = amr
return nil
}
func (s *state3) addressMap() (adt.Map, error) {
return adt3.AsMap(s.store, s.AddressMap, builtin3.DefaultHamtBitwidth)
}

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