Compare commits

...
264 Commits
Author SHA1 Message Date
Jiaying Wang 9416ceb7de Merge pull request #9833 from filecoin-project/release/v1.18.2
build: release: v1.18.2
2022-12-10 22:55:38 -05:00
Jiaying Wang 2cbc29ea09 Merge branch 'releases' into release/v1.18.2 2022-12-10 22:46:32 -05:00
Jiaying Wang 0b30261e5c Merge pull request #9832 from filecoin-project/jen/chan
release: v1.18.2
2022-12-10 22:45:38 -05:00
Jennifer Wang ea4b57854b v1.18.2 2022-12-10 22:31:39 -05:00
Jiaying Wang 5c656133e2 Merge pull request #9830 from filecoin-project/asr/backport-panic-fix-1.18
chore: backport: panic fix
2022-12-10 22:12:40 -05:00
Łukasz Magiera 1a5e38ecf9 sealing: Add a guard check to getExpirationCached when sector not found 2022-12-10 19:00:17 -05:00
Łukasz Magiera 887f00856e fix: sealing: Avoid nil dereference in debug log 2022-12-10 19:00:15 -05:00
Jiaying Wang e68b8e96c7 Merge pull request #9745 from filecoin-project/release/v1.18.1
build:release: v1.18.1
2022-11-29 00:10:14 -05:00
c32b8af65f build:release: v1.18.1 prep (#9744)
* fix: cli: check found before dereferencing SectorInfo

* v1.18.1 prep

* Docsgen-cli

Co-authored-by: Aayush <arajasek94@gmail.com>
Co-authored-by: Geoff Stuart <geoff.vball@gmail.com>
2022-11-28 23:28:32 -05:00
+3 bd10bdf99a build: release: v1.18.0 (#9652)
* build: Bump version to v1.17.3-dev

* build: set version to v1.18.0-dev

* chore: actors: Allow builtin-actors to return a map of methods (#9342)

* Allow builtin-actors to return a map of methods

* go mod

* Fix tests

* Fix tests, check carefully please

* Delete lotus-pond (#9352)

* feat: add StateNetworkVersion to mpool API

* chore: refactor: rename NewestNetworkVersion

* feat: actors: Integrate datacap actor into lotus (#9348)

* Integrate datacap actor

* Implement datacap actor in chain/builtin

* feat: support typed errors over RPC

* chore: deps: update to go-jsonrpc 0.1.8

* remove duplicate import

* fix: itest: check for closed connection

* chore: refactor: move retry test to API

* address magik supernit

* Add ability to only have single partition per msg for partitions with recovery sectors

* doc gen

* Address comments

* Return beneficiary info from miner state Info()

* Update builtin-actors to dev/20220922-v9 which includes FIP-0045 changes in progress

* Integrate verifreg changes to lotus

* Setup datacap actor

* Update builtin-actors to dev/20220922-v9-1

* Update datacap actor to query datacap instead of verifreg

* update gst

* update markets

* update actors with hamt fix

* update gst

* Update datacap to parse tokens

* Update bundles

* datacap and verifreg actors use ID addresses without protocol byte

* update builtin-actors to rc1

* update go-fil-markets

* Update bundles to rc2

* Integrate the v9 migration

* Add api for getting allocation

* Add upgrade epoch for butterfly

* Tweak PreSeal struct to be infra-friendly

* docsgen

* More tweaking of PreSeal for genesis

* review fixes

* Use fake cid for test

* add butterfly artifacts for oct 5 upgrade

* check datacaps for v8 verifreg match v9 datacap actor

* Remove print statements

* Update to go-state-types master

* Update to go-state-types v0.9.0-rc1

* review fixes

* use go-fil-markets v1.24.0-v17

* Add accessors for allocations and claims maps

* fix: missing permissions tag

* butterfly

* update butterfly artifacts

* sealing pipeline: Prepare deal assigning logic for FIP-45

* sealing pipeline: Get allocationId with StateApi

* use NoAllocationID instead of nil AllocationId

* address review

* Add datacap actor to registry.go

* Add cli for listing allocations and removing expired allocations

* Update to go-state-types master

* deps: upgrade go-merkledag to 0.8.0

* shark params

* Update cli/filplus.go

Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>

* revert change to verifreg util

* docsgen-cli

* miss the stuff

* Update FFI

* Update go-state-types to v0.9.0

* Update builtin-actors to v9.0.0

* add calib upgrade epcoh

* update  the upgrade envvar

* kill shark

* Remove fvm splash banner from nv17 upgrade

* check invariance for pending deals and allocations

* check pending verified deal proposal migrated to allocation

* Add check for unsealed CID in precommit sectors

* Fix counting of allocations in nv17 migration test

* make gen

* pass state trees as pointers

* Add assertion that migrations with & without cache are the same

* compare allocation to verified deal proposal

* Fix miner state precommit info

* fix migration test tool

* add changelog

* Update to go-state-types v0.9.1

* Integrate builtin-actors v9.0.1

* chore: ver: bump version for rc3 (#9512)

* Bump version to 1.18.0-rc3

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>

Co-authored-by: Jiaying Wang <42981373+jennijuju@users.noreply.github.com>
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>

* Migration: Use autobatch bs

* Fix autobatch

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>

* Invoker: Use MethodMeta from go-state-types

* Add a second premigration for nv17

* Add more shed tools for migration checking

* address review

* Lotus release v1.18.0-rc4

* fix: ci: fix app-image build on ci (#9527)

* Remove old go version first

* Add GO_VERSION file

* Use GO_VERSION to set / verify go version

* mv GO_VERSION GO_VERSION_MIN

* Use GO_VERSION_MIN in Makefile check

Co-authored-by: Ian Davis <jungziege@gmail.com>

* Update to latest go-state-types for migration fixes

* go mod tidy

* fix: use api.ErrActorNotFound instead of types.ErrActorNotFound

* fix: add fields to ForkUpgradeParams

* docs: update actors_version_checklist.md

* chore: fix lint

* update to go state type v0.9.6 with market migration fix (#9545)

* update go-state-types to v-0.9.7

* Add invariant checks to migration

* fix invariant check: number of entries in datacap actor should include verifreg

* Invariant checks: Only include not-activated deals

* test: nv17 migration

* Address review

* add lotus-shed invariance method

* Migration cli takes a stateroot cid and a height

* make gen

* Update to builtin-actors v9.0.2

* Failing test that shows that notaries can remove datacap from the verifreg actor

* Test that should pass when the problem is solved

* make gen

* Review fixes

* statemanager call function will return call information even if call errors

* update go-state-types

* update builtin-actors

* bubble up errors properly from ApplyImplicitMessage

* bump to rc5

* set new upgrade heights for calibnet

* set new upgrade height for butterfly

* tweak calibnet upgrade schedule

* clarify changelog note about calibnet

* butterfly

* update calibnet artifacts

* Allow setting local bundles for Debug FVM for av 9+

* fix: autobatch: remove potential deadlock when a block is missing

Check the _underlying_ blockstore instead of recursing. Also, drop the
lock before we do that.

* fix imports

* build: set shark mainnet epoch (#9640)

* chore: build: Lotus release v1.18.0 (#9641)

* Lotus release v1.18.0

* add changelog

* address review

* changelog improvement

Co-authored-by: Jennifer Wang <jiayingw703@gmail.com>
Co-authored-by: Jiaying Wang <42981373+jennijuju@users.noreply.github.com>

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Co-authored-by: Łukasz Magiera <magik6k@gmail.com>
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
Co-authored-by: Aayush <arajasek94@gmail.com>
Co-authored-by: Geoff Stuart <geoff.vball@gmail.com>
Co-authored-by: Shrenuj Bansal <shrenuj.bansal@protocol.ai>
Co-authored-by: simlecode <69969590+simlecode@users.noreply.github.com>
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Jakub Sztandera <kubuxu@protocol.ai>
Co-authored-by: Ian Davis <jungziege@gmail.com>
Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
Co-authored-by: Steven Allen <steven@stebalien.com>
2022-11-15 20:57:23 -05:00
Łukasz Magiera fb0fb7144b Merge pull request #9432 from filecoin-project/release/v1.17.2
release: v1.17.2
2022-10-05 18:32:08 +00:00
Jiaying Wang c4901e998a Merge pull request #9431 from filecoin-project/chore/v1.17.2-prep
Release v1.17.2
2022-10-05 13:45:08 -04:00
Łukasz Magiera d468c36216 release v1.17.2 2022-10-05 16:58:49 +00:00
Łukasz Magiera 4d7eddc52c Merge pull request #9428 from filecoin-project/backport/9402
fix: renew --only-cc with sectorfile
2022-10-05 16:17:06 +00:00
Phi 396f5d610e fix: renew --only-cc with sectorfile
Add the ability to extend/renew only CC-sectors with the `--only-cc` when using a sector-file.
2022-10-05 15:43:13 +00:00
Łukasz Magiera 3d23a54fe4 Merge pull request #9393 from filecoin-project/chore/v1.17.2-rc2-prep
v1.17.2-rc2
2022-09-29 15:22:49 +00:00
Łukasz Magiera 258001c6aa changelog: Add v1.17.2-rc2 entry 2022-09-29 15:16:57 +00:00
Łukasz Magiera 310f20e81b v1.17.2-rc2 2022-09-29 15:08:09 +00:00
Łukasz Magiera c42f88e4d3 Merge pull request #9389 from filecoin-project/backport/9386
[v1.17.2 backport] Use golang 1.18.1 to build appimage
2022-09-28 14:28:32 +00:00
Ian Davis bb8c3bad86 Use golang 1.18.1 to build appimage 2022-09-28 10:15:13 +00:00
Łukasz Magiera 311c8b25fe Merge pull request #9383 from filecoin-project/backports/17.2rc2
v1.17.2 backports
2022-09-27 16:23:18 +00:00
Ian Davis f228bf484e Don't publish new homebrew releases for RC builds 2022-09-27 14:50:44 +00:00
Aayush b4ec045bc0 fix: build: set PropagationDelaySecs correctly 2022-09-27 14:50:44 +00:00
Aayush 27030aa1e8 fix: miner: init miner's with 32GiB sectors by default 2022-09-27 14:50:44 +00:00
Aayush d8441b134a fix: miner: init: only get sector-size once 2022-09-27 14:50:44 +00:00
Łukasz Magiera 39604faa09 Merge pull request #9339 from filecoin-project/chore/v1.17.2-rc1-prep
v1.17.2-rc1
2022-09-20 18:37:19 +02:00
Łukasz Magiera 3ffedead7a v1.17.2-rc1 2022-09-20 18:31:06 +02:00
Aayush Rajasekaran ee3a9d2e09 Merge pull request #9335 from filecoin-project/deps/update-cborgen
deps: Use latest cbor-gen
2022-09-20 12:16:13 -04:00
Aayush 1f80471479 Update to go-state-types v0.1.12-beta 2022-09-20 11:59:26 -04:00
Łukasz Magiera 2d82527ee9 cli: Fix compute-state --html 2022-09-20 17:40:24 +02:00
Łukasz Magiera 9be712de99 deps: Use latest cbor-gen 2022-09-20 17:30:07 +02:00
Aayush Rajasekaran b6d36436c3 Merge pull request #9290 from filecoin-project/jen/propgation
feat: env: propagation delay
2022-09-19 22:00:28 -04:00
Łukasz Magiera 39af6e0365 Merge pull request #9328 from filecoin-project/fix/ffiwrap-close-ap
fix: ffiwrapper: Close readers in AddPiece
2022-09-19 17:47:15 +02:00
Łukasz Magiera dacbdee85b Merge pull request #9331 from filecoin-project/fix/no-upd-activating-panik
sealing: Avoid panicking in handleUpdateActivating on startup
2022-09-19 17:42:21 +02:00
Geoff Stuart 862e885125 Merge pull request #9330 from filecoin-project/asr/ffi-update
chore: deps: update FFI
2022-09-19 11:39:15 -04:00
Łukasz Magiera 66ad2b8102 sealing: Avoid panicking in handleUpdateActivating on startup 2022-09-19 17:32:02 +02:00
Aayush 291a889595 chore: deps: update FFI 2022-09-19 10:42:41 -04:00
Łukasz Magiera 4cdeb6cdb1 Merge pull request #9210 from filecoin-project/feat/recievesector
feat: sealing: Partially sealed sector import
2022-09-19 13:04:39 +02:00
Łukasz Magiera 015139d451 sealing pipeline: Clarify maybeNotifyRemoteDone 2022-09-19 12:16:11 +02:00
Łukasz Magiera 859c2606f0 sealing: Address review 2022-09-19 12:13:06 +02:00
Łukasz Magiera a05593da5b systar: Create file after header checks 2022-09-19 12:13:06 +02:00
Łukasz Magiera fec9c0f981 sector import: Fix lint 2022-09-19 12:13:06 +02:00
Łukasz Magiera 061a990eb8 sector import: RemoteSealingDoneEndpoint 2022-09-19 12:13:06 +02:00
Łukasz Magiera ef834b988c sector import: Fix test build 2022-09-19 12:13:06 +02:00
Łukasz Magiera 474c60203b tarutil: Strict header checks 2022-09-19 12:13:06 +02:00
Łukasz Magiera c17ab761c5 sector import: Remote Commit2 2022-09-19 12:13:06 +02:00
Łukasz Magiera 142894895d sector import: Implement seed/ticket/commr/commd checks 2022-09-19 12:13:06 +02:00
Łukasz Magiera b2dfaae68c sector import: Test remote commit1 retry 2022-09-19 12:13:06 +02:00
Łukasz Magiera 9f03569cd0 sector import: Remote Commit1 2022-09-19 12:13:06 +02:00
Łukasz Magiera 830c2ffdf5 sector import: FinalizeInto, send finalized cacde in itest 2022-09-19 12:13:06 +02:00
Łukasz Magiera 3086e8aa01 sector import: Seal with the correct proof type in saas itest 2022-09-19 12:13:06 +02:00
Łukasz Magiera 9c6d531ae7 sector import: Plumb sector download task canfig 2022-09-19 12:13:06 +02:00
Łukasz Magiera 12a8ab5ac7 sector import: Add missing initial fsm state transition 2022-09-19 12:13:06 +02:00
Łukasz Magiera fef7232c6b sector import: Initial SectorReceive itest 2022-09-19 12:13:06 +02:00
Łukasz Magiera 3caa010779 sector import: Update type-gen 2022-09-19 12:13:06 +02:00
Łukasz Magiera cdadf5e5a9 sector import: Implement handleReceiveSector 2022-09-19 12:13:05 +02:00
Łukasz Magiera cde23be559 sector import: Fix tests 2022-09-19 12:13:05 +02:00
Łukasz Magiera ea99bd9763 sector import: Sector data download 2022-09-19 12:13:05 +02:00
Łukasz Magiera fbb487ae2b sector import: Plumbing for DownloadSectorData in the sealing system 2022-09-19 12:13:05 +02:00
Łukasz Magiera 39e4845f42 sector import: Put the imported sector into the sealing pipeline 2022-09-19 12:13:05 +02:00
Łukasz Magiera 2b644525f8 sector import: More check progress 2022-09-19 12:13:05 +02:00
Łukasz Magiera 2318419291 sector import: Fix missing perm tag on SectorReceive 2022-09-19 12:13:05 +02:00
Łukasz Magiera ca790b4c69 sealing: Validate piece alignment in checkPieces 2022-09-19 12:13:05 +02:00
Łukasz Magiera 332d83bd18 sector import: Check pieces in Sealing.Receive 2022-09-19 12:13:05 +02:00
Łukasz Magiera 5c485c3375 sealing: Drop redundant Piece type 2022-09-19 12:13:05 +02:00
Łukasz Magiera 29135aa77c sector import: Initial api scaffolding 2022-09-19 12:13:03 +02:00
Łukasz Magiera d68bb937d8 fix: ffiwrapper: Close readers in AddPiece 2022-09-19 09:52:57 +02:00
Jiaying Wang 4abc38dacc Merge pull request #9310 from filecoin-project/fix/empty-snap
fix: sealing: Abort upgrades in sectors with no deals
2022-09-16 21:21:39 -04:00
Aayush Rajasekaran 10087ffaeb Merge pull request #9326 from filecoin-project/asr/deal-info-logs
feat: add descriptive errors to markets event handler
2022-09-16 15:54:14 -04:00
Aayush 4382bbcc96 feat: add logs to markets event handler 2022-09-16 15:36:08 -04:00
Aayush Rajasekaran 7663ec2bde Merge pull request #9325 from filecoin-project/fix/missing-pci
fix: sealing: Drop unused PreCommitInfo from pipeline.SectorInfo
2022-09-16 12:10:45 -04:00
Łukasz Magiera f1e4ecaaa3 fix: Drop unused PreCommitInfo from pipeline.SectorInfo 2022-09-16 17:51:09 +02:00
Łukasz Magiera 501d21aa28 fix expiration config handling in calcTargetExpiration 2022-09-16 15:37:50 +02:00
Łukasz Magiera e3d59288fe Merge pull request #9241 from filecoin-project/fix/control-list-panic
fix: cli: fix panic in `lotus-miner actor control list`
2022-09-16 14:11:18 +02:00
Łukasz Magiera 7cfba5e1b2 Merge pull request #9323 from LexLuthr/feat/update-storage-output
feat: miner: display updated & update-cache for storage list
2022-09-16 12:43:51 +02:00
LexLuthr 32ce8f0d9b display updated & update-cache for storage 2022-09-16 11:37:12 +05:30
Aayush Rajasekaran 7d3b7fe728 Merge pull request #9321 from filecoin-project/gstuart/actors-cids-cli-network-version
fix: cli: actor-cids cli command now defaults to current network
2022-09-15 12:38:51 -04:00
Geoff Stuart 609dad02a2 actor-cids cli command now defaults to current network version instead of newest 2022-09-15 10:42:44 -04:00
Łukasz Magiera 7dd12f88e1 Merge pull request #9027 from filecoin-project/jen/butterfly
build: artifacts: butterfly
2022-09-15 16:30:02 +02:00
Łukasz Magiera 7a2a069a5a Merge pull request #9282 from Juneezee/refactor/os.ReadDir
refactor: use `os.ReadDir` for lightweight directory reading
2022-09-15 16:25:51 +02:00
Łukasz Magiera bf3daea124 sealing: Minimum upgrade sector expiration/target config 2022-09-15 16:19:57 +02:00
Łukasz Magiera 305cfa1f69 sealing: Pick safer minTarget in calcTargetExpiration 2022-09-15 16:09:13 +02:00
Łukasz Magiera d2c726cd28 fix: sealing: Abort upgrades in sectors with no deals 2022-09-15 16:09:13 +02:00
Aayush Rajasekaran 4e830a8c31 Merge pull request #9308 from filecoin-project/gstuart/beneficiary-info-cli
feat: cli: print beneficiary info in state miner-info
2022-09-14 18:12:55 -04:00
Geoff Stuart 9d63e1412e print beneficiary info in state miner-info and lotus-miner info 2022-09-14 17:54:20 -04:00
Aayush Rajasekaran 305589e347 Merge pull request #9307 from filecoin-project/gstuart/change-beneficiary
feat: api/cli: change beneficiary propose and confirm for actors and multisigs.
2022-09-14 17:47:20 -04:00
Geoff Stuart 3c19328764 Review fixes 2022-09-14 17:38:01 -04:00
Geoff Stuart 84fd51ff50 add cli commands for changing beneficiary 2022-09-14 16:52:00 -04:00
Aayush Rajasekaran 4f46ad3665 Merge pull request #9317 from filecoin-project/gstuart/cli-cleanup
chore: cli: cleanup and standardize cli
2022-09-14 16:35:49 -04:00
Geoff Stuart 4f75e2041c Add helper function to print usage when wrong number of arguments are supplied 2022-09-14 15:38:15 -04:00
Geoff Stuart 3ca9b1e331 wait.Receipt.ExitCode != 0 to wait.Receipt.ExitCode.IsError() 2022-09-14 14:53:11 -04:00
Geoff Stuart fb0633453a api, nodeApi to minerApi 2022-09-14 14:51:18 -04:00
Geoff Stuart 308cef950b cctx.Args().Len() to cctx.NArg() 2022-09-14 14:33:29 -04:00
Geoff Stuart f567db64b6 Merge pull request #9296 from filecoin-project/gstuart/beneficiary-withdraw-api
feat: api/cli: beneficiary withdraw api and cli
2022-09-14 13:36:51 -04:00
Geoff Stuart d94cdaaade Fixes node startup 2022-09-14 13:15:17 -04:00
Łukasz Magiera 3e8eaa8112 Merge pull request #9315 from filecoin-project/asr/fix-config
fix: docsgen: revert rename of API Name to Num
2022-09-14 19:13:16 +02:00
Aayush e3e6ff67db fix: docsgen: revert rename of API Name to Num 2022-09-14 12:41:47 -04:00
Geoff Stuart 21906b5a63 add api and cli calls for beneficiary withdrawl 2022-09-14 12:26:35 -04:00
Łukasz Magiera bdb62e6a40 Merge pull request #9303 from filecoin-project/9299-messages-with-empty-uuids-to-mpoolpushmessage-will-be-rejected
fix: api: Ignore uuid check for messages with uuid not set
2022-09-14 08:59:11 +02:00
Aayush Rajasekaran 7b23814fc1 Merge pull request #9291 from filecoin-project/gstuart/terminate-from-worker-addr
feat: cli: Add option to terminate sectors from worker address
2022-09-13 20:51:11 -04:00
Geoff Stuart 36fec765e7 Merge pull request #9304 from filecoin-project/tippy/update-links-2
chore: Fix dead links to docs.filecoin.io
2022-09-13 19:37:42 -04:00
TippyFlitsUK ea53f12a98 chore: Fix dead links to docs.filecoin.io 2022-09-14 00:10:22 +01:00
Shrenuj Bansal a50a21b076 cleanup 2022-09-13 16:52:47 -04:00
Shrenuj Bansal 4c4b10c617 Ignore uuid check for messages with uuid not set 2022-09-13 16:33:55 -04:00
Aayush Rajasekaran d249117182 Merge pull request #9279 from filecoin-project/chore/update-bitswap
chore: update bitswap and some libp2p packages
2022-09-13 12:14:38 -04:00
Steven Allen b13cf82541 chore: update bitswap and some libp2p packages
This removes some deprecated packages from the build tree.
2022-09-13 07:56:12 -07:00
Geoff Stuart a0ec3a7bbe Add option to terminate sectors from any address 2022-09-13 10:14:28 -04:00
Aayush Rajasekaran c791fe34b9 Merge pull request #9283 from filecoin-project/gstuart/merge-releases-1.17.1
chore: merge releases into master after v1.17.1 release
2022-09-13 10:06:13 -04:00
Aayush Rajasekaran 04a8239df4 Merge pull request #9267 from filecoin-project/jen/nv17
feat: network: add nv17 and integrate the corresponding go state type
2022-09-12 18:19:28 -04:00
Aayush 108d41fd78 Update FFI and go-state-types 2022-09-12 15:59:55 -04:00
Jennifer Wang 001c5500bd increase the default propagation delay to 10 sec 2022-09-12 10:48:55 -04:00
Jennifer Wang 8d99d27932 add envvar for PROPAGATION_DELAY_SECS 2022-09-12 10:45:34 -04:00
Aayush 19c3232d2f more fixes 2022-09-10 12:37:03 -04:00
Aayush 76090193ea Tweak StateMinerPreCommitDepositForPower based on network version 2022-09-09 21:40:15 -04:00
Aayush c0bbaebaf4 more fixes 2022-09-09 21:40:15 -04:00
Aayush 92cc24fca2 support fvm gas tracing 2022-09-09 21:40:15 -04:00
Aayush 30f66578e1 fixup genesis creation 2022-09-09 21:40:15 -04:00
Aayush e9a3235291 more fixes 2022-09-09 21:40:15 -04:00
Geoff Stuart 642555d0fb Fix discrepancies, run fiximports 2022-09-09 21:40:15 -04:00
Aayush 0efca4d266 introduce v9 actors and nv17 2022-09-09 21:40:15 -04:00
Geoff Stuart bc2bf7d6d0 Merge branch 'releases' 2022-09-09 14:05:15 -04:00
Geoff Stuart 29fff4fb06 Merge pull request #9281 from filecoin-project/fix/call-syncBasefeeCheck
fix: miner: Call SyncBasefeeCheck from `lotus info`
2022-09-09 12:34:18 -04:00
Eng Zer Jun abef90423d refactor: use os.ReadDir for lightweight directory reading
`os.ReadDir` was added in Go 1.16 as part of the deprecation of `ioutil`
package. It is a more efficient implementation than `ioutil.ReadDir`.

Reference: https://pkg.go.dev/io/ioutil#ReadDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-09-09 19:53:40 +08:00
Phi ca965d1c6c Call SyncBasefeeCheck from lotus info
Call SyncBasefeeCheck from `lotus info` to not duplicate logic. Also switches to V1 api.
2022-09-09 13:42:34 +02:00
Łukasz Magiera 0594e33ed7 Merge pull request #9277 from filecoin-project/fix/ffi-version
ffi: Revert accidental filecoin-ffi downgrade from #9144
2022-09-08 12:04:41 +02:00
Łukasz Magiera f9e19500be ffi: Revert accidental update from #9144 2022-09-08 11:53:52 +02:00
LexLuthr 67d4f905e6 feat: proving: Introduce manual sector fault recovery (#9144)
* rebase

* fix lint error

* fix errors

* add itest

* make gen after rebase

* apply suggestion from review

* make gen after latest rebase

* gen after rebase

* fix waitgroup

* change as per review

* refactor Recovery Batches

* fix CLI

* gen after rebase

* close the channel
2022-09-06 21:17:30 +05:30
Phi 9c48922a75 Fix lotus-shed actor cmd
Check the length of multisig address in lotus-shed actor cmd as well.
2022-09-05 09:58:34 +02:00
Łukasz Magiera 783fc6a20d Merge pull request #9233 from filecoin-project/feat/lotus-info-cmd
feat: cli: lotus info cmd
2022-09-05 09:47:42 +02:00
Phi ab0699875a make gen happy
make gen happy not sad
2022-09-02 15:20:36 +02:00
Phi-rjanandŁukasz Magiera a31b8a1b58 Update cli/info.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2022-09-02 15:12:32 +02:00
Phi 3e74819519 Check length of msig address
Check the length of multisig address, and print based on that.
2022-09-02 10:33:32 +02:00
Aayush Rajasekaran 98ff8c477e Merge pull request #9237 from filecoin-project/fix/actor-set-addrs-sender
fix: cli: Option to specify --from msg sender
2022-09-01 11:31:21 -04:00
Aayush Rajasekaran c147e315db Merge pull request #9242 from filecoin-project/fix/ledger-reject-error
fix: ux: better ledger rejection error
2022-09-01 11:29:46 -04:00
Phi a5ea5ba9c1 Fix lint
Fix lint
2022-09-01 17:01:03 +02:00
Phi 405bfeddac Better ledger rejection error
Print a more understandable error message when a transaction is being rejected on ledger.
2022-09-01 16:30:36 +02:00
Phi 7c00c1e5d5 Tune down slice
Tuning down slice to only 6 characters to avoid panics if the multisig-actor is of really low character length.
2022-09-01 11:54:10 +02:00
Phi 15ea3953f0 Option to specify --from msg sender
Adds the option to specify the account to send the message from in the `lotus-miner actor set-addrs`
2022-08-31 18:42:24 +02:00
Phi 818153a1e7 Put SyncBasefeeCheck in function
Put SyncBasefeeCheck in function
2022-08-31 13:15:28 +02:00
Phi 870c2f9554 Move newline
Move newline
2022-08-31 10:44:59 +02:00
Phi 8a45e8c8af Handle "Default address not set" better
Only print address and get balance if err == nil, else print that the Default address is not set
2022-08-31 10:40:50 +02:00
Phi 683900b5a2 make docsgen-cli
make docsgen-cli
2022-08-30 13:29:22 +02:00
Phi ab61f4bb2c lotus info cmd
Adds lotus info command that prints a lot of node information.
2022-08-30 12:54:59 +02:00
Łukasz Magiera 088bf56f2a Merge pull request #9231 from filecoin-project/fix/datacid-res-envvars
sealing: fix: Make DataCid resource env vars make more sense
2022-08-30 02:36:02 +02:00
Łukasz Magiera 2532300156 Merge pull request #9232 from filecoin-project/fix/gatewaytest-panic
cli: Don't panic with no providers in client retrieve
2022-08-29 17:27:36 +02:00
Łukasz Magiera 36ae2086ab cli: Don't panic with no providers in client retrieve 2022-08-29 16:55:58 +02:00
Łukasz Magiera 08b22edd89 fix make gen 2022-08-29 16:25:30 +02:00
Łukasz Magiera 78cde92999 Merge pull request #9230 from filecoin-project/fix/data-cid-close
fix: api: DataCid - ensure reader is closed
2022-08-29 16:15:03 +02:00
Łukasz Magiera 9d916029d9 Merge pull request #9229 from filecoin-project/deps/pubsub-v0.8.0
deps: go-libp2p-pubsub v0.8.0
2022-08-29 16:12:43 +02:00
Łukasz Magiera d00e1e78bb resources: Use 32G AP resources for DC 2022-08-29 16:12:02 +02:00
Łukasz Magiera c51283223d mod tidy 2022-08-29 16:03:03 +02:00
Łukasz Magiera e4ed3f8cf8 sealing: fix: Make DataCid resource env vars make more sense 2022-08-29 15:57:58 +02:00
Dirk McCormick 964bbca792 fix: DataCid - ensure reader is closed 2022-08-29 10:31:11 +02:00
Łukasz Magiera efc8c75e7d deps: go-libp2p-pubsub v0.8.0 2022-08-29 10:05:14 +02:00
Łukasz Magiera 28722de72d Merge pull request #9177 from filecoin-project/9171-add-retries-to-mpool-push-message
feat: message: Add retries to mpool push message from lotus miner
2022-08-29 09:24:35 +02:00
Łukasz Magiera 99c2ad4ad5 make: fix go version check 2022-08-29 09:06:19 +02:00
Jiaying Wang 1b5a1f692a Merge pull request #9206 from filecoin-project/asr/verifreg-tuple
fix: verifreg: serialize RmDcProposalID as int, not tuple
2022-08-26 16:38:34 -04:00
Jennifer Wang 343d092044 mod tidy 2022-08-26 15:33:26 -04:00
Jennifer Wang d8578190ff update go state type to v0.1.11 2022-08-26 14:43:53 -04:00
Shrenuj Bansal 6291799cfa Change go version to 1.18.1 in more readmes 2022-08-26 14:19:17 -04:00
Shrenuj Bansal b3175f0b5c Merge branch 'master' into 9171-add-retries-to-mpool-push-message 2022-08-26 12:31:35 -04:00
Shrenuj Bansal 0ebe1a6631 go mod tidy 2022-08-26 12:02:00 -04:00
Shrenuj Bansal 217cc846c3 Address more comments 2022-08-26 11:55:20 -04:00
Łukasz Magiera 45d1bd61ce Merge pull request #9183 from filecoin-project/feat/sectornum-mgmt
feat: sealing: Use bitfields to manage sector numbers
2022-08-26 10:59:24 -04:00
Łukasz Magiera 0770bced09 Merge pull request #9216 from filecoin-project/deps/libp2p-v0.22
deps: libp2p v0.22
2022-08-25 20:03:26 -04:00
Łukasz Magiera 5d9315938f Make mod tidy happy 2022-08-25 14:28:06 -04:00
Łukasz Magiera dd144eaab9 Update other deprecated libp2p imports 2022-08-25 14:23:25 -04:00
Łukasz Magiera 2086b219d2 Don't use go-libp2p-core 2022-08-25 14:20:41 -04:00
Łukasz Magiera ebd8c0c50a gomod: Update libp2p to v0.22.0 2022-08-25 14:06:21 -04:00
Łukasz Magiera 153cdf24a5 Merge pull request #9167 from ianconsolata/snap-daemon-autorun-disable
_ci_ / _build_ : Snap daemon autorun disable
2022-08-25 13:42:13 -04:00
Geoff Stuart aa27fb496f Merge pull request #9212 from filecoin-project/feat/shed-vlog-maxsz
feat: shed: add a --max-size flag to vlog2car
2022-08-25 10:25:37 -04:00
Łukasz Magiera 70f0edd041 strle, sealing: address review 2022-08-25 10:19:39 -04:00
Łukasz Magiera 2f7062d642 vlog2car: add max-size flag usage, fix lint 2022-08-25 10:08:12 -04:00
Łukasz Magiera ebeb16eda5 feat: shed: add a --max-size flag to vlog2car 2022-08-25 01:05:56 +02:00
Łukasz Magiera b8a8648f4a numassigner: fix lint 2022-08-24 11:38:29 -04:00
Łukasz Magiera 335f5df3ec numassigner: SectorNumReserveCount 2022-08-24 11:25:37 -04:00
Łukasz Magiera f1f31d1067 Merge pull request #9207 from filecoin-project/asr/deflake
fix: mock sealer: grab lock in ReadPiece
2022-08-23 21:55:18 -04:00
Aayush 5e80276631 fix: mock sealer: grab lock in ReadPiece 2022-08-23 17:24:28 -04:00
Aayush 9812792d46 fix: verifreg: serialize RmDcProposalID as int, not tuple 2022-08-23 16:58:10 -04:00
Łukasz Magiera 4a6ea4c492 Merge pull request #9202 from nujz/master
fix: cgroupV1: memory.memsw.usage_in_bytes: no such file or directory
2022-08-23 14:38:55 -04:00
Łukasz Magiera b290dac3cb Merge remote-tracking branch 'origin/master' into feat/sectornum-mgmt 2022-08-23 11:44:43 -04:00
nujz 76f6eb3edf cgroupV1: memory.memsw.usage_in_bytes: no such file or directory 2022-08-23 17:37:47 +08:00
Aayush Rajasekaran b33e3eac60 Merge pull request #9201 from filecoin-project/gstuart/state-actor-manifest-cid
feat: api: Reintroduce StateActorManifestCID
2022-08-22 18:20:24 -04:00
Łukasz Magiera c18874c122 numassigner: Don't error on fresh non-genesis miners 2022-08-22 17:49:58 -04:00
Łukasz Magiera 64290b69c9 numassigner: Fix missing api perms 2022-08-22 17:41:41 -04:00
Shrenuj Bansal b972e079b8 Address comments 2022-08-22 17:32:43 -04:00
Geoff Stuart 7d07ddd837 Reintroduce StateActorManifestCID 2022-08-22 17:17:01 -04:00
Łukasz Magiera 129eba2b5d sealing: numassign: itests/bug fixes 2022-08-22 16:58:36 -04:00
Łukasz Magiera 00bef607ca sealing: numassign: take on-chain allocated numbers into account 2022-08-22 16:55:44 -04:00
Łukasz Magiera ef2080a800 cli for managing sector reservations 2022-08-22 16:55:41 -04:00
Łukasz Magiera ca72590e49 sealing: Use bitfields to manage sector numbers 2022-08-22 16:55:08 -04:00
Łukasz Magiera 5274ddce83 Merge pull request #9198 from filecoin-project/jen/annoyed
chore:  seed: add cmd for adding signers to rkh to genesis
2022-08-22 13:05:09 -04:00
Jennifer Wang f86ce88d3d add cmd for adding signers to vkh to genesis 2022-08-21 22:33:24 -04:00
Łukasz Magiera ea504dc93b Merge pull request #9189 from filecoin-project/phi/commp-bytes
fix: ux: Output bytes in `lotus client commP` cmd
2022-08-19 19:15:19 -04:00
Shrenuj Bansal 8a19cd19d8 Merge branch 'master' into 9171-add-retries-to-mpool-push-message 2022-08-19 12:08:07 -04:00
Łukasz Magiera c9d65606f5 Merge branch 'deps/go-libp2p-v0.21' 2022-08-19 11:57:01 -04:00
Shrenuj Bansal 5a12e58c0c Return error for non retryable errors 2022-08-19 11:33:37 -04:00
Łukasz Magiera 9112470785 deps: use tagged kad-dht 2022-08-19 11:31:51 -04:00
Łukasz Magiera 87edaa3f06 deps: use tagged markets 2022-08-19 11:28:05 -04:00
Łukasz Magiera ba67431731 Merge branch 'update-go-libp2p-v0.21' of github.com:MarcoPolo/lotus into deps/go-libp2p-v0.21 2022-08-19 11:22:04 -04:00
Phi 656f4d5101 Output bytes in lotus client commP cmd
Adds an additional line that outputs bytes in the `lotus client commP` cmd. Resolves #9188
2022-08-19 12:27:09 +02:00
Shrenuj Bansal afb4b1b68f mod tidy and fiximports 2022-08-18 18:23:42 -04:00
Shrenuj Bansal 12abc74640 update jsonrpc deps 2022-08-18 18:10:57 -04:00
Shrenuj Bansal 7c404d8b5e fix error type comparison 2022-08-18 17:55:56 -04:00
Shrenuj Bansal 00975237b1 Add retries for specific types of errors 2022-08-18 15:57:59 -04:00
Jiaying Wang e165731b82 Merge pull request #9182 from filecoin-project/jen/9169
fix: ux: exclude negative available balance from spendable amount
2022-08-18 14:44:56 -04:00
Łukasz Magiera 9fb1a0d4b3 Merge pull request #9184 from filecoin-project/feat/secrenew-only-cc
feat: sectors renew --only-cc
2022-08-18 14:08:36 -04:00
Łukasz Magiera 87b82b95c8 feat: sectors renew --only-cc 2022-08-18 11:04:20 -04:00
Jennifer Wang 52bae8d37d when availabel balance is negative, exclude from spendable amount 2022-08-18 09:31:14 -04:00
Shrenuj Bansal 736b492fb0 Change go version in dockerfile 2022-08-17 16:09:30 -04:00
Shrenuj Bansal 66891b6c53 mod tidy 2022-08-17 15:28:38 -04:00
Shrenuj Bansal 942c3a879c Change go version for circleci 2022-08-17 15:21:03 -04:00
Łukasz Magiera b5ac141936 Merge pull request #9174 from filecoin-project/9171-add-uuid-to-message-sent-to-chain-node
feat: message: Add uuid to mpool message sent to chain node from miner
2022-08-17 15:07:48 -04:00
Shrenuj Bansal f5ba7b958e Add stateWaitMsg before checking last balance 2022-08-17 14:48:44 -04:00
Shrenuj Bansal a59f977db1 Add retries to mpool push message from lotus miner 2022-08-17 14:22:31 -04:00
Shrenuj Bansal cd5dd2727c fix lint 2022-08-17 14:14:07 -04:00
Shrenuj Bansal 087a838db5 make gen for tests 2022-08-17 14:02:53 -04:00
Shrenuj Bansal 99040a89c6 Add test for dedup mpool messages 2022-08-17 12:38:23 -04:00
Shrenuj Bansal 60751f809b Change func name and nil pointer check based on comments 2022-08-17 10:47:05 -04:00
Shrenuj Bansal 32a2ae12cb fix lint rename 2022-08-16 16:44:14 -04:00
Shrenuj Bansal 72230d3249 fix lint 2022-08-16 16:25:42 -04:00
Shrenuj Bansal b7227d3a6b run make gen 2022-08-16 15:56:32 -04:00
Shrenuj Bansal fa4a479b97 Add uuid to mpool message sent to chain node from miner 2022-08-16 15:39:06 -04:00
Łukasz Magiera f27ef344bc Merge pull request #9170 from filecoin-project/gstuart/xcode-version-ci-master
Update xcode version for macos builds
2022-08-15 15:51:10 -04:00
Geoff Stuart 84a2ebcbfd Update xcode version for macos builds 2022-08-15 12:23:20 -04:00
Łukasz Magiera 2e29b460d2 Merge pull request #9142 from filecoin-project/chore/untangle-fsm
sealing pipeline: Remove useless storage adapter code
2022-08-14 15:50:31 -04:00
Łukasz Magiera 77208728ad sealing: fix lint/tests 2022-08-14 12:50:18 -04:00
Ian Davis e0428ca8c2 Snap starts disabled now, so no need to disable 2022-08-12 14:44:31 -07:00
Marco Munizaga 1af9e3c313 Check err for view.Register 2022-08-12 09:55:03 -07:00
Marco Munizaga 1f65d51a69 Update go-libp2p-resource-manager to v0.5.3 2022-08-12 09:49:38 -07:00
Łukasz Magiera a81cbb5a7b Merge pull request #9161 from Fatman13/fatman13
chore: fix typo in comment
2022-08-12 12:17:35 +02:00
Yu 0ad96858ff chore: do make docsgen 2022-08-12 15:12:22 +08:00
Yu bb05aeb860 chore: fix typo in comment 2022-08-12 11:53:06 +08:00
Marco Munizaga 5a133ff2d4 Hook up resource manager metrics 2022-08-11 15:56:48 -07:00
Ian Davis 8bc79a65c7 Don't automatically start the lotus daemon on snap install 2022-08-11 15:45:02 -07:00
Marco Munizaga 3c2c827bc3 Revert "Rerun ci"
This reverts commit 05f5e02c03.
2022-08-11 13:42:33 -07:00
Marco Munizaga 05f5e02c03 Rerun ci 2022-08-11 13:22:58 -07:00
Geoff Stuart c326eadd8b Merge pull request #9151 from RobQuistNL/patch-8
fix: sealing: Add information on what worker a job was assigned to in logs
2022-08-11 16:01:53 -04:00
Marco Munizaga df777b3166 Update deps 2022-08-11 12:53:10 -07:00
Marco Munizaga 6d4b962391 Use v0.8.0 go-bitswap 2022-08-11 12:38:50 -07:00
Geoff Stuart 525ee3b77d Merge pull request #9153 from filecoin-project/sbansal/detach-storage-on-worker-shutdown
fix: worker: Close all storage paths on worker shutdown
2022-08-11 15:01:33 -04:00
Marco Munizaga 61abd91eb9 Use kad-dht fork 2022-08-11 11:39:06 -07:00
Marco Munizaga 6ae75aa1a2 Mod tidy 2022-08-11 11:23:34 -07:00
Marco Munizaga d03992f878 Update rcmgr 2022-08-11 11:23:19 -07:00
Marco Munizaga 15e00a125d Update rcmgr 2022-08-11 11:23:01 -07:00
Marco Munizaga 57772135ad Update dep 2022-08-11 11:22:21 -07:00
Marco Munizaga abd418af41 Fix lint 2022-08-11 11:20:12 -07:00
Marco Munizaga 6a17cad206 Update testplans go.mod 2022-08-11 11:20:10 -07:00
Marco Munizaga 766d809f0c Update to go-libp2p v0.21-RC 2022-08-11 11:15:20 -07:00
Shrenuj Bansal 1c98e37db8 fiximports 2022-08-11 11:53:58 -04:00
Shrenuj Bansal 4d10487463 log errors when closing all paths instead of stopping execution 2022-08-11 10:44:26 -04:00
Geoff Stuart 0b5e27d3de Merge pull request #9152 from ianconsolata/update-packer-snap-name
Use lotus snap (and fix typo) for packer builds
2022-08-11 09:14:11 -04:00
Geoff Stuart 5119769de0 Merge pull request #9155 from filecoin-project/phi/print-withdraw-receipt
fix: ux: msg receipt for actor withdrawal
2022-08-11 09:05:02 -04:00
Phi 509c44d446 fix: ux: msg receipt for actor withdrawal
Prints the message receipt when withdrawing from the miner-actor. Also highlights that the command is waiting for the message to be included in  a block.
2022-08-11 09:34:18 +02:00
Shrenuj Bansal 10dba44638 Add return value assignments 2022-08-10 17:43:54 -04:00
Shrenuj Bansal f390c186e6 Close all storage paths on worker shutdown 2022-08-10 17:06:01 -04:00
Rob Quist f5086c98e8 fix: Add information on what worker a job was assigned to in logs
More detailed logs
2022-08-10 21:33:19 +02:00
Ian Davis 670c53e863 Use lotus snap (and fix typo) for packer builds 2022-08-10 11:44:52 -07:00
Jiaying Wang 3244969b93 Merge pull request #9147 from filecoin-project/gstuart/bump-versions
chore: versioning: Bump version to v1.17.2-dev
2022-08-09 13:57:25 -04:00
Geoff Stuart f536257d3c Bump version 2022-08-09 13:38:28 -04:00
Łukasz Magiera 71dacb5af8 sealing pipeline: Remove useless storage adapter code 2022-08-09 13:40:06 +02:00
Łukasz Magiera fe2a589890 sealing pipeline: Cleanup AddresSelector plumbing 2022-08-09 12:57:36 +02:00
Łukasz Magiera 4b6a9e0387 sealing pipeline: Cleanup journal plumbing 2022-08-09 12:42:35 +02:00
Jennifer Wang d85d4f6094 butterfly artifacts 2022-07-13 08:54:19 -04:00
631 changed files with 17817 additions and 21884 deletions
+64 -4
View File
@@ -5,7 +5,8 @@ orbs:
executors:
golang:
docker:
- image: cimg/go:1.17.9
# Must match GO_VERSION_MIN in project root
- image: cimg/go:1.18.1
resource_class: 2xlarge
ubuntu:
docker:
@@ -44,6 +45,15 @@ commands:
- when:
condition: << parameters.linux >>
steps:
- run:
name: Check Go Version
command: |
v=`go version | { read _ _ v _; echo ${v#go}; }`
if [[ $v != `cat GO_VERSION_MIN` ]]; then
echo "GO_VERSION_MIN file does not match the go version being used."
echo "Please update image to cimg/go:`cat GO_VERSION_MIN` or update GO_VERSION_MIN to $v."
exit 1
fi
- run: sudo apt-get update
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
- when:
@@ -52,7 +62,7 @@ commands:
- run:
name: Install Go
command: |
curl https://dl.google.com/go/go1.17.9.darwin-amd64.pkg -o /tmp/go.pkg && \
curl https://dl.google.com/go/go`cat GO_VERSION_MIN`.darwin-amd64.pkg -o /tmp/go.pkg && \
sudo installer -pkg /tmp/go.pkg -target /
- run:
name: Export Go
@@ -424,6 +434,13 @@ jobs:
- checkout
- attach_workspace:
at: "."
- run:
name: Update Go
command: |
sudo rm -rf /usr/local/go && \
curl -L https://golang.org/dl/go`cat GO_VERSION_MIN`.linux-amd64.tar.gz -o /tmp/go.tar.gz && \
sudo tar -C /usr/local -xvf /tmp/go.tar.gz
- run: go version
- run:
name: install appimage-builder
command: |
@@ -889,6 +906,11 @@ workflows:
suite: itest-deals
target: "./itests/deals_test.go"
- test:
name: test-itest-dup_mpool_messages
suite: itest-dup_mpool_messages
target: "./itests/dup_mpool_messages_test.go"
- test:
name: test-itest-gas_estimation
suite: itest-gas_estimation
@@ -919,6 +941,16 @@ workflows:
suite: itest-mempool
target: "./itests/mempool_test.go"
- test:
name: test-itest-migration_nv17
suite: itest-migration_nv17
target: "./itests/migration_nv17_test.go"
- test:
name: test-itest-mpool_msg_uuid
suite: itest-mpool_msg_uuid
target: "./itests/mpool_msg_uuid_test.go"
- test:
name: test-itest-multisig
suite: itest-multisig
@@ -954,6 +986,16 @@ workflows:
suite: itest-paych_cli
target: "./itests/paych_cli_test.go"
- test:
name: test-itest-pending_deal_allocation
suite: itest-pending_deal_allocation
target: "./itests/pending_deal_allocation_test.go"
- test:
name: test-itest-remove_verifreg_datacap
suite: itest-remove_verifreg_datacap
target: "./itests/remove_verifreg_datacap_test.go"
- test:
name: test-itest-sdr_upgrade
suite: itest-sdr_upgrade
@@ -964,6 +1006,16 @@ workflows:
suite: itest-sector_finalize_early
target: "./itests/sector_finalize_early_test.go"
- test:
name: test-itest-sector_import_full
suite: itest-sector_import_full
target: "./itests/sector_import_full_test.go"
- test:
name: test-itest-sector_import_simple
suite: itest-sector_import_simple
target: "./itests/sector_import_simple_test.go"
- test:
name: test-itest-sector_make_cc_avail
suite: itest-sector_make_cc_avail
@@ -974,6 +1026,11 @@ workflows:
suite: itest-sector_miner_collateral
target: "./itests/sector_miner_collateral_test.go"
- test:
name: test-itest-sector_numassign
suite: itest-sector_numassign
target: "./itests/sector_numassign_test.go"
- test:
name: test-itest-sector_pledge
suite: itest-sector_pledge
@@ -1104,12 +1161,15 @@ workflows:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- /^v\d+\.\d+\.\d+$/
- build-macos:
filters:
branches:
only:
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
tags:
only:
- /^v\d+\.\d+\.\d+-rc\d+$/
- build-appimage:
filters:
branches:
@@ -1240,4 +1300,4 @@ workflows:
only:
- master
jobs:
- publish-packer-snap
- publish-packer-snap
+24 -4
View File
@@ -5,7 +5,8 @@ orbs:
executors:
golang:
docker:
- image: cimg/go:1.17.9
# Must match GO_VERSION_MIN in project root
- image: cimg/go:1.18.1
resource_class: 2xlarge
ubuntu:
docker:
@@ -44,6 +45,15 @@ commands:
- when:
condition: << parameters.linux >>
steps:
- run:
name: Check Go Version
command: |
v=`go version | { read _ _ v _; echo ${v#go}; }`
if [["[[ $v != `cat GO_VERSION_MIN` ]]"]]; then
echo "GO_VERSION_MIN file does not match the go version being used."
echo "Please update image to cimg/go:`cat GO_VERSION_MIN` or update GO_VERSION_MIN to $v."
exit 1
fi
- run: sudo apt-get update
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
- when:
@@ -52,7 +62,7 @@ commands:
- run:
name: Install Go
command: |
curl https://dl.google.com/go/go1.17.9.darwin-amd64.pkg -o /tmp/go.pkg && \
curl https://dl.google.com/go/go`cat GO_VERSION_MIN`.darwin-amd64.pkg -o /tmp/go.pkg && \
sudo installer -pkg /tmp/go.pkg -target /
- run:
name: Export Go
@@ -424,6 +434,13 @@ jobs:
- checkout
- attach_workspace:
at: "."
- run:
name: Update Go
command: |
sudo rm -rf /usr/local/go && \
curl -L https://golang.org/dl/go`cat GO_VERSION_MIN`.linux-amd64.tar.gz -o /tmp/go.tar.gz && \
sudo tar -C /usr/local -xvf /tmp/go.tar.gz
- run: go version
- run:
name: install appimage-builder
command: |
@@ -854,12 +871,15 @@ workflows:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- /^v\d+\.\d+\.\d+$/
- build-macos:
filters:
branches:
only:
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
tags:
only:
- /^v\d+\.\d+\.\d+-rc\d+$/
- build-appimage:
filters:
branches:
@@ -990,4 +1010,4 @@ workflows:
only:
- master
jobs:
- publish-packer-snap
- publish-packer-snap
+1 -1
View File
@@ -81,7 +81,7 @@ body:
render: text
description: |
Please provide debug logs of the problem, remember you can get set log level control for:
* lotus: use `lotus log list` to get all log systems available and set level by `lotus log set-level`. An example can be found [here](https://docs.filecoin.io/get-started/lotus/configuration-and-advanced-usage/#log-level-control).
* lotus: use `lotus log list` to get all log systems available and set level by `lotus log set-level`. An example can be found [here](https://lotus.filecoin.io/lotus/configure/defaults/#log-level-control).
* lotus-miner:`lotus-miner log list` to get all log systems available and set level by `lotus-miner log set-level
If you don't provide detailed logs when you raise the issue it will almost certainly be the first request I make before furthur diagnosing the problem.
validations:
+1 -1
View File
@@ -37,7 +37,7 @@ jobs:
- uses: actions/setup-go@v1
with:
go-version: '1.17.9'
go-version: '1.18.1'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
-3
View File
@@ -9,7 +9,6 @@
/lotus-chainwatch
/lotus-shed
/lotus-sim
/lotus-pond
/lotus-townhall
/lotus-fountain
/lotus-stats
@@ -21,8 +20,6 @@
/docgen-md
/docgen-openrpc
/bench.json
/lotuspond/front/node_modules
/lotuspond/front/build
/cmd/lotus-townhall/townhall/node_modules
/cmd/lotus-townhall/townhall/build
/cmd/lotus-townhall/townhall/package-lock.json
-3
View File
@@ -43,9 +43,6 @@ issues:
exclude-use-default: false
exclude-rules:
- path: lotuspond
linters:
- errcheck
- path: node/modules/lp2p
linters:
+305 -13
View File
@@ -1,5 +1,295 @@
# Lotus changelog
# 1.18.2 / 2022-12-10
This is an OPTIONAL patch release that fixes a recently reported bug, where the miner process crashes due to a panic during an AddPiece process. More details can be found [here](https://github.com/filecoin-project/lotus/pull/9822).
# 1.18.1 / 2022-11-28
This is a small OPTIONAL patch release for the mandatory v1.18.0 release that supports the Filecoin nv17 Shark Upgrade.
We highly recommend you to read the full [v1.18.0 release note](https://github.com/filecoin-project/lotus/releases/tag/v1.18.0) if you haven't already.
Note to SPs:
If you are running into issue with updating your miner node from an earlier release and is failing to restart your miner, check your `journalctl` and see if you noticed the following error:
```
New sector storage: <%d>
Nov 19 15:03:43 g0lotus01 lotus-miner[<id>]: ERROR: creating node: starting node: could not build arguments for function "reflect".makeFuncStub (/usr/local/go/src/reflect/asm_amd64.s:28): failed to build *paths.Local: received non-nil error from function "reflect".makeFuncStub (/usr/local/go/src/reflect/asm_amd64.s:28): opening path /media/data1/lotusstorage: path with ID <%d> already opened: '<path>'
```
If so, this check is introduced via [#9032](https://github.com/filecoin-project/lotus/pull/9032), precisely this [line](https://github.com/filecoin-project/lotus/blame/master/storage/paths/local.go#L164-L166
). It's added to prevents double-attaching paths given it's now possible to manipulate paths at runtime. Verify storage.json configs if you encounter this error or remove the undesired depulicated path as you see fit accordingly.
## Bug Fixes
- fix: cli: check found before dereferencing SectorInfo #9703
# 1.18.0 / 2022-11-15
> ⚠️ **Please note that from Lotus v1.17.2&^ will require a Go-version of v1.18.1&^**
This is the final release of the upcoming MANDATORY release of Lotus that introduces [Filecoin network v17,
codenamed the Shark upgrade](https://github.com/filecoin-project/community/discussions/74?sort=top#discussioncomment-3825422). Shark upgrade delivers a wave of protocol refinements that will allow for useful smart contracts to be written using the FVM (eg. programmable markets, lending contracts, etc.).
**The Filecoin mainnet is scheduled to upgrade to nv17 at epoch 2383680, on Nov 30th on 2022-11-30T14:00:00Z. All node operators, including storage providers, must upgrade to this release before that time. Storage providers must update their daemons, miners, market and worker(s)/boost.**
The Shark upgrade introduces the following FIPs, delivered in [actors v9](https://github.com/filecoin-project/builtin-actors/releases/tag/v9.0.3):
- [FIP0029 Beneficiary Address for Storage Providers](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0029.md): step towards better lending market for SP
- [FIP0034 Fix PreCommit Deposit Independent of Sector Content](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0034.md): resolves a significant weakening of Filecoin PoReps security guarantees
- ❗Pre-commit deposit will be calculated as the 20-day projection of expected reward earned by a sector with **a sector quality of 10 (i.e. full of verified deals)**, regardless of sector content. The Initial Pledge value, due when the sector is proven, is left **unchanged**.
- [FIP0041 Forward Compatibility for PreCommit](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0041.md): enables a cleaner and easier transition to Programmable Storage Markets
- [FIP0044 Standard Message Authentication](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0044.md): enable metadata authentication for user defined actor
- [FIP0045 Decoupling Fil+ from Marketplace](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0045.md): DataCap and the 10x QAP is now only associated with how long DATA is wanted to be stored on the network.
- This is a transitional state to enabling far more efficient and dynamic storage markets on Filecoin network in the future.
- ⭐️ First Fungible Token Contract - Datacap Actor, on Filecoin! ([fungible token standard](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0046.md), [token contract library](https://github.com/helix-onchain/filecoin/tree/5455f4f831e0f3f20005a9a789623d7ad6dada15/frc46_token)).
- For storage deal participants (clients and storage providers):
- `PublishStorageDeals`/`ProveCommit(Aggregate)`/`ProveReplicaUpdates` message that includes verified deals will see a gas usage increase, more details can be found [here](https://github.com/filecoin-project/FIPs/blob/385f069b3b146c5fef4fdc1109a0e2f35f399e48/FIPS/fip-0045.md?plain=1#L784)
- `Term` is introduced for defining how long the DataCap is assigned to a piece of data. Anyone who cares about that piece of data may extend the _term_, which incentives SPs to store the data longer on the network without a new deal/resealing.
- There is no more diluted verified deal QAP due to deal/sector space time for new sectors that contains verified deals after this upgrade.
- SPs may enjoy 90 days of extra QAP than deal duration by default, given `term_max` is always `deal duration + 90 days`.
❗ We highly recommend all lotus users, especially storage providers, developers and clients to read the FIPs in detail to understand the protocol changes and potential impact to network participants!
## Snapshots
The [#fil-infra](https://filecoinproject.slack.com/archives/C039RBG3RPC) team at PL has launched a brand new Lightweight Filecoin Chain Snapshots Service to support chain management needs for the node operators, check [here](https://www.notion.so/pl-strflt/Lightweight-Filecoin-Chain-Snapshots-17e4c386f35c44548f5863afb7b5e024) for the full detail.
We are planning to switch [the snapshot service listed in lotus docs](https://lotus.filecoin.io/lotus/manage/chain-management/#lightweight-snapshot) to the new Lightweight Filecoin Chain Snapshots Service by EOY, and deprecate public support of the current snapshots production. We recommend all users to test and switch the new service ASAP, and if you run into any issue, please report them [here](https://github.com/filecoin-project/filecoin-chain-archiver/discussions/new?category=feedback) and the team would be happy to support you! For the main differences between the old & the new service, checkout the FAQ section [here](https://www.notion.so/pl-strflt/Lightweight-Filecoin-Chain-Snapshots-17e4c386f35c44548f5863afb7b5e024)
## Migration
We are expecting a heavier than normal state migration for this upgrade due to the amount of the state changes introduced.
All node operators, including storage providers, should be aware that two pre-migrations are being scheduled. The first pre-migration will begin at 2022-11-30T12:00:00Z (120 minutes before the real upgrade), the second pre-migration will begin at 2022-11-30T13:45:00Z (7.5 minutes before the real upgrade).
The first pre-migration will take up to 1.5hr, depending on the amount of the historical state in the node blockstore and the hardware specs the node is running on. During this time, expect slower block validation times, increased CPU and memory usage, and longer delays for API queries.
We recommend node operators (who haven't enbabled splistore `universal` mode) that do not care about historical chain states, to prune the chain blockstore by syncing from a snapshot 1-2 days before the upgrade.
Note to full archival node operators: you may expect a migration that takes up to 20 min upon the upgrade, during this period your node will fall out of sync and your chain service may have some disruption. However, you can expect the node to catch up soon after the migration completes.
### v9 Built-in actor bundles
Bundles for all networks(mainnet, calibnet, and etc) are included in the lotus source tree (`build/actors/`) and embedded on build, for v9 actors you can find it [here](https://github.com/filecoin-project/lotus/blob/master/build/actors/v9.tar.zst).
Reminder: Lotus verifies that the bundle CIDs are the right ones upon build & upgrade against the values in `build/builtin_actors_gen.go`, according to the network you are building. You may also check the bundle manifest CID matches the bundle gen-ed values by running `lotus state actor-cids --network-version 17`.
The manifest CID & full list of actor code CIDs for nv17 using [actor v9](https://github.com/filecoin-project/builtin-actors/releases/tag/v9.0.3) is:
```
"_manifest": "bafy2bzaceb6j6666h36xnhksu3ww4kxb6e25niayfgkdnifaqi6m6ooc66i6i"
"account": "bafk2bzacect2p7urje3pylrrrjy3tngn6yaih4gtzauuatf2jllk3ksgfiw2y"
"cron": "bafk2bzacebcec3lffmos3nawm5cvwehssxeqwxixoyyfvejy7viszzsxzyu26"
"datacap": "bafk2bzacebb6uy2ys7tapekmtj7apnjg7oyj4ia5t7tlkvbmwtxwv74lb2pug"
"init": "bafk2bzacebtdq4zyuxk2fzbdkva6kc4mx75mkbfmldplfntayhbl5wkqou33i"
"multisig": "bafk2bzacec4va3nmugyqjqrs3lqyr2ij67jhjia5frvx7omnh2isha6abxzya"
"paymentchannel": "bafk2bzacebhdvjbjcgupklddfavzef4e4gnkt3xk3rbmgfmk7xhecszhfxeds"
"reward": "bafk2bzacebezgbbmcm2gbcqwisus5fjvpj7hhmu5ubd37phuku3hmkfulxm2o"
"storagemarket": "bafk2bzacec3j7p6gklk64stax5px3xxd7hdtejaepnd4nw7s2adihde6emkcu"
"storageminer": "bafk2bzacedyux5hlrildwutvvjdcsvjtwsoc5xnqdjl73ouiukgklekeuyfl4"
"storagepower": "bafk2bzacedsetphfajgne4qy3vdrpyd6ekcmtfs2zkjut4r34cvnuoqemdrtw"
"system": "bafk2bzaceagvlo2jtahj7dloshrmwfulrd6e2izqev32qm46eumf754weec6c"
"verifiedregistry": "bafk2bzacecf3yodlyudzukumehbuabgqljyhjt5ifiv4vetcfohnvsxzynwga"
```
## New Features
- Integrate actor v9:
- test: Add invariance checks to v17 migration test ([filecoin-project/lotus#9454](https://github.com/filecoin-project/lotus/pull/9454))
- Implement and support [FIP0045 Decoupling Fil+ from Marketplace](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0045.md):
- fix: state: add datacap actor to actors registry ([filecoin-project/lotus#9476](https://github.com/filecoin-project/lotus/pull/9476))
- feat: actors: Integrate builtin-actors changes for FIP-0045 ([filecoin-project/lotus#9355](https://github.com/filecoin-project/lotus/pull/9355))
- feat: actors: Integrate datacap actor into lotus (#9348) ([filecoin-project/lotus#9348](https://github.com/filecoin-project/lotus/pull/9348))
- feat: cli: Add commands for listing allocations and removing expired allocations ([filecoin-project/lotus#9468](https://github.com/filecoin-project/lotus/pull/9468))
- feat: sealing pipeline: Prepare deal assigning logic for FIP-45 ([filecoin-project/lotus#9412](https://github.com/filecoin-project/lotus/pull/9412))
- feat: add API methods to get allocations and claims ([filecoin-project/lotus#9437](https://github.com/filecoin-project/lotus/pull/9437))
- Implement and support [FIP0029 Beneficiary Address for Storage Providers](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0029.md)
- feat: api/cli: beneficiary withdraw api and cli #9296
- feat: api/cli: change beneficiary propose and confirm for actors and multisigs. #9307
## Improvements
- feat: wdpost: Add ability to only have single partition per msg for partitions with recovery sectors ([filecoin-project/lotus#9427](https://github.com/filecoin-project/lotus/pull/9427))
- feat: API: support typed errors over RPC ([filecoin-project/lotus#9061](https://github.com/filecoin-project/lotus/pull/9061))
- feat: refactor: remove NewestNetworkVersion ([filecoin-project/lotus#9351](https://github.com/filecoin-project/lotus/pull/9351))
- chore: actors: Allow builtin-actors to return a map of methods (#9342) ([filecoin-project/lotus#9342](https://github.com/filecoin-project/lotus/pull/9342))
## Dependencies
- Update FFI ([filecoin-project/lotus#9484](https://github.com/filecoin-project/lotus/pull/9484))
- chore: deps: update go-state-types and builtin-actors for v9 release ([filecoin-project/lotus#9485](https://github.com/filecoin-project/lotus/pull/9485))
- deps: backport: #9455 ([filecoin-project/lotus#9463](https://github.com/filecoin-project/lotus/pull/9463))
- Deps: Update go-fil-markets to 1.24.0-v17 ([filecoin-project/lotus#9450](https://github.com/filecoin-project/lotus/pull/9450))
- github.com/filecoin-project/go-jsonrpc (v0.1.7 -> v0.1.8)
- github.com/filecoin-project/go-state-types (v0.1.12-beta -> v0.9.0):
## Others
- fix: upgrade: no splash banner for nv17 :( ([filecoin-project/lotus#9486](https://github.com/filecoin-project/lotus/pull/9486))
- chore: build: add calib upgrade param for shark ([filecoin-project/lotus#9483](https://github.com/filecoin-project/lotus/pull/9483))
- chore: update butterfly artifacts ([filecoin-project/lotus#9467](https://github.com/filecoin-project/lotus/pull/9467))
- chore: butterfly: update assets ([filecoin-project/lotus#9462](https://github.com/filecoin-project/lotus/pull/9462))
- Delete lotus-pond (#9352) ([filecoin-project/lotus#9352](https://github.com/filecoin-project/lotus/pull/9352))
- build: set version to v1.18.0-dev
## lotus-market EOL notice
As mentioned in [lotus v1.17.0 release notes](https://github.com/filecoin-project/lotus/releases/tag/v1.17.0), markets related features, enhancements and fixes is now lower priority for Lotus. We recommend our users to migrate to other deal making focused software, like [boost](https://boost.filecoin.io/) as soon as possible. That being said, the lotus maintainers will be:
- Lotus maintainers will stop supporting lotus-market subcomponent/**storage** deal making related issues or enhancements on Jan 31, 2023.
- In Q2 2023, we will be deprecating/removing lotus-market related code from this repository.
If you have any questions or concerns, please raise them in [Lotus discussion](https://github.com/filecoin-project/lotus/discussions/categories/market)!
## Contributors
| Contributor | Commits | Lines ± | Files Changed |
|-------------|---------|---------|---------------|
| @geoff-vball | 73 | +14533/-19712 | 509 |
| @arajasek | 16 | +2230/-303 | 49 |
| @arajasek | 29 | +701/-297 | 117 |
| @magik6k | 5 | +429/-135 | 45 |
| @Frrist | 1 | +246/-203 | 25 |
| @stebalien | 2 | +323/-2 | 6 |
| @shrenujbansal | 3 | +176/-61 | 10 |
| @ZenGround0 | 2 | +78/-38 | 5 |
| @jennijuju | 8 | +97/-18 | 16 |
| @simlecode | 5 | +18/-9 | 11 |
| Kevin Li | 1 | +7/-0 | 1 |
| @zenground0 | 2 | +3/-3 | 3 |
| @jennijuju | 1 | +3/-3 | 2 |
| Rod Vagg | 1 | +3/-2 | 2 |
| @jennijuju | 1 | +2/-2 | 2 |
| Peter Rabbitson | 1 | +3/-0 | 1 |
| Jakub Sztandera | 1 | +1/-1 | 1 |
# v1.17.2 / 2022-10-05
This is an OPTIONAL release of Lotus. This feature release introduces new sector number management APIs in Lotus that enables all the Sealing-as-a-Service and Lotus interactions needed to function. The default propagation delay setting for storage providers has also been changed, as well as numerous other features and enhancements. Check out the sub-bullet points in the feature and enhancement section to get a short description about each feature and enhancements.
### Highlights
🦭 **SaaS** 🦭
New sector management APIs makes it possible to import partially sealed sectors into Lotus. This release implements all SaaS<->Lotus interactions needed for such services to work. Deep dive into the new APIs here: https://github.com/filecoin-project/lotus/discussions/9079#discussioncomment-3652044
**Propagation delay** ⌛️
In v1.17.2 the default PropagationDelay has been raised from 6 seconds -> 10 seconds, and you can tune this yourself with the `PROPAGATION_DELAY_SECS` environment variable. This means you will now wait for 10 seconds for other blocks to arrive from the network before computing a winningPoSt (if eligible). In your `lotus-miner` logs that means you will see this "baseDeltaSeconds": 10 as default.
⚠️ **Please note that Lotus v1.17.2 will require a Go-version of v1.18.1 or higher!**
## New features
- feat: sealing: Partially sealed sector import ([filecoin-project/lotus#9210](https://github.com/filecoin-project/lotus/pull/9210))
- Implements support for importing (partially) sealed sectors which is needed for enabling external sealing services.
- feat: sealing: Use bitfields to manage sector numbers ([filecoin-project/lotus#9183](https://github.com/filecoin-project/lotus/pull/9183))
- Needed for Sealing-as-a-Service. Move sector number assigning logic to use stored bitfields instead of stored counters. Makes it possible to reserve ranges of sector numbers, see the sector assigner state and view sector number reservations.
- feat: env: propagation delay ([filecoin-project/lotus#9290](https://github.com/filecoin-project/lotus/pull/9290))
- The default propagation delay is raised to 10 seconds from 6 seconds. Ability to set it yourself with the `PROPAGATION_DELAY_SECS` environment variable.
- feat: cli: lotus info cmd ([filecoin-project/lotus#9233](https://github.com/filecoin-project/lotus/pull/9233))
- A new `lotus info` command that prints useful node information in one place.
- feat: proving: Introduce manual sector fault recovery (#9144) ([filecoin-project/lotus#9144](https://github.com/filecoin-project/lotus/pull/9144))
- Allow users to declare fault recovery messages manually with the `lotus-miner proving recover-faults` command, rather than waiting for it to happen automatically before windowPost.
- feat: api: Reintroduce StateActorManifestCID ([filecoin-project/lotus#9201](https://github.com/filecoin-project/lotus/pull/9201))
- Adds ability to retrieve the Actor Manifest CID through the api.
- feat: message: Add uuid to mpool message sent to chain node from miner ([filecoin-project/lotus#9174](https://github.com/filecoin-project/lotus/pull/9174))
- Adds a UUID to each message sent by the `lotus-miner` to the daemon. A requirement needed for https://github.com/filecoin-project/lotus/issues/9130
- feat: message: Add retries to mpool push message from lotus-miner ([filecoin-project/lotus#9177](https://github.com/filecoin-project/lotus/pull/9177))
- Retries to mpool push message API in case of unavailability of the lotus chain node.
**Network 17 related features :**
- feat: network: add nv17 and integrate the corresponding go state type ([filecoin-project/lotus#9267](https://github.com/filecoin-project/lotus/pull/9267))
- feat: cli: print beneficiary info in state miner-info ([filecoin-project/lotus#9308](https://github.com/filecoin-project/lotus/pull/9308))
- feat: api/cli: change beneficiary propose and confirm for actors and multisigs. ([filecoin-project/lotus#9307](https://github.com/filecoin-project/lotus/pull/9307))
- feat: api/cli: beneficiary withdraw api and cli ([filecoin-project/lotus#9296](https://github.com/filecoin-project/lotus/pull/9296))
## Enhancements
- feat: sectors renew --only-cc ([filecoin-project/lotus#9184](https://github.com/filecoin-project/lotus/pull/9184))
- Exlude extending deal-related sectors with the `--only-cc` option when using the `lotus-miner sectors renew`
- feat: miner: display updated & update-cache for storage list ([filecoin-project/lotus#9323](https://github.com/filecoin-project/lotus/pull/9323))
- Show amount of `updated` & `update-cache` sectors in each storage path in the `lotus-miner storage list` output
- feat: add descriptive errors to markets event handler ([filecoin-project/lotus#9326](https://github.com/filecoin-project/lotus/pull/9326))
- More descriptive market error logs
- feat: cli: Add option to terminate sectors from worker address ([filecoin-project/lotus#9291](https://github.com/filecoin-project/lotus/pull/9291))
- Adds a flag to allow either owner address or worker address to send terminate sectors message.
- fix: cli: actor-cids cli command now defaults to current network ([filecoin-project/lotus#9321](https://github.com/filecoin-project/lotus/pull/9321))
- Makes the command defaults to the current network.
- fix: ux: Output bytes in `lotus client commP` cmd ([filecoin-project/lotus#9189](https://github.com/filecoin-project/lotus/pull/9189))
- Adds an additional line that outputs bytes in the `lotus client commP` command.
- fix: sealing: Add information on what worker a job was assigned to in logs ([filecoin-project/lotus#9151](https://github.com/filecoin-project/lotus/pull/9151))
- Adds the worker hostname into the assignment logs.
- refactor: sealing pipeline: Remove useless storage adapter code ([filecoin-project/lotus#9142](https://github.com/filecoin-project/lotus/pull/9142)
- Remove proxy code in `storage/miner.go` / `storage/miner_sealing.go`, call the pipeline directly instead.
## Bug fixes
- fix: ffiwrapper: Close readers in AddPiece ([filecoin-project/lotus#9328](https://github.com/filecoin-project/lotus/pull/9328))
- fix: sealing: Drop unused PreCommitInfo from pipeline.SectorInfo ([filecoin-project/lotus#9325](https://github.com/filecoin-project/lotus/pull/9325))
- fix: cli: fix panic in `lotus-miner actor control list` ([filecoin-project/lotus#9241](https://github.com/filecoin-project/lotus/pull/9241))
- fix: sealing: Abort upgrades in sectors with no deals ([filecoin-project/lotus#9310](https://github.com/filecoin-project/lotus/pull/9310))
- fix: sealing: Make DataCid resource env vars make more sense ([filecoin-project/lotus#9231](https://github.com/filecoin-project/lotus/pull/9231))
- fix: cli: Option to specify --from msg sender ([filecoin-project/lotus#9237](https://github.com/filecoin-project/lotus/pull/9237))
- fix: ux: better ledger rejection error ([filecoin-project/lotus#9242](https://github.com/filecoin-project/lotus/pull/9242))
- fix: ux: msg receipt for actor withdrawal ([filecoin-project/lotus#9155](https://github.com/filecoin-project/lotus/pull/9155))
- fix: ux: exclude negative available balance from spendable amount ([filecoin-project/lotus#9182](https://github.com/filecoin-project/lotus/pull/9182))
- fix: sealing: Avoid panicking in handleUpdateActivating on startup ([filecoin-project/lotus#9331](https://github.com/filecoin-project/lotus/pull/9331))
- fix: api: DataCid - ensure reader is closed ([filecoin-project/lotus#9230](https://github.com/filecoin-project/lotus/pull/9230))
- fix: verifreg: serialize RmDcProposalID as int, not tuple ([filecoin-project/lotus#9206](https://github.com/filecoin-project/lotus/pull/9206))
- fix: api: Ignore uuid check for messages with uuid not set ([filecoin-project/lotus#9303](https://github.com/filecoin-project/lotus/pull/9303))
- fix: cgroupV1: memory.memsw.usage_in_bytes: no such file or directory ([filecoin-project/lotus#9202](https://github.com/filecoin-project/lotus/pull/9202))
- fix: miner: init miner's with 32GiB sectors by default ([filecoin-project/lotus#9364](https://github.com/filecoin-project/lotus/pull/9364))
- fix: worker: Close all storage paths on worker shutdown ([filecoin-project/lotus#9153](https://github.com/filecoin-project/lotus/pull/9153))
- fix: build: set PropagationDelaySecs correctly ([filecoin-project/lotus#9358](https://github.com/filecoin-project/lotus/pull/9358))
- fix: renew --only-cc with sectorfile ([filecoin-project/lotus#9428](https://github.com/filecoin-project/lotus/pull/9428))
## Dependency updates
- github.com/filecoin-project/go-fil-markets (v1.23.1 -> v1.24.0)
- github.com/filecoin-project/go-jsonrpc (v0.1.5 -> v0.1.7)
- github.com/filecoin-project/go-state-types (v0.1.10 -> v0.1.12-beta)
- github.com/filecoin-project/go-commp-utils/nonffi (null -> v0.0.0-20220905160352-62059082a837)
- deps: go-libp2p-pubsub v0.8.0 ([filecoin-project/lotus#9229](https://github.com/filecoin-project/lotus/pull/9229))
- deps: libp2p v0.22 ([filecoin-project/lotus#9216](https://github.com/filecoin-project/lotus/pull/9216))
- deps: Use latest cbor-gen ([filecoin-project/lotus#9335](https://github.com/filecoin-project/lotus/pull/9335))
- chore: update bitswap and some libp2p packages ([filecoin-project/lotus#9279](https://github.com/filecoin-project/lotus/pull/9279))
## Others
- chore: merge releases into master after v1.17.1 release ([filecoin-project/lotus#9283](https://github.com/filecoin-project/lotus/pull/9283))
- chore: docs: Fix dead links to docs.filecoin.io ([filecoin-project/lotus#9304](https://github.com/filecoin-project/lotus/pull/9304))
- chore: deps: update FFI ([filecoin-project/lotus#9330](https://github.com/filecoin-project/lotus/pull/9330))
- chore: seed: add cmd for adding signers to rkh to genesis ([filecoin-project/lotus#9198](https://github.com/filecoin-project/lotus/pull/9198))
- chore: fix typo in comment ([filecoin-project/lotus#9161](https://github.com/filecoin-project/lotus/pull/9161))
- chore: cli: cleanup and standardize cli ([filecoin-project/lotus#9317](https://github.com/filecoin-project/lotus/pull/9317))
- chore: versioning: Bump version to v1.17.2-dev ([filecoin-project/lotus#9147](https://github.com/filecoin-project/lotus/pull/9147))
- chore: release: v1.17.2-rc1 ([filecoin-project/lotus#9339](https://github.com/filecoin-project/lotus/pull/9339))
- feat: shed: add a --max-size flag to vlog2car ([filecoin-project/lotus#9212](https://github.com/filecoin-project/lotus/pull/9212))
- fix: docsgen: revert rename of API Name to Num ([filecoin-project/lotus#9315](https://github.com/filecoin-project/lotus/pull/9315))
- fix: ffi: Revert accidental filecoin-ffi downgrade from #9144 ([filecoin-project/lotus#9277](https://github.com/filecoin-project/lotus/pull/9277))
- fix: miner: Call SyncBasefeeCheck from `lotus info` ([filecoin-project/lotus#9281](https://github.com/filecoin-project/lotus/pull/9281))
- fix: mock sealer: grab lock in ReadPiece ([filecoin-project/lotus#9207](https://github.com/filecoin-project/lotus/pull/9207))
- refactor: use `os.ReadDir` for lightweight directory reading ([filecoin-project/lotus#9282](https://github.com/filecoin-project/lotus/pull/9282))
- tests: cli: Don't panic with no providers in client retrieve ([filecoin-project/lotus#9232](https://github.com/filecoin-project/lotus/pull/9232))
- build: artifacts: butterfly ([filecoin-project/lotus#9027](https://github.com/filecoin-project/lotus/pull/9027))
- build: Use lotus snap (and fix typo) for packer builds ([filecoin-project/lotus#9152](https://github.com/filecoin-project/lotus/pull/9152))
- build: Update xcode version for macos builds ([filecoin-project/lotus#9170](https://github.com/filecoin-project/lotus/pull/9170))
- ci: build: Snap daemon autorun disable ([filecoin-project/lotus#9167](https://github.com/filecoin-project/lotus/pull/9167))
- ci: Use golang 1.18.1 to build appimage ([filecoin-project/lotus#9389](https://github.com/filecoin-project/lotus/pull/9389))
- ci: Don't publish new homebrew releases for RC builds ([filecoin-project/lotus#9350](https://github.com/filecoin-project/lotus/pull/9350))
- Merge branch 'deps/go-libp2p-v0.21'
Contributors
| Contributor | Commits | Lines ± | Files Changed |
|-------------|---------|---------|---------------|
| Aayush Rajasekaran | 8 | +23010/-2122 | 109 |
| Aayush | 15 | +6168/-2679 | 360 |
| Łukasz Magiera | 69 | +6462/-2137 | 606 |
| Geoff Stuart | 19 | +3080/-1177 | 342 |
| Marco Munizaga | 16 | +543/-424 | 41 |
| Shrenuj Bansal | 30 | +485/-419 | 88 |
| LexLuthr | 3 | +498/-12 | 19 |
| Phi | 15 | +330/-70 | 17 |
| Jennifer Wang | 7 | +132/-12 | 11 |
| TippyFlitsUK | 1 | +43/-45 | 12 |
| Steven Allen | 1 | +18/-28 | 2 |
| Frrist | 1 | +19/-11 | 2 |
| Eng Zer Jun | 1 | +14/-11 | 6 |
| Dirk McCormick | 2 | +23/-1 | 3 |
| Ian Davis | 3 | +7/-9 | 3 |
| Masih H. Derkani | 1 | +11/-0 | 1 |
| Anton Evangelatov | 1 | +11/-0 | 1 |
| Yu | 2 | +4/-4 | 5 |
| Hannah Howard | 1 | +4/-4 | 1 |
| Phi-rjan | 1 | +1/-2 | 1 |
| Jiaying Wang | 1 | +3/-0 | 1 |
| nujz | 1 | +1/-1 | 1 |
| Rob Quist | 1 | +1/-1 | 1 |
# v1.17.1 / 2022-09-06
This is an optional release of Lotus. This release introduces the [Splitstore v2 - beta](https://github.com/filecoin-project/lotus/blob/master/blockstore/splitstore/README.md)(beta). Splitstore aims to reduce the node performance impact that's caused by the Filecoin's very large, and continuously growing datastore. Splitstore v2 introduces the coldstore auto prune/GC feature & some improvements for the hotstore. We welcome all lotus users to join the early testers and try the new Splitstore out, you can leave any feedback or report issues in [this discussion](https://github.com/filecoin-project/lotus/discussions/9179) or create an issue. As always, multiple small bug fixes, new features & improvements are also included in this release.
@@ -103,6 +393,8 @@ Contributors
| Aloxaf | 1 | +2/-2 | 1 |
# Lotus changelog
# v1.17.0 / 2022-08-02
This is an optional release of Lotus. This feature release introduces a lot of new sealing and scheduler improvements, and many other functionalities and bug fixes.
@@ -471,7 +763,7 @@ This is an optional release of lotus that include new APIs, some improvements an
This is a highly recommended feature lotus release v1.15.2. This feature release introduces many new features and for SPs, including PoSt workers, sealing scheduler, snap deal queue and so on.
Note: You need to be using go v1.17.9&up from this release onwards.
Note: You need to be using go v1.18.1&up from this release onwards.
## Highlights
### ❣️❣️❣️ PoSt Workers ❣️❣️❣️
@@ -1439,7 +1731,7 @@ storage providers and clients.
## Highlights
- 🌟🌟🌟 Introduce Dagstore and CARv2 for deal-making (#6671) ([filecoin-project/lotus#6671](https://github.com/filecoin-project/lotus/pull/6671))
- **[lotus miner markets' Dagstore](https://docs.filecoin.io/mine/lotus/dagstore/#conceptual-overview)** is a
- **[lotus miner markets' Dagstore](https://lotus.filecoin.io/storage-providers/operate/dagstore/)** is a
component of the `markets` subsystem in lotus-miner. It is a sharded store to hold large IPLD graphs efficiently,
packaged as location-transparent attachable CAR files and it replaces the former Badger staging blockstore. It
is designed to provide high efficiency and throughput, and minimize resource utilization during deal-making operations.
@@ -1447,18 +1739,18 @@ storage providers and clients.
blockstores, which are served as the direct medium for data exchanges in markets for both storage and retrieval
deal making without requiring intermediate buffers.
- In the future, lotus will leverage and interact with Dagstore a lot for new features and improvements for deal
making, therefore, it's highly recommended to lotus users to go through [Lotus Miner: About the markets dagstore](https://docs.filecoin.io/mine/lotus/dagstore/#conceptual-overview) thoroughly to learn more about Dagstore's
making, therefore, it's highly recommended to lotus users to go through [Lotus Miner: About the markets dagstore](https://lotus.filecoin.io/storage-providers/operate/dagstore/) thoroughly to learn more about Dagstore's
conceptual overview, terminology, directory structure, configuration and so on.
- **Note**:
- When you first start your lotus-miner or market subsystem with this release, a one-time/first-time **dagstore migration** will be triggered which replaces the former Badger staging blockstore with dagstore. We highly
recommend storage providers to read this [section](https://docs.filecoin.io/mine/lotus/dagstore/#first-time-migration) to learn more about
recommend storage providers to read this [section](https://lotus.filecoin.io/storage-providers/operate/dagstore/#first-time-migration) to learn more about
what the process does, what to expect and how monitor it.
- It is highly recommended to **wait all ongoing data transfer to finish or cancel inbound storage deals that
are still transferring**, using the `lotus-miner data-transfers cancel` command before upgrade your market nodes. Reason being that the new dagstore changes attributes in the internal deal state objects, and the paths to the staging CARs where the deal data was being placed will be lost.
- ‼️Having your dags initialized will become important in the near feature for you to provide a better storage
and retrieval service. We'd suggest you to start [forced bulk initialization] soon if possible as this process
places relatively high IP workload on your storage system and is better to be carried out gradually and over a
longer timeframe. Read how to do properly perform a force bulk initialization [here](https://docs.filecoin.io/mine/lotus/dagstore/#forcing-bulk-initialization).
longer timeframe. Read how to do properly perform a force bulk initialization [here](https://lotus.filecoin.io/storage-providers/operate/dagstore/#forcing-bulk-initialization).
- ⏮ Rollback Alert(from v1.11.2-rcX to any version lower): If a storages deal is initiated with M1/v1.11.2(-rcX)
release, it needs to get to the `StorageDealAwaitingPrecommit` state before you can do a version rollback or the markets process may panic.
- 💙 **Special thanks to [MinerX fellows for testing and providing valuable feedbacks](https://github.com/filecoin-project/lotus/discussions/6852) for Dagstore in the past month!**
@@ -1588,8 +1880,8 @@ Contributors
This is a **highly recommended** but optional Lotus v1.11.1 release that introduces many deal making and datastore improvements and new features along with other bug fixes.
## Highlights
- ⭐️⭐️⭐️[**lotus-miner market subsystem**](https://docs.filecoin.io/mine/lotus/split-markets-miners/#frontmatter-title) is introduced in this release! It is **highly recommended** for storage providers to run markets processes on a separate machine! Doing so, only this machine needs to exposes public ports for deal making. This also means that the other miner operations can now be completely isolated by from the deal making processes and storage providers can stop and restarts the markets process without affecting an ongoing Winning/Window PoSt!
- More details on the concepts, architecture and how to split the market process can be found [here](https://docs.filecoin.io/mine/lotus/split-markets-miners/#concepts).
- ⭐️⭐️⭐️[**lotus-miner market subsystem**](https://lotus.filecoin.io/storage-providers/advanced-configurations/split-markets-miners/) is introduced in this release! It is **highly recommended** for storage providers to run markets processes on a separate machine! Doing so, only this machine needs to exposes public ports for deal making. This also means that the other miner operations can now be completely isolated by from the deal making processes and storage providers can stop and restarts the markets process without affecting an ongoing Winning/Window PoSt!
- More details on the concepts, architecture and how to split the market process can be found [here](https://lotus.filecoin.io/storage-providers/advanced-configurations/split-markets-miners/#concepts).
- Base on your system setup(running on separate machines, same machine and so on), please see the suggested practice by community members [here](https://github.com/filecoin-project/lotus/discussions/7047#discussion-3515335).
- Note: if you are running lotus-worker on a different machine, you will need to set `MARKETS_API_INFO` for certain CLI to work properly. This will be improved by #7072.
- Huge thanks to MinerX fellows for [helping testing the implementation, reporting the issues so they were fixed by now and providing feedbacks](https://github.com/filecoin-project/lotus/discussions/6861) to user docs in the past three weeks!
@@ -1599,7 +1891,7 @@ This is a **highly recommended** but optional Lotus v1.11.1 release that introd
- `AvailableBalanceBuffer`: minimum available balance to keep in the miner actor before sending it with messages, default is 0FIL.
- `DisableCollateralFallback`: whether to send collateral with messages even if there is no available balance in the miner actor, default is `false`.
- Config for deal publishing control addresses ([filecoin-project/lotus#6697](https://github.com/filecoin-project/lotus/pull/6697))
- Set `DealPublishControl` to set the wallet used for sending `PublishStorageDeals` messages, instructions [here](https://docs.filecoin.io/mine/lotus/miner-addresses/#control-addresses).
- Set `DealPublishControl` to set the wallet used for sending `PublishStorageDeals` messages, instructions [here](https://lotus.filecoin.io/storage-providers/operate/addresses/#control-addresses).
- Config UX improvements ([filecoin-project/lotus#6848](https://github.com/filecoin-project/lotus/pull/6848))
- You can now preview the the default and updated node config by running `lotus/lotus-miner config default/updated`
@@ -2028,7 +2320,7 @@ Note that this release is built on top of Lotus v1.9.0. Enterprising users can u
FIPs [0008](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0008.md) and [0013](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0013.md) combine to allow for a significant increase in the rate of onboarding storage on the Filecoin network. This aims to lead to more useful data being stored on the network, reduced network congestion, and lower network base fee.
**Check out the documentation [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#precommitsectorsbatch) for details on the new Lotus miner sealing config options, [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#fees-section) for fee config options, and explanations of the new features.**
**Check out the documentation [here]((https://lotus.filecoin.io/storage-providers/advanced-configurations/sealing/#precommitsectorsbatch) for details on the new Lotus miner sealing config options, [here](https://lotus.filecoin.io/storage-providers/setup/configuration/#fees-section) for fee config options, and explanations of the new features.**
Note:
- We recommend to keep `PreCommitSectorsBatch` as 1.
@@ -2044,7 +2336,7 @@ Given these assumptions:
- We'd expect a network storage growth rate of around 530PiB per day. 😳 🎉 🥳 😅
- We'd expect network bandwidth dedicated to `SubmitWindowedPoSt` to grow by about 0.02% per day.
- We'd expect the [state-tree](https://spec.filecoin.io/#section-systems.filecoin_vm.state_tree) (and therefore [snapshot](https://docs.filecoin.io/get-started/lotus/chain/#lightweight-snapshot)) size to grow by 1.16GiB per day.
- We'd expect the [state-tree](https://spec.filecoin.io/#section-systems.filecoin_vm.state_tree) (and therefore [snapshot](https://lotus.filecoin.io/lotus/manage/chain-management/#lightweight-snapshot)) size to grow by 1.16GiB per day.
- Nearly all of the state-tree growth is expected to come from new sector metadata.
- We'd expect the daily lotus datastore growth rate to increase by about 10-15% (from current ~21GiB/day).
- Most "growth" of the lotus datastore is due to "churn", historical data that's no longer referenced by the latest state-tree.
@@ -2065,7 +2357,7 @@ Included in the HyperDrive upgrade is [FIP-0015](https://github.com/filecoin-pro
- Implement FIP-0015 ([filecoin-project/lotus#6361](https://github.com/filecoin-project/lotus/pull/6361))
- Integrate FIP0013 and FIP0008 ([filecoin-project/lotus#6235](https://github.com/filecoin-project/lotus/pull/6235))
- [Configuration docs and cli examples](https://docs.filecoin.io/mine/lotus/miner-configuration/#precommitsectorsbatch)
- [Configuration docs and cli examples](https://lotus.filecoin.io/storage-providers/advanced-configurations/sealing/#precommitsectorsbatch)
- [cli docs](https://github.com/filecoin-project/lotus/blob/master/documentation/en/cli-lotus-miner.md#lotus-miner-sectors-batching)
- Introduce gas prices for aggregate verifications ([filecoin-project/lotus#6347](https://github.com/filecoin-project/lotus/pull/6347))
- Introduce v5 actors ([filecoin-project/lotus#6195](https://github.com/filecoin-project/lotus/pull/6195))
@@ -2383,7 +2675,7 @@ Note that this release does NOT set an upgrade epoch for v3 actors to take effec
- [#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).
- Added `PublishMsgPeriod` and `MaxDealsPerPublishMsg` to miner `Dealmaking` [configuration](https://lotus.filecoin.io/storage-providers/advanced-configurations/market/#dealmaking-section). See how they work [here](https://lotus.filecoin.io/storage-providers/advanced-configurations/market/#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
@@ -3736,4 +4028,4 @@ We are grateful for every contribution!
We are very excited to release **lotus** 0.1.0. This is our testnet release. To install lotus and join the testnet, please visit [lotu.sh](lotu.sh). Please file bug reports as [issues](https://github.com/filecoin-project/lotus/issues).
A huge thank you to all contributors for this testnet release!
A huge thank you to all contributors for this testnet release!
+1 -1
View File
@@ -1,4 +1,4 @@
FROM golang:1.17.9-buster AS builder-deps
FROM golang:1.18.1-buster AS builder-deps
MAINTAINER Lotus Development Team
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
+1
View File
@@ -0,0 +1 @@
1.18.1
+5 -18
View File
@@ -8,9 +8,11 @@ unexport GOFLAGS
GOCC?=go
GOVERSION:=$(shell $(GOCC) version | tr ' ' '\n' | grep go1 | sed 's/^go//' | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
ifeq ($(shell expr $(GOVERSION) \< 1016000), 1)
GOVERSIONMIN:=$(shell cat GO_VERSION_MIN | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
ifeq ($(shell expr $(GOVERSION) \< $(GOVERSIONMIN)), 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.17.9)
$(error Update Golang to version to at least $(shell cat GO_VERSION_MIN))
endif
# git modules that need to be loaded
@@ -160,18 +162,6 @@ benchmarks:
@curl -X POST 'http://benchmark.kittyhawk.wtf/benchmark' -d '@bench.json' -u "${benchmark_http_cred}"
.PHONY: benchmarks
lotus-pond: 2k
$(GOCC) build -o lotus-pond ./lotuspond
.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-fountain:
rm -f lotus-fountain
$(GOCC) build $(GOFLAGS) -o lotus-fountain ./cmd/lotus-fountain
@@ -299,9 +289,6 @@ type-gen: api-gen
$(GOCC) generate -x ./...
goimports -w api/
method-gen: api-gen
(cd ./lotuspond/front/src/chain && $(GOCC) run ./methodgen.go)
actors-code-gen:
$(GOCC) run ./gen/inline-gen . gen/inlinegen-data.json
$(GOCC) run ./chain/actors/agen
@@ -367,7 +354,7 @@ docsgen-openrpc-gateway: docsgen-openrpc-bin
fiximports:
./scripts/fiximports
gen: actors-code-gen type-gen method-gen cfgdoc-gen docsgen api-gen circleci bundle-gen fiximports
gen: actors-code-gen type-gen cfgdoc-gen docsgen api-gen circleci bundle-gen fiximports
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli"
.PHONY: gen
+9 -9
View File
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://docs.filecoin.io/" title="Filecoin Docs">
<a href="https://lotus.filecoin.io/" title="Filecoin Docs">
<img src="documentation/images/lotus_logo_h.png" alt="Project Lotus Logo" width="244" />
</a>
</p>
@@ -67,14 +67,14 @@ Fedora:
sudo dnf -y install gcc make git bzr jq pkgconfig mesa-libOpenCL mesa-libOpenCL-devel opencl-headers ocl-icd ocl-icd-devel clang llvm wget hwloc hwloc-devel
```
For other distributions you can find the required dependencies [here.](https://docs.filecoin.io/get-started/lotus/installation/#system-specific) For instructions specific to macOS, you can find them [here.](https://docs.filecoin.io/get-started/lotus/installation/#macos)
For other distributions you can find the required dependencies [here.](https://lotus.filecoin.io/lotus/install/prerequisites/#supported-platforms) For instructions specific to macOS, you can find them [here.](https://lotus.filecoin.io/lotus/install/macos/)
#### Go
To build Lotus, you need a working installation of [Go 1.17.9 or higher](https://golang.org/dl/):
To build Lotus, you need a working installation of [Go 1.18.1 or higher](https://golang.org/dl/):
```bash
wget -c https://golang.org/dl/go1.17.9.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
wget -c https://golang.org/dl/go1.18.1.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
```
**TIP:**
@@ -101,7 +101,7 @@ Note: The default branch `master` is the dev branch where the latest new feature
2. To join mainnet, checkout the [latest release](https://github.com/filecoin-project/lotus/releases).
If you are changing networks from a previous Lotus installation or there has been a network reset, read the [Switch networks guide](https://docs.filecoin.io/get-started/lotus/switch-networks/) before proceeding.
If you are changing networks from a previous Lotus installation or there has been a network reset, read the [Switch networks guide](https://lotus.filecoin.io/lotus/manage/switch-networks/) before proceeding.
For networks other than mainnet, look up the current branch or tag/commit for the network you want to join in the [Filecoin networks dashboard](https://network.filecoin.io), then build Lotus for your specific network below.
@@ -113,8 +113,8 @@ Note: The default branch `master` is the dev branch where the latest new feature
Currently, the latest code on the _master_ branch corresponds to mainnet.
3. If you are in China, see "[Lotus: tips when running in China](https://docs.filecoin.io/get-started/lotus/tips-running-in-china/)".
4. This build instruction uses the prebuilt proofs binaries. If you want to build the proof binaries from source check the [complete instructions](https://docs.filecoin.io/get-started/lotus/installation/#build-and-install-lotus). Note, if you are building the proof binaries from source, [installing rustup](https://docs.filecoin.io/get-started/lotus/installation/#rustup) is also needed.
3. If you are in China, see "[Lotus: tips when running in China](https://lotus.filecoin.io/lotus/configure/nodes-in-china/)".
4. This build instruction uses the prebuilt proofs binaries. If you want to build the proof binaries from source check the [complete instructions](https://lotus.filecoin.io/lotus/install/prerequisites/). Note, if you are building the proof binaries from source, [installing rustup](https://lotus.filecoin.io/lotus/install/linux/#rustup) is also needed.
5. Build and install Lotus:
@@ -129,9 +129,9 @@ Note: The default branch `master` is the dev branch where the latest new feature
This will put `lotus`, `lotus-miner` and `lotus-worker` in `/usr/local/bin`.
`lotus` will use the `$HOME/.lotus` folder by default for storage (configuration, chain data, wallets, etc). See [advanced options](https://docs.filecoin.io/get-started/lotus/configuration-and-advanced-usage/) for information on how to customize the Lotus folder.
`lotus` will use the `$HOME/.lotus` folder by default for storage (configuration, chain data, wallets, etc). See [advanced options](https://lotus.filecoin.io/lotus/configure/defaults/#environment-variables) for information on how to customize the Lotus folder.
6. You should now have Lotus installed. You can now [start the Lotus daemon and sync the chain](https://docs.filecoin.io/get-started/lotus/installation/#start-the-lotus-daemon-and-sync-the-chain).
6. You should now have Lotus installed. You can now [start the Lotus daemon and sync the chain](https://lotus.filecoin.io/lotus/install/linux/#start-the-lotus-daemon-and-sync-the-chain).
## License
+42
View File
@@ -0,0 +1,42 @@
package api
import (
"errors"
"reflect"
"github.com/filecoin-project/go-jsonrpc"
)
const (
EOutOfGas = iota + jsonrpc.FirstUserCode
EActorNotFound
)
type ErrOutOfGas struct{}
func (e *ErrOutOfGas) Error() string {
return "call ran out of gas"
}
type ErrActorNotFound struct{}
func (e *ErrActorNotFound) Error() string {
return "actor not found"
}
var RPCErrors = jsonrpc.NewErrors()
func ErrorIsIn(err error, errorTypes []error) bool {
for _, etype := range errorTypes {
tmp := reflect.New(reflect.PointerTo(reflect.ValueOf(etype).Elem().Type())).Interface()
if errors.As(err, tmp) {
return true
}
}
return false
}
func init() {
RPCErrors.Register(EOutOfGas, new(*ErrOutOfGas))
RPCErrors.Register(EActorNotFound, new(*ErrActorNotFound))
}
+20 -4
View File
@@ -8,7 +8,7 @@ import (
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
@@ -17,9 +17,10 @@ import (
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/builtin/v8/market"
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
"github.com/filecoin-project/go-state-types/builtin/v9/market"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/dline"
abinetwork "github.com/filecoin-project/go-state-types/network"
@@ -527,6 +528,17 @@ type FullNode interface {
StateMarketDeals(context.Context, types.TipSetKey) (map[string]*MarketDeal, error) //perm:read
// StateMarketStorageDeal returns information about the indicated deal
StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*MarketDeal, error) //perm:read
// StateGetAllocationForPendingDeal returns the allocation for a given deal ID of a pending deal. Returns nil if
// pending allocation is not found.
StateGetAllocationForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*verifregtypes.Allocation, error) //perm:read
// StateGetAllocation returns the allocation for a given address and allocation ID.
StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifregtypes.AllocationId, tsk types.TipSetKey) (*verifregtypes.Allocation, error) //perm:read
// StateGetAllocations returns the all the allocations for a given client.
StateGetAllocations(ctx context.Context, clientAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) //perm:read
// StateGetClaim returns the claim for a given address and claim ID.
StateGetClaim(ctx context.Context, providerAddr address.Address, claimId verifregtypes.ClaimId, tsk types.TipSetKey) (*verifregtypes.Claim, error) //perm:read
// StateGetClaims returns the all the claims for a given provider.
StateGetClaims(ctx context.Context, providerAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) //perm:read
// StateComputeDataCID computes DataCID from a set of on-chain deals
StateComputeDataCID(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error) //perm:read
// StateLookupID retrieves the ID address of the given address
@@ -540,6 +552,8 @@ type FullNode interface {
StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) //perm:read
// StateMinerSectorCount returns the number of sectors in a miner's sector set and proving set
StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (MinerSectors, error) //perm:read
// StateMinerAllocated returns a bitfield containing all sector numbers marked as allocated in miner state
StateMinerAllocated(context.Context, address.Address, types.TipSetKey) (*bitfield.BitField, error) //perm:read
// StateCompute is a flexible command that applies the given messages on the given tipset.
// The messages are run as though the VM were at the provided height.
//
@@ -581,7 +595,7 @@ type FullNode interface {
// Returns nil if there is no entry in the data cap table for the
// address.
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read
// StateVerifiedClientStatus returns the address of the Verified Registry's root key
// StateVerifiedRegistryRootKey returns the address of the Verified Registry's root key
StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) //perm:read
// StateDealProviderCollateralBounds returns the min and max collateral a storage provider
// can issue. It takes the deal size and verified status as parameters.
@@ -597,6 +611,8 @@ type FullNode interface {
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
// StateActorCodeCIDs returns the CIDs of all the builtin actors for the given network version
StateActorCodeCIDs(context.Context, abinetwork.Version) (map[string]cid.Cid, error) //perm:read
// StateActorManifestCID returns the CID of the builtin actors manifest for the given network version
StateActorManifestCID(context.Context, abinetwork.Version) (cid.Cid, error) //perm:read
// StateGetRandomnessFromTickets is used to sample the chain for randomness.
StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/dline"
apitypes "github.com/filecoin-project/lotus/api/types"
+4 -4
View File
@@ -4,10 +4,10 @@ import (
"context"
"time"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
)
// MODIFYING THE API INTERFACE
+149 -3
View File
@@ -7,17 +7,19 @@ import (
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-fil-markets/piecestore"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v8/market"
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/builtin/v9/market"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
abinetwork "github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/chain/actors/builtin"
@@ -53,6 +55,11 @@ type StorageMiner interface {
// and does not wait for message execution
ActorWithdrawBalance(ctx context.Context, amount abi.TokenAmount) (cid.Cid, error) //perm:admin
// BeneficiaryWithdrawBalance allows the beneficiary of a miner to withdraw balance from miner actor
// Specify amount as "0" to withdraw full balance. This method returns a message CID
// and does not wait for message execution
BeneficiaryWithdrawBalance(context.Context, abi.TokenAmount) (cid.Cid, error) //perm:admin
MiningBase(context.Context) (*types.TipSet, error) //perm:read
ComputeWindowPoSt(ctx context.Context, dlIdx uint64, tsk types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) //perm:admin
@@ -123,6 +130,23 @@ type StorageMiner interface {
// SectorAbortUpgrade can be called on sectors that are in the process of being upgraded to abort it
SectorAbortUpgrade(context.Context, abi.SectorNumber) error //perm:admin
// SectorNumAssignerMeta returns sector number assigner metadata - reserved/allocated
SectorNumAssignerMeta(ctx context.Context) (NumAssignerMeta, error) //perm:read
// SectorNumReservations returns a list of sector number reservations
SectorNumReservations(ctx context.Context) (map[string]bitfield.BitField, error) //perm:read
// SectorNumReserve creates a new sector number reservation. Will fail if any other reservation has colliding
// numbers or name. Set force to true to override safety checks.
// Valid characters for name: a-z, A-Z, 0-9, _, -
SectorNumReserve(ctx context.Context, name string, sectors bitfield.BitField, force bool) error //perm:admin
// SectorNumReserveCount creates a new sector number reservation for `count` sector numbers.
// by default lotus will allocate lowest-available sector numbers to the reservation.
// For restrictions on `name` see SectorNumReserve
SectorNumReserveCount(ctx context.Context, name string, count uint64) (bitfield.BitField, error) //perm:admin
// SectorNumFree drops a sector reservation
SectorNumFree(ctx context.Context, name string) error //perm:admin
SectorReceive(ctx context.Context, meta RemoteSectorMeta) error //perm:admin
// WorkerConnect tells the node to connect to workers RPC
WorkerConnect(context.Context, string) error //perm:admin retry:true
WorkerStats(context.Context) (map[uuid.UUID]storiface.WorkerStats, error) //perm:admin
@@ -145,6 +169,7 @@ type StorageMiner interface {
ReturnMoveStorage(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnUnsealPiece(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnReadPiece(ctx context.Context, callID storiface.CallID, ok bool, err *storiface.CallError) error //perm:admin retry:true
ReturnDownloadSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnFetch(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
// SealingSchedDiag dumps internal sealing scheduler state
@@ -298,6 +323,11 @@ type StorageMiner interface {
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storiface.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) //perm:admin
ComputeProof(ctx context.Context, ssi []builtin.ExtendedSectorInfo, rand abi.PoStRandomness, poStEpoch abi.ChainEpoch, nv abinetwork.Version) ([]builtin.PoStProof, error) //perm:read
// RecoverFault can be used to declare recoveries manually. It sends messages
// to the miner actor with details of recovered sectors and returns the CID of messages. It honors the
// maxPartitionsPerRecoveryMessage from the config
RecoverFault(ctx context.Context, sectors []abi.SectorNumber) ([]cid.Cid, error) //perm:admin
}
var _ storiface.WorkerReturn = *new(StorageMiner)
@@ -468,3 +498,119 @@ type DagstoreInitializeAllEvent struct {
Total int
Current int
}
type NumAssignerMeta struct {
Reserved bitfield.BitField
Allocated bitfield.BitField
// ChainAllocated+Reserved+Allocated
InUse bitfield.BitField
Next abi.SectorNumber
}
type RemoteSectorMeta struct {
////////
// BASIC SECTOR INFORMATION
// State specifies the first state the sector will enter after being imported
// Must be one of the following states:
// * Packing
// * GetTicket
// * PreCommitting
// * SubmitCommit
// * Proving/Available
State SectorState
Sector abi.SectorID
Type abi.RegisteredSealProof
////////
// SEALING METADATA
// (allows lotus to continue the sealing process)
// Required in Packing and later
Pieces []SectorPiece // todo better type?
// Required in PreCommitting and later
TicketValue abi.SealRandomness
TicketEpoch abi.ChainEpoch
PreCommit1Out storiface.PreCommit1Out // todo specify better
CommD *cid.Cid
CommR *cid.Cid // SectorKey
// Required in SubmitCommit and later
PreCommitInfo *miner.SectorPreCommitInfo
PreCommitDeposit *big.Int
PreCommitMessage *cid.Cid
PreCommitTipSet types.TipSetKey
SeedValue abi.InteractiveSealRandomness
SeedEpoch abi.ChainEpoch
CommitProof []byte
// Required in Proving/Available
CommitMessage *cid.Cid
// Optional sector metadata to import
Log []SectorLog
////////
// SECTOR DATA SOURCE
// Sector urls - lotus will use those for fetching files into local storage
// Required in all states
DataUnsealed *storiface.SectorLocation
// Required in PreCommitting and later
DataSealed *storiface.SectorLocation
DataCache *storiface.SectorLocation
////////
// SEALING SERVICE HOOKS
// URL
// RemoteCommit1Endpoint is an URL of POST endpoint which lotus will call requesting Commit1 (seal_commit_phase1)
// request body will be json-serialized RemoteCommit1Params struct
RemoteCommit1Endpoint string
// RemoteCommit2Endpoint is an URL of POST endpoint which lotus will call requesting Commit2 (seal_commit_phase2)
// request body will be json-serialized RemoteCommit2Params struct
RemoteCommit2Endpoint string
// RemoteSealingDoneEndpoint is called after the sector exists the sealing pipeline
// request body will be json-serialized RemoteSealingDoneParams struct
RemoteSealingDoneEndpoint string
}
type RemoteCommit1Params struct {
Ticket, Seed []byte
Unsealed cid.Cid
Sealed cid.Cid
ProofType abi.RegisteredSealProof
}
type RemoteCommit2Params struct {
Sector abi.SectorID
ProofType abi.RegisteredSealProof
// todo spec better
Commit1Out storiface.Commit1Out
}
type RemoteSealingDoneParams struct {
// Successful is true if the sector has entered state considered as "successfully sealed"
Successful bool
// State is the state the sector has entered
// For example "Proving" / "Removing"
State string
// Optional commit message CID
CommitMessage *cid.Cid
}
+19 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package api
import (
@@ -12,6 +12,9 @@ import (
"testing"
"github.com/stretchr/testify/require"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-jsonrpc"
)
func goCmd() string {
@@ -124,3 +127,18 @@ func TestPermTags(t *testing.T) {
_ = PermissionedStorMinerAPI(&StorageMinerStruct{})
_ = PermissionedWorkerAPI(&WorkerStruct{})
}
func TestRetryErrorIsInTrue(t *testing.T) {
errorsToRetry := []error{&jsonrpc.RPCConnectionError{}}
require.True(t, ErrorIsIn(&jsonrpc.RPCConnectionError{}, errorsToRetry))
}
func TestRetryErrorIsInFalse(t *testing.T) {
errorsToRetry := []error{&jsonrpc.RPCConnectionError{}}
require.False(t, ErrorIsIn(xerrors.Errorf("random error"), errorsToRetry))
}
func TestRetryWrappedErrorIsInTrue(t *testing.T) {
errorsToRetry := []error{&jsonrpc.RPCConnectionError{}}
require.True(t, ErrorIsIn(xerrors.Errorf("wrapped: %w", &jsonrpc.RPCConnectionError{}), errorsToRetry))
}
+1
View File
@@ -49,6 +49,7 @@ type Worker interface {
MoveStorage(ctx context.Context, sector storiface.SectorRef, types storiface.SectorFileType) (storiface.CallID, error) //perm:admin
UnsealPiece(context.Context, storiface.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (storiface.CallID, error) //perm:admin
Fetch(context.Context, storiface.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) //perm:admin
DownloadSectorData(ctx context.Context, sector storiface.SectorRef, finalized bool, src map[storiface.SectorFileType]storiface.SectorLocation) (storiface.CallID, error) //perm:admin
GenerateWinningPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []storiface.PostSectorChallenge, randomness abi.PoStRandomness) ([]proof.PoStProof, error) //perm:admin
GenerateWindowPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []storiface.PostSectorChallenge, partitionIdx int, randomness abi.PoStRandomness) (storiface.WindowPoStResult, error) //perm:admin
+124 -1
View File
@@ -13,8 +13,8 @@ import (
xerrors "golang.org/x/xerrors"
abi "github.com/filecoin-project/go-state-types/abi"
market "github.com/filecoin-project/go-state-types/builtin/v8/market"
paych "github.com/filecoin-project/go-state-types/builtin/v8/paych"
market "github.com/filecoin-project/go-state-types/builtin/v9/market"
)
var _ = xerrors.Errorf
@@ -1005,6 +1005,129 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) (err error) {
return nil
}
func (t *SectorPiece) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
cw := cbg.NewCborWriter(w)
if _, err := cw.Write([]byte{162}); err != nil {
return err
}
// t.Piece (abi.PieceInfo) (struct)
if len("Piece") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"Piece\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Piece"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("Piece")); err != nil {
return err
}
if err := t.Piece.MarshalCBOR(cw); err != nil {
return err
}
// t.DealInfo (api.PieceDealInfo) (struct)
if len("DealInfo") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"DealInfo\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealInfo"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("DealInfo")); err != nil {
return err
}
if err := t.DealInfo.MarshalCBOR(cw); err != nil {
return err
}
return nil
}
func (t *SectorPiece) UnmarshalCBOR(r io.Reader) (err error) {
*t = SectorPiece{}
cr := cbg.NewCborReader(r)
maj, extra, err := cr.ReadHeader()
if err != nil {
return err
}
defer func() {
if err == io.EOF {
err = io.ErrUnexpectedEOF
}
}()
if maj != cbg.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra > cbg.MaxLength {
return fmt.Errorf("SectorPiece: map struct too large (%d)", extra)
}
var name string
n := extra
for i := uint64(0); i < n; i++ {
{
sval, err := cbg.ReadString(cr)
if err != nil {
return err
}
name = string(sval)
}
switch name {
// t.Piece (abi.PieceInfo) (struct)
case "Piece":
{
if err := t.Piece.UnmarshalCBOR(cr); err != nil {
return xerrors.Errorf("unmarshaling t.Piece: %w", err)
}
}
// t.DealInfo (api.PieceDealInfo) (struct)
case "DealInfo":
{
b, err := cr.ReadByte()
if err != nil {
return err
}
if b != cbg.CborNull[0] {
if err := cr.UnreadByte(); err != nil {
return err
}
t.DealInfo = new(PieceDealInfo)
if err := t.DealInfo.UnmarshalCBOR(cr); err != nil {
return xerrors.Errorf("unmarshaling t.DealInfo pointer: %w", err)
}
}
}
default:
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
return nil
}
func (t *DealSchedule) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
+8 -5
View File
@@ -19,7 +19,7 @@ import (
func NewCommonRPCV0(ctx context.Context, addr string, requestHeader http.Header) (api.CommonNet, jsonrpc.ClientCloser, error) {
var res v0api.CommonNetStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res), requestHeader)
api.GetInternalStructs(&res), requestHeader, jsonrpc.WithErrors(api.RPCErrors))
return &res, closer, err
}
@@ -29,7 +29,7 @@ func NewFullNodeRPCV0(ctx context.Context, addr string, requestHeader http.Heade
var res v0api.FullNodeStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res), requestHeader)
api.GetInternalStructs(&res), requestHeader, jsonrpc.WithErrors(api.RPCErrors))
return &res, closer, err
}
@@ -38,7 +38,7 @@ func NewFullNodeRPCV0(ctx context.Context, addr string, requestHeader http.Heade
func NewFullNodeRPCV1(ctx context.Context, addr string, requestHeader http.Header) (api.FullNode, jsonrpc.ClientCloser, error) {
var res v1api.FullNodeStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res), requestHeader)
api.GetInternalStructs(&res), requestHeader, jsonrpc.WithErrors(api.RPCErrors))
return &res, closer, err
}
@@ -72,6 +72,7 @@ func NewStorageMinerRPCV0(ctx context.Context, addr string, requestHeader http.H
api.GetInternalStructs(&res), requestHeader,
append([]jsonrpc.Option{
rpcenc.ReaderParamEncoder(pushUrl),
jsonrpc.WithErrors(api.RPCErrors),
}, opts...)...)
return &res, closer, err
@@ -90,6 +91,7 @@ func NewWorkerRPCV0(ctx context.Context, addr string, requestHeader http.Header)
rpcenc.ReaderParamEncoder(pushUrl),
jsonrpc.WithNoReconnect(),
jsonrpc.WithTimeout(30*time.Second),
jsonrpc.WithErrors(api.RPCErrors),
)
return &res, closer, err
@@ -101,7 +103,7 @@ func NewGatewayRPCV1(ctx context.Context, addr string, requestHeader http.Header
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res),
requestHeader,
opts...,
append(opts, jsonrpc.WithErrors(api.RPCErrors))...,
)
return &res, closer, err
@@ -113,7 +115,7 @@ func NewGatewayRPCV0(ctx context.Context, addr string, requestHeader http.Header
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res),
requestHeader,
opts...,
append(opts, jsonrpc.WithErrors(api.RPCErrors))...,
)
return &res, closer, err
@@ -124,6 +126,7 @@ func NewWalletRPCV0(ctx context.Context, addr string, requestHeader http.Header)
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res),
requestHeader,
jsonrpc.WithErrors(api.RPCErrors),
)
return &res, closer, err
+29 -5
View File
@@ -6,6 +6,7 @@ import (
"go/ast"
"go/parser"
"go/token"
"net/http"
"path/filepath"
"reflect"
"strings"
@@ -17,11 +18,11 @@ import (
"github.com/ipfs/go-cid"
"github.com/ipfs/go-graphsync"
textselector "github.com/ipld/go-ipld-selector-text-lite"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/multiformats/go-multiaddr"
"github.com/filecoin-project/go-address"
@@ -31,6 +32,7 @@ import (
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/exitcode"
@@ -136,7 +138,15 @@ func init() {
addExample(&textSelExample)
addExample(&apiSelExample)
addExample(network.ReachabilityPublic)
addExample(build.NewestNetworkVersion)
addExample(build.TestNetworkVersion)
allocationId := verifreg.AllocationId(0)
addExample(allocationId)
addExample(&allocationId)
addExample(map[verifreg.AllocationId]verifreg.Allocation{})
claimId := verifreg.ClaimId(0)
addExample(claimId)
addExample(&claimId)
addExample(map[verifreg.ClaimId]verifreg.Claim{})
addExample(map[string]int{"name": 42})
addExample(map[string]time.Time{"name": time.Unix(1615243938, 0).UTC()})
addExample(&types.ExecutionTrace{
@@ -336,7 +346,21 @@ func init() {
Conns: 4,
FD: 5,
})
addExample(map[string]bitfield.BitField{
"": bitfield.NewFromSet([]uint64{5, 6, 7, 10}),
})
addExample(http.Header{
"Authorization": []string{"Bearer ey.."},
})
addExample(map[storiface.SectorFileType]storiface.SectorLocation{
storiface.FTSealed: {
Local: false,
URL: "https://example.com/sealingservice/sectors/s-f0123-12345",
Headers: nil,
},
})
}
func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
+111 -5
View File
@@ -14,10 +14,10 @@ import (
uuid "github.com/google/uuid"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
metrics "github.com/libp2p/go-libp2p-core/metrics"
network0 "github.com/libp2p/go-libp2p-core/network"
peer "github.com/libp2p/go-libp2p-core/peer"
protocol "github.com/libp2p/go-libp2p-core/protocol"
metrics "github.com/libp2p/go-libp2p/core/metrics"
network0 "github.com/libp2p/go-libp2p/core/network"
peer "github.com/libp2p/go-libp2p/core/peer"
protocol "github.com/libp2p/go-libp2p/core/protocol"
address "github.com/filecoin-project/go-address"
bitfield "github.com/filecoin-project/go-bitfield"
@@ -26,8 +26,9 @@ import (
auth "github.com/filecoin-project/go-jsonrpc/auth"
abi "github.com/filecoin-project/go-state-types/abi"
big "github.com/filecoin-project/go-state-types/big"
miner "github.com/filecoin-project/go-state-types/builtin/v8/miner"
paych "github.com/filecoin-project/go-state-types/builtin/v8/paych"
miner "github.com/filecoin-project/go-state-types/builtin/v9/miner"
verifreg "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
crypto "github.com/filecoin-project/go-state-types/crypto"
dline "github.com/filecoin-project/go-state-types/dline"
network "github.com/filecoin-project/go-state-types/network"
@@ -2302,6 +2303,21 @@ func (mr *MockFullNodeMockRecorder) StateActorCodeCIDs(arg0, arg1 interface{}) *
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateActorCodeCIDs", reflect.TypeOf((*MockFullNode)(nil).StateActorCodeCIDs), arg0, arg1)
}
// StateActorManifestCID mocks base method.
func (m *MockFullNode) StateActorManifestCID(arg0 context.Context, arg1 network.Version) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateActorManifestCID", arg0, arg1)
ret0, _ := ret[0].(cid.Cid)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateActorManifestCID indicates an expected call of StateActorManifestCID.
func (mr *MockFullNodeMockRecorder) StateActorManifestCID(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateActorManifestCID", reflect.TypeOf((*MockFullNode)(nil).StateActorManifestCID), arg0, arg1)
}
// StateAllMinerFaults mocks base method.
func (m *MockFullNode) StateAllMinerFaults(arg0 context.Context, arg1 abi.ChainEpoch, arg2 types.TipSetKey) ([]*api.Fault, error) {
m.ctrl.T.Helper()
@@ -2452,6 +2468,51 @@ func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{})
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
}
// StateGetAllocation mocks base method.
func (m *MockFullNode) StateGetAllocation(arg0 context.Context, arg1 address.Address, arg2 verifreg.AllocationId, arg3 types.TipSetKey) (*verifreg.Allocation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetAllocation", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(*verifreg.Allocation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetAllocation indicates an expected call of StateGetAllocation.
func (mr *MockFullNodeMockRecorder) StateGetAllocation(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllocation", reflect.TypeOf((*MockFullNode)(nil).StateGetAllocation), arg0, arg1, arg2, arg3)
}
// StateGetAllocationForPendingDeal mocks base method.
func (m *MockFullNode) StateGetAllocationForPendingDeal(arg0 context.Context, arg1 abi.DealID, arg2 types.TipSetKey) (*verifreg.Allocation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetAllocationForPendingDeal", arg0, arg1, arg2)
ret0, _ := ret[0].(*verifreg.Allocation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetAllocationForPendingDeal indicates an expected call of StateGetAllocationForPendingDeal.
func (mr *MockFullNodeMockRecorder) StateGetAllocationForPendingDeal(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllocationForPendingDeal", reflect.TypeOf((*MockFullNode)(nil).StateGetAllocationForPendingDeal), arg0, arg1, arg2)
}
// StateGetAllocations mocks base method.
func (m *MockFullNode) StateGetAllocations(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (map[verifreg.AllocationId]verifreg.Allocation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetAllocations", arg0, arg1, arg2)
ret0, _ := ret[0].(map[verifreg.AllocationId]verifreg.Allocation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetAllocations indicates an expected call of StateGetAllocations.
func (mr *MockFullNodeMockRecorder) StateGetAllocations(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllocations", reflect.TypeOf((*MockFullNode)(nil).StateGetAllocations), arg0, arg1, arg2)
}
// StateGetBeaconEntry mocks base method.
func (m *MockFullNode) StateGetBeaconEntry(arg0 context.Context, arg1 abi.ChainEpoch) (*types.BeaconEntry, error) {
m.ctrl.T.Helper()
@@ -2467,6 +2528,36 @@ func (mr *MockFullNodeMockRecorder) StateGetBeaconEntry(arg0, arg1 interface{})
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetBeaconEntry", reflect.TypeOf((*MockFullNode)(nil).StateGetBeaconEntry), arg0, arg1)
}
// StateGetClaim mocks base method.
func (m *MockFullNode) StateGetClaim(arg0 context.Context, arg1 address.Address, arg2 verifreg.ClaimId, arg3 types.TipSetKey) (*verifreg.Claim, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetClaim", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(*verifreg.Claim)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetClaim indicates an expected call of StateGetClaim.
func (mr *MockFullNodeMockRecorder) StateGetClaim(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetClaim", reflect.TypeOf((*MockFullNode)(nil).StateGetClaim), arg0, arg1, arg2, arg3)
}
// StateGetClaims mocks base method.
func (m *MockFullNode) StateGetClaims(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (map[verifreg.ClaimId]verifreg.Claim, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetClaims", arg0, arg1, arg2)
ret0, _ := ret[0].(map[verifreg.ClaimId]verifreg.Claim)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetClaims indicates an expected call of StateGetClaims.
func (mr *MockFullNodeMockRecorder) StateGetClaims(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetClaims", reflect.TypeOf((*MockFullNode)(nil).StateGetClaims), arg0, arg1, arg2)
}
// StateGetNetworkParams mocks base method.
func (m *MockFullNode) StateGetNetworkParams(arg0 context.Context) (*api.NetworkParams, error) {
m.ctrl.T.Helper()
@@ -2662,6 +2753,21 @@ func (mr *MockFullNodeMockRecorder) StateMinerActiveSectors(arg0, arg1, arg2 int
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerActiveSectors", reflect.TypeOf((*MockFullNode)(nil).StateMinerActiveSectors), arg0, arg1, arg2)
}
// StateMinerAllocated mocks base method.
func (m *MockFullNode) StateMinerAllocated(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*bitfield.BitField, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerAllocated", arg0, arg1, arg2)
ret0, _ := ret[0].(*bitfield.BitField)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateMinerAllocated indicates an expected call of StateMinerAllocated.
func (mr *MockFullNodeMockRecorder) StateMinerAllocated(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerAllocated", reflect.TypeOf((*MockFullNode)(nil).StateMinerAllocated), arg0, arg1, arg2)
}
// StateMinerAvailableBalance mocks base method.
func (m *MockFullNode) StateMinerAvailableBalance(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
+227 -5
View File
@@ -10,10 +10,10 @@ import (
"github.com/google/uuid"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
@@ -24,8 +24,9 @@ import (
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/dline"
abinetwork "github.com/filecoin-project/go-state-types/network"
@@ -343,6 +344,8 @@ type FullNodeStruct struct {
StateActorCodeCIDs func(p0 context.Context, p1 abinetwork.Version) (map[string]cid.Cid, error) `perm:"read"`
StateActorManifestCID func(p0 context.Context, p1 abinetwork.Version) (cid.Cid, error) `perm:"read"`
StateAllMinerFaults func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*Fault, error) `perm:"read"`
StateCall func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*InvocResult, error) `perm:"read"`
@@ -363,8 +366,18 @@ type FullNodeStruct struct {
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
StateGetAllocation func(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) `perm:"read"`
StateGetAllocationForPendingDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*verifregtypes.Allocation, error) `perm:"read"`
StateGetAllocations func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) `perm:"read"`
StateGetBeaconEntry func(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) `perm:"read"`
StateGetClaim func(p0 context.Context, p1 address.Address, p2 verifregtypes.ClaimId, p3 types.TipSetKey) (*verifregtypes.Claim, error) `perm:"read"`
StateGetClaims func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) `perm:"read"`
StateGetNetworkParams func(p0 context.Context) (*NetworkParams, error) `perm:"read"`
StateGetRandomnessFromBeacon func(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) `perm:"read"`
@@ -391,6 +404,8 @@ type FullNodeStruct struct {
StateMinerActiveSectors func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"`
StateMinerAllocated func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*bitfield.BitField, error) `perm:"read"`
StateMinerAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) `perm:"read"`
StateMinerDeadlines func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]Deadline, error) `perm:"read"`
@@ -660,6 +675,8 @@ type StorageMinerStruct struct {
ActorWithdrawBalance func(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) `perm:"admin"`
BeneficiaryWithdrawBalance func(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) `perm:"admin"`
CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) `perm:"admin"`
ComputeDataCid func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data) (abi.PieceInfo, error) `perm:"admin"`
@@ -766,10 +783,14 @@ type StorageMinerStruct struct {
PledgeSector func(p0 context.Context) (abi.SectorID, error) `perm:"write"`
RecoverFault func(p0 context.Context, p1 []abi.SectorNumber) ([]cid.Cid, error) `perm:"admin"`
ReturnAddPiece func(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error `perm:"admin"`
ReturnDataCid func(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error `perm:"admin"`
ReturnDownloadSector func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
ReturnFetch func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
ReturnFinalizeReplicaUpdate func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
@@ -824,10 +845,22 @@ type StorageMinerStruct struct {
SectorMatchPendingPiecesToOpenSectors func(p0 context.Context) error `perm:"admin"`
SectorNumAssignerMeta func(p0 context.Context) (NumAssignerMeta, error) `perm:"read"`
SectorNumFree func(p0 context.Context, p1 string) error `perm:"admin"`
SectorNumReservations func(p0 context.Context) (map[string]bitfield.BitField, error) `perm:"read"`
SectorNumReserve func(p0 context.Context, p1 string, p2 bitfield.BitField, p3 bool) error `perm:"admin"`
SectorNumReserveCount func(p0 context.Context, p1 string, p2 uint64) (bitfield.BitField, error) `perm:"admin"`
SectorPreCommitFlush func(p0 context.Context) ([]sealiface.PreCommitBatchRes, error) `perm:"admin"`
SectorPreCommitPending func(p0 context.Context) ([]abi.SectorID, error) `perm:"admin"`
SectorReceive func(p0 context.Context, p1 RemoteSectorMeta) error `perm:"admin"`
SectorRemove func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"`
SectorSetExpectedSealDuration func(p0 context.Context, p1 time.Duration) error `perm:"write"`
@@ -933,6 +966,8 @@ type WorkerStruct struct {
DataCid func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data) (storiface.CallID, error) `perm:"admin"`
DownloadSectorData func(p0 context.Context, p1 storiface.SectorRef, p2 bool, p3 map[storiface.SectorFileType]storiface.SectorLocation) (storiface.CallID, error) `perm:"admin"`
Enabled func(p0 context.Context) (bool, error) `perm:"admin"`
Fetch func(p0 context.Context, p1 storiface.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) `perm:"admin"`
@@ -2447,6 +2482,17 @@ func (s *FullNodeStub) StateActorCodeCIDs(p0 context.Context, p1 abinetwork.Vers
return *new(map[string]cid.Cid), ErrNotSupported
}
func (s *FullNodeStruct) StateActorManifestCID(p0 context.Context, p1 abinetwork.Version) (cid.Cid, error) {
if s.Internal.StateActorManifestCID == nil {
return *new(cid.Cid), ErrNotSupported
}
return s.Internal.StateActorManifestCID(p0, p1)
}
func (s *FullNodeStub) StateActorManifestCID(p0 context.Context, p1 abinetwork.Version) (cid.Cid, error) {
return *new(cid.Cid), ErrNotSupported
}
func (s *FullNodeStruct) StateAllMinerFaults(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*Fault, error) {
if s.Internal.StateAllMinerFaults == nil {
return *new([]*Fault), ErrNotSupported
@@ -2557,6 +2603,39 @@ func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateGetAllocation(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) {
if s.Internal.StateGetAllocation == nil {
return nil, ErrNotSupported
}
return s.Internal.StateGetAllocation(p0, p1, p2, p3)
}
func (s *FullNodeStub) StateGetAllocation(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateGetAllocationForPendingDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*verifregtypes.Allocation, error) {
if s.Internal.StateGetAllocationForPendingDeal == nil {
return nil, ErrNotSupported
}
return s.Internal.StateGetAllocationForPendingDeal(p0, p1, p2)
}
func (s *FullNodeStub) StateGetAllocationForPendingDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*verifregtypes.Allocation, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateGetAllocations(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) {
if s.Internal.StateGetAllocations == nil {
return *new(map[verifregtypes.AllocationId]verifregtypes.Allocation), ErrNotSupported
}
return s.Internal.StateGetAllocations(p0, p1, p2)
}
func (s *FullNodeStub) StateGetAllocations(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) {
return *new(map[verifregtypes.AllocationId]verifregtypes.Allocation), ErrNotSupported
}
func (s *FullNodeStruct) StateGetBeaconEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) {
if s.Internal.StateGetBeaconEntry == nil {
return nil, ErrNotSupported
@@ -2568,6 +2647,28 @@ func (s *FullNodeStub) StateGetBeaconEntry(p0 context.Context, p1 abi.ChainEpoch
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateGetClaim(p0 context.Context, p1 address.Address, p2 verifregtypes.ClaimId, p3 types.TipSetKey) (*verifregtypes.Claim, error) {
if s.Internal.StateGetClaim == nil {
return nil, ErrNotSupported
}
return s.Internal.StateGetClaim(p0, p1, p2, p3)
}
func (s *FullNodeStub) StateGetClaim(p0 context.Context, p1 address.Address, p2 verifregtypes.ClaimId, p3 types.TipSetKey) (*verifregtypes.Claim, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateGetClaims(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) {
if s.Internal.StateGetClaims == nil {
return *new(map[verifregtypes.ClaimId]verifregtypes.Claim), ErrNotSupported
}
return s.Internal.StateGetClaims(p0, p1, p2)
}
func (s *FullNodeStub) StateGetClaims(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) {
return *new(map[verifregtypes.ClaimId]verifregtypes.Claim), ErrNotSupported
}
func (s *FullNodeStruct) StateGetNetworkParams(p0 context.Context) (*NetworkParams, error) {
if s.Internal.StateGetNetworkParams == nil {
return nil, ErrNotSupported
@@ -2711,6 +2812,17 @@ func (s *FullNodeStub) StateMinerActiveSectors(p0 context.Context, p1 address.Ad
return *new([]*miner.SectorOnChainInfo), ErrNotSupported
}
func (s *FullNodeStruct) StateMinerAllocated(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*bitfield.BitField, error) {
if s.Internal.StateMinerAllocated == nil {
return nil, ErrNotSupported
}
return s.Internal.StateMinerAllocated(p0, p1, p2)
}
func (s *FullNodeStub) StateMinerAllocated(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*bitfield.BitField, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateMinerAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
if s.Internal.StateMinerAvailableBalance == nil {
return *new(types.BigInt), ErrNotSupported
@@ -3998,6 +4110,17 @@ func (s *StorageMinerStub) ActorWithdrawBalance(p0 context.Context, p1 abi.Token
return *new(cid.Cid), ErrNotSupported
}
func (s *StorageMinerStruct) BeneficiaryWithdrawBalance(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) {
if s.Internal.BeneficiaryWithdrawBalance == nil {
return *new(cid.Cid), ErrNotSupported
}
return s.Internal.BeneficiaryWithdrawBalance(p0, p1)
}
func (s *StorageMinerStub) BeneficiaryWithdrawBalance(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) {
return *new(cid.Cid), ErrNotSupported
}
func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) {
if s.Internal.CheckProvable == nil {
return *new(map[abi.SectorNumber]string), ErrNotSupported
@@ -4581,6 +4704,17 @@ func (s *StorageMinerStub) PledgeSector(p0 context.Context) (abi.SectorID, error
return *new(abi.SectorID), ErrNotSupported
}
func (s *StorageMinerStruct) RecoverFault(p0 context.Context, p1 []abi.SectorNumber) ([]cid.Cid, error) {
if s.Internal.RecoverFault == nil {
return *new([]cid.Cid), ErrNotSupported
}
return s.Internal.RecoverFault(p0, p1)
}
func (s *StorageMinerStub) RecoverFault(p0 context.Context, p1 []abi.SectorNumber) ([]cid.Cid, error) {
return *new([]cid.Cid), ErrNotSupported
}
func (s *StorageMinerStruct) ReturnAddPiece(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error {
if s.Internal.ReturnAddPiece == nil {
return ErrNotSupported
@@ -4603,6 +4737,17 @@ func (s *StorageMinerStub) ReturnDataCid(p0 context.Context, p1 storiface.CallID
return ErrNotSupported
}
func (s *StorageMinerStruct) ReturnDownloadSector(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
if s.Internal.ReturnDownloadSector == nil {
return ErrNotSupported
}
return s.Internal.ReturnDownloadSector(p0, p1, p2)
}
func (s *StorageMinerStub) ReturnDownloadSector(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) ReturnFetch(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
if s.Internal.ReturnFetch == nil {
return ErrNotSupported
@@ -4900,6 +5045,61 @@ func (s *StorageMinerStub) SectorMatchPendingPiecesToOpenSectors(p0 context.Cont
return ErrNotSupported
}
func (s *StorageMinerStruct) SectorNumAssignerMeta(p0 context.Context) (NumAssignerMeta, error) {
if s.Internal.SectorNumAssignerMeta == nil {
return *new(NumAssignerMeta), ErrNotSupported
}
return s.Internal.SectorNumAssignerMeta(p0)
}
func (s *StorageMinerStub) SectorNumAssignerMeta(p0 context.Context) (NumAssignerMeta, error) {
return *new(NumAssignerMeta), ErrNotSupported
}
func (s *StorageMinerStruct) SectorNumFree(p0 context.Context, p1 string) error {
if s.Internal.SectorNumFree == nil {
return ErrNotSupported
}
return s.Internal.SectorNumFree(p0, p1)
}
func (s *StorageMinerStub) SectorNumFree(p0 context.Context, p1 string) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) SectorNumReservations(p0 context.Context) (map[string]bitfield.BitField, error) {
if s.Internal.SectorNumReservations == nil {
return *new(map[string]bitfield.BitField), ErrNotSupported
}
return s.Internal.SectorNumReservations(p0)
}
func (s *StorageMinerStub) SectorNumReservations(p0 context.Context) (map[string]bitfield.BitField, error) {
return *new(map[string]bitfield.BitField), ErrNotSupported
}
func (s *StorageMinerStruct) SectorNumReserve(p0 context.Context, p1 string, p2 bitfield.BitField, p3 bool) error {
if s.Internal.SectorNumReserve == nil {
return ErrNotSupported
}
return s.Internal.SectorNumReserve(p0, p1, p2, p3)
}
func (s *StorageMinerStub) SectorNumReserve(p0 context.Context, p1 string, p2 bitfield.BitField, p3 bool) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) SectorNumReserveCount(p0 context.Context, p1 string, p2 uint64) (bitfield.BitField, error) {
if s.Internal.SectorNumReserveCount == nil {
return *new(bitfield.BitField), ErrNotSupported
}
return s.Internal.SectorNumReserveCount(p0, p1, p2)
}
func (s *StorageMinerStub) SectorNumReserveCount(p0 context.Context, p1 string, p2 uint64) (bitfield.BitField, error) {
return *new(bitfield.BitField), ErrNotSupported
}
func (s *StorageMinerStruct) SectorPreCommitFlush(p0 context.Context) ([]sealiface.PreCommitBatchRes, error) {
if s.Internal.SectorPreCommitFlush == nil {
return *new([]sealiface.PreCommitBatchRes), ErrNotSupported
@@ -4922,6 +5122,17 @@ func (s *StorageMinerStub) SectorPreCommitPending(p0 context.Context) ([]abi.Sec
return *new([]abi.SectorID), ErrNotSupported
}
func (s *StorageMinerStruct) SectorReceive(p0 context.Context, p1 RemoteSectorMeta) error {
if s.Internal.SectorReceive == nil {
return ErrNotSupported
}
return s.Internal.SectorReceive(p0, p1)
}
func (s *StorageMinerStub) SectorReceive(p0 context.Context, p1 RemoteSectorMeta) error {
return ErrNotSupported
}
func (s *StorageMinerStruct) SectorRemove(p0 context.Context, p1 abi.SectorNumber) error {
if s.Internal.SectorRemove == nil {
return ErrNotSupported
@@ -5406,6 +5617,17 @@ func (s *WorkerStub) DataCid(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 st
return *new(storiface.CallID), ErrNotSupported
}
func (s *WorkerStruct) DownloadSectorData(p0 context.Context, p1 storiface.SectorRef, p2 bool, p3 map[storiface.SectorFileType]storiface.SectorLocation) (storiface.CallID, error) {
if s.Internal.DownloadSectorData == nil {
return *new(storiface.CallID), ErrNotSupported
}
return s.Internal.DownloadSectorData(p0, p1, p2, p3)
}
func (s *WorkerStub) DownloadSectorData(p0 context.Context, p1 storiface.SectorRef, p2 bool, p3 map[storiface.SectorFileType]storiface.SectorLocation) (storiface.CallID, error) {
return *new(storiface.CallID), ErrNotSupported
}
func (s *WorkerStruct) Enabled(p0 context.Context) (bool, error) {
if s.Internal.Enabled == nil {
return false, ErrNotSupported
+1 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package api
import (
+15 -13
View File
@@ -5,17 +5,19 @@ import (
"fmt"
"time"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-graphsync"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
ma "github.com/multiformats/go-multiaddr"
"github.com/filecoin-project/go-address"
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/modules/dtypes"
@@ -53,7 +55,8 @@ type PubsubScore struct {
}
type MessageSendSpec struct {
MaxFee abi.TokenAmount
MaxFee abi.TokenAmount
MsgUuid uuid.UUID
}
// GraphSyncDataTransfer provides diagnostics on a data transfer happening over graphsync
@@ -134,13 +137,7 @@ type NetStat struct {
}
type NetLimit struct {
Dynamic bool `json:",omitempty"`
// set if Dynamic is false
Memory int64 `json:",omitempty"`
// set if Dynamic is true
MemoryFraction float64 `json:",omitempty"`
MinMemory int64 `json:",omitempty"`
MaxMemory int64 `json:",omitempty"`
Streams, StreamsInbound, StreamsOutbound int
Conns, ConnsInbound, ConnsOutbound int
@@ -252,10 +249,10 @@ type RestrievalRes struct {
}
// Selector specifies ipld selector string
// - if the string starts with '{', it's interpreted as json selector string
// see https://ipld.io/specs/selectors/ and https://ipld.io/specs/selectors/fixtures/selector-fixtures-1/
// - otherwise the string is interpreted as ipld-selector-text-lite (simple ipld path)
// see https://github.com/ipld/go-ipld-selector-text-lite
// - if the string starts with '{', it's interpreted as json selector string
// see https://ipld.io/specs/selectors/ and https://ipld.io/specs/selectors/fixtures/selector-fixtures-1/
// - otherwise the string is interpreted as ipld-selector-text-lite (simple ipld path)
// see https://github.com/ipld/go-ipld-selector-text-lite
type Selector string
type DagSpec struct {
@@ -299,6 +296,9 @@ type MinerInfo struct {
SectorSize abi.SectorSize
WindowPoStPartitionSectors uint64
ConsensusFaultElapsed abi.ChainEpoch
Beneficiary address.Address
BeneficiaryTerm *miner.BeneficiaryTerm
PendingBeneficiaryTerm *miner.PendingBeneficiaryChange
}
type NetworkParams struct {
@@ -331,4 +331,6 @@ type ForkUpgradeParams struct {
UpgradeHyperdriveHeight abi.ChainEpoch
UpgradeChocolateHeight abi.ChainEpoch
UpgradeOhSnapHeight abi.ChainEpoch
UpgradeSkyrHeight abi.ChainEpoch
UpgradeSharkHeight abi.ChainEpoch
}
+16 -3
View File
@@ -6,7 +6,7 @@ import (
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
textselector "github.com/ipld/go-ipld-selector-text-lite"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
@@ -14,8 +14,9 @@ import (
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/dline"
abinetwork "github.com/filecoin-project/go-state-types/network"
@@ -531,6 +532,16 @@ type FullNode interface {
StateMarketDeals(context.Context, types.TipSetKey) (map[string]*api.MarketDeal, error) //perm:read
// StateMarketStorageDeal returns information about the indicated deal
StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error) //perm:read
// StateGetAllocationForPendingDeal returns the allocation for a given deal ID of a pending deal.
StateGetAllocationForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*verifregtypes.Allocation, error) //perm:read
// StateGetAllocation returns the allocation for a given address and allocation ID.
StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifregtypes.AllocationId, tsk types.TipSetKey) (*verifregtypes.Allocation, error) //perm:read
// StateGetAllocations returns the all the allocations for a given client.
StateGetAllocations(ctx context.Context, clientAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) //perm:read
// StateGetClaim returns the claim for a given address and claim ID.
StateGetClaim(ctx context.Context, providerAddr address.Address, claimId verifregtypes.ClaimId, tsk types.TipSetKey) (*verifregtypes.Claim, error) //perm:read
// StateGetClaims returns the all the claims for a given provider.
StateGetClaims(ctx context.Context, providerAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) //perm:read
// StateLookupID retrieves the ID address of the given address
StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
// StateAccountKey returns the public key address of the given ID address
@@ -591,7 +602,7 @@ type FullNode interface {
// Returns nil if there is no entry in the data cap table for the
// address.
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read
// StateVerifiedClientStatus returns the address of the Verified Registry's root key
// StateVerifiedRegistryRootKey returns the address of the Verified Registry's root key
StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) //perm:read
// StateDealProviderCollateralBounds returns the min and max collateral a storage provider
// can issue. It takes the deal size and verified status as parameters.
@@ -607,6 +618,8 @@ type FullNode interface {
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
// StateActorCodeCIDs returns the CIDs of all the builtin actors for the given network version
StateActorCodeCIDs(context.Context, abinetwork.Version) (map[string]cid.Cid, error) //perm:read
// StateActorManifestCID returns the CID of the builtin actors manifest for the given network version
StateActorManifestCID(context.Context, abinetwork.Version) (cid.Cid, error) //perm:read
// StateGetRandomnessFromTickets is used to sample the chain for randomness.
StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/dline"
abinetwork "github.com/filecoin-project/go-state-types/network"
+81 -2
View File
@@ -7,7 +7,7 @@ import (
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
@@ -16,8 +16,9 @@ import (
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/dline"
abinetwork "github.com/filecoin-project/go-state-types/network"
@@ -259,6 +260,8 @@ type FullNodeStruct struct {
StateActorCodeCIDs func(p0 context.Context, p1 abinetwork.Version) (map[string]cid.Cid, error) `perm:"read"`
StateActorManifestCID func(p0 context.Context, p1 abinetwork.Version) (cid.Cid, error) `perm:"read"`
StateAllMinerFaults func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*api.Fault, error) `perm:"read"`
StateCall func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*api.InvocResult, error) `perm:"read"`
@@ -275,6 +278,16 @@ type FullNodeStruct struct {
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
StateGetAllocation func(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) `perm:"read"`
StateGetAllocationForPendingDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*verifregtypes.Allocation, error) `perm:"read"`
StateGetAllocations func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) `perm:"read"`
StateGetClaim func(p0 context.Context, p1 address.Address, p2 verifregtypes.ClaimId, p3 types.TipSetKey) (*verifregtypes.Claim, error) `perm:"read"`
StateGetClaims func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) `perm:"read"`
StateGetNetworkParams func(p0 context.Context) (*api.NetworkParams, error) `perm:"read"`
StateGetRandomnessFromBeacon func(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) `perm:"read"`
@@ -1692,6 +1705,17 @@ func (s *FullNodeStub) StateActorCodeCIDs(p0 context.Context, p1 abinetwork.Vers
return *new(map[string]cid.Cid), ErrNotSupported
}
func (s *FullNodeStruct) StateActorManifestCID(p0 context.Context, p1 abinetwork.Version) (cid.Cid, error) {
if s.Internal.StateActorManifestCID == nil {
return *new(cid.Cid), ErrNotSupported
}
return s.Internal.StateActorManifestCID(p0, p1)
}
func (s *FullNodeStub) StateActorManifestCID(p0 context.Context, p1 abinetwork.Version) (cid.Cid, error) {
return *new(cid.Cid), ErrNotSupported
}
func (s *FullNodeStruct) StateAllMinerFaults(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*api.Fault, error) {
if s.Internal.StateAllMinerFaults == nil {
return *new([]*api.Fault), ErrNotSupported
@@ -1780,6 +1804,61 @@ func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateGetAllocation(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) {
if s.Internal.StateGetAllocation == nil {
return nil, ErrNotSupported
}
return s.Internal.StateGetAllocation(p0, p1, p2, p3)
}
func (s *FullNodeStub) StateGetAllocation(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateGetAllocationForPendingDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*verifregtypes.Allocation, error) {
if s.Internal.StateGetAllocationForPendingDeal == nil {
return nil, ErrNotSupported
}
return s.Internal.StateGetAllocationForPendingDeal(p0, p1, p2)
}
func (s *FullNodeStub) StateGetAllocationForPendingDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*verifregtypes.Allocation, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateGetAllocations(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) {
if s.Internal.StateGetAllocations == nil {
return *new(map[verifregtypes.AllocationId]verifregtypes.Allocation), ErrNotSupported
}
return s.Internal.StateGetAllocations(p0, p1, p2)
}
func (s *FullNodeStub) StateGetAllocations(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) {
return *new(map[verifregtypes.AllocationId]verifregtypes.Allocation), ErrNotSupported
}
func (s *FullNodeStruct) StateGetClaim(p0 context.Context, p1 address.Address, p2 verifregtypes.ClaimId, p3 types.TipSetKey) (*verifregtypes.Claim, error) {
if s.Internal.StateGetClaim == nil {
return nil, ErrNotSupported
}
return s.Internal.StateGetClaim(p0, p1, p2, p3)
}
func (s *FullNodeStub) StateGetClaim(p0 context.Context, p1 address.Address, p2 verifregtypes.ClaimId, p3 types.TipSetKey) (*verifregtypes.Claim, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) StateGetClaims(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) {
if s.Internal.StateGetClaims == nil {
return *new(map[verifregtypes.ClaimId]verifregtypes.Claim), ErrNotSupported
}
return s.Internal.StateGetClaims(p0, p1, p2)
}
func (s *FullNodeStub) StateGetClaims(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) {
return *new(map[verifregtypes.ClaimId]verifregtypes.Claim), ErrNotSupported
}
func (s *FullNodeStruct) StateGetNetworkParams(p0 context.Context) (*api.NetworkParams, error) {
if s.Internal.StateGetNetworkParams == nil {
return nil, ErrNotSupported
+96 -5
View File
@@ -13,10 +13,10 @@ import (
uuid "github.com/google/uuid"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
metrics "github.com/libp2p/go-libp2p-core/metrics"
network0 "github.com/libp2p/go-libp2p-core/network"
peer "github.com/libp2p/go-libp2p-core/peer"
protocol "github.com/libp2p/go-libp2p-core/protocol"
metrics "github.com/libp2p/go-libp2p/core/metrics"
network0 "github.com/libp2p/go-libp2p/core/network"
peer "github.com/libp2p/go-libp2p/core/peer"
protocol "github.com/libp2p/go-libp2p/core/protocol"
address "github.com/filecoin-project/go-address"
bitfield "github.com/filecoin-project/go-bitfield"
@@ -26,8 +26,9 @@ import (
auth "github.com/filecoin-project/go-jsonrpc/auth"
abi "github.com/filecoin-project/go-state-types/abi"
big "github.com/filecoin-project/go-state-types/big"
miner "github.com/filecoin-project/go-state-types/builtin/v8/miner"
paych "github.com/filecoin-project/go-state-types/builtin/v8/paych"
miner "github.com/filecoin-project/go-state-types/builtin/v9/miner"
verifreg "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
crypto "github.com/filecoin-project/go-state-types/crypto"
dline "github.com/filecoin-project/go-state-types/dline"
network "github.com/filecoin-project/go-state-types/network"
@@ -2187,6 +2188,21 @@ func (mr *MockFullNodeMockRecorder) StateActorCodeCIDs(arg0, arg1 interface{}) *
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateActorCodeCIDs", reflect.TypeOf((*MockFullNode)(nil).StateActorCodeCIDs), arg0, arg1)
}
// StateActorManifestCID mocks base method.
func (m *MockFullNode) StateActorManifestCID(arg0 context.Context, arg1 network.Version) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateActorManifestCID", arg0, arg1)
ret0, _ := ret[0].(cid.Cid)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateActorManifestCID indicates an expected call of StateActorManifestCID.
func (mr *MockFullNodeMockRecorder) StateActorManifestCID(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateActorManifestCID", reflect.TypeOf((*MockFullNode)(nil).StateActorManifestCID), arg0, arg1)
}
// StateAllMinerFaults mocks base method.
func (m *MockFullNode) StateAllMinerFaults(arg0 context.Context, arg1 abi.ChainEpoch, arg2 types.TipSetKey) ([]*api.Fault, error) {
m.ctrl.T.Helper()
@@ -2307,6 +2323,81 @@ func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{})
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
}
// StateGetAllocation mocks base method.
func (m *MockFullNode) StateGetAllocation(arg0 context.Context, arg1 address.Address, arg2 verifreg.AllocationId, arg3 types.TipSetKey) (*verifreg.Allocation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetAllocation", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(*verifreg.Allocation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetAllocation indicates an expected call of StateGetAllocation.
func (mr *MockFullNodeMockRecorder) StateGetAllocation(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllocation", reflect.TypeOf((*MockFullNode)(nil).StateGetAllocation), arg0, arg1, arg2, arg3)
}
// StateGetAllocationForPendingDeal mocks base method.
func (m *MockFullNode) StateGetAllocationForPendingDeal(arg0 context.Context, arg1 abi.DealID, arg2 types.TipSetKey) (*verifreg.Allocation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetAllocationForPendingDeal", arg0, arg1, arg2)
ret0, _ := ret[0].(*verifreg.Allocation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetAllocationForPendingDeal indicates an expected call of StateGetAllocationForPendingDeal.
func (mr *MockFullNodeMockRecorder) StateGetAllocationForPendingDeal(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllocationForPendingDeal", reflect.TypeOf((*MockFullNode)(nil).StateGetAllocationForPendingDeal), arg0, arg1, arg2)
}
// StateGetAllocations mocks base method.
func (m *MockFullNode) StateGetAllocations(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (map[verifreg.AllocationId]verifreg.Allocation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetAllocations", arg0, arg1, arg2)
ret0, _ := ret[0].(map[verifreg.AllocationId]verifreg.Allocation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetAllocations indicates an expected call of StateGetAllocations.
func (mr *MockFullNodeMockRecorder) StateGetAllocations(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllocations", reflect.TypeOf((*MockFullNode)(nil).StateGetAllocations), arg0, arg1, arg2)
}
// StateGetClaim mocks base method.
func (m *MockFullNode) StateGetClaim(arg0 context.Context, arg1 address.Address, arg2 verifreg.ClaimId, arg3 types.TipSetKey) (*verifreg.Claim, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetClaim", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(*verifreg.Claim)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetClaim indicates an expected call of StateGetClaim.
func (mr *MockFullNodeMockRecorder) StateGetClaim(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetClaim", reflect.TypeOf((*MockFullNode)(nil).StateGetClaim), arg0, arg1, arg2, arg3)
}
// StateGetClaims mocks base method.
func (m *MockFullNode) StateGetClaims(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (map[verifreg.ClaimId]verifreg.Claim, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetClaims", arg0, arg1, arg2)
ret0, _ := ret[0].(map[verifreg.ClaimId]verifreg.Claim)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StateGetClaims indicates an expected call of StateGetClaims.
func (mr *MockFullNodeMockRecorder) StateGetClaims(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetClaims", reflect.TypeOf((*MockFullNode)(nil).StateGetClaims), arg0, arg1, arg2)
}
// StateGetNetworkParams mocks base method.
func (m *MockFullNode) StateGetNetworkParams(arg0 context.Context) (*api.NetworkParams, error) {
m.ctrl.T.Helper()
+2 -2
View File
@@ -4,7 +4,7 @@ import (
"context"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
@@ -12,7 +12,7 @@ import (
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/lotus/api"
+2
View File
@@ -7,6 +7,8 @@ import (
type FullNode = api.FullNode
type FullNodeStruct = api.FullNodeStruct
type RawFullNodeAPI FullNode
func PermissionedFullAPI(a FullNode) FullNode {
return api.PermissionedFullAPI(a)
}
+6 -2
View File
@@ -181,18 +181,22 @@ func (bs *AutobatchBlockstore) Get(ctx context.Context, c cid.Cid) (block.Block,
}
bs.stateLock.Lock()
defer bs.stateLock.Unlock()
v, ok := bs.flushingBatch.blockMap[c]
if ok {
bs.stateLock.Unlock()
return v, nil
}
v, ok = bs.bufferedBatch.blockMap[c]
if ok {
bs.stateLock.Unlock()
return v, nil
}
bs.stateLock.Unlock()
return bs.Get(ctx, c)
// We have to check the backing store one more time because it may have been flushed by the
// time we were able to take the lock above.
return bs.backingBs.Get(ctx, c)
}
func (bs *AutobatchBlockstore) DeleteBlock(context.Context, cid.Cid) error {
+5
View File
@@ -4,6 +4,7 @@ import (
"context"
"testing"
ipld "github.com/ipfs/go-ipld-format"
"github.com/stretchr/testify/require"
)
@@ -29,6 +30,10 @@ func TestAutobatchBlockstore(t *testing.T) {
require.NoError(t, err)
require.Equal(t, b2.RawData(), v2.RawData())
// Regression test for a deadlock.
_, err = ab.Get(ctx, b3.Cid())
require.True(t, ipld.IsNotFound(err))
require.NoError(t, ab.Flush(ctx))
require.NoError(t, ab.Shutdown(ctx))
}
+1 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package badgerbs
import (
+1 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package badgerbs
import (
+1 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package splitstore
import (
@@ -519,6 +519,7 @@ func (s *SplitStore) applyProtectors() error {
// - At this point we are ready to begin purging:
// - We sort cold objects heaviest first, so as to never delete the consituents of a DAG before the DAG itself (which would leave dangling references)
// - We delete in small batches taking a lock; each batch is checked again for marks, from the concurrent transactional mark, so as to never delete anything live
//
// - We then end the transaction and compact/gc the hotstore.
func (s *SplitStore) compact(curTs *types.TipSet) {
log.Info("waiting for active views to complete")
+1 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package splitstore
import (
+1 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package blockstore
import (
+3 -4
View File
@@ -12,10 +12,9 @@ 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 deletes) are broadcast to all stores.
//
// - Reads return from the first blockstore that has the value, querying in the
// supplied order.
// - Writes (puts and deletes) are broadcast to all stores.
func Union(stores ...Blockstore) Blockstore {
return unionBlockstore(stores)
}
+2 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package blockstore
import (
@@ -13,6 +13,7 @@ var (
b0 = blocks.NewBlock([]byte("abc"))
b1 = blocks.NewBlock([]byte("foo"))
b2 = blocks.NewBlock([]byte("bar"))
b3 = blocks.NewBlock([]byte("baz"))
)
func TestUnionBlockstore_Get(t *testing.T) {
Binary file not shown.
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"path"
"strings"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/filecoin-project/lotus/lib/addrutil"
)
+2 -2
View File
@@ -1,2 +1,2 @@
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWSUZhAY3eyoPUboJ1ZWe4dNPFWTr1EPoDjbTDSAN15uhY
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWDfvNrSRVGWAGbn3sm9C8z98W2x25qCZjaXGHXmGiH24e
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWKeDMuJbouvypr1nL2qRruhNVXzv4QiLsZRh6gnvLkc7p
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWSsACNHLGoJbPqeitNY7tom19Nxq8x5ag36eTwmgcAeLo
+4 -4
View File
@@ -1,4 +1,4 @@
/dns4/bootstrap-0.calibration.fildev.network/tcp/1347/p2p/12D3KooWJkikQQkxS58spo76BYzFt4fotaT5NpV2zngvrqm4u5ow
/dns4/bootstrap-1.calibration.fildev.network/tcp/1347/p2p/12D3KooWLce5FDHR4EX4CrYavphA5xS3uDsX6aoowXh5tzDUxJav
/dns4/bootstrap-2.calibration.fildev.network/tcp/1347/p2p/12D3KooWA9hFfQG9GjP6bHeuQQbMD3FDtZLdW1NayxKXUT26PQZu
/dns4/bootstrap-3.calibration.fildev.network/tcp/1347/p2p/12D3KooWMHDi3LVTFG8Szqogt7RkNXvonbQYqSazxBx41A5aeuVz
/dns4/bootstrap-0.calibration.fildev.network/tcp/1347/p2p/12D3KooWCi2w8U4DDB9xqrejb5KYHaQv2iA2AJJ6uzG3iQxNLBMy
/dns4/bootstrap-1.calibration.fildev.network/tcp/1347/p2p/12D3KooWDTayrBojBn9jWNNUih4nNQQBGJD7Zo3gQCKgBkUsS6dp
/dns4/bootstrap-2.calibration.fildev.network/tcp/1347/p2p/12D3KooWNRxTHUn8bf7jz1KEUPMc2dMgGfa4f8ZJTsquVSn3vHCG
/dns4/bootstrap-3.calibration.fildev.network/tcp/1347/p2p/12D3KooWFWUqE9jgXvcKHWieYs9nhyp6NF4ftwLGAHm4sCv73jjK
+8 -6
View File
@@ -18,6 +18,8 @@ import (
"github.com/ipld/go-car"
"golang.org/x/xerrors"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
@@ -28,14 +30,14 @@ var embeddedBuiltinActorReleases embed.FS
func init() {
if BundleOverrides == nil {
BundleOverrides = make(map[actors.Version]string)
BundleOverrides = make(map[actorstypes.Version]string)
}
for _, av := range actors.Versions {
path := os.Getenv(fmt.Sprintf("LOTUS_BUILTIN_ACTORS_V%d_BUNDLE", av))
if path == "" {
continue
}
BundleOverrides[actors.Version(av)] = path
BundleOverrides[actorstypes.Version(av)] = path
}
if err := loadManifests(NetworkBundle); err != nil {
panic(err)
@@ -55,7 +57,7 @@ func UseNetworkBundle(netw string) error {
}
func loadManifests(netw string) error {
overridden := make(map[actors.Version]struct{})
overridden := make(map[actorstypes.Version]struct{})
var newMetadata []*BuiltinActorsMetadata
// First, prefer overrides.
for av, path := range BundleOverrides {
@@ -94,7 +96,7 @@ func loadManifests(netw string) error {
type BuiltinActorsMetadata struct {
Network string
Version actors.Version
Version actorstypes.Version
ManifestCid cid.Cid
Actors map[string]cid.Cid
}
@@ -182,7 +184,7 @@ func readEmbeddedBuiltinActorsMetadata(bundle string) ([]*BuiltinActorsMetadata,
}
bundles = append(bundles, &BuiltinActorsMetadata{
Network: name,
Version: actors.Version(version),
Version: actorstypes.Version(version),
ManifestCid: root,
Actors: actorCids,
})
@@ -229,7 +231,7 @@ func readBundleManifest(r io.Reader) (cid.Cid, map[string]cid.Cid, error) {
}
// GetEmbeddedBuiltinActorsBundle returns the builtin-actors bundle for the given actors version.
func GetEmbeddedBuiltinActorsBundle(version actors.Version) ([]byte, bool) {
func GetEmbeddedBuiltinActorsBundle(version actorstypes.Version) ([]byte, bool) {
fi, err := embeddedBuiltinActorReleases.Open(fmt.Sprintf("actors/v%d.tar.zst", version))
if err != nil {
return nil, false
+126
View File
@@ -23,6 +23,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"system": MustParseCid("bafk2bzacec6xctjxybp7r3kkhase56o6jsaiua7ure5ttu2xfuojt4jhlsoa6"),
"verifiedregistry": MustParseCid("bafk2bzacec2hcqlqcfacylfcrhhliwkisvh4y3adwt47xkf2gdvodwu6ccepc"),
},
}, {
Network: "butterflynet",
Version: 9,
ManifestCid: MustParseCid("bafy2bzacec35by4erhcdgcsgzp7yb3j57utydlxxfc73m3k5pep67ehvvyv6i"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceajsdln7v4chxqoukiw7lxw6aexg5qdsaex2hgelz2sbu24iblhzg"),
"cron": MustParseCid("bafk2bzacecgrwmgnqhybn3l23uvwf2n2vrcfjrprfzgd44uxers2pgr5mhsue"),
"datacap": MustParseCid("bafk2bzacebyier2ceh27acbrq2ccv4efvzotl6qntnlrxdsrik6i4tembz6qw"),
"init": MustParseCid("bafk2bzaceberhto43wnf4pklkd4c7d36kzslngyzyms4op7shxuswv3dtvfxu"),
"multisig": MustParseCid("bafk2bzaceaclpbrhoqdruvsuqqgknvy2k5dywzmjoehk4uarce3uvt3w2rewu"),
"paymentchannel": MustParseCid("bafk2bzacedzp56g5cg73oilloak3kf7u667rdkd5pgnhe2cljmr3o7ykcrzuk"),
"reward": MustParseCid("bafk2bzacebczbwfbbi6mvppbjcozatasjiaohvjjiqcy65ccuuyyw3xiixhk2"),
"storagemarket": MustParseCid("bafk2bzaceawqexy6t2ybzh3jjwhbs7icbg5vqnedbbge4e4r4pfp7spkcadsu"),
"storageminer": MustParseCid("bafk2bzacearemd7pn2jj26fdtqd4di27lfhpng3vp5chepm7qnmdzgiqr6wfi"),
"storagepower": MustParseCid("bafk2bzaceddc7fiaxfobfegqaobf5xinjgmhsa5iu4yi6klvc3jmjimcdvgyg"),
"system": MustParseCid("bafk2bzacedylltr57b2n6zpadh4i2c2kis4fzzvhao3kgvfaggrrbqyacew7q"),
"verifiedregistry": MustParseCid("bafk2bzacecjkesz766626ab4svnzpq3jfs26a75vfktlfaku5fjdao2eyiqyq"),
},
}, {
Network: "calibrationnet",
Version: 8,
@@ -40,6 +58,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"system": MustParseCid("bafk2bzaceaqrkllksxv2jsfgjvmuewx5vbzrammw5mdscod6gkdr3ijih2q64"),
"verifiedregistry": MustParseCid("bafk2bzaceaihibfu625lbtzdp3tcftscshrmbgghgrc7kzqhxn4455pycpdkm"),
},
}, {
Network: "calibrationnet",
Version: 9,
ManifestCid: MustParseCid("bafy2bzacedbedgynklc4dgpyxippkxmba2mgtw7ecntoneclsvvl4klqwuyyy"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceavfgpiw6whqigmskk74z4blm22nwjfnzxb4unlqz2e4wg3c5ujpw"),
"cron": MustParseCid("bafk2bzaceb7hxmudhvkizszbmmf2ur2qfnfxfkok3xmbrlifylx6huw4bb3s4"),
"datacap": MustParseCid("bafk2bzaceanmwcfjfj65xy275rrfqqgoblnuqirdg6zwhc6qhbfhpphomvceu"),
"init": MustParseCid("bafk2bzaceczqxpivlxifdo5ohr2rx5ny4uyvssm6tkf7am357xm47x472yxu2"),
"multisig": MustParseCid("bafk2bzacec6gmi7ucukr3bk67akaxwngohw3lsg3obvdazhmfhdzflkszk3tg"),
"paymentchannel": MustParseCid("bafk2bzacec4kg3bfjtssvv2b4wizlbdk3pdtrg5aknzgeb3a6rmksgurpynca"),
"reward": MustParseCid("bafk2bzacebpptqhcw6mcwdj576dgpryapdd2zfexxvqzlh3aoc24mabwgmcss"),
"storagemarket": MustParseCid("bafk2bzacebkfcnc27d3agm2bhzzbvvtbqahmvy2b2nf5xyj4aoxehow3bules"),
"storageminer": MustParseCid("bafk2bzacebz4na3nq4gmumghegtkaofrv4nffiihd7sxntrryfneusqkuqodm"),
"storagepower": MustParseCid("bafk2bzaceburxajojmywawjudovqvigmos4dlu4ifdikogumhso2ca2ccaleo"),
"system": MustParseCid("bafk2bzaceaue3nzucbom3tcclgyaahy3iwvbqejsxrohiquakvvsjgbw3shac"),
"verifiedregistry": MustParseCid("bafk2bzacebh7dj6j7yi5vadh7lgqjtq42qi2uq4n6zy2g5vjeathacwn2tscu"),
},
}, {
Network: "caterpillarnet",
Version: 8,
@@ -57,6 +93,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"system": MustParseCid("bafk2bzacebu47th3xerlngqavlipb6cfu2utljkxxzgadc3totogto2tmx2jc"),
"verifiedregistry": MustParseCid("bafk2bzaceci3niq3rmbcmepgn27zvlgci6d5t4dvthx3pbmmx3wcu5elova6i"),
},
}, {
Network: "caterpillarnet",
Version: 9,
ManifestCid: MustParseCid("bafy2bzacedo6tmei6rzjaaddh2yffe5xgr6w4smnadofjhomc3saiv3ubplqe"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacebb32htqlwcwiotyvtbeehfmluu2ubjnepo57gelelwitudrstwba"),
"cron": MustParseCid("bafk2bzaceatvkww7soy4a6onu6xhe7pzkdzkqw46ywuu56yv3ncl76xpotzqu"),
"datacap": MustParseCid("bafk2bzaced57nk7i7w6qmbosy4gd6atme6yppesdgjllou6nppbti5yw6glcg"),
"init": MustParseCid("bafk2bzacedtoputbtz573ytg4yo5wbbg7fbhrzplux4uknxrb2jarifcuxxou"),
"multisig": MustParseCid("bafk2bzacec22z3xz45mbwgtliwkj7ngc43bervnt557c6dqsg6aesatpd5isy"),
"paymentchannel": MustParseCid("bafk2bzacedym7xnaxr2igfq72rttj2adqyqqfxk3j4qovp2bcwqk5paoe4t7e"),
"reward": MustParseCid("bafk2bzacedemsmbmbtk5toprmm6jivjq3wkxumavc65vpvm6ngspgjfkth7z6"),
"storagemarket": MustParseCid("bafk2bzacecb53mmklf4rbv263dvufqj3nsf7mi6zk2tjlgwmzbr633kw3ds3w"),
"storageminer": MustParseCid("bafk2bzacea3wljpn2ixgnd4lovr6yckiwd652ytcrz5amgj47lg6drjhgggqa"),
"storagepower": MustParseCid("bafk2bzaceakvohgvovpeldb6hjfg7readxo37a5h4qauis4nz6pte7mcll6c2"),
"system": MustParseCid("bafk2bzacecisuqj2ln7ep72xaejvs2lrgh2logc7retxxpd3qvobymwyz7bxo"),
"verifiedregistry": MustParseCid("bafk2bzacebyjosiripwqyf56yhjfs5hg26mch7totsqth4rgpt5j32hqg6ric"),
},
}, {
Network: "devnet",
Version: 8,
@@ -74,6 +128,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"system": MustParseCid("bafk2bzacecf7eta2stfd3cnuxzervd33imbvlaqq6b5tsho7pxmhifrybreru"),
"verifiedregistry": MustParseCid("bafk2bzaceaajgtglewgitshgdi2nzrvq7eihjtyqj5yiamesqun2hujl3xev2"),
},
}, {
Network: "devnet",
Version: 9,
ManifestCid: MustParseCid("bafy2bzacedozk3jh2j4nobqotkbofodq4chbrabioxbfrygpldgoxs3zwgggk"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaced5llqnqqhypolyuogz3h2wjomugqkrhyhocvly3aoib4c5xiush6"),
"cron": MustParseCid("bafk2bzaceahwdt32ji53mo5yz6imvztz3s3g2ra5uz3jdfa77j7hqcnq6r4l2"),
"datacap": MustParseCid("bafk2bzaceabcxoy5iscdierasorjoj6xzqgnnb5pmrr7prkuibw4yggx3v2d2"),
"init": MustParseCid("bafk2bzaceastwn42kqyztz7uzej7l4lemp5nakqqsfvksry7k75q5ombhprme"),
"multisig": MustParseCid("bafk2bzacebeiygkjupkpfxcrsidci4bvn6afkvx4lsj3ut3ywhsj654pzfgk4"),
"paymentchannel": MustParseCid("bafk2bzacedhsdoo4ww47rm44pizu5qqpho753cizzbbvnd5yz3nm3347su5cy"),
"reward": MustParseCid("bafk2bzacebzqvisqe3iaodtxq7l2lgzwfkxznrnp676ddpllqcpvuae5i33le"),
"storagemarket": MustParseCid("bafk2bzaceduauegz4nniegh667btjhg2anipwpxeb664s4ossq2ifvuqwqlso"),
"storageminer": MustParseCid("bafk2bzacec23wjdmbm5pt6pqsbjb3w6j7vyrolijz2mysvp6clllfgpmhb6ge"),
"storagepower": MustParseCid("bafk2bzacebnyywv46n2ghg62inllwpmnyuwtoz57fn5lpgpf436mahajg4qrg"),
"system": MustParseCid("bafk2bzacebgafb6h2o2g5whrujc2uvsttrussyc5t56rvhrjqkqhzdu4jopwa"),
"verifiedregistry": MustParseCid("bafk2bzacednorhcy446agy7ecpmfms2u4aoa3mj2eqomffuoerbik5yavrxyi"),
},
}, {
Network: "mainnet",
Version: 8,
@@ -91,6 +163,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"system": MustParseCid("bafk2bzacedwq5uppsw7vp55zpj7jdieizirmldceehu6wvombw3ixq2tcq57w"),
"verifiedregistry": MustParseCid("bafk2bzaceb3zbkjz3auizmoln2unmxep7dyfcmsre64vnqfhdyh7rkqfoxlw4"),
},
}, {
Network: "mainnet",
Version: 9,
ManifestCid: MustParseCid("bafy2bzaceb6j6666h36xnhksu3ww4kxb6e25niayfgkdnifaqi6m6ooc66i6i"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacect2p7urje3pylrrrjy3tngn6yaih4gtzauuatf2jllk3ksgfiw2y"),
"cron": MustParseCid("bafk2bzacebcec3lffmos3nawm5cvwehssxeqwxixoyyfvejy7viszzsxzyu26"),
"datacap": MustParseCid("bafk2bzacebb6uy2ys7tapekmtj7apnjg7oyj4ia5t7tlkvbmwtxwv74lb2pug"),
"init": MustParseCid("bafk2bzacebtdq4zyuxk2fzbdkva6kc4mx75mkbfmldplfntayhbl5wkqou33i"),
"multisig": MustParseCid("bafk2bzacec4va3nmugyqjqrs3lqyr2ij67jhjia5frvx7omnh2isha6abxzya"),
"paymentchannel": MustParseCid("bafk2bzacebhdvjbjcgupklddfavzef4e4gnkt3xk3rbmgfmk7xhecszhfxeds"),
"reward": MustParseCid("bafk2bzacebezgbbmcm2gbcqwisus5fjvpj7hhmu5ubd37phuku3hmkfulxm2o"),
"storagemarket": MustParseCid("bafk2bzacec3j7p6gklk64stax5px3xxd7hdtejaepnd4nw7s2adihde6emkcu"),
"storageminer": MustParseCid("bafk2bzacedyux5hlrildwutvvjdcsvjtwsoc5xnqdjl73ouiukgklekeuyfl4"),
"storagepower": MustParseCid("bafk2bzacedsetphfajgne4qy3vdrpyd6ekcmtfs2zkjut4r34cvnuoqemdrtw"),
"system": MustParseCid("bafk2bzaceagvlo2jtahj7dloshrmwfulrd6e2izqev32qm46eumf754weec6c"),
"verifiedregistry": MustParseCid("bafk2bzacecf3yodlyudzukumehbuabgqljyhjt5ifiv4vetcfohnvsxzynwga"),
},
}, {
Network: "testing",
Version: 8,
@@ -108,6 +198,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"system": MustParseCid("bafk2bzaced6kjkbv7lrb2qwq5we2hqaxc6ztch5p52g27qtjy45zdemsk4b7m"),
"verifiedregistry": MustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"),
},
}, {
Network: "testing",
Version: 9,
ManifestCid: MustParseCid("bafy2bzacecnnrmekqw2xvud46g3vo6x26cogh3ydgljqajlxqxzzbuxsjlwjm"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceaiebfiuu76zoywzltelio2zuvsavirka27ur6kspn7scvcl5cuiy"),
"cron": MustParseCid("bafk2bzacecla36w3tbwap5jgdtooxsud25mdpc75kgtjs34mi4xhwygph2gki"),
"datacap": MustParseCid("bafk2bzaced5h3ct6i7oqpyimkj3hwdywmux5tslu5vs2ywbzruqmxjtqczygs"),
"init": MustParseCid("bafk2bzaceauxqpspnvui7dryuvfgzoogatbkbahp4ovaih734blwi4bassnlm"),
"multisig": MustParseCid("bafk2bzaceddfagxfpsihjxq7yt4ditv2tcoou5w4hzbsapadlw3v44cxfcqpi"),
"paymentchannel": MustParseCid("bafk2bzaced4nc4ofrbqevpwrt7fnf3beshi5ccrecq3zojt2sxgrkz7ebnbh4"),
"reward": MustParseCid("bafk2bzacedxleepeg4ei3jnayzcfz6shi25rrvoyhr6fxmkdezq4owrazi7rq"),
"storagemarket": MustParseCid("bafk2bzaceakqcjpppg3exrr7dru7jglvno2xyw4hsuebxay4lvrzvmwmv5kvu"),
"storageminer": MustParseCid("bafk2bzacealfvphicwnysmmyyerseppyvydy2reisvbft46vdprp2lnfvlgqc"),
"storagepower": MustParseCid("bafk2bzaceageil5b5mr5uwo6vqs4nnnmpiwe3fkjffzyngcicuu7gruuwapjm"),
"system": MustParseCid("bafk2bzacedo4pu3iwx2gu72hinsstpiokhl5iicnb3rumzffsnhy7zhmnxhyy"),
"verifiedregistry": MustParseCid("bafk2bzaceatmqip2o3ausbntvdhj7yemu6hb3b5yqv6hm42gylbbmz7geocpm"),
},
}, {
Network: "testing-fake-proofs",
Version: 8,
@@ -125,4 +233,22 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"system": MustParseCid("bafk2bzaced6kjkbv7lrb2qwq5we2hqaxc6ztch5p52g27qtjy45zdemsk4b7m"),
"verifiedregistry": MustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"),
},
}, {
Network: "testing-fake-proofs",
Version: 9,
ManifestCid: MustParseCid("bafy2bzacecql2gj2tri4fnbznmldue73qzt6zszvugw4exd64mwb52zrhv7k2"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceaiebfiuu76zoywzltelio2zuvsavirka27ur6kspn7scvcl5cuiy"),
"cron": MustParseCid("bafk2bzacecla36w3tbwap5jgdtooxsud25mdpc75kgtjs34mi4xhwygph2gki"),
"datacap": MustParseCid("bafk2bzaced5h3ct6i7oqpyimkj3hwdywmux5tslu5vs2ywbzruqmxjtqczygs"),
"init": MustParseCid("bafk2bzaceauxqpspnvui7dryuvfgzoogatbkbahp4ovaih734blwi4bassnlm"),
"multisig": MustParseCid("bafk2bzaceddfagxfpsihjxq7yt4ditv2tcoou5w4hzbsapadlw3v44cxfcqpi"),
"paymentchannel": MustParseCid("bafk2bzaced4nc4ofrbqevpwrt7fnf3beshi5ccrecq3zojt2sxgrkz7ebnbh4"),
"reward": MustParseCid("bafk2bzacedxleepeg4ei3jnayzcfz6shi25rrvoyhr6fxmkdezq4owrazi7rq"),
"storagemarket": MustParseCid("bafk2bzaceakqcjpppg3exrr7dru7jglvno2xyw4hsuebxay4lvrzvmwmv5kvu"),
"storageminer": MustParseCid("bafk2bzaceab3cjrwwwfemyc5lw73w6tibpgxtx3wuzjhami6tvhcvetygdm7m"),
"storagepower": MustParseCid("bafk2bzaceafemwhsy3e7ueqsrn3f7n53vdqkvfbig3hgbw7eohsefnfvgq7yc"),
"system": MustParseCid("bafk2bzacedo4pu3iwx2gu72hinsstpiokhl5iicnb3rumzffsnhy7zhmnxhyy"),
"verifiedregistry": MustParseCid("bafk2bzaceatmqip2o3ausbntvdhj7yemu6hb3b5yqv6hm42gylbbmz7geocpm"),
},
}}
+6 -4
View File
@@ -5,6 +5,8 @@ import (
"github.com/stretchr/testify/require"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
)
@@ -19,16 +21,16 @@ func TestEmbeddedMetadata(t *testing.T) {
// Test that we're registering the manifest correctly.
func TestRegistration(t *testing.T) {
manifestCid, found := actors.GetManifest(actors.Version8)
manifestCid, found := actors.GetManifest(actorstypes.Version8)
require.True(t, found)
require.True(t, manifestCid.Defined())
for _, key := range actors.GetBuiltinActorsKeys() {
actorCid, found := actors.GetActorCodeID(actors.Version8, key)
for _, key := range actors.GetBuiltinActorsKeys(actorstypes.Version8) {
actorCid, found := actors.GetActorCodeID(actorstypes.Version8, key)
require.True(t, found)
name, version, found := actors.GetActorMetaByCode(actorCid)
require.True(t, found)
require.Equal(t, actors.Version8, version)
require.Equal(t, actorstypes.Version8, version)
require.Equal(t, key, name)
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package build
import (
+5 -2
View File
@@ -10,9 +10,9 @@ import (
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
@@ -20,7 +20,7 @@ const BootstrappersFile = ""
const GenesisFile = ""
var NetworkBundle = "devnet"
var BundleOverrides map[actors.Version]string
var BundleOverrides map[actorstypes.Version]string
const GenesisNetworkVersion = network.Version16
@@ -56,6 +56,8 @@ var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
var UpgradeSkyrHeight = abi.ChainEpoch(-19)
var UpgradeSharkHeight = abi.ChainEpoch(100)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
@@ -107,6 +109,7 @@ func init() {
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
UpgradeSkyrHeight = getUpgradeHeight("LOTUS_SKYR_HEIGHT", UpgradeSkyrHeight)
UpgradeSharkHeight = getUpgradeHeight("LOTUS_SHARK_HEIGHT", UpgradeSharkHeight)
BuildType |= Build2k
+5 -6
View File
@@ -8,10 +8,10 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
@@ -19,10 +19,10 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
const GenesisNetworkVersion = network.Version15
const GenesisNetworkVersion = network.Version16
var NetworkBundle = "butterflynet"
var BundleOverrides map[actors.Version]string
var BundleOverrides map[actorstypes.Version]string
const BootstrappersFile = "butterflynet.pi"
const GenesisFile = "butterflynet.car"
@@ -47,10 +47,9 @@ const UpgradeNorwegianHeight = -14
const UpgradeTurboHeight = -15
const UpgradeHyperdriveHeight = -16
const UpgradeChocolateHeight = -17
const UpgradeOhSnapHeight = -18
const UpgradeSkyrHeight = abi.ChainEpoch(50)
const UpgradeSkyrHeight = -19
const UpgradeSharkHeight = abi.ChainEpoch(600)
var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg512MiBV1,
+26 -8
View File
@@ -4,14 +4,17 @@
package build
import (
"os"
"strconv"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
@@ -22,7 +25,7 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
const GenesisNetworkVersion = network.Version0
var NetworkBundle = "calibrationnet"
var BundleOverrides map[actors.Version]string
var BundleOverrides map[actorstypes.Version]string
const BootstrappersFile = "calibnet.pi"
const GenesisFile = "calibnet.car"
@@ -58,13 +61,13 @@ const UpgradeTurboHeight = 390
const UpgradeHyperdriveHeight = 420
const UpgradeChocolateHeight = 312746
const UpgradeChocolateHeight = 450
// 2022-02-10T19:23:00Z
const UpgradeOhSnapHeight = 682006
const UpgradeOhSnapHeight = 480
// 2022-06-16T17:30:00Z
const UpgradeSkyrHeight = 1044660
const UpgradeSkyrHeight = 510
const UpgradeSharkHeight = 16800 // 6 days after genesis
var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
@@ -84,13 +87,28 @@ func init() {
Devnet = true
// NOTE: DO NOT change this unless you REALLY know what you're doing. This is not consensus critical, however,
//set this value too high may impacts your block submission; set this value too low may cause you miss
//parent tipsets for blocking forming and mining.
if len(os.Getenv("PROPAGATION_DELAY_SECS")) != 0 {
pds, err := strconv.ParseUint(os.Getenv("PROPAGATION_DELAY_SECS"), 10, 64)
if err != nil {
log.Warnw("Error setting PROPAGATION_DELAY_SECS, %v, proceed with default value %s", err,
PropagationDelaySecs)
} else {
PropagationDelaySecs = pds
log.Warnw(" !!WARNING!! propagation delay is set to be %s second, "+
"this value impacts your message republish interval and block forming - monitor with caution!!", PropagationDelaySecs)
}
}
BuildType = BuildCalibnet
}
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
const PropagationDelaySecs = uint64(6)
var PropagationDelaySecs = uint64(10)
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
const BootstrapPeerThreshold = 4
+7 -10
View File
@@ -11,20 +11,20 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
var NetworkBundle = "caterpillarnet"
var BundleOverrides map[actors.Version]string
var BundleOverrides map[actorstypes.Version]string
const BootstrappersFile = "interopnet.pi"
const GenesisFile = "interopnet.car"
const GenesisNetworkVersion = network.Version15
const GenesisNetworkVersion = network.Version16
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
@@ -34,26 +34,22 @@ var UpgradeSmokeHeight = abi.ChainEpoch(-1)
var UpgradeIgnitionHeight = abi.ChainEpoch(-2)
var UpgradeRefuelHeight = abi.ChainEpoch(-3)
var UpgradeTapeHeight = abi.ChainEpoch(-4)
var UpgradeAssemblyHeight = abi.ChainEpoch(-5)
var UpgradeLiftoffHeight = abi.ChainEpoch(-6)
var UpgradeKumquatHeight = abi.ChainEpoch(-7)
var UpgradeCalicoHeight = abi.ChainEpoch(-9)
var UpgradePersianHeight = abi.ChainEpoch(-10)
var UpgradeOrangeHeight = abi.ChainEpoch(-11)
var UpgradeClausHeight = abi.ChainEpoch(-12)
var UpgradeTrustHeight = abi.ChainEpoch(-13)
var UpgradeNorwegianHeight = abi.ChainEpoch(-14)
var UpgradeTurboHeight = abi.ChainEpoch(-15)
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
var UpgradeChocolateHeight = abi.ChainEpoch(-17)
var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
var UpgradeSkyrHeight = abi.ChainEpoch(100)
var UpgradeSkyrHeight = abi.ChainEpoch(-19)
const UpgradeSharkHeight = abi.ChainEpoch(99999999999999)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
@@ -107,6 +103,7 @@ func init() {
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
UpgradeSkyrHeight = getUpgradeHeight("LOTUS_SKYR_HEIGHT", UpgradeSkyrHeight)
UpgradeSharkHeight = getUpgradeHeight("LOTUS_SHARK_HEIGHT", UpgradeSharkHeight)
BuildType |= BuildInteropnet
SetAddressNetwork(address.Testnet)
+25 -8
View File
@@ -6,13 +6,13 @@ package build
import (
"math"
"os"
"strconv"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors"
)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
@@ -23,7 +23,7 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
var NetworkBundle = "mainnet"
// NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical.
var BundleOverrides map[actors.Version]string
var BundleOverrides map[actorstypes.Version]string
const GenesisNetworkVersion = network.Version0
@@ -77,7 +77,10 @@ const UpgradeChocolateHeight = 1231620
const UpgradeOhSnapHeight = 1594680
// 2022-07-06T14:00:00Z
var UpgradeSkyrHeight = abi.ChainEpoch(1960320)
const UpgradeSkyrHeight = 1960320
// 2022-11-30T14:00:00Z
var UpgradeSharkHeight = abi.ChainEpoch(2383680)
var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
@@ -86,14 +89,30 @@ var SupportedProofTypes = []abi.RegisteredSealProof{
var ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
var PreCommitChallengeDelay = abi.ChainEpoch(150)
var PropagationDelaySecs = uint64(10)
func init() {
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
SetAddressNetwork(address.Mainnet)
}
if os.Getenv("LOTUS_DISABLE_SKYR") == "1" {
UpgradeSkyrHeight = math.MaxInt64
if os.Getenv("LOTUS_DISABLE_SHARK") == "1" {
UpgradeSharkHeight = math.MaxInt64
}
// NOTE: DO NOT change this unless you REALLY know what you're doing. This is not consensus critical, however,
//set this value too high may impacts your block submission; set this value too low may cause you miss
//parent tipsets for blocking forming and mining.
if len(os.Getenv("PROPAGATION_DELAY_SECS")) != 0 {
pds, err := strconv.ParseUint(os.Getenv("PROPAGATION_DELAY_SECS"), 10, 64)
if err != nil {
log.Warnw("Error setting PROPAGATION_DELAY_SECS, %v, proceed with default value %s", err,
PropagationDelaySecs)
} else {
PropagationDelaySecs = pds
log.Warnw(" !!WARNING!! propagation delay is set to be %s second, "+
"this value impacts your message republish interval and block forming - monitor with caution!!", PropagationDelaySecs)
}
}
Devnet = false
@@ -103,8 +122,6 @@ func init() {
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 -1
View File
@@ -2,7 +2,7 @@ package build
import (
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/filecoin-project/go-address"
+6 -5
View File
@@ -26,14 +26,14 @@ const UnixfsLinksPerLevel = 1024
const AllowableClockDriftSecs = uint64(1)
// TODO: This is still terrible...What's the impact of updating this before mainnet actually upgrades
// Used by tests and some obscure tooling
/* inline-gen template
const NewestNetworkVersion = network.Version{{.latestNetworkVersion}}
const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
/* inline-gen start */
const NewestNetworkVersion = network.Version16
const TestNetworkVersion = network.Version17
/* inline-gen end */
@@ -118,8 +118,9 @@ const VerifSigCacheSize = 32000
// TODO: If this is gonna stay, it should move to specs-actors
const BlockMessageLimit = 10000
const BlockGasLimit = 10_000_000_000
const BlockGasTarget = BlockGasLimit / 2
var BlockGasLimit = int64(10_000_000_000)
var BlockGasTarget = BlockGasLimit / 2
const BaseFeeMaxChangeDenom = 8 // 12.5%
const InitialBaseFee = 100e6
const MinimumBaseFee = 100
+5 -5
View File
@@ -5,7 +5,6 @@
//
// Its purpose is to unlock various degrees of flexibility and parametrization
// when writing Testground plans for Lotus.
//
package build
import (
@@ -14,10 +13,10 @@ import (
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
@@ -108,6 +107,7 @@ var (
UpgradeChocolateHeight abi.ChainEpoch = -16
UpgradeOhSnapHeight abi.ChainEpoch = -17
UpgradeSkyrHeight abi.ChainEpoch = -18
UpgradeSharkHeight abi.ChainEpoch = -19
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
@@ -115,10 +115,10 @@ var (
GenesisNetworkVersion = network.Version0
NetworkBundle = "devnet"
BundleOverrides map[actors.Version]string
BundleOverrides map[actorstypes.Version]string
NewestNetworkVersion = network.Version15
ActorUpgradeNetworkVersion = network.Version15
NewestNetworkVersion = network.Version16
ActorUpgradeNetworkVersion = network.Version16
Devnet = true
ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a")
+1 -1
View File
@@ -37,7 +37,7 @@ func BuildTypeString() string {
}
// BuildVersion is the local build version
const BuildVersion = "1.17.1"
const BuildVersion = "1.18.2"
func UserVersion() string {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
+82 -81
View File
@@ -4,6 +4,7 @@ import (
"github.com/ipfs/go-cid"
"golang.org/x/xerrors"
actorstypes "github.com/filecoin-project/go-state-types/actors"
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"
@@ -14,10 +15,10 @@ import (
)
// GetActorCodeID looks up a builtin actor's code CID by actor version and canonical actor name.
func GetActorCodeID(av Version, name string) (cid.Cid, bool) {
func GetActorCodeID(av actorstypes.Version, name string) (cid.Cid, bool) {
// Actors V8 and above
if av >= Version8 {
if av >= actorstypes.Version8 {
if cids, ok := GetActorCodeIDsFromManifest(av); ok {
c, ok := cids[name]
return c, ok
@@ -30,275 +31,275 @@ func GetActorCodeID(av Version, name string) (cid.Cid, bool) {
case AccountKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.AccountActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.AccountActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.AccountActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.AccountActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.AccountActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.AccountActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.AccountActorCodeID, true
}
case CronKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.CronActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.CronActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.CronActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.CronActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.CronActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.CronActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.CronActorCodeID, true
}
case InitKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.InitActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.InitActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.InitActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.InitActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.InitActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.InitActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.InitActorCodeID, true
}
case MarketKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.StorageMarketActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.StorageMarketActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.StorageMarketActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.StorageMarketActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.StorageMarketActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.StorageMarketActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.StorageMarketActorCodeID, true
}
case MinerKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.StorageMinerActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.StorageMinerActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.StorageMinerActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.StorageMinerActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.StorageMinerActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.StorageMinerActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.StorageMinerActorCodeID, true
}
case MultisigKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.MultisigActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.MultisigActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.MultisigActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.MultisigActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.MultisigActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.MultisigActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.MultisigActorCodeID, true
}
case PaychKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.PaymentChannelActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.PaymentChannelActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.PaymentChannelActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.PaymentChannelActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.PaymentChannelActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.PaymentChannelActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.PaymentChannelActorCodeID, true
}
case PowerKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.StoragePowerActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.StoragePowerActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.StoragePowerActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.StoragePowerActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.StoragePowerActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.StoragePowerActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.StoragePowerActorCodeID, true
}
case RewardKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.RewardActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.RewardActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.RewardActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.RewardActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.RewardActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.RewardActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.RewardActorCodeID, true
}
case SystemKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.SystemActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.SystemActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.SystemActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.SystemActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.SystemActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.SystemActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.SystemActorCodeID, true
}
case VerifregKey:
switch av {
case Version0:
case actorstypes.Version0:
return builtin0.VerifiedRegistryActorCodeID, true
case Version2:
case actorstypes.Version2:
return builtin2.VerifiedRegistryActorCodeID, true
case Version3:
case actorstypes.Version3:
return builtin3.VerifiedRegistryActorCodeID, true
case Version4:
case actorstypes.Version4:
return builtin4.VerifiedRegistryActorCodeID, true
case Version5:
case actorstypes.Version5:
return builtin5.VerifiedRegistryActorCodeID, true
case Version6:
case actorstypes.Version6:
return builtin6.VerifiedRegistryActorCodeID, true
case Version7:
case actorstypes.Version7:
return builtin7.VerifiedRegistryActorCodeID, true
}
}
@@ -307,13 +308,13 @@ func GetActorCodeID(av Version, name string) (cid.Cid, bool) {
}
// GetActorCodeIDs looks up all builtin actor's code CIDs by actor version.
func GetActorCodeIDs(av Version) (map[string]cid.Cid, error) {
func GetActorCodeIDs(av actorstypes.Version) (map[string]cid.Cid, error) {
cids, ok := GetActorCodeIDsFromManifest(av)
if ok {
return cids, nil
}
actorsKeys := GetBuiltinActorsKeys()
actorsKeys := GetBuiltinActorsKeys(av)
synthCids := make(map[string]cid.Cid)
for _, key := range actorsKeys {
+1 -1
View File
@@ -26,7 +26,7 @@ type AdtArrayDiff interface {
// - All values that exist in preArr and not in curArr are passed to AdtArrayDiff.Remove()
// - All values that exist in curArr nnd not in prevArr are passed to adtArrayDiff.Add()
// - All values that exist in preArr and in curArr are passed to AdtArrayDiff.Modify()
// - It is the responsibility of AdtArrayDiff.Modify() to determine if the values it was passed have been modified.
// - It is the responsibility of AdtArrayDiff.Modify() to determine if the values it was passed have been modified.
func DiffAdtArray(preArr, curArr Array, out AdtArrayDiff) error {
notNew := make(map[int64]struct{}, curArr.Length())
prevVal := new(typegen.Deferred)
+1 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package adt
import (
+1 -1
View File
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package aerrors_test
import (
+45 -7
View File
@@ -27,6 +27,7 @@ var actors = map[string][]int{
"system": lotusactors.Versions,
"reward": lotusactors.Versions,
"verifreg": lotusactors.Versions,
"datacap": lotusactors.Versions[8:],
}
func main() {
@@ -44,13 +45,18 @@ func main() {
fmt.Println(err)
return
}
if err := generateRegistry("chain/actors/builtin/registry.go"); err != nil {
fmt.Println(err)
return
}
}
func generateAdapters() error {
for act, versions := range actors {
actDir := filepath.Join("chain/actors/builtin", act)
if err := generateState(actDir); err != nil {
if err := generateState(actDir, versions); err != nil {
return err
}
@@ -92,7 +98,7 @@ func generateAdapters() error {
return nil
}
func generateState(actDir string) error {
func generateState(actDir string, versions []int) error {
af, err := ioutil.ReadFile(filepath.Join(actDir, "state.go.template"))
if err != nil {
if os.IsNotExist(err) {
@@ -102,14 +108,15 @@ func generateState(actDir string) error {
return xerrors.Errorf("loading state adapter template: %w", err)
}
for _, version := range lotusactors.Versions {
for _, version := range versions {
tpl := template.Must(template.New("").Funcs(template.FuncMap{}).Parse(string(af)))
var b bytes.Buffer
err := tpl.Execute(&b, map[string]interface{}{
"v": version,
"import": getVersionImports()[version],
"v": version,
"import": getVersionImports()[version],
"latestVersion": lotusactors.LatestVersion,
})
if err != nil {
return err
@@ -139,8 +146,9 @@ func generateMessages(actDir string) error {
var b bytes.Buffer
err := tpl.Execute(&b, map[string]interface{}{
"v": version,
"import": getVersionImports()[version],
"v": version,
"import": getVersionImports()[version],
"latestVersion": lotusactors.LatestVersion,
})
if err != nil {
return err
@@ -216,6 +224,36 @@ func generateBuiltin(builtinPath string) error {
return nil
}
func generateRegistry(registryPath string) error {
bf, err := ioutil.ReadFile(registryPath + ".template")
if err != nil {
if os.IsNotExist(err) {
return nil // skip
}
return xerrors.Errorf("loading registry template file: %w", err)
}
tpl := template.Must(template.New("").Funcs(template.FuncMap{
"import": func(v int) string { return getVersionImports()[v] },
}).Parse(string(bf)))
var b bytes.Buffer
err = tpl.Execute(&b, map[string]interface{}{
"versions": lotusactors.Versions,
})
if err != nil {
return err
}
if err := ioutil.WriteFile(registryPath, b.Bytes(), 0666); err != nil {
return err
}
return nil
}
func getVersionImports() map[int]string {
versionImports := make(map[int]string, lotusactors.LatestVersion)
for _, v := range lotusactors.Versions {
+19 -12
View File
@@ -4,7 +4,8 @@ import (
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
builtin8 "github.com/filecoin-project/go-state-types/builtin"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin9 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
@@ -19,7 +20,7 @@ import (
"github.com/filecoin-project/lotus/chain/types"
)
var Methods = builtin8.MethodsAccount
var Methods = builtin9.MethodsAccount
func Load(store adt.Store, act *types.Actor) (State, error) {
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
@@ -29,9 +30,12 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
case actors.Version8:
case actorstypes.Version8:
return load8(store, act.Head)
case actorstypes.Version9:
return load9(store, act.Head)
}
}
@@ -63,33 +67,36 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actors.Version, addr address.Address) (State, error) {
func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (State, error) {
switch av {
case actors.Version0:
case actorstypes.Version0:
return make0(store, addr)
case actors.Version2:
case actorstypes.Version2:
return make2(store, addr)
case actors.Version3:
case actorstypes.Version3:
return make3(store, addr)
case actors.Version4:
case actorstypes.Version4:
return make4(store, addr)
case actors.Version5:
case actorstypes.Version5:
return make5(store, addr)
case actors.Version6:
case actorstypes.Version6:
return make6(store, addr)
case actors.Version7:
case actorstypes.Version7:
return make7(store, addr)
case actors.Version8:
case actorstypes.Version8:
return make8(store, addr)
case actorstypes.Version9:
return make9(store, addr)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@@ -1,6 +1,7 @@
package account
import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/lotus/chain/actors"
"golang.org/x/xerrors"
@@ -9,13 +10,13 @@ import (
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types"
{{range .versions}}
{{if (le . 7)}}
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
{{else}}
builtin{{.}} "github.com/filecoin-project/go-state-types/builtin"
{{end}}
{{end}}
builtin{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin"
)
var Methods = builtin{{.latestVersion}}.MethodsAccount
@@ -29,7 +30,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
{{range .versions}}
{{if (ge . 8)}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return load{{.}}(store, act.Head)
{{end}}
{{end}}
@@ -48,10 +49,10 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actors.Version, addr address.Address) (State, error) {
func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (State, error) {
switch av {
{{range .versions}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return make{{.}}(store, addr)
{{end}}
}
+40
View File
@@ -0,0 +1,40 @@
package account
import (
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
account9 "github.com/filecoin-project/go-state-types/builtin/v9/account"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state9)(nil)
func load9(store adt.Store, root cid.Cid) (State, error) {
out := state9{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make9(store adt.Store, addr address.Address) (State, error) {
out := state9{store: store}
out.State = account9.State{Address: addr}
return &out, nil
}
type state9 struct {
account9.State
store adt.Store
}
func (s *state9) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}
func (s *state9) GetState() interface{} {
return &s.State
}
+2 -6
View File
@@ -8,8 +8,8 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin"
miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner"
smoothingtypes "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing"
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/proof"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
@@ -18,7 +18,6 @@ import (
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
builtin8 "github.com/filecoin-project/specs-actors/v8/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors"
)
@@ -53,7 +52,7 @@ type PoStProof = proof.PoStProof
type FilterEstimate = smoothingtypes.FilterEstimate
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
return miner8.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
return minertypes.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
}
func ActorNameByCode(c cid.Cid) string {
@@ -84,9 +83,6 @@ func ActorNameByCode(c cid.Cid) string {
case builtin7.IsBuiltinActor(c):
return builtin7.ActorNameByCode(c)
case builtin8.IsBuiltinActor(c):
return builtin8.ActorNameByCode(c)
default:
return "<unknown>"
}
+6 -2
View File
@@ -7,7 +7,9 @@ import (
"github.com/ipfs/go-cid"
{{range .versions}}
{{if (le . 7)}}
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
{{end}}
{{end}}
"github.com/filecoin-project/go-state-types/abi"
@@ -16,7 +18,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors"
miner{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin/v8/miner"
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
smoothingtypes "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing"
)
@@ -50,7 +52,7 @@ type PoStProof = proof.PoStProof
type FilterEstimate = smoothingtypes.FilterEstimate
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
return miner{{.latestVersion}}.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
return minertypes.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
}
func ActorNameByCode(c cid.Cid) string {
@@ -60,8 +62,10 @@ func ActorNameByCode(c cid.Cid) string {
switch {
{{range .versions}}
{{if (le . 7)}}
case builtin{{.}}.IsBuiltinActor(c):
return builtin{{.}}.ActorNameByCode(c)
{{end}}
{{end}}
default:
return "<unknown>"
+5 -5
View File
@@ -1,6 +1,7 @@
package cron
import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"golang.org/x/xerrors"
@@ -9,10 +10,9 @@ import (
{{range .versions}}
{{if (le . 7)}}
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
{{else}}
builtin{{.}} "github.com/filecoin-project/go-state-types/builtin"
{{end}}
{{end}}
builtin{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin"
)
func Load(store adt.Store, act *types.Actor) (State, error) {
@@ -24,7 +24,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
{{range .versions}}
{{if (ge . 8)}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return load{{.}}(store, act.Head)
{{end}}
{{end}}
@@ -43,10 +43,10 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actors.Version) (State, error) {
func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
switch av {
{{range .versions}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return make{{.}}(store)
{{end}}
}
+20 -13
View File
@@ -3,7 +3,8 @@ package cron
import (
"golang.org/x/xerrors"
builtin8 "github.com/filecoin-project/go-state-types/builtin"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin9 "github.com/filecoin-project/go-state-types/builtin"
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"
@@ -25,9 +26,12 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
case actors.Version8:
case actorstypes.Version8:
return load8(store, act.Head)
case actorstypes.Version9:
return load9(store, act.Head)
}
}
@@ -59,40 +63,43 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actors.Version) (State, error) {
func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
switch av {
case actors.Version0:
case actorstypes.Version0:
return make0(store)
case actors.Version2:
case actorstypes.Version2:
return make2(store)
case actors.Version3:
case actorstypes.Version3:
return make3(store)
case actors.Version4:
case actorstypes.Version4:
return make4(store)
case actors.Version5:
case actorstypes.Version5:
return make5(store)
case actors.Version6:
case actorstypes.Version6:
return make6(store)
case actors.Version7:
case actorstypes.Version7:
return make7(store)
case actors.Version8:
case actorstypes.Version8:
return make8(store)
case actorstypes.Version9:
return make9(store)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
var (
Address = builtin8.CronActorAddr
Methods = builtin8.MethodsCron
Address = builtin9.CronActorAddr
Methods = builtin9.MethodsCron
)
type State interface {
+35
View File
@@ -0,0 +1,35 @@
package cron
import (
"github.com/ipfs/go-cid"
cron9 "github.com/filecoin-project/go-state-types/builtin/v9/cron"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state9)(nil)
func load9(store adt.Store, root cid.Cid) (State, error) {
out := state9{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make9(store adt.Store) (State, error) {
out := state9{store: store}
out.State = *cron9.ConstructState(cron9.BuiltInEntries())
return &out, nil
}
type state9 struct {
cron9.State
store adt.Store
}
func (s *state9) GetState() interface{} {
return &s.State
}
@@ -0,0 +1,57 @@
package datacap
import (
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types"
)
var (
Address = builtin9.DatacapActorAddr
Methods = builtin9.MethodsDatacap
)
func Load(store adt.Store, act *types.Actor) (State, error) {
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
if name != actors.DatacapKey {
return nil, xerrors.Errorf("actor code is not datacap: %s", name)
}
switch av {
{{range .versions}}
case actorstypes.Version{{.}}:
return load{{.}}(store, act.Head)
{{end}}
}
}
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actorstypes.Version, governor address.Address, bitwidth uint64) (State, error) {
switch av {
{{range .versions}}
case actorstypes.Version{{.}}:
return make{{.}}(store, governor, bitwidth)
default: return nil, xerrors.Errorf("datacap actor only valid for actors v9 and above, got %d", av)
{{end}}
}
}
type State interface {
cbor.Marshaler
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
VerifiedClientDataCap(address.Address) (bool, abi.StoragePower, error)
Governor() (address.Address, error)
GetState() interface{}
}
+58
View File
@@ -0,0 +1,58 @@
package datacap
import (
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin9 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types"
)
var (
Address = builtin9.DatacapActorAddr
Methods = builtin9.MethodsDatacap
)
func Load(store adt.Store, act *types.Actor) (State, error) {
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
if name != actors.DatacapKey {
return nil, xerrors.Errorf("actor code is not datacap: %s", name)
}
switch av {
case actorstypes.Version9:
return load9(store, act.Head)
}
}
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actorstypes.Version, governor address.Address, bitwidth uint64) (State, error) {
switch av {
case actorstypes.Version9:
return make9(store, governor, bitwidth)
default:
return nil, xerrors.Errorf("datacap actor only valid for actors v9 and above, got %d", av)
}
}
type State interface {
cbor.Marshaler
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
VerifiedClientDataCap(address.Address) (bool, abi.StoragePower, error)
Governor() (address.Address, error)
GetState() interface{}
}
@@ -0,0 +1,61 @@
package datacap
import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
datacap{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}datacap"
adt{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}util/adt"
)
var _ State = (*state{{.v}})(nil)
func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
out := state{{.v}}{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make{{.v}}(store adt.Store, governor address.Address, bitwidth uint64) (State, error) {
out := state{{.v}}{store: store}
s, err := datacap{{.v}}.ConstructState(store, governor, bitwidth)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state{{.v}} struct {
datacap{{.v}}.State
store adt.Store
}
func (s *state{{.v}}) Governor() (address.Address, error) {
return s.State.Governor, nil
}
func (s *state{{.v}}) GetState() interface{} {
return &s.State
}
func (s *state{{.v}}) ForEachClient(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachClient(s.store, actors.Version{{.v}}, s.verifiedClients, cb)
}
func (s *state{{.v}}) verifiedClients() (adt.Map, error) {
return adt{{.v}}.AsMap(s.store, s.Token.Balances, int(s.Token.HamtBitWidth))
}
func (s *state{{.v}}) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
return getDataCap(s.store, actors.Version{{.v}}, s.verifiedClients, addr)
}
+60
View File
@@ -0,0 +1,60 @@
package datacap
import (
"github.com/multiformats/go-varint"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
// taking this as a function instead of asking the caller to call it helps reduce some of the error
// checking boilerplate.
//
// "go made me do it"
type rootFunc func() (adt.Map, error)
func getDataCap(store adt.Store, ver actors.Version, root rootFunc, addr address.Address) (bool, abi.StoragePower, error) {
if addr.Protocol() != address.ID {
return false, big.Zero(), xerrors.Errorf("can only look up ID addresses")
}
vh, err := root()
if err != nil {
return false, big.Zero(), xerrors.Errorf("loading datacap actor: %w", err)
}
var dcap abi.StoragePower
if found, err := vh.Get(abi.IdAddrKey(addr), &dcap); err != nil {
return false, big.Zero(), xerrors.Errorf("looking up addr: %w", err)
} else if !found {
return false, big.Zero(), nil
}
return true, big.Div(dcap, verifreg.DataCapGranularity), nil
}
func forEachClient(store adt.Store, ver actors.Version, root rootFunc, cb func(addr address.Address, dcap abi.StoragePower) error) error {
vh, err := root()
if err != nil {
return xerrors.Errorf("loading verified clients: %w", err)
}
var dcap abi.StoragePower
return vh.ForEach(&dcap, func(key string) error {
id, n, err := varint.FromUvarint([]byte(key))
if n != len([]byte(key)) {
return xerrors.Errorf("could not get varint from address string")
}
if err != nil {
return err
}
a, err := address.NewIDAddress(id)
return cb(a, big.Div(dcap, verifreg.DataCapGranularity))
})
}
+61
View File
@@ -0,0 +1,61 @@
package datacap
import (
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
datacap9 "github.com/filecoin-project/go-state-types/builtin/v9/datacap"
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state9)(nil)
func load9(store adt.Store, root cid.Cid) (State, error) {
out := state9{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make9(store adt.Store, governor address.Address, bitwidth uint64) (State, error) {
out := state9{store: store}
s, err := datacap9.ConstructState(store, governor, bitwidth)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state9 struct {
datacap9.State
store adt.Store
}
func (s *state9) Governor() (address.Address, error) {
return s.State.Governor, nil
}
func (s *state9) GetState() interface{} {
return &s.State
}
func (s *state9) ForEachClient(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachClient(s.store, actors.Version9, s.verifiedClients, cb)
}
func (s *state9) verifiedClients() (adt.Map, error) {
return adt9.AsMap(s.store, s.Token.Balances, int(s.Token.HamtBitWidth))
}
func (s *state9) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
return getDataCap(s.store, actors.Version9, s.verifiedClients, addr)
}
+5 -5
View File
@@ -1,6 +1,7 @@
package init
import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/lotus/chain/actors"
"golang.org/x/xerrors"
@@ -15,10 +16,9 @@ import (
{{range .versions}}
{{if (le . 7)}}
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
{{else}}
builtin{{.}} "github.com/filecoin-project/go-state-types/builtin"
{{end}}
{{end}}
builtin{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin"
)
var (
@@ -35,7 +35,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
{{range .versions}}
{{if (ge . 8)}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return load{{.}}(store, act.Head)
{{end}}
{{end}}
@@ -54,10 +54,10 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actors.Version, networkName string) (State, error) {
func MakeState(store adt.Store, av actorstypes.Version, networkName string) (State, error) {
switch av {
{{range .versions}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return make{{.}}(store, networkName)
{{end}}
}
+20 -13
View File
@@ -6,7 +6,8 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
builtin8 "github.com/filecoin-project/go-state-types/builtin"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin9 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
@@ -23,8 +24,8 @@ import (
)
var (
Address = builtin8.InitActorAddr
Methods = builtin8.MethodsInit
Address = builtin9.InitActorAddr
Methods = builtin9.MethodsInit
)
func Load(store adt.Store, act *types.Actor) (State, error) {
@@ -35,9 +36,12 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
case actors.Version8:
case actorstypes.Version8:
return load8(store, act.Head)
case actorstypes.Version9:
return load9(store, act.Head)
}
}
@@ -69,33 +73,36 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actors.Version, networkName string) (State, error) {
func MakeState(store adt.Store, av actorstypes.Version, networkName string) (State, error) {
switch av {
case actors.Version0:
case actorstypes.Version0:
return make0(store, networkName)
case actors.Version2:
case actorstypes.Version2:
return make2(store, networkName)
case actors.Version3:
case actorstypes.Version3:
return make3(store, networkName)
case actors.Version4:
case actorstypes.Version4:
return make4(store, networkName)
case actors.Version5:
case actorstypes.Version5:
return make5(store, networkName)
case actors.Version6:
case actorstypes.Version6:
return make6(store, networkName)
case actors.Version7:
case actorstypes.Version7:
return make7(store, networkName)
case actors.Version8:
case actorstypes.Version8:
return make8(store, networkName)
case actorstypes.Version9:
return make9(store, networkName)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
+113
View File
@@ -0,0 +1,113 @@
package init
import (
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
builtin9 "github.com/filecoin-project/go-state-types/builtin"
init9 "github.com/filecoin-project/go-state-types/builtin/v9/init"
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
var _ State = (*state9)(nil)
func load9(store adt.Store, root cid.Cid) (State, error) {
out := state9{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make9(store adt.Store, networkName string) (State, error) {
out := state9{store: store}
s, err := init9.ConstructState(store, networkName)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state9 struct {
init9.State
store adt.Store
}
func (s *state9) ResolveAddress(address address.Address) (address.Address, bool, error) {
return s.State.ResolveAddress(s.store, address)
}
func (s *state9) MapAddressToNewID(address address.Address) (address.Address, error) {
return s.State.MapAddressToNewID(s.store, address)
}
func (s *state9) ForEachActor(cb func(id abi.ActorID, address address.Address) error) error {
addrs, err := adt9.AsMap(s.store, s.State.AddressMap, builtin9.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 *state9) NetworkName() (dtypes.NetworkName, error) {
return dtypes.NetworkName(s.State.NetworkName), nil
}
func (s *state9) SetNetworkName(name string) error {
s.State.NetworkName = name
return nil
}
func (s *state9) SetNextID(id abi.ActorID) error {
s.State.NextID = id
return nil
}
func (s *state9) Remove(addrs ...address.Address) (err error) {
m, err := adt9.AsMap(s.store, s.State.AddressMap, builtin9.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 *state9) SetAddressMap(mcid cid.Cid) error {
s.State.AddressMap = mcid
return nil
}
func (s *state9) AddressMap() (adt.Map, error) {
return adt9.AsMap(s.store, s.State.AddressMap, builtin9.DefaultHamtBitwidth)
}
func (s *state9) GetState() interface{} {
return &s.State
}
+26 -22
View File
@@ -1,7 +1,8 @@
package market
import (
"unicode/utf8"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"unicode/utf8"
"github.com/filecoin-project/go-state-types/network"
"golang.org/x/xerrors"
@@ -12,23 +13,24 @@ import (
"github.com/filecoin-project/go-state-types/cbor"
cbg "github.com/whyrusleeping/cbor-gen"
market{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin{{import .latestVersion}}market"
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
{{range .versions}}
{{if (le . 7)}}
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
{{else}}
builtin{{.}} "github.com/filecoin-project/go-state-types/builtin"
{{end}}
{{end}}
builtintypes "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/types"
)
var (
Address = builtin{{.latestVersion}}.StorageMarketActorAddr
Methods = builtin{{.latestVersion}}.MethodsMarket
Address = builtintypes.StorageMarketActorAddr
Methods = builtintypes.MethodsMarket
)
func Load(store adt.Store, act *types.Actor) (State, error) {
@@ -40,7 +42,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
{{range .versions}}
{{if (ge . 8)}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return load{{.}}(store, act.Head)
{{end}}
{{end}}
@@ -59,10 +61,10 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actors.Version) (State, error) {
func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
switch av {
{{range .versions}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return make{{.}}(store)
{{end}}
}
@@ -84,6 +86,7 @@ type State interface {
) (weight, verifiedWeight abi.DealWeight, err error)
NextID() (abi.DealID, error)
GetState() interface{}
GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error)
}
type BalanceTable interface {
@@ -100,11 +103,11 @@ type DealStates interface {
}
type DealProposals interface {
ForEach(cb func(id abi.DealID, dp market{{.latestVersion}}.DealProposal) error) error
Get(id abi.DealID) (*market{{.latestVersion}}.DealProposal, bool, error)
ForEach(cb func(id abi.DealID, dp markettypes.DealProposal) error) error
Get(id abi.DealID) (*markettypes.DealProposal, bool, error)
array() adt.Array
decode(*cbg.Deferred) (*market{{.latestVersion}}.DealProposal, error)
decode(*cbg.Deferred) (*markettypes.DealProposal, error)
}
@@ -115,23 +118,24 @@ type PublishStorageDealsReturn interface {
}
func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStorageDealsReturn, error) {
av, err := actors.VersionForNetwork(nv)
av, err := actorstypes.VersionForNetwork(nv)
if err != nil {
return nil, err
}
switch av {
{{range .versions}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return decodePublishStorageDealsReturn{{.}}(b)
{{end}}
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
type DealProposal = market{{.latestVersion}}.DealProposal
type DealProposal = markettypes.DealProposal
type DealLabel = markettypes.DealLabel
type DealState = market{{.latestVersion}}.DealState
type DealState = markettypes.DealState
type DealStateChanges struct {
Added []DealIDState
@@ -158,7 +162,7 @@ type DealProposalChanges struct {
type ProposalIDState struct {
ID abi.DealID
Proposal market{{.latestVersion}}.DealProposal
Proposal markettypes.DealProposal
}
func EmptyDealState() *DealState {
@@ -170,7 +174,7 @@ func EmptyDealState() *DealState {
}
// returns the earned fees and pending fees for a given deal
func GetDealFees(deal market{{.latestVersion}}.DealProposal, height abi.ChainEpoch) (abi.TokenAmount, abi.TokenAmount) {
func GetDealFees(deal markettypes.DealProposal, height abi.ChainEpoch) (abi.TokenAmount, abi.TokenAmount) {
tf := big.Mul(deal.StoragePricePerEpoch, big.NewInt(int64(deal.EndEpoch-deal.StartEpoch)))
ef := big.Mul(deal.StoragePricePerEpoch, big.NewInt(int64(height-deal.StartEpoch)))
@@ -185,14 +189,14 @@ func GetDealFees(deal market{{.latestVersion}}.DealProposal, height abi.ChainEpo
return ef, big.Sub(tf, ef)
}
func IsDealActive(state market{{.latestVersion}}.DealState) bool {
func IsDealActive(state markettypes.DealState) bool {
return state.SectorStartEpoch > -1 && state.SlashEpoch == -1
}
func labelFromGoString(s string) (market{{.latestVersion}}.DealLabel, error) {
func labelFromGoString(s string) (markettypes.DealLabel, error) {
if utf8.ValidString(s) {
return market{{.latestVersion}}.NewLabelFromString(s)
return markettypes.NewLabelFromString(s)
} else {
return market{{.latestVersion}}.NewLabelFromBytes([]byte(s))
return markettypes.NewLabelFromBytes([]byte(s))
}
}
+47 -34
View File
@@ -8,9 +8,11 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
builtin8 "github.com/filecoin-project/go-state-types/builtin"
market8 "github.com/filecoin-project/go-state-types/builtin/v8/market"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/network"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
@@ -27,8 +29,8 @@ import (
)
var (
Address = builtin8.StorageMarketActorAddr
Methods = builtin8.MethodsMarket
Address = builtintypes.StorageMarketActorAddr
Methods = builtintypes.MethodsMarket
)
func Load(store adt.Store, act *types.Actor) (State, error) {
@@ -39,9 +41,12 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
case actors.Version8:
case actorstypes.Version8:
return load8(store, act.Head)
case actorstypes.Version9:
return load9(store, act.Head)
}
}
@@ -73,33 +78,36 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
func MakeState(store adt.Store, av actors.Version) (State, error) {
func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
switch av {
case actors.Version0:
case actorstypes.Version0:
return make0(store)
case actors.Version2:
case actorstypes.Version2:
return make2(store)
case actors.Version3:
case actorstypes.Version3:
return make3(store)
case actors.Version4:
case actorstypes.Version4:
return make4(store)
case actors.Version5:
case actorstypes.Version5:
return make5(store)
case actors.Version6:
case actorstypes.Version6:
return make6(store)
case actors.Version7:
case actorstypes.Version7:
return make7(store)
case actors.Version8:
case actorstypes.Version8:
return make8(store)
case actorstypes.Version9:
return make9(store)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@@ -119,6 +127,7 @@ type State interface {
) (weight, verifiedWeight abi.DealWeight, err error)
NextID() (abi.DealID, error)
GetState() interface{}
GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error)
}
type BalanceTable interface {
@@ -135,11 +144,11 @@ type DealStates interface {
}
type DealProposals interface {
ForEach(cb func(id abi.DealID, dp market8.DealProposal) error) error
Get(id abi.DealID) (*market8.DealProposal, bool, error)
ForEach(cb func(id abi.DealID, dp markettypes.DealProposal) error) error
Get(id abi.DealID) (*markettypes.DealProposal, bool, error)
array() adt.Array
decode(*cbg.Deferred) (*market8.DealProposal, error)
decode(*cbg.Deferred) (*markettypes.DealProposal, error)
}
type PublishStorageDealsReturn interface {
@@ -149,44 +158,48 @@ type PublishStorageDealsReturn interface {
}
func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStorageDealsReturn, error) {
av, err := actors.VersionForNetwork(nv)
av, err := actorstypes.VersionForNetwork(nv)
if err != nil {
return nil, err
}
switch av {
case actors.Version0:
case actorstypes.Version0:
return decodePublishStorageDealsReturn0(b)
case actors.Version2:
case actorstypes.Version2:
return decodePublishStorageDealsReturn2(b)
case actors.Version3:
case actorstypes.Version3:
return decodePublishStorageDealsReturn3(b)
case actors.Version4:
case actorstypes.Version4:
return decodePublishStorageDealsReturn4(b)
case actors.Version5:
case actorstypes.Version5:
return decodePublishStorageDealsReturn5(b)
case actors.Version6:
case actorstypes.Version6:
return decodePublishStorageDealsReturn6(b)
case actors.Version7:
case actorstypes.Version7:
return decodePublishStorageDealsReturn7(b)
case actors.Version8:
case actorstypes.Version8:
return decodePublishStorageDealsReturn8(b)
case actorstypes.Version9:
return decodePublishStorageDealsReturn9(b)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
type DealProposal = market8.DealProposal
type DealProposal = markettypes.DealProposal
type DealLabel = markettypes.DealLabel
type DealState = market8.DealState
type DealState = markettypes.DealState
type DealStateChanges struct {
Added []DealIDState
@@ -213,7 +226,7 @@ type DealProposalChanges struct {
type ProposalIDState struct {
ID abi.DealID
Proposal market8.DealProposal
Proposal markettypes.DealProposal
}
func EmptyDealState() *DealState {
@@ -225,7 +238,7 @@ func EmptyDealState() *DealState {
}
// returns the earned fees and pending fees for a given deal
func GetDealFees(deal market8.DealProposal, height abi.ChainEpoch) (abi.TokenAmount, abi.TokenAmount) {
func GetDealFees(deal markettypes.DealProposal, height abi.ChainEpoch) (abi.TokenAmount, abi.TokenAmount) {
tf := big.Mul(deal.StoragePricePerEpoch, big.NewInt(int64(deal.EndEpoch-deal.StartEpoch)))
ef := big.Mul(deal.StoragePricePerEpoch, big.NewInt(int64(height-deal.StartEpoch)))
@@ -240,14 +253,14 @@ func GetDealFees(deal market8.DealProposal, height abi.ChainEpoch) (abi.TokenAmo
return ef, big.Sub(tf, ef)
}
func IsDealActive(state market8.DealState) bool {
func IsDealActive(state markettypes.DealState) bool {
return state.SectorStartEpoch > -1 && state.SlashEpoch == -1
}
func labelFromGoString(s string) (market8.DealLabel, error) {
func labelFromGoString(s string) (markettypes.DealLabel, error) {
if utf8.ValidString(s) {
return market8.NewLabelFromString(s)
return markettypes.NewLabelFromString(s)
} else {
return market8.NewLabelFromBytes([]byte(s))
return markettypes.NewLabelFromBytes([]byte(s))
}
}
+61 -6
View File
@@ -16,13 +16,18 @@ import (
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
{{if (le .v 7)}}
market{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/market"
adt{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/util/adt"
{{else}}
market{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}market"
adt{{.v}} "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
adt{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}util/adt"
{{end}}
{{if (ge .v 9)}}
"github.com/filecoin-project/go-state-types/builtin"
{{end}}
)
@@ -200,7 +205,16 @@ func (s *dealStates{{.v}}) array() adt.Array {
}
func fromV{{.v}}DealState(v{{.v}} market{{.v}}.DealState) DealState {
return (DealState)(v{{.v}})
{{if (le .v 8)}}
return DealState{
SectorStartEpoch: v{{.v}}.SectorStartEpoch,
LastUpdatedEpoch: v{{.v}}.LastUpdatedEpoch,
SlashEpoch: v{{.v}}.SlashEpoch,
VerifiedClaim: 0,
}
{{else}}
return (DealState)(v{{.v}})
{{end}}
}
type dealProposals{{.v}} struct {
@@ -258,12 +272,12 @@ func (s *dealProposals{{.v}}) array() adt.Array {
func fromV{{.v}}DealProposal(v{{.v}} market{{.v}}.DealProposal) (DealProposal, error) {
{{if (le .v 7)}}
label, err := labelFromGoString(v{{.v}}.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
{{else}}
label := v{{.v}}.Label
label, err := fromV{{.v}}Label(v{{.v}}.Label)
{{end}}
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
return DealProposal{
PieceCID: v{{.v}}.PieceCID,
@@ -283,6 +297,25 @@ func fromV{{.v}}DealProposal(v{{.v}} market{{.v}}.DealProposal) (DealProposal, e
}, nil
}
{{if (ge .v 8)}}
func fromV{{.v}}Label(v{{.v}} market{{.v}}.DealLabel) (DealLabel, error) {
if v{{.v}}.IsString() {
str, err := v{{.v}}.ToString()
if err != nil {
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert string label to string: %w", err)
}
return markettypes.NewLabelFromString(str)
}
bs, err := v{{.v}}.ToBytes()
if err != nil {
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert bytes label to bytes: %w", err)
}
return markettypes.NewLabelFromBytes(bs)
}
{{end}}
func (s *state{{.v}}) GetState() interface{} {
return &s.State
@@ -332,3 +365,25 @@ func (r *publishStorageDealsReturn{{.v}}) IsDealValid(index uint64) (bool, int,
func (r *publishStorageDealsReturn{{.v}}) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state{{.v}}) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
{{if (le .v 8)}}
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
{{else}}
allocations, err := adt9.AsMap(s.store, s.PendingDealAllocationIds, builtin.DefaultHamtBitwidth)
if err != nil {
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
}
var allocationId cbg.CborInt
found, err := allocations.Get(abi.UIntKey(uint64(dealId)), &allocationId)
if err != nil {
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
}
if !found {
return verifregtypes.NoAllocationID, nil
}
return verifregtypes.AllocationId(allocationId), nil
{{end}}
}
+16 -1
View File
@@ -9,6 +9,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
market0 "github.com/filecoin-project/specs-actors/actors/builtin/market"
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
@@ -183,7 +184,14 @@ func (s *dealStates0) array() adt.Array {
}
func fromV0DealState(v0 market0.DealState) DealState {
return (DealState)(v0)
return DealState{
SectorStartEpoch: v0.SectorStartEpoch,
LastUpdatedEpoch: v0.LastUpdatedEpoch,
SlashEpoch: v0.SlashEpoch,
VerifiedClaim: 0,
}
}
type dealProposals0 struct {
@@ -241,6 +249,7 @@ func (s *dealProposals0) array() adt.Array {
func fromV0DealProposal(v0 market0.DealProposal) (DealProposal, error) {
label, err := labelFromGoString(v0.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
@@ -292,3 +301,9 @@ func (r *publishStorageDealsReturn0) IsDealValid(index uint64) (bool, int, error
func (r *publishStorageDealsReturn0) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state0) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
}
+16 -1
View File
@@ -9,6 +9,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
@@ -183,7 +184,14 @@ func (s *dealStates2) array() adt.Array {
}
func fromV2DealState(v2 market2.DealState) DealState {
return (DealState)(v2)
return DealState{
SectorStartEpoch: v2.SectorStartEpoch,
LastUpdatedEpoch: v2.LastUpdatedEpoch,
SlashEpoch: v2.SlashEpoch,
VerifiedClaim: 0,
}
}
type dealProposals2 struct {
@@ -241,6 +249,7 @@ func (s *dealProposals2) array() adt.Array {
func fromV2DealProposal(v2 market2.DealProposal) (DealProposal, error) {
label, err := labelFromGoString(v2.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
@@ -292,3 +301,9 @@ func (r *publishStorageDealsReturn2) IsDealValid(index uint64) (bool, int, error
func (r *publishStorageDealsReturn2) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state2) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
}
+16 -1
View File
@@ -9,6 +9,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
market3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/market"
adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt"
@@ -178,7 +179,14 @@ func (s *dealStates3) array() adt.Array {
}
func fromV3DealState(v3 market3.DealState) DealState {
return (DealState)(v3)
return DealState{
SectorStartEpoch: v3.SectorStartEpoch,
LastUpdatedEpoch: v3.LastUpdatedEpoch,
SlashEpoch: v3.SlashEpoch,
VerifiedClaim: 0,
}
}
type dealProposals3 struct {
@@ -236,6 +244,7 @@ func (s *dealProposals3) array() adt.Array {
func fromV3DealProposal(v3 market3.DealProposal) (DealProposal, error) {
label, err := labelFromGoString(v3.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
@@ -287,3 +296,9 @@ func (r *publishStorageDealsReturn3) IsDealValid(index uint64) (bool, int, error
func (r *publishStorageDealsReturn3) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state3) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
}
+16 -1
View File
@@ -9,6 +9,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
market4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/market"
adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt"
@@ -178,7 +179,14 @@ func (s *dealStates4) array() adt.Array {
}
func fromV4DealState(v4 market4.DealState) DealState {
return (DealState)(v4)
return DealState{
SectorStartEpoch: v4.SectorStartEpoch,
LastUpdatedEpoch: v4.LastUpdatedEpoch,
SlashEpoch: v4.SlashEpoch,
VerifiedClaim: 0,
}
}
type dealProposals4 struct {
@@ -236,6 +244,7 @@ func (s *dealProposals4) array() adt.Array {
func fromV4DealProposal(v4 market4.DealProposal) (DealProposal, error) {
label, err := labelFromGoString(v4.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
@@ -287,3 +296,9 @@ func (r *publishStorageDealsReturn4) IsDealValid(index uint64) (bool, int, error
func (r *publishStorageDealsReturn4) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state4) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
}
+16 -1
View File
@@ -9,6 +9,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
market5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/market"
adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt"
@@ -178,7 +179,14 @@ func (s *dealStates5) array() adt.Array {
}
func fromV5DealState(v5 market5.DealState) DealState {
return (DealState)(v5)
return DealState{
SectorStartEpoch: v5.SectorStartEpoch,
LastUpdatedEpoch: v5.LastUpdatedEpoch,
SlashEpoch: v5.SlashEpoch,
VerifiedClaim: 0,
}
}
type dealProposals5 struct {
@@ -236,6 +244,7 @@ func (s *dealProposals5) array() adt.Array {
func fromV5DealProposal(v5 market5.DealProposal) (DealProposal, error) {
label, err := labelFromGoString(v5.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
@@ -287,3 +296,9 @@ func (r *publishStorageDealsReturn5) IsDealValid(index uint64) (bool, int, error
func (r *publishStorageDealsReturn5) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state5) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
}
+16 -1
View File
@@ -11,6 +11,7 @@ import (
"github.com/filecoin-project/go-bitfield"
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
market6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/market"
adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt"
@@ -180,7 +181,14 @@ func (s *dealStates6) array() adt.Array {
}
func fromV6DealState(v6 market6.DealState) DealState {
return (DealState)(v6)
return DealState{
SectorStartEpoch: v6.SectorStartEpoch,
LastUpdatedEpoch: v6.LastUpdatedEpoch,
SlashEpoch: v6.SlashEpoch,
VerifiedClaim: 0,
}
}
type dealProposals6 struct {
@@ -238,6 +246,7 @@ func (s *dealProposals6) array() adt.Array {
func fromV6DealProposal(v6 market6.DealProposal) (DealProposal, error) {
label, err := labelFromGoString(v6.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
@@ -305,3 +314,9 @@ func (r *publishStorageDealsReturn6) IsDealValid(index uint64) (bool, int, error
func (r *publishStorageDealsReturn6) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state6) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
}
+16 -1
View File
@@ -11,6 +11,7 @@ import (
"github.com/filecoin-project/go-bitfield"
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
market7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/market"
adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt"
@@ -180,7 +181,14 @@ func (s *dealStates7) array() adt.Array {
}
func fromV7DealState(v7 market7.DealState) DealState {
return (DealState)(v7)
return DealState{
SectorStartEpoch: v7.SectorStartEpoch,
LastUpdatedEpoch: v7.LastUpdatedEpoch,
SlashEpoch: v7.SlashEpoch,
VerifiedClaim: 0,
}
}
type dealProposals7 struct {
@@ -238,6 +246,7 @@ func (s *dealProposals7) array() adt.Array {
func fromV7DealProposal(v7 market7.DealProposal) (DealProposal, error) {
label, err := labelFromGoString(v7.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
@@ -305,3 +314,9 @@ func (r *publishStorageDealsReturn7) IsDealValid(index uint64) (bool, int, error
func (r *publishStorageDealsReturn7) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state7) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
}
+37 -2
View File
@@ -13,6 +13,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
market8 "github.com/filecoin-project/go-state-types/builtin/v8/market"
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types"
@@ -180,7 +182,14 @@ func (s *dealStates8) array() adt.Array {
}
func fromV8DealState(v8 market8.DealState) DealState {
return (DealState)(v8)
return DealState{
SectorStartEpoch: v8.SectorStartEpoch,
LastUpdatedEpoch: v8.LastUpdatedEpoch,
SlashEpoch: v8.SlashEpoch,
VerifiedClaim: 0,
}
}
type dealProposals8 struct {
@@ -237,7 +246,11 @@ func (s *dealProposals8) array() adt.Array {
func fromV8DealProposal(v8 market8.DealProposal) (DealProposal, error) {
label := v8.Label
label, err := fromV8Label(v8.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
return DealProposal{
PieceCID: v8.PieceCID,
@@ -257,6 +270,22 @@ func fromV8DealProposal(v8 market8.DealProposal) (DealProposal, error) {
}, nil
}
func fromV8Label(v8 market8.DealLabel) (DealLabel, error) {
if v8.IsString() {
str, err := v8.ToString()
if err != nil {
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert string label to string: %w", err)
}
return markettypes.NewLabelFromString(str)
}
bs, err := v8.ToBytes()
if err != nil {
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert bytes label to bytes: %w", err)
}
return markettypes.NewLabelFromBytes(bs)
}
func (s *state8) GetState() interface{} {
return &s.State
}
@@ -302,3 +331,9 @@ func (r *publishStorageDealsReturn8) IsDealValid(index uint64) (bool, int, error
func (r *publishStorageDealsReturn8) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state8) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
}
+349
View File
@@ -0,0 +1,349 @@
package market
import (
"bytes"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin"
market9 "github.com/filecoin-project/go-state-types/builtin/v9/market"
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types"
)
var _ State = (*state9)(nil)
func load9(store adt.Store, root cid.Cid) (State, error) {
out := state9{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make9(store adt.Store) (State, error) {
out := state9{store: store}
s, err := market9.ConstructState(store)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state9 struct {
market9.State
store adt.Store
}
func (s *state9) TotalLocked() (abi.TokenAmount, error) {
fml := types.BigAdd(s.TotalClientLockedCollateral, s.TotalProviderLockedCollateral)
fml = types.BigAdd(fml, s.TotalClientStorageFee)
return fml, nil
}
func (s *state9) BalancesChanged(otherState State) (bool, error) {
otherState9, ok := otherState.(*state9)
if !ok {
// there's no way to compare different versions of the state, so let's
// just say that means the state of balances has changed
return true, nil
}
return !s.State.EscrowTable.Equals(otherState9.State.EscrowTable) || !s.State.LockedTable.Equals(otherState9.State.LockedTable), nil
}
func (s *state9) StatesChanged(otherState State) (bool, error) {
otherState9, ok := otherState.(*state9)
if !ok {
// there's no way to compare different versions of the state, so let's
// just say that means the state of balances has changed
return true, nil
}
return !s.State.States.Equals(otherState9.State.States), nil
}
func (s *state9) States() (DealStates, error) {
stateArray, err := adt9.AsArray(s.store, s.State.States, market9.StatesAmtBitwidth)
if err != nil {
return nil, err
}
return &dealStates9{stateArray}, nil
}
func (s *state9) ProposalsChanged(otherState State) (bool, error) {
otherState9, ok := otherState.(*state9)
if !ok {
// there's no way to compare different versions of the state, so let's
// just say that means the state of balances has changed
return true, nil
}
return !s.State.Proposals.Equals(otherState9.State.Proposals), nil
}
func (s *state9) Proposals() (DealProposals, error) {
proposalArray, err := adt9.AsArray(s.store, s.State.Proposals, market9.ProposalsAmtBitwidth)
if err != nil {
return nil, err
}
return &dealProposals9{proposalArray}, nil
}
func (s *state9) EscrowTable() (BalanceTable, error) {
bt, err := adt9.AsBalanceTable(s.store, s.State.EscrowTable)
if err != nil {
return nil, err
}
return &balanceTable9{bt}, nil
}
func (s *state9) LockedTable() (BalanceTable, error) {
bt, err := adt9.AsBalanceTable(s.store, s.State.LockedTable)
if err != nil {
return nil, err
}
return &balanceTable9{bt}, nil
}
func (s *state9) VerifyDealsForActivation(
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
) (weight, verifiedWeight abi.DealWeight, err error) {
w, vw, _, err := market9.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch)
return w, vw, err
}
func (s *state9) NextID() (abi.DealID, error) {
return s.State.NextID, nil
}
type balanceTable9 struct {
*adt9.BalanceTable
}
func (bt *balanceTable9) ForEach(cb func(address.Address, abi.TokenAmount) error) error {
asMap := (*adt9.Map)(bt.BalanceTable)
var ta abi.TokenAmount
return asMap.ForEach(&ta, func(key string) error {
a, err := address.NewFromBytes([]byte(key))
if err != nil {
return err
}
return cb(a, ta)
})
}
type dealStates9 struct {
adt.Array
}
func (s *dealStates9) Get(dealID abi.DealID) (*DealState, bool, error) {
var deal9 market9.DealState
found, err := s.Array.Get(uint64(dealID), &deal9)
if err != nil {
return nil, false, err
}
if !found {
return nil, false, nil
}
deal := fromV9DealState(deal9)
return &deal, true, nil
}
func (s *dealStates9) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
var ds9 market9.DealState
return s.Array.ForEach(&ds9, func(idx int64) error {
return cb(abi.DealID(idx), fromV9DealState(ds9))
})
}
func (s *dealStates9) decode(val *cbg.Deferred) (*DealState, error) {
var ds9 market9.DealState
if err := ds9.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
return nil, err
}
ds := fromV9DealState(ds9)
return &ds, nil
}
func (s *dealStates9) array() adt.Array {
return s.Array
}
func fromV9DealState(v9 market9.DealState) DealState {
return (DealState)(v9)
}
type dealProposals9 struct {
adt.Array
}
func (s *dealProposals9) Get(dealID abi.DealID) (*DealProposal, bool, error) {
var proposal9 market9.DealProposal
found, err := s.Array.Get(uint64(dealID), &proposal9)
if err != nil {
return nil, false, err
}
if !found {
return nil, false, nil
}
proposal, err := fromV9DealProposal(proposal9)
if err != nil {
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
}
return &proposal, true, nil
}
func (s *dealProposals9) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
var dp9 market9.DealProposal
return s.Array.ForEach(&dp9, func(idx int64) error {
dp, err := fromV9DealProposal(dp9)
if err != nil {
return xerrors.Errorf("decoding proposal: %w", err)
}
return cb(abi.DealID(idx), dp)
})
}
func (s *dealProposals9) decode(val *cbg.Deferred) (*DealProposal, error) {
var dp9 market9.DealProposal
if err := dp9.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
return nil, err
}
dp, err := fromV9DealProposal(dp9)
if err != nil {
return nil, err
}
return &dp, nil
}
func (s *dealProposals9) array() adt.Array {
return s.Array
}
func fromV9DealProposal(v9 market9.DealProposal) (DealProposal, error) {
label, err := fromV9Label(v9.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
return DealProposal{
PieceCID: v9.PieceCID,
PieceSize: v9.PieceSize,
VerifiedDeal: v9.VerifiedDeal,
Client: v9.Client,
Provider: v9.Provider,
Label: label,
StartEpoch: v9.StartEpoch,
EndEpoch: v9.EndEpoch,
StoragePricePerEpoch: v9.StoragePricePerEpoch,
ProviderCollateral: v9.ProviderCollateral,
ClientCollateral: v9.ClientCollateral,
}, nil
}
func fromV9Label(v9 market9.DealLabel) (DealLabel, error) {
if v9.IsString() {
str, err := v9.ToString()
if err != nil {
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert string label to string: %w", err)
}
return markettypes.NewLabelFromString(str)
}
bs, err := v9.ToBytes()
if err != nil {
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert bytes label to bytes: %w", err)
}
return markettypes.NewLabelFromBytes(bs)
}
func (s *state9) GetState() interface{} {
return &s.State
}
var _ PublishStorageDealsReturn = (*publishStorageDealsReturn9)(nil)
func decodePublishStorageDealsReturn9(b []byte) (PublishStorageDealsReturn, error) {
var retval market9.PublishStorageDealsReturn
if err := retval.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
return nil, xerrors.Errorf("failed to unmarshal PublishStorageDealsReturn: %w", err)
}
return &publishStorageDealsReturn9{retval}, nil
}
type publishStorageDealsReturn9 struct {
market9.PublishStorageDealsReturn
}
func (r *publishStorageDealsReturn9) IsDealValid(index uint64) (bool, int, error) {
set, err := r.ValidDeals.IsSet(index)
if err != nil || !set {
return false, -1, err
}
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
if err != nil {
return false, -1, err
}
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
if err != nil {
return false, -1, err
}
outIdx, err := before.Count()
if err != nil {
return false, -1, err
}
return set, int(outIdx), nil
}
func (r *publishStorageDealsReturn9) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state9) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
allocations, err := adt9.AsMap(s.store, s.PendingDealAllocationIds, builtin.DefaultHamtBitwidth)
if err != nil {
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
}
var allocationId cbg.CborInt
found, err := allocations.Get(abi.UIntKey(uint64(dealId)), &allocationId)
if err != nil {
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
}
if !found {
return verifregtypes.NoAllocationID, nil
}
return verifregtypes.AllocationId(allocationId), nil
}
+3 -1
View File
@@ -1,6 +1,7 @@
package miner
import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/chain/actors"
@@ -33,7 +34,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
{{range .versions}}
{{if (ge . 8)}}
case actors.Version{{.}}:
case actorstypes.Version{{.}}:
return load{{.}}(store, act.Head)
{{end}}
{{end}}
@@ -201,6 +202,7 @@ func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi
type MinerInfo = miner{{.latestVersion}}.MinerInfo
type WorkerKeyChange = miner{{.latestVersion}}.WorkerKeyChange
type SectorPreCommitOnChainInfo = miner{{.latestVersion}}.SectorPreCommitOnChainInfo
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
type SectorExpiration struct {
+18 -10
View File
@@ -6,8 +6,9 @@ import (
"github.com/filecoin-project/go-bitfield"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner"
miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/dline"
"github.com/filecoin-project/go-state-types/network"
@@ -33,9 +34,12 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
switch av {
case actors.Version8:
case actorstypes.Version8:
return load8(store, act.Head)
case actorstypes.Version9:
return load9(store, act.Head)
}
}
@@ -94,6 +98,9 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
case actors.Version8:
return make8(store)
case actors.Version9:
return make9(store)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@@ -112,8 +119,8 @@ type State interface {
GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)
FindSector(abi.SectorNumber) (*SectorLocation, error)
GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)
GetPrecommittedSector(abi.SectorNumber) (*miner8.SectorPreCommitOnChainInfo, error)
ForEachPrecommittedSector(func(miner8.SectorPreCommitOnChainInfo) error) error
GetPrecommittedSector(abi.SectorNumber) (*miner9.SectorPreCommitOnChainInfo, error)
ForEachPrecommittedSector(func(miner9.SectorPreCommitOnChainInfo) error) error
LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error)
NumLiveSectors() (uint64, error)
IsAllocated(abi.SectorNumber) (bool, error)
@@ -142,7 +149,7 @@ type State interface {
sectors() (adt.Array, error)
decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)
precommits() (adt.Map, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (miner8.SectorPreCommitOnChainInfo, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (miner9.SectorPreCommitOnChainInfo, error)
GetState() interface{}
}
@@ -180,7 +187,7 @@ type Partition interface {
UnprovenSectors() (bitfield.BitField, error)
}
type SectorOnChainInfo = miner8.SectorOnChainInfo
type SectorOnChainInfo = miner9.SectorOnChainInfo
func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredSealProof, error) {
// We added support for the new proofs in network version 7, and removed support for the old
@@ -235,8 +242,9 @@ func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi
}
}
type MinerInfo = miner8.MinerInfo
type WorkerKeyChange = miner8.WorkerKeyChange
type MinerInfo = miner9.MinerInfo
type WorkerKeyChange = miner9.WorkerKeyChange
type SectorPreCommitOnChainInfo = miner9.SectorPreCommitOnChainInfo
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
type SectorExpiration struct {
@@ -264,8 +272,8 @@ type SectorExtensions struct {
}
type PreCommitChanges struct {
Added []miner8.SectorPreCommitOnChainInfo
Removed []miner8.SectorPreCommitOnChainInfo
Added []miner9.SectorPreCommitOnChainInfo
Removed []miner9.SectorPreCommitOnChainInfo
}
type LockedFunds struct {
+16 -6
View File
@@ -15,7 +15,7 @@ import (
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/chain/actors/adt"
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
minertypes "github.com/filecoin-project/go-state-types/builtin/v{{.latestVersion}}/miner"
{{if (le .v 7)}}
{{if (ge .v 3)}}
@@ -413,6 +413,10 @@ func (s *state{{.v}}) Info() (MinerInfo, error) {
SectorSize: info.SectorSize,
WindowPoStPartitionSectors: info.WindowPoStPartitionSectors,
ConsensusFaultElapsed: {{if (ge .v 2)}}info.ConsensusFaultElapsed{{else}}-1{{end}},
{{if (ge .v 9)}}
Beneficiary: info.Beneficiary,
BeneficiaryTerm: info.BeneficiaryTerm,
PendingBeneficiaryTerm: info.PendingBeneficiaryTerm,{{end}}
}
return mi, nil
@@ -580,13 +584,19 @@ func fromV{{.v}}SectorOnChainInfo(v{{.v}} miner{{.v}}.SectorOnChainInfo) SectorO
}
func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
return minertypes.SectorPreCommitOnChainInfo{
Info: (minertypes.SectorPreCommitInfo)(v{{.v}}.Info),
{{if (le .v 8)}}return minertypes.SectorPreCommitOnChainInfo{
Info: minertypes.SectorPreCommitInfo{
SealProof: v{{.v}}.Info.SealProof,
SectorNumber: v{{.v}}.Info.SectorNumber,
SealedCID: v{{.v}}.Info.SealedCID,
SealRandEpoch: v{{.v}}.Info.SealRandEpoch,
DealIDs: v{{.v}}.Info.DealIDs,
Expiration: v{{.v}}.Info.Expiration,
UnsealedCid: nil,
},
PreCommitDeposit: v{{.v}}.PreCommitDeposit,
PreCommitEpoch: v{{.v}}.PreCommitEpoch,
DealWeight: v{{.v}}.DealWeight,
VerifiedDealWeight: v{{.v}}.VerifiedDealWeight,
}
}{{else}}return v{{.v}}{{end}}
}
func (s *state{{.v}}) GetState() interface{} {

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