Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.5.1 staging branch #5679

Merged
merged 294 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
294 commits
Select commit Hold shift + click to select a range
92b6054
Improve error message with importing a chain
ghoneycutt Feb 23, 2021
247a086
Merge pull request #5658 from filecoin-project/fix/handle-recoverdealids
magik6k Feb 25, 2021
e49a412
Merge pull request #5375 from filecoin-project/feat/refactor-fsm-input
magik6k Feb 25, 2021
f5d819b
Merge pull request #5669 from ghoneycutt/import_error
magik6k Feb 25, 2021
b48ea96
Merge remote-tracking branch 'origin/master' into revert-5667-revert-…
magik6k Feb 25, 2021
c69f884
Merge pull request #5668 from filecoin-project/revert-5667-revert-543…
magik6k Feb 25, 2021
29c9fa3
Merge pull request #5612 from filecoin-project/feat/cc-fsm-cleanup
magik6k Feb 26, 2021
10e1b26
chain list --gas-stats display capacity
Feb 24, 2021
fe69b56
Merge pull request #5676 from filecoin-project/feat/list-gas-stats
magik6k Feb 26, 2021
48bce38
Correct some logs
arajasek Feb 28, 2021
8601e5d
address review comments.
raulk Feb 28, 2021
7f0f7d0
Merge branch 'master' into refactor/lib/blockstore
raulk Feb 28, 2021
9f0c68b
fix unused import post-merge.
raulk Feb 28, 2021
8b17a47
fix CI for build-lotus-soup.
raulk Feb 28, 2021
45a650c
remove unnecessary View casting.
raulk Feb 28, 2021
853de3d
fix TimedCacheBlockstore#View.
raulk Feb 28, 2021
3795cc2
segregate chain and state blockstores.
raulk Feb 28, 2021
b34b4e0
fix test compilation error.
raulk Feb 28, 2021
3f5b17d
Merge pull request #5694 from filecoin-project/asr/nits
magik6k Mar 1, 2021
5fe3740
Merge remote-tracking branch 'origin/master' into next
magik6k Mar 1, 2021
8bd5173
Merge branch 'next' into refactor/lib/blockstore
magik6k Mar 1, 2021
2f496b3
tag in droplet image
Mar 1, 2021
5764269
Merge pull request #5484 from filecoin-project/refactor/lib/blockstore
magik6k Mar 1, 2021
9850e78
Add idle to sync stage's String()
arajasek Mar 2, 2021
ced455b
feat: add configurable max provider collateral
dirkmc Mar 2, 2021
cd1a2e3
Merge pull request #5702 from filecoin-project/asr/sync-stage-string
magik6k Mar 2, 2021
a39f480
Merge pull request #5604 from filecoin-project/feat/packer-build
magik6k Mar 2, 2021
b9d7de5
list-asks: add --output-format & omit progress if !stdout
rvagg Feb 26, 2021
61005e6
Merge branch 'rvagg-rvagg/list-asks-output' into next
magik6k Mar 2, 2021
b1c348b
address review comments.
raulk Mar 2, 2021
2047a74
implement blockstore.Union, a union blockstore.
raulk Mar 2, 2021
68b8e8e
implement unionBlockstore#HashOnRead.
raulk Mar 2, 2021
1ac0c9a
address review comments.
raulk Mar 2, 2021
22e465b
log block cid in the large delay warning
arajasek Mar 2, 2021
448813d
Merge pull request #5695 from filecoin-project/feat/segregate-blockst…
magik6k Mar 3, 2021
d80b0d9
fix(multisig): The format of the amount is not correct in msigLockApp…
Rennbon Mar 4, 2021
fb78d50
no message
Rennbon Mar 4, 2021
10076d5
no message
Rennbon Mar 4, 2021
e05dc4e
Merge pull request #5718 from Rennbon/master
magik6k Mar 4, 2021
374bd9b
Update chain/sub/incoming.go
arajasek Mar 5, 2021
fe230f9
Collect worker task metrics
magik6k Feb 21, 2021
046eb28
Merge pull request #5648 from filecoin-project/feat/miner-worker-metrics
magik6k Mar 5, 2021
d53c700
Merge pull request #5704 from filecoin-project/asr/log-large-delay
magik6k Mar 5, 2021
6577cc8
splitstore struct and Blockstore interface implementation
vyzo Nov 24, 2020
c8f1139
compaction algorithm
vyzo Nov 24, 2020
b192adf
trigger compaction from head changes
vyzo Nov 24, 2020
fd08786
track base epoch in metadata ds
vyzo Nov 24, 2020
c2cc198
fix off by 1 in marking
vyzo Nov 24, 2020
2bed6c9
use dual live set marking algorithm to keep all hotly reachable objec…
vyzo Nov 24, 2020
b945747
satisfy linter
vyzo Nov 24, 2020
101e5c6
close keys channel when dome emitting keys
vyzo Nov 25, 2020
3083d80
no need to import go-ipfs-blockstore, lib/blockstore will do
vyzo Nov 25, 2020
c1b1a9c
avoid race with compacting state variable
vyzo Nov 25, 2020
2c9b58a
add some logging
vyzo Nov 25, 2020
17bc5fc
move splitstore implementation to its own directory
vyzo Nov 26, 2020
0bf1a78
stubs for tracking store and live set
vyzo Nov 26, 2020
df856b7
gomod: get lmdb-go
vyzo Nov 26, 2020
3f92a00
implement lmdb-backed LiveSet
vyzo Nov 26, 2020
5043f31
liveset unit test
vyzo Nov 26, 2020
83f8a0a
quiet linter
vyzo Nov 26, 2020
0d7476c
implement LMDB-backed tracking store
vyzo Nov 26, 2020
4763397
add tracking store test
vyzo Nov 26, 2020
da47883
quiet linter
vyzo Nov 26, 2020
d20cbc0
protect against potential data races
vyzo Nov 29, 2020
5db314f
fallback to coldstore if snooping fails.
vyzo Nov 29, 2020
37e391f
add TODO note about map size
vyzo Nov 29, 2020
0af7b16
simplify Has
vyzo Nov 29, 2020
b0f48b5
use CAS for compacting state
vyzo Nov 29, 2020
e87ce6c
go get go-bs-lmdb
vyzo Dec 1, 2020
e07c6c7
splitstore constructor
vyzo Dec 1, 2020
622b4f7
hook splitstore into DI
vyzo Dec 1, 2020
3912694
fix lotus-shed build
vyzo Dec 1, 2020
facdc55
add nil check for curTs -- some tests don't have chain state
vyzo Dec 1, 2020
f44cf0f
appease linter
vyzo Dec 1, 2020
843fd09
deal with MDB_KEY_EXIST errors
vyzo Dec 1, 2020
ce41e39
handle MDB_KEYEXIST in liveset marking
vyzo Dec 1, 2020
3f8da19
go get go-bs-lmdb@v0.0.3
vyzo Dec 1, 2020
6e51e6d
better handling of MDB_KEYEXIST in Put
vyzo Dec 1, 2020
1a23b1f
make CompactionThreshold a var to fix lotus-soup build
vyzo Dec 1, 2020
76d6edb
fix max readers for tracking store
vyzo Dec 1, 2020
8b00875
adjust walk boundaries for marking
vyzo Dec 1, 2020
58a8434
temporary log level for splitstore to DEBUG
vyzo Jan 13, 2021
5b4e6b7
don't set max readers for livesets
vyzo Jan 20, 2021
877ecab
update go-bs-lmdb and migrate to ledgerwatch/lmdb-go.
raulk Jan 25, 2021
5872f24
go get go-bs-lmdb@v1.0.2
vyzo Jan 26, 2021
2080e46
don't set MaxReaders for tracking store
vyzo Jan 29, 2021
c89ab1a
retry on MDB_READERS_FULL errors
vyzo Feb 1, 2021
b9f8a3d
log MDB_READERS_FULL retries
vyzo Feb 1, 2021
d91b60d
fix potential panic with max readers retry and cursor channel
vyzo Feb 1, 2021
ea05fd9
use xerrors instead of fmt.Errorf
vyzo Feb 10, 2021
cdf5bd0
return annotated xerrors where appropriate
vyzo Feb 10, 2021
69a88d4
fix snoop test
vyzo Feb 10, 2021
ca8a673
adjust hot store options
vyzo Feb 11, 2021
874ecd3
adjust hot store options, redux.
vyzo Feb 11, 2021
723e48b
gomod:update go-bs-lmdb to v1.0.3
vyzo Feb 11, 2021
95befa1
set lmdb max readers retry delay to 1ms
vyzo Feb 11, 2021
f6c930d
crank up blockstore max readers to 16K, reduce retry delays to 10us
vyzo Feb 13, 2021
7044e62
flag to enable GC during compaction, disabled for now
vyzo Feb 26, 2021
a586d42
make hot store DI injectable in the split store, default to badger.
vyzo Feb 26, 2021
842ec43
get rid of goroutine iteration in tracking store; long live ForEach
vyzo Feb 26, 2021
d44719d
amend confusing comment
vyzo Feb 26, 2021
5068d51
use CompactionCold epochs for delinating the cold epoch cliff
vyzo Feb 26, 2021
31268ba
walk snapshot the same way snapshot exporting does; skip old msgs and…
vyzo Feb 26, 2021
8e12377
handle consistency edge case
vyzo Feb 26, 2021
99c7d8e
more informative names for the hotstore directories
vyzo Feb 26, 2021
ee751f8
refactor lmdb specific snoop/liveset code into their own files
vyzo Feb 26, 2021
9977f5c
rewrite sweep logic to avoid doing writes/deletes nested in a read txn
vyzo Feb 26, 2021
e794451
handle MDB_KEY_EXIST in tracking store Puts
vyzo Feb 27, 2021
8f0ddac
add comment
vyzo Feb 27, 2021
923a3db
abstract tracking store and live set construction
vyzo Feb 27, 2021
68b6f91
propagate useLMDB option to splitstore through DI
vyzo Feb 27, 2021
cb1789e
gomod: use bolt
vyzo Feb 27, 2021
27a9b97
implement bolt-backed liveset
vyzo Feb 27, 2021
2c1a978
add test for bolt liveset
vyzo Feb 27, 2021
b839947
separate LMDB options for hotstore and tracking stores
vyzo Feb 27, 2021
f1c61c4
implement bolt backed tracking store
vyzo Feb 27, 2021
2e4d45e
test for bolt backed tracking store
vyzo Feb 27, 2021
73259aa
add configuration for splitstore and default to a simple compaction a…
vyzo Feb 27, 2021
364076c
set NoSync option for bolt livesets
vyzo Feb 27, 2021
783dcda
add Sync to the tracking store
vyzo Feb 27, 2021
2f26026
compactSimple should walk the cold epoch at depth 1
vyzo Feb 27, 2021
2426ffb
better logging plus moving some code around
vyzo Feb 27, 2021
e52c709
more accurate setting of skip params
vyzo Feb 27, 2021
09cd117
structured log for beginning of compaction
vyzo Feb 27, 2021
aba6530
batch deletion for purging the tracking store
vyzo Feb 27, 2021
97abbe1
add (salted) bloom filter liveset
vyzo Feb 28, 2021
4cc672d
batch move objects from coldstore to hotstore
vyzo Feb 28, 2021
f4c6bc6
comment nomenclature
vyzo Feb 28, 2021
f5ce795
size bloom filter for 50M objects
vyzo Feb 28, 2021
8884920
fix tests
vyzo Feb 28, 2021
44aadb9
rehash salted keys in bloom filter
vyzo Feb 28, 2021
f62999d
use named constants for bloom filter parameters
vyzo Feb 28, 2021
05fee27
remove stale references to lmdb from splitstore implementation
vyzo Feb 28, 2021
e582f0b
remove references to splitstore from lotus-shed
vyzo Feb 28, 2021
7587ab6
quiet the stupid linter
vyzo Feb 28, 2021
5639261
make compaction parameters variable
vyzo Feb 28, 2021
cae5ddc
dynamically size bloom filters
vyzo Feb 28, 2021
99c6e4f
adjust min bloom filter size
vyzo Feb 28, 2021
3282f85
fix tests
vyzo Feb 28, 2021
0fc2f3a
fix post-rebase compilation errors
vyzo Mar 1, 2021
3733456
go mod tidy
vyzo Mar 1, 2021
1b51c10
split off lmdb support to a different branch.
raulk Mar 1, 2021
1a804fb
move splitstore into blockstore package.
raulk Mar 1, 2021
cb36d5b
warm up splitstore at first head change notification
vyzo Mar 1, 2021
748dd96
snake current tipset from head change notification
vyzo Mar 1, 2021
e612fff
also estimate liveset size during warm up
vyzo Mar 1, 2021
b9400c5
use crypto/rand for bloom salt
vyzo Mar 1, 2021
b1b452b
remove dependency from blockstore/splitstore => chain/store.
raulk Mar 1, 2021
8cfba5b
renames and polish.
raulk Mar 1, 2021
ce68b9b
batch writes during warm up
vyzo Mar 1, 2021
48f2533
increase batch size to 16K
vyzo Mar 1, 2021
4b1e1f4
rename liveset => markset; rename snoop => tracking store; docs.
raulk Mar 2, 2021
f651f43
improve comment accuracy
vyzo Mar 2, 2021
35d466d
use sha256 for bloom key rehashing
vyzo Mar 2, 2021
68213a9
use ioutil.TempDir for test directories
vyzo Mar 2, 2021
5184bc5
log consistency for full compaction
vyzo Mar 2, 2021
c762536
deduplicate code
vyzo Mar 2, 2021
6014273
storage miner doesn't need a splitstore
vyzo Mar 2, 2021
dd0c308
move Blockstore config to FullNode, rename to Chainstore and add defa…
vyzo Mar 2, 2021
86b73d6
add DeleteMany to Blockstore interface
vyzo Mar 2, 2021
8a55b73
fix the situation with WrapIDStore
vyzo Mar 2, 2021
2ff5aec
satisfy linter, use Prefix for common path of non inline CIDs
vyzo Mar 2, 2021
86fdad2
fix typo
vyzo Mar 2, 2021
ab52e34
add comment
vyzo Mar 2, 2021
4c05ec2
fix FromDatastore to not do double adapting
vyzo Mar 2, 2021
06d8ea1
batch delete during the cold purge
vyzo Mar 2, 2021
006c55a
add startup log
vyzo Mar 2, 2021
70ebb2a
improve startup log
vyzo Mar 2, 2021
d2d0980
don't delete in one giant batch, use smaller chunks of batchSize
vyzo Mar 2, 2021
6b8c60a
don't ID wrap the hotstore
vyzo Mar 2, 2021
6b680d1
do tracker purge in smaller batches
vyzo Mar 2, 2021
11b2f41
overestimate markSetSize a bit
vyzo Mar 3, 2021
47d8c87
fix log
vyzo Mar 3, 2021
508fcb9
properly close snoop at shutdown
vyzo Mar 3, 2021
fdd8775
walk at boundary epoch, 2 finalities from current epoch, to find live…
vyzo Mar 3, 2021
98a7b88
implement DeleteMany in union blockstore
vyzo Mar 3, 2021
5fb6a90
fix loop condition in batch deletion
vyzo Mar 3, 2021
aff0f1e
deduplicate code for batch deletion
vyzo Mar 3, 2021
17be7d3
save markSetSize
vyzo Mar 5, 2021
9bd009d
use atomics to demarkate critical section and limit close delay
vyzo Mar 5, 2021
c58df3f
don't panic on compaction errors
vyzo Mar 5, 2021
99d2157
remove DEBUG log spam
vyzo Mar 5, 2021
2b32c2e
add some metrics
vyzo Mar 5, 2021
0a2f2cf
use the right condition for triggering the miss metric
vyzo Mar 5, 2021
09f5ba1
add splitstore unit test
vyzo Mar 5, 2021
e85391b
quiet stupid linter
vyzo Mar 5, 2021
58e49e3
Move api client builders to a cliutil package
magik6k Mar 5, 2021
a4a21b5
fix lint
magik6k Mar 5, 2021
b4ca792
Merge pull request #5728 from filecoin-project/feat/cliutil-pkg
magik6k Mar 5, 2021
e7a1d72
extract build/version to api/version, remove api package dep on build
whyrusleeping Mar 5, 2021
dbbcb14
lotus-seed: add a command to set the verified registry root key
arajasek Mar 6, 2021
279f9e6
gen/genesis: Allow verifreg rootkey to be either account or msig
arajasek Mar 6, 2021
6534280
lotus-seed: add a command to set the remainder
arajasek Mar 6, 2021
fc03a07
gen/genesis: Allow remainder to be either account or msig
arajasek Mar 6, 2021
4a74f75
implement extended peer info in net peers cli
vyzo Mar 6, 2021
444b84d
deduplicate peers in extended output
vyzo Mar 6, 2021
667fffb
go get go-libp2p-pubsub@master
vyzo Mar 6, 2021
64646de
add configuration option for pubsub IPColocationWhitelist subnets
vyzo Mar 6, 2021
6d398f2
make gen, docsgen
magik6k Mar 8, 2021
3ee87a8
gofmt
magik6k Mar 8, 2021
afb527f
fix lint
magik6k Mar 8, 2021
5df45ad
Merge pull request #5734 from filecoin-project/feat/net-peers-extended
magik6k Mar 8, 2021
8562a9b
garbage collect hotstore after compaction
vyzo Mar 8, 2021
52de95d
also gc in compactFull, not just compactSimple
vyzo Mar 8, 2021
8a5cd21
Merge pull request #5666 from filecoin-project/feat/extend-sectors-cmd
magik6k Mar 8, 2021
3d1b855
rename GC to CollectGarbage, ignore badger.ErrNoRewrite
vyzo Mar 8, 2021
3bd7770
deduplicate code
vyzo Mar 8, 2021
c52dae4
Merge pull request #5744 from filecoin-project/feat/splitstore-gc
vyzo Mar 8, 2021
90741da
tune badger gc to repeated gc the value log until there is no rewrite
vyzo Mar 8, 2021
7c7b107
Add max-storage flags to storage attach commands
magik6k Mar 8, 2021
51ed4c7
Merge pull request #5745 from filecoin-project/feat/splitstore-gc-tuning
magik6k Mar 8, 2021
b130462
Merge pull request #5735 from filecoin-project/feat/pubsub-ip-colocat…
magik6k Mar 8, 2021
3a2e988
chore: update go-graphsync to 0.6.0
Stebalien Mar 8, 2021
305c2ec
miner: Config to disable owner/worker addcess fallback
magik6k Feb 17, 2021
6591af9
Merge pull request #4992 from filecoin-project/feat/splitstore
magik6k Mar 8, 2021
06b3603
handle terminate control addrs in address selection correctly
magik6k Mar 8, 2021
58d7627
Merge pull request #5730 from filecoin-project/asr/genesis-rootkey
magik6k Mar 8, 2021
c49c6fd
Merge pull request #5746 from filecoin-project/chore/update-graphsync
magik6k Mar 8, 2021
5388f3e
Add connmgr metadata to NetPeerInfo
magik6k Mar 8, 2021
9f2015e
docsgen
magik6k Mar 8, 2021
4231e43
docsgen funtimes
magik6k Mar 8, 2021
6d2e8d7
test: attempt to make the splitstore test deterministic
Stebalien Mar 9, 2021
6addd9a
remove unused imports
Stebalien Mar 9, 2021
dedf0ba
fix docsgen
Stebalien Mar 9, 2021
5304df5
fix lotus-shed compile
Stebalien Mar 9, 2021
05e03dc
revert change to generated file
Stebalien Mar 9, 2021
1755fc2
Merge pull request #5749 from filecoin-project/feat/netpeers-ext-connmgr
magik6k Mar 9, 2021
ae6410d
use compacting atomic to make the test deterministic
vyzo Mar 9, 2021
2642ddc
Merge pull request #5750 from filecoin-project/fix/splitstore-tests
magik6k Mar 9, 2021
1c62d7a
Merge pull request #5729 from filecoin-project/feat/api-no-dep-build
magik6k Mar 9, 2021
ca7e70b
Metadata datastore log
magik6k Mar 9, 2021
9f7d3ed
gofmt
magik6k Mar 9, 2021
b4eefd7
backupds: make sure logfile matches datastore
magik6k Mar 9, 2021
d4a981f
fix lint
magik6k Mar 9, 2021
0a51395
better DisableWorkerFallback doc
magik6k Mar 9, 2021
58cacda
Fix bootstrapper profile setting
magik6k Mar 9, 2021
bdafdf8
Remove the SR2 stats, leave just the network totals
ribasushi Dec 19, 2020
47064f9
Check liveness of sectors when processing termination batches
arajasek Mar 10, 2021
268abb5
Merge pull request #5756 from filecoin-project/fix/bootstrapper-profile
magik6k Mar 10, 2021
d11f2de
Merge branch 'feat/max-deal-collateral-multiplier' into next
magik6k Mar 10, 2021
df0a8d9
Merge pull request #5759 from filecoin-project/asr/terminate-livecheck
magik6k Mar 10, 2021
40fdf6c
Merge pull request #5624 from filecoin-project/feat/miner-storage-limit
magik6k Mar 10, 2021
0527494
Merge pull request #5620 from filecoin-project/feat/disable-owner-wor…
magik6k Mar 10, 2021
2b380c9
Exit from the kvlog goroutine when closing
magik6k Mar 9, 2021
7fbb4bd
Fix TestUnpadReader on Go 1.16
magik6k Mar 10, 2021
cc490b9
Merge pull request #5761 from filecoin-project/fix/testunpadreader-go116
magik6k Mar 10, 2021
3f1054d
backupds kvlog: Address review
magik6k Mar 10, 2021
bd8864a
Merge pull request #5755 from filecoin-project/feat/kvlog
magik6k Mar 10, 2021
504affd
Merge pull request #5757 from filecoin-project/chore/sr2_stats_factor…
magik6k Mar 10, 2021
6315523
Merge remote-tracking branch 'origin/master' into next
magik6k Mar 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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:
Expand Down Expand Up @@ -277,6 +278,11 @@ jobs:
- 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
Expand All @@ -289,7 +295,7 @@ jobs:
- run: cd extern/filecoin-ffi && make
- run:
name: "go get lotus@master"
command: cd testplans/lotus-soup && go get github.com/filecoin-project/lotus@master
command: cd testplans/lotus-soup && go mod edit -replace=github.com/filecoin-project/lotus=../..
- run:
name: "build lotus-soup testplan"
command: pushd testplans/lotus-soup && go build -tags=testground .
Expand Down Expand Up @@ -583,6 +589,22 @@ jobs:
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
ci:
Expand Down Expand Up @@ -683,3 +705,15 @@ workflows:
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+$/

13 changes: 6 additions & 7 deletions api/api_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"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 {
Expand All @@ -33,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.
Expand All @@ -57,7 +56,7 @@ type Common interface {
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
Expand All @@ -71,23 +70,23 @@ type Common interface {
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?

// Seconds
BlockDelay uint64
}

func (v Version) String() string {
func (v APIVersion) String() string {
return fmt.Sprintf("%s+api%s", v.Version, v.APIVersion.String())
}

Expand Down
10 changes: 10 additions & 0 deletions api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,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
Expand Down Expand Up @@ -862,6 +870,8 @@ const (

func (v SyncStateStage) String() string {
switch v {
case StageIdle:
return "idle"
case StageHeaders:
return "header sync"
case StagePersistHeaders:
Expand Down
5 changes: 4 additions & 1 deletion api/api_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type StorageMiner interface {
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)
Expand Down Expand Up @@ -238,6 +238,9 @@ 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
Expand Down
4 changes: 1 addition & 3 deletions api/api_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import (
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"

"github.com/filecoin-project/lotus/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
Expand Down
68 changes: 0 additions & 68 deletions api/apibstore/apibstore.go

This file was deleted.

20 changes: 12 additions & 8 deletions api/apistruct/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"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/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
"github.com/filecoin-project/lotus/chain/types"
Expand All @@ -60,12 +59,13 @@ type CommonStruct struct {
NetBandwidthStatsByPeer func(ctx context.Context) (map[string]metrics.Stats, error) `perm:"read"`
NetBandwidthStatsByProtocol func(ctx context.Context) (map[protocol.ID]metrics.Stats, error) `perm:"read"`
NetAgentVersion func(ctx context.Context, p peer.ID) (string, error) `perm:"read"`
NetPeerInfo func(context.Context, peer.ID) (*api.ExtendedPeerInfo, error) `perm:"read"`
NetBlockAdd func(ctx context.Context, acl api.NetBlockList) error `perm:"admin"`
NetBlockRemove func(ctx context.Context, acl api.NetBlockList) error `perm:"admin"`
NetBlockList func(ctx context.Context) (api.NetBlockList, error) `perm:"read"`

ID func(context.Context) (peer.ID, error) `perm:"read"`
Version func(context.Context) (api.Version, error) `perm:"read"`
ID func(context.Context) (peer.ID, error) `perm:"read"`
Version func(context.Context) (api.APIVersion, error) `perm:"read"`

LogList func(context.Context) ([]string, error) `perm:"write"`
LogSetLevel func(context.Context, string, string) error `perm:"write"`
Expand Down Expand Up @@ -304,7 +304,7 @@ type StorageMinerStruct struct {
MarketPendingDeals func(ctx context.Context) (api.PendingDealInfo, error) `perm:"write"`
MarketPublishPendingDeals func(ctx context.Context) error `perm:"admin"`

PledgeSector func(context.Context) error `perm:"write"`
PledgeSector func(context.Context) (abi.SectorID, error) `perm:"write"`

SectorsStatus func(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (api.SectorInfo, error) `perm:"read"`
SectorsList func(context.Context) ([]abi.SectorNumber, error) `perm:"read"`
Expand Down Expand Up @@ -389,7 +389,7 @@ type WorkerStruct struct {
Internal struct {
// TODO: lower perms

Version func(context.Context) (build.Version, error) `perm:"admin"`
Version func(context.Context) (api.Version, error) `perm:"admin"`

TaskTypes func(context.Context) (map[sealtasks.TaskType]struct{}, error) `perm:"admin"`
Paths func(context.Context) ([]stores.StoragePath, error) `perm:"admin"`
Expand Down Expand Up @@ -540,13 +540,17 @@ func (c *CommonStruct) NetAgentVersion(ctx context.Context, p peer.ID) (string,
return c.Internal.NetAgentVersion(ctx, p)
}

func (c *CommonStruct) NetPeerInfo(ctx context.Context, p peer.ID) (*api.ExtendedPeerInfo, error) {
return c.Internal.NetPeerInfo(ctx, p)
}

// ID implements API.ID
func (c *CommonStruct) ID(ctx context.Context) (peer.ID, error) {
return c.Internal.ID(ctx)
}

// Version implements API.Version
func (c *CommonStruct) Version(ctx context.Context) (api.Version, error) {
func (c *CommonStruct) Version(ctx context.Context) (api.APIVersion, error) {
return c.Internal.Version(ctx)
}

Expand Down Expand Up @@ -1274,7 +1278,7 @@ func (c *StorageMinerStruct) ActorAddressConfig(ctx context.Context) (api.Addres
return c.Internal.ActorAddressConfig(ctx)
}

func (c *StorageMinerStruct) PledgeSector(ctx context.Context) error {
func (c *StorageMinerStruct) PledgeSector(ctx context.Context) (abi.SectorID, error) {
return c.Internal.PledgeSector(ctx)
}

Expand Down Expand Up @@ -1610,7 +1614,7 @@ func (c *StorageMinerStruct) CheckProvable(ctx context.Context, pp abi.Registere

// WorkerStruct

func (w *WorkerStruct) Version(ctx context.Context) (build.Version, error) {
func (w *WorkerStruct) Version(ctx context.Context) (api.Version, error) {
return w.Internal.Version(ctx)
}

Expand Down
4 changes: 3 additions & 1 deletion api/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,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))
Expand All @@ -123,6 +123,8 @@ 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("init", reflect.TypeOf(&types.Message{}), nil).(*types.Message),
MsgRct: exampleValue("init", reflect.TypeOf(&types.MessageReceipt{}), nil).(*types.MessageReceipt),
Expand Down
Loading