diff --git a/.circleci/config.yml b/.circleci/config.yml
index 11e8ac506..5edc0cdac 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -7,7 +7,7 @@ orbs:
executors:
golang:
docker:
- - image: circleci/golang:1.15.5
+ - image: circleci/golang:1.16.4
resource_class: 2xlarge
ubuntu:
docker:
@@ -331,7 +331,7 @@ jobs:
- run: cd extern/filecoin-ffi && make
- run:
name: "go get lotus@master"
- command: cd testplans/lotus-soup && go mod edit -replace=github.com/filecoin-project/lotus=../..
+ command: cd testplans/lotus-soup && go mod edit -replace=github.com/filecoin-project/lotus=../.. && go mod tidy
- run:
name: "build lotus-soup testplan"
command: pushd testplans/lotus-soup && go build -tags=testground .
@@ -379,8 +379,8 @@ jobs:
- run:
name: Install go
command: |
- curl -O https://dl.google.com/go/go1.15.5.darwin-amd64.pkg && \
- sudo installer -pkg go1.15.5.darwin-amd64.pkg -target /
+ curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
+ sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
- run:
name: Install pkg-config
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
@@ -428,6 +428,41 @@ jobs:
- "~/.rustup"
- "~/.cargo"
+ build-appimage:
+ machine:
+ image: ubuntu-2004:202104-01
+ steps:
+ - checkout
+ - attach_workspace:
+ at: "."
+ - run:
+ name: install appimage-builder
+ command: |
+ # docs: https://appimage-builder.readthedocs.io/en/latest/intro/install.html
+ sudo apt update
+ sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace
+ sudo curl -Lo /usr/local/bin/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
+ sudo chmod +x /usr/local/bin/appimagetool
+ sudo pip3 install appimage-builder
+ - run:
+ name: install lotus dependencies
+ command: sudo apt install ocl-icd-opencl-dev libhwloc-dev
+ - run:
+ name: build appimage
+ command: |
+ sed -i "s/version: latest/version: ${CIRCLE_TAG:-latest}/" AppImageBuilder.yml
+ make appimage
+ - run:
+ name: prepare workspace
+ command: |
+ mkdir appimage
+ mv Lotus-latest-x86_64.AppImage appimage
+ - persist_to_workspace:
+ root: "."
+ paths:
+ - appimage
+
+
gofmt:
executor: golang
steps:
@@ -436,7 +471,7 @@ jobs:
- run:
command: "! go fmt ./... 2>&1 | read"
- cbor-gen-check:
+ gen-check:
executor: golang
steps:
- install-deps
@@ -444,7 +479,10 @@ jobs:
- run: make deps
- run: go install golang.org/x/tools/cmd/goimports
- run: go install github.com/hannahhoward/cbor-gen-for
- - run: go generate ./...
+ - run: make gen
+ - run: git --no-pager diff
+ - run: git --no-pager diff --quiet
+ - run: make docsgen-cli
- run: git --no-pager diff
- run: git --no-pager diff --quiet
@@ -453,6 +491,7 @@ jobs:
steps:
- install-deps
- prepare
+ - run: go install golang.org/x/tools/cmd/goimports
- run: zcat build/openrpc/full.json.gz | jq > ../pre-openrpc-full
- run: zcat build/openrpc/miner.json.gz | jq > ../pre-openrpc-miner
- run: zcat build/openrpc/worker.json.gz | jq > ../pre-openrpc-worker
@@ -526,6 +565,34 @@ jobs:
name: Publish release
command: ./scripts/publish-release.sh
+ publish-snapcraft:
+ description: build and push snapcraft
+ machine:
+ image: ubuntu-2004:202104-01
+ resource_class: 2xlarge
+ parameters:
+ channel:
+ type: string
+ default: "edge"
+ description: snapcraft channel
+ steps:
+ - checkout
+ - run:
+ name: install snapcraft
+ command: sudo snap install snapcraft --classic
+ - run:
+ name: create snapcraft config file
+ command: |
+ mkdir -p ~/.config/snapcraft
+ echo "$SNAPCRAFT_LOGIN_FILE" | base64 -d > ~/.config/snapcraft/snapcraft.cfg
+ - run:
+ name: build snap
+ command: snapcraft --use-lxd
+ - run:
+ name: publish snap
+ command: snapcraft push *.snap --release << parameters.channel >>
+
+
build-and-push-image:
description: build and push docker images to public AWS ECR registry
executor: aws-cli/default
@@ -700,7 +767,7 @@ workflows:
concurrency: "16" # expend all docker 2xlarge CPUs.
- mod-tidy-check
- gofmt
- - cbor-gen-check
+ - gen-check
- docs-check
- test:
codecov-upload: true
@@ -801,10 +868,21 @@ workflows:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
+ - build-appimage:
+ requires:
+ - test-short
+ filters:
+ branches:
+ ignore:
+ - /.*/
+ tags:
+ only:
+ - /^v\d+\.\d+\.\d+(-rc\d+)?$/
- publish:
requires:
- build-all
- build-macos
+ - build-appimage
filters:
branches:
ignore:
@@ -857,3 +935,26 @@ workflows:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
+ - publish-snapcraft:
+ name: publish-snapcraft-stable
+ channel: stable
+ filters:
+ branches:
+ ignore:
+ - /.*/
+ tags:
+ only:
+ - /^v\d+\.\d+\.\d+(-rc\d+)?$/
+
+ nightly:
+ triggers:
+ - schedule:
+ cron: "0 0 * * *"
+ filters:
+ branches:
+ only:
+ - master
+ jobs:
+ - publish-snapcraft:
+ name: publish-snapcraft-nightly
+ channel: edge
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
deleted file mode 100644
index 6d717b44d..000000000
--- a/.github/CODEOWNERS
+++ /dev/null
@@ -1,16 +0,0 @@
-## filecoin-project/lotus CODEOWNERS
-## Refer to https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners.
-##
-## These users or groups will be automatically assigned as reviewers every time
-## a PR is submitted that modifies code in the specified locations.
-##
-## The Lotus repo configuration requires that at least ONE codeowner approves
-## the PR before merging.
-
-### Global owners.
-* @magik6k @whyrusleeping @Kubuxu
-
-### Conformance testing.
-conformance/ @raulk
-extern/test-vectors @raulk
-cmd/tvx @raulk
\ No newline at end of file
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 000000000..33725d70d
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,69 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [ master ]
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'go' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
+ # Learn more:
+ # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - uses: actions/setup-go@v1
+ with:
+ go-version: '1.16.4'
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v1
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v1
+
+ # âšī¸ Command-line programs to run using the OS shell.
+ # đ https://git.io/JvXDl
+
+ # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines
+ # and modify them (or add more) to build your code if your project
+ # uses a compiled language
+
+ #- run: |
+ # make bootstrap
+ # make release
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/testground-on-push.yml b/.github/workflows/testground-on-push.yml
new file mode 100644
index 000000000..2a3c8af1d
--- /dev/null
+++ b/.github/workflows/testground-on-push.yml
@@ -0,0 +1,29 @@
+---
+name: Testground PR Checker
+
+on: [push]
+
+jobs:
+ testground:
+ runs-on: ubuntu-latest
+ name: ${{ matrix.composition_file }}
+ strategy:
+ matrix:
+ include:
+ - backend_addr: ci.testground.ipfs.team
+ backend_proto: https
+ plan_directory: testplans/lotus-soup
+ composition_file: testplans/lotus-soup/_compositions/baseline-k8s-3-1.toml
+ - backend_addr: ci.testground.ipfs.team
+ backend_proto: https
+ plan_directory: testplans/lotus-soup
+ composition_file: testplans/lotus-soup/_compositions/paych-stress-k8s.toml
+ steps:
+ - uses: actions/checkout@v2
+ - name: testground run
+ uses: coryschwartz/testground-github-action@v1.1
+ with:
+ backend_addr: ${{ matrix.backend_addr }}
+ backend_proto: ${{ matrix.backend_proto }}
+ plan_directory: ${{ matrix.plan_directory }}
+ composition_file: ${{ matrix.composition_file }}
diff --git a/.gitignore b/.gitignore
index e34ebb935..eddee0590 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+/AppDir
+/appimage-builder-cache
+*.AppImage
/lotus
/lotus-miner
/lotus-worker
diff --git a/AppDir/usr/share/icons/icon.svg b/AppDir/usr/share/icons/icon.svg
new file mode 100644
index 000000000..da992296a
--- /dev/null
+++ b/AppDir/usr/share/icons/icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml
new file mode 100644
index 000000000..19c74e4a2
--- /dev/null
+++ b/AppImageBuilder.yml
@@ -0,0 +1,73 @@
+version: 1
+AppDir:
+ path: ./AppDir
+ app_info:
+ id: io.filecoin.lotus
+ name: Lotus
+ icon: icon
+ version: latest
+ exec: usr/bin/lotus
+ exec_args: $@
+ apt:
+ arch: amd64
+ allow_unauthenticated: true
+ sources:
+ - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main restricted
+ - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
+ - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal universe
+ - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
+ - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal multiverse
+ - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
+ - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted
+ universe multiverse
+ - sourceline: deb http://security.ubuntu.com/ubuntu focal-security main restricted
+ - sourceline: deb http://security.ubuntu.com/ubuntu focal-security universe
+ - sourceline: deb http://security.ubuntu.com/ubuntu focal-security multiverse
+ - sourceline: deb https://cli-assets.heroku.com/apt ./
+ - sourceline: deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu focal main
+ - sourceline: deb http://ppa.launchpad.net/git-core/ppa/ubuntu focal main
+ - sourceline: deb http://archive.canonical.com/ubuntu focal partner
+ include:
+ - ocl-icd-libopencl1
+ - libhwloc15
+ exclude: []
+ files:
+ include:
+ - /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
+ - /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
+ - /usr/lib/x86_64-linux-gnu/libm-2.31.so
+ - /usr/lib/x86_64-linux-gnu/libdl-2.31.so
+ - /usr/lib/x86_64-linux-gnu/libc-2.31.so
+ - /usr/lib/x86_64-linux-gnu/libudev.so.1.6.17
+ exclude:
+ - usr/share/man
+ - usr/share/doc/*/README.*
+ - usr/share/doc/*/changelog.*
+ - usr/share/doc/*/NEWS.*
+ - usr/share/doc/*/TODO.*
+ test:
+ fedora:
+ image: appimagecrafters/tests-env:fedora-30
+ command: ./AppRun
+ use_host_x: true
+ debian:
+ image: appimagecrafters/tests-env:debian-stable
+ command: ./AppRun
+ use_host_x: true
+ arch:
+ image: appimagecrafters/tests-env:archlinux-latest
+ command: ./AppRun
+ use_host_x: true
+ centos:
+ image: appimagecrafters/tests-env:centos-7
+ command: ./AppRun
+ use_host_x: true
+ ubuntu:
+ image: appimagecrafters/tests-env:ubuntu-xenial
+ command: ./AppRun
+ use_host_x: true
+AppImage:
+ arch: x86_64
+ update-information: guess
+ sign-key: None
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bfc1b98e4..fa6330907 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,21 +1,5 @@
# Lotus changelog
-# 1.10.0-rc2 / 2021-06-09
-
-This is the second release candidate for Lotus v1.10.0, an upcoming mandatory release of Lotus that will introduce Filecoin network v13. Included in the new network version are the following FIPs:
-
-- [FIP-0008](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0008.md): Add miner batched sector pre-commit method
-- [FIP-0011](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0011.md): Remove reward auction from reporting consensus faults
-- [FIP-0012](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0012.md): DataCap Top up for FIL+ Client Addresses
-- [FIP-0013](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0013.md): Add ProveCommitSectorAggregated method to reduce on-chain congestion
-- [FIP-0015](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0015.md): Revert FIP-0009(Exempt Window PoSts from BaseFee burn)
-
-This release candidate does not set the upgrade epochs for mainnet, but does set the upgrade epoch for the calibration network to 321519.
-
-Note that this release is built on top of Lotus v1.9.0. Enterprising users can use the `master` branch of Lotus to get the latest functionality, including all changes in this release candidate.
-
-A detailed changelog will be included in a later release candidate.
-
# 1.9.0 / 2021-05-17
This is an optional Lotus release that introduces various improvements to the sealing, mining, and deal-making processes.
@@ -86,143 +70,6 @@ This is an optional Lotus release that introduces various improvements to the se
- fix health report (https://github.com/filecoin-project/lotus/pull/6011)
- fix(ci): Use recent ubuntu LTS release; Update release params ((https://github.com/filecoin-project/lotus/pull/6011))
-# 1.9.0-rc4 / 2021-05-13
-
-This is an optional Lotus release that introduces various improvements to the sealing, mining, and deal-making processes.
-
-## Highlights
-
-- OpenRPC Support (https://github.com/filecoin-project/lotus/pull/5843)
-- Take latency into account when making interactive deals (https://github.com/filecoin-project/lotus/pull/5876)
-- Update go-commp-utils for >10x faster client commp calculation (https://github.com/filecoin-project/lotus/pull/5892)
-- add `lotus client cancel-retrieval` cmd to lotus CLI (https://github.com/filecoin-project/lotus/pull/5871)
-- add `inspect-deal` command to `lotus client` (https://github.com/filecoin-project/lotus/pull/5833)
-- Local retrieval support (https://github.com/filecoin-project/lotus/pull/5917)
-- go-fil-markets v1.1.9 -> v1.2.5
- - For a detailed changelog see https://github.com/filecoin-project/go-fil-markets/blob/master/CHANGELOG.md
-- rust-fil-proofs v5.4.1 -> v7.0.1
- - For a detailed changelog see https://github.com/filecoin-project/rust-fil-proofs/blob/master/CHANGELOG.md
-
-## Changes
-- storagefsm: Apply global events even in broken states (https://github.com/filecoin-project/lotus/pull/5962)
-- Default the AlwaysKeepUnsealedCopy flag to true (https://github.com/filecoin-project/lotus/pull/5743)
-- splitstore: compact hotstore prior to garbage collection (https://github.com/filecoin-project/lotus/pull/5778)
-- ipfs-force bootstrapper update (https://github.com/filecoin-project/lotus/pull/5799)
-- better logging when unsealing fails (https://github.com/filecoin-project/lotus/pull/5851)
-- perf: add cache for gas permium estimation (https://github.com/filecoin-project/lotus/pull/5709)
-- backupds: Compact log on restart (https://github.com/filecoin-project/lotus/pull/5875)
-- backupds: Improve truncated log handling (https://github.com/filecoin-project/lotus/pull/5891)
-- State CLI improvements (State CLI improvements)
-- API proxy struct codegen (https://github.com/filecoin-project/lotus/pull/5854)
-- move DI stuff for paychmgr into modules (https://github.com/filecoin-project/lotus/pull/5791)
-- Implement Event observer and Settings for 3rd party dep injection (https://github.com/filecoin-project/lotus/pull/5693)
-- Export developer and network commands for consumption by derivatives of Lotus (https://github.com/filecoin-project/lotus/pull/5864)
-- mock sealer: Simulate randomness sideeffects (https://github.com/filecoin-project/lotus/pull/5805)
-- localstorage: Demote reservation stat error to debug (https://github.com/filecoin-project/lotus/pull/5976)
-- shed command to unpack miner info dumps (https://github.com/filecoin-project/lotus/pull/5800)
-- Add two utils to Lotus-shed (https://github.com/filecoin-project/lotus/pull/5867)
-- add shed election estimate command (https://github.com/filecoin-project/lotus/pull/5092)
-- Add --actor flag in lotus-shed sectors terminate (https://github.com/filecoin-project/lotus/pull/5819)
-- Move lotus mpool clear to lotus-shed (https://github.com/filecoin-project/lotus/pull/5900)
-- Centralize everything on ipfs/go-log/v2 (https://github.com/filecoin-project/lotus/pull/5974)
-- expose NextID from nice market actor interface (https://github.com/filecoin-project/lotus/pull/5850)
-- add available options for perm on error (https://github.com/filecoin-project/lotus/pull/5814)
-- API docs clarification: Document StateSearchMsg replaced message behavior (https://github.com/filecoin-project/lotus/pull/5838)
-- api: Document StateReplay replaced message behavior (https://github.com/filecoin-project/lotus/pull/5840)
-- add godocs to miner objects (https://github.com/filecoin-project/lotus/pull/2184)
-- Add description to the client deal CLI command (https://github.com/filecoin-project/lotus/pull/5999)
-- lint: don't skip builtin (https://github.com/filecoin-project/lotus/pull/5881)
-- use deal duration from actors (https://github.com/filecoin-project/lotus/pull/5270)
-- remote calc winningpost proof (https://github.com/filecoin-project/lotus/pull/5884)
-- packer: other network images (https://github.com/filecoin-project/lotus/pull/5930)
-- Convert the chainstore lock to RW (https://github.com/filecoin-project/lotus/pull/5971)
-- Remove CachedBlockstore (https://github.com/filecoin-project/lotus/pull/5972)
-- remove messagepool CapGasFee duplicate code (https://github.com/filecoin-project/lotus/pull/5992)
-- Add a mining-heartbeat INFO line at every epoch (https://github.com/filecoin-project/lotus/pull/6183)
-- chore(ci): Enable build on RC tags (https://github.com/filecoin-project/lotus/pull/6245)
-- Upgrade nerpa to actor v4 and bump the version to rc4 (https://github.com/filecoin-project/lotus/pull/6249)
-## Fixes
-- return buffers after canceling badger operation (https://github.com/filecoin-project/lotus/pull/5796)
-- avoid holding a lock while calling the View callback (https://github.com/filecoin-project/lotus/pull/5792)
-- storagefsm: Trigger input processing when below limits (https://github.com/filecoin-project/lotus/pull/5801)
-- After importing a previously deleted key, be able to delete it again (https://github.com/filecoin-project/lotus/pull/4653)
-- fix StateManager.Replay on reward actor (https://github.com/filecoin-project/lotus/pull/5804)
-- make sure atomic 64bit fields are 64bit aligned (https://github.com/filecoin-project/lotus/pull/5794)
-- Import secp sigs in paych tests (https://github.com/filecoin-project/lotus/pull/5879)
-- fix ci build-macos (https://github.com/filecoin-project/lotus/pull/5934)
-- Fix creation of remainder account when it's not a multisig (https://github.com/filecoin-project/lotus/pull/5807)
-- Fix fallback chainstore (https://github.com/filecoin-project/lotus/pull/6003)
-- fix 4857: show help for set-addrs (https://github.com/filecoin-project/lotus/pull/5943)
-- fix health report (https://github.com/filecoin-project/lotus/pull/6011)
-
-
-# 1.9.0-rc2 / 2021-04-30
-
-This is an optional Lotus release that introduces various improvements to the sealing, mining, and deal-making processes.
-
-## Highlights
-
-- OpenRPC Support (https://github.com/filecoin-project/lotus/pull/5843)
-- Take latency into account when making interactive deals (https://github.com/filecoin-project/lotus/pull/5876)
-- Update go-commp-utils for >10x faster client commp calculation (https://github.com/filecoin-project/lotus/pull/5892)
-- add `lotus client cancel-retrieval` cmd to lotus CLI (https://github.com/filecoin-project/lotus/pull/5871)
-- add `inspect-deal` command to `lotus client` (https://github.com/filecoin-project/lotus/pull/5833)
-- Local retrieval support (https://github.com/filecoin-project/lotus/pull/5917)
-- go-fil-markets v1.1.9 -> v1.2.5
- - For a detailed changelog see https://github.com/filecoin-project/go-fil-markets/blob/master/CHANGELOG.md
-- rust-fil-proofs v5.4.1 -> v7
- - For a detailed changelog see https://github.com/filecoin-project/rust-fil-proofs/blob/master/CHANGELOG.md
-
-## Changes
-- storagefsm: Apply global events even in broken states (https://github.com/filecoin-project/lotus/pull/5962)
-- Default the AlwaysKeepUnsealedCopy flag to true (https://github.com/filecoin-project/lotus/pull/5743)
-- splitstore: compact hotstore prior to garbage collection (https://github.com/filecoin-project/lotus/pull/5778)
-- ipfs-force bootstrapper update (https://github.com/filecoin-project/lotus/pull/5799)
-- better logging when unsealing fails (https://github.com/filecoin-project/lotus/pull/5851)
-- perf: add cache for gas permium estimation (https://github.com/filecoin-project/lotus/pull/5709)
-- backupds: Compact log on restart (https://github.com/filecoin-project/lotus/pull/5875)
-- backupds: Improve truncated log handling (https://github.com/filecoin-project/lotus/pull/5891)
-- State CLI improvements (State CLI improvements)
-- API proxy struct codegen (https://github.com/filecoin-project/lotus/pull/5854)
-- move DI stuff for paychmgr into modules (https://github.com/filecoin-project/lotus/pull/5791)
-- Implement Event observer and Settings for 3rd party dep injection (https://github.com/filecoin-project/lotus/pull/5693)
-- Export developer and network commands for consumption by derivatives of Lotus (https://github.com/filecoin-project/lotus/pull/5864)
-- mock sealer: Simulate randomness sideeffects (https://github.com/filecoin-project/lotus/pull/5805)
-- localstorage: Demote reservation stat error to debug (https://github.com/filecoin-project/lotus/pull/5976)
-- shed command to unpack miner info dumps (https://github.com/filecoin-project/lotus/pull/5800)
-- Add two utils to Lotus-shed (https://github.com/filecoin-project/lotus/pull/5867)
-- add shed election estimate command (https://github.com/filecoin-project/lotus/pull/5092)
-- Add --actor flag in lotus-shed sectors terminate (https://github.com/filecoin-project/lotus/pull/5819)
-- Move lotus mpool clear to lotus-shed (https://github.com/filecoin-project/lotus/pull/5900)
-- Centralize everything on ipfs/go-log/v2 (https://github.com/filecoin-project/lotus/pull/5974)
-- expose NextID from nice market actor interface (https://github.com/filecoin-project/lotus/pull/5850)
-- add available options for perm on error (https://github.com/filecoin-project/lotus/pull/5814)
-- API docs clarification: Document StateSearchMsg replaced message behavior (https://github.com/filecoin-project/lotus/pull/5838)
-- api: Document StateReplay replaced message behavior (https://github.com/filecoin-project/lotus/pull/5840)
-- add godocs to miner objects (https://github.com/filecoin-project/lotus/pull/2184)
-- Add description to the client deal CLI command (https://github.com/filecoin-project/lotus/pull/5999)
-- lint: don't skip builtin (https://github.com/filecoin-project/lotus/pull/5881)
-- use deal duration from actors (https://github.com/filecoin-project/lotus/pull/5270)
-- remote calc winningpost proof (https://github.com/filecoin-project/lotus/pull/5884)
-- packer: other network images (https://github.com/filecoin-project/lotus/pull/5930)
-- Convert the chainstore lock to RW (https://github.com/filecoin-project/lotus/pull/5971)
-- Remove CachedBlockstore (https://github.com/filecoin-project/lotus/pull/5972)
-- remove messagepool CapGasFee duplicate code (https://github.com/filecoin-project/lotus/pull/5992)
-
-## Fixes
-- return buffers after canceling badger operation (https://github.com/filecoin-project/lotus/pull/5796)
-- avoid holding a lock while calling the View callback (https://github.com/filecoin-project/lotus/pull/5792)
-- storagefsm: Trigger input processing when below limits (https://github.com/filecoin-project/lotus/pull/5801)
-- After importing a previously deleted key, be able to delete it again (https://github.com/filecoin-project/lotus/pull/4653)
-- fix StateManager.Replay on reward actor (https://github.com/filecoin-project/lotus/pull/5804)
-- make sure atomic 64bit fields are 64bit aligned (https://github.com/filecoin-project/lotus/pull/5794)
-- Import secp sigs in paych tests (https://github.com/filecoin-project/lotus/pull/5879)
-- fix ci build-macos (https://github.com/filecoin-project/lotus/pull/5934)
-- Fix creation of remainder account when it's not a multisig (https://github.com/filecoin-project/lotus/pull/5807)
-- Fix fallback chainstore (https://github.com/filecoin-project/lotus/pull/6003)
-- fix 4857: show help for set-addrs (https://github.com/filecoin-project/lotus/pull/5943)
-- fix health report (https://github.com/filecoin-project/lotus/pull/6011)
-
# 1.8.0 / 2021-04-05
This is a mandatory release of Lotus that upgrades the network to version 12, which introduces various performance improvements to the cron processing of the power actor. The network will upgrade at height 712320, which is 2021-04-29T06:00:00Z.
@@ -243,7 +90,7 @@ This release also expands the `lotus-miner sectors extend` CLI, with a new optio
- The `expiration-cutoff` flag can be passed to skip sectors whose expiration is past a certain point from the current head. It defaults to infinity (no cutoff), but if, say, 28800 was specified, then only sectors expiring in the next 10 days would be extended (2880 epochs in 1 day).
-## Changes
+## Changes
- Util for miners to extend all v1 sectors (https://github.com/filecoin-project/lotus/pull/5924)
- Upgrade the butterfly network (https://github.com/filecoin-project/lotus/pull/5929)
@@ -254,7 +101,7 @@ This release also expands the `lotus-miner sectors extend` CLI, with a new optio
This is a patch release of Lotus that introduces small fixes to the Storage FSM.
-## Changes
+## Changes
- storagefsm: Fix double unlock with ready WaitDeals sectors (https://github.com/filecoin-project/lotus/pull/5783)
- backupds: Allow larger values in write log (https://github.com/filecoin-project/lotus/pull/5776)
@@ -270,7 +117,7 @@ This is an hotfix release of Lotus that fixes a critical bug introduced in v1.5.
# 1.5.1 / 2021-03-10
-This is an optional release of Lotus that introduces an important fix to the WindowPoSt computation process. The change is to wait for some confidence before drawing beacon randomness for the proof. Without this, invalid proofs might be generated as the result of a null tipset.
+This is an optional release of Lotus that introduces an important fix to the WindowPoSt computation process. The change is to wait for some confidence before drawing beacon randomness for the proof. Without this, invalid proofs might be generated as the result of a null tipset.
## Splitstore
@@ -363,7 +210,7 @@ FIP-0010 introduces the ability to dispute bad Window PoSts. Node operators are
## Changes
- [#5341](https://github.com/filecoin-project/lotus/pull/5341) Add a `LOTUS_DISABLE_V3_ACTOR_MIGRATION` envvar
- - Setting this envvar to 1 disables the v3 actor migration, should only be used in the event of a failed migration
+ - Setting this envvar to 1 disables the v3 actor migration, should only be used in the event of a failed migration
# 1.4.2 / 2021-02-17
@@ -371,14 +218,14 @@ This is a large, and highly recommended, optional release with new features and
- [FIP-0007 h/amt-v3](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0007.md) which improves the performance of the Filecoin HAMT and AMT.
- [FIP-0010 off-chain Window PoSt Verification](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0010.md) which reduces the gas consumption of `SubmitWindowedPoSt` messages significantly by optimistically accepting Window PoSt proofs without verification, and allowing them to be disputed later by off-chain verifiers.
-
+
Note that this release does NOT set an upgrade epoch for v3 actors to take effect. That will be done in the upcoming 1.5.0 release.
-
- ## New Features
-
- - [#5341](https://github.com/filecoin-project/lotus/pull/5341) Added sector termination API and CLI
- - Run `lotus-miner sectors terminate`
-- [#5342](https://github.com/filecoin-project/lotus/pull/5342) Added CLI for using a multisig wallet as miner's owner address
+
+## New Features
+
+- [#5341](https://github.com/filecoin-project/lotus/pull/5341) Added sector termination API and CLI
+ - Run `lotus-miner sectors terminate`
+- [#5342](https://github.com/filecoin-project/lotus/pull/5342) Added CLI for using a multisig wallet as miner's owner address
- See how to set it up [here](https://github.com/filecoin-project/lotus/pull/5342#issue-554009129)
- [#5363](https://github.com/filecoin-project/lotus/pull/5363), [#5418](https://github.com/filecoin-project/lotus/pull/), [#5476](https://github.com/filecoin-project/lotus/pull/5476), [#5459](https://github.com/filecoin-project/lotus/pull/5459) Integrated [spec-actor v3](https://github.com/filecoin-pro5418ject/specs-actors/releases/tag/v3.0.0)
- [#5472](https://github.com/filecoin-project/lotus/pull/5472) Generate actor v3 methods for pond
@@ -389,7 +236,7 @@ Note that this release does NOT set an upgrade epoch for v3 actors to take effec
- [#5411](https://github.com/filecoin-project/lotus/pull/5411) Handle batch `PublishStorageDeals` message in sealing recovery
- [#5505](https://github.com/filecoin-project/lotus/pull/5505) Exclude expired deals from batching in `PublishStorageDeals` messages
- Added `PublishMsgPeriod` and `MaxDealsPerPublishMsg` to miner `Dealmaking` [configuration](https://docs.filecoin.io/mine/lotus/miner-configuration/#dealmaking-section). See how they work [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#publishing-several-deals-in-one-message).
- - [#5538](https://github.com/filecoin-project/lotus/pull/5538), [#5549](https://github.com/filecoin-project/lotus/pull/5549) Added a command to list pending deals and force publish messages.
+ - [#5538](https://github.com/filecoin-project/lotus/pull/5538), [#5549](https://github.com/filecoin-project/lotus/pull/5549) Added a command to list pending deals and force publish messages.
- Run `lotus-miner market pending-publish`
- [#5428](https://github.com/filecoin-project/lotus/pull/5428) Moved waiting for `PublishStorageDeals` messages' receipt from markets to lotus
- [#5510](https://github.com/filecoin-project/lotus/pull/5510) Added `nerpanet` build option
@@ -399,32 +246,32 @@ Note that this release does NOT set an upgrade epoch for v3 actors to take effec
- [#5219](https://github.com/filecoin-project/lotus/pull/5219) Added interactive mode for lotus-wallet
- [5529](https://github.com/filecoin-project/lotus/pull/5529) Added support for minder nodes in `lotus-shed rpc` util
- ## Bug Fixes
-
- - [#5210](https://github.com/filecoin-project/lotus/pull/5210) Miner should not dial client on restart
- - [#5403](https://github.com/filecoin-project/lotus/pull/5403) When estimating GasLimit only apply prior messages up to the nonce
- - [#5410](https://github.com/filecoin-project/lotus/pull/510) Fix the calibnet build option
- - [#5492](https://github.com/filecoin-project/lotus/pull/5492) Fixed `has` for ipfsbstore for non-existing blocks
- - [#5361](https://github.com/filecoin-project/lotus/pull/5361) Fixed retrieval hangs when using `IpfsOnlineMode=true`
- - [#5493](https://github.com/filecoin-project/lotus/pull/5493) Fixed retrieval failure when price-per-byte is zero
- - [#5506](https://github.com/filecoin-project/lotus/pull/5506) Fixed contexts in the storage adpater
- - [#5515](https://github.com/filecoin-project/lotus/pull/5515) Properly wire up `StateReadState` on gateway API
- - [#5582](https://github.com/filecoin-project/lotus/pull/5582) Fixed error logging format strings
- - [#5614](https://github.com/filecoin-project/lotus/pull/5614) Fixed websocket reconnecting handling
+## Bug Fixes
+
+- [#5210](https://github.com/filecoin-project/lotus/pull/5210) Miner should not dial client on restart
+- [#5403](https://github.com/filecoin-project/lotus/pull/5403) When estimating GasLimit only apply prior messages up to the nonce
+- [#5410](https://github.com/filecoin-project/lotus/pull/510) Fix the calibnet build option
+- [#5492](https://github.com/filecoin-project/lotus/pull/5492) Fixed `has` for ipfsbstore for non-existing blocks
+- [#5361](https://github.com/filecoin-project/lotus/pull/5361) Fixed retrieval hangs when using `IpfsOnlineMode=true`
+- [#5493](https://github.com/filecoin-project/lotus/pull/5493) Fixed retrieval failure when price-per-byte is zero
+- [#5506](https://github.com/filecoin-project/lotus/pull/5506) Fixed contexts in the storage adpater
+- [#5515](https://github.com/filecoin-project/lotus/pull/5515) Properly wire up `StateReadState` on gateway API
+- [#5582](https://github.com/filecoin-project/lotus/pull/5582) Fixed error logging format strings
+- [#5614](https://github.com/filecoin-project/lotus/pull/5614) Fixed websocket reconnecting handling
- ## Improvements
-
- - [#5389](https://github.com/filecoin-project/lotus/pull/5389) Show verified indicator for `./lotus-miner storage-deals list`
+## Improvements
+
+- [#5389](https://github.com/filecoin-project/lotus/pull/5389) Show verified indicator for `./lotus-miner storage-deals list`
- [#5229](https://github.com/filecoin-project/lotus/pull/5220) Show power for verified deals in `./lotus-miner setocr list`
- [#5407](https://github.com/filecoin-project/lotus/pull/5407) Added explicit check of the miner address protocol
- - [#5399](https://github.com/filecoin-project/lotus/pull/5399) watchdog: increase heapprof capture threshold to 90%
- - [#5398](https://github.com/filecoin-project/lotus/pull/5398) storageadapter: Look at precommits on-chain since deal publish msg
- - [#5470](https://github.com/filecoin-project/lotus/pull/5470) Added `--no-timing` option for `./lotus state compute-state --html`
+- [#5399](https://github.com/filecoin-project/lotus/pull/5399) watchdog: increase heapprof capture threshold to 90%
+- [#5398](https://github.com/filecoin-project/lotus/pull/5398) storageadapter: Look at precommits on-chain since deal publish msg
+- [#5470](https://github.com/filecoin-project/lotus/pull/5470) Added `--no-timing` option for `./lotus state compute-state --html`
- [#5417](https://github.com/filecoin-project/lotus/pull/5417) Storage Manager: Always unseal full sectors
- [#5393](https://github.com/filecoin-project/lotus/pull/5393) Switched to [filecoin-ffi bls api ](https://github.com/filecoin-project/filecoin-ffi/pull/159)for bls signatures
-- [#5380](https://github.com/filecoin-project/lotus/pull/5210) Refactor deals API tests
-- [#5397](https://github.com/filecoin-project/lotus/pull/5397) Fixed a flake in the sync manager edge case test
+- [#5380](https://github.com/filecoin-project/lotus/pull/5210) Refactor deals API tests
+- [#5397](https://github.com/filecoin-project/lotus/pull/5397) Fixed a flake in the sync manager edge case test
- [#5406](https://github.com/filecoin-project/lotus/pull/5406) Added a test to ensure a correct window post cannot be disputed
- [#5294](https://github.com/filecoin-project/lotus/pull/5394) Added jobs to build Lotus docker image and push it to AWS ECR
- [#5387](https://github.com/filecoin-project/lotus/pull/5387) Added network info(mainnet|calibnet) in version
@@ -433,7 +280,7 @@ Note that this release does NOT set an upgrade epoch for v3 actors to take effec
- [#5047](https://github.com/filecoin-project/lotus/pull/5047) Improved the UX for `./lotus-shed bitfield enc`
- [#5282](https://github.com/filecoin-project/lotus/pull/5282) Snake a context through the chian blockstore creation
- [#5350](https://github.com/filecoin-project/lotus/pull/5350) Avoid using `mp.cfg` directrly to prevent race condition
-- [#5449](https://github.com/filecoin-project/lotus/pull/5449) Documented the block-header better
+- [#5449](https://github.com/filecoin-project/lotus/pull/5449) Documented the block-header better
- [#5404](https://github.com/filecoin-project/lotus/pull/5404) Added retrying proofs if an incorrect one is generated
- [#4545](https://github.com/filecoin-project/lotus/pull/4545) Made state tipset usage consistent in the API
- [#5540](https://github.com/filecoin-project/lotus/pull/5540) Removed unnecessary database reads in validation check
@@ -450,14 +297,14 @@ Note that this release does NOT set an upgrade epoch for v3 actors to take effec
- [#5592](https://github.com/filecoin-project/lotus/pull/5592) Verify FFI version before building
## Dependency Updates
- - [#5296](https://github.com/filecoin-project/lotus/pull/5396) Upgraded to [raulk/go-watchdog@v1.0.1](https://github.com/raulk/go-watchdog/releases/tag/v1.0.1)
- - [#5450](https://github.com/filecoin-project/lotus/pull/5450) Dependency updates
- - [#5425](https://github.com/filecoin-project/lotus/pull/5425) Fixed stale imports in testplans/lotus-soup
- - [#5535](https://github.com/filecoin-project/lotus/pull/5535) Updated to [go-fil-markets@v1.1.7](https://github.com/filecoin-project/go-fil-markets/releases/tag/v1.1.7)
- - [#5616](https://github.com/filecoin-project/lotus/pull/5600) Updated to [filecoin-ffi@b6e0b35fb49ed0fe](https://github.com/filecoin-project/filecoin-ffi/releases/tag/b6e0b35fb49ed0fe)
- - [#5599](https://github.com/filecoin-project/lotus/pull/5599) Updated to [go-bitfield@v0.2.4](https://github.com/filecoin-project/go-bitfield/releases/tag/v0.2.4)
- - [#5614](https://github.com/filecoin-project/lotus/pull/5614), , [#5621](https://github.com/filecoin-project/lotus/pull/5621) Updated to [go-jsonrpc@v0.1.3](https://github.com/filecoin-project/go-jsonrpc/releases/tag/v0.1.3)
- - [#5459](https://github.com/filecoin-project/lotus/pull/5459) Updated to [spec-actors@v3.0.1](https://github.com/filecoin-project/specs-actors/releases/tag/v3.0.1)
+- [#5296](https://github.com/filecoin-project/lotus/pull/5396) Upgraded to [raulk/go-watchdog@v1.0.1](https://github.com/raulk/go-watchdog/releases/tag/v1.0.1)
+- [#5450](https://github.com/filecoin-project/lotus/pull/5450) Dependency updates
+- [#5425](https://github.com/filecoin-project/lotus/pull/5425) Fixed stale imports in testplans/lotus-soup
+- [#5535](https://github.com/filecoin-project/lotus/pull/5535) Updated to [go-fil-markets@v1.1.7](https://github.com/filecoin-project/go-fil-markets/releases/tag/v1.1.7)
+- [#5616](https://github.com/filecoin-project/lotus/pull/5600) Updated to [filecoin-ffi@b6e0b35fb49ed0fe](https://github.com/filecoin-project/filecoin-ffi/releases/tag/b6e0b35fb49ed0fe)
+- [#5599](https://github.com/filecoin-project/lotus/pull/5599) Updated to [go-bitfield@v0.2.4](https://github.com/filecoin-project/go-bitfield/releases/tag/v0.2.4)
+- [#5614](https://github.com/filecoin-project/lotus/pull/5614), , [#5621](https://github.com/filecoin-project/lotus/pull/5621) Updated to [go-jsonrpc@v0.1.3](https://github.com/filecoin-project/go-jsonrpc/releases/tag/v0.1.3)
+- [#5459](https://github.com/filecoin-project/lotus/pull/5459) Updated to [spec-actors@v3.0.1](https://github.com/filecoin-project/specs-actors/releases/tag/v3.0.1)
## Network Version v10 Upgrade
@@ -465,7 +312,7 @@ Note that this release does NOT set an upgrade epoch for v3 actors to take effec
- [#5603](https://github.com/filecoin-project/lotus/pull/5603) Set nerpanet's upgrade epochs up to v3 actors
- [#5471](https://github.com/filecoin-project/lotus/pull/5471), [#5456](https://github.com/filecoin-project/lotus/pull/5456) Set calibration net actor v3 migration epochs for testing
- [#5434](https://github.com/filecoin-project/lotus/pull/5434) Implemented pre-migration framework
-- [#5476](https://github.com/filecoin-project/lotus/pull/5477) Tune migration
+- [#5476](https://github.com/filecoin-project/lotus/pull/5477) Tune migration
# 1.4.1 / 2021-01-20
@@ -664,9 +511,9 @@ This is an optional Lotus release that introduces various improvements to the mi
- Error out deals that are not activated by proposed deal start epoch (https://github.com/filecoin-project/lotus/pull/5061)
# 1.2.1 / 2020-11-20
-
+
This is a very small release of Lotus that fixes an issue users are experiencing when importing snapshots. There is no need to upgrade unless you experience an issue with creating a new datastore directory in the Lotus repo.
-
+
## Changes
- fix blockstore directory not created automatically (https://github.com/filecoin-project/lotus/pull/4922)
@@ -686,7 +533,7 @@ The changes that break consensus are:
- Correction of the VM circulating supply calculation (https://github.com/filecoin-project/lotus/pull/4862)
- Retuning gas costs (https://github.com/filecoin-project/lotus/pull/4830)
- Avoid sending messages to the zero BLS address (https://github.com/filecoin-project/lotus/pull/4888)
-
+
## Other Changes
- delayed pubsub subscribe for messages topic (https://github.com/filecoin-project/lotus/pull/3646)
@@ -843,7 +690,7 @@ This is an optional release of Lotus that upgrades Lotus dependencies, and inclu
This is a patch release of Lotus that builds on the fixes involving worker keys that was introduced in v1.1.1. Miners and node operators should update to this release as soon as possible in order to ensure their blocks are propagated and validated.
-## Changes
+## Changes
- Handle worker key changes correctly in runtime (https://github.com/filecoin-project/lotus/pull/4579)
@@ -1086,7 +933,7 @@ This consensus-breaking release of Lotus upgrades the actors version to v2.0.0.
- Fix pond (https://github.com/filecoin-project/lotus/pull/4203)
- allow manual setting of noncefix fee cap (https://github.com/filecoin-project/lotus/pull/4205)
- implement command to get execution traces of any message (https://github.com/filecoin-project/lotus/pull/4200)
-- conformance: minor driver refactors (https://github.com/filecoin-project/lotus/pull/4211)
+- conformance: minor driver refactors (https://github.com/filecoin-project/lotus/pull/4211)
- lotus-pcr: ignore all other messages (https://github.com/filecoin-project/lotus/pull/4218)
- lotus-pcr: zero refund (https://github.com/filecoin-project/lotus/pull/4229)
@@ -1113,7 +960,7 @@ We are grateful for every contribution!
This optional release of Lotus introduces a new version of markets which switches to CBOR-map encodings, and allows datastore migrations. The release also introduces several improvements to the mining process, a few performance optimizations, and a battery of UX additions and enhancements.
-## Changes
+## Changes
#### Dependencies
@@ -1184,7 +1031,7 @@ This consensus-breaking release of Lotus introduces an upgrade to the network. T
This release also updates go-fil-markets to fix an incompatibility issue between v0.7.2 and earlier versions.
-## Changes
+## Changes
#### Dependencies
@@ -1273,7 +1120,7 @@ This optional release of Lotus introduces some critical fixes to the window PoSt
## Changes
-#### Some notable improvements:
+#### Some notable improvements:
- Correctly construct params for `SubmitWindowedPoSt` messages (https://github.com/filecoin-project/lotus/pull/3909)
- Skip sectors correctly for Window PoSt (https://github.com/filecoin-project/lotus/pull/3839)
@@ -1309,7 +1156,7 @@ This consensus-breaking release of Lotus is designed to test a network upgrade o
- Drand upgrade (https://github.com/filecoin-project/lotus/pull/3670)
- Multisig API additions (https://github.com/filecoin-project/lotus/pull/3590)
-#### Storage Miner
+#### Storage Miner
- Increase the number of times precommit2 is attempted before moving back to precommit1 (https://github.com/filecoin-project/lotus/pull/3720)
@@ -1352,7 +1199,7 @@ This release introduces some critical fixes to message selection and gas estimat
## Changes
-#### Messagepool
+#### Messagepool
- Warn when optimal selection fails to pack a block and we fall back to random selection (https://github.com/filecoin-project/lotus/pull/3708)
- Add basic command for printing gas performance of messages in the mpool (https://github.com/filecoin-project/lotus/pull/3701)
@@ -1422,7 +1269,7 @@ This release also introduces many improvements to Lotus! Among them are a new ve
- Add additional info about gas premium (https://github.com/filecoin-project/lotus/pull/3578)
- Fix GasPremium capping logic (https://github.com/filecoin-project/lotus/pull/3552)
-#### Payment channels
+#### Payment channels
- Get available funds by address or by from/to (https://github.com/filecoin-project/lotus/pull/3547)
- Create `lotus paych status` command (https://github.com/filecoin-project/lotus/pull/3523)
@@ -1472,7 +1319,7 @@ This patch includes a crucial fix to the message pool selection logic, strongly
This patch includes a hotfix to the `GasEstimateFeeCap` method, capping the estimated fee to a reasonable level by default.
-## Changes
+## Changes
- Added target height to sync wait (https://github.com/filecoin-project/lotus/pull/3502)
- Disable codecov annotations (https://github.com/filecoin-project/lotus/pull/3514)
@@ -1502,7 +1349,7 @@ This patch includes some bugfixes to the sector sealing process, and updates go-
# 0.5.7 / 2020-08-31
-This patch release includes some bugfixes and enhancements to the sector lifecycle and message pool logic.
+This patch release includes some bugfixes and enhancements to the sector lifecycle and message pool logic.
## Changes
@@ -1522,7 +1369,7 @@ Hotfix release that fixes a panic in the sealing scheduler (https://github.com/f
# 0.5.5
This patch release introduces a large number of improvements to the sealing process.
-It also updates go-fil-markets to
+It also updates go-fil-markets to
[version 0.5.8](https://github.com/filecoin-project/go-fil-markets/releases/tag/v0.5.8),
and go-libp2p-pubsub to [v0.3.5](https://github.com/libp2p/go-libp2p-pubsub/releases/tag/v0.3.5).
@@ -1535,16 +1382,16 @@ and go-libp2p-pubsub to [v0.3.5](https://github.com/libp2p/go-libp2p-pubsub/rele
- The following improvements were introduced in https://github.com/filecoin-project/lotus/pull/3350.
- - Allow `lotus-miner sectors remove` to remove a sector in any state.
- - Create a separate state in the storage FSM dedicated to submitting the Commit message.
- - Recovery for when the Deal IDs of deals in a sector get changed in a reorg.
- - Auto-retry sending Precommit and Commit messages if they run out of gas
- - Auto-retry sector remove tasks when they fail
- - Compact worker windows, and allow their tasks to be executed in any order
+ - Allow `lotus-miner sectors remove` to remove a sector in any state.
+ - Create a separate state in the storage FSM dedicated to submitting the Commit message.
+ - Recovery for when the Deal IDs of deals in a sector get changed in a reorg.
+ - Auto-retry sending Precommit and Commit messages if they run out of gas
+ - Auto-retry sector remove tasks when they fail
+ - Compact worker windows, and allow their tasks to be executed in any order
- Don't simply skip PoSt for bad sectors (https://github.com/filecoin-project/lotus/pull/3323)
-#### Message Pool
+#### Message Pool
- Spam Protection: Track required funds for pending messages (https://github.com/filecoin-project/lotus/pull/3313)
@@ -1569,7 +1416,7 @@ A patch release, containing a few nice bugfixes and improvements:
# 0.5.3
-Yet another hotfix release.
+Yet another hotfix release.
A lesson for readers, having people who have been awake for 12+ hours review
your hotfix PR is not a good idea. Find someone who has enough slept recently
enough to give you good code review, otherwise you'll end up quickly bumping
@@ -1588,9 +1435,9 @@ This is a hotfix release.
# 0.5.1 / 2020-08-24
-The Space Race release!
+The Space Race release!
This release contains the genesis car file and bootstrap peers for the space
-race network.
+race network.
Additionally, we included two small fixes to genesis creation:
- Randomize ticket value in genesis generation
@@ -1608,9 +1455,9 @@ Among the highlights included in this release are:
- Gas changes: We implemented EIP-1559 and introduced real gas values.
- Deal-making: We now support "Committed Capacity" sectors, "fast-retrieval" deals,
-and the packing of multiple deals into a single sector.
+ and the packing of multiple deals into a single sector.
- Renamed features: We renamed some of the binaries, environment variables, and default
-paths associated with a Lotus node.
+ paths associated with a Lotus node.
### Gas changes
@@ -1618,19 +1465,19 @@ We made some significant changes to the mechanics of gas in this release.
#### Network fee
-We implemented something similar to
+We implemented something similar to
[Ethereum's EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md).
The `Message` structure had three changes:
- The `GasPrice` field has been removed
- A new `GasFeeCap` field has been added, which controls the maximum cost
-the sender incurs for the message
+ the sender incurs for the message
- A new `GasPremium` field has been added, which controls the reward a miner
-earns for including the message
+ earns for including the message
-A sender will never be charged more than `GasFeeCap * GasLimit`.
+A sender will never be charged more than `GasFeeCap * GasLimit`.
A miner will typically earn `GasPremium * GasLimit` as a reward.
-The `Blockheader` structure has one new field, called `ParentBaseFee`.
+The `Blockheader` structure has one new field, called `ParentBaseFee`.
Informally speaking,the `ParentBaseFee`
is increased when blocks are densely packed with messages, and decreased otherwise.
diff --git a/Dockerfile.lotus b/Dockerfile.lotus
index 43d8fbc23..0b43ef806 100644
--- a/Dockerfile.lotus
+++ b/Dockerfile.lotus
@@ -1,4 +1,4 @@
-FROM golang:1.15.6 AS builder-deps
+FROM golang:1.16.4 AS builder-deps
MAINTAINER Lotus Development Team
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
diff --git a/Makefile b/Makefile
index 93b647942..d20343f55 100644
--- a/Makefile
+++ b/Makefile
@@ -6,9 +6,9 @@ all: build
unexport GOFLAGS
GOVERSION:=$(shell go version | cut -d' ' -f 3 | sed 's/^go//' | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
-ifeq ($(shell expr $(GOVERSION) \< 1015005), 1)
+ifeq ($(shell expr $(GOVERSION) \< 1016000), 1)
$(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell expr $(GOVERSION) % 1000000 / 1000).$(shell expr $(GOVERSION) % 1000))
-$(error Update Golang to version to at least 1.15.5)
+$(error Update Golang to version to at least 1.16.0)
endif
# git modules that need to be loaded
@@ -47,7 +47,6 @@ BUILD_DEPS+=ffi-version-check
.PHONY: ffi-version-check
-
$(MODULES): build/.update-modules ;
# dummy file that marks the last time modules were updated
build/.update-modules:
@@ -81,10 +80,12 @@ nerpanet: build-devnets
butterflynet: GOFLAGS+=-tags=butterflynet
butterflynet: build-devnets
+interopnet: GOFLAGS+=-tags=interopnet
+interopnet: build-devnets
+
lotus: $(BUILD_DEPS)
rm -f lotus
go build $(GOFLAGS) -o lotus ./cmd/lotus
- go run github.com/GeertJohan/go.rice/rice append --exec lotus -i ./build
.PHONY: lotus
BINS+=lotus
@@ -92,21 +93,18 @@ BINS+=lotus
lotus-miner: $(BUILD_DEPS)
rm -f lotus-miner
go build $(GOFLAGS) -o lotus-miner ./cmd/lotus-storage-miner
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-miner -i ./build
.PHONY: lotus-miner
BINS+=lotus-miner
lotus-worker: $(BUILD_DEPS)
rm -f lotus-worker
go build $(GOFLAGS) -o lotus-worker ./cmd/lotus-seal-worker
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-worker -i ./build
.PHONY: lotus-worker
BINS+=lotus-worker
lotus-shed: $(BUILD_DEPS)
rm -f lotus-shed
go build $(GOFLAGS) -o lotus-shed ./cmd/lotus-shed
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-shed -i ./build
.PHONY: lotus-shed
BINS+=lotus-shed
@@ -138,7 +136,6 @@ install-worker:
lotus-seed: $(BUILD_DEPS)
rm -f lotus-seed
go build $(GOFLAGS) -o lotus-seed ./cmd/lotus-seed
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-seed -i ./build
.PHONY: lotus-seed
BINS+=lotus-seed
@@ -172,13 +169,11 @@ lotus-townhall-front:
.PHONY: lotus-townhall-front
lotus-townhall-app: lotus-touch lotus-townhall-front
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-townhall -i ./cmd/lotus-townhall -i ./build
.PHONY: lotus-townhall-app
lotus-fountain:
rm -f lotus-fountain
go build -o lotus-fountain ./cmd/lotus-fountain
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-fountain -i ./cmd/lotus-fountain -i ./build
.PHONY: lotus-fountain
BINS+=lotus-fountain
@@ -191,28 +186,24 @@ BINS+=lotus-chainwatch
lotus-bench:
rm -f lotus-bench
go build -o lotus-bench ./cmd/lotus-bench
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-bench -i ./build
.PHONY: lotus-bench
BINS+=lotus-bench
lotus-stats:
rm -f lotus-stats
go build $(GOFLAGS) -o lotus-stats ./cmd/lotus-stats
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-stats -i ./build
.PHONY: lotus-stats
BINS+=lotus-stats
lotus-pcr:
rm -f lotus-pcr
go build $(GOFLAGS) -o lotus-pcr ./cmd/lotus-pcr
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-pcr -i ./build
.PHONY: lotus-pcr
BINS+=lotus-pcr
lotus-health:
rm -f lotus-health
go build -o lotus-health ./cmd/lotus-health
- go run github.com/GeertJohan/go.rice/rice append --exec lotus-health -i ./build
.PHONY: lotus-health
BINS+=lotus-health
@@ -233,6 +224,13 @@ testground:
.PHONY: testground
BINS+=testground
+
+tvx:
+ rm -f tvx
+ go build -o tvx ./cmd/tvx
+.PHONY: tvx
+BINS+=tvx
+
install-chainwatch: lotus-chainwatch
install -C ./lotus-chainwatch /usr/local/bin/lotus-chainwatch
@@ -296,17 +294,10 @@ clean-services: clean-all-services
buildall: $(BINS)
-completions:
- ./scripts/make-completions.sh lotus
- ./scripts/make-completions.sh lotus-miner
-.PHONY: completions
-
install-completions:
mkdir -p /usr/share/bash-completion/completions /usr/local/share/zsh/site-functions/
install -C ./scripts/bash-completion/lotus /usr/share/bash-completion/completions/lotus
- install -C ./scripts/bash-completion/lotus-miner /usr/share/bash-completion/completions/lotus-miner
install -C ./scripts/zsh-completion/lotus /usr/local/share/zsh/site-functions/_lotus
- install -C ./scripts/zsh-completion/lotus-miner /usr/local/share/zsh/site-functions/_lotus-miner
clean:
rm -rf $(CLEAN) $(BINS)
@@ -318,11 +309,12 @@ dist-clean:
git submodule deinit --all -f
.PHONY: dist-clean
-type-gen:
+type-gen: api-gen
go run ./gen/main.go
- go generate ./...
+ go generate -x ./...
+ goimports -w api/
-method-gen:
+method-gen: api-gen
(cd ./lotuspond/front/src/chain && go run ./methodgen.go)
actors-gen:
@@ -330,40 +322,60 @@ actors-gen:
go fmt ./...
api-gen:
- go run ./gen/api > api/apistruct/struct.go
- goimports -w api/apistruct
- goimports -w api/apistruct
+ go run ./gen/api
+ goimports -w api
+ goimports -w api
.PHONY: api-gen
+appimage: lotus
+ rm -rf appimage-builder-cache || true
+ rm AppDir/io.filecoin.lotus.desktop || true
+ rm AppDir/icon.svg || true
+ rm Appdir/AppRun || true
+ mkdir -p AppDir/usr/bin
+ cp ./lotus AppDir/usr/bin/
+ appimage-builder
+
docsgen: docsgen-md docsgen-openrpc
-docsgen-md-bin: actors-gen
+docsgen-md-bin: api-gen actors-gen
go build $(GOFLAGS) -o docgen-md ./api/docgen/cmd
-docsgen-openrpc-bin: actors-gen
+docsgen-openrpc-bin: api-gen actors-gen
go build $(GOFLAGS) -o docgen-openrpc ./api/docgen-openrpc/cmd
docsgen-md: docsgen-md-full docsgen-md-storage docsgen-md-worker
docsgen-md-full: docsgen-md-bin
- ./docgen-md "api/api_full.go" "FullNode" > documentation/en/api-methods.md
+ ./docgen-md "api/api_full.go" "FullNode" "api" "./api" > documentation/en/api-v1-unstable-methods.md
+ ./docgen-md "api/v0api/full.go" "FullNode" "v0api" "./api/v0api" > documentation/en/api-v0-methods.md
docsgen-md-storage: docsgen-md-bin
- ./docgen-md "api/api_storage.go" "StorageMiner" > documentation/en/api-methods-miner.md
+ ./docgen-md "api/api_storage.go" "StorageMiner" "api" "./api" > documentation/en/api-v0-methods-miner.md
docsgen-md-worker: docsgen-md-bin
- ./docgen-md "api/api_worker.go" "Worker" > documentation/en/api-methods-worker.md
+ ./docgen-md "api/api_worker.go" "Worker" "api" "./api" > documentation/en/api-v0-methods-worker.md
docsgen-openrpc: docsgen-openrpc-full docsgen-openrpc-storage docsgen-openrpc-worker
docsgen-openrpc-full: docsgen-openrpc-bin
- ./docgen-openrpc "api/api_full.go" "FullNode" -gzip > build/openrpc/full.json.gz
+ ./docgen-openrpc "api/api_full.go" "FullNode" "api" "./api" -gzip > build/openrpc/full.json.gz
docsgen-openrpc-storage: docsgen-openrpc-bin
- ./docgen-openrpc "api/api_storage.go" "StorageMiner" -gzip > build/openrpc/miner.json.gz
+ ./docgen-openrpc "api/api_storage.go" "StorageMiner" "api" "./api" -gzip > build/openrpc/miner.json.gz
docsgen-openrpc-worker: docsgen-openrpc-bin
- ./docgen-openrpc "api/api_worker.go" "Worker" -gzip > build/openrpc/worker.json.gz
+ ./docgen-openrpc "api/api_worker.go" "Worker" "api" "./api" -gzip > build/openrpc/worker.json.gz
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin
gen: actors-gen type-gen method-gen docsgen api-gen
+ @echo ">>> IF YOU'VE MODIFIED THE CLI, REMEMBER TO ALSO MAKE docsgen-cli"
.PHONY: gen
+snap: lotus lotus-miner lotus-worker
+ snapcraft
+ # snapcraft upload ./lotus_*.snap
+
+# separate from gen because it needs binaries
+docsgen-cli: lotus lotus-miner lotus-worker
+ python ./scripts/generate-lotus-cli.py
+.PHONY: docsgen-cli
+
print-%:
@echo $*=$($*)
diff --git a/README.md b/README.md
index 636c01b44..761838834 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
-
+
diff --git a/api/README.md b/api/README.md
new file mode 100644
index 000000000..07089d7ae
--- /dev/null
+++ b/api/README.md
@@ -0,0 +1,14 @@
+## Lotus API
+
+This package contains all lotus API definitions. Interfaces defined here are
+exposed as JsonRPC 2.0 endpoints by lotus programs.
+
+### Versions
+
+| File | Alias File | Interface | Exposed by | Version | HTTP Endpoint | Status | Docs
+|------------------|-------------------|----------------|--------------------|---------|---------------|------------------------------|------
+| `api_common.go` | `v0api/latest.go` | `Common` | lotus; lotus-miner | v0 | `/rpc/v0` | Latest, Stable | [Methods](../documentation/en/api-v0-methods.md)
+| `api_full.go` | `v1api/latest.go` | `FullNode` | lotus | v1 | `/rpc/v1` | Latest, **Work in progress** | [Methods](../documentation/en/api-v1-unstable-methods.md)
+| `api_storage.go` | `v0api/latest.go` | `StorageMiner` | lotus-miner | v0 | `/rpc/v0` | Latest, Stable | [Methods](../documentation/en/api-v0-methods-miner.md)
+| `api_worker.go` | `v0api/latest.go` | `Worker` | lotus-worker | v0 | `/rpc/v0` | Latest, Stable | [Methods](../documentation/en/api-v0-methods-worker.md)
+| `v0api/full.go` | | `FullNode` | lotus | v0 | `/rpc/v0` | Stable | [Methods](../documentation/en/api-v0-methods.md)
diff --git a/api/api_common.go b/api/api_common.go
index b1aaa4a82..2f27eb95f 100644
--- a/api/api_common.go
+++ b/api/api_common.go
@@ -15,6 +15,17 @@ import (
apitypes "github.com/filecoin-project/lotus/api/types"
)
+// MODIFYING THE API INTERFACE
+//
+// When adding / changing methods in this file:
+// * Do the change here
+// * Adjust implementation in `node/impl/`
+// * Run `make gen` - this will:
+// * Generate proxy structs
+// * Generate mocks
+// * Generate markdown docs
+// * Generate openrpc blobs
+
type Common interface {
// MethodGroup: Auth
diff --git a/api/api_full.go b/api/api_full.go
index 6a56f0473..3dc503f46 100644
--- a/api/api_full.go
+++ b/api/api_full.go
@@ -39,6 +39,22 @@ type ChainIO interface {
ChainHasObj(context.Context, cid.Cid) (bool, error)
}
+const LookbackNoLimit = abi.ChainEpoch(-1)
+
+// MODIFYING THE API INTERFACE
+//
+// NOTE: This is the V1 (Unstable) API - to add methods to the V0 (Stable) API
+// you'll have to add those methods to interfaces in `api/v0api`
+//
+// When adding / changing methods in this file:
+// * Do the change here
+// * Adjust implementation in `node/impl/`
+// * Run `make gen` - this will:
+// * Generate proxy structs
+// * Generate mocks
+// * Generate markdown docs
+// * Generate openrpc blobs
+
// FullNode API is a low-level interface to the Filecoin network full node
type FullNode interface {
Common
@@ -236,6 +252,13 @@ type FullNode interface {
// MpoolBatchPushMessage batch pushes a unsigned message to mempool.
MpoolBatchPushMessage(context.Context, []*types.Message, *MessageSendSpec) ([]*types.SignedMessage, error) //perm:sign
+ // MpoolCheckMessages performs logical checks on a batch of messages
+ MpoolCheckMessages(context.Context, []*MessagePrototype) ([][]MessageCheckStatus, error) //perm:read
+ // MpoolCheckPendingMessages performs logical checks for all pending messages from a given address
+ MpoolCheckPendingMessages(context.Context, address.Address) ([][]MessageCheckStatus, error) //perm:read
+ // MpoolCheckReplaceMessages performs logical checks on pending messages with replacement
+ MpoolCheckReplaceMessages(context.Context, []*types.Message) ([][]MessageCheckStatus, error) //perm:read
+
// MpoolGetNonce gets next nonce for the specified sender.
// Note that this method may not be atomic. Use MpoolPushMessage instead.
MpoolGetNonce(context.Context, address.Address) (uint64, error) //perm:read
@@ -300,6 +323,8 @@ type FullNode interface {
ClientRemoveImport(ctx context.Context, importID multistore.StoreID) error //perm:admin
// ClientStartDeal proposes a deal with a miner.
ClientStartDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error) //perm:admin
+ // ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking.
+ ClientStatelessDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error) //perm:write
// ClientGetDealInfo returns the latest information about a given deal.
ClientGetDealInfo(context.Context, cid.Cid) (*DealInfo, error) //perm:read
// ClientListDeals returns information about the deals made by the local client.
@@ -319,6 +344,10 @@ type FullNode interface {
// ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
// of status updates.
ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
+ // ClientListRetrievals returns information about retrievals made by the local client
+ ClientListRetrievals(ctx context.Context) ([]RetrievalInfo, error) //perm:write
+ // ClientGetRetrievalUpdates returns status of updated retrieval deals
+ ClientGetRetrievalUpdates(ctx context.Context) (<-chan RetrievalInfo, error) //perm:write
// ClientQueryAsk returns a signed StorageAsk from the specified miner.
ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) //perm:read
// ClientCalcCommP calculates the CommP and data size of the specified CID
@@ -430,7 +459,7 @@ type FullNode interface {
StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error) //perm:read
// StateSectorPartition finds deadline/partition with the specified sector
StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error) //perm:read
- // StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed
+ // StateSearchMsg looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed
//
// NOTE: If a replacing message is found on chain, this method will return
// a MsgLookup for the replacing message - the MsgLookup.Message will be a different
@@ -438,48 +467,16 @@ type FullNode interface {
// result of the execution of the replacing message.
//
// If the caller wants to ensure that exactly the requested message was executed,
- // they MUST check that MsgLookup.Message is equal to the provided 'cid'.
- // Without this check both the requested and original message may appear as
+ // they must check that MsgLookup.Message is equal to the provided 'cid', or set the
+ // `allowReplaced` parameter to false. Without this check, and with `allowReplaced`
+ // set to true, both the requested and original message may appear as
// successfully executed on-chain, which may look like a double-spend.
//
// A replacing message is a message with a different CID, any of Gas values, and
// different signature, but with all other parameters matching (source/destination,
// nonce, params, etc.)
- StateSearchMsg(context.Context, cid.Cid) (*MsgLookup, error) //perm:read
- // StateSearchMsgLimited looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed
- //
- // NOTE: If a replacing message is found on chain, this method will return
- // a MsgLookup for the replacing message - the MsgLookup.Message will be a different
- // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
- // result of the execution of the replacing message.
- //
- // If the caller wants to ensure that exactly the requested message was executed,
- // they MUST check that MsgLookup.Message is equal to the provided 'cid'.
- // Without this check both the requested and original message may appear as
- // successfully executed on-chain, which may look like a double-spend.
- //
- // A replacing message is a message with a different CID, any of Gas values, and
- // different signature, but with all other parameters matching (source/destination,
- // nonce, params, etc.)
- StateSearchMsgLimited(ctx context.Context, msg cid.Cid, limit abi.ChainEpoch) (*MsgLookup, error) //perm:read
- // StateWaitMsg looks back in the chain for a message. If not found, it blocks until the
- // message arrives on chain, and gets to the indicated confidence depth.
- //
- // NOTE: If a replacing message is found on chain, this method will return
- // a MsgLookup for the replacing message - the MsgLookup.Message will be a different
- // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
- // result of the execution of the replacing message.
- //
- // If the caller wants to ensure that exactly the requested message was executed,
- // they MUST check that MsgLookup.Message is equal to the provided 'cid'.
- // Without this check both the requested and original message may appear as
- // successfully executed on-chain, which may look like a double-spend.
- //
- // A replacing message is a message with a different CID, any of Gas values, and
- // different signature, but with all other parameters matching (source/destination,
- // nonce, params, etc.)
- StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*MsgLookup, error) //perm:read
- // StateWaitMsgLimited looks back up to limit epochs in the chain for a message.
+ StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error) //perm:read
+ // StateWaitMsg looks back up to limit epochs in the chain for a message.
// If not found, it blocks until the message arrives on chain, and gets to the
// indicated confidence depth.
//
@@ -489,14 +486,15 @@ type FullNode interface {
// result of the execution of the replacing message.
//
// If the caller wants to ensure that exactly the requested message was executed,
- // they MUST check that MsgLookup.Message is equal to the provided 'cid'.
- // Without this check both the requested and original message may appear as
+ // they must check that MsgLookup.Message is equal to the provided 'cid', or set the
+ // `allowReplaced` parameter to false. Without this check, and with `allowReplaced`
+ // set to true, both the requested and original message may appear as
// successfully executed on-chain, which may look like a double-spend.
//
// A replacing message is a message with a different CID, any of Gas values, and
// different signature, but with all other parameters matching (source/destination,
// nonce, params, etc.)
- StateWaitMsgLimited(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch) (*MsgLookup, error) //perm:read
+ StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error) //perm:read
// StateListMiners returns the addresses of every miner that has claimed power in the Power Actor
StateListMiners(context.Context, types.TipSetKey) ([]address.Address, error) //perm:read
// StateListActors returns the addresses of every actor in the state
@@ -516,16 +514,6 @@ type FullNode interface {
// StateChangedActors returns all the actors whose states change between the two given state CIDs
// TODO: Should this take tipset keys instead?
StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) //perm:read
- // StateGetReceipt returns the message receipt for the given message or for a
- // matching gas-repriced replacing message
- //
- // NOTE: If the requested message was replaced, this method will return the receipt
- // for the replacing message - if the caller needs the receipt for exactly the
- // requested message, use StateSearchMsg().Receipt, and check that MsgLookup.Message
- // is matching the requested CID
- //
- // DEPRECATED: Use StateSearchMsg, this method won't be supported in v1 API
- StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) //perm:read
// StateMinerSectorCount returns the number of sectors in a miner's sector set and proving set
StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (MinerSectors, error) //perm:read
// StateCompute is a flexible command that applies the given messages on the given tipset.
@@ -604,15 +592,16 @@ type FullNode interface {
// MsigCreate creates a multisig wallet
// It takes the following params: , ,
//, ,
- MsigCreate(context.Context, uint64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) //perm:sign
+ MsigCreate(context.Context, uint64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (*MessagePrototype, error) //perm:sign
+
// MsigPropose proposes a multisig message
// It takes the following params: , , ,
// , ,
- MsigPropose(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
+ MsigPropose(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
// MsigApprove approves a previously-proposed multisig message by transaction ID
// It takes the following params: ,
- MsigApprove(context.Context, address.Address, uint64, address.Address) (cid.Cid, error) //perm:sign
+ MsigApprove(context.Context, address.Address, uint64, address.Address) (*MessagePrototype, error) //perm:sign
// MsigApproveTxnHash approves a previously-proposed multisig message, specified
// using both transaction ID and a hash of the parameters used in the
@@ -620,43 +609,49 @@ type FullNode interface {
// exactly the transaction you think you are.
// It takes the following params: , , , , ,
// , ,
- MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
+ MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
// MsigCancel cancels a previously-proposed multisig message
// It takes the following params: , , , ,
// , ,
- MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
+ MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
+
// MsigAddPropose proposes adding a signer in the multisig
// It takes the following params: , ,
// ,
- MsigAddPropose(context.Context, address.Address, address.Address, address.Address, bool) (cid.Cid, error) //perm:sign
+ MsigAddPropose(context.Context, address.Address, address.Address, address.Address, bool) (*MessagePrototype, error) //perm:sign
+
// MsigAddApprove approves a previously proposed AddSigner message
// It takes the following params: , , ,
// , ,
- MsigAddApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, bool) (cid.Cid, error) //perm:sign
+ MsigAddApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, bool) (*MessagePrototype, error) //perm:sign
+
// MsigAddCancel cancels a previously proposed AddSigner message
// It takes the following params: , , ,
// ,
- MsigAddCancel(context.Context, address.Address, address.Address, uint64, address.Address, bool) (cid.Cid, error) //perm:sign
+ MsigAddCancel(context.Context, address.Address, address.Address, uint64, address.Address, bool) (*MessagePrototype, error) //perm:sign
+
// MsigSwapPropose proposes swapping 2 signers in the multisig
// It takes the following params: , ,
// ,
- MsigSwapPropose(context.Context, address.Address, address.Address, address.Address, address.Address) (cid.Cid, error) //perm:sign
+ MsigSwapPropose(context.Context, address.Address, address.Address, address.Address, address.Address) (*MessagePrototype, error) //perm:sign
+
// MsigSwapApprove approves a previously proposed SwapSigner
// It takes the following params: , , ,
// , ,
- MsigSwapApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, address.Address) (cid.Cid, error) //perm:sign
+ MsigSwapApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, address.Address) (*MessagePrototype, error) //perm:sign
+
// MsigSwapCancel cancels a previously proposed SwapSigner message
// It takes the following params: , , ,
// ,
- MsigSwapCancel(context.Context, address.Address, address.Address, uint64, address.Address, address.Address) (cid.Cid, error) //perm:sign
+ MsigSwapCancel(context.Context, address.Address, address.Address, uint64, address.Address, address.Address) (*MessagePrototype, error) //perm:sign
// MsigRemoveSigner proposes the removal of a signer from the multisig.
// It accepts the multisig to make the change on, the proposer address to
// send the message from, the address to be removed, and a boolean
// indicating whether or not the signing threshold should be lowered by one
// along with the address removal.
- MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) //perm:sign
+ MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (*MessagePrototype, error) //perm:sign
// MarketAddBalance adds funds to the market actor
MarketAddBalance(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign
@@ -689,6 +684,11 @@ type FullNode interface {
PaychVoucherList(context.Context, address.Address) ([]*paych.SignedVoucher, error) //perm:write
PaychVoucherSubmit(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (cid.Cid, error) //perm:sign
+ // MethodGroup: Node
+ // These methods are general node management and status commands
+
+ NodeStatus(ctx context.Context, inclChainStatus bool) (NodeStatus, error) //perm:read
+
// CreateBackup creates node backup onder the specified file name. The
// method requires that the lotus daemon is running with the
// LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that
@@ -1038,11 +1038,12 @@ type DealCollateralBounds struct {
}
type CirculatingSupply struct {
- FilVested abi.TokenAmount
- FilMined abi.TokenAmount
- FilBurnt abi.TokenAmount
- FilLocked abi.TokenAmount
- FilCirculating abi.TokenAmount
+ FilVested abi.TokenAmount
+ FilMined abi.TokenAmount
+ FilBurnt abi.TokenAmount
+ FilLocked abi.TokenAmount
+ FilCirculating abi.TokenAmount
+ FilReserveDisbursed abi.TokenAmount
}
type MiningBaseInfo struct {
diff --git a/api/api_gateway.go b/api/api_gateway.go
index b550bcbbc..130a18c55 100644
--- a/api/api_gateway.go
+++ b/api/api_gateway.go
@@ -14,6 +14,20 @@ import (
"github.com/filecoin-project/lotus/chain/types"
)
+// MODIFYING THE API INTERFACE
+//
+// NOTE: This is the V1 (Unstable) API - to add methods to the V0 (Stable) API
+// you'll have to add those methods to interfaces in `api/v0api`
+//
+// When adding / changing methods in this file:
+// * Do the change here
+// * Adjust implementation in `node/impl/`
+// * Run `make gen` - this will:
+// * Generate proxy structs
+// * Generate mocks
+// * Generate markdown docs
+// * Generate openrpc blobs
+
type Gateway interface {
ChainHasObj(context.Context, cid.Cid) (bool, error)
ChainHead(ctx context.Context) (*types.TipSet, error)
@@ -31,7 +45,6 @@ type Gateway interface {
StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (DealCollateralBounds, error)
StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
- StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)
StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (MarketBalance, error)
@@ -40,8 +53,9 @@ type Gateway interface {
StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*MinerPower, error)
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error)
- StateSearchMsg(ctx context.Context, msg cid.Cid) (*MsgLookup, error)
StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
- StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*MsgLookup, error)
+ StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error)
+ StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error)
+ WalletBalance(context.Context, address.Address) (types.BigInt, error)
}
diff --git a/api/api_storage.go b/api/api_storage.go
index e50fedc19..0ccfbd88f 100644
--- a/api/api_storage.go
+++ b/api/api_storage.go
@@ -27,6 +27,17 @@ import (
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
)
+// MODIFYING THE API INTERFACE
+//
+// When adding / changing methods in this file:
+// * Do the change here
+// * Adjust implementation in `node/impl/`
+// * Run `make gen` - this will:
+// * Generate proxy structs
+// * Generate mocks
+// * Generate markdown docs
+// * Generate openrpc blobs
+
// StorageMiner is a low-level interface to the Filecoin network storage miner node
type StorageMiner interface {
Common
diff --git a/api/api_test.go b/api/api_test.go
index 70d918b5c..738e1b067 100644
--- a/api/api_test.go
+++ b/api/api_test.go
@@ -113,3 +113,9 @@ func TestReturnTypes(t *testing.T) {
t.Run("miner", tst(new(StorageMiner)))
t.Run("worker", tst(new(Worker)))
}
+
+func TestPermTags(t *testing.T) {
+ _ = PermissionedFullAPI(&FullNodeStruct{})
+ _ = PermissionedStorMinerAPI(&StorageMinerStruct{})
+ _ = PermissionedWorkerAPI(&WorkerStruct{})
+}
diff --git a/api/api_wallet.go b/api/api_wallet.go
index 891b2fabb..973aaaf6d 100644
--- a/api/api_wallet.go
+++ b/api/api_wallet.go
@@ -35,13 +35,13 @@ type MsgMeta struct {
}
type Wallet interface {
- WalletNew(context.Context, types.KeyType) (address.Address, error)
- WalletHas(context.Context, address.Address) (bool, error)
- WalletList(context.Context) ([]address.Address, error)
+ WalletNew(context.Context, types.KeyType) (address.Address, error) //perm:admin
+ WalletHas(context.Context, address.Address) (bool, error) //perm:admin
+ WalletList(context.Context) ([]address.Address, error) //perm:admin
- WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta MsgMeta) (*crypto.Signature, error)
+ WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta MsgMeta) (*crypto.Signature, error) //perm:admin
- WalletExport(context.Context, address.Address) (*types.KeyInfo, error)
- WalletImport(context.Context, *types.KeyInfo) (address.Address, error)
- WalletDelete(context.Context, address.Address) error
+ WalletExport(context.Context, address.Address) (*types.KeyInfo, error) //perm:admin
+ WalletImport(context.Context, *types.KeyInfo) (address.Address, error) //perm:admin
+ WalletDelete(context.Context, address.Address) error //perm:admin
}
diff --git a/api/api_worker.go b/api/api_worker.go
index 3232de449..4553c30e0 100644
--- a/api/api_worker.go
+++ b/api/api_worker.go
@@ -2,7 +2,6 @@ package api
import (
"context"
- "io"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
@@ -14,6 +13,17 @@ import (
"github.com/filecoin-project/specs-storage/storage"
)
+// MODIFYING THE API INTERFACE
+//
+// When adding / changing methods in this file:
+// * Do the change here
+// * Adjust implementation in `node/impl/`
+// * Run `make gen` - this will:
+// * Generate proxy structs
+// * Generate mocks
+// * Generate markdown docs
+// * Generate openrpc blobs
+
type Worker interface {
Version(context.Context) (Version, error) //perm:admin
@@ -32,7 +42,6 @@ type Worker interface {
ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (storiface.CallID, error) //perm:admin
MoveStorage(ctx context.Context, sector storage.SectorRef, types storiface.SectorFileType) (storiface.CallID, error) //perm:admin
UnsealPiece(context.Context, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (storiface.CallID, error) //perm:admin
- ReadPiece(context.Context, io.Writer, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize) (storiface.CallID, error) //perm:admin
Fetch(context.Context, storage.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) //perm:admin
TaskDisable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
diff --git a/api/apistruct/struct_test.go b/api/apistruct/struct_test.go
deleted file mode 100644
index 9f5f58360..000000000
--- a/api/apistruct/struct_test.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package apistruct
-
-import "testing"
-
-func TestPermTags(t *testing.T) {
- _ = PermissionedFullAPI(&FullNodeStruct{})
- _ = PermissionedStorMinerAPI(&StorageMinerStruct{})
- _ = PermissionedWorkerAPI(&WorkerStruct{})
-}
diff --git a/api/checkstatuscode_string.go b/api/checkstatuscode_string.go
new file mode 100644
index 000000000..072f77989
--- /dev/null
+++ b/api/checkstatuscode_string.go
@@ -0,0 +1,35 @@
+// Code generated by "stringer -type=CheckStatusCode -trimprefix=CheckStatus"; DO NOT EDIT.
+
+package api
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[CheckStatusMessageSerialize-1]
+ _ = x[CheckStatusMessageSize-2]
+ _ = x[CheckStatusMessageValidity-3]
+ _ = x[CheckStatusMessageMinGas-4]
+ _ = x[CheckStatusMessageMinBaseFee-5]
+ _ = x[CheckStatusMessageBaseFee-6]
+ _ = x[CheckStatusMessageBaseFeeLowerBound-7]
+ _ = x[CheckStatusMessageBaseFeeUpperBound-8]
+ _ = x[CheckStatusMessageGetStateNonce-9]
+ _ = x[CheckStatusMessageNonce-10]
+ _ = x[CheckStatusMessageGetStateBalance-11]
+ _ = x[CheckStatusMessageBalance-12]
+}
+
+const _CheckStatusCode_name = "MessageSerializeMessageSizeMessageValidityMessageMinGasMessageMinBaseFeeMessageBaseFeeMessageBaseFeeLowerBoundMessageBaseFeeUpperBoundMessageGetStateNonceMessageNonceMessageGetStateBalanceMessageBalance"
+
+var _CheckStatusCode_index = [...]uint8{0, 16, 27, 42, 55, 72, 86, 110, 134, 154, 166, 188, 202}
+
+func (i CheckStatusCode) String() string {
+ i -= 1
+ if i < 0 || i >= CheckStatusCode(len(_CheckStatusCode_index)-1) {
+ return "CheckStatusCode(" + strconv.FormatInt(int64(i+1), 10) + ")"
+ }
+ return _CheckStatusCode_name[_CheckStatusCode_index[i]:_CheckStatusCode_index[i+1]]
+}
diff --git a/api/client/client.go b/api/client/client.go
index 9ffd1707e..90fe714bf 100644
--- a/api/client/client.go
+++ b/api/client/client.go
@@ -10,13 +10,14 @@ import (
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/apistruct"
+ "github.com/filecoin-project/lotus/api/v0api"
+ "github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/lib/rpcenc"
)
-// NewCommonRPC creates a new http jsonrpc client.
-func NewCommonRPC(ctx context.Context, addr string, requestHeader http.Header) (api.Common, jsonrpc.ClientCloser, error) {
- var res apistruct.CommonStruct
+// NewCommonRPCV0 creates a new http jsonrpc client.
+func NewCommonRPCV0(ctx context.Context, addr string, requestHeader http.Header) (api.Common, jsonrpc.ClientCloser, error) {
+ var res v0api.CommonStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
@@ -27,9 +28,9 @@ func NewCommonRPC(ctx context.Context, addr string, requestHeader http.Header) (
return &res, closer, err
}
-// NewFullNodeRPC creates a new http jsonrpc client.
-func NewFullNodeRPC(ctx context.Context, addr string, requestHeader http.Header) (api.FullNode, jsonrpc.ClientCloser, error) {
- var res apistruct.FullNodeStruct
+// NewFullNodeRPCV0 creates a new http jsonrpc client.
+func NewFullNodeRPCV0(ctx context.Context, addr string, requestHeader http.Header) (v0api.FullNode, jsonrpc.ClientCloser, error) {
+ var res v0api.FullNodeStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.CommonStruct.Internal,
@@ -39,9 +40,21 @@ func NewFullNodeRPC(ctx context.Context, addr string, requestHeader http.Header)
return &res, closer, err
}
-// NewStorageMinerRPC creates a new http jsonrpc client for miner
-func NewStorageMinerRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.StorageMiner, jsonrpc.ClientCloser, error) {
- var res apistruct.StorageMinerStruct
+// NewFullNodeRPCV1 creates a new http jsonrpc client.
+func NewFullNodeRPCV1(ctx context.Context, addr string, requestHeader http.Header) (api.FullNode, jsonrpc.ClientCloser, error) {
+ var res v1api.FullNodeStruct
+ closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
+ []interface{}{
+ &res.CommonStruct.Internal,
+ &res.Internal,
+ }, requestHeader)
+
+ return &res, closer, err
+}
+
+// NewStorageMinerRPCV0 creates a new http jsonrpc client for miner
+func NewStorageMinerRPCV0(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (v0api.StorageMiner, jsonrpc.ClientCloser, error) {
+ var res v0api.StorageMinerStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.CommonStruct.Internal,
@@ -54,7 +67,7 @@ func NewStorageMinerRPC(ctx context.Context, addr string, requestHeader http.Hea
return &res, closer, err
}
-func NewWorkerRPC(ctx context.Context, addr string, requestHeader http.Header) (api.Worker, jsonrpc.ClientCloser, error) {
+func NewWorkerRPCV0(ctx context.Context, addr string, requestHeader http.Header) (api.Worker, jsonrpc.ClientCloser, error) {
u, err := url.Parse(addr)
if err != nil {
return nil, nil, err
@@ -69,7 +82,7 @@ func NewWorkerRPC(ctx context.Context, addr string, requestHeader http.Header) (
u.Path = path.Join(u.Path, "../streams/v0/push")
- var res apistruct.WorkerStruct
+ var res api.WorkerStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
@@ -83,9 +96,9 @@ func NewWorkerRPC(ctx context.Context, addr string, requestHeader http.Header) (
return &res, closer, err
}
-// NewGatewayRPC creates a new http jsonrpc client for a gateway node.
-func NewGatewayRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.Gateway, jsonrpc.ClientCloser, error) {
- var res apistruct.GatewayStruct
+// NewGatewayRPCV1 creates a new http jsonrpc client for a gateway node.
+func NewGatewayRPCV1(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.Gateway, jsonrpc.ClientCloser, error) {
+ var res api.GatewayStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
@@ -97,8 +110,22 @@ func NewGatewayRPC(ctx context.Context, addr string, requestHeader http.Header,
return &res, closer, err
}
-func NewWalletRPC(ctx context.Context, addr string, requestHeader http.Header) (api.Wallet, jsonrpc.ClientCloser, error) {
- var res apistruct.WalletStruct
+// NewGatewayRPCV0 creates a new http jsonrpc client for a gateway node.
+func NewGatewayRPCV0(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (v0api.Gateway, jsonrpc.ClientCloser, error) {
+ var res v0api.GatewayStruct
+ closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
+ []interface{}{
+ &res.Internal,
+ },
+ requestHeader,
+ opts...,
+ )
+
+ return &res, closer, err
+}
+
+func NewWalletRPCV0(ctx context.Context, addr string, requestHeader http.Header) (api.Wallet, jsonrpc.ClientCloser, error) {
+ var res api.WalletStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
diff --git a/api/docgen-openrpc/cmd/docgen_openrpc.go b/api/docgen-openrpc/cmd/docgen_openrpc.go
index 81683e04d..febbef3e4 100644
--- a/api/docgen-openrpc/cmd/docgen_openrpc.go
+++ b/api/docgen-openrpc/cmd/docgen_openrpc.go
@@ -7,7 +7,8 @@ import (
"log"
"os"
- "github.com/filecoin-project/lotus/api/apistruct"
+ "github.com/filecoin-project/lotus/api/docgen"
+
docgen_openrpc "github.com/filecoin-project/lotus/api/docgen-openrpc"
)
@@ -29,16 +30,12 @@ Use:
*/
func main() {
- doc := docgen_openrpc.NewLotusOpenRPCDocument()
+ Comments, GroupDocs := docgen.ParseApiASTInfo(os.Args[1], os.Args[2], os.Args[3], os.Args[4])
- switch os.Args[2] {
- case "FullNode":
- doc.RegisterReceiverName("Filecoin", &apistruct.FullNodeStruct{})
- case "StorageMiner":
- doc.RegisterReceiverName("Filecoin", &apistruct.StorageMinerStruct{})
- case "Worker":
- doc.RegisterReceiverName("Filecoin", &apistruct.WorkerStruct{})
- }
+ doc := docgen_openrpc.NewLotusOpenRPCDocument(Comments, GroupDocs)
+
+ i, _, _, _ := docgen.GetAPIType(os.Args[2], os.Args[3])
+ doc.RegisterReceiverName("Filecoin", i)
out, err := doc.Discover()
if err != nil {
@@ -52,7 +49,7 @@ func main() {
// Could use flags package to handle this more cleanly, but that requires changes elsewhere
// the scope of which just isn't warranted by this one use case which will usually be run
// programmatically anyways.
- if len(os.Args) > 3 && os.Args[3] == "-gzip" {
+ if len(os.Args) > 5 && os.Args[5] == "-gzip" {
jsonOut, err = json.Marshal(out)
if err != nil {
log.Fatalln(err)
diff --git a/api/docgen-openrpc/openrpc.go b/api/docgen-openrpc/openrpc.go
index 507ad3cb1..271b43ac6 100644
--- a/api/docgen-openrpc/openrpc.go
+++ b/api/docgen-openrpc/openrpc.go
@@ -4,7 +4,6 @@ import (
"encoding/json"
"go/ast"
"net"
- "os"
"reflect"
"github.com/alecthomas/jsonschema"
@@ -15,16 +14,6 @@ import (
meta_schema "github.com/open-rpc/meta-schema"
)
-// Comments holds API method comments collected by AST parsing.
-var Comments map[string]string
-
-// GroupDocs holds documentation for documentation groups.
-var GroupDocs map[string]string
-
-func init() {
- Comments, GroupDocs = docgen.ParseApiASTInfo(os.Args[1], os.Args[2])
-}
-
// schemaDictEntry represents a type association passed to the jsonschema reflector.
type schemaDictEntry struct {
example interface{}
@@ -94,7 +83,7 @@ func OpenRPCSchemaTypeMapper(ty reflect.Type) *jsonschema.Type {
}
// NewLotusOpenRPCDocument defines application-specific documentation and configuration for its OpenRPC document.
-func NewLotusOpenRPCDocument() *go_openrpc_reflect.Document {
+func NewLotusOpenRPCDocument(Comments, GroupDocs map[string]string) *go_openrpc_reflect.Document {
d := &go_openrpc_reflect.Document{}
// Register "Meta" document fields.
diff --git a/api/docgen/cmd/docgen.go b/api/docgen/cmd/docgen.go
index c47d44208..912eea841 100644
--- a/api/docgen/cmd/docgen.go
+++ b/api/docgen/cmd/docgen.go
@@ -4,39 +4,18 @@ import (
"encoding/json"
"fmt"
"os"
- "reflect"
"sort"
"strings"
- "github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/apistruct"
"github.com/filecoin-project/lotus/api/docgen"
)
func main() {
- comments, groupComments := docgen.ParseApiASTInfo(os.Args[1], os.Args[2])
+ comments, groupComments := docgen.ParseApiASTInfo(os.Args[1], os.Args[2], os.Args[3], os.Args[4])
groups := make(map[string]*docgen.MethodGroup)
- var t reflect.Type
- var permStruct, commonPermStruct reflect.Type
-
- switch os.Args[2] {
- case "FullNode":
- t = reflect.TypeOf(new(struct{ api.FullNode })).Elem()
- permStruct = reflect.TypeOf(apistruct.FullNodeStruct{}.Internal)
- commonPermStruct = reflect.TypeOf(apistruct.CommonStruct{}.Internal)
- case "StorageMiner":
- t = reflect.TypeOf(new(struct{ api.StorageMiner })).Elem()
- permStruct = reflect.TypeOf(apistruct.StorageMinerStruct{}.Internal)
- commonPermStruct = reflect.TypeOf(apistruct.CommonStruct{}.Internal)
- case "Worker":
- t = reflect.TypeOf(new(struct{ api.Worker })).Elem()
- permStruct = reflect.TypeOf(apistruct.WorkerStruct{}.Internal)
- commonPermStruct = reflect.TypeOf(apistruct.WorkerStruct{}.Internal)
- default:
- panic("unknown type")
- }
+ _, t, permStruct, commonPermStruct := docgen.GetAPIType(os.Args[2], os.Args[3])
for i := 0; i < t.NumMethod(); i++ {
m := t.Method(i)
diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go
index e17238d88..4f9bc637e 100644
--- a/api/docgen/docgen.go
+++ b/api/docgen/docgen.go
@@ -35,6 +35,7 @@ import (
"github.com/filecoin-project/lotus/api"
apitypes "github.com/filecoin-project/lotus/api/types"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
@@ -113,7 +114,7 @@ func init() {
addExample(network.Connected)
addExample(dtypes.NetworkName("lotus"))
addExample(api.SyncStateStage(1))
- addExample(api.FullAPIVersion)
+ addExample(api.FullAPIVersion1)
addExample(api.PCHInbound)
addExample(time.Minute)
addExample(datatransfer.TransferID(3))
@@ -260,6 +261,45 @@ func init() {
},
"methods": []interface{}{}},
)
+
+ addExample(api.CheckStatusCode(0))
+ addExample(map[string]interface{}{"abc": 123})
+}
+
+func GetAPIType(name, pkg string) (i interface{}, t, permStruct, commonPermStruct reflect.Type) {
+ switch pkg {
+ case "api": // latest
+ switch name {
+ case "FullNode":
+ i = &api.FullNodeStruct{}
+ t = reflect.TypeOf(new(struct{ api.FullNode })).Elem()
+ permStruct = reflect.TypeOf(api.FullNodeStruct{}.Internal)
+ commonPermStruct = reflect.TypeOf(api.CommonStruct{}.Internal)
+ case "StorageMiner":
+ i = &api.StorageMinerStruct{}
+ t = reflect.TypeOf(new(struct{ api.StorageMiner })).Elem()
+ permStruct = reflect.TypeOf(api.StorageMinerStruct{}.Internal)
+ commonPermStruct = reflect.TypeOf(api.CommonStruct{}.Internal)
+ case "Worker":
+ i = &api.WorkerStruct{}
+ t = reflect.TypeOf(new(struct{ api.Worker })).Elem()
+ permStruct = reflect.TypeOf(api.WorkerStruct{}.Internal)
+ commonPermStruct = reflect.TypeOf(api.WorkerStruct{}.Internal)
+ default:
+ panic("unknown type")
+ }
+ case "v0api":
+ switch name {
+ case "FullNode":
+ i = v0api.FullNodeStruct{}
+ t = reflect.TypeOf(new(struct{ v0api.FullNode })).Elem()
+ permStruct = reflect.TypeOf(v0api.FullNodeStruct{}.Internal)
+ commonPermStruct = reflect.TypeOf(v0api.CommonStruct{}.Internal)
+ default:
+ panic("unknown type")
+ }
+ }
+ return
}
func ExampleValue(method string, t, parent reflect.Type) interface{} {
@@ -342,9 +382,9 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor {
const NoComment = "There are not yet any comments for this method."
-func ParseApiASTInfo(apiFile, iface string) (comments map[string]string, groupDocs map[string]string) { //nolint:golint
+func ParseApiASTInfo(apiFile, iface, pkg, dir string) (comments map[string]string, groupDocs map[string]string) { //nolint:golint
fset := token.NewFileSet()
- apiDir, err := filepath.Abs("./api")
+ apiDir, err := filepath.Abs(dir)
if err != nil {
fmt.Println("./api filepath absolute error: ", err)
return
@@ -360,14 +400,14 @@ func ParseApiASTInfo(apiFile, iface string) (comments map[string]string, groupDo
return
}
- ap := pkgs["api"]
+ ap := pkgs[pkg]
f := ap.Files[apiFile]
cmap := ast.NewCommentMap(fset, f, f.Comments)
v := &Visitor{iface, make(map[string]ast.Node)}
- ast.Walk(v, pkgs["api"])
+ ast.Walk(v, ap)
comments = make(map[string]string)
groupDocs = make(map[string]string)
diff --git a/api/mocks/mock_full.go b/api/mocks/mock_full.go
index 8de04cf4c..bb83a88a2 100644
--- a/api/mocks/mock_full.go
+++ b/api/mocks/mock_full.go
@@ -6,6 +6,8 @@ package mocks
import (
context "context"
+ reflect "reflect"
+
address "github.com/filecoin-project/go-address"
bitfield "github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer"
@@ -33,33 +35,32 @@ import (
network0 "github.com/libp2p/go-libp2p-core/network"
peer "github.com/libp2p/go-libp2p-core/peer"
protocol "github.com/libp2p/go-libp2p-core/protocol"
- reflect "reflect"
)
-// MockFullNode is a mock of FullNode interface
+// MockFullNode is a mock of FullNode interface.
type MockFullNode struct {
ctrl *gomock.Controller
recorder *MockFullNodeMockRecorder
}
-// MockFullNodeMockRecorder is the mock recorder for MockFullNode
+// MockFullNodeMockRecorder is the mock recorder for MockFullNode.
type MockFullNodeMockRecorder struct {
mock *MockFullNode
}
-// NewMockFullNode creates a new mock instance
+// NewMockFullNode creates a new mock instance.
func NewMockFullNode(ctrl *gomock.Controller) *MockFullNode {
mock := &MockFullNode{ctrl: ctrl}
mock.recorder = &MockFullNodeMockRecorder{mock}
return mock
}
-// EXPECT returns an object that allows the caller to indicate expected use
+// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockFullNode) EXPECT() *MockFullNodeMockRecorder {
return m.recorder
}
-// AuthNew mocks base method
+// AuthNew mocks base method.
func (m *MockFullNode) AuthNew(arg0 context.Context, arg1 []auth.Permission) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AuthNew", arg0, arg1)
@@ -68,13 +69,13 @@ func (m *MockFullNode) AuthNew(arg0 context.Context, arg1 []auth.Permission) ([]
return ret0, ret1
}
-// AuthNew indicates an expected call of AuthNew
+// AuthNew indicates an expected call of AuthNew.
func (mr *MockFullNodeMockRecorder) AuthNew(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthNew", reflect.TypeOf((*MockFullNode)(nil).AuthNew), arg0, arg1)
}
-// AuthVerify mocks base method
+// AuthVerify mocks base method.
func (m *MockFullNode) AuthVerify(arg0 context.Context, arg1 string) ([]auth.Permission, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AuthVerify", arg0, arg1)
@@ -83,13 +84,13 @@ func (m *MockFullNode) AuthVerify(arg0 context.Context, arg1 string) ([]auth.Per
return ret0, ret1
}
-// AuthVerify indicates an expected call of AuthVerify
+// AuthVerify indicates an expected call of AuthVerify.
func (mr *MockFullNodeMockRecorder) AuthVerify(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthVerify", reflect.TypeOf((*MockFullNode)(nil).AuthVerify), arg0, arg1)
}
-// BeaconGetEntry mocks base method
+// BeaconGetEntry mocks base method.
func (m *MockFullNode) BeaconGetEntry(arg0 context.Context, arg1 abi.ChainEpoch) (*types.BeaconEntry, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BeaconGetEntry", arg0, arg1)
@@ -98,13 +99,13 @@ func (m *MockFullNode) BeaconGetEntry(arg0 context.Context, arg1 abi.ChainEpoch)
return ret0, ret1
}
-// BeaconGetEntry indicates an expected call of BeaconGetEntry
+// BeaconGetEntry indicates an expected call of BeaconGetEntry.
func (mr *MockFullNodeMockRecorder) BeaconGetEntry(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconGetEntry", reflect.TypeOf((*MockFullNode)(nil).BeaconGetEntry), arg0, arg1)
}
-// ChainDeleteObj mocks base method
+// ChainDeleteObj mocks base method.
func (m *MockFullNode) ChainDeleteObj(arg0 context.Context, arg1 cid.Cid) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainDeleteObj", arg0, arg1)
@@ -112,13 +113,13 @@ func (m *MockFullNode) ChainDeleteObj(arg0 context.Context, arg1 cid.Cid) error
return ret0
}
-// ChainDeleteObj indicates an expected call of ChainDeleteObj
+// ChainDeleteObj indicates an expected call of ChainDeleteObj.
func (mr *MockFullNodeMockRecorder) ChainDeleteObj(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainDeleteObj", reflect.TypeOf((*MockFullNode)(nil).ChainDeleteObj), arg0, arg1)
}
-// ChainExport mocks base method
+// ChainExport mocks base method.
func (m *MockFullNode) ChainExport(arg0 context.Context, arg1 abi.ChainEpoch, arg2 bool, arg3 types.TipSetKey) (<-chan []byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainExport", arg0, arg1, arg2, arg3)
@@ -127,13 +128,13 @@ func (m *MockFullNode) ChainExport(arg0 context.Context, arg1 abi.ChainEpoch, ar
return ret0, ret1
}
-// ChainExport indicates an expected call of ChainExport
+// ChainExport indicates an expected call of ChainExport.
func (mr *MockFullNodeMockRecorder) ChainExport(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainExport", reflect.TypeOf((*MockFullNode)(nil).ChainExport), arg0, arg1, arg2, arg3)
}
-// ChainGetBlock mocks base method
+// ChainGetBlock mocks base method.
func (m *MockFullNode) ChainGetBlock(arg0 context.Context, arg1 cid.Cid) (*types.BlockHeader, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetBlock", arg0, arg1)
@@ -142,13 +143,13 @@ func (m *MockFullNode) ChainGetBlock(arg0 context.Context, arg1 cid.Cid) (*types
return ret0, ret1
}
-// ChainGetBlock indicates an expected call of ChainGetBlock
+// ChainGetBlock indicates an expected call of ChainGetBlock.
func (mr *MockFullNodeMockRecorder) ChainGetBlock(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetBlock", reflect.TypeOf((*MockFullNode)(nil).ChainGetBlock), arg0, arg1)
}
-// ChainGetBlockMessages mocks base method
+// ChainGetBlockMessages mocks base method.
func (m *MockFullNode) ChainGetBlockMessages(arg0 context.Context, arg1 cid.Cid) (*api.BlockMessages, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetBlockMessages", arg0, arg1)
@@ -157,13 +158,13 @@ func (m *MockFullNode) ChainGetBlockMessages(arg0 context.Context, arg1 cid.Cid)
return ret0, ret1
}
-// ChainGetBlockMessages indicates an expected call of ChainGetBlockMessages
+// ChainGetBlockMessages indicates an expected call of ChainGetBlockMessages.
func (mr *MockFullNodeMockRecorder) ChainGetBlockMessages(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetBlockMessages", reflect.TypeOf((*MockFullNode)(nil).ChainGetBlockMessages), arg0, arg1)
}
-// ChainGetGenesis mocks base method
+// ChainGetGenesis mocks base method.
func (m *MockFullNode) ChainGetGenesis(arg0 context.Context) (*types.TipSet, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetGenesis", arg0)
@@ -172,13 +173,13 @@ func (m *MockFullNode) ChainGetGenesis(arg0 context.Context) (*types.TipSet, err
return ret0, ret1
}
-// ChainGetGenesis indicates an expected call of ChainGetGenesis
+// ChainGetGenesis indicates an expected call of ChainGetGenesis.
func (mr *MockFullNodeMockRecorder) ChainGetGenesis(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetGenesis", reflect.TypeOf((*MockFullNode)(nil).ChainGetGenesis), arg0)
}
-// ChainGetMessage mocks base method
+// ChainGetMessage mocks base method.
func (m *MockFullNode) ChainGetMessage(arg0 context.Context, arg1 cid.Cid) (*types.Message, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetMessage", arg0, arg1)
@@ -187,13 +188,13 @@ func (m *MockFullNode) ChainGetMessage(arg0 context.Context, arg1 cid.Cid) (*typ
return ret0, ret1
}
-// ChainGetMessage indicates an expected call of ChainGetMessage
+// ChainGetMessage indicates an expected call of ChainGetMessage.
func (mr *MockFullNodeMockRecorder) ChainGetMessage(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetMessage", reflect.TypeOf((*MockFullNode)(nil).ChainGetMessage), arg0, arg1)
}
-// ChainGetNode mocks base method
+// ChainGetNode mocks base method.
func (m *MockFullNode) ChainGetNode(arg0 context.Context, arg1 string) (*api.IpldObject, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetNode", arg0, arg1)
@@ -202,13 +203,13 @@ func (m *MockFullNode) ChainGetNode(arg0 context.Context, arg1 string) (*api.Ipl
return ret0, ret1
}
-// ChainGetNode indicates an expected call of ChainGetNode
+// ChainGetNode indicates an expected call of ChainGetNode.
func (mr *MockFullNodeMockRecorder) ChainGetNode(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetNode", reflect.TypeOf((*MockFullNode)(nil).ChainGetNode), arg0, arg1)
}
-// ChainGetParentMessages mocks base method
+// ChainGetParentMessages mocks base method.
func (m *MockFullNode) ChainGetParentMessages(arg0 context.Context, arg1 cid.Cid) ([]api.Message, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetParentMessages", arg0, arg1)
@@ -217,13 +218,13 @@ func (m *MockFullNode) ChainGetParentMessages(arg0 context.Context, arg1 cid.Cid
return ret0, ret1
}
-// ChainGetParentMessages indicates an expected call of ChainGetParentMessages
+// ChainGetParentMessages indicates an expected call of ChainGetParentMessages.
func (mr *MockFullNodeMockRecorder) ChainGetParentMessages(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetParentMessages", reflect.TypeOf((*MockFullNode)(nil).ChainGetParentMessages), arg0, arg1)
}
-// ChainGetParentReceipts mocks base method
+// ChainGetParentReceipts mocks base method.
func (m *MockFullNode) ChainGetParentReceipts(arg0 context.Context, arg1 cid.Cid) ([]*types.MessageReceipt, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetParentReceipts", arg0, arg1)
@@ -232,13 +233,13 @@ func (m *MockFullNode) ChainGetParentReceipts(arg0 context.Context, arg1 cid.Cid
return ret0, ret1
}
-// ChainGetParentReceipts indicates an expected call of ChainGetParentReceipts
+// ChainGetParentReceipts indicates an expected call of ChainGetParentReceipts.
func (mr *MockFullNodeMockRecorder) ChainGetParentReceipts(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetParentReceipts", reflect.TypeOf((*MockFullNode)(nil).ChainGetParentReceipts), arg0, arg1)
}
-// ChainGetPath mocks base method
+// ChainGetPath mocks base method.
func (m *MockFullNode) ChainGetPath(arg0 context.Context, arg1, arg2 types.TipSetKey) ([]*api.HeadChange, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetPath", arg0, arg1, arg2)
@@ -247,13 +248,13 @@ func (m *MockFullNode) ChainGetPath(arg0 context.Context, arg1, arg2 types.TipSe
return ret0, ret1
}
-// ChainGetPath indicates an expected call of ChainGetPath
+// ChainGetPath indicates an expected call of ChainGetPath.
func (mr *MockFullNodeMockRecorder) ChainGetPath(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetPath", reflect.TypeOf((*MockFullNode)(nil).ChainGetPath), arg0, arg1, arg2)
}
-// ChainGetRandomnessFromBeacon mocks base method
+// ChainGetRandomnessFromBeacon mocks base method.
func (m *MockFullNode) ChainGetRandomnessFromBeacon(arg0 context.Context, arg1 types.TipSetKey, arg2 crypto.DomainSeparationTag, arg3 abi.ChainEpoch, arg4 []byte) (abi.Randomness, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetRandomnessFromBeacon", arg0, arg1, arg2, arg3, arg4)
@@ -262,13 +263,13 @@ func (m *MockFullNode) ChainGetRandomnessFromBeacon(arg0 context.Context, arg1 t
return ret0, ret1
}
-// ChainGetRandomnessFromBeacon indicates an expected call of ChainGetRandomnessFromBeacon
+// ChainGetRandomnessFromBeacon indicates an expected call of ChainGetRandomnessFromBeacon.
func (mr *MockFullNodeMockRecorder) ChainGetRandomnessFromBeacon(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetRandomnessFromBeacon", reflect.TypeOf((*MockFullNode)(nil).ChainGetRandomnessFromBeacon), arg0, arg1, arg2, arg3, arg4)
}
-// ChainGetRandomnessFromTickets mocks base method
+// ChainGetRandomnessFromTickets mocks base method.
func (m *MockFullNode) ChainGetRandomnessFromTickets(arg0 context.Context, arg1 types.TipSetKey, arg2 crypto.DomainSeparationTag, arg3 abi.ChainEpoch, arg4 []byte) (abi.Randomness, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetRandomnessFromTickets", arg0, arg1, arg2, arg3, arg4)
@@ -277,13 +278,13 @@ func (m *MockFullNode) ChainGetRandomnessFromTickets(arg0 context.Context, arg1
return ret0, ret1
}
-// ChainGetRandomnessFromTickets indicates an expected call of ChainGetRandomnessFromTickets
+// ChainGetRandomnessFromTickets indicates an expected call of ChainGetRandomnessFromTickets.
func (mr *MockFullNodeMockRecorder) ChainGetRandomnessFromTickets(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetRandomnessFromTickets", reflect.TypeOf((*MockFullNode)(nil).ChainGetRandomnessFromTickets), arg0, arg1, arg2, arg3, arg4)
}
-// ChainGetTipSet mocks base method
+// ChainGetTipSet mocks base method.
func (m *MockFullNode) ChainGetTipSet(arg0 context.Context, arg1 types.TipSetKey) (*types.TipSet, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetTipSet", arg0, arg1)
@@ -292,13 +293,13 @@ func (m *MockFullNode) ChainGetTipSet(arg0 context.Context, arg1 types.TipSetKey
return ret0, ret1
}
-// ChainGetTipSet indicates an expected call of ChainGetTipSet
+// ChainGetTipSet indicates an expected call of ChainGetTipSet.
func (mr *MockFullNodeMockRecorder) ChainGetTipSet(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetTipSet", reflect.TypeOf((*MockFullNode)(nil).ChainGetTipSet), arg0, arg1)
}
-// ChainGetTipSetByHeight mocks base method
+// ChainGetTipSetByHeight mocks base method.
func (m *MockFullNode) ChainGetTipSetByHeight(arg0 context.Context, arg1 abi.ChainEpoch, arg2 types.TipSetKey) (*types.TipSet, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainGetTipSetByHeight", arg0, arg1, arg2)
@@ -307,13 +308,13 @@ func (m *MockFullNode) ChainGetTipSetByHeight(arg0 context.Context, arg1 abi.Cha
return ret0, ret1
}
-// ChainGetTipSetByHeight indicates an expected call of ChainGetTipSetByHeight
+// ChainGetTipSetByHeight indicates an expected call of ChainGetTipSetByHeight.
func (mr *MockFullNodeMockRecorder) ChainGetTipSetByHeight(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetTipSetByHeight", reflect.TypeOf((*MockFullNode)(nil).ChainGetTipSetByHeight), arg0, arg1, arg2)
}
-// ChainHasObj mocks base method
+// ChainHasObj mocks base method.
func (m *MockFullNode) ChainHasObj(arg0 context.Context, arg1 cid.Cid) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainHasObj", arg0, arg1)
@@ -322,13 +323,13 @@ func (m *MockFullNode) ChainHasObj(arg0 context.Context, arg1 cid.Cid) (bool, er
return ret0, ret1
}
-// ChainHasObj indicates an expected call of ChainHasObj
+// ChainHasObj indicates an expected call of ChainHasObj.
func (mr *MockFullNodeMockRecorder) ChainHasObj(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHasObj", reflect.TypeOf((*MockFullNode)(nil).ChainHasObj), arg0, arg1)
}
-// ChainHead mocks base method
+// ChainHead mocks base method.
func (m *MockFullNode) ChainHead(arg0 context.Context) (*types.TipSet, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainHead", arg0)
@@ -337,13 +338,13 @@ func (m *MockFullNode) ChainHead(arg0 context.Context) (*types.TipSet, error) {
return ret0, ret1
}
-// ChainHead indicates an expected call of ChainHead
+// ChainHead indicates an expected call of ChainHead.
func (mr *MockFullNodeMockRecorder) ChainHead(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockFullNode)(nil).ChainHead), arg0)
}
-// ChainNotify mocks base method
+// ChainNotify mocks base method.
func (m *MockFullNode) ChainNotify(arg0 context.Context) (<-chan []*api.HeadChange, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainNotify", arg0)
@@ -352,13 +353,13 @@ func (m *MockFullNode) ChainNotify(arg0 context.Context) (<-chan []*api.HeadChan
return ret0, ret1
}
-// ChainNotify indicates an expected call of ChainNotify
+// ChainNotify indicates an expected call of ChainNotify.
func (mr *MockFullNodeMockRecorder) ChainNotify(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainNotify", reflect.TypeOf((*MockFullNode)(nil).ChainNotify), arg0)
}
-// ChainReadObj mocks base method
+// ChainReadObj mocks base method.
func (m *MockFullNode) ChainReadObj(arg0 context.Context, arg1 cid.Cid) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainReadObj", arg0, arg1)
@@ -367,13 +368,13 @@ func (m *MockFullNode) ChainReadObj(arg0 context.Context, arg1 cid.Cid) ([]byte,
return ret0, ret1
}
-// ChainReadObj indicates an expected call of ChainReadObj
+// ChainReadObj indicates an expected call of ChainReadObj.
func (mr *MockFullNodeMockRecorder) ChainReadObj(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainReadObj", reflect.TypeOf((*MockFullNode)(nil).ChainReadObj), arg0, arg1)
}
-// ChainSetHead mocks base method
+// ChainSetHead mocks base method.
func (m *MockFullNode) ChainSetHead(arg0 context.Context, arg1 types.TipSetKey) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainSetHead", arg0, arg1)
@@ -381,13 +382,13 @@ func (m *MockFullNode) ChainSetHead(arg0 context.Context, arg1 types.TipSetKey)
return ret0
}
-// ChainSetHead indicates an expected call of ChainSetHead
+// ChainSetHead indicates an expected call of ChainSetHead.
func (mr *MockFullNodeMockRecorder) ChainSetHead(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainSetHead", reflect.TypeOf((*MockFullNode)(nil).ChainSetHead), arg0, arg1)
}
-// ChainStatObj mocks base method
+// ChainStatObj mocks base method.
func (m *MockFullNode) ChainStatObj(arg0 context.Context, arg1, arg2 cid.Cid) (api.ObjStat, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainStatObj", arg0, arg1, arg2)
@@ -396,13 +397,13 @@ func (m *MockFullNode) ChainStatObj(arg0 context.Context, arg1, arg2 cid.Cid) (a
return ret0, ret1
}
-// ChainStatObj indicates an expected call of ChainStatObj
+// ChainStatObj indicates an expected call of ChainStatObj.
func (mr *MockFullNodeMockRecorder) ChainStatObj(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainStatObj", reflect.TypeOf((*MockFullNode)(nil).ChainStatObj), arg0, arg1, arg2)
}
-// ChainTipSetWeight mocks base method
+// ChainTipSetWeight mocks base method.
func (m *MockFullNode) ChainTipSetWeight(arg0 context.Context, arg1 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainTipSetWeight", arg0, arg1)
@@ -411,13 +412,13 @@ func (m *MockFullNode) ChainTipSetWeight(arg0 context.Context, arg1 types.TipSet
return ret0, ret1
}
-// ChainTipSetWeight indicates an expected call of ChainTipSetWeight
+// ChainTipSetWeight indicates an expected call of ChainTipSetWeight.
func (mr *MockFullNodeMockRecorder) ChainTipSetWeight(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainTipSetWeight", reflect.TypeOf((*MockFullNode)(nil).ChainTipSetWeight), arg0, arg1)
}
-// ClientCalcCommP mocks base method
+// ClientCalcCommP mocks base method.
func (m *MockFullNode) ClientCalcCommP(arg0 context.Context, arg1 string) (*api.CommPRet, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientCalcCommP", arg0, arg1)
@@ -426,13 +427,13 @@ func (m *MockFullNode) ClientCalcCommP(arg0 context.Context, arg1 string) (*api.
return ret0, ret1
}
-// ClientCalcCommP indicates an expected call of ClientCalcCommP
+// ClientCalcCommP indicates an expected call of ClientCalcCommP.
func (mr *MockFullNodeMockRecorder) ClientCalcCommP(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCalcCommP", reflect.TypeOf((*MockFullNode)(nil).ClientCalcCommP), arg0, arg1)
}
-// ClientCancelDataTransfer mocks base method
+// ClientCancelDataTransfer mocks base method.
func (m *MockFullNode) ClientCancelDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientCancelDataTransfer", arg0, arg1, arg2, arg3)
@@ -440,13 +441,13 @@ func (m *MockFullNode) ClientCancelDataTransfer(arg0 context.Context, arg1 datat
return ret0
}
-// ClientCancelDataTransfer indicates an expected call of ClientCancelDataTransfer
+// ClientCancelDataTransfer indicates an expected call of ClientCancelDataTransfer.
func (mr *MockFullNodeMockRecorder) ClientCancelDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientCancelDataTransfer), arg0, arg1, arg2, arg3)
}
-// ClientCancelRetrievalDeal mocks base method
+// ClientCancelRetrievalDeal mocks base method.
func (m *MockFullNode) ClientCancelRetrievalDeal(arg0 context.Context, arg1 retrievalmarket.DealID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientCancelRetrievalDeal", arg0, arg1)
@@ -454,13 +455,13 @@ func (m *MockFullNode) ClientCancelRetrievalDeal(arg0 context.Context, arg1 retr
return ret0
}
-// ClientCancelRetrievalDeal indicates an expected call of ClientCancelRetrievalDeal
+// ClientCancelRetrievalDeal indicates an expected call of ClientCancelRetrievalDeal.
func (mr *MockFullNodeMockRecorder) ClientCancelRetrievalDeal(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelRetrievalDeal", reflect.TypeOf((*MockFullNode)(nil).ClientCancelRetrievalDeal), arg0, arg1)
}
-// ClientDataTransferUpdates mocks base method
+// ClientDataTransferUpdates mocks base method.
func (m *MockFullNode) ClientDataTransferUpdates(arg0 context.Context) (<-chan api.DataTransferChannel, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientDataTransferUpdates", arg0)
@@ -469,13 +470,13 @@ func (m *MockFullNode) ClientDataTransferUpdates(arg0 context.Context) (<-chan a
return ret0, ret1
}
-// ClientDataTransferUpdates indicates an expected call of ClientDataTransferUpdates
+// ClientDataTransferUpdates indicates an expected call of ClientDataTransferUpdates.
func (mr *MockFullNodeMockRecorder) ClientDataTransferUpdates(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDataTransferUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientDataTransferUpdates), arg0)
}
-// ClientDealPieceCID mocks base method
+// ClientDealPieceCID mocks base method.
func (m *MockFullNode) ClientDealPieceCID(arg0 context.Context, arg1 cid.Cid) (api.DataCIDSize, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientDealPieceCID", arg0, arg1)
@@ -484,13 +485,13 @@ func (m *MockFullNode) ClientDealPieceCID(arg0 context.Context, arg1 cid.Cid) (a
return ret0, ret1
}
-// ClientDealPieceCID indicates an expected call of ClientDealPieceCID
+// ClientDealPieceCID indicates an expected call of ClientDealPieceCID.
func (mr *MockFullNodeMockRecorder) ClientDealPieceCID(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealPieceCID", reflect.TypeOf((*MockFullNode)(nil).ClientDealPieceCID), arg0, arg1)
}
-// ClientDealSize mocks base method
+// ClientDealSize mocks base method.
func (m *MockFullNode) ClientDealSize(arg0 context.Context, arg1 cid.Cid) (api.DataSize, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientDealSize", arg0, arg1)
@@ -499,13 +500,13 @@ func (m *MockFullNode) ClientDealSize(arg0 context.Context, arg1 cid.Cid) (api.D
return ret0, ret1
}
-// ClientDealSize indicates an expected call of ClientDealSize
+// ClientDealSize indicates an expected call of ClientDealSize.
func (mr *MockFullNodeMockRecorder) ClientDealSize(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealSize", reflect.TypeOf((*MockFullNode)(nil).ClientDealSize), arg0, arg1)
}
-// ClientFindData mocks base method
+// ClientFindData mocks base method.
func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *cid.Cid) ([]api.QueryOffer, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientFindData", arg0, arg1, arg2)
@@ -514,13 +515,13 @@ func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *
return ret0, ret1
}
-// ClientFindData indicates an expected call of ClientFindData
+// ClientFindData indicates an expected call of ClientFindData.
func (mr *MockFullNodeMockRecorder) ClientFindData(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientFindData", reflect.TypeOf((*MockFullNode)(nil).ClientFindData), arg0, arg1, arg2)
}
-// ClientGenCar mocks base method
+// ClientGenCar mocks base method.
func (m *MockFullNode) ClientGenCar(arg0 context.Context, arg1 api.FileRef, arg2 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientGenCar", arg0, arg1, arg2)
@@ -528,13 +529,13 @@ func (m *MockFullNode) ClientGenCar(arg0 context.Context, arg1 api.FileRef, arg2
return ret0
}
-// ClientGenCar indicates an expected call of ClientGenCar
+// ClientGenCar indicates an expected call of ClientGenCar.
func (mr *MockFullNodeMockRecorder) ClientGenCar(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGenCar", reflect.TypeOf((*MockFullNode)(nil).ClientGenCar), arg0, arg1, arg2)
}
-// ClientGetDealInfo mocks base method
+// ClientGetDealInfo mocks base method.
func (m *MockFullNode) ClientGetDealInfo(arg0 context.Context, arg1 cid.Cid) (*api.DealInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientGetDealInfo", arg0, arg1)
@@ -543,13 +544,13 @@ func (m *MockFullNode) ClientGetDealInfo(arg0 context.Context, arg1 cid.Cid) (*a
return ret0, ret1
}
-// ClientGetDealInfo indicates an expected call of ClientGetDealInfo
+// ClientGetDealInfo indicates an expected call of ClientGetDealInfo.
func (mr *MockFullNodeMockRecorder) ClientGetDealInfo(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealInfo", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealInfo), arg0, arg1)
}
-// ClientGetDealStatus mocks base method
+// ClientGetDealStatus mocks base method.
func (m *MockFullNode) ClientGetDealStatus(arg0 context.Context, arg1 uint64) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientGetDealStatus", arg0, arg1)
@@ -558,13 +559,13 @@ func (m *MockFullNode) ClientGetDealStatus(arg0 context.Context, arg1 uint64) (s
return ret0, ret1
}
-// ClientGetDealStatus indicates an expected call of ClientGetDealStatus
+// ClientGetDealStatus indicates an expected call of ClientGetDealStatus.
func (mr *MockFullNodeMockRecorder) ClientGetDealStatus(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealStatus", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealStatus), arg0, arg1)
}
-// ClientGetDealUpdates mocks base method
+// ClientGetDealUpdates mocks base method.
func (m *MockFullNode) ClientGetDealUpdates(arg0 context.Context) (<-chan api.DealInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientGetDealUpdates", arg0)
@@ -573,13 +574,28 @@ func (m *MockFullNode) ClientGetDealUpdates(arg0 context.Context) (<-chan api.De
return ret0, ret1
}
-// ClientGetDealUpdates indicates an expected call of ClientGetDealUpdates
+// ClientGetDealUpdates indicates an expected call of ClientGetDealUpdates.
func (mr *MockFullNodeMockRecorder) ClientGetDealUpdates(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealUpdates), arg0)
}
-// ClientHasLocal mocks base method
+// ClientGetRetrievalUpdates mocks base method.
+func (m *MockFullNode) ClientGetRetrievalUpdates(arg0 context.Context) (<-chan api.RetrievalInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientGetRetrievalUpdates", arg0)
+ ret0, _ := ret[0].(<-chan api.RetrievalInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientGetRetrievalUpdates indicates an expected call of ClientGetRetrievalUpdates.
+func (mr *MockFullNodeMockRecorder) ClientGetRetrievalUpdates(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetRetrievalUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetRetrievalUpdates), arg0)
+}
+
+// ClientHasLocal mocks base method.
func (m *MockFullNode) ClientHasLocal(arg0 context.Context, arg1 cid.Cid) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientHasLocal", arg0, arg1)
@@ -588,13 +604,13 @@ func (m *MockFullNode) ClientHasLocal(arg0 context.Context, arg1 cid.Cid) (bool,
return ret0, ret1
}
-// ClientHasLocal indicates an expected call of ClientHasLocal
+// ClientHasLocal indicates an expected call of ClientHasLocal.
func (mr *MockFullNodeMockRecorder) ClientHasLocal(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientHasLocal", reflect.TypeOf((*MockFullNode)(nil).ClientHasLocal), arg0, arg1)
}
-// ClientImport mocks base method
+// ClientImport mocks base method.
func (m *MockFullNode) ClientImport(arg0 context.Context, arg1 api.FileRef) (*api.ImportRes, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientImport", arg0, arg1)
@@ -603,13 +619,13 @@ func (m *MockFullNode) ClientImport(arg0 context.Context, arg1 api.FileRef) (*ap
return ret0, ret1
}
-// ClientImport indicates an expected call of ClientImport
+// ClientImport indicates an expected call of ClientImport.
func (mr *MockFullNodeMockRecorder) ClientImport(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientImport", reflect.TypeOf((*MockFullNode)(nil).ClientImport), arg0, arg1)
}
-// ClientListDataTransfers mocks base method
+// ClientListDataTransfers mocks base method.
func (m *MockFullNode) ClientListDataTransfers(arg0 context.Context) ([]api.DataTransferChannel, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientListDataTransfers", arg0)
@@ -618,13 +634,13 @@ func (m *MockFullNode) ClientListDataTransfers(arg0 context.Context) ([]api.Data
return ret0, ret1
}
-// ClientListDataTransfers indicates an expected call of ClientListDataTransfers
+// ClientListDataTransfers indicates an expected call of ClientListDataTransfers.
func (mr *MockFullNodeMockRecorder) ClientListDataTransfers(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDataTransfers", reflect.TypeOf((*MockFullNode)(nil).ClientListDataTransfers), arg0)
}
-// ClientListDeals mocks base method
+// ClientListDeals mocks base method.
func (m *MockFullNode) ClientListDeals(arg0 context.Context) ([]api.DealInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientListDeals", arg0)
@@ -633,13 +649,13 @@ func (m *MockFullNode) ClientListDeals(arg0 context.Context) ([]api.DealInfo, er
return ret0, ret1
}
-// ClientListDeals indicates an expected call of ClientListDeals
+// ClientListDeals indicates an expected call of ClientListDeals.
func (mr *MockFullNodeMockRecorder) ClientListDeals(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDeals", reflect.TypeOf((*MockFullNode)(nil).ClientListDeals), arg0)
}
-// ClientListImports mocks base method
+// ClientListImports mocks base method.
func (m *MockFullNode) ClientListImports(arg0 context.Context) ([]api.Import, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientListImports", arg0)
@@ -648,13 +664,28 @@ func (m *MockFullNode) ClientListImports(arg0 context.Context) ([]api.Import, er
return ret0, ret1
}
-// ClientListImports indicates an expected call of ClientListImports
+// ClientListImports indicates an expected call of ClientListImports.
func (mr *MockFullNodeMockRecorder) ClientListImports(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListImports", reflect.TypeOf((*MockFullNode)(nil).ClientListImports), arg0)
}
-// ClientMinerQueryOffer mocks base method
+// ClientListRetrievals mocks base method.
+func (m *MockFullNode) ClientListRetrievals(arg0 context.Context) ([]api.RetrievalInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientListRetrievals", arg0)
+ ret0, _ := ret[0].([]api.RetrievalInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientListRetrievals indicates an expected call of ClientListRetrievals.
+func (mr *MockFullNodeMockRecorder) ClientListRetrievals(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListRetrievals", reflect.TypeOf((*MockFullNode)(nil).ClientListRetrievals), arg0)
+}
+
+// ClientMinerQueryOffer mocks base method.
func (m *MockFullNode) ClientMinerQueryOffer(arg0 context.Context, arg1 address.Address, arg2 cid.Cid, arg3 *cid.Cid) (api.QueryOffer, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientMinerQueryOffer", arg0, arg1, arg2, arg3)
@@ -663,13 +694,13 @@ func (m *MockFullNode) ClientMinerQueryOffer(arg0 context.Context, arg1 address.
return ret0, ret1
}
-// ClientMinerQueryOffer indicates an expected call of ClientMinerQueryOffer
+// ClientMinerQueryOffer indicates an expected call of ClientMinerQueryOffer.
func (mr *MockFullNodeMockRecorder) ClientMinerQueryOffer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientMinerQueryOffer", reflect.TypeOf((*MockFullNode)(nil).ClientMinerQueryOffer), arg0, arg1, arg2, arg3)
}
-// ClientQueryAsk mocks base method
+// ClientQueryAsk mocks base method.
func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*storagemarket.StorageAsk, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientQueryAsk", arg0, arg1, arg2)
@@ -678,13 +709,13 @@ func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 a
return ret0, ret1
}
-// ClientQueryAsk indicates an expected call of ClientQueryAsk
+// ClientQueryAsk indicates an expected call of ClientQueryAsk.
func (mr *MockFullNodeMockRecorder) ClientQueryAsk(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientQueryAsk", reflect.TypeOf((*MockFullNode)(nil).ClientQueryAsk), arg0, arg1, arg2)
}
-// ClientRemoveImport mocks base method
+// ClientRemoveImport mocks base method.
func (m *MockFullNode) ClientRemoveImport(arg0 context.Context, arg1 multistore.StoreID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientRemoveImport", arg0, arg1)
@@ -692,13 +723,13 @@ func (m *MockFullNode) ClientRemoveImport(arg0 context.Context, arg1 multistore.
return ret0
}
-// ClientRemoveImport indicates an expected call of ClientRemoveImport
+// ClientRemoveImport indicates an expected call of ClientRemoveImport.
func (mr *MockFullNodeMockRecorder) ClientRemoveImport(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRemoveImport", reflect.TypeOf((*MockFullNode)(nil).ClientRemoveImport), arg0, arg1)
}
-// ClientRestartDataTransfer mocks base method
+// ClientRestartDataTransfer mocks base method.
func (m *MockFullNode) ClientRestartDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientRestartDataTransfer", arg0, arg1, arg2, arg3)
@@ -706,13 +737,13 @@ func (m *MockFullNode) ClientRestartDataTransfer(arg0 context.Context, arg1 data
return ret0
}
-// ClientRestartDataTransfer indicates an expected call of ClientRestartDataTransfer
+// ClientRestartDataTransfer indicates an expected call of ClientRestartDataTransfer.
func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRestartDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientRestartDataTransfer), arg0, arg1, arg2, arg3)
}
-// ClientRetrieve mocks base method
+// ClientRetrieve mocks base method.
func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1, arg2)
@@ -720,13 +751,13 @@ func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOr
return ret0
}
-// ClientRetrieve indicates an expected call of ClientRetrieve
+// ClientRetrieve indicates an expected call of ClientRetrieve.
func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1, arg2)
}
-// ClientRetrieveTryRestartInsufficientFunds mocks base method
+// ClientRetrieveTryRestartInsufficientFunds mocks base method.
func (m *MockFullNode) ClientRetrieveTryRestartInsufficientFunds(arg0 context.Context, arg1 address.Address) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientRetrieveTryRestartInsufficientFunds", arg0, arg1)
@@ -734,13 +765,13 @@ func (m *MockFullNode) ClientRetrieveTryRestartInsufficientFunds(arg0 context.Co
return ret0
}
-// ClientRetrieveTryRestartInsufficientFunds indicates an expected call of ClientRetrieveTryRestartInsufficientFunds
+// ClientRetrieveTryRestartInsufficientFunds indicates an expected call of ClientRetrieveTryRestartInsufficientFunds.
func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveTryRestartInsufficientFunds", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveTryRestartInsufficientFunds), arg0, arg1)
}
-// ClientRetrieveWithEvents mocks base method
+// ClientRetrieveWithEvents mocks base method.
func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientRetrieveWithEvents", arg0, arg1, arg2)
@@ -749,13 +780,13 @@ func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 api.R
return ret0, ret1
}
-// ClientRetrieveWithEvents indicates an expected call of ClientRetrieveWithEvents
+// ClientRetrieveWithEvents indicates an expected call of ClientRetrieveWithEvents.
func (mr *MockFullNodeMockRecorder) ClientRetrieveWithEvents(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWithEvents", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWithEvents), arg0, arg1, arg2)
}
-// ClientStartDeal mocks base method
+// ClientStartDeal mocks base method.
func (m *MockFullNode) ClientStartDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientStartDeal", arg0, arg1)
@@ -764,13 +795,28 @@ func (m *MockFullNode) ClientStartDeal(arg0 context.Context, arg1 *api.StartDeal
return ret0, ret1
}
-// ClientStartDeal indicates an expected call of ClientStartDeal
+// ClientStartDeal indicates an expected call of ClientStartDeal.
func (mr *MockFullNodeMockRecorder) ClientStartDeal(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStartDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStartDeal), arg0, arg1)
}
-// Closing mocks base method
+// ClientStatelessDeal mocks base method.
+func (m *MockFullNode) ClientStatelessDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientStatelessDeal", arg0, arg1)
+ ret0, _ := ret[0].(*cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientStatelessDeal indicates an expected call of ClientStatelessDeal.
+func (mr *MockFullNodeMockRecorder) ClientStatelessDeal(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStatelessDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStatelessDeal), arg0, arg1)
+}
+
+// Closing mocks base method.
func (m *MockFullNode) Closing(arg0 context.Context) (<-chan struct{}, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Closing", arg0)
@@ -779,13 +825,13 @@ func (m *MockFullNode) Closing(arg0 context.Context) (<-chan struct{}, error) {
return ret0, ret1
}
-// Closing indicates an expected call of Closing
+// Closing indicates an expected call of Closing.
func (mr *MockFullNodeMockRecorder) Closing(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Closing", reflect.TypeOf((*MockFullNode)(nil).Closing), arg0)
}
-// CreateBackup mocks base method
+// CreateBackup mocks base method.
func (m *MockFullNode) CreateBackup(arg0 context.Context, arg1 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateBackup", arg0, arg1)
@@ -793,13 +839,13 @@ func (m *MockFullNode) CreateBackup(arg0 context.Context, arg1 string) error {
return ret0
}
-// CreateBackup indicates an expected call of CreateBackup
+// CreateBackup indicates an expected call of CreateBackup.
func (mr *MockFullNodeMockRecorder) CreateBackup(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBackup", reflect.TypeOf((*MockFullNode)(nil).CreateBackup), arg0, arg1)
}
-// Discover mocks base method
+// Discover mocks base method.
func (m *MockFullNode) Discover(arg0 context.Context) (apitypes.OpenRPCDocument, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Discover", arg0)
@@ -808,13 +854,13 @@ func (m *MockFullNode) Discover(arg0 context.Context) (apitypes.OpenRPCDocument,
return ret0, ret1
}
-// Discover indicates an expected call of Discover
+// Discover indicates an expected call of Discover.
func (mr *MockFullNodeMockRecorder) Discover(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Discover", reflect.TypeOf((*MockFullNode)(nil).Discover), arg0)
}
-// GasEstimateFeeCap mocks base method
+// GasEstimateFeeCap mocks base method.
func (m *MockFullNode) GasEstimateFeeCap(arg0 context.Context, arg1 *types.Message, arg2 int64, arg3 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GasEstimateFeeCap", arg0, arg1, arg2, arg3)
@@ -823,13 +869,13 @@ func (m *MockFullNode) GasEstimateFeeCap(arg0 context.Context, arg1 *types.Messa
return ret0, ret1
}
-// GasEstimateFeeCap indicates an expected call of GasEstimateFeeCap
+// GasEstimateFeeCap indicates an expected call of GasEstimateFeeCap.
func (mr *MockFullNodeMockRecorder) GasEstimateFeeCap(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateFeeCap", reflect.TypeOf((*MockFullNode)(nil).GasEstimateFeeCap), arg0, arg1, arg2, arg3)
}
-// GasEstimateGasLimit mocks base method
+// GasEstimateGasLimit mocks base method.
func (m *MockFullNode) GasEstimateGasLimit(arg0 context.Context, arg1 *types.Message, arg2 types.TipSetKey) (int64, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GasEstimateGasLimit", arg0, arg1, arg2)
@@ -838,13 +884,13 @@ func (m *MockFullNode) GasEstimateGasLimit(arg0 context.Context, arg1 *types.Mes
return ret0, ret1
}
-// GasEstimateGasLimit indicates an expected call of GasEstimateGasLimit
+// GasEstimateGasLimit indicates an expected call of GasEstimateGasLimit.
func (mr *MockFullNodeMockRecorder) GasEstimateGasLimit(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateGasLimit", reflect.TypeOf((*MockFullNode)(nil).GasEstimateGasLimit), arg0, arg1, arg2)
}
-// GasEstimateGasPremium mocks base method
+// GasEstimateGasPremium mocks base method.
func (m *MockFullNode) GasEstimateGasPremium(arg0 context.Context, arg1 uint64, arg2 address.Address, arg3 int64, arg4 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GasEstimateGasPremium", arg0, arg1, arg2, arg3, arg4)
@@ -853,13 +899,13 @@ func (m *MockFullNode) GasEstimateGasPremium(arg0 context.Context, arg1 uint64,
return ret0, ret1
}
-// GasEstimateGasPremium indicates an expected call of GasEstimateGasPremium
+// GasEstimateGasPremium indicates an expected call of GasEstimateGasPremium.
func (mr *MockFullNodeMockRecorder) GasEstimateGasPremium(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateGasPremium", reflect.TypeOf((*MockFullNode)(nil).GasEstimateGasPremium), arg0, arg1, arg2, arg3, arg4)
}
-// GasEstimateMessageGas mocks base method
+// GasEstimateMessageGas mocks base method.
func (m *MockFullNode) GasEstimateMessageGas(arg0 context.Context, arg1 *types.Message, arg2 *api.MessageSendSpec, arg3 types.TipSetKey) (*types.Message, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GasEstimateMessageGas", arg0, arg1, arg2, arg3)
@@ -868,13 +914,13 @@ func (m *MockFullNode) GasEstimateMessageGas(arg0 context.Context, arg1 *types.M
return ret0, ret1
}
-// GasEstimateMessageGas indicates an expected call of GasEstimateMessageGas
+// GasEstimateMessageGas indicates an expected call of GasEstimateMessageGas.
func (mr *MockFullNodeMockRecorder) GasEstimateMessageGas(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateMessageGas", reflect.TypeOf((*MockFullNode)(nil).GasEstimateMessageGas), arg0, arg1, arg2, arg3)
}
-// ID mocks base method
+// ID mocks base method.
func (m *MockFullNode) ID(arg0 context.Context) (peer.ID, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ID", arg0)
@@ -883,13 +929,13 @@ func (m *MockFullNode) ID(arg0 context.Context) (peer.ID, error) {
return ret0, ret1
}
-// ID indicates an expected call of ID
+// ID indicates an expected call of ID.
func (mr *MockFullNodeMockRecorder) ID(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockFullNode)(nil).ID), arg0)
}
-// LogList mocks base method
+// LogList mocks base method.
func (m *MockFullNode) LogList(arg0 context.Context) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LogList", arg0)
@@ -898,13 +944,13 @@ func (m *MockFullNode) LogList(arg0 context.Context) ([]string, error) {
return ret0, ret1
}
-// LogList indicates an expected call of LogList
+// LogList indicates an expected call of LogList.
func (mr *MockFullNodeMockRecorder) LogList(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogList", reflect.TypeOf((*MockFullNode)(nil).LogList), arg0)
}
-// LogSetLevel mocks base method
+// LogSetLevel mocks base method.
func (m *MockFullNode) LogSetLevel(arg0 context.Context, arg1, arg2 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LogSetLevel", arg0, arg1, arg2)
@@ -912,13 +958,13 @@ func (m *MockFullNode) LogSetLevel(arg0 context.Context, arg1, arg2 string) erro
return ret0
}
-// LogSetLevel indicates an expected call of LogSetLevel
+// LogSetLevel indicates an expected call of LogSetLevel.
func (mr *MockFullNodeMockRecorder) LogSetLevel(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogSetLevel", reflect.TypeOf((*MockFullNode)(nil).LogSetLevel), arg0, arg1, arg2)
}
-// MarketAddBalance mocks base method
+// MarketAddBalance mocks base method.
func (m *MockFullNode) MarketAddBalance(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MarketAddBalance", arg0, arg1, arg2, arg3)
@@ -927,13 +973,13 @@ func (m *MockFullNode) MarketAddBalance(arg0 context.Context, arg1, arg2 address
return ret0, ret1
}
-// MarketAddBalance indicates an expected call of MarketAddBalance
+// MarketAddBalance indicates an expected call of MarketAddBalance.
func (mr *MockFullNodeMockRecorder) MarketAddBalance(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketAddBalance", reflect.TypeOf((*MockFullNode)(nil).MarketAddBalance), arg0, arg1, arg2, arg3)
}
-// MarketGetReserved mocks base method
+// MarketGetReserved mocks base method.
func (m *MockFullNode) MarketGetReserved(arg0 context.Context, arg1 address.Address) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MarketGetReserved", arg0, arg1)
@@ -942,13 +988,13 @@ func (m *MockFullNode) MarketGetReserved(arg0 context.Context, arg1 address.Addr
return ret0, ret1
}
-// MarketGetReserved indicates an expected call of MarketGetReserved
+// MarketGetReserved indicates an expected call of MarketGetReserved.
func (mr *MockFullNodeMockRecorder) MarketGetReserved(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketGetReserved", reflect.TypeOf((*MockFullNode)(nil).MarketGetReserved), arg0, arg1)
}
-// MarketReleaseFunds mocks base method
+// MarketReleaseFunds mocks base method.
func (m *MockFullNode) MarketReleaseFunds(arg0 context.Context, arg1 address.Address, arg2 big.Int) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MarketReleaseFunds", arg0, arg1, arg2)
@@ -956,13 +1002,13 @@ func (m *MockFullNode) MarketReleaseFunds(arg0 context.Context, arg1 address.Add
return ret0
}
-// MarketReleaseFunds indicates an expected call of MarketReleaseFunds
+// MarketReleaseFunds indicates an expected call of MarketReleaseFunds.
func (mr *MockFullNodeMockRecorder) MarketReleaseFunds(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketReleaseFunds", reflect.TypeOf((*MockFullNode)(nil).MarketReleaseFunds), arg0, arg1, arg2)
}
-// MarketReserveFunds mocks base method
+// MarketReserveFunds mocks base method.
func (m *MockFullNode) MarketReserveFunds(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MarketReserveFunds", arg0, arg1, arg2, arg3)
@@ -971,13 +1017,13 @@ func (m *MockFullNode) MarketReserveFunds(arg0 context.Context, arg1, arg2 addre
return ret0, ret1
}
-// MarketReserveFunds indicates an expected call of MarketReserveFunds
+// MarketReserveFunds indicates an expected call of MarketReserveFunds.
func (mr *MockFullNodeMockRecorder) MarketReserveFunds(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketReserveFunds", reflect.TypeOf((*MockFullNode)(nil).MarketReserveFunds), arg0, arg1, arg2, arg3)
}
-// MarketWithdraw mocks base method
+// MarketWithdraw mocks base method.
func (m *MockFullNode) MarketWithdraw(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MarketWithdraw", arg0, arg1, arg2, arg3)
@@ -986,13 +1032,13 @@ func (m *MockFullNode) MarketWithdraw(arg0 context.Context, arg1, arg2 address.A
return ret0, ret1
}
-// MarketWithdraw indicates an expected call of MarketWithdraw
+// MarketWithdraw indicates an expected call of MarketWithdraw.
func (mr *MockFullNodeMockRecorder) MarketWithdraw(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketWithdraw", reflect.TypeOf((*MockFullNode)(nil).MarketWithdraw), arg0, arg1, arg2, arg3)
}
-// MinerCreateBlock mocks base method
+// MinerCreateBlock mocks base method.
func (m *MockFullNode) MinerCreateBlock(arg0 context.Context, arg1 *api.BlockTemplate) (*types.BlockMsg, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MinerCreateBlock", arg0, arg1)
@@ -1001,13 +1047,13 @@ func (m *MockFullNode) MinerCreateBlock(arg0 context.Context, arg1 *api.BlockTem
return ret0, ret1
}
-// MinerCreateBlock indicates an expected call of MinerCreateBlock
+// MinerCreateBlock indicates an expected call of MinerCreateBlock.
func (mr *MockFullNodeMockRecorder) MinerCreateBlock(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MinerCreateBlock", reflect.TypeOf((*MockFullNode)(nil).MinerCreateBlock), arg0, arg1)
}
-// MinerGetBaseInfo mocks base method
+// MinerGetBaseInfo mocks base method.
func (m *MockFullNode) MinerGetBaseInfo(arg0 context.Context, arg1 address.Address, arg2 abi.ChainEpoch, arg3 types.TipSetKey) (*api.MiningBaseInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MinerGetBaseInfo", arg0, arg1, arg2, arg3)
@@ -1016,13 +1062,13 @@ func (m *MockFullNode) MinerGetBaseInfo(arg0 context.Context, arg1 address.Addre
return ret0, ret1
}
-// MinerGetBaseInfo indicates an expected call of MinerGetBaseInfo
+// MinerGetBaseInfo indicates an expected call of MinerGetBaseInfo.
func (mr *MockFullNodeMockRecorder) MinerGetBaseInfo(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MinerGetBaseInfo", reflect.TypeOf((*MockFullNode)(nil).MinerGetBaseInfo), arg0, arg1, arg2, arg3)
}
-// MpoolBatchPush mocks base method
+// MpoolBatchPush mocks base method.
func (m *MockFullNode) MpoolBatchPush(arg0 context.Context, arg1 []*types.SignedMessage) ([]cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolBatchPush", arg0, arg1)
@@ -1031,13 +1077,13 @@ func (m *MockFullNode) MpoolBatchPush(arg0 context.Context, arg1 []*types.Signed
return ret0, ret1
}
-// MpoolBatchPush indicates an expected call of MpoolBatchPush
+// MpoolBatchPush indicates an expected call of MpoolBatchPush.
func (mr *MockFullNodeMockRecorder) MpoolBatchPush(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolBatchPush", reflect.TypeOf((*MockFullNode)(nil).MpoolBatchPush), arg0, arg1)
}
-// MpoolBatchPushMessage mocks base method
+// MpoolBatchPushMessage mocks base method.
func (m *MockFullNode) MpoolBatchPushMessage(arg0 context.Context, arg1 []*types.Message, arg2 *api.MessageSendSpec) ([]*types.SignedMessage, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolBatchPushMessage", arg0, arg1, arg2)
@@ -1046,13 +1092,13 @@ func (m *MockFullNode) MpoolBatchPushMessage(arg0 context.Context, arg1 []*types
return ret0, ret1
}
-// MpoolBatchPushMessage indicates an expected call of MpoolBatchPushMessage
+// MpoolBatchPushMessage indicates an expected call of MpoolBatchPushMessage.
func (mr *MockFullNodeMockRecorder) MpoolBatchPushMessage(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolBatchPushMessage", reflect.TypeOf((*MockFullNode)(nil).MpoolBatchPushMessage), arg0, arg1, arg2)
}
-// MpoolBatchPushUntrusted mocks base method
+// MpoolBatchPushUntrusted mocks base method.
func (m *MockFullNode) MpoolBatchPushUntrusted(arg0 context.Context, arg1 []*types.SignedMessage) ([]cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolBatchPushUntrusted", arg0, arg1)
@@ -1061,13 +1107,58 @@ func (m *MockFullNode) MpoolBatchPushUntrusted(arg0 context.Context, arg1 []*typ
return ret0, ret1
}
-// MpoolBatchPushUntrusted indicates an expected call of MpoolBatchPushUntrusted
+// MpoolBatchPushUntrusted indicates an expected call of MpoolBatchPushUntrusted.
func (mr *MockFullNodeMockRecorder) MpoolBatchPushUntrusted(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolBatchPushUntrusted", reflect.TypeOf((*MockFullNode)(nil).MpoolBatchPushUntrusted), arg0, arg1)
}
-// MpoolClear mocks base method
+// MpoolCheckMessages mocks base method.
+func (m *MockFullNode) MpoolCheckMessages(arg0 context.Context, arg1 []*api.MessagePrototype) ([][]api.MessageCheckStatus, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolCheckMessages", arg0, arg1)
+ ret0, _ := ret[0].([][]api.MessageCheckStatus)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolCheckMessages indicates an expected call of MpoolCheckMessages.
+func (mr *MockFullNodeMockRecorder) MpoolCheckMessages(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolCheckMessages", reflect.TypeOf((*MockFullNode)(nil).MpoolCheckMessages), arg0, arg1)
+}
+
+// MpoolCheckPendingMessages mocks base method.
+func (m *MockFullNode) MpoolCheckPendingMessages(arg0 context.Context, arg1 address.Address) ([][]api.MessageCheckStatus, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolCheckPendingMessages", arg0, arg1)
+ ret0, _ := ret[0].([][]api.MessageCheckStatus)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolCheckPendingMessages indicates an expected call of MpoolCheckPendingMessages.
+func (mr *MockFullNodeMockRecorder) MpoolCheckPendingMessages(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolCheckPendingMessages", reflect.TypeOf((*MockFullNode)(nil).MpoolCheckPendingMessages), arg0, arg1)
+}
+
+// MpoolCheckReplaceMessages mocks base method.
+func (m *MockFullNode) MpoolCheckReplaceMessages(arg0 context.Context, arg1 []*types.Message) ([][]api.MessageCheckStatus, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolCheckReplaceMessages", arg0, arg1)
+ ret0, _ := ret[0].([][]api.MessageCheckStatus)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolCheckReplaceMessages indicates an expected call of MpoolCheckReplaceMessages.
+func (mr *MockFullNodeMockRecorder) MpoolCheckReplaceMessages(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolCheckReplaceMessages", reflect.TypeOf((*MockFullNode)(nil).MpoolCheckReplaceMessages), arg0, arg1)
+}
+
+// MpoolClear mocks base method.
func (m *MockFullNode) MpoolClear(arg0 context.Context, arg1 bool) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolClear", arg0, arg1)
@@ -1075,13 +1166,13 @@ func (m *MockFullNode) MpoolClear(arg0 context.Context, arg1 bool) error {
return ret0
}
-// MpoolClear indicates an expected call of MpoolClear
+// MpoolClear indicates an expected call of MpoolClear.
func (mr *MockFullNodeMockRecorder) MpoolClear(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolClear", reflect.TypeOf((*MockFullNode)(nil).MpoolClear), arg0, arg1)
}
-// MpoolGetConfig mocks base method
+// MpoolGetConfig mocks base method.
func (m *MockFullNode) MpoolGetConfig(arg0 context.Context) (*types.MpoolConfig, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolGetConfig", arg0)
@@ -1090,13 +1181,13 @@ func (m *MockFullNode) MpoolGetConfig(arg0 context.Context) (*types.MpoolConfig,
return ret0, ret1
}
-// MpoolGetConfig indicates an expected call of MpoolGetConfig
+// MpoolGetConfig indicates an expected call of MpoolGetConfig.
func (mr *MockFullNodeMockRecorder) MpoolGetConfig(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolGetConfig", reflect.TypeOf((*MockFullNode)(nil).MpoolGetConfig), arg0)
}
-// MpoolGetNonce mocks base method
+// MpoolGetNonce mocks base method.
func (m *MockFullNode) MpoolGetNonce(arg0 context.Context, arg1 address.Address) (uint64, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolGetNonce", arg0, arg1)
@@ -1105,13 +1196,13 @@ func (m *MockFullNode) MpoolGetNonce(arg0 context.Context, arg1 address.Address)
return ret0, ret1
}
-// MpoolGetNonce indicates an expected call of MpoolGetNonce
+// MpoolGetNonce indicates an expected call of MpoolGetNonce.
func (mr *MockFullNodeMockRecorder) MpoolGetNonce(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolGetNonce", reflect.TypeOf((*MockFullNode)(nil).MpoolGetNonce), arg0, arg1)
}
-// MpoolPending mocks base method
+// MpoolPending mocks base method.
func (m *MockFullNode) MpoolPending(arg0 context.Context, arg1 types.TipSetKey) ([]*types.SignedMessage, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolPending", arg0, arg1)
@@ -1120,13 +1211,13 @@ func (m *MockFullNode) MpoolPending(arg0 context.Context, arg1 types.TipSetKey)
return ret0, ret1
}
-// MpoolPending indicates an expected call of MpoolPending
+// MpoolPending indicates an expected call of MpoolPending.
func (mr *MockFullNodeMockRecorder) MpoolPending(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPending", reflect.TypeOf((*MockFullNode)(nil).MpoolPending), arg0, arg1)
}
-// MpoolPush mocks base method
+// MpoolPush mocks base method.
func (m *MockFullNode) MpoolPush(arg0 context.Context, arg1 *types.SignedMessage) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolPush", arg0, arg1)
@@ -1135,13 +1226,13 @@ func (m *MockFullNode) MpoolPush(arg0 context.Context, arg1 *types.SignedMessage
return ret0, ret1
}
-// MpoolPush indicates an expected call of MpoolPush
+// MpoolPush indicates an expected call of MpoolPush.
func (mr *MockFullNodeMockRecorder) MpoolPush(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPush", reflect.TypeOf((*MockFullNode)(nil).MpoolPush), arg0, arg1)
}
-// MpoolPushMessage mocks base method
+// MpoolPushMessage mocks base method.
func (m *MockFullNode) MpoolPushMessage(arg0 context.Context, arg1 *types.Message, arg2 *api.MessageSendSpec) (*types.SignedMessage, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolPushMessage", arg0, arg1, arg2)
@@ -1150,13 +1241,13 @@ func (m *MockFullNode) MpoolPushMessage(arg0 context.Context, arg1 *types.Messag
return ret0, ret1
}
-// MpoolPushMessage indicates an expected call of MpoolPushMessage
+// MpoolPushMessage indicates an expected call of MpoolPushMessage.
func (mr *MockFullNodeMockRecorder) MpoolPushMessage(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPushMessage", reflect.TypeOf((*MockFullNode)(nil).MpoolPushMessage), arg0, arg1, arg2)
}
-// MpoolPushUntrusted mocks base method
+// MpoolPushUntrusted mocks base method.
func (m *MockFullNode) MpoolPushUntrusted(arg0 context.Context, arg1 *types.SignedMessage) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolPushUntrusted", arg0, arg1)
@@ -1165,13 +1256,13 @@ func (m *MockFullNode) MpoolPushUntrusted(arg0 context.Context, arg1 *types.Sign
return ret0, ret1
}
-// MpoolPushUntrusted indicates an expected call of MpoolPushUntrusted
+// MpoolPushUntrusted indicates an expected call of MpoolPushUntrusted.
func (mr *MockFullNodeMockRecorder) MpoolPushUntrusted(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPushUntrusted", reflect.TypeOf((*MockFullNode)(nil).MpoolPushUntrusted), arg0, arg1)
}
-// MpoolSelect mocks base method
+// MpoolSelect mocks base method.
func (m *MockFullNode) MpoolSelect(arg0 context.Context, arg1 types.TipSetKey, arg2 float64) ([]*types.SignedMessage, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolSelect", arg0, arg1, arg2)
@@ -1180,13 +1271,13 @@ func (m *MockFullNode) MpoolSelect(arg0 context.Context, arg1 types.TipSetKey, a
return ret0, ret1
}
-// MpoolSelect indicates an expected call of MpoolSelect
+// MpoolSelect indicates an expected call of MpoolSelect.
func (mr *MockFullNodeMockRecorder) MpoolSelect(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolSelect", reflect.TypeOf((*MockFullNode)(nil).MpoolSelect), arg0, arg1, arg2)
}
-// MpoolSetConfig mocks base method
+// MpoolSetConfig mocks base method.
func (m *MockFullNode) MpoolSetConfig(arg0 context.Context, arg1 *types.MpoolConfig) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolSetConfig", arg0, arg1)
@@ -1194,13 +1285,13 @@ func (m *MockFullNode) MpoolSetConfig(arg0 context.Context, arg1 *types.MpoolCon
return ret0
}
-// MpoolSetConfig indicates an expected call of MpoolSetConfig
+// MpoolSetConfig indicates an expected call of MpoolSetConfig.
func (mr *MockFullNodeMockRecorder) MpoolSetConfig(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolSetConfig", reflect.TypeOf((*MockFullNode)(nil).MpoolSetConfig), arg0, arg1)
}
-// MpoolSub mocks base method
+// MpoolSub mocks base method.
func (m *MockFullNode) MpoolSub(arg0 context.Context) (<-chan api.MpoolUpdate, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MpoolSub", arg0)
@@ -1209,118 +1300,118 @@ func (m *MockFullNode) MpoolSub(arg0 context.Context) (<-chan api.MpoolUpdate, e
return ret0, ret1
}
-// MpoolSub indicates an expected call of MpoolSub
+// MpoolSub indicates an expected call of MpoolSub.
func (mr *MockFullNodeMockRecorder) MpoolSub(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolSub", reflect.TypeOf((*MockFullNode)(nil).MpoolSub), arg0)
}
-// MsigAddApprove mocks base method
-func (m *MockFullNode) MsigAddApprove(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4, arg5 address.Address, arg6 bool) (cid.Cid, error) {
+// MsigAddApprove mocks base method.
+func (m *MockFullNode) MsigAddApprove(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4, arg5 address.Address, arg6 bool) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigAddApprove", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigAddApprove indicates an expected call of MsigAddApprove
+// MsigAddApprove indicates an expected call of MsigAddApprove.
func (mr *MockFullNodeMockRecorder) MsigAddApprove(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigAddApprove", reflect.TypeOf((*MockFullNode)(nil).MsigAddApprove), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
}
-// MsigAddCancel mocks base method
-func (m *MockFullNode) MsigAddCancel(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4 address.Address, arg5 bool) (cid.Cid, error) {
+// MsigAddCancel mocks base method.
+func (m *MockFullNode) MsigAddCancel(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4 address.Address, arg5 bool) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigAddCancel", arg0, arg1, arg2, arg3, arg4, arg5)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigAddCancel indicates an expected call of MsigAddCancel
+// MsigAddCancel indicates an expected call of MsigAddCancel.
func (mr *MockFullNodeMockRecorder) MsigAddCancel(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigAddCancel", reflect.TypeOf((*MockFullNode)(nil).MsigAddCancel), arg0, arg1, arg2, arg3, arg4, arg5)
}
-// MsigAddPropose mocks base method
-func (m *MockFullNode) MsigAddPropose(arg0 context.Context, arg1, arg2, arg3 address.Address, arg4 bool) (cid.Cid, error) {
+// MsigAddPropose mocks base method.
+func (m *MockFullNode) MsigAddPropose(arg0 context.Context, arg1, arg2, arg3 address.Address, arg4 bool) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigAddPropose", arg0, arg1, arg2, arg3, arg4)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigAddPropose indicates an expected call of MsigAddPropose
+// MsigAddPropose indicates an expected call of MsigAddPropose.
func (mr *MockFullNodeMockRecorder) MsigAddPropose(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigAddPropose", reflect.TypeOf((*MockFullNode)(nil).MsigAddPropose), arg0, arg1, arg2, arg3, arg4)
}
-// MsigApprove mocks base method
-func (m *MockFullNode) MsigApprove(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address) (cid.Cid, error) {
+// MsigApprove mocks base method.
+func (m *MockFullNode) MsigApprove(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigApprove", arg0, arg1, arg2, arg3)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigApprove indicates an expected call of MsigApprove
+// MsigApprove indicates an expected call of MsigApprove.
func (mr *MockFullNodeMockRecorder) MsigApprove(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigApprove", reflect.TypeOf((*MockFullNode)(nil).MsigApprove), arg0, arg1, arg2, arg3)
}
-// MsigApproveTxnHash mocks base method
-func (m *MockFullNode) MsigApproveTxnHash(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3, arg4 address.Address, arg5 big.Int, arg6 address.Address, arg7 uint64, arg8 []byte) (cid.Cid, error) {
+// MsigApproveTxnHash mocks base method.
+func (m *MockFullNode) MsigApproveTxnHash(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3, arg4 address.Address, arg5 big.Int, arg6 address.Address, arg7 uint64, arg8 []byte) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigApproveTxnHash", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigApproveTxnHash indicates an expected call of MsigApproveTxnHash
+// MsigApproveTxnHash indicates an expected call of MsigApproveTxnHash.
func (mr *MockFullNodeMockRecorder) MsigApproveTxnHash(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigApproveTxnHash", reflect.TypeOf((*MockFullNode)(nil).MsigApproveTxnHash), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
}
-// MsigCancel mocks base method
-func (m *MockFullNode) MsigCancel(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address, arg4 big.Int, arg5 address.Address, arg6 uint64, arg7 []byte) (cid.Cid, error) {
+// MsigCancel mocks base method.
+func (m *MockFullNode) MsigCancel(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address, arg4 big.Int, arg5 address.Address, arg6 uint64, arg7 []byte) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigCancel", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigCancel indicates an expected call of MsigCancel
+// MsigCancel indicates an expected call of MsigCancel.
func (mr *MockFullNodeMockRecorder) MsigCancel(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCancel", reflect.TypeOf((*MockFullNode)(nil).MsigCancel), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
}
-// MsigCreate mocks base method
-func (m *MockFullNode) MsigCreate(arg0 context.Context, arg1 uint64, arg2 []address.Address, arg3 abi.ChainEpoch, arg4 big.Int, arg5 address.Address, arg6 big.Int) (cid.Cid, error) {
+// MsigCreate mocks base method.
+func (m *MockFullNode) MsigCreate(arg0 context.Context, arg1 uint64, arg2 []address.Address, arg3 abi.ChainEpoch, arg4 big.Int, arg5 address.Address, arg6 big.Int) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigCreate", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigCreate indicates an expected call of MsigCreate
+// MsigCreate indicates an expected call of MsigCreate.
func (mr *MockFullNodeMockRecorder) MsigCreate(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCreate", reflect.TypeOf((*MockFullNode)(nil).MsigCreate), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
}
-// MsigGetAvailableBalance mocks base method
+// MsigGetAvailableBalance mocks base method.
func (m *MockFullNode) MsigGetAvailableBalance(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigGetAvailableBalance", arg0, arg1, arg2)
@@ -1329,13 +1420,13 @@ func (m *MockFullNode) MsigGetAvailableBalance(arg0 context.Context, arg1 addres
return ret0, ret1
}
-// MsigGetAvailableBalance indicates an expected call of MsigGetAvailableBalance
+// MsigGetAvailableBalance indicates an expected call of MsigGetAvailableBalance.
func (mr *MockFullNodeMockRecorder) MsigGetAvailableBalance(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigGetAvailableBalance", reflect.TypeOf((*MockFullNode)(nil).MsigGetAvailableBalance), arg0, arg1, arg2)
}
-// MsigGetPending mocks base method
+// MsigGetPending mocks base method.
func (m *MockFullNode) MsigGetPending(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) ([]*api.MsigTransaction, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigGetPending", arg0, arg1, arg2)
@@ -1344,13 +1435,13 @@ func (m *MockFullNode) MsigGetPending(arg0 context.Context, arg1 address.Address
return ret0, ret1
}
-// MsigGetPending indicates an expected call of MsigGetPending
+// MsigGetPending indicates an expected call of MsigGetPending.
func (mr *MockFullNodeMockRecorder) MsigGetPending(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigGetPending", reflect.TypeOf((*MockFullNode)(nil).MsigGetPending), arg0, arg1, arg2)
}
-// MsigGetVested mocks base method
+// MsigGetVested mocks base method.
func (m *MockFullNode) MsigGetVested(arg0 context.Context, arg1 address.Address, arg2, arg3 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigGetVested", arg0, arg1, arg2, arg3)
@@ -1359,13 +1450,13 @@ func (m *MockFullNode) MsigGetVested(arg0 context.Context, arg1 address.Address,
return ret0, ret1
}
-// MsigGetVested indicates an expected call of MsigGetVested
+// MsigGetVested indicates an expected call of MsigGetVested.
func (mr *MockFullNodeMockRecorder) MsigGetVested(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigGetVested", reflect.TypeOf((*MockFullNode)(nil).MsigGetVested), arg0, arg1, arg2, arg3)
}
-// MsigGetVestingSchedule mocks base method
+// MsigGetVestingSchedule mocks base method.
func (m *MockFullNode) MsigGetVestingSchedule(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MsigVesting, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigGetVestingSchedule", arg0, arg1, arg2)
@@ -1374,88 +1465,88 @@ func (m *MockFullNode) MsigGetVestingSchedule(arg0 context.Context, arg1 address
return ret0, ret1
}
-// MsigGetVestingSchedule indicates an expected call of MsigGetVestingSchedule
+// MsigGetVestingSchedule indicates an expected call of MsigGetVestingSchedule.
func (mr *MockFullNodeMockRecorder) MsigGetVestingSchedule(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigGetVestingSchedule", reflect.TypeOf((*MockFullNode)(nil).MsigGetVestingSchedule), arg0, arg1, arg2)
}
-// MsigPropose mocks base method
-func (m *MockFullNode) MsigPropose(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int, arg4 address.Address, arg5 uint64, arg6 []byte) (cid.Cid, error) {
+// MsigPropose mocks base method.
+func (m *MockFullNode) MsigPropose(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int, arg4 address.Address, arg5 uint64, arg6 []byte) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigPropose", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigPropose indicates an expected call of MsigPropose
+// MsigPropose indicates an expected call of MsigPropose.
func (mr *MockFullNodeMockRecorder) MsigPropose(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigPropose", reflect.TypeOf((*MockFullNode)(nil).MsigPropose), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
}
-// MsigRemoveSigner mocks base method
-func (m *MockFullNode) MsigRemoveSigner(arg0 context.Context, arg1, arg2, arg3 address.Address, arg4 bool) (cid.Cid, error) {
+// MsigRemoveSigner mocks base method.
+func (m *MockFullNode) MsigRemoveSigner(arg0 context.Context, arg1, arg2, arg3 address.Address, arg4 bool) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigRemoveSigner", arg0, arg1, arg2, arg3, arg4)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigRemoveSigner indicates an expected call of MsigRemoveSigner
+// MsigRemoveSigner indicates an expected call of MsigRemoveSigner.
func (mr *MockFullNodeMockRecorder) MsigRemoveSigner(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigRemoveSigner", reflect.TypeOf((*MockFullNode)(nil).MsigRemoveSigner), arg0, arg1, arg2, arg3, arg4)
}
-// MsigSwapApprove mocks base method
-func (m *MockFullNode) MsigSwapApprove(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4, arg5, arg6 address.Address) (cid.Cid, error) {
+// MsigSwapApprove mocks base method.
+func (m *MockFullNode) MsigSwapApprove(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4, arg5, arg6 address.Address) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigSwapApprove", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigSwapApprove indicates an expected call of MsigSwapApprove
+// MsigSwapApprove indicates an expected call of MsigSwapApprove.
func (mr *MockFullNodeMockRecorder) MsigSwapApprove(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigSwapApprove", reflect.TypeOf((*MockFullNode)(nil).MsigSwapApprove), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
}
-// MsigSwapCancel mocks base method
-func (m *MockFullNode) MsigSwapCancel(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4, arg5 address.Address) (cid.Cid, error) {
+// MsigSwapCancel mocks base method.
+func (m *MockFullNode) MsigSwapCancel(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4, arg5 address.Address) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigSwapCancel", arg0, arg1, arg2, arg3, arg4, arg5)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigSwapCancel indicates an expected call of MsigSwapCancel
+// MsigSwapCancel indicates an expected call of MsigSwapCancel.
func (mr *MockFullNodeMockRecorder) MsigSwapCancel(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigSwapCancel", reflect.TypeOf((*MockFullNode)(nil).MsigSwapCancel), arg0, arg1, arg2, arg3, arg4, arg5)
}
-// MsigSwapPropose mocks base method
-func (m *MockFullNode) MsigSwapPropose(arg0 context.Context, arg1, arg2, arg3, arg4 address.Address) (cid.Cid, error) {
+// MsigSwapPropose mocks base method.
+func (m *MockFullNode) MsigSwapPropose(arg0 context.Context, arg1, arg2, arg3, arg4 address.Address) (*api.MessagePrototype, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MsigSwapPropose", arg0, arg1, arg2, arg3, arg4)
- ret0, _ := ret[0].(cid.Cid)
+ ret0, _ := ret[0].(*api.MessagePrototype)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// MsigSwapPropose indicates an expected call of MsigSwapPropose
+// MsigSwapPropose indicates an expected call of MsigSwapPropose.
func (mr *MockFullNodeMockRecorder) MsigSwapPropose(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigSwapPropose", reflect.TypeOf((*MockFullNode)(nil).MsigSwapPropose), arg0, arg1, arg2, arg3, arg4)
}
-// NetAddrsListen mocks base method
+// NetAddrsListen mocks base method.
func (m *MockFullNode) NetAddrsListen(arg0 context.Context) (peer.AddrInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetAddrsListen", arg0)
@@ -1464,13 +1555,13 @@ func (m *MockFullNode) NetAddrsListen(arg0 context.Context) (peer.AddrInfo, erro
return ret0, ret1
}
-// NetAddrsListen indicates an expected call of NetAddrsListen
+// NetAddrsListen indicates an expected call of NetAddrsListen.
func (mr *MockFullNodeMockRecorder) NetAddrsListen(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetAddrsListen", reflect.TypeOf((*MockFullNode)(nil).NetAddrsListen), arg0)
}
-// NetAgentVersion mocks base method
+// NetAgentVersion mocks base method.
func (m *MockFullNode) NetAgentVersion(arg0 context.Context, arg1 peer.ID) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetAgentVersion", arg0, arg1)
@@ -1479,13 +1570,13 @@ func (m *MockFullNode) NetAgentVersion(arg0 context.Context, arg1 peer.ID) (stri
return ret0, ret1
}
-// NetAgentVersion indicates an expected call of NetAgentVersion
+// NetAgentVersion indicates an expected call of NetAgentVersion.
func (mr *MockFullNodeMockRecorder) NetAgentVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetAgentVersion", reflect.TypeOf((*MockFullNode)(nil).NetAgentVersion), arg0, arg1)
}
-// NetAutoNatStatus mocks base method
+// NetAutoNatStatus mocks base method.
func (m *MockFullNode) NetAutoNatStatus(arg0 context.Context) (api.NatInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetAutoNatStatus", arg0)
@@ -1494,13 +1585,13 @@ func (m *MockFullNode) NetAutoNatStatus(arg0 context.Context) (api.NatInfo, erro
return ret0, ret1
}
-// NetAutoNatStatus indicates an expected call of NetAutoNatStatus
+// NetAutoNatStatus indicates an expected call of NetAutoNatStatus.
func (mr *MockFullNodeMockRecorder) NetAutoNatStatus(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetAutoNatStatus", reflect.TypeOf((*MockFullNode)(nil).NetAutoNatStatus), arg0)
}
-// NetBandwidthStats mocks base method
+// NetBandwidthStats mocks base method.
func (m *MockFullNode) NetBandwidthStats(arg0 context.Context) (metrics.Stats, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetBandwidthStats", arg0)
@@ -1509,13 +1600,13 @@ func (m *MockFullNode) NetBandwidthStats(arg0 context.Context) (metrics.Stats, e
return ret0, ret1
}
-// NetBandwidthStats indicates an expected call of NetBandwidthStats
+// NetBandwidthStats indicates an expected call of NetBandwidthStats.
func (mr *MockFullNodeMockRecorder) NetBandwidthStats(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBandwidthStats", reflect.TypeOf((*MockFullNode)(nil).NetBandwidthStats), arg0)
}
-// NetBandwidthStatsByPeer mocks base method
+// NetBandwidthStatsByPeer mocks base method.
func (m *MockFullNode) NetBandwidthStatsByPeer(arg0 context.Context) (map[string]metrics.Stats, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetBandwidthStatsByPeer", arg0)
@@ -1524,13 +1615,13 @@ func (m *MockFullNode) NetBandwidthStatsByPeer(arg0 context.Context) (map[string
return ret0, ret1
}
-// NetBandwidthStatsByPeer indicates an expected call of NetBandwidthStatsByPeer
+// NetBandwidthStatsByPeer indicates an expected call of NetBandwidthStatsByPeer.
func (mr *MockFullNodeMockRecorder) NetBandwidthStatsByPeer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBandwidthStatsByPeer", reflect.TypeOf((*MockFullNode)(nil).NetBandwidthStatsByPeer), arg0)
}
-// NetBandwidthStatsByProtocol mocks base method
+// NetBandwidthStatsByProtocol mocks base method.
func (m *MockFullNode) NetBandwidthStatsByProtocol(arg0 context.Context) (map[protocol.ID]metrics.Stats, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetBandwidthStatsByProtocol", arg0)
@@ -1539,13 +1630,13 @@ func (m *MockFullNode) NetBandwidthStatsByProtocol(arg0 context.Context) (map[pr
return ret0, ret1
}
-// NetBandwidthStatsByProtocol indicates an expected call of NetBandwidthStatsByProtocol
+// NetBandwidthStatsByProtocol indicates an expected call of NetBandwidthStatsByProtocol.
func (mr *MockFullNodeMockRecorder) NetBandwidthStatsByProtocol(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBandwidthStatsByProtocol", reflect.TypeOf((*MockFullNode)(nil).NetBandwidthStatsByProtocol), arg0)
}
-// NetBlockAdd mocks base method
+// NetBlockAdd mocks base method.
func (m *MockFullNode) NetBlockAdd(arg0 context.Context, arg1 api.NetBlockList) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetBlockAdd", arg0, arg1)
@@ -1553,13 +1644,13 @@ func (m *MockFullNode) NetBlockAdd(arg0 context.Context, arg1 api.NetBlockList)
return ret0
}
-// NetBlockAdd indicates an expected call of NetBlockAdd
+// NetBlockAdd indicates an expected call of NetBlockAdd.
func (mr *MockFullNodeMockRecorder) NetBlockAdd(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBlockAdd", reflect.TypeOf((*MockFullNode)(nil).NetBlockAdd), arg0, arg1)
}
-// NetBlockList mocks base method
+// NetBlockList mocks base method.
func (m *MockFullNode) NetBlockList(arg0 context.Context) (api.NetBlockList, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetBlockList", arg0)
@@ -1568,13 +1659,13 @@ func (m *MockFullNode) NetBlockList(arg0 context.Context) (api.NetBlockList, err
return ret0, ret1
}
-// NetBlockList indicates an expected call of NetBlockList
+// NetBlockList indicates an expected call of NetBlockList.
func (mr *MockFullNodeMockRecorder) NetBlockList(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBlockList", reflect.TypeOf((*MockFullNode)(nil).NetBlockList), arg0)
}
-// NetBlockRemove mocks base method
+// NetBlockRemove mocks base method.
func (m *MockFullNode) NetBlockRemove(arg0 context.Context, arg1 api.NetBlockList) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetBlockRemove", arg0, arg1)
@@ -1582,13 +1673,13 @@ func (m *MockFullNode) NetBlockRemove(arg0 context.Context, arg1 api.NetBlockLis
return ret0
}
-// NetBlockRemove indicates an expected call of NetBlockRemove
+// NetBlockRemove indicates an expected call of NetBlockRemove.
func (mr *MockFullNodeMockRecorder) NetBlockRemove(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBlockRemove", reflect.TypeOf((*MockFullNode)(nil).NetBlockRemove), arg0, arg1)
}
-// NetConnect mocks base method
+// NetConnect mocks base method.
func (m *MockFullNode) NetConnect(arg0 context.Context, arg1 peer.AddrInfo) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetConnect", arg0, arg1)
@@ -1596,13 +1687,13 @@ func (m *MockFullNode) NetConnect(arg0 context.Context, arg1 peer.AddrInfo) erro
return ret0
}
-// NetConnect indicates an expected call of NetConnect
+// NetConnect indicates an expected call of NetConnect.
func (mr *MockFullNodeMockRecorder) NetConnect(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetConnect", reflect.TypeOf((*MockFullNode)(nil).NetConnect), arg0, arg1)
}
-// NetConnectedness mocks base method
+// NetConnectedness mocks base method.
func (m *MockFullNode) NetConnectedness(arg0 context.Context, arg1 peer.ID) (network0.Connectedness, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetConnectedness", arg0, arg1)
@@ -1611,13 +1702,13 @@ func (m *MockFullNode) NetConnectedness(arg0 context.Context, arg1 peer.ID) (net
return ret0, ret1
}
-// NetConnectedness indicates an expected call of NetConnectedness
+// NetConnectedness indicates an expected call of NetConnectedness.
func (mr *MockFullNodeMockRecorder) NetConnectedness(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetConnectedness", reflect.TypeOf((*MockFullNode)(nil).NetConnectedness), arg0, arg1)
}
-// NetDisconnect mocks base method
+// NetDisconnect mocks base method.
func (m *MockFullNode) NetDisconnect(arg0 context.Context, arg1 peer.ID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetDisconnect", arg0, arg1)
@@ -1625,13 +1716,13 @@ func (m *MockFullNode) NetDisconnect(arg0 context.Context, arg1 peer.ID) error {
return ret0
}
-// NetDisconnect indicates an expected call of NetDisconnect
+// NetDisconnect indicates an expected call of NetDisconnect.
func (mr *MockFullNodeMockRecorder) NetDisconnect(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetDisconnect", reflect.TypeOf((*MockFullNode)(nil).NetDisconnect), arg0, arg1)
}
-// NetFindPeer mocks base method
+// NetFindPeer mocks base method.
func (m *MockFullNode) NetFindPeer(arg0 context.Context, arg1 peer.ID) (peer.AddrInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetFindPeer", arg0, arg1)
@@ -1640,13 +1731,13 @@ func (m *MockFullNode) NetFindPeer(arg0 context.Context, arg1 peer.ID) (peer.Add
return ret0, ret1
}
-// NetFindPeer indicates an expected call of NetFindPeer
+// NetFindPeer indicates an expected call of NetFindPeer.
func (mr *MockFullNodeMockRecorder) NetFindPeer(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
}
-// NetPeerInfo mocks base method
+// NetPeerInfo mocks base method.
func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetPeerInfo", arg0, arg1)
@@ -1655,13 +1746,13 @@ func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.Ext
return ret0, ret1
}
-// NetPeerInfo indicates an expected call of NetPeerInfo
+// NetPeerInfo indicates an expected call of NetPeerInfo.
func (mr *MockFullNodeMockRecorder) NetPeerInfo(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeerInfo", reflect.TypeOf((*MockFullNode)(nil).NetPeerInfo), arg0, arg1)
}
-// NetPeers mocks base method
+// NetPeers mocks base method.
func (m *MockFullNode) NetPeers(arg0 context.Context) ([]peer.AddrInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetPeers", arg0)
@@ -1670,13 +1761,13 @@ func (m *MockFullNode) NetPeers(arg0 context.Context) ([]peer.AddrInfo, error) {
return ret0, ret1
}
-// NetPeers indicates an expected call of NetPeers
+// NetPeers indicates an expected call of NetPeers.
func (mr *MockFullNodeMockRecorder) NetPeers(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeers", reflect.TypeOf((*MockFullNode)(nil).NetPeers), arg0)
}
-// NetPubsubScores mocks base method
+// NetPubsubScores mocks base method.
func (m *MockFullNode) NetPubsubScores(arg0 context.Context) ([]api.PubsubScore, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NetPubsubScores", arg0)
@@ -1685,13 +1776,28 @@ func (m *MockFullNode) NetPubsubScores(arg0 context.Context) ([]api.PubsubScore,
return ret0, ret1
}
-// NetPubsubScores indicates an expected call of NetPubsubScores
+// NetPubsubScores indicates an expected call of NetPubsubScores.
func (mr *MockFullNodeMockRecorder) NetPubsubScores(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
}
-// PaychAllocateLane mocks base method
+// NodeStatus mocks base method.
+func (m *MockFullNode) NodeStatus(arg0 context.Context, arg1 bool) (api.NodeStatus, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NodeStatus", arg0, arg1)
+ ret0, _ := ret[0].(api.NodeStatus)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NodeStatus indicates an expected call of NodeStatus.
+func (mr *MockFullNodeMockRecorder) NodeStatus(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeStatus", reflect.TypeOf((*MockFullNode)(nil).NodeStatus), arg0, arg1)
+}
+
+// PaychAllocateLane mocks base method.
func (m *MockFullNode) PaychAllocateLane(arg0 context.Context, arg1 address.Address) (uint64, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychAllocateLane", arg0, arg1)
@@ -1700,13 +1806,13 @@ func (m *MockFullNode) PaychAllocateLane(arg0 context.Context, arg1 address.Addr
return ret0, ret1
}
-// PaychAllocateLane indicates an expected call of PaychAllocateLane
+// PaychAllocateLane indicates an expected call of PaychAllocateLane.
func (mr *MockFullNodeMockRecorder) PaychAllocateLane(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychAllocateLane", reflect.TypeOf((*MockFullNode)(nil).PaychAllocateLane), arg0, arg1)
}
-// PaychAvailableFunds mocks base method
+// PaychAvailableFunds mocks base method.
func (m *MockFullNode) PaychAvailableFunds(arg0 context.Context, arg1 address.Address) (*api.ChannelAvailableFunds, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychAvailableFunds", arg0, arg1)
@@ -1715,13 +1821,13 @@ func (m *MockFullNode) PaychAvailableFunds(arg0 context.Context, arg1 address.Ad
return ret0, ret1
}
-// PaychAvailableFunds indicates an expected call of PaychAvailableFunds
+// PaychAvailableFunds indicates an expected call of PaychAvailableFunds.
func (mr *MockFullNodeMockRecorder) PaychAvailableFunds(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychAvailableFunds", reflect.TypeOf((*MockFullNode)(nil).PaychAvailableFunds), arg0, arg1)
}
-// PaychAvailableFundsByFromTo mocks base method
+// PaychAvailableFundsByFromTo mocks base method.
func (m *MockFullNode) PaychAvailableFundsByFromTo(arg0 context.Context, arg1, arg2 address.Address) (*api.ChannelAvailableFunds, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychAvailableFundsByFromTo", arg0, arg1, arg2)
@@ -1730,13 +1836,13 @@ func (m *MockFullNode) PaychAvailableFundsByFromTo(arg0 context.Context, arg1, a
return ret0, ret1
}
-// PaychAvailableFundsByFromTo indicates an expected call of PaychAvailableFundsByFromTo
+// PaychAvailableFundsByFromTo indicates an expected call of PaychAvailableFundsByFromTo.
func (mr *MockFullNodeMockRecorder) PaychAvailableFundsByFromTo(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychAvailableFundsByFromTo", reflect.TypeOf((*MockFullNode)(nil).PaychAvailableFundsByFromTo), arg0, arg1, arg2)
}
-// PaychCollect mocks base method
+// PaychCollect mocks base method.
func (m *MockFullNode) PaychCollect(arg0 context.Context, arg1 address.Address) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychCollect", arg0, arg1)
@@ -1745,13 +1851,13 @@ func (m *MockFullNode) PaychCollect(arg0 context.Context, arg1 address.Address)
return ret0, ret1
}
-// PaychCollect indicates an expected call of PaychCollect
+// PaychCollect indicates an expected call of PaychCollect.
func (mr *MockFullNodeMockRecorder) PaychCollect(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychCollect", reflect.TypeOf((*MockFullNode)(nil).PaychCollect), arg0, arg1)
}
-// PaychGet mocks base method
+// PaychGet mocks base method.
func (m *MockFullNode) PaychGet(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (*api.ChannelInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychGet", arg0, arg1, arg2, arg3)
@@ -1760,13 +1866,13 @@ func (m *MockFullNode) PaychGet(arg0 context.Context, arg1, arg2 address.Address
return ret0, ret1
}
-// PaychGet indicates an expected call of PaychGet
+// PaychGet indicates an expected call of PaychGet.
func (mr *MockFullNodeMockRecorder) PaychGet(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychGet", reflect.TypeOf((*MockFullNode)(nil).PaychGet), arg0, arg1, arg2, arg3)
}
-// PaychGetWaitReady mocks base method
+// PaychGetWaitReady mocks base method.
func (m *MockFullNode) PaychGetWaitReady(arg0 context.Context, arg1 cid.Cid) (address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychGetWaitReady", arg0, arg1)
@@ -1775,13 +1881,13 @@ func (m *MockFullNode) PaychGetWaitReady(arg0 context.Context, arg1 cid.Cid) (ad
return ret0, ret1
}
-// PaychGetWaitReady indicates an expected call of PaychGetWaitReady
+// PaychGetWaitReady indicates an expected call of PaychGetWaitReady.
func (mr *MockFullNodeMockRecorder) PaychGetWaitReady(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychGetWaitReady", reflect.TypeOf((*MockFullNode)(nil).PaychGetWaitReady), arg0, arg1)
}
-// PaychList mocks base method
+// PaychList mocks base method.
func (m *MockFullNode) PaychList(arg0 context.Context) ([]address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychList", arg0)
@@ -1790,13 +1896,13 @@ func (m *MockFullNode) PaychList(arg0 context.Context) ([]address.Address, error
return ret0, ret1
}
-// PaychList indicates an expected call of PaychList
+// PaychList indicates an expected call of PaychList.
func (mr *MockFullNodeMockRecorder) PaychList(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychList", reflect.TypeOf((*MockFullNode)(nil).PaychList), arg0)
}
-// PaychNewPayment mocks base method
+// PaychNewPayment mocks base method.
func (m *MockFullNode) PaychNewPayment(arg0 context.Context, arg1, arg2 address.Address, arg3 []api.VoucherSpec) (*api.PaymentInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychNewPayment", arg0, arg1, arg2, arg3)
@@ -1805,13 +1911,13 @@ func (m *MockFullNode) PaychNewPayment(arg0 context.Context, arg1, arg2 address.
return ret0, ret1
}
-// PaychNewPayment indicates an expected call of PaychNewPayment
+// PaychNewPayment indicates an expected call of PaychNewPayment.
func (mr *MockFullNodeMockRecorder) PaychNewPayment(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychNewPayment", reflect.TypeOf((*MockFullNode)(nil).PaychNewPayment), arg0, arg1, arg2, arg3)
}
-// PaychSettle mocks base method
+// PaychSettle mocks base method.
func (m *MockFullNode) PaychSettle(arg0 context.Context, arg1 address.Address) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychSettle", arg0, arg1)
@@ -1820,13 +1926,13 @@ func (m *MockFullNode) PaychSettle(arg0 context.Context, arg1 address.Address) (
return ret0, ret1
}
-// PaychSettle indicates an expected call of PaychSettle
+// PaychSettle indicates an expected call of PaychSettle.
func (mr *MockFullNodeMockRecorder) PaychSettle(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychSettle", reflect.TypeOf((*MockFullNode)(nil).PaychSettle), arg0, arg1)
}
-// PaychStatus mocks base method
+// PaychStatus mocks base method.
func (m *MockFullNode) PaychStatus(arg0 context.Context, arg1 address.Address) (*api.PaychStatus, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychStatus", arg0, arg1)
@@ -1835,13 +1941,13 @@ func (m *MockFullNode) PaychStatus(arg0 context.Context, arg1 address.Address) (
return ret0, ret1
}
-// PaychStatus indicates an expected call of PaychStatus
+// PaychStatus indicates an expected call of PaychStatus.
func (mr *MockFullNodeMockRecorder) PaychStatus(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychStatus", reflect.TypeOf((*MockFullNode)(nil).PaychStatus), arg0, arg1)
}
-// PaychVoucherAdd mocks base method
+// PaychVoucherAdd mocks base method.
func (m *MockFullNode) PaychVoucherAdd(arg0 context.Context, arg1 address.Address, arg2 *paych.SignedVoucher, arg3 []byte, arg4 big.Int) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychVoucherAdd", arg0, arg1, arg2, arg3, arg4)
@@ -1850,13 +1956,13 @@ func (m *MockFullNode) PaychVoucherAdd(arg0 context.Context, arg1 address.Addres
return ret0, ret1
}
-// PaychVoucherAdd indicates an expected call of PaychVoucherAdd
+// PaychVoucherAdd indicates an expected call of PaychVoucherAdd.
func (mr *MockFullNodeMockRecorder) PaychVoucherAdd(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherAdd", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherAdd), arg0, arg1, arg2, arg3, arg4)
}
-// PaychVoucherCheckSpendable mocks base method
+// PaychVoucherCheckSpendable mocks base method.
func (m *MockFullNode) PaychVoucherCheckSpendable(arg0 context.Context, arg1 address.Address, arg2 *paych.SignedVoucher, arg3, arg4 []byte) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychVoucherCheckSpendable", arg0, arg1, arg2, arg3, arg4)
@@ -1865,13 +1971,13 @@ func (m *MockFullNode) PaychVoucherCheckSpendable(arg0 context.Context, arg1 add
return ret0, ret1
}
-// PaychVoucherCheckSpendable indicates an expected call of PaychVoucherCheckSpendable
+// PaychVoucherCheckSpendable indicates an expected call of PaychVoucherCheckSpendable.
func (mr *MockFullNodeMockRecorder) PaychVoucherCheckSpendable(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherCheckSpendable", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherCheckSpendable), arg0, arg1, arg2, arg3, arg4)
}
-// PaychVoucherCheckValid mocks base method
+// PaychVoucherCheckValid mocks base method.
func (m *MockFullNode) PaychVoucherCheckValid(arg0 context.Context, arg1 address.Address, arg2 *paych.SignedVoucher) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychVoucherCheckValid", arg0, arg1, arg2)
@@ -1879,13 +1985,13 @@ func (m *MockFullNode) PaychVoucherCheckValid(arg0 context.Context, arg1 address
return ret0
}
-// PaychVoucherCheckValid indicates an expected call of PaychVoucherCheckValid
+// PaychVoucherCheckValid indicates an expected call of PaychVoucherCheckValid.
func (mr *MockFullNodeMockRecorder) PaychVoucherCheckValid(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherCheckValid", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherCheckValid), arg0, arg1, arg2)
}
-// PaychVoucherCreate mocks base method
+// PaychVoucherCreate mocks base method.
func (m *MockFullNode) PaychVoucherCreate(arg0 context.Context, arg1 address.Address, arg2 big.Int, arg3 uint64) (*api.VoucherCreateResult, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychVoucherCreate", arg0, arg1, arg2, arg3)
@@ -1894,13 +2000,13 @@ func (m *MockFullNode) PaychVoucherCreate(arg0 context.Context, arg1 address.Add
return ret0, ret1
}
-// PaychVoucherCreate indicates an expected call of PaychVoucherCreate
+// PaychVoucherCreate indicates an expected call of PaychVoucherCreate.
func (mr *MockFullNodeMockRecorder) PaychVoucherCreate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherCreate", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherCreate), arg0, arg1, arg2, arg3)
}
-// PaychVoucherList mocks base method
+// PaychVoucherList mocks base method.
func (m *MockFullNode) PaychVoucherList(arg0 context.Context, arg1 address.Address) ([]*paych.SignedVoucher, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychVoucherList", arg0, arg1)
@@ -1909,13 +2015,13 @@ func (m *MockFullNode) PaychVoucherList(arg0 context.Context, arg1 address.Addre
return ret0, ret1
}
-// PaychVoucherList indicates an expected call of PaychVoucherList
+// PaychVoucherList indicates an expected call of PaychVoucherList.
func (mr *MockFullNodeMockRecorder) PaychVoucherList(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherList", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherList), arg0, arg1)
}
-// PaychVoucherSubmit mocks base method
+// PaychVoucherSubmit mocks base method.
func (m *MockFullNode) PaychVoucherSubmit(arg0 context.Context, arg1 address.Address, arg2 *paych.SignedVoucher, arg3, arg4 []byte) (cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PaychVoucherSubmit", arg0, arg1, arg2, arg3, arg4)
@@ -1924,13 +2030,13 @@ func (m *MockFullNode) PaychVoucherSubmit(arg0 context.Context, arg1 address.Add
return ret0, ret1
}
-// PaychVoucherSubmit indicates an expected call of PaychVoucherSubmit
+// PaychVoucherSubmit indicates an expected call of PaychVoucherSubmit.
func (mr *MockFullNodeMockRecorder) PaychVoucherSubmit(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherSubmit", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherSubmit), arg0, arg1, arg2, arg3, arg4)
}
-// Session mocks base method
+// Session mocks base method.
func (m *MockFullNode) Session(arg0 context.Context) (uuid.UUID, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Session", arg0)
@@ -1939,13 +2045,13 @@ func (m *MockFullNode) Session(arg0 context.Context) (uuid.UUID, error) {
return ret0, ret1
}
-// Session indicates an expected call of Session
+// Session indicates an expected call of Session.
func (mr *MockFullNodeMockRecorder) Session(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Session", reflect.TypeOf((*MockFullNode)(nil).Session), arg0)
}
-// Shutdown mocks base method
+// Shutdown mocks base method.
func (m *MockFullNode) Shutdown(arg0 context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Shutdown", arg0)
@@ -1953,13 +2059,13 @@ func (m *MockFullNode) Shutdown(arg0 context.Context) error {
return ret0
}
-// Shutdown indicates an expected call of Shutdown
+// Shutdown indicates an expected call of Shutdown.
func (mr *MockFullNodeMockRecorder) Shutdown(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Shutdown", reflect.TypeOf((*MockFullNode)(nil).Shutdown), arg0)
}
-// StateAccountKey mocks base method
+// StateAccountKey mocks base method.
func (m *MockFullNode) StateAccountKey(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateAccountKey", arg0, arg1, arg2)
@@ -1968,13 +2074,13 @@ func (m *MockFullNode) StateAccountKey(arg0 context.Context, arg1 address.Addres
return ret0, ret1
}
-// StateAccountKey indicates an expected call of StateAccountKey
+// StateAccountKey indicates an expected call of StateAccountKey.
func (mr *MockFullNodeMockRecorder) StateAccountKey(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateAccountKey", reflect.TypeOf((*MockFullNode)(nil).StateAccountKey), arg0, arg1, arg2)
}
-// StateAllMinerFaults mocks base method
+// StateAllMinerFaults mocks base method.
func (m *MockFullNode) StateAllMinerFaults(arg0 context.Context, arg1 abi.ChainEpoch, arg2 types.TipSetKey) ([]*api.Fault, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateAllMinerFaults", arg0, arg1, arg2)
@@ -1983,13 +2089,13 @@ func (m *MockFullNode) StateAllMinerFaults(arg0 context.Context, arg1 abi.ChainE
return ret0, ret1
}
-// StateAllMinerFaults indicates an expected call of StateAllMinerFaults
+// StateAllMinerFaults indicates an expected call of StateAllMinerFaults.
func (mr *MockFullNodeMockRecorder) StateAllMinerFaults(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateAllMinerFaults", reflect.TypeOf((*MockFullNode)(nil).StateAllMinerFaults), arg0, arg1, arg2)
}
-// StateCall mocks base method
+// StateCall mocks base method.
func (m *MockFullNode) StateCall(arg0 context.Context, arg1 *types.Message, arg2 types.TipSetKey) (*api.InvocResult, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateCall", arg0, arg1, arg2)
@@ -1998,13 +2104,13 @@ func (m *MockFullNode) StateCall(arg0 context.Context, arg1 *types.Message, arg2
return ret0, ret1
}
-// StateCall indicates an expected call of StateCall
+// StateCall indicates an expected call of StateCall.
func (mr *MockFullNodeMockRecorder) StateCall(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCall", reflect.TypeOf((*MockFullNode)(nil).StateCall), arg0, arg1, arg2)
}
-// StateChangedActors mocks base method
+// StateChangedActors mocks base method.
func (m *MockFullNode) StateChangedActors(arg0 context.Context, arg1, arg2 cid.Cid) (map[string]types.Actor, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateChangedActors", arg0, arg1, arg2)
@@ -2013,13 +2119,13 @@ func (m *MockFullNode) StateChangedActors(arg0 context.Context, arg1, arg2 cid.C
return ret0, ret1
}
-// StateChangedActors indicates an expected call of StateChangedActors
+// StateChangedActors indicates an expected call of StateChangedActors.
func (mr *MockFullNodeMockRecorder) StateChangedActors(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateChangedActors", reflect.TypeOf((*MockFullNode)(nil).StateChangedActors), arg0, arg1, arg2)
}
-// StateCirculatingSupply mocks base method
+// StateCirculatingSupply mocks base method.
func (m *MockFullNode) StateCirculatingSupply(arg0 context.Context, arg1 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateCirculatingSupply", arg0, arg1)
@@ -2028,13 +2134,13 @@ func (m *MockFullNode) StateCirculatingSupply(arg0 context.Context, arg1 types.T
return ret0, ret1
}
-// StateCirculatingSupply indicates an expected call of StateCirculatingSupply
+// StateCirculatingSupply indicates an expected call of StateCirculatingSupply.
func (mr *MockFullNodeMockRecorder) StateCirculatingSupply(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCirculatingSupply", reflect.TypeOf((*MockFullNode)(nil).StateCirculatingSupply), arg0, arg1)
}
-// StateCompute mocks base method
+// StateCompute mocks base method.
func (m *MockFullNode) StateCompute(arg0 context.Context, arg1 abi.ChainEpoch, arg2 []*types.Message, arg3 types.TipSetKey) (*api.ComputeStateOutput, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateCompute", arg0, arg1, arg2, arg3)
@@ -2043,13 +2149,13 @@ func (m *MockFullNode) StateCompute(arg0 context.Context, arg1 abi.ChainEpoch, a
return ret0, ret1
}
-// StateCompute indicates an expected call of StateCompute
+// StateCompute indicates an expected call of StateCompute.
func (mr *MockFullNodeMockRecorder) StateCompute(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCompute", reflect.TypeOf((*MockFullNode)(nil).StateCompute), arg0, arg1, arg2, arg3)
}
-// StateDealProviderCollateralBounds mocks base method
+// StateDealProviderCollateralBounds mocks base method.
func (m *MockFullNode) StateDealProviderCollateralBounds(arg0 context.Context, arg1 abi.PaddedPieceSize, arg2 bool, arg3 types.TipSetKey) (api.DealCollateralBounds, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateDealProviderCollateralBounds", arg0, arg1, arg2, arg3)
@@ -2058,13 +2164,13 @@ func (m *MockFullNode) StateDealProviderCollateralBounds(arg0 context.Context, a
return ret0, ret1
}
-// StateDealProviderCollateralBounds indicates an expected call of StateDealProviderCollateralBounds
+// StateDealProviderCollateralBounds indicates an expected call of StateDealProviderCollateralBounds.
func (mr *MockFullNodeMockRecorder) StateDealProviderCollateralBounds(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateDealProviderCollateralBounds", reflect.TypeOf((*MockFullNode)(nil).StateDealProviderCollateralBounds), arg0, arg1, arg2, arg3)
}
-// StateDecodeParams mocks base method
+// StateDecodeParams mocks base method.
func (m *MockFullNode) StateDecodeParams(arg0 context.Context, arg1 address.Address, arg2 abi.MethodNum, arg3 []byte, arg4 types.TipSetKey) (interface{}, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateDecodeParams", arg0, arg1, arg2, arg3, arg4)
@@ -2073,13 +2179,13 @@ func (m *MockFullNode) StateDecodeParams(arg0 context.Context, arg1 address.Addr
return ret0, ret1
}
-// StateDecodeParams indicates an expected call of StateDecodeParams
+// StateDecodeParams indicates an expected call of StateDecodeParams.
func (mr *MockFullNodeMockRecorder) StateDecodeParams(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateDecodeParams", reflect.TypeOf((*MockFullNode)(nil).StateDecodeParams), arg0, arg1, arg2, arg3, arg4)
}
-// StateGetActor mocks base method
+// StateGetActor mocks base method.
func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*types.Actor, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateGetActor", arg0, arg1, arg2)
@@ -2088,28 +2194,13 @@ func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address,
return ret0, ret1
}
-// StateGetActor indicates an expected call of StateGetActor
+// StateGetActor indicates an expected call of StateGetActor.
func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
}
-// StateGetReceipt mocks base method
-func (m *MockFullNode) StateGetReceipt(arg0 context.Context, arg1 cid.Cid, arg2 types.TipSetKey) (*types.MessageReceipt, error) {
- m.ctrl.T.Helper()
- ret := m.ctrl.Call(m, "StateGetReceipt", arg0, arg1, arg2)
- ret0, _ := ret[0].(*types.MessageReceipt)
- ret1, _ := ret[1].(error)
- return ret0, ret1
-}
-
-// StateGetReceipt indicates an expected call of StateGetReceipt
-func (mr *MockFullNodeMockRecorder) StateGetReceipt(arg0, arg1, arg2 interface{}) *gomock.Call {
- mr.mock.ctrl.T.Helper()
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetReceipt", reflect.TypeOf((*MockFullNode)(nil).StateGetReceipt), arg0, arg1, arg2)
-}
-
-// StateListActors mocks base method
+// StateListActors mocks base method.
func (m *MockFullNode) StateListActors(arg0 context.Context, arg1 types.TipSetKey) ([]address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateListActors", arg0, arg1)
@@ -2118,13 +2209,13 @@ func (m *MockFullNode) StateListActors(arg0 context.Context, arg1 types.TipSetKe
return ret0, ret1
}
-// StateListActors indicates an expected call of StateListActors
+// StateListActors indicates an expected call of StateListActors.
func (mr *MockFullNodeMockRecorder) StateListActors(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateListActors", reflect.TypeOf((*MockFullNode)(nil).StateListActors), arg0, arg1)
}
-// StateListMessages mocks base method
+// StateListMessages mocks base method.
func (m *MockFullNode) StateListMessages(arg0 context.Context, arg1 *api.MessageMatch, arg2 types.TipSetKey, arg3 abi.ChainEpoch) ([]cid.Cid, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateListMessages", arg0, arg1, arg2, arg3)
@@ -2133,13 +2224,13 @@ func (m *MockFullNode) StateListMessages(arg0 context.Context, arg1 *api.Message
return ret0, ret1
}
-// StateListMessages indicates an expected call of StateListMessages
+// StateListMessages indicates an expected call of StateListMessages.
func (mr *MockFullNodeMockRecorder) StateListMessages(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateListMessages", reflect.TypeOf((*MockFullNode)(nil).StateListMessages), arg0, arg1, arg2, arg3)
}
-// StateListMiners mocks base method
+// StateListMiners mocks base method.
func (m *MockFullNode) StateListMiners(arg0 context.Context, arg1 types.TipSetKey) ([]address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateListMiners", arg0, arg1)
@@ -2148,13 +2239,13 @@ func (m *MockFullNode) StateListMiners(arg0 context.Context, arg1 types.TipSetKe
return ret0, ret1
}
-// StateListMiners indicates an expected call of StateListMiners
+// StateListMiners indicates an expected call of StateListMiners.
func (mr *MockFullNodeMockRecorder) StateListMiners(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateListMiners", reflect.TypeOf((*MockFullNode)(nil).StateListMiners), arg0, arg1)
}
-// StateLookupID mocks base method
+// StateLookupID mocks base method.
func (m *MockFullNode) StateLookupID(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateLookupID", arg0, arg1, arg2)
@@ -2163,13 +2254,13 @@ func (m *MockFullNode) StateLookupID(arg0 context.Context, arg1 address.Address,
return ret0, ret1
}
-// StateLookupID indicates an expected call of StateLookupID
+// StateLookupID indicates an expected call of StateLookupID.
func (mr *MockFullNodeMockRecorder) StateLookupID(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateLookupID", reflect.TypeOf((*MockFullNode)(nil).StateLookupID), arg0, arg1, arg2)
}
-// StateMarketBalance mocks base method
+// StateMarketBalance mocks base method.
func (m *MockFullNode) StateMarketBalance(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MarketBalance, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMarketBalance", arg0, arg1, arg2)
@@ -2178,13 +2269,13 @@ func (m *MockFullNode) StateMarketBalance(arg0 context.Context, arg1 address.Add
return ret0, ret1
}
-// StateMarketBalance indicates an expected call of StateMarketBalance
+// StateMarketBalance indicates an expected call of StateMarketBalance.
func (mr *MockFullNodeMockRecorder) StateMarketBalance(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMarketBalance", reflect.TypeOf((*MockFullNode)(nil).StateMarketBalance), arg0, arg1, arg2)
}
-// StateMarketDeals mocks base method
+// StateMarketDeals mocks base method.
func (m *MockFullNode) StateMarketDeals(arg0 context.Context, arg1 types.TipSetKey) (map[string]api.MarketDeal, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMarketDeals", arg0, arg1)
@@ -2193,13 +2284,13 @@ func (m *MockFullNode) StateMarketDeals(arg0 context.Context, arg1 types.TipSetK
return ret0, ret1
}
-// StateMarketDeals indicates an expected call of StateMarketDeals
+// StateMarketDeals indicates an expected call of StateMarketDeals.
func (mr *MockFullNodeMockRecorder) StateMarketDeals(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMarketDeals", reflect.TypeOf((*MockFullNode)(nil).StateMarketDeals), arg0, arg1)
}
-// StateMarketParticipants mocks base method
+// StateMarketParticipants mocks base method.
func (m *MockFullNode) StateMarketParticipants(arg0 context.Context, arg1 types.TipSetKey) (map[string]api.MarketBalance, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMarketParticipants", arg0, arg1)
@@ -2208,13 +2299,13 @@ func (m *MockFullNode) StateMarketParticipants(arg0 context.Context, arg1 types.
return ret0, ret1
}
-// StateMarketParticipants indicates an expected call of StateMarketParticipants
+// StateMarketParticipants indicates an expected call of StateMarketParticipants.
func (mr *MockFullNodeMockRecorder) StateMarketParticipants(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMarketParticipants", reflect.TypeOf((*MockFullNode)(nil).StateMarketParticipants), arg0, arg1)
}
-// StateMarketStorageDeal mocks base method
+// StateMarketStorageDeal mocks base method.
func (m *MockFullNode) StateMarketStorageDeal(arg0 context.Context, arg1 abi.DealID, arg2 types.TipSetKey) (*api.MarketDeal, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMarketStorageDeal", arg0, arg1, arg2)
@@ -2223,13 +2314,13 @@ func (m *MockFullNode) StateMarketStorageDeal(arg0 context.Context, arg1 abi.Dea
return ret0, ret1
}
-// StateMarketStorageDeal indicates an expected call of StateMarketStorageDeal
+// StateMarketStorageDeal indicates an expected call of StateMarketStorageDeal.
func (mr *MockFullNodeMockRecorder) StateMarketStorageDeal(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMarketStorageDeal", reflect.TypeOf((*MockFullNode)(nil).StateMarketStorageDeal), arg0, arg1, arg2)
}
-// StateMinerActiveSectors mocks base method
+// StateMinerActiveSectors mocks base method.
func (m *MockFullNode) StateMinerActiveSectors(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerActiveSectors", arg0, arg1, arg2)
@@ -2238,13 +2329,13 @@ func (m *MockFullNode) StateMinerActiveSectors(arg0 context.Context, arg1 addres
return ret0, ret1
}
-// StateMinerActiveSectors indicates an expected call of StateMinerActiveSectors
+// StateMinerActiveSectors indicates an expected call of StateMinerActiveSectors.
func (mr *MockFullNodeMockRecorder) StateMinerActiveSectors(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerActiveSectors", reflect.TypeOf((*MockFullNode)(nil).StateMinerActiveSectors), arg0, arg1, arg2)
}
-// StateMinerAvailableBalance mocks base method
+// StateMinerAvailableBalance mocks base method.
func (m *MockFullNode) StateMinerAvailableBalance(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerAvailableBalance", arg0, arg1, arg2)
@@ -2253,13 +2344,13 @@ func (m *MockFullNode) StateMinerAvailableBalance(arg0 context.Context, arg1 add
return ret0, ret1
}
-// StateMinerAvailableBalance indicates an expected call of StateMinerAvailableBalance
+// StateMinerAvailableBalance indicates an expected call of StateMinerAvailableBalance.
func (mr *MockFullNodeMockRecorder) StateMinerAvailableBalance(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerAvailableBalance", reflect.TypeOf((*MockFullNode)(nil).StateMinerAvailableBalance), arg0, arg1, arg2)
}
-// StateMinerDeadlines mocks base method
+// StateMinerDeadlines mocks base method.
func (m *MockFullNode) StateMinerDeadlines(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) ([]api.Deadline, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerDeadlines", arg0, arg1, arg2)
@@ -2268,13 +2359,13 @@ func (m *MockFullNode) StateMinerDeadlines(arg0 context.Context, arg1 address.Ad
return ret0, ret1
}
-// StateMinerDeadlines indicates an expected call of StateMinerDeadlines
+// StateMinerDeadlines indicates an expected call of StateMinerDeadlines.
func (mr *MockFullNodeMockRecorder) StateMinerDeadlines(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerDeadlines", reflect.TypeOf((*MockFullNode)(nil).StateMinerDeadlines), arg0, arg1, arg2)
}
-// StateMinerFaults mocks base method
+// StateMinerFaults mocks base method.
func (m *MockFullNode) StateMinerFaults(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (bitfield.BitField, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerFaults", arg0, arg1, arg2)
@@ -2283,13 +2374,13 @@ func (m *MockFullNode) StateMinerFaults(arg0 context.Context, arg1 address.Addre
return ret0, ret1
}
-// StateMinerFaults indicates an expected call of StateMinerFaults
+// StateMinerFaults indicates an expected call of StateMinerFaults.
func (mr *MockFullNodeMockRecorder) StateMinerFaults(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerFaults", reflect.TypeOf((*MockFullNode)(nil).StateMinerFaults), arg0, arg1, arg2)
}
-// StateMinerInfo mocks base method
+// StateMinerInfo mocks base method.
func (m *MockFullNode) StateMinerInfo(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (miner.MinerInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerInfo", arg0, arg1, arg2)
@@ -2298,13 +2389,13 @@ func (m *MockFullNode) StateMinerInfo(arg0 context.Context, arg1 address.Address
return ret0, ret1
}
-// StateMinerInfo indicates an expected call of StateMinerInfo
+// StateMinerInfo indicates an expected call of StateMinerInfo.
func (mr *MockFullNodeMockRecorder) StateMinerInfo(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerInfo", reflect.TypeOf((*MockFullNode)(nil).StateMinerInfo), arg0, arg1, arg2)
}
-// StateMinerInitialPledgeCollateral mocks base method
+// StateMinerInitialPledgeCollateral mocks base method.
func (m *MockFullNode) StateMinerInitialPledgeCollateral(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerInitialPledgeCollateral", arg0, arg1, arg2, arg3)
@@ -2313,13 +2404,13 @@ func (m *MockFullNode) StateMinerInitialPledgeCollateral(arg0 context.Context, a
return ret0, ret1
}
-// StateMinerInitialPledgeCollateral indicates an expected call of StateMinerInitialPledgeCollateral
+// StateMinerInitialPledgeCollateral indicates an expected call of StateMinerInitialPledgeCollateral.
func (mr *MockFullNodeMockRecorder) StateMinerInitialPledgeCollateral(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerInitialPledgeCollateral", reflect.TypeOf((*MockFullNode)(nil).StateMinerInitialPledgeCollateral), arg0, arg1, arg2, arg3)
}
-// StateMinerPartitions mocks base method
+// StateMinerPartitions mocks base method.
func (m *MockFullNode) StateMinerPartitions(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 types.TipSetKey) ([]api.Partition, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerPartitions", arg0, arg1, arg2, arg3)
@@ -2328,13 +2419,13 @@ func (m *MockFullNode) StateMinerPartitions(arg0 context.Context, arg1 address.A
return ret0, ret1
}
-// StateMinerPartitions indicates an expected call of StateMinerPartitions
+// StateMinerPartitions indicates an expected call of StateMinerPartitions.
func (mr *MockFullNodeMockRecorder) StateMinerPartitions(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerPartitions", reflect.TypeOf((*MockFullNode)(nil).StateMinerPartitions), arg0, arg1, arg2, arg3)
}
-// StateMinerPower mocks base method
+// StateMinerPower mocks base method.
func (m *MockFullNode) StateMinerPower(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*api.MinerPower, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerPower", arg0, arg1, arg2)
@@ -2343,13 +2434,13 @@ func (m *MockFullNode) StateMinerPower(arg0 context.Context, arg1 address.Addres
return ret0, ret1
}
-// StateMinerPower indicates an expected call of StateMinerPower
+// StateMinerPower indicates an expected call of StateMinerPower.
func (mr *MockFullNodeMockRecorder) StateMinerPower(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerPower", reflect.TypeOf((*MockFullNode)(nil).StateMinerPower), arg0, arg1, arg2)
}
-// StateMinerPreCommitDepositForPower mocks base method
+// StateMinerPreCommitDepositForPower mocks base method.
func (m *MockFullNode) StateMinerPreCommitDepositForPower(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerPreCommitDepositForPower", arg0, arg1, arg2, arg3)
@@ -2358,13 +2449,13 @@ func (m *MockFullNode) StateMinerPreCommitDepositForPower(arg0 context.Context,
return ret0, ret1
}
-// StateMinerPreCommitDepositForPower indicates an expected call of StateMinerPreCommitDepositForPower
+// StateMinerPreCommitDepositForPower indicates an expected call of StateMinerPreCommitDepositForPower.
func (mr *MockFullNodeMockRecorder) StateMinerPreCommitDepositForPower(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerPreCommitDepositForPower", reflect.TypeOf((*MockFullNode)(nil).StateMinerPreCommitDepositForPower), arg0, arg1, arg2, arg3)
}
-// StateMinerProvingDeadline mocks base method
+// StateMinerProvingDeadline mocks base method.
func (m *MockFullNode) StateMinerProvingDeadline(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*dline.Info, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerProvingDeadline", arg0, arg1, arg2)
@@ -2373,13 +2464,13 @@ func (m *MockFullNode) StateMinerProvingDeadline(arg0 context.Context, arg1 addr
return ret0, ret1
}
-// StateMinerProvingDeadline indicates an expected call of StateMinerProvingDeadline
+// StateMinerProvingDeadline indicates an expected call of StateMinerProvingDeadline.
func (mr *MockFullNodeMockRecorder) StateMinerProvingDeadline(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerProvingDeadline", reflect.TypeOf((*MockFullNode)(nil).StateMinerProvingDeadline), arg0, arg1, arg2)
}
-// StateMinerRecoveries mocks base method
+// StateMinerRecoveries mocks base method.
func (m *MockFullNode) StateMinerRecoveries(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (bitfield.BitField, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerRecoveries", arg0, arg1, arg2)
@@ -2388,13 +2479,13 @@ func (m *MockFullNode) StateMinerRecoveries(arg0 context.Context, arg1 address.A
return ret0, ret1
}
-// StateMinerRecoveries indicates an expected call of StateMinerRecoveries
+// StateMinerRecoveries indicates an expected call of StateMinerRecoveries.
func (mr *MockFullNodeMockRecorder) StateMinerRecoveries(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerRecoveries", reflect.TypeOf((*MockFullNode)(nil).StateMinerRecoveries), arg0, arg1, arg2)
}
-// StateMinerSectorAllocated mocks base method
+// StateMinerSectorAllocated mocks base method.
func (m *MockFullNode) StateMinerSectorAllocated(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerSectorAllocated", arg0, arg1, arg2, arg3)
@@ -2403,13 +2494,13 @@ func (m *MockFullNode) StateMinerSectorAllocated(arg0 context.Context, arg1 addr
return ret0, ret1
}
-// StateMinerSectorAllocated indicates an expected call of StateMinerSectorAllocated
+// StateMinerSectorAllocated indicates an expected call of StateMinerSectorAllocated.
func (mr *MockFullNodeMockRecorder) StateMinerSectorAllocated(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerSectorAllocated", reflect.TypeOf((*MockFullNode)(nil).StateMinerSectorAllocated), arg0, arg1, arg2, arg3)
}
-// StateMinerSectorCount mocks base method
+// StateMinerSectorCount mocks base method.
func (m *MockFullNode) StateMinerSectorCount(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MinerSectors, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerSectorCount", arg0, arg1, arg2)
@@ -2418,13 +2509,13 @@ func (m *MockFullNode) StateMinerSectorCount(arg0 context.Context, arg1 address.
return ret0, ret1
}
-// StateMinerSectorCount indicates an expected call of StateMinerSectorCount
+// StateMinerSectorCount indicates an expected call of StateMinerSectorCount.
func (mr *MockFullNodeMockRecorder) StateMinerSectorCount(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerSectorCount", reflect.TypeOf((*MockFullNode)(nil).StateMinerSectorCount), arg0, arg1, arg2)
}
-// StateMinerSectors mocks base method
+// StateMinerSectors mocks base method.
func (m *MockFullNode) StateMinerSectors(arg0 context.Context, arg1 address.Address, arg2 *bitfield.BitField, arg3 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateMinerSectors", arg0, arg1, arg2, arg3)
@@ -2433,13 +2524,13 @@ func (m *MockFullNode) StateMinerSectors(arg0 context.Context, arg1 address.Addr
return ret0, ret1
}
-// StateMinerSectors indicates an expected call of StateMinerSectors
+// StateMinerSectors indicates an expected call of StateMinerSectors.
func (mr *MockFullNodeMockRecorder) StateMinerSectors(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerSectors", reflect.TypeOf((*MockFullNode)(nil).StateMinerSectors), arg0, arg1, arg2, arg3)
}
-// StateNetworkName mocks base method
+// StateNetworkName mocks base method.
func (m *MockFullNode) StateNetworkName(arg0 context.Context) (dtypes.NetworkName, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateNetworkName", arg0)
@@ -2448,13 +2539,13 @@ func (m *MockFullNode) StateNetworkName(arg0 context.Context) (dtypes.NetworkNam
return ret0, ret1
}
-// StateNetworkName indicates an expected call of StateNetworkName
+// StateNetworkName indicates an expected call of StateNetworkName.
func (mr *MockFullNodeMockRecorder) StateNetworkName(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateNetworkName", reflect.TypeOf((*MockFullNode)(nil).StateNetworkName), arg0)
}
-// StateNetworkVersion mocks base method
+// StateNetworkVersion mocks base method.
func (m *MockFullNode) StateNetworkVersion(arg0 context.Context, arg1 types.TipSetKey) (network.Version, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateNetworkVersion", arg0, arg1)
@@ -2463,13 +2554,13 @@ func (m *MockFullNode) StateNetworkVersion(arg0 context.Context, arg1 types.TipS
return ret0, ret1
}
-// StateNetworkVersion indicates an expected call of StateNetworkVersion
+// StateNetworkVersion indicates an expected call of StateNetworkVersion.
func (mr *MockFullNodeMockRecorder) StateNetworkVersion(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateNetworkVersion", reflect.TypeOf((*MockFullNode)(nil).StateNetworkVersion), arg0, arg1)
}
-// StateReadState mocks base method
+// StateReadState mocks base method.
func (m *MockFullNode) StateReadState(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*api.ActorState, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateReadState", arg0, arg1, arg2)
@@ -2478,13 +2569,13 @@ func (m *MockFullNode) StateReadState(arg0 context.Context, arg1 address.Address
return ret0, ret1
}
-// StateReadState indicates an expected call of StateReadState
+// StateReadState indicates an expected call of StateReadState.
func (mr *MockFullNodeMockRecorder) StateReadState(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateReadState", reflect.TypeOf((*MockFullNode)(nil).StateReadState), arg0, arg1, arg2)
}
-// StateReplay mocks base method
+// StateReplay mocks base method.
func (m *MockFullNode) StateReplay(arg0 context.Context, arg1 types.TipSetKey, arg2 cid.Cid) (*api.InvocResult, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateReplay", arg0, arg1, arg2)
@@ -2493,43 +2584,28 @@ func (m *MockFullNode) StateReplay(arg0 context.Context, arg1 types.TipSetKey, a
return ret0, ret1
}
-// StateReplay indicates an expected call of StateReplay
+// StateReplay indicates an expected call of StateReplay.
func (mr *MockFullNodeMockRecorder) StateReplay(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateReplay", reflect.TypeOf((*MockFullNode)(nil).StateReplay), arg0, arg1, arg2)
}
-// StateSearchMsg mocks base method
-func (m *MockFullNode) StateSearchMsg(arg0 context.Context, arg1 cid.Cid) (*api.MsgLookup, error) {
+// StateSearchMsg mocks base method.
+func (m *MockFullNode) StateSearchMsg(arg0 context.Context, arg1 types.TipSetKey, arg2 cid.Cid, arg3 abi.ChainEpoch, arg4 bool) (*api.MsgLookup, error) {
m.ctrl.T.Helper()
- ret := m.ctrl.Call(m, "StateSearchMsg", arg0, arg1)
+ ret := m.ctrl.Call(m, "StateSearchMsg", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(*api.MsgLookup)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// StateSearchMsg indicates an expected call of StateSearchMsg
-func (mr *MockFullNodeMockRecorder) StateSearchMsg(arg0, arg1 interface{}) *gomock.Call {
+// StateSearchMsg indicates an expected call of StateSearchMsg.
+func (mr *MockFullNodeMockRecorder) StateSearchMsg(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSearchMsg", reflect.TypeOf((*MockFullNode)(nil).StateSearchMsg), arg0, arg1)
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSearchMsg", reflect.TypeOf((*MockFullNode)(nil).StateSearchMsg), arg0, arg1, arg2, arg3, arg4)
}
-// StateSearchMsgLimited mocks base method
-func (m *MockFullNode) StateSearchMsgLimited(arg0 context.Context, arg1 cid.Cid, arg2 abi.ChainEpoch) (*api.MsgLookup, error) {
- m.ctrl.T.Helper()
- ret := m.ctrl.Call(m, "StateSearchMsgLimited", arg0, arg1, arg2)
- ret0, _ := ret[0].(*api.MsgLookup)
- ret1, _ := ret[1].(error)
- return ret0, ret1
-}
-
-// StateSearchMsgLimited indicates an expected call of StateSearchMsgLimited
-func (mr *MockFullNodeMockRecorder) StateSearchMsgLimited(arg0, arg1, arg2 interface{}) *gomock.Call {
- mr.mock.ctrl.T.Helper()
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSearchMsgLimited", reflect.TypeOf((*MockFullNode)(nil).StateSearchMsgLimited), arg0, arg1, arg2)
-}
-
-// StateSectorExpiration mocks base method
+// StateSectorExpiration mocks base method.
func (m *MockFullNode) StateSectorExpiration(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorExpiration, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateSectorExpiration", arg0, arg1, arg2, arg3)
@@ -2538,13 +2614,13 @@ func (m *MockFullNode) StateSectorExpiration(arg0 context.Context, arg1 address.
return ret0, ret1
}
-// StateSectorExpiration indicates an expected call of StateSectorExpiration
+// StateSectorExpiration indicates an expected call of StateSectorExpiration.
func (mr *MockFullNodeMockRecorder) StateSectorExpiration(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSectorExpiration", reflect.TypeOf((*MockFullNode)(nil).StateSectorExpiration), arg0, arg1, arg2, arg3)
}
-// StateSectorGetInfo mocks base method
+// StateSectorGetInfo mocks base method.
func (m *MockFullNode) StateSectorGetInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateSectorGetInfo", arg0, arg1, arg2, arg3)
@@ -2553,13 +2629,13 @@ func (m *MockFullNode) StateSectorGetInfo(arg0 context.Context, arg1 address.Add
return ret0, ret1
}
-// StateSectorGetInfo indicates an expected call of StateSectorGetInfo
+// StateSectorGetInfo indicates an expected call of StateSectorGetInfo.
func (mr *MockFullNodeMockRecorder) StateSectorGetInfo(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSectorGetInfo", reflect.TypeOf((*MockFullNode)(nil).StateSectorGetInfo), arg0, arg1, arg2, arg3)
}
-// StateSectorPartition mocks base method
+// StateSectorPartition mocks base method.
func (m *MockFullNode) StateSectorPartition(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorLocation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateSectorPartition", arg0, arg1, arg2, arg3)
@@ -2568,13 +2644,13 @@ func (m *MockFullNode) StateSectorPartition(arg0 context.Context, arg1 address.A
return ret0, ret1
}
-// StateSectorPartition indicates an expected call of StateSectorPartition
+// StateSectorPartition indicates an expected call of StateSectorPartition.
func (mr *MockFullNodeMockRecorder) StateSectorPartition(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSectorPartition", reflect.TypeOf((*MockFullNode)(nil).StateSectorPartition), arg0, arg1, arg2, arg3)
}
-// StateSectorPreCommitInfo mocks base method
+// StateSectorPreCommitInfo mocks base method.
func (m *MockFullNode) StateSectorPreCommitInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateSectorPreCommitInfo", arg0, arg1, arg2, arg3)
@@ -2583,13 +2659,13 @@ func (m *MockFullNode) StateSectorPreCommitInfo(arg0 context.Context, arg1 addre
return ret0, ret1
}
-// StateSectorPreCommitInfo indicates an expected call of StateSectorPreCommitInfo
+// StateSectorPreCommitInfo indicates an expected call of StateSectorPreCommitInfo.
func (mr *MockFullNodeMockRecorder) StateSectorPreCommitInfo(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSectorPreCommitInfo", reflect.TypeOf((*MockFullNode)(nil).StateSectorPreCommitInfo), arg0, arg1, arg2, arg3)
}
-// StateVMCirculatingSupplyInternal mocks base method
+// StateVMCirculatingSupplyInternal mocks base method.
func (m *MockFullNode) StateVMCirculatingSupplyInternal(arg0 context.Context, arg1 types.TipSetKey) (api.CirculatingSupply, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateVMCirculatingSupplyInternal", arg0, arg1)
@@ -2598,13 +2674,13 @@ func (m *MockFullNode) StateVMCirculatingSupplyInternal(arg0 context.Context, ar
return ret0, ret1
}
-// StateVMCirculatingSupplyInternal indicates an expected call of StateVMCirculatingSupplyInternal
+// StateVMCirculatingSupplyInternal indicates an expected call of StateVMCirculatingSupplyInternal.
func (mr *MockFullNodeMockRecorder) StateVMCirculatingSupplyInternal(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVMCirculatingSupplyInternal", reflect.TypeOf((*MockFullNode)(nil).StateVMCirculatingSupplyInternal), arg0, arg1)
}
-// StateVerifiedClientStatus mocks base method
+// StateVerifiedClientStatus mocks base method.
func (m *MockFullNode) StateVerifiedClientStatus(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateVerifiedClientStatus", arg0, arg1, arg2)
@@ -2613,13 +2689,13 @@ func (m *MockFullNode) StateVerifiedClientStatus(arg0 context.Context, arg1 addr
return ret0, ret1
}
-// StateVerifiedClientStatus indicates an expected call of StateVerifiedClientStatus
+// StateVerifiedClientStatus indicates an expected call of StateVerifiedClientStatus.
func (mr *MockFullNodeMockRecorder) StateVerifiedClientStatus(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVerifiedClientStatus", reflect.TypeOf((*MockFullNode)(nil).StateVerifiedClientStatus), arg0, arg1, arg2)
}
-// StateVerifiedRegistryRootKey mocks base method
+// StateVerifiedRegistryRootKey mocks base method.
func (m *MockFullNode) StateVerifiedRegistryRootKey(arg0 context.Context, arg1 types.TipSetKey) (address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateVerifiedRegistryRootKey", arg0, arg1)
@@ -2628,13 +2704,13 @@ func (m *MockFullNode) StateVerifiedRegistryRootKey(arg0 context.Context, arg1 t
return ret0, ret1
}
-// StateVerifiedRegistryRootKey indicates an expected call of StateVerifiedRegistryRootKey
+// StateVerifiedRegistryRootKey indicates an expected call of StateVerifiedRegistryRootKey.
func (mr *MockFullNodeMockRecorder) StateVerifiedRegistryRootKey(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVerifiedRegistryRootKey", reflect.TypeOf((*MockFullNode)(nil).StateVerifiedRegistryRootKey), arg0, arg1)
}
-// StateVerifierStatus mocks base method
+// StateVerifierStatus mocks base method.
func (m *MockFullNode) StateVerifierStatus(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StateVerifierStatus", arg0, arg1, arg2)
@@ -2643,43 +2719,28 @@ func (m *MockFullNode) StateVerifierStatus(arg0 context.Context, arg1 address.Ad
return ret0, ret1
}
-// StateVerifierStatus indicates an expected call of StateVerifierStatus
+// StateVerifierStatus indicates an expected call of StateVerifierStatus.
func (mr *MockFullNodeMockRecorder) StateVerifierStatus(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVerifierStatus", reflect.TypeOf((*MockFullNode)(nil).StateVerifierStatus), arg0, arg1, arg2)
}
-// StateWaitMsg mocks base method
-func (m *MockFullNode) StateWaitMsg(arg0 context.Context, arg1 cid.Cid, arg2 uint64) (*api.MsgLookup, error) {
+// StateWaitMsg mocks base method.
+func (m *MockFullNode) StateWaitMsg(arg0 context.Context, arg1 cid.Cid, arg2 uint64, arg3 abi.ChainEpoch, arg4 bool) (*api.MsgLookup, error) {
m.ctrl.T.Helper()
- ret := m.ctrl.Call(m, "StateWaitMsg", arg0, arg1, arg2)
+ ret := m.ctrl.Call(m, "StateWaitMsg", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(*api.MsgLookup)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// StateWaitMsg indicates an expected call of StateWaitMsg
-func (mr *MockFullNodeMockRecorder) StateWaitMsg(arg0, arg1, arg2 interface{}) *gomock.Call {
+// StateWaitMsg indicates an expected call of StateWaitMsg.
+func (mr *MockFullNodeMockRecorder) StateWaitMsg(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateWaitMsg", reflect.TypeOf((*MockFullNode)(nil).StateWaitMsg), arg0, arg1, arg2)
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateWaitMsg", reflect.TypeOf((*MockFullNode)(nil).StateWaitMsg), arg0, arg1, arg2, arg3, arg4)
}
-// StateWaitMsgLimited mocks base method
-func (m *MockFullNode) StateWaitMsgLimited(arg0 context.Context, arg1 cid.Cid, arg2 uint64, arg3 abi.ChainEpoch) (*api.MsgLookup, error) {
- m.ctrl.T.Helper()
- ret := m.ctrl.Call(m, "StateWaitMsgLimited", arg0, arg1, arg2, arg3)
- ret0, _ := ret[0].(*api.MsgLookup)
- ret1, _ := ret[1].(error)
- return ret0, ret1
-}
-
-// StateWaitMsgLimited indicates an expected call of StateWaitMsgLimited
-func (mr *MockFullNodeMockRecorder) StateWaitMsgLimited(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
- mr.mock.ctrl.T.Helper()
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateWaitMsgLimited", reflect.TypeOf((*MockFullNode)(nil).StateWaitMsgLimited), arg0, arg1, arg2, arg3)
-}
-
-// SyncCheckBad mocks base method
+// SyncCheckBad mocks base method.
func (m *MockFullNode) SyncCheckBad(arg0 context.Context, arg1 cid.Cid) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncCheckBad", arg0, arg1)
@@ -2688,13 +2749,13 @@ func (m *MockFullNode) SyncCheckBad(arg0 context.Context, arg1 cid.Cid) (string,
return ret0, ret1
}
-// SyncCheckBad indicates an expected call of SyncCheckBad
+// SyncCheckBad indicates an expected call of SyncCheckBad.
func (mr *MockFullNodeMockRecorder) SyncCheckBad(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCheckBad", reflect.TypeOf((*MockFullNode)(nil).SyncCheckBad), arg0, arg1)
}
-// SyncCheckpoint mocks base method
+// SyncCheckpoint mocks base method.
func (m *MockFullNode) SyncCheckpoint(arg0 context.Context, arg1 types.TipSetKey) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncCheckpoint", arg0, arg1)
@@ -2702,13 +2763,13 @@ func (m *MockFullNode) SyncCheckpoint(arg0 context.Context, arg1 types.TipSetKey
return ret0
}
-// SyncCheckpoint indicates an expected call of SyncCheckpoint
+// SyncCheckpoint indicates an expected call of SyncCheckpoint.
func (mr *MockFullNodeMockRecorder) SyncCheckpoint(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCheckpoint", reflect.TypeOf((*MockFullNode)(nil).SyncCheckpoint), arg0, arg1)
}
-// SyncIncomingBlocks mocks base method
+// SyncIncomingBlocks mocks base method.
func (m *MockFullNode) SyncIncomingBlocks(arg0 context.Context) (<-chan *types.BlockHeader, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncIncomingBlocks", arg0)
@@ -2717,13 +2778,13 @@ func (m *MockFullNode) SyncIncomingBlocks(arg0 context.Context) (<-chan *types.B
return ret0, ret1
}
-// SyncIncomingBlocks indicates an expected call of SyncIncomingBlocks
+// SyncIncomingBlocks indicates an expected call of SyncIncomingBlocks.
func (mr *MockFullNodeMockRecorder) SyncIncomingBlocks(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncIncomingBlocks", reflect.TypeOf((*MockFullNode)(nil).SyncIncomingBlocks), arg0)
}
-// SyncMarkBad mocks base method
+// SyncMarkBad mocks base method.
func (m *MockFullNode) SyncMarkBad(arg0 context.Context, arg1 cid.Cid) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncMarkBad", arg0, arg1)
@@ -2731,13 +2792,13 @@ func (m *MockFullNode) SyncMarkBad(arg0 context.Context, arg1 cid.Cid) error {
return ret0
}
-// SyncMarkBad indicates an expected call of SyncMarkBad
+// SyncMarkBad indicates an expected call of SyncMarkBad.
func (mr *MockFullNodeMockRecorder) SyncMarkBad(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMarkBad", reflect.TypeOf((*MockFullNode)(nil).SyncMarkBad), arg0, arg1)
}
-// SyncState mocks base method
+// SyncState mocks base method.
func (m *MockFullNode) SyncState(arg0 context.Context) (*api.SyncState, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncState", arg0)
@@ -2746,13 +2807,13 @@ func (m *MockFullNode) SyncState(arg0 context.Context) (*api.SyncState, error) {
return ret0, ret1
}
-// SyncState indicates an expected call of SyncState
+// SyncState indicates an expected call of SyncState.
func (mr *MockFullNodeMockRecorder) SyncState(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncState", reflect.TypeOf((*MockFullNode)(nil).SyncState), arg0)
}
-// SyncSubmitBlock mocks base method
+// SyncSubmitBlock mocks base method.
func (m *MockFullNode) SyncSubmitBlock(arg0 context.Context, arg1 *types.BlockMsg) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncSubmitBlock", arg0, arg1)
@@ -2760,13 +2821,13 @@ func (m *MockFullNode) SyncSubmitBlock(arg0 context.Context, arg1 *types.BlockMs
return ret0
}
-// SyncSubmitBlock indicates an expected call of SyncSubmitBlock
+// SyncSubmitBlock indicates an expected call of SyncSubmitBlock.
func (mr *MockFullNodeMockRecorder) SyncSubmitBlock(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubmitBlock", reflect.TypeOf((*MockFullNode)(nil).SyncSubmitBlock), arg0, arg1)
}
-// SyncUnmarkAllBad mocks base method
+// SyncUnmarkAllBad mocks base method.
func (m *MockFullNode) SyncUnmarkAllBad(arg0 context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncUnmarkAllBad", arg0)
@@ -2774,13 +2835,13 @@ func (m *MockFullNode) SyncUnmarkAllBad(arg0 context.Context) error {
return ret0
}
-// SyncUnmarkAllBad indicates an expected call of SyncUnmarkAllBad
+// SyncUnmarkAllBad indicates an expected call of SyncUnmarkAllBad.
func (mr *MockFullNodeMockRecorder) SyncUnmarkAllBad(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncUnmarkAllBad", reflect.TypeOf((*MockFullNode)(nil).SyncUnmarkAllBad), arg0)
}
-// SyncUnmarkBad mocks base method
+// SyncUnmarkBad mocks base method.
func (m *MockFullNode) SyncUnmarkBad(arg0 context.Context, arg1 cid.Cid) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncUnmarkBad", arg0, arg1)
@@ -2788,13 +2849,13 @@ func (m *MockFullNode) SyncUnmarkBad(arg0 context.Context, arg1 cid.Cid) error {
return ret0
}
-// SyncUnmarkBad indicates an expected call of SyncUnmarkBad
+// SyncUnmarkBad indicates an expected call of SyncUnmarkBad.
func (mr *MockFullNodeMockRecorder) SyncUnmarkBad(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncUnmarkBad", reflect.TypeOf((*MockFullNode)(nil).SyncUnmarkBad), arg0, arg1)
}
-// SyncValidateTipset mocks base method
+// SyncValidateTipset mocks base method.
func (m *MockFullNode) SyncValidateTipset(arg0 context.Context, arg1 types.TipSetKey) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncValidateTipset", arg0, arg1)
@@ -2803,13 +2864,13 @@ func (m *MockFullNode) SyncValidateTipset(arg0 context.Context, arg1 types.TipSe
return ret0, ret1
}
-// SyncValidateTipset indicates an expected call of SyncValidateTipset
+// SyncValidateTipset indicates an expected call of SyncValidateTipset.
func (mr *MockFullNodeMockRecorder) SyncValidateTipset(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncValidateTipset", reflect.TypeOf((*MockFullNode)(nil).SyncValidateTipset), arg0, arg1)
}
-// Version mocks base method
+// Version mocks base method.
func (m *MockFullNode) Version(arg0 context.Context) (api.APIVersion, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Version", arg0)
@@ -2818,13 +2879,13 @@ func (m *MockFullNode) Version(arg0 context.Context) (api.APIVersion, error) {
return ret0, ret1
}
-// Version indicates an expected call of Version
+// Version indicates an expected call of Version.
func (mr *MockFullNodeMockRecorder) Version(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockFullNode)(nil).Version), arg0)
}
-// WalletBalance mocks base method
+// WalletBalance mocks base method.
func (m *MockFullNode) WalletBalance(arg0 context.Context, arg1 address.Address) (big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletBalance", arg0, arg1)
@@ -2833,13 +2894,13 @@ func (m *MockFullNode) WalletBalance(arg0 context.Context, arg1 address.Address)
return ret0, ret1
}
-// WalletBalance indicates an expected call of WalletBalance
+// WalletBalance indicates an expected call of WalletBalance.
func (mr *MockFullNodeMockRecorder) WalletBalance(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletBalance", reflect.TypeOf((*MockFullNode)(nil).WalletBalance), arg0, arg1)
}
-// WalletDefaultAddress mocks base method
+// WalletDefaultAddress mocks base method.
func (m *MockFullNode) WalletDefaultAddress(arg0 context.Context) (address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletDefaultAddress", arg0)
@@ -2848,13 +2909,13 @@ func (m *MockFullNode) WalletDefaultAddress(arg0 context.Context) (address.Addre
return ret0, ret1
}
-// WalletDefaultAddress indicates an expected call of WalletDefaultAddress
+// WalletDefaultAddress indicates an expected call of WalletDefaultAddress.
func (mr *MockFullNodeMockRecorder) WalletDefaultAddress(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletDefaultAddress", reflect.TypeOf((*MockFullNode)(nil).WalletDefaultAddress), arg0)
}
-// WalletDelete mocks base method
+// WalletDelete mocks base method.
func (m *MockFullNode) WalletDelete(arg0 context.Context, arg1 address.Address) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletDelete", arg0, arg1)
@@ -2862,13 +2923,13 @@ func (m *MockFullNode) WalletDelete(arg0 context.Context, arg1 address.Address)
return ret0
}
-// WalletDelete indicates an expected call of WalletDelete
+// WalletDelete indicates an expected call of WalletDelete.
func (mr *MockFullNodeMockRecorder) WalletDelete(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletDelete", reflect.TypeOf((*MockFullNode)(nil).WalletDelete), arg0, arg1)
}
-// WalletExport mocks base method
+// WalletExport mocks base method.
func (m *MockFullNode) WalletExport(arg0 context.Context, arg1 address.Address) (*types.KeyInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletExport", arg0, arg1)
@@ -2877,13 +2938,13 @@ func (m *MockFullNode) WalletExport(arg0 context.Context, arg1 address.Address)
return ret0, ret1
}
-// WalletExport indicates an expected call of WalletExport
+// WalletExport indicates an expected call of WalletExport.
func (mr *MockFullNodeMockRecorder) WalletExport(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletExport", reflect.TypeOf((*MockFullNode)(nil).WalletExport), arg0, arg1)
}
-// WalletHas mocks base method
+// WalletHas mocks base method.
func (m *MockFullNode) WalletHas(arg0 context.Context, arg1 address.Address) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletHas", arg0, arg1)
@@ -2892,13 +2953,13 @@ func (m *MockFullNode) WalletHas(arg0 context.Context, arg1 address.Address) (bo
return ret0, ret1
}
-// WalletHas indicates an expected call of WalletHas
+// WalletHas indicates an expected call of WalletHas.
func (mr *MockFullNodeMockRecorder) WalletHas(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletHas", reflect.TypeOf((*MockFullNode)(nil).WalletHas), arg0, arg1)
}
-// WalletImport mocks base method
+// WalletImport mocks base method.
func (m *MockFullNode) WalletImport(arg0 context.Context, arg1 *types.KeyInfo) (address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletImport", arg0, arg1)
@@ -2907,13 +2968,13 @@ func (m *MockFullNode) WalletImport(arg0 context.Context, arg1 *types.KeyInfo) (
return ret0, ret1
}
-// WalletImport indicates an expected call of WalletImport
+// WalletImport indicates an expected call of WalletImport.
func (mr *MockFullNodeMockRecorder) WalletImport(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletImport", reflect.TypeOf((*MockFullNode)(nil).WalletImport), arg0, arg1)
}
-// WalletList mocks base method
+// WalletList mocks base method.
func (m *MockFullNode) WalletList(arg0 context.Context) ([]address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletList", arg0)
@@ -2922,13 +2983,13 @@ func (m *MockFullNode) WalletList(arg0 context.Context) ([]address.Address, erro
return ret0, ret1
}
-// WalletList indicates an expected call of WalletList
+// WalletList indicates an expected call of WalletList.
func (mr *MockFullNodeMockRecorder) WalletList(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletList", reflect.TypeOf((*MockFullNode)(nil).WalletList), arg0)
}
-// WalletNew mocks base method
+// WalletNew mocks base method.
func (m *MockFullNode) WalletNew(arg0 context.Context, arg1 types.KeyType) (address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletNew", arg0, arg1)
@@ -2937,13 +2998,13 @@ func (m *MockFullNode) WalletNew(arg0 context.Context, arg1 types.KeyType) (addr
return ret0, ret1
}
-// WalletNew indicates an expected call of WalletNew
+// WalletNew indicates an expected call of WalletNew.
func (mr *MockFullNodeMockRecorder) WalletNew(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletNew", reflect.TypeOf((*MockFullNode)(nil).WalletNew), arg0, arg1)
}
-// WalletSetDefault mocks base method
+// WalletSetDefault mocks base method.
func (m *MockFullNode) WalletSetDefault(arg0 context.Context, arg1 address.Address) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletSetDefault", arg0, arg1)
@@ -2951,13 +3012,13 @@ func (m *MockFullNode) WalletSetDefault(arg0 context.Context, arg1 address.Addre
return ret0
}
-// WalletSetDefault indicates an expected call of WalletSetDefault
+// WalletSetDefault indicates an expected call of WalletSetDefault.
func (mr *MockFullNodeMockRecorder) WalletSetDefault(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletSetDefault", reflect.TypeOf((*MockFullNode)(nil).WalletSetDefault), arg0, arg1)
}
-// WalletSign mocks base method
+// WalletSign mocks base method.
func (m *MockFullNode) WalletSign(arg0 context.Context, arg1 address.Address, arg2 []byte) (*crypto.Signature, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletSign", arg0, arg1, arg2)
@@ -2966,13 +3027,13 @@ func (m *MockFullNode) WalletSign(arg0 context.Context, arg1 address.Address, ar
return ret0, ret1
}
-// WalletSign indicates an expected call of WalletSign
+// WalletSign indicates an expected call of WalletSign.
func (mr *MockFullNodeMockRecorder) WalletSign(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletSign", reflect.TypeOf((*MockFullNode)(nil).WalletSign), arg0, arg1, arg2)
}
-// WalletSignMessage mocks base method
+// WalletSignMessage mocks base method.
func (m *MockFullNode) WalletSignMessage(arg0 context.Context, arg1 address.Address, arg2 *types.Message) (*types.SignedMessage, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletSignMessage", arg0, arg1, arg2)
@@ -2981,13 +3042,13 @@ func (m *MockFullNode) WalletSignMessage(arg0 context.Context, arg1 address.Addr
return ret0, ret1
}
-// WalletSignMessage indicates an expected call of WalletSignMessage
+// WalletSignMessage indicates an expected call of WalletSignMessage.
func (mr *MockFullNodeMockRecorder) WalletSignMessage(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletSignMessage", reflect.TypeOf((*MockFullNode)(nil).WalletSignMessage), arg0, arg1, arg2)
}
-// WalletValidateAddress mocks base method
+// WalletValidateAddress mocks base method.
func (m *MockFullNode) WalletValidateAddress(arg0 context.Context, arg1 string) (address.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletValidateAddress", arg0, arg1)
@@ -2996,13 +3057,13 @@ func (m *MockFullNode) WalletValidateAddress(arg0 context.Context, arg1 string)
return ret0, ret1
}
-// WalletValidateAddress indicates an expected call of WalletValidateAddress
+// WalletValidateAddress indicates an expected call of WalletValidateAddress.
func (mr *MockFullNodeMockRecorder) WalletValidateAddress(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletValidateAddress", reflect.TypeOf((*MockFullNode)(nil).WalletValidateAddress), arg0, arg1)
}
-// WalletVerify mocks base method
+// WalletVerify mocks base method.
func (m *MockFullNode) WalletVerify(arg0 context.Context, arg1 address.Address, arg2 []byte, arg3 *crypto.Signature) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WalletVerify", arg0, arg1, arg2, arg3)
@@ -3011,7 +3072,7 @@ func (m *MockFullNode) WalletVerify(arg0 context.Context, arg1 address.Address,
return ret0, ret1
}
-// WalletVerify indicates an expected call of WalletVerify
+// WalletVerify indicates an expected call of WalletVerify.
func (mr *MockFullNodeMockRecorder) WalletVerify(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletVerify", reflect.TypeOf((*MockFullNode)(nil).WalletVerify), arg0, arg1, arg2, arg3)
diff --git a/api/apistruct/permissioned.go b/api/permissioned.go
similarity index 78%
rename from api/apistruct/permissioned.go
rename to api/permissioned.go
index 23259fa87..d99e5943b 100644
--- a/api/apistruct/permissioned.go
+++ b/api/permissioned.go
@@ -1,8 +1,7 @@
-package apistruct
+package api
import (
"github.com/filecoin-project/go-jsonrpc/auth"
- "github.com/filecoin-project/lotus/api"
)
const (
@@ -17,27 +16,27 @@ const (
var AllPermissions = []auth.Permission{PermRead, PermWrite, PermSign, PermAdmin}
var DefaultPerms = []auth.Permission{PermRead}
-func PermissionedStorMinerAPI(a api.StorageMiner) api.StorageMiner {
+func PermissionedStorMinerAPI(a StorageMiner) StorageMiner {
var out StorageMinerStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.CommonStruct.Internal)
return &out
}
-func PermissionedFullAPI(a api.FullNode) api.FullNode {
+func PermissionedFullAPI(a FullNode) FullNode {
var out FullNodeStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.CommonStruct.Internal)
return &out
}
-func PermissionedWorkerAPI(a api.Worker) api.Worker {
+func PermissionedWorkerAPI(a Worker) Worker {
var out WorkerStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
return &out
}
-func PermissionedWalletAPI(a api.Wallet) api.Wallet {
+func PermissionedWalletAPI(a Wallet) Wallet {
var out WalletStruct
auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal)
return &out
diff --git a/api/proxy_gen.go b/api/proxy_gen.go
new file mode 100644
index 000000000..6540ae7cd
--- /dev/null
+++ b/api/proxy_gen.go
@@ -0,0 +1,3681 @@
+// Code generated by github.com/filecoin-project/lotus/gen/api. DO NOT EDIT.
+
+package api
+
+import (
+ "context"
+ "time"
+
+ "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-multistore"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/crypto"
+ "github.com/filecoin-project/go-state-types/dline"
+ apitypes "github.com/filecoin-project/lotus/api/types"
+ "github.com/filecoin-project/lotus/chain/actors/builtin"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/paych"
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
+ "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
+ "github.com/filecoin-project/lotus/extern/sector-storage/stores"
+ "github.com/filecoin-project/lotus/extern/sector-storage/storiface"
+ "github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
+ marketevents "github.com/filecoin-project/lotus/markets/loggers"
+ "github.com/filecoin-project/lotus/node/modules/dtypes"
+ "github.com/filecoin-project/specs-storage/storage"
+ "github.com/google/uuid"
+ "github.com/ipfs/go-cid"
+ metrics "github.com/libp2p/go-libp2p-core/metrics"
+ "github.com/libp2p/go-libp2p-core/network"
+ "github.com/libp2p/go-libp2p-core/peer"
+ protocol "github.com/libp2p/go-libp2p-core/protocol"
+ xerrors "golang.org/x/xerrors"
+)
+
+type ChainIOStruct struct {
+ Internal struct {
+ ChainHasObj func(p0 context.Context, p1 cid.Cid) (bool, error) ``
+
+ ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) ``
+ }
+}
+
+type ChainIOStub struct {
+}
+
+type CommonStruct struct {
+ Internal struct {
+ AuthNew func(p0 context.Context, p1 []auth.Permission) ([]byte, error) `perm:"admin"`
+
+ AuthVerify func(p0 context.Context, p1 string) ([]auth.Permission, error) `perm:"read"`
+
+ Closing func(p0 context.Context) (<-chan struct{}, error) `perm:"read"`
+
+ Discover func(p0 context.Context) (apitypes.OpenRPCDocument, error) `perm:"read"`
+
+ ID func(p0 context.Context) (peer.ID, error) `perm:"read"`
+
+ LogList func(p0 context.Context) ([]string, error) `perm:"write"`
+
+ LogSetLevel func(p0 context.Context, p1 string, p2 string) error `perm:"write"`
+
+ NetAddrsListen func(p0 context.Context) (peer.AddrInfo, error) `perm:"read"`
+
+ NetAgentVersion func(p0 context.Context, p1 peer.ID) (string, error) `perm:"read"`
+
+ NetAutoNatStatus func(p0 context.Context) (NatInfo, error) `perm:"read"`
+
+ NetBandwidthStats func(p0 context.Context) (metrics.Stats, error) `perm:"read"`
+
+ NetBandwidthStatsByPeer func(p0 context.Context) (map[string]metrics.Stats, error) `perm:"read"`
+
+ NetBandwidthStatsByProtocol func(p0 context.Context) (map[protocol.ID]metrics.Stats, error) `perm:"read"`
+
+ NetBlockAdd func(p0 context.Context, p1 NetBlockList) error `perm:"admin"`
+
+ NetBlockList func(p0 context.Context) (NetBlockList, error) `perm:"read"`
+
+ NetBlockRemove func(p0 context.Context, p1 NetBlockList) error `perm:"admin"`
+
+ NetConnect func(p0 context.Context, p1 peer.AddrInfo) error `perm:"write"`
+
+ NetConnectedness func(p0 context.Context, p1 peer.ID) (network.Connectedness, error) `perm:"read"`
+
+ NetDisconnect func(p0 context.Context, p1 peer.ID) error `perm:"write"`
+
+ NetFindPeer func(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) `perm:"read"`
+
+ NetPeerInfo func(p0 context.Context, p1 peer.ID) (*ExtendedPeerInfo, error) `perm:"read"`
+
+ NetPeers func(p0 context.Context) ([]peer.AddrInfo, error) `perm:"read"`
+
+ NetPubsubScores func(p0 context.Context) ([]PubsubScore, error) `perm:"read"`
+
+ Session func(p0 context.Context) (uuid.UUID, error) `perm:"read"`
+
+ Shutdown func(p0 context.Context) error `perm:"admin"`
+
+ Version func(p0 context.Context) (APIVersion, error) `perm:"read"`
+ }
+}
+
+type CommonStub struct {
+}
+
+type FullNodeStruct struct {
+ CommonStruct
+
+ Internal struct {
+ BeaconGetEntry func(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) `perm:"read"`
+
+ ChainDeleteObj func(p0 context.Context, p1 cid.Cid) error `perm:"admin"`
+
+ ChainExport func(p0 context.Context, p1 abi.ChainEpoch, p2 bool, p3 types.TipSetKey) (<-chan []byte, error) `perm:"read"`
+
+ ChainGetBlock func(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) `perm:"read"`
+
+ ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) `perm:"read"`
+
+ ChainGetGenesis func(p0 context.Context) (*types.TipSet, error) `perm:"read"`
+
+ ChainGetMessage func(p0 context.Context, p1 cid.Cid) (*types.Message, error) `perm:"read"`
+
+ ChainGetNode func(p0 context.Context, p1 string) (*IpldObject, error) `perm:"read"`
+
+ ChainGetParentMessages func(p0 context.Context, p1 cid.Cid) ([]Message, error) `perm:"read"`
+
+ ChainGetParentReceipts func(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) `perm:"read"`
+
+ ChainGetPath func(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*HeadChange, error) `perm:"read"`
+
+ ChainGetRandomnessFromBeacon func(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) `perm:"read"`
+
+ ChainGetRandomnessFromTickets func(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) `perm:"read"`
+
+ ChainGetTipSet func(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) `perm:"read"`
+
+ ChainGetTipSetByHeight func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) `perm:"read"`
+
+ ChainHasObj func(p0 context.Context, p1 cid.Cid) (bool, error) `perm:"read"`
+
+ ChainHead func(p0 context.Context) (*types.TipSet, error) `perm:"read"`
+
+ ChainNotify func(p0 context.Context) (<-chan []*HeadChange, error) `perm:"read"`
+
+ ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) `perm:"read"`
+
+ ChainSetHead func(p0 context.Context, p1 types.TipSetKey) error `perm:"admin"`
+
+ ChainStatObj func(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (ObjStat, error) `perm:"read"`
+
+ ChainTipSetWeight func(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) `perm:"read"`
+
+ ClientCalcCommP func(p0 context.Context, p1 string) (*CommPRet, error) `perm:"write"`
+
+ ClientCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
+
+ ClientCancelRetrievalDeal func(p0 context.Context, p1 retrievalmarket.DealID) error `perm:"write"`
+
+ ClientDataTransferUpdates func(p0 context.Context) (<-chan DataTransferChannel, error) `perm:"write"`
+
+ ClientDealPieceCID func(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) `perm:"read"`
+
+ ClientDealSize func(p0 context.Context, p1 cid.Cid) (DataSize, error) `perm:"read"`
+
+ ClientFindData func(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) `perm:"read"`
+
+ ClientGenCar func(p0 context.Context, p1 FileRef, p2 string) error `perm:"write"`
+
+ ClientGetDealInfo func(p0 context.Context, p1 cid.Cid) (*DealInfo, error) `perm:"read"`
+
+ ClientGetDealStatus func(p0 context.Context, p1 uint64) (string, error) `perm:"read"`
+
+ ClientGetDealUpdates func(p0 context.Context) (<-chan DealInfo, error) `perm:"write"`
+
+ ClientGetRetrievalUpdates func(p0 context.Context) (<-chan RetrievalInfo, error) `perm:"write"`
+
+ ClientHasLocal func(p0 context.Context, p1 cid.Cid) (bool, error) `perm:"write"`
+
+ ClientImport func(p0 context.Context, p1 FileRef) (*ImportRes, error) `perm:"admin"`
+
+ ClientListDataTransfers func(p0 context.Context) ([]DataTransferChannel, error) `perm:"write"`
+
+ ClientListDeals func(p0 context.Context) ([]DealInfo, error) `perm:"write"`
+
+ ClientListImports func(p0 context.Context) ([]Import, error) `perm:"write"`
+
+ ClientListRetrievals func(p0 context.Context) ([]RetrievalInfo, error) `perm:"write"`
+
+ ClientMinerQueryOffer func(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) `perm:"read"`
+
+ ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) `perm:"read"`
+
+ ClientRemoveImport func(p0 context.Context, p1 multistore.StoreID) error `perm:"admin"`
+
+ ClientRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
+
+ ClientRetrieve func(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) error `perm:"admin"`
+
+ ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"`
+
+ ClientRetrieveWithEvents func(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"`
+
+ ClientStartDeal func(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) `perm:"admin"`
+
+ ClientStatelessDeal func(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) `perm:"write"`
+
+ CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"`
+
+ GasEstimateFeeCap func(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"`
+
+ GasEstimateGasLimit func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (int64, error) `perm:"read"`
+
+ GasEstimateGasPremium func(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) `perm:"read"`
+
+ GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) `perm:"read"`
+
+ MarketAddBalance func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) `perm:"sign"`
+
+ MarketGetReserved func(p0 context.Context, p1 address.Address) (types.BigInt, error) `perm:"sign"`
+
+ MarketReleaseFunds func(p0 context.Context, p1 address.Address, p2 types.BigInt) error `perm:"sign"`
+
+ MarketReserveFunds func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) `perm:"sign"`
+
+ MarketWithdraw func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) `perm:"sign"`
+
+ MinerCreateBlock func(p0 context.Context, p1 *BlockTemplate) (*types.BlockMsg, error) `perm:"write"`
+
+ MinerGetBaseInfo func(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*MiningBaseInfo, error) `perm:"read"`
+
+ MpoolBatchPush func(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) `perm:"write"`
+
+ MpoolBatchPushMessage func(p0 context.Context, p1 []*types.Message, p2 *MessageSendSpec) ([]*types.SignedMessage, error) `perm:"sign"`
+
+ MpoolBatchPushUntrusted func(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) `perm:"write"`
+
+ MpoolCheckMessages func(p0 context.Context, p1 []*MessagePrototype) ([][]MessageCheckStatus, error) `perm:"read"`
+
+ MpoolCheckPendingMessages func(p0 context.Context, p1 address.Address) ([][]MessageCheckStatus, error) `perm:"read"`
+
+ MpoolCheckReplaceMessages func(p0 context.Context, p1 []*types.Message) ([][]MessageCheckStatus, error) `perm:"read"`
+
+ MpoolClear func(p0 context.Context, p1 bool) error `perm:"write"`
+
+ MpoolGetConfig func(p0 context.Context) (*types.MpoolConfig, error) `perm:"read"`
+
+ MpoolGetNonce func(p0 context.Context, p1 address.Address) (uint64, error) `perm:"read"`
+
+ MpoolPending func(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) `perm:"read"`
+
+ MpoolPush func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) `perm:"write"`
+
+ MpoolPushMessage func(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec) (*types.SignedMessage, error) `perm:"sign"`
+
+ MpoolPushUntrusted func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) `perm:"write"`
+
+ MpoolSelect func(p0 context.Context, p1 types.TipSetKey, p2 float64) ([]*types.SignedMessage, error) `perm:"read"`
+
+ MpoolSetConfig func(p0 context.Context, p1 *types.MpoolConfig) error `perm:"admin"`
+
+ MpoolSub func(p0 context.Context) (<-chan MpoolUpdate, error) `perm:"read"`
+
+ MsigAddApprove func(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 bool) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigAddCancel func(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 bool) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigAddPropose func(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigApprove func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigApproveTxnHash func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 address.Address, p5 types.BigInt, p6 address.Address, p7 uint64, p8 []byte) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigCancel func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigCreate func(p0 context.Context, p1 uint64, p2 []address.Address, p3 abi.ChainEpoch, p4 types.BigInt, p5 address.Address, p6 types.BigInt) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigGetAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) `perm:"read"`
+
+ MsigGetPending func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*MsigTransaction, error) `perm:"read"`
+
+ MsigGetVested func(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"`
+
+ MsigGetVestingSchedule func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MsigVesting, error) `perm:"read"`
+
+ MsigPropose func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 address.Address, p5 uint64, p6 []byte) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigRemoveSigner func(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigSwapApprove func(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 address.Address) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigSwapCancel func(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address) (*MessagePrototype, error) `perm:"sign"`
+
+ MsigSwapPropose func(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 address.Address) (*MessagePrototype, error) `perm:"sign"`
+
+ NodeStatus func(p0 context.Context, p1 bool) (NodeStatus, error) `perm:"read"`
+
+ PaychAllocateLane func(p0 context.Context, p1 address.Address) (uint64, error) `perm:"sign"`
+
+ PaychAvailableFunds func(p0 context.Context, p1 address.Address) (*ChannelAvailableFunds, error) `perm:"sign"`
+
+ PaychAvailableFundsByFromTo func(p0 context.Context, p1 address.Address, p2 address.Address) (*ChannelAvailableFunds, error) `perm:"sign"`
+
+ PaychCollect func(p0 context.Context, p1 address.Address) (cid.Cid, error) `perm:"sign"`
+
+ PaychGet func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*ChannelInfo, error) `perm:"sign"`
+
+ PaychGetWaitReady func(p0 context.Context, p1 cid.Cid) (address.Address, error) `perm:"sign"`
+
+ PaychList func(p0 context.Context) ([]address.Address, error) `perm:"read"`
+
+ PaychNewPayment func(p0 context.Context, p1 address.Address, p2 address.Address, p3 []VoucherSpec) (*PaymentInfo, error) `perm:"sign"`
+
+ PaychSettle func(p0 context.Context, p1 address.Address) (cid.Cid, error) `perm:"sign"`
+
+ PaychStatus func(p0 context.Context, p1 address.Address) (*PaychStatus, error) `perm:"read"`
+
+ PaychVoucherAdd func(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 types.BigInt) (types.BigInt, error) `perm:"write"`
+
+ PaychVoucherCheckSpendable func(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (bool, error) `perm:"read"`
+
+ PaychVoucherCheckValid func(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher) error `perm:"read"`
+
+ PaychVoucherCreate func(p0 context.Context, p1 address.Address, p2 types.BigInt, p3 uint64) (*VoucherCreateResult, error) `perm:"sign"`
+
+ PaychVoucherList func(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) `perm:"write"`
+
+ PaychVoucherSubmit func(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (cid.Cid, error) `perm:"sign"`
+
+ StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, 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"`
+
+ StateChangedActors func(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (map[string]types.Actor, error) `perm:"read"`
+
+ StateCirculatingSupply func(p0 context.Context, p1 types.TipSetKey) (abi.TokenAmount, error) `perm:"read"`
+
+ StateCompute func(p0 context.Context, p1 abi.ChainEpoch, p2 []*types.Message, p3 types.TipSetKey) (*ComputeStateOutput, error) `perm:"read"`
+
+ StateDealProviderCollateralBounds func(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (DealCollateralBounds, error) `perm:"read"`
+
+ StateDecodeParams func(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) `perm:"read"`
+
+ StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
+
+ StateListActors func(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) `perm:"read"`
+
+ StateListMessages func(p0 context.Context, p1 *MessageMatch, p2 types.TipSetKey, p3 abi.ChainEpoch) ([]cid.Cid, error) `perm:"read"`
+
+ StateListMiners func(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) `perm:"read"`
+
+ StateLookupID func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"`
+
+ StateMarketBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) `perm:"read"`
+
+ StateMarketDeals func(p0 context.Context, p1 types.TipSetKey) (map[string]MarketDeal, error) `perm:"read"`
+
+ StateMarketParticipants func(p0 context.Context, p1 types.TipSetKey) (map[string]MarketBalance, error) `perm:"read"`
+
+ StateMarketStorageDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*MarketDeal, error) `perm:"read"`
+
+ StateMinerActiveSectors func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*miner.SectorOnChainInfo, 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"`
+
+ StateMinerFaults func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) `perm:"read"`
+
+ StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) `perm:"read"`
+
+ StateMinerInitialPledgeCollateral func(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"`
+
+ StateMinerPartitions func(p0 context.Context, p1 address.Address, p2 uint64, p3 types.TipSetKey) ([]Partition, error) `perm:"read"`
+
+ StateMinerPower func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*MinerPower, error) `perm:"read"`
+
+ StateMinerPreCommitDepositForPower func(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"`
+
+ StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) `perm:"read"`
+
+ StateMinerRecoveries func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) `perm:"read"`
+
+ StateMinerSectorAllocated func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (bool, error) `perm:"read"`
+
+ StateMinerSectorCount func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerSectors, error) `perm:"read"`
+
+ StateMinerSectors func(p0 context.Context, p1 address.Address, p2 *bitfield.BitField, p3 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"`
+
+ StateNetworkName func(p0 context.Context) (dtypes.NetworkName, error) `perm:"read"`
+
+ StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) `perm:"read"`
+
+ StateReadState func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*ActorState, error) `perm:"read"`
+
+ StateReplay func(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*InvocResult, error) `perm:"read"`
+
+ StateSearchMsg func(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) `perm:"read"`
+
+ StateSectorExpiration func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) `perm:"read"`
+
+ StateSectorGetInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) `perm:"read"`
+
+ StateSectorPartition func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) `perm:"read"`
+
+ StateSectorPreCommitInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) `perm:"read"`
+
+ StateVMCirculatingSupplyInternal func(p0 context.Context, p1 types.TipSetKey) (CirculatingSupply, error) `perm:"read"`
+
+ StateVerifiedClientStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) `perm:"read"`
+
+ StateVerifiedRegistryRootKey func(p0 context.Context, p1 types.TipSetKey) (address.Address, error) `perm:"read"`
+
+ StateVerifierStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) `perm:"read"`
+
+ StateWaitMsg func(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) `perm:"read"`
+
+ SyncCheckBad func(p0 context.Context, p1 cid.Cid) (string, error) `perm:"read"`
+
+ SyncCheckpoint func(p0 context.Context, p1 types.TipSetKey) error `perm:"admin"`
+
+ SyncIncomingBlocks func(p0 context.Context) (<-chan *types.BlockHeader, error) `perm:"read"`
+
+ SyncMarkBad func(p0 context.Context, p1 cid.Cid) error `perm:"admin"`
+
+ SyncState func(p0 context.Context) (*SyncState, error) `perm:"read"`
+
+ SyncSubmitBlock func(p0 context.Context, p1 *types.BlockMsg) error `perm:"write"`
+
+ SyncUnmarkAllBad func(p0 context.Context) error `perm:"admin"`
+
+ SyncUnmarkBad func(p0 context.Context, p1 cid.Cid) error `perm:"admin"`
+
+ SyncValidateTipset func(p0 context.Context, p1 types.TipSetKey) (bool, error) `perm:"read"`
+
+ WalletBalance func(p0 context.Context, p1 address.Address) (types.BigInt, error) `perm:"read"`
+
+ WalletDefaultAddress func(p0 context.Context) (address.Address, error) `perm:"write"`
+
+ WalletDelete func(p0 context.Context, p1 address.Address) error `perm:"admin"`
+
+ WalletExport func(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) `perm:"admin"`
+
+ WalletHas func(p0 context.Context, p1 address.Address) (bool, error) `perm:"write"`
+
+ WalletImport func(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) `perm:"admin"`
+
+ WalletList func(p0 context.Context) ([]address.Address, error) `perm:"write"`
+
+ WalletNew func(p0 context.Context, p1 types.KeyType) (address.Address, error) `perm:"write"`
+
+ WalletSetDefault func(p0 context.Context, p1 address.Address) error `perm:"write"`
+
+ WalletSign func(p0 context.Context, p1 address.Address, p2 []byte) (*crypto.Signature, error) `perm:"sign"`
+
+ WalletSignMessage func(p0 context.Context, p1 address.Address, p2 *types.Message) (*types.SignedMessage, error) `perm:"sign"`
+
+ WalletValidateAddress func(p0 context.Context, p1 string) (address.Address, error) `perm:"read"`
+
+ WalletVerify func(p0 context.Context, p1 address.Address, p2 []byte, p3 *crypto.Signature) (bool, error) `perm:"read"`
+ }
+}
+
+type FullNodeStub struct {
+ CommonStub
+}
+
+type GatewayStruct struct {
+ Internal struct {
+ ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) ``
+
+ ChainGetMessage func(p0 context.Context, p1 cid.Cid) (*types.Message, error) ``
+
+ ChainGetTipSet func(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) ``
+
+ ChainGetTipSetByHeight func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) ``
+
+ ChainHasObj func(p0 context.Context, p1 cid.Cid) (bool, error) ``
+
+ ChainHead func(p0 context.Context) (*types.TipSet, error) ``
+
+ ChainNotify func(p0 context.Context) (<-chan []*HeadChange, error) ``
+
+ ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) ``
+
+ GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) ``
+
+ MpoolPush func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) ``
+
+ MsigGetAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) ``
+
+ MsigGetPending func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*MsigTransaction, error) ``
+
+ MsigGetVested func(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) ``
+
+ StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) ``
+
+ StateDealProviderCollateralBounds func(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (DealCollateralBounds, error) ``
+
+ StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) ``
+
+ StateListMiners func(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) ``
+
+ StateLookupID func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) ``
+
+ StateMarketBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) ``
+
+ StateMarketStorageDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*MarketDeal, error) ``
+
+ StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) ``
+
+ StateMinerPower func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*MinerPower, error) ``
+
+ StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) ``
+
+ StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) ``
+
+ StateSearchMsg func(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) ``
+
+ StateSectorGetInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) ``
+
+ StateVerifiedClientStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) ``
+
+ StateWaitMsg func(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) ``
+
+ WalletBalance func(p0 context.Context, p1 address.Address) (types.BigInt, error) ``
+ }
+}
+
+type GatewayStub struct {
+}
+
+type SignableStruct struct {
+ Internal struct {
+ Sign func(p0 context.Context, p1 SignFunc) error ``
+ }
+}
+
+type SignableStub struct {
+}
+
+type StorageMinerStruct struct {
+ CommonStruct
+
+ Internal struct {
+ ActorAddress func(p0 context.Context) (address.Address, error) `perm:"read"`
+
+ ActorAddressConfig func(p0 context.Context) (AddressConfig, error) `perm:"read"`
+
+ ActorSectorSize func(p0 context.Context, p1 address.Address) (abi.SectorSize, error) `perm:"read"`
+
+ CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) `perm:"admin"`
+
+ ComputeProof func(p0 context.Context, p1 []builtin.SectorInfo, p2 abi.PoStRandomness) ([]builtin.PoStProof, error) `perm:"read"`
+
+ CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"`
+
+ DealsConsiderOfflineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"`
+
+ DealsConsiderOfflineStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"`
+
+ DealsConsiderOnlineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"`
+
+ DealsConsiderOnlineStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"`
+
+ DealsConsiderUnverifiedStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"`
+
+ DealsConsiderVerifiedStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"`
+
+ DealsImportData func(p0 context.Context, p1 cid.Cid, p2 string) error `perm:"admin"`
+
+ DealsList func(p0 context.Context) ([]MarketDeal, error) `perm:"admin"`
+
+ DealsPieceCidBlocklist func(p0 context.Context) ([]cid.Cid, error) `perm:"admin"`
+
+ DealsSetConsiderOfflineRetrievalDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
+
+ DealsSetConsiderOfflineStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
+
+ DealsSetConsiderOnlineRetrievalDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
+
+ DealsSetConsiderOnlineStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
+
+ DealsSetConsiderUnverifiedStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
+
+ DealsSetConsiderVerifiedStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
+
+ DealsSetPieceCidBlocklist func(p0 context.Context, p1 []cid.Cid) error `perm:"admin"`
+
+ MarketCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
+
+ MarketDataTransferUpdates func(p0 context.Context) (<-chan DataTransferChannel, error) `perm:"write"`
+
+ MarketGetAsk func(p0 context.Context) (*storagemarket.SignedStorageAsk, error) `perm:"read"`
+
+ MarketGetDealUpdates func(p0 context.Context) (<-chan storagemarket.MinerDeal, error) `perm:"read"`
+
+ MarketGetRetrievalAsk func(p0 context.Context) (*retrievalmarket.Ask, error) `perm:"read"`
+
+ MarketImportDealData func(p0 context.Context, p1 cid.Cid, p2 string) error `perm:"write"`
+
+ MarketListDataTransfers func(p0 context.Context) ([]DataTransferChannel, error) `perm:"write"`
+
+ MarketListDeals func(p0 context.Context) ([]MarketDeal, error) `perm:"read"`
+
+ MarketListIncompleteDeals func(p0 context.Context) ([]storagemarket.MinerDeal, error) `perm:"read"`
+
+ MarketListRetrievalDeals func(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) `perm:"read"`
+
+ MarketPendingDeals func(p0 context.Context) (PendingDealInfo, error) `perm:"write"`
+
+ MarketPublishPendingDeals func(p0 context.Context) error `perm:"admin"`
+
+ MarketRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
+
+ MarketSetAsk func(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error `perm:"admin"`
+
+ MarketSetRetrievalAsk func(p0 context.Context, p1 *retrievalmarket.Ask) error `perm:"admin"`
+
+ MiningBase func(p0 context.Context) (*types.TipSet, error) `perm:"read"`
+
+ PiecesGetCIDInfo func(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) `perm:"read"`
+
+ PiecesGetPieceInfo func(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) `perm:"read"`
+
+ PiecesListCidInfos func(p0 context.Context) ([]cid.Cid, error) `perm:"read"`
+
+ PiecesListPieces func(p0 context.Context) ([]cid.Cid, error) `perm:"read"`
+
+ PledgeSector func(p0 context.Context) (abi.SectorID, error) `perm:"write"`
+
+ ReturnAddPiece func(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error `perm:"admin"`
+
+ ReturnFetch func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
+
+ ReturnFinalizeSector func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
+
+ ReturnMoveStorage func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
+
+ ReturnReadPiece func(p0 context.Context, p1 storiface.CallID, p2 bool, p3 *storiface.CallError) error `perm:"admin"`
+
+ ReturnReleaseUnsealed func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
+
+ ReturnSealCommit1 func(p0 context.Context, p1 storiface.CallID, p2 storage.Commit1Out, p3 *storiface.CallError) error `perm:"admin"`
+
+ ReturnSealCommit2 func(p0 context.Context, p1 storiface.CallID, p2 storage.Proof, p3 *storiface.CallError) error `perm:"admin"`
+
+ ReturnSealPreCommit1 func(p0 context.Context, p1 storiface.CallID, p2 storage.PreCommit1Out, p3 *storiface.CallError) error `perm:"admin"`
+
+ ReturnSealPreCommit2 func(p0 context.Context, p1 storiface.CallID, p2 storage.SectorCids, p3 *storiface.CallError) error `perm:"admin"`
+
+ ReturnUnsealPiece func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
+
+ SealingAbort func(p0 context.Context, p1 storiface.CallID) error `perm:"admin"`
+
+ SealingSchedDiag func(p0 context.Context, p1 bool) (interface{}, error) `perm:"admin"`
+
+ SectorCommitFlush func(p0 context.Context) ([]sealiface.CommitBatchRes, error) `perm:"admin"`
+
+ SectorCommitPending func(p0 context.Context) ([]abi.SectorID, error) `perm:"admin"`
+
+ SectorGetExpectedSealDuration func(p0 context.Context) (time.Duration, error) `perm:"read"`
+
+ SectorGetSealDelay func(p0 context.Context) (time.Duration, error) `perm:"read"`
+
+ SectorMarkForUpgrade func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"`
+
+ SectorPreCommitFlush func(p0 context.Context) ([]sealiface.PreCommitBatchRes, error) `perm:"admin"`
+
+ SectorPreCommitPending func(p0 context.Context) ([]abi.SectorID, 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"`
+
+ SectorSetSealDelay func(p0 context.Context, p1 time.Duration) error `perm:"write"`
+
+ SectorStartSealing func(p0 context.Context, p1 abi.SectorNumber) error `perm:"write"`
+
+ SectorTerminate func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"`
+
+ SectorTerminateFlush func(p0 context.Context) (*cid.Cid, error) `perm:"admin"`
+
+ SectorTerminatePending func(p0 context.Context) ([]abi.SectorID, error) `perm:"admin"`
+
+ SectorsList func(p0 context.Context) ([]abi.SectorNumber, error) `perm:"read"`
+
+ SectorsListInStates func(p0 context.Context, p1 []SectorState) ([]abi.SectorNumber, error) `perm:"read"`
+
+ SectorsRefs func(p0 context.Context) (map[string][]SealedRef, error) `perm:"read"`
+
+ SectorsStatus func(p0 context.Context, p1 abi.SectorNumber, p2 bool) (SectorInfo, error) `perm:"read"`
+
+ SectorsSummary func(p0 context.Context) (map[SectorState]int, error) `perm:"read"`
+
+ SectorsUpdate func(p0 context.Context, p1 abi.SectorNumber, p2 SectorState) error `perm:"admin"`
+
+ StorageAddLocal func(p0 context.Context, p1 string) error `perm:"admin"`
+
+ StorageAttach func(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error `perm:"admin"`
+
+ StorageBestAlloc func(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) `perm:"admin"`
+
+ StorageDeclareSector func(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error `perm:"admin"`
+
+ StorageDropSector func(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error `perm:"admin"`
+
+ StorageFindSector func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) `perm:"admin"`
+
+ StorageInfo func(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) `perm:"admin"`
+
+ StorageList func(p0 context.Context) (map[stores.ID][]stores.Decl, error) `perm:"admin"`
+
+ StorageLocal func(p0 context.Context) (map[stores.ID]string, error) `perm:"admin"`
+
+ StorageLock func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) error `perm:"admin"`
+
+ StorageReportHealth func(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error `perm:"admin"`
+
+ StorageStat func(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) `perm:"admin"`
+
+ StorageTryLock func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) (bool, error) `perm:"admin"`
+
+ WorkerConnect func(p0 context.Context, p1 string) error `perm:"admin"`
+
+ WorkerJobs func(p0 context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) `perm:"admin"`
+
+ WorkerStats func(p0 context.Context) (map[uuid.UUID]storiface.WorkerStats, error) `perm:"admin"`
+ }
+}
+
+type StorageMinerStub struct {
+ CommonStub
+}
+
+type WalletStruct struct {
+ Internal struct {
+ WalletDelete func(p0 context.Context, p1 address.Address) error `perm:"admin"`
+
+ WalletExport func(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) `perm:"admin"`
+
+ WalletHas func(p0 context.Context, p1 address.Address) (bool, error) `perm:"admin"`
+
+ WalletImport func(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) `perm:"admin"`
+
+ WalletList func(p0 context.Context) ([]address.Address, error) `perm:"admin"`
+
+ WalletNew func(p0 context.Context, p1 types.KeyType) (address.Address, error) `perm:"admin"`
+
+ WalletSign func(p0 context.Context, p1 address.Address, p2 []byte, p3 MsgMeta) (*crypto.Signature, error) `perm:"admin"`
+ }
+}
+
+type WalletStub struct {
+}
+
+type WorkerStruct struct {
+ Internal struct {
+ AddPiece func(p0 context.Context, p1 storage.SectorRef, p2 []abi.UnpaddedPieceSize, p3 abi.UnpaddedPieceSize, p4 storage.Data) (storiface.CallID, error) `perm:"admin"`
+
+ Enabled func(p0 context.Context) (bool, error) `perm:"admin"`
+
+ Fetch func(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) `perm:"admin"`
+
+ FinalizeSector func(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) `perm:"admin"`
+
+ Info func(p0 context.Context) (storiface.WorkerInfo, error) `perm:"admin"`
+
+ MoveStorage func(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType) (storiface.CallID, error) `perm:"admin"`
+
+ Paths func(p0 context.Context) ([]stores.StoragePath, error) `perm:"admin"`
+
+ ProcessSession func(p0 context.Context) (uuid.UUID, error) `perm:"admin"`
+
+ ReleaseUnsealed func(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) `perm:"admin"`
+
+ Remove func(p0 context.Context, p1 abi.SectorID) error `perm:"admin"`
+
+ SealCommit1 func(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 abi.InteractiveSealRandomness, p4 []abi.PieceInfo, p5 storage.SectorCids) (storiface.CallID, error) `perm:"admin"`
+
+ SealCommit2 func(p0 context.Context, p1 storage.SectorRef, p2 storage.Commit1Out) (storiface.CallID, error) `perm:"admin"`
+
+ SealPreCommit1 func(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 []abi.PieceInfo) (storiface.CallID, error) `perm:"admin"`
+
+ SealPreCommit2 func(p0 context.Context, p1 storage.SectorRef, p2 storage.PreCommit1Out) (storiface.CallID, error) `perm:"admin"`
+
+ Session func(p0 context.Context) (uuid.UUID, error) `perm:"admin"`
+
+ SetEnabled func(p0 context.Context, p1 bool) error `perm:"admin"`
+
+ StorageAddLocal func(p0 context.Context, p1 string) error `perm:"admin"`
+
+ TaskDisable func(p0 context.Context, p1 sealtasks.TaskType) error `perm:"admin"`
+
+ TaskEnable func(p0 context.Context, p1 sealtasks.TaskType) error `perm:"admin"`
+
+ TaskTypes func(p0 context.Context) (map[sealtasks.TaskType]struct{}, error) `perm:"admin"`
+
+ UnsealPiece func(p0 context.Context, p1 storage.SectorRef, p2 storiface.UnpaddedByteIndex, p3 abi.UnpaddedPieceSize, p4 abi.SealRandomness, p5 cid.Cid) (storiface.CallID, error) `perm:"admin"`
+
+ Version func(p0 context.Context) (Version, error) `perm:"admin"`
+
+ WaitQuiet func(p0 context.Context) error `perm:"admin"`
+ }
+}
+
+type WorkerStub struct {
+}
+
+func (s *ChainIOStruct) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return s.Internal.ChainHasObj(p0, p1)
+}
+
+func (s *ChainIOStub) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *ChainIOStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
+ return s.Internal.ChainReadObj(p0, p1)
+}
+
+func (s *ChainIOStub) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
+ return *new([]byte), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) AuthNew(p0 context.Context, p1 []auth.Permission) ([]byte, error) {
+ return s.Internal.AuthNew(p0, p1)
+}
+
+func (s *CommonStub) AuthNew(p0 context.Context, p1 []auth.Permission) ([]byte, error) {
+ return *new([]byte), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) AuthVerify(p0 context.Context, p1 string) ([]auth.Permission, error) {
+ return s.Internal.AuthVerify(p0, p1)
+}
+
+func (s *CommonStub) AuthVerify(p0 context.Context, p1 string) ([]auth.Permission, error) {
+ return *new([]auth.Permission), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) Closing(p0 context.Context) (<-chan struct{}, error) {
+ return s.Internal.Closing(p0)
+}
+
+func (s *CommonStub) Closing(p0 context.Context) (<-chan struct{}, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) Discover(p0 context.Context) (apitypes.OpenRPCDocument, error) {
+ return s.Internal.Discover(p0)
+}
+
+func (s *CommonStub) Discover(p0 context.Context) (apitypes.OpenRPCDocument, error) {
+ return *new(apitypes.OpenRPCDocument), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) ID(p0 context.Context) (peer.ID, error) {
+ return s.Internal.ID(p0)
+}
+
+func (s *CommonStub) ID(p0 context.Context) (peer.ID, error) {
+ return *new(peer.ID), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) LogList(p0 context.Context) ([]string, error) {
+ return s.Internal.LogList(p0)
+}
+
+func (s *CommonStub) LogList(p0 context.Context) ([]string, error) {
+ return *new([]string), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) LogSetLevel(p0 context.Context, p1 string, p2 string) error {
+ return s.Internal.LogSetLevel(p0, p1, p2)
+}
+
+func (s *CommonStub) LogSetLevel(p0 context.Context, p1 string, p2 string) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetAddrsListen(p0 context.Context) (peer.AddrInfo, error) {
+ return s.Internal.NetAddrsListen(p0)
+}
+
+func (s *CommonStub) NetAddrsListen(p0 context.Context) (peer.AddrInfo, error) {
+ return *new(peer.AddrInfo), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetAgentVersion(p0 context.Context, p1 peer.ID) (string, error) {
+ return s.Internal.NetAgentVersion(p0, p1)
+}
+
+func (s *CommonStub) NetAgentVersion(p0 context.Context, p1 peer.ID) (string, error) {
+ return "", xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetAutoNatStatus(p0 context.Context) (NatInfo, error) {
+ return s.Internal.NetAutoNatStatus(p0)
+}
+
+func (s *CommonStub) NetAutoNatStatus(p0 context.Context) (NatInfo, error) {
+ return *new(NatInfo), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetBandwidthStats(p0 context.Context) (metrics.Stats, error) {
+ return s.Internal.NetBandwidthStats(p0)
+}
+
+func (s *CommonStub) NetBandwidthStats(p0 context.Context) (metrics.Stats, error) {
+ return *new(metrics.Stats), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetBandwidthStatsByPeer(p0 context.Context) (map[string]metrics.Stats, error) {
+ return s.Internal.NetBandwidthStatsByPeer(p0)
+}
+
+func (s *CommonStub) NetBandwidthStatsByPeer(p0 context.Context) (map[string]metrics.Stats, error) {
+ return *new(map[string]metrics.Stats), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetBandwidthStatsByProtocol(p0 context.Context) (map[protocol.ID]metrics.Stats, error) {
+ return s.Internal.NetBandwidthStatsByProtocol(p0)
+}
+
+func (s *CommonStub) NetBandwidthStatsByProtocol(p0 context.Context) (map[protocol.ID]metrics.Stats, error) {
+ return *new(map[protocol.ID]metrics.Stats), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetBlockAdd(p0 context.Context, p1 NetBlockList) error {
+ return s.Internal.NetBlockAdd(p0, p1)
+}
+
+func (s *CommonStub) NetBlockAdd(p0 context.Context, p1 NetBlockList) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetBlockList(p0 context.Context) (NetBlockList, error) {
+ return s.Internal.NetBlockList(p0)
+}
+
+func (s *CommonStub) NetBlockList(p0 context.Context) (NetBlockList, error) {
+ return *new(NetBlockList), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetBlockRemove(p0 context.Context, p1 NetBlockList) error {
+ return s.Internal.NetBlockRemove(p0, p1)
+}
+
+func (s *CommonStub) NetBlockRemove(p0 context.Context, p1 NetBlockList) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetConnect(p0 context.Context, p1 peer.AddrInfo) error {
+ return s.Internal.NetConnect(p0, p1)
+}
+
+func (s *CommonStub) NetConnect(p0 context.Context, p1 peer.AddrInfo) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetConnectedness(p0 context.Context, p1 peer.ID) (network.Connectedness, error) {
+ return s.Internal.NetConnectedness(p0, p1)
+}
+
+func (s *CommonStub) NetConnectedness(p0 context.Context, p1 peer.ID) (network.Connectedness, error) {
+ return *new(network.Connectedness), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetDisconnect(p0 context.Context, p1 peer.ID) error {
+ return s.Internal.NetDisconnect(p0, p1)
+}
+
+func (s *CommonStub) NetDisconnect(p0 context.Context, p1 peer.ID) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetFindPeer(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) {
+ return s.Internal.NetFindPeer(p0, p1)
+}
+
+func (s *CommonStub) NetFindPeer(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) {
+ return *new(peer.AddrInfo), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetPeerInfo(p0 context.Context, p1 peer.ID) (*ExtendedPeerInfo, error) {
+ return s.Internal.NetPeerInfo(p0, p1)
+}
+
+func (s *CommonStub) NetPeerInfo(p0 context.Context, p1 peer.ID) (*ExtendedPeerInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetPeers(p0 context.Context) ([]peer.AddrInfo, error) {
+ return s.Internal.NetPeers(p0)
+}
+
+func (s *CommonStub) NetPeers(p0 context.Context) ([]peer.AddrInfo, error) {
+ return *new([]peer.AddrInfo), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) NetPubsubScores(p0 context.Context) ([]PubsubScore, error) {
+ return s.Internal.NetPubsubScores(p0)
+}
+
+func (s *CommonStub) NetPubsubScores(p0 context.Context) ([]PubsubScore, error) {
+ return *new([]PubsubScore), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) Session(p0 context.Context) (uuid.UUID, error) {
+ return s.Internal.Session(p0)
+}
+
+func (s *CommonStub) Session(p0 context.Context) (uuid.UUID, error) {
+ return *new(uuid.UUID), xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) Shutdown(p0 context.Context) error {
+ return s.Internal.Shutdown(p0)
+}
+
+func (s *CommonStub) Shutdown(p0 context.Context) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *CommonStruct) Version(p0 context.Context) (APIVersion, error) {
+ return s.Internal.Version(p0)
+}
+
+func (s *CommonStub) Version(p0 context.Context) (APIVersion, error) {
+ return *new(APIVersion), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) BeaconGetEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) {
+ return s.Internal.BeaconGetEntry(p0, p1)
+}
+
+func (s *FullNodeStub) BeaconGetEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainDeleteObj(p0 context.Context, p1 cid.Cid) error {
+ return s.Internal.ChainDeleteObj(p0, p1)
+}
+
+func (s *FullNodeStub) ChainDeleteObj(p0 context.Context, p1 cid.Cid) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainExport(p0 context.Context, p1 abi.ChainEpoch, p2 bool, p3 types.TipSetKey) (<-chan []byte, error) {
+ return s.Internal.ChainExport(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) ChainExport(p0 context.Context, p1 abi.ChainEpoch, p2 bool, p3 types.TipSetKey) (<-chan []byte, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) {
+ return s.Internal.ChainGetBlock(p0, p1)
+}
+
+func (s *FullNodeStub) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) {
+ return s.Internal.ChainGetBlockMessages(p0, p1)
+}
+
+func (s *FullNodeStub) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetGenesis(p0 context.Context) (*types.TipSet, error) {
+ return s.Internal.ChainGetGenesis(p0)
+}
+
+func (s *FullNodeStub) ChainGetGenesis(p0 context.Context) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) {
+ return s.Internal.ChainGetMessage(p0, p1)
+}
+
+func (s *FullNodeStub) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetNode(p0 context.Context, p1 string) (*IpldObject, error) {
+ return s.Internal.ChainGetNode(p0, p1)
+}
+
+func (s *FullNodeStub) ChainGetNode(p0 context.Context, p1 string) (*IpldObject, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetParentMessages(p0 context.Context, p1 cid.Cid) ([]Message, error) {
+ return s.Internal.ChainGetParentMessages(p0, p1)
+}
+
+func (s *FullNodeStub) ChainGetParentMessages(p0 context.Context, p1 cid.Cid) ([]Message, error) {
+ return *new([]Message), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetParentReceipts(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) {
+ return s.Internal.ChainGetParentReceipts(p0, p1)
+}
+
+func (s *FullNodeStub) ChainGetParentReceipts(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) {
+ return *new([]*types.MessageReceipt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetPath(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*HeadChange, error) {
+ return s.Internal.ChainGetPath(p0, p1, p2)
+}
+
+func (s *FullNodeStub) ChainGetPath(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*HeadChange, error) {
+ return *new([]*HeadChange), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetRandomnessFromBeacon(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) {
+ return s.Internal.ChainGetRandomnessFromBeacon(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) ChainGetRandomnessFromBeacon(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) {
+ return *new(abi.Randomness), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetRandomnessFromTickets(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) {
+ return s.Internal.ChainGetRandomnessFromTickets(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) ChainGetRandomnessFromTickets(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) {
+ return *new(abi.Randomness), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) {
+ return s.Internal.ChainGetTipSet(p0, p1)
+}
+
+func (s *FullNodeStub) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) {
+ return s.Internal.ChainGetTipSetByHeight(p0, p1, p2)
+}
+
+func (s *FullNodeStub) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return s.Internal.ChainHasObj(p0, p1)
+}
+
+func (s *FullNodeStub) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainHead(p0 context.Context) (*types.TipSet, error) {
+ return s.Internal.ChainHead(p0)
+}
+
+func (s *FullNodeStub) ChainHead(p0 context.Context) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainNotify(p0 context.Context) (<-chan []*HeadChange, error) {
+ return s.Internal.ChainNotify(p0)
+}
+
+func (s *FullNodeStub) ChainNotify(p0 context.Context) (<-chan []*HeadChange, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
+ return s.Internal.ChainReadObj(p0, p1)
+}
+
+func (s *FullNodeStub) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
+ return *new([]byte), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainSetHead(p0 context.Context, p1 types.TipSetKey) error {
+ return s.Internal.ChainSetHead(p0, p1)
+}
+
+func (s *FullNodeStub) ChainSetHead(p0 context.Context, p1 types.TipSetKey) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainStatObj(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (ObjStat, error) {
+ return s.Internal.ChainStatObj(p0, p1, p2)
+}
+
+func (s *FullNodeStub) ChainStatObj(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (ObjStat, error) {
+ return *new(ObjStat), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.ChainTipSetWeight(p0, p1)
+}
+
+func (s *FullNodeStub) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*CommPRet, error) {
+ return s.Internal.ClientCalcCommP(p0, p1)
+}
+
+func (s *FullNodeStub) ClientCalcCommP(p0 context.Context, p1 string) (*CommPRet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return s.Internal.ClientCancelDataTransfer(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error {
+ return s.Internal.ClientCancelRetrievalDeal(p0, p1)
+}
+
+func (s *FullNodeStub) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) {
+ return s.Internal.ClientDataTransferUpdates(p0)
+}
+
+func (s *FullNodeStub) ClientDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) {
+ return s.Internal.ClientDealPieceCID(p0, p1)
+}
+
+func (s *FullNodeStub) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) {
+ return *new(DataCIDSize), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (DataSize, error) {
+ return s.Internal.ClientDealSize(p0, p1)
+}
+
+func (s *FullNodeStub) ClientDealSize(p0 context.Context, p1 cid.Cid) (DataSize, error) {
+ return *new(DataSize), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) {
+ return s.Internal.ClientFindData(p0, p1, p2)
+}
+
+func (s *FullNodeStub) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) {
+ return *new([]QueryOffer), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 FileRef, p2 string) error {
+ return s.Internal.ClientGenCar(p0, p1, p2)
+}
+
+func (s *FullNodeStub) ClientGenCar(p0 context.Context, p1 FileRef, p2 string) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*DealInfo, error) {
+ return s.Internal.ClientGetDealInfo(p0, p1)
+}
+
+func (s *FullNodeStub) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*DealInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) {
+ return s.Internal.ClientGetDealStatus(p0, p1)
+}
+
+func (s *FullNodeStub) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) {
+ return "", xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientGetDealUpdates(p0 context.Context) (<-chan DealInfo, error) {
+ return s.Internal.ClientGetDealUpdates(p0)
+}
+
+func (s *FullNodeStub) ClientGetDealUpdates(p0 context.Context) (<-chan DealInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientGetRetrievalUpdates(p0 context.Context) (<-chan RetrievalInfo, error) {
+ return s.Internal.ClientGetRetrievalUpdates(p0)
+}
+
+func (s *FullNodeStub) ClientGetRetrievalUpdates(p0 context.Context) (<-chan RetrievalInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return s.Internal.ClientHasLocal(p0, p1)
+}
+
+func (s *FullNodeStub) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientImport(p0 context.Context, p1 FileRef) (*ImportRes, error) {
+ return s.Internal.ClientImport(p0, p1)
+}
+
+func (s *FullNodeStub) ClientImport(p0 context.Context, p1 FileRef) (*ImportRes, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) {
+ return s.Internal.ClientListDataTransfers(p0)
+}
+
+func (s *FullNodeStub) ClientListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) {
+ return *new([]DataTransferChannel), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]DealInfo, error) {
+ return s.Internal.ClientListDeals(p0)
+}
+
+func (s *FullNodeStub) ClientListDeals(p0 context.Context) ([]DealInfo, error) {
+ return *new([]DealInfo), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]Import, error) {
+ return s.Internal.ClientListImports(p0)
+}
+
+func (s *FullNodeStub) ClientListImports(p0 context.Context) ([]Import, error) {
+ return *new([]Import), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientListRetrievals(p0 context.Context) ([]RetrievalInfo, error) {
+ return s.Internal.ClientListRetrievals(p0)
+}
+
+func (s *FullNodeStub) ClientListRetrievals(p0 context.Context) ([]RetrievalInfo, error) {
+ return *new([]RetrievalInfo), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) {
+ return s.Internal.ClientMinerQueryOffer(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) {
+ return *new(QueryOffer), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) {
+ return s.Internal.ClientQueryAsk(p0, p1, p2)
+}
+
+func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 multistore.StoreID) error {
+ return s.Internal.ClientRemoveImport(p0, p1)
+}
+
+func (s *FullNodeStub) ClientRemoveImport(p0 context.Context, p1 multistore.StoreID) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return s.Internal.ClientRestartDataTransfer(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) error {
+ return s.Internal.ClientRetrieve(p0, p1, p2)
+}
+
+func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error {
+ return s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1)
+}
+
+func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) (<-chan marketevents.RetrievalEvent, error) {
+ return s.Internal.ClientRetrieveWithEvents(p0, p1, p2)
+}
+
+func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *FileRef) (<-chan marketevents.RetrievalEvent, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) {
+ return s.Internal.ClientStartDeal(p0, p1)
+}
+
+func (s *FullNodeStub) ClientStartDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) {
+ return s.Internal.ClientStatelessDeal(p0, p1)
+}
+
+func (s *FullNodeStub) ClientStatelessDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) CreateBackup(p0 context.Context, p1 string) error {
+ return s.Internal.CreateBackup(p0, p1)
+}
+
+func (s *FullNodeStub) CreateBackup(p0 context.Context, p1 string) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) GasEstimateFeeCap(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.GasEstimateFeeCap(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) GasEstimateFeeCap(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) GasEstimateGasLimit(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (int64, error) {
+ return s.Internal.GasEstimateGasLimit(p0, p1, p2)
+}
+
+func (s *FullNodeStub) GasEstimateGasLimit(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (int64, error) {
+ return 0, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) GasEstimateGasPremium(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.GasEstimateGasPremium(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) GasEstimateGasPremium(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
+ return s.Internal.GasEstimateMessageGas(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MarketAddBalance(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
+ return s.Internal.MarketAddBalance(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) MarketAddBalance(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MarketGetReserved(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return s.Internal.MarketGetReserved(p0, p1)
+}
+
+func (s *FullNodeStub) MarketGetReserved(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MarketReleaseFunds(p0 context.Context, p1 address.Address, p2 types.BigInt) error {
+ return s.Internal.MarketReleaseFunds(p0, p1, p2)
+}
+
+func (s *FullNodeStub) MarketReleaseFunds(p0 context.Context, p1 address.Address, p2 types.BigInt) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MarketReserveFunds(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
+ return s.Internal.MarketReserveFunds(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) MarketReserveFunds(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MarketWithdraw(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
+ return s.Internal.MarketWithdraw(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) MarketWithdraw(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MinerCreateBlock(p0 context.Context, p1 *BlockTemplate) (*types.BlockMsg, error) {
+ return s.Internal.MinerCreateBlock(p0, p1)
+}
+
+func (s *FullNodeStub) MinerCreateBlock(p0 context.Context, p1 *BlockTemplate) (*types.BlockMsg, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*MiningBaseInfo, error) {
+ return s.Internal.MinerGetBaseInfo(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*MiningBaseInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolBatchPush(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) {
+ return s.Internal.MpoolBatchPush(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolBatchPush(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) {
+ return *new([]cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolBatchPushMessage(p0 context.Context, p1 []*types.Message, p2 *MessageSendSpec) ([]*types.SignedMessage, error) {
+ return s.Internal.MpoolBatchPushMessage(p0, p1, p2)
+}
+
+func (s *FullNodeStub) MpoolBatchPushMessage(p0 context.Context, p1 []*types.Message, p2 *MessageSendSpec) ([]*types.SignedMessage, error) {
+ return *new([]*types.SignedMessage), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolBatchPushUntrusted(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) {
+ return s.Internal.MpoolBatchPushUntrusted(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolBatchPushUntrusted(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) {
+ return *new([]cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolCheckMessages(p0 context.Context, p1 []*MessagePrototype) ([][]MessageCheckStatus, error) {
+ return s.Internal.MpoolCheckMessages(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolCheckMessages(p0 context.Context, p1 []*MessagePrototype) ([][]MessageCheckStatus, error) {
+ return *new([][]MessageCheckStatus), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolCheckPendingMessages(p0 context.Context, p1 address.Address) ([][]MessageCheckStatus, error) {
+ return s.Internal.MpoolCheckPendingMessages(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolCheckPendingMessages(p0 context.Context, p1 address.Address) ([][]MessageCheckStatus, error) {
+ return *new([][]MessageCheckStatus), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolCheckReplaceMessages(p0 context.Context, p1 []*types.Message) ([][]MessageCheckStatus, error) {
+ return s.Internal.MpoolCheckReplaceMessages(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolCheckReplaceMessages(p0 context.Context, p1 []*types.Message) ([][]MessageCheckStatus, error) {
+ return *new([][]MessageCheckStatus), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolClear(p0 context.Context, p1 bool) error {
+ return s.Internal.MpoolClear(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolClear(p0 context.Context, p1 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolGetConfig(p0 context.Context) (*types.MpoolConfig, error) {
+ return s.Internal.MpoolGetConfig(p0)
+}
+
+func (s *FullNodeStub) MpoolGetConfig(p0 context.Context) (*types.MpoolConfig, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) {
+ return s.Internal.MpoolGetNonce(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) {
+ return 0, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolPending(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) {
+ return s.Internal.MpoolPending(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolPending(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) {
+ return *new([]*types.SignedMessage), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
+ return s.Internal.MpoolPush(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolPushMessage(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec) (*types.SignedMessage, error) {
+ return s.Internal.MpoolPushMessage(p0, p1, p2)
+}
+
+func (s *FullNodeStub) MpoolPushMessage(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec) (*types.SignedMessage, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolPushUntrusted(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
+ return s.Internal.MpoolPushUntrusted(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolPushUntrusted(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolSelect(p0 context.Context, p1 types.TipSetKey, p2 float64) ([]*types.SignedMessage, error) {
+ return s.Internal.MpoolSelect(p0, p1, p2)
+}
+
+func (s *FullNodeStub) MpoolSelect(p0 context.Context, p1 types.TipSetKey, p2 float64) ([]*types.SignedMessage, error) {
+ return *new([]*types.SignedMessage), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolSetConfig(p0 context.Context, p1 *types.MpoolConfig) error {
+ return s.Internal.MpoolSetConfig(p0, p1)
+}
+
+func (s *FullNodeStub) MpoolSetConfig(p0 context.Context, p1 *types.MpoolConfig) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MpoolSub(p0 context.Context) (<-chan MpoolUpdate, error) {
+ return s.Internal.MpoolSub(p0)
+}
+
+func (s *FullNodeStub) MpoolSub(p0 context.Context) (<-chan MpoolUpdate, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigAddApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 bool) (*MessagePrototype, error) {
+ return s.Internal.MsigAddApprove(p0, p1, p2, p3, p4, p5, p6)
+}
+
+func (s *FullNodeStub) MsigAddApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 bool) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigAddCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 bool) (*MessagePrototype, error) {
+ return s.Internal.MsigAddCancel(p0, p1, p2, p3, p4, p5)
+}
+
+func (s *FullNodeStub) MsigAddCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 bool) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigAddPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (*MessagePrototype, error) {
+ return s.Internal.MsigAddPropose(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) MsigAddPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigApprove(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (*MessagePrototype, error) {
+ return s.Internal.MsigApprove(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) MsigApprove(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigApproveTxnHash(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 address.Address, p5 types.BigInt, p6 address.Address, p7 uint64, p8 []byte) (*MessagePrototype, error) {
+ return s.Internal.MsigApproveTxnHash(p0, p1, p2, p3, p4, p5, p6, p7, p8)
+}
+
+func (s *FullNodeStub) MsigApproveTxnHash(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 address.Address, p5 types.BigInt, p6 address.Address, p7 uint64, p8 []byte) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigCancel(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (*MessagePrototype, error) {
+ return s.Internal.MsigCancel(p0, p1, p2, p3, p4, p5, p6, p7)
+}
+
+func (s *FullNodeStub) MsigCancel(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigCreate(p0 context.Context, p1 uint64, p2 []address.Address, p3 abi.ChainEpoch, p4 types.BigInt, p5 address.Address, p6 types.BigInt) (*MessagePrototype, error) {
+ return s.Internal.MsigCreate(p0, p1, p2, p3, p4, p5, p6)
+}
+
+func (s *FullNodeStub) MsigCreate(p0 context.Context, p1 uint64, p2 []address.Address, p3 abi.ChainEpoch, p4 types.BigInt, p5 address.Address, p6 types.BigInt) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.MsigGetAvailableBalance(p0, p1, p2)
+}
+
+func (s *FullNodeStub) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*MsigTransaction, error) {
+ return s.Internal.MsigGetPending(p0, p1, p2)
+}
+
+func (s *FullNodeStub) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*MsigTransaction, error) {
+ return *new([]*MsigTransaction), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.MsigGetVested(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigGetVestingSchedule(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MsigVesting, error) {
+ return s.Internal.MsigGetVestingSchedule(p0, p1, p2)
+}
+
+func (s *FullNodeStub) MsigGetVestingSchedule(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MsigVesting, error) {
+ return *new(MsigVesting), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 address.Address, p5 uint64, p6 []byte) (*MessagePrototype, error) {
+ return s.Internal.MsigPropose(p0, p1, p2, p3, p4, p5, p6)
+}
+
+func (s *FullNodeStub) MsigPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 address.Address, p5 uint64, p6 []byte) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigRemoveSigner(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (*MessagePrototype, error) {
+ return s.Internal.MsigRemoveSigner(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) MsigRemoveSigner(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigSwapApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 address.Address) (*MessagePrototype, error) {
+ return s.Internal.MsigSwapApprove(p0, p1, p2, p3, p4, p5, p6)
+}
+
+func (s *FullNodeStub) MsigSwapApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 address.Address) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigSwapCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address) (*MessagePrototype, error) {
+ return s.Internal.MsigSwapCancel(p0, p1, p2, p3, p4, p5)
+}
+
+func (s *FullNodeStub) MsigSwapCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) MsigSwapPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 address.Address) (*MessagePrototype, error) {
+ return s.Internal.MsigSwapPropose(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) MsigSwapPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 address.Address) (*MessagePrototype, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) NodeStatus(p0 context.Context, p1 bool) (NodeStatus, error) {
+ return s.Internal.NodeStatus(p0, p1)
+}
+
+func (s *FullNodeStub) NodeStatus(p0 context.Context, p1 bool) (NodeStatus, error) {
+ return *new(NodeStatus), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychAllocateLane(p0 context.Context, p1 address.Address) (uint64, error) {
+ return s.Internal.PaychAllocateLane(p0, p1)
+}
+
+func (s *FullNodeStub) PaychAllocateLane(p0 context.Context, p1 address.Address) (uint64, error) {
+ return 0, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychAvailableFunds(p0 context.Context, p1 address.Address) (*ChannelAvailableFunds, error) {
+ return s.Internal.PaychAvailableFunds(p0, p1)
+}
+
+func (s *FullNodeStub) PaychAvailableFunds(p0 context.Context, p1 address.Address) (*ChannelAvailableFunds, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychAvailableFundsByFromTo(p0 context.Context, p1 address.Address, p2 address.Address) (*ChannelAvailableFunds, error) {
+ return s.Internal.PaychAvailableFundsByFromTo(p0, p1, p2)
+}
+
+func (s *FullNodeStub) PaychAvailableFundsByFromTo(p0 context.Context, p1 address.Address, p2 address.Address) (*ChannelAvailableFunds, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychCollect(p0 context.Context, p1 address.Address) (cid.Cid, error) {
+ return s.Internal.PaychCollect(p0, p1)
+}
+
+func (s *FullNodeStub) PaychCollect(p0 context.Context, p1 address.Address) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychGet(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*ChannelInfo, error) {
+ return s.Internal.PaychGet(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) PaychGet(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*ChannelInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychGetWaitReady(p0 context.Context, p1 cid.Cid) (address.Address, error) {
+ return s.Internal.PaychGetWaitReady(p0, p1)
+}
+
+func (s *FullNodeStub) PaychGetWaitReady(p0 context.Context, p1 cid.Cid) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychList(p0 context.Context) ([]address.Address, error) {
+ return s.Internal.PaychList(p0)
+}
+
+func (s *FullNodeStub) PaychList(p0 context.Context) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychNewPayment(p0 context.Context, p1 address.Address, p2 address.Address, p3 []VoucherSpec) (*PaymentInfo, error) {
+ return s.Internal.PaychNewPayment(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) PaychNewPayment(p0 context.Context, p1 address.Address, p2 address.Address, p3 []VoucherSpec) (*PaymentInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychSettle(p0 context.Context, p1 address.Address) (cid.Cid, error) {
+ return s.Internal.PaychSettle(p0, p1)
+}
+
+func (s *FullNodeStub) PaychSettle(p0 context.Context, p1 address.Address) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychStatus(p0 context.Context, p1 address.Address) (*PaychStatus, error) {
+ return s.Internal.PaychStatus(p0, p1)
+}
+
+func (s *FullNodeStub) PaychStatus(p0 context.Context, p1 address.Address) (*PaychStatus, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychVoucherAdd(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 types.BigInt) (types.BigInt, error) {
+ return s.Internal.PaychVoucherAdd(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) PaychVoucherAdd(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 types.BigInt) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychVoucherCheckSpendable(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (bool, error) {
+ return s.Internal.PaychVoucherCheckSpendable(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) PaychVoucherCheckSpendable(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychVoucherCheckValid(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher) error {
+ return s.Internal.PaychVoucherCheckValid(p0, p1, p2)
+}
+
+func (s *FullNodeStub) PaychVoucherCheckValid(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychVoucherCreate(p0 context.Context, p1 address.Address, p2 types.BigInt, p3 uint64) (*VoucherCreateResult, error) {
+ return s.Internal.PaychVoucherCreate(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) PaychVoucherCreate(p0 context.Context, p1 address.Address, p2 types.BigInt, p3 uint64) (*VoucherCreateResult, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychVoucherList(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) {
+ return s.Internal.PaychVoucherList(p0, p1)
+}
+
+func (s *FullNodeStub) PaychVoucherList(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) {
+ return *new([]*paych.SignedVoucher), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) PaychVoucherSubmit(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (cid.Cid, error) {
+ return s.Internal.PaychVoucherSubmit(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) PaychVoucherSubmit(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return s.Internal.StateAccountKey(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateAllMinerFaults(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*Fault, error) {
+ return s.Internal.StateAllMinerFaults(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateAllMinerFaults(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*Fault, error) {
+ return *new([]*Fault), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*InvocResult, error) {
+ return s.Internal.StateCall(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*InvocResult, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateChangedActors(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (map[string]types.Actor, error) {
+ return s.Internal.StateChangedActors(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateChangedActors(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (map[string]types.Actor, error) {
+ return *new(map[string]types.Actor), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateCirculatingSupply(p0 context.Context, p1 types.TipSetKey) (abi.TokenAmount, error) {
+ return s.Internal.StateCirculatingSupply(p0, p1)
+}
+
+func (s *FullNodeStub) StateCirculatingSupply(p0 context.Context, p1 types.TipSetKey) (abi.TokenAmount, error) {
+ return *new(abi.TokenAmount), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateCompute(p0 context.Context, p1 abi.ChainEpoch, p2 []*types.Message, p3 types.TipSetKey) (*ComputeStateOutput, error) {
+ return s.Internal.StateCompute(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateCompute(p0 context.Context, p1 abi.ChainEpoch, p2 []*types.Message, p3 types.TipSetKey) (*ComputeStateOutput, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (DealCollateralBounds, error) {
+ return s.Internal.StateDealProviderCollateralBounds(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (DealCollateralBounds, error) {
+ return *new(DealCollateralBounds), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateDecodeParams(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) {
+ return s.Internal.StateDecodeParams(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) StateDecodeParams(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) {
+ return s.Internal.StateGetActor(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateListActors(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
+ return s.Internal.StateListActors(p0, p1)
+}
+
+func (s *FullNodeStub) StateListActors(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateListMessages(p0 context.Context, p1 *MessageMatch, p2 types.TipSetKey, p3 abi.ChainEpoch) ([]cid.Cid, error) {
+ return s.Internal.StateListMessages(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateListMessages(p0 context.Context, p1 *MessageMatch, p2 types.TipSetKey, p3 abi.ChainEpoch) ([]cid.Cid, error) {
+ return *new([]cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
+ return s.Internal.StateListMiners(p0, p1)
+}
+
+func (s *FullNodeStub) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return s.Internal.StateLookupID(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) {
+ return s.Internal.StateMarketBalance(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) {
+ return *new(MarketBalance), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]MarketDeal, error) {
+ return s.Internal.StateMarketDeals(p0, p1)
+}
+
+func (s *FullNodeStub) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]MarketDeal, error) {
+ return *new(map[string]MarketDeal), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMarketParticipants(p0 context.Context, p1 types.TipSetKey) (map[string]MarketBalance, error) {
+ return s.Internal.StateMarketParticipants(p0, p1)
+}
+
+func (s *FullNodeStub) StateMarketParticipants(p0 context.Context, p1 types.TipSetKey) (map[string]MarketBalance, error) {
+ return *new(map[string]MarketBalance), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*MarketDeal, error) {
+ return s.Internal.StateMarketStorageDeal(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*MarketDeal, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerActiveSectors(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
+ return s.Internal.StateMinerActiveSectors(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMinerActiveSectors(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
+ return *new([]*miner.SectorOnChainInfo), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.StateMinerAvailableBalance(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMinerAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerDeadlines(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]Deadline, error) {
+ return s.Internal.StateMinerDeadlines(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMinerDeadlines(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]Deadline, error) {
+ return *new([]Deadline), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerFaults(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) {
+ return s.Internal.StateMinerFaults(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMinerFaults(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) {
+ return *new(bitfield.BitField), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
+ return s.Internal.StateMinerInfo(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
+ return *new(miner.MinerInfo), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerInitialPledgeCollateral(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.StateMinerInitialPledgeCollateral(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateMinerInitialPledgeCollateral(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerPartitions(p0 context.Context, p1 address.Address, p2 uint64, p3 types.TipSetKey) ([]Partition, error) {
+ return s.Internal.StateMinerPartitions(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateMinerPartitions(p0 context.Context, p1 address.Address, p2 uint64, p3 types.TipSetKey) ([]Partition, error) {
+ return *new([]Partition), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*MinerPower, error) {
+ return s.Internal.StateMinerPower(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*MinerPower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerPreCommitDepositForPower(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.StateMinerPreCommitDepositForPower(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateMinerPreCommitDepositForPower(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) {
+ return s.Internal.StateMinerProvingDeadline(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerRecoveries(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) {
+ return s.Internal.StateMinerRecoveries(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMinerRecoveries(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) {
+ return *new(bitfield.BitField), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerSectorAllocated(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (bool, error) {
+ return s.Internal.StateMinerSectorAllocated(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateMinerSectorAllocated(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerSectorCount(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerSectors, error) {
+ return s.Internal.StateMinerSectorCount(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateMinerSectorCount(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerSectors, error) {
+ return *new(MinerSectors), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateMinerSectors(p0 context.Context, p1 address.Address, p2 *bitfield.BitField, p3 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
+ return s.Internal.StateMinerSectors(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateMinerSectors(p0 context.Context, p1 address.Address, p2 *bitfield.BitField, p3 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
+ return *new([]*miner.SectorOnChainInfo), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) {
+ return s.Internal.StateNetworkName(p0)
+}
+
+func (s *FullNodeStub) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) {
+ return *new(dtypes.NetworkName), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) {
+ return s.Internal.StateNetworkVersion(p0, p1)
+}
+
+func (s *FullNodeStub) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) {
+ return *new(apitypes.NetworkVersion), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateReadState(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*ActorState, error) {
+ return s.Internal.StateReadState(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateReadState(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*ActorState, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateReplay(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*InvocResult, error) {
+ return s.Internal.StateReplay(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateReplay(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*InvocResult, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateSearchMsg(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) {
+ return s.Internal.StateSearchMsg(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) StateSearchMsg(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) {
+ return s.Internal.StateSectorExpiration(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
+ return s.Internal.StateSectorGetInfo(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) {
+ return s.Internal.StateSectorPartition(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateSectorPreCommitInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) {
+ return s.Internal.StateSectorPreCommitInfo(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) StateSectorPreCommitInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) {
+ return *new(miner.SectorPreCommitOnChainInfo), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateVMCirculatingSupplyInternal(p0 context.Context, p1 types.TipSetKey) (CirculatingSupply, error) {
+ return s.Internal.StateVMCirculatingSupplyInternal(p0, p1)
+}
+
+func (s *FullNodeStub) StateVMCirculatingSupplyInternal(p0 context.Context, p1 types.TipSetKey) (CirculatingSupply, error) {
+ return *new(CirculatingSupply), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
+ return s.Internal.StateVerifiedClientStatus(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateVerifiedRegistryRootKey(p0 context.Context, p1 types.TipSetKey) (address.Address, error) {
+ return s.Internal.StateVerifiedRegistryRootKey(p0, p1)
+}
+
+func (s *FullNodeStub) StateVerifiedRegistryRootKey(p0 context.Context, p1 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateVerifierStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
+ return s.Internal.StateVerifierStatus(p0, p1, p2)
+}
+
+func (s *FullNodeStub) StateVerifierStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) {
+ return s.Internal.StateWaitMsg(p0, p1, p2, p3, p4)
+}
+
+func (s *FullNodeStub) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) SyncCheckBad(p0 context.Context, p1 cid.Cid) (string, error) {
+ return s.Internal.SyncCheckBad(p0, p1)
+}
+
+func (s *FullNodeStub) SyncCheckBad(p0 context.Context, p1 cid.Cid) (string, error) {
+ return "", xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) SyncCheckpoint(p0 context.Context, p1 types.TipSetKey) error {
+ return s.Internal.SyncCheckpoint(p0, p1)
+}
+
+func (s *FullNodeStub) SyncCheckpoint(p0 context.Context, p1 types.TipSetKey) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) SyncIncomingBlocks(p0 context.Context) (<-chan *types.BlockHeader, error) {
+ return s.Internal.SyncIncomingBlocks(p0)
+}
+
+func (s *FullNodeStub) SyncIncomingBlocks(p0 context.Context) (<-chan *types.BlockHeader, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) SyncMarkBad(p0 context.Context, p1 cid.Cid) error {
+ return s.Internal.SyncMarkBad(p0, p1)
+}
+
+func (s *FullNodeStub) SyncMarkBad(p0 context.Context, p1 cid.Cid) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) SyncState(p0 context.Context) (*SyncState, error) {
+ return s.Internal.SyncState(p0)
+}
+
+func (s *FullNodeStub) SyncState(p0 context.Context) (*SyncState, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) SyncSubmitBlock(p0 context.Context, p1 *types.BlockMsg) error {
+ return s.Internal.SyncSubmitBlock(p0, p1)
+}
+
+func (s *FullNodeStub) SyncSubmitBlock(p0 context.Context, p1 *types.BlockMsg) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) SyncUnmarkAllBad(p0 context.Context) error {
+ return s.Internal.SyncUnmarkAllBad(p0)
+}
+
+func (s *FullNodeStub) SyncUnmarkAllBad(p0 context.Context) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) SyncUnmarkBad(p0 context.Context, p1 cid.Cid) error {
+ return s.Internal.SyncUnmarkBad(p0, p1)
+}
+
+func (s *FullNodeStub) SyncUnmarkBad(p0 context.Context, p1 cid.Cid) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) SyncValidateTipset(p0 context.Context, p1 types.TipSetKey) (bool, error) {
+ return s.Internal.SyncValidateTipset(p0, p1)
+}
+
+func (s *FullNodeStub) SyncValidateTipset(p0 context.Context, p1 types.TipSetKey) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return s.Internal.WalletBalance(p0, p1)
+}
+
+func (s *FullNodeStub) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletDefaultAddress(p0 context.Context) (address.Address, error) {
+ return s.Internal.WalletDefaultAddress(p0)
+}
+
+func (s *FullNodeStub) WalletDefaultAddress(p0 context.Context) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletDelete(p0 context.Context, p1 address.Address) error {
+ return s.Internal.WalletDelete(p0, p1)
+}
+
+func (s *FullNodeStub) WalletDelete(p0 context.Context, p1 address.Address) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) {
+ return s.Internal.WalletExport(p0, p1)
+}
+
+func (s *FullNodeStub) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletHas(p0 context.Context, p1 address.Address) (bool, error) {
+ return s.Internal.WalletHas(p0, p1)
+}
+
+func (s *FullNodeStub) WalletHas(p0 context.Context, p1 address.Address) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) {
+ return s.Internal.WalletImport(p0, p1)
+}
+
+func (s *FullNodeStub) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletList(p0 context.Context) ([]address.Address, error) {
+ return s.Internal.WalletList(p0)
+}
+
+func (s *FullNodeStub) WalletList(p0 context.Context) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error) {
+ return s.Internal.WalletNew(p0, p1)
+}
+
+func (s *FullNodeStub) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletSetDefault(p0 context.Context, p1 address.Address) error {
+ return s.Internal.WalletSetDefault(p0, p1)
+}
+
+func (s *FullNodeStub) WalletSetDefault(p0 context.Context, p1 address.Address) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletSign(p0 context.Context, p1 address.Address, p2 []byte) (*crypto.Signature, error) {
+ return s.Internal.WalletSign(p0, p1, p2)
+}
+
+func (s *FullNodeStub) WalletSign(p0 context.Context, p1 address.Address, p2 []byte) (*crypto.Signature, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletSignMessage(p0 context.Context, p1 address.Address, p2 *types.Message) (*types.SignedMessage, error) {
+ return s.Internal.WalletSignMessage(p0, p1, p2)
+}
+
+func (s *FullNodeStub) WalletSignMessage(p0 context.Context, p1 address.Address, p2 *types.Message) (*types.SignedMessage, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletValidateAddress(p0 context.Context, p1 string) (address.Address, error) {
+ return s.Internal.WalletValidateAddress(p0, p1)
+}
+
+func (s *FullNodeStub) WalletValidateAddress(p0 context.Context, p1 string) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) WalletVerify(p0 context.Context, p1 address.Address, p2 []byte, p3 *crypto.Signature) (bool, error) {
+ return s.Internal.WalletVerify(p0, p1, p2, p3)
+}
+
+func (s *FullNodeStub) WalletVerify(p0 context.Context, p1 address.Address, p2 []byte, p3 *crypto.Signature) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) {
+ return s.Internal.ChainGetBlockMessages(p0, p1)
+}
+
+func (s *GatewayStub) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) {
+ return s.Internal.ChainGetMessage(p0, p1)
+}
+
+func (s *GatewayStub) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) {
+ return s.Internal.ChainGetTipSet(p0, p1)
+}
+
+func (s *GatewayStub) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) {
+ return s.Internal.ChainGetTipSetByHeight(p0, p1, p2)
+}
+
+func (s *GatewayStub) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return s.Internal.ChainHasObj(p0, p1)
+}
+
+func (s *GatewayStub) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) ChainHead(p0 context.Context) (*types.TipSet, error) {
+ return s.Internal.ChainHead(p0)
+}
+
+func (s *GatewayStub) ChainHead(p0 context.Context) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) ChainNotify(p0 context.Context) (<-chan []*HeadChange, error) {
+ return s.Internal.ChainNotify(p0)
+}
+
+func (s *GatewayStub) ChainNotify(p0 context.Context) (<-chan []*HeadChange, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
+ return s.Internal.ChainReadObj(p0, p1)
+}
+
+func (s *GatewayStub) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
+ return *new([]byte), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
+ return s.Internal.GasEstimateMessageGas(p0, p1, p2, p3)
+}
+
+func (s *GatewayStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
+ return s.Internal.MpoolPush(p0, p1)
+}
+
+func (s *GatewayStub) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.MsigGetAvailableBalance(p0, p1, p2)
+}
+
+func (s *GatewayStub) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*MsigTransaction, error) {
+ return s.Internal.MsigGetPending(p0, p1, p2)
+}
+
+func (s *GatewayStub) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*MsigTransaction, error) {
+ return *new([]*MsigTransaction), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) {
+ return s.Internal.MsigGetVested(p0, p1, p2, p3)
+}
+
+func (s *GatewayStub) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return s.Internal.StateAccountKey(p0, p1, p2)
+}
+
+func (s *GatewayStub) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (DealCollateralBounds, error) {
+ return s.Internal.StateDealProviderCollateralBounds(p0, p1, p2, p3)
+}
+
+func (s *GatewayStub) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (DealCollateralBounds, error) {
+ return *new(DealCollateralBounds), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) {
+ return s.Internal.StateGetActor(p0, p1, p2)
+}
+
+func (s *GatewayStub) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
+ return s.Internal.StateListMiners(p0, p1)
+}
+
+func (s *GatewayStub) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return s.Internal.StateLookupID(p0, p1, p2)
+}
+
+func (s *GatewayStub) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) {
+ return s.Internal.StateMarketBalance(p0, p1, p2)
+}
+
+func (s *GatewayStub) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) {
+ return *new(MarketBalance), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*MarketDeal, error) {
+ return s.Internal.StateMarketStorageDeal(p0, p1, p2)
+}
+
+func (s *GatewayStub) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*MarketDeal, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
+ return s.Internal.StateMinerInfo(p0, p1, p2)
+}
+
+func (s *GatewayStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
+ return *new(miner.MinerInfo), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*MinerPower, error) {
+ return s.Internal.StateMinerPower(p0, p1, p2)
+}
+
+func (s *GatewayStub) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*MinerPower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) {
+ return s.Internal.StateMinerProvingDeadline(p0, p1, p2)
+}
+
+func (s *GatewayStub) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) {
+ return s.Internal.StateNetworkVersion(p0, p1)
+}
+
+func (s *GatewayStub) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) {
+ return *new(apitypes.NetworkVersion), xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateSearchMsg(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) {
+ return s.Internal.StateSearchMsg(p0, p1, p2, p3, p4)
+}
+
+func (s *GatewayStub) StateSearchMsg(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
+ return s.Internal.StateSectorGetInfo(p0, p1, p2, p3)
+}
+
+func (s *GatewayStub) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
+ return s.Internal.StateVerifiedClientStatus(p0, p1, p2)
+}
+
+func (s *GatewayStub) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) {
+ return s.Internal.StateWaitMsg(p0, p1, p2, p3, p4)
+}
+
+func (s *GatewayStub) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return s.Internal.WalletBalance(p0, p1)
+}
+
+func (s *GatewayStub) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
+func (s *SignableStruct) Sign(p0 context.Context, p1 SignFunc) error {
+ return s.Internal.Sign(p0, p1)
+}
+
+func (s *SignableStub) Sign(p0 context.Context, p1 SignFunc) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ActorAddress(p0 context.Context) (address.Address, error) {
+ return s.Internal.ActorAddress(p0)
+}
+
+func (s *StorageMinerStub) ActorAddress(p0 context.Context) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ActorAddressConfig(p0 context.Context) (AddressConfig, error) {
+ return s.Internal.ActorAddressConfig(p0)
+}
+
+func (s *StorageMinerStub) ActorAddressConfig(p0 context.Context) (AddressConfig, error) {
+ return *new(AddressConfig), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ActorSectorSize(p0 context.Context, p1 address.Address) (abi.SectorSize, error) {
+ return s.Internal.ActorSectorSize(p0, p1)
+}
+
+func (s *StorageMinerStub) ActorSectorSize(p0 context.Context, p1 address.Address) (abi.SectorSize, error) {
+ return *new(abi.SectorSize), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) {
+ return s.Internal.CheckProvable(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) {
+ return *new(map[abi.SectorNumber]string), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ComputeProof(p0 context.Context, p1 []builtin.SectorInfo, p2 abi.PoStRandomness) ([]builtin.PoStProof, error) {
+ return s.Internal.ComputeProof(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) ComputeProof(p0 context.Context, p1 []builtin.SectorInfo, p2 abi.PoStRandomness) ([]builtin.PoStProof, error) {
+ return *new([]builtin.PoStProof), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) CreateBackup(p0 context.Context, p1 string) error {
+ return s.Internal.CreateBackup(p0, p1)
+}
+
+func (s *StorageMinerStub) CreateBackup(p0 context.Context, p1 string) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsConsiderOfflineRetrievalDeals(p0 context.Context) (bool, error) {
+ return s.Internal.DealsConsiderOfflineRetrievalDeals(p0)
+}
+
+func (s *StorageMinerStub) DealsConsiderOfflineRetrievalDeals(p0 context.Context) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsConsiderOfflineStorageDeals(p0 context.Context) (bool, error) {
+ return s.Internal.DealsConsiderOfflineStorageDeals(p0)
+}
+
+func (s *StorageMinerStub) DealsConsiderOfflineStorageDeals(p0 context.Context) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsConsiderOnlineRetrievalDeals(p0 context.Context) (bool, error) {
+ return s.Internal.DealsConsiderOnlineRetrievalDeals(p0)
+}
+
+func (s *StorageMinerStub) DealsConsiderOnlineRetrievalDeals(p0 context.Context) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsConsiderOnlineStorageDeals(p0 context.Context) (bool, error) {
+ return s.Internal.DealsConsiderOnlineStorageDeals(p0)
+}
+
+func (s *StorageMinerStub) DealsConsiderOnlineStorageDeals(p0 context.Context) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsConsiderUnverifiedStorageDeals(p0 context.Context) (bool, error) {
+ return s.Internal.DealsConsiderUnverifiedStorageDeals(p0)
+}
+
+func (s *StorageMinerStub) DealsConsiderUnverifiedStorageDeals(p0 context.Context) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsConsiderVerifiedStorageDeals(p0 context.Context) (bool, error) {
+ return s.Internal.DealsConsiderVerifiedStorageDeals(p0)
+}
+
+func (s *StorageMinerStub) DealsConsiderVerifiedStorageDeals(p0 context.Context) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error {
+ return s.Internal.DealsImportData(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsList(p0 context.Context) ([]MarketDeal, error) {
+ return s.Internal.DealsList(p0)
+}
+
+func (s *StorageMinerStub) DealsList(p0 context.Context) ([]MarketDeal, error) {
+ return *new([]MarketDeal), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsPieceCidBlocklist(p0 context.Context) ([]cid.Cid, error) {
+ return s.Internal.DealsPieceCidBlocklist(p0)
+}
+
+func (s *StorageMinerStub) DealsPieceCidBlocklist(p0 context.Context) ([]cid.Cid, error) {
+ return *new([]cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsSetConsiderOfflineRetrievalDeals(p0 context.Context, p1 bool) error {
+ return s.Internal.DealsSetConsiderOfflineRetrievalDeals(p0, p1)
+}
+
+func (s *StorageMinerStub) DealsSetConsiderOfflineRetrievalDeals(p0 context.Context, p1 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsSetConsiderOfflineStorageDeals(p0 context.Context, p1 bool) error {
+ return s.Internal.DealsSetConsiderOfflineStorageDeals(p0, p1)
+}
+
+func (s *StorageMinerStub) DealsSetConsiderOfflineStorageDeals(p0 context.Context, p1 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsSetConsiderOnlineRetrievalDeals(p0 context.Context, p1 bool) error {
+ return s.Internal.DealsSetConsiderOnlineRetrievalDeals(p0, p1)
+}
+
+func (s *StorageMinerStub) DealsSetConsiderOnlineRetrievalDeals(p0 context.Context, p1 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsSetConsiderOnlineStorageDeals(p0 context.Context, p1 bool) error {
+ return s.Internal.DealsSetConsiderOnlineStorageDeals(p0, p1)
+}
+
+func (s *StorageMinerStub) DealsSetConsiderOnlineStorageDeals(p0 context.Context, p1 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsSetConsiderUnverifiedStorageDeals(p0 context.Context, p1 bool) error {
+ return s.Internal.DealsSetConsiderUnverifiedStorageDeals(p0, p1)
+}
+
+func (s *StorageMinerStub) DealsSetConsiderUnverifiedStorageDeals(p0 context.Context, p1 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsSetConsiderVerifiedStorageDeals(p0 context.Context, p1 bool) error {
+ return s.Internal.DealsSetConsiderVerifiedStorageDeals(p0, p1)
+}
+
+func (s *StorageMinerStub) DealsSetConsiderVerifiedStorageDeals(p0 context.Context, p1 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) DealsSetPieceCidBlocklist(p0 context.Context, p1 []cid.Cid) error {
+ return s.Internal.DealsSetPieceCidBlocklist(p0, p1)
+}
+
+func (s *StorageMinerStub) DealsSetPieceCidBlocklist(p0 context.Context, p1 []cid.Cid) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return s.Internal.MarketCancelDataTransfer(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) MarketCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) {
+ return s.Internal.MarketDataTransferUpdates(p0)
+}
+
+func (s *StorageMinerStub) MarketDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketGetAsk(p0 context.Context) (*storagemarket.SignedStorageAsk, error) {
+ return s.Internal.MarketGetAsk(p0)
+}
+
+func (s *StorageMinerStub) MarketGetAsk(p0 context.Context) (*storagemarket.SignedStorageAsk, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketGetDealUpdates(p0 context.Context) (<-chan storagemarket.MinerDeal, error) {
+ return s.Internal.MarketGetDealUpdates(p0)
+}
+
+func (s *StorageMinerStub) MarketGetDealUpdates(p0 context.Context) (<-chan storagemarket.MinerDeal, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketGetRetrievalAsk(p0 context.Context) (*retrievalmarket.Ask, error) {
+ return s.Internal.MarketGetRetrievalAsk(p0)
+}
+
+func (s *StorageMinerStub) MarketGetRetrievalAsk(p0 context.Context) (*retrievalmarket.Ask, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketImportDealData(p0 context.Context, p1 cid.Cid, p2 string) error {
+ return s.Internal.MarketImportDealData(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) MarketImportDealData(p0 context.Context, p1 cid.Cid, p2 string) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) {
+ return s.Internal.MarketListDataTransfers(p0)
+}
+
+func (s *StorageMinerStub) MarketListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) {
+ return *new([]DataTransferChannel), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketListDeals(p0 context.Context) ([]MarketDeal, error) {
+ return s.Internal.MarketListDeals(p0)
+}
+
+func (s *StorageMinerStub) MarketListDeals(p0 context.Context) ([]MarketDeal, error) {
+ return *new([]MarketDeal), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketListIncompleteDeals(p0 context.Context) ([]storagemarket.MinerDeal, error) {
+ return s.Internal.MarketListIncompleteDeals(p0)
+}
+
+func (s *StorageMinerStub) MarketListIncompleteDeals(p0 context.Context) ([]storagemarket.MinerDeal, error) {
+ return *new([]storagemarket.MinerDeal), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketListRetrievalDeals(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) {
+ return s.Internal.MarketListRetrievalDeals(p0)
+}
+
+func (s *StorageMinerStub) MarketListRetrievalDeals(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) {
+ return *new([]retrievalmarket.ProviderDealState), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketPendingDeals(p0 context.Context) (PendingDealInfo, error) {
+ return s.Internal.MarketPendingDeals(p0)
+}
+
+func (s *StorageMinerStub) MarketPendingDeals(p0 context.Context) (PendingDealInfo, error) {
+ return *new(PendingDealInfo), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketPublishPendingDeals(p0 context.Context) error {
+ return s.Internal.MarketPublishPendingDeals(p0)
+}
+
+func (s *StorageMinerStub) MarketPublishPendingDeals(p0 context.Context) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return s.Internal.MarketRestartDataTransfer(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) MarketRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketSetAsk(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error {
+ return s.Internal.MarketSetAsk(p0, p1, p2, p3, p4, p5)
+}
+
+func (s *StorageMinerStub) MarketSetAsk(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MarketSetRetrievalAsk(p0 context.Context, p1 *retrievalmarket.Ask) error {
+ return s.Internal.MarketSetRetrievalAsk(p0, p1)
+}
+
+func (s *StorageMinerStub) MarketSetRetrievalAsk(p0 context.Context, p1 *retrievalmarket.Ask) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) MiningBase(p0 context.Context) (*types.TipSet, error) {
+ return s.Internal.MiningBase(p0)
+}
+
+func (s *StorageMinerStub) MiningBase(p0 context.Context) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) PiecesGetCIDInfo(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) {
+ return s.Internal.PiecesGetCIDInfo(p0, p1)
+}
+
+func (s *StorageMinerStub) PiecesGetCIDInfo(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) PiecesGetPieceInfo(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) {
+ return s.Internal.PiecesGetPieceInfo(p0, p1)
+}
+
+func (s *StorageMinerStub) PiecesGetPieceInfo(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) PiecesListCidInfos(p0 context.Context) ([]cid.Cid, error) {
+ return s.Internal.PiecesListCidInfos(p0)
+}
+
+func (s *StorageMinerStub) PiecesListCidInfos(p0 context.Context) ([]cid.Cid, error) {
+ return *new([]cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) PiecesListPieces(p0 context.Context) ([]cid.Cid, error) {
+ return s.Internal.PiecesListPieces(p0)
+}
+
+func (s *StorageMinerStub) PiecesListPieces(p0 context.Context) ([]cid.Cid, error) {
+ return *new([]cid.Cid), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) PledgeSector(p0 context.Context) (abi.SectorID, error) {
+ return s.Internal.PledgeSector(p0)
+}
+
+func (s *StorageMinerStub) PledgeSector(p0 context.Context) (abi.SectorID, error) {
+ return *new(abi.SectorID), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnAddPiece(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error {
+ return s.Internal.ReturnAddPiece(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) ReturnAddPiece(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnFetch(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return s.Internal.ReturnFetch(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) ReturnFetch(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnFinalizeSector(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return s.Internal.ReturnFinalizeSector(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) ReturnFinalizeSector(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnMoveStorage(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return s.Internal.ReturnMoveStorage(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) ReturnMoveStorage(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnReadPiece(p0 context.Context, p1 storiface.CallID, p2 bool, p3 *storiface.CallError) error {
+ return s.Internal.ReturnReadPiece(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) ReturnReadPiece(p0 context.Context, p1 storiface.CallID, p2 bool, p3 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnReleaseUnsealed(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return s.Internal.ReturnReleaseUnsealed(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) ReturnReleaseUnsealed(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnSealCommit1(p0 context.Context, p1 storiface.CallID, p2 storage.Commit1Out, p3 *storiface.CallError) error {
+ return s.Internal.ReturnSealCommit1(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) ReturnSealCommit1(p0 context.Context, p1 storiface.CallID, p2 storage.Commit1Out, p3 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnSealCommit2(p0 context.Context, p1 storiface.CallID, p2 storage.Proof, p3 *storiface.CallError) error {
+ return s.Internal.ReturnSealCommit2(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) ReturnSealCommit2(p0 context.Context, p1 storiface.CallID, p2 storage.Proof, p3 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnSealPreCommit1(p0 context.Context, p1 storiface.CallID, p2 storage.PreCommit1Out, p3 *storiface.CallError) error {
+ return s.Internal.ReturnSealPreCommit1(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) ReturnSealPreCommit1(p0 context.Context, p1 storiface.CallID, p2 storage.PreCommit1Out, p3 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnSealPreCommit2(p0 context.Context, p1 storiface.CallID, p2 storage.SectorCids, p3 *storiface.CallError) error {
+ return s.Internal.ReturnSealPreCommit2(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) ReturnSealPreCommit2(p0 context.Context, p1 storiface.CallID, p2 storage.SectorCids, p3 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) ReturnUnsealPiece(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return s.Internal.ReturnUnsealPiece(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) ReturnUnsealPiece(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SealingAbort(p0 context.Context, p1 storiface.CallID) error {
+ return s.Internal.SealingAbort(p0, p1)
+}
+
+func (s *StorageMinerStub) SealingAbort(p0 context.Context, p1 storiface.CallID) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SealingSchedDiag(p0 context.Context, p1 bool) (interface{}, error) {
+ return s.Internal.SealingSchedDiag(p0, p1)
+}
+
+func (s *StorageMinerStub) SealingSchedDiag(p0 context.Context, p1 bool) (interface{}, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorCommitFlush(p0 context.Context) ([]sealiface.CommitBatchRes, error) {
+ return s.Internal.SectorCommitFlush(p0)
+}
+
+func (s *StorageMinerStub) SectorCommitFlush(p0 context.Context) ([]sealiface.CommitBatchRes, error) {
+ return *new([]sealiface.CommitBatchRes), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorCommitPending(p0 context.Context) ([]abi.SectorID, error) {
+ return s.Internal.SectorCommitPending(p0)
+}
+
+func (s *StorageMinerStub) SectorCommitPending(p0 context.Context) ([]abi.SectorID, error) {
+ return *new([]abi.SectorID), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorGetExpectedSealDuration(p0 context.Context) (time.Duration, error) {
+ return s.Internal.SectorGetExpectedSealDuration(p0)
+}
+
+func (s *StorageMinerStub) SectorGetExpectedSealDuration(p0 context.Context) (time.Duration, error) {
+ return *new(time.Duration), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorGetSealDelay(p0 context.Context) (time.Duration, error) {
+ return s.Internal.SectorGetSealDelay(p0)
+}
+
+func (s *StorageMinerStub) SectorGetSealDelay(p0 context.Context) (time.Duration, error) {
+ return *new(time.Duration), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorMarkForUpgrade(p0 context.Context, p1 abi.SectorNumber) error {
+ return s.Internal.SectorMarkForUpgrade(p0, p1)
+}
+
+func (s *StorageMinerStub) SectorMarkForUpgrade(p0 context.Context, p1 abi.SectorNumber) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorPreCommitFlush(p0 context.Context) ([]sealiface.PreCommitBatchRes, error) {
+ return s.Internal.SectorPreCommitFlush(p0)
+}
+
+func (s *StorageMinerStub) SectorPreCommitFlush(p0 context.Context) ([]sealiface.PreCommitBatchRes, error) {
+ return *new([]sealiface.PreCommitBatchRes), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorPreCommitPending(p0 context.Context) ([]abi.SectorID, error) {
+ return s.Internal.SectorPreCommitPending(p0)
+}
+
+func (s *StorageMinerStub) SectorPreCommitPending(p0 context.Context) ([]abi.SectorID, error) {
+ return *new([]abi.SectorID), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorRemove(p0 context.Context, p1 abi.SectorNumber) error {
+ return s.Internal.SectorRemove(p0, p1)
+}
+
+func (s *StorageMinerStub) SectorRemove(p0 context.Context, p1 abi.SectorNumber) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorSetExpectedSealDuration(p0 context.Context, p1 time.Duration) error {
+ return s.Internal.SectorSetExpectedSealDuration(p0, p1)
+}
+
+func (s *StorageMinerStub) SectorSetExpectedSealDuration(p0 context.Context, p1 time.Duration) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorSetSealDelay(p0 context.Context, p1 time.Duration) error {
+ return s.Internal.SectorSetSealDelay(p0, p1)
+}
+
+func (s *StorageMinerStub) SectorSetSealDelay(p0 context.Context, p1 time.Duration) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorStartSealing(p0 context.Context, p1 abi.SectorNumber) error {
+ return s.Internal.SectorStartSealing(p0, p1)
+}
+
+func (s *StorageMinerStub) SectorStartSealing(p0 context.Context, p1 abi.SectorNumber) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorTerminate(p0 context.Context, p1 abi.SectorNumber) error {
+ return s.Internal.SectorTerminate(p0, p1)
+}
+
+func (s *StorageMinerStub) SectorTerminate(p0 context.Context, p1 abi.SectorNumber) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorTerminateFlush(p0 context.Context) (*cid.Cid, error) {
+ return s.Internal.SectorTerminateFlush(p0)
+}
+
+func (s *StorageMinerStub) SectorTerminateFlush(p0 context.Context) (*cid.Cid, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorTerminatePending(p0 context.Context) ([]abi.SectorID, error) {
+ return s.Internal.SectorTerminatePending(p0)
+}
+
+func (s *StorageMinerStub) SectorTerminatePending(p0 context.Context) ([]abi.SectorID, error) {
+ return *new([]abi.SectorID), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorsList(p0 context.Context) ([]abi.SectorNumber, error) {
+ return s.Internal.SectorsList(p0)
+}
+
+func (s *StorageMinerStub) SectorsList(p0 context.Context) ([]abi.SectorNumber, error) {
+ return *new([]abi.SectorNumber), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorsListInStates(p0 context.Context, p1 []SectorState) ([]abi.SectorNumber, error) {
+ return s.Internal.SectorsListInStates(p0, p1)
+}
+
+func (s *StorageMinerStub) SectorsListInStates(p0 context.Context, p1 []SectorState) ([]abi.SectorNumber, error) {
+ return *new([]abi.SectorNumber), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorsRefs(p0 context.Context) (map[string][]SealedRef, error) {
+ return s.Internal.SectorsRefs(p0)
+}
+
+func (s *StorageMinerStub) SectorsRefs(p0 context.Context) (map[string][]SealedRef, error) {
+ return *new(map[string][]SealedRef), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorsStatus(p0 context.Context, p1 abi.SectorNumber, p2 bool) (SectorInfo, error) {
+ return s.Internal.SectorsStatus(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) SectorsStatus(p0 context.Context, p1 abi.SectorNumber, p2 bool) (SectorInfo, error) {
+ return *new(SectorInfo), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorsSummary(p0 context.Context) (map[SectorState]int, error) {
+ return s.Internal.SectorsSummary(p0)
+}
+
+func (s *StorageMinerStub) SectorsSummary(p0 context.Context) (map[SectorState]int, error) {
+ return *new(map[SectorState]int), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) SectorsUpdate(p0 context.Context, p1 abi.SectorNumber, p2 SectorState) error {
+ return s.Internal.SectorsUpdate(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) SectorsUpdate(p0 context.Context, p1 abi.SectorNumber, p2 SectorState) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageAddLocal(p0 context.Context, p1 string) error {
+ return s.Internal.StorageAddLocal(p0, p1)
+}
+
+func (s *StorageMinerStub) StorageAddLocal(p0 context.Context, p1 string) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageAttach(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error {
+ return s.Internal.StorageAttach(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) StorageAttach(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageBestAlloc(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) {
+ return s.Internal.StorageBestAlloc(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) StorageBestAlloc(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) {
+ return *new([]stores.StorageInfo), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageDeclareSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error {
+ return s.Internal.StorageDeclareSector(p0, p1, p2, p3, p4)
+}
+
+func (s *StorageMinerStub) StorageDeclareSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageDropSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error {
+ return s.Internal.StorageDropSector(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) StorageDropSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageFindSector(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) {
+ return s.Internal.StorageFindSector(p0, p1, p2, p3, p4)
+}
+
+func (s *StorageMinerStub) StorageFindSector(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) {
+ return *new([]stores.SectorStorageInfo), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageInfo(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) {
+ return s.Internal.StorageInfo(p0, p1)
+}
+
+func (s *StorageMinerStub) StorageInfo(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) {
+ return *new(stores.StorageInfo), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageList(p0 context.Context) (map[stores.ID][]stores.Decl, error) {
+ return s.Internal.StorageList(p0)
+}
+
+func (s *StorageMinerStub) StorageList(p0 context.Context) (map[stores.ID][]stores.Decl, error) {
+ return *new(map[stores.ID][]stores.Decl), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageLocal(p0 context.Context) (map[stores.ID]string, error) {
+ return s.Internal.StorageLocal(p0)
+}
+
+func (s *StorageMinerStub) StorageLocal(p0 context.Context) (map[stores.ID]string, error) {
+ return *new(map[stores.ID]string), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageLock(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) error {
+ return s.Internal.StorageLock(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) StorageLock(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageReportHealth(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error {
+ return s.Internal.StorageReportHealth(p0, p1, p2)
+}
+
+func (s *StorageMinerStub) StorageReportHealth(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageStat(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) {
+ return s.Internal.StorageStat(p0, p1)
+}
+
+func (s *StorageMinerStub) StorageStat(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) {
+ return *new(fsutil.FsStat), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) StorageTryLock(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) (bool, error) {
+ return s.Internal.StorageTryLock(p0, p1, p2, p3)
+}
+
+func (s *StorageMinerStub) StorageTryLock(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) WorkerConnect(p0 context.Context, p1 string) error {
+ return s.Internal.WorkerConnect(p0, p1)
+}
+
+func (s *StorageMinerStub) WorkerConnect(p0 context.Context, p1 string) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) WorkerJobs(p0 context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) {
+ return s.Internal.WorkerJobs(p0)
+}
+
+func (s *StorageMinerStub) WorkerJobs(p0 context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) {
+ return *new(map[uuid.UUID][]storiface.WorkerJob), xerrors.New("method not supported")
+}
+
+func (s *StorageMinerStruct) WorkerStats(p0 context.Context) (map[uuid.UUID]storiface.WorkerStats, error) {
+ return s.Internal.WorkerStats(p0)
+}
+
+func (s *StorageMinerStub) WorkerStats(p0 context.Context) (map[uuid.UUID]storiface.WorkerStats, error) {
+ return *new(map[uuid.UUID]storiface.WorkerStats), xerrors.New("method not supported")
+}
+
+func (s *WalletStruct) WalletDelete(p0 context.Context, p1 address.Address) error {
+ return s.Internal.WalletDelete(p0, p1)
+}
+
+func (s *WalletStub) WalletDelete(p0 context.Context, p1 address.Address) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *WalletStruct) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) {
+ return s.Internal.WalletExport(p0, p1)
+}
+
+func (s *WalletStub) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *WalletStruct) WalletHas(p0 context.Context, p1 address.Address) (bool, error) {
+ return s.Internal.WalletHas(p0, p1)
+}
+
+func (s *WalletStub) WalletHas(p0 context.Context, p1 address.Address) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *WalletStruct) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) {
+ return s.Internal.WalletImport(p0, p1)
+}
+
+func (s *WalletStub) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *WalletStruct) WalletList(p0 context.Context) ([]address.Address, error) {
+ return s.Internal.WalletList(p0)
+}
+
+func (s *WalletStub) WalletList(p0 context.Context) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
+func (s *WalletStruct) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error) {
+ return s.Internal.WalletNew(p0, p1)
+}
+
+func (s *WalletStub) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
+func (s *WalletStruct) WalletSign(p0 context.Context, p1 address.Address, p2 []byte, p3 MsgMeta) (*crypto.Signature, error) {
+ return s.Internal.WalletSign(p0, p1, p2, p3)
+}
+
+func (s *WalletStub) WalletSign(p0 context.Context, p1 address.Address, p2 []byte, p3 MsgMeta) (*crypto.Signature, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) AddPiece(p0 context.Context, p1 storage.SectorRef, p2 []abi.UnpaddedPieceSize, p3 abi.UnpaddedPieceSize, p4 storage.Data) (storiface.CallID, error) {
+ return s.Internal.AddPiece(p0, p1, p2, p3, p4)
+}
+
+func (s *WorkerStub) AddPiece(p0 context.Context, p1 storage.SectorRef, p2 []abi.UnpaddedPieceSize, p3 abi.UnpaddedPieceSize, p4 storage.Data) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) Enabled(p0 context.Context) (bool, error) {
+ return s.Internal.Enabled(p0)
+}
+
+func (s *WorkerStub) Enabled(p0 context.Context) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) Fetch(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) {
+ return s.Internal.Fetch(p0, p1, p2, p3, p4)
+}
+
+func (s *WorkerStub) Fetch(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) FinalizeSector(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) {
+ return s.Internal.FinalizeSector(p0, p1, p2)
+}
+
+func (s *WorkerStub) FinalizeSector(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) Info(p0 context.Context) (storiface.WorkerInfo, error) {
+ return s.Internal.Info(p0)
+}
+
+func (s *WorkerStub) Info(p0 context.Context) (storiface.WorkerInfo, error) {
+ return *new(storiface.WorkerInfo), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) MoveStorage(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType) (storiface.CallID, error) {
+ return s.Internal.MoveStorage(p0, p1, p2)
+}
+
+func (s *WorkerStub) MoveStorage(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) Paths(p0 context.Context) ([]stores.StoragePath, error) {
+ return s.Internal.Paths(p0)
+}
+
+func (s *WorkerStub) Paths(p0 context.Context) ([]stores.StoragePath, error) {
+ return *new([]stores.StoragePath), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) ProcessSession(p0 context.Context) (uuid.UUID, error) {
+ return s.Internal.ProcessSession(p0)
+}
+
+func (s *WorkerStub) ProcessSession(p0 context.Context) (uuid.UUID, error) {
+ return *new(uuid.UUID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) ReleaseUnsealed(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) {
+ return s.Internal.ReleaseUnsealed(p0, p1, p2)
+}
+
+func (s *WorkerStub) ReleaseUnsealed(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) Remove(p0 context.Context, p1 abi.SectorID) error {
+ return s.Internal.Remove(p0, p1)
+}
+
+func (s *WorkerStub) Remove(p0 context.Context, p1 abi.SectorID) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) SealCommit1(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 abi.InteractiveSealRandomness, p4 []abi.PieceInfo, p5 storage.SectorCids) (storiface.CallID, error) {
+ return s.Internal.SealCommit1(p0, p1, p2, p3, p4, p5)
+}
+
+func (s *WorkerStub) SealCommit1(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 abi.InteractiveSealRandomness, p4 []abi.PieceInfo, p5 storage.SectorCids) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) SealCommit2(p0 context.Context, p1 storage.SectorRef, p2 storage.Commit1Out) (storiface.CallID, error) {
+ return s.Internal.SealCommit2(p0, p1, p2)
+}
+
+func (s *WorkerStub) SealCommit2(p0 context.Context, p1 storage.SectorRef, p2 storage.Commit1Out) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) SealPreCommit1(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 []abi.PieceInfo) (storiface.CallID, error) {
+ return s.Internal.SealPreCommit1(p0, p1, p2, p3)
+}
+
+func (s *WorkerStub) SealPreCommit1(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 []abi.PieceInfo) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) SealPreCommit2(p0 context.Context, p1 storage.SectorRef, p2 storage.PreCommit1Out) (storiface.CallID, error) {
+ return s.Internal.SealPreCommit2(p0, p1, p2)
+}
+
+func (s *WorkerStub) SealPreCommit2(p0 context.Context, p1 storage.SectorRef, p2 storage.PreCommit1Out) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) Session(p0 context.Context) (uuid.UUID, error) {
+ return s.Internal.Session(p0)
+}
+
+func (s *WorkerStub) Session(p0 context.Context) (uuid.UUID, error) {
+ return *new(uuid.UUID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) SetEnabled(p0 context.Context, p1 bool) error {
+ return s.Internal.SetEnabled(p0, p1)
+}
+
+func (s *WorkerStub) SetEnabled(p0 context.Context, p1 bool) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) StorageAddLocal(p0 context.Context, p1 string) error {
+ return s.Internal.StorageAddLocal(p0, p1)
+}
+
+func (s *WorkerStub) StorageAddLocal(p0 context.Context, p1 string) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) TaskDisable(p0 context.Context, p1 sealtasks.TaskType) error {
+ return s.Internal.TaskDisable(p0, p1)
+}
+
+func (s *WorkerStub) TaskDisable(p0 context.Context, p1 sealtasks.TaskType) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) TaskEnable(p0 context.Context, p1 sealtasks.TaskType) error {
+ return s.Internal.TaskEnable(p0, p1)
+}
+
+func (s *WorkerStub) TaskEnable(p0 context.Context, p1 sealtasks.TaskType) error {
+ return xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) TaskTypes(p0 context.Context) (map[sealtasks.TaskType]struct{}, error) {
+ return s.Internal.TaskTypes(p0)
+}
+
+func (s *WorkerStub) TaskTypes(p0 context.Context) (map[sealtasks.TaskType]struct{}, error) {
+ return *new(map[sealtasks.TaskType]struct{}), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) UnsealPiece(p0 context.Context, p1 storage.SectorRef, p2 storiface.UnpaddedByteIndex, p3 abi.UnpaddedPieceSize, p4 abi.SealRandomness, p5 cid.Cid) (storiface.CallID, error) {
+ return s.Internal.UnsealPiece(p0, p1, p2, p3, p4, p5)
+}
+
+func (s *WorkerStub) UnsealPiece(p0 context.Context, p1 storage.SectorRef, p2 storiface.UnpaddedByteIndex, p3 abi.UnpaddedPieceSize, p4 abi.SealRandomness, p5 cid.Cid) (storiface.CallID, error) {
+ return *new(storiface.CallID), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) Version(p0 context.Context) (Version, error) {
+ return s.Internal.Version(p0)
+}
+
+func (s *WorkerStub) Version(p0 context.Context) (Version, error) {
+ return *new(Version), xerrors.New("method not supported")
+}
+
+func (s *WorkerStruct) WaitQuiet(p0 context.Context) error {
+ return s.Internal.WaitQuiet(p0)
+}
+
+func (s *WorkerStub) WaitQuiet(p0 context.Context) error {
+ return xerrors.New("method not supported")
+}
+
+var _ ChainIO = new(ChainIOStruct)
+var _ Common = new(CommonStruct)
+var _ FullNode = new(FullNodeStruct)
+var _ Gateway = new(GatewayStruct)
+var _ Signable = new(SignableStruct)
+var _ StorageMiner = new(StorageMinerStruct)
+var _ Wallet = new(WalletStruct)
+var _ Worker = new(WorkerStruct)
diff --git a/api/test/blockminer.go b/api/test/blockminer.go
deleted file mode 100644
index 23af94a36..000000000
--- a/api/test/blockminer.go
+++ /dev/null
@@ -1,61 +0,0 @@
-package test
-
-import (
- "context"
- "fmt"
- "sync/atomic"
- "testing"
- "time"
-
- "github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/lotus/miner"
-)
-
-type BlockMiner struct {
- ctx context.Context
- t *testing.T
- miner TestStorageNode
- blocktime time.Duration
- mine int64
- nulls int64
- done chan struct{}
-}
-
-func NewBlockMiner(ctx context.Context, t *testing.T, miner TestStorageNode, blocktime time.Duration) *BlockMiner {
- return &BlockMiner{
- ctx: ctx,
- t: t,
- miner: miner,
- blocktime: blocktime,
- mine: int64(1),
- done: make(chan struct{}),
- }
-}
-
-func (bm *BlockMiner) MineBlocks() {
- time.Sleep(time.Second)
- go func() {
- defer close(bm.done)
- for atomic.LoadInt64(&bm.mine) == 1 {
- select {
- case <-bm.ctx.Done():
- return
- case <-time.After(bm.blocktime):
- }
-
- nulls := atomic.SwapInt64(&bm.nulls, 0)
- if err := bm.miner.MineOne(bm.ctx, miner.MineReq{
- InjectNulls: abi.ChainEpoch(nulls),
- Done: func(bool, abi.ChainEpoch, error) {},
- }); err != nil {
- bm.t.Error(err)
- }
- }
- }()
-}
-
-func (bm *BlockMiner) Stop() {
- atomic.AddInt64(&bm.mine, -1)
- fmt.Println("shutting down mining")
- <-bm.done
-}
diff --git a/api/test/deals.go b/api/test/deals.go
deleted file mode 100644
index e3432ff0d..000000000
--- a/api/test/deals.go
+++ /dev/null
@@ -1,556 +0,0 @@
-package test
-
-import (
- "bytes"
- "context"
- "fmt"
- "io/ioutil"
- "math/rand"
- "os"
- "path/filepath"
- "testing"
- "time"
-
- "github.com/ipfs/go-cid"
- files "github.com/ipfs/go-ipfs-files"
- "github.com/ipld/go-car"
- "github.com/stretchr/testify/require"
-
- "github.com/filecoin-project/go-fil-markets/storagemarket"
- "github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/build"
- "github.com/filecoin-project/lotus/chain/actors/builtin/market"
- "github.com/filecoin-project/lotus/chain/types"
- sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
- "github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
- "github.com/filecoin-project/lotus/markets/storageadapter"
- "github.com/filecoin-project/lotus/node"
- "github.com/filecoin-project/lotus/node/impl"
- "github.com/filecoin-project/lotus/node/modules/dtypes"
- market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
- ipld "github.com/ipfs/go-ipld-format"
- dag "github.com/ipfs/go-merkledag"
- dstest "github.com/ipfs/go-merkledag/test"
- unixfile "github.com/ipfs/go-unixfs/file"
-)
-
-func TestDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, carExport, fastRet bool, startEpoch abi.ChainEpoch) {
- s := setupOneClientOneMiner(t, b, blocktime)
- defer s.blockMiner.Stop()
-
- MakeDeal(t, s.ctx, 6, s.client, s.miner, carExport, fastRet, startEpoch)
-}
-
-func TestDoubleDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
- s := setupOneClientOneMiner(t, b, blocktime)
- defer s.blockMiner.Stop()
-
- MakeDeal(t, s.ctx, 6, s.client, s.miner, false, false, startEpoch)
- MakeDeal(t, s.ctx, 7, s.client, s.miner, false, false, startEpoch)
-}
-
-func MakeDeal(t *testing.T, ctx context.Context, rseed int, client api.FullNode, miner TestStorageNode, carExport, fastRet bool, startEpoch abi.ChainEpoch) {
- res, data, err := CreateClientFile(ctx, client, rseed)
- if err != nil {
- t.Fatal(err)
- }
-
- fcid := res.Root
- fmt.Println("FILE CID: ", fcid)
-
- deal := startDeal(t, ctx, miner, client, fcid, fastRet, startEpoch)
-
- // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
- time.Sleep(time.Second)
- waitDealSealed(t, ctx, miner, client, deal, false)
-
- // Retrieval
- info, err := client.ClientGetDealInfo(ctx, *deal)
- require.NoError(t, err)
-
- testRetrieval(t, ctx, client, fcid, &info.PieceCID, carExport, data)
-}
-
-func CreateClientFile(ctx context.Context, client api.FullNode, rseed int) (*api.ImportRes, []byte, error) {
- data := make([]byte, 1600)
- rand.New(rand.NewSource(int64(rseed))).Read(data)
-
- dir, err := ioutil.TempDir(os.TempDir(), "test-make-deal-")
- if err != nil {
- return nil, nil, err
- }
-
- path := filepath.Join(dir, "sourcefile.dat")
- err = ioutil.WriteFile(path, data, 0644)
- if err != nil {
- return nil, nil, err
- }
-
- res, err := client.ClientImport(ctx, api.FileRef{Path: path})
- if err != nil {
- return nil, nil, err
- }
- return res, data, nil
-}
-
-func TestPublishDealsBatching(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
- publishPeriod := 10 * time.Second
- maxDealsPerMsg := uint64(2)
-
- // Set max deals per publish deals message to 2
- minerDef := []StorageMiner{{
- Full: 0,
- Opts: node.Override(
- new(*storageadapter.DealPublisher),
- storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{
- Period: publishPeriod,
- MaxDealsPerMsg: maxDealsPerMsg,
- })),
- Preseal: PresealGenesis,
- }}
-
- // Create a connect client and miner node
- n, sn := b(t, OneFull, minerDef)
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
- s := connectAndStartMining(t, b, blocktime, client, miner)
- defer s.blockMiner.Stop()
-
- // Starts a deal and waits until it's published
- runDealTillPublish := func(rseed int) {
- res, _, err := CreateClientFile(s.ctx, s.client, rseed)
- require.NoError(t, err)
-
- upds, err := client.ClientGetDealUpdates(s.ctx)
- require.NoError(t, err)
-
- startDeal(t, s.ctx, s.miner, s.client, res.Root, false, startEpoch)
-
- // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
- time.Sleep(time.Second)
-
- done := make(chan struct{})
- go func() {
- for upd := range upds {
- if upd.DataRef.Root == res.Root && upd.State == storagemarket.StorageDealAwaitingPreCommit {
- done <- struct{}{}
- }
- }
- }()
- <-done
- }
-
- // Run three deals in parallel
- done := make(chan struct{}, maxDealsPerMsg+1)
- for rseed := 1; rseed <= 3; rseed++ {
- rseed := rseed
- go func() {
- runDealTillPublish(rseed)
- done <- struct{}{}
- }()
- }
-
- // Wait for two of the deals to be published
- for i := 0; i < int(maxDealsPerMsg); i++ {
- <-done
- }
-
- // Expect a single PublishStorageDeals message that includes the first two deals
- msgCids, err := s.client.StateListMessages(s.ctx, &api.MessageMatch{To: market.Address}, types.EmptyTSK, 1)
- require.NoError(t, err)
- count := 0
- for _, msgCid := range msgCids {
- msg, err := s.client.ChainGetMessage(s.ctx, msgCid)
- require.NoError(t, err)
-
- if msg.Method == market.Methods.PublishStorageDeals {
- count++
- var pubDealsParams market2.PublishStorageDealsParams
- err = pubDealsParams.UnmarshalCBOR(bytes.NewReader(msg.Params))
- require.NoError(t, err)
- require.Len(t, pubDealsParams.Deals, int(maxDealsPerMsg))
- }
- }
- require.Equal(t, 1, count)
-
- // The third deal should be published once the publish period expires.
- // Allow a little padding as it takes a moment for the state change to
- // be noticed by the client.
- padding := 10 * time.Second
- select {
- case <-time.After(publishPeriod + padding):
- require.Fail(t, "Expected 3rd deal to be published once publish period elapsed")
- case <-done: // Success
- }
-}
-
-func TestBatchDealInput(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
- publishPeriod := 10 * time.Second
- maxDealsPerMsg := uint64(4)
-
- // Set max deals per publish deals message to maxDealsPerMsg
- minerDef := []StorageMiner{{
- Full: 0,
- Opts: node.Options(
- node.Override(
- new(*storageadapter.DealPublisher),
- storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{
- Period: publishPeriod,
- MaxDealsPerMsg: maxDealsPerMsg,
- })),
- node.Override(new(dtypes.GetSealingConfigFunc), func() (dtypes.GetSealingConfigFunc, error) {
- return func() (sealiface.Config, error) {
- return sealiface.Config{
- MaxWaitDealsSectors: 1,
- MaxSealingSectors: 1,
- MaxSealingSectorsForDeals: 2,
- AlwaysKeepUnsealedCopy: true,
- }, nil
- }, nil
- }),
- ),
- Preseal: PresealGenesis,
- }}
-
- // Create a connect client and miner node
- n, sn := b(t, OneFull, minerDef)
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
- s := connectAndStartMining(t, b, blocktime, client, miner)
- defer s.blockMiner.Stop()
-
- // Starts a deal and waits until it's published
- runDealTillSeal := func(rseed int) {
- res, _, err := CreateClientFile(s.ctx, s.client, rseed)
- require.NoError(t, err)
-
- dc := startDeal(t, s.ctx, s.miner, s.client, res.Root, false, startEpoch)
- waitDealSealed(t, s.ctx, s.miner, s.client, dc, false)
- }
-
- // Run maxDealsPerMsg+1 deals in parallel
- done := make(chan struct{}, maxDealsPerMsg+1)
- for rseed := 1; rseed <= int(maxDealsPerMsg+1); rseed++ {
- rseed := rseed
- go func() {
- runDealTillSeal(rseed)
- done <- struct{}{}
- }()
- }
-
- // Wait for maxDealsPerMsg of the deals to be published
- for i := 0; i < int(maxDealsPerMsg); i++ {
- <-done
- }
-
- sl, err := sn[0].SectorsList(s.ctx)
- require.NoError(t, err)
- require.GreaterOrEqual(t, len(sl), 4)
- require.LessOrEqual(t, len(sl), 5)
-}
-
-func TestFastRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
- s := setupOneClientOneMiner(t, b, blocktime)
- defer s.blockMiner.Stop()
-
- data := make([]byte, 1600)
- rand.New(rand.NewSource(int64(8))).Read(data)
-
- r := bytes.NewReader(data)
- fcid, err := s.client.ClientImportLocal(s.ctx, r)
- if err != nil {
- t.Fatal(err)
- }
-
- fmt.Println("FILE CID: ", fcid)
-
- deal := startDeal(t, s.ctx, s.miner, s.client, fcid, true, startEpoch)
-
- waitDealPublished(t, s.ctx, s.miner, deal)
- fmt.Println("deal published, retrieving")
- // Retrieval
- info, err := s.client.ClientGetDealInfo(s.ctx, *deal)
- require.NoError(t, err)
-
- testRetrieval(t, s.ctx, s.client, fcid, &info.PieceCID, false, data)
-}
-
-func TestSecondDealRetrieval(t *testing.T, b APIBuilder, blocktime time.Duration) {
- s := setupOneClientOneMiner(t, b, blocktime)
- defer s.blockMiner.Stop()
-
- {
- data1 := make([]byte, 800)
- rand.New(rand.NewSource(int64(3))).Read(data1)
- r := bytes.NewReader(data1)
-
- fcid1, err := s.client.ClientImportLocal(s.ctx, r)
- if err != nil {
- t.Fatal(err)
- }
-
- data2 := make([]byte, 800)
- rand.New(rand.NewSource(int64(9))).Read(data2)
- r2 := bytes.NewReader(data2)
-
- fcid2, err := s.client.ClientImportLocal(s.ctx, r2)
- if err != nil {
- t.Fatal(err)
- }
-
- deal1 := startDeal(t, s.ctx, s.miner, s.client, fcid1, true, 0)
-
- // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
- time.Sleep(time.Second)
- waitDealSealed(t, s.ctx, s.miner, s.client, deal1, true)
-
- deal2 := startDeal(t, s.ctx, s.miner, s.client, fcid2, true, 0)
-
- time.Sleep(time.Second)
- waitDealSealed(t, s.ctx, s.miner, s.client, deal2, false)
-
- // Retrieval
- info, err := s.client.ClientGetDealInfo(s.ctx, *deal2)
- require.NoError(t, err)
-
- rf, _ := s.miner.SectorsRefs(s.ctx)
- fmt.Printf("refs: %+v\n", rf)
-
- testRetrieval(t, s.ctx, s.client, fcid2, &info.PieceCID, false, data2)
- }
-}
-
-func TestZeroPricePerByteRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
- s := setupOneClientOneMiner(t, b, blocktime)
- defer s.blockMiner.Stop()
-
- // Set price-per-byte to zero
- ask, err := s.miner.MarketGetRetrievalAsk(s.ctx)
- require.NoError(t, err)
-
- ask.PricePerByte = abi.NewTokenAmount(0)
- err = s.miner.MarketSetRetrievalAsk(s.ctx, ask)
- require.NoError(t, err)
-
- MakeDeal(t, s.ctx, 6, s.client, s.miner, false, false, startEpoch)
-}
-
-func startDeal(t *testing.T, ctx context.Context, miner TestStorageNode, client api.FullNode, fcid cid.Cid, fastRet bool, startEpoch abi.ChainEpoch) *cid.Cid {
- maddr, err := miner.ActorAddress(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- addr, err := client.WalletDefaultAddress(ctx)
- if err != nil {
- t.Fatal(err)
- }
- deal, err := client.ClientStartDeal(ctx, &api.StartDealParams{
- Data: &storagemarket.DataRef{
- TransferType: storagemarket.TTGraphsync,
- Root: fcid,
- },
- Wallet: addr,
- Miner: maddr,
- EpochPrice: types.NewInt(1000000),
- DealStartEpoch: startEpoch,
- MinBlocksDuration: uint64(build.MinDealDuration),
- FastRetrieval: fastRet,
- })
- if err != nil {
- t.Fatalf("%+v", err)
- }
- return deal
-}
-
-func waitDealSealed(t *testing.T, ctx context.Context, miner TestStorageNode, client api.FullNode, deal *cid.Cid, noseal bool) {
-loop:
- for {
- di, err := client.ClientGetDealInfo(ctx, *deal)
- if err != nil {
- t.Fatal(err)
- }
- switch di.State {
- case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing:
- if noseal {
- return
- }
- startSealingWaiting(t, ctx, miner)
- case storagemarket.StorageDealProposalRejected:
- t.Fatal("deal rejected")
- case storagemarket.StorageDealFailing:
- t.Fatal("deal failed")
- case storagemarket.StorageDealError:
- t.Fatal("deal errored", di.Message)
- case storagemarket.StorageDealActive:
- fmt.Println("COMPLETE", di)
- break loop
- }
- fmt.Println("Deal state: ", storagemarket.DealStates[di.State])
- time.Sleep(time.Second / 2)
- }
-}
-
-func waitDealPublished(t *testing.T, ctx context.Context, miner TestStorageNode, deal *cid.Cid) {
- subCtx, cancel := context.WithCancel(ctx)
- defer cancel()
- updates, err := miner.MarketGetDealUpdates(subCtx)
- if err != nil {
- t.Fatal(err)
- }
- for {
- select {
- case <-ctx.Done():
- t.Fatal("context timeout")
- case di := <-updates:
- if deal.Equals(di.ProposalCid) {
- switch di.State {
- case storagemarket.StorageDealProposalRejected:
- t.Fatal("deal rejected")
- case storagemarket.StorageDealFailing:
- t.Fatal("deal failed")
- case storagemarket.StorageDealError:
- t.Fatal("deal errored", di.Message)
- case storagemarket.StorageDealFinalizing, storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing, storagemarket.StorageDealActive:
- fmt.Println("COMPLETE", di)
- return
- }
- fmt.Println("Deal state: ", storagemarket.DealStates[di.State])
- }
- }
- }
-}
-
-func startSealingWaiting(t *testing.T, ctx context.Context, miner TestStorageNode) {
- snums, err := miner.SectorsList(ctx)
- require.NoError(t, err)
-
- for _, snum := range snums {
- si, err := miner.SectorsStatus(ctx, snum, false)
- require.NoError(t, err)
-
- t.Logf("Sector state: %s", si.State)
- if si.State == api.SectorState(sealing.WaitDeals) {
- require.NoError(t, miner.SectorStartSealing(ctx, snum))
- }
- }
-
- flushSealingBatches(t, ctx, miner)
-}
-
-func testRetrieval(t *testing.T, ctx context.Context, client api.FullNode, fcid cid.Cid, piece *cid.Cid, carExport bool, data []byte) {
- offers, err := client.ClientFindData(ctx, fcid, piece)
- if err != nil {
- t.Fatal(err)
- }
-
- if len(offers) < 1 {
- t.Fatal("no offers")
- }
-
- rpath, err := ioutil.TempDir("", "lotus-retrieve-test-")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(rpath) //nolint:errcheck
-
- caddr, err := client.WalletDefaultAddress(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- ref := &api.FileRef{
- Path: filepath.Join(rpath, "ret"),
- IsCAR: carExport,
- }
- updates, err := client.ClientRetrieveWithEvents(ctx, offers[0].Order(caddr), ref)
- if err != nil {
- t.Fatal(err)
- }
- for update := range updates {
- if update.Err != "" {
- t.Fatalf("retrieval failed: %s", update.Err)
- }
- }
-
- rdata, err := ioutil.ReadFile(filepath.Join(rpath, "ret"))
- if err != nil {
- t.Fatal(err)
- }
-
- if carExport {
- rdata = extractCarData(t, ctx, rdata, rpath)
- }
-
- if !bytes.Equal(rdata, data) {
- t.Fatal("wrong data retrieved")
- }
-}
-
-func extractCarData(t *testing.T, ctx context.Context, rdata []byte, rpath string) []byte {
- bserv := dstest.Bserv()
- ch, err := car.LoadCar(bserv.Blockstore(), bytes.NewReader(rdata))
- if err != nil {
- t.Fatal(err)
- }
- b, err := bserv.GetBlock(ctx, ch.Roots[0])
- if err != nil {
- t.Fatal(err)
- }
- nd, err := ipld.Decode(b)
- if err != nil {
- t.Fatal(err)
- }
- dserv := dag.NewDAGService(bserv)
- fil, err := unixfile.NewUnixfsFile(ctx, dserv, nd)
- if err != nil {
- t.Fatal(err)
- }
- outPath := filepath.Join(rpath, "retLoadedCAR")
- if err := files.WriteTo(fil, outPath); err != nil {
- t.Fatal(err)
- }
- rdata, err = ioutil.ReadFile(outPath)
- if err != nil {
- t.Fatal(err)
- }
- return rdata
-}
-
-type dealsScaffold struct {
- ctx context.Context
- client *impl.FullNodeAPI
- miner TestStorageNode
- blockMiner *BlockMiner
-}
-
-func setupOneClientOneMiner(t *testing.T, b APIBuilder, blocktime time.Duration) *dealsScaffold {
- n, sn := b(t, OneFull, OneMiner)
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
- return connectAndStartMining(t, b, blocktime, client, miner)
-}
-
-func connectAndStartMining(t *testing.T, b APIBuilder, blocktime time.Duration, client *impl.FullNodeAPI, miner TestStorageNode) *dealsScaffold {
- ctx := context.Background()
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- time.Sleep(time.Second)
-
- blockMiner := NewBlockMiner(ctx, t, miner, blocktime)
- blockMiner.MineBlocks()
-
- return &dealsScaffold{
- ctx: ctx,
- client: client,
- miner: miner,
- blockMiner: blockMiner,
- }
-}
diff --git a/api/test/mining.go b/api/test/mining.go
deleted file mode 100644
index 4a4f1e1a4..000000000
--- a/api/test/mining.go
+++ /dev/null
@@ -1,240 +0,0 @@
-package test
-
-import (
- "bytes"
- "context"
- "fmt"
- "math/rand"
- "sync/atomic"
- "testing"
- "time"
-
- logging "github.com/ipfs/go-log/v2"
-
- "github.com/stretchr/testify/require"
-
- "github.com/filecoin-project/go-address"
- "github.com/filecoin-project/go-state-types/abi"
-
- "github.com/filecoin-project/lotus/build"
- "github.com/filecoin-project/lotus/chain/types"
- "github.com/filecoin-project/lotus/miner"
- "github.com/filecoin-project/lotus/node/impl"
-)
-
-//nolint:deadcode,varcheck
-var log = logging.Logger("apitest")
-
-func (ts *testSuite) testMining(t *testing.T) {
- ctx := context.Background()
- apis, sn := ts.makeNodes(t, OneFull, OneMiner)
- api := apis[0]
-
- newHeads, err := api.ChainNotify(ctx)
- require.NoError(t, err)
- initHead := (<-newHeads)[0]
- baseHeight := initHead.Val.Height()
-
- h1, err := api.ChainHead(ctx)
- require.NoError(t, err)
- require.Equal(t, int64(h1.Height()), int64(baseHeight))
-
- MineUntilBlock(ctx, t, apis[0], sn[0], nil)
- require.NoError(t, err)
-
- <-newHeads
-
- h2, err := api.ChainHead(ctx)
- require.NoError(t, err)
- require.Greater(t, int64(h2.Height()), int64(h1.Height()))
-}
-
-func (ts *testSuite) testMiningReal(t *testing.T) {
- build.InsecurePoStValidation = false
- defer func() {
- build.InsecurePoStValidation = true
- }()
-
- ctx := context.Background()
- apis, sn := ts.makeNodes(t, OneFull, OneMiner)
- api := apis[0]
-
- newHeads, err := api.ChainNotify(ctx)
- require.NoError(t, err)
- at := (<-newHeads)[0].Val.Height()
-
- h1, err := api.ChainHead(ctx)
- require.NoError(t, err)
- require.Equal(t, int64(at), int64(h1.Height()))
-
- MineUntilBlock(ctx, t, apis[0], sn[0], nil)
- require.NoError(t, err)
-
- <-newHeads
-
- h2, err := api.ChainHead(ctx)
- require.NoError(t, err)
- require.Greater(t, int64(h2.Height()), int64(h1.Height()))
-
- MineUntilBlock(ctx, t, apis[0], sn[0], nil)
- require.NoError(t, err)
-
- <-newHeads
-
- h3, err := api.ChainHead(ctx)
- require.NoError(t, err)
- require.Greater(t, int64(h3.Height()), int64(h2.Height()))
-}
-
-func TestDealMining(t *testing.T, b APIBuilder, blocktime time.Duration, carExport bool) {
- // test making a deal with a fresh miner, and see if it starts to mine
-
- ctx := context.Background()
- n, sn := b(t, OneFull, []StorageMiner{
- {Full: 0, Preseal: PresealGenesis},
- {Full: 0, Preseal: 0}, // TODO: Add support for miners on non-first full node
- })
- client := n[0].FullNode.(*impl.FullNodeAPI)
- provider := sn[1]
- genesisMiner := sn[0]
-
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := provider.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
-
- if err := genesisMiner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
-
- time.Sleep(time.Second)
-
- data := make([]byte, 600)
- rand.New(rand.NewSource(5)).Read(data)
-
- r := bytes.NewReader(data)
- fcid, err := client.ClientImportLocal(ctx, r)
- if err != nil {
- t.Fatal(err)
- }
-
- fmt.Println("FILE CID: ", fcid)
-
- var mine int32 = 1
- done := make(chan struct{})
- minedTwo := make(chan struct{})
-
- m2addr, err := sn[1].ActorAddress(context.TODO())
- if err != nil {
- t.Fatal(err)
- }
-
- go func() {
- defer close(done)
-
- complChan := minedTwo
- for atomic.LoadInt32(&mine) != 0 {
- wait := make(chan int)
- mdone := func(mined bool, _ abi.ChainEpoch, err error) {
- n := 0
- if mined {
- n = 1
- }
- wait <- n
- }
-
- if err := sn[0].MineOne(ctx, miner.MineReq{Done: mdone}); err != nil {
- t.Error(err)
- }
-
- if err := sn[1].MineOne(ctx, miner.MineReq{Done: mdone}); err != nil {
- t.Error(err)
- }
-
- expect := <-wait
- expect += <-wait
-
- time.Sleep(blocktime)
- if expect == 0 {
- // null block
- continue
- }
-
- var nodeOneMined bool
- for _, node := range sn {
- mb, err := node.MiningBase(ctx)
- if err != nil {
- t.Error(err)
- return
- }
-
- for _, b := range mb.Blocks() {
- if b.Miner == m2addr {
- nodeOneMined = true
- break
- }
- }
-
- }
-
- if nodeOneMined && complChan != nil {
- close(complChan)
- complChan = nil
- }
-
- }
- }()
-
- deal := startDeal(t, ctx, provider, client, fcid, false, 0)
-
- // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
- time.Sleep(time.Second)
-
- waitDealSealed(t, ctx, provider, client, deal, false)
-
- <-minedTwo
-
- atomic.StoreInt32(&mine, 0)
- fmt.Println("shutting down mining")
- <-done
-}
-
-func (ts *testSuite) testNonGenesisMiner(t *testing.T) {
- ctx := context.Background()
- n, sn := ts.makeNodes(t, []FullNodeOpts{
- FullNodeWithLatestActorsAt(-1),
- }, []StorageMiner{
- {Full: 0, Preseal: PresealGenesis},
- })
-
- full, ok := n[0].FullNode.(*impl.FullNodeAPI)
- if !ok {
- t.Skip("not testing with a full node")
- return
- }
- genesisMiner := sn[0]
-
- bm := NewBlockMiner(ctx, t, genesisMiner, 4*time.Millisecond)
- bm.MineBlocks()
- t.Cleanup(bm.Stop)
-
- gaa, err := genesisMiner.ActorAddress(ctx)
- require.NoError(t, err)
-
- gmi, err := full.StateMinerInfo(ctx, gaa, types.EmptyTSK)
- require.NoError(t, err)
-
- testm := n[0].Stb(ctx, t, TestSpt, gmi.Owner)
-
- ta, err := testm.ActorAddress(ctx)
- require.NoError(t, err)
-
- tid, err := address.IDFromAddress(ta)
- require.NoError(t, err)
-
- require.Equal(t, uint64(1001), tid)
-}
diff --git a/api/test/pledge.go b/api/test/pledge.go
deleted file mode 100644
index 08548dc60..000000000
--- a/api/test/pledge.go
+++ /dev/null
@@ -1,389 +0,0 @@
-package test
-
-import (
- "context"
- "fmt"
- "sort"
- "strings"
- "sync/atomic"
- "testing"
- "time"
-
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
-
- "github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/go-state-types/network"
-
- "github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/build"
- "github.com/filecoin-project/lotus/chain/stmgr"
- sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
- bminer "github.com/filecoin-project/lotus/miner"
- "github.com/filecoin-project/lotus/node"
- "github.com/filecoin-project/lotus/node/impl"
-)
-
-func TestSDRUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- n, sn := b(t, []FullNodeOpts{FullNodeWithSDRAt(500, 1000)}, OneMiner)
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
-
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- build.Clock.Sleep(time.Second)
-
- pledge := make(chan struct{})
- mine := int64(1)
- done := make(chan struct{})
- go func() {
- defer close(done)
- round := 0
- for atomic.LoadInt64(&mine) != 0 {
- build.Clock.Sleep(blocktime)
- if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
-
- }}); err != nil {
- t.Error(err)
- }
-
- // 3 sealing rounds: before, during after.
- if round >= 3 {
- continue
- }
-
- head, err := client.ChainHead(ctx)
- assert.NoError(t, err)
-
- // rounds happen every 100 blocks, with a 50 block offset.
- if head.Height() >= abi.ChainEpoch(round*500+50) {
- round++
- pledge <- struct{}{}
-
- ver, err := client.StateNetworkVersion(ctx, head.Key())
- assert.NoError(t, err)
- switch round {
- case 1:
- assert.Equal(t, network.Version6, ver)
- case 2:
- assert.Equal(t, network.Version7, ver)
- case 3:
- assert.Equal(t, network.Version8, ver)
- }
- }
-
- }
- }()
-
- // before.
- pledgeSectors(t, ctx, miner, 9, 0, pledge)
-
- s, err := miner.SectorsList(ctx)
- require.NoError(t, err)
- sort.Slice(s, func(i, j int) bool {
- return s[i] < s[j]
- })
-
- for i, id := range s {
- info, err := miner.SectorsStatus(ctx, id, true)
- require.NoError(t, err)
- expectProof := abi.RegisteredSealProof_StackedDrg2KiBV1
- if i >= 3 {
- // after
- expectProof = abi.RegisteredSealProof_StackedDrg2KiBV1_1
- }
- assert.Equal(t, expectProof, info.SealProof, "sector %d, id %d", i, id)
- }
-
- atomic.StoreInt64(&mine, 0)
- <-done
-}
-
-func TestPledgeBatching(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(-1)}, OneMiner)
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
-
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- build.Clock.Sleep(time.Second)
-
- mine := int64(1)
- done := make(chan struct{})
- go func() {
- defer close(done)
- for atomic.LoadInt64(&mine) != 0 {
- build.Clock.Sleep(blocktime)
- if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
-
- }}); err != nil {
- t.Error(err)
- }
- }
- }()
-
- for {
- h, err := client.ChainHead(ctx)
- require.NoError(t, err)
- if h.Height() > 10 {
- break
- }
- }
-
- toCheck := startPledge(t, ctx, miner, nSectors, 0, nil)
-
- for len(toCheck) > 0 {
- states := map[api.SectorState]int{}
-
- for n := range toCheck {
- st, err := miner.SectorsStatus(ctx, n, false)
- require.NoError(t, err)
- states[st.State]++
- if st.State == api.SectorState(sealing.Proving) {
- delete(toCheck, n)
- }
- if strings.Contains(string(st.State), "Fail") {
- t.Fatal("sector in a failed state", st.State)
- }
- }
- if states[api.SectorState(sealing.SubmitPreCommitBatch)] == nSectors ||
- (states[api.SectorState(sealing.SubmitPreCommitBatch)] > 0 && states[api.SectorState(sealing.PreCommit1)] == 0 && states[api.SectorState(sealing.PreCommit2)] == 0) {
- pcb, err := miner.SectorPreCommitFlush(ctx)
- require.NoError(t, err)
- if pcb != nil {
- fmt.Printf("PRECOMMIT BATCH: %+v\n", pcb)
- }
- }
-
- if states[api.SectorState(sealing.SubmitCommitAggregate)] == nSectors ||
- (states[api.SectorState(sealing.SubmitCommitAggregate)] > 0 && states[api.SectorState(sealing.WaitSeed)] == 0 && states[api.SectorState(sealing.Committing)] == 0) {
- cb, err := miner.SectorCommitFlush(ctx)
- require.NoError(t, err)
- if cb != nil {
- fmt.Printf("COMMIT BATCH: %+v\n", cb)
- }
- }
-
- build.Clock.Sleep(100 * time.Millisecond)
- fmt.Printf("WaitSeal: %d %+v\n", len(toCheck), states)
- }
-
- atomic.StoreInt64(&mine, 0)
- <-done
-}
-
-func TestPledgeBeforeNv13(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- n, sn := b(t, []FullNodeOpts{
- {
- Opts: func(nodes []TestNode) node.Option {
- return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
- Network: network.Version9,
- Height: 1,
- Migration: stmgr.UpgradeActorsV2,
- }, {
- Network: network.Version10,
- Height: 2,
- Migration: stmgr.UpgradeActorsV3,
- }, {
- Network: network.Version12,
- Height: 3,
- Migration: stmgr.UpgradeActorsV4,
- }, {
- Network: network.Version13,
- Height: 1000000000,
- Migration: stmgr.UpgradeActorsV5,
- }})
- },
- },
- }, OneMiner)
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
-
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- build.Clock.Sleep(time.Second)
-
- mine := int64(1)
- done := make(chan struct{})
- go func() {
- defer close(done)
- for atomic.LoadInt64(&mine) != 0 {
- build.Clock.Sleep(blocktime)
- if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
-
- }}); err != nil {
- t.Error(err)
- }
- }
- }()
-
- for {
- h, err := client.ChainHead(ctx)
- require.NoError(t, err)
- if h.Height() > 10 {
- break
- }
- }
-
- toCheck := startPledge(t, ctx, miner, nSectors, 0, nil)
-
- for len(toCheck) > 0 {
- states := map[api.SectorState]int{}
-
- for n := range toCheck {
- st, err := miner.SectorsStatus(ctx, n, false)
- require.NoError(t, err)
- states[st.State]++
- if st.State == api.SectorState(sealing.Proving) {
- delete(toCheck, n)
- }
- if strings.Contains(string(st.State), "Fail") {
- t.Fatal("sector in a failed state", st.State)
- }
- }
-
- build.Clock.Sleep(100 * time.Millisecond)
- fmt.Printf("WaitSeal: %d %+v\n", len(toCheck), states)
- }
-
- atomic.StoreInt64(&mine, 0)
- <-done
-}
-
-func TestPledgeSector(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- n, sn := b(t, OneFull, OneMiner)
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
-
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- build.Clock.Sleep(time.Second)
-
- mine := int64(1)
- done := make(chan struct{})
- go func() {
- defer close(done)
- for atomic.LoadInt64(&mine) != 0 {
- build.Clock.Sleep(blocktime)
- if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
-
- }}); err != nil {
- t.Error(err)
- }
- }
- }()
-
- pledgeSectors(t, ctx, miner, nSectors, 0, nil)
-
- atomic.StoreInt64(&mine, 0)
- <-done
-}
-
-func flushSealingBatches(t *testing.T, ctx context.Context, miner TestStorageNode) {
- pcb, err := miner.SectorPreCommitFlush(ctx)
- require.NoError(t, err)
- if pcb != nil {
- fmt.Printf("PRECOMMIT BATCH: %+v\n", pcb)
- }
-
- cb, err := miner.SectorCommitFlush(ctx)
- require.NoError(t, err)
- if cb != nil {
- fmt.Printf("COMMIT BATCH: %+v\n", cb)
- }
-}
-
-func startPledge(t *testing.T, ctx context.Context, miner TestStorageNode, n, existing int, blockNotif <-chan struct{}) map[abi.SectorNumber]struct{} {
- for i := 0; i < n; i++ {
- if i%3 == 0 && blockNotif != nil {
- <-blockNotif
- log.Errorf("WAIT")
- }
- log.Errorf("PLEDGING %d", i)
- _, err := miner.PledgeSector(ctx)
- require.NoError(t, err)
- }
-
- for {
- s, err := miner.SectorsList(ctx) // Note - the test builder doesn't import genesis sectors into FSM
- require.NoError(t, err)
- fmt.Printf("Sectors: %d\n", len(s))
- if len(s) >= n+existing {
- break
- }
-
- build.Clock.Sleep(100 * time.Millisecond)
- }
-
- fmt.Printf("All sectors is fsm\n")
-
- s, err := miner.SectorsList(ctx)
- require.NoError(t, err)
-
- toCheck := map[abi.SectorNumber]struct{}{}
- for _, number := range s {
- toCheck[number] = struct{}{}
- }
-
- return toCheck
-}
-
-func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n, existing int, blockNotif <-chan struct{}) {
- toCheck := startPledge(t, ctx, miner, n, existing, blockNotif)
-
- for len(toCheck) > 0 {
- flushSealingBatches(t, ctx, miner)
-
- states := map[api.SectorState]int{}
- for n := range toCheck {
- st, err := miner.SectorsStatus(ctx, n, false)
- require.NoError(t, err)
- states[st.State]++
- if st.State == api.SectorState(sealing.Proving) {
- delete(toCheck, n)
- }
- if strings.Contains(string(st.State), "Fail") {
- t.Fatal("sector in a failed state", st.State)
- }
- }
-
- build.Clock.Sleep(100 * time.Millisecond)
- fmt.Printf("WaitSeal: %d %+v\n", len(toCheck), states)
- }
-}
diff --git a/api/test/test.go b/api/test/test.go
deleted file mode 100644
index c064ca6fb..000000000
--- a/api/test/test.go
+++ /dev/null
@@ -1,322 +0,0 @@
-package test
-
-import (
- "context"
- "fmt"
- "os"
- "strings"
- "testing"
- "time"
-
- logging "github.com/ipfs/go-log/v2"
- "github.com/multiformats/go-multiaddr"
-
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
-
- "github.com/filecoin-project/go-address"
- "github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/go-state-types/big"
- "github.com/filecoin-project/go-state-types/network"
-
- "github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/build"
- "github.com/filecoin-project/lotus/chain/stmgr"
- "github.com/filecoin-project/lotus/chain/types"
- "github.com/filecoin-project/lotus/miner"
- "github.com/filecoin-project/lotus/node"
-)
-
-func init() {
- logging.SetAllLoggers(logging.LevelInfo)
- err := os.Setenv("BELLMAN_NO_GPU", "1")
- if err != nil {
- panic(fmt.Sprintf("failed to set BELLMAN_NO_GPU env variable: %s", err))
- }
- build.InsecurePoStValidation = true
-}
-
-type StorageBuilder func(context.Context, *testing.T, abi.RegisteredSealProof, address.Address) TestStorageNode
-
-type TestNode struct {
- api.FullNode
- // ListenAddr is the address on which an API server is listening, if an
- // API server is created for this Node
- ListenAddr multiaddr.Multiaddr
-
- Stb StorageBuilder
-}
-
-type TestStorageNode struct {
- api.StorageMiner
- // ListenAddr is the address on which an API server is listening, if an
- // API server is created for this Node
- ListenAddr multiaddr.Multiaddr
-
- MineOne func(context.Context, miner.MineReq) error
- Stop func(context.Context) error
-}
-
-var PresealGenesis = -1
-
-const GenesisPreseals = 2
-
-const TestSpt = abi.RegisteredSealProof_StackedDrg2KiBV1_1
-
-// Options for setting up a mock storage miner
-type StorageMiner struct {
- Full int
- Opts node.Option
- Preseal int
-}
-
-type OptionGenerator func([]TestNode) node.Option
-
-// Options for setting up a mock full node
-type FullNodeOpts struct {
- Lite bool // run node in "lite" mode
- Opts OptionGenerator // generate dependency injection options
-}
-
-// APIBuilder is a function which is invoked in test suite to provide
-// test nodes and networks
-//
-// fullOpts array defines options for each full node
-// storage array defines storage nodes, numbers in the array specify full node
-// index the storage node 'belongs' to
-type APIBuilder func(t *testing.T, full []FullNodeOpts, storage []StorageMiner) ([]TestNode, []TestStorageNode)
-type testSuite struct {
- makeNodes APIBuilder
-}
-
-// TestApis is the entry point to API test suite
-func TestApis(t *testing.T, b APIBuilder) {
- ts := testSuite{
- makeNodes: b,
- }
-
- t.Run("version", ts.testVersion)
- t.Run("id", ts.testID)
- t.Run("testConnectTwo", ts.testConnectTwo)
- t.Run("testMining", ts.testMining)
- t.Run("testMiningReal", ts.testMiningReal)
- t.Run("testSearchMsg", ts.testSearchMsg)
- t.Run("testNonGenesisMiner", ts.testNonGenesisMiner)
-}
-
-func DefaultFullOpts(nFull int) []FullNodeOpts {
- full := make([]FullNodeOpts, nFull)
- for i := range full {
- full[i] = FullNodeOpts{
- Opts: func(nodes []TestNode) node.Option {
- return node.Options()
- },
- }
- }
- return full
-}
-
-var OneMiner = []StorageMiner{{Full: 0, Preseal: PresealGenesis}}
-var OneFull = DefaultFullOpts(1)
-var TwoFull = DefaultFullOpts(2)
-
-var FullNodeWithLatestActorsAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
- if upgradeHeight == -1 {
- // Attention: Update this when introducing new actor versions or your tests will be sad
- upgradeHeight = 4
- }
-
- return FullNodeOpts{
- Opts: func(nodes []TestNode) node.Option {
- return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
- // prepare for upgrade.
- Network: network.Version9,
- Height: 1,
- Migration: stmgr.UpgradeActorsV2,
- }, {
- Network: network.Version10,
- Height: 2,
- Migration: stmgr.UpgradeActorsV3,
- }, {
- Network: network.Version12,
- Height: 3,
- Migration: stmgr.UpgradeActorsV4,
- }, {
- Network: network.Version13,
- Height: upgradeHeight,
- Migration: stmgr.UpgradeActorsV5,
- }})
- },
- }
-}
-
-var FullNodeWithSDRAt = func(calico, persian abi.ChainEpoch) FullNodeOpts {
- return FullNodeOpts{
- Opts: func(nodes []TestNode) node.Option {
- return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
- Network: network.Version6,
- Height: 1,
- Migration: stmgr.UpgradeActorsV2,
- }, {
- Network: network.Version7,
- Height: calico,
- Migration: stmgr.UpgradeCalico,
- }, {
- Network: network.Version8,
- Height: persian,
- }})
- },
- }
-}
-
-var FullNodeWithV4ActorsAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
- if upgradeHeight == -1 {
- upgradeHeight = 3
- }
-
- return FullNodeOpts{
- Opts: func(nodes []TestNode) node.Option {
- return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
- // prepare for upgrade.
- Network: network.Version9,
- Height: 1,
- Migration: stmgr.UpgradeActorsV2,
- }, {
- Network: network.Version10,
- Height: 2,
- Migration: stmgr.UpgradeActorsV3,
- }, {
- Network: network.Version12,
- Height: upgradeHeight,
- Migration: stmgr.UpgradeActorsV4,
- }})
- },
- }
-}
-
-var MineNext = miner.MineReq{
- InjectNulls: 0,
- Done: func(bool, abi.ChainEpoch, error) {},
-}
-
-func (ts *testSuite) testVersion(t *testing.T) {
- api.RunningNodeType = api.NodeFull
- t.Cleanup(func() {
- api.RunningNodeType = api.NodeUnknown
- })
-
- ctx := context.Background()
- apis, _ := ts.makeNodes(t, OneFull, OneMiner)
- napi := apis[0]
-
- v, err := napi.Version(ctx)
- if err != nil {
- t.Fatal(err)
- }
- versions := strings.Split(v.Version, "+")
- if len(versions) <= 0 {
- t.Fatal("empty version")
- }
- require.Equal(t, versions[0], build.BuildVersion)
-}
-
-func (ts *testSuite) testSearchMsg(t *testing.T) {
- apis, miners := ts.makeNodes(t, OneFull, OneMiner)
-
- api := apis[0]
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
- senderAddr, err := api.WalletDefaultAddress(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- msg := &types.Message{
- From: senderAddr,
- To: senderAddr,
- Value: big.Zero(),
- }
- bm := NewBlockMiner(ctx, t, miners[0], 100*time.Millisecond)
- bm.MineBlocks()
- defer bm.Stop()
-
- sm, err := api.MpoolPushMessage(ctx, msg, nil)
- if err != nil {
- t.Fatal(err)
- }
- res, err := api.StateWaitMsg(ctx, sm.Cid(), 1)
- if err != nil {
- t.Fatal(err)
- }
- if res.Receipt.ExitCode != 0 {
- t.Fatal("did not successfully send message")
- }
-
- searchRes, err := api.StateSearchMsg(ctx, sm.Cid())
- if err != nil {
- t.Fatal(err)
- }
-
- if searchRes.TipSet != res.TipSet {
- t.Fatalf("search ts: %s, different from wait ts: %s", searchRes.TipSet, res.TipSet)
- }
-
-}
-
-func (ts *testSuite) testID(t *testing.T) {
- ctx := context.Background()
- apis, _ := ts.makeNodes(t, OneFull, OneMiner)
- api := apis[0]
-
- id, err := api.ID(ctx)
- if err != nil {
- t.Fatal(err)
- }
- assert.Regexp(t, "^12", id.Pretty())
-}
-
-func (ts *testSuite) testConnectTwo(t *testing.T) {
- ctx := context.Background()
- apis, _ := ts.makeNodes(t, TwoFull, OneMiner)
-
- p, err := apis[0].NetPeers(ctx)
- if err != nil {
- t.Fatal(err)
- }
- if len(p) != 0 {
- t.Error("Node 0 has a peer")
- }
-
- p, err = apis[1].NetPeers(ctx)
- if err != nil {
- t.Fatal(err)
- }
- if len(p) != 0 {
- t.Error("Node 1 has a peer")
- }
-
- addrs, err := apis[1].NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := apis[0].NetConnect(ctx, addrs); err != nil {
- t.Fatal(err)
- }
-
- p, err = apis[0].NetPeers(ctx)
- if err != nil {
- t.Fatal(err)
- }
- if len(p) != 1 {
- t.Error("Node 0 doesn't have 1 peer")
- }
-
- p, err = apis[1].NetPeers(ctx)
- if err != nil {
- t.Fatal(err)
- }
- if len(p) != 1 {
- t.Error("Node 0 doesn't have 1 peer")
- }
-}
diff --git a/api/test/util.go b/api/test/util.go
deleted file mode 100644
index 8695e2e2e..000000000
--- a/api/test/util.go
+++ /dev/null
@@ -1,86 +0,0 @@
-package test
-
-import (
- "context"
- "testing"
- "time"
-
- "github.com/filecoin-project/go-state-types/abi"
-
- "github.com/filecoin-project/go-address"
- "github.com/filecoin-project/lotus/chain/types"
- "github.com/filecoin-project/lotus/miner"
-)
-
-func SendFunds(ctx context.Context, t *testing.T, sender TestNode, addr address.Address, amount abi.TokenAmount) {
- senderAddr, err := sender.WalletDefaultAddress(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- msg := &types.Message{
- From: senderAddr,
- To: addr,
- Value: amount,
- }
-
- sm, err := sender.MpoolPushMessage(ctx, msg, nil)
- if err != nil {
- t.Fatal(err)
- }
- res, err := sender.StateWaitMsg(ctx, sm.Cid(), 1)
- if err != nil {
- t.Fatal(err)
- }
- if res.Receipt.ExitCode != 0 {
- t.Fatal("did not successfully send money")
- }
-}
-
-func MineUntilBlock(ctx context.Context, t *testing.T, fn TestNode, sn TestStorageNode, cb func(abi.ChainEpoch)) {
- for i := 0; i < 1000; i++ {
- var success bool
- var err error
- var epoch abi.ChainEpoch
- wait := make(chan struct{})
- mineErr := sn.MineOne(ctx, miner.MineReq{
- Done: func(win bool, ep abi.ChainEpoch, e error) {
- success = win
- err = e
- epoch = ep
- wait <- struct{}{}
- },
- })
- if mineErr != nil {
- t.Fatal(mineErr)
- }
- <-wait
- if err != nil {
- t.Fatal(err)
- }
- if success {
- // Wait until it shows up on the given full nodes ChainHead
- nloops := 50
- for i := 0; i < nloops; i++ {
- ts, err := fn.ChainHead(ctx)
- if err != nil {
- t.Fatal(err)
- }
- if ts.Height() == epoch {
- break
- }
- if i == nloops-1 {
- t.Fatal("block never managed to sync to node")
- }
- time.Sleep(time.Millisecond * 10)
- }
-
- if cb != nil {
- cb(epoch)
- }
- return
- }
- t.Log("did not mine block, trying again", i)
- }
- t.Fatal("failed to mine 1000 times in a row...")
-}
diff --git a/api/test/window_post.go b/api/test/window_post.go
deleted file mode 100644
index 8a6ca8044..000000000
--- a/api/test/window_post.go
+++ /dev/null
@@ -1,1002 +0,0 @@
-package test
-
-import (
- "context"
- "fmt"
- "testing"
- "time"
-
- "github.com/filecoin-project/go-state-types/big"
-
- "github.com/stretchr/testify/require"
-
- "github.com/filecoin-project/go-address"
- "github.com/filecoin-project/go-bitfield"
- "github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/go-state-types/crypto"
- "github.com/filecoin-project/go-state-types/dline"
- "github.com/filecoin-project/lotus/extern/sector-storage/mock"
- sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
- proof3 "github.com/filecoin-project/specs-actors/v3/actors/runtime/proof"
- "github.com/filecoin-project/specs-storage/storage"
-
- "github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/build"
- "github.com/filecoin-project/lotus/chain/actors"
- minerActor "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
- "github.com/filecoin-project/lotus/chain/types"
- "github.com/filecoin-project/lotus/node/impl"
-)
-
-func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int) {
- for _, height := range []abi.ChainEpoch{
- -1, // before
- 162, // while sealing
- 5000, // while proving
- } {
- height := height // copy to satisfy lints
- t.Run(fmt.Sprintf("upgrade-%d", height), func(t *testing.T) {
- testWindowPostUpgrade(t, b, blocktime, nSectors, height)
- })
- }
-
-}
-
-func testWindowPostUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int,
- upgradeHeight abi.ChainEpoch) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(upgradeHeight)}, OneMiner)
-
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
-
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- build.Clock.Sleep(time.Second)
-
- done := make(chan struct{})
- go func() {
- defer close(done)
- for ctx.Err() == nil {
- build.Clock.Sleep(blocktime)
- if err := sn[0].MineOne(ctx, MineNext); err != nil {
- if ctx.Err() != nil {
- // context was canceled, ignore the error.
- return
- }
- t.Error(err)
- }
- }
- }()
- defer func() {
- cancel()
- <-done
- }()
-
- pledgeSectors(t, ctx, miner, nSectors, 0, nil)
-
- maddr, err := miner.ActorAddress(ctx)
- require.NoError(t, err)
-
- di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- mid, err := address.IDFromAddress(maddr)
- require.NoError(t, err)
-
- fmt.Printf("Running one proving period\n")
- fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
-
- for {
- head, err := client.ChainHead(ctx)
- require.NoError(t, err)
-
- if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 {
- fmt.Printf("Now head.Height = %d\n", head.Height())
- break
- }
- build.Clock.Sleep(blocktime)
- }
-
- p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- ssz, err := miner.ActorSectorSize(ctx, maddr)
- require.NoError(t, err)
-
- require.Equal(t, p.MinerPower, p.TotalPower)
- require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*uint64(nSectors+GenesisPreseals)))
-
- fmt.Printf("Drop some sectors\n")
-
- // Drop 2 sectors from deadline 2 partition 0 (full partition / deadline)
- {
- parts, err := client.StateMinerPartitions(ctx, maddr, 2, types.EmptyTSK)
- require.NoError(t, err)
- require.Greater(t, len(parts), 0)
-
- secs := parts[0].AllSectors
- n, err := secs.Count()
- require.NoError(t, err)
- require.Equal(t, uint64(2), n)
-
- // Drop the partition
- err = secs.ForEach(func(sid uint64) error {
- return miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkCorrupted(storage.SectorRef{
- ID: abi.SectorID{
- Miner: abi.ActorID(mid),
- Number: abi.SectorNumber(sid),
- },
- }, true)
- })
- require.NoError(t, err)
- }
-
- var s storage.SectorRef
-
- // Drop 1 sectors from deadline 3 partition 0
- {
- parts, err := client.StateMinerPartitions(ctx, maddr, 3, types.EmptyTSK)
- require.NoError(t, err)
- require.Greater(t, len(parts), 0)
-
- secs := parts[0].AllSectors
- n, err := secs.Count()
- require.NoError(t, err)
- require.Equal(t, uint64(2), n)
-
- // Drop the sector
- sn, err := secs.First()
- require.NoError(t, err)
-
- all, err := secs.All(2)
- require.NoError(t, err)
- fmt.Println("the sectors", all)
-
- s = storage.SectorRef{
- ID: abi.SectorID{
- Miner: abi.ActorID(mid),
- Number: abi.SectorNumber(sn),
- },
- }
-
- err = miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkFailed(s, true)
- require.NoError(t, err)
- }
-
- di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- fmt.Printf("Go through another PP, wait for sectors to become faulty\n")
- fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
-
- for {
- head, err := client.ChainHead(ctx)
- require.NoError(t, err)
-
- if head.Height() > di.PeriodStart+(di.WPoStProvingPeriod)+2 {
- fmt.Printf("Now head.Height = %d\n", head.Height())
- break
- }
-
- build.Clock.Sleep(blocktime)
- }
-
- p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- require.Equal(t, p.MinerPower, p.TotalPower)
-
- sectors := p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
- require.Equal(t, nSectors+GenesisPreseals-3, int(sectors)) // -3 just removed sectors
-
- fmt.Printf("Recover one sector\n")
-
- err = miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkFailed(s, false)
- require.NoError(t, err)
-
- di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
-
- for {
- head, err := client.ChainHead(ctx)
- require.NoError(t, err)
-
- if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 {
- fmt.Printf("Now head.Height = %d\n", head.Height())
- break
- }
-
- build.Clock.Sleep(blocktime)
- }
-
- p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- require.Equal(t, p.MinerPower, p.TotalPower)
-
- sectors = p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
- require.Equal(t, nSectors+GenesisPreseals-2, int(sectors)) // -2 not recovered sectors
-
- // pledge a sector after recovery
-
- pledgeSectors(t, ctx, miner, 1, nSectors, nil)
-
- {
- // Wait until proven.
- di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- waitUntil := di.PeriodStart + di.WPoStProvingPeriod + 2
- fmt.Printf("End for head.Height > %d\n", waitUntil)
-
- for {
- head, err := client.ChainHead(ctx)
- require.NoError(t, err)
-
- if head.Height() > waitUntil {
- fmt.Printf("Now head.Height = %d\n", head.Height())
- break
- }
- }
- }
-
- p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- require.Equal(t, p.MinerPower, p.TotalPower)
-
- sectors = p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
- require.Equal(t, nSectors+GenesisPreseals-2+1, int(sectors)) // -2 not recovered sectors + 1 just pledged
-}
-
-func TestTerminate(t *testing.T, b APIBuilder, blocktime time.Duration) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- nSectors := uint64(2)
-
- n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(-1)}, []StorageMiner{{Full: 0, Preseal: int(nSectors)}})
-
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
-
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- build.Clock.Sleep(time.Second)
-
- done := make(chan struct{})
- go func() {
- defer close(done)
- for ctx.Err() == nil {
- build.Clock.Sleep(blocktime)
- if err := sn[0].MineOne(ctx, MineNext); err != nil {
- if ctx.Err() != nil {
- // context was canceled, ignore the error.
- return
- }
- t.Error(err)
- }
- }
- }()
- defer func() {
- cancel()
- <-done
- }()
-
- maddr, err := miner.ActorAddress(ctx)
- require.NoError(t, err)
-
- ssz, err := miner.ActorSectorSize(ctx, maddr)
- require.NoError(t, err)
-
- p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
- require.Equal(t, p.MinerPower, p.TotalPower)
- require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*nSectors))
-
- fmt.Printf("Seal a sector\n")
-
- pledgeSectors(t, ctx, miner, 1, 0, nil)
-
- fmt.Printf("wait for power\n")
-
- {
- // Wait until proven.
- di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- waitUntil := di.PeriodStart + di.WPoStProvingPeriod + 2
- fmt.Printf("End for head.Height > %d\n", waitUntil)
-
- for {
- head, err := client.ChainHead(ctx)
- require.NoError(t, err)
-
- if head.Height() > waitUntil {
- fmt.Printf("Now head.Height = %d\n", head.Height())
- break
- }
- }
- }
-
- nSectors++
-
- p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
- require.Equal(t, p.MinerPower, p.TotalPower)
- require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*nSectors))
-
- fmt.Println("Terminate a sector")
-
- toTerminate := abi.SectorNumber(3)
-
- err = miner.SectorTerminate(ctx, toTerminate)
- require.NoError(t, err)
-
- msgTriggerred := false
-loop:
- for {
- si, err := miner.SectorsStatus(ctx, toTerminate, false)
- require.NoError(t, err)
-
- fmt.Println("state: ", si.State, msgTriggerred)
-
- switch sealing.SectorState(si.State) {
- case sealing.Terminating:
- if !msgTriggerred {
- {
- p, err := miner.SectorTerminatePending(ctx)
- require.NoError(t, err)
- require.Len(t, p, 1)
- require.Equal(t, abi.SectorNumber(3), p[0].Number)
- }
-
- c, err := miner.SectorTerminateFlush(ctx)
- require.NoError(t, err)
- if c != nil {
- msgTriggerred = true
- fmt.Println("terminate message:", c)
-
- {
- p, err := miner.SectorTerminatePending(ctx)
- require.NoError(t, err)
- require.Len(t, p, 0)
- }
- }
- }
- case sealing.TerminateWait, sealing.TerminateFinality, sealing.Removed:
- break loop
- }
-
- time.Sleep(100 * time.Millisecond)
- }
-
- // check power decreased
- p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
- require.Equal(t, p.MinerPower, p.TotalPower)
- require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*(nSectors-1)))
-
- // check in terminated set
- {
- parts, err := client.StateMinerPartitions(ctx, maddr, 1, types.EmptyTSK)
- require.NoError(t, err)
- require.Greater(t, len(parts), 0)
-
- bflen := func(b bitfield.BitField) uint64 {
- l, err := b.Count()
- require.NoError(t, err)
- return l
- }
-
- require.Equal(t, uint64(1), bflen(parts[0].AllSectors))
- require.Equal(t, uint64(0), bflen(parts[0].LiveSectors))
- }
-
- di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
- for {
- head, err := client.ChainHead(ctx)
- require.NoError(t, err)
-
- if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 {
- fmt.Printf("Now head.Height = %d\n", head.Height())
- break
- }
- build.Clock.Sleep(blocktime)
- }
- require.NoError(t, err)
- fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
-
- p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- require.Equal(t, p.MinerPower, p.TotalPower)
- require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*(nSectors-1)))
-}
-
-func TestWindowPostDispute(t *testing.T, b APIBuilder, blocktime time.Duration) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- // First, we configure two miners. After sealing, we're going to turn off the first miner so
- // it doesn't submit proofs.
- ///
- // Then we're going to manually submit bad proofs.
- n, sn := b(t, []FullNodeOpts{
- FullNodeWithV4ActorsAt(-1),
- }, []StorageMiner{
- {Full: 0, Preseal: PresealGenesis},
- {Full: 0},
- })
-
- client := n[0].FullNode.(*impl.FullNodeAPI)
- chainMiner := sn[0]
- evilMiner := sn[1]
-
- {
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := chainMiner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
-
- if err := evilMiner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- }
-
- defaultFrom, err := client.WalletDefaultAddress(ctx)
- require.NoError(t, err)
-
- build.Clock.Sleep(time.Second)
-
- // Mine with the _second_ node (the good one).
- done := make(chan struct{})
- go func() {
- defer close(done)
- for ctx.Err() == nil {
- build.Clock.Sleep(blocktime)
- if err := chainMiner.MineOne(ctx, MineNext); err != nil {
- if ctx.Err() != nil {
- // context was canceled, ignore the error.
- return
- }
- t.Error(err)
- }
- }
- }()
- defer func() {
- cancel()
- <-done
- }()
-
- // Give the chain miner enough sectors to win every block.
- pledgeSectors(t, ctx, chainMiner, 10, 0, nil)
- // And the evil one 1 sector. No cookie for you.
- pledgeSectors(t, ctx, evilMiner, 1, 0, nil)
-
- // Let the evil miner's sectors gain power.
- evilMinerAddr, err := evilMiner.ActorAddress(ctx)
- require.NoError(t, err)
-
- di, err := client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
- require.NoError(t, err)
-
- fmt.Printf("Running one proving period\n")
- fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod*2)
-
- for {
- head, err := client.ChainHead(ctx)
- require.NoError(t, err)
-
- if head.Height() > di.PeriodStart+di.WPoStProvingPeriod*2 {
- fmt.Printf("Now head.Height = %d\n", head.Height())
- break
- }
- build.Clock.Sleep(blocktime)
- }
-
- p, err := client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK)
- require.NoError(t, err)
-
- ssz, err := evilMiner.ActorSectorSize(ctx, evilMinerAddr)
- require.NoError(t, err)
-
- // make sure it has gained power.
- require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)))
-
- evilSectors, err := evilMiner.SectorsList(ctx)
- require.NoError(t, err)
- evilSectorNo := evilSectors[0] // only one.
- evilSectorLoc, err := client.StateSectorPartition(ctx, evilMinerAddr, evilSectorNo, types.EmptyTSK)
- require.NoError(t, err)
-
- fmt.Println("evil miner stopping")
-
- // Now stop the evil miner, and start manually submitting bad proofs.
- require.NoError(t, evilMiner.Stop(ctx))
-
- fmt.Println("evil miner stopped")
-
- // Wait until we need to prove our sector.
- for {
- di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
- require.NoError(t, err)
- if di.Index == evilSectorLoc.Deadline && di.CurrentEpoch-di.PeriodStart > 1 {
- break
- }
- build.Clock.Sleep(blocktime)
- }
-
- err = submitBadProof(ctx, client, evilMinerAddr, di, evilSectorLoc.Deadline, evilSectorLoc.Partition)
- require.NoError(t, err, "evil proof not accepted")
-
- // Wait until after the proving period.
- for {
- di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
- require.NoError(t, err)
- if di.Index != evilSectorLoc.Deadline {
- break
- }
- build.Clock.Sleep(blocktime)
- }
-
- fmt.Println("accepted evil proof")
-
- // Make sure the evil node didn't lose any power.
- p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK)
- require.NoError(t, err)
- require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)))
-
- // OBJECTION! The good miner files a DISPUTE!!!!
- {
- params := &minerActor.DisputeWindowedPoStParams{
- Deadline: evilSectorLoc.Deadline,
- PoStIndex: 0,
- }
-
- enc, aerr := actors.SerializeParams(params)
- require.NoError(t, aerr)
-
- msg := &types.Message{
- To: evilMinerAddr,
- Method: minerActor.Methods.DisputeWindowedPoSt,
- Params: enc,
- Value: types.NewInt(0),
- From: defaultFrom,
- }
- sm, err := client.MpoolPushMessage(ctx, msg, nil)
- require.NoError(t, err)
-
- fmt.Println("waiting dispute")
- rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence)
- require.NoError(t, err)
- require.Zero(t, rec.Receipt.ExitCode, "dispute not accepted: %s", rec.Receipt.ExitCode.Error())
- }
-
- // Objection SUSTAINED!
- // Make sure the evil node lost power.
- p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK)
- require.NoError(t, err)
- require.True(t, p.MinerPower.RawBytePower.IsZero())
-
- // Now we begin the redemption arc.
- require.True(t, p.MinerPower.RawBytePower.IsZero())
-
- // First, recover the sector.
-
- {
- minerInfo, err := client.StateMinerInfo(ctx, evilMinerAddr, types.EmptyTSK)
- require.NoError(t, err)
-
- params := &minerActor.DeclareFaultsRecoveredParams{
- Recoveries: []minerActor.RecoveryDeclaration{{
- Deadline: evilSectorLoc.Deadline,
- Partition: evilSectorLoc.Partition,
- Sectors: bitfield.NewFromSet([]uint64{uint64(evilSectorNo)}),
- }},
- }
-
- enc, aerr := actors.SerializeParams(params)
- require.NoError(t, aerr)
-
- msg := &types.Message{
- To: evilMinerAddr,
- Method: minerActor.Methods.DeclareFaultsRecovered,
- Params: enc,
- Value: types.FromFil(30), // repay debt.
- From: minerInfo.Owner,
- }
- sm, err := client.MpoolPushMessage(ctx, msg, nil)
- require.NoError(t, err)
-
- rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence)
- require.NoError(t, err)
- require.Zero(t, rec.Receipt.ExitCode, "recovery not accepted: %s", rec.Receipt.ExitCode.Error())
- }
-
- // Then wait for the deadline.
- for {
- di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
- require.NoError(t, err)
- if di.Index == evilSectorLoc.Deadline && di.CurrentEpoch-di.PeriodStart > 1 {
- break
- }
- build.Clock.Sleep(blocktime)
- }
-
- // Now try to be evil again
- err = submitBadProof(ctx, client, evilMinerAddr, di, evilSectorLoc.Deadline, evilSectorLoc.Partition)
- require.Error(t, err)
- require.Contains(t, err.Error(), "message execution failed: exit 16, reason: window post failed: invalid PoSt")
-
- // It didn't work because we're recovering.
-}
-
-func submitBadProof(
- ctx context.Context,
- client api.FullNode, maddr address.Address,
- di *dline.Info, dlIdx, partIdx uint64,
-) error {
- head, err := client.ChainHead(ctx)
- if err != nil {
- return err
- }
-
- from, err := client.WalletDefaultAddress(ctx)
- if err != nil {
- return err
- }
-
- minerInfo, err := client.StateMinerInfo(ctx, maddr, head.Key())
- if err != nil {
- return err
- }
-
- commEpoch := di.Open
- commRand, err := client.ChainGetRandomnessFromTickets(
- ctx, head.Key(), crypto.DomainSeparationTag_PoStChainCommit,
- commEpoch, nil,
- )
- if err != nil {
- return err
- }
- params := &minerActor.SubmitWindowedPoStParams{
- ChainCommitEpoch: commEpoch,
- ChainCommitRand: commRand,
- Deadline: dlIdx,
- Partitions: []minerActor.PoStPartition{{Index: partIdx}},
- Proofs: []proof3.PoStProof{{
- PoStProof: minerInfo.WindowPoStProofType,
- ProofBytes: []byte("I'm soooo very evil."),
- }},
- }
-
- enc, aerr := actors.SerializeParams(params)
- if aerr != nil {
- return aerr
- }
-
- msg := &types.Message{
- To: maddr,
- Method: minerActor.Methods.SubmitWindowedPoSt,
- Params: enc,
- Value: types.NewInt(0),
- From: from,
- }
- sm, err := client.MpoolPushMessage(ctx, msg, nil)
- if err != nil {
- return err
- }
-
- rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence)
- if err != nil {
- return err
- }
- if rec.Receipt.ExitCode.IsError() {
- return rec.Receipt.ExitCode
- }
- return nil
-}
-
-func TestWindowPostDisputeFails(t *testing.T, b APIBuilder, blocktime time.Duration) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- n, sn := b(t, []FullNodeOpts{FullNodeWithV4ActorsAt(-1)}, OneMiner)
-
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
-
- {
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- }
-
- defaultFrom, err := client.WalletDefaultAddress(ctx)
- require.NoError(t, err)
-
- maddr, err := miner.ActorAddress(ctx)
- require.NoError(t, err)
-
- build.Clock.Sleep(time.Second)
-
- // Mine with the _second_ node (the good one).
- done := make(chan struct{})
- go func() {
- defer close(done)
- for ctx.Err() == nil {
- build.Clock.Sleep(blocktime)
- if err := miner.MineOne(ctx, MineNext); err != nil {
- if ctx.Err() != nil {
- // context was canceled, ignore the error.
- return
- }
- t.Error(err)
- }
- }
- }()
- defer func() {
- cancel()
- <-done
- }()
-
- pledgeSectors(t, ctx, miner, 10, 0, nil)
-
- di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- fmt.Printf("Running one proving period\n")
- fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod*2)
-
- for {
- head, err := client.ChainHead(ctx)
- require.NoError(t, err)
-
- if head.Height() > di.PeriodStart+di.WPoStProvingPeriod*2 {
- fmt.Printf("Now head.Height = %d\n", head.Height())
- break
- }
- build.Clock.Sleep(blocktime)
- }
-
- ssz, err := miner.ActorSectorSize(ctx, maddr)
- require.NoError(t, err)
- expectedPower := types.NewInt(uint64(ssz) * (GenesisPreseals + 10))
-
- p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- // make sure it has gained power.
- require.Equal(t, p.MinerPower.RawBytePower, expectedPower)
-
- // Wait until a proof has been submitted.
- var targetDeadline uint64
-waitForProof:
- for {
- deadlines, err := client.StateMinerDeadlines(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
- for dlIdx, dl := range deadlines {
- nonEmpty, err := dl.PostSubmissions.IsEmpty()
- require.NoError(t, err)
- if nonEmpty {
- targetDeadline = uint64(dlIdx)
- break waitForProof
- }
- }
-
- build.Clock.Sleep(blocktime)
- }
-
- for {
- di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
- // wait until the deadline finishes.
- if di.Index == ((targetDeadline + 1) % di.WPoStPeriodDeadlines) {
- break
- }
-
- build.Clock.Sleep(blocktime)
- }
-
- // Try to object to the proof. This should fail.
- {
- params := &minerActor.DisputeWindowedPoStParams{
- Deadline: targetDeadline,
- PoStIndex: 0,
- }
-
- enc, aerr := actors.SerializeParams(params)
- require.NoError(t, aerr)
-
- msg := &types.Message{
- To: maddr,
- Method: minerActor.Methods.DisputeWindowedPoSt,
- Params: enc,
- Value: types.NewInt(0),
- From: defaultFrom,
- }
- _, err := client.MpoolPushMessage(ctx, msg, nil)
- require.Error(t, err)
- require.Contains(t, err.Error(), "failed to dispute valid post (RetCode=16)")
- }
-}
-
-func TestWindowPostBaseFeeNoBurn(t *testing.T, b APIBuilder, blocktime time.Duration) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- och := build.UpgradeClausHeight
- build.UpgradeClausHeight = 10
- n, sn := b(t, DefaultFullOpts(1), OneMiner)
-
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
-
- {
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- }
-
- maddr, err := miner.ActorAddress(ctx)
- require.NoError(t, err)
-
- mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- build.Clock.Sleep(time.Second)
-
- done := make(chan struct{})
- go func() {
- defer close(done)
- for ctx.Err() == nil {
- build.Clock.Sleep(blocktime)
- if err := miner.MineOne(ctx, MineNext); err != nil {
- if ctx.Err() != nil {
- // context was canceled, ignore the error.
- return
- }
- t.Error(err)
- }
- }
- }()
- defer func() {
- cancel()
- <-done
- }()
-
- pledgeSectors(t, ctx, miner, 10, 0, nil)
- wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
- require.NoError(t, err)
- en := wact.Nonce
-
- // wait for a new message to be sent from worker address, it will be a PoSt
-
-waitForProof:
- for {
- wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
- require.NoError(t, err)
- if wact.Nonce > en {
- break waitForProof
- }
-
- build.Clock.Sleep(blocktime)
- }
-
- slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0)
- require.NoError(t, err)
-
- pmr, err := client.StateReplay(ctx, types.EmptyTSK, slm[0])
- require.NoError(t, err)
-
- require.Equal(t, pmr.GasCost.BaseFeeBurn, big.Zero())
-
- build.UpgradeClausHeight = och
-}
-
-func TestWindowPostBaseFeeBurn(t *testing.T, b APIBuilder, blocktime time.Duration) {
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(-1)}, OneMiner)
-
- client := n[0].FullNode.(*impl.FullNodeAPI)
- miner := sn[0]
-
- {
- addrinfo, err := client.NetAddrsListen(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- if err := miner.NetConnect(ctx, addrinfo); err != nil {
- t.Fatal(err)
- }
- }
-
- maddr, err := miner.ActorAddress(ctx)
- require.NoError(t, err)
-
- mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK)
- require.NoError(t, err)
-
- build.Clock.Sleep(time.Second)
-
- done := make(chan struct{})
- go func() {
- defer close(done)
- for ctx.Err() == nil {
- build.Clock.Sleep(blocktime)
- if err := miner.MineOne(ctx, MineNext); err != nil {
- if ctx.Err() != nil {
- // context was canceled, ignore the error.
- return
- }
- t.Error(err)
- }
- }
- }()
- defer func() {
- cancel()
- <-done
- }()
-
- pledgeSectors(t, ctx, miner, 10, 0, nil)
- wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
- require.NoError(t, err)
- en := wact.Nonce
-
- // wait for a new message to be sent from worker address, it will be a PoSt
-
-waitForProof:
- for {
- wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
- require.NoError(t, err)
- if wact.Nonce > en {
- break waitForProof
- }
-
- build.Clock.Sleep(blocktime)
- }
-
- slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0)
- require.NoError(t, err)
-
- pmr, err := client.StateReplay(ctx, types.EmptyTSK, slm[0])
- require.NoError(t, err)
-
- require.NotEqual(t, pmr.GasCost.BaseFeeBurn, big.Zero())
-}
diff --git a/api/types.go b/api/types.go
index 6417ce756..9d887b0a1 100644
--- a/api/types.go
+++ b/api/types.go
@@ -5,6 +5,9 @@ import (
"fmt"
"time"
+ "github.com/filecoin-project/go-fil-markets/retrievalmarket"
+ "github.com/filecoin-project/lotus/chain/types"
+
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
@@ -116,3 +119,79 @@ type ConnMgrInfo struct {
Tags map[string]int
Conns map[string]time.Time
}
+
+type NodeStatus struct {
+ SyncStatus NodeSyncStatus
+ PeerStatus NodePeerStatus
+ ChainStatus NodeChainStatus
+}
+
+type NodeSyncStatus struct {
+ Epoch uint64
+ Behind uint64
+}
+
+type NodePeerStatus struct {
+ PeersToPublishMsgs int
+ PeersToPublishBlocks int
+}
+
+type NodeChainStatus struct {
+ BlocksPerTipsetLast100 float64
+ BlocksPerTipsetLastFinality float64
+}
+
+type CheckStatusCode int
+
+//go:generate go run golang.org/x/tools/cmd/stringer -type=CheckStatusCode -trimprefix=CheckStatus
+const (
+ _ CheckStatusCode = iota
+ // Message Checks
+ CheckStatusMessageSerialize
+ CheckStatusMessageSize
+ CheckStatusMessageValidity
+ CheckStatusMessageMinGas
+ CheckStatusMessageMinBaseFee
+ CheckStatusMessageBaseFee
+ CheckStatusMessageBaseFeeLowerBound
+ CheckStatusMessageBaseFeeUpperBound
+ CheckStatusMessageGetStateNonce
+ CheckStatusMessageNonce
+ CheckStatusMessageGetStateBalance
+ CheckStatusMessageBalance
+)
+
+type CheckStatus struct {
+ Code CheckStatusCode
+ OK bool
+ Err string
+ Hint map[string]interface{}
+}
+
+type MessageCheckStatus struct {
+ Cid cid.Cid
+ CheckStatus
+}
+
+type MessagePrototype struct {
+ Message types.Message
+ ValidNonce bool
+}
+
+type RetrievalInfo struct {
+ PayloadCID cid.Cid
+ ID retrievalmarket.DealID
+ PieceCID *cid.Cid
+ PricePerByte abi.TokenAmount
+ UnsealPrice abi.TokenAmount
+
+ Status retrievalmarket.DealStatus
+ Message string // more information about deal state, particularly errors
+ Provider peer.ID
+ BytesReceived uint64
+ BytesPaidFor uint64
+ TotalPaid abi.TokenAmount
+
+ TransferChannelID *datatransfer.ChannelID
+ DataTransfer *DataTransferChannel
+}
diff --git a/api/v0api/full.go b/api/v0api/full.go
new file mode 100644
index 000000000..076c37013
--- /dev/null
+++ b/api/v0api/full.go
@@ -0,0 +1,707 @@
+package v0api
+
+import (
+ "context"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-bitfield"
+ datatransfer "github.com/filecoin-project/go-data-transfer"
+ "github.com/filecoin-project/go-fil-markets/retrievalmarket"
+ "github.com/filecoin-project/go-fil-markets/storagemarket"
+ "github.com/filecoin-project/go-multistore"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/crypto"
+ "github.com/filecoin-project/go-state-types/dline"
+ "github.com/ipfs/go-cid"
+ "github.com/libp2p/go-libp2p-core/peer"
+
+ "github.com/filecoin-project/lotus/api"
+ apitypes "github.com/filecoin-project/lotus/api/types"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/paych"
+ "github.com/filecoin-project/lotus/chain/types"
+ marketevents "github.com/filecoin-project/lotus/markets/loggers"
+ "github.com/filecoin-project/lotus/node/modules/dtypes"
+)
+
+//go:generate go run github.com/golang/mock/mockgen -destination=v0mocks/mock_full.go -package=v0mocks . FullNode
+
+// MODIFYING THE API INTERFACE
+//
+// NOTE: This is the V0 (Stable) API - when adding methods to this interface,
+// you'll need to make sure they are also present on the V1 (Unstable) API
+//
+// This API is implemented in `v1_wrapper.go` as a compatibility layer backed
+// by the V1 api
+//
+// When adding / changing methods in this file:
+// * Do the change here
+// * Adjust implementation in `node/impl/`
+// * Run `make gen` - this will:
+// * Generate proxy structs
+// * Generate mocks
+// * Generate markdown docs
+// * Generate openrpc blobs
+
+// FullNode API is a low-level interface to the Filecoin network full node
+type FullNode interface {
+ Common
+
+ // MethodGroup: Chain
+ // The Chain method group contains methods for interacting with the
+ // blockchain, but that do not require any form of state computation.
+
+ // ChainNotify returns channel with chain head updates.
+ // First message is guaranteed to be of len == 1, and type == 'current'.
+ ChainNotify(context.Context) (<-chan []*api.HeadChange, error) //perm:read
+
+ // ChainHead returns the current head of the chain.
+ ChainHead(context.Context) (*types.TipSet, error) //perm:read
+
+ // ChainGetRandomnessFromTickets is used to sample the chain for randomness.
+ ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read
+
+ // ChainGetRandomnessFromBeacon is used to sample the beacon for randomness.
+ ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read
+
+ // ChainGetBlock returns the block specified by the given CID.
+ ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error) //perm:read
+ // ChainGetTipSet returns the tipset specified by the given TipSetKey.
+ ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) //perm:read
+
+ // ChainGetBlockMessages returns messages stored in the specified block.
+ //
+ // Note: If there are multiple blocks in a tipset, it's likely that some
+ // messages will be duplicated. It's also possible for blocks in a tipset to have
+ // different messages from the same sender at the same nonce. When that happens,
+ // only the first message (in a block with lowest ticket) will be considered
+ // for execution
+ //
+ // NOTE: THIS METHOD SHOULD ONLY BE USED FOR GETTING MESSAGES IN A SPECIFIC BLOCK
+ //
+ // DO NOT USE THIS METHOD TO GET MESSAGES INCLUDED IN A TIPSET
+ // Use ChainGetParentMessages, which will perform correct message deduplication
+ ChainGetBlockMessages(ctx context.Context, blockCid cid.Cid) (*api.BlockMessages, error) //perm:read
+
+ // ChainGetParentReceipts returns receipts for messages in parent tipset of
+ // the specified block. The receipts in the list returned is one-to-one with the
+ // messages returned by a call to ChainGetParentMessages with the same blockCid.
+ ChainGetParentReceipts(ctx context.Context, blockCid cid.Cid) ([]*types.MessageReceipt, error) //perm:read
+
+ // ChainGetParentMessages returns messages stored in parent tipset of the
+ // specified block.
+ ChainGetParentMessages(ctx context.Context, blockCid cid.Cid) ([]api.Message, error) //perm:read
+
+ // ChainGetTipSetByHeight looks back for a tipset at the specified epoch.
+ // If there are no blocks at the specified epoch, a tipset at an earlier epoch
+ // will be returned.
+ ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) //perm:read
+
+ // ChainReadObj reads ipld nodes referenced by the specified CID from chain
+ // blockstore and returns raw bytes.
+ ChainReadObj(context.Context, cid.Cid) ([]byte, error) //perm:read
+
+ // ChainDeleteObj deletes node referenced by the given CID
+ ChainDeleteObj(context.Context, cid.Cid) error //perm:admin
+
+ // ChainHasObj checks if a given CID exists in the chain blockstore.
+ ChainHasObj(context.Context, cid.Cid) (bool, error) //perm:read
+
+ // ChainStatObj returns statistics about the graph referenced by 'obj'.
+ // If 'base' is also specified, then the returned stat will be a diff
+ // between the two objects.
+ ChainStatObj(ctx context.Context, obj cid.Cid, base cid.Cid) (api.ObjStat, error) //perm:read
+
+ // ChainSetHead forcefully sets current chain head. Use with caution.
+ ChainSetHead(context.Context, types.TipSetKey) error //perm:admin
+
+ // ChainGetGenesis returns the genesis tipset.
+ ChainGetGenesis(context.Context) (*types.TipSet, error) //perm:read
+
+ // ChainTipSetWeight computes weight for the specified tipset.
+ ChainTipSetWeight(context.Context, types.TipSetKey) (types.BigInt, error) //perm:read
+ ChainGetNode(ctx context.Context, p string) (*api.IpldObject, error) //perm:read
+
+ // ChainGetMessage reads a message referenced by the specified CID from the
+ // chain blockstore.
+ ChainGetMessage(context.Context, cid.Cid) (*types.Message, error) //perm:read
+
+ // ChainGetPath returns a set of revert/apply operations needed to get from
+ // one tipset to another, for example:
+ //```
+ // to
+ // ^
+ // from tAA
+ // ^ ^
+ // tBA tAB
+ // ^---*--^
+ // ^
+ // tRR
+ //```
+ // Would return `[revert(tBA), apply(tAB), apply(tAA)]`
+ ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*api.HeadChange, error) //perm:read
+
+ // ChainExport returns a stream of bytes with CAR dump of chain data.
+ // The exported chain data includes the header chain from the given tipset
+ // back to genesis, the entire genesis state, and the most recent 'nroots'
+ // state trees.
+ // If oldmsgskip is set, messages from before the requested roots are also not included.
+ ChainExport(ctx context.Context, nroots abi.ChainEpoch, oldmsgskip bool, tsk types.TipSetKey) (<-chan []byte, error) //perm:read
+
+ // MethodGroup: Beacon
+ // The Beacon method group contains methods for interacting with the random beacon (DRAND)
+
+ // BeaconGetEntry returns the beacon entry for the given filecoin epoch. If
+ // the entry has not yet been produced, the call will block until the entry
+ // becomes available
+ BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) //perm:read
+
+ // GasEstimateFeeCap estimates gas fee cap
+ GasEstimateFeeCap(context.Context, *types.Message, int64, types.TipSetKey) (types.BigInt, error) //perm:read
+
+ // GasEstimateGasLimit estimates gas used by the message and returns it.
+ // It fails if message fails to execute.
+ GasEstimateGasLimit(context.Context, *types.Message, types.TipSetKey) (int64, error) //perm:read
+
+ // GasEstimateGasPremium estimates what gas price should be used for a
+ // message to have high likelihood of inclusion in `nblocksincl` epochs.
+
+ GasEstimateGasPremium(_ context.Context, nblocksincl uint64,
+ sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) //perm:read
+
+ // GasEstimateMessageGas estimates gas values for unset message gas fields
+ GasEstimateMessageGas(context.Context, *types.Message, *api.MessageSendSpec, types.TipSetKey) (*types.Message, error) //perm:read
+
+ // MethodGroup: Sync
+ // The Sync method group contains methods for interacting with and
+ // observing the lotus sync service.
+
+ // SyncState returns the current status of the lotus sync system.
+ SyncState(context.Context) (*api.SyncState, error) //perm:read
+
+ // SyncSubmitBlock can be used to submit a newly created block to the.
+ // network through this node
+ SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error //perm:write
+
+ // SyncIncomingBlocks returns a channel streaming incoming, potentially not
+ // yet synced block headers.
+ SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) //perm:read
+
+ // SyncCheckpoint marks a blocks as checkpointed, meaning that it won't ever fork away from it.
+ SyncCheckpoint(ctx context.Context, tsk types.TipSetKey) error //perm:admin
+
+ // SyncMarkBad marks a blocks as bad, meaning that it won't ever by synced.
+ // Use with extreme caution.
+ SyncMarkBad(ctx context.Context, bcid cid.Cid) error //perm:admin
+
+ // SyncUnmarkBad unmarks a blocks as bad, making it possible to be validated and synced again.
+ SyncUnmarkBad(ctx context.Context, bcid cid.Cid) error //perm:admin
+
+ // SyncUnmarkAllBad purges bad block cache, making it possible to sync to chains previously marked as bad
+ SyncUnmarkAllBad(ctx context.Context) error //perm:admin
+
+ // SyncCheckBad checks if a block was marked as bad, and if it was, returns
+ // the reason.
+ SyncCheckBad(ctx context.Context, bcid cid.Cid) (string, error) //perm:read
+
+ // SyncValidateTipset indicates whether the provided tipset is valid or not
+ SyncValidateTipset(ctx context.Context, tsk types.TipSetKey) (bool, error) //perm:read
+
+ // MethodGroup: Mpool
+ // The Mpool methods are for interacting with the message pool. The message pool
+ // manages all incoming and outgoing 'messages' going over the network.
+
+ // MpoolPending returns pending mempool messages.
+ MpoolPending(context.Context, types.TipSetKey) ([]*types.SignedMessage, error) //perm:read
+
+ // MpoolSelect returns a list of pending messages for inclusion in the next block
+ MpoolSelect(context.Context, types.TipSetKey, float64) ([]*types.SignedMessage, error) //perm:read
+
+ // MpoolPush pushes a signed message to mempool.
+ MpoolPush(context.Context, *types.SignedMessage) (cid.Cid, error) //perm:write
+
+ // MpoolPushUntrusted pushes a signed message to mempool from untrusted sources.
+ MpoolPushUntrusted(context.Context, *types.SignedMessage) (cid.Cid, error) //perm:write
+
+ // MpoolPushMessage atomically assigns a nonce, signs, and pushes a message
+ // to mempool.
+ // maxFee is only used when GasFeeCap/GasPremium fields aren't specified
+ //
+ // When maxFee is set to 0, MpoolPushMessage will guess appropriate fee
+ // based on current chain conditions
+ MpoolPushMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) (*types.SignedMessage, error) //perm:sign
+
+ // MpoolBatchPush batch pushes a signed message to mempool.
+ MpoolBatchPush(context.Context, []*types.SignedMessage) ([]cid.Cid, error) //perm:write
+
+ // MpoolBatchPushUntrusted batch pushes a signed message to mempool from untrusted sources.
+ MpoolBatchPushUntrusted(context.Context, []*types.SignedMessage) ([]cid.Cid, error) //perm:write
+
+ // MpoolBatchPushMessage batch pushes a unsigned message to mempool.
+ MpoolBatchPushMessage(context.Context, []*types.Message, *api.MessageSendSpec) ([]*types.SignedMessage, error) //perm:sign
+
+ // MpoolGetNonce gets next nonce for the specified sender.
+ // Note that this method may not be atomic. Use MpoolPushMessage instead.
+ MpoolGetNonce(context.Context, address.Address) (uint64, error) //perm:read
+ MpoolSub(context.Context) (<-chan api.MpoolUpdate, error) //perm:read
+
+ // MpoolClear clears pending messages from the mpool
+ MpoolClear(context.Context, bool) error //perm:write
+
+ // MpoolGetConfig returns (a copy of) the current mpool config
+ MpoolGetConfig(context.Context) (*types.MpoolConfig, error) //perm:read
+ // MpoolSetConfig sets the mpool config to (a copy of) the supplied config
+ MpoolSetConfig(context.Context, *types.MpoolConfig) error //perm:admin
+
+ // MethodGroup: Miner
+
+ MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error) //perm:read
+ MinerCreateBlock(context.Context, *api.BlockTemplate) (*types.BlockMsg, error) //perm:write
+
+ // // UX ?
+
+ // MethodGroup: Wallet
+
+ // WalletNew creates a new address in the wallet with the given sigType.
+ // Available key types: bls, secp256k1, secp256k1-ledger
+ // Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated
+ WalletNew(context.Context, types.KeyType) (address.Address, error) //perm:write
+ // WalletHas indicates whether the given address is in the wallet.
+ WalletHas(context.Context, address.Address) (bool, error) //perm:write
+ // WalletList lists all the addresses in the wallet.
+ WalletList(context.Context) ([]address.Address, error) //perm:write
+ // WalletBalance returns the balance of the given address at the current head of the chain.
+ WalletBalance(context.Context, address.Address) (types.BigInt, error) //perm:read
+ // WalletSign signs the given bytes using the given address.
+ WalletSign(context.Context, address.Address, []byte) (*crypto.Signature, error) //perm:sign
+ // WalletSignMessage signs the given message using the given address.
+ WalletSignMessage(context.Context, address.Address, *types.Message) (*types.SignedMessage, error) //perm:sign
+ // WalletVerify takes an address, a signature, and some bytes, and indicates whether the signature is valid.
+ // The address does not have to be in the wallet.
+ WalletVerify(context.Context, address.Address, []byte, *crypto.Signature) (bool, error) //perm:read
+ // WalletDefaultAddress returns the address marked as default in the wallet.
+ WalletDefaultAddress(context.Context) (address.Address, error) //perm:write
+ // WalletSetDefault marks the given address as as the default one.
+ WalletSetDefault(context.Context, address.Address) error //perm:write
+ // WalletExport returns the private key of an address in the wallet.
+ WalletExport(context.Context, address.Address) (*types.KeyInfo, error) //perm:admin
+ // WalletImport receives a KeyInfo, which includes a private key, and imports it into the wallet.
+ WalletImport(context.Context, *types.KeyInfo) (address.Address, error) //perm:admin
+ // WalletDelete deletes an address from the wallet.
+ WalletDelete(context.Context, address.Address) error //perm:admin
+ // WalletValidateAddress validates whether a given string can be decoded as a well-formed address
+ WalletValidateAddress(context.Context, string) (address.Address, error) //perm:read
+
+ // Other
+
+ // MethodGroup: Client
+ // The Client methods all have to do with interacting with the storage and
+ // retrieval markets as a client
+
+ // ClientImport imports file under the specified path into filestore.
+ ClientImport(ctx context.Context, ref api.FileRef) (*api.ImportRes, error) //perm:admin
+ // ClientRemoveImport removes file import
+ ClientRemoveImport(ctx context.Context, importID multistore.StoreID) error //perm:admin
+ // ClientStartDeal proposes a deal with a miner.
+ ClientStartDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) //perm:admin
+ // ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking.
+ ClientStatelessDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) //perm:write
+ // ClientGetDealInfo returns the latest information about a given deal.
+ ClientGetDealInfo(context.Context, cid.Cid) (*api.DealInfo, error) //perm:read
+ // ClientListDeals returns information about the deals made by the local client.
+ ClientListDeals(ctx context.Context) ([]api.DealInfo, error) //perm:write
+ // ClientGetDealUpdates returns the status of updated deals
+ ClientGetDealUpdates(ctx context.Context) (<-chan api.DealInfo, error) //perm:write
+ // ClientGetDealStatus returns status given a code
+ ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) //perm:read
+ // ClientHasLocal indicates whether a certain CID is locally stored.
+ ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error) //perm:write
+ // ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer).
+ ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) //perm:read
+ // ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.
+ ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) //perm:read
+ // ClientRetrieve initiates the retrieval of a file, as specified in the order.
+ ClientRetrieve(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error //perm:admin
+ // ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
+ // of status updates.
+ ClientRetrieveWithEvents(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
+ // ClientQueryAsk returns a signed StorageAsk from the specified miner.
+ // ClientListRetrievals returns information about retrievals made by the local client
+ ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) //perm:write
+ // ClientGetRetrievalUpdates returns status of updated retrieval deals
+ ClientGetRetrievalUpdates(ctx context.Context) (<-chan api.RetrievalInfo, error) //perm:write
+ ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) //perm:read
+ // ClientCalcCommP calculates the CommP and data size of the specified CID
+ ClientDealPieceCID(ctx context.Context, root cid.Cid) (api.DataCIDSize, error) //perm:read
+ // ClientCalcCommP calculates the CommP for a specified file
+ ClientCalcCommP(ctx context.Context, inpath string) (*api.CommPRet, error) //perm:write
+ // ClientGenCar generates a CAR file for the specified file.
+ ClientGenCar(ctx context.Context, ref api.FileRef, outpath string) error //perm:write
+ // ClientDealSize calculates real deal data size
+ ClientDealSize(ctx context.Context, root cid.Cid) (api.DataSize, error) //perm:read
+ // ClientListTransfers returns the status of all ongoing transfers of data
+ ClientListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error) //perm:write
+ ClientDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error) //perm:write
+ // ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer
+ ClientRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
+ // ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer
+ ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
+ // ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel
+ // which are stuck due to insufficient funds
+ ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error //perm:write
+
+ // ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID
+ ClientCancelRetrievalDeal(ctx context.Context, dealid retrievalmarket.DealID) error //perm:write
+
+ // ClientUnimport removes references to the specified file from filestore
+ //ClientUnimport(path string)
+
+ // ClientListImports lists imported files and their root CIDs
+ ClientListImports(ctx context.Context) ([]api.Import, error) //perm:write
+
+ //ClientListAsks() []Ask
+
+ // MethodGroup: State
+ // The State methods are used to query, inspect, and interact with chain state.
+ // Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset.
+ // A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used.
+
+ // StateCall runs the given message and returns its result without any persisted changes.
+ //
+ // StateCall applies the message to the tipset's parent state. The
+ // message is not applied on-top-of the messages in the passed-in
+ // tipset.
+ StateCall(context.Context, *types.Message, types.TipSetKey) (*api.InvocResult, error) //perm:read
+ // StateReplay replays a given message, assuming it was included in a block in the specified tipset.
+ //
+ // If a tipset key is provided, and a replacing message is found on chain,
+ // the method will return an error saying that the message wasn't found
+ //
+ // If no tipset key is provided, the appropriate tipset is looked up, and if
+ // the message was gas-repriced, the on-chain message will be replayed - in
+ // that case the returned InvocResult.MsgCid will not match the Cid param
+ //
+ // If the caller wants to ensure that exactly the requested message was executed,
+ // they MUST check that InvocResult.MsgCid is equal to the provided Cid.
+ // Without this check both the requested and original message may appear as
+ // successfully executed on-chain, which may look like a double-spend.
+ //
+ // A replacing message is a message with a different CID, any of Gas values, and
+ // different signature, but with all other parameters matching (source/destination,
+ // nonce, params, etc.)
+ StateReplay(context.Context, types.TipSetKey, cid.Cid) (*api.InvocResult, error) //perm:read
+ // StateGetActor returns the indicated actor's nonce and balance.
+ StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) //perm:read
+ // StateReadState returns the indicated actor's state.
+ StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*api.ActorState, error) //perm:read
+ // StateListMessages looks back and returns all messages with a matching to or from address, stopping at the given height.
+ StateListMessages(ctx context.Context, match *api.MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) //perm:read
+ // StateDecodeParams attempts to decode the provided params, based on the recipient actor address and method number.
+ StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) //perm:read
+
+ // StateNetworkName returns the name of the network the node is synced to
+ StateNetworkName(context.Context) (dtypes.NetworkName, error) //perm:read
+ // StateMinerSectors returns info about the given miner's sectors. If the filter bitfield is nil, all sectors are included.
+ StateMinerSectors(context.Context, address.Address, *bitfield.BitField, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read
+ // StateMinerActiveSectors returns info about sectors that a given miner is actively proving.
+ StateMinerActiveSectors(context.Context, address.Address, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read
+ // StateMinerProvingDeadline calculates the deadline at some epoch for a proving period
+ // and returns the deadline-related calculations.
+ StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error) //perm:read
+ // StateMinerPower returns the power of the indicated miner
+ StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error) //perm:read
+ // StateMinerInfo returns info about the indicated miner
+ StateMinerInfo(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) //perm:read
+ // StateMinerDeadlines returns all the proving deadlines for the given miner
+ StateMinerDeadlines(context.Context, address.Address, types.TipSetKey) ([]api.Deadline, error) //perm:read
+ // StateMinerPartitions returns all partitions in the specified deadline
+ StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]api.Partition, error) //perm:read
+ // StateMinerFaults returns a bitfield indicating the faulty sectors of the given miner
+ StateMinerFaults(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) //perm:read
+ // StateAllMinerFaults returns all non-expired Faults that occur within lookback epochs of the given tipset
+ StateAllMinerFaults(ctx context.Context, lookback abi.ChainEpoch, ts types.TipSetKey) ([]*api.Fault, error) //perm:read
+ // StateMinerRecoveries returns a bitfield indicating the recovering sectors of the given miner
+ StateMinerRecoveries(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) //perm:read
+ // StateMinerInitialPledgeCollateral returns the precommit deposit for the specified miner's sector
+ StateMinerPreCommitDepositForPower(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) //perm:read
+ // StateMinerInitialPledgeCollateral returns the initial pledge collateral for the specified miner's sector
+ StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) //perm:read
+ // StateMinerAvailableBalance returns the portion of a miner's balance that can be withdrawn or spent
+ StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) //perm:read
+ // StateMinerSectorAllocated checks if a sector is allocated
+ StateMinerSectorAllocated(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error) //perm:read
+ // StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector
+ StateSectorPreCommitInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) //perm:read
+ // StateSectorGetInfo returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found
+ // NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate
+ // expiration epoch
+ StateSectorGetInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error) //perm:read
+ // StateSectorExpiration returns epoch at which given sector will expire
+ StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error) //perm:read
+ // StateSectorPartition finds deadline/partition with the specified sector
+ StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error) //perm:read
+ // StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed
+ //
+ // NOTE: If a replacing message is found on chain, this method will return
+ // a MsgLookup for the replacing message - the MsgLookup.Message will be a different
+ // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
+ // result of the execution of the replacing message.
+ //
+ // If the caller wants to ensure that exactly the requested message was executed,
+ // they MUST check that MsgLookup.Message is equal to the provided 'cid'.
+ // Without this check both the requested and original message may appear as
+ // successfully executed on-chain, which may look like a double-spend.
+ //
+ // A replacing message is a message with a different CID, any of Gas values, and
+ // different signature, but with all other parameters matching (source/destination,
+ // nonce, params, etc.)
+ StateSearchMsg(context.Context, cid.Cid) (*api.MsgLookup, error) //perm:read
+ // StateSearchMsgLimited looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed
+ //
+ // NOTE: If a replacing message is found on chain, this method will return
+ // a MsgLookup for the replacing message - the MsgLookup.Message will be a different
+ // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
+ // result of the execution of the replacing message.
+ //
+ // If the caller wants to ensure that exactly the requested message was executed,
+ // they MUST check that MsgLookup.Message is equal to the provided 'cid'.
+ // Without this check both the requested and original message may appear as
+ // successfully executed on-chain, which may look like a double-spend.
+ //
+ // A replacing message is a message with a different CID, any of Gas values, and
+ // different signature, but with all other parameters matching (source/destination,
+ // nonce, params, etc.)
+ StateSearchMsgLimited(ctx context.Context, msg cid.Cid, limit abi.ChainEpoch) (*api.MsgLookup, error) //perm:read
+ // StateWaitMsg looks back in the chain for a message. If not found, it blocks until the
+ // message arrives on chain, and gets to the indicated confidence depth.
+ //
+ // NOTE: If a replacing message is found on chain, this method will return
+ // a MsgLookup for the replacing message - the MsgLookup.Message will be a different
+ // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
+ // result of the execution of the replacing message.
+ //
+ // If the caller wants to ensure that exactly the requested message was executed,
+ // they MUST check that MsgLookup.Message is equal to the provided 'cid'.
+ // Without this check both the requested and original message may appear as
+ // successfully executed on-chain, which may look like a double-spend.
+ //
+ // A replacing message is a message with a different CID, any of Gas values, and
+ // different signature, but with all other parameters matching (source/destination,
+ // nonce, params, etc.)
+ StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*api.MsgLookup, error) //perm:read
+ // StateWaitMsgLimited looks back up to limit epochs in the chain for a message.
+ // If not found, it blocks until the message arrives on chain, and gets to the
+ // indicated confidence depth.
+ //
+ // NOTE: If a replacing message is found on chain, this method will return
+ // a MsgLookup for the replacing message - the MsgLookup.Message will be a different
+ // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
+ // result of the execution of the replacing message.
+ //
+ // If the caller wants to ensure that exactly the requested message was executed,
+ // they MUST check that MsgLookup.Message is equal to the provided 'cid'.
+ // Without this check both the requested and original message may appear as
+ // successfully executed on-chain, which may look like a double-spend.
+ //
+ // A replacing message is a message with a different CID, any of Gas values, and
+ // different signature, but with all other parameters matching (source/destination,
+ // nonce, params, etc.)
+ StateWaitMsgLimited(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch) (*api.MsgLookup, error) //perm:read
+ // StateListMiners returns the addresses of every miner that has claimed power in the Power Actor
+ StateListMiners(context.Context, types.TipSetKey) ([]address.Address, error) //perm:read
+ // StateListActors returns the addresses of every actor in the state
+ StateListActors(context.Context, types.TipSetKey) ([]address.Address, error) //perm:read
+ // StateMarketBalance looks up the Escrow and Locked balances of the given address in the Storage Market
+ StateMarketBalance(context.Context, address.Address, types.TipSetKey) (api.MarketBalance, error) //perm:read
+ // StateMarketParticipants returns the Escrow and Locked balances of every participant in the Storage Market
+ StateMarketParticipants(context.Context, types.TipSetKey) (map[string]api.MarketBalance, error) //perm:read
+ // StateMarketDeals returns information about every deal in the Storage Market
+ StateMarketDeals(context.Context, types.TipSetKey) (map[string]api.MarketDeal, error) //perm:read
+ // StateMarketStorageDeal returns information about the indicated deal
+ StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error) //perm:read
+ // StateLookupID retrieves the ID address of the given address
+ StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
+ // StateAccountKey returns the public key address of the given ID address
+ StateAccountKey(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
+ // StateChangedActors returns all the actors whose states change between the two given state CIDs
+ // TODO: Should this take tipset keys instead?
+ StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) //perm:read
+ // StateGetReceipt returns the message receipt for the given message or for a
+ // matching gas-repriced replacing message
+ //
+ // NOTE: If the requested message was replaced, this method will return the receipt
+ // for the replacing message - if the caller needs the receipt for exactly the
+ // requested message, use StateSearchMsg().Receipt, and check that MsgLookup.Message
+ // is matching the requested CID
+ //
+ // DEPRECATED: Use StateSearchMsg, this method won't be supported in v1 API
+ StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) //perm:read
+ // StateMinerSectorCount returns the number of sectors in a miner's sector set and proving set
+ StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (api.MinerSectors, error) //perm:read
+ // StateCompute is a flexible command that applies the given messages on the given tipset.
+ // The messages are run as though the VM were at the provided height.
+ //
+ // When called, StateCompute will:
+ // - Load the provided tipset, or use the current chain head if not provided
+ // - Compute the tipset state of the provided tipset on top of the parent state
+ // - (note that this step runs before vmheight is applied to the execution)
+ // - Execute state upgrade if any were scheduled at the epoch, or in null
+ // blocks preceding the tipset
+ // - Call the cron actor on null blocks preceding the tipset
+ // - For each block in the tipset
+ // - Apply messages in blocks in the specified
+ // - Award block reward by calling the reward actor
+ // - Call the cron actor for the current epoch
+ // - If the specified vmheight is higher than the current epoch, apply any
+ // needed state upgrades to the state
+ // - Apply the specified messages to the state
+ //
+ // The vmheight parameter sets VM execution epoch, and can be used to simulate
+ // message execution in different network versions. If the specified vmheight
+ // epoch is higher than the epoch of the specified tipset, any state upgrades
+ // until the vmheight will be executed on the state before applying messages
+ // specified by the user.
+ //
+ // Note that the initial tipset state computation is not affected by the
+ // vmheight parameter - only the messages in the `apply` set are
+ //
+ // If the caller wants to simply compute the state, vmheight should be set to
+ // the epoch of the specified tipset.
+ //
+ // Messages in the `apply` parameter must have the correct nonces, and gas
+ // values set.
+ StateCompute(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*api.ComputeStateOutput, error) //perm:read
+ // StateVerifierStatus returns the data cap for the given address.
+ // Returns nil if there is no entry in the data cap table for the
+ // address.
+ StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read
+ // StateVerifiedClientStatus returns the data cap for the given address.
+ // Returns nil if there is no entry in the data cap table for the
+ // address.
+ StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read
+ // StateVerifiedClientStatus returns the address of the Verified Registry's root key
+ StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) //perm:read
+ // StateDealProviderCollateralBounds returns the min and max collateral a storage provider
+ // can issue. It takes the deal size and verified status as parameters.
+ StateDealProviderCollateralBounds(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (api.DealCollateralBounds, error) //perm:read
+
+ // StateCirculatingSupply returns the exact circulating supply of Filecoin at the given tipset.
+ // This is not used anywhere in the protocol itself, and is only for external consumption.
+ StateCirculatingSupply(context.Context, types.TipSetKey) (abi.TokenAmount, error) //perm:read
+ // StateVMCirculatingSupplyInternal returns an approximation of the circulating supply of Filecoin at the given tipset.
+ // This is the value reported by the runtime interface to actors code.
+ StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (api.CirculatingSupply, error) //perm:read
+ // StateNetworkVersion returns the network version at the given tipset
+ StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
+
+ // MethodGroup: Msig
+ // The Msig methods are used to interact with multisig wallets on the
+ // filecoin network
+
+ // MsigGetAvailableBalance returns the portion of a multisig's balance that can be withdrawn or spent
+ MsigGetAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) //perm:read
+ // MsigGetVestingSchedule returns the vesting details of a given multisig.
+ MsigGetVestingSchedule(context.Context, address.Address, types.TipSetKey) (api.MsigVesting, error) //perm:read
+ // MsigGetVested returns the amount of FIL that vested in a multisig in a certain period.
+ // It takes the following params: , ,
+ MsigGetVested(context.Context, address.Address, types.TipSetKey, types.TipSetKey) (types.BigInt, error) //perm:read
+
+ //MsigGetPending returns pending transactions for the given multisig
+ //wallet. Once pending transactions are fully approved, they will no longer
+ //appear here.
+ MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*api.MsigTransaction, error) //perm:read
+
+ // MsigCreate creates a multisig wallet
+ // It takes the following params: , ,
+ //, ,
+ MsigCreate(context.Context, uint64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) //perm:sign
+ // MsigPropose proposes a multisig message
+ // It takes the following params: , , ,
+ // , ,
+ MsigPropose(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
+
+ // MsigApprove approves a previously-proposed multisig message by transaction ID
+ // It takes the following params: ,
+ MsigApprove(context.Context, address.Address, uint64, address.Address) (cid.Cid, error) //perm:sign
+
+ // MsigApproveTxnHash approves a previously-proposed multisig message, specified
+ // using both transaction ID and a hash of the parameters used in the
+ // proposal. This method of approval can be used to ensure you only approve
+ // exactly the transaction you think you are.
+ // It takes the following params: , , , , ,
+ // , ,
+ MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
+
+ // MsigCancel cancels a previously-proposed multisig message
+ // It takes the following params: , , , ,
+ // , ,
+ MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign
+ // MsigAddPropose proposes adding a signer in the multisig
+ // It takes the following params: , ,
+ // ,
+ MsigAddPropose(context.Context, address.Address, address.Address, address.Address, bool) (cid.Cid, error) //perm:sign
+ // MsigAddApprove approves a previously proposed AddSigner message
+ // It takes the following params: , , ,
+ // , ,
+ MsigAddApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, bool) (cid.Cid, error) //perm:sign
+ // MsigAddCancel cancels a previously proposed AddSigner message
+ // It takes the following params: , , ,
+ // ,
+ MsigAddCancel(context.Context, address.Address, address.Address, uint64, address.Address, bool) (cid.Cid, error) //perm:sign
+ // MsigSwapPropose proposes swapping 2 signers in the multisig
+ // It takes the following params: , ,
+ // ,
+ MsigSwapPropose(context.Context, address.Address, address.Address, address.Address, address.Address) (cid.Cid, error) //perm:sign
+ // MsigSwapApprove approves a previously proposed SwapSigner
+ // It takes the following params: , , ,
+ // , ,
+ MsigSwapApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, address.Address) (cid.Cid, error) //perm:sign
+ // MsigSwapCancel cancels a previously proposed SwapSigner message
+ // It takes the following params: , , ,
+ // ,
+ MsigSwapCancel(context.Context, address.Address, address.Address, uint64, address.Address, address.Address) (cid.Cid, error) //perm:sign
+
+ // MsigRemoveSigner proposes the removal of a signer from the multisig.
+ // It accepts the multisig to make the change on, the proposer address to
+ // send the message from, the address to be removed, and a boolean
+ // indicating whether or not the signing threshold should be lowered by one
+ // along with the address removal.
+ MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) //perm:sign
+
+ // MarketAddBalance adds funds to the market actor
+ MarketAddBalance(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign
+ // MarketGetReserved gets the amount of funds that are currently reserved for the address
+ MarketGetReserved(ctx context.Context, addr address.Address) (types.BigInt, error) //perm:sign
+ // MarketReserveFunds reserves funds for a deal
+ MarketReserveFunds(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign
+ // MarketReleaseFunds releases funds reserved by MarketReserveFunds
+ MarketReleaseFunds(ctx context.Context, addr address.Address, amt types.BigInt) error //perm:sign
+ // MarketWithdraw withdraws unlocked funds from the market actor
+ MarketWithdraw(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign
+
+ // MethodGroup: Paych
+ // The Paych methods are for interacting with and managing payment channels
+
+ PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) //perm:sign
+ PaychGetWaitReady(context.Context, cid.Cid) (address.Address, error) //perm:sign
+ PaychAvailableFunds(ctx context.Context, ch address.Address) (*api.ChannelAvailableFunds, error) //perm:sign
+ PaychAvailableFundsByFromTo(ctx context.Context, from, to address.Address) (*api.ChannelAvailableFunds, error) //perm:sign
+ PaychList(context.Context) ([]address.Address, error) //perm:read
+ PaychStatus(context.Context, address.Address) (*api.PaychStatus, error) //perm:read
+ PaychSettle(context.Context, address.Address) (cid.Cid, error) //perm:sign
+ PaychCollect(context.Context, address.Address) (cid.Cid, error) //perm:sign
+ PaychAllocateLane(ctx context.Context, ch address.Address) (uint64, error) //perm:sign
+ PaychNewPayment(ctx context.Context, from, to address.Address, vouchers []api.VoucherSpec) (*api.PaymentInfo, error) //perm:sign
+ PaychVoucherCheckValid(context.Context, address.Address, *paych.SignedVoucher) error //perm:read
+ PaychVoucherCheckSpendable(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (bool, error) //perm:read
+ PaychVoucherCreate(context.Context, address.Address, types.BigInt, uint64) (*api.VoucherCreateResult, error) //perm:sign
+ PaychVoucherAdd(context.Context, address.Address, *paych.SignedVoucher, []byte, types.BigInt) (types.BigInt, error) //perm:write
+ PaychVoucherList(context.Context, address.Address) ([]*paych.SignedVoucher, error) //perm:write
+ PaychVoucherSubmit(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (cid.Cid, error) //perm:sign
+
+ // CreateBackup creates node backup onder the specified file name. The
+ // method requires that the lotus daemon is running with the
+ // LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that
+ // the path specified when calling CreateBackup is within the base path
+ CreateBackup(ctx context.Context, fpath string) error //perm:admin
+}
diff --git a/api/v0api/gateway.go b/api/v0api/gateway.go
new file mode 100644
index 000000000..8a55b4c27
--- /dev/null
+++ b/api/v0api/gateway.go
@@ -0,0 +1,68 @@
+package v0api
+
+import (
+ "context"
+
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/dline"
+ "github.com/filecoin-project/go-state-types/network"
+
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
+ "github.com/filecoin-project/lotus/chain/types"
+)
+
+// MODIFYING THE API INTERFACE
+//
+// NOTE: This is the V0 (Stable) API - when adding methods to this interface,
+// you'll need to make sure they are also present on the V1 (Unstable) API
+//
+// This API is implemented in `v1_wrapper.go` as a compatibility layer backed
+// by the V1 api
+//
+// When adding / changing methods in this file:
+// * Do the change here
+// * Adjust implementation in `node/impl/`
+// * Run `make gen` - this will:
+// * Generate proxy structs
+// * Generate mocks
+// * Generate markdown docs
+// * Generate openrpc blobs
+
+type Gateway interface {
+ ChainHasObj(context.Context, cid.Cid) (bool, error)
+ ChainHead(ctx context.Context) (*types.TipSet, error)
+ ChainGetBlockMessages(context.Context, cid.Cid) (*api.BlockMessages, error)
+ ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
+ ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
+ ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
+ ChainNotify(context.Context) (<-chan []*api.HeadChange, error)
+ ChainReadObj(context.Context, cid.Cid) ([]byte, error)
+ GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
+ MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
+ MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
+ MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
+ MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*api.MsigTransaction, error)
+ StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
+ StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error)
+ StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
+ StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)
+ StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
+ StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
+ StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error)
+ StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error)
+ StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error)
+ StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
+ StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)
+ StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
+ StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error)
+ StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
+ StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
+ StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error)
+ WalletBalance(context.Context, address.Address) (types.BigInt, error)
+}
+
+var _ Gateway = *new(FullNode)
diff --git a/api/v0api/latest.go b/api/v0api/latest.go
new file mode 100644
index 000000000..87f977be6
--- /dev/null
+++ b/api/v0api/latest.go
@@ -0,0 +1,25 @@
+package v0api
+
+import (
+ "github.com/filecoin-project/lotus/api"
+)
+
+type Common = api.Common
+type CommonStruct = api.CommonStruct
+type CommonStub = api.CommonStub
+
+type StorageMiner = api.StorageMiner
+type StorageMinerStruct = api.StorageMinerStruct
+
+type Worker = api.Worker
+type WorkerStruct = api.WorkerStruct
+
+type Wallet = api.Wallet
+
+func PermissionedStorMinerAPI(a StorageMiner) StorageMiner {
+ return api.PermissionedStorMinerAPI(a)
+}
+
+func PermissionedWorkerAPI(a Worker) Worker {
+ return api.PermissionedWorkerAPI(a)
+}
diff --git a/api/v0api/permissioned.go b/api/v0api/permissioned.go
new file mode 100644
index 000000000..ad64bc29e
--- /dev/null
+++ b/api/v0api/permissioned.go
@@ -0,0 +1,13 @@
+package v0api
+
+import (
+ "github.com/filecoin-project/go-jsonrpc/auth"
+ "github.com/filecoin-project/lotus/api"
+)
+
+func PermissionedFullAPI(a FullNode) FullNode {
+ var out FullNodeStruct
+ auth.PermissionedProxy(api.AllPermissions, api.DefaultPerms, a, &out.Internal)
+ auth.PermissionedProxy(api.AllPermissions, api.DefaultPerms, a, &out.CommonStruct.Internal)
+ return &out
+}
diff --git a/api/apistruct/struct.go b/api/v0api/proxy_gen.go
similarity index 60%
rename from api/apistruct/struct.go
rename to api/v0api/proxy_gen.go
index acdc0f9b5..fc2fc4186 100644
--- a/api/apistruct/struct.go
+++ b/api/v0api/proxy_gen.go
@@ -1,109 +1,32 @@
// Code generated by github.com/filecoin-project/lotus/gen/api. DO NOT EDIT.
-package apistruct
+package v0api
import (
"context"
- "io"
- "time"
"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-multistore"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/dline"
+ "github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/api"
apitypes "github.com/filecoin-project/lotus/api/types"
- "github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
"github.com/filecoin-project/lotus/chain/types"
- "github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
- "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
- "github.com/filecoin-project/lotus/extern/sector-storage/stores"
- "github.com/filecoin-project/lotus/extern/sector-storage/storiface"
- "github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
marketevents "github.com/filecoin-project/lotus/markets/loggers"
"github.com/filecoin-project/lotus/node/modules/dtypes"
- "github.com/filecoin-project/specs-storage/storage"
- "github.com/google/uuid"
"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"
+ "golang.org/x/xerrors"
)
-type ChainIOStruct struct {
- Internal struct {
- ChainHasObj func(p0 context.Context, p1 cid.Cid) (bool, error) ``
-
- ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) ``
- }
-}
-
-type CommonStruct struct {
- Internal struct {
- AuthNew func(p0 context.Context, p1 []auth.Permission) ([]byte, error) `perm:"admin"`
-
- AuthVerify func(p0 context.Context, p1 string) ([]auth.Permission, error) `perm:"read"`
-
- Closing func(p0 context.Context) (<-chan struct{}, error) `perm:"read"`
-
- Discover func(p0 context.Context) (apitypes.OpenRPCDocument, error) `perm:"read"`
-
- ID func(p0 context.Context) (peer.ID, error) `perm:"read"`
-
- LogList func(p0 context.Context) ([]string, error) `perm:"write"`
-
- LogSetLevel func(p0 context.Context, p1 string, p2 string) error `perm:"write"`
-
- NetAddrsListen func(p0 context.Context) (peer.AddrInfo, error) `perm:"read"`
-
- NetAgentVersion func(p0 context.Context, p1 peer.ID) (string, error) `perm:"read"`
-
- NetAutoNatStatus func(p0 context.Context) (api.NatInfo, error) `perm:"read"`
-
- NetBandwidthStats func(p0 context.Context) (metrics.Stats, error) `perm:"read"`
-
- NetBandwidthStatsByPeer func(p0 context.Context) (map[string]metrics.Stats, error) `perm:"read"`
-
- NetBandwidthStatsByProtocol func(p0 context.Context) (map[protocol.ID]metrics.Stats, error) `perm:"read"`
-
- NetBlockAdd func(p0 context.Context, p1 api.NetBlockList) error `perm:"admin"`
-
- NetBlockList func(p0 context.Context) (api.NetBlockList, error) `perm:"read"`
-
- NetBlockRemove func(p0 context.Context, p1 api.NetBlockList) error `perm:"admin"`
-
- NetConnect func(p0 context.Context, p1 peer.AddrInfo) error `perm:"write"`
-
- NetConnectedness func(p0 context.Context, p1 peer.ID) (network.Connectedness, error) `perm:"read"`
-
- NetDisconnect func(p0 context.Context, p1 peer.ID) error `perm:"write"`
-
- NetFindPeer func(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) `perm:"read"`
-
- NetPeerInfo func(p0 context.Context, p1 peer.ID) (*api.ExtendedPeerInfo, error) `perm:"read"`
-
- NetPeers func(p0 context.Context) ([]peer.AddrInfo, error) `perm:"read"`
-
- NetPubsubScores func(p0 context.Context) ([]api.PubsubScore, error) `perm:"read"`
-
- Session func(p0 context.Context) (uuid.UUID, error) `perm:"read"`
-
- Shutdown func(p0 context.Context) error `perm:"admin"`
-
- Version func(p0 context.Context) (api.APIVersion, error) `perm:"read"`
- }
-}
-
type FullNodeStruct struct {
CommonStruct
@@ -174,6 +97,8 @@ type FullNodeStruct struct {
ClientGetDealUpdates func(p0 context.Context) (<-chan api.DealInfo, error) `perm:"write"`
+ ClientGetRetrievalUpdates func(p0 context.Context) (<-chan api.RetrievalInfo, error) `perm:"write"`
+
ClientHasLocal func(p0 context.Context, p1 cid.Cid) (bool, error) `perm:"write"`
ClientImport func(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) `perm:"admin"`
@@ -184,6 +109,8 @@ type FullNodeStruct struct {
ClientListImports func(p0 context.Context) ([]api.Import, error) `perm:"write"`
+ ClientListRetrievals func(p0 context.Context) ([]api.RetrievalInfo, error) `perm:"write"`
+
ClientMinerQueryOffer func(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) `perm:"read"`
ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) `perm:"read"`
@@ -200,6 +127,8 @@ type FullNodeStruct struct {
ClientStartDeal func(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) `perm:"admin"`
+ ClientStatelessDeal func(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) `perm:"write"`
+
CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"`
GasEstimateFeeCap func(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"`
@@ -456,6 +385,10 @@ type FullNodeStruct struct {
}
}
+type FullNodeStub struct {
+ CommonStub
+}
+
type GatewayStruct struct {
Internal struct {
ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) ``
@@ -506,7 +439,7 @@ type GatewayStruct struct {
StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) ``
- StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) ``
+ StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (network.Version, error) ``
StateSearchMsg func(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) ``
@@ -515,1696 +448,1661 @@ type GatewayStruct struct {
StateVerifiedClientStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) ``
StateWaitMsg func(p0 context.Context, p1 cid.Cid, p2 uint64) (*api.MsgLookup, error) ``
+
+ WalletBalance func(p0 context.Context, p1 address.Address) (types.BigInt, error) ``
}
}
-type SignableStruct struct {
- Internal struct {
- Sign func(p0 context.Context, p1 api.SignFunc) error ``
- }
-}
-
-type StorageMinerStruct struct {
- CommonStruct
-
- Internal struct {
- ActorAddress func(p0 context.Context) (address.Address, error) `perm:"read"`
-
- ActorAddressConfig func(p0 context.Context) (api.AddressConfig, error) `perm:"read"`
-
- ActorSectorSize func(p0 context.Context, p1 address.Address) (abi.SectorSize, error) `perm:"read"`
-
- CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) `perm:"admin"`
-
- ComputeProof func(p0 context.Context, p1 []builtin.SectorInfo, p2 abi.PoStRandomness) ([]builtin.PoStProof, error) `perm:"read"`
-
- CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"`
-
- DealsConsiderOfflineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"`
-
- DealsConsiderOfflineStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"`
-
- DealsConsiderOnlineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"`
-
- DealsConsiderOnlineStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"`
-
- DealsConsiderUnverifiedStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"`
-
- DealsConsiderVerifiedStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"`
-
- DealsImportData func(p0 context.Context, p1 cid.Cid, p2 string) error `perm:"admin"`
-
- DealsList func(p0 context.Context) ([]api.MarketDeal, error) `perm:"admin"`
-
- DealsPieceCidBlocklist func(p0 context.Context) ([]cid.Cid, error) `perm:"admin"`
-
- DealsSetConsiderOfflineRetrievalDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
-
- DealsSetConsiderOfflineStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
-
- DealsSetConsiderOnlineRetrievalDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
-
- DealsSetConsiderOnlineStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
-
- DealsSetConsiderUnverifiedStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
-
- DealsSetConsiderVerifiedStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"`
-
- DealsSetPieceCidBlocklist func(p0 context.Context, p1 []cid.Cid) error `perm:"admin"`
-
- MarketCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
-
- MarketDataTransferUpdates func(p0 context.Context) (<-chan api.DataTransferChannel, error) `perm:"write"`
-
- MarketGetAsk func(p0 context.Context) (*storagemarket.SignedStorageAsk, error) `perm:"read"`
-
- MarketGetDealUpdates func(p0 context.Context) (<-chan storagemarket.MinerDeal, error) `perm:"read"`
-
- MarketGetRetrievalAsk func(p0 context.Context) (*retrievalmarket.Ask, error) `perm:"read"`
-
- MarketImportDealData func(p0 context.Context, p1 cid.Cid, p2 string) error `perm:"write"`
-
- MarketListDataTransfers func(p0 context.Context) ([]api.DataTransferChannel, error) `perm:"write"`
-
- MarketListDeals func(p0 context.Context) ([]api.MarketDeal, error) `perm:"read"`
-
- MarketListIncompleteDeals func(p0 context.Context) ([]storagemarket.MinerDeal, error) `perm:"read"`
-
- MarketListRetrievalDeals func(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) `perm:"read"`
-
- MarketPendingDeals func(p0 context.Context) (api.PendingDealInfo, error) `perm:"write"`
-
- MarketPublishPendingDeals func(p0 context.Context) error `perm:"admin"`
-
- MarketRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
-
- MarketSetAsk func(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error `perm:"admin"`
-
- MarketSetRetrievalAsk func(p0 context.Context, p1 *retrievalmarket.Ask) error `perm:"admin"`
-
- MiningBase func(p0 context.Context) (*types.TipSet, error) `perm:"read"`
-
- PiecesGetCIDInfo func(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) `perm:"read"`
-
- PiecesGetPieceInfo func(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) `perm:"read"`
-
- PiecesListCidInfos func(p0 context.Context) ([]cid.Cid, error) `perm:"read"`
-
- PiecesListPieces func(p0 context.Context) ([]cid.Cid, error) `perm:"read"`
-
- PledgeSector func(p0 context.Context) (abi.SectorID, error) `perm:"write"`
-
- ReturnAddPiece func(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error `perm:"admin"`
-
- ReturnFetch func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
-
- ReturnFinalizeSector func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
-
- ReturnMoveStorage func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
-
- ReturnReadPiece func(p0 context.Context, p1 storiface.CallID, p2 bool, p3 *storiface.CallError) error `perm:"admin"`
-
- ReturnReleaseUnsealed func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
-
- ReturnSealCommit1 func(p0 context.Context, p1 storiface.CallID, p2 storage.Commit1Out, p3 *storiface.CallError) error `perm:"admin"`
-
- ReturnSealCommit2 func(p0 context.Context, p1 storiface.CallID, p2 storage.Proof, p3 *storiface.CallError) error `perm:"admin"`
-
- ReturnSealPreCommit1 func(p0 context.Context, p1 storiface.CallID, p2 storage.PreCommit1Out, p3 *storiface.CallError) error `perm:"admin"`
-
- ReturnSealPreCommit2 func(p0 context.Context, p1 storiface.CallID, p2 storage.SectorCids, p3 *storiface.CallError) error `perm:"admin"`
-
- ReturnUnsealPiece func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
-
- SealingAbort func(p0 context.Context, p1 storiface.CallID) error `perm:"admin"`
-
- SealingSchedDiag func(p0 context.Context, p1 bool) (interface{}, error) `perm:"admin"`
-
- SectorCommitFlush func(p0 context.Context) ([]sealiface.CommitBatchRes, error) `perm:"admin"`
-
- SectorCommitPending func(p0 context.Context) ([]abi.SectorID, error) `perm:"admin"`
-
- SectorGetExpectedSealDuration func(p0 context.Context) (time.Duration, error) `perm:"read"`
-
- SectorGetSealDelay func(p0 context.Context) (time.Duration, error) `perm:"read"`
-
- SectorMarkForUpgrade func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"`
-
- SectorPreCommitFlush func(p0 context.Context) ([]sealiface.PreCommitBatchRes, error) `perm:"admin"`
-
- SectorPreCommitPending func(p0 context.Context) ([]abi.SectorID, 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"`
-
- SectorSetSealDelay func(p0 context.Context, p1 time.Duration) error `perm:"write"`
-
- SectorStartSealing func(p0 context.Context, p1 abi.SectorNumber) error `perm:"write"`
-
- SectorTerminate func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"`
-
- SectorTerminateFlush func(p0 context.Context) (*cid.Cid, error) `perm:"admin"`
-
- SectorTerminatePending func(p0 context.Context) ([]abi.SectorID, error) `perm:"admin"`
-
- SectorsList func(p0 context.Context) ([]abi.SectorNumber, error) `perm:"read"`
-
- SectorsListInStates func(p0 context.Context, p1 []api.SectorState) ([]abi.SectorNumber, error) `perm:"read"`
-
- SectorsRefs func(p0 context.Context) (map[string][]api.SealedRef, error) `perm:"read"`
-
- SectorsStatus func(p0 context.Context, p1 abi.SectorNumber, p2 bool) (api.SectorInfo, error) `perm:"read"`
-
- SectorsSummary func(p0 context.Context) (map[api.SectorState]int, error) `perm:"read"`
-
- SectorsUpdate func(p0 context.Context, p1 abi.SectorNumber, p2 api.SectorState) error `perm:"admin"`
-
- StorageAddLocal func(p0 context.Context, p1 string) error `perm:"admin"`
-
- StorageAttach func(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error `perm:"admin"`
-
- StorageBestAlloc func(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) `perm:"admin"`
-
- StorageDeclareSector func(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error `perm:"admin"`
-
- StorageDropSector func(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error `perm:"admin"`
-
- StorageFindSector func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) `perm:"admin"`
-
- StorageInfo func(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) `perm:"admin"`
-
- StorageList func(p0 context.Context) (map[stores.ID][]stores.Decl, error) `perm:"admin"`
-
- StorageLocal func(p0 context.Context) (map[stores.ID]string, error) `perm:"admin"`
-
- StorageLock func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) error `perm:"admin"`
-
- StorageReportHealth func(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error `perm:"admin"`
-
- StorageStat func(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) `perm:"admin"`
-
- StorageTryLock func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) (bool, error) `perm:"admin"`
-
- WorkerConnect func(p0 context.Context, p1 string) error `perm:"admin"`
-
- WorkerJobs func(p0 context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) `perm:"admin"`
-
- WorkerStats func(p0 context.Context) (map[uuid.UUID]storiface.WorkerStats, error) `perm:"admin"`
- }
-}
-
-type WalletStruct struct {
- Internal struct {
- WalletDelete func(p0 context.Context, p1 address.Address) error ``
-
- WalletExport func(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) ``
-
- WalletHas func(p0 context.Context, p1 address.Address) (bool, error) ``
-
- WalletImport func(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) ``
-
- WalletList func(p0 context.Context) ([]address.Address, error) ``
-
- WalletNew func(p0 context.Context, p1 types.KeyType) (address.Address, error) ``
-
- WalletSign func(p0 context.Context, p1 address.Address, p2 []byte, p3 api.MsgMeta) (*crypto.Signature, error) ``
- }
-}
-
-type WorkerStruct struct {
- Internal struct {
- AddPiece func(p0 context.Context, p1 storage.SectorRef, p2 []abi.UnpaddedPieceSize, p3 abi.UnpaddedPieceSize, p4 storage.Data) (storiface.CallID, error) `perm:"admin"`
-
- Enabled func(p0 context.Context) (bool, error) `perm:"admin"`
-
- Fetch func(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) `perm:"admin"`
-
- FinalizeSector func(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) `perm:"admin"`
-
- Info func(p0 context.Context) (storiface.WorkerInfo, error) `perm:"admin"`
-
- MoveStorage func(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType) (storiface.CallID, error) `perm:"admin"`
-
- Paths func(p0 context.Context) ([]stores.StoragePath, error) `perm:"admin"`
-
- ProcessSession func(p0 context.Context) (uuid.UUID, error) `perm:"admin"`
-
- ReadPiece func(p0 context.Context, p1 io.Writer, p2 storage.SectorRef, p3 storiface.UnpaddedByteIndex, p4 abi.UnpaddedPieceSize) (storiface.CallID, error) `perm:"admin"`
-
- ReleaseUnsealed func(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) `perm:"admin"`
-
- Remove func(p0 context.Context, p1 abi.SectorID) error `perm:"admin"`
-
- SealCommit1 func(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 abi.InteractiveSealRandomness, p4 []abi.PieceInfo, p5 storage.SectorCids) (storiface.CallID, error) `perm:"admin"`
-
- SealCommit2 func(p0 context.Context, p1 storage.SectorRef, p2 storage.Commit1Out) (storiface.CallID, error) `perm:"admin"`
-
- SealPreCommit1 func(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 []abi.PieceInfo) (storiface.CallID, error) `perm:"admin"`
-
- SealPreCommit2 func(p0 context.Context, p1 storage.SectorRef, p2 storage.PreCommit1Out) (storiface.CallID, error) `perm:"admin"`
-
- Session func(p0 context.Context) (uuid.UUID, error) `perm:"admin"`
-
- SetEnabled func(p0 context.Context, p1 bool) error `perm:"admin"`
-
- StorageAddLocal func(p0 context.Context, p1 string) error `perm:"admin"`
-
- TaskDisable func(p0 context.Context, p1 sealtasks.TaskType) error `perm:"admin"`
-
- TaskEnable func(p0 context.Context, p1 sealtasks.TaskType) error `perm:"admin"`
-
- TaskTypes func(p0 context.Context) (map[sealtasks.TaskType]struct{}, error) `perm:"admin"`
-
- UnsealPiece func(p0 context.Context, p1 storage.SectorRef, p2 storiface.UnpaddedByteIndex, p3 abi.UnpaddedPieceSize, p4 abi.SealRandomness, p5 cid.Cid) (storiface.CallID, error) `perm:"admin"`
-
- Version func(p0 context.Context) (api.Version, error) `perm:"admin"`
-
- WaitQuiet func(p0 context.Context) error `perm:"admin"`
- }
-}
-
-func (s *ChainIOStruct) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
- return s.Internal.ChainHasObj(p0, p1)
-}
-
-func (s *ChainIOStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
- return s.Internal.ChainReadObj(p0, p1)
-}
-
-func (s *CommonStruct) AuthNew(p0 context.Context, p1 []auth.Permission) ([]byte, error) {
- return s.Internal.AuthNew(p0, p1)
-}
-
-func (s *CommonStruct) AuthVerify(p0 context.Context, p1 string) ([]auth.Permission, error) {
- return s.Internal.AuthVerify(p0, p1)
-}
-
-func (s *CommonStruct) Closing(p0 context.Context) (<-chan struct{}, error) {
- return s.Internal.Closing(p0)
-}
-
-func (s *CommonStruct) Discover(p0 context.Context) (apitypes.OpenRPCDocument, error) {
- return s.Internal.Discover(p0)
-}
-
-func (s *CommonStruct) ID(p0 context.Context) (peer.ID, error) {
- return s.Internal.ID(p0)
-}
-
-func (s *CommonStruct) LogList(p0 context.Context) ([]string, error) {
- return s.Internal.LogList(p0)
-}
-
-func (s *CommonStruct) LogSetLevel(p0 context.Context, p1 string, p2 string) error {
- return s.Internal.LogSetLevel(p0, p1, p2)
-}
-
-func (s *CommonStruct) NetAddrsListen(p0 context.Context) (peer.AddrInfo, error) {
- return s.Internal.NetAddrsListen(p0)
-}
-
-func (s *CommonStruct) NetAgentVersion(p0 context.Context, p1 peer.ID) (string, error) {
- return s.Internal.NetAgentVersion(p0, p1)
-}
-
-func (s *CommonStruct) NetAutoNatStatus(p0 context.Context) (api.NatInfo, error) {
- return s.Internal.NetAutoNatStatus(p0)
-}
-
-func (s *CommonStruct) NetBandwidthStats(p0 context.Context) (metrics.Stats, error) {
- return s.Internal.NetBandwidthStats(p0)
-}
-
-func (s *CommonStruct) NetBandwidthStatsByPeer(p0 context.Context) (map[string]metrics.Stats, error) {
- return s.Internal.NetBandwidthStatsByPeer(p0)
-}
-
-func (s *CommonStruct) NetBandwidthStatsByProtocol(p0 context.Context) (map[protocol.ID]metrics.Stats, error) {
- return s.Internal.NetBandwidthStatsByProtocol(p0)
-}
-
-func (s *CommonStruct) NetBlockAdd(p0 context.Context, p1 api.NetBlockList) error {
- return s.Internal.NetBlockAdd(p0, p1)
-}
-
-func (s *CommonStruct) NetBlockList(p0 context.Context) (api.NetBlockList, error) {
- return s.Internal.NetBlockList(p0)
-}
-
-func (s *CommonStruct) NetBlockRemove(p0 context.Context, p1 api.NetBlockList) error {
- return s.Internal.NetBlockRemove(p0, p1)
-}
-
-func (s *CommonStruct) NetConnect(p0 context.Context, p1 peer.AddrInfo) error {
- return s.Internal.NetConnect(p0, p1)
-}
-
-func (s *CommonStruct) NetConnectedness(p0 context.Context, p1 peer.ID) (network.Connectedness, error) {
- return s.Internal.NetConnectedness(p0, p1)
-}
-
-func (s *CommonStruct) NetDisconnect(p0 context.Context, p1 peer.ID) error {
- return s.Internal.NetDisconnect(p0, p1)
-}
-
-func (s *CommonStruct) NetFindPeer(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) {
- return s.Internal.NetFindPeer(p0, p1)
-}
-
-func (s *CommonStruct) NetPeerInfo(p0 context.Context, p1 peer.ID) (*api.ExtendedPeerInfo, error) {
- return s.Internal.NetPeerInfo(p0, p1)
-}
-
-func (s *CommonStruct) NetPeers(p0 context.Context) ([]peer.AddrInfo, error) {
- return s.Internal.NetPeers(p0)
-}
-
-func (s *CommonStruct) NetPubsubScores(p0 context.Context) ([]api.PubsubScore, error) {
- return s.Internal.NetPubsubScores(p0)
-}
-
-func (s *CommonStruct) Session(p0 context.Context) (uuid.UUID, error) {
- return s.Internal.Session(p0)
-}
-
-func (s *CommonStruct) Shutdown(p0 context.Context) error {
- return s.Internal.Shutdown(p0)
-}
-
-func (s *CommonStruct) Version(p0 context.Context) (api.APIVersion, error) {
- return s.Internal.Version(p0)
+type GatewayStub struct {
}
func (s *FullNodeStruct) BeaconGetEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) {
return s.Internal.BeaconGetEntry(p0, p1)
}
+func (s *FullNodeStub) BeaconGetEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainDeleteObj(p0 context.Context, p1 cid.Cid) error {
return s.Internal.ChainDeleteObj(p0, p1)
}
+func (s *FullNodeStub) ChainDeleteObj(p0 context.Context, p1 cid.Cid) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainExport(p0 context.Context, p1 abi.ChainEpoch, p2 bool, p3 types.TipSetKey) (<-chan []byte, error) {
return s.Internal.ChainExport(p0, p1, p2, p3)
}
+func (s *FullNodeStub) ChainExport(p0 context.Context, p1 abi.ChainEpoch, p2 bool, p3 types.TipSetKey) (<-chan []byte, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) {
return s.Internal.ChainGetBlock(p0, p1)
}
+func (s *FullNodeStub) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) {
return s.Internal.ChainGetBlockMessages(p0, p1)
}
+func (s *FullNodeStub) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetGenesis(p0 context.Context) (*types.TipSet, error) {
return s.Internal.ChainGetGenesis(p0)
}
+func (s *FullNodeStub) ChainGetGenesis(p0 context.Context) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) {
return s.Internal.ChainGetMessage(p0, p1)
}
+func (s *FullNodeStub) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetNode(p0 context.Context, p1 string) (*api.IpldObject, error) {
return s.Internal.ChainGetNode(p0, p1)
}
+func (s *FullNodeStub) ChainGetNode(p0 context.Context, p1 string) (*api.IpldObject, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetParentMessages(p0 context.Context, p1 cid.Cid) ([]api.Message, error) {
return s.Internal.ChainGetParentMessages(p0, p1)
}
+func (s *FullNodeStub) ChainGetParentMessages(p0 context.Context, p1 cid.Cid) ([]api.Message, error) {
+ return *new([]api.Message), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetParentReceipts(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) {
return s.Internal.ChainGetParentReceipts(p0, p1)
}
+func (s *FullNodeStub) ChainGetParentReceipts(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) {
+ return *new([]*types.MessageReceipt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetPath(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*api.HeadChange, error) {
return s.Internal.ChainGetPath(p0, p1, p2)
}
+func (s *FullNodeStub) ChainGetPath(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*api.HeadChange, error) {
+ return *new([]*api.HeadChange), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetRandomnessFromBeacon(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) {
return s.Internal.ChainGetRandomnessFromBeacon(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) ChainGetRandomnessFromBeacon(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) {
+ return *new(abi.Randomness), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetRandomnessFromTickets(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) {
return s.Internal.ChainGetRandomnessFromTickets(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) ChainGetRandomnessFromTickets(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) {
+ return *new(abi.Randomness), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) {
return s.Internal.ChainGetTipSet(p0, p1)
}
+func (s *FullNodeStub) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) {
return s.Internal.ChainGetTipSetByHeight(p0, p1, p2)
}
+func (s *FullNodeStub) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
return s.Internal.ChainHasObj(p0, p1)
}
+func (s *FullNodeStub) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainHead(p0 context.Context) (*types.TipSet, error) {
return s.Internal.ChainHead(p0)
}
+func (s *FullNodeStub) ChainHead(p0 context.Context) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainNotify(p0 context.Context) (<-chan []*api.HeadChange, error) {
return s.Internal.ChainNotify(p0)
}
+func (s *FullNodeStub) ChainNotify(p0 context.Context) (<-chan []*api.HeadChange, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
return s.Internal.ChainReadObj(p0, p1)
}
+func (s *FullNodeStub) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
+ return *new([]byte), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainSetHead(p0 context.Context, p1 types.TipSetKey) error {
return s.Internal.ChainSetHead(p0, p1)
}
+func (s *FullNodeStub) ChainSetHead(p0 context.Context, p1 types.TipSetKey) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainStatObj(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (api.ObjStat, error) {
return s.Internal.ChainStatObj(p0, p1, p2)
}
+func (s *FullNodeStub) ChainStatObj(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (api.ObjStat, error) {
+ return *new(api.ObjStat), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) {
return s.Internal.ChainTipSetWeight(p0, p1)
}
+func (s *FullNodeStub) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*api.CommPRet, error) {
return s.Internal.ClientCalcCommP(p0, p1)
}
+func (s *FullNodeStub) ClientCalcCommP(p0 context.Context, p1 string) (*api.CommPRet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
return s.Internal.ClientCancelDataTransfer(p0, p1, p2, p3)
}
+func (s *FullNodeStub) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error {
return s.Internal.ClientCancelRetrievalDeal(p0, p1)
}
+func (s *FullNodeStub) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) {
return s.Internal.ClientDataTransferUpdates(p0)
}
+func (s *FullNodeStub) ClientDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) {
return s.Internal.ClientDealPieceCID(p0, p1)
}
+func (s *FullNodeStub) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) {
+ return *new(api.DataCIDSize), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (api.DataSize, error) {
return s.Internal.ClientDealSize(p0, p1)
}
+func (s *FullNodeStub) ClientDealSize(p0 context.Context, p1 cid.Cid) (api.DataSize, error) {
+ return *new(api.DataSize), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) {
return s.Internal.ClientFindData(p0, p1, p2)
}
+func (s *FullNodeStub) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) {
+ return *new([]api.QueryOffer), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 api.FileRef, p2 string) error {
return s.Internal.ClientGenCar(p0, p1, p2)
}
+func (s *FullNodeStub) ClientGenCar(p0 context.Context, p1 api.FileRef, p2 string) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) {
return s.Internal.ClientGetDealInfo(p0, p1)
}
+func (s *FullNodeStub) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) {
return s.Internal.ClientGetDealStatus(p0, p1)
}
+func (s *FullNodeStub) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) {
+ return "", xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientGetDealUpdates(p0 context.Context) (<-chan api.DealInfo, error) {
return s.Internal.ClientGetDealUpdates(p0)
}
+func (s *FullNodeStub) ClientGetDealUpdates(p0 context.Context) (<-chan api.DealInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientGetRetrievalUpdates(p0 context.Context) (<-chan api.RetrievalInfo, error) {
+ return s.Internal.ClientGetRetrievalUpdates(p0)
+}
+
+func (s *FullNodeStub) ClientGetRetrievalUpdates(p0 context.Context) (<-chan api.RetrievalInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) {
return s.Internal.ClientHasLocal(p0, p1)
}
+func (s *FullNodeStub) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientImport(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) {
return s.Internal.ClientImport(p0, p1)
}
+func (s *FullNodeStub) ClientImport(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) {
return s.Internal.ClientListDataTransfers(p0)
}
+func (s *FullNodeStub) ClientListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) {
+ return *new([]api.DataTransferChannel), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]api.DealInfo, error) {
return s.Internal.ClientListDeals(p0)
}
+func (s *FullNodeStub) ClientListDeals(p0 context.Context) ([]api.DealInfo, error) {
+ return *new([]api.DealInfo), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]api.Import, error) {
return s.Internal.ClientListImports(p0)
}
+func (s *FullNodeStub) ClientListImports(p0 context.Context) ([]api.Import, error) {
+ return *new([]api.Import), xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientListRetrievals(p0 context.Context) ([]api.RetrievalInfo, error) {
+ return s.Internal.ClientListRetrievals(p0)
+}
+
+func (s *FullNodeStub) ClientListRetrievals(p0 context.Context) ([]api.RetrievalInfo, error) {
+ return *new([]api.RetrievalInfo), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) {
return s.Internal.ClientMinerQueryOffer(p0, p1, p2, p3)
}
+func (s *FullNodeStub) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) {
+ return *new(api.QueryOffer), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) {
return s.Internal.ClientQueryAsk(p0, p1, p2)
}
+func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 multistore.StoreID) error {
return s.Internal.ClientRemoveImport(p0, p1)
}
+func (s *FullNodeStub) ClientRemoveImport(p0 context.Context, p1 multistore.StoreID) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
return s.Internal.ClientRestartDataTransfer(p0, p1, p2, p3)
}
+func (s *FullNodeStub) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) error {
return s.Internal.ClientRetrieve(p0, p1, p2)
}
+func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error {
return s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1)
}
+func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
return s.Internal.ClientRetrieveWithEvents(p0, p1, p2)
}
+func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) {
return s.Internal.ClientStartDeal(p0, p1)
}
+func (s *FullNodeStub) ClientStartDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) {
+ return s.Internal.ClientStatelessDeal(p0, p1)
+}
+
+func (s *FullNodeStub) ClientStatelessDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) CreateBackup(p0 context.Context, p1 string) error {
return s.Internal.CreateBackup(p0, p1)
}
+func (s *FullNodeStub) CreateBackup(p0 context.Context, p1 string) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) GasEstimateFeeCap(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) {
return s.Internal.GasEstimateFeeCap(p0, p1, p2, p3)
}
+func (s *FullNodeStub) GasEstimateFeeCap(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) GasEstimateGasLimit(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (int64, error) {
return s.Internal.GasEstimateGasLimit(p0, p1, p2)
}
+func (s *FullNodeStub) GasEstimateGasLimit(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (int64, error) {
+ return 0, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) GasEstimateGasPremium(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) {
return s.Internal.GasEstimateGasPremium(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) GasEstimateGasPremium(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
return s.Internal.GasEstimateMessageGas(p0, p1, p2, p3)
}
+func (s *FullNodeStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MarketAddBalance(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
return s.Internal.MarketAddBalance(p0, p1, p2, p3)
}
+func (s *FullNodeStub) MarketAddBalance(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MarketGetReserved(p0 context.Context, p1 address.Address) (types.BigInt, error) {
return s.Internal.MarketGetReserved(p0, p1)
}
+func (s *FullNodeStub) MarketGetReserved(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MarketReleaseFunds(p0 context.Context, p1 address.Address, p2 types.BigInt) error {
return s.Internal.MarketReleaseFunds(p0, p1, p2)
}
+func (s *FullNodeStub) MarketReleaseFunds(p0 context.Context, p1 address.Address, p2 types.BigInt) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MarketReserveFunds(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
return s.Internal.MarketReserveFunds(p0, p1, p2, p3)
}
+func (s *FullNodeStub) MarketReserveFunds(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MarketWithdraw(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
return s.Internal.MarketWithdraw(p0, p1, p2, p3)
}
+func (s *FullNodeStub) MarketWithdraw(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MinerCreateBlock(p0 context.Context, p1 *api.BlockTemplate) (*types.BlockMsg, error) {
return s.Internal.MinerCreateBlock(p0, p1)
}
+func (s *FullNodeStub) MinerCreateBlock(p0 context.Context, p1 *api.BlockTemplate) (*types.BlockMsg, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*api.MiningBaseInfo, error) {
return s.Internal.MinerGetBaseInfo(p0, p1, p2, p3)
}
+func (s *FullNodeStub) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*api.MiningBaseInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolBatchPush(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) {
return s.Internal.MpoolBatchPush(p0, p1)
}
+func (s *FullNodeStub) MpoolBatchPush(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) {
+ return *new([]cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolBatchPushMessage(p0 context.Context, p1 []*types.Message, p2 *api.MessageSendSpec) ([]*types.SignedMessage, error) {
return s.Internal.MpoolBatchPushMessage(p0, p1, p2)
}
+func (s *FullNodeStub) MpoolBatchPushMessage(p0 context.Context, p1 []*types.Message, p2 *api.MessageSendSpec) ([]*types.SignedMessage, error) {
+ return *new([]*types.SignedMessage), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolBatchPushUntrusted(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) {
return s.Internal.MpoolBatchPushUntrusted(p0, p1)
}
+func (s *FullNodeStub) MpoolBatchPushUntrusted(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) {
+ return *new([]cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolClear(p0 context.Context, p1 bool) error {
return s.Internal.MpoolClear(p0, p1)
}
+func (s *FullNodeStub) MpoolClear(p0 context.Context, p1 bool) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolGetConfig(p0 context.Context) (*types.MpoolConfig, error) {
return s.Internal.MpoolGetConfig(p0)
}
+func (s *FullNodeStub) MpoolGetConfig(p0 context.Context) (*types.MpoolConfig, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) {
return s.Internal.MpoolGetNonce(p0, p1)
}
+func (s *FullNodeStub) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) {
+ return 0, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolPending(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) {
return s.Internal.MpoolPending(p0, p1)
}
+func (s *FullNodeStub) MpoolPending(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) {
+ return *new([]*types.SignedMessage), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
return s.Internal.MpoolPush(p0, p1)
}
+func (s *FullNodeStub) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolPushMessage(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec) (*types.SignedMessage, error) {
return s.Internal.MpoolPushMessage(p0, p1, p2)
}
+func (s *FullNodeStub) MpoolPushMessage(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec) (*types.SignedMessage, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolPushUntrusted(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
return s.Internal.MpoolPushUntrusted(p0, p1)
}
+func (s *FullNodeStub) MpoolPushUntrusted(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolSelect(p0 context.Context, p1 types.TipSetKey, p2 float64) ([]*types.SignedMessage, error) {
return s.Internal.MpoolSelect(p0, p1, p2)
}
+func (s *FullNodeStub) MpoolSelect(p0 context.Context, p1 types.TipSetKey, p2 float64) ([]*types.SignedMessage, error) {
+ return *new([]*types.SignedMessage), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolSetConfig(p0 context.Context, p1 *types.MpoolConfig) error {
return s.Internal.MpoolSetConfig(p0, p1)
}
+func (s *FullNodeStub) MpoolSetConfig(p0 context.Context, p1 *types.MpoolConfig) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MpoolSub(p0 context.Context) (<-chan api.MpoolUpdate, error) {
return s.Internal.MpoolSub(p0)
}
+func (s *FullNodeStub) MpoolSub(p0 context.Context) (<-chan api.MpoolUpdate, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigAddApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 bool) (cid.Cid, error) {
return s.Internal.MsigAddApprove(p0, p1, p2, p3, p4, p5, p6)
}
+func (s *FullNodeStub) MsigAddApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 bool) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigAddCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 bool) (cid.Cid, error) {
return s.Internal.MsigAddCancel(p0, p1, p2, p3, p4, p5)
}
+func (s *FullNodeStub) MsigAddCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 bool) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigAddPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (cid.Cid, error) {
return s.Internal.MsigAddPropose(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) MsigAddPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigApprove(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (cid.Cid, error) {
return s.Internal.MsigApprove(p0, p1, p2, p3)
}
+func (s *FullNodeStub) MsigApprove(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigApproveTxnHash(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 address.Address, p5 types.BigInt, p6 address.Address, p7 uint64, p8 []byte) (cid.Cid, error) {
return s.Internal.MsigApproveTxnHash(p0, p1, p2, p3, p4, p5, p6, p7, p8)
}
+func (s *FullNodeStub) MsigApproveTxnHash(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 address.Address, p5 types.BigInt, p6 address.Address, p7 uint64, p8 []byte) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigCancel(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (cid.Cid, error) {
return s.Internal.MsigCancel(p0, p1, p2, p3, p4, p5, p6, p7)
}
+func (s *FullNodeStub) MsigCancel(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigCreate(p0 context.Context, p1 uint64, p2 []address.Address, p3 abi.ChainEpoch, p4 types.BigInt, p5 address.Address, p6 types.BigInt) (cid.Cid, error) {
return s.Internal.MsigCreate(p0, p1, p2, p3, p4, p5, p6)
}
+func (s *FullNodeStub) MsigCreate(p0 context.Context, p1 uint64, p2 []address.Address, p3 abi.ChainEpoch, p4 types.BigInt, p5 address.Address, p6 types.BigInt) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
return s.Internal.MsigGetAvailableBalance(p0, p1, p2)
}
+func (s *FullNodeStub) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*api.MsigTransaction, error) {
return s.Internal.MsigGetPending(p0, p1, p2)
}
+func (s *FullNodeStub) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*api.MsigTransaction, error) {
+ return *new([]*api.MsigTransaction), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) {
return s.Internal.MsigGetVested(p0, p1, p2, p3)
}
+func (s *FullNodeStub) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigGetVestingSchedule(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MsigVesting, error) {
return s.Internal.MsigGetVestingSchedule(p0, p1, p2)
}
+func (s *FullNodeStub) MsigGetVestingSchedule(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MsigVesting, error) {
+ return *new(api.MsigVesting), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 address.Address, p5 uint64, p6 []byte) (cid.Cid, error) {
return s.Internal.MsigPropose(p0, p1, p2, p3, p4, p5, p6)
}
+func (s *FullNodeStub) MsigPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 address.Address, p5 uint64, p6 []byte) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigRemoveSigner(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (cid.Cid, error) {
return s.Internal.MsigRemoveSigner(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) MsigRemoveSigner(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigSwapApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 address.Address) (cid.Cid, error) {
return s.Internal.MsigSwapApprove(p0, p1, p2, p3, p4, p5, p6)
}
+func (s *FullNodeStub) MsigSwapApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 address.Address) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigSwapCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address) (cid.Cid, error) {
return s.Internal.MsigSwapCancel(p0, p1, p2, p3, p4, p5)
}
+func (s *FullNodeStub) MsigSwapCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) MsigSwapPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 address.Address) (cid.Cid, error) {
return s.Internal.MsigSwapPropose(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) MsigSwapPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 address.Address) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychAllocateLane(p0 context.Context, p1 address.Address) (uint64, error) {
return s.Internal.PaychAllocateLane(p0, p1)
}
+func (s *FullNodeStub) PaychAllocateLane(p0 context.Context, p1 address.Address) (uint64, error) {
+ return 0, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychAvailableFunds(p0 context.Context, p1 address.Address) (*api.ChannelAvailableFunds, error) {
return s.Internal.PaychAvailableFunds(p0, p1)
}
+func (s *FullNodeStub) PaychAvailableFunds(p0 context.Context, p1 address.Address) (*api.ChannelAvailableFunds, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychAvailableFundsByFromTo(p0 context.Context, p1 address.Address, p2 address.Address) (*api.ChannelAvailableFunds, error) {
return s.Internal.PaychAvailableFundsByFromTo(p0, p1, p2)
}
+func (s *FullNodeStub) PaychAvailableFundsByFromTo(p0 context.Context, p1 address.Address, p2 address.Address) (*api.ChannelAvailableFunds, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychCollect(p0 context.Context, p1 address.Address) (cid.Cid, error) {
return s.Internal.PaychCollect(p0, p1)
}
+func (s *FullNodeStub) PaychCollect(p0 context.Context, p1 address.Address) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychGet(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*api.ChannelInfo, error) {
return s.Internal.PaychGet(p0, p1, p2, p3)
}
+func (s *FullNodeStub) PaychGet(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*api.ChannelInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychGetWaitReady(p0 context.Context, p1 cid.Cid) (address.Address, error) {
return s.Internal.PaychGetWaitReady(p0, p1)
}
+func (s *FullNodeStub) PaychGetWaitReady(p0 context.Context, p1 cid.Cid) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychList(p0 context.Context) ([]address.Address, error) {
return s.Internal.PaychList(p0)
}
+func (s *FullNodeStub) PaychList(p0 context.Context) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychNewPayment(p0 context.Context, p1 address.Address, p2 address.Address, p3 []api.VoucherSpec) (*api.PaymentInfo, error) {
return s.Internal.PaychNewPayment(p0, p1, p2, p3)
}
+func (s *FullNodeStub) PaychNewPayment(p0 context.Context, p1 address.Address, p2 address.Address, p3 []api.VoucherSpec) (*api.PaymentInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychSettle(p0 context.Context, p1 address.Address) (cid.Cid, error) {
return s.Internal.PaychSettle(p0, p1)
}
+func (s *FullNodeStub) PaychSettle(p0 context.Context, p1 address.Address) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychStatus(p0 context.Context, p1 address.Address) (*api.PaychStatus, error) {
return s.Internal.PaychStatus(p0, p1)
}
+func (s *FullNodeStub) PaychStatus(p0 context.Context, p1 address.Address) (*api.PaychStatus, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychVoucherAdd(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 types.BigInt) (types.BigInt, error) {
return s.Internal.PaychVoucherAdd(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) PaychVoucherAdd(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 types.BigInt) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychVoucherCheckSpendable(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (bool, error) {
return s.Internal.PaychVoucherCheckSpendable(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) PaychVoucherCheckSpendable(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychVoucherCheckValid(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher) error {
return s.Internal.PaychVoucherCheckValid(p0, p1, p2)
}
+func (s *FullNodeStub) PaychVoucherCheckValid(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychVoucherCreate(p0 context.Context, p1 address.Address, p2 types.BigInt, p3 uint64) (*api.VoucherCreateResult, error) {
return s.Internal.PaychVoucherCreate(p0, p1, p2, p3)
}
+func (s *FullNodeStub) PaychVoucherCreate(p0 context.Context, p1 address.Address, p2 types.BigInt, p3 uint64) (*api.VoucherCreateResult, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychVoucherList(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) {
return s.Internal.PaychVoucherList(p0, p1)
}
+func (s *FullNodeStub) PaychVoucherList(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) {
+ return *new([]*paych.SignedVoucher), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) PaychVoucherSubmit(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (cid.Cid, error) {
return s.Internal.PaychVoucherSubmit(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) PaychVoucherSubmit(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
return s.Internal.StateAccountKey(p0, p1, p2)
}
+func (s *FullNodeStub) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateAllMinerFaults(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*api.Fault, error) {
return s.Internal.StateAllMinerFaults(p0, p1, p2)
}
+func (s *FullNodeStub) StateAllMinerFaults(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*api.Fault, error) {
+ return *new([]*api.Fault), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*api.InvocResult, error) {
return s.Internal.StateCall(p0, p1, p2)
}
+func (s *FullNodeStub) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*api.InvocResult, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateChangedActors(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (map[string]types.Actor, error) {
return s.Internal.StateChangedActors(p0, p1, p2)
}
+func (s *FullNodeStub) StateChangedActors(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (map[string]types.Actor, error) {
+ return *new(map[string]types.Actor), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateCirculatingSupply(p0 context.Context, p1 types.TipSetKey) (abi.TokenAmount, error) {
return s.Internal.StateCirculatingSupply(p0, p1)
}
+func (s *FullNodeStub) StateCirculatingSupply(p0 context.Context, p1 types.TipSetKey) (abi.TokenAmount, error) {
+ return *new(abi.TokenAmount), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateCompute(p0 context.Context, p1 abi.ChainEpoch, p2 []*types.Message, p3 types.TipSetKey) (*api.ComputeStateOutput, error) {
return s.Internal.StateCompute(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateCompute(p0 context.Context, p1 abi.ChainEpoch, p2 []*types.Message, p3 types.TipSetKey) (*api.ComputeStateOutput, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) {
return s.Internal.StateDealProviderCollateralBounds(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) {
+ return *new(api.DealCollateralBounds), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateDecodeParams(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) {
return s.Internal.StateDecodeParams(p0, p1, p2, p3, p4)
}
+func (s *FullNodeStub) StateDecodeParams(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) {
return s.Internal.StateGetActor(p0, p1, p2)
}
+func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateGetReceipt(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) {
return s.Internal.StateGetReceipt(p0, p1, p2)
}
+func (s *FullNodeStub) StateGetReceipt(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateListActors(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
return s.Internal.StateListActors(p0, p1)
}
+func (s *FullNodeStub) StateListActors(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateListMessages(p0 context.Context, p1 *api.MessageMatch, p2 types.TipSetKey, p3 abi.ChainEpoch) ([]cid.Cid, error) {
return s.Internal.StateListMessages(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateListMessages(p0 context.Context, p1 *api.MessageMatch, p2 types.TipSetKey, p3 abi.ChainEpoch) ([]cid.Cid, error) {
+ return *new([]cid.Cid), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
return s.Internal.StateListMiners(p0, p1)
}
+func (s *FullNodeStub) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
return s.Internal.StateLookupID(p0, p1, p2)
}
+func (s *FullNodeStub) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MarketBalance, error) {
return s.Internal.StateMarketBalance(p0, p1, p2)
}
+func (s *FullNodeStub) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MarketBalance, error) {
+ return *new(api.MarketBalance), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketDeal, error) {
return s.Internal.StateMarketDeals(p0, p1)
}
+func (s *FullNodeStub) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketDeal, error) {
+ return *new(map[string]api.MarketDeal), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMarketParticipants(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketBalance, error) {
return s.Internal.StateMarketParticipants(p0, p1)
}
+func (s *FullNodeStub) StateMarketParticipants(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketBalance, error) {
+ return *new(map[string]api.MarketBalance), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*api.MarketDeal, error) {
return s.Internal.StateMarketStorageDeal(p0, p1, p2)
}
+func (s *FullNodeStub) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*api.MarketDeal, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerActiveSectors(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
return s.Internal.StateMinerActiveSectors(p0, p1, p2)
}
+func (s *FullNodeStub) StateMinerActiveSectors(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
+ return *new([]*miner.SectorOnChainInfo), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
return s.Internal.StateMinerAvailableBalance(p0, p1, p2)
}
+func (s *FullNodeStub) StateMinerAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerDeadlines(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]api.Deadline, error) {
return s.Internal.StateMinerDeadlines(p0, p1, p2)
}
+func (s *FullNodeStub) StateMinerDeadlines(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]api.Deadline, error) {
+ return *new([]api.Deadline), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerFaults(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) {
return s.Internal.StateMinerFaults(p0, p1, p2)
}
+func (s *FullNodeStub) StateMinerFaults(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) {
+ return *new(bitfield.BitField), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
return s.Internal.StateMinerInfo(p0, p1, p2)
}
+func (s *FullNodeStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
+ return *new(miner.MinerInfo), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerInitialPledgeCollateral(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
return s.Internal.StateMinerInitialPledgeCollateral(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateMinerInitialPledgeCollateral(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerPartitions(p0 context.Context, p1 address.Address, p2 uint64, p3 types.TipSetKey) ([]api.Partition, error) {
return s.Internal.StateMinerPartitions(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateMinerPartitions(p0 context.Context, p1 address.Address, p2 uint64, p3 types.TipSetKey) ([]api.Partition, error) {
+ return *new([]api.Partition), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) {
return s.Internal.StateMinerPower(p0, p1, p2)
}
+func (s *FullNodeStub) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerPreCommitDepositForPower(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
return s.Internal.StateMinerPreCommitDepositForPower(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateMinerPreCommitDepositForPower(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) {
return s.Internal.StateMinerProvingDeadline(p0, p1, p2)
}
+func (s *FullNodeStub) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerRecoveries(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) {
return s.Internal.StateMinerRecoveries(p0, p1, p2)
}
+func (s *FullNodeStub) StateMinerRecoveries(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) {
+ return *new(bitfield.BitField), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerSectorAllocated(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (bool, error) {
return s.Internal.StateMinerSectorAllocated(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateMinerSectorAllocated(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerSectorCount(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerSectors, error) {
return s.Internal.StateMinerSectorCount(p0, p1, p2)
}
+func (s *FullNodeStub) StateMinerSectorCount(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerSectors, error) {
+ return *new(api.MinerSectors), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateMinerSectors(p0 context.Context, p1 address.Address, p2 *bitfield.BitField, p3 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
return s.Internal.StateMinerSectors(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateMinerSectors(p0 context.Context, p1 address.Address, p2 *bitfield.BitField, p3 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
+ return *new([]*miner.SectorOnChainInfo), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) {
return s.Internal.StateNetworkName(p0)
}
+func (s *FullNodeStub) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) {
+ return *new(dtypes.NetworkName), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) {
return s.Internal.StateNetworkVersion(p0, p1)
}
+func (s *FullNodeStub) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) {
+ return *new(apitypes.NetworkVersion), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateReadState(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.ActorState, error) {
return s.Internal.StateReadState(p0, p1, p2)
}
+func (s *FullNodeStub) StateReadState(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.ActorState, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateReplay(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*api.InvocResult, error) {
return s.Internal.StateReplay(p0, p1, p2)
}
+func (s *FullNodeStub) StateReplay(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*api.InvocResult, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateSearchMsg(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) {
return s.Internal.StateSearchMsg(p0, p1)
}
+func (s *FullNodeStub) StateSearchMsg(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateSearchMsgLimited(p0 context.Context, p1 cid.Cid, p2 abi.ChainEpoch) (*api.MsgLookup, error) {
return s.Internal.StateSearchMsgLimited(p0, p1, p2)
}
+func (s *FullNodeStub) StateSearchMsgLimited(p0 context.Context, p1 cid.Cid, p2 abi.ChainEpoch) (*api.MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) {
return s.Internal.StateSectorExpiration(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
return s.Internal.StateSectorGetInfo(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) {
return s.Internal.StateSectorPartition(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateSectorPreCommitInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) {
return s.Internal.StateSectorPreCommitInfo(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateSectorPreCommitInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) {
+ return *new(miner.SectorPreCommitOnChainInfo), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateVMCirculatingSupplyInternal(p0 context.Context, p1 types.TipSetKey) (api.CirculatingSupply, error) {
return s.Internal.StateVMCirculatingSupplyInternal(p0, p1)
}
+func (s *FullNodeStub) StateVMCirculatingSupplyInternal(p0 context.Context, p1 types.TipSetKey) (api.CirculatingSupply, error) {
+ return *new(api.CirculatingSupply), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
return s.Internal.StateVerifiedClientStatus(p0, p1, p2)
}
+func (s *FullNodeStub) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateVerifiedRegistryRootKey(p0 context.Context, p1 types.TipSetKey) (address.Address, error) {
return s.Internal.StateVerifiedRegistryRootKey(p0, p1)
}
+func (s *FullNodeStub) StateVerifiedRegistryRootKey(p0 context.Context, p1 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateVerifierStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
return s.Internal.StateVerifierStatus(p0, p1, p2)
}
+func (s *FullNodeStub) StateVerifierStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64) (*api.MsgLookup, error) {
return s.Internal.StateWaitMsg(p0, p1, p2)
}
+func (s *FullNodeStub) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64) (*api.MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) StateWaitMsgLimited(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch) (*api.MsgLookup, error) {
return s.Internal.StateWaitMsgLimited(p0, p1, p2, p3)
}
+func (s *FullNodeStub) StateWaitMsgLimited(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch) (*api.MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) SyncCheckBad(p0 context.Context, p1 cid.Cid) (string, error) {
return s.Internal.SyncCheckBad(p0, p1)
}
+func (s *FullNodeStub) SyncCheckBad(p0 context.Context, p1 cid.Cid) (string, error) {
+ return "", xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) SyncCheckpoint(p0 context.Context, p1 types.TipSetKey) error {
return s.Internal.SyncCheckpoint(p0, p1)
}
+func (s *FullNodeStub) SyncCheckpoint(p0 context.Context, p1 types.TipSetKey) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) SyncIncomingBlocks(p0 context.Context) (<-chan *types.BlockHeader, error) {
return s.Internal.SyncIncomingBlocks(p0)
}
+func (s *FullNodeStub) SyncIncomingBlocks(p0 context.Context) (<-chan *types.BlockHeader, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) SyncMarkBad(p0 context.Context, p1 cid.Cid) error {
return s.Internal.SyncMarkBad(p0, p1)
}
+func (s *FullNodeStub) SyncMarkBad(p0 context.Context, p1 cid.Cid) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) SyncState(p0 context.Context) (*api.SyncState, error) {
return s.Internal.SyncState(p0)
}
+func (s *FullNodeStub) SyncState(p0 context.Context) (*api.SyncState, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) SyncSubmitBlock(p0 context.Context, p1 *types.BlockMsg) error {
return s.Internal.SyncSubmitBlock(p0, p1)
}
+func (s *FullNodeStub) SyncSubmitBlock(p0 context.Context, p1 *types.BlockMsg) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) SyncUnmarkAllBad(p0 context.Context) error {
return s.Internal.SyncUnmarkAllBad(p0)
}
+func (s *FullNodeStub) SyncUnmarkAllBad(p0 context.Context) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) SyncUnmarkBad(p0 context.Context, p1 cid.Cid) error {
return s.Internal.SyncUnmarkBad(p0, p1)
}
+func (s *FullNodeStub) SyncUnmarkBad(p0 context.Context, p1 cid.Cid) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) SyncValidateTipset(p0 context.Context, p1 types.TipSetKey) (bool, error) {
return s.Internal.SyncValidateTipset(p0, p1)
}
+func (s *FullNodeStub) SyncValidateTipset(p0 context.Context, p1 types.TipSetKey) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) {
return s.Internal.WalletBalance(p0, p1)
}
+func (s *FullNodeStub) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletDefaultAddress(p0 context.Context) (address.Address, error) {
return s.Internal.WalletDefaultAddress(p0)
}
+func (s *FullNodeStub) WalletDefaultAddress(p0 context.Context) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletDelete(p0 context.Context, p1 address.Address) error {
return s.Internal.WalletDelete(p0, p1)
}
+func (s *FullNodeStub) WalletDelete(p0 context.Context, p1 address.Address) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) {
return s.Internal.WalletExport(p0, p1)
}
+func (s *FullNodeStub) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletHas(p0 context.Context, p1 address.Address) (bool, error) {
return s.Internal.WalletHas(p0, p1)
}
+func (s *FullNodeStub) WalletHas(p0 context.Context, p1 address.Address) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) {
return s.Internal.WalletImport(p0, p1)
}
+func (s *FullNodeStub) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletList(p0 context.Context) ([]address.Address, error) {
return s.Internal.WalletList(p0)
}
+func (s *FullNodeStub) WalletList(p0 context.Context) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error) {
return s.Internal.WalletNew(p0, p1)
}
+func (s *FullNodeStub) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletSetDefault(p0 context.Context, p1 address.Address) error {
return s.Internal.WalletSetDefault(p0, p1)
}
+func (s *FullNodeStub) WalletSetDefault(p0 context.Context, p1 address.Address) error {
+ return xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletSign(p0 context.Context, p1 address.Address, p2 []byte) (*crypto.Signature, error) {
return s.Internal.WalletSign(p0, p1, p2)
}
+func (s *FullNodeStub) WalletSign(p0 context.Context, p1 address.Address, p2 []byte) (*crypto.Signature, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletSignMessage(p0 context.Context, p1 address.Address, p2 *types.Message) (*types.SignedMessage, error) {
return s.Internal.WalletSignMessage(p0, p1, p2)
}
+func (s *FullNodeStub) WalletSignMessage(p0 context.Context, p1 address.Address, p2 *types.Message) (*types.SignedMessage, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletValidateAddress(p0 context.Context, p1 string) (address.Address, error) {
return s.Internal.WalletValidateAddress(p0, p1)
}
+func (s *FullNodeStub) WalletValidateAddress(p0 context.Context, p1 string) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *FullNodeStruct) WalletVerify(p0 context.Context, p1 address.Address, p2 []byte, p3 *crypto.Signature) (bool, error) {
return s.Internal.WalletVerify(p0, p1, p2, p3)
}
+func (s *FullNodeStub) WalletVerify(p0 context.Context, p1 address.Address, p2 []byte, p3 *crypto.Signature) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) {
return s.Internal.ChainGetBlockMessages(p0, p1)
}
+func (s *GatewayStub) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) {
return s.Internal.ChainGetMessage(p0, p1)
}
+func (s *GatewayStub) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) {
return s.Internal.ChainGetTipSet(p0, p1)
}
+func (s *GatewayStub) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) {
return s.Internal.ChainGetTipSetByHeight(p0, p1, p2)
}
+func (s *GatewayStub) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
return s.Internal.ChainHasObj(p0, p1)
}
+func (s *GatewayStub) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) {
+ return false, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) ChainHead(p0 context.Context) (*types.TipSet, error) {
return s.Internal.ChainHead(p0)
}
+func (s *GatewayStub) ChainHead(p0 context.Context) (*types.TipSet, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) ChainNotify(p0 context.Context) (<-chan []*api.HeadChange, error) {
return s.Internal.ChainNotify(p0)
}
+func (s *GatewayStub) ChainNotify(p0 context.Context) (<-chan []*api.HeadChange, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
return s.Internal.ChainReadObj(p0, p1)
}
+func (s *GatewayStub) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
+ return *new([]byte), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
return s.Internal.GasEstimateMessageGas(p0, p1, p2, p3)
}
+func (s *GatewayStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
return s.Internal.MpoolPush(p0, p1)
}
+func (s *GatewayStub) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
+ return *new(cid.Cid), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
return s.Internal.MsigGetAvailableBalance(p0, p1, p2)
}
+func (s *GatewayStub) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*api.MsigTransaction, error) {
return s.Internal.MsigGetPending(p0, p1, p2)
}
+func (s *GatewayStub) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*api.MsigTransaction, error) {
+ return *new([]*api.MsigTransaction), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) {
return s.Internal.MsigGetVested(p0, p1, p2, p3)
}
+func (s *GatewayStub) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
return s.Internal.StateAccountKey(p0, p1, p2)
}
+func (s *GatewayStub) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) {
return s.Internal.StateDealProviderCollateralBounds(p0, p1, p2, p3)
}
+func (s *GatewayStub) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) {
+ return *new(api.DealCollateralBounds), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) {
return s.Internal.StateGetActor(p0, p1, p2)
}
+func (s *GatewayStub) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateGetReceipt(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) {
return s.Internal.StateGetReceipt(p0, p1, p2)
}
+func (s *GatewayStub) StateGetReceipt(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
return s.Internal.StateListMiners(p0, p1)
}
+func (s *GatewayStub) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) {
+ return *new([]address.Address), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
return s.Internal.StateLookupID(p0, p1, p2)
}
+func (s *GatewayStub) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
+ return *new(address.Address), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MarketBalance, error) {
return s.Internal.StateMarketBalance(p0, p1, p2)
}
+func (s *GatewayStub) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MarketBalance, error) {
+ return *new(api.MarketBalance), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*api.MarketDeal, error) {
return s.Internal.StateMarketStorageDeal(p0, p1, p2)
}
+func (s *GatewayStub) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*api.MarketDeal, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
return s.Internal.StateMinerInfo(p0, p1, p2)
}
+func (s *GatewayStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
+ return *new(miner.MinerInfo), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) {
return s.Internal.StateMinerPower(p0, p1, p2)
}
+func (s *GatewayStub) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) {
return s.Internal.StateMinerProvingDeadline(p0, p1, p2)
}
-func (s *GatewayStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) {
+func (s *GatewayStub) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) {
+ return nil, xerrors.New("method not supported")
+}
+
+func (s *GatewayStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (network.Version, error) {
return s.Internal.StateNetworkVersion(p0, p1)
}
+func (s *GatewayStub) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (network.Version, error) {
+ return *new(network.Version), xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateSearchMsg(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) {
return s.Internal.StateSearchMsg(p0, p1)
}
+func (s *GatewayStub) StateSearchMsg(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
return s.Internal.StateSectorGetInfo(p0, p1, p2, p3)
}
+func (s *GatewayStub) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
return s.Internal.StateVerifiedClientStatus(p0, p1, p2)
}
+func (s *GatewayStub) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) {
+ return nil, xerrors.New("method not supported")
+}
+
func (s *GatewayStruct) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64) (*api.MsgLookup, error) {
return s.Internal.StateWaitMsg(p0, p1, p2)
}
-func (s *SignableStruct) Sign(p0 context.Context, p1 api.SignFunc) error {
- return s.Internal.Sign(p0, p1)
+func (s *GatewayStub) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64) (*api.MsgLookup, error) {
+ return nil, xerrors.New("method not supported")
}
-func (s *StorageMinerStruct) ActorAddress(p0 context.Context) (address.Address, error) {
- return s.Internal.ActorAddress(p0)
+func (s *GatewayStruct) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return s.Internal.WalletBalance(p0, p1)
}
-func (s *StorageMinerStruct) ActorAddressConfig(p0 context.Context) (api.AddressConfig, error) {
- return s.Internal.ActorAddressConfig(p0)
+func (s *GatewayStub) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) {
+ return *new(types.BigInt), xerrors.New("method not supported")
}
-func (s *StorageMinerStruct) ActorSectorSize(p0 context.Context, p1 address.Address) (abi.SectorSize, error) {
- return s.Internal.ActorSectorSize(p0, p1)
-}
-
-func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) {
- return s.Internal.CheckProvable(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) ComputeProof(p0 context.Context, p1 []builtin.SectorInfo, p2 abi.PoStRandomness) ([]builtin.PoStProof, error) {
- return s.Internal.ComputeProof(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) CreateBackup(p0 context.Context, p1 string) error {
- return s.Internal.CreateBackup(p0, p1)
-}
-
-func (s *StorageMinerStruct) DealsConsiderOfflineRetrievalDeals(p0 context.Context) (bool, error) {
- return s.Internal.DealsConsiderOfflineRetrievalDeals(p0)
-}
-
-func (s *StorageMinerStruct) DealsConsiderOfflineStorageDeals(p0 context.Context) (bool, error) {
- return s.Internal.DealsConsiderOfflineStorageDeals(p0)
-}
-
-func (s *StorageMinerStruct) DealsConsiderOnlineRetrievalDeals(p0 context.Context) (bool, error) {
- return s.Internal.DealsConsiderOnlineRetrievalDeals(p0)
-}
-
-func (s *StorageMinerStruct) DealsConsiderOnlineStorageDeals(p0 context.Context) (bool, error) {
- return s.Internal.DealsConsiderOnlineStorageDeals(p0)
-}
-
-func (s *StorageMinerStruct) DealsConsiderUnverifiedStorageDeals(p0 context.Context) (bool, error) {
- return s.Internal.DealsConsiderUnverifiedStorageDeals(p0)
-}
-
-func (s *StorageMinerStruct) DealsConsiderVerifiedStorageDeals(p0 context.Context) (bool, error) {
- return s.Internal.DealsConsiderVerifiedStorageDeals(p0)
-}
-
-func (s *StorageMinerStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error {
- return s.Internal.DealsImportData(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) DealsList(p0 context.Context) ([]api.MarketDeal, error) {
- return s.Internal.DealsList(p0)
-}
-
-func (s *StorageMinerStruct) DealsPieceCidBlocklist(p0 context.Context) ([]cid.Cid, error) {
- return s.Internal.DealsPieceCidBlocklist(p0)
-}
-
-func (s *StorageMinerStruct) DealsSetConsiderOfflineRetrievalDeals(p0 context.Context, p1 bool) error {
- return s.Internal.DealsSetConsiderOfflineRetrievalDeals(p0, p1)
-}
-
-func (s *StorageMinerStruct) DealsSetConsiderOfflineStorageDeals(p0 context.Context, p1 bool) error {
- return s.Internal.DealsSetConsiderOfflineStorageDeals(p0, p1)
-}
-
-func (s *StorageMinerStruct) DealsSetConsiderOnlineRetrievalDeals(p0 context.Context, p1 bool) error {
- return s.Internal.DealsSetConsiderOnlineRetrievalDeals(p0, p1)
-}
-
-func (s *StorageMinerStruct) DealsSetConsiderOnlineStorageDeals(p0 context.Context, p1 bool) error {
- return s.Internal.DealsSetConsiderOnlineStorageDeals(p0, p1)
-}
-
-func (s *StorageMinerStruct) DealsSetConsiderUnverifiedStorageDeals(p0 context.Context, p1 bool) error {
- return s.Internal.DealsSetConsiderUnverifiedStorageDeals(p0, p1)
-}
-
-func (s *StorageMinerStruct) DealsSetConsiderVerifiedStorageDeals(p0 context.Context, p1 bool) error {
- return s.Internal.DealsSetConsiderVerifiedStorageDeals(p0, p1)
-}
-
-func (s *StorageMinerStruct) DealsSetPieceCidBlocklist(p0 context.Context, p1 []cid.Cid) error {
- return s.Internal.DealsSetPieceCidBlocklist(p0, p1)
-}
-
-func (s *StorageMinerStruct) MarketCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
- return s.Internal.MarketCancelDataTransfer(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) MarketDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) {
- return s.Internal.MarketDataTransferUpdates(p0)
-}
-
-func (s *StorageMinerStruct) MarketGetAsk(p0 context.Context) (*storagemarket.SignedStorageAsk, error) {
- return s.Internal.MarketGetAsk(p0)
-}
-
-func (s *StorageMinerStruct) MarketGetDealUpdates(p0 context.Context) (<-chan storagemarket.MinerDeal, error) {
- return s.Internal.MarketGetDealUpdates(p0)
-}
-
-func (s *StorageMinerStruct) MarketGetRetrievalAsk(p0 context.Context) (*retrievalmarket.Ask, error) {
- return s.Internal.MarketGetRetrievalAsk(p0)
-}
-
-func (s *StorageMinerStruct) MarketImportDealData(p0 context.Context, p1 cid.Cid, p2 string) error {
- return s.Internal.MarketImportDealData(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) MarketListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) {
- return s.Internal.MarketListDataTransfers(p0)
-}
-
-func (s *StorageMinerStruct) MarketListDeals(p0 context.Context) ([]api.MarketDeal, error) {
- return s.Internal.MarketListDeals(p0)
-}
-
-func (s *StorageMinerStruct) MarketListIncompleteDeals(p0 context.Context) ([]storagemarket.MinerDeal, error) {
- return s.Internal.MarketListIncompleteDeals(p0)
-}
-
-func (s *StorageMinerStruct) MarketListRetrievalDeals(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) {
- return s.Internal.MarketListRetrievalDeals(p0)
-}
-
-func (s *StorageMinerStruct) MarketPendingDeals(p0 context.Context) (api.PendingDealInfo, error) {
- return s.Internal.MarketPendingDeals(p0)
-}
-
-func (s *StorageMinerStruct) MarketPublishPendingDeals(p0 context.Context) error {
- return s.Internal.MarketPublishPendingDeals(p0)
-}
-
-func (s *StorageMinerStruct) MarketRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
- return s.Internal.MarketRestartDataTransfer(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) MarketSetAsk(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error {
- return s.Internal.MarketSetAsk(p0, p1, p2, p3, p4, p5)
-}
-
-func (s *StorageMinerStruct) MarketSetRetrievalAsk(p0 context.Context, p1 *retrievalmarket.Ask) error {
- return s.Internal.MarketSetRetrievalAsk(p0, p1)
-}
-
-func (s *StorageMinerStruct) MiningBase(p0 context.Context) (*types.TipSet, error) {
- return s.Internal.MiningBase(p0)
-}
-
-func (s *StorageMinerStruct) PiecesGetCIDInfo(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) {
- return s.Internal.PiecesGetCIDInfo(p0, p1)
-}
-
-func (s *StorageMinerStruct) PiecesGetPieceInfo(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) {
- return s.Internal.PiecesGetPieceInfo(p0, p1)
-}
-
-func (s *StorageMinerStruct) PiecesListCidInfos(p0 context.Context) ([]cid.Cid, error) {
- return s.Internal.PiecesListCidInfos(p0)
-}
-
-func (s *StorageMinerStruct) PiecesListPieces(p0 context.Context) ([]cid.Cid, error) {
- return s.Internal.PiecesListPieces(p0)
-}
-
-func (s *StorageMinerStruct) PledgeSector(p0 context.Context) (abi.SectorID, error) {
- return s.Internal.PledgeSector(p0)
-}
-
-func (s *StorageMinerStruct) ReturnAddPiece(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error {
- return s.Internal.ReturnAddPiece(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) ReturnFetch(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
- return s.Internal.ReturnFetch(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) ReturnFinalizeSector(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
- return s.Internal.ReturnFinalizeSector(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) ReturnMoveStorage(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
- return s.Internal.ReturnMoveStorage(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) ReturnReadPiece(p0 context.Context, p1 storiface.CallID, p2 bool, p3 *storiface.CallError) error {
- return s.Internal.ReturnReadPiece(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) ReturnReleaseUnsealed(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
- return s.Internal.ReturnReleaseUnsealed(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) ReturnSealCommit1(p0 context.Context, p1 storiface.CallID, p2 storage.Commit1Out, p3 *storiface.CallError) error {
- return s.Internal.ReturnSealCommit1(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) ReturnSealCommit2(p0 context.Context, p1 storiface.CallID, p2 storage.Proof, p3 *storiface.CallError) error {
- return s.Internal.ReturnSealCommit2(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) ReturnSealPreCommit1(p0 context.Context, p1 storiface.CallID, p2 storage.PreCommit1Out, p3 *storiface.CallError) error {
- return s.Internal.ReturnSealPreCommit1(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) ReturnSealPreCommit2(p0 context.Context, p1 storiface.CallID, p2 storage.SectorCids, p3 *storiface.CallError) error {
- return s.Internal.ReturnSealPreCommit2(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) ReturnUnsealPiece(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
- return s.Internal.ReturnUnsealPiece(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) SealingAbort(p0 context.Context, p1 storiface.CallID) error {
- return s.Internal.SealingAbort(p0, p1)
-}
-
-func (s *StorageMinerStruct) SealingSchedDiag(p0 context.Context, p1 bool) (interface{}, error) {
- return s.Internal.SealingSchedDiag(p0, p1)
-}
-
-func (s *StorageMinerStruct) SectorCommitFlush(p0 context.Context) ([]sealiface.CommitBatchRes, error) {
- return s.Internal.SectorCommitFlush(p0)
-}
-
-func (s *StorageMinerStruct) SectorCommitPending(p0 context.Context) ([]abi.SectorID, error) {
- return s.Internal.SectorCommitPending(p0)
-}
-
-func (s *StorageMinerStruct) SectorGetExpectedSealDuration(p0 context.Context) (time.Duration, error) {
- return s.Internal.SectorGetExpectedSealDuration(p0)
-}
-
-func (s *StorageMinerStruct) SectorGetSealDelay(p0 context.Context) (time.Duration, error) {
- return s.Internal.SectorGetSealDelay(p0)
-}
-
-func (s *StorageMinerStruct) SectorMarkForUpgrade(p0 context.Context, p1 abi.SectorNumber) error {
- return s.Internal.SectorMarkForUpgrade(p0, p1)
-}
-
-func (s *StorageMinerStruct) SectorPreCommitFlush(p0 context.Context) ([]sealiface.PreCommitBatchRes, error) {
- return s.Internal.SectorPreCommitFlush(p0)
-}
-
-func (s *StorageMinerStruct) SectorPreCommitPending(p0 context.Context) ([]abi.SectorID, error) {
- return s.Internal.SectorPreCommitPending(p0)
-}
-
-func (s *StorageMinerStruct) SectorRemove(p0 context.Context, p1 abi.SectorNumber) error {
- return s.Internal.SectorRemove(p0, p1)
-}
-
-func (s *StorageMinerStruct) SectorSetExpectedSealDuration(p0 context.Context, p1 time.Duration) error {
- return s.Internal.SectorSetExpectedSealDuration(p0, p1)
-}
-
-func (s *StorageMinerStruct) SectorSetSealDelay(p0 context.Context, p1 time.Duration) error {
- return s.Internal.SectorSetSealDelay(p0, p1)
-}
-
-func (s *StorageMinerStruct) SectorStartSealing(p0 context.Context, p1 abi.SectorNumber) error {
- return s.Internal.SectorStartSealing(p0, p1)
-}
-
-func (s *StorageMinerStruct) SectorTerminate(p0 context.Context, p1 abi.SectorNumber) error {
- return s.Internal.SectorTerminate(p0, p1)
-}
-
-func (s *StorageMinerStruct) SectorTerminateFlush(p0 context.Context) (*cid.Cid, error) {
- return s.Internal.SectorTerminateFlush(p0)
-}
-
-func (s *StorageMinerStruct) SectorTerminatePending(p0 context.Context) ([]abi.SectorID, error) {
- return s.Internal.SectorTerminatePending(p0)
-}
-
-func (s *StorageMinerStruct) SectorsList(p0 context.Context) ([]abi.SectorNumber, error) {
- return s.Internal.SectorsList(p0)
-}
-
-func (s *StorageMinerStruct) SectorsListInStates(p0 context.Context, p1 []api.SectorState) ([]abi.SectorNumber, error) {
- return s.Internal.SectorsListInStates(p0, p1)
-}
-
-func (s *StorageMinerStruct) SectorsRefs(p0 context.Context) (map[string][]api.SealedRef, error) {
- return s.Internal.SectorsRefs(p0)
-}
-
-func (s *StorageMinerStruct) SectorsStatus(p0 context.Context, p1 abi.SectorNumber, p2 bool) (api.SectorInfo, error) {
- return s.Internal.SectorsStatus(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) SectorsSummary(p0 context.Context) (map[api.SectorState]int, error) {
- return s.Internal.SectorsSummary(p0)
-}
-
-func (s *StorageMinerStruct) SectorsUpdate(p0 context.Context, p1 abi.SectorNumber, p2 api.SectorState) error {
- return s.Internal.SectorsUpdate(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) StorageAddLocal(p0 context.Context, p1 string) error {
- return s.Internal.StorageAddLocal(p0, p1)
-}
-
-func (s *StorageMinerStruct) StorageAttach(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error {
- return s.Internal.StorageAttach(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) StorageBestAlloc(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) {
- return s.Internal.StorageBestAlloc(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) StorageDeclareSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error {
- return s.Internal.StorageDeclareSector(p0, p1, p2, p3, p4)
-}
-
-func (s *StorageMinerStruct) StorageDropSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error {
- return s.Internal.StorageDropSector(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) StorageFindSector(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) {
- return s.Internal.StorageFindSector(p0, p1, p2, p3, p4)
-}
-
-func (s *StorageMinerStruct) StorageInfo(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) {
- return s.Internal.StorageInfo(p0, p1)
-}
-
-func (s *StorageMinerStruct) StorageList(p0 context.Context) (map[stores.ID][]stores.Decl, error) {
- return s.Internal.StorageList(p0)
-}
-
-func (s *StorageMinerStruct) StorageLocal(p0 context.Context) (map[stores.ID]string, error) {
- return s.Internal.StorageLocal(p0)
-}
-
-func (s *StorageMinerStruct) StorageLock(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) error {
- return s.Internal.StorageLock(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) StorageReportHealth(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error {
- return s.Internal.StorageReportHealth(p0, p1, p2)
-}
-
-func (s *StorageMinerStruct) StorageStat(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) {
- return s.Internal.StorageStat(p0, p1)
-}
-
-func (s *StorageMinerStruct) StorageTryLock(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) (bool, error) {
- return s.Internal.StorageTryLock(p0, p1, p2, p3)
-}
-
-func (s *StorageMinerStruct) WorkerConnect(p0 context.Context, p1 string) error {
- return s.Internal.WorkerConnect(p0, p1)
-}
-
-func (s *StorageMinerStruct) WorkerJobs(p0 context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) {
- return s.Internal.WorkerJobs(p0)
-}
-
-func (s *StorageMinerStruct) WorkerStats(p0 context.Context) (map[uuid.UUID]storiface.WorkerStats, error) {
- return s.Internal.WorkerStats(p0)
-}
-
-func (s *WalletStruct) WalletDelete(p0 context.Context, p1 address.Address) error {
- return s.Internal.WalletDelete(p0, p1)
-}
-
-func (s *WalletStruct) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) {
- return s.Internal.WalletExport(p0, p1)
-}
-
-func (s *WalletStruct) WalletHas(p0 context.Context, p1 address.Address) (bool, error) {
- return s.Internal.WalletHas(p0, p1)
-}
-
-func (s *WalletStruct) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) {
- return s.Internal.WalletImport(p0, p1)
-}
-
-func (s *WalletStruct) WalletList(p0 context.Context) ([]address.Address, error) {
- return s.Internal.WalletList(p0)
-}
-
-func (s *WalletStruct) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error) {
- return s.Internal.WalletNew(p0, p1)
-}
-
-func (s *WalletStruct) WalletSign(p0 context.Context, p1 address.Address, p2 []byte, p3 api.MsgMeta) (*crypto.Signature, error) {
- return s.Internal.WalletSign(p0, p1, p2, p3)
-}
-
-func (s *WorkerStruct) AddPiece(p0 context.Context, p1 storage.SectorRef, p2 []abi.UnpaddedPieceSize, p3 abi.UnpaddedPieceSize, p4 storage.Data) (storiface.CallID, error) {
- return s.Internal.AddPiece(p0, p1, p2, p3, p4)
-}
-
-func (s *WorkerStruct) Enabled(p0 context.Context) (bool, error) {
- return s.Internal.Enabled(p0)
-}
-
-func (s *WorkerStruct) Fetch(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) {
- return s.Internal.Fetch(p0, p1, p2, p3, p4)
-}
-
-func (s *WorkerStruct) FinalizeSector(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) {
- return s.Internal.FinalizeSector(p0, p1, p2)
-}
-
-func (s *WorkerStruct) Info(p0 context.Context) (storiface.WorkerInfo, error) {
- return s.Internal.Info(p0)
-}
-
-func (s *WorkerStruct) MoveStorage(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType) (storiface.CallID, error) {
- return s.Internal.MoveStorage(p0, p1, p2)
-}
-
-func (s *WorkerStruct) Paths(p0 context.Context) ([]stores.StoragePath, error) {
- return s.Internal.Paths(p0)
-}
-
-func (s *WorkerStruct) ProcessSession(p0 context.Context) (uuid.UUID, error) {
- return s.Internal.ProcessSession(p0)
-}
-
-func (s *WorkerStruct) ReadPiece(p0 context.Context, p1 io.Writer, p2 storage.SectorRef, p3 storiface.UnpaddedByteIndex, p4 abi.UnpaddedPieceSize) (storiface.CallID, error) {
- return s.Internal.ReadPiece(p0, p1, p2, p3, p4)
-}
-
-func (s *WorkerStruct) ReleaseUnsealed(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) {
- return s.Internal.ReleaseUnsealed(p0, p1, p2)
-}
-
-func (s *WorkerStruct) Remove(p0 context.Context, p1 abi.SectorID) error {
- return s.Internal.Remove(p0, p1)
-}
-
-func (s *WorkerStruct) SealCommit1(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 abi.InteractiveSealRandomness, p4 []abi.PieceInfo, p5 storage.SectorCids) (storiface.CallID, error) {
- return s.Internal.SealCommit1(p0, p1, p2, p3, p4, p5)
-}
-
-func (s *WorkerStruct) SealCommit2(p0 context.Context, p1 storage.SectorRef, p2 storage.Commit1Out) (storiface.CallID, error) {
- return s.Internal.SealCommit2(p0, p1, p2)
-}
-
-func (s *WorkerStruct) SealPreCommit1(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 []abi.PieceInfo) (storiface.CallID, error) {
- return s.Internal.SealPreCommit1(p0, p1, p2, p3)
-}
-
-func (s *WorkerStruct) SealPreCommit2(p0 context.Context, p1 storage.SectorRef, p2 storage.PreCommit1Out) (storiface.CallID, error) {
- return s.Internal.SealPreCommit2(p0, p1, p2)
-}
-
-func (s *WorkerStruct) Session(p0 context.Context) (uuid.UUID, error) {
- return s.Internal.Session(p0)
-}
-
-func (s *WorkerStruct) SetEnabled(p0 context.Context, p1 bool) error {
- return s.Internal.SetEnabled(p0, p1)
-}
-
-func (s *WorkerStruct) StorageAddLocal(p0 context.Context, p1 string) error {
- return s.Internal.StorageAddLocal(p0, p1)
-}
-
-func (s *WorkerStruct) TaskDisable(p0 context.Context, p1 sealtasks.TaskType) error {
- return s.Internal.TaskDisable(p0, p1)
-}
-
-func (s *WorkerStruct) TaskEnable(p0 context.Context, p1 sealtasks.TaskType) error {
- return s.Internal.TaskEnable(p0, p1)
-}
-
-func (s *WorkerStruct) TaskTypes(p0 context.Context) (map[sealtasks.TaskType]struct{}, error) {
- return s.Internal.TaskTypes(p0)
-}
-
-func (s *WorkerStruct) UnsealPiece(p0 context.Context, p1 storage.SectorRef, p2 storiface.UnpaddedByteIndex, p3 abi.UnpaddedPieceSize, p4 abi.SealRandomness, p5 cid.Cid) (storiface.CallID, error) {
- return s.Internal.UnsealPiece(p0, p1, p2, p3, p4, p5)
-}
-
-func (s *WorkerStruct) Version(p0 context.Context) (api.Version, error) {
- return s.Internal.Version(p0)
-}
-
-func (s *WorkerStruct) WaitQuiet(p0 context.Context) error {
- return s.Internal.WaitQuiet(p0)
-}
-
-var _ api.ChainIO = new(ChainIOStruct)
-var _ api.Common = new(CommonStruct)
-var _ api.FullNode = new(FullNodeStruct)
-var _ api.Gateway = new(GatewayStruct)
-var _ api.Signable = new(SignableStruct)
-var _ api.StorageMiner = new(StorageMinerStruct)
-var _ api.Wallet = new(WalletStruct)
-var _ api.Worker = new(WorkerStruct)
+var _ FullNode = new(FullNodeStruct)
+var _ Gateway = new(GatewayStruct)
diff --git a/api/v0api/v0mocks/mock_full.go b/api/v0api/v0mocks/mock_full.go
new file mode 100644
index 000000000..a268d4a8a
--- /dev/null
+++ b/api/v0api/v0mocks/mock_full.go
@@ -0,0 +1,3064 @@
+// Code generated by MockGen. DO NOT EDIT.
+// Source: github.com/filecoin-project/lotus/api/v0api (interfaces: FullNode)
+
+// Package v0mocks is a generated GoMock package.
+package v0mocks
+
+import (
+ context "context"
+ reflect "reflect"
+
+ address "github.com/filecoin-project/go-address"
+ bitfield "github.com/filecoin-project/go-bitfield"
+ datatransfer "github.com/filecoin-project/go-data-transfer"
+ retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket"
+ storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
+ auth "github.com/filecoin-project/go-jsonrpc/auth"
+ multistore "github.com/filecoin-project/go-multistore"
+ abi "github.com/filecoin-project/go-state-types/abi"
+ big "github.com/filecoin-project/go-state-types/big"
+ 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"
+ api "github.com/filecoin-project/lotus/api"
+ apitypes "github.com/filecoin-project/lotus/api/types"
+ miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
+ types "github.com/filecoin-project/lotus/chain/types"
+ marketevents "github.com/filecoin-project/lotus/markets/loggers"
+ dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
+ miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
+ paych "github.com/filecoin-project/specs-actors/actors/builtin/paych"
+ gomock "github.com/golang/mock/gomock"
+ uuid "github.com/google/uuid"
+ 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"
+)
+
+// MockFullNode is a mock of FullNode interface.
+type MockFullNode struct {
+ ctrl *gomock.Controller
+ recorder *MockFullNodeMockRecorder
+}
+
+// MockFullNodeMockRecorder is the mock recorder for MockFullNode.
+type MockFullNodeMockRecorder struct {
+ mock *MockFullNode
+}
+
+// NewMockFullNode creates a new mock instance.
+func NewMockFullNode(ctrl *gomock.Controller) *MockFullNode {
+ mock := &MockFullNode{ctrl: ctrl}
+ mock.recorder = &MockFullNodeMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use.
+func (m *MockFullNode) EXPECT() *MockFullNodeMockRecorder {
+ return m.recorder
+}
+
+// AuthNew mocks base method.
+func (m *MockFullNode) AuthNew(arg0 context.Context, arg1 []auth.Permission) ([]byte, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "AuthNew", arg0, arg1)
+ ret0, _ := ret[0].([]byte)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// AuthNew indicates an expected call of AuthNew.
+func (mr *MockFullNodeMockRecorder) AuthNew(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthNew", reflect.TypeOf((*MockFullNode)(nil).AuthNew), arg0, arg1)
+}
+
+// AuthVerify mocks base method.
+func (m *MockFullNode) AuthVerify(arg0 context.Context, arg1 string) ([]auth.Permission, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "AuthVerify", arg0, arg1)
+ ret0, _ := ret[0].([]auth.Permission)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// AuthVerify indicates an expected call of AuthVerify.
+func (mr *MockFullNodeMockRecorder) AuthVerify(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthVerify", reflect.TypeOf((*MockFullNode)(nil).AuthVerify), arg0, arg1)
+}
+
+// BeaconGetEntry mocks base method.
+func (m *MockFullNode) BeaconGetEntry(arg0 context.Context, arg1 abi.ChainEpoch) (*types.BeaconEntry, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "BeaconGetEntry", arg0, arg1)
+ ret0, _ := ret[0].(*types.BeaconEntry)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// BeaconGetEntry indicates an expected call of BeaconGetEntry.
+func (mr *MockFullNodeMockRecorder) BeaconGetEntry(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconGetEntry", reflect.TypeOf((*MockFullNode)(nil).BeaconGetEntry), arg0, arg1)
+}
+
+// ChainDeleteObj mocks base method.
+func (m *MockFullNode) ChainDeleteObj(arg0 context.Context, arg1 cid.Cid) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainDeleteObj", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ChainDeleteObj indicates an expected call of ChainDeleteObj.
+func (mr *MockFullNodeMockRecorder) ChainDeleteObj(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainDeleteObj", reflect.TypeOf((*MockFullNode)(nil).ChainDeleteObj), arg0, arg1)
+}
+
+// ChainExport mocks base method.
+func (m *MockFullNode) ChainExport(arg0 context.Context, arg1 abi.ChainEpoch, arg2 bool, arg3 types.TipSetKey) (<-chan []byte, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainExport", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(<-chan []byte)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainExport indicates an expected call of ChainExport.
+func (mr *MockFullNodeMockRecorder) ChainExport(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainExport", reflect.TypeOf((*MockFullNode)(nil).ChainExport), arg0, arg1, arg2, arg3)
+}
+
+// ChainGetBlock mocks base method.
+func (m *MockFullNode) ChainGetBlock(arg0 context.Context, arg1 cid.Cid) (*types.BlockHeader, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetBlock", arg0, arg1)
+ ret0, _ := ret[0].(*types.BlockHeader)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetBlock indicates an expected call of ChainGetBlock.
+func (mr *MockFullNodeMockRecorder) ChainGetBlock(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetBlock", reflect.TypeOf((*MockFullNode)(nil).ChainGetBlock), arg0, arg1)
+}
+
+// ChainGetBlockMessages mocks base method.
+func (m *MockFullNode) ChainGetBlockMessages(arg0 context.Context, arg1 cid.Cid) (*api.BlockMessages, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetBlockMessages", arg0, arg1)
+ ret0, _ := ret[0].(*api.BlockMessages)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetBlockMessages indicates an expected call of ChainGetBlockMessages.
+func (mr *MockFullNodeMockRecorder) ChainGetBlockMessages(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetBlockMessages", reflect.TypeOf((*MockFullNode)(nil).ChainGetBlockMessages), arg0, arg1)
+}
+
+// ChainGetGenesis mocks base method.
+func (m *MockFullNode) ChainGetGenesis(arg0 context.Context) (*types.TipSet, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetGenesis", arg0)
+ ret0, _ := ret[0].(*types.TipSet)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetGenesis indicates an expected call of ChainGetGenesis.
+func (mr *MockFullNodeMockRecorder) ChainGetGenesis(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetGenesis", reflect.TypeOf((*MockFullNode)(nil).ChainGetGenesis), arg0)
+}
+
+// ChainGetMessage mocks base method.
+func (m *MockFullNode) ChainGetMessage(arg0 context.Context, arg1 cid.Cid) (*types.Message, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetMessage", arg0, arg1)
+ ret0, _ := ret[0].(*types.Message)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetMessage indicates an expected call of ChainGetMessage.
+func (mr *MockFullNodeMockRecorder) ChainGetMessage(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetMessage", reflect.TypeOf((*MockFullNode)(nil).ChainGetMessage), arg0, arg1)
+}
+
+// ChainGetNode mocks base method.
+func (m *MockFullNode) ChainGetNode(arg0 context.Context, arg1 string) (*api.IpldObject, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetNode", arg0, arg1)
+ ret0, _ := ret[0].(*api.IpldObject)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetNode indicates an expected call of ChainGetNode.
+func (mr *MockFullNodeMockRecorder) ChainGetNode(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetNode", reflect.TypeOf((*MockFullNode)(nil).ChainGetNode), arg0, arg1)
+}
+
+// ChainGetParentMessages mocks base method.
+func (m *MockFullNode) ChainGetParentMessages(arg0 context.Context, arg1 cid.Cid) ([]api.Message, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetParentMessages", arg0, arg1)
+ ret0, _ := ret[0].([]api.Message)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetParentMessages indicates an expected call of ChainGetParentMessages.
+func (mr *MockFullNodeMockRecorder) ChainGetParentMessages(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetParentMessages", reflect.TypeOf((*MockFullNode)(nil).ChainGetParentMessages), arg0, arg1)
+}
+
+// ChainGetParentReceipts mocks base method.
+func (m *MockFullNode) ChainGetParentReceipts(arg0 context.Context, arg1 cid.Cid) ([]*types.MessageReceipt, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetParentReceipts", arg0, arg1)
+ ret0, _ := ret[0].([]*types.MessageReceipt)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetParentReceipts indicates an expected call of ChainGetParentReceipts.
+func (mr *MockFullNodeMockRecorder) ChainGetParentReceipts(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetParentReceipts", reflect.TypeOf((*MockFullNode)(nil).ChainGetParentReceipts), arg0, arg1)
+}
+
+// ChainGetPath mocks base method.
+func (m *MockFullNode) ChainGetPath(arg0 context.Context, arg1, arg2 types.TipSetKey) ([]*api.HeadChange, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetPath", arg0, arg1, arg2)
+ ret0, _ := ret[0].([]*api.HeadChange)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetPath indicates an expected call of ChainGetPath.
+func (mr *MockFullNodeMockRecorder) ChainGetPath(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetPath", reflect.TypeOf((*MockFullNode)(nil).ChainGetPath), arg0, arg1, arg2)
+}
+
+// ChainGetRandomnessFromBeacon mocks base method.
+func (m *MockFullNode) ChainGetRandomnessFromBeacon(arg0 context.Context, arg1 types.TipSetKey, arg2 crypto.DomainSeparationTag, arg3 abi.ChainEpoch, arg4 []byte) (abi.Randomness, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetRandomnessFromBeacon", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(abi.Randomness)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetRandomnessFromBeacon indicates an expected call of ChainGetRandomnessFromBeacon.
+func (mr *MockFullNodeMockRecorder) ChainGetRandomnessFromBeacon(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetRandomnessFromBeacon", reflect.TypeOf((*MockFullNode)(nil).ChainGetRandomnessFromBeacon), arg0, arg1, arg2, arg3, arg4)
+}
+
+// ChainGetRandomnessFromTickets mocks base method.
+func (m *MockFullNode) ChainGetRandomnessFromTickets(arg0 context.Context, arg1 types.TipSetKey, arg2 crypto.DomainSeparationTag, arg3 abi.ChainEpoch, arg4 []byte) (abi.Randomness, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetRandomnessFromTickets", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(abi.Randomness)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetRandomnessFromTickets indicates an expected call of ChainGetRandomnessFromTickets.
+func (mr *MockFullNodeMockRecorder) ChainGetRandomnessFromTickets(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetRandomnessFromTickets", reflect.TypeOf((*MockFullNode)(nil).ChainGetRandomnessFromTickets), arg0, arg1, arg2, arg3, arg4)
+}
+
+// ChainGetTipSet mocks base method.
+func (m *MockFullNode) ChainGetTipSet(arg0 context.Context, arg1 types.TipSetKey) (*types.TipSet, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetTipSet", arg0, arg1)
+ ret0, _ := ret[0].(*types.TipSet)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetTipSet indicates an expected call of ChainGetTipSet.
+func (mr *MockFullNodeMockRecorder) ChainGetTipSet(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetTipSet", reflect.TypeOf((*MockFullNode)(nil).ChainGetTipSet), arg0, arg1)
+}
+
+// ChainGetTipSetByHeight mocks base method.
+func (m *MockFullNode) ChainGetTipSetByHeight(arg0 context.Context, arg1 abi.ChainEpoch, arg2 types.TipSetKey) (*types.TipSet, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainGetTipSetByHeight", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*types.TipSet)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainGetTipSetByHeight indicates an expected call of ChainGetTipSetByHeight.
+func (mr *MockFullNodeMockRecorder) ChainGetTipSetByHeight(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetTipSetByHeight", reflect.TypeOf((*MockFullNode)(nil).ChainGetTipSetByHeight), arg0, arg1, arg2)
+}
+
+// ChainHasObj mocks base method.
+func (m *MockFullNode) ChainHasObj(arg0 context.Context, arg1 cid.Cid) (bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainHasObj", arg0, arg1)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainHasObj indicates an expected call of ChainHasObj.
+func (mr *MockFullNodeMockRecorder) ChainHasObj(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHasObj", reflect.TypeOf((*MockFullNode)(nil).ChainHasObj), arg0, arg1)
+}
+
+// ChainHead mocks base method.
+func (m *MockFullNode) ChainHead(arg0 context.Context) (*types.TipSet, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainHead", arg0)
+ ret0, _ := ret[0].(*types.TipSet)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainHead indicates an expected call of ChainHead.
+func (mr *MockFullNodeMockRecorder) ChainHead(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockFullNode)(nil).ChainHead), arg0)
+}
+
+// ChainNotify mocks base method.
+func (m *MockFullNode) ChainNotify(arg0 context.Context) (<-chan []*api.HeadChange, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainNotify", arg0)
+ ret0, _ := ret[0].(<-chan []*api.HeadChange)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainNotify indicates an expected call of ChainNotify.
+func (mr *MockFullNodeMockRecorder) ChainNotify(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainNotify", reflect.TypeOf((*MockFullNode)(nil).ChainNotify), arg0)
+}
+
+// ChainReadObj mocks base method.
+func (m *MockFullNode) ChainReadObj(arg0 context.Context, arg1 cid.Cid) ([]byte, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainReadObj", arg0, arg1)
+ ret0, _ := ret[0].([]byte)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainReadObj indicates an expected call of ChainReadObj.
+func (mr *MockFullNodeMockRecorder) ChainReadObj(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainReadObj", reflect.TypeOf((*MockFullNode)(nil).ChainReadObj), arg0, arg1)
+}
+
+// ChainSetHead mocks base method.
+func (m *MockFullNode) ChainSetHead(arg0 context.Context, arg1 types.TipSetKey) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainSetHead", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ChainSetHead indicates an expected call of ChainSetHead.
+func (mr *MockFullNodeMockRecorder) ChainSetHead(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainSetHead", reflect.TypeOf((*MockFullNode)(nil).ChainSetHead), arg0, arg1)
+}
+
+// ChainStatObj mocks base method.
+func (m *MockFullNode) ChainStatObj(arg0 context.Context, arg1, arg2 cid.Cid) (api.ObjStat, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainStatObj", arg0, arg1, arg2)
+ ret0, _ := ret[0].(api.ObjStat)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainStatObj indicates an expected call of ChainStatObj.
+func (mr *MockFullNodeMockRecorder) ChainStatObj(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainStatObj", reflect.TypeOf((*MockFullNode)(nil).ChainStatObj), arg0, arg1, arg2)
+}
+
+// ChainTipSetWeight mocks base method.
+func (m *MockFullNode) ChainTipSetWeight(arg0 context.Context, arg1 types.TipSetKey) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ChainTipSetWeight", arg0, arg1)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ChainTipSetWeight indicates an expected call of ChainTipSetWeight.
+func (mr *MockFullNodeMockRecorder) ChainTipSetWeight(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainTipSetWeight", reflect.TypeOf((*MockFullNode)(nil).ChainTipSetWeight), arg0, arg1)
+}
+
+// ClientCalcCommP mocks base method.
+func (m *MockFullNode) ClientCalcCommP(arg0 context.Context, arg1 string) (*api.CommPRet, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientCalcCommP", arg0, arg1)
+ ret0, _ := ret[0].(*api.CommPRet)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientCalcCommP indicates an expected call of ClientCalcCommP.
+func (mr *MockFullNodeMockRecorder) ClientCalcCommP(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCalcCommP", reflect.TypeOf((*MockFullNode)(nil).ClientCalcCommP), arg0, arg1)
+}
+
+// ClientCancelDataTransfer mocks base method.
+func (m *MockFullNode) ClientCancelDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientCancelDataTransfer", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ClientCancelDataTransfer indicates an expected call of ClientCancelDataTransfer.
+func (mr *MockFullNodeMockRecorder) ClientCancelDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientCancelDataTransfer), arg0, arg1, arg2, arg3)
+}
+
+// ClientCancelRetrievalDeal mocks base method.
+func (m *MockFullNode) ClientCancelRetrievalDeal(arg0 context.Context, arg1 retrievalmarket.DealID) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientCancelRetrievalDeal", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ClientCancelRetrievalDeal indicates an expected call of ClientCancelRetrievalDeal.
+func (mr *MockFullNodeMockRecorder) ClientCancelRetrievalDeal(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelRetrievalDeal", reflect.TypeOf((*MockFullNode)(nil).ClientCancelRetrievalDeal), arg0, arg1)
+}
+
+// ClientDataTransferUpdates mocks base method.
+func (m *MockFullNode) ClientDataTransferUpdates(arg0 context.Context) (<-chan api.DataTransferChannel, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientDataTransferUpdates", arg0)
+ ret0, _ := ret[0].(<-chan api.DataTransferChannel)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientDataTransferUpdates indicates an expected call of ClientDataTransferUpdates.
+func (mr *MockFullNodeMockRecorder) ClientDataTransferUpdates(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDataTransferUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientDataTransferUpdates), arg0)
+}
+
+// ClientDealPieceCID mocks base method.
+func (m *MockFullNode) ClientDealPieceCID(arg0 context.Context, arg1 cid.Cid) (api.DataCIDSize, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientDealPieceCID", arg0, arg1)
+ ret0, _ := ret[0].(api.DataCIDSize)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientDealPieceCID indicates an expected call of ClientDealPieceCID.
+func (mr *MockFullNodeMockRecorder) ClientDealPieceCID(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealPieceCID", reflect.TypeOf((*MockFullNode)(nil).ClientDealPieceCID), arg0, arg1)
+}
+
+// ClientDealSize mocks base method.
+func (m *MockFullNode) ClientDealSize(arg0 context.Context, arg1 cid.Cid) (api.DataSize, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientDealSize", arg0, arg1)
+ ret0, _ := ret[0].(api.DataSize)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientDealSize indicates an expected call of ClientDealSize.
+func (mr *MockFullNodeMockRecorder) ClientDealSize(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealSize", reflect.TypeOf((*MockFullNode)(nil).ClientDealSize), arg0, arg1)
+}
+
+// ClientFindData mocks base method.
+func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *cid.Cid) ([]api.QueryOffer, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientFindData", arg0, arg1, arg2)
+ ret0, _ := ret[0].([]api.QueryOffer)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientFindData indicates an expected call of ClientFindData.
+func (mr *MockFullNodeMockRecorder) ClientFindData(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientFindData", reflect.TypeOf((*MockFullNode)(nil).ClientFindData), arg0, arg1, arg2)
+}
+
+// ClientGenCar mocks base method.
+func (m *MockFullNode) ClientGenCar(arg0 context.Context, arg1 api.FileRef, arg2 string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientGenCar", arg0, arg1, arg2)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ClientGenCar indicates an expected call of ClientGenCar.
+func (mr *MockFullNodeMockRecorder) ClientGenCar(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGenCar", reflect.TypeOf((*MockFullNode)(nil).ClientGenCar), arg0, arg1, arg2)
+}
+
+// ClientGetDealInfo mocks base method.
+func (m *MockFullNode) ClientGetDealInfo(arg0 context.Context, arg1 cid.Cid) (*api.DealInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientGetDealInfo", arg0, arg1)
+ ret0, _ := ret[0].(*api.DealInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientGetDealInfo indicates an expected call of ClientGetDealInfo.
+func (mr *MockFullNodeMockRecorder) ClientGetDealInfo(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealInfo", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealInfo), arg0, arg1)
+}
+
+// ClientGetDealStatus mocks base method.
+func (m *MockFullNode) ClientGetDealStatus(arg0 context.Context, arg1 uint64) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientGetDealStatus", arg0, arg1)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientGetDealStatus indicates an expected call of ClientGetDealStatus.
+func (mr *MockFullNodeMockRecorder) ClientGetDealStatus(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealStatus", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealStatus), arg0, arg1)
+}
+
+// ClientGetDealUpdates mocks base method.
+func (m *MockFullNode) ClientGetDealUpdates(arg0 context.Context) (<-chan api.DealInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientGetDealUpdates", arg0)
+ ret0, _ := ret[0].(<-chan api.DealInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientGetDealUpdates indicates an expected call of ClientGetDealUpdates.
+func (mr *MockFullNodeMockRecorder) ClientGetDealUpdates(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealUpdates), arg0)
+}
+
+// ClientGetRetrievalUpdates mocks base method.
+func (m *MockFullNode) ClientGetRetrievalUpdates(arg0 context.Context) (<-chan api.RetrievalInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientGetRetrievalUpdates", arg0)
+ ret0, _ := ret[0].(<-chan api.RetrievalInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientGetRetrievalUpdates indicates an expected call of ClientGetRetrievalUpdates.
+func (mr *MockFullNodeMockRecorder) ClientGetRetrievalUpdates(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetRetrievalUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetRetrievalUpdates), arg0)
+}
+
+// ClientHasLocal mocks base method.
+func (m *MockFullNode) ClientHasLocal(arg0 context.Context, arg1 cid.Cid) (bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientHasLocal", arg0, arg1)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientHasLocal indicates an expected call of ClientHasLocal.
+func (mr *MockFullNodeMockRecorder) ClientHasLocal(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientHasLocal", reflect.TypeOf((*MockFullNode)(nil).ClientHasLocal), arg0, arg1)
+}
+
+// ClientImport mocks base method.
+func (m *MockFullNode) ClientImport(arg0 context.Context, arg1 api.FileRef) (*api.ImportRes, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientImport", arg0, arg1)
+ ret0, _ := ret[0].(*api.ImportRes)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientImport indicates an expected call of ClientImport.
+func (mr *MockFullNodeMockRecorder) ClientImport(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientImport", reflect.TypeOf((*MockFullNode)(nil).ClientImport), arg0, arg1)
+}
+
+// ClientListDataTransfers mocks base method.
+func (m *MockFullNode) ClientListDataTransfers(arg0 context.Context) ([]api.DataTransferChannel, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientListDataTransfers", arg0)
+ ret0, _ := ret[0].([]api.DataTransferChannel)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientListDataTransfers indicates an expected call of ClientListDataTransfers.
+func (mr *MockFullNodeMockRecorder) ClientListDataTransfers(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDataTransfers", reflect.TypeOf((*MockFullNode)(nil).ClientListDataTransfers), arg0)
+}
+
+// ClientListDeals mocks base method.
+func (m *MockFullNode) ClientListDeals(arg0 context.Context) ([]api.DealInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientListDeals", arg0)
+ ret0, _ := ret[0].([]api.DealInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientListDeals indicates an expected call of ClientListDeals.
+func (mr *MockFullNodeMockRecorder) ClientListDeals(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDeals", reflect.TypeOf((*MockFullNode)(nil).ClientListDeals), arg0)
+}
+
+// ClientListImports mocks base method.
+func (m *MockFullNode) ClientListImports(arg0 context.Context) ([]api.Import, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientListImports", arg0)
+ ret0, _ := ret[0].([]api.Import)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientListImports indicates an expected call of ClientListImports.
+func (mr *MockFullNodeMockRecorder) ClientListImports(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListImports", reflect.TypeOf((*MockFullNode)(nil).ClientListImports), arg0)
+}
+
+// ClientListRetrievals mocks base method.
+func (m *MockFullNode) ClientListRetrievals(arg0 context.Context) ([]api.RetrievalInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientListRetrievals", arg0)
+ ret0, _ := ret[0].([]api.RetrievalInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientListRetrievals indicates an expected call of ClientListRetrievals.
+func (mr *MockFullNodeMockRecorder) ClientListRetrievals(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListRetrievals", reflect.TypeOf((*MockFullNode)(nil).ClientListRetrievals), arg0)
+}
+
+// ClientMinerQueryOffer mocks base method.
+func (m *MockFullNode) ClientMinerQueryOffer(arg0 context.Context, arg1 address.Address, arg2 cid.Cid, arg3 *cid.Cid) (api.QueryOffer, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientMinerQueryOffer", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(api.QueryOffer)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientMinerQueryOffer indicates an expected call of ClientMinerQueryOffer.
+func (mr *MockFullNodeMockRecorder) ClientMinerQueryOffer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientMinerQueryOffer", reflect.TypeOf((*MockFullNode)(nil).ClientMinerQueryOffer), arg0, arg1, arg2, arg3)
+}
+
+// ClientQueryAsk mocks base method.
+func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*storagemarket.StorageAsk, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientQueryAsk", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*storagemarket.StorageAsk)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientQueryAsk indicates an expected call of ClientQueryAsk.
+func (mr *MockFullNodeMockRecorder) ClientQueryAsk(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientQueryAsk", reflect.TypeOf((*MockFullNode)(nil).ClientQueryAsk), arg0, arg1, arg2)
+}
+
+// ClientRemoveImport mocks base method.
+func (m *MockFullNode) ClientRemoveImport(arg0 context.Context, arg1 multistore.StoreID) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientRemoveImport", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ClientRemoveImport indicates an expected call of ClientRemoveImport.
+func (mr *MockFullNodeMockRecorder) ClientRemoveImport(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRemoveImport", reflect.TypeOf((*MockFullNode)(nil).ClientRemoveImport), arg0, arg1)
+}
+
+// ClientRestartDataTransfer mocks base method.
+func (m *MockFullNode) ClientRestartDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientRestartDataTransfer", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ClientRestartDataTransfer indicates an expected call of ClientRestartDataTransfer.
+func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRestartDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientRestartDataTransfer), arg0, arg1, arg2, arg3)
+}
+
+// ClientRetrieve mocks base method.
+func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1, arg2)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ClientRetrieve indicates an expected call of ClientRetrieve.
+func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1, arg2)
+}
+
+// ClientRetrieveTryRestartInsufficientFunds mocks base method.
+func (m *MockFullNode) ClientRetrieveTryRestartInsufficientFunds(arg0 context.Context, arg1 address.Address) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientRetrieveTryRestartInsufficientFunds", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ClientRetrieveTryRestartInsufficientFunds indicates an expected call of ClientRetrieveTryRestartInsufficientFunds.
+func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveTryRestartInsufficientFunds", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveTryRestartInsufficientFunds), arg0, arg1)
+}
+
+// ClientRetrieveWithEvents mocks base method.
+func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientRetrieveWithEvents", arg0, arg1, arg2)
+ ret0, _ := ret[0].(<-chan marketevents.RetrievalEvent)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientRetrieveWithEvents indicates an expected call of ClientRetrieveWithEvents.
+func (mr *MockFullNodeMockRecorder) ClientRetrieveWithEvents(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWithEvents", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWithEvents), arg0, arg1, arg2)
+}
+
+// ClientStartDeal mocks base method.
+func (m *MockFullNode) ClientStartDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientStartDeal", arg0, arg1)
+ ret0, _ := ret[0].(*cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientStartDeal indicates an expected call of ClientStartDeal.
+func (mr *MockFullNodeMockRecorder) ClientStartDeal(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStartDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStartDeal), arg0, arg1)
+}
+
+// ClientStatelessDeal mocks base method.
+func (m *MockFullNode) ClientStatelessDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ClientStatelessDeal", arg0, arg1)
+ ret0, _ := ret[0].(*cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ClientStatelessDeal indicates an expected call of ClientStatelessDeal.
+func (mr *MockFullNodeMockRecorder) ClientStatelessDeal(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStatelessDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStatelessDeal), arg0, arg1)
+}
+
+// Closing mocks base method.
+func (m *MockFullNode) Closing(arg0 context.Context) (<-chan struct{}, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Closing", arg0)
+ ret0, _ := ret[0].(<-chan struct{})
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// Closing indicates an expected call of Closing.
+func (mr *MockFullNodeMockRecorder) Closing(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Closing", reflect.TypeOf((*MockFullNode)(nil).Closing), arg0)
+}
+
+// CreateBackup mocks base method.
+func (m *MockFullNode) CreateBackup(arg0 context.Context, arg1 string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "CreateBackup", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// CreateBackup indicates an expected call of CreateBackup.
+func (mr *MockFullNodeMockRecorder) CreateBackup(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBackup", reflect.TypeOf((*MockFullNode)(nil).CreateBackup), arg0, arg1)
+}
+
+// Discover mocks base method.
+func (m *MockFullNode) Discover(arg0 context.Context) (apitypes.OpenRPCDocument, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Discover", arg0)
+ ret0, _ := ret[0].(apitypes.OpenRPCDocument)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// Discover indicates an expected call of Discover.
+func (mr *MockFullNodeMockRecorder) Discover(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Discover", reflect.TypeOf((*MockFullNode)(nil).Discover), arg0)
+}
+
+// GasEstimateFeeCap mocks base method.
+func (m *MockFullNode) GasEstimateFeeCap(arg0 context.Context, arg1 *types.Message, arg2 int64, arg3 types.TipSetKey) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GasEstimateFeeCap", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GasEstimateFeeCap indicates an expected call of GasEstimateFeeCap.
+func (mr *MockFullNodeMockRecorder) GasEstimateFeeCap(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateFeeCap", reflect.TypeOf((*MockFullNode)(nil).GasEstimateFeeCap), arg0, arg1, arg2, arg3)
+}
+
+// GasEstimateGasLimit mocks base method.
+func (m *MockFullNode) GasEstimateGasLimit(arg0 context.Context, arg1 *types.Message, arg2 types.TipSetKey) (int64, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GasEstimateGasLimit", arg0, arg1, arg2)
+ ret0, _ := ret[0].(int64)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GasEstimateGasLimit indicates an expected call of GasEstimateGasLimit.
+func (mr *MockFullNodeMockRecorder) GasEstimateGasLimit(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateGasLimit", reflect.TypeOf((*MockFullNode)(nil).GasEstimateGasLimit), arg0, arg1, arg2)
+}
+
+// GasEstimateGasPremium mocks base method.
+func (m *MockFullNode) GasEstimateGasPremium(arg0 context.Context, arg1 uint64, arg2 address.Address, arg3 int64, arg4 types.TipSetKey) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GasEstimateGasPremium", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GasEstimateGasPremium indicates an expected call of GasEstimateGasPremium.
+func (mr *MockFullNodeMockRecorder) GasEstimateGasPremium(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateGasPremium", reflect.TypeOf((*MockFullNode)(nil).GasEstimateGasPremium), arg0, arg1, arg2, arg3, arg4)
+}
+
+// GasEstimateMessageGas mocks base method.
+func (m *MockFullNode) GasEstimateMessageGas(arg0 context.Context, arg1 *types.Message, arg2 *api.MessageSendSpec, arg3 types.TipSetKey) (*types.Message, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GasEstimateMessageGas", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*types.Message)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GasEstimateMessageGas indicates an expected call of GasEstimateMessageGas.
+func (mr *MockFullNodeMockRecorder) GasEstimateMessageGas(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateMessageGas", reflect.TypeOf((*MockFullNode)(nil).GasEstimateMessageGas), arg0, arg1, arg2, arg3)
+}
+
+// ID mocks base method.
+func (m *MockFullNode) ID(arg0 context.Context) (peer.ID, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ID", arg0)
+ ret0, _ := ret[0].(peer.ID)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// ID indicates an expected call of ID.
+func (mr *MockFullNodeMockRecorder) ID(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockFullNode)(nil).ID), arg0)
+}
+
+// LogList mocks base method.
+func (m *MockFullNode) LogList(arg0 context.Context) ([]string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "LogList", arg0)
+ ret0, _ := ret[0].([]string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// LogList indicates an expected call of LogList.
+func (mr *MockFullNodeMockRecorder) LogList(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogList", reflect.TypeOf((*MockFullNode)(nil).LogList), arg0)
+}
+
+// LogSetLevel mocks base method.
+func (m *MockFullNode) LogSetLevel(arg0 context.Context, arg1, arg2 string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "LogSetLevel", arg0, arg1, arg2)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// LogSetLevel indicates an expected call of LogSetLevel.
+func (mr *MockFullNodeMockRecorder) LogSetLevel(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogSetLevel", reflect.TypeOf((*MockFullNode)(nil).LogSetLevel), arg0, arg1, arg2)
+}
+
+// MarketAddBalance mocks base method.
+func (m *MockFullNode) MarketAddBalance(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MarketAddBalance", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MarketAddBalance indicates an expected call of MarketAddBalance.
+func (mr *MockFullNodeMockRecorder) MarketAddBalance(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketAddBalance", reflect.TypeOf((*MockFullNode)(nil).MarketAddBalance), arg0, arg1, arg2, arg3)
+}
+
+// MarketGetReserved mocks base method.
+func (m *MockFullNode) MarketGetReserved(arg0 context.Context, arg1 address.Address) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MarketGetReserved", arg0, arg1)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MarketGetReserved indicates an expected call of MarketGetReserved.
+func (mr *MockFullNodeMockRecorder) MarketGetReserved(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketGetReserved", reflect.TypeOf((*MockFullNode)(nil).MarketGetReserved), arg0, arg1)
+}
+
+// MarketReleaseFunds mocks base method.
+func (m *MockFullNode) MarketReleaseFunds(arg0 context.Context, arg1 address.Address, arg2 big.Int) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MarketReleaseFunds", arg0, arg1, arg2)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// MarketReleaseFunds indicates an expected call of MarketReleaseFunds.
+func (mr *MockFullNodeMockRecorder) MarketReleaseFunds(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketReleaseFunds", reflect.TypeOf((*MockFullNode)(nil).MarketReleaseFunds), arg0, arg1, arg2)
+}
+
+// MarketReserveFunds mocks base method.
+func (m *MockFullNode) MarketReserveFunds(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MarketReserveFunds", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MarketReserveFunds indicates an expected call of MarketReserveFunds.
+func (mr *MockFullNodeMockRecorder) MarketReserveFunds(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketReserveFunds", reflect.TypeOf((*MockFullNode)(nil).MarketReserveFunds), arg0, arg1, arg2, arg3)
+}
+
+// MarketWithdraw mocks base method.
+func (m *MockFullNode) MarketWithdraw(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MarketWithdraw", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MarketWithdraw indicates an expected call of MarketWithdraw.
+func (mr *MockFullNodeMockRecorder) MarketWithdraw(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketWithdraw", reflect.TypeOf((*MockFullNode)(nil).MarketWithdraw), arg0, arg1, arg2, arg3)
+}
+
+// MinerCreateBlock mocks base method.
+func (m *MockFullNode) MinerCreateBlock(arg0 context.Context, arg1 *api.BlockTemplate) (*types.BlockMsg, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MinerCreateBlock", arg0, arg1)
+ ret0, _ := ret[0].(*types.BlockMsg)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MinerCreateBlock indicates an expected call of MinerCreateBlock.
+func (mr *MockFullNodeMockRecorder) MinerCreateBlock(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MinerCreateBlock", reflect.TypeOf((*MockFullNode)(nil).MinerCreateBlock), arg0, arg1)
+}
+
+// MinerGetBaseInfo mocks base method.
+func (m *MockFullNode) MinerGetBaseInfo(arg0 context.Context, arg1 address.Address, arg2 abi.ChainEpoch, arg3 types.TipSetKey) (*api.MiningBaseInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MinerGetBaseInfo", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*api.MiningBaseInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MinerGetBaseInfo indicates an expected call of MinerGetBaseInfo.
+func (mr *MockFullNodeMockRecorder) MinerGetBaseInfo(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MinerGetBaseInfo", reflect.TypeOf((*MockFullNode)(nil).MinerGetBaseInfo), arg0, arg1, arg2, arg3)
+}
+
+// MpoolBatchPush mocks base method.
+func (m *MockFullNode) MpoolBatchPush(arg0 context.Context, arg1 []*types.SignedMessage) ([]cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolBatchPush", arg0, arg1)
+ ret0, _ := ret[0].([]cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolBatchPush indicates an expected call of MpoolBatchPush.
+func (mr *MockFullNodeMockRecorder) MpoolBatchPush(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolBatchPush", reflect.TypeOf((*MockFullNode)(nil).MpoolBatchPush), arg0, arg1)
+}
+
+// MpoolBatchPushMessage mocks base method.
+func (m *MockFullNode) MpoolBatchPushMessage(arg0 context.Context, arg1 []*types.Message, arg2 *api.MessageSendSpec) ([]*types.SignedMessage, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolBatchPushMessage", arg0, arg1, arg2)
+ ret0, _ := ret[0].([]*types.SignedMessage)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolBatchPushMessage indicates an expected call of MpoolBatchPushMessage.
+func (mr *MockFullNodeMockRecorder) MpoolBatchPushMessage(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolBatchPushMessage", reflect.TypeOf((*MockFullNode)(nil).MpoolBatchPushMessage), arg0, arg1, arg2)
+}
+
+// MpoolBatchPushUntrusted mocks base method.
+func (m *MockFullNode) MpoolBatchPushUntrusted(arg0 context.Context, arg1 []*types.SignedMessage) ([]cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolBatchPushUntrusted", arg0, arg1)
+ ret0, _ := ret[0].([]cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolBatchPushUntrusted indicates an expected call of MpoolBatchPushUntrusted.
+func (mr *MockFullNodeMockRecorder) MpoolBatchPushUntrusted(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolBatchPushUntrusted", reflect.TypeOf((*MockFullNode)(nil).MpoolBatchPushUntrusted), arg0, arg1)
+}
+
+// MpoolClear mocks base method.
+func (m *MockFullNode) MpoolClear(arg0 context.Context, arg1 bool) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolClear", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// MpoolClear indicates an expected call of MpoolClear.
+func (mr *MockFullNodeMockRecorder) MpoolClear(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolClear", reflect.TypeOf((*MockFullNode)(nil).MpoolClear), arg0, arg1)
+}
+
+// MpoolGetConfig mocks base method.
+func (m *MockFullNode) MpoolGetConfig(arg0 context.Context) (*types.MpoolConfig, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolGetConfig", arg0)
+ ret0, _ := ret[0].(*types.MpoolConfig)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolGetConfig indicates an expected call of MpoolGetConfig.
+func (mr *MockFullNodeMockRecorder) MpoolGetConfig(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolGetConfig", reflect.TypeOf((*MockFullNode)(nil).MpoolGetConfig), arg0)
+}
+
+// MpoolGetNonce mocks base method.
+func (m *MockFullNode) MpoolGetNonce(arg0 context.Context, arg1 address.Address) (uint64, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolGetNonce", arg0, arg1)
+ ret0, _ := ret[0].(uint64)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolGetNonce indicates an expected call of MpoolGetNonce.
+func (mr *MockFullNodeMockRecorder) MpoolGetNonce(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolGetNonce", reflect.TypeOf((*MockFullNode)(nil).MpoolGetNonce), arg0, arg1)
+}
+
+// MpoolPending mocks base method.
+func (m *MockFullNode) MpoolPending(arg0 context.Context, arg1 types.TipSetKey) ([]*types.SignedMessage, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolPending", arg0, arg1)
+ ret0, _ := ret[0].([]*types.SignedMessage)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolPending indicates an expected call of MpoolPending.
+func (mr *MockFullNodeMockRecorder) MpoolPending(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPending", reflect.TypeOf((*MockFullNode)(nil).MpoolPending), arg0, arg1)
+}
+
+// MpoolPush mocks base method.
+func (m *MockFullNode) MpoolPush(arg0 context.Context, arg1 *types.SignedMessage) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolPush", arg0, arg1)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolPush indicates an expected call of MpoolPush.
+func (mr *MockFullNodeMockRecorder) MpoolPush(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPush", reflect.TypeOf((*MockFullNode)(nil).MpoolPush), arg0, arg1)
+}
+
+// MpoolPushMessage mocks base method.
+func (m *MockFullNode) MpoolPushMessage(arg0 context.Context, arg1 *types.Message, arg2 *api.MessageSendSpec) (*types.SignedMessage, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolPushMessage", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*types.SignedMessage)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolPushMessage indicates an expected call of MpoolPushMessage.
+func (mr *MockFullNodeMockRecorder) MpoolPushMessage(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPushMessage", reflect.TypeOf((*MockFullNode)(nil).MpoolPushMessage), arg0, arg1, arg2)
+}
+
+// MpoolPushUntrusted mocks base method.
+func (m *MockFullNode) MpoolPushUntrusted(arg0 context.Context, arg1 *types.SignedMessage) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolPushUntrusted", arg0, arg1)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolPushUntrusted indicates an expected call of MpoolPushUntrusted.
+func (mr *MockFullNodeMockRecorder) MpoolPushUntrusted(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPushUntrusted", reflect.TypeOf((*MockFullNode)(nil).MpoolPushUntrusted), arg0, arg1)
+}
+
+// MpoolSelect mocks base method.
+func (m *MockFullNode) MpoolSelect(arg0 context.Context, arg1 types.TipSetKey, arg2 float64) ([]*types.SignedMessage, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolSelect", arg0, arg1, arg2)
+ ret0, _ := ret[0].([]*types.SignedMessage)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolSelect indicates an expected call of MpoolSelect.
+func (mr *MockFullNodeMockRecorder) MpoolSelect(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolSelect", reflect.TypeOf((*MockFullNode)(nil).MpoolSelect), arg0, arg1, arg2)
+}
+
+// MpoolSetConfig mocks base method.
+func (m *MockFullNode) MpoolSetConfig(arg0 context.Context, arg1 *types.MpoolConfig) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolSetConfig", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// MpoolSetConfig indicates an expected call of MpoolSetConfig.
+func (mr *MockFullNodeMockRecorder) MpoolSetConfig(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolSetConfig", reflect.TypeOf((*MockFullNode)(nil).MpoolSetConfig), arg0, arg1)
+}
+
+// MpoolSub mocks base method.
+func (m *MockFullNode) MpoolSub(arg0 context.Context) (<-chan api.MpoolUpdate, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolSub", arg0)
+ ret0, _ := ret[0].(<-chan api.MpoolUpdate)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolSub indicates an expected call of MpoolSub.
+func (mr *MockFullNodeMockRecorder) MpoolSub(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolSub", reflect.TypeOf((*MockFullNode)(nil).MpoolSub), arg0)
+}
+
+// MsigAddApprove mocks base method.
+func (m *MockFullNode) MsigAddApprove(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4, arg5 address.Address, arg6 bool) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigAddApprove", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigAddApprove indicates an expected call of MsigAddApprove.
+func (mr *MockFullNodeMockRecorder) MsigAddApprove(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigAddApprove", reflect.TypeOf((*MockFullNode)(nil).MsigAddApprove), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
+}
+
+// MsigAddCancel mocks base method.
+func (m *MockFullNode) MsigAddCancel(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4 address.Address, arg5 bool) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigAddCancel", arg0, arg1, arg2, arg3, arg4, arg5)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigAddCancel indicates an expected call of MsigAddCancel.
+func (mr *MockFullNodeMockRecorder) MsigAddCancel(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigAddCancel", reflect.TypeOf((*MockFullNode)(nil).MsigAddCancel), arg0, arg1, arg2, arg3, arg4, arg5)
+}
+
+// MsigAddPropose mocks base method.
+func (m *MockFullNode) MsigAddPropose(arg0 context.Context, arg1, arg2, arg3 address.Address, arg4 bool) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigAddPropose", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigAddPropose indicates an expected call of MsigAddPropose.
+func (mr *MockFullNodeMockRecorder) MsigAddPropose(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigAddPropose", reflect.TypeOf((*MockFullNode)(nil).MsigAddPropose), arg0, arg1, arg2, arg3, arg4)
+}
+
+// MsigApprove mocks base method.
+func (m *MockFullNode) MsigApprove(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigApprove", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigApprove indicates an expected call of MsigApprove.
+func (mr *MockFullNodeMockRecorder) MsigApprove(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigApprove", reflect.TypeOf((*MockFullNode)(nil).MsigApprove), arg0, arg1, arg2, arg3)
+}
+
+// MsigApproveTxnHash mocks base method.
+func (m *MockFullNode) MsigApproveTxnHash(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3, arg4 address.Address, arg5 big.Int, arg6 address.Address, arg7 uint64, arg8 []byte) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigApproveTxnHash", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigApproveTxnHash indicates an expected call of MsigApproveTxnHash.
+func (mr *MockFullNodeMockRecorder) MsigApproveTxnHash(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigApproveTxnHash", reflect.TypeOf((*MockFullNode)(nil).MsigApproveTxnHash), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
+}
+
+// MsigCancel mocks base method.
+func (m *MockFullNode) MsigCancel(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address, arg4 big.Int, arg5 address.Address, arg6 uint64, arg7 []byte) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigCancel", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigCancel indicates an expected call of MsigCancel.
+func (mr *MockFullNodeMockRecorder) MsigCancel(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCancel", reflect.TypeOf((*MockFullNode)(nil).MsigCancel), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
+}
+
+// MsigCreate mocks base method.
+func (m *MockFullNode) MsigCreate(arg0 context.Context, arg1 uint64, arg2 []address.Address, arg3 abi.ChainEpoch, arg4 big.Int, arg5 address.Address, arg6 big.Int) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigCreate", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigCreate indicates an expected call of MsigCreate.
+func (mr *MockFullNodeMockRecorder) MsigCreate(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCreate", reflect.TypeOf((*MockFullNode)(nil).MsigCreate), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
+}
+
+// MsigGetAvailableBalance mocks base method.
+func (m *MockFullNode) MsigGetAvailableBalance(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigGetAvailableBalance", arg0, arg1, arg2)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigGetAvailableBalance indicates an expected call of MsigGetAvailableBalance.
+func (mr *MockFullNodeMockRecorder) MsigGetAvailableBalance(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigGetAvailableBalance", reflect.TypeOf((*MockFullNode)(nil).MsigGetAvailableBalance), arg0, arg1, arg2)
+}
+
+// MsigGetPending mocks base method.
+func (m *MockFullNode) MsigGetPending(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) ([]*api.MsigTransaction, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigGetPending", arg0, arg1, arg2)
+ ret0, _ := ret[0].([]*api.MsigTransaction)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigGetPending indicates an expected call of MsigGetPending.
+func (mr *MockFullNodeMockRecorder) MsigGetPending(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigGetPending", reflect.TypeOf((*MockFullNode)(nil).MsigGetPending), arg0, arg1, arg2)
+}
+
+// MsigGetVested mocks base method.
+func (m *MockFullNode) MsigGetVested(arg0 context.Context, arg1 address.Address, arg2, arg3 types.TipSetKey) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigGetVested", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigGetVested indicates an expected call of MsigGetVested.
+func (mr *MockFullNodeMockRecorder) MsigGetVested(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigGetVested", reflect.TypeOf((*MockFullNode)(nil).MsigGetVested), arg0, arg1, arg2, arg3)
+}
+
+// MsigGetVestingSchedule mocks base method.
+func (m *MockFullNode) MsigGetVestingSchedule(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MsigVesting, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigGetVestingSchedule", arg0, arg1, arg2)
+ ret0, _ := ret[0].(api.MsigVesting)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigGetVestingSchedule indicates an expected call of MsigGetVestingSchedule.
+func (mr *MockFullNodeMockRecorder) MsigGetVestingSchedule(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigGetVestingSchedule", reflect.TypeOf((*MockFullNode)(nil).MsigGetVestingSchedule), arg0, arg1, arg2)
+}
+
+// MsigPropose mocks base method.
+func (m *MockFullNode) MsigPropose(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int, arg4 address.Address, arg5 uint64, arg6 []byte) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigPropose", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigPropose indicates an expected call of MsigPropose.
+func (mr *MockFullNodeMockRecorder) MsigPropose(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigPropose", reflect.TypeOf((*MockFullNode)(nil).MsigPropose), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
+}
+
+// MsigRemoveSigner mocks base method.
+func (m *MockFullNode) MsigRemoveSigner(arg0 context.Context, arg1, arg2, arg3 address.Address, arg4 bool) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigRemoveSigner", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigRemoveSigner indicates an expected call of MsigRemoveSigner.
+func (mr *MockFullNodeMockRecorder) MsigRemoveSigner(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigRemoveSigner", reflect.TypeOf((*MockFullNode)(nil).MsigRemoveSigner), arg0, arg1, arg2, arg3, arg4)
+}
+
+// MsigSwapApprove mocks base method.
+func (m *MockFullNode) MsigSwapApprove(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4, arg5, arg6 address.Address) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigSwapApprove", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigSwapApprove indicates an expected call of MsigSwapApprove.
+func (mr *MockFullNodeMockRecorder) MsigSwapApprove(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigSwapApprove", reflect.TypeOf((*MockFullNode)(nil).MsigSwapApprove), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
+}
+
+// MsigSwapCancel mocks base method.
+func (m *MockFullNode) MsigSwapCancel(arg0 context.Context, arg1, arg2 address.Address, arg3 uint64, arg4, arg5 address.Address) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigSwapCancel", arg0, arg1, arg2, arg3, arg4, arg5)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigSwapCancel indicates an expected call of MsigSwapCancel.
+func (mr *MockFullNodeMockRecorder) MsigSwapCancel(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigSwapCancel", reflect.TypeOf((*MockFullNode)(nil).MsigSwapCancel), arg0, arg1, arg2, arg3, arg4, arg5)
+}
+
+// MsigSwapPropose mocks base method.
+func (m *MockFullNode) MsigSwapPropose(arg0 context.Context, arg1, arg2, arg3, arg4 address.Address) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MsigSwapPropose", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MsigSwapPropose indicates an expected call of MsigSwapPropose.
+func (mr *MockFullNodeMockRecorder) MsigSwapPropose(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigSwapPropose", reflect.TypeOf((*MockFullNode)(nil).MsigSwapPropose), arg0, arg1, arg2, arg3, arg4)
+}
+
+// NetAddrsListen mocks base method.
+func (m *MockFullNode) NetAddrsListen(arg0 context.Context) (peer.AddrInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetAddrsListen", arg0)
+ ret0, _ := ret[0].(peer.AddrInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetAddrsListen indicates an expected call of NetAddrsListen.
+func (mr *MockFullNodeMockRecorder) NetAddrsListen(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetAddrsListen", reflect.TypeOf((*MockFullNode)(nil).NetAddrsListen), arg0)
+}
+
+// NetAgentVersion mocks base method.
+func (m *MockFullNode) NetAgentVersion(arg0 context.Context, arg1 peer.ID) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetAgentVersion", arg0, arg1)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetAgentVersion indicates an expected call of NetAgentVersion.
+func (mr *MockFullNodeMockRecorder) NetAgentVersion(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetAgentVersion", reflect.TypeOf((*MockFullNode)(nil).NetAgentVersion), arg0, arg1)
+}
+
+// NetAutoNatStatus mocks base method.
+func (m *MockFullNode) NetAutoNatStatus(arg0 context.Context) (api.NatInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetAutoNatStatus", arg0)
+ ret0, _ := ret[0].(api.NatInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetAutoNatStatus indicates an expected call of NetAutoNatStatus.
+func (mr *MockFullNodeMockRecorder) NetAutoNatStatus(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetAutoNatStatus", reflect.TypeOf((*MockFullNode)(nil).NetAutoNatStatus), arg0)
+}
+
+// NetBandwidthStats mocks base method.
+func (m *MockFullNode) NetBandwidthStats(arg0 context.Context) (metrics.Stats, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetBandwidthStats", arg0)
+ ret0, _ := ret[0].(metrics.Stats)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetBandwidthStats indicates an expected call of NetBandwidthStats.
+func (mr *MockFullNodeMockRecorder) NetBandwidthStats(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBandwidthStats", reflect.TypeOf((*MockFullNode)(nil).NetBandwidthStats), arg0)
+}
+
+// NetBandwidthStatsByPeer mocks base method.
+func (m *MockFullNode) NetBandwidthStatsByPeer(arg0 context.Context) (map[string]metrics.Stats, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetBandwidthStatsByPeer", arg0)
+ ret0, _ := ret[0].(map[string]metrics.Stats)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetBandwidthStatsByPeer indicates an expected call of NetBandwidthStatsByPeer.
+func (mr *MockFullNodeMockRecorder) NetBandwidthStatsByPeer(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBandwidthStatsByPeer", reflect.TypeOf((*MockFullNode)(nil).NetBandwidthStatsByPeer), arg0)
+}
+
+// NetBandwidthStatsByProtocol mocks base method.
+func (m *MockFullNode) NetBandwidthStatsByProtocol(arg0 context.Context) (map[protocol.ID]metrics.Stats, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetBandwidthStatsByProtocol", arg0)
+ ret0, _ := ret[0].(map[protocol.ID]metrics.Stats)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetBandwidthStatsByProtocol indicates an expected call of NetBandwidthStatsByProtocol.
+func (mr *MockFullNodeMockRecorder) NetBandwidthStatsByProtocol(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBandwidthStatsByProtocol", reflect.TypeOf((*MockFullNode)(nil).NetBandwidthStatsByProtocol), arg0)
+}
+
+// NetBlockAdd mocks base method.
+func (m *MockFullNode) NetBlockAdd(arg0 context.Context, arg1 api.NetBlockList) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetBlockAdd", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// NetBlockAdd indicates an expected call of NetBlockAdd.
+func (mr *MockFullNodeMockRecorder) NetBlockAdd(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBlockAdd", reflect.TypeOf((*MockFullNode)(nil).NetBlockAdd), arg0, arg1)
+}
+
+// NetBlockList mocks base method.
+func (m *MockFullNode) NetBlockList(arg0 context.Context) (api.NetBlockList, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetBlockList", arg0)
+ ret0, _ := ret[0].(api.NetBlockList)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetBlockList indicates an expected call of NetBlockList.
+func (mr *MockFullNodeMockRecorder) NetBlockList(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBlockList", reflect.TypeOf((*MockFullNode)(nil).NetBlockList), arg0)
+}
+
+// NetBlockRemove mocks base method.
+func (m *MockFullNode) NetBlockRemove(arg0 context.Context, arg1 api.NetBlockList) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetBlockRemove", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// NetBlockRemove indicates an expected call of NetBlockRemove.
+func (mr *MockFullNodeMockRecorder) NetBlockRemove(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetBlockRemove", reflect.TypeOf((*MockFullNode)(nil).NetBlockRemove), arg0, arg1)
+}
+
+// NetConnect mocks base method.
+func (m *MockFullNode) NetConnect(arg0 context.Context, arg1 peer.AddrInfo) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetConnect", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// NetConnect indicates an expected call of NetConnect.
+func (mr *MockFullNodeMockRecorder) NetConnect(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetConnect", reflect.TypeOf((*MockFullNode)(nil).NetConnect), arg0, arg1)
+}
+
+// NetConnectedness mocks base method.
+func (m *MockFullNode) NetConnectedness(arg0 context.Context, arg1 peer.ID) (network0.Connectedness, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetConnectedness", arg0, arg1)
+ ret0, _ := ret[0].(network0.Connectedness)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetConnectedness indicates an expected call of NetConnectedness.
+func (mr *MockFullNodeMockRecorder) NetConnectedness(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetConnectedness", reflect.TypeOf((*MockFullNode)(nil).NetConnectedness), arg0, arg1)
+}
+
+// NetDisconnect mocks base method.
+func (m *MockFullNode) NetDisconnect(arg0 context.Context, arg1 peer.ID) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetDisconnect", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// NetDisconnect indicates an expected call of NetDisconnect.
+func (mr *MockFullNodeMockRecorder) NetDisconnect(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetDisconnect", reflect.TypeOf((*MockFullNode)(nil).NetDisconnect), arg0, arg1)
+}
+
+// NetFindPeer mocks base method.
+func (m *MockFullNode) NetFindPeer(arg0 context.Context, arg1 peer.ID) (peer.AddrInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetFindPeer", arg0, arg1)
+ ret0, _ := ret[0].(peer.AddrInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetFindPeer indicates an expected call of NetFindPeer.
+func (mr *MockFullNodeMockRecorder) NetFindPeer(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
+}
+
+// NetPeerInfo mocks base method.
+func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetPeerInfo", arg0, arg1)
+ ret0, _ := ret[0].(*api.ExtendedPeerInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetPeerInfo indicates an expected call of NetPeerInfo.
+func (mr *MockFullNodeMockRecorder) NetPeerInfo(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeerInfo", reflect.TypeOf((*MockFullNode)(nil).NetPeerInfo), arg0, arg1)
+}
+
+// NetPeers mocks base method.
+func (m *MockFullNode) NetPeers(arg0 context.Context) ([]peer.AddrInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetPeers", arg0)
+ ret0, _ := ret[0].([]peer.AddrInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetPeers indicates an expected call of NetPeers.
+func (mr *MockFullNodeMockRecorder) NetPeers(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeers", reflect.TypeOf((*MockFullNode)(nil).NetPeers), arg0)
+}
+
+// NetPubsubScores mocks base method.
+func (m *MockFullNode) NetPubsubScores(arg0 context.Context) ([]api.PubsubScore, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "NetPubsubScores", arg0)
+ ret0, _ := ret[0].([]api.PubsubScore)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// NetPubsubScores indicates an expected call of NetPubsubScores.
+func (mr *MockFullNodeMockRecorder) NetPubsubScores(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
+}
+
+// PaychAllocateLane mocks base method.
+func (m *MockFullNode) PaychAllocateLane(arg0 context.Context, arg1 address.Address) (uint64, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychAllocateLane", arg0, arg1)
+ ret0, _ := ret[0].(uint64)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychAllocateLane indicates an expected call of PaychAllocateLane.
+func (mr *MockFullNodeMockRecorder) PaychAllocateLane(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychAllocateLane", reflect.TypeOf((*MockFullNode)(nil).PaychAllocateLane), arg0, arg1)
+}
+
+// PaychAvailableFunds mocks base method.
+func (m *MockFullNode) PaychAvailableFunds(arg0 context.Context, arg1 address.Address) (*api.ChannelAvailableFunds, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychAvailableFunds", arg0, arg1)
+ ret0, _ := ret[0].(*api.ChannelAvailableFunds)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychAvailableFunds indicates an expected call of PaychAvailableFunds.
+func (mr *MockFullNodeMockRecorder) PaychAvailableFunds(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychAvailableFunds", reflect.TypeOf((*MockFullNode)(nil).PaychAvailableFunds), arg0, arg1)
+}
+
+// PaychAvailableFundsByFromTo mocks base method.
+func (m *MockFullNode) PaychAvailableFundsByFromTo(arg0 context.Context, arg1, arg2 address.Address) (*api.ChannelAvailableFunds, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychAvailableFundsByFromTo", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*api.ChannelAvailableFunds)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychAvailableFundsByFromTo indicates an expected call of PaychAvailableFundsByFromTo.
+func (mr *MockFullNodeMockRecorder) PaychAvailableFundsByFromTo(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychAvailableFundsByFromTo", reflect.TypeOf((*MockFullNode)(nil).PaychAvailableFundsByFromTo), arg0, arg1, arg2)
+}
+
+// PaychCollect mocks base method.
+func (m *MockFullNode) PaychCollect(arg0 context.Context, arg1 address.Address) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychCollect", arg0, arg1)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychCollect indicates an expected call of PaychCollect.
+func (mr *MockFullNodeMockRecorder) PaychCollect(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychCollect", reflect.TypeOf((*MockFullNode)(nil).PaychCollect), arg0, arg1)
+}
+
+// PaychGet mocks base method.
+func (m *MockFullNode) PaychGet(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (*api.ChannelInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychGet", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*api.ChannelInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychGet indicates an expected call of PaychGet.
+func (mr *MockFullNodeMockRecorder) PaychGet(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychGet", reflect.TypeOf((*MockFullNode)(nil).PaychGet), arg0, arg1, arg2, arg3)
+}
+
+// PaychGetWaitReady mocks base method.
+func (m *MockFullNode) PaychGetWaitReady(arg0 context.Context, arg1 cid.Cid) (address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychGetWaitReady", arg0, arg1)
+ ret0, _ := ret[0].(address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychGetWaitReady indicates an expected call of PaychGetWaitReady.
+func (mr *MockFullNodeMockRecorder) PaychGetWaitReady(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychGetWaitReady", reflect.TypeOf((*MockFullNode)(nil).PaychGetWaitReady), arg0, arg1)
+}
+
+// PaychList mocks base method.
+func (m *MockFullNode) PaychList(arg0 context.Context) ([]address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychList", arg0)
+ ret0, _ := ret[0].([]address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychList indicates an expected call of PaychList.
+func (mr *MockFullNodeMockRecorder) PaychList(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychList", reflect.TypeOf((*MockFullNode)(nil).PaychList), arg0)
+}
+
+// PaychNewPayment mocks base method.
+func (m *MockFullNode) PaychNewPayment(arg0 context.Context, arg1, arg2 address.Address, arg3 []api.VoucherSpec) (*api.PaymentInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychNewPayment", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*api.PaymentInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychNewPayment indicates an expected call of PaychNewPayment.
+func (mr *MockFullNodeMockRecorder) PaychNewPayment(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychNewPayment", reflect.TypeOf((*MockFullNode)(nil).PaychNewPayment), arg0, arg1, arg2, arg3)
+}
+
+// PaychSettle mocks base method.
+func (m *MockFullNode) PaychSettle(arg0 context.Context, arg1 address.Address) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychSettle", arg0, arg1)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychSettle indicates an expected call of PaychSettle.
+func (mr *MockFullNodeMockRecorder) PaychSettle(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychSettle", reflect.TypeOf((*MockFullNode)(nil).PaychSettle), arg0, arg1)
+}
+
+// PaychStatus mocks base method.
+func (m *MockFullNode) PaychStatus(arg0 context.Context, arg1 address.Address) (*api.PaychStatus, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychStatus", arg0, arg1)
+ ret0, _ := ret[0].(*api.PaychStatus)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychStatus indicates an expected call of PaychStatus.
+func (mr *MockFullNodeMockRecorder) PaychStatus(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychStatus", reflect.TypeOf((*MockFullNode)(nil).PaychStatus), arg0, arg1)
+}
+
+// PaychVoucherAdd mocks base method.
+func (m *MockFullNode) PaychVoucherAdd(arg0 context.Context, arg1 address.Address, arg2 *paych.SignedVoucher, arg3 []byte, arg4 big.Int) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychVoucherAdd", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychVoucherAdd indicates an expected call of PaychVoucherAdd.
+func (mr *MockFullNodeMockRecorder) PaychVoucherAdd(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherAdd", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherAdd), arg0, arg1, arg2, arg3, arg4)
+}
+
+// PaychVoucherCheckSpendable mocks base method.
+func (m *MockFullNode) PaychVoucherCheckSpendable(arg0 context.Context, arg1 address.Address, arg2 *paych.SignedVoucher, arg3, arg4 []byte) (bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychVoucherCheckSpendable", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychVoucherCheckSpendable indicates an expected call of PaychVoucherCheckSpendable.
+func (mr *MockFullNodeMockRecorder) PaychVoucherCheckSpendable(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherCheckSpendable", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherCheckSpendable), arg0, arg1, arg2, arg3, arg4)
+}
+
+// PaychVoucherCheckValid mocks base method.
+func (m *MockFullNode) PaychVoucherCheckValid(arg0 context.Context, arg1 address.Address, arg2 *paych.SignedVoucher) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychVoucherCheckValid", arg0, arg1, arg2)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PaychVoucherCheckValid indicates an expected call of PaychVoucherCheckValid.
+func (mr *MockFullNodeMockRecorder) PaychVoucherCheckValid(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherCheckValid", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherCheckValid), arg0, arg1, arg2)
+}
+
+// PaychVoucherCreate mocks base method.
+func (m *MockFullNode) PaychVoucherCreate(arg0 context.Context, arg1 address.Address, arg2 big.Int, arg3 uint64) (*api.VoucherCreateResult, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychVoucherCreate", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*api.VoucherCreateResult)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychVoucherCreate indicates an expected call of PaychVoucherCreate.
+func (mr *MockFullNodeMockRecorder) PaychVoucherCreate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherCreate", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherCreate), arg0, arg1, arg2, arg3)
+}
+
+// PaychVoucherList mocks base method.
+func (m *MockFullNode) PaychVoucherList(arg0 context.Context, arg1 address.Address) ([]*paych.SignedVoucher, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychVoucherList", arg0, arg1)
+ ret0, _ := ret[0].([]*paych.SignedVoucher)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychVoucherList indicates an expected call of PaychVoucherList.
+func (mr *MockFullNodeMockRecorder) PaychVoucherList(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherList", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherList), arg0, arg1)
+}
+
+// PaychVoucherSubmit mocks base method.
+func (m *MockFullNode) PaychVoucherSubmit(arg0 context.Context, arg1 address.Address, arg2 *paych.SignedVoucher, arg3, arg4 []byte) (cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PaychVoucherSubmit", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PaychVoucherSubmit indicates an expected call of PaychVoucherSubmit.
+func (mr *MockFullNodeMockRecorder) PaychVoucherSubmit(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherSubmit", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherSubmit), arg0, arg1, arg2, arg3, arg4)
+}
+
+// Session mocks base method.
+func (m *MockFullNode) Session(arg0 context.Context) (uuid.UUID, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Session", arg0)
+ ret0, _ := ret[0].(uuid.UUID)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// Session indicates an expected call of Session.
+func (mr *MockFullNodeMockRecorder) Session(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Session", reflect.TypeOf((*MockFullNode)(nil).Session), arg0)
+}
+
+// Shutdown mocks base method.
+func (m *MockFullNode) Shutdown(arg0 context.Context) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Shutdown", arg0)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// Shutdown indicates an expected call of Shutdown.
+func (mr *MockFullNodeMockRecorder) Shutdown(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Shutdown", reflect.TypeOf((*MockFullNode)(nil).Shutdown), arg0)
+}
+
+// StateAccountKey mocks base method.
+func (m *MockFullNode) StateAccountKey(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateAccountKey", arg0, arg1, arg2)
+ ret0, _ := ret[0].(address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateAccountKey indicates an expected call of StateAccountKey.
+func (mr *MockFullNodeMockRecorder) StateAccountKey(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateAccountKey", reflect.TypeOf((*MockFullNode)(nil).StateAccountKey), arg0, arg1, arg2)
+}
+
+// StateAllMinerFaults mocks base method.
+func (m *MockFullNode) StateAllMinerFaults(arg0 context.Context, arg1 abi.ChainEpoch, arg2 types.TipSetKey) ([]*api.Fault, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateAllMinerFaults", arg0, arg1, arg2)
+ ret0, _ := ret[0].([]*api.Fault)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateAllMinerFaults indicates an expected call of StateAllMinerFaults.
+func (mr *MockFullNodeMockRecorder) StateAllMinerFaults(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateAllMinerFaults", reflect.TypeOf((*MockFullNode)(nil).StateAllMinerFaults), arg0, arg1, arg2)
+}
+
+// StateCall mocks base method.
+func (m *MockFullNode) StateCall(arg0 context.Context, arg1 *types.Message, arg2 types.TipSetKey) (*api.InvocResult, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateCall", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*api.InvocResult)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateCall indicates an expected call of StateCall.
+func (mr *MockFullNodeMockRecorder) StateCall(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCall", reflect.TypeOf((*MockFullNode)(nil).StateCall), arg0, arg1, arg2)
+}
+
+// StateChangedActors mocks base method.
+func (m *MockFullNode) StateChangedActors(arg0 context.Context, arg1, arg2 cid.Cid) (map[string]types.Actor, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateChangedActors", arg0, arg1, arg2)
+ ret0, _ := ret[0].(map[string]types.Actor)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateChangedActors indicates an expected call of StateChangedActors.
+func (mr *MockFullNodeMockRecorder) StateChangedActors(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateChangedActors", reflect.TypeOf((*MockFullNode)(nil).StateChangedActors), arg0, arg1, arg2)
+}
+
+// StateCirculatingSupply mocks base method.
+func (m *MockFullNode) StateCirculatingSupply(arg0 context.Context, arg1 types.TipSetKey) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateCirculatingSupply", arg0, arg1)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateCirculatingSupply indicates an expected call of StateCirculatingSupply.
+func (mr *MockFullNodeMockRecorder) StateCirculatingSupply(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCirculatingSupply", reflect.TypeOf((*MockFullNode)(nil).StateCirculatingSupply), arg0, arg1)
+}
+
+// StateCompute mocks base method.
+func (m *MockFullNode) StateCompute(arg0 context.Context, arg1 abi.ChainEpoch, arg2 []*types.Message, arg3 types.TipSetKey) (*api.ComputeStateOutput, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateCompute", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*api.ComputeStateOutput)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateCompute indicates an expected call of StateCompute.
+func (mr *MockFullNodeMockRecorder) StateCompute(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCompute", reflect.TypeOf((*MockFullNode)(nil).StateCompute), arg0, arg1, arg2, arg3)
+}
+
+// StateDealProviderCollateralBounds mocks base method.
+func (m *MockFullNode) StateDealProviderCollateralBounds(arg0 context.Context, arg1 abi.PaddedPieceSize, arg2 bool, arg3 types.TipSetKey) (api.DealCollateralBounds, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateDealProviderCollateralBounds", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(api.DealCollateralBounds)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateDealProviderCollateralBounds indicates an expected call of StateDealProviderCollateralBounds.
+func (mr *MockFullNodeMockRecorder) StateDealProviderCollateralBounds(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateDealProviderCollateralBounds", reflect.TypeOf((*MockFullNode)(nil).StateDealProviderCollateralBounds), arg0, arg1, arg2, arg3)
+}
+
+// StateDecodeParams mocks base method.
+func (m *MockFullNode) StateDecodeParams(arg0 context.Context, arg1 address.Address, arg2 abi.MethodNum, arg3 []byte, arg4 types.TipSetKey) (interface{}, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateDecodeParams", arg0, arg1, arg2, arg3, arg4)
+ ret0, _ := ret[0].(interface{})
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateDecodeParams indicates an expected call of StateDecodeParams.
+func (mr *MockFullNodeMockRecorder) StateDecodeParams(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateDecodeParams", reflect.TypeOf((*MockFullNode)(nil).StateDecodeParams), arg0, arg1, arg2, arg3, arg4)
+}
+
+// StateGetActor mocks base method.
+func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*types.Actor, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateGetActor", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*types.Actor)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateGetActor indicates an expected call of StateGetActor.
+func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
+}
+
+// StateGetReceipt mocks base method.
+func (m *MockFullNode) StateGetReceipt(arg0 context.Context, arg1 cid.Cid, arg2 types.TipSetKey) (*types.MessageReceipt, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateGetReceipt", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*types.MessageReceipt)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateGetReceipt indicates an expected call of StateGetReceipt.
+func (mr *MockFullNodeMockRecorder) StateGetReceipt(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetReceipt", reflect.TypeOf((*MockFullNode)(nil).StateGetReceipt), arg0, arg1, arg2)
+}
+
+// StateListActors mocks base method.
+func (m *MockFullNode) StateListActors(arg0 context.Context, arg1 types.TipSetKey) ([]address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateListActors", arg0, arg1)
+ ret0, _ := ret[0].([]address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateListActors indicates an expected call of StateListActors.
+func (mr *MockFullNodeMockRecorder) StateListActors(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateListActors", reflect.TypeOf((*MockFullNode)(nil).StateListActors), arg0, arg1)
+}
+
+// StateListMessages mocks base method.
+func (m *MockFullNode) StateListMessages(arg0 context.Context, arg1 *api.MessageMatch, arg2 types.TipSetKey, arg3 abi.ChainEpoch) ([]cid.Cid, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateListMessages", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].([]cid.Cid)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateListMessages indicates an expected call of StateListMessages.
+func (mr *MockFullNodeMockRecorder) StateListMessages(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateListMessages", reflect.TypeOf((*MockFullNode)(nil).StateListMessages), arg0, arg1, arg2, arg3)
+}
+
+// StateListMiners mocks base method.
+func (m *MockFullNode) StateListMiners(arg0 context.Context, arg1 types.TipSetKey) ([]address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateListMiners", arg0, arg1)
+ ret0, _ := ret[0].([]address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateListMiners indicates an expected call of StateListMiners.
+func (mr *MockFullNodeMockRecorder) StateListMiners(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateListMiners", reflect.TypeOf((*MockFullNode)(nil).StateListMiners), arg0, arg1)
+}
+
+// StateLookupID mocks base method.
+func (m *MockFullNode) StateLookupID(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateLookupID", arg0, arg1, arg2)
+ ret0, _ := ret[0].(address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateLookupID indicates an expected call of StateLookupID.
+func (mr *MockFullNodeMockRecorder) StateLookupID(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateLookupID", reflect.TypeOf((*MockFullNode)(nil).StateLookupID), arg0, arg1, arg2)
+}
+
+// StateMarketBalance mocks base method.
+func (m *MockFullNode) StateMarketBalance(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MarketBalance, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMarketBalance", arg0, arg1, arg2)
+ ret0, _ := ret[0].(api.MarketBalance)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMarketBalance indicates an expected call of StateMarketBalance.
+func (mr *MockFullNodeMockRecorder) StateMarketBalance(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMarketBalance", reflect.TypeOf((*MockFullNode)(nil).StateMarketBalance), arg0, arg1, arg2)
+}
+
+// StateMarketDeals mocks base method.
+func (m *MockFullNode) StateMarketDeals(arg0 context.Context, arg1 types.TipSetKey) (map[string]api.MarketDeal, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMarketDeals", arg0, arg1)
+ ret0, _ := ret[0].(map[string]api.MarketDeal)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMarketDeals indicates an expected call of StateMarketDeals.
+func (mr *MockFullNodeMockRecorder) StateMarketDeals(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMarketDeals", reflect.TypeOf((*MockFullNode)(nil).StateMarketDeals), arg0, arg1)
+}
+
+// StateMarketParticipants mocks base method.
+func (m *MockFullNode) StateMarketParticipants(arg0 context.Context, arg1 types.TipSetKey) (map[string]api.MarketBalance, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMarketParticipants", arg0, arg1)
+ ret0, _ := ret[0].(map[string]api.MarketBalance)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMarketParticipants indicates an expected call of StateMarketParticipants.
+func (mr *MockFullNodeMockRecorder) StateMarketParticipants(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMarketParticipants", reflect.TypeOf((*MockFullNode)(nil).StateMarketParticipants), arg0, arg1)
+}
+
+// StateMarketStorageDeal mocks base method.
+func (m *MockFullNode) StateMarketStorageDeal(arg0 context.Context, arg1 abi.DealID, arg2 types.TipSetKey) (*api.MarketDeal, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMarketStorageDeal", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*api.MarketDeal)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMarketStorageDeal indicates an expected call of StateMarketStorageDeal.
+func (mr *MockFullNodeMockRecorder) StateMarketStorageDeal(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMarketStorageDeal", reflect.TypeOf((*MockFullNode)(nil).StateMarketStorageDeal), arg0, arg1, arg2)
+}
+
+// StateMinerActiveSectors mocks base method.
+func (m *MockFullNode) StateMinerActiveSectors(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerActiveSectors", arg0, arg1, arg2)
+ ret0, _ := ret[0].([]*miner.SectorOnChainInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerActiveSectors indicates an expected call of StateMinerActiveSectors.
+func (mr *MockFullNodeMockRecorder) StateMinerActiveSectors(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerActiveSectors", reflect.TypeOf((*MockFullNode)(nil).StateMinerActiveSectors), 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()
+ ret := m.ctrl.Call(m, "StateMinerAvailableBalance", arg0, arg1, arg2)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerAvailableBalance indicates an expected call of StateMinerAvailableBalance.
+func (mr *MockFullNodeMockRecorder) StateMinerAvailableBalance(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerAvailableBalance", reflect.TypeOf((*MockFullNode)(nil).StateMinerAvailableBalance), arg0, arg1, arg2)
+}
+
+// StateMinerDeadlines mocks base method.
+func (m *MockFullNode) StateMinerDeadlines(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) ([]api.Deadline, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerDeadlines", arg0, arg1, arg2)
+ ret0, _ := ret[0].([]api.Deadline)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerDeadlines indicates an expected call of StateMinerDeadlines.
+func (mr *MockFullNodeMockRecorder) StateMinerDeadlines(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerDeadlines", reflect.TypeOf((*MockFullNode)(nil).StateMinerDeadlines), arg0, arg1, arg2)
+}
+
+// StateMinerFaults mocks base method.
+func (m *MockFullNode) StateMinerFaults(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (bitfield.BitField, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerFaults", arg0, arg1, arg2)
+ ret0, _ := ret[0].(bitfield.BitField)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerFaults indicates an expected call of StateMinerFaults.
+func (mr *MockFullNodeMockRecorder) StateMinerFaults(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerFaults", reflect.TypeOf((*MockFullNode)(nil).StateMinerFaults), arg0, arg1, arg2)
+}
+
+// StateMinerInfo mocks base method.
+func (m *MockFullNode) StateMinerInfo(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (miner.MinerInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerInfo", arg0, arg1, arg2)
+ ret0, _ := ret[0].(miner.MinerInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerInfo indicates an expected call of StateMinerInfo.
+func (mr *MockFullNodeMockRecorder) StateMinerInfo(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerInfo", reflect.TypeOf((*MockFullNode)(nil).StateMinerInfo), arg0, arg1, arg2)
+}
+
+// StateMinerInitialPledgeCollateral mocks base method.
+func (m *MockFullNode) StateMinerInitialPledgeCollateral(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerInitialPledgeCollateral", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerInitialPledgeCollateral indicates an expected call of StateMinerInitialPledgeCollateral.
+func (mr *MockFullNodeMockRecorder) StateMinerInitialPledgeCollateral(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerInitialPledgeCollateral", reflect.TypeOf((*MockFullNode)(nil).StateMinerInitialPledgeCollateral), arg0, arg1, arg2, arg3)
+}
+
+// StateMinerPartitions mocks base method.
+func (m *MockFullNode) StateMinerPartitions(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 types.TipSetKey) ([]api.Partition, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerPartitions", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].([]api.Partition)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerPartitions indicates an expected call of StateMinerPartitions.
+func (mr *MockFullNodeMockRecorder) StateMinerPartitions(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerPartitions", reflect.TypeOf((*MockFullNode)(nil).StateMinerPartitions), arg0, arg1, arg2, arg3)
+}
+
+// StateMinerPower mocks base method.
+func (m *MockFullNode) StateMinerPower(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*api.MinerPower, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerPower", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*api.MinerPower)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerPower indicates an expected call of StateMinerPower.
+func (mr *MockFullNodeMockRecorder) StateMinerPower(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerPower", reflect.TypeOf((*MockFullNode)(nil).StateMinerPower), arg0, arg1, arg2)
+}
+
+// StateMinerPreCommitDepositForPower mocks base method.
+func (m *MockFullNode) StateMinerPreCommitDepositForPower(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerPreCommitDepositForPower", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerPreCommitDepositForPower indicates an expected call of StateMinerPreCommitDepositForPower.
+func (mr *MockFullNodeMockRecorder) StateMinerPreCommitDepositForPower(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerPreCommitDepositForPower", reflect.TypeOf((*MockFullNode)(nil).StateMinerPreCommitDepositForPower), arg0, arg1, arg2, arg3)
+}
+
+// StateMinerProvingDeadline mocks base method.
+func (m *MockFullNode) StateMinerProvingDeadline(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*dline.Info, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerProvingDeadline", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*dline.Info)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerProvingDeadline indicates an expected call of StateMinerProvingDeadline.
+func (mr *MockFullNodeMockRecorder) StateMinerProvingDeadline(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerProvingDeadline", reflect.TypeOf((*MockFullNode)(nil).StateMinerProvingDeadline), arg0, arg1, arg2)
+}
+
+// StateMinerRecoveries mocks base method.
+func (m *MockFullNode) StateMinerRecoveries(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (bitfield.BitField, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerRecoveries", arg0, arg1, arg2)
+ ret0, _ := ret[0].(bitfield.BitField)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerRecoveries indicates an expected call of StateMinerRecoveries.
+func (mr *MockFullNodeMockRecorder) StateMinerRecoveries(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerRecoveries", reflect.TypeOf((*MockFullNode)(nil).StateMinerRecoveries), arg0, arg1, arg2)
+}
+
+// StateMinerSectorAllocated mocks base method.
+func (m *MockFullNode) StateMinerSectorAllocated(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerSectorAllocated", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerSectorAllocated indicates an expected call of StateMinerSectorAllocated.
+func (mr *MockFullNodeMockRecorder) StateMinerSectorAllocated(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerSectorAllocated", reflect.TypeOf((*MockFullNode)(nil).StateMinerSectorAllocated), arg0, arg1, arg2, arg3)
+}
+
+// StateMinerSectorCount mocks base method.
+func (m *MockFullNode) StateMinerSectorCount(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MinerSectors, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerSectorCount", arg0, arg1, arg2)
+ ret0, _ := ret[0].(api.MinerSectors)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerSectorCount indicates an expected call of StateMinerSectorCount.
+func (mr *MockFullNodeMockRecorder) StateMinerSectorCount(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerSectorCount", reflect.TypeOf((*MockFullNode)(nil).StateMinerSectorCount), arg0, arg1, arg2)
+}
+
+// StateMinerSectors mocks base method.
+func (m *MockFullNode) StateMinerSectors(arg0 context.Context, arg1 address.Address, arg2 *bitfield.BitField, arg3 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateMinerSectors", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].([]*miner.SectorOnChainInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateMinerSectors indicates an expected call of StateMinerSectors.
+func (mr *MockFullNodeMockRecorder) StateMinerSectors(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerSectors", reflect.TypeOf((*MockFullNode)(nil).StateMinerSectors), arg0, arg1, arg2, arg3)
+}
+
+// StateNetworkName mocks base method.
+func (m *MockFullNode) StateNetworkName(arg0 context.Context) (dtypes.NetworkName, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateNetworkName", arg0)
+ ret0, _ := ret[0].(dtypes.NetworkName)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateNetworkName indicates an expected call of StateNetworkName.
+func (mr *MockFullNodeMockRecorder) StateNetworkName(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateNetworkName", reflect.TypeOf((*MockFullNode)(nil).StateNetworkName), arg0)
+}
+
+// StateNetworkVersion mocks base method.
+func (m *MockFullNode) StateNetworkVersion(arg0 context.Context, arg1 types.TipSetKey) (network.Version, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateNetworkVersion", arg0, arg1)
+ ret0, _ := ret[0].(network.Version)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateNetworkVersion indicates an expected call of StateNetworkVersion.
+func (mr *MockFullNodeMockRecorder) StateNetworkVersion(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateNetworkVersion", reflect.TypeOf((*MockFullNode)(nil).StateNetworkVersion), arg0, arg1)
+}
+
+// StateReadState mocks base method.
+func (m *MockFullNode) StateReadState(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*api.ActorState, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateReadState", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*api.ActorState)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateReadState indicates an expected call of StateReadState.
+func (mr *MockFullNodeMockRecorder) StateReadState(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateReadState", reflect.TypeOf((*MockFullNode)(nil).StateReadState), arg0, arg1, arg2)
+}
+
+// StateReplay mocks base method.
+func (m *MockFullNode) StateReplay(arg0 context.Context, arg1 types.TipSetKey, arg2 cid.Cid) (*api.InvocResult, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateReplay", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*api.InvocResult)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateReplay indicates an expected call of StateReplay.
+func (mr *MockFullNodeMockRecorder) StateReplay(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateReplay", reflect.TypeOf((*MockFullNode)(nil).StateReplay), arg0, arg1, arg2)
+}
+
+// StateSearchMsg mocks base method.
+func (m *MockFullNode) StateSearchMsg(arg0 context.Context, arg1 cid.Cid) (*api.MsgLookup, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateSearchMsg", arg0, arg1)
+ ret0, _ := ret[0].(*api.MsgLookup)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateSearchMsg indicates an expected call of StateSearchMsg.
+func (mr *MockFullNodeMockRecorder) StateSearchMsg(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSearchMsg", reflect.TypeOf((*MockFullNode)(nil).StateSearchMsg), arg0, arg1)
+}
+
+// StateSearchMsgLimited mocks base method.
+func (m *MockFullNode) StateSearchMsgLimited(arg0 context.Context, arg1 cid.Cid, arg2 abi.ChainEpoch) (*api.MsgLookup, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateSearchMsgLimited", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*api.MsgLookup)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateSearchMsgLimited indicates an expected call of StateSearchMsgLimited.
+func (mr *MockFullNodeMockRecorder) StateSearchMsgLimited(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSearchMsgLimited", reflect.TypeOf((*MockFullNode)(nil).StateSearchMsgLimited), arg0, arg1, arg2)
+}
+
+// StateSectorExpiration mocks base method.
+func (m *MockFullNode) StateSectorExpiration(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorExpiration, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateSectorExpiration", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*miner.SectorExpiration)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateSectorExpiration indicates an expected call of StateSectorExpiration.
+func (mr *MockFullNodeMockRecorder) StateSectorExpiration(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSectorExpiration", reflect.TypeOf((*MockFullNode)(nil).StateSectorExpiration), arg0, arg1, arg2, arg3)
+}
+
+// StateSectorGetInfo mocks base method.
+func (m *MockFullNode) StateSectorGetInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorOnChainInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateSectorGetInfo", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*miner.SectorOnChainInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateSectorGetInfo indicates an expected call of StateSectorGetInfo.
+func (mr *MockFullNodeMockRecorder) StateSectorGetInfo(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSectorGetInfo", reflect.TypeOf((*MockFullNode)(nil).StateSectorGetInfo), arg0, arg1, arg2, arg3)
+}
+
+// StateSectorPartition mocks base method.
+func (m *MockFullNode) StateSectorPartition(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorLocation, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateSectorPartition", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*miner.SectorLocation)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateSectorPartition indicates an expected call of StateSectorPartition.
+func (mr *MockFullNodeMockRecorder) StateSectorPartition(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSectorPartition", reflect.TypeOf((*MockFullNode)(nil).StateSectorPartition), arg0, arg1, arg2, arg3)
+}
+
+// StateSectorPreCommitInfo mocks base method.
+func (m *MockFullNode) StateSectorPreCommitInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateSectorPreCommitInfo", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(miner.SectorPreCommitOnChainInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateSectorPreCommitInfo indicates an expected call of StateSectorPreCommitInfo.
+func (mr *MockFullNodeMockRecorder) StateSectorPreCommitInfo(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSectorPreCommitInfo", reflect.TypeOf((*MockFullNode)(nil).StateSectorPreCommitInfo), arg0, arg1, arg2, arg3)
+}
+
+// StateVMCirculatingSupplyInternal mocks base method.
+func (m *MockFullNode) StateVMCirculatingSupplyInternal(arg0 context.Context, arg1 types.TipSetKey) (api.CirculatingSupply, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateVMCirculatingSupplyInternal", arg0, arg1)
+ ret0, _ := ret[0].(api.CirculatingSupply)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateVMCirculatingSupplyInternal indicates an expected call of StateVMCirculatingSupplyInternal.
+func (mr *MockFullNodeMockRecorder) StateVMCirculatingSupplyInternal(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVMCirculatingSupplyInternal", reflect.TypeOf((*MockFullNode)(nil).StateVMCirculatingSupplyInternal), arg0, arg1)
+}
+
+// StateVerifiedClientStatus mocks base method.
+func (m *MockFullNode) StateVerifiedClientStatus(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateVerifiedClientStatus", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateVerifiedClientStatus indicates an expected call of StateVerifiedClientStatus.
+func (mr *MockFullNodeMockRecorder) StateVerifiedClientStatus(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVerifiedClientStatus", reflect.TypeOf((*MockFullNode)(nil).StateVerifiedClientStatus), arg0, arg1, arg2)
+}
+
+// StateVerifiedRegistryRootKey mocks base method.
+func (m *MockFullNode) StateVerifiedRegistryRootKey(arg0 context.Context, arg1 types.TipSetKey) (address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateVerifiedRegistryRootKey", arg0, arg1)
+ ret0, _ := ret[0].(address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateVerifiedRegistryRootKey indicates an expected call of StateVerifiedRegistryRootKey.
+func (mr *MockFullNodeMockRecorder) StateVerifiedRegistryRootKey(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVerifiedRegistryRootKey", reflect.TypeOf((*MockFullNode)(nil).StateVerifiedRegistryRootKey), arg0, arg1)
+}
+
+// StateVerifierStatus mocks base method.
+func (m *MockFullNode) StateVerifierStatus(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateVerifierStatus", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateVerifierStatus indicates an expected call of StateVerifierStatus.
+func (mr *MockFullNodeMockRecorder) StateVerifierStatus(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVerifierStatus", reflect.TypeOf((*MockFullNode)(nil).StateVerifierStatus), arg0, arg1, arg2)
+}
+
+// StateWaitMsg mocks base method.
+func (m *MockFullNode) StateWaitMsg(arg0 context.Context, arg1 cid.Cid, arg2 uint64) (*api.MsgLookup, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateWaitMsg", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*api.MsgLookup)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateWaitMsg indicates an expected call of StateWaitMsg.
+func (mr *MockFullNodeMockRecorder) StateWaitMsg(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateWaitMsg", reflect.TypeOf((*MockFullNode)(nil).StateWaitMsg), arg0, arg1, arg2)
+}
+
+// StateWaitMsgLimited mocks base method.
+func (m *MockFullNode) StateWaitMsgLimited(arg0 context.Context, arg1 cid.Cid, arg2 uint64, arg3 abi.ChainEpoch) (*api.MsgLookup, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StateWaitMsgLimited", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(*api.MsgLookup)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StateWaitMsgLimited indicates an expected call of StateWaitMsgLimited.
+func (mr *MockFullNodeMockRecorder) StateWaitMsgLimited(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateWaitMsgLimited", reflect.TypeOf((*MockFullNode)(nil).StateWaitMsgLimited), arg0, arg1, arg2, arg3)
+}
+
+// SyncCheckBad mocks base method.
+func (m *MockFullNode) SyncCheckBad(arg0 context.Context, arg1 cid.Cid) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "SyncCheckBad", arg0, arg1)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// SyncCheckBad indicates an expected call of SyncCheckBad.
+func (mr *MockFullNodeMockRecorder) SyncCheckBad(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCheckBad", reflect.TypeOf((*MockFullNode)(nil).SyncCheckBad), arg0, arg1)
+}
+
+// SyncCheckpoint mocks base method.
+func (m *MockFullNode) SyncCheckpoint(arg0 context.Context, arg1 types.TipSetKey) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "SyncCheckpoint", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// SyncCheckpoint indicates an expected call of SyncCheckpoint.
+func (mr *MockFullNodeMockRecorder) SyncCheckpoint(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCheckpoint", reflect.TypeOf((*MockFullNode)(nil).SyncCheckpoint), arg0, arg1)
+}
+
+// SyncIncomingBlocks mocks base method.
+func (m *MockFullNode) SyncIncomingBlocks(arg0 context.Context) (<-chan *types.BlockHeader, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "SyncIncomingBlocks", arg0)
+ ret0, _ := ret[0].(<-chan *types.BlockHeader)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// SyncIncomingBlocks indicates an expected call of SyncIncomingBlocks.
+func (mr *MockFullNodeMockRecorder) SyncIncomingBlocks(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncIncomingBlocks", reflect.TypeOf((*MockFullNode)(nil).SyncIncomingBlocks), arg0)
+}
+
+// SyncMarkBad mocks base method.
+func (m *MockFullNode) SyncMarkBad(arg0 context.Context, arg1 cid.Cid) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "SyncMarkBad", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// SyncMarkBad indicates an expected call of SyncMarkBad.
+func (mr *MockFullNodeMockRecorder) SyncMarkBad(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMarkBad", reflect.TypeOf((*MockFullNode)(nil).SyncMarkBad), arg0, arg1)
+}
+
+// SyncState mocks base method.
+func (m *MockFullNode) SyncState(arg0 context.Context) (*api.SyncState, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "SyncState", arg0)
+ ret0, _ := ret[0].(*api.SyncState)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// SyncState indicates an expected call of SyncState.
+func (mr *MockFullNodeMockRecorder) SyncState(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncState", reflect.TypeOf((*MockFullNode)(nil).SyncState), arg0)
+}
+
+// SyncSubmitBlock mocks base method.
+func (m *MockFullNode) SyncSubmitBlock(arg0 context.Context, arg1 *types.BlockMsg) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "SyncSubmitBlock", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// SyncSubmitBlock indicates an expected call of SyncSubmitBlock.
+func (mr *MockFullNodeMockRecorder) SyncSubmitBlock(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubmitBlock", reflect.TypeOf((*MockFullNode)(nil).SyncSubmitBlock), arg0, arg1)
+}
+
+// SyncUnmarkAllBad mocks base method.
+func (m *MockFullNode) SyncUnmarkAllBad(arg0 context.Context) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "SyncUnmarkAllBad", arg0)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// SyncUnmarkAllBad indicates an expected call of SyncUnmarkAllBad.
+func (mr *MockFullNodeMockRecorder) SyncUnmarkAllBad(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncUnmarkAllBad", reflect.TypeOf((*MockFullNode)(nil).SyncUnmarkAllBad), arg0)
+}
+
+// SyncUnmarkBad mocks base method.
+func (m *MockFullNode) SyncUnmarkBad(arg0 context.Context, arg1 cid.Cid) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "SyncUnmarkBad", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// SyncUnmarkBad indicates an expected call of SyncUnmarkBad.
+func (mr *MockFullNodeMockRecorder) SyncUnmarkBad(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncUnmarkBad", reflect.TypeOf((*MockFullNode)(nil).SyncUnmarkBad), arg0, arg1)
+}
+
+// SyncValidateTipset mocks base method.
+func (m *MockFullNode) SyncValidateTipset(arg0 context.Context, arg1 types.TipSetKey) (bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "SyncValidateTipset", arg0, arg1)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// SyncValidateTipset indicates an expected call of SyncValidateTipset.
+func (mr *MockFullNodeMockRecorder) SyncValidateTipset(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncValidateTipset", reflect.TypeOf((*MockFullNode)(nil).SyncValidateTipset), arg0, arg1)
+}
+
+// Version mocks base method.
+func (m *MockFullNode) Version(arg0 context.Context) (api.APIVersion, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Version", arg0)
+ ret0, _ := ret[0].(api.APIVersion)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// Version indicates an expected call of Version.
+func (mr *MockFullNodeMockRecorder) Version(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockFullNode)(nil).Version), arg0)
+}
+
+// WalletBalance mocks base method.
+func (m *MockFullNode) WalletBalance(arg0 context.Context, arg1 address.Address) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletBalance", arg0, arg1)
+ ret0, _ := ret[0].(big.Int)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletBalance indicates an expected call of WalletBalance.
+func (mr *MockFullNodeMockRecorder) WalletBalance(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletBalance", reflect.TypeOf((*MockFullNode)(nil).WalletBalance), arg0, arg1)
+}
+
+// WalletDefaultAddress mocks base method.
+func (m *MockFullNode) WalletDefaultAddress(arg0 context.Context) (address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletDefaultAddress", arg0)
+ ret0, _ := ret[0].(address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletDefaultAddress indicates an expected call of WalletDefaultAddress.
+func (mr *MockFullNodeMockRecorder) WalletDefaultAddress(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletDefaultAddress", reflect.TypeOf((*MockFullNode)(nil).WalletDefaultAddress), arg0)
+}
+
+// WalletDelete mocks base method.
+func (m *MockFullNode) WalletDelete(arg0 context.Context, arg1 address.Address) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletDelete", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// WalletDelete indicates an expected call of WalletDelete.
+func (mr *MockFullNodeMockRecorder) WalletDelete(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletDelete", reflect.TypeOf((*MockFullNode)(nil).WalletDelete), arg0, arg1)
+}
+
+// WalletExport mocks base method.
+func (m *MockFullNode) WalletExport(arg0 context.Context, arg1 address.Address) (*types.KeyInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletExport", arg0, arg1)
+ ret0, _ := ret[0].(*types.KeyInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletExport indicates an expected call of WalletExport.
+func (mr *MockFullNodeMockRecorder) WalletExport(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletExport", reflect.TypeOf((*MockFullNode)(nil).WalletExport), arg0, arg1)
+}
+
+// WalletHas mocks base method.
+func (m *MockFullNode) WalletHas(arg0 context.Context, arg1 address.Address) (bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletHas", arg0, arg1)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletHas indicates an expected call of WalletHas.
+func (mr *MockFullNodeMockRecorder) WalletHas(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletHas", reflect.TypeOf((*MockFullNode)(nil).WalletHas), arg0, arg1)
+}
+
+// WalletImport mocks base method.
+func (m *MockFullNode) WalletImport(arg0 context.Context, arg1 *types.KeyInfo) (address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletImport", arg0, arg1)
+ ret0, _ := ret[0].(address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletImport indicates an expected call of WalletImport.
+func (mr *MockFullNodeMockRecorder) WalletImport(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletImport", reflect.TypeOf((*MockFullNode)(nil).WalletImport), arg0, arg1)
+}
+
+// WalletList mocks base method.
+func (m *MockFullNode) WalletList(arg0 context.Context) ([]address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletList", arg0)
+ ret0, _ := ret[0].([]address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletList indicates an expected call of WalletList.
+func (mr *MockFullNodeMockRecorder) WalletList(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletList", reflect.TypeOf((*MockFullNode)(nil).WalletList), arg0)
+}
+
+// WalletNew mocks base method.
+func (m *MockFullNode) WalletNew(arg0 context.Context, arg1 types.KeyType) (address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletNew", arg0, arg1)
+ ret0, _ := ret[0].(address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletNew indicates an expected call of WalletNew.
+func (mr *MockFullNodeMockRecorder) WalletNew(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletNew", reflect.TypeOf((*MockFullNode)(nil).WalletNew), arg0, arg1)
+}
+
+// WalletSetDefault mocks base method.
+func (m *MockFullNode) WalletSetDefault(arg0 context.Context, arg1 address.Address) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletSetDefault", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// WalletSetDefault indicates an expected call of WalletSetDefault.
+func (mr *MockFullNodeMockRecorder) WalletSetDefault(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletSetDefault", reflect.TypeOf((*MockFullNode)(nil).WalletSetDefault), arg0, arg1)
+}
+
+// WalletSign mocks base method.
+func (m *MockFullNode) WalletSign(arg0 context.Context, arg1 address.Address, arg2 []byte) (*crypto.Signature, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletSign", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*crypto.Signature)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletSign indicates an expected call of WalletSign.
+func (mr *MockFullNodeMockRecorder) WalletSign(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletSign", reflect.TypeOf((*MockFullNode)(nil).WalletSign), arg0, arg1, arg2)
+}
+
+// WalletSignMessage mocks base method.
+func (m *MockFullNode) WalletSignMessage(arg0 context.Context, arg1 address.Address, arg2 *types.Message) (*types.SignedMessage, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletSignMessage", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*types.SignedMessage)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletSignMessage indicates an expected call of WalletSignMessage.
+func (mr *MockFullNodeMockRecorder) WalletSignMessage(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletSignMessage", reflect.TypeOf((*MockFullNode)(nil).WalletSignMessage), arg0, arg1, arg2)
+}
+
+// WalletValidateAddress mocks base method.
+func (m *MockFullNode) WalletValidateAddress(arg0 context.Context, arg1 string) (address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletValidateAddress", arg0, arg1)
+ ret0, _ := ret[0].(address.Address)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletValidateAddress indicates an expected call of WalletValidateAddress.
+func (mr *MockFullNodeMockRecorder) WalletValidateAddress(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletValidateAddress", reflect.TypeOf((*MockFullNode)(nil).WalletValidateAddress), arg0, arg1)
+}
+
+// WalletVerify mocks base method.
+func (m *MockFullNode) WalletVerify(arg0 context.Context, arg1 address.Address, arg2 []byte, arg3 *crypto.Signature) (bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "WalletVerify", arg0, arg1, arg2, arg3)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// WalletVerify indicates an expected call of WalletVerify.
+func (mr *MockFullNodeMockRecorder) WalletVerify(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletVerify", reflect.TypeOf((*MockFullNode)(nil).WalletVerify), arg0, arg1, arg2, arg3)
+}
diff --git a/api/v0api/v1_wrapper.go b/api/v0api/v1_wrapper.go
new file mode 100644
index 000000000..ff4474fe5
--- /dev/null
+++ b/api/v0api/v1_wrapper.go
@@ -0,0 +1,187 @@
+package v0api
+
+import (
+ "context"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/lotus/chain/types"
+ "golang.org/x/xerrors"
+
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/go-state-types/abi"
+
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v1api"
+)
+
+type WrapperV1Full struct {
+ v1api.FullNode
+}
+
+func (w *WrapperV1Full) StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) {
+ return w.FullNode.StateSearchMsg(ctx, types.EmptyTSK, msg, api.LookbackNoLimit, true)
+}
+
+func (w *WrapperV1Full) StateSearchMsgLimited(ctx context.Context, msg cid.Cid, limit abi.ChainEpoch) (*api.MsgLookup, error) {
+ return w.FullNode.StateSearchMsg(ctx, types.EmptyTSK, msg, limit, true)
+}
+
+func (w *WrapperV1Full) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error) {
+ return w.FullNode.StateWaitMsg(ctx, msg, confidence, api.LookbackNoLimit, true)
+}
+
+func (w *WrapperV1Full) StateWaitMsgLimited(ctx context.Context, msg cid.Cid, confidence uint64, limit abi.ChainEpoch) (*api.MsgLookup, error) {
+ return w.FullNode.StateWaitMsg(ctx, msg, confidence, limit, true)
+}
+
+func (w *WrapperV1Full) StateGetReceipt(ctx context.Context, msg cid.Cid, from types.TipSetKey) (*types.MessageReceipt, error) {
+ ml, err := w.FullNode.StateSearchMsg(ctx, from, msg, api.LookbackNoLimit, true)
+ if err != nil {
+ return nil, err
+ }
+
+ if ml == nil {
+ return nil, nil
+ }
+
+ return &ml.Receipt, nil
+}
+
+func (w *WrapperV1Full) Version(ctx context.Context) (api.APIVersion, error) {
+ ver, err := w.FullNode.Version(ctx)
+ if err != nil {
+ return api.APIVersion{}, err
+ }
+
+ ver.APIVersion = api.FullAPIVersion0
+
+ return ver, nil
+}
+
+func (w *WrapperV1Full) executePrototype(ctx context.Context, p *api.MessagePrototype) (cid.Cid, error) {
+ sm, err := w.FullNode.MpoolPushMessage(ctx, &p.Message, nil)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("pushing message: %w", err)
+ }
+
+ return sm.Cid(), nil
+}
+func (w *WrapperV1Full) MsigCreate(ctx context.Context, req uint64, addrs []address.Address, duration abi.ChainEpoch, val types.BigInt, src address.Address, gp types.BigInt) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigCreate(ctx, req, addrs, duration, val, src, gp)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigPropose(ctx context.Context, msig address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigPropose(ctx, msig, to, amt, src, method, params)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+func (w *WrapperV1Full) MsigApprove(ctx context.Context, msig address.Address, txID uint64, src address.Address) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigApprove(ctx, msig, txID, src)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigApproveTxnHash(ctx context.Context, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
+ p, err := w.FullNode.MsigApproveTxnHash(ctx, msig, txID, proposer, to, amt, src, method, params)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
+ p, err := w.FullNode.MsigCancel(ctx, msig, txID, to, amt, src, method, params)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigAddPropose(ctx context.Context, msig address.Address, src address.Address, newAdd address.Address, inc bool) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigAddPropose(ctx, msig, src, newAdd, inc)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigAddApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, newAdd address.Address, inc bool) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigAddApprove(ctx, msig, src, txID, proposer, newAdd, inc)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigAddCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, newAdd address.Address, inc bool) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigAddCancel(ctx, msig, src, txID, newAdd, inc)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigSwapPropose(ctx context.Context, msig address.Address, src address.Address, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigSwapPropose(ctx, msig, src, oldAdd, newAdd)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigSwapApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigSwapApprove(ctx, msig, src, txID, proposer, oldAdd, newAdd)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigSwapCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigSwapCancel(ctx, msig, src, txID, oldAdd, newAdd)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+func (w *WrapperV1Full) MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) {
+
+ p, err := w.FullNode.MsigRemoveSigner(ctx, msig, proposer, toRemove, decrease)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
+ }
+
+ return w.executePrototype(ctx, p)
+}
+
+var _ FullNode = &WrapperV1Full{}
diff --git a/api/v1api/latest.go b/api/v1api/latest.go
new file mode 100644
index 000000000..6f57d8826
--- /dev/null
+++ b/api/v1api/latest.go
@@ -0,0 +1,12 @@
+package v1api
+
+import (
+ "github.com/filecoin-project/lotus/api"
+)
+
+type FullNode = api.FullNode
+type FullNodeStruct = api.FullNodeStruct
+
+func PermissionedFullAPI(a FullNode) FullNode {
+ return api.PermissionedFullAPI(a)
+}
diff --git a/api/version.go b/api/version.go
index f1b0b3b9a..e8011204d 100644
--- a/api/version.go
+++ b/api/version.go
@@ -42,11 +42,11 @@ var RunningNodeType NodeType
func VersionForType(nodeType NodeType) (Version, error) {
switch nodeType {
case NodeFull:
- return FullAPIVersion, nil
+ return FullAPIVersion1, nil
case NodeMiner:
- return MinerAPIVersion, nil
+ return MinerAPIVersion0, nil
case NodeWorker:
- return WorkerAPIVersion, nil
+ return WorkerAPIVersion0, nil
default:
return Version(0), xerrors.Errorf("unknown node type %d", nodeType)
}
@@ -54,9 +54,11 @@ func VersionForType(nodeType NodeType) (Version, error) {
// semver versions of the rpc api exposed
var (
- FullAPIVersion = newVer(1, 2, 0)
- MinerAPIVersion = newVer(1, 0, 1)
- WorkerAPIVersion = newVer(1, 0, 0)
+ FullAPIVersion0 = newVer(1, 3, 0)
+ FullAPIVersion1 = newVer(2, 1, 0)
+
+ MinerAPIVersion0 = newVer(1, 1, 0)
+ WorkerAPIVersion0 = newVer(1, 1, 0)
)
//nolint:varcheck,deadcode
diff --git a/api/wrap.go b/api/wrap.go
new file mode 100644
index 000000000..1ded67132
--- /dev/null
+++ b/api/wrap.go
@@ -0,0 +1,32 @@
+package api
+
+import (
+ "reflect"
+)
+
+// Wrap adapts partial api impl to another version
+// proxyT is the proxy type used as input in wrapperT
+// Usage: Wrap(new(v1api.FullNodeStruct), new(v0api.WrapperV1Full), eventsApi).(EventAPI)
+func Wrap(proxyT, wrapperT, impl interface{}) interface{} {
+ proxy := reflect.New(reflect.TypeOf(proxyT).Elem())
+ proxyMethods := proxy.Elem().FieldByName("Internal")
+ ri := reflect.ValueOf(impl)
+
+ for i := 0; i < ri.NumMethod(); i++ {
+ mt := ri.Type().Method(i)
+ if proxyMethods.FieldByName(mt.Name).Kind() == reflect.Invalid {
+ continue
+ }
+
+ fn := ri.Method(i)
+ of := proxyMethods.FieldByName(mt.Name)
+
+ proxyMethods.FieldByName(mt.Name).Set(reflect.MakeFunc(of.Type(), func(args []reflect.Value) (results []reflect.Value) {
+ return fn.Call(args)
+ }))
+ }
+
+ wp := reflect.New(reflect.TypeOf(wrapperT).Elem())
+ wp.Elem().Field(0).Set(proxy)
+ return wp.Interface()
+}
diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go
index 23b2d3427..f6d26bbdd 100644
--- a/blockstore/splitstore/splitstore.go
+++ b/blockstore/splitstore/splitstore.go
@@ -406,6 +406,11 @@ func (s *SplitStore) Close() error {
}
func (s *SplitStore) HeadChange(_, apply []*types.TipSet) error {
+ // Revert only.
+ if len(apply) == 0 {
+ return nil
+ }
+
s.mx.Lock()
curTs := apply[len(apply)-1]
epoch := curTs.Height()
diff --git a/blockstore/splitstore/splitstore_test.go b/blockstore/splitstore/splitstore_test.go
index e5314b80f..dcaf27647 100644
--- a/blockstore/splitstore/splitstore_test.go
+++ b/blockstore/splitstore/splitstore_test.go
@@ -27,7 +27,7 @@ func init() {
}
func testSplitStore(t *testing.T, cfg *Config) {
- chain := &mockChain{}
+ chain := &mockChain{t: t}
// genesis
genBlock := mock.MkBlock(nil, 0, 0)
genTs := mock.TipSet(genBlock)
@@ -169,6 +169,9 @@ func testSplitStore(t *testing.T, cfg *Config) {
t.Errorf("expected %d hot blocks, but got %d", 7, hotCnt)
}
}
+
+ // Make sure we can revert without panicking.
+ chain.revert(2)
}
func TestSplitStoreSimpleCompaction(t *testing.T) {
@@ -191,6 +194,8 @@ func TestSplitStoreFullCompactionWithGC(t *testing.T) {
}
type mockChain struct {
+ t testing.TB
+
sync.Mutex
tipsets []*types.TipSet
listener func(revert []*types.TipSet, apply []*types.TipSet) error
@@ -204,7 +209,26 @@ func (c *mockChain) push(ts *types.TipSet) {
if c.listener != nil {
err := c.listener(nil, []*types.TipSet{ts})
if err != nil {
- log.Errorf("mockchain: error dispatching listener: %s", err)
+ c.t.Errorf("mockchain: error dispatching listener: %s", err)
+ }
+ }
+}
+
+func (c *mockChain) revert(count int) {
+ c.Lock()
+ revert := make([]*types.TipSet, count)
+ if count > len(c.tipsets) {
+ c.Unlock()
+ c.t.Fatalf("not enough tipsets to revert")
+ }
+ copy(revert, c.tipsets[len(c.tipsets)-count:])
+ c.tipsets = c.tipsets[:len(c.tipsets)-count]
+ c.Unlock()
+
+ if c.listener != nil {
+ err := c.listener(revert, nil)
+ if err != nil {
+ c.t.Errorf("mockchain: error dispatching listener: %s", err)
}
}
}
diff --git a/build/bootstrap.go b/build/bootstrap.go
index cd72cfd1b..98fa2e2f9 100644
--- a/build/bootstrap.go
+++ b/build/bootstrap.go
@@ -2,28 +2,32 @@ package build
import (
"context"
+ "embed"
+ "path"
"strings"
"github.com/filecoin-project/lotus/lib/addrutil"
- rice "github.com/GeertJohan/go.rice"
"github.com/libp2p/go-libp2p-core/peer"
)
+//go:embed bootstrap
+var bootstrapfs embed.FS
+
func BuiltinBootstrap() ([]peer.AddrInfo, error) {
if DisableBuiltinAssets {
return nil, nil
}
-
- b := rice.MustFindBox("bootstrap")
-
if BootstrappersFile != "" {
- spi := b.MustString(BootstrappersFile)
- if spi == "" {
+ spi, err := bootstrapfs.ReadFile(path.Join("bootstrap", BootstrappersFile))
+ if err != nil {
+ return nil, err
+ }
+ if len(spi) == 0 {
return nil, nil
}
- return addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(spi), "\n"))
+ return addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(string(spi)), "\n"))
}
return nil, nil
diff --git a/build/bootstrap/butterflynet.pi b/build/bootstrap/butterflynet.pi
index 0de3043a3..cc4ce4f1d 100644
--- a/build/bootstrap/butterflynet.pi
+++ b/build/bootstrap/butterflynet.pi
@@ -1,2 +1,2 @@
-/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWRkaF18SR3E6qL6dkGrozT8QJUV5VbhE9E7BZtPmHqdWJ
-/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWJcJUc23WJjJHGSboGcU3t76z9Lb7CghrH2tiBiDCY4ux
+/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWBbZd7Su9XfLUQ12RynGQ3ZmGY1nGqFntmqop9pLNJE6g
+/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWGKRzEY4tJFTmAmrYUpa1CVVohmV9YjJbC9v5XWY2gUji
diff --git a/build/bootstrap/interopnet.pi b/build/bootstrap/interopnet.pi
new file mode 100644
index 000000000..112d96113
--- /dev/null
+++ b/build/bootstrap/interopnet.pi
@@ -0,0 +1,2 @@
+/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWN86wA54r3v9M8bBYbc1vK9W1ehHDxVGPRaoeUYuXF8R7
+/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWNZ41kev8mtBZgWe43qam1VX9pJyf87jnaisQP2urZZ2M
diff --git a/build/genesis.go b/build/genesis.go
index 812f5a9df..6d94b38cf 100644
--- a/build/genesis.go
+++ b/build/genesis.go
@@ -1,23 +1,23 @@
package build
import (
- rice "github.com/GeertJohan/go.rice"
+ "embed"
+ "path"
+
logging "github.com/ipfs/go-log/v2"
)
// moved from now-defunct build/paramfetch.go
var log = logging.Logger("build")
+//go:embed genesis
+var genesisfs embed.FS
+
func MaybeGenesis() []byte {
- builtinGen, err := rice.FindBox("genesis")
+ genBytes, err := genesisfs.ReadFile(path.Join("genesis", GenesisFile))
if err != nil {
log.Warnf("loading built-in genesis: %s", err)
return nil
}
- genBytes, err := builtinGen.Bytes(GenesisFile)
- if err != nil {
- log.Warnf("loading built-in genesis: %s", err)
- }
-
return genBytes
}
diff --git a/build/genesis/butterflynet.car b/build/genesis/butterflynet.car
index 6654d7195..7c2d19251 100644
Binary files a/build/genesis/butterflynet.car and b/build/genesis/butterflynet.car differ
diff --git a/build/genesis/interopnet.car b/build/genesis/interopnet.car
new file mode 100644
index 000000000..80ecd6e72
Binary files /dev/null and b/build/genesis/interopnet.car differ
diff --git a/build/openrpc.go b/build/openrpc.go
index 0f514c8aa..ac951c172 100644
--- a/build/openrpc.go
+++ b/build/openrpc.go
@@ -3,13 +3,15 @@ package build
import (
"bytes"
"compress/gzip"
+ "embed"
"encoding/json"
- rice "github.com/GeertJohan/go.rice"
-
apitypes "github.com/filecoin-project/lotus/api/types"
)
+//go:embed openrpc
+var openrpcfs embed.FS
+
func mustReadGzippedOpenRPCDocument(data []byte) apitypes.OpenRPCDocument {
zr, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil {
@@ -28,16 +30,25 @@ func mustReadGzippedOpenRPCDocument(data []byte) apitypes.OpenRPCDocument {
}
func OpenRPCDiscoverJSON_Full() apitypes.OpenRPCDocument {
- data := rice.MustFindBox("openrpc").MustBytes("full.json.gz")
+ data, err := openrpcfs.ReadFile("openrpc/full.json.gz")
+ if err != nil {
+ panic(err)
+ }
return mustReadGzippedOpenRPCDocument(data)
}
func OpenRPCDiscoverJSON_Miner() apitypes.OpenRPCDocument {
- data := rice.MustFindBox("openrpc").MustBytes("miner.json.gz")
+ data, err := openrpcfs.ReadFile("openrpc/miner.json.gz")
+ if err != nil {
+ panic(err)
+ }
return mustReadGzippedOpenRPCDocument(data)
}
func OpenRPCDiscoverJSON_Worker() apitypes.OpenRPCDocument {
- data := rice.MustFindBox("openrpc").MustBytes("worker.json.gz")
+ data, err := openrpcfs.ReadFile("openrpc/worker.json.gz")
+ if err != nil {
+ panic(err)
+ }
return mustReadGzippedOpenRPCDocument(data)
}
diff --git a/build/openrpc/full.json.gz b/build/openrpc/full.json.gz
index 388ae3027..4490109e9 100644
Binary files a/build/openrpc/full.json.gz and b/build/openrpc/full.json.gz differ
diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz
index a712e6abe..1d8ff7579 100644
Binary files a/build/openrpc/miner.json.gz and b/build/openrpc/miner.json.gz differ
diff --git a/build/openrpc/worker.json.gz b/build/openrpc/worker.json.gz
index d8087c424..3c4fa4f70 100644
Binary files a/build/openrpc/worker.json.gz and b/build/openrpc/worker.json.gz differ
diff --git a/build/parameters.go b/build/parameters.go
index b70dad1c1..9e60f12a6 100644
--- a/build/parameters.go
+++ b/build/parameters.go
@@ -1,11 +1,19 @@
package build
-import rice "github.com/GeertJohan/go.rice"
+import (
+ _ "embed"
+)
+
+//go:embed proof-params/parameters.json
+var params []byte
+
+//go:embed proof-params/srs-inner-product.json
+var srs []byte
func ParametersJSON() []byte {
- return rice.MustFindBox("proof-params").MustBytes("parameters.json")
+ return params
}
func SrsJSON() []byte {
- return rice.MustFindBox("proof-params").MustBytes("srs-inner-product.json")
+ return srs
}
diff --git a/build/params_2k.go b/build/params_2k.go
index 8ead218f5..387d2da0b 100644
--- a/build/params_2k.go
+++ b/build/params_2k.go
@@ -24,29 +24,29 @@ var UpgradeIgnitionHeight = abi.ChainEpoch(-2)
var UpgradeRefuelHeight = abi.ChainEpoch(-3)
var UpgradeTapeHeight = abi.ChainEpoch(-4)
-var UpgradeAssemblyHeight = abi.ChainEpoch(5)
-var UpgradeLiftoffHeight = abi.ChainEpoch(-5)
+var UpgradeAssemblyHeight = abi.ChainEpoch(-5)
+var UpgradeLiftoffHeight = abi.ChainEpoch(-6)
-var UpgradeKumquatHeight = abi.ChainEpoch(6)
-var UpgradeCalicoHeight = abi.ChainEpoch(7)
-var UpgradePersianHeight = abi.ChainEpoch(8)
-var UpgradeOrangeHeight = abi.ChainEpoch(9)
-var UpgradeClausHeight = abi.ChainEpoch(10)
+var UpgradeKumquatHeight = abi.ChainEpoch(-7)
+var UpgradeCalicoHeight = abi.ChainEpoch(-8)
+var UpgradePersianHeight = abi.ChainEpoch(-9)
+var UpgradeOrangeHeight = abi.ChainEpoch(-10)
+var UpgradeClausHeight = abi.ChainEpoch(-11)
-var UpgradeTrustHeight = abi.ChainEpoch(11)
+var UpgradeTrustHeight = abi.ChainEpoch(-12)
-var UpgradeNorwegianHeight = abi.ChainEpoch(12)
+var UpgradeNorwegianHeight = abi.ChainEpoch(-13)
-var UpgradeTurboHeight = abi.ChainEpoch(13)
+var UpgradeTurboHeight = abi.ChainEpoch(-14)
-var UpgradeHyperdriveHeight = abi.ChainEpoch(14)
+var UpgradeHyperdriveHeight = abi.ChainEpoch(-15)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
func init() {
- policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
+ policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1, abi.RegisteredSealProof_StackedDrg8MiBV1)
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
diff --git a/build/params_interop.go b/build/params_interop.go
new file mode 100644
index 000000000..73cc1c7d9
--- /dev/null
+++ b/build/params_interop.go
@@ -0,0 +1,104 @@
+// +build interopnet
+
+package build
+
+import (
+ "os"
+ "strconv"
+
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/abi"
+ builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
+
+ "github.com/filecoin-project/lotus/chain/actors/policy"
+)
+
+const BootstrappersFile = "interopnet.pi"
+const GenesisFile = "interopnet.car"
+
+var UpgradeBreezeHeight = abi.ChainEpoch(-1)
+
+const BreezeGasTampingDuration = 0
+
+var UpgradeSmokeHeight = abi.ChainEpoch(-1)
+var UpgradeIgnitionHeight = abi.ChainEpoch(-2)
+var UpgradeRefuelHeight = abi.ChainEpoch(-3)
+var UpgradeTapeHeight = abi.ChainEpoch(-4)
+
+var UpgradeAssemblyHeight = abi.ChainEpoch(-5)
+var UpgradeLiftoffHeight = abi.ChainEpoch(-6)
+
+var UpgradeKumquatHeight = abi.ChainEpoch(-7)
+var UpgradeCalicoHeight = abi.ChainEpoch(-8)
+var UpgradePersianHeight = abi.ChainEpoch(-9)
+var UpgradeOrangeHeight = abi.ChainEpoch(-10)
+var UpgradeClausHeight = abi.ChainEpoch(-11)
+
+var UpgradeTrustHeight = abi.ChainEpoch(-12)
+
+var UpgradeNorwegianHeight = abi.ChainEpoch(-13)
+
+var UpgradeTurboHeight = abi.ChainEpoch(-14)
+
+var UpgradeHyperdriveHeight = abi.ChainEpoch(-15)
+
+var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
+ 0: DrandMainnet,
+}
+
+func init() {
+ policy.SetSupportedProofTypes(
+ abi.RegisteredSealProof_StackedDrg2KiBV1,
+ abi.RegisteredSealProof_StackedDrg8MiBV1,
+ abi.RegisteredSealProof_StackedDrg512MiBV1,
+ )
+ policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
+ policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
+ policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
+
+ getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
+ hs, found := os.LookupEnv(ev)
+ if found {
+ h, err := strconv.Atoi(hs)
+ if err != nil {
+ log.Panicf("failed to parse %s env var", ev)
+ }
+
+ return abi.ChainEpoch(h)
+ }
+
+ return def
+ }
+
+ UpgradeBreezeHeight = getUpgradeHeight("LOTUS_BREEZE_HEIGHT", UpgradeBreezeHeight)
+ UpgradeSmokeHeight = getUpgradeHeight("LOTUS_SMOKE_HEIGHT", UpgradeSmokeHeight)
+ UpgradeIgnitionHeight = getUpgradeHeight("LOTUS_IGNITION_HEIGHT", UpgradeIgnitionHeight)
+ UpgradeRefuelHeight = getUpgradeHeight("LOTUS_REFUEL_HEIGHT", UpgradeRefuelHeight)
+ UpgradeTapeHeight = getUpgradeHeight("LOTUS_TAPE_HEIGHT", UpgradeTapeHeight)
+ UpgradeAssemblyHeight = getUpgradeHeight("LOTUS_ACTORSV2_HEIGHT", UpgradeAssemblyHeight)
+ UpgradeLiftoffHeight = getUpgradeHeight("LOTUS_LIFTOFF_HEIGHT", UpgradeLiftoffHeight)
+ UpgradeKumquatHeight = getUpgradeHeight("LOTUS_KUMQUAT_HEIGHT", UpgradeKumquatHeight)
+ UpgradeCalicoHeight = getUpgradeHeight("LOTUS_CALICO_HEIGHT", UpgradeCalicoHeight)
+ UpgradePersianHeight = getUpgradeHeight("LOTUS_PERSIAN_HEIGHT", UpgradePersianHeight)
+ UpgradeOrangeHeight = getUpgradeHeight("LOTUS_ORANGE_HEIGHT", UpgradeOrangeHeight)
+ UpgradeClausHeight = getUpgradeHeight("LOTUS_CLAUS_HEIGHT", UpgradeClausHeight)
+ UpgradeTrustHeight = getUpgradeHeight("LOTUS_ACTORSV3_HEIGHT", UpgradeTrustHeight)
+ UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
+ UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
+ UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
+
+ BuildType |= BuildInteropnet
+ SetAddressNetwork(address.Testnet)
+ Devnet = true
+}
+
+const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
+
+const PropagationDelaySecs = uint64(6)
+
+// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
+const BootstrapPeerThreshold = 2
+
+var WhitelistedBlock = cid.Undef
diff --git a/build/params_mainnet.go b/build/params_mainnet.go
index 2d708f9e4..e9bf33f5a 100644
--- a/build/params_mainnet.go
+++ b/build/params_mainnet.go
@@ -4,6 +4,7 @@
// +build !calibnet
// +build !nerpanet
// +build !butterflynet
+// +build !interopnet
package build
@@ -13,7 +14,6 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/lotus/chain/actors/policy"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
)
@@ -66,8 +66,6 @@ const UpgradeTurboHeight = 712320
var UpgradeHyperdriveHeight = abi.ChainEpoch(9999999)
func init() {
- policy.SetConsensusMinerMinPower(abi.NewStoragePower(10 << 40))
-
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
SetAddressNetwork(address.Mainnet)
}
diff --git a/build/tools.go b/build/tools.go
index ad45397bb..57b6e7d1f 100644
--- a/build/tools.go
+++ b/build/tools.go
@@ -6,4 +6,5 @@ import (
_ "github.com/GeertJohan/go.rice/rice"
_ "github.com/golang/mock/mockgen"
_ "github.com/whyrusleeping/bencher"
+ _ "golang.org/x/tools/cmd/stringer"
)
diff --git a/build/version.go b/build/version.go
index 2fb070853..5a4a494fc 100644
--- a/build/version.go
+++ b/build/version.go
@@ -1,14 +1,17 @@
package build
+import "os"
+
var CurrentCommit string
var BuildType int
const (
- BuildDefault = 0
- BuildMainnet = 0x1
- Build2k = 0x2
- BuildDebug = 0x3
- BuildCalibnet = 0x4
+ BuildDefault = 0
+ BuildMainnet = 0x1
+ Build2k = 0x2
+ BuildDebug = 0x3
+ BuildCalibnet = 0x4
+ BuildInteropnet = 0x5
)
func buildType() string {
@@ -23,14 +26,20 @@ func buildType() string {
return "+debug"
case BuildCalibnet:
return "+calibnet"
+ case BuildInteropnet:
+ return "+interopnet"
default:
return "+huh?"
}
}
// BuildVersion is the local build version, set by build system
-const BuildVersion = "1.10.0-rc2"
+const BuildVersion = "1.11.0-dev"
func UserVersion() string {
+ if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
+ return BuildVersion
+ }
+
return BuildVersion + buildType() + CurrentCommit
}
diff --git a/chain/actors/agen/main.go b/chain/actors/agen/main.go
index d34b43ca8..9a3b8fd20 100644
--- a/chain/actors/agen/main.go
+++ b/chain/actors/agen/main.go
@@ -6,34 +6,26 @@ import (
"io/ioutil"
"os"
"path/filepath"
+ "strconv"
"text/template"
+ lotusactors "github.com/filecoin-project/lotus/chain/actors"
+
"golang.org/x/xerrors"
)
-var latestVersion = 5
-
-var versions = []int{0, 2, 3, 4, latestVersion}
-
-var versionImports = map[int]string{
- 0: "/",
- 2: "/v2/",
- 3: "/v3/",
- 4: "/v4/",
- latestVersion: "/v5/",
-}
-
var actors = map[string][]int{
- "account": versions,
- "cron": versions,
- "init": versions,
- "market": versions,
- "miner": versions,
- "multisig": versions,
- "paych": versions,
- "power": versions,
- "reward": versions,
- "verifreg": versions,
+ "account": lotusactors.Versions,
+ "cron": lotusactors.Versions,
+ "init": lotusactors.Versions,
+ "market": lotusactors.Versions,
+ "miner": lotusactors.Versions,
+ "multisig": lotusactors.Versions,
+ "paych": lotusactors.Versions,
+ "power": lotusactors.Versions,
+ "system": lotusactors.Versions,
+ "reward": lotusactors.Versions,
+ "verifreg": lotusactors.Versions,
}
func main() {
@@ -72,14 +64,14 @@ func generateAdapters() error {
}
tpl := template.Must(template.New("").Funcs(template.FuncMap{
- "import": func(v int) string { return versionImports[v] },
+ "import": func(v int) string { return getVersionImports()[v] },
}).Parse(string(af)))
var b bytes.Buffer
err = tpl.Execute(&b, map[string]interface{}{
"versions": versions,
- "latestVersion": latestVersion,
+ "latestVersion": lotusactors.LatestVersion,
})
if err != nil {
return err
@@ -104,14 +96,14 @@ func generateState(actDir string) error {
return xerrors.Errorf("loading state adapter template: %w", err)
}
- for _, version := range versions {
+ for _, version := range lotusactors.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": versionImports[version],
+ "import": getVersionImports()[version],
})
if err != nil {
return err
@@ -135,14 +127,14 @@ func generateMessages(actDir string) error {
return xerrors.Errorf("loading message adapter template: %w", err)
}
- for _, version := range versions {
+ for _, version := range lotusactors.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": versionImports[version],
+ "import": getVersionImports()[version],
})
if err != nil {
return err
@@ -168,13 +160,13 @@ func generatePolicy(policyPath string) error {
}
tpl := template.Must(template.New("").Funcs(template.FuncMap{
- "import": func(v int) string { return versionImports[v] },
+ "import": func(v int) string { return getVersionImports()[v] },
}).Parse(string(pf)))
var b bytes.Buffer
err = tpl.Execute(&b, map[string]interface{}{
- "versions": versions,
- "latestVersion": latestVersion,
+ "versions": lotusactors.Versions,
+ "latestVersion": lotusactors.LatestVersion,
})
if err != nil {
return err
@@ -199,13 +191,13 @@ func generateBuiltin(builtinPath string) error {
}
tpl := template.Must(template.New("").Funcs(template.FuncMap{
- "import": func(v int) string { return versionImports[v] },
+ "import": func(v int) string { return getVersionImports()[v] },
}).Parse(string(bf)))
var b bytes.Buffer
err = tpl.Execute(&b, map[string]interface{}{
- "versions": versions,
- "latestVersion": latestVersion,
+ "versions": lotusactors.Versions,
+ "latestVersion": lotusactors.LatestVersion,
})
if err != nil {
return err
@@ -217,3 +209,16 @@ func generateBuiltin(builtinPath string) error {
return nil
}
+
+func getVersionImports() map[int]string {
+ versionImports := make(map[int]string, lotusactors.LatestVersion)
+ for _, v := range lotusactors.Versions {
+ if v == 0 {
+ versionImports[v] = "/"
+ } else {
+ versionImports[v] = "/v" + strconv.Itoa(v) + "/"
+ }
+ }
+
+ return versionImports
+}
diff --git a/chain/actors/builtin/account/account.go b/chain/actors/builtin/account/account.go
index 7ac8f62d0..04c82b340 100644
--- a/chain/actors/builtin/account/account.go
+++ b/chain/actors/builtin/account/account.go
@@ -1,6 +1,7 @@
package account
import (
+ "github.com/filecoin-project/lotus/chain/actors"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
@@ -69,8 +70,54 @@ 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) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store, addr)
+
+ case actors.Version2:
+ return make2(store, addr)
+
+ case actors.Version3:
+ return make3(store, addr)
+
+ case actors.Version4:
+ return make4(store, addr)
+
+ case actors.Version5:
+ return make5(store, addr)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.AccountActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.AccountActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.AccountActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.AccountActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.AccountActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
PubkeyAddress() (address.Address, error)
+ GetState() interface{}
}
diff --git a/chain/actors/builtin/account/actor.go.template b/chain/actors/builtin/account/actor.go.template
index f75af3dfb..53962cc94 100644
--- a/chain/actors/builtin/account/actor.go.template
+++ b/chain/actors/builtin/account/actor.go.template
@@ -1,6 +1,7 @@
package account
import (
+ "github.com/filecoin-project/lotus/chain/actors"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
@@ -34,8 +35,30 @@ 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) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store, addr)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.AccountActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
PubkeyAddress() (address.Address, error)
+ GetState() interface{}
}
diff --git a/chain/actors/builtin/account/state.go.template b/chain/actors/builtin/account/state.go.template
index 65d874c80..5be262ece 100644
--- a/chain/actors/builtin/account/state.go.template
+++ b/chain/actors/builtin/account/state.go.template
@@ -20,6 +20,12 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make{{.v}}(store adt.Store, addr address.Address) (State, error) {
+ out := state{{.v}}{store: store}
+ out.State = account{{.v}}.State{Address:addr}
+ return &out, nil
+}
+
type state{{.v}} struct {
account{{.v}}.State
store adt.Store
@@ -28,3 +34,7 @@ type state{{.v}} struct {
func (s *state{{.v}}) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
\ No newline at end of file
diff --git a/chain/actors/builtin/account/v0.go b/chain/actors/builtin/account/v0.go
index 67c555c5d..bdfca2fd7 100644
--- a/chain/actors/builtin/account/v0.go
+++ b/chain/actors/builtin/account/v0.go
@@ -20,6 +20,12 @@ func load0(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make0(store adt.Store, addr address.Address) (State, error) {
+ out := state0{store: store}
+ out.State = account0.State{Address: addr}
+ return &out, nil
+}
+
type state0 struct {
account0.State
store adt.Store
@@ -28,3 +34,7 @@ type state0 struct {
func (s *state0) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/account/v2.go b/chain/actors/builtin/account/v2.go
index 2664631bc..66618e06a 100644
--- a/chain/actors/builtin/account/v2.go
+++ b/chain/actors/builtin/account/v2.go
@@ -20,6 +20,12 @@ func load2(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make2(store adt.Store, addr address.Address) (State, error) {
+ out := state2{store: store}
+ out.State = account2.State{Address: addr}
+ return &out, nil
+}
+
type state2 struct {
account2.State
store adt.Store
@@ -28,3 +34,7 @@ type state2 struct {
func (s *state2) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/account/v3.go b/chain/actors/builtin/account/v3.go
index 16b489a3e..dbe100a4f 100644
--- a/chain/actors/builtin/account/v3.go
+++ b/chain/actors/builtin/account/v3.go
@@ -20,6 +20,12 @@ func load3(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make3(store adt.Store, addr address.Address) (State, error) {
+ out := state3{store: store}
+ out.State = account3.State{Address: addr}
+ return &out, nil
+}
+
type state3 struct {
account3.State
store adt.Store
@@ -28,3 +34,7 @@ type state3 struct {
func (s *state3) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/account/v4.go b/chain/actors/builtin/account/v4.go
index 1a24007d8..53f71dcc5 100644
--- a/chain/actors/builtin/account/v4.go
+++ b/chain/actors/builtin/account/v4.go
@@ -20,6 +20,12 @@ func load4(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make4(store adt.Store, addr address.Address) (State, error) {
+ out := state4{store: store}
+ out.State = account4.State{Address: addr}
+ return &out, nil
+}
+
type state4 struct {
account4.State
store adt.Store
@@ -28,3 +34,7 @@ type state4 struct {
func (s *state4) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/account/v5.go b/chain/actors/builtin/account/v5.go
index e2df5904d..538f56987 100644
--- a/chain/actors/builtin/account/v5.go
+++ b/chain/actors/builtin/account/v5.go
@@ -20,6 +20,12 @@ func load5(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make5(store adt.Store, addr address.Address) (State, error) {
+ out := state5{store: store}
+ out.State = account5.State{Address: addr}
+ return &out, nil
+}
+
type state5 struct {
account5.State
store adt.Store
@@ -28,3 +34,7 @@ type state5 struct {
func (s *state5) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/builtin.go.template b/chain/actors/builtin/builtin.go.template
index 9b89b13f5..031c05182 100644
--- a/chain/actors/builtin/builtin.go.template
+++ b/chain/actors/builtin/builtin.go.template
@@ -6,9 +6,9 @@ import (
"golang.org/x/xerrors"
{{range .versions}}
- builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
- smoothing{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/util/smoothing"
- {{end}}
+ builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
+ smoothing{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/util/smoothing"
+ {{end}}
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/cbor"
@@ -17,7 +17,7 @@ import (
"github.com/filecoin-project/lotus/chain/types"
miner{{.latestVersion}} "github.com/filecoin-project/specs-actors{{import .latestVersion}}actors/builtin/miner"
- proof{{.latestVersion}} "github.com/filecoin-project/specs-actors{{import .latestVersion}}actors/runtime/proof"
+ proof{{.latestVersion}} "github.com/filecoin-project/specs-actors{{import .latestVersion}}actors/runtime/proof"
)
var SystemActorAddr = builtin{{.latestVersion}}.SystemActorAddr
@@ -53,13 +53,13 @@ func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight,
}
{{range .versions}}
- func FromV{{.}}FilterEstimate(v{{.}} smoothing{{.}}.FilterEstimate) FilterEstimate {
+ func FromV{{.}}FilterEstimate(v{{.}} smoothing{{.}}.FilterEstimate) FilterEstimate {
{{if (eq . 0)}}
- return (FilterEstimate)(v{{.}}) //nolint:unconvert
- {{else}}
- return (FilterEstimate)(v{{.}})
- {{end}}
- }
+ return (FilterEstimate)(v{{.}}) //nolint:unconvert
+ {{else}}
+ return (FilterEstimate)(v{{.}})
+ {{end}}
+ }
{{end}}
type ActorStateLoader func(store adt.Store, root cid.Cid) (cbor.Marshaler, error)
@@ -80,58 +80,58 @@ func Load(store adt.Store, act *types.Actor) (cbor.Marshaler, error) {
func ActorNameByCode(c cid.Cid) string {
switch {
- {{range .versions}}
- case builtin{{.}}.IsBuiltinActor(c):
- return builtin{{.}}.ActorNameByCode(c)
- {{end}}
+ {{range .versions}}
+ case builtin{{.}}.IsBuiltinActor(c):
+ return builtin{{.}}.ActorNameByCode(c)
+ {{end}}
default:
return ""
}
}
func IsBuiltinActor(c cid.Cid) bool {
- {{range .versions}}
- if builtin{{.}}.IsBuiltinActor(c) {
- return true
- }
- {{end}}
- return false
+ {{range .versions}}
+ if builtin{{.}}.IsBuiltinActor(c) {
+ return true
+ }
+ {{end}}
+ return false
}
func IsAccountActor(c cid.Cid) bool {
- {{range .versions}}
- if c == builtin{{.}}.AccountActorCodeID {
- return true
- }
- {{end}}
- return false
+ {{range .versions}}
+ if c == builtin{{.}}.AccountActorCodeID {
+ return true
+ }
+ {{end}}
+ return false
}
func IsStorageMinerActor(c cid.Cid) bool {
- {{range .versions}}
- if c == builtin{{.}}.StorageMinerActorCodeID {
- return true
- }
- {{end}}
- return false
+ {{range .versions}}
+ if c == builtin{{.}}.StorageMinerActorCodeID {
+ return true
+ }
+ {{end}}
+ return false
}
func IsMultisigActor(c cid.Cid) bool {
- {{range .versions}}
- if c == builtin{{.}}.MultisigActorCodeID {
- return true
- }
- {{end}}
- return false
+ {{range .versions}}
+ if c == builtin{{.}}.MultisigActorCodeID {
+ return true
+ }
+ {{end}}
+ return false
}
func IsPaymentChannelActor(c cid.Cid) bool {
- {{range .versions}}
- if c == builtin{{.}}.PaymentChannelActorCodeID {
- return true
- }
- {{end}}
- return false
+ {{range .versions}}
+ if c == builtin{{.}}.PaymentChannelActorCodeID {
+ return true
+ }
+ {{end}}
+ return false
}
func makeAddress(addr string) address.Address {
diff --git a/chain/actors/builtin/cron/actor.go.template b/chain/actors/builtin/cron/actor.go.template
index 6b7449617..d73808556 100644
--- a/chain/actors/builtin/cron/actor.go.template
+++ b/chain/actors/builtin/cron/actor.go.template
@@ -1,10 +1,42 @@
package cron
import (
- builtin{{.latestVersion}} "github.com/filecoin-project/specs-actors{{import .latestVersion}}actors/builtin"
+ "github.com/filecoin-project/lotus/chain/actors"
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+ "golang.org/x/xerrors"
+ "github.com/ipfs/go-cid"
+{{range .versions}}
+ builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
+{{end}}
)
+func MakeState(store adt.Store, av actors.Version) (State, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.CronActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
var (
Address = builtin{{.latestVersion}}.CronActorAddr
Methods = builtin{{.latestVersion}}.MethodsCron
)
+
+
+type State interface {
+ GetState() interface{}
+}
diff --git a/chain/actors/builtin/cron/cron.go b/chain/actors/builtin/cron/cron.go
index a601f2b1e..2275e747f 100644
--- a/chain/actors/builtin/cron/cron.go
+++ b/chain/actors/builtin/cron/cron.go
@@ -1,10 +1,72 @@
package cron
import (
+ "github.com/filecoin-project/lotus/chain/actors"
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+ "github.com/ipfs/go-cid"
+ "golang.org/x/xerrors"
+
+ builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
+
+ builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
+
+ builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
+
+ builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
+
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
)
+func MakeState(store adt.Store, av actors.Version) (State, error) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store)
+
+ case actors.Version2:
+ return make2(store)
+
+ case actors.Version3:
+ return make3(store)
+
+ case actors.Version4:
+ return make4(store)
+
+ case actors.Version5:
+ return make5(store)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.CronActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.CronActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.CronActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.CronActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.CronActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
var (
Address = builtin5.CronActorAddr
Methods = builtin5.MethodsCron
)
+
+type State interface {
+ GetState() interface{}
+}
diff --git a/chain/actors/builtin/cron/state.go.template b/chain/actors/builtin/cron/state.go.template
new file mode 100644
index 000000000..99a06d7f8
--- /dev/null
+++ b/chain/actors/builtin/cron/state.go.template
@@ -0,0 +1,35 @@
+package cron
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ cron{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/cron"
+)
+
+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) (State, error) {
+ out := state{{.v}}{store: store}
+ out.State = *cron{{.v}}.ConstructState(cron{{.v}}.BuiltInEntries())
+ return &out, nil
+}
+
+type state{{.v}} struct {
+ cron{{.v}}.State
+ store adt.Store
+}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
\ No newline at end of file
diff --git a/chain/actors/builtin/cron/v0.go b/chain/actors/builtin/cron/v0.go
new file mode 100644
index 000000000..6147b858c
--- /dev/null
+++ b/chain/actors/builtin/cron/v0.go
@@ -0,0 +1,35 @@
+package cron
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ cron0 "github.com/filecoin-project/specs-actors/actors/builtin/cron"
+)
+
+var _ State = (*state0)(nil)
+
+func load0(store adt.Store, root cid.Cid) (State, error) {
+ out := state0{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make0(store adt.Store) (State, error) {
+ out := state0{store: store}
+ out.State = *cron0.ConstructState(cron0.BuiltInEntries())
+ return &out, nil
+}
+
+type state0 struct {
+ cron0.State
+ store adt.Store
+}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/cron/v2.go b/chain/actors/builtin/cron/v2.go
new file mode 100644
index 000000000..51ca179d9
--- /dev/null
+++ b/chain/actors/builtin/cron/v2.go
@@ -0,0 +1,35 @@
+package cron
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ cron2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/cron"
+)
+
+var _ State = (*state2)(nil)
+
+func load2(store adt.Store, root cid.Cid) (State, error) {
+ out := state2{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make2(store adt.Store) (State, error) {
+ out := state2{store: store}
+ out.State = *cron2.ConstructState(cron2.BuiltInEntries())
+ return &out, nil
+}
+
+type state2 struct {
+ cron2.State
+ store adt.Store
+}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/cron/v3.go b/chain/actors/builtin/cron/v3.go
new file mode 100644
index 000000000..ff74d511d
--- /dev/null
+++ b/chain/actors/builtin/cron/v3.go
@@ -0,0 +1,35 @@
+package cron
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ cron3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/cron"
+)
+
+var _ State = (*state3)(nil)
+
+func load3(store adt.Store, root cid.Cid) (State, error) {
+ out := state3{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make3(store adt.Store) (State, error) {
+ out := state3{store: store}
+ out.State = *cron3.ConstructState(cron3.BuiltInEntries())
+ return &out, nil
+}
+
+type state3 struct {
+ cron3.State
+ store adt.Store
+}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/cron/v4.go b/chain/actors/builtin/cron/v4.go
new file mode 100644
index 000000000..1cff8cc28
--- /dev/null
+++ b/chain/actors/builtin/cron/v4.go
@@ -0,0 +1,35 @@
+package cron
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ cron4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/cron"
+)
+
+var _ State = (*state4)(nil)
+
+func load4(store adt.Store, root cid.Cid) (State, error) {
+ out := state4{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make4(store adt.Store) (State, error) {
+ out := state4{store: store}
+ out.State = *cron4.ConstructState(cron4.BuiltInEntries())
+ return &out, nil
+}
+
+type state4 struct {
+ cron4.State
+ store adt.Store
+}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/cron/v5.go b/chain/actors/builtin/cron/v5.go
new file mode 100644
index 000000000..2bb00dc21
--- /dev/null
+++ b/chain/actors/builtin/cron/v5.go
@@ -0,0 +1,35 @@
+package cron
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ cron5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/cron"
+)
+
+var _ State = (*state5)(nil)
+
+func load5(store adt.Store, root cid.Cid) (State, error) {
+ out := state5{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make5(store adt.Store) (State, error) {
+ out := state5{store: store}
+ out.State = *cron5.ConstructState(cron5.BuiltInEntries())
+ return &out, nil
+}
+
+type state5 struct {
+ cron5.State
+ store adt.Store
+}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/init/actor.go.template b/chain/actors/builtin/init/actor.go.template
index 5b700cec8..f825eb9fa 100644
--- a/chain/actors/builtin/init/actor.go.template
+++ b/chain/actors/builtin/init/actor.go.template
@@ -1,6 +1,7 @@
package init
import (
+ "github.com/filecoin-project/lotus/chain/actors"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
@@ -39,6 +40,27 @@ 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) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store, networkName)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.InitActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -56,5 +78,12 @@ type State interface {
// Sets the network's name. This should only be used on upgrade/fork.
SetNetworkName(name string) error
- addressMap() (adt.Map, error)
+ // Sets the next ID for the init actor. This should only be used for testing.
+ SetNextID(id abi.ActorID) error
+
+ // Sets the address map for the init actor. This should only be used for testing.
+ SetAddressMap(mcid cid.Cid) error
+
+ AddressMap() (adt.Map, error)
+ GetState() interface{}
}
diff --git a/chain/actors/builtin/init/diff.go b/chain/actors/builtin/init/diff.go
index 593171322..5eb8f3c75 100644
--- a/chain/actors/builtin/init/diff.go
+++ b/chain/actors/builtin/init/diff.go
@@ -11,12 +11,12 @@ import (
)
func DiffAddressMap(pre, cur State) (*AddressMapChanges, error) {
- prem, err := pre.addressMap()
+ prem, err := pre.AddressMap()
if err != nil {
return nil, err
}
- curm, err := cur.addressMap()
+ curm, err := cur.AddressMap()
if err != nil {
return nil, err
}
diff --git a/chain/actors/builtin/init/init.go b/chain/actors/builtin/init/init.go
index 605f2d103..e1bd6f371 100644
--- a/chain/actors/builtin/init/init.go
+++ b/chain/actors/builtin/init/init.go
@@ -1,6 +1,7 @@
package init
import (
+ "github.com/filecoin-project/lotus/chain/actors"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
@@ -74,6 +75,51 @@ 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) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store, networkName)
+
+ case actors.Version2:
+ return make2(store, networkName)
+
+ case actors.Version3:
+ return make3(store, networkName)
+
+ case actors.Version4:
+ return make4(store, networkName)
+
+ case actors.Version5:
+ return make5(store, networkName)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.InitActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.InitActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.InitActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.InitActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.InitActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -91,5 +137,12 @@ type State interface {
// Sets the network's name. This should only be used on upgrade/fork.
SetNetworkName(name string) error
- addressMap() (adt.Map, error)
+ // Sets the next ID for the init actor. This should only be used for testing.
+ SetNextID(id abi.ActorID) error
+
+ // Sets the address map for the init actor. This should only be used for testing.
+ SetAddressMap(mcid cid.Cid) error
+
+ AddressMap() (adt.Map, error)
+ GetState() interface{}
}
diff --git a/chain/actors/builtin/init/state.go.template b/chain/actors/builtin/init/state.go.template
index 95f052bda..482ad4df5 100644
--- a/chain/actors/builtin/init/state.go.template
+++ b/chain/actors/builtin/init/state.go.template
@@ -29,6 +29,26 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make{{.v}}(store adt.Store, networkName string) (State, error) {
+ out := state{{.v}}{store: store}
+ {{if (le .v 2)}}
+ mr, err := adt{{.v}}.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *init{{.v}}.ConstructState(mr, networkName)
+ {{else}}
+ s, err := init{{.v}}.ConstructState(store, networkName)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+ {{end}}
+ return &out, nil
+}
+
type state{{.v}} struct {
init{{.v}}.State
store adt.Store
@@ -66,6 +86,11 @@ func (s *state{{.v}}) SetNetworkName(name string) error {
return nil
}
+func (s *state{{.v}}) SetNextID(id abi.ActorID) error {
+ s.State.NextID = id
+ return nil
+}
+
func (s *state{{.v}}) Remove(addrs ...address.Address) (err error) {
m, err := adt{{.v}}.AsMap(s.store, s.State.AddressMap{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}})
if err != nil {
@@ -84,6 +109,15 @@ func (s *state{{.v}}) Remove(addrs ...address.Address) (err error) {
return nil
}
-func (s *state{{.v}}) addressMap() (adt.Map, error) {
- return adt{{.v}}.AsMap(s.store, s.AddressMap{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}})
+func (s *state{{.v}}) SetAddressMap(mcid cid.Cid) error {
+ s.State.AddressMap = mcid
+ return nil
}
+
+func (s *state{{.v}}) AddressMap() (adt.Map, error) {
+ return adt{{.v}}.AsMap(s.store, s.State.AddressMap{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}})
+}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
\ No newline at end of file
diff --git a/chain/actors/builtin/init/v0.go b/chain/actors/builtin/init/v0.go
index c019705b1..ddd2dab94 100644
--- a/chain/actors/builtin/init/v0.go
+++ b/chain/actors/builtin/init/v0.go
@@ -25,6 +25,19 @@ func load0(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make0(store adt.Store, networkName string) (State, error) {
+ out := state0{store: store}
+
+ mr, err := adt0.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *init0.ConstructState(mr, networkName)
+
+ return &out, nil
+}
+
type state0 struct {
init0.State
store adt.Store
@@ -62,6 +75,11 @@ func (s *state0) SetNetworkName(name string) error {
return nil
}
+func (s *state0) SetNextID(id abi.ActorID) error {
+ s.State.NextID = id
+ return nil
+}
+
func (s *state0) Remove(addrs ...address.Address) (err error) {
m, err := adt0.AsMap(s.store, s.State.AddressMap)
if err != nil {
@@ -80,6 +98,15 @@ func (s *state0) Remove(addrs ...address.Address) (err error) {
return nil
}
-func (s *state0) addressMap() (adt.Map, error) {
- return adt0.AsMap(s.store, s.AddressMap)
+func (s *state0) SetAddressMap(mcid cid.Cid) error {
+ s.State.AddressMap = mcid
+ return nil
+}
+
+func (s *state0) AddressMap() (adt.Map, error) {
+ return adt0.AsMap(s.store, s.State.AddressMap)
+}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
}
diff --git a/chain/actors/builtin/init/v2.go b/chain/actors/builtin/init/v2.go
index 420243be4..72e2d56a5 100644
--- a/chain/actors/builtin/init/v2.go
+++ b/chain/actors/builtin/init/v2.go
@@ -25,6 +25,19 @@ func load2(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make2(store adt.Store, networkName string) (State, error) {
+ out := state2{store: store}
+
+ mr, err := adt2.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *init2.ConstructState(mr, networkName)
+
+ return &out, nil
+}
+
type state2 struct {
init2.State
store adt.Store
@@ -62,6 +75,11 @@ func (s *state2) SetNetworkName(name string) error {
return nil
}
+func (s *state2) SetNextID(id abi.ActorID) error {
+ s.State.NextID = id
+ return nil
+}
+
func (s *state2) Remove(addrs ...address.Address) (err error) {
m, err := adt2.AsMap(s.store, s.State.AddressMap)
if err != nil {
@@ -80,6 +98,15 @@ func (s *state2) Remove(addrs ...address.Address) (err error) {
return nil
}
-func (s *state2) addressMap() (adt.Map, error) {
- return adt2.AsMap(s.store, s.AddressMap)
+func (s *state2) SetAddressMap(mcid cid.Cid) error {
+ s.State.AddressMap = mcid
+ return nil
+}
+
+func (s *state2) AddressMap() (adt.Map, error) {
+ return adt2.AsMap(s.store, s.State.AddressMap)
+}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
}
diff --git a/chain/actors/builtin/init/v3.go b/chain/actors/builtin/init/v3.go
index eaa54dfd4..4609c94a3 100644
--- a/chain/actors/builtin/init/v3.go
+++ b/chain/actors/builtin/init/v3.go
@@ -27,6 +27,19 @@ func load3(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make3(store adt.Store, networkName string) (State, error) {
+ out := state3{store: store}
+
+ s, err := init3.ConstructState(store, networkName)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state3 struct {
init3.State
store adt.Store
@@ -64,6 +77,11 @@ func (s *state3) SetNetworkName(name string) error {
return nil
}
+func (s *state3) SetNextID(id abi.ActorID) error {
+ s.State.NextID = id
+ return nil
+}
+
func (s *state3) Remove(addrs ...address.Address) (err error) {
m, err := adt3.AsMap(s.store, s.State.AddressMap, builtin3.DefaultHamtBitwidth)
if err != nil {
@@ -82,6 +100,15 @@ func (s *state3) Remove(addrs ...address.Address) (err error) {
return nil
}
-func (s *state3) addressMap() (adt.Map, error) {
- return adt3.AsMap(s.store, s.AddressMap, builtin3.DefaultHamtBitwidth)
+func (s *state3) SetAddressMap(mcid cid.Cid) error {
+ s.State.AddressMap = mcid
+ return nil
+}
+
+func (s *state3) AddressMap() (adt.Map, error) {
+ return adt3.AsMap(s.store, s.State.AddressMap, builtin3.DefaultHamtBitwidth)
+}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
}
diff --git a/chain/actors/builtin/init/v4.go b/chain/actors/builtin/init/v4.go
index 38749eed5..dc56d1f19 100644
--- a/chain/actors/builtin/init/v4.go
+++ b/chain/actors/builtin/init/v4.go
@@ -27,6 +27,19 @@ func load4(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make4(store adt.Store, networkName string) (State, error) {
+ out := state4{store: store}
+
+ s, err := init4.ConstructState(store, networkName)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state4 struct {
init4.State
store adt.Store
@@ -64,6 +77,11 @@ func (s *state4) SetNetworkName(name string) error {
return nil
}
+func (s *state4) SetNextID(id abi.ActorID) error {
+ s.State.NextID = id
+ return nil
+}
+
func (s *state4) Remove(addrs ...address.Address) (err error) {
m, err := adt4.AsMap(s.store, s.State.AddressMap, builtin4.DefaultHamtBitwidth)
if err != nil {
@@ -82,6 +100,15 @@ func (s *state4) Remove(addrs ...address.Address) (err error) {
return nil
}
-func (s *state4) addressMap() (adt.Map, error) {
- return adt4.AsMap(s.store, s.AddressMap, builtin4.DefaultHamtBitwidth)
+func (s *state4) SetAddressMap(mcid cid.Cid) error {
+ s.State.AddressMap = mcid
+ return nil
+}
+
+func (s *state4) AddressMap() (adt.Map, error) {
+ return adt4.AsMap(s.store, s.State.AddressMap, builtin4.DefaultHamtBitwidth)
+}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
}
diff --git a/chain/actors/builtin/init/v5.go b/chain/actors/builtin/init/v5.go
index 01c20fc23..107366de5 100644
--- a/chain/actors/builtin/init/v5.go
+++ b/chain/actors/builtin/init/v5.go
@@ -27,6 +27,19 @@ func load5(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make5(store adt.Store, networkName string) (State, error) {
+ out := state5{store: store}
+
+ s, err := init5.ConstructState(store, networkName)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state5 struct {
init5.State
store adt.Store
@@ -64,6 +77,11 @@ func (s *state5) SetNetworkName(name string) error {
return nil
}
+func (s *state5) SetNextID(id abi.ActorID) error {
+ s.State.NextID = id
+ return nil
+}
+
func (s *state5) Remove(addrs ...address.Address) (err error) {
m, err := adt5.AsMap(s.store, s.State.AddressMap, builtin5.DefaultHamtBitwidth)
if err != nil {
@@ -82,6 +100,15 @@ func (s *state5) Remove(addrs ...address.Address) (err error) {
return nil
}
-func (s *state5) addressMap() (adt.Map, error) {
- return adt5.AsMap(s.store, s.AddressMap, builtin5.DefaultHamtBitwidth)
+func (s *state5) SetAddressMap(mcid cid.Cid) error {
+ s.State.AddressMap = mcid
+ return nil
+}
+
+func (s *state5) AddressMap() (adt.Map, error) {
+ return adt5.AsMap(s.store, s.State.AddressMap, builtin5.DefaultHamtBitwidth)
+}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
}
diff --git a/chain/actors/builtin/market/actor.go.template b/chain/actors/builtin/market/actor.go.template
index eaa06b867..f78c84b8f 100644
--- a/chain/actors/builtin/market/actor.go.template
+++ b/chain/actors/builtin/market/actor.go.template
@@ -5,6 +5,7 @@ import (
"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/cbor"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
@@ -15,6 +16,7 @@ import (
{{end}}
"github.com/filecoin-project/lotus/chain/actors/adt"
+ "github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/types"
)
@@ -41,6 +43,27 @@ 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) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.StorageMarketActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
BalancesChanged(State) (bool, error)
@@ -55,6 +78,7 @@ type State interface {
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
) (weight, verifiedWeight abi.DealWeight, err error)
NextID() (abi.DealID, error)
+ GetState() interface{}
}
type BalanceTable interface {
@@ -92,51 +116,67 @@ type DealState struct {
}
type DealProposal struct {
- PieceCID cid.Cid
- PieceSize abi.PaddedPieceSize
- VerifiedDeal bool
- Client address.Address
- Provider address.Address
- Label string
- StartEpoch abi.ChainEpoch
- EndEpoch abi.ChainEpoch
+ PieceCID cid.Cid
+ PieceSize abi.PaddedPieceSize
+ VerifiedDeal bool
+ Client address.Address
+ Provider address.Address
+ Label string
+ StartEpoch abi.ChainEpoch
+ EndEpoch abi.ChainEpoch
StoragePricePerEpoch abi.TokenAmount
- ProviderCollateral abi.TokenAmount
- ClientCollateral abi.TokenAmount
+ ProviderCollateral abi.TokenAmount
+ ClientCollateral abi.TokenAmount
}
type DealStateChanges struct {
- Added []DealIDState
+ Added []DealIDState
Modified []DealStateChange
- Removed []DealIDState
+ Removed []DealIDState
}
type DealIDState struct {
- ID abi.DealID
+ ID abi.DealID
Deal DealState
}
// DealStateChange is a change in deal state from -> to
type DealStateChange struct {
- ID abi.DealID
+ ID abi.DealID
From *DealState
- To *DealState
+ To *DealState
}
type DealProposalChanges struct {
- Added []ProposalIDState
+ Added []ProposalIDState
Removed []ProposalIDState
}
type ProposalIDState struct {
- ID abi.DealID
+ ID abi.DealID
Proposal DealProposal
}
func EmptyDealState() *DealState {
return &DealState{
SectorStartEpoch: -1,
- SlashEpoch: -1,
+ SlashEpoch: -1,
LastUpdatedEpoch: -1,
}
-}
\ No newline at end of file
+}
+
+// returns the earned fees and pending fees for a given deal
+func (deal DealProposal) GetDealFees(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)))
+ if ef.LessThan(big.Zero()) {
+ ef = big.Zero()
+ }
+
+ if ef.GreaterThan(tf) {
+ ef = tf
+ }
+
+ return ef, big.Sub(tf, ef)
+}
diff --git a/chain/actors/builtin/market/market.go b/chain/actors/builtin/market/market.go
index 8f5964ecc..026e35d4e 100644
--- a/chain/actors/builtin/market/market.go
+++ b/chain/actors/builtin/market/market.go
@@ -5,6 +5,7 @@ import (
"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/cbor"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
@@ -21,6 +22,7 @@ import (
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
+ "github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/types"
@@ -76,6 +78,51 @@ 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) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store)
+
+ case actors.Version2:
+ return make2(store)
+
+ case actors.Version3:
+ return make3(store)
+
+ case actors.Version4:
+ return make4(store)
+
+ case actors.Version5:
+ return make5(store)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.StorageMarketActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.StorageMarketActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.StorageMarketActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.StorageMarketActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.StorageMarketActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
BalancesChanged(State) (bool, error)
@@ -90,6 +137,7 @@ type State interface {
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
) (weight, verifiedWeight abi.DealWeight, err error)
NextID() (abi.DealID, error)
+ GetState() interface{}
}
type BalanceTable interface {
@@ -175,3 +223,19 @@ func EmptyDealState() *DealState {
LastUpdatedEpoch: -1,
}
}
+
+// returns the earned fees and pending fees for a given deal
+func (deal DealProposal) GetDealFees(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)))
+ if ef.LessThan(big.Zero()) {
+ ef = big.Zero()
+ }
+
+ if ef.GreaterThan(tf) {
+ ef = tf
+ }
+
+ return ef, big.Sub(tf, ef)
+}
diff --git a/chain/actors/builtin/market/state.go.template b/chain/actors/builtin/market/state.go.template
index a55743ce5..70b731148 100644
--- a/chain/actors/builtin/market/state.go.template
+++ b/chain/actors/builtin/market/state.go.template
@@ -26,6 +26,31 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make{{.v}}(store adt.Store) (State, error) {
+ out := state{{.v}}{store: store}
+ {{if (le .v 2)}}
+ ea, err := adt{{.v}}.MakeEmptyArray(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ em, err := adt{{.v}}.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *market{{.v}}.ConstructState(ea, em, em)
+ {{else}}
+ s, err := market{{.v}}.ConstructState(store)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+ {{end}}
+ return &out, nil
+}
+
type state{{.v}} struct {
market{{.v}}.State
store adt.Store
@@ -207,3 +232,7 @@ func (s *dealProposals{{.v}}) array() adt.Array {
func fromV{{.v}}DealProposal(v{{.v}} market{{.v}}.DealProposal) DealProposal {
return (DealProposal)(v{{.v}})
}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/market/v0.go b/chain/actors/builtin/market/v0.go
index 175c0a2ea..b3093b54b 100644
--- a/chain/actors/builtin/market/v0.go
+++ b/chain/actors/builtin/market/v0.go
@@ -26,6 +26,24 @@ func load0(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make0(store adt.Store) (State, error) {
+ out := state0{store: store}
+
+ ea, err := adt0.MakeEmptyArray(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ em, err := adt0.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *market0.ConstructState(ea, em, em)
+
+ return &out, nil
+}
+
type state0 struct {
market0.State
store adt.Store
@@ -207,3 +225,7 @@ func (s *dealProposals0) array() adt.Array {
func fromV0DealProposal(v0 market0.DealProposal) DealProposal {
return (DealProposal)(v0)
}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/market/v2.go b/chain/actors/builtin/market/v2.go
index dafae8feb..fdedcce85 100644
--- a/chain/actors/builtin/market/v2.go
+++ b/chain/actors/builtin/market/v2.go
@@ -26,6 +26,24 @@ func load2(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make2(store adt.Store) (State, error) {
+ out := state2{store: store}
+
+ ea, err := adt2.MakeEmptyArray(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ em, err := adt2.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *market2.ConstructState(ea, em, em)
+
+ return &out, nil
+}
+
type state2 struct {
market2.State
store adt.Store
@@ -207,3 +225,7 @@ func (s *dealProposals2) array() adt.Array {
func fromV2DealProposal(v2 market2.DealProposal) DealProposal {
return (DealProposal)(v2)
}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/market/v3.go b/chain/actors/builtin/market/v3.go
index dec8d6e25..53d266443 100644
--- a/chain/actors/builtin/market/v3.go
+++ b/chain/actors/builtin/market/v3.go
@@ -26,6 +26,19 @@ func load3(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make3(store adt.Store) (State, error) {
+ out := state3{store: store}
+
+ s, err := market3.ConstructState(store)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state3 struct {
market3.State
store adt.Store
@@ -207,3 +220,7 @@ func (s *dealProposals3) array() adt.Array {
func fromV3DealProposal(v3 market3.DealProposal) DealProposal {
return (DealProposal)(v3)
}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/market/v4.go b/chain/actors/builtin/market/v4.go
index 22514395c..30aa26920 100644
--- a/chain/actors/builtin/market/v4.go
+++ b/chain/actors/builtin/market/v4.go
@@ -26,6 +26,19 @@ func load4(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make4(store adt.Store) (State, error) {
+ out := state4{store: store}
+
+ s, err := market4.ConstructState(store)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state4 struct {
market4.State
store adt.Store
@@ -207,3 +220,7 @@ func (s *dealProposals4) array() adt.Array {
func fromV4DealProposal(v4 market4.DealProposal) DealProposal {
return (DealProposal)(v4)
}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/market/v5.go b/chain/actors/builtin/market/v5.go
index 9acd3d57e..12378c76d 100644
--- a/chain/actors/builtin/market/v5.go
+++ b/chain/actors/builtin/market/v5.go
@@ -26,6 +26,19 @@ func load5(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make5(store adt.Store) (State, error) {
+ out := state5{store: store}
+
+ s, err := market5.ConstructState(store)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state5 struct {
market5.State
store adt.Store
@@ -207,3 +220,7 @@ func (s *dealProposals5) array() adt.Array {
func fromV5DealProposal(v5 market5.DealProposal) DealProposal {
return (DealProposal)(v5)
}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/miner/actor.go.template b/chain/actors/builtin/miner/actor.go.template
index 4b3d8db5e..619dc699d 100644
--- a/chain/actors/builtin/miner/actor.go.template
+++ b/chain/actors/builtin/miner/actor.go.template
@@ -3,6 +3,7 @@ package miner
import (
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/network"
+ "github.com/filecoin-project/lotus/chain/actors"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
cbg "github.com/whyrusleeping/cbor-gen"
@@ -60,6 +61,27 @@ 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) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.StorageMinerActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -79,6 +101,11 @@ type State interface {
NumLiveSectors() (uint64, error)
IsAllocated(abi.SectorNumber) (bool, error)
+ // Note that ProvingPeriodStart is deprecated and will be renamed / removed in a future version of actors
+ GetProvingPeriodStart() (abi.ChainEpoch, error)
+ // Testing only
+ EraseAllUnproven() error
+
LoadDeadline(idx uint64) (Deadline, error)
ForEachDeadline(cb func(idx uint64, dl Deadline) error) error
NumDeadlines() (uint64, error)
@@ -95,6 +122,7 @@ type State interface {
decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)
precommits() (adt.Map, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (SectorPreCommitOnChainInfo, error)
+ GetState() interface{}
}
type Deadline interface {
diff --git a/chain/actors/builtin/miner/miner.go b/chain/actors/builtin/miner/miner.go
index 195e8f177..6e35d4e9f 100644
--- a/chain/actors/builtin/miner/miner.go
+++ b/chain/actors/builtin/miner/miner.go
@@ -3,6 +3,7 @@ package miner
import (
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/network"
+ "github.com/filecoin-project/lotus/chain/actors"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
cbg "github.com/whyrusleeping/cbor-gen"
@@ -95,6 +96,51 @@ 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) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store)
+
+ case actors.Version2:
+ return make2(store)
+
+ case actors.Version3:
+ return make3(store)
+
+ case actors.Version4:
+ return make4(store)
+
+ case actors.Version5:
+ return make5(store)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.StorageMinerActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.StorageMinerActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.StorageMinerActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.StorageMinerActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.StorageMinerActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -114,6 +160,11 @@ type State interface {
NumLiveSectors() (uint64, error)
IsAllocated(abi.SectorNumber) (bool, error)
+ // Note that ProvingPeriodStart is deprecated and will be renamed / removed in a future version of actors
+ GetProvingPeriodStart() (abi.ChainEpoch, error)
+ // Testing only
+ EraseAllUnproven() error
+
LoadDeadline(idx uint64) (Deadline, error)
ForEachDeadline(cb func(idx uint64, dl Deadline) error) error
NumDeadlines() (uint64, error)
@@ -130,6 +181,7 @@ type State interface {
decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)
precommits() (adt.Map, error)
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (SectorPreCommitOnChainInfo, error)
+ GetState() interface{}
}
type Deadline interface {
diff --git a/chain/actors/builtin/miner/state.go.template b/chain/actors/builtin/miner/state.go.template
index 0769eea10..b7e5f40df 100644
--- a/chain/actors/builtin/miner/state.go.template
+++ b/chain/actors/builtin/miner/state.go.template
@@ -35,6 +35,12 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make{{.v}}(store adt.Store) (State, error) {
+ out := state{{.v}}{store: store}
+ out.State = miner{{.v}}.State{}
+ return &out, nil
+}
+
type state{{.v}} struct {
miner{{.v}}.State
store adt.Store
@@ -245,6 +251,10 @@ func (s *state{{.v}}) IsAllocated(num abi.SectorNumber) (bool, error) {
return allocatedSectors.IsSet(uint64(num))
}
+func (s *state{{.v}}) GetProvingPeriodStart() (abi.ChainEpoch, error) {
+ return s.State.ProvingPeriodStart, nil
+}
+
func (s *state{{.v}}) LoadDeadline(idx uint64) (Deadline, error) {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
@@ -366,6 +376,45 @@ func (s *state{{.v}}) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (Secto
return fromV{{.v}}SectorPreCommitOnChainInfo(sp), nil
}
+func (s *state{{.v}}) EraseAllUnproven() error {
+ {{if (ge .v 2)}}
+ dls, err := s.State.LoadDeadlines(s.store)
+ if err != nil {
+ return err
+ }
+
+ err = dls.ForEach(s.store, func(dindx uint64, dl *miner{{.v}}.Deadline) error {
+ ps, err := dl.PartitionsArray(s.store)
+ if err != nil {
+ return err
+ }
+
+ var part miner{{.v}}.Partition
+ err = ps.ForEach(&part, func(pindx int64) error {
+ _ = part.ActivateUnproven()
+ err = ps.Set(uint64(pindx), &part)
+ return nil
+ })
+
+ if err != nil {
+ return err
+ }
+
+ dl.Partitions, err = ps.Root()
+ if err != nil {
+ return err
+ }
+
+ return dls.UpdateDeadline(s.store, dindx, dl)
+ })
+
+ return s.State.SaveDeadlines(s.store, dls)
+ {{else}}
+ // field doesn't exist until v2
+ {{end}}
+ return nil
+}
+
func (d *deadline{{.v}}) LoadPartition(idx uint64) (Partition, error) {
p, err := d.Deadline.LoadPartition(d.store, idx)
if err != nil {
@@ -458,3 +507,7 @@ func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOn
return (SectorPreCommitOnChainInfo)(v0)
{{end}}
}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/miner/v0.go b/chain/actors/builtin/miner/v0.go
index 2dc8ae23e..344be1993 100644
--- a/chain/actors/builtin/miner/v0.go
+++ b/chain/actors/builtin/miner/v0.go
@@ -32,6 +32,12 @@ func load0(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make0(store adt.Store) (State, error) {
+ out := state0{store: store}
+ out.State = miner0.State{}
+ return &out, nil
+}
+
type state0 struct {
miner0.State
store adt.Store
@@ -242,6 +248,10 @@ func (s *state0) IsAllocated(num abi.SectorNumber) (bool, error) {
return allocatedSectors.IsSet(uint64(num))
}
+func (s *state0) GetProvingPeriodStart() (abi.ChainEpoch, error) {
+ return s.State.ProvingPeriodStart, nil
+}
+
func (s *state0) LoadDeadline(idx uint64) (Deadline, error) {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
@@ -363,6 +373,13 @@ func (s *state0) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreC
return fromV0SectorPreCommitOnChainInfo(sp), nil
}
+func (s *state0) EraseAllUnproven() error {
+
+ // field doesn't exist until v2
+
+ return nil
+}
+
func (d *deadline0) LoadPartition(idx uint64) (Partition, error) {
p, err := d.Deadline.LoadPartition(d.store, idx)
if err != nil {
@@ -426,3 +443,7 @@ func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) Sect
return (SectorPreCommitOnChainInfo)(v0)
}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/miner/v2.go b/chain/actors/builtin/miner/v2.go
index 7564dd8b8..3e76d0b69 100644
--- a/chain/actors/builtin/miner/v2.go
+++ b/chain/actors/builtin/miner/v2.go
@@ -30,6 +30,12 @@ func load2(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make2(store adt.Store) (State, error) {
+ out := state2{store: store}
+ out.State = miner2.State{}
+ return &out, nil
+}
+
type state2 struct {
miner2.State
store adt.Store
@@ -240,6 +246,10 @@ func (s *state2) IsAllocated(num abi.SectorNumber) (bool, error) {
return allocatedSectors.IsSet(uint64(num))
}
+func (s *state2) GetProvingPeriodStart() (abi.ChainEpoch, error) {
+ return s.State.ProvingPeriodStart, nil
+}
+
func (s *state2) LoadDeadline(idx uint64) (Deadline, error) {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
@@ -361,6 +371,43 @@ func (s *state2) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreC
return fromV2SectorPreCommitOnChainInfo(sp), nil
}
+func (s *state2) EraseAllUnproven() error {
+
+ dls, err := s.State.LoadDeadlines(s.store)
+ if err != nil {
+ return err
+ }
+
+ err = dls.ForEach(s.store, func(dindx uint64, dl *miner2.Deadline) error {
+ ps, err := dl.PartitionsArray(s.store)
+ if err != nil {
+ return err
+ }
+
+ var part miner2.Partition
+ err = ps.ForEach(&part, func(pindx int64) error {
+ _ = part.ActivateUnproven()
+ err = ps.Set(uint64(pindx), &part)
+ return nil
+ })
+
+ if err != nil {
+ return err
+ }
+
+ dl.Partitions, err = ps.Root()
+ if err != nil {
+ return err
+ }
+
+ return dls.UpdateDeadline(s.store, dindx, dl)
+ })
+
+ return s.State.SaveDeadlines(s.store, dls)
+
+ return nil
+}
+
func (d *deadline2) LoadPartition(idx uint64) (Partition, error) {
p, err := d.Deadline.LoadPartition(d.store, idx)
if err != nil {
@@ -442,3 +489,7 @@ func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) Sect
}
}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/miner/v3.go b/chain/actors/builtin/miner/v3.go
index 72a080f73..72986233d 100644
--- a/chain/actors/builtin/miner/v3.go
+++ b/chain/actors/builtin/miner/v3.go
@@ -32,6 +32,12 @@ func load3(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make3(store adt.Store) (State, error) {
+ out := state3{store: store}
+ out.State = miner3.State{}
+ return &out, nil
+}
+
type state3 struct {
miner3.State
store adt.Store
@@ -242,6 +248,10 @@ func (s *state3) IsAllocated(num abi.SectorNumber) (bool, error) {
return allocatedSectors.IsSet(uint64(num))
}
+func (s *state3) GetProvingPeriodStart() (abi.ChainEpoch, error) {
+ return s.State.ProvingPeriodStart, nil
+}
+
func (s *state3) LoadDeadline(idx uint64) (Deadline, error) {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
@@ -358,6 +368,43 @@ func (s *state3) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreC
return fromV3SectorPreCommitOnChainInfo(sp), nil
}
+func (s *state3) EraseAllUnproven() error {
+
+ dls, err := s.State.LoadDeadlines(s.store)
+ if err != nil {
+ return err
+ }
+
+ err = dls.ForEach(s.store, func(dindx uint64, dl *miner3.Deadline) error {
+ ps, err := dl.PartitionsArray(s.store)
+ if err != nil {
+ return err
+ }
+
+ var part miner3.Partition
+ err = ps.ForEach(&part, func(pindx int64) error {
+ _ = part.ActivateUnproven()
+ err = ps.Set(uint64(pindx), &part)
+ return nil
+ })
+
+ if err != nil {
+ return err
+ }
+
+ dl.Partitions, err = ps.Root()
+ if err != nil {
+ return err
+ }
+
+ return dls.UpdateDeadline(s.store, dindx, dl)
+ })
+
+ return s.State.SaveDeadlines(s.store, dls)
+
+ return nil
+}
+
func (d *deadline3) LoadPartition(idx uint64) (Partition, error) {
p, err := d.Deadline.LoadPartition(d.store, idx)
if err != nil {
@@ -443,3 +490,7 @@ func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) Sect
}
}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/miner/v4.go b/chain/actors/builtin/miner/v4.go
index 698bdf2f5..96ed21f04 100644
--- a/chain/actors/builtin/miner/v4.go
+++ b/chain/actors/builtin/miner/v4.go
@@ -32,6 +32,12 @@ func load4(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make4(store adt.Store) (State, error) {
+ out := state4{store: store}
+ out.State = miner4.State{}
+ return &out, nil
+}
+
type state4 struct {
miner4.State
store adt.Store
@@ -242,6 +248,10 @@ func (s *state4) IsAllocated(num abi.SectorNumber) (bool, error) {
return allocatedSectors.IsSet(uint64(num))
}
+func (s *state4) GetProvingPeriodStart() (abi.ChainEpoch, error) {
+ return s.State.ProvingPeriodStart, nil
+}
+
func (s *state4) LoadDeadline(idx uint64) (Deadline, error) {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
@@ -358,6 +368,43 @@ func (s *state4) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreC
return fromV4SectorPreCommitOnChainInfo(sp), nil
}
+func (s *state4) EraseAllUnproven() error {
+
+ dls, err := s.State.LoadDeadlines(s.store)
+ if err != nil {
+ return err
+ }
+
+ err = dls.ForEach(s.store, func(dindx uint64, dl *miner4.Deadline) error {
+ ps, err := dl.PartitionsArray(s.store)
+ if err != nil {
+ return err
+ }
+
+ var part miner4.Partition
+ err = ps.ForEach(&part, func(pindx int64) error {
+ _ = part.ActivateUnproven()
+ err = ps.Set(uint64(pindx), &part)
+ return nil
+ })
+
+ if err != nil {
+ return err
+ }
+
+ dl.Partitions, err = ps.Root()
+ if err != nil {
+ return err
+ }
+
+ return dls.UpdateDeadline(s.store, dindx, dl)
+ })
+
+ return s.State.SaveDeadlines(s.store, dls)
+
+ return nil
+}
+
func (d *deadline4) LoadPartition(idx uint64) (Partition, error) {
p, err := d.Deadline.LoadPartition(d.store, idx)
if err != nil {
@@ -443,3 +490,7 @@ func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) Sect
}
}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/miner/v5.go b/chain/actors/builtin/miner/v5.go
index eea00b6e9..7996acf32 100644
--- a/chain/actors/builtin/miner/v5.go
+++ b/chain/actors/builtin/miner/v5.go
@@ -32,6 +32,12 @@ func load5(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make5(store adt.Store) (State, error) {
+ out := state5{store: store}
+ out.State = miner5.State{}
+ return &out, nil
+}
+
type state5 struct {
miner5.State
store adt.Store
@@ -242,6 +248,10 @@ func (s *state5) IsAllocated(num abi.SectorNumber) (bool, error) {
return allocatedSectors.IsSet(uint64(num))
}
+func (s *state5) GetProvingPeriodStart() (abi.ChainEpoch, error) {
+ return s.State.ProvingPeriodStart, nil
+}
+
func (s *state5) LoadDeadline(idx uint64) (Deadline, error) {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
@@ -358,6 +368,43 @@ func (s *state5) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreC
return fromV5SectorPreCommitOnChainInfo(sp), nil
}
+func (s *state5) EraseAllUnproven() error {
+
+ dls, err := s.State.LoadDeadlines(s.store)
+ if err != nil {
+ return err
+ }
+
+ err = dls.ForEach(s.store, func(dindx uint64, dl *miner5.Deadline) error {
+ ps, err := dl.PartitionsArray(s.store)
+ if err != nil {
+ return err
+ }
+
+ var part miner5.Partition
+ err = ps.ForEach(&part, func(pindx int64) error {
+ _ = part.ActivateUnproven()
+ err = ps.Set(uint64(pindx), &part)
+ return nil
+ })
+
+ if err != nil {
+ return err
+ }
+
+ dl.Partitions, err = ps.Root()
+ if err != nil {
+ return err
+ }
+
+ return dls.UpdateDeadline(s.store, dindx, dl)
+ })
+
+ return s.State.SaveDeadlines(s.store, dls)
+
+ return nil
+}
+
func (d *deadline5) LoadPartition(idx uint64) (Partition, error) {
p, err := d.Deadline.LoadPartition(d.store, idx)
if err != nil {
@@ -443,3 +490,7 @@ func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) Sect
}
}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/multisig/actor.go.template b/chain/actors/builtin/multisig/actor.go.template
index f741eba93..77bc13f67 100644
--- a/chain/actors/builtin/multisig/actor.go.template
+++ b/chain/actors/builtin/multisig/actor.go.template
@@ -41,6 +41,27 @@ 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, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.MultisigActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -56,6 +77,7 @@ type State interface {
transactions() (adt.Map, error)
decodeTransaction(val *cbg.Deferred) (Transaction, error)
+ GetState() interface{}
}
type Transaction = msig0.Transaction
diff --git a/chain/actors/builtin/multisig/multisig.go b/chain/actors/builtin/multisig/multisig.go
index eafd418e0..ae6a9daf3 100644
--- a/chain/actors/builtin/multisig/multisig.go
+++ b/chain/actors/builtin/multisig/multisig.go
@@ -76,6 +76,51 @@ 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, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
+
+ case actors.Version2:
+ return make2(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
+
+ case actors.Version3:
+ return make3(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
+
+ case actors.Version4:
+ return make4(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
+
+ case actors.Version5:
+ return make5(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.MultisigActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.MultisigActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.MultisigActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.MultisigActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.MultisigActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -91,6 +136,7 @@ type State interface {
transactions() (adt.Map, error)
decodeTransaction(val *cbg.Deferred) (Transaction, error)
+ GetState() interface{}
}
type Transaction = msig0.Transaction
diff --git a/chain/actors/builtin/multisig/state.go.template b/chain/actors/builtin/multisig/state.go.template
index 2316aadba..6c0130c09 100644
--- a/chain/actors/builtin/multisig/state.go.template
+++ b/chain/actors/builtin/multisig/state.go.template
@@ -31,6 +31,32 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make{{.v}}(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
+ out := state{{.v}}{store: store}
+ out.State = msig{{.v}}.State{}
+ out.State.Signers = signers
+ out.State.NumApprovalsThreshold = threshold
+ out.State.StartEpoch = startEpoch
+ out.State.UnlockDuration = unlockDuration
+ out.State.InitialBalance = initialBalance
+ {{if (le .v 2)}}
+ em, err := adt{{.v}}.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State.PendingTxns = em
+ {{else}}
+ em, err := adt{{.v}}.StoreEmptyMap(store, builtin{{.v}}.DefaultHamtBitwidth)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State.PendingTxns = em
+ {{end}}
+ return &out, nil
+}
+
type state{{.v}} struct {
msig{{.v}}.State
store adt.Store
@@ -95,3 +121,7 @@ func (s *state{{.v}}) decodeTransaction(val *cbg.Deferred) (Transaction, error)
}
return tx, nil
}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/multisig/v0.go b/chain/actors/builtin/multisig/v0.go
index 20c1557b0..973ac9209 100644
--- a/chain/actors/builtin/multisig/v0.go
+++ b/chain/actors/builtin/multisig/v0.go
@@ -28,6 +28,25 @@ func load0(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make0(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
+ out := state0{store: store}
+ out.State = msig0.State{}
+ out.State.Signers = signers
+ out.State.NumApprovalsThreshold = threshold
+ out.State.StartEpoch = startEpoch
+ out.State.UnlockDuration = unlockDuration
+ out.State.InitialBalance = initialBalance
+
+ em, err := adt0.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State.PendingTxns = em
+
+ return &out, nil
+}
+
type state0 struct {
msig0.State
store adt.Store
@@ -92,3 +111,7 @@ func (s *state0) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
}
return tx, nil
}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/multisig/v2.go b/chain/actors/builtin/multisig/v2.go
index ef317f903..5b830e695 100644
--- a/chain/actors/builtin/multisig/v2.go
+++ b/chain/actors/builtin/multisig/v2.go
@@ -28,6 +28,25 @@ func load2(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make2(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
+ out := state2{store: store}
+ out.State = msig2.State{}
+ out.State.Signers = signers
+ out.State.NumApprovalsThreshold = threshold
+ out.State.StartEpoch = startEpoch
+ out.State.UnlockDuration = unlockDuration
+ out.State.InitialBalance = initialBalance
+
+ em, err := adt2.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State.PendingTxns = em
+
+ return &out, nil
+}
+
type state2 struct {
msig2.State
store adt.Store
@@ -92,3 +111,7 @@ func (s *state2) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
}
return tx, nil
}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/multisig/v3.go b/chain/actors/builtin/multisig/v3.go
index 8834e4553..c4a2791b7 100644
--- a/chain/actors/builtin/multisig/v3.go
+++ b/chain/actors/builtin/multisig/v3.go
@@ -30,6 +30,25 @@ func load3(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make3(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
+ out := state3{store: store}
+ out.State = msig3.State{}
+ out.State.Signers = signers
+ out.State.NumApprovalsThreshold = threshold
+ out.State.StartEpoch = startEpoch
+ out.State.UnlockDuration = unlockDuration
+ out.State.InitialBalance = initialBalance
+
+ em, err := adt3.StoreEmptyMap(store, builtin3.DefaultHamtBitwidth)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State.PendingTxns = em
+
+ return &out, nil
+}
+
type state3 struct {
msig3.State
store adt.Store
@@ -94,3 +113,7 @@ func (s *state3) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
}
return tx, nil
}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/multisig/v4.go b/chain/actors/builtin/multisig/v4.go
index 9f9dc7573..a35a890f8 100644
--- a/chain/actors/builtin/multisig/v4.go
+++ b/chain/actors/builtin/multisig/v4.go
@@ -30,6 +30,25 @@ func load4(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make4(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
+ out := state4{store: store}
+ out.State = msig4.State{}
+ out.State.Signers = signers
+ out.State.NumApprovalsThreshold = threshold
+ out.State.StartEpoch = startEpoch
+ out.State.UnlockDuration = unlockDuration
+ out.State.InitialBalance = initialBalance
+
+ em, err := adt4.StoreEmptyMap(store, builtin4.DefaultHamtBitwidth)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State.PendingTxns = em
+
+ return &out, nil
+}
+
type state4 struct {
msig4.State
store adt.Store
@@ -94,3 +113,7 @@ func (s *state4) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
}
return tx, nil
}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/multisig/v5.go b/chain/actors/builtin/multisig/v5.go
index e879783ba..4ad9aea94 100644
--- a/chain/actors/builtin/multisig/v5.go
+++ b/chain/actors/builtin/multisig/v5.go
@@ -30,6 +30,25 @@ func load5(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make5(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
+ out := state5{store: store}
+ out.State = msig5.State{}
+ out.State.Signers = signers
+ out.State.NumApprovalsThreshold = threshold
+ out.State.StartEpoch = startEpoch
+ out.State.UnlockDuration = unlockDuration
+ out.State.InitialBalance = initialBalance
+
+ em, err := adt5.StoreEmptyMap(store, builtin5.DefaultHamtBitwidth)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State.PendingTxns = em
+
+ return &out, nil
+}
+
type state5 struct {
msig5.State
store adt.Store
@@ -94,3 +113,7 @@ func (s *state5) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
}
return tx, nil
}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/paych/actor.go.template b/chain/actors/builtin/paych/actor.go.template
index 3f68a5cfa..7699e76b6 100644
--- a/chain/actors/builtin/paych/actor.go.template
+++ b/chain/actors/builtin/paych/actor.go.template
@@ -42,6 +42,27 @@ 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) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.PaymentChannelActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
// State is an abstract version of payment channel state that works across
// versions
type State interface {
@@ -62,6 +83,8 @@ type State interface {
// Iterate lane states
ForEachLaneState(cb func(idx uint64, dl LaneState) error) error
+
+ GetState() interface{}
}
// LaneState is an abstract copy of the state of a single lane
diff --git a/chain/actors/builtin/paych/mock/mock.go b/chain/actors/builtin/paych/mock/mock.go
index 3b82511ff..1ecfa1130 100644
--- a/chain/actors/builtin/paych/mock/mock.go
+++ b/chain/actors/builtin/paych/mock/mock.go
@@ -17,6 +17,10 @@ type mockState struct {
lanes map[uint64]paych.LaneState
}
+func (ms *mockState) GetState() interface{} {
+ panic("implement me")
+}
+
type mockLaneState struct {
redeemed big.Int
nonce uint64
diff --git a/chain/actors/builtin/paych/paych.go b/chain/actors/builtin/paych/paych.go
index bafd6e94d..d87f70f0c 100644
--- a/chain/actors/builtin/paych/paych.go
+++ b/chain/actors/builtin/paych/paych.go
@@ -77,6 +77,51 @@ 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) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store)
+
+ case actors.Version2:
+ return make2(store)
+
+ case actors.Version3:
+ return make3(store)
+
+ case actors.Version4:
+ return make4(store)
+
+ case actors.Version5:
+ return make5(store)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.PaymentChannelActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.PaymentChannelActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.PaymentChannelActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.PaymentChannelActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.PaymentChannelActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
// State is an abstract version of payment channel state that works across
// versions
type State interface {
@@ -97,6 +142,8 @@ type State interface {
// Iterate lane states
ForEachLaneState(cb func(idx uint64, dl LaneState) error) error
+
+ GetState() interface{}
}
// LaneState is an abstract copy of the state of a single lane
diff --git a/chain/actors/builtin/paych/state.go.template b/chain/actors/builtin/paych/state.go.template
index b4b575a3e..3e41f5be5 100644
--- a/chain/actors/builtin/paych/state.go.template
+++ b/chain/actors/builtin/paych/state.go.template
@@ -24,6 +24,12 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make{{.v}}(store adt.Store) (State, error) {
+ out := state{{.v}}{store: store}
+ out.State = paych{{.v}}.State{}
+ return &out, nil
+}
+
type state{{.v}} struct {
paych{{.v}}.State
store adt.Store
@@ -74,6 +80,10 @@ func (s *state{{.v}}) LaneCount() (uint64, error) {
return lsamt.Length(), nil
}
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
+
// Iterate lane states
func (s *state{{.v}}) ForEachLaneState(cb func(idx uint64, dl LaneState) error) error {
// Get the lane state from the chain
diff --git a/chain/actors/builtin/paych/v0.go b/chain/actors/builtin/paych/v0.go
index 8e0e3434e..e9bc30e3d 100644
--- a/chain/actors/builtin/paych/v0.go
+++ b/chain/actors/builtin/paych/v0.go
@@ -24,6 +24,12 @@ func load0(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make0(store adt.Store) (State, error) {
+ out := state0{store: store}
+ out.State = paych0.State{}
+ return &out, nil
+}
+
type state0 struct {
paych0.State
store adt.Store
@@ -74,6 +80,10 @@ func (s *state0) LaneCount() (uint64, error) {
return lsamt.Length(), nil
}
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
+
// Iterate lane states
func (s *state0) ForEachLaneState(cb func(idx uint64, dl LaneState) error) error {
// Get the lane state from the chain
diff --git a/chain/actors/builtin/paych/v2.go b/chain/actors/builtin/paych/v2.go
index fbf4b9fde..400305e2f 100644
--- a/chain/actors/builtin/paych/v2.go
+++ b/chain/actors/builtin/paych/v2.go
@@ -24,6 +24,12 @@ func load2(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make2(store adt.Store) (State, error) {
+ out := state2{store: store}
+ out.State = paych2.State{}
+ return &out, nil
+}
+
type state2 struct {
paych2.State
store adt.Store
@@ -74,6 +80,10 @@ func (s *state2) LaneCount() (uint64, error) {
return lsamt.Length(), nil
}
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
+
// Iterate lane states
func (s *state2) ForEachLaneState(cb func(idx uint64, dl LaneState) error) error {
// Get the lane state from the chain
diff --git a/chain/actors/builtin/paych/v3.go b/chain/actors/builtin/paych/v3.go
index 14bb4cb61..1d7c2f94b 100644
--- a/chain/actors/builtin/paych/v3.go
+++ b/chain/actors/builtin/paych/v3.go
@@ -24,6 +24,12 @@ func load3(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make3(store adt.Store) (State, error) {
+ out := state3{store: store}
+ out.State = paych3.State{}
+ return &out, nil
+}
+
type state3 struct {
paych3.State
store adt.Store
@@ -74,6 +80,10 @@ func (s *state3) LaneCount() (uint64, error) {
return lsamt.Length(), nil
}
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
+
// Iterate lane states
func (s *state3) ForEachLaneState(cb func(idx uint64, dl LaneState) error) error {
// Get the lane state from the chain
diff --git a/chain/actors/builtin/paych/v4.go b/chain/actors/builtin/paych/v4.go
index cf37eea5c..b7d1e52a5 100644
--- a/chain/actors/builtin/paych/v4.go
+++ b/chain/actors/builtin/paych/v4.go
@@ -24,6 +24,12 @@ func load4(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make4(store adt.Store) (State, error) {
+ out := state4{store: store}
+ out.State = paych4.State{}
+ return &out, nil
+}
+
type state4 struct {
paych4.State
store adt.Store
@@ -74,6 +80,10 @@ func (s *state4) LaneCount() (uint64, error) {
return lsamt.Length(), nil
}
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
+
// Iterate lane states
func (s *state4) ForEachLaneState(cb func(idx uint64, dl LaneState) error) error {
// Get the lane state from the chain
diff --git a/chain/actors/builtin/paych/v5.go b/chain/actors/builtin/paych/v5.go
index f878d858c..b331a1500 100644
--- a/chain/actors/builtin/paych/v5.go
+++ b/chain/actors/builtin/paych/v5.go
@@ -24,6 +24,12 @@ func load5(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make5(store adt.Store) (State, error) {
+ out := state5{store: store}
+ out.State = paych5.State{}
+ return &out, nil
+}
+
type state5 struct {
paych5.State
store adt.Store
@@ -74,6 +80,10 @@ func (s *state5) LaneCount() (uint64, error) {
return lsamt.Length(), nil
}
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
+
// Iterate lane states
func (s *state5) ForEachLaneState(cb func(idx uint64, dl LaneState) error) error {
// Get the lane state from the chain
diff --git a/chain/actors/builtin/power/actor.go.template b/chain/actors/builtin/power/actor.go.template
index 82f791e58..fe11fc160 100644
--- a/chain/actors/builtin/power/actor.go.template
+++ b/chain/actors/builtin/power/actor.go.template
@@ -3,6 +3,7 @@ package power
import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/chain/actors"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
@@ -40,6 +41,27 @@ 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) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.StoragePowerActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -47,6 +69,7 @@ type State interface {
TotalPower() (Claim, error)
TotalCommitted() (Claim, error)
TotalPowerSmoothed() (builtin.FilterEstimate, error)
+ GetState() interface{}
// MinerCounts returns the number of miners. Participating is the number
// with power above the minimum miner threshold.
@@ -57,6 +80,12 @@ type State interface {
ForEachClaim(func(miner address.Address, claim Claim) error) error
ClaimsChanged(State) (bool, error)
+ // Testing or genesis setup only
+ SetTotalQualityAdjPower(abi.StoragePower) error
+ SetTotalRawBytePower(abi.StoragePower) error
+ SetThisEpochQualityAdjPower(abi.StoragePower) error
+ SetThisEpochRawBytePower(abi.StoragePower) error
+
// Diff helpers. Used by Diff* functions internally.
claims() (adt.Map, error)
decodeClaim(*cbg.Deferred) (Claim, error)
diff --git a/chain/actors/builtin/power/power.go b/chain/actors/builtin/power/power.go
index 2cf59ef02..5b4aa1b04 100644
--- a/chain/actors/builtin/power/power.go
+++ b/chain/actors/builtin/power/power.go
@@ -3,6 +3,7 @@ package power
import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/chain/actors"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
@@ -75,6 +76,51 @@ 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) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store)
+
+ case actors.Version2:
+ return make2(store)
+
+ case actors.Version3:
+ return make3(store)
+
+ case actors.Version4:
+ return make4(store)
+
+ case actors.Version5:
+ return make5(store)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.StoragePowerActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.StoragePowerActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.StoragePowerActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.StoragePowerActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.StoragePowerActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -82,6 +128,7 @@ type State interface {
TotalPower() (Claim, error)
TotalCommitted() (Claim, error)
TotalPowerSmoothed() (builtin.FilterEstimate, error)
+ GetState() interface{}
// MinerCounts returns the number of miners. Participating is the number
// with power above the minimum miner threshold.
@@ -92,6 +139,12 @@ type State interface {
ForEachClaim(func(miner address.Address, claim Claim) error) error
ClaimsChanged(State) (bool, error)
+ // Testing or genesis setup only
+ SetTotalQualityAdjPower(abi.StoragePower) error
+ SetTotalRawBytePower(abi.StoragePower) error
+ SetThisEpochQualityAdjPower(abi.StoragePower) error
+ SetThisEpochRawBytePower(abi.StoragePower) error
+
// Diff helpers. Used by Diff* functions internally.
claims() (adt.Map, error)
decodeClaim(*cbg.Deferred) (Claim, error)
diff --git a/chain/actors/builtin/power/state.go.template b/chain/actors/builtin/power/state.go.template
index 4cb904a1d..fcdc5c350 100644
--- a/chain/actors/builtin/power/state.go.template
+++ b/chain/actors/builtin/power/state.go.template
@@ -29,6 +29,32 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make{{.v}}(store adt.Store) (State, error) {
+ out := state{{.v}}{store: store}
+ {{if (le .v 2)}}
+ em, err := adt{{.v}}.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ emm, err := adt{{.v}}.MakeEmptyMultimap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *power{{.v}}.ConstructState(em, emm)
+ {{else}}
+ s, err := power{{.v}}.ConstructState(store)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+ {{end}}
+
+ return &out, nil
+}
+
type state{{.v}} struct {
power{{.v}}.State
store adt.Store
@@ -131,6 +157,30 @@ func (s *state{{.v}}) ClaimsChanged(other State) (bool, error) {
return !s.State.Claims.Equals(other{{.v}}.State.Claims), nil
}
+func (s *state{{.v}}) SetTotalQualityAdjPower(p abi.StoragePower) error {
+ s.State.TotalQualityAdjPower = p
+ return nil
+}
+
+func (s *state{{.v}}) SetTotalRawBytePower(p abi.StoragePower) error {
+ s.State.TotalRawBytePower = p
+ return nil
+}
+
+func (s *state{{.v}}) SetThisEpochQualityAdjPower(p abi.StoragePower) error {
+ s.State.ThisEpochQualityAdjPower = p
+ return nil
+}
+
+func (s *state{{.v}}) SetThisEpochRawBytePower(p abi.StoragePower) error {
+ s.State.ThisEpochRawBytePower = p
+ return nil
+}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
+
func (s *state{{.v}}) claims() (adt.Map, error) {
return adt{{.v}}.AsMap(s.store, s.Claims{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}})
}
diff --git a/chain/actors/builtin/power/v0.go b/chain/actors/builtin/power/v0.go
index 91fad8c57..465d16c5c 100644
--- a/chain/actors/builtin/power/v0.go
+++ b/chain/actors/builtin/power/v0.go
@@ -26,6 +26,24 @@ func load0(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make0(store adt.Store) (State, error) {
+ out := state0{store: store}
+
+ em, err := adt0.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ emm, err := adt0.MakeEmptyMultimap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *power0.ConstructState(em, emm)
+
+ return &out, nil
+}
+
type state0 struct {
power0.State
store adt.Store
@@ -128,6 +146,30 @@ func (s *state0) ClaimsChanged(other State) (bool, error) {
return !s.State.Claims.Equals(other0.State.Claims), nil
}
+func (s *state0) SetTotalQualityAdjPower(p abi.StoragePower) error {
+ s.State.TotalQualityAdjPower = p
+ return nil
+}
+
+func (s *state0) SetTotalRawBytePower(p abi.StoragePower) error {
+ s.State.TotalRawBytePower = p
+ return nil
+}
+
+func (s *state0) SetThisEpochQualityAdjPower(p abi.StoragePower) error {
+ s.State.ThisEpochQualityAdjPower = p
+ return nil
+}
+
+func (s *state0) SetThisEpochRawBytePower(p abi.StoragePower) error {
+ s.State.ThisEpochRawBytePower = p
+ return nil
+}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
+
func (s *state0) claims() (adt.Map, error) {
return adt0.AsMap(s.store, s.Claims)
}
diff --git a/chain/actors/builtin/power/v2.go b/chain/actors/builtin/power/v2.go
index 313160a78..606534cef 100644
--- a/chain/actors/builtin/power/v2.go
+++ b/chain/actors/builtin/power/v2.go
@@ -26,6 +26,24 @@ func load2(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make2(store adt.Store) (State, error) {
+ out := state2{store: store}
+
+ em, err := adt2.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ emm, err := adt2.MakeEmptyMultimap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *power2.ConstructState(em, emm)
+
+ return &out, nil
+}
+
type state2 struct {
power2.State
store adt.Store
@@ -128,6 +146,30 @@ func (s *state2) ClaimsChanged(other State) (bool, error) {
return !s.State.Claims.Equals(other2.State.Claims), nil
}
+func (s *state2) SetTotalQualityAdjPower(p abi.StoragePower) error {
+ s.State.TotalQualityAdjPower = p
+ return nil
+}
+
+func (s *state2) SetTotalRawBytePower(p abi.StoragePower) error {
+ s.State.TotalRawBytePower = p
+ return nil
+}
+
+func (s *state2) SetThisEpochQualityAdjPower(p abi.StoragePower) error {
+ s.State.ThisEpochQualityAdjPower = p
+ return nil
+}
+
+func (s *state2) SetThisEpochRawBytePower(p abi.StoragePower) error {
+ s.State.ThisEpochRawBytePower = p
+ return nil
+}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
+
func (s *state2) claims() (adt.Map, error) {
return adt2.AsMap(s.store, s.Claims)
}
diff --git a/chain/actors/builtin/power/v3.go b/chain/actors/builtin/power/v3.go
index 2ef1e2808..3dec3c63e 100644
--- a/chain/actors/builtin/power/v3.go
+++ b/chain/actors/builtin/power/v3.go
@@ -28,6 +28,19 @@ func load3(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make3(store adt.Store) (State, error) {
+ out := state3{store: store}
+
+ s, err := power3.ConstructState(store)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state3 struct {
power3.State
store adt.Store
@@ -130,6 +143,30 @@ func (s *state3) ClaimsChanged(other State) (bool, error) {
return !s.State.Claims.Equals(other3.State.Claims), nil
}
+func (s *state3) SetTotalQualityAdjPower(p abi.StoragePower) error {
+ s.State.TotalQualityAdjPower = p
+ return nil
+}
+
+func (s *state3) SetTotalRawBytePower(p abi.StoragePower) error {
+ s.State.TotalRawBytePower = p
+ return nil
+}
+
+func (s *state3) SetThisEpochQualityAdjPower(p abi.StoragePower) error {
+ s.State.ThisEpochQualityAdjPower = p
+ return nil
+}
+
+func (s *state3) SetThisEpochRawBytePower(p abi.StoragePower) error {
+ s.State.ThisEpochRawBytePower = p
+ return nil
+}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
+
func (s *state3) claims() (adt.Map, error) {
return adt3.AsMap(s.store, s.Claims, builtin3.DefaultHamtBitwidth)
}
diff --git a/chain/actors/builtin/power/v4.go b/chain/actors/builtin/power/v4.go
index 686550456..b73eedf5a 100644
--- a/chain/actors/builtin/power/v4.go
+++ b/chain/actors/builtin/power/v4.go
@@ -28,6 +28,19 @@ func load4(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make4(store adt.Store) (State, error) {
+ out := state4{store: store}
+
+ s, err := power4.ConstructState(store)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state4 struct {
power4.State
store adt.Store
@@ -130,6 +143,30 @@ func (s *state4) ClaimsChanged(other State) (bool, error) {
return !s.State.Claims.Equals(other4.State.Claims), nil
}
+func (s *state4) SetTotalQualityAdjPower(p abi.StoragePower) error {
+ s.State.TotalQualityAdjPower = p
+ return nil
+}
+
+func (s *state4) SetTotalRawBytePower(p abi.StoragePower) error {
+ s.State.TotalRawBytePower = p
+ return nil
+}
+
+func (s *state4) SetThisEpochQualityAdjPower(p abi.StoragePower) error {
+ s.State.ThisEpochQualityAdjPower = p
+ return nil
+}
+
+func (s *state4) SetThisEpochRawBytePower(p abi.StoragePower) error {
+ s.State.ThisEpochRawBytePower = p
+ return nil
+}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
+
func (s *state4) claims() (adt.Map, error) {
return adt4.AsMap(s.store, s.Claims, builtin4.DefaultHamtBitwidth)
}
diff --git a/chain/actors/builtin/power/v5.go b/chain/actors/builtin/power/v5.go
index 33a5d3b62..84b23a577 100644
--- a/chain/actors/builtin/power/v5.go
+++ b/chain/actors/builtin/power/v5.go
@@ -28,6 +28,19 @@ func load5(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make5(store adt.Store) (State, error) {
+ out := state5{store: store}
+
+ s, err := power5.ConstructState(store)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state5 struct {
power5.State
store adt.Store
@@ -130,6 +143,30 @@ func (s *state5) ClaimsChanged(other State) (bool, error) {
return !s.State.Claims.Equals(other5.State.Claims), nil
}
+func (s *state5) SetTotalQualityAdjPower(p abi.StoragePower) error {
+ s.State.TotalQualityAdjPower = p
+ return nil
+}
+
+func (s *state5) SetTotalRawBytePower(p abi.StoragePower) error {
+ s.State.TotalRawBytePower = p
+ return nil
+}
+
+func (s *state5) SetThisEpochQualityAdjPower(p abi.StoragePower) error {
+ s.State.ThisEpochQualityAdjPower = p
+ return nil
+}
+
+func (s *state5) SetThisEpochRawBytePower(p abi.StoragePower) error {
+ s.State.ThisEpochRawBytePower = p
+ return nil
+}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
+
func (s *state5) claims() (adt.Map, error) {
return adt5.AsMap(s.store, s.Claims, builtin5.DefaultHamtBitwidth)
}
diff --git a/chain/actors/builtin/reward/actor.go.template b/chain/actors/builtin/reward/actor.go.template
index 81437d26f..89cdddaec 100644
--- a/chain/actors/builtin/reward/actor.go.template
+++ b/chain/actors/builtin/reward/actor.go.template
@@ -4,6 +4,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
reward0 "github.com/filecoin-project/specs-actors/actors/builtin/reward"
"github.com/ipfs/go-cid"
+ "github.com/filecoin-project/lotus/chain/actors"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/cbor"
@@ -38,6 +39,27 @@ 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, currRealizedPower abi.StoragePower) (State, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store, currRealizedPower)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.RewardActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -55,6 +77,7 @@ type State interface {
InitialPledgeForPower(abi.StoragePower, abi.TokenAmount, *builtin.FilterEstimate, abi.TokenAmount) (abi.TokenAmount, error)
PreCommitDepositForPower(builtin.FilterEstimate, abi.StoragePower) (abi.TokenAmount, error)
+ GetState() interface{}
}
type AwardBlockRewardParams = reward0.AwardBlockRewardParams
diff --git a/chain/actors/builtin/reward/reward.go b/chain/actors/builtin/reward/reward.go
index 5f6131334..ebec85517 100644
--- a/chain/actors/builtin/reward/reward.go
+++ b/chain/actors/builtin/reward/reward.go
@@ -2,6 +2,7 @@ package reward
import (
"github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/chain/actors"
reward0 "github.com/filecoin-project/specs-actors/actors/builtin/reward"
"github.com/ipfs/go-cid"
"golang.org/x/xerrors"
@@ -73,6 +74,51 @@ 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, currRealizedPower abi.StoragePower) (State, error) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store, currRealizedPower)
+
+ case actors.Version2:
+ return make2(store, currRealizedPower)
+
+ case actors.Version3:
+ return make3(store, currRealizedPower)
+
+ case actors.Version4:
+ return make4(store, currRealizedPower)
+
+ case actors.Version5:
+ return make5(store, currRealizedPower)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.RewardActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.RewardActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.RewardActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.RewardActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.RewardActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -90,6 +136,7 @@ type State interface {
InitialPledgeForPower(abi.StoragePower, abi.TokenAmount, *builtin.FilterEstimate, abi.TokenAmount) (abi.TokenAmount, error)
PreCommitDepositForPower(builtin.FilterEstimate, abi.StoragePower) (abi.TokenAmount, error)
+ GetState() interface{}
}
type AwardBlockRewardParams = reward0.AwardBlockRewardParams
diff --git a/chain/actors/builtin/reward/state.go.template b/chain/actors/builtin/reward/state.go.template
index 1758d1413..2bc271cbb 100644
--- a/chain/actors/builtin/reward/state.go.template
+++ b/chain/actors/builtin/reward/state.go.template
@@ -23,6 +23,12 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make{{.v}}(store adt.Store, currRealizedPower abi.StoragePower) (State, error) {
+ out := state{{.v}}{store: store}
+ out.State = *reward{{.v}}.ConstructState(currRealizedPower)
+ return &out, nil
+}
+
type state{{.v}} struct {
reward{{.v}}.State
store adt.Store
@@ -101,3 +107,7 @@ func (s *state{{.v}}) PreCommitDepositForPower(networkQAPower builtin.FilterEsti
},
sectorWeight), nil
}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/reward/v0.go b/chain/actors/builtin/reward/v0.go
index fe053cc16..cd098c151 100644
--- a/chain/actors/builtin/reward/v0.go
+++ b/chain/actors/builtin/reward/v0.go
@@ -23,6 +23,12 @@ func load0(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make0(store adt.Store, currRealizedPower abi.StoragePower) (State, error) {
+ out := state0{store: store}
+ out.State = *reward0.ConstructState(currRealizedPower)
+ return &out, nil
+}
+
type state0 struct {
reward0.State
store adt.Store
@@ -83,3 +89,7 @@ func (s *state0) PreCommitDepositForPower(networkQAPower builtin.FilterEstimate,
},
sectorWeight), nil
}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/reward/v2.go b/chain/actors/builtin/reward/v2.go
index 90621e467..08e9a7bc3 100644
--- a/chain/actors/builtin/reward/v2.go
+++ b/chain/actors/builtin/reward/v2.go
@@ -23,6 +23,12 @@ func load2(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make2(store adt.Store, currRealizedPower abi.StoragePower) (State, error) {
+ out := state2{store: store}
+ out.State = *reward2.ConstructState(currRealizedPower)
+ return &out, nil
+}
+
type state2 struct {
reward2.State
store adt.Store
@@ -86,3 +92,7 @@ func (s *state2) PreCommitDepositForPower(networkQAPower builtin.FilterEstimate,
},
sectorWeight), nil
}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/reward/v3.go b/chain/actors/builtin/reward/v3.go
index 926cc085b..fd9fa56e2 100644
--- a/chain/actors/builtin/reward/v3.go
+++ b/chain/actors/builtin/reward/v3.go
@@ -23,6 +23,12 @@ func load3(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make3(store adt.Store, currRealizedPower abi.StoragePower) (State, error) {
+ out := state3{store: store}
+ out.State = *reward3.ConstructState(currRealizedPower)
+ return &out, nil
+}
+
type state3 struct {
reward3.State
store adt.Store
@@ -86,3 +92,7 @@ func (s *state3) PreCommitDepositForPower(networkQAPower builtin.FilterEstimate,
},
sectorWeight), nil
}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/reward/v4.go b/chain/actors/builtin/reward/v4.go
index f034b0018..310ca04e8 100644
--- a/chain/actors/builtin/reward/v4.go
+++ b/chain/actors/builtin/reward/v4.go
@@ -23,6 +23,12 @@ func load4(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make4(store adt.Store, currRealizedPower abi.StoragePower) (State, error) {
+ out := state4{store: store}
+ out.State = *reward4.ConstructState(currRealizedPower)
+ return &out, nil
+}
+
type state4 struct {
reward4.State
store adt.Store
@@ -86,3 +92,7 @@ func (s *state4) PreCommitDepositForPower(networkQAPower builtin.FilterEstimate,
},
sectorWeight), nil
}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/reward/v5.go b/chain/actors/builtin/reward/v5.go
index 0dd75de73..7200f7d11 100644
--- a/chain/actors/builtin/reward/v5.go
+++ b/chain/actors/builtin/reward/v5.go
@@ -23,6 +23,12 @@ func load5(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make5(store adt.Store, currRealizedPower abi.StoragePower) (State, error) {
+ out := state5{store: store}
+ out.State = *reward5.ConstructState(currRealizedPower)
+ return &out, nil
+}
+
type state5 struct {
reward5.State
store adt.Store
@@ -86,3 +92,7 @@ func (s *state5) PreCommitDepositForPower(networkQAPower builtin.FilterEstimate,
},
sectorWeight), nil
}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/system/actor.go.template b/chain/actors/builtin/system/actor.go.template
new file mode 100644
index 000000000..925319970
--- /dev/null
+++ b/chain/actors/builtin/system/actor.go.template
@@ -0,0 +1,41 @@
+package system
+
+import (
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+ "github.com/filecoin-project/lotus/chain/actors"
+ "golang.org/x/xerrors"
+ "github.com/ipfs/go-cid"
+
+{{range .versions}}
+ builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
+{{end}}
+)
+
+var (
+ Address = builtin{{.latestVersion}}.SystemActorAddr
+)
+
+func MakeState(store adt.Store, av actors.Version) (State, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.SystemActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
+type State interface {
+ GetState() interface{}
+}
diff --git a/chain/actors/builtin/system/state.go.template b/chain/actors/builtin/system/state.go.template
new file mode 100644
index 000000000..fa644f8c7
--- /dev/null
+++ b/chain/actors/builtin/system/state.go.template
@@ -0,0 +1,35 @@
+package system
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ system{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/system"
+)
+
+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) (State, error) {
+ out := state{{.v}}{store: store}
+ out.State = system{{.v}}.State{}
+ return &out, nil
+}
+
+type state{{.v}} struct {
+ system{{.v}}.State
+ store adt.Store
+}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
\ No newline at end of file
diff --git a/chain/actors/builtin/system/system.go b/chain/actors/builtin/system/system.go
new file mode 100644
index 000000000..289fb4d5d
--- /dev/null
+++ b/chain/actors/builtin/system/system.go
@@ -0,0 +1,71 @@
+package system
+
+import (
+ "github.com/filecoin-project/lotus/chain/actors"
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+ "github.com/ipfs/go-cid"
+ "golang.org/x/xerrors"
+
+ builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
+
+ builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
+
+ builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
+
+ builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
+
+ builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
+)
+
+var (
+ Address = builtin5.SystemActorAddr
+)
+
+func MakeState(store adt.Store, av actors.Version) (State, error) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store)
+
+ case actors.Version2:
+ return make2(store)
+
+ case actors.Version3:
+ return make3(store)
+
+ case actors.Version4:
+ return make4(store)
+
+ case actors.Version5:
+ return make5(store)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.SystemActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.SystemActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.SystemActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.SystemActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.SystemActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
+type State interface {
+ GetState() interface{}
+}
diff --git a/chain/actors/builtin/system/v0.go b/chain/actors/builtin/system/v0.go
new file mode 100644
index 000000000..64c6f53d3
--- /dev/null
+++ b/chain/actors/builtin/system/v0.go
@@ -0,0 +1,35 @@
+package system
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ system0 "github.com/filecoin-project/specs-actors/actors/builtin/system"
+)
+
+var _ State = (*state0)(nil)
+
+func load0(store adt.Store, root cid.Cid) (State, error) {
+ out := state0{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make0(store adt.Store) (State, error) {
+ out := state0{store: store}
+ out.State = system0.State{}
+ return &out, nil
+}
+
+type state0 struct {
+ system0.State
+ store adt.Store
+}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/system/v2.go b/chain/actors/builtin/system/v2.go
new file mode 100644
index 000000000..eb540891c
--- /dev/null
+++ b/chain/actors/builtin/system/v2.go
@@ -0,0 +1,35 @@
+package system
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ system2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/system"
+)
+
+var _ State = (*state2)(nil)
+
+func load2(store adt.Store, root cid.Cid) (State, error) {
+ out := state2{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make2(store adt.Store) (State, error) {
+ out := state2{store: store}
+ out.State = system2.State{}
+ return &out, nil
+}
+
+type state2 struct {
+ system2.State
+ store adt.Store
+}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/system/v3.go b/chain/actors/builtin/system/v3.go
new file mode 100644
index 000000000..5b04e189e
--- /dev/null
+++ b/chain/actors/builtin/system/v3.go
@@ -0,0 +1,35 @@
+package system
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ system3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/system"
+)
+
+var _ State = (*state3)(nil)
+
+func load3(store adt.Store, root cid.Cid) (State, error) {
+ out := state3{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make3(store adt.Store) (State, error) {
+ out := state3{store: store}
+ out.State = system3.State{}
+ return &out, nil
+}
+
+type state3 struct {
+ system3.State
+ store adt.Store
+}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/system/v4.go b/chain/actors/builtin/system/v4.go
new file mode 100644
index 000000000..b6c924978
--- /dev/null
+++ b/chain/actors/builtin/system/v4.go
@@ -0,0 +1,35 @@
+package system
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ system4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/system"
+)
+
+var _ State = (*state4)(nil)
+
+func load4(store adt.Store, root cid.Cid) (State, error) {
+ out := state4{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make4(store adt.Store) (State, error) {
+ out := state4{store: store}
+ out.State = system4.State{}
+ return &out, nil
+}
+
+type state4 struct {
+ system4.State
+ store adt.Store
+}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/system/v5.go b/chain/actors/builtin/system/v5.go
new file mode 100644
index 000000000..77d2a8478
--- /dev/null
+++ b/chain/actors/builtin/system/v5.go
@@ -0,0 +1,35 @@
+package system
+
+import (
+ "github.com/ipfs/go-cid"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ system5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/system"
+)
+
+var _ State = (*state5)(nil)
+
+func load5(store adt.Store, root cid.Cid) (State, error) {
+ out := state5{store: store}
+ err := store.Get(store.Context(), root, &out)
+ if err != nil {
+ return nil, err
+ }
+ return &out, nil
+}
+
+func make5(store adt.Store) (State, error) {
+ out := state5{store: store}
+ out.State = system5.State{}
+ return &out, nil
+}
+
+type state5 struct {
+ system5.State
+ store adt.Store
+}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/verifreg/actor.go.template b/chain/actors/builtin/verifreg/actor.go.template
index 22e809ccf..9ea8e155a 100644
--- a/chain/actors/builtin/verifreg/actor.go.template
+++ b/chain/actors/builtin/verifreg/actor.go.template
@@ -14,6 +14,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/actors/builtin"
+ "github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/types"
)
@@ -40,6 +41,28 @@ 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, rootKeyAddress address.Address) (State, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return make{{.}}(store, rootKeyAddress)
+{{end}}
+}
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+{{range .versions}}
+ case actors.Version{{.}}:
+ return builtin{{.}}.VerifiedRegistryActorCodeID, nil
+{{end}}
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
+
type State interface {
cbor.Marshaler
@@ -48,4 +71,5 @@ type State interface {
VerifierDataCap(address.Address) (bool, abi.StoragePower, error)
ForEachVerifier(func(addr address.Address, dcap abi.StoragePower) error) error
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
+ GetState() interface{}
}
diff --git a/chain/actors/builtin/verifreg/state.go.template b/chain/actors/builtin/verifreg/state.go.template
index 244d20932..b59cfb628 100644
--- a/chain/actors/builtin/verifreg/state.go.template
+++ b/chain/actors/builtin/verifreg/state.go.template
@@ -24,6 +24,26 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make{{.v}}(store adt.Store, rootKeyAddress address.Address) (State, error) {
+ out := state{{.v}}{store: store}
+ {{if (le .v 2)}}
+ em, err := adt{{.v}}.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *verifreg{{.v}}.ConstructState(em, rootKeyAddress)
+ {{else}}
+ s, err := verifreg{{.v}}.ConstructState(store, rootKeyAddress)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+ {{end}}
+ return &out, nil
+}
+
type state{{.v}} struct {
verifreg{{.v}}.State
store adt.Store
@@ -56,3 +76,7 @@ func (s *state{{.v}}) verifiedClients() (adt.Map, error) {
func (s *state{{.v}}) verifiers() (adt.Map, error) {
return adt{{.v}}.AsMap(s.store, s.Verifiers{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}})
}
+
+func (s *state{{.v}}) GetState() interface{} {
+ return &s.State
+}
\ No newline at end of file
diff --git a/chain/actors/builtin/verifreg/v0.go b/chain/actors/builtin/verifreg/v0.go
index 0dc4696f4..e70b0e3c9 100644
--- a/chain/actors/builtin/verifreg/v0.go
+++ b/chain/actors/builtin/verifreg/v0.go
@@ -23,6 +23,19 @@ func load0(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make0(store adt.Store, rootKeyAddress address.Address) (State, error) {
+ out := state0{store: store}
+
+ em, err := adt0.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *verifreg0.ConstructState(em, rootKeyAddress)
+
+ return &out, nil
+}
+
type state0 struct {
verifreg0.State
store adt.Store
@@ -55,3 +68,7 @@ func (s *state0) verifiedClients() (adt.Map, error) {
func (s *state0) verifiers() (adt.Map, error) {
return adt0.AsMap(s.store, s.Verifiers)
}
+
+func (s *state0) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/verifreg/v2.go b/chain/actors/builtin/verifreg/v2.go
index a5ef84532..0bcbe0212 100644
--- a/chain/actors/builtin/verifreg/v2.go
+++ b/chain/actors/builtin/verifreg/v2.go
@@ -23,6 +23,19 @@ func load2(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make2(store adt.Store, rootKeyAddress address.Address) (State, error) {
+ out := state2{store: store}
+
+ em, err := adt2.MakeEmptyMap(store).Root()
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *verifreg2.ConstructState(em, rootKeyAddress)
+
+ return &out, nil
+}
+
type state2 struct {
verifreg2.State
store adt.Store
@@ -55,3 +68,7 @@ func (s *state2) verifiedClients() (adt.Map, error) {
func (s *state2) verifiers() (adt.Map, error) {
return adt2.AsMap(s.store, s.Verifiers)
}
+
+func (s *state2) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/verifreg/v3.go b/chain/actors/builtin/verifreg/v3.go
index fb0c46d0c..32003ca3a 100644
--- a/chain/actors/builtin/verifreg/v3.go
+++ b/chain/actors/builtin/verifreg/v3.go
@@ -24,6 +24,19 @@ func load3(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make3(store adt.Store, rootKeyAddress address.Address) (State, error) {
+ out := state3{store: store}
+
+ s, err := verifreg3.ConstructState(store, rootKeyAddress)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state3 struct {
verifreg3.State
store adt.Store
@@ -56,3 +69,7 @@ func (s *state3) verifiedClients() (adt.Map, error) {
func (s *state3) verifiers() (adt.Map, error) {
return adt3.AsMap(s.store, s.Verifiers, builtin3.DefaultHamtBitwidth)
}
+
+func (s *state3) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/verifreg/v4.go b/chain/actors/builtin/verifreg/v4.go
index 2419ef758..b752e747b 100644
--- a/chain/actors/builtin/verifreg/v4.go
+++ b/chain/actors/builtin/verifreg/v4.go
@@ -24,6 +24,19 @@ func load4(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make4(store adt.Store, rootKeyAddress address.Address) (State, error) {
+ out := state4{store: store}
+
+ s, err := verifreg4.ConstructState(store, rootKeyAddress)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state4 struct {
verifreg4.State
store adt.Store
@@ -56,3 +69,7 @@ func (s *state4) verifiedClients() (adt.Map, error) {
func (s *state4) verifiers() (adt.Map, error) {
return adt4.AsMap(s.store, s.Verifiers, builtin4.DefaultHamtBitwidth)
}
+
+func (s *state4) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/verifreg/v5.go b/chain/actors/builtin/verifreg/v5.go
index 367d38498..6fefd7115 100644
--- a/chain/actors/builtin/verifreg/v5.go
+++ b/chain/actors/builtin/verifreg/v5.go
@@ -24,6 +24,19 @@ func load5(store adt.Store, root cid.Cid) (State, error) {
return &out, nil
}
+func make5(store adt.Store, rootKeyAddress address.Address) (State, error) {
+ out := state5{store: store}
+
+ s, err := verifreg5.ConstructState(store, rootKeyAddress)
+ if err != nil {
+ return nil, err
+ }
+
+ out.State = *s
+
+ return &out, nil
+}
+
type state5 struct {
verifreg5.State
store adt.Store
@@ -56,3 +69,7 @@ func (s *state5) verifiedClients() (adt.Map, error) {
func (s *state5) verifiers() (adt.Map, error) {
return adt5.AsMap(s.store, s.Verifiers, builtin5.DefaultHamtBitwidth)
}
+
+func (s *state5) GetState() interface{} {
+ return &s.State
+}
diff --git a/chain/actors/builtin/verifreg/verifreg.go b/chain/actors/builtin/verifreg/verifreg.go
index baca66177..88104ad69 100644
--- a/chain/actors/builtin/verifreg/verifreg.go
+++ b/chain/actors/builtin/verifreg/verifreg.go
@@ -19,6 +19,7 @@ import (
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
+ "github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/types"
@@ -75,6 +76,51 @@ 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, rootKeyAddress address.Address) (State, error) {
+ switch av {
+
+ case actors.Version0:
+ return make0(store, rootKeyAddress)
+
+ case actors.Version2:
+ return make2(store, rootKeyAddress)
+
+ case actors.Version3:
+ return make3(store, rootKeyAddress)
+
+ case actors.Version4:
+ return make4(store, rootKeyAddress)
+
+ case actors.Version5:
+ return make5(store, rootKeyAddress)
+
+ }
+ return nil, xerrors.Errorf("unknown actor version %d", av)
+}
+
+func GetActorCodeID(av actors.Version) (cid.Cid, error) {
+ switch av {
+
+ case actors.Version0:
+ return builtin0.VerifiedRegistryActorCodeID, nil
+
+ case actors.Version2:
+ return builtin2.VerifiedRegistryActorCodeID, nil
+
+ case actors.Version3:
+ return builtin3.VerifiedRegistryActorCodeID, nil
+
+ case actors.Version4:
+ return builtin4.VerifiedRegistryActorCodeID, nil
+
+ case actors.Version5:
+ return builtin5.VerifiedRegistryActorCodeID, nil
+
+ }
+
+ return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
+}
+
type State interface {
cbor.Marshaler
@@ -83,4 +129,5 @@ type State interface {
VerifierDataCap(address.Address) (bool, abi.StoragePower, error)
ForEachVerifier(func(addr address.Address, dcap abi.StoragePower) error) error
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
+ GetState() interface{}
}
diff --git a/chain/actors/policy/policy.go.template b/chain/actors/policy/policy.go.template
index 5d8100675..feca2370a 100644
--- a/chain/actors/policy/policy.go.template
+++ b/chain/actors/policy/policy.go.template
@@ -10,14 +10,14 @@ import (
"github.com/filecoin-project/lotus/chain/actors"
{{range .versions}}
- {{if (ge . 2)}} builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin" {{end}}
+ {{if (ge . 2)}} builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin" {{end}}
market{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin/market"
miner{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin/miner"
verifreg{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin/verifreg"
{{if (eq . 0)}} power{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin/power" {{end}}
- {{end}}
+ {{end}}
- paych{{.latestVersion}} "github.com/filecoin-project/specs-actors{{import .latestVersion}}actors/builtin/paych"
+ paych{{.latestVersion}} "github.com/filecoin-project/specs-actors{{import .latestVersion}}actors/builtin/paych"
)
const (
@@ -31,15 +31,15 @@ const (
// This should only be used for testing.
func SetSupportedProofTypes(types ...abi.RegisteredSealProof) {
{{range .versions}}
- {{if (eq . 0)}}
- miner{{.}}.SupportedProofTypes = make(map[abi.RegisteredSealProof]struct{}, len(types))
- {{else if (le . 4)}}
- miner{{.}}.PreCommitSealProofTypesV0 = make(map[abi.RegisteredSealProof]struct{}, len(types))
- miner{{.}}.PreCommitSealProofTypesV7 = make(map[abi.RegisteredSealProof]struct{}, len(types)*2)
- miner{{.}}.PreCommitSealProofTypesV8 = make(map[abi.RegisteredSealProof]struct{}, len(types))
- {{else}}
- miner{{.}}.PreCommitSealProofTypesV8 = make(map[abi.RegisteredSealProof]struct{}, len(types))
- {{end}}
+ {{if (eq . 0)}}
+ miner{{.}}.SupportedProofTypes = make(map[abi.RegisteredSealProof]struct{}, len(types))
+ {{else if (le . 4)}}
+ miner{{.}}.PreCommitSealProofTypesV0 = make(map[abi.RegisteredSealProof]struct{}, len(types))
+ miner{{.}}.PreCommitSealProofTypesV7 = make(map[abi.RegisteredSealProof]struct{}, len(types)*2)
+ miner{{.}}.PreCommitSealProofTypesV8 = make(map[abi.RegisteredSealProof]struct{}, len(types))
+ {{else}}
+ miner{{.}}.PreCommitSealProofTypesV8 = make(map[abi.RegisteredSealProof]struct{}, len(types))
+ {{end}}
{{end}}
AddSupportedProofTypes(types...)
@@ -80,9 +80,9 @@ func AddSupportedProofTypes(types ...abi.RegisteredSealProof) {
// actors versions. Use for testing.
func SetPreCommitChallengeDelay(delay abi.ChainEpoch) {
// Set for all miner versions.
- {{range .versions}}
- miner{{.}}.PreCommitChallengeDelay = delay
- {{end}}
+ {{range .versions}}
+ miner{{.}}.PreCommitChallengeDelay = delay
+ {{end}}
}
// TODO: this function shouldn't really exist. Instead, the API should expose the precommit delay.
@@ -94,42 +94,42 @@ func GetPreCommitChallengeDelay() abi.ChainEpoch {
// meet for leader election, across all actor versions. This should only be used
// for testing.
func SetConsensusMinerMinPower(p abi.StoragePower) {
- {{range .versions}}
- {{if (eq . 0)}}
- power{{.}}.ConsensusMinerMinPower = p
- {{else if (eq . 2)}}
- for _, policy := range builtin{{.}}.SealProofPolicies {
- policy.ConsensusMinerMinPower = p
- }
- {{else}}
- for _, policy := range builtin{{.}}.PoStProofPolicies {
- policy.ConsensusMinerMinPower = p
- }
- {{end}}
- {{end}}
+ {{range .versions}}
+ {{if (eq . 0)}}
+ power{{.}}.ConsensusMinerMinPower = p
+ {{else if (eq . 2)}}
+ for _, policy := range builtin{{.}}.SealProofPolicies {
+ policy.ConsensusMinerMinPower = p
+ }
+ {{else}}
+ for _, policy := range builtin{{.}}.PoStProofPolicies {
+ policy.ConsensusMinerMinPower = p
+ }
+ {{end}}
+ {{end}}
}
// SetMinVerifiedDealSize sets the minimum size of a verified deal. This should
// only be used for testing.
func SetMinVerifiedDealSize(size abi.StoragePower) {
- {{range .versions}}
- verifreg{{.}}.MinVerifiedDealSize = size
- {{end}}
+ {{range .versions}}
+ verifreg{{.}}.MinVerifiedDealSize = size
+ {{end}}
}
func GetMaxProveCommitDuration(ver actors.Version, t abi.RegisteredSealProof) abi.ChainEpoch {
switch ver {
{{range .versions}}
- case actors.Version{{.}}:
- {{if (eq . 0)}}
- return miner{{.}}.MaxSealDuration[t]
- {{else}}
- return miner{{.}}.MaxProveCommitDuration[t]
- {{end}}
- {{end}}
- default:
- panic("unsupported actors version")
- }
+ case actors.Version{{.}}:
+ {{if (eq . 0)}}
+ return miner{{.}}.MaxSealDuration[t]
+ {{else}}
+ return miner{{.}}.MaxProveCommitDuration[t]
+ {{end}}
+ {{end}}
+ default:
+ panic("unsupported actors version")
+ }
}
func DealProviderCollateralBounds(
@@ -138,14 +138,14 @@ func DealProviderCollateralBounds(
circulatingFil abi.TokenAmount, nwVer network.Version,
) (min, max abi.TokenAmount) {
switch actors.VersionForNetwork(nwVer) {
- {{range .versions}}
- case actors.Version{{.}}:
- {{if (eq . 0)}}
- return market{{.}}.DealProviderCollateralBounds(size, verified, rawBytePower, qaPower, baselinePower, circulatingFil, nwVer)
- {{else}}
- return market{{.}}.DealProviderCollateralBounds(size, verified, rawBytePower, qaPower, baselinePower, circulatingFil)
- {{end}}
- {{end}}
+ {{range .versions}}
+ case actors.Version{{.}}:
+ {{if (eq . 0)}}
+ return market{{.}}.DealProviderCollateralBounds(size, verified, rawBytePower, qaPower, baselinePower, circulatingFil, nwVer)
+ {{else}}
+ return market{{.}}.DealProviderCollateralBounds(size, verified, rawBytePower, qaPower, baselinePower, circulatingFil)
+ {{end}}
+ {{end}}
default:
panic("unsupported actors version")
}
@@ -158,15 +158,15 @@ func DealDurationBounds(pieceSize abi.PaddedPieceSize) (min, max abi.ChainEpoch)
// Sets the challenge window and scales the proving period to match (such that
// there are always 48 challenge windows in a proving period).
func SetWPoStChallengeWindow(period abi.ChainEpoch) {
- {{range .versions}}
- miner{{.}}.WPoStChallengeWindow = period
- miner{{.}}.WPoStProvingPeriod = period * abi.ChainEpoch(miner{{.}}.WPoStPeriodDeadlines)
- {{if (ge . 3)}}
- // by default, this is 2x finality which is 30 periods.
- // scale it if we're scaling the challenge period.
- miner{{.}}.WPoStDisputeWindow = period * 30
- {{end}}
- {{end}}
+ {{range .versions}}
+ miner{{.}}.WPoStChallengeWindow = period
+ miner{{.}}.WPoStProvingPeriod = period * abi.ChainEpoch(miner{{.}}.WPoStPeriodDeadlines)
+ {{if (ge . 3)}}
+ // by default, this is 2x finality which is 30 periods.
+ // scale it if we're scaling the challenge period.
+ miner{{.}}.WPoStDisputeWindow = period * 30
+ {{end}}
+ {{end}}
}
func GetWinningPoStSectorSetLookback(nwVer network.Version) abi.ChainEpoch {
@@ -174,7 +174,7 @@ func GetWinningPoStSectorSetLookback(nwVer network.Version) abi.ChainEpoch {
return 10
}
- // NOTE: if this ever changes, adjust it in a (*Miner).mineOne() logline as well
+ // NOTE: if this ever changes, adjust it in a (*Miner).mineOne() logline as well
return ChainFinality
}
@@ -211,7 +211,7 @@ func GetDefaultSectorSize() abi.SectorSize {
}
func GetDefaultAggregationProof() abi.RegisteredAggregationProof {
- return abi.RegisteredAggregationProof_SnarkPackV1
+ return abi.RegisteredAggregationProof_SnarkPackV1
}
func GetSectorMaxLifetime(proof abi.RegisteredSealProof, nwVer network.Version) abi.ChainEpoch {
@@ -224,10 +224,10 @@ func GetSectorMaxLifetime(proof abi.RegisteredSealProof, nwVer network.Version)
func GetAddressedSectorsMax(nwVer network.Version) int {
switch actors.VersionForNetwork(nwVer) {
- {{range .versions}}
- case actors.Version{{.}}:
- return miner{{.}}.AddressedSectorsMax
- {{end}}
+ {{range .versions}}
+ case actors.Version{{.}}:
+ return miner{{.}}.AddressedSectorsMax
+ {{end}}
default:
panic("unsupported network version")
}
@@ -235,15 +235,15 @@ func GetAddressedSectorsMax(nwVer network.Version) int {
func GetDeclarationsMax(nwVer network.Version) int {
switch actors.VersionForNetwork(nwVer) {
- {{range .versions}}
- case actors.Version{{.}}:
- {{if (eq . 0)}}
- // TODO: Should we instead panic here since the concept doesn't exist yet?
- return miner{{.}}.AddressedPartitionsMax
- {{else}}
- return miner{{.}}.DeclarationsMax
- {{end}}
- {{end}}
+ {{range .versions}}
+ case actors.Version{{.}}:
+ {{if (eq . 0)}}
+ // TODO: Should we instead panic here since the concept doesn't exist yet?
+ return miner{{.}}.AddressedPartitionsMax
+ {{else}}
+ return miner{{.}}.DeclarationsMax
+ {{end}}
+ {{end}}
default:
panic("unsupported network version")
}
diff --git a/chain/actors/version.go b/chain/actors/version.go
index e6ca2e9bd..9710e62fa 100644
--- a/chain/actors/version.go
+++ b/chain/actors/version.go
@@ -8,6 +8,10 @@ import (
type Version int
+var LatestVersion = 5
+
+var Versions = []int{0, 2, 3, 4, LatestVersion}
+
const (
Version0 Version = 0
Version2 Version = 2
diff --git a/chain/beacon/drand/drand.go b/chain/beacon/drand/drand.go
index 847091858..e7f673d7f 100644
--- a/chain/beacon/drand/drand.go
+++ b/chain/beacon/drand/drand.go
@@ -168,8 +168,8 @@ func (db *DrandBeacon) getCachedValue(round uint64) *types.BeaconEntry {
if !ok {
return nil
}
- e, _ := v.(*types.BeaconEntry)
- return e
+ e, _ := v.(types.BeaconEntry)
+ return &e
}
func (db *DrandBeacon) VerifyEntry(curr types.BeaconEntry, prev types.BeaconEntry) error {
@@ -178,6 +178,9 @@ func (db *DrandBeacon) VerifyEntry(curr types.BeaconEntry, prev types.BeaconEntr
return nil
}
if be := db.getCachedValue(curr.Round); be != nil {
+ if !bytes.Equal(curr.Data, be.Data) {
+ return xerrors.New("invalid beacon value, does not match cached good value")
+ }
// return no error if the value is in the cache already
return nil
}
diff --git a/chain/checkpoint.go b/chain/checkpoint.go
index 8f99d73e4..a3660a45c 100644
--- a/chain/checkpoint.go
+++ b/chain/checkpoint.go
@@ -1,81 +1,57 @@
package chain
import (
- "encoding/json"
+ "context"
"github.com/filecoin-project/lotus/chain/types"
- "github.com/filecoin-project/lotus/node/modules/dtypes"
- "github.com/ipfs/go-datastore"
"golang.org/x/xerrors"
)
-var CheckpointKey = datastore.NewKey("/chain/checks")
-
-func loadCheckpoint(ds dtypes.MetadataDS) (types.TipSetKey, error) {
- haveChks, err := ds.Has(CheckpointKey)
- if err != nil {
- return types.EmptyTSK, err
- }
-
- if !haveChks {
- return types.EmptyTSK, nil
- }
-
- tskBytes, err := ds.Get(CheckpointKey)
- if err != nil {
- return types.EmptyTSK, err
- }
-
- var tsk types.TipSetKey
- err = json.Unmarshal(tskBytes, &tsk)
- if err != nil {
- return types.EmptyTSK, err
- }
-
- return tsk, err
-}
-
-func (syncer *Syncer) SetCheckpoint(tsk types.TipSetKey) error {
+func (syncer *Syncer) SyncCheckpoint(ctx context.Context, tsk types.TipSetKey) error {
if tsk == types.EmptyTSK {
return xerrors.Errorf("called with empty tsk")
}
- syncer.checkptLk.Lock()
- defer syncer.checkptLk.Unlock()
-
ts, err := syncer.ChainStore().LoadTipSet(tsk)
if err != nil {
- return xerrors.Errorf("cannot find tipset: %w", err)
+ tss, err := syncer.Exchange.GetBlocks(ctx, tsk, 1)
+ if err != nil {
+ return xerrors.Errorf("failed to fetch tipset: %w", err)
+ } else if len(tss) != 1 {
+ return xerrors.Errorf("expected 1 tipset, got %d", len(tss))
+ }
+ ts = tss[0]
}
- hts := syncer.ChainStore().GetHeaviestTipSet()
- anc, err := syncer.ChainStore().IsAncestorOf(ts, hts)
- if err != nil {
- return xerrors.Errorf("cannot determine whether checkpoint tipset is in main-chain: %w", err)
+ if err := syncer.switchChain(ctx, ts); err != nil {
+ return xerrors.Errorf("failed to switch chain when syncing checkpoint: %w", err)
}
- if !hts.Equals(ts) && !anc {
- return xerrors.Errorf("cannot mark tipset as checkpoint, since it isn't in the main-chain: %w", err)
+ if err := syncer.ChainStore().SetCheckpoint(ts); err != nil {
+ return xerrors.Errorf("failed to set the chain checkpoint: %w", err)
}
- tskBytes, err := json.Marshal(tsk)
- if err != nil {
- return err
- }
-
- err = syncer.ds.Put(CheckpointKey, tskBytes)
- if err != nil {
- return err
- }
-
- syncer.checkpt = tsk
-
return nil
}
-func (syncer *Syncer) GetCheckpoint() types.TipSetKey {
- syncer.checkptLk.Lock()
- defer syncer.checkptLk.Unlock()
- return syncer.checkpt
+func (syncer *Syncer) switchChain(ctx context.Context, ts *types.TipSet) error {
+ hts := syncer.ChainStore().GetHeaviestTipSet()
+ if hts.Equals(ts) {
+ return nil
+ }
+
+ if anc, err := syncer.store.IsAncestorOf(ts, hts); err == nil && anc {
+ return nil
+ }
+
+ // Otherwise, sync the chain and set the head.
+ if err := syncer.collectChain(ctx, ts, hts, true); err != nil {
+ return xerrors.Errorf("failed to collect chain for checkpoint: %w", err)
+ }
+
+ if err := syncer.ChainStore().SetHead(ts); err != nil {
+ return xerrors.Errorf("failed to set the chain head: %w", err)
+ }
+ return nil
}
diff --git a/chain/events/events.go b/chain/events/events.go
index 8ad40f95f..8511de921 100644
--- a/chain/events/events.go
+++ b/chain/events/events.go
@@ -33,19 +33,19 @@ type heightHandler struct {
revert RevertHandler
}
-type eventAPI interface {
+type EventAPI interface {
ChainNotify(context.Context) (<-chan []*api.HeadChange, error)
ChainGetBlockMessages(context.Context, cid.Cid) (*api.BlockMessages, error)
ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)
ChainHead(context.Context) (*types.TipSet, error)
- StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)
+ StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error)
StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) // optional / for CalledMsg
}
type Events struct {
- api eventAPI
+ api EventAPI
tsc *tipSetCache
lk sync.Mutex
@@ -59,7 +59,7 @@ type Events struct {
observers []TipSetObserver
}
-func NewEventsWithConfidence(ctx context.Context, api eventAPI, gcConfidence abi.ChainEpoch) *Events {
+func NewEventsWithConfidence(ctx context.Context, api EventAPI, gcConfidence abi.ChainEpoch) *Events {
tsc := newTSCache(gcConfidence, api)
e := &Events{
@@ -93,7 +93,7 @@ func NewEventsWithConfidence(ctx context.Context, api eventAPI, gcConfidence abi
return e
}
-func NewEvents(ctx context.Context, api eventAPI) *Events {
+func NewEvents(ctx context.Context, api EventAPI) *Events {
gcConfidence := 2 * build.ForkLengthThreshold
return NewEventsWithConfidence(ctx, api, gcConfidence)
}
diff --git a/chain/events/events_called.go b/chain/events/events_called.go
index e84484480..2fe6853eb 100644
--- a/chain/events/events_called.go
+++ b/chain/events/events_called.go
@@ -5,6 +5,8 @@ import (
"math"
"sync"
+ "github.com/filecoin-project/lotus/chain/stmgr"
+
"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
"golang.org/x/xerrors"
@@ -66,7 +68,7 @@ type queuedEvent struct {
// Manages chain head change events, which may be forward (new tipset added to
// chain) or backward (chain branch discarded in favour of heavier branch)
type hcEvents struct {
- cs eventAPI
+ cs EventAPI
tsc *tipSetCache
ctx context.Context
gcConfidence uint64
@@ -93,7 +95,7 @@ type hcEvents struct {
watcherEvents
}
-func newHCEvents(ctx context.Context, cs eventAPI, tsc *tipSetCache, gcConfidence uint64) *hcEvents {
+func newHCEvents(ctx context.Context, cs EventAPI, tsc *tipSetCache, gcConfidence uint64) *hcEvents {
e := hcEvents{
ctx: ctx,
cs: cs,
@@ -355,14 +357,14 @@ type headChangeAPI interface {
// watcherEvents watches for a state change
type watcherEvents struct {
ctx context.Context
- cs eventAPI
+ cs EventAPI
hcAPI headChangeAPI
lk sync.RWMutex
matchers map[triggerID]StateMatchFunc
}
-func newWatcherEvents(ctx context.Context, hcAPI headChangeAPI, cs eventAPI) watcherEvents {
+func newWatcherEvents(ctx context.Context, hcAPI headChangeAPI, cs EventAPI) watcherEvents {
return watcherEvents{
ctx: ctx,
cs: cs,
@@ -457,14 +459,14 @@ func (we *watcherEvents) StateChanged(check CheckFunc, scHnd StateChangeHandler,
// messageEvents watches for message calls to actors
type messageEvents struct {
ctx context.Context
- cs eventAPI
+ cs EventAPI
hcAPI headChangeAPI
lk sync.RWMutex
matchers map[triggerID]MsgMatchFunc
}
-func newMessageEvents(ctx context.Context, hcAPI headChangeAPI, cs eventAPI) messageEvents {
+func newMessageEvents(ctx context.Context, hcAPI headChangeAPI, cs EventAPI) messageEvents {
return messageEvents{
ctx: ctx,
cs: cs,
@@ -585,12 +587,16 @@ func (me *messageEvents) Called(check CheckFunc, msgHnd MsgHandler, rev RevertHa
panic("expected msg")
}
- rec, err := me.cs.StateGetReceipt(me.ctx, msg.Cid(), ts.Key())
+ ml, err := me.cs.StateSearchMsg(me.ctx, ts.Key(), msg.Cid(), stmgr.LookbackNoLimit, true)
if err != nil {
return false, err
}
- return msgHnd(msg, rec, ts, height)
+ if ml == nil {
+ return msgHnd(msg, nil, ts, height)
+ }
+
+ return msgHnd(msg, &ml.Receipt, ts, height)
}
id, err := me.hcAPI.onHeadChanged(check, hnd, rev, confidence, timeout)
diff --git a/chain/events/events_test.go b/chain/events/events_test.go
index b5cbb0594..e18d5ba7c 100644
--- a/chain/events/events_test.go
+++ b/chain/events/events_test.go
@@ -54,7 +54,7 @@ func (fcs *fakeCS) ChainGetTipSet(ctx context.Context, key types.TipSetKey) (*ty
return fcs.tipsets[key], nil
}
-func (fcs *fakeCS) StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) {
+func (fcs *fakeCS) StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) {
return nil, nil
}
@@ -229,7 +229,7 @@ func (fcs *fakeCS) notifDone() {
fcs.sync.Unlock()
}
-var _ eventAPI = &fakeCS{}
+var _ EventAPI = &fakeCS{}
func TestAt(t *testing.T) {
fcs := &fakeCS{
diff --git a/chain/events/utils.go b/chain/events/utils.go
index c26ca5b83..91ea0cd7a 100644
--- a/chain/events/utils.go
+++ b/chain/events/utils.go
@@ -3,6 +3,8 @@ package events
import (
"context"
+ "github.com/filecoin-project/lotus/chain/stmgr"
+
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/chain/types"
@@ -22,12 +24,16 @@ func (me *messageEvents) CheckMsg(ctx context.Context, smsg types.ChainMsg, hnd
return false, true, nil
}
- rec, err := me.cs.StateGetReceipt(ctx, smsg.VMMessage().Cid(), ts.Key())
+ ml, err := me.cs.StateSearchMsg(me.ctx, ts.Key(), msg.Cid(), stmgr.LookbackNoLimit, true)
if err != nil {
return false, true, xerrors.Errorf("getting receipt in CheckMsg: %w", err)
}
- more, err = hnd(msg, rec, ts, ts.Height())
+ if ml == nil {
+ more, err = hnd(msg, nil, ts, ts.Height())
+ } else {
+ more, err = hnd(msg, &ml.Receipt, ts, ts.Height())
+ }
return true, more, err
}
diff --git a/chain/gen/gen.go b/chain/gen/gen.go
index 0cbdb2188..424ee6edc 100644
--- a/chain/gen/gen.go
+++ b/chain/gen/gen.go
@@ -3,13 +3,14 @@ package gen
import (
"bytes"
"context"
- "encoding/base64"
"fmt"
"io"
"io/ioutil"
"sync/atomic"
"time"
+ "github.com/filecoin-project/go-state-types/network"
+
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
@@ -199,6 +200,7 @@ func NewGeneratorWithSectorsAndUpgradeSchedule(numSectors int, us stmgr.UpgradeS
sys := vm.Syscalls(&genFakeVerifier{})
tpl := genesis.Template{
+ NetworkVersion: network.Version0,
Accounts: []genesis.Actor{
{
Type: genesis.TAccount,
@@ -635,8 +637,6 @@ func (wpp *wppProvider) ComputeProof(context.Context, []proof5.SectorInfo, abi.P
return ValidWpostForTesting, nil
}
-var b64 = base64.URLEncoding.WithPadding(base64.NoPadding)
-
func IsRoundWinner(ctx context.Context, ts *types.TipSet, round abi.ChainEpoch,
miner address.Address, brand types.BeaconEntry, mbi *api.MiningBaseInfo, a MiningCheckAPI) (*types.ElectionProof, error) {
@@ -658,15 +658,6 @@ func IsRoundWinner(ctx context.Context, ts *types.TipSet, round abi.ChainEpoch,
ep := &types.ElectionProof{VRFProof: vrfout}
j := ep.ComputeWinCount(mbi.MinerPower, mbi.NetworkPower)
ep.WinCount = j
-
- log.Infow("completed winAttemptVRF",
- "beaconRound", brand.Round,
- "beaconDataB64", b64.EncodeToString(brand.Data),
- "electionRandB64", b64.EncodeToString(electionRand),
- "vrfB64", b64.EncodeToString(vrfout),
- "winCount", j,
- )
-
if j < 1 {
return nil, nil
}
diff --git a/chain/gen/genesis/f00_system.go b/chain/gen/genesis/f00_system.go
index 015dfac4a..d1dd203b6 100644
--- a/chain/gen/genesis/f00_system.go
+++ b/chain/gen/genesis/f00_system.go
@@ -3,27 +3,36 @@ package genesis
import (
"context"
- "github.com/filecoin-project/specs-actors/actors/builtin/system"
+ "github.com/filecoin-project/lotus/chain/actors"
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/system"
- "github.com/filecoin-project/specs-actors/actors/builtin"
cbor "github.com/ipfs/go-ipld-cbor"
bstore "github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/types"
)
-func SetupSystemActor(bs bstore.Blockstore) (*types.Actor, error) {
- var st system.State
+func SetupSystemActor(ctx context.Context, bs bstore.Blockstore, av actors.Version) (*types.Actor, error) {
cst := cbor.NewCborStore(bs)
+ st, err := system.MakeState(adt.WrapStore(ctx, cst), av)
+ if err != nil {
+ return nil, err
+ }
- statecid, err := cst.Put(context.TODO(), &st)
+ statecid, err := cst.Put(ctx, st.GetState())
+ if err != nil {
+ return nil, err
+ }
+
+ actcid, err := system.GetActorCodeID(av)
if err != nil {
return nil, err
}
act := &types.Actor{
- Code: builtin.SystemActorCodeID,
+ Code: actcid,
Head: statecid,
}
diff --git a/chain/gen/genesis/f01_init.go b/chain/gen/genesis/f01_init.go
index 718eb4480..88d409221 100644
--- a/chain/gen/genesis/f01_init.go
+++ b/chain/gen/genesis/f01_init.go
@@ -5,13 +5,15 @@ import (
"encoding/json"
"fmt"
+ init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
+
+ "github.com/filecoin-project/lotus/chain/actors"
+
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/specs-actors/actors/builtin"
"github.com/filecoin-project/specs-actors/actors/util/adt"
- init_ "github.com/filecoin-project/specs-actors/actors/builtin/init"
cbor "github.com/ipfs/go-ipld-cbor"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
@@ -21,17 +23,25 @@ import (
"github.com/filecoin-project/lotus/genesis"
)
-func SetupInitActor(bs bstore.Blockstore, netname string, initialActors []genesis.Actor, rootVerifier genesis.Actor, remainder genesis.Actor) (int64, *types.Actor, map[address.Address]address.Address, error) {
+func SetupInitActor(ctx context.Context, bs bstore.Blockstore, netname string, initialActors []genesis.Actor, rootVerifier genesis.Actor, remainder genesis.Actor, av actors.Version) (int64, *types.Actor, map[address.Address]address.Address, error) {
if len(initialActors) > MaxAccounts {
return 0, nil, nil, xerrors.New("too many initial actors")
}
- var ias init_.State
- ias.NextID = MinerStart
- ias.NetworkName = netname
+ cst := cbor.NewCborStore(bs)
+ ist, err := init_.MakeState(adt.WrapStore(ctx, cst), av, netname)
+ if err != nil {
+ return 0, nil, nil, err
+ }
- store := adt.WrapStore(context.TODO(), cbor.NewCborStore(bs))
- amap := adt.MakeEmptyMap(store)
+ if err = ist.SetNextID(MinerStart); err != nil {
+ return 0, nil, nil, err
+ }
+
+ amap, err := ist.AddressMap()
+ if err != nil {
+ return 0, nil, nil, err
+ }
keyToId := map[address.Address]address.Address{}
counter := int64(AccountStart)
@@ -155,15 +165,23 @@ func SetupInitActor(bs bstore.Blockstore, netname string, initialActors []genesi
if err != nil {
return 0, nil, nil, err
}
- ias.AddressMap = amapaddr
- statecid, err := store.Put(store.Context(), &ias)
+ if err = ist.SetAddressMap(amapaddr); err != nil {
+ return 0, nil, nil, err
+ }
+
+ statecid, err := cst.Put(ctx, ist.GetState())
+ if err != nil {
+ return 0, nil, nil, err
+ }
+
+ actcid, err := init_.GetActorCodeID(av)
if err != nil {
return 0, nil, nil, err
}
act := &types.Actor{
- Code: builtin.InitActorCodeID,
+ Code: actcid,
Head: statecid,
}
diff --git a/chain/gen/genesis/f02_reward.go b/chain/gen/genesis/f02_reward.go
index e218da6fe..c8f479722 100644
--- a/chain/gen/genesis/f02_reward.go
+++ b/chain/gen/genesis/f02_reward.go
@@ -3,10 +3,12 @@ package genesis
import (
"context"
+ "github.com/filecoin-project/lotus/chain/actors"
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/reward"
+
"github.com/filecoin-project/go-state-types/big"
- "github.com/filecoin-project/specs-actors/actors/builtin"
- reward0 "github.com/filecoin-project/specs-actors/actors/builtin/reward"
cbor "github.com/ipfs/go-ipld-cbor"
bstore "github.com/filecoin-project/lotus/blockstore"
@@ -14,19 +16,28 @@ import (
"github.com/filecoin-project/lotus/chain/types"
)
-func SetupRewardActor(bs bstore.Blockstore, qaPower big.Int) (*types.Actor, error) {
+func SetupRewardActor(ctx context.Context, bs bstore.Blockstore, qaPower big.Int, av actors.Version) (*types.Actor, error) {
cst := cbor.NewCborStore(bs)
-
- st := reward0.ConstructState(qaPower)
-
- hcid, err := cst.Put(context.TODO(), st)
+ rst, err := reward.MakeState(adt.WrapStore(ctx, cst), av, qaPower)
if err != nil {
return nil, err
}
- return &types.Actor{
- Code: builtin.RewardActorCodeID,
+ statecid, err := cst.Put(ctx, rst.GetState())
+ if err != nil {
+ return nil, err
+ }
+
+ actcid, err := reward.GetActorCodeID(av)
+ if err != nil {
+ return nil, err
+ }
+
+ act := &types.Actor{
+ Code: actcid,
Balance: types.BigInt{Int: build.InitialRewardBalance},
- Head: hcid,
- }, nil
+ Head: statecid,
+ }
+
+ return act, nil
}
diff --git a/chain/gen/genesis/f03_cron.go b/chain/gen/genesis/f03_cron.go
index dd43a59a4..c6fd2422a 100644
--- a/chain/gen/genesis/f03_cron.go
+++ b/chain/gen/genesis/f03_cron.go
@@ -3,27 +3,37 @@ package genesis
import (
"context"
- "github.com/filecoin-project/specs-actors/actors/builtin"
- "github.com/filecoin-project/specs-actors/actors/builtin/cron"
+ "github.com/filecoin-project/lotus/chain/actors"
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/cron"
+
cbor "github.com/ipfs/go-ipld-cbor"
bstore "github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/types"
)
-func SetupCronActor(bs bstore.Blockstore) (*types.Actor, error) {
+func SetupCronActor(ctx context.Context, bs bstore.Blockstore, av actors.Version) (*types.Actor, error) {
cst := cbor.NewCborStore(bs)
- cas := cron.ConstructState(cron.BuiltInEntries())
-
- stcid, err := cst.Put(context.TODO(), cas)
+ st, err := cron.MakeState(adt.WrapStore(ctx, cbor.NewCborStore(bs)), av)
if err != nil {
return nil, err
}
- return &types.Actor{
- Code: builtin.CronActorCodeID,
- Head: stcid,
- Nonce: 0,
- Balance: types.NewInt(0),
- }, nil
+ statecid, err := cst.Put(ctx, st.GetState())
+ if err != nil {
+ return nil, err
+ }
+
+ actcid, err := cron.GetActorCodeID(av)
+ if err != nil {
+ return nil, err
+ }
+
+ act := &types.Actor{
+ Code: actcid,
+ Head: statecid,
+ }
+
+ return act, nil
}
diff --git a/chain/gen/genesis/f04_power.go b/chain/gen/genesis/f04_power.go
index ed349c18b..6fe4d75c0 100644
--- a/chain/gen/genesis/f04_power.go
+++ b/chain/gen/genesis/f04_power.go
@@ -3,44 +3,39 @@ package genesis
import (
"context"
- "github.com/filecoin-project/specs-actors/actors/builtin"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/power"
+
+ "github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/specs-actors/actors/util/adt"
- power0 "github.com/filecoin-project/specs-actors/actors/builtin/power"
cbor "github.com/ipfs/go-ipld-cbor"
bstore "github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/types"
)
-func SetupStoragePowerActor(bs bstore.Blockstore) (*types.Actor, error) {
- store := adt.WrapStore(context.TODO(), cbor.NewCborStore(bs))
- emptyMap, err := adt.MakeEmptyMap(store).Root()
+func SetupStoragePowerActor(ctx context.Context, bs bstore.Blockstore, av actors.Version) (*types.Actor, error) {
+
+ cst := cbor.NewCborStore(bs)
+ pst, err := power.MakeState(adt.WrapStore(ctx, cbor.NewCborStore(bs)), av)
if err != nil {
return nil, err
}
- multiMap, err := adt.AsMultimap(store, emptyMap)
+ statecid, err := cst.Put(ctx, pst.GetState())
if err != nil {
return nil, err
}
- emptyMultiMap, err := multiMap.Root()
+ actcid, err := power.GetActorCodeID(av)
if err != nil {
return nil, err
}
- sms := power0.ConstructState(emptyMap, emptyMultiMap)
-
- stcid, err := store.Put(store.Context(), sms)
- if err != nil {
- return nil, err
+ act := &types.Actor{
+ Code: actcid,
+ Head: statecid,
}
- return &types.Actor{
- Code: builtin.StoragePowerActorCodeID,
- Head: stcid,
- Nonce: 0,
- Balance: types.NewInt(0),
- }, nil
+ return act, nil
}
diff --git a/chain/gen/genesis/f05_market.go b/chain/gen/genesis/f05_market.go
index f7ac26f43..5c39ef38f 100644
--- a/chain/gen/genesis/f05_market.go
+++ b/chain/gen/genesis/f05_market.go
@@ -3,38 +3,36 @@ package genesis
import (
"context"
- "github.com/filecoin-project/specs-actors/actors/builtin"
- "github.com/filecoin-project/specs-actors/actors/builtin/market"
- "github.com/filecoin-project/specs-actors/actors/util/adt"
+ "github.com/filecoin-project/lotus/chain/actors"
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/market"
+
cbor "github.com/ipfs/go-ipld-cbor"
bstore "github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/types"
)
-func SetupStorageMarketActor(bs bstore.Blockstore) (*types.Actor, error) {
- store := adt.WrapStore(context.TODO(), cbor.NewCborStore(bs))
-
- a, err := adt.MakeEmptyArray(store).Root()
- if err != nil {
- return nil, err
- }
- h, err := adt.MakeEmptyMap(store).Root()
+func SetupStorageMarketActor(ctx context.Context, bs bstore.Blockstore, av actors.Version) (*types.Actor, error) {
+ cst := cbor.NewCborStore(bs)
+ mst, err := market.MakeState(adt.WrapStore(ctx, cbor.NewCborStore(bs)), av)
if err != nil {
return nil, err
}
- sms := market.ConstructState(a, h, h)
+ statecid, err := cst.Put(ctx, mst.GetState())
+ if err != nil {
+ return nil, err
+ }
- stcid, err := store.Put(store.Context(), sms)
+ actcid, err := market.GetActorCodeID(av)
if err != nil {
return nil, err
}
act := &types.Actor{
- Code: builtin.StorageMarketActorCodeID,
- Head: stcid,
- Balance: types.NewInt(0),
+ Code: actcid,
+ Head: statecid,
}
return act, nil
diff --git a/chain/gen/genesis/f06_vreg.go b/chain/gen/genesis/f06_vreg.go
index 1ba8abede..d8f5ee2a0 100644
--- a/chain/gen/genesis/f06_vreg.go
+++ b/chain/gen/genesis/f06_vreg.go
@@ -3,11 +3,13 @@ package genesis
import (
"context"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/verifreg"
+
+ "github.com/filecoin-project/lotus/chain/actors"
+
"github.com/filecoin-project/go-address"
cbor "github.com/ipfs/go-ipld-cbor"
- "github.com/filecoin-project/specs-actors/actors/builtin"
- verifreg0 "github.com/filecoin-project/specs-actors/actors/builtin/verifreg"
"github.com/filecoin-project/specs-actors/actors/util/adt"
bstore "github.com/filecoin-project/lotus/blockstore"
@@ -26,25 +28,26 @@ func init() {
RootVerifierID = idk
}
-func SetupVerifiedRegistryActor(bs bstore.Blockstore) (*types.Actor, error) {
- store := adt.WrapStore(context.TODO(), cbor.NewCborStore(bs))
-
- h, err := adt.MakeEmptyMap(store).Root()
+func SetupVerifiedRegistryActor(ctx context.Context, bs bstore.Blockstore, av actors.Version) (*types.Actor, error) {
+ cst := cbor.NewCborStore(bs)
+ vst, err := verifreg.MakeState(adt.WrapStore(ctx, cbor.NewCborStore(bs)), av, RootVerifierID)
if err != nil {
return nil, err
}
- sms := verifreg0.ConstructState(h, RootVerifierID)
+ statecid, err := cst.Put(ctx, vst.GetState())
+ if err != nil {
+ return nil, err
+ }
- stcid, err := store.Put(store.Context(), sms)
+ actcid, err := verifreg.GetActorCodeID(av)
if err != nil {
return nil, err
}
act := &types.Actor{
- Code: builtin.VerifiedRegistryActorCodeID,
- Head: stcid,
- Balance: types.NewInt(0),
+ Code: actcid,
+ Head: statecid,
}
return act, nil
diff --git a/chain/gen/genesis/genesis.go b/chain/gen/genesis/genesis.go
index 4b86db550..94badbbfb 100644
--- a/chain/gen/genesis/genesis.go
+++ b/chain/gen/genesis/genesis.go
@@ -6,6 +6,32 @@ import (
"encoding/json"
"fmt"
+ builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
+ verifreg0 "github.com/filecoin-project/specs-actors/actors/builtin/verifreg"
+ adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
+
+ "github.com/filecoin-project/go-state-types/network"
+
+ "github.com/filecoin-project/lotus/chain/actors/builtin/multisig"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/account"
+
+ "github.com/filecoin-project/lotus/chain/actors"
+
+ "github.com/filecoin-project/lotus/chain/actors/builtin/verifreg"
+
+ "github.com/filecoin-project/lotus/chain/actors/builtin/market"
+
+ "github.com/filecoin-project/lotus/chain/actors/builtin/power"
+
+ "github.com/filecoin-project/lotus/chain/actors/builtin/cron"
+
+ init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/reward"
+
+ "github.com/filecoin-project/lotus/chain/actors/builtin/system"
+
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/journal"
@@ -21,11 +47,6 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/crypto"
- builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
- account0 "github.com/filecoin-project/specs-actors/actors/builtin/account"
- multisig0 "github.com/filecoin-project/specs-actors/actors/builtin/multisig"
- verifreg0 "github.com/filecoin-project/specs-actors/actors/builtin/verifreg"
- adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
bstore "github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
@@ -118,94 +139,92 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
return nil, nil, xerrors.Errorf("putting empty object: %w", err)
}
- state, err := state.NewStateTree(cst, types.StateTreeVersion0)
+ sv, err := state.VersionForNetwork(template.NetworkVersion)
+ if err != nil {
+ return nil, nil, xerrors.Errorf("getting state tree version: %w", err)
+ }
+
+ state, err := state.NewStateTree(cst, sv)
if err != nil {
return nil, nil, xerrors.Errorf("making new state tree: %w", err)
}
+ av := actors.VersionForNetwork(template.NetworkVersion)
+
// Create system actor
- sysact, err := SetupSystemActor(bs)
+ sysact, err := SetupSystemActor(ctx, bs, av)
if err != nil {
- return nil, nil, xerrors.Errorf("setup init actor: %w", err)
+ return nil, nil, xerrors.Errorf("setup system actor: %w", err)
}
- if err := state.SetActor(builtin0.SystemActorAddr, sysact); err != nil {
- return nil, nil, xerrors.Errorf("set init actor: %w", err)
+ if err := state.SetActor(system.Address, sysact); err != nil {
+ return nil, nil, xerrors.Errorf("set system actor: %w", err)
}
// Create init actor
- idStart, initact, keyIDs, err := SetupInitActor(bs, template.NetworkName, template.Accounts, template.VerifregRootKey, template.RemainderAccount)
+ idStart, initact, keyIDs, err := SetupInitActor(ctx, bs, template.NetworkName, template.Accounts, template.VerifregRootKey, template.RemainderAccount, av)
if err != nil {
return nil, nil, xerrors.Errorf("setup init actor: %w", err)
}
- if err := state.SetActor(builtin0.InitActorAddr, initact); err != nil {
+ if err := state.SetActor(init_.Address, initact); err != nil {
return nil, nil, xerrors.Errorf("set init actor: %w", err)
}
// Setup reward
- // RewardActor's state is overrwritten by SetupStorageMiners
- rewact, err := SetupRewardActor(bs, big.Zero())
+ // RewardActor's state is overwritten by SetupStorageMiners, but needs to exist for miner creation messages
+ rewact, err := SetupRewardActor(ctx, bs, big.Zero(), av)
if err != nil {
- return nil, nil, xerrors.Errorf("setup init actor: %w", err)
+ return nil, nil, xerrors.Errorf("setup reward actor: %w", err)
}
- err = state.SetActor(builtin0.RewardActorAddr, rewact)
+ err = state.SetActor(reward.Address, rewact)
if err != nil {
- return nil, nil, xerrors.Errorf("set network account actor: %w", err)
+ return nil, nil, xerrors.Errorf("set reward actor: %w", err)
}
// Setup cron
- cronact, err := SetupCronActor(bs)
+ cronact, err := SetupCronActor(ctx, bs, av)
if err != nil {
return nil, nil, xerrors.Errorf("setup cron actor: %w", err)
}
- if err := state.SetActor(builtin0.CronActorAddr, cronact); err != nil {
+ if err := state.SetActor(cron.Address, cronact); err != nil {
return nil, nil, xerrors.Errorf("set cron actor: %w", err)
}
// Create empty power actor
- spact, err := SetupStoragePowerActor(bs)
+ spact, err := SetupStoragePowerActor(ctx, bs, av)
if err != nil {
- return nil, nil, xerrors.Errorf("setup storage market actor: %w", err)
+ return nil, nil, xerrors.Errorf("setup storage power actor: %w", err)
}
- if err := state.SetActor(builtin0.StoragePowerActorAddr, spact); err != nil {
- return nil, nil, xerrors.Errorf("set storage market actor: %w", err)
+ if err := state.SetActor(power.Address, spact); err != nil {
+ return nil, nil, xerrors.Errorf("set storage power actor: %w", err)
}
// Create empty market actor
- marketact, err := SetupStorageMarketActor(bs)
+ marketact, err := SetupStorageMarketActor(ctx, bs, av)
if err != nil {
return nil, nil, xerrors.Errorf("setup storage market actor: %w", err)
}
- if err := state.SetActor(builtin0.StorageMarketActorAddr, marketact); err != nil {
- return nil, nil, xerrors.Errorf("set market actor: %w", err)
+ if err := state.SetActor(market.Address, marketact); err != nil {
+ return nil, nil, xerrors.Errorf("set storage market actor: %w", err)
}
// Create verified registry
- verifact, err := SetupVerifiedRegistryActor(bs)
+ verifact, err := SetupVerifiedRegistryActor(ctx, bs, av)
if err != nil {
- return nil, nil, xerrors.Errorf("setup storage market actor: %w", err)
+ return nil, nil, xerrors.Errorf("setup verified registry market actor: %w", err)
}
- if err := state.SetActor(builtin0.VerifiedRegistryActorAddr, verifact); err != nil {
- return nil, nil, xerrors.Errorf("set market actor: %w", err)
+ if err := state.SetActor(verifreg.Address, verifact); err != nil {
+ return nil, nil, xerrors.Errorf("set verified registry actor: %w", err)
}
- burntRoot, err := cst.Put(ctx, &account0.State{
- Address: builtin0.BurntFundsActorAddr,
- })
+ bact, err := makeAccountActor(ctx, cst, av, builtin.BurntFundsActorAddr, big.Zero())
if err != nil {
- return nil, nil, xerrors.Errorf("failed to setup burnt funds actor state: %w", err)
+ return nil, nil, xerrors.Errorf("setup burnt funds actor state: %w", err)
}
-
- // Setup burnt-funds
- err = state.SetActor(builtin0.BurntFundsActorAddr, &types.Actor{
- Code: builtin0.AccountActorCodeID,
- Balance: types.NewInt(0),
- Head: burntRoot,
- })
- if err != nil {
- return nil, nil, xerrors.Errorf("set burnt funds account actor: %w", err)
+ if err := state.SetActor(builtin.BurntFundsActorAddr, bact); err != nil {
+ return nil, nil, xerrors.Errorf("set burnt funds actor: %w", err)
}
// Create accounts
@@ -213,7 +232,7 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
switch info.Type {
case genesis.TAccount:
- if err := createAccountActor(ctx, cst, state, info, keyIDs); err != nil {
+ if err := createAccountActor(ctx, cst, state, info, keyIDs, av); err != nil {
return nil, nil, xerrors.Errorf("failed to create account actor: %w", err)
}
@@ -225,7 +244,7 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
}
idStart++
- if err := createMultisigAccount(ctx, bs, cst, state, ida, info, keyIDs); err != nil {
+ if err := createMultisigAccount(ctx, cst, state, ida, info, keyIDs, av); err != nil {
return nil, nil, err
}
default:
@@ -240,26 +259,21 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
if err := json.Unmarshal(template.VerifregRootKey.Meta, &ainfo); err != nil {
return nil, nil, xerrors.Errorf("unmarshaling account meta: %w", err)
}
- st, err := cst.Put(ctx, &account0.State{Address: ainfo.Owner})
- if err != nil {
- return nil, nil, err
- }
_, ok := keyIDs[ainfo.Owner]
if ok {
return nil, nil, fmt.Errorf("rootkey account has already been declared, cannot be assigned 80: %s", ainfo.Owner)
}
- err = state.SetActor(builtin.RootVerifierAddress, &types.Actor{
- Code: builtin0.AccountActorCodeID,
- Balance: template.VerifregRootKey.Balance,
- Head: st,
- })
+ vact, err := makeAccountActor(ctx, cst, av, ainfo.Owner, template.VerifregRootKey.Balance)
if err != nil {
- return nil, nil, xerrors.Errorf("setting verifreg rootkey account: %w", err)
+ return nil, nil, xerrors.Errorf("setup verifreg rootkey account state: %w", err)
+ }
+ if err = state.SetActor(builtin.RootVerifierAddress, vact); err != nil {
+ return nil, nil, xerrors.Errorf("set verifreg rootkey account actor: %w", err)
}
case genesis.TMultisig:
- if err = createMultisigAccount(ctx, bs, cst, state, builtin.RootVerifierAddress, template.VerifregRootKey, keyIDs); err != nil {
+ if err = createMultisigAccount(ctx, cst, state, builtin.RootVerifierAddress, template.VerifregRootKey, keyIDs, av); err != nil {
return nil, nil, xerrors.Errorf("failed to set up verified registry signer: %w", err)
}
default:
@@ -288,18 +302,13 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
return nil, nil, err
}
- verifierState, err := cst.Put(ctx, &account0.State{Address: verifierAd})
+ verifierAct, err := makeAccountActor(ctx, cst, av, verifierAd, big.Zero())
if err != nil {
- return nil, nil, err
+ return nil, nil, xerrors.Errorf("setup first verifier state: %w", err)
}
- err = state.SetActor(verifierId, &types.Actor{
- Code: builtin0.AccountActorCodeID,
- Balance: types.NewInt(0),
- Head: verifierState,
- })
- if err != nil {
- return nil, nil, xerrors.Errorf("setting account from actmap: %w", err)
+ if err = state.SetActor(verifierId, verifierAct); err != nil {
+ return nil, nil, xerrors.Errorf("set first verifier actor: %w", err)
}
totalFilAllocated := big.Zero()
@@ -337,13 +346,13 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
}
keyIDs[ainfo.Owner] = builtin.ReserveAddress
- err = createAccountActor(ctx, cst, state, template.RemainderAccount, keyIDs)
+ err = createAccountActor(ctx, cst, state, template.RemainderAccount, keyIDs, av)
if err != nil {
return nil, nil, xerrors.Errorf("creating remainder acct: %w", err)
}
case genesis.TMultisig:
- if err = createMultisigAccount(ctx, bs, cst, state, builtin.ReserveAddress, template.RemainderAccount, keyIDs); err != nil {
+ if err = createMultisigAccount(ctx, cst, state, builtin.ReserveAddress, template.RemainderAccount, keyIDs, av); err != nil {
return nil, nil, xerrors.Errorf("failed to set up remainder: %w", err)
}
default:
@@ -353,12 +362,38 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
return state, keyIDs, nil
}
-func createAccountActor(ctx context.Context, cst cbor.IpldStore, state *state.StateTree, info genesis.Actor, keyIDs map[address.Address]address.Address) error {
+func makeAccountActor(ctx context.Context, cst cbor.IpldStore, av actors.Version, addr address.Address, bal types.BigInt) (*types.Actor, error) {
+ ast, err := account.MakeState(adt.WrapStore(ctx, cst), av, addr)
+ if err != nil {
+ return nil, err
+ }
+
+ statecid, err := cst.Put(ctx, ast.GetState())
+ if err != nil {
+ return nil, err
+ }
+
+ actcid, err := account.GetActorCodeID(av)
+ if err != nil {
+ return nil, err
+ }
+
+ act := &types.Actor{
+ Code: actcid,
+ Head: statecid,
+ Balance: bal,
+ }
+
+ return act, nil
+}
+
+func createAccountActor(ctx context.Context, cst cbor.IpldStore, state *state.StateTree, info genesis.Actor, keyIDs map[address.Address]address.Address, av actors.Version) error {
var ainfo genesis.AccountMeta
if err := json.Unmarshal(info.Meta, &ainfo); err != nil {
return xerrors.Errorf("unmarshaling account meta: %w", err)
}
- st, err := cst.Put(ctx, &account0.State{Address: ainfo.Owner})
+
+ aa, err := makeAccountActor(ctx, cst, av, ainfo.Owner, info.Balance)
if err != nil {
return err
}
@@ -368,18 +403,14 @@ func createAccountActor(ctx context.Context, cst cbor.IpldStore, state *state.St
return fmt.Errorf("no registered ID for account actor: %s", ainfo.Owner)
}
- err = state.SetActor(ida, &types.Actor{
- Code: builtin0.AccountActorCodeID,
- Balance: info.Balance,
- Head: st,
- })
+ err = state.SetActor(ida, aa)
if err != nil {
return xerrors.Errorf("setting account from actmap: %w", err)
}
return nil
}
-func createMultisigAccount(ctx context.Context, bs bstore.Blockstore, cst cbor.IpldStore, state *state.StateTree, ida address.Address, info genesis.Actor, keyIDs map[address.Address]address.Address) error {
+func createMultisigAccount(ctx context.Context, cst cbor.IpldStore, state *state.StateTree, ida address.Address, info genesis.Actor, keyIDs map[address.Address]address.Address, av actors.Version) error {
if info.Type != genesis.TMultisig {
return fmt.Errorf("can only call createMultisigAccount with multisig Actor info")
}
@@ -387,10 +418,6 @@ func createMultisigAccount(ctx context.Context, bs bstore.Blockstore, cst cbor.I
if err := json.Unmarshal(info.Meta, &ainfo); err != nil {
return xerrors.Errorf("unmarshaling account meta: %w", err)
}
- pending, err := adt0.MakeEmptyMap(adt0.WrapStore(ctx, cst)).Root()
- if err != nil {
- return xerrors.Errorf("failed to create empty map: %v", err)
- }
var signers []address.Address
@@ -407,44 +434,45 @@ func createMultisigAccount(ctx context.Context, bs bstore.Blockstore, cst cbor.I
continue
}
- st, err := cst.Put(ctx, &account0.State{Address: e})
+ aa, err := makeAccountActor(ctx, cst, av, e, big.Zero())
if err != nil {
return err
}
- err = state.SetActor(idAddress, &types.Actor{
- Code: builtin0.AccountActorCodeID,
- Balance: types.NewInt(0),
- Head: st,
- })
- if err != nil {
+
+ if err = state.SetActor(idAddress, aa); err != nil {
return xerrors.Errorf("setting account from actmap: %w", err)
}
signers = append(signers, idAddress)
}
- st, err := cst.Put(ctx, &multisig0.State{
- Signers: signers,
- NumApprovalsThreshold: uint64(ainfo.Threshold),
- StartEpoch: abi.ChainEpoch(ainfo.VestingStart),
- UnlockDuration: abi.ChainEpoch(ainfo.VestingDuration),
- PendingTxns: pending,
- InitialBalance: info.Balance,
- })
+ mst, err := multisig.MakeState(adt.WrapStore(ctx, cst), av, signers, uint64(ainfo.Threshold), abi.ChainEpoch(ainfo.VestingStart), abi.ChainEpoch(ainfo.VestingDuration), info.Balance)
if err != nil {
return err
}
+
+ statecid, err := cst.Put(ctx, mst.GetState())
+ if err != nil {
+ return err
+ }
+
+ actcid, err := multisig.GetActorCodeID(av)
+ if err != nil {
+ return err
+ }
+
err = state.SetActor(ida, &types.Actor{
- Code: builtin0.MultisigActorCodeID,
+ Code: actcid,
Balance: info.Balance,
- Head: st,
+ Head: statecid,
})
if err != nil {
return xerrors.Errorf("setting account from actmap: %w", err)
}
+
return nil
}
-func VerifyPreSealedData(ctx context.Context, cs *store.ChainStore, stateroot cid.Cid, template genesis.Template, keyIDs map[address.Address]address.Address) (cid.Cid, error) {
+func VerifyPreSealedData(ctx context.Context, cs *store.ChainStore, stateroot cid.Cid, template genesis.Template, keyIDs map[address.Address]address.Address, nv network.Version) (cid.Cid, error) {
verifNeeds := make(map[address.Address]abi.PaddedPieceSize)
var sum abi.PaddedPieceSize
@@ -455,8 +483,10 @@ func VerifyPreSealedData(ctx context.Context, cs *store.ChainStore, stateroot ci
Bstore: cs.StateBlockstore(),
Syscalls: mkFakedSigSyscalls(cs.VMSys()),
CircSupplyCalc: nil,
- NtwkVersion: genesisNetworkVersion,
- BaseFee: types.NewInt(0),
+ NtwkVersion: func(_ context.Context, _ abi.ChainEpoch) network.Version {
+ return nv
+ },
+ BaseFee: types.NewInt(0),
}
vm, err := vm.NewVM(ctx, &vmopt)
if err != nil {
@@ -485,7 +515,8 @@ func VerifyPreSealedData(ctx context.Context, cs *store.ChainStore, stateroot ci
return cid.Undef, err
}
- _, err = doExecValue(ctx, vm, builtin0.VerifiedRegistryActorAddr, verifregRoot, types.NewInt(0), builtin0.MethodsVerifiedRegistry.AddVerifier, mustEnc(&verifreg0.AddVerifierParams{
+ // Note: This is brittle, if the methodNum / param changes, it could break things
+ _, err = doExecValue(ctx, vm, verifreg.Address, verifregRoot, types.NewInt(0), builtin0.MethodsVerifiedRegistry.AddVerifier, mustEnc(&verifreg0.AddVerifierParams{
Address: verifier,
Allowance: abi.NewStoragePower(int64(sum)), // eh, close enough
@@ -496,7 +527,8 @@ func VerifyPreSealedData(ctx context.Context, cs *store.ChainStore, stateroot ci
}
for c, amt := range verifNeeds {
- _, err := doExecValue(ctx, vm, builtin0.VerifiedRegistryActorAddr, verifier, types.NewInt(0), builtin0.MethodsVerifiedRegistry.AddVerifiedClient, mustEnc(&verifreg0.AddVerifiedClientParams{
+ // Note: This is brittle, if the methodNum / param changes, it could break things
+ _, err := doExecValue(ctx, vm, verifreg.Address, verifier, types.NewInt(0), builtin0.MethodsVerifiedRegistry.AddVerifiedClient, mustEnc(&verifreg0.AddVerifiedClientParams{
Address: c,
Allowance: abi.NewStoragePower(int64(amt)),
}))
@@ -531,17 +563,17 @@ func MakeGenesisBlock(ctx context.Context, j journal.Journal, bs bstore.Blocksto
cs := store.NewChainStore(bs, bs, datastore.NewMapDatastore(), sys, j)
// Verify PreSealed Data
- stateroot, err = VerifyPreSealedData(ctx, cs, stateroot, template, keyIDs)
+ stateroot, err = VerifyPreSealedData(ctx, cs, stateroot, template, keyIDs, template.NetworkVersion)
if err != nil {
return nil, xerrors.Errorf("failed to verify presealed data: %w", err)
}
- stateroot, err = SetupStorageMiners(ctx, cs, stateroot, template.Miners)
+ stateroot, err = SetupStorageMiners(ctx, cs, stateroot, template.Miners, template.NetworkVersion)
if err != nil {
return nil, xerrors.Errorf("setup miners failed: %w", err)
}
- store := adt0.WrapStore(ctx, cbor.NewCborStore(bs))
+ store := adt.WrapStore(ctx, cbor.NewCborStore(bs))
emptyroot, err := adt0.MakeEmptyArray(store).Root()
if err != nil {
return nil, xerrors.Errorf("amt build failed: %w", err)
@@ -590,7 +622,7 @@ func MakeGenesisBlock(ctx context.Context, j journal.Journal, bs bstore.Blocksto
}
b := &types.BlockHeader{
- Miner: builtin0.SystemActorAddr,
+ Miner: system.Address,
Ticket: genesisticket,
Parents: []cid.Cid{filecoinGenesisCid},
Height: 0,
diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go
index 86fd16812..e6f17d677 100644
--- a/chain/gen/genesis/miners.go
+++ b/chain/gen/genesis/miners.go
@@ -6,6 +6,22 @@ import (
"fmt"
"math/rand"
+ power4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/power"
+
+ reward4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/reward"
+
+ market4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/market"
+
+ "github.com/filecoin-project/lotus/chain/actors"
+
+ "github.com/filecoin-project/lotus/chain/actors/builtin"
+
+ "github.com/filecoin-project/lotus/chain/actors/policy"
+
+ "github.com/filecoin-project/lotus/chain/actors/adt"
+
+ "github.com/filecoin-project/go-state-types/network"
+
market0 "github.com/filecoin-project/specs-actors/actors/builtin/market"
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
@@ -61,7 +77,12 @@ func mkFakedSigSyscalls(base vm.SyscallBuilder) vm.SyscallBuilder {
}
}
-func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid, miners []genesis.Miner) (cid.Cid, error) {
+// Note: Much of this is brittle, if the methodNum / param / return changes, it will break things
+func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid, miners []genesis.Miner, nv network.Version) (cid.Cid, error) {
+
+ cst := cbor.NewCborStore(cs.StateBlockstore())
+ av := actors.VersionForNetwork(nv)
+
csc := func(context.Context, abi.ChainEpoch, *state.StateTree) (abi.TokenAmount, error) {
return big.Zero(), nil
}
@@ -73,8 +94,10 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
Bstore: cs.StateBlockstore(),
Syscalls: mkFakedSigSyscalls(cs.VMSys()),
CircSupplyCalc: csc,
- NtwkVersion: genesisNetworkVersion,
- BaseFee: types.NewInt(0),
+ NtwkVersion: func(_ context.Context, _ abi.ChainEpoch) network.Version {
+ return nv
+ },
+ BaseFee: types.NewInt(0),
}
vm, err := vm.NewVM(ctx, vmopt)
@@ -94,12 +117,13 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
dealIDs []abi.DealID
}, len(miners))
+ maxPeriods := policy.GetMaxSectorExpirationExtension() / miner.WPoStProvingPeriod
for i, m := range miners {
// Create miner through power actor
i := i
m := m
- spt, err := miner.SealProofTypeFromSectorSize(m.SectorSize, GenesisNetworkVersion)
+ spt, err := miner.SealProofTypeFromSectorSize(m.SectorSize, nv)
if err != nil {
return cid.Undef, err
}
@@ -113,7 +137,7 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
}
params := mustEnc(constructorParams)
- rval, err := doExecValue(ctx, vm, power.Address, m.Owner, m.PowerBalance, builtin0.MethodsPower.CreateMiner, params)
+ rval, err := doExecValue(ctx, vm, power.Address, m.Owner, m.PowerBalance, power.Methods.CreateMiner, params)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to create genesis miner: %w", err)
}
@@ -129,23 +153,34 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
}
minerInfos[i].maddr = ma.IDAddress
- // TODO: ActorUpgrade
- err = vm.MutateState(ctx, minerInfos[i].maddr, func(cst cbor.IpldStore, st *miner0.State) error {
- maxPeriods := miner0.MaxSectorExpirationExtension / miner0.WPoStProvingPeriod
- minerInfos[i].presealExp = (maxPeriods-1)*miner0.WPoStProvingPeriod + st.ProvingPeriodStart - 1
-
- return nil
- })
+ _, err = vm.Flush(ctx)
if err != nil {
- return cid.Undef, xerrors.Errorf("mutating state: %w", err)
+ return cid.Undef, xerrors.Errorf("flushing vm: %w", err)
}
+
+ mact, err := vm.StateTree().GetActor(minerInfos[i].maddr)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting newly created miner actor: %w", err)
+ }
+
+ mst, err := miner.Load(adt.WrapStore(ctx, cst), mact)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting newly created miner state: %w", err)
+ }
+
+ pps, err := mst.GetProvingPeriodStart()
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting newly created miner proving period start: %w", err)
+ }
+
+ minerInfos[i].presealExp = (maxPeriods-1)*miner0.WPoStProvingPeriod + pps - 1
}
// Add market funds
if m.MarketBalance.GreaterThan(big.Zero()) {
params := mustEnc(&minerInfos[i].maddr)
- _, err := doExecValue(ctx, vm, market.Address, m.Worker, m.MarketBalance, builtin0.MethodsMarket.AddBalance, params)
+ _, err := doExecValue(ctx, vm, market.Address, m.Worker, m.MarketBalance, market.Methods.AddBalance, params)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to create genesis miner (add balance): %w", err)
}
@@ -203,35 +238,66 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
for pi := range m.Sectors {
rawPow = types.BigAdd(rawPow, types.NewInt(uint64(m.SectorSize)))
- dweight, err := dealWeight(ctx, vm, minerInfos[i].maddr, []abi.DealID{minerInfos[i].dealIDs[pi]}, 0, minerInfos[i].presealExp)
+ dweight, vdweight, err := dealWeight(ctx, vm, minerInfos[i].maddr, []abi.DealID{minerInfos[i].dealIDs[pi]}, 0, minerInfos[i].presealExp, av)
if err != nil {
return cid.Undef, xerrors.Errorf("getting deal weight: %w", err)
}
- sectorWeight := miner0.QAPowerForWeight(m.SectorSize, minerInfos[i].presealExp, dweight.DealWeight, dweight.VerifiedDealWeight)
+ sectorWeight := builtin.QAPowerForWeight(m.SectorSize, minerInfos[i].presealExp, dweight, vdweight)
qaPow = types.BigAdd(qaPow, sectorWeight)
}
}
- err = vm.MutateState(ctx, power.Address, func(cst cbor.IpldStore, st *power0.State) error {
- st.TotalQualityAdjPower = qaPow
- st.TotalRawBytePower = rawPow
-
- st.ThisEpochQualityAdjPower = qaPow
- st.ThisEpochRawBytePower = rawPow
- return nil
- })
+ _, err = vm.Flush(ctx)
if err != nil {
- return cid.Undef, xerrors.Errorf("mutating state: %w", err)
+ return cid.Undef, xerrors.Errorf("flushing vm: %w", err)
}
- err = vm.MutateState(ctx, reward.Address, func(sct cbor.IpldStore, st *reward0.State) error {
- *st = *reward0.ConstructState(qaPow)
- return nil
- })
+ pact, err := vm.StateTree().GetActor(power.Address)
if err != nil {
- return cid.Undef, xerrors.Errorf("mutating state: %w", err)
+ return cid.Undef, xerrors.Errorf("getting power actor: %w", err)
+ }
+
+ pst, err := power.Load(adt.WrapStore(ctx, cst), pact)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting power state: %w", err)
+ }
+
+ if err = pst.SetTotalQualityAdjPower(qaPow); err != nil {
+ return cid.Undef, xerrors.Errorf("setting TotalQualityAdjPower in power state: %w", err)
+ }
+
+ if err = pst.SetTotalRawBytePower(rawPow); err != nil {
+ return cid.Undef, xerrors.Errorf("setting TotalRawBytePower in power state: %w", err)
+ }
+
+ if err = pst.SetThisEpochQualityAdjPower(qaPow); err != nil {
+ return cid.Undef, xerrors.Errorf("setting ThisEpochQualityAdjPower in power state: %w", err)
+ }
+
+ if err = pst.SetThisEpochRawBytePower(rawPow); err != nil {
+ return cid.Undef, xerrors.Errorf("setting ThisEpochRawBytePower in power state: %w", err)
+ }
+
+ pcid, err := cst.Put(ctx, pst.GetState())
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("putting power state: %w", err)
+ }
+
+ pact.Head = pcid
+
+ if err = vm.StateTree().SetActor(power.Address, pact); err != nil {
+ return cid.Undef, xerrors.Errorf("setting power state: %w", err)
+ }
+
+ rewact, err := SetupRewardActor(ctx, cs.StateBlockstore(), big.Zero(), actors.VersionForNetwork(nv))
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("setup reward actor: %w", err)
+ }
+
+ if err = vm.StateTree().SetActor(reward.Address, rewact); err != nil {
+ return cid.Undef, xerrors.Errorf("set reward actor: %w", err)
}
}
@@ -248,24 +314,55 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
Expiration: minerInfos[i].presealExp, // TODO: Allow setting externally!
}
- dweight, err := dealWeight(ctx, vm, minerInfos[i].maddr, params.DealIDs, 0, minerInfos[i].presealExp)
+ dweight, vdweight, err := dealWeight(ctx, vm, minerInfos[i].maddr, params.DealIDs, 0, minerInfos[i].presealExp, av)
if err != nil {
return cid.Undef, xerrors.Errorf("getting deal weight: %w", err)
}
- sectorWeight := miner0.QAPowerForWeight(m.SectorSize, minerInfos[i].presealExp, dweight.DealWeight, dweight.VerifiedDealWeight)
+ sectorWeight := builtin.QAPowerForWeight(m.SectorSize, minerInfos[i].presealExp, dweight, vdweight)
// we've added fake power for this sector above, remove it now
- err = vm.MutateState(ctx, power.Address, func(cst cbor.IpldStore, st *power0.State) error {
- st.TotalQualityAdjPower = types.BigSub(st.TotalQualityAdjPower, sectorWeight) //nolint:scopelint
- st.TotalRawBytePower = types.BigSub(st.TotalRawBytePower, types.NewInt(uint64(m.SectorSize)))
- return nil
- })
+
+ _, err = vm.Flush(ctx)
if err != nil {
- return cid.Undef, xerrors.Errorf("removing fake power: %w", err)
+ return cid.Undef, xerrors.Errorf("flushing vm: %w", err)
}
- epochReward, err := currentEpochBlockReward(ctx, vm, minerInfos[i].maddr)
+ pact, err := vm.StateTree().GetActor(power.Address)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting power actor: %w", err)
+ }
+
+ pst, err := power.Load(adt.WrapStore(ctx, cst), pact)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting power state: %w", err)
+ }
+
+ pc, err := pst.TotalPower()
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting total power: %w", err)
+ }
+
+ if err = pst.SetTotalRawBytePower(types.BigSub(pc.RawBytePower, types.NewInt(uint64(m.SectorSize)))); err != nil {
+ return cid.Undef, xerrors.Errorf("setting TotalRawBytePower in power state: %w", err)
+ }
+
+ if err = pst.SetTotalQualityAdjPower(types.BigSub(pc.QualityAdjPower, sectorWeight)); err != nil {
+ return cid.Undef, xerrors.Errorf("setting TotalQualityAdjPower in power state: %w", err)
+ }
+
+ pcid, err := cst.Put(ctx, pst.GetState())
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("putting power state: %w", err)
+ }
+
+ pact.Head = pcid
+
+ if err = vm.StateTree().SetActor(power.Address, pact); err != nil {
+ return cid.Undef, xerrors.Errorf("setting power state: %w", err)
+ }
+
+ baselinePower, rewardSmoothed, err := currentEpochBlockReward(ctx, vm, minerInfos[i].maddr, av)
if err != nil {
return cid.Undef, xerrors.Errorf("getting current epoch reward: %w", err)
}
@@ -275,13 +372,13 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
return cid.Undef, xerrors.Errorf("getting current total power: %w", err)
}
- pcd := miner0.PreCommitDepositForPower(epochReward.ThisEpochRewardSmoothed, tpow.QualityAdjPowerSmoothed, sectorWeight)
+ pcd := miner0.PreCommitDepositForPower(&rewardSmoothed, tpow.QualityAdjPowerSmoothed, sectorWeight)
pledge := miner0.InitialPledgeForPower(
sectorWeight,
- epochReward.ThisEpochBaselinePower,
+ baselinePower,
tpow.PledgeCollateral,
- epochReward.ThisEpochRewardSmoothed,
+ &rewardSmoothed,
tpow.QualityAdjPowerSmoothed,
circSupply(ctx, vm, minerInfos[i].maddr),
)
@@ -289,7 +386,7 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
pledge = big.Add(pcd, pledge)
fmt.Println(types.FIL(pledge))
- _, err = doExecValue(ctx, vm, minerInfos[i].maddr, m.Worker, pledge, builtin0.MethodsMiner.PreCommitSector, mustEnc(params))
+ _, err = doExecValue(ctx, vm, minerInfos[i].maddr, m.Worker, pledge, miner.Methods.PreCommitSector, mustEnc(params))
if err != nil {
return cid.Undef, xerrors.Errorf("failed to confirm presealed sectors: %w", err)
}
@@ -299,28 +396,84 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
Sectors: []abi.SectorNumber{preseal.SectorID},
}
- _, err = doExecValue(ctx, vm, minerInfos[i].maddr, power.Address, big.Zero(), builtin0.MethodsMiner.ConfirmSectorProofsValid, mustEnc(confirmParams))
+ _, err = doExecValue(ctx, vm, minerInfos[i].maddr, power.Address, big.Zero(), miner.Methods.ConfirmSectorProofsValid, mustEnc(confirmParams))
if err != nil {
return cid.Undef, xerrors.Errorf("failed to confirm presealed sectors: %w", err)
}
+
+ if av > actors.Version2 {
+ // post v2, we need to explicitly Claim this power since ConfirmSectorProofsValid doesn't do it anymore
+ claimParams := &power4.UpdateClaimedPowerParams{
+ RawByteDelta: types.NewInt(uint64(m.SectorSize)),
+ QualityAdjustedDelta: sectorWeight,
+ }
+
+ _, err = doExecValue(ctx, vm, power.Address, minerInfos[i].maddr, big.Zero(), power.Methods.UpdateClaimedPower, mustEnc(claimParams))
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("failed to confirm presealed sectors: %w", err)
+ }
+
+ _, err = vm.Flush(ctx)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("flushing vm: %w", err)
+ }
+
+ mact, err := vm.StateTree().GetActor(minerInfos[i].maddr)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting miner actor: %w", err)
+ }
+
+ mst, err := miner.Load(adt.WrapStore(ctx, cst), mact)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting miner state: %w", err)
+ }
+
+ if err = mst.EraseAllUnproven(); err != nil {
+ return cid.Undef, xerrors.Errorf("failed to erase unproven sectors: %w", err)
+ }
+
+ mcid, err := cst.Put(ctx, mst.GetState())
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("putting miner state: %w", err)
+ }
+
+ mact.Head = mcid
+
+ if err = vm.StateTree().SetActor(minerInfos[i].maddr, mact); err != nil {
+ return cid.Undef, xerrors.Errorf("setting miner state: %w", err)
+ }
+ }
}
}
}
// Sanity-check total network power
- err = vm.MutateState(ctx, power.Address, func(cst cbor.IpldStore, st *power0.State) error {
- if !st.TotalRawBytePower.Equals(rawPow) {
- return xerrors.Errorf("st.TotalRawBytePower doesn't match previously calculated rawPow")
- }
-
- if !st.TotalQualityAdjPower.Equals(qaPow) {
- return xerrors.Errorf("st.TotalQualityAdjPower doesn't match previously calculated qaPow")
- }
-
- return nil
- })
+ _, err = vm.Flush(ctx)
if err != nil {
- return cid.Undef, xerrors.Errorf("mutating state: %w", err)
+ return cid.Undef, xerrors.Errorf("flushing vm: %w", err)
+ }
+
+ pact, err := vm.StateTree().GetActor(power.Address)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting power actor: %w", err)
+ }
+
+ pst, err := power.Load(adt.WrapStore(ctx, cst), pact)
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting power state: %w", err)
+ }
+
+ pc, err := pst.TotalPower()
+ if err != nil {
+ return cid.Undef, xerrors.Errorf("getting total power: %w", err)
+ }
+
+ if !pc.RawBytePower.Equals(rawPow) {
+ return cid.Undef, xerrors.Errorf("TotalRawBytePower (%s) doesn't match previously calculated rawPow (%s)", pc.RawBytePower, rawPow)
+ }
+
+ if !pc.QualityAdjPower.Equals(qaPow) {
+ return cid.Undef, xerrors.Errorf("QualityAdjPower (%s) doesn't match previously calculated qaPow (%s)", pc.QualityAdjPower, qaPow)
}
// TODO: Should we re-ConstructState for the reward actor using rawPow as currRealizedPower here?
@@ -372,43 +525,79 @@ func currentTotalPower(ctx context.Context, vm *vm.VM, maddr address.Address) (*
return &pwr, nil
}
-func dealWeight(ctx context.Context, vm *vm.VM, maddr address.Address, dealIDs []abi.DealID, sectorStart, sectorExpiry abi.ChainEpoch) (market0.VerifyDealsForActivationReturn, error) {
- params := &market.VerifyDealsForActivationParams{
- DealIDs: dealIDs,
- SectorStart: sectorStart,
- SectorExpiry: sectorExpiry,
- }
+func dealWeight(ctx context.Context, vm *vm.VM, maddr address.Address, dealIDs []abi.DealID, sectorStart, sectorExpiry abi.ChainEpoch, av actors.Version) (abi.DealWeight, abi.DealWeight, error) {
+ // TODO: This hack should move to market actor wrapper
+ if av <= actors.Version2 {
+ params := &market0.VerifyDealsForActivationParams{
+ DealIDs: dealIDs,
+ SectorStart: sectorStart,
+ SectorExpiry: sectorExpiry,
+ }
- var dealWeights market0.VerifyDealsForActivationReturn
+ var dealWeights market0.VerifyDealsForActivationReturn
+ ret, err := doExecValue(ctx, vm,
+ market.Address,
+ maddr,
+ abi.NewTokenAmount(0),
+ builtin0.MethodsMarket.VerifyDealsForActivation,
+ mustEnc(params),
+ )
+ if err != nil {
+ return big.Zero(), big.Zero(), err
+ }
+ if err := dealWeights.UnmarshalCBOR(bytes.NewReader(ret)); err != nil {
+ return big.Zero(), big.Zero(), err
+ }
+
+ return dealWeights.DealWeight, dealWeights.VerifiedDealWeight, nil
+ }
+ params := &market4.VerifyDealsForActivationParams{Sectors: []market4.SectorDeals{{
+ SectorExpiry: sectorExpiry,
+ DealIDs: dealIDs,
+ }}}
+
+ var dealWeights market4.VerifyDealsForActivationReturn
ret, err := doExecValue(ctx, vm,
market.Address,
maddr,
abi.NewTokenAmount(0),
- builtin0.MethodsMarket.VerifyDealsForActivation,
+ market.Methods.VerifyDealsForActivation,
mustEnc(params),
)
if err != nil {
- return market0.VerifyDealsForActivationReturn{}, err
+ return big.Zero(), big.Zero(), err
}
if err := dealWeights.UnmarshalCBOR(bytes.NewReader(ret)); err != nil {
- return market0.VerifyDealsForActivationReturn{}, err
+ return big.Zero(), big.Zero(), err
}
- return dealWeights, nil
+ return dealWeights.Sectors[0].DealWeight, dealWeights.Sectors[0].VerifiedDealWeight, nil
}
-func currentEpochBlockReward(ctx context.Context, vm *vm.VM, maddr address.Address) (*reward0.ThisEpochRewardReturn, error) {
- rwret, err := doExecValue(ctx, vm, reward.Address, maddr, big.Zero(), builtin0.MethodsReward.ThisEpochReward, nil)
+func currentEpochBlockReward(ctx context.Context, vm *vm.VM, maddr address.Address, av actors.Version) (abi.StoragePower, builtin.FilterEstimate, error) {
+ rwret, err := doExecValue(ctx, vm, reward.Address, maddr, big.Zero(), reward.Methods.ThisEpochReward, nil)
if err != nil {
- return nil, err
+ return big.Zero(), builtin.FilterEstimate{}, err
}
- var epochReward reward0.ThisEpochRewardReturn
+ // TODO: This hack should move to reward actor wrapper
+ if av <= actors.Version2 {
+ var epochReward reward0.ThisEpochRewardReturn
+
+ if err := epochReward.UnmarshalCBOR(bytes.NewReader(rwret)); err != nil {
+ return big.Zero(), builtin.FilterEstimate{}, err
+ }
+
+ return epochReward.ThisEpochBaselinePower, *epochReward.ThisEpochRewardSmoothed, nil
+ }
+
+ var epochReward reward4.ThisEpochRewardReturn
+
if err := epochReward.UnmarshalCBOR(bytes.NewReader(rwret)); err != nil {
- return nil, err
+ return big.Zero(), builtin.FilterEstimate{}, err
}
- return &epochReward, nil
+ return epochReward.ThisEpochBaselinePower, builtin.FilterEstimate(epochReward.ThisEpochRewardSmoothed), nil
}
func circSupply(ctx context.Context, vmi *vm.VM, maddr address.Address) abi.TokenAmount {
diff --git a/chain/gen/genesis/util.go b/chain/gen/genesis/util.go
index 1ebc58121..67a4e9579 100644
--- a/chain/gen/genesis/util.go
+++ b/chain/gen/genesis/util.go
@@ -3,9 +3,6 @@ package genesis
import (
"context"
- "github.com/filecoin-project/go-state-types/network"
- "github.com/filecoin-project/lotus/build"
-
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
cbg "github.com/whyrusleeping/cbor-gen"
@@ -49,29 +46,3 @@ func doExecValue(ctx context.Context, vm *vm.VM, to, from address.Address, value
return ret.Return, nil
}
-
-// TODO: Get from build
-// TODO: make a list/schedule of these.
-var GenesisNetworkVersion = func() network.Version {
- // returns the version _before_ the first upgrade.
- if build.UpgradeBreezeHeight >= 0 {
- return network.Version0
- }
- if build.UpgradeSmokeHeight >= 0 {
- return network.Version1
- }
- if build.UpgradeIgnitionHeight >= 0 {
- return network.Version2
- }
- if build.UpgradeAssemblyHeight >= 0 {
- return network.Version3
- }
- if build.UpgradeLiftoffHeight >= 0 {
- return network.Version3
- }
- return build.ActorUpgradeNetworkVersion - 1 // genesis requires actors v0.
-}()
-
-func genesisNetworkVersion(context.Context, abi.ChainEpoch) network.Version { // TODO: Get from build/
- return GenesisNetworkVersion // TODO: Get from build/
-} // TODO: Get from build/
diff --git a/chain/market/fundmanager.go b/chain/market/fundmanager.go
index 8d5f63ce2..5becfdfa7 100644
--- a/chain/market/fundmanager.go
+++ b/chain/market/fundmanager.go
@@ -36,7 +36,7 @@ type FundManagerAPI struct {
type fundManagerAPI interface {
MpoolPushMessage(context.Context, *types.Message, *api.MessageSendSpec) (*types.SignedMessage, error)
StateMarketBalance(context.Context, address.Address, types.TipSetKey) (api.MarketBalance, error)
- StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*api.MsgLookup, error)
+ StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
}
// FundManager keeps track of funds in a set of addresses
@@ -721,6 +721,6 @@ func (env *fundManagerEnvironment) WithdrawFunds(
}
func (env *fundManagerEnvironment) WaitMsg(ctx context.Context, c cid.Cid) error {
- _, err := env.api.StateWaitMsg(ctx, c, build.MessageConfidence)
+ _, err := env.api.StateWaitMsg(ctx, c, build.MessageConfidence, api.LookbackNoLimit, true)
return err
}
diff --git a/chain/market/fundmanager_test.go b/chain/market/fundmanager_test.go
index ac6b2a405..125304343 100644
--- a/chain/market/fundmanager_test.go
+++ b/chain/market/fundmanager_test.go
@@ -793,7 +793,7 @@ func (mapi *mockFundManagerAPI) publish(addr address.Address, amt abi.TokenAmoun
mapi.escrow[addr] = escrow
}
-func (mapi *mockFundManagerAPI) StateWaitMsg(ctx context.Context, c cid.Cid, confidence uint64) (*api.MsgLookup, error) {
+func (mapi *mockFundManagerAPI) StateWaitMsg(ctx context.Context, c cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) {
res := &api.MsgLookup{
Message: c,
Receipt: types.MessageReceipt{
diff --git a/chain/messagepool/check.go b/chain/messagepool/check.go
new file mode 100644
index 000000000..11203e7df
--- /dev/null
+++ b/chain/messagepool/check.go
@@ -0,0 +1,431 @@
+package messagepool
+
+import (
+ "context"
+ "fmt"
+ stdbig "math/big"
+ "sort"
+
+ "golang.org/x/xerrors"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/chain/vm"
+)
+
+var baseFeeUpperBoundFactor = types.NewInt(10)
+
+// CheckMessages performs a set of logic checks for a list of messages, prior to submitting it to the mpool
+func (mp *MessagePool) CheckMessages(ctx context.Context, protos []*api.MessagePrototype) ([][]api.MessageCheckStatus, error) {
+ flex := make([]bool, len(protos))
+ msgs := make([]*types.Message, len(protos))
+ for i, p := range protos {
+ flex[i] = !p.ValidNonce
+ msgs[i] = &p.Message
+ }
+ return mp.checkMessages(ctx, msgs, false, flex)
+}
+
+// CheckPendingMessages performs a set of logical sets for all messages pending from a given actor
+func (mp *MessagePool) CheckPendingMessages(ctx context.Context, from address.Address) ([][]api.MessageCheckStatus, error) {
+ var msgs []*types.Message
+ mp.lk.Lock()
+ mset, ok := mp.pending[from]
+ if ok {
+ for _, sm := range mset.msgs {
+ msgs = append(msgs, &sm.Message)
+ }
+ }
+ mp.lk.Unlock()
+
+ if len(msgs) == 0 {
+ return nil, nil
+ }
+
+ sort.Slice(msgs, func(i, j int) bool {
+ return msgs[i].Nonce < msgs[j].Nonce
+ })
+
+ return mp.checkMessages(ctx, msgs, true, nil)
+}
+
+// CheckReplaceMessages performs a set of logical checks for related messages while performing a
+// replacement.
+func (mp *MessagePool) CheckReplaceMessages(ctx context.Context, replace []*types.Message) ([][]api.MessageCheckStatus, error) {
+ msgMap := make(map[address.Address]map[uint64]*types.Message)
+ count := 0
+
+ mp.lk.Lock()
+ for _, m := range replace {
+ mmap, ok := msgMap[m.From]
+ if !ok {
+ mmap = make(map[uint64]*types.Message)
+ msgMap[m.From] = mmap
+ mset, ok := mp.pending[m.From]
+ if ok {
+ count += len(mset.msgs)
+ for _, sm := range mset.msgs {
+ mmap[sm.Message.Nonce] = &sm.Message
+ }
+ } else {
+ count++
+ }
+ }
+ mmap[m.Nonce] = m
+ }
+ mp.lk.Unlock()
+
+ msgs := make([]*types.Message, 0, count)
+ start := 0
+ for _, mmap := range msgMap {
+ end := start + len(mmap)
+
+ for _, m := range mmap {
+ msgs = append(msgs, m)
+ }
+
+ sort.Slice(msgs[start:end], func(i, j int) bool {
+ return msgs[start+i].Nonce < msgs[start+j].Nonce
+ })
+
+ start = end
+ }
+
+ return mp.checkMessages(ctx, msgs, true, nil)
+}
+
+// flexibleNonces should be either nil or of len(msgs), it signifies that message at given index
+// has non-determied nonce at this point
+func (mp *MessagePool) checkMessages(ctx context.Context, msgs []*types.Message, interned bool, flexibleNonces []bool) (result [][]api.MessageCheckStatus, err error) {
+ if mp.api.IsLite() {
+ return nil, nil
+ }
+ mp.curTsLk.Lock()
+ curTs := mp.curTs
+ mp.curTsLk.Unlock()
+
+ epoch := curTs.Height()
+
+ var baseFee big.Int
+ if len(curTs.Blocks()) > 0 {
+ baseFee = curTs.Blocks()[0].ParentBaseFee
+ } else {
+ baseFee, err = mp.api.ChainComputeBaseFee(context.Background(), curTs)
+ if err != nil {
+ return nil, xerrors.Errorf("error computing basefee: %w", err)
+ }
+ }
+
+ baseFeeLowerBound := getBaseFeeLowerBound(baseFee, baseFeeLowerBoundFactor)
+ baseFeeUpperBound := types.BigMul(baseFee, baseFeeUpperBoundFactor)
+
+ type actorState struct {
+ nextNonce uint64
+ requiredFunds *stdbig.Int
+ }
+
+ state := make(map[address.Address]*actorState)
+ balances := make(map[address.Address]big.Int)
+
+ result = make([][]api.MessageCheckStatus, len(msgs))
+
+ for i, m := range msgs {
+ // pre-check: actor nonce
+ check := api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageGetStateNonce,
+ },
+ }
+
+ st, ok := state[m.From]
+ if !ok {
+ mp.lk.Lock()
+ mset, ok := mp.pending[m.From]
+ if ok && !interned {
+ st = &actorState{nextNonce: mset.nextNonce, requiredFunds: mset.requiredFunds}
+ for _, m := range mset.msgs {
+ st.requiredFunds = new(stdbig.Int).Add(st.requiredFunds, m.Message.Value.Int)
+ }
+ state[m.From] = st
+ mp.lk.Unlock()
+
+ check.OK = true
+ check.Hint = map[string]interface{}{
+ "nonce": st.nextNonce,
+ }
+ } else {
+ mp.lk.Unlock()
+
+ stateNonce, err := mp.getStateNonce(ctx, m.From, curTs)
+ if err != nil {
+ check.OK = false
+ check.Err = fmt.Sprintf("error retrieving state nonce: %s", err.Error())
+ } else {
+ check.OK = true
+ check.Hint = map[string]interface{}{
+ "nonce": stateNonce,
+ }
+ }
+
+ st = &actorState{nextNonce: stateNonce, requiredFunds: new(stdbig.Int)}
+ state[m.From] = st
+ }
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+ if !check.OK {
+ continue
+ }
+
+ // pre-check: actor balance
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageGetStateBalance,
+ },
+ }
+
+ balance, ok := balances[m.From]
+ if !ok {
+ balance, err = mp.getStateBalance(ctx, m.From, curTs)
+ if err != nil {
+ check.OK = false
+ check.Err = fmt.Sprintf("error retrieving state balance: %s", err)
+ } else {
+ check.OK = true
+ check.Hint = map[string]interface{}{
+ "balance": balance,
+ }
+ }
+
+ balances[m.From] = balance
+ } else {
+ check.OK = true
+ check.Hint = map[string]interface{}{
+ "balance": balance,
+ }
+ }
+
+ result[i] = append(result[i], check)
+ if !check.OK {
+ continue
+ }
+
+ // 1. Serialization
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageSerialize,
+ },
+ }
+
+ bytes, err := m.Serialize()
+ if err != nil {
+ check.OK = false
+ check.Err = err.Error()
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+
+ // 2. Message size
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageSize,
+ },
+ }
+
+ if len(bytes) > MaxMessageSize-128 { // 128 bytes to account for signature size
+ check.OK = false
+ check.Err = "message too big"
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+
+ // 3. Syntactic validation
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageValidity,
+ },
+ }
+
+ if err := m.ValidForBlockInclusion(0, build.NewestNetworkVersion); err != nil {
+ check.OK = false
+ check.Err = fmt.Sprintf("syntactically invalid message: %s", err.Error())
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+ if !check.OK {
+ // skip remaining checks if it is a syntatically invalid message
+ continue
+ }
+
+ // gas checks
+
+ // 4. Min Gas
+ minGas := vm.PricelistByEpoch(epoch).OnChainMessage(m.ChainLength())
+
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageMinGas,
+ Hint: map[string]interface{}{
+ "minGas": minGas,
+ },
+ },
+ }
+
+ if m.GasLimit < minGas.Total() {
+ check.OK = false
+ check.Err = "GasLimit less than epoch minimum gas"
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+
+ // 5. Min Base Fee
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageMinBaseFee,
+ },
+ }
+
+ if m.GasFeeCap.LessThan(minimumBaseFee) {
+ check.OK = false
+ check.Err = "GasFeeCap less than minimum base fee"
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+ if !check.OK {
+ goto checkState
+ }
+
+ // 6. Base Fee
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageBaseFee,
+ Hint: map[string]interface{}{
+ "baseFee": baseFee,
+ },
+ },
+ }
+
+ if m.GasFeeCap.LessThan(baseFee) {
+ check.OK = false
+ check.Err = "GasFeeCap less than current base fee"
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+
+ // 7. Base Fee lower bound
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageBaseFeeLowerBound,
+ Hint: map[string]interface{}{
+ "baseFeeLowerBound": baseFeeLowerBound,
+ "baseFee": baseFee,
+ },
+ },
+ }
+
+ if m.GasFeeCap.LessThan(baseFeeLowerBound) {
+ check.OK = false
+ check.Err = "GasFeeCap less than base fee lower bound for inclusion in next 20 epochs"
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+
+ // 8. Base Fee upper bound
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageBaseFeeUpperBound,
+ Hint: map[string]interface{}{
+ "baseFeeUpperBound": baseFeeUpperBound,
+ "baseFee": baseFee,
+ },
+ },
+ }
+
+ if m.GasFeeCap.LessThan(baseFeeUpperBound) {
+ check.OK = true // on purpose, the checks is more of a warning
+ check.Err = "GasFeeCap less than base fee upper bound for inclusion in next 20 epochs"
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+
+ // stateful checks
+ checkState:
+ // 9. Message Nonce
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageNonce,
+ Hint: map[string]interface{}{
+ "nextNonce": st.nextNonce,
+ },
+ },
+ }
+
+ if (flexibleNonces == nil || !flexibleNonces[i]) && st.nextNonce != m.Nonce {
+ check.OK = false
+ check.Err = fmt.Sprintf("message nonce doesn't match next nonce (%d)", st.nextNonce)
+ } else {
+ check.OK = true
+ st.nextNonce++
+ }
+
+ result[i] = append(result[i], check)
+
+ // check required funds -vs- balance
+ st.requiredFunds = new(stdbig.Int).Add(st.requiredFunds, m.RequiredFunds().Int)
+ st.requiredFunds.Add(st.requiredFunds, m.Value.Int)
+
+ // 10. Balance
+ check = api.MessageCheckStatus{
+ Cid: m.Cid(),
+ CheckStatus: api.CheckStatus{
+ Code: api.CheckStatusMessageBalance,
+ Hint: map[string]interface{}{
+ "requiredFunds": big.Int{Int: stdbig.NewInt(0).Set(st.requiredFunds)},
+ },
+ },
+ }
+
+ if balance.Int.Cmp(st.requiredFunds) < 0 {
+ check.OK = false
+ check.Err = "insufficient balance"
+ } else {
+ check.OK = true
+ }
+
+ result[i] = append(result[i], check)
+ }
+
+ return result, nil
+}
diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go
index 59f7b0f75..865c18a3a 100644
--- a/chain/messagepool/messagepool.go
+++ b/chain/messagepool/messagepool.go
@@ -938,7 +938,7 @@ func (mp *MessagePool) addLocked(ctx context.Context, m *types.SignedMessage, st
return nil
}
-func (mp *MessagePool) GetNonce(ctx context.Context, addr address.Address) (uint64, error) {
+func (mp *MessagePool) GetNonce(ctx context.Context, addr address.Address, _ types.TipSetKey) (uint64, error) {
mp.curTsLk.Lock()
defer mp.curTsLk.Unlock()
@@ -948,6 +948,13 @@ func (mp *MessagePool) GetNonce(ctx context.Context, addr address.Address) (uint
return mp.getNonceLocked(ctx, addr, mp.curTs)
}
+// GetActor should not be used. It is only here to satisfy interface mess caused by lite node handling
+func (mp *MessagePool) GetActor(_ context.Context, addr address.Address, _ types.TipSetKey) (*types.Actor, error) {
+ mp.curTsLk.Lock()
+ defer mp.curTsLk.Unlock()
+ return mp.api.GetActorAfter(addr, mp.curTs)
+}
+
func (mp *MessagePool) getNonceLocked(ctx context.Context, addr address.Address, curTs *types.TipSet) (uint64, error) {
stateNonce, err := mp.getStateNonce(ctx, addr, curTs) // sanity check
if err != nil {
@@ -973,11 +980,11 @@ func (mp *MessagePool) getNonceLocked(ctx context.Context, addr address.Address,
return stateNonce, nil
}
-func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address, curTs *types.TipSet) (uint64, error) {
+func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address, ts *types.TipSet) (uint64, error) {
done := metrics.Timer(ctx, metrics.MpoolGetNonceDuration)
defer done()
- act, err := mp.api.GetActorAfter(addr, curTs)
+ act, err := mp.api.GetActorAfter(addr, ts)
if err != nil {
return 0, err
}
diff --git a/chain/messagepool/messagepool_test.go b/chain/messagepool/messagepool_test.go
index 6c0178c86..f271249df 100644
--- a/chain/messagepool/messagepool_test.go
+++ b/chain/messagepool/messagepool_test.go
@@ -105,6 +105,9 @@ func (tma *testMpoolAPI) SubscribeHeadChanges(cb func(rev, app []*types.TipSet)
func (tma *testMpoolAPI) PutMessage(m types.ChainMsg) (cid.Cid, error) {
return cid.Undef, nil
}
+func (tma *testMpoolAPI) IsLite() bool {
+ return false
+}
func (tma *testMpoolAPI) PubSubPublish(string, []byte) error {
tma.published++
@@ -201,7 +204,7 @@ func (tma *testMpoolAPI) ChainComputeBaseFee(ctx context.Context, ts *types.TipS
func assertNonce(t *testing.T, mp *MessagePool, addr address.Address, val uint64) {
t.Helper()
- n, err := mp.GetNonce(context.TODO(), addr)
+ n, err := mp.GetNonce(context.TODO(), addr, types.EmptyTSK)
if err != nil {
t.Fatal(err)
}
diff --git a/chain/messagepool/provider.go b/chain/messagepool/provider.go
index b2cc26e58..0f904c52c 100644
--- a/chain/messagepool/provider.go
+++ b/chain/messagepool/provider.go
@@ -9,6 +9,7 @@ import (
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/lotus/chain/messagesigner"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/chain/types"
@@ -30,11 +31,14 @@ type Provider interface {
MessagesForTipset(*types.TipSet) ([]types.ChainMsg, error)
LoadTipSet(tsk types.TipSetKey) (*types.TipSet, error)
ChainComputeBaseFee(ctx context.Context, ts *types.TipSet) (types.BigInt, error)
+ IsLite() bool
}
type mpoolProvider struct {
sm *stmgr.StateManager
ps *pubsub.PubSub
+
+ lite messagesigner.MpoolNonceAPI
}
var _ Provider = (*mpoolProvider)(nil)
@@ -43,6 +47,14 @@ func NewProvider(sm *stmgr.StateManager, ps *pubsub.PubSub) Provider {
return &mpoolProvider{sm: sm, ps: ps}
}
+func NewProviderLite(sm *stmgr.StateManager, ps *pubsub.PubSub, noncer messagesigner.MpoolNonceAPI) Provider {
+ return &mpoolProvider{sm: sm, ps: ps, lite: noncer}
+}
+
+func (mpp *mpoolProvider) IsLite() bool {
+ return mpp.lite != nil
+}
+
func (mpp *mpoolProvider) SubscribeHeadChanges(cb func(rev, app []*types.TipSet) error) *types.TipSet {
mpp.sm.ChainStore().SubscribeHeadChanges(
store.WrapHeadChangeCoalescer(
@@ -63,6 +75,19 @@ func (mpp *mpoolProvider) PubSubPublish(k string, v []byte) error {
}
func (mpp *mpoolProvider) GetActorAfter(addr address.Address, ts *types.TipSet) (*types.Actor, error) {
+ if mpp.IsLite() {
+ n, err := mpp.lite.GetNonce(context.TODO(), addr, ts.Key())
+ if err != nil {
+ return nil, xerrors.Errorf("getting nonce over lite: %w", err)
+ }
+ a, err := mpp.lite.GetActor(context.TODO(), addr, ts.Key())
+ if err != nil {
+ return nil, xerrors.Errorf("getting actor over lite: %w", err)
+ }
+ a.Nonce = n
+ return a, nil
+ }
+
stcid, _, err := mpp.sm.TipSetState(context.TODO(), ts)
if err != nil {
return nil, xerrors.Errorf("computing tipset state for GetActor: %w", err)
diff --git a/chain/messagepool/selection.go b/chain/messagepool/selection.go
index 3684a7b80..611ab8e5f 100644
--- a/chain/messagepool/selection.go
+++ b/chain/messagepool/selection.go
@@ -11,9 +11,7 @@ import (
"github.com/filecoin-project/go-address"
tbig "github.com/filecoin-project/go-state-types/big"
- "github.com/filecoin-project/specs-actors/v3/actors/builtin"
- "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/messagepool/gasguess"
"github.com/filecoin-project/lotus/chain/types"
@@ -705,17 +703,6 @@ func (*MessagePool) getGasPerf(gasReward *big.Int, gasLimit int64) float64 {
return r
}
-func isMessageMute(m *types.Message, ts *types.TipSet) bool {
- if api.RunningNodeType != api.NodeFull || ts.Height() > build.UpgradeTurboHeight {
- return false
- }
-
- if m.To == builtin.StoragePowerActorAddr {
- return m.Method == builtin.MethodsPower.CreateMiner
- }
- return false
-}
-
func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint64]*types.SignedMessage, baseFee types.BigInt, ts *types.TipSet) []*msgChain {
// collect all messages
msgs := make([]*types.SignedMessage, 0, len(mset))
@@ -777,10 +764,6 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint6
break
}
- if isMessageMute(&m.Message, ts) {
- break
- }
-
balance = new(big.Int).Sub(balance, required)
value := m.Message.Value.Int
diff --git a/chain/messagesigner/messagesigner.go b/chain/messagesigner/messagesigner.go
index c64d00003..063d1aa7d 100644
--- a/chain/messagesigner/messagesigner.go
+++ b/chain/messagesigner/messagesigner.go
@@ -23,7 +23,8 @@ const dsKeyActorNonce = "ActorNextNonce"
var log = logging.Logger("messagesigner")
type MpoolNonceAPI interface {
- GetNonce(context.Context, address.Address) (uint64, error)
+ GetNonce(context.Context, address.Address, types.TipSetKey) (uint64, error)
+ GetActor(context.Context, address.Address, types.TipSetKey) (*types.Actor, error)
}
// MessageSigner keeps track of nonces per address, and increments the nonce
@@ -97,7 +98,7 @@ func (ms *MessageSigner) nextNonce(ctx context.Context, addr address.Address) (u
// that have mempool nonces, so first check the mempool for a nonce for
// this address. Note that the mempool returns the actor state's nonce
// by default.
- nonce, err := ms.mpool.GetNonce(ctx, addr)
+ nonce, err := ms.mpool.GetNonce(ctx, addr, types.EmptyTSK)
if err != nil {
return 0, xerrors.Errorf("failed to get nonce from mempool: %w", err)
}
diff --git a/chain/messagesigner/messagesigner_test.go b/chain/messagesigner/messagesigner_test.go
index 8206b11c0..20d9af38b 100644
--- a/chain/messagesigner/messagesigner_test.go
+++ b/chain/messagesigner/messagesigner_test.go
@@ -37,12 +37,15 @@ func (mp *mockMpool) setNonce(addr address.Address, nonce uint64) {
mp.nonces[addr] = nonce
}
-func (mp *mockMpool) GetNonce(ctx context.Context, addr address.Address) (uint64, error) {
+func (mp *mockMpool) GetNonce(_ context.Context, addr address.Address, _ types.TipSetKey) (uint64, error) {
mp.lk.RLock()
defer mp.lk.RUnlock()
return mp.nonces[addr], nil
}
+func (mp *mockMpool) GetActor(_ context.Context, addr address.Address, _ types.TipSetKey) (*types.Actor, error) {
+ panic("don't use it")
+}
func TestMessageSignerSignMessage(t *testing.T) {
ctx := context.Background()
diff --git a/chain/state/statetree.go b/chain/state/statetree.go
index d783fff69..40955c48b 100644
--- a/chain/state/statetree.go
+++ b/chain/state/statetree.go
@@ -14,7 +14,6 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
- "github.com/filecoin-project/lotus/chain/actors"
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
cbg "github.com/whyrusleeping/cbor-gen"
@@ -143,11 +142,21 @@ func (ss *stateSnaps) deleteActor(addr address.Address) {
// VersionForNetwork returns the state tree version for the given network
// version.
-func VersionForNetwork(ver network.Version) types.StateTreeVersion {
- if actors.VersionForNetwork(ver) == actors.Version0 {
- return types.StateTreeVersion0
+func VersionForNetwork(ver network.Version) (types.StateTreeVersion, error) {
+ switch ver {
+ case network.Version0, network.Version1, network.Version2, network.Version3:
+ return types.StateTreeVersion0, nil
+ case network.Version4, network.Version5, network.Version6, network.Version7, network.Version8, network.Version9:
+ return types.StateTreeVersion1, nil
+ case network.Version10, network.Version11:
+ return types.StateTreeVersion2, nil
+ case network.Version12:
+ return types.StateTreeVersion3, nil
+ case network.Version13:
+ return types.StateTreeVersion4, nil
+ default:
+ panic(fmt.Sprintf("unsupported network version %d", ver))
}
- return types.StateTreeVersion1
}
func NewStateTree(cst cbor.IpldStore, ver types.StateTreeVersion) (*StateTree, error) {
@@ -155,7 +164,7 @@ func NewStateTree(cst cbor.IpldStore, ver types.StateTreeVersion) (*StateTree, e
switch ver {
case types.StateTreeVersion0:
// info is undefined
- case types.StateTreeVersion1, types.StateTreeVersion2:
+ case types.StateTreeVersion1, types.StateTreeVersion2, types.StateTreeVersion3, types.StateTreeVersion4:
var err error
info, err = cst.Put(context.TODO(), new(types.StateInfo0))
if err != nil {
diff --git a/chain/state/statetree_test.go b/chain/state/statetree_test.go
index 91674337b..9177af312 100644
--- a/chain/state/statetree_test.go
+++ b/chain/state/statetree_test.go
@@ -5,11 +5,12 @@ import (
"fmt"
"testing"
+ "github.com/filecoin-project/go-state-types/network"
+
"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
address "github.com/filecoin-project/go-address"
- "github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/lotus/build"
@@ -45,7 +46,12 @@ func BenchmarkStateTreeSet(b *testing.B) {
func BenchmarkStateTreeSetFlush(b *testing.B) {
cst := cbor.NewMemCborStore()
- st, err := NewStateTree(cst, VersionForNetwork(build.NewestNetworkVersion))
+ sv, err := VersionForNetwork(build.NewestNetworkVersion)
+ if err != nil {
+ b.Fatal(err)
+ }
+
+ st, err := NewStateTree(cst, sv)
if err != nil {
b.Fatal(err)
}
@@ -75,7 +81,12 @@ func BenchmarkStateTreeSetFlush(b *testing.B) {
func TestResolveCache(t *testing.T) {
cst := cbor.NewMemCborStore()
- st, err := NewStateTree(cst, VersionForNetwork(build.NewestNetworkVersion))
+ sv, err := VersionForNetwork(build.NewestNetworkVersion)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ st, err := NewStateTree(cst, sv)
if err != nil {
t.Fatal(err)
}
@@ -172,7 +183,12 @@ func TestResolveCache(t *testing.T) {
func BenchmarkStateTree10kGetActor(b *testing.B) {
cst := cbor.NewMemCborStore()
- st, err := NewStateTree(cst, VersionForNetwork(build.NewestNetworkVersion))
+ sv, err := VersionForNetwork(build.NewestNetworkVersion)
+ if err != nil {
+ b.Fatal(err)
+ }
+
+ st, err := NewStateTree(cst, sv)
if err != nil {
b.Fatal(err)
}
@@ -214,7 +230,12 @@ func BenchmarkStateTree10kGetActor(b *testing.B) {
func TestSetCache(t *testing.T) {
cst := cbor.NewMemCborStore()
- st, err := NewStateTree(cst, VersionForNetwork(build.NewestNetworkVersion))
+ sv, err := VersionForNetwork(build.NewestNetworkVersion)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ st, err := NewStateTree(cst, sv)
if err != nil {
t.Fatal(err)
}
@@ -251,7 +272,13 @@ func TestSetCache(t *testing.T) {
func TestSnapshots(t *testing.T) {
ctx := context.Background()
cst := cbor.NewMemCborStore()
- st, err := NewStateTree(cst, VersionForNetwork(build.NewestNetworkVersion))
+
+ sv, err := VersionForNetwork(build.NewestNetworkVersion)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ st, err := NewStateTree(cst, sv)
if err != nil {
t.Fatal(err)
}
@@ -334,8 +361,15 @@ func assertNotHas(t *testing.T, st *StateTree, addr address.Address) {
func TestStateTreeConsistency(t *testing.T) {
cst := cbor.NewMemCborStore()
+
// TODO: ActorUpgrade: this test tests pre actors v2
- st, err := NewStateTree(cst, VersionForNetwork(network.Version3))
+
+ sv, err := VersionForNetwork(network.Version3)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ st, err := NewStateTree(cst, sv)
if err != nil {
t.Fatal(err)
}
diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go
index cfbf60a95..dc6da0f9c 100644
--- a/chain/stmgr/call.go
+++ b/chain/stmgr/call.go
@@ -39,25 +39,29 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.
}
bstate := ts.ParentState()
- bheight := ts.Height()
+ pts, err := sm.cs.LoadTipSet(ts.Parents())
+ if err != nil {
+ return nil, xerrors.Errorf("failed to load parent tipset: %w", err)
+ }
+ pheight := pts.Height()
// If we have to run an expensive migration, and we're not at genesis,
// return an error because the migration will take too long.
//
// We allow this at height 0 for at-genesis migrations (for testing).
- if bheight-1 > 0 && sm.hasExpensiveFork(ctx, bheight-1) {
+ if pheight > 0 && sm.hasExpensiveFork(ctx, pheight) {
return nil, ErrExpensiveFork
}
// Run the (not expensive) migration.
- bstate, err := sm.handleStateForks(ctx, bstate, bheight-1, nil, ts)
+ bstate, err = sm.handleStateForks(ctx, bstate, pheight, nil, ts)
if err != nil {
return nil, fmt.Errorf("failed to handle fork: %w", err)
}
vmopt := &vm.VMOpts{
StateBase: bstate,
- Epoch: bheight,
+ Epoch: pheight + 1,
Rand: store.NewChainRand(sm.cs, ts.Cids()),
Bstore: sm.cs.StateBlockstore(),
Syscalls: sm.cs.VMSys(),
@@ -155,6 +159,11 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, pri
return nil, xerrors.Errorf("computing tipset state: %w", err)
}
+ state, err = sm.handleStateForks(ctx, state, ts.Height(), nil, ts)
+ if err != nil {
+ return nil, fmt.Errorf("failed to handle fork: %w", err)
+ }
+
r := store.NewChainRand(sm.cs, ts.Cids())
if span.IsRecordingEvents() {
@@ -167,7 +176,7 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, pri
vmopt := &vm.VMOpts{
StateBase: state,
- Epoch: ts.Height(),
+ Epoch: ts.Height() + 1,
Rand: r,
Bstore: sm.cs.StateBlockstore(),
Syscalls: sm.cs.VMSys(),
@@ -239,24 +248,18 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, pri
var errHaltExecution = fmt.Errorf("halt")
func (sm *StateManager) Replay(ctx context.Context, ts *types.TipSet, mcid cid.Cid) (*types.Message, *vm.ApplyRet, error) {
- var outm *types.Message
- var outr *vm.ApplyRet
+ var finder messageFinder
+ // message to find
+ finder.mcid = mcid
- _, _, err := sm.computeTipSetState(ctx, ts, func(c cid.Cid, m *types.Message, ret *vm.ApplyRet) error {
- if c == mcid {
- outm = m
- outr = ret
- return errHaltExecution
- }
- return nil
- })
+ _, _, err := sm.computeTipSetState(ctx, ts, &finder)
if err != nil && !xerrors.Is(err, errHaltExecution) {
return nil, nil, xerrors.Errorf("unexpected error during execution: %w", err)
}
- if outr == nil {
+ if finder.outr == nil {
return nil, nil, xerrors.Errorf("given message not found in tipset")
}
- return outm, outr, nil
+ return finder.outm, finder.outr, nil
}
diff --git a/chain/stmgr/forks.go b/chain/stmgr/forks.go
index ee5a26dea..bb87da44c 100644
--- a/chain/stmgr/forks.go
+++ b/chain/stmgr/forks.go
@@ -61,7 +61,7 @@ type MigrationCache interface {
type MigrationFunc func(
ctx context.Context,
sm *StateManager, cache MigrationCache,
- cb ExecCallback, oldState cid.Cid,
+ cb ExecMonitor, oldState cid.Cid,
height abi.ChainEpoch, ts *types.TipSet,
) (newState cid.Cid, err error)
@@ -292,7 +292,7 @@ func (us UpgradeSchedule) Validate() error {
return nil
}
-func (sm *StateManager) handleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, cb ExecCallback, ts *types.TipSet) (cid.Cid, error) {
+func (sm *StateManager) handleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, cb ExecMonitor, ts *types.TipSet) (cid.Cid, error) {
retCid := root
var err error
u := sm.stateMigrations[height]
@@ -472,7 +472,7 @@ func doTransfer(tree types.StateTree, from, to address.Address, amt abi.TokenAmo
return nil
}
-func UpgradeFaucetBurnRecovery(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecCallback, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
+func UpgradeFaucetBurnRecovery(ctx context.Context, sm *StateManager, _ MigrationCache, em ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
// Some initial parameters
FundsForMiners := types.FromFil(1_000_000)
LookbackEpoch := abi.ChainEpoch(32000)
@@ -722,12 +722,12 @@ func UpgradeFaucetBurnRecovery(ctx context.Context, sm *StateManager, _ Migratio
return cid.Undef, xerrors.Errorf("resultant state tree account balance was not correct: %s", total)
}
- if cb != nil {
+ if em != nil {
// record the transfer in execution traces
fakeMsg := makeFakeMsg(builtin.SystemActorAddr, builtin.SystemActorAddr, big.Zero(), uint64(epoch))
- if err := cb(fakeMsg.Cid(), fakeMsg, &vm.ApplyRet{
+ if err := em.MessageApplied(ctx, ts, fakeMsg.Cid(), fakeMsg, &vm.ApplyRet{
MessageReceipt: *makeFakeRct(),
ActorErr: nil,
ExecutionTrace: types.ExecutionTrace{
@@ -740,7 +740,7 @@ func UpgradeFaucetBurnRecovery(ctx context.Context, sm *StateManager, _ Migratio
},
Duration: 0,
GasCosts: nil,
- }); err != nil {
+ }, false); err != nil {
return cid.Undef, xerrors.Errorf("recording transfers: %w", err)
}
}
@@ -748,7 +748,7 @@ func UpgradeFaucetBurnRecovery(ctx context.Context, sm *StateManager, _ Migratio
return tree.Flush(ctx)
}
-func UpgradeIgnition(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecCallback, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
+func UpgradeIgnition(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
store := sm.cs.ActorStore(ctx)
if build.UpgradeLiftoffHeight <= epoch {
@@ -785,12 +785,12 @@ func UpgradeIgnition(ctx context.Context, sm *StateManager, _ MigrationCache, cb
return cid.Undef, xerrors.Errorf("resetting genesis msig start epochs: %w", err)
}
- err = splitGenesisMultisig0(ctx, cb, split1, store, tree, 50, epoch)
+ err = splitGenesisMultisig0(ctx, cb, split1, store, tree, 50, epoch, ts)
if err != nil {
return cid.Undef, xerrors.Errorf("splitting first msig: %w", err)
}
- err = splitGenesisMultisig0(ctx, cb, split2, store, tree, 50, epoch)
+ err = splitGenesisMultisig0(ctx, cb, split2, store, tree, 50, epoch, ts)
if err != nil {
return cid.Undef, xerrors.Errorf("splitting second msig: %w", err)
}
@@ -803,7 +803,7 @@ func UpgradeIgnition(ctx context.Context, sm *StateManager, _ MigrationCache, cb
return tree.Flush(ctx)
}
-func UpgradeRefuel(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecCallback, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
+func UpgradeRefuel(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
store := sm.cs.ActorStore(ctx)
tree, err := sm.StateTree(root)
@@ -829,7 +829,7 @@ func UpgradeRefuel(ctx context.Context, sm *StateManager, _ MigrationCache, cb E
return tree.Flush(ctx)
}
-func UpgradeActorsV2(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecCallback, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
+func UpgradeActorsV2(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
buf := blockstore.NewTieredBstore(sm.cs.StateBlockstore(), blockstore.NewMemorySync())
store := store.ActorStore(ctx, buf)
@@ -875,7 +875,7 @@ func UpgradeActorsV2(ctx context.Context, sm *StateManager, _ MigrationCache, cb
return newRoot, nil
}
-func UpgradeLiftoff(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecCallback, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
+func UpgradeLiftoff(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
tree, err := sm.StateTree(root)
if err != nil {
return cid.Undef, xerrors.Errorf("getting state tree: %w", err)
@@ -889,7 +889,7 @@ func UpgradeLiftoff(ctx context.Context, sm *StateManager, _ MigrationCache, cb
return tree.Flush(ctx)
}
-func UpgradeCalico(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecCallback, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
+func UpgradeCalico(ctx context.Context, sm *StateManager, _ MigrationCache, cb ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
if build.BuildType != build.BuildMainnet {
return root, nil
}
@@ -935,7 +935,7 @@ func UpgradeCalico(ctx context.Context, sm *StateManager, _ MigrationCache, cb E
return newRoot, nil
}
-func terminateActor(ctx context.Context, tree *state.StateTree, addr address.Address, cb ExecCallback, epoch abi.ChainEpoch) error {
+func terminateActor(ctx context.Context, tree *state.StateTree, addr address.Address, em ExecMonitor, epoch abi.ChainEpoch, ts *types.TipSet) error {
a, err := tree.GetActor(addr)
if xerrors.Is(err, types.ErrActorNotFound) {
return types.ErrActorNotFound
@@ -950,18 +950,18 @@ func terminateActor(ctx context.Context, tree *state.StateTree, addr address.Add
return xerrors.Errorf("transferring terminated actor's balance: %w", err)
}
- if cb != nil {
+ if em != nil {
// record the transfer in execution traces
fakeMsg := makeFakeMsg(builtin.SystemActorAddr, addr, big.Zero(), uint64(epoch))
- if err := cb(fakeMsg.Cid(), fakeMsg, &vm.ApplyRet{
+ if err := em.MessageApplied(ctx, ts, fakeMsg.Cid(), fakeMsg, &vm.ApplyRet{
MessageReceipt: *makeFakeRct(),
ActorErr: nil,
ExecutionTrace: trace,
Duration: 0,
GasCosts: nil,
- }); err != nil {
+ }, false); err != nil {
return xerrors.Errorf("recording transfers: %w", err)
}
}
@@ -995,7 +995,7 @@ func terminateActor(ctx context.Context, tree *state.StateTree, addr address.Add
return tree.SetActor(init_.Address, ia)
}
-func UpgradeActorsV3(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecCallback, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
+func UpgradeActorsV3(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
// Use all the CPUs except 3.
workerCount := runtime.NumCPU() - 3
if workerCount <= 0 {
@@ -1019,7 +1019,7 @@ func UpgradeActorsV3(ctx context.Context, sm *StateManager, cache MigrationCache
}
if build.BuildType == build.BuildMainnet {
- err := terminateActor(ctx, tree, build.ZeroAddress, cb, epoch)
+ err := terminateActor(ctx, tree, build.ZeroAddress, cb, epoch, ts)
if err != nil && !xerrors.Is(err, types.ErrActorNotFound) {
return cid.Undef, xerrors.Errorf("deleting zero bls actor: %w", err)
}
@@ -1097,7 +1097,7 @@ func upgradeActorsV3Common(
return newRoot, nil
}
-func UpgradeActorsV4(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecCallback, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
+func UpgradeActorsV4(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
// Use all the CPUs except 3.
workerCount := runtime.NumCPU() - 3
if workerCount <= 0 {
@@ -1183,7 +1183,7 @@ func upgradeActorsV4Common(
return newRoot, nil
}
-func UpgradeActorsV5(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecCallback, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
+func UpgradeActorsV5(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
// Use all the CPUs except 3.
workerCount := runtime.NumCPU() - 3
if workerCount <= 0 {
@@ -1296,7 +1296,7 @@ func setNetworkName(ctx context.Context, store adt.Store, tree *state.StateTree,
return nil
}
-func splitGenesisMultisig0(ctx context.Context, cb ExecCallback, addr address.Address, store adt0.Store, tree *state.StateTree, portions uint64, epoch abi.ChainEpoch) error {
+func splitGenesisMultisig0(ctx context.Context, em ExecMonitor, addr address.Address, store adt0.Store, tree *state.StateTree, portions uint64, epoch abi.ChainEpoch, ts *types.TipSet) error {
if portions < 1 {
return xerrors.Errorf("cannot split into 0 portions")
}
@@ -1393,12 +1393,12 @@ func splitGenesisMultisig0(ctx context.Context, cb ExecCallback, addr address.Ad
i++
}
- if cb != nil {
+ if em != nil {
// record the transfer in execution traces
fakeMsg := makeFakeMsg(builtin.SystemActorAddr, addr, big.Zero(), uint64(epoch))
- if err := cb(fakeMsg.Cid(), fakeMsg, &vm.ApplyRet{
+ if err := em.MessageApplied(ctx, ts, fakeMsg.Cid(), fakeMsg, &vm.ApplyRet{
MessageReceipt: *makeFakeRct(),
ActorErr: nil,
ExecutionTrace: types.ExecutionTrace{
@@ -1411,7 +1411,7 @@ func splitGenesisMultisig0(ctx context.Context, cb ExecCallback, addr address.Ad
},
Duration: 0,
GasCosts: nil,
- }); err != nil {
+ }, false); err != nil {
return xerrors.Errorf("recording transfers: %w", err)
}
}
diff --git a/chain/stmgr/forks_test.go b/chain/stmgr/forks_test.go
index fe96ad610..dd2e47a57 100644
--- a/chain/stmgr/forks_test.go
+++ b/chain/stmgr/forks_test.go
@@ -123,7 +123,7 @@ func TestForkHeightTriggers(t *testing.T) {
cg.ChainStore(), UpgradeSchedule{{
Network: 1,
Height: testForkHeight,
- Migration: func(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecCallback,
+ Migration: func(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecMonitor,
root cid.Cid, height abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
cst := ipldcbor.NewCborStore(sm.ChainStore().StateBlockstore())
@@ -253,7 +253,7 @@ func TestForkRefuseCall(t *testing.T) {
Network: 1,
Expensive: true,
Height: testForkHeight,
- Migration: func(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecCallback,
+ Migration: func(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecMonitor,
root cid.Cid, height abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
return root, nil
}}})
@@ -363,7 +363,7 @@ func TestForkPreMigration(t *testing.T) {
cg.ChainStore(), UpgradeSchedule{{
Network: 1,
Height: testForkHeight,
- Migration: func(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecCallback,
+ Migration: func(ctx context.Context, sm *StateManager, cache MigrationCache, cb ExecMonitor,
root cid.Cid, height abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
// Make sure the test that should be canceled, is canceled.
diff --git a/chain/stmgr/stmgr.go b/chain/stmgr/stmgr.go
index 049ac3153..4f1351d2c 100644
--- a/chain/stmgr/stmgr.go
+++ b/chain/stmgr/stmgr.go
@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"sync"
+ "sync/atomic"
"github.com/filecoin-project/lotus/chain/actors/policy"
@@ -12,6 +13,7 @@ import (
cbor "github.com/ipfs/go-ipld-cbor"
logging "github.com/ipfs/go-log/v2"
cbg "github.com/whyrusleeping/cbor-gen"
+ "go.opencensus.io/stats"
"go.opencensus.io/trace"
"golang.org/x/xerrors"
@@ -45,9 +47,10 @@ import (
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/vm"
+ "github.com/filecoin-project/lotus/metrics"
)
-const LookbackNoLimit = abi.ChainEpoch(-1)
+const LookbackNoLimit = api.LookbackNoLimit
const ReceiptAmtBitwidth = 3
var log = logging.Logger("statemgr")
@@ -100,6 +103,8 @@ type StateManager struct {
genesisPledge abi.TokenAmount
genesisMarketFunds abi.TokenAmount
+
+ tsExecMonitor ExecMonitor
}
// Caches a single state tree
@@ -168,6 +173,15 @@ func NewStateManagerWithUpgradeSchedule(cs *store.ChainStore, us UpgradeSchedule
}, nil
}
+func NewStateManagerWithUpgradeScheduleAndMonitor(cs *store.ChainStore, us UpgradeSchedule, em ExecMonitor) (*StateManager, error) {
+ sm, err := NewStateManagerWithUpgradeSchedule(cs, us)
+ if err != nil {
+ return nil, err
+ }
+ sm.tsExecMonitor = em
+ return sm, nil
+}
+
func cidsToKey(cids []cid.Cid) string {
var out string
for _, c := range cids {
@@ -252,7 +266,7 @@ func (sm *StateManager) TipSetState(ctx context.Context, ts *types.TipSet) (st c
return ts.Blocks()[0].ParentStateRoot, ts.Blocks()[0].ParentMessageReceipts, nil
}
- st, rec, err = sm.computeTipSetState(ctx, ts, nil)
+ st, rec, err = sm.computeTipSetState(ctx, ts, sm.tsExecMonitor)
if err != nil {
return cid.Undef, cid.Undef, err
}
@@ -260,39 +274,28 @@ func (sm *StateManager) TipSetState(ctx context.Context, ts *types.TipSet) (st c
return st, rec, nil
}
-func traceFunc(trace *[]*api.InvocResult) func(mcid cid.Cid, msg *types.Message, ret *vm.ApplyRet) error {
- return func(mcid cid.Cid, msg *types.Message, ret *vm.ApplyRet) error {
- ir := &api.InvocResult{
- MsgCid: mcid,
- Msg: msg,
- MsgRct: &ret.MessageReceipt,
- ExecutionTrace: ret.ExecutionTrace,
- Duration: ret.Duration,
- }
- if ret.ActorErr != nil {
- ir.Error = ret.ActorErr.Error()
- }
- if ret.GasCosts != nil {
- ir.GasCost = MakeMsgGasCost(msg, ret)
- }
- *trace = append(*trace, ir)
- return nil
- }
+func (sm *StateManager) ExecutionTraceWithMonitor(ctx context.Context, ts *types.TipSet, em ExecMonitor) (cid.Cid, error) {
+ st, _, err := sm.computeTipSetState(ctx, ts, em)
+ return st, err
}
func (sm *StateManager) ExecutionTrace(ctx context.Context, ts *types.TipSet) (cid.Cid, []*api.InvocResult, error) {
- var trace []*api.InvocResult
- st, _, err := sm.computeTipSetState(ctx, ts, traceFunc(&trace))
+ var invocTrace []*api.InvocResult
+ st, err := sm.ExecutionTraceWithMonitor(ctx, ts, &InvocationTracer{trace: &invocTrace})
if err != nil {
return cid.Undef, nil, err
}
-
- return st, trace, nil
+ return st, invocTrace, nil
}
-type ExecCallback func(cid.Cid, *types.Message, *vm.ApplyRet) error
+func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEpoch, pstate cid.Cid, bms []store.BlockMessages, epoch abi.ChainEpoch, r vm.Rand, em ExecMonitor, baseFee abi.TokenAmount, ts *types.TipSet) (cid.Cid, cid.Cid, error) {
+ done := metrics.Timer(ctx, metrics.VMApplyBlocksTotal)
+ defer done()
-func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEpoch, pstate cid.Cid, bms []store.BlockMessages, epoch abi.ChainEpoch, r vm.Rand, cb ExecCallback, baseFee abi.TokenAmount, ts *types.TipSet) (cid.Cid, cid.Cid, error) {
+ partDone := metrics.Timer(ctx, metrics.VMApplyEarly)
+ defer func() {
+ partDone()
+ }()
makeVmWithBaseState := func(base cid.Cid) (*vm.VM, error) {
vmopt := &vm.VMOpts{
@@ -316,7 +319,6 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEp
}
runCron := func(epoch abi.ChainEpoch) error {
-
cronMsg := &types.Message{
To: cron.Address,
From: builtin.SystemActorAddr,
@@ -332,8 +334,8 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEp
if err != nil {
return err
}
- if cb != nil {
- if err := cb(cronMsg.Cid(), cronMsg, ret); err != nil {
+ if em != nil {
+ if err := em.MessageApplied(ctx, ts, cronMsg.Cid(), cronMsg, ret, true); err != nil {
return xerrors.Errorf("callback failed on cron message: %w", err)
}
}
@@ -359,7 +361,7 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEp
// handle state forks
// XXX: The state tree
- newState, err := sm.handleStateForks(ctx, pstate, i, cb, ts)
+ newState, err := sm.handleStateForks(ctx, pstate, i, em, ts)
if err != nil {
return cid.Undef, cid.Undef, xerrors.Errorf("error handling state forks: %w", err)
}
@@ -375,6 +377,9 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEp
pstate = newState
}
+ partDone()
+ partDone = metrics.Timer(ctx, metrics.VMApplyMessages)
+
var receipts []cbg.CBORMarshaler
processedMsgs := make(map[cid.Cid]struct{})
for _, b := range bms {
@@ -395,8 +400,8 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEp
gasReward = big.Add(gasReward, r.GasCosts.MinerTip)
penalty = big.Add(penalty, r.GasCosts.MinerPenalty)
- if cb != nil {
- if err := cb(cm.Cid(), m, r); err != nil {
+ if em != nil {
+ if err := em.MessageApplied(ctx, ts, cm.Cid(), m, r, false); err != nil {
return cid.Undef, cid.Undef, err
}
}
@@ -428,8 +433,8 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEp
if actErr != nil {
return cid.Undef, cid.Undef, xerrors.Errorf("failed to apply reward message for miner %s: %w", b.Miner, actErr)
}
- if cb != nil {
- if err := cb(rwMsg.Cid(), rwMsg, ret); err != nil {
+ if em != nil {
+ if err := em.MessageApplied(ctx, ts, rwMsg.Cid(), rwMsg, ret, true); err != nil {
return cid.Undef, cid.Undef, xerrors.Errorf("callback failed on reward message: %w", err)
}
}
@@ -439,10 +444,16 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEp
}
}
+ partDone()
+ partDone = metrics.Timer(ctx, metrics.VMApplyCron)
+
if err := runCron(epoch); err != nil {
return cid.Cid{}, cid.Cid{}, err
}
+ partDone()
+ partDone = metrics.Timer(ctx, metrics.VMApplyFlush)
+
rectarr := blockadt.MakeEmptyArray(sm.cs.ActorStore(ctx))
for i, receipt := range receipts {
if err := rectarr.Set(uint64(i), receipt); err != nil {
@@ -459,10 +470,13 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, parentEpoch abi.ChainEp
return cid.Undef, cid.Undef, xerrors.Errorf("vm flush failed: %w", err)
}
+ stats.Record(ctx, metrics.VMSends.M(int64(atomic.LoadUint64(&vm.StatSends))),
+ metrics.VMApplied.M(int64(atomic.LoadUint64(&vm.StatApplied))))
+
return st, rectroot, nil
}
-func (sm *StateManager) computeTipSetState(ctx context.Context, ts *types.TipSet, cb ExecCallback) (cid.Cid, cid.Cid, error) {
+func (sm *StateManager) computeTipSetState(ctx context.Context, ts *types.TipSet, em ExecMonitor) (cid.Cid, cid.Cid, error) {
ctx, span := trace.StartSpan(ctx, "computeTipSetState")
defer span.End()
@@ -498,7 +512,7 @@ func (sm *StateManager) computeTipSetState(ctx context.Context, ts *types.TipSet
baseFee := blks[0].ParentBaseFee
- return sm.ApplyBlocks(ctx, parentEpoch, pstate, blkmsgs, blks[0].Height, r, cb, baseFee, ts)
+ return sm.ApplyBlocks(ctx, parentEpoch, pstate, blkmsgs, blks[0].Height, r, em, baseFee, ts)
}
func (sm *StateManager) parentState(ts *types.TipSet) cid.Cid {
@@ -623,24 +637,10 @@ func (sm *StateManager) LookupID(ctx context.Context, addr address.Address, ts *
return state.LookupID(addr)
}
-func (sm *StateManager) GetReceipt(ctx context.Context, msg cid.Cid, ts *types.TipSet) (*types.MessageReceipt, error) {
- m, err := sm.cs.GetCMessage(msg)
- if err != nil {
- return nil, fmt.Errorf("failed to load message: %w", err)
- }
-
- _, r, _, err := sm.searchBackForMsg(ctx, ts, m, LookbackNoLimit)
- if err != nil {
- return nil, fmt.Errorf("failed to look back through chain for message: %w", err)
- }
-
- return r, nil
-}
-
// WaitForMessage blocks until a message appears on chain. It looks backwards in the chain to see if this has already
// happened, with an optional limit to how many epochs it will search. It guarantees that the message has been on
// chain for at least confidence epochs without being reverted before returning.
-func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confidence uint64, lookbackLimit abi.ChainEpoch) (*types.TipSet, *types.MessageReceipt, cid.Cid, error) {
+func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confidence uint64, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*types.TipSet, *types.MessageReceipt, cid.Cid, error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
@@ -664,7 +664,7 @@ func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confid
return nil, nil, cid.Undef, fmt.Errorf("expected current head on SHC stream (got %s)", head[0].Type)
}
- r, foundMsg, err := sm.tipsetExecutedMessage(head[0].Val, mcid, msg.VMMessage())
+ r, foundMsg, err := sm.tipsetExecutedMessage(head[0].Val, mcid, msg.VMMessage(), allowReplaced)
if err != nil {
return nil, nil, cid.Undef, err
}
@@ -678,7 +678,7 @@ func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confid
var backFm cid.Cid
backSearchWait := make(chan struct{})
go func() {
- fts, r, foundMsg, err := sm.searchBackForMsg(ctx, head[0].Val, msg, lookbackLimit)
+ fts, r, foundMsg, err := sm.searchBackForMsg(ctx, head[0].Val, msg, lookbackLimit, allowReplaced)
if err != nil {
log.Warnf("failed to look back through chain for message: %v", err)
return
@@ -717,7 +717,7 @@ func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confid
if candidateTs != nil && val.Val.Height() >= candidateTs.Height()+abi.ChainEpoch(confidence) {
return candidateTs, candidateRcp, candidateFm, nil
}
- r, foundMsg, err := sm.tipsetExecutedMessage(val.Val, mcid, msg.VMMessage())
+ r, foundMsg, err := sm.tipsetExecutedMessage(val.Val, mcid, msg.VMMessage(), allowReplaced)
if err != nil {
return nil, nil, cid.Undef, err
}
@@ -753,15 +753,13 @@ func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confid
}
}
-func (sm *StateManager) SearchForMessage(ctx context.Context, mcid cid.Cid, lookbackLimit abi.ChainEpoch) (*types.TipSet, *types.MessageReceipt, cid.Cid, error) {
+func (sm *StateManager) SearchForMessage(ctx context.Context, head *types.TipSet, mcid cid.Cid, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*types.TipSet, *types.MessageReceipt, cid.Cid, error) {
msg, err := sm.cs.GetCMessage(mcid)
if err != nil {
return nil, nil, cid.Undef, fmt.Errorf("failed to load message: %w", err)
}
- head := sm.cs.GetHeaviestTipSet()
-
- r, foundMsg, err := sm.tipsetExecutedMessage(head, mcid, msg.VMMessage())
+ r, foundMsg, err := sm.tipsetExecutedMessage(head, mcid, msg.VMMessage(), allowReplaced)
if err != nil {
return nil, nil, cid.Undef, err
}
@@ -770,7 +768,7 @@ func (sm *StateManager) SearchForMessage(ctx context.Context, mcid cid.Cid, look
return head, r, foundMsg, nil
}
- fts, r, foundMsg, err := sm.searchBackForMsg(ctx, head, msg, lookbackLimit)
+ fts, r, foundMsg, err := sm.searchBackForMsg(ctx, head, msg, lookbackLimit, allowReplaced)
if err != nil {
log.Warnf("failed to look back through chain for message %s", mcid)
@@ -790,7 +788,7 @@ func (sm *StateManager) SearchForMessage(ctx context.Context, mcid cid.Cid, look
// - 0 then no tipsets are searched
// - 5 then five tipset are searched
// - LookbackNoLimit then there is no limit
-func (sm *StateManager) searchBackForMsg(ctx context.Context, from *types.TipSet, m types.ChainMsg, limit abi.ChainEpoch) (*types.TipSet, *types.MessageReceipt, cid.Cid, error) {
+func (sm *StateManager) searchBackForMsg(ctx context.Context, from *types.TipSet, m types.ChainMsg, limit abi.ChainEpoch, allowReplaced bool) (*types.TipSet, *types.MessageReceipt, cid.Cid, error) {
limitHeight := from.Height() - limit
noLimit := limit == LookbackNoLimit
@@ -840,7 +838,7 @@ func (sm *StateManager) searchBackForMsg(ctx context.Context, from *types.TipSet
// check that between cur and parent tipset the nonce fell into range of our message
if actorNoExist || (curActor.Nonce > mNonce && act.Nonce <= mNonce) {
- r, foundMsg, err := sm.tipsetExecutedMessage(cur, m.Cid(), m.VMMessage())
+ r, foundMsg, err := sm.tipsetExecutedMessage(cur, m.Cid(), m.VMMessage(), allowReplaced)
if err != nil {
return nil, nil, cid.Undef, xerrors.Errorf("checking for message execution during lookback: %w", err)
}
@@ -855,7 +853,7 @@ func (sm *StateManager) searchBackForMsg(ctx context.Context, from *types.TipSet
}
}
-func (sm *StateManager) tipsetExecutedMessage(ts *types.TipSet, msg cid.Cid, vmm *types.Message) (*types.MessageReceipt, cid.Cid, error) {
+func (sm *StateManager) tipsetExecutedMessage(ts *types.TipSet, msg cid.Cid, vmm *types.Message, allowReplaced bool) (*types.MessageReceipt, cid.Cid, error) {
// The genesis block did not execute any messages
if ts.Height() == 0 {
return nil, cid.Undef, nil
@@ -878,7 +876,7 @@ func (sm *StateManager) tipsetExecutedMessage(ts *types.TipSet, msg cid.Cid, vmm
if m.VMMessage().From == vmm.From { // cheaper to just check origin first
if m.VMMessage().Nonce == vmm.Nonce {
- if m.VMMessage().EqualCall(vmm) {
+ if allowReplaced && m.VMMessage().EqualCall(vmm) {
if m.Cid() != msg {
log.Warnw("found message with equal nonce and call params but different CID",
"wanted", msg, "found", m.Cid(), "nonce", vmm.Nonce, "from", vmm.From)
@@ -908,10 +906,7 @@ func (sm *StateManager) ListAllActors(ctx context.Context, ts *types.TipSet) ([]
if ts == nil {
ts = sm.cs.GetHeaviestTipSet()
}
- st, _, err := sm.TipSetState(ctx, ts)
- if err != nil {
- return nil, err
- }
+ st := ts.ParentState()
stateTree, err := sm.StateTree(st)
if err != nil {
@@ -1354,11 +1349,12 @@ func (sm *StateManager) GetVMCirculatingSupplyDetailed(ctx context.Context, heig
}
return api.CirculatingSupply{
- FilVested: filVested,
- FilMined: filMined,
- FilBurnt: filBurnt,
- FilLocked: filLocked,
- FilCirculating: ret,
+ FilVested: filVested,
+ FilMined: filMined,
+ FilBurnt: filBurnt,
+ FilLocked: filLocked,
+ FilCirculating: ret,
+ FilReserveDisbursed: filReserveDisbursed,
}, nil
}
diff --git a/chain/stmgr/tracers.go b/chain/stmgr/tracers.go
new file mode 100644
index 000000000..6bcd7bc15
--- /dev/null
+++ b/chain/stmgr/tracers.go
@@ -0,0 +1,56 @@
+package stmgr
+
+import (
+ "context"
+
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/chain/vm"
+ "github.com/ipfs/go-cid"
+)
+
+type ExecMonitor interface {
+ // MessageApplied is called after a message has been applied. Returning an error will halt execution of any further messages.
+ MessageApplied(ctx context.Context, ts *types.TipSet, mcid cid.Cid, msg *types.Message, ret *vm.ApplyRet, implicit bool) error
+}
+
+var _ ExecMonitor = (*InvocationTracer)(nil)
+
+type InvocationTracer struct {
+ trace *[]*api.InvocResult
+}
+
+func (i *InvocationTracer) MessageApplied(ctx context.Context, ts *types.TipSet, mcid cid.Cid, msg *types.Message, ret *vm.ApplyRet, implicit bool) error {
+ ir := &api.InvocResult{
+ MsgCid: mcid,
+ Msg: msg,
+ MsgRct: &ret.MessageReceipt,
+ ExecutionTrace: ret.ExecutionTrace,
+ Duration: ret.Duration,
+ }
+ if ret.ActorErr != nil {
+ ir.Error = ret.ActorErr.Error()
+ }
+ if ret.GasCosts != nil {
+ ir.GasCost = MakeMsgGasCost(msg, ret)
+ }
+ *i.trace = append(*i.trace, ir)
+ return nil
+}
+
+var _ ExecMonitor = (*messageFinder)(nil)
+
+type messageFinder struct {
+ mcid cid.Cid // the message cid to find
+ outm *types.Message
+ outr *vm.ApplyRet
+}
+
+func (m *messageFinder) MessageApplied(ctx context.Context, ts *types.TipSet, mcid cid.Cid, msg *types.Message, ret *vm.ApplyRet, implicit bool) error {
+ if m.mcid == mcid {
+ m.outm = msg
+ m.outr = ret
+ return errHaltExecution // message was found, no need to continue
+ }
+ return nil
+}
diff --git a/chain/stmgr/utils.go b/chain/stmgr/utils.go
index ce6d0bf2b..d2a2c6e60 100644
--- a/chain/stmgr/utils.go
+++ b/chain/stmgr/utils.go
@@ -107,8 +107,7 @@ func GetPowerRaw(ctx context.Context, sm *StateManager, st cid.Cid, maddr addres
var found bool
mpow, found, err = pas.MinerPower(maddr)
if err != nil || !found {
- // TODO: return an error when not found?
- return power.Claim{}, power.Claim{}, false, err
+ return power.Claim{}, tpow, false, err
}
minpow, err = pas.MinerNominalPowerMeetsConsensusMinimum(maddr)
@@ -343,7 +342,7 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch,
for i := ts.Height(); i < height; i++ {
// handle state forks
- base, err = sm.handleStateForks(ctx, base, i, traceFunc(&trace), ts)
+ base, err = sm.handleStateForks(ctx, base, i, &InvocationTracer{trace: &trace}, ts)
if err != nil {
return cid.Undef, nil, xerrors.Errorf("error handling state forks: %w", err)
}
diff --git a/chain/store/checkpoint_test.go b/chain/store/checkpoint_test.go
new file mode 100644
index 000000000..81bbab6ea
--- /dev/null
+++ b/chain/store/checkpoint_test.go
@@ -0,0 +1,89 @@
+package store_test
+
+import (
+ "context"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/filecoin-project/lotus/chain/gen"
+)
+
+func TestChainCheckpoint(t *testing.T) {
+ cg, err := gen.NewGenerator()
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ // Let the first miner mine some blocks.
+ last := cg.CurTipset.TipSet()
+ for i := 0; i < 4; i++ {
+ ts, err := cg.NextTipSetFromMiners(last, cg.Miners[:1], 0)
+ require.NoError(t, err)
+
+ last = ts.TipSet.TipSet()
+ }
+
+ cs := cg.ChainStore()
+
+ checkpoint := last
+ checkpointParents, err := cs.GetTipSetFromKey(checkpoint.Parents())
+ require.NoError(t, err)
+
+ // Set the head to the block before the checkpoint.
+ err = cs.SetHead(checkpointParents)
+ require.NoError(t, err)
+
+ // Verify it worked.
+ head := cs.GetHeaviestTipSet()
+ require.True(t, head.Equals(checkpointParents))
+
+ // Try to set the checkpoint in the future, it should fail.
+ err = cs.SetCheckpoint(checkpoint)
+ require.Error(t, err)
+
+ // Then move the head back.
+ err = cs.SetHead(checkpoint)
+ require.NoError(t, err)
+
+ // Verify it worked.
+ head = cs.GetHeaviestTipSet()
+ require.True(t, head.Equals(checkpoint))
+
+ // And checkpoint it.
+ err = cs.SetCheckpoint(checkpoint)
+ require.NoError(t, err)
+
+ // Let the second miner miner mine a fork
+ last = checkpointParents
+ for i := 0; i < 4; i++ {
+ ts, err := cg.NextTipSetFromMiners(last, cg.Miners[1:], 0)
+ require.NoError(t, err)
+
+ last = ts.TipSet.TipSet()
+ }
+
+ // See if the chain will take the fork, it shouldn't.
+ err = cs.MaybeTakeHeavierTipSet(context.Background(), last)
+ require.NoError(t, err)
+ head = cs.GetHeaviestTipSet()
+ require.True(t, head.Equals(checkpoint))
+
+ // Remove the checkpoint.
+ err = cs.RemoveCheckpoint()
+ require.NoError(t, err)
+
+ // Now switch to the other fork.
+ err = cs.MaybeTakeHeavierTipSet(context.Background(), last)
+ require.NoError(t, err)
+ head = cs.GetHeaviestTipSet()
+ require.True(t, head.Equals(last))
+
+ // Setting a checkpoint on the other fork should fail.
+ err = cs.SetCheckpoint(checkpoint)
+ require.Error(t, err)
+
+ // Setting a checkpoint on this fork should succeed.
+ err = cs.SetCheckpoint(checkpointParents)
+ require.NoError(t, err)
+}
diff --git a/chain/store/store.go b/chain/store/store.go
index 5414b12fe..71fa0397a 100644
--- a/chain/store/store.go
+++ b/chain/store/store.go
@@ -56,8 +56,11 @@ import (
var log = logging.Logger("chainstore")
-var chainHeadKey = dstore.NewKey("head")
-var blockValidationCacheKeyPrefix = dstore.NewKey("blockValidation")
+var (
+ chainHeadKey = dstore.NewKey("head")
+ checkpointKey = dstore.NewKey("/chain/checks")
+ blockValidationCacheKeyPrefix = dstore.NewKey("blockValidation")
+)
var DefaultTipSetCacheSize = 8192
var DefaultMsgMetaCacheSize = 2048
@@ -117,6 +120,7 @@ type ChainStore struct {
heaviestLk sync.RWMutex
heaviest *types.TipSet
+ checkpoint *types.TipSet
bestTips *pubsub.PubSub
pubLk sync.Mutex
@@ -217,6 +221,15 @@ func (cs *ChainStore) Close() error {
}
func (cs *ChainStore) Load() error {
+ if err := cs.loadHead(); err != nil {
+ return err
+ }
+ if err := cs.loadCheckpoint(); err != nil {
+ return err
+ }
+ return nil
+}
+func (cs *ChainStore) loadHead() error {
head, err := cs.metadataDs.Get(chainHeadKey)
if err == dstore.ErrNotFound {
log.Warn("no previous chain state found")
@@ -241,6 +254,31 @@ func (cs *ChainStore) Load() error {
return nil
}
+func (cs *ChainStore) loadCheckpoint() error {
+ tskBytes, err := cs.metadataDs.Get(checkpointKey)
+ if err == dstore.ErrNotFound {
+ return nil
+ }
+ if err != nil {
+ return xerrors.Errorf("failed to load checkpoint from datastore: %w", err)
+ }
+
+ var tsk types.TipSetKey
+ err = json.Unmarshal(tskBytes, &tsk)
+ if err != nil {
+ return err
+ }
+
+ ts, err := cs.LoadTipSet(tsk)
+ if err != nil {
+ return xerrors.Errorf("loading tipset: %w", err)
+ }
+
+ cs.checkpoint = ts
+
+ return nil
+}
+
func (cs *ChainStore) writeHead(ts *types.TipSet) error {
data, err := json.Marshal(ts.Cids())
if err != nil {
@@ -441,6 +479,11 @@ func (cs *ChainStore) exceedsForkLength(synced, external *types.TipSet) (bool, e
return false, nil
}
+ // Now check to see if we've walked back to the checkpoint.
+ if synced.Equals(cs.checkpoint) {
+ return true, nil
+ }
+
// If we didn't, go back *one* tipset on the `synced` side (incrementing
// the `forkLength`).
if synced.Height() == 0 {
@@ -469,6 +512,9 @@ func (cs *ChainStore) ForceHeadSilent(_ context.Context, ts *types.TipSet) error
cs.heaviestLk.Lock()
defer cs.heaviestLk.Unlock()
+ if err := cs.removeCheckpoint(); err != nil {
+ return err
+ }
cs.heaviest = ts
err := cs.writeHead(ts)
@@ -644,13 +690,80 @@ func FlushValidationCache(ds datastore.Batching) error {
}
// SetHead sets the chainstores current 'best' head node.
-// This should only be called if something is broken and needs fixing
+// This should only be called if something is broken and needs fixing.
+//
+// This function will bypass and remove any checkpoints.
func (cs *ChainStore) SetHead(ts *types.TipSet) error {
cs.heaviestLk.Lock()
defer cs.heaviestLk.Unlock()
+ if err := cs.removeCheckpoint(); err != nil {
+ return err
+ }
return cs.takeHeaviestTipSet(context.TODO(), ts)
}
+// RemoveCheckpoint removes the current checkpoint.
+func (cs *ChainStore) RemoveCheckpoint() error {
+ cs.heaviestLk.Lock()
+ defer cs.heaviestLk.Unlock()
+ return cs.removeCheckpoint()
+}
+
+func (cs *ChainStore) removeCheckpoint() error {
+ if err := cs.metadataDs.Delete(checkpointKey); err != nil {
+ return err
+ }
+ cs.checkpoint = nil
+ return nil
+}
+
+// SetCheckpoint will set a checkpoint past which the chainstore will not allow forks.
+//
+// NOTE: Checkpoints cannot be set beyond ForkLengthThreshold epochs in the past.
+func (cs *ChainStore) SetCheckpoint(ts *types.TipSet) error {
+ tskBytes, err := json.Marshal(ts.Key())
+ if err != nil {
+ return err
+ }
+
+ cs.heaviestLk.Lock()
+ defer cs.heaviestLk.Unlock()
+
+ if ts.Height() > cs.heaviest.Height() {
+ return xerrors.Errorf("cannot set a checkpoint in the future")
+ }
+
+ // Otherwise, this operation could get _very_ expensive.
+ if cs.heaviest.Height()-ts.Height() > build.ForkLengthThreshold {
+ return xerrors.Errorf("cannot set a checkpoint before the fork threshold")
+ }
+
+ if !ts.Equals(cs.heaviest) {
+ anc, err := cs.IsAncestorOf(ts, cs.heaviest)
+ if err != nil {
+ return xerrors.Errorf("cannot determine whether checkpoint tipset is in main-chain: %w", err)
+ }
+
+ if !anc {
+ return xerrors.Errorf("cannot mark tipset as checkpoint, since it isn't in the main-chain: %w", err)
+ }
+ }
+ err = cs.metadataDs.Put(checkpointKey, tskBytes)
+ if err != nil {
+ return err
+ }
+
+ cs.checkpoint = ts
+ return nil
+}
+
+func (cs *ChainStore) GetCheckpoint() *types.TipSet {
+ cs.heaviestLk.RLock()
+ chkpt := cs.checkpoint
+ cs.heaviestLk.RUnlock()
+ return chkpt
+}
+
// Contains returns whether our BlockStore has all blocks in the supplied TipSet.
func (cs *ChainStore) Contains(ts *types.TipSet) (bool, error) {
for _, c := range ts.Cids() {
@@ -742,6 +855,14 @@ func (cs *ChainStore) NearestCommonAncestor(a, b *types.TipSet) (*types.TipSet,
return cs.LoadTipSet(l[len(l)-1].Parents())
}
+// ReorgOps takes two tipsets (which can be at different heights), and walks
+// their corresponding chains backwards one step at a time until we find
+// a common ancestor. It then returns the respective chain segments that fork
+// from the identified ancestor, in reverse order, where the first element of
+// each slice is the supplied tipset, and the last element is the common
+// ancestor.
+//
+// If an error happens along the way, we return the error with nil slices.
func (cs *ChainStore) ReorgOps(a, b *types.TipSet) ([]*types.TipSet, []*types.TipSet, error) {
return ReorgOps(cs.LoadTipSet, a, b)
}
@@ -1140,6 +1261,9 @@ func (cs *ChainStore) ReadMsgMetaCids(mmc cid.Cid) ([]cid.Cid, []cid.Cid, error)
return blscids, secpkcids, nil
}
+// GetPath returns the sequence of atomic head change operations that
+// need to be applied in order to switch the head of the chain from the `from`
+// tipset to the `to` tipset.
func (cs *ChainStore) GetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*api.HeadChange, error) {
fts, err := cs.LoadTipSet(from)
if err != nil {
diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go
index 7452d31a9..115c33261 100644
--- a/chain/sub/incoming.go
+++ b/chain/sub/incoming.go
@@ -81,13 +81,13 @@ func HandleIncomingBlocks(ctx context.Context, bsub *pubsub.Subscription, s *cha
log.Debug("about to fetch messages for block from pubsub")
bmsgs, err := FetchMessagesByCids(ctx, ses, blk.BlsMessages)
if err != nil {
- log.Errorf("failed to fetch all bls messages for block received over pubusb: %s; source: %s", err, src)
+ log.Errorf("failed to fetch all bls messages for block received over pubsub: %s; source: %s", err, src)
return
}
smsgs, err := FetchSignedMessagesByCids(ctx, ses, blk.SecpkMessages)
if err != nil {
- log.Errorf("failed to fetch all secpk messages for block received over pubusb: %s; source: %s", err, src)
+ log.Errorf("failed to fetch all secpk messages for block received over pubsub: %s; source: %s", err, src)
return
}
diff --git a/chain/sync.go b/chain/sync.go
index d908f3fd8..167856927 100644
--- a/chain/sync.go
+++ b/chain/sync.go
@@ -131,10 +131,6 @@ type Syncer struct {
tickerCtxCancel context.CancelFunc
- checkptLk sync.Mutex
-
- checkpt types.TipSetKey
-
ds dtypes.MetadataDS
}
@@ -152,14 +148,8 @@ func NewSyncer(ds dtypes.MetadataDS, sm *stmgr.StateManager, exchange exchange.C
return nil, err
}
- cp, err := loadCheckpoint(ds)
- if err != nil {
- return nil, xerrors.Errorf("error loading mpool config: %w", err)
- }
-
s := &Syncer{
ds: ds,
- checkpt: cp,
beacon: beacon,
bad: NewBadBlockCache(),
Genesis: gent,
@@ -561,7 +551,7 @@ func (syncer *Syncer) Sync(ctx context.Context, maybeHead *types.TipSet) error {
return nil
}
- if err := syncer.collectChain(ctx, maybeHead, hts); err != nil {
+ if err := syncer.collectChain(ctx, maybeHead, hts, false); err != nil {
span.AddAttributes(trace.StringAttribute("col_error", err.Error()))
span.SetStatus(trace.Status{
Code: 13,
@@ -1257,7 +1247,7 @@ func extractSyncState(ctx context.Context) *SyncerState {
//
// All throughout the process, we keep checking if the received blocks are in
// the deny list, and short-circuit the process if so.
-func (syncer *Syncer) collectHeaders(ctx context.Context, incoming *types.TipSet, known *types.TipSet) ([]*types.TipSet, error) {
+func (syncer *Syncer) collectHeaders(ctx context.Context, incoming *types.TipSet, known *types.TipSet, ignoreCheckpoint bool) ([]*types.TipSet, error) {
ctx, span := trace.StartSpan(ctx, "collectHeaders")
defer span.End()
ss := extractSyncState(ctx)
@@ -1426,7 +1416,7 @@ loop:
// We have now ascertained that this is *not* a 'fast forward'
log.Warnf("(fork detected) synced header chain (%s - %d) does not link to our best block (%s - %d)", incoming.Cids(), incoming.Height(), known.Cids(), known.Height())
- fork, err := syncer.syncFork(ctx, base, known)
+ fork, err := syncer.syncFork(ctx, base, known, ignoreCheckpoint)
if err != nil {
if xerrors.Is(err, ErrForkTooLong) || xerrors.Is(err, ErrForkCheckpoint) {
// TODO: we're marking this block bad in the same way that we mark invalid blocks bad. Maybe distinguish?
@@ -1452,11 +1442,14 @@ var ErrForkCheckpoint = fmt.Errorf("fork would require us to diverge from checkp
// If the fork is too long (build.ForkLengthThreshold), or would cause us to diverge from the checkpoint (ErrForkCheckpoint),
// we add the entire subchain to the denylist. Else, we find the common ancestor, and add the missing chain
// fragment until the fork point to the returned []TipSet.
-func (syncer *Syncer) syncFork(ctx context.Context, incoming *types.TipSet, known *types.TipSet) ([]*types.TipSet, error) {
+func (syncer *Syncer) syncFork(ctx context.Context, incoming *types.TipSet, known *types.TipSet, ignoreCheckpoint bool) ([]*types.TipSet, error) {
- chkpt := syncer.GetCheckpoint()
- if known.Key() == chkpt {
- return nil, ErrForkCheckpoint
+ var chkpt *types.TipSet
+ if !ignoreCheckpoint {
+ chkpt = syncer.store.GetCheckpoint()
+ if known.Equals(chkpt) {
+ return nil, ErrForkCheckpoint
+ }
}
// TODO: Does this mean we always ask for ForkLengthThreshold blocks from the network, even if we just need, like, 2? Yes.
@@ -1498,7 +1491,7 @@ func (syncer *Syncer) syncFork(ctx context.Context, incoming *types.TipSet, know
}
// We will be forking away from nts, check that it isn't checkpointed
- if nts.Key() == chkpt {
+ if nts.Equals(chkpt) {
return nil, ErrForkCheckpoint
}
@@ -1709,14 +1702,14 @@ func persistMessages(ctx context.Context, bs bstore.Blockstore, bst *exchange.Co
//
// 3. StageMessages: having acquired the headers and found a common tipset,
// we then move forward, requesting the full blocks, including the messages.
-func (syncer *Syncer) collectChain(ctx context.Context, ts *types.TipSet, hts *types.TipSet) error {
+func (syncer *Syncer) collectChain(ctx context.Context, ts *types.TipSet, hts *types.TipSet, ignoreCheckpoint bool) error {
ctx, span := trace.StartSpan(ctx, "collectChain")
defer span.End()
ss := extractSyncState(ctx)
ss.Init(hts, ts)
- headers, err := syncer.collectHeaders(ctx, ts, hts)
+ headers, err := syncer.collectHeaders(ctx, ts, hts, ignoreCheckpoint)
if err != nil {
ss.Error(err)
return err
diff --git a/chain/sync_test.go b/chain/sync_test.go
index 4aa3f6fdf..9f89f789b 100644
--- a/chain/sync_test.go
+++ b/chain/sync_test.go
@@ -400,12 +400,15 @@ func (tu *syncTestUtil) checkpointTs(node int, tsk types.TipSetKey) {
require.NoError(tu.t, tu.nds[node].SyncCheckpoint(context.TODO(), tsk))
}
+func (tu *syncTestUtil) nodeHasTs(node int, tsk types.TipSetKey) bool {
+ _, err := tu.nds[node].ChainGetTipSet(context.TODO(), tsk)
+ return err == nil
+}
+
func (tu *syncTestUtil) waitUntilNodeHasTs(node int, tsk types.TipSetKey) {
- for {
- _, err := tu.nds[node].ChainGetTipSet(context.TODO(), tsk)
- if err != nil {
- break
- }
+ for !tu.nodeHasTs(node, tsk) {
+ // Time to allow for syncing and validation
+ time.Sleep(10 * time.Millisecond)
}
// Time to allow for syncing and validation
@@ -430,12 +433,18 @@ func (tu *syncTestUtil) waitUntilSyncTarget(to int, target *types.TipSet) {
tu.t.Fatal(err)
}
- // TODO: some sort of timeout?
- for n := range hc {
- for _, c := range n {
- if c.Val.Equals(target) {
- return
+ timeout := time.After(5 * time.Second)
+
+ for {
+ select {
+ case n := <-hc:
+ for _, c := range n {
+ if c.Val.Equals(target) {
+ return
+ }
}
+ case <-timeout:
+ tu.t.Fatal("waitUntilSyncTarget timeout")
}
}
}
@@ -572,15 +581,20 @@ func TestSyncFork(t *testing.T) {
tu.loadChainToNode(p1)
tu.loadChainToNode(p2)
- phead := func() {
+ printHead := func() {
h1, err := tu.nds[1].ChainHead(tu.ctx)
require.NoError(tu.t, err)
h2, err := tu.nds[2].ChainHead(tu.ctx)
require.NoError(tu.t, err)
- fmt.Println("Node 1: ", h1.Cids(), h1.Parents(), h1.Height())
- fmt.Println("Node 2: ", h2.Cids(), h1.Parents(), h2.Height())
+ w1, err := tu.nds[1].(*impl.FullNodeAPI).ChainAPI.Chain.Weight(tu.ctx, h1)
+ require.NoError(tu.t, err)
+ w2, err := tu.nds[2].(*impl.FullNodeAPI).ChainAPI.Chain.Weight(tu.ctx, h2)
+ require.NoError(tu.t, err)
+
+ fmt.Println("Node 1: ", h1.Cids(), h1.Parents(), h1.Height(), w1)
+ fmt.Println("Node 2: ", h2.Cids(), h2.Parents(), h2.Height(), w2)
//time.Sleep(time.Second * 2)
fmt.Println()
fmt.Println()
@@ -588,7 +602,7 @@ func TestSyncFork(t *testing.T) {
fmt.Println()
}
- phead()
+ printHead()
base := tu.g.CurTipset
fmt.Println("Mining base: ", base.TipSet().Cids(), base.TipSet().Height())
@@ -608,6 +622,8 @@ func TestSyncFork(t *testing.T) {
fmt.Println("A: ", a.Cids(), a.TipSet().Height())
fmt.Println("B: ", b.Cids(), b.TipSet().Height())
+ printHead()
+
// Now for the fun part!!
require.NoError(t, tu.mn.LinkAll())
@@ -615,7 +631,7 @@ func TestSyncFork(t *testing.T) {
tu.waitUntilSyncTarget(p1, b.TipSet())
tu.waitUntilSyncTarget(p2, b.TipSet())
- phead()
+ printHead()
}
// This test crafts a tipset with 2 blocks, A and B.
@@ -676,17 +692,17 @@ func TestDuplicateNonce(t *testing.T) {
var includedMsg cid.Cid
var skippedMsg cid.Cid
- r0, err0 := tu.nds[0].StateGetReceipt(context.TODO(), msgs[0][0].Cid(), ts2.TipSet().Key())
- r1, err1 := tu.nds[0].StateGetReceipt(context.TODO(), msgs[1][0].Cid(), ts2.TipSet().Key())
+ r0, err0 := tu.nds[0].StateSearchMsg(context.TODO(), ts2.TipSet().Key(), msgs[0][0].Cid(), api.LookbackNoLimit, true)
+ r1, err1 := tu.nds[0].StateSearchMsg(context.TODO(), ts2.TipSet().Key(), msgs[1][0].Cid(), api.LookbackNoLimit, true)
if err0 == nil {
require.Error(t, err1, "at least one of the StateGetReceipt calls should fail")
- require.True(t, r0.ExitCode.IsSuccess())
+ require.True(t, r0.Receipt.ExitCode.IsSuccess())
includedMsg = msgs[0][0].Message.Cid()
skippedMsg = msgs[1][0].Message.Cid()
} else {
require.NoError(t, err1, "both the StateGetReceipt calls should not fail")
- require.True(t, r1.ExitCode.IsSuccess())
+ require.True(t, r1.Receipt.ExitCode.IsSuccess())
includedMsg = msgs[1][0].Message.Cid()
skippedMsg = msgs[0][0].Message.Cid()
}
@@ -953,8 +969,13 @@ func TestSyncCheckpointHead(t *testing.T) {
tu.connect(p1, p2)
tu.waitUntilNodeHasTs(p1, b.TipSet().Key())
p1Head := tu.getHead(p1)
- require.Equal(tu.t, p1Head, a.TipSet())
+ require.True(tu.t, p1Head.Equals(a.TipSet()))
tu.assertBad(p1, b.TipSet())
+
+ // Should be able to switch forks.
+ tu.checkpointTs(p1, b.TipSet().Key())
+ p1Head = tu.getHead(p1)
+ require.True(tu.t, p1Head.Equals(b.TipSet()))
}
func TestSyncCheckpointEarlierThanHead(t *testing.T) {
@@ -995,8 +1016,13 @@ func TestSyncCheckpointEarlierThanHead(t *testing.T) {
tu.connect(p1, p2)
tu.waitUntilNodeHasTs(p1, b.TipSet().Key())
p1Head := tu.getHead(p1)
- require.Equal(tu.t, p1Head, a.TipSet())
+ require.True(tu.t, p1Head.Equals(a.TipSet()))
tu.assertBad(p1, b.TipSet())
+
+ // Should be able to switch forks.
+ tu.checkpointTs(p1, b.TipSet().Key())
+ p1Head = tu.getHead(p1)
+ require.True(tu.t, p1Head.Equals(b.TipSet()))
}
func TestDrandNull(t *testing.T) {
diff --git a/chain/types/fil.go b/chain/types/fil.go
index 223ed3c50..7438410c8 100644
--- a/chain/types/fil.go
+++ b/chain/types/fil.go
@@ -46,6 +46,15 @@ func (f FIL) Short() string {
return strings.TrimRight(strings.TrimRight(r.FloatString(3), "0"), ".") + " " + prefix + "FIL"
}
+func (f FIL) Nano() string {
+ r := new(big.Rat).SetFrac(f.Int, big.NewInt(int64(1e9)))
+ if r.Sign() == 0 {
+ return "0"
+ }
+
+ return strings.TrimRight(strings.TrimRight(r.FloatString(9), "0"), ".") + " nFIL"
+}
+
func (f FIL) Format(s fmt.State, ch rune) {
switch ch {
case 's', 'v':
diff --git a/chain/types/tipset_key.go b/chain/types/tipset_key.go
index e5bc7750d..9f9887796 100644
--- a/chain/types/tipset_key.go
+++ b/chain/types/tipset_key.go
@@ -47,7 +47,7 @@ func NewTipSetKey(cids ...cid.Cid) TipSetKey {
func TipSetKeyFromBytes(encoded []byte) (TipSetKey, error) {
_, err := decodeKey(encoded)
if err != nil {
- return TipSetKey{}, err
+ return EmptyTSK, err
}
return TipSetKey{string(encoded)}, nil
}
diff --git a/chain/types/tipset_key_test.go b/chain/types/tipset_key_test.go
index 7b3ce439d..73c1ca9df 100644
--- a/chain/types/tipset_key_test.go
+++ b/chain/types/tipset_key_test.go
@@ -19,7 +19,7 @@ func TestTipSetKey(t *testing.T) {
fmt.Println(len(c1.Bytes()))
t.Run("zero value", func(t *testing.T) {
- assert.Equal(t, TipSetKey{}, NewTipSetKey())
+ assert.Equal(t, EmptyTSK, NewTipSetKey())
})
t.Run("CID extraction", func(t *testing.T) {
diff --git a/chain/vm/runtime.go b/chain/vm/runtime.go
index 7c40fed62..2845c7696 100644
--- a/chain/vm/runtime.go
+++ b/chain/vm/runtime.go
@@ -229,7 +229,7 @@ func (rt *Runtime) GetRandomnessFromTickets(personalization crypto.DomainSeparat
func (rt *Runtime) GetRandomnessFromBeacon(personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) abi.Randomness {
var err error
var res []byte
- if rt.vm.GetNtwkVersion(rt.ctx, randEpoch) >= network.Version13 {
+ if randEpoch > build.UpgradeHyperdriveHeight {
res, err = rt.vm.rand.GetBeaconRandomnessLookingForward(rt.ctx, personalization, randEpoch, entropy)
} else {
res, err = rt.vm.rand.GetBeaconRandomnessLookingBack(rt.ctx, personalization, randEpoch, entropy)
diff --git a/chain/vm/syscalls.go b/chain/vm/syscalls.go
index bb93fce8d..0cbefd1fd 100644
--- a/chain/vm/syscalls.go
+++ b/chain/vm/syscalls.go
@@ -267,7 +267,7 @@ func (ss *syscallShim) VerifySeal(info proof5.SealVerifyInfo) error {
proof := info.Proof
seed := []byte(info.InteractiveRandomness)
- log.Debugf("Verif r:%x; d:%x; m:%s; t:%x; s:%x; N:%d; p:%x", info.SealedCID, info.UnsealedCID, miner, ticket, seed, info.SectorID.Number, proof)
+ log.Debugf("Verif r:%s; d:%s; m:%s; t:%x; s:%x; N:%d; p:%x", info.SealedCID, info.UnsealedCID, miner, ticket, seed, info.SectorID.Number, proof)
//func(ctx context.Context, maddr address.Address, ssize abi.SectorSize, commD, commR, ticket, proof, seed []byte, sectorID abi.SectorNumber)
ok, err := ss.verifier.VerifySeal(info)
diff --git a/chain/vm/vm.go b/chain/vm/vm.go
index d3fc9ee7a..c5bfffc7f 100644
--- a/chain/vm/vm.go
+++ b/chain/vm/vm.go
@@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
- "reflect"
"sync/atomic"
"time"
@@ -203,7 +202,8 @@ type (
)
type VM struct {
- cstate *state.StateTree
+ cstate *state.StateTree
+ // TODO: Is base actually used? Can we delete it?
base cid.Cid
cst *cbor.BasicIpldStore
buf *blockstore.BufferedBlockstore
@@ -669,37 +669,6 @@ func (vm *VM) Flush(ctx context.Context) (cid.Cid, error) {
return root, nil
}
-// MutateState usage: MutateState(ctx, idAddr, func(cst cbor.IpldStore, st *ActorStateType) error {...})
-func (vm *VM) MutateState(ctx context.Context, addr address.Address, fn interface{}) error {
- act, err := vm.cstate.GetActor(addr)
- if err != nil {
- return xerrors.Errorf("actor not found: %w", err)
- }
-
- st := reflect.New(reflect.TypeOf(fn).In(1).Elem())
- if err := vm.cst.Get(ctx, act.Head, st.Interface()); err != nil {
- return xerrors.Errorf("read actor head: %w", err)
- }
-
- out := reflect.ValueOf(fn).Call([]reflect.Value{reflect.ValueOf(vm.cst), st})
- if !out[0].IsNil() && out[0].Interface().(error) != nil {
- return out[0].Interface().(error)
- }
-
- head, err := vm.cst.Put(ctx, st.Interface())
- if err != nil {
- return xerrors.Errorf("put new actor head: %w", err)
- }
-
- act.Head = head
-
- if err := vm.cstate.SetActor(addr, act); err != nil {
- return xerrors.Errorf("set actor: %w", err)
- }
-
- return nil
-}
-
func linksForObj(blk block.Block, cb func(cid.Cid)) error {
switch blk.Cid().Prefix().Codec {
case cid.DagCBOR:
diff --git a/chain/wallet/remotewallet/remote.go b/chain/wallet/remotewallet/remote.go
index 262b5f9c6..d1734518e 100644
--- a/chain/wallet/remotewallet/remote.go
+++ b/chain/wallet/remotewallet/remote.go
@@ -20,12 +20,12 @@ func SetupRemoteWallet(info string) func(mctx helpers.MetricsCtx, lc fx.Lifecycl
return func(mctx helpers.MetricsCtx, lc fx.Lifecycle) (*RemoteWallet, error) {
ai := cliutil.ParseApiInfo(info)
- url, err := ai.DialArgs()
+ url, err := ai.DialArgs("v0")
if err != nil {
return nil, err
}
- wapi, closer, err := client.NewWalletRPC(mctx, url, ai.AuthHeader())
+ wapi, closer, err := client.NewWalletRPCV0(mctx, url, ai.AuthHeader())
if err != nil {
return nil, xerrors.Errorf("creating jsonrpc client: %w", err)
}
diff --git a/cli/auth.go b/cli/auth.go
index 6426a4ab6..20b9bb394 100644
--- a/cli/auth.go
+++ b/cli/auth.go
@@ -8,7 +8,7 @@ import (
"github.com/filecoin-project/go-jsonrpc/auth"
- "github.com/filecoin-project/lotus/api/apistruct"
+ "github.com/filecoin-project/lotus/api"
cliutil "github.com/filecoin-project/lotus/cli/util"
"github.com/filecoin-project/lotus/node/repo"
)
@@ -47,18 +47,18 @@ var AuthCreateAdminToken = &cli.Command{
perm := cctx.String("perm")
idx := 0
- for i, p := range apistruct.AllPermissions {
+ for i, p := range api.AllPermissions {
if auth.Permission(perm) == p {
idx = i + 1
}
}
if idx == 0 {
- return fmt.Errorf("--perm flag has to be one of: %s", apistruct.AllPermissions)
+ return fmt.Errorf("--perm flag has to be one of: %s", api.AllPermissions)
}
// slice on [:idx] so for example: 'sign' gives you [read, write, sign]
- token, err := napi.AuthNew(ctx, apistruct.AllPermissions[:idx])
+ token, err := napi.AuthNew(ctx, api.AllPermissions[:idx])
if err != nil {
return err
}
@@ -95,18 +95,18 @@ var AuthApiInfoToken = &cli.Command{
perm := cctx.String("perm")
idx := 0
- for i, p := range apistruct.AllPermissions {
+ for i, p := range api.AllPermissions {
if auth.Permission(perm) == p {
idx = i + 1
}
}
if idx == 0 {
- return fmt.Errorf("--perm flag has to be one of: %s", apistruct.AllPermissions)
+ return fmt.Errorf("--perm flag has to be one of: %s", api.AllPermissions)
}
// slice on [:idx] so for example: 'sign' gives you [read, write, sign]
- token, err := napi.AuthNew(ctx, apistruct.AllPermissions[:idx])
+ token, err := napi.AuthNew(ctx, api.AllPermissions[:idx])
if err != nil {
return err
}
diff --git a/cli/chain.go b/cli/chain.go
index 1574f3f64..6651a7764 100644
--- a/cli/chain.go
+++ b/cli/chain.go
@@ -31,7 +31,9 @@ import (
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
+ "github.com/filecoin-project/lotus/api"
lapi "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/stmgr"
@@ -722,12 +724,6 @@ var ChainGetCmd = &cli.Command{
return err
}
- if ts == nil {
- ts, err = api.ChainHead(ctx)
- if err != nil {
- return err
- }
- }
p = "/ipfs/" + ts.ParentState().String() + p
if cctx.Bool("verbose") {
fmt.Println(p)
@@ -806,7 +802,7 @@ var ChainGetCmd = &cli.Command{
type apiIpldStore struct {
ctx context.Context
- api lapi.FullNode
+ api v0api.FullNode
}
func (ht *apiIpldStore) Context() context.Context {
@@ -834,7 +830,7 @@ func (ht *apiIpldStore) Put(ctx context.Context, v interface{}) (cid.Cid, error)
panic("No mutations allowed")
}
-func handleAmt(ctx context.Context, api lapi.FullNode, r cid.Cid) error {
+func handleAmt(ctx context.Context, api v0api.FullNode, r cid.Cid) error {
s := &apiIpldStore{ctx, api}
mp, err := adt.AsArray(s, r)
if err != nil {
@@ -847,7 +843,7 @@ func handleAmt(ctx context.Context, api lapi.FullNode, r cid.Cid) error {
})
}
-func handleHamtEpoch(ctx context.Context, api lapi.FullNode, r cid.Cid) error {
+func handleHamtEpoch(ctx context.Context, api v0api.FullNode, r cid.Cid) error {
s := &apiIpldStore{ctx, api}
mp, err := adt.AsMap(s, r)
if err != nil {
@@ -865,7 +861,7 @@ func handleHamtEpoch(ctx context.Context, api lapi.FullNode, r cid.Cid) error {
})
}
-func handleHamtAddress(ctx context.Context, api lapi.FullNode, r cid.Cid) error {
+func handleHamtAddress(ctx context.Context, api v0api.FullNode, r cid.Cid) error {
s := &apiIpldStore{ctx, api}
mp, err := adt.AsMap(s, r)
if err != nil {
@@ -1121,11 +1117,13 @@ var SlashConsensusFault = &cli.Command{
},
},
Action: func(cctx *cli.Context) error {
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ a := srv.FullNodeAPI()
ctx := ReqContext(cctx)
c1, err := cid.Parse(cctx.Args().Get(0))
@@ -1133,7 +1131,7 @@ var SlashConsensusFault = &cli.Command{
return xerrors.Errorf("parsing cid 1: %w", err)
}
- b1, err := api.ChainGetBlock(ctx, c1)
+ b1, err := a.ChainGetBlock(ctx, c1)
if err != nil {
return xerrors.Errorf("getting block 1: %w", err)
}
@@ -1143,7 +1141,7 @@ var SlashConsensusFault = &cli.Command{
return xerrors.Errorf("parsing cid 2: %w", err)
}
- b2, err := api.ChainGetBlock(ctx, c2)
+ b2, err := a.ChainGetBlock(ctx, c2)
if err != nil {
return xerrors.Errorf("getting block 2: %w", err)
}
@@ -1154,7 +1152,7 @@ var SlashConsensusFault = &cli.Command{
var fromAddr address.Address
if from := cctx.String("from"); from == "" {
- defaddr, err := api.WalletDefaultAddress(ctx)
+ defaddr, err := a.WalletDefaultAddress(ctx)
if err != nil {
return err
}
@@ -1190,7 +1188,7 @@ var SlashConsensusFault = &cli.Command{
return xerrors.Errorf("parsing cid extra: %w", err)
}
- bExtra, err := api.ChainGetBlock(ctx, cExtra)
+ bExtra, err := a.ChainGetBlock(ctx, cExtra)
if err != nil {
return xerrors.Errorf("getting block extra: %w", err)
}
@@ -1208,15 +1206,17 @@ var SlashConsensusFault = &cli.Command{
return err
}
- msg := &types.Message{
- To: b2.Miner,
- From: fromAddr,
- Value: types.NewInt(0),
- Method: builtin.MethodsMiner.ReportConsensusFault,
- Params: enc,
+ proto := &api.MessagePrototype{
+ Message: types.Message{
+ To: b2.Miner,
+ From: fromAddr,
+ Value: types.NewInt(0),
+ Method: builtin.MethodsMiner.ReportConsensusFault,
+ Params: enc,
+ },
}
- smsg, err := api.MpoolPushMessage(ctx, msg, nil)
+ smsg, err := InteractiveSend(ctx, cctx, srv, proto)
if err != nil {
return err
}
diff --git a/cli/client.go b/cli/client.go
index 8964ea0cd..4f2c58dc2 100644
--- a/cli/client.go
+++ b/cli/client.go
@@ -40,6 +40,7 @@ import (
"github.com/filecoin-project/lotus/api"
lapi "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
@@ -91,6 +92,7 @@ var clientCmd = &cli.Command{
WithCategory("retrieval", clientFindCmd),
WithCategory("retrieval", clientRetrieveCmd),
WithCategory("retrieval", clientCancelRetrievalDealCmd),
+ WithCategory("retrieval", clientListRetrievalsCmd),
WithCategory("util", clientCommPCmd),
WithCategory("util", clientCarGenCmd),
WithCategory("util", clientBalancesCmd),
@@ -321,6 +323,10 @@ The minimum value is 518400 (6 months).`,
Name: "manual-piece-size",
Usage: "if manually specifying piece cid, used to specify size (dataCid must be to a car file)",
},
+ &cli.BoolFlag{
+ Name: "manual-stateless-deal",
+ Usage: "instructs the node to send an offline deal without registering it with the deallist/fsm",
+ },
&cli.StringFlag{
Name: "from",
Usage: "specify address to fund the deal with",
@@ -460,7 +466,7 @@ The minimum value is 518400 (6 months).`,
isVerified = verifiedDealParam
}
- proposal, err := api.ClientStartDeal(ctx, &lapi.StartDealParams{
+ sdParams := &lapi.StartDealParams{
Data: ref,
Wallet: a,
Miner: miner,
@@ -470,7 +476,18 @@ The minimum value is 518400 (6 months).`,
FastRetrieval: cctx.Bool("fast-retrieval"),
VerifiedDeal: isVerified,
ProviderCollateral: provCol,
- })
+ }
+
+ var proposal *cid.Cid
+ if cctx.Bool("manual-stateless-deal") {
+ if ref.TransferType != storagemarket.TTManual || price.Int64() != 0 {
+ return xerrors.New("when manual-stateless-deal is enabled, you must also provide a 'price' of 0 and specify 'manual-piece-cid' and 'manual-piece-size'")
+ }
+ proposal, err = api.ClientStatelessDeal(ctx, sdParams)
+ } else {
+ proposal, err = api.ClientStartDeal(ctx, sdParams)
+ }
+
if err != nil {
return err
}
@@ -1168,6 +1185,8 @@ var clientRetrieveCmd = &cli.Command{
return xerrors.Errorf("error setting up retrieval: %w", err)
}
+ var prevStatus retrievalmarket.DealStatus
+
for {
select {
case evt, ok := <-updates:
@@ -1178,14 +1197,23 @@ var clientRetrieveCmd = &cli.Command{
retrievalmarket.ClientEvents[evt.Event],
retrievalmarket.DealStatuses[evt.Status],
)
- } else {
- afmt.Println("Success")
- return nil
+ prevStatus = evt.Status
}
if evt.Err != "" {
return xerrors.Errorf("retrieval failed: %s", evt.Err)
}
+
+ if !ok {
+ if prevStatus == retrievalmarket.DealStatusCompleted {
+ afmt.Println("Success")
+ } else {
+ afmt.Printf("saw final deal state %s instead of expected success state DealStatusCompleted\n",
+ retrievalmarket.DealStatuses[prevStatus])
+ }
+ return nil
+ }
+
case <-ctx.Done():
return xerrors.Errorf("retrieval timed out")
}
@@ -1193,6 +1221,197 @@ var clientRetrieveCmd = &cli.Command{
},
}
+var clientListRetrievalsCmd = &cli.Command{
+ Name: "list-retrievals",
+ Usage: "List retrieval market deals",
+ Flags: []cli.Flag{
+ &cli.BoolFlag{
+ Name: "verbose",
+ Aliases: []string{"v"},
+ Usage: "print verbose deal details",
+ },
+ &cli.BoolFlag{
+ Name: "color",
+ Usage: "use color in display output",
+ Value: true,
+ },
+ &cli.BoolFlag{
+ Name: "show-failed",
+ Usage: "show failed/failing deals",
+ Value: true,
+ },
+ &cli.BoolFlag{
+ Name: "completed",
+ Usage: "show completed retrievals",
+ },
+ &cli.BoolFlag{
+ Name: "watch",
+ Usage: "watch deal updates in real-time, rather than a one time list",
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ api, closer, err := GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+ ctx := ReqContext(cctx)
+
+ verbose := cctx.Bool("verbose")
+ color := cctx.Bool("color")
+ watch := cctx.Bool("watch")
+ showFailed := cctx.Bool("show-failed")
+ completed := cctx.Bool("completed")
+
+ localDeals, err := api.ClientListRetrievals(ctx)
+ if err != nil {
+ return err
+ }
+
+ if watch {
+ updates, err := api.ClientGetRetrievalUpdates(ctx)
+ if err != nil {
+ return err
+ }
+
+ for {
+ tm.Clear()
+ tm.MoveCursor(1, 1)
+
+ err = outputRetrievalDeals(ctx, tm.Screen, localDeals, verbose, color, showFailed, completed)
+ if err != nil {
+ return err
+ }
+
+ tm.Flush()
+
+ select {
+ case <-ctx.Done():
+ return nil
+ case updated := <-updates:
+ var found bool
+ for i, existing := range localDeals {
+ if existing.ID == updated.ID {
+ localDeals[i] = updated
+ found = true
+ break
+ }
+ }
+ if !found {
+ localDeals = append(localDeals, updated)
+ }
+ }
+ }
+ }
+
+ return outputRetrievalDeals(ctx, cctx.App.Writer, localDeals, verbose, color, showFailed, completed)
+ },
+}
+
+func isTerminalError(status retrievalmarket.DealStatus) bool {
+ // should patch this in go-fil-markets but to solve the problem immediate and not have buggy output
+ return retrievalmarket.IsTerminalError(status) || status == retrievalmarket.DealStatusErrored || status == retrievalmarket.DealStatusCancelled
+}
+func outputRetrievalDeals(ctx context.Context, out io.Writer, localDeals []lapi.RetrievalInfo, verbose bool, color bool, showFailed bool, completed bool) error {
+ var deals []api.RetrievalInfo
+ for _, deal := range localDeals {
+ if !showFailed && isTerminalError(deal.Status) {
+ continue
+ }
+ if !completed && retrievalmarket.IsTerminalSuccess(deal.Status) {
+ continue
+ }
+ deals = append(deals, deal)
+ }
+
+ tableColumns := []tablewriter.Column{
+ tablewriter.Col("PayloadCID"),
+ tablewriter.Col("DealId"),
+ tablewriter.Col("Provider"),
+ tablewriter.Col("Status"),
+ tablewriter.Col("PricePerByte"),
+ tablewriter.Col("Received"),
+ tablewriter.Col("TotalPaid"),
+ }
+
+ if verbose {
+ tableColumns = append(tableColumns,
+ tablewriter.Col("PieceCID"),
+ tablewriter.Col("UnsealPrice"),
+ tablewriter.Col("BytesPaidFor"),
+ tablewriter.Col("TransferChannelID"),
+ tablewriter.Col("TransferStatus"),
+ )
+ }
+ tableColumns = append(tableColumns, tablewriter.NewLineCol("Message"))
+
+ w := tablewriter.New(tableColumns...)
+
+ for _, d := range deals {
+ w.Write(toRetrievalOutput(d, color, verbose))
+ }
+
+ return w.Flush(out)
+}
+
+func toRetrievalOutput(d api.RetrievalInfo, color bool, verbose bool) map[string]interface{} {
+
+ payloadCID := d.PayloadCID.String()
+ provider := d.Provider.String()
+ if !verbose {
+ payloadCID = ellipsis(payloadCID, 8)
+ provider = ellipsis(provider, 8)
+ }
+
+ retrievalOutput := map[string]interface{}{
+ "PayloadCID": payloadCID,
+ "DealId": d.ID,
+ "Provider": provider,
+ "Status": retrievalStatusString(color, d.Status),
+ "PricePerByte": types.FIL(d.PricePerByte),
+ "Received": units.BytesSize(float64(d.BytesReceived)),
+ "TotalPaid": types.FIL(d.TotalPaid),
+ "Message": d.Message,
+ }
+
+ if verbose {
+ transferChannelID := ""
+ if d.TransferChannelID != nil {
+ transferChannelID = d.TransferChannelID.String()
+ }
+ transferStatus := ""
+ if d.DataTransfer != nil {
+ transferStatus = datatransfer.Statuses[d.DataTransfer.Status]
+ }
+ pieceCID := ""
+ if d.PieceCID != nil {
+ pieceCID = d.PieceCID.String()
+ }
+
+ retrievalOutput["PieceCID"] = pieceCID
+ retrievalOutput["UnsealPrice"] = types.FIL(d.UnsealPrice)
+ retrievalOutput["BytesPaidFor"] = units.BytesSize(float64(d.BytesPaidFor))
+ retrievalOutput["TransferChannelID"] = transferChannelID
+ retrievalOutput["TransferStatus"] = transferStatus
+ }
+ return retrievalOutput
+}
+
+func retrievalStatusString(c bool, status retrievalmarket.DealStatus) string {
+ s := retrievalmarket.DealStatuses[status]
+ if !c {
+ return s
+ }
+
+ if isTerminalError(status) {
+ return color.RedString(s)
+ }
+ if retrievalmarket.IsTerminalSuccess(status) {
+ return color.GreenString(s)
+ }
+ return s
+}
+
var clientInspectDealCmd = &cli.Command{
Name: "inspect-deal",
Usage: "Inspect detailed information about deal's lifecycle and the various stages it goes through",
@@ -1295,7 +1514,8 @@ var clientListAsksCmd = &cli.Command{
Usage: "List asks for top miners",
Flags: []cli.Flag{
&cli.BoolFlag{
- Name: "by-ping",
+ Name: "by-ping",
+ Usage: "sort by ping",
},
&cli.StringFlag{
Name: "output-format",
@@ -1348,7 +1568,7 @@ type QueriedAsk struct {
Ping time.Duration
}
-func GetAsks(ctx context.Context, api lapi.FullNode) ([]QueriedAsk, error) {
+func GetAsks(ctx context.Context, api v0api.FullNode) ([]QueriedAsk, error) {
isTTY := true
if fileInfo, _ := os.Stdout.Stat(); (fileInfo.Mode() & os.ModeCharDevice) == 0 {
isTTY = false
@@ -1450,17 +1670,17 @@ loop:
}
rt := time.Now()
-
_, err = api.ClientQueryAsk(ctx, *mi.PeerId, miner)
if err != nil {
return
}
+ pingDuration := time.Now().Sub(rt)
atomic.AddInt64(&got, 1)
lk.Lock()
asks = append(asks, QueriedAsk{
Ask: ask,
- Ping: time.Now().Sub(rt),
+ Ping: pingDuration,
})
lk.Unlock()
}(miner)
@@ -1655,7 +1875,7 @@ var clientListDeals = &cli.Command{
},
}
-func dealFromDealInfo(ctx context.Context, full api.FullNode, head *types.TipSet, v api.DealInfo) deal {
+func dealFromDealInfo(ctx context.Context, full v0api.FullNode, head *types.TipSet, v api.DealInfo) deal {
if v.DealID == 0 {
return deal{
LocalDeal: v,
@@ -1674,7 +1894,7 @@ func dealFromDealInfo(ctx context.Context, full api.FullNode, head *types.TipSet
}
}
-func outputStorageDeals(ctx context.Context, out io.Writer, full lapi.FullNode, localDeals []lapi.DealInfo, verbose bool, color bool, showFailed bool) error {
+func outputStorageDeals(ctx context.Context, out io.Writer, full v0api.FullNode, localDeals []lapi.DealInfo, verbose bool, color bool, showFailed bool) error {
sort.Slice(localDeals, func(i, j int) bool {
return localDeals[i].CreationTime.Before(localDeals[j].CreationTime)
})
@@ -2293,7 +2513,7 @@ func ellipsis(s string, length int) string {
return s
}
-func inspectDealCmd(ctx context.Context, api lapi.FullNode, proposalCid string, dealId int) error {
+func inspectDealCmd(ctx context.Context, api v0api.FullNode, proposalCid string, dealId int) error {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
@@ -2346,7 +2566,7 @@ func renderDeal(di *lapi.DealInfo) {
}
for _, stg := range di.DealStages.Stages {
- msg := fmt.Sprintf("%s %s: %s (%s)", color.BlueString("Stage:"), color.BlueString(strings.TrimPrefix(stg.Name, "StorageDeal")), stg.Description, color.GreenString(stg.ExpectedDuration))
+ msg := fmt.Sprintf("%s %s: %s (expected duration: %s)", color.BlueString("Stage:"), color.BlueString(strings.TrimPrefix(stg.Name, "StorageDeal")), stg.Description, color.GreenString(stg.ExpectedDuration))
if stg.UpdatedTime.Time().IsZero() {
msg = color.YellowString(msg)
}
diff --git a/cli/client_test.go b/cli/client_test.go
deleted file mode 100644
index f0e8efda8..000000000
--- a/cli/client_test.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package cli
-
-import (
- "context"
- "os"
- "testing"
- "time"
-
- clitest "github.com/filecoin-project/lotus/cli/test"
-)
-
-// TestClient does a basic test to exercise the client CLI
-// commands
-func TestClient(t *testing.T) {
- _ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
-
- blocktime := 5 * time.Millisecond
- ctx := context.Background()
- clientNode, _ := clitest.StartOneNodeOneMiner(ctx, t, blocktime)
- clitest.RunClientTest(t, Commands, clientNode)
-}
diff --git a/cli/cmd.go b/cli/cmd.go
index bd7588206..630aae1bc 100644
--- a/cli/cmd.go
+++ b/cli/cmd.go
@@ -34,7 +34,7 @@ func GetFullNodeServices(ctx *cli.Context) (ServicesAPI, error) {
return tn.(ServicesAPI), nil
}
- api, c, err := GetFullNodeAPI(ctx)
+ api, c, err := GetFullNodeAPIV1(ctx)
if err != nil {
return nil, err
}
@@ -50,6 +50,7 @@ var DaemonContext = cliutil.DaemonContext
var ReqContext = cliutil.ReqContext
var GetFullNodeAPI = cliutil.GetFullNodeAPI
+var GetFullNodeAPIV1 = cliutil.GetFullNodeAPIV1
var GetGatewayAPI = cliutil.GetGatewayAPI
var GetStorageMinerAPI = cliutil.GetStorageMinerAPI
@@ -81,6 +82,7 @@ var Commands = []*cli.Command{
WithCategory("developer", FetchParamCmd),
WithCategory("network", NetCmd),
WithCategory("network", SyncCmd),
+ WithCategory("status", StatusCmd),
PprofCmd,
VersionCmd,
}
diff --git a/cli/disputer.go b/cli/disputer.go
index ded240a80..ceebeb939 100644
--- a/cli/disputer.go
+++ b/cli/disputer.go
@@ -22,6 +22,7 @@ import (
logging "github.com/ipfs/go-log/v2"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/chain/store"
"github.com/urfave/cli/v2"
)
@@ -237,6 +238,9 @@ var disputerStartCmd = &cli.Command{
dpmsgs := make([]*types.Message, 0)
+ startTime := time.Now()
+ proofsChecked := uint64(0)
+
// TODO: Parallelizeable
for _, dl := range dls {
fullDeadlines, err := api.StateMinerDeadlines(ctx, dl.miner, tsk)
@@ -248,7 +252,10 @@ var disputerStartCmd = &cli.Command{
return xerrors.Errorf("deadline index %d not found in deadlines", dl.index)
}
- ms, err := makeDisputeWindowedPosts(ctx, api, dl, fullDeadlines[dl.index].DisputableProofCount, fromAddr)
+ disputableProofs := fullDeadlines[dl.index].DisputableProofCount
+ proofsChecked += disputableProofs
+
+ ms, err := makeDisputeWindowedPosts(ctx, api, dl, disputableProofs, fromAddr)
if err != nil {
return xerrors.Errorf("failed to check for disputes: %w", err)
}
@@ -263,6 +270,8 @@ var disputerStartCmd = &cli.Command{
deadlineMap[dClose+Confidence] = append(deadlineMap[dClose+Confidence], *dl)
}
+ disputeLog.Infow("checked proofs", "count", proofsChecked, "duration", time.Since(startTime))
+
// TODO: Parallelizeable / can be integrated into the previous deadline-iterating for loop
for _, dpmsg := range dpmsgs {
disputeLog.Infow("disputing a PoSt", "miner", dpmsg.To)
@@ -356,7 +365,7 @@ var disputerStartCmd = &cli.Command{
// for a given miner, index, and maxPostIndex, tries to dispute posts from 0...postsSnapshotted-1
// returns a list of DisputeWindowedPoSt msgs that are expected to succeed if sent
-func makeDisputeWindowedPosts(ctx context.Context, api lapi.FullNode, dl minerDeadline, postsSnapshotted uint64, sender address.Address) ([]*types.Message, error) {
+func makeDisputeWindowedPosts(ctx context.Context, api v0api.FullNode, dl minerDeadline, postsSnapshotted uint64, sender address.Address) ([]*types.Message, error) {
disputes := make([]*types.Message, 0)
for i := uint64(0); i < postsSnapshotted; i++ {
@@ -388,7 +397,7 @@ func makeDisputeWindowedPosts(ctx context.Context, api lapi.FullNode, dl minerDe
return disputes, nil
}
-func makeMinerDeadline(ctx context.Context, api lapi.FullNode, mAddr address.Address) (abi.ChainEpoch, *minerDeadline, error) {
+func makeMinerDeadline(ctx context.Context, api v0api.FullNode, mAddr address.Address) (abi.ChainEpoch, *minerDeadline, error) {
dl, err := api.StateMinerProvingDeadline(ctx, mAddr, types.EmptyTSK)
if err != nil {
return -1, nil, xerrors.Errorf("getting proving index list: %w", err)
@@ -400,7 +409,7 @@ func makeMinerDeadline(ctx context.Context, api lapi.FullNode, mAddr address.Add
}, nil
}
-func getSender(ctx context.Context, api lapi.FullNode, fromStr string) (address.Address, error) {
+func getSender(ctx context.Context, api v0api.FullNode, fromStr string) (address.Address, error) {
if fromStr == "" {
return api.WalletDefaultAddress(ctx)
}
diff --git a/cli/filplus.go b/cli/filplus.go
index b98ac4ab8..53dc5092b 100644
--- a/cli/filplus.go
+++ b/cli/filplus.go
@@ -4,8 +4,6 @@ import (
"context"
"fmt"
- "github.com/filecoin-project/lotus/api"
-
verifreg4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/verifreg"
"github.com/filecoin-project/go-state-types/big"
@@ -16,6 +14,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
@@ -254,7 +253,7 @@ var filplusCheckNotaryCmd = &cli.Command{
},
}
-func checkNotary(ctx context.Context, api api.FullNode, vaddr address.Address) (bool, abi.StoragePower, error) {
+func checkNotary(ctx context.Context, api v0api.FullNode, vaddr address.Address) (bool, abi.StoragePower, error) {
vid, err := api.StateLookupID(ctx, vaddr, types.EmptyTSK)
if err != nil {
return false, big.Zero(), err
diff --git a/cli/init_test.go b/cli/init_test.go
new file mode 100644
index 000000000..8c343bcfa
--- /dev/null
+++ b/cli/init_test.go
@@ -0,0 +1,9 @@
+package cli
+
+import (
+ logging "github.com/ipfs/go-log/v2"
+)
+
+func init() {
+ logging.SetLogLevel("watchdog", "ERROR")
+}
diff --git a/cli/mpool.go b/cli/mpool.go
index 025a2fc3f..b128ccc15 100644
--- a/cli/mpool.go
+++ b/cli/mpool.go
@@ -34,6 +34,7 @@ var MpoolCmd = &cli.Command{
MpoolFindCmd,
MpoolConfig,
MpoolGasPerfCmd,
+ mpoolManage,
},
}
diff --git a/cli/mpool_manage.go b/cli/mpool_manage.go
new file mode 100644
index 000000000..164a05842
--- /dev/null
+++ b/cli/mpool_manage.go
@@ -0,0 +1,360 @@
+package cli
+
+import (
+ "context"
+ "fmt"
+ "sort"
+
+ "github.com/Kubuxu/imtui"
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/chain/actors/builtin"
+ "github.com/filecoin-project/lotus/chain/messagepool"
+ types "github.com/filecoin-project/lotus/chain/types"
+ "github.com/gdamore/tcell/v2"
+ cid "github.com/ipfs/go-cid"
+ "github.com/urfave/cli/v2"
+ "golang.org/x/xerrors"
+)
+
+var mpoolManage = &cli.Command{
+ Name: "manage",
+ Action: func(cctx *cli.Context) error {
+ srv, err := GetFullNodeServices(cctx)
+ if err != nil {
+ return err
+ }
+ defer srv.Close() //nolint:errcheck
+
+ ctx := ReqContext(cctx)
+
+ _, localAddr, err := srv.LocalAddresses(ctx)
+ if err != nil {
+ return xerrors.Errorf("getting local addresses: %w", err)
+ }
+
+ msgs, err := srv.MpoolPendingFilter(ctx, func(sm *types.SignedMessage) bool {
+ if sm.Message.From.Empty() {
+ return false
+ }
+ for _, a := range localAddr {
+ if a == sm.Message.From {
+ return true
+ }
+ }
+ return false
+ }, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ t, err := imtui.NewTui()
+ if err != nil {
+ panic(err)
+ }
+
+ mm := &mmUI{
+ ctx: ctx,
+ srv: srv,
+ addrs: localAddr,
+ messages: msgs,
+ }
+ sort.Slice(mm.addrs, func(i, j int) bool {
+ return mm.addrs[i].String() < mm.addrs[j].String()
+ })
+ t.PushScene(mm.addrSelect())
+
+ err = t.Run()
+
+ if err != nil {
+ panic(err)
+ }
+
+ return nil
+ },
+}
+
+type mmUI struct {
+ ctx context.Context
+ srv ServicesAPI
+ addrs []address.Address
+ messages []*types.SignedMessage
+}
+
+func (mm *mmUI) addrSelect() func(*imtui.Tui) error {
+ rows := [][]string{{"Address", "No. Messages"}}
+ mCount := map[address.Address]int{}
+ for _, sm := range mm.messages {
+ mCount[sm.Message.From]++
+ }
+ for _, a := range mm.addrs {
+ rows = append(rows, []string{a.String(), fmt.Sprintf("%d", mCount[a])})
+ }
+
+ flex := []int{4, 1}
+ sel := 0
+ scroll := 0
+ return func(t *imtui.Tui) error {
+ if t.CurrentKey != nil && t.CurrentKey.Key() == tcell.KeyEnter {
+ if sel > 0 {
+ t.ReplaceScene(mm.messageLising(mm.addrs[sel-1]))
+ }
+ }
+ t.FlexTable(0, 0, 0, &sel, &scroll, rows, flex, true)
+ return nil
+ }
+}
+
+func errUI(err error) func(*imtui.Tui) error {
+ return func(t *imtui.Tui) error {
+ return err
+ }
+}
+
+type msgInfo struct {
+ sm *types.SignedMessage
+ checks []api.MessageCheckStatus
+}
+
+func (mi *msgInfo) Row() []string {
+ cidStr := mi.sm.Cid().String()
+ failedChecks := 0
+ for _, c := range mi.checks {
+ if !c.OK {
+ failedChecks++
+ }
+ }
+ shortAddr := mi.sm.Message.To.String()
+ if len(shortAddr) > 16 {
+ shortAddr = "âĻ" + shortAddr[len(shortAddr)-16:]
+ }
+ var fCk string
+ if failedChecks == 0 {
+ fCk = "[:green:]OK"
+ } else {
+ fCk = "[:orange:]" + fmt.Sprintf("%d", failedChecks)
+ }
+ return []string{"âĻ" + cidStr[len(cidStr)-32:], shortAddr,
+ fmt.Sprintf("%d", mi.sm.Message.Nonce), types.FIL(mi.sm.Message.Value).String(),
+ fmt.Sprintf("%d", mi.sm.Message.Method), fCk}
+
+}
+
+func (mm *mmUI) messageLising(a address.Address) func(*imtui.Tui) error {
+ genMsgInfos := func() ([]msgInfo, error) {
+ msgs, err := mm.srv.MpoolPendingFilter(mm.ctx, func(sm *types.SignedMessage) bool {
+ if sm.Message.From.Empty() {
+ return false
+ }
+ if a == sm.Message.From {
+ return true
+ }
+ return false
+ }, types.EmptyTSK)
+
+ if err != nil {
+ return nil, xerrors.Errorf("getting pending: %w", err)
+ }
+
+ msgIdx := map[cid.Cid]*types.SignedMessage{}
+ for _, sm := range msgs {
+ if sm.Message.From == a {
+ msgIdx[sm.Message.Cid()] = sm
+ msgIdx[sm.Cid()] = sm
+ }
+ }
+
+ checks, err := mm.srv.MpoolCheckPendingMessages(mm.ctx, a)
+ if err != nil {
+ return nil, xerrors.Errorf("checking pending: %w", err)
+ }
+ msgInfos := make([]msgInfo, 0, len(checks))
+ for _, msgChecks := range checks {
+ failingChecks := []api.MessageCheckStatus{}
+ for _, c := range msgChecks {
+ if !c.OK {
+ failingChecks = append(failingChecks, c)
+ }
+ }
+ msgInfos = append(msgInfos, msgInfo{
+ sm: msgIdx[msgChecks[0].Cid],
+ checks: failingChecks,
+ })
+ }
+ return msgInfos, nil
+ }
+
+ sel := 0
+ scroll := 0
+
+ var msgInfos []msgInfo
+ var rows [][]string
+ flex := []int{3, 2, 1, 1, 1, 1}
+ refresh := true
+
+ return func(t *imtui.Tui) error {
+ if refresh {
+ var err error
+ msgInfos, err = genMsgInfos()
+ if err != nil {
+ return xerrors.Errorf("getting msgInfos: %w", err)
+ }
+
+ rows = [][]string{{"Message Cid", "To", "Nonce", "Value", "Method", "Checks"}}
+ for _, mi := range msgInfos {
+ rows = append(rows, mi.Row())
+ }
+ refresh = false
+ }
+
+ if t.CurrentKey != nil && t.CurrentKey.Key() == tcell.KeyEnter {
+ if sel > 0 {
+ t.PushScene(mm.messageDetail(msgInfos[sel-1]))
+ refresh = true
+ return nil
+ }
+ }
+
+ t.Label(0, 0, fmt.Sprintf("Address: %s", a), tcell.StyleDefault)
+ t.FlexTable(1, 0, 0, &sel, &scroll, rows, flex, true)
+ return nil
+ }
+}
+
+func (mm *mmUI) messageDetail(mi msgInfo) func(*imtui.Tui) error {
+ baseFee, err := mm.srv.GetBaseFee(mm.ctx)
+ if err != nil {
+ return errUI(err)
+ }
+ _ = baseFee
+
+ m := mi.sm.Message
+ maxFee := big.Mul(m.GasFeeCap, big.NewInt(m.GasLimit))
+
+ issues := [][]string{}
+ for _, c := range mi.checks {
+ issues = append(issues, []string{c.Code.String(), c.Err})
+ }
+ issuesFlex := []int{1, 3}
+ var sel, scroll int
+
+ executeReprice := false
+ executeNoop := false
+ return func(t *imtui.Tui) error {
+ if executeReprice {
+ m.GasFeeCap = big.Div(maxFee, big.NewInt(m.GasLimit))
+ m.GasPremium = messagepool.ComputeMinRBF(m.GasPremium)
+ m.GasFeeCap = big.Max(m.GasFeeCap, m.GasPremium)
+
+ _, _, err := mm.srv.PublishMessage(mm.ctx, &api.MessagePrototype{
+ Message: m,
+ ValidNonce: true,
+ }, true)
+ if err != nil {
+ return err
+ }
+ t.PopScene()
+ return nil
+ }
+ if executeNoop {
+ nop := types.Message{
+ To: builtin.BurntFundsActorAddr,
+ From: m.From,
+
+ Nonce: m.Nonce,
+ Value: big.Zero(),
+ }
+
+ nop.GasPremium = messagepool.ComputeMinRBF(m.GasPremium)
+
+ _, _, err := mm.srv.PublishMessage(mm.ctx, &api.MessagePrototype{
+ Message: nop,
+ ValidNonce: true,
+ }, true)
+
+ if err != nil {
+ return xerrors.Errorf("publishing noop message: %w", err)
+ }
+
+ t.PopScene()
+ return nil
+ }
+
+ if t.CurrentKey != nil {
+ if t.CurrentKey.Key() == tcell.KeyLeft {
+ t.PopScene()
+ return nil
+ }
+ if t.CurrentKey.Key() == tcell.KeyRune {
+ switch t.CurrentKey.Rune() {
+ case 'R', 'r':
+ t.PushScene(feeUI(baseFee, m.GasLimit, &maxFee, &executeReprice))
+ return nil
+ case 'N', 'n':
+ t.PushScene(confirmationScene(
+ &executeNoop,
+ "Are you sure you want to cancel the message by",
+ "replacing it with a message with no effects?"))
+ return nil
+ }
+ }
+ }
+
+ row := 0
+ defS := tcell.StyleDefault
+ display := func(f string, args ...interface{}) {
+ t.Label(0, row, fmt.Sprintf(f, args...), defS)
+ row++
+ }
+
+ display("Message CID: %s", m.Cid())
+ display("Signed Message CID: %s", mi.sm.Cid())
+ row++
+ display("From: %s", m.From)
+ display("To: %s", m.To)
+ row++
+ display("Nonce: %d", m.Nonce)
+ display("Value: %s", types.FIL(m.Value))
+ row++
+ display("GasLimit: %d", m.GasLimit)
+ display("GasPremium: %s", types.FIL(m.GasPremium).Short())
+ display("GasFeeCap %s", types.FIL(m.GasFeeCap).Short())
+ row++
+ display("Press R to reprice this message")
+ display("Press N to replace this message with no-operation message")
+ row++
+
+ t.FlexTable(row, 0, 0, &sel, &scroll, issues, issuesFlex, false)
+
+ return nil
+ }
+}
+
+func confirmationScene(yes *bool, ask ...string) func(*imtui.Tui) error {
+ return func(t *imtui.Tui) error {
+ row := 0
+ defS := tcell.StyleDefault
+ display := func(f string, args ...interface{}) {
+ t.Label(0, row, fmt.Sprintf(f, args...), defS)
+ row++
+ }
+
+ for _, a := range ask {
+ display(a)
+ }
+ row++
+ display("Enter to confirm")
+ display("Esc to cancel")
+
+ if t.CurrentKey != nil {
+ if t.CurrentKey.Key() == tcell.KeyEnter {
+ *yes = true
+ t.PopScene()
+ return nil
+ }
+ }
+
+ return nil
+ }
+}
diff --git a/cli/multisig.go b/cli/multisig.go
index f6caa6ee0..9ddfcdfc1 100644
--- a/cli/multisig.go
+++ b/cli/multisig.go
@@ -95,11 +95,13 @@ var msigCreateCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("multisigs must have at least one signer"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
var addrs []address.Address
@@ -146,13 +148,20 @@ var msigCreateCmd = &cli.Command{
gp := types.NewInt(1)
- msgCid, err := api.MsigCreate(ctx, required, addrs, d, intVal, sendAddr, gp)
+ proto, err := api.MsigCreate(ctx, required, addrs, d, intVal, sendAddr, gp)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
// wait for it to get mined into a block
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -364,11 +373,13 @@ var msigProposeCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must either pass three or five arguments"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -426,14 +437,21 @@ var msigProposeCmd = &cli.Command{
return fmt.Errorf("actor %s is not a multisig actor", msig)
}
- msgCid, err := api.MsigPropose(ctx, msig, dest, types.BigInt(value), from, method, params)
+ proto, err := api.MsigPropose(ctx, msig, dest, types.BigInt(value), from, method, params)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("send proposal in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -481,11 +499,13 @@ var msigApproveCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("usage: msig approve [ ]"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -515,10 +535,17 @@ var msigApproveCmd = &cli.Command{
var msgCid cid.Cid
if cctx.Args().Len() == 2 {
- msgCid, err = api.MsigApprove(ctx, msig, txid, from)
+ proto, err := api.MsigApprove(ctx, msig, txid, from)
if err != nil {
return err
}
+
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid = sm.Cid()
} else {
proposer, err := address.NewFromString(cctx.Args().Get(2))
if err != nil {
@@ -558,15 +585,22 @@ var msigApproveCmd = &cli.Command{
params = p
}
- msgCid, err = api.MsigApproveTxnHash(ctx, msig, txid, proposer, dest, types.BigInt(value), from, method, params)
+ proto, err := api.MsigApproveTxnHash(ctx, msig, txid, proposer, dest, types.BigInt(value), from, method, params)
if err != nil {
return err
}
+
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid = sm.Cid()
}
fmt.Println("sent approval in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -598,11 +632,13 @@ var msigRemoveProposeCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address and signer address"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -630,14 +666,21 @@ var msigRemoveProposeCmd = &cli.Command{
from = defaddr
}
- msgCid, err := api.MsigRemoveSigner(ctx, msig, from, addr, cctx.Bool("decrease-threshold"))
+ proto, err := api.MsigRemoveSigner(ctx, msig, from, addr, cctx.Bool("decrease-threshold"))
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent remove proposal in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -676,11 +719,13 @@ var msigAddProposeCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address and signer address"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -708,14 +753,21 @@ var msigAddProposeCmd = &cli.Command{
from = defaddr
}
- msgCid, err := api.MsigAddPropose(ctx, msig, from, addr, cctx.Bool("increase-threshold"))
+ proto, err := api.MsigAddPropose(ctx, msig, from, addr, cctx.Bool("increase-threshold"))
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Fprintln(cctx.App.Writer, "sent add proposal in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -743,11 +795,13 @@ var msigAddApproveCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address, proposer address, transaction id, new signer address, whether to increase threshold"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -790,14 +844,21 @@ var msigAddApproveCmd = &cli.Command{
from = defaddr
}
- msgCid, err := api.MsigAddApprove(ctx, msig, from, txid, prop, newAdd, inc)
+ proto, err := api.MsigAddApprove(ctx, msig, from, txid, prop, newAdd, inc)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent add approval in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -825,11 +886,13 @@ var msigAddCancelCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address, transaction id, new signer address, whether to increase threshold"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -867,14 +930,21 @@ var msigAddCancelCmd = &cli.Command{
from = defaddr
}
- msgCid, err := api.MsigAddCancel(ctx, msig, from, txid, newAdd, inc)
+ proto, err := api.MsigAddCancel(ctx, msig, from, txid, newAdd, inc)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent add cancellation in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -902,11 +972,13 @@ var msigSwapProposeCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address, old signer address, new signer address"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -939,14 +1011,21 @@ var msigSwapProposeCmd = &cli.Command{
from = defaddr
}
- msgCid, err := api.MsigSwapPropose(ctx, msig, from, oldAdd, newAdd)
+ proto, err := api.MsigSwapPropose(ctx, msig, from, oldAdd, newAdd)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent swap proposal in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -974,11 +1053,13 @@ var msigSwapApproveCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address, proposer address, transaction id, old signer address, new signer address"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -1021,14 +1102,21 @@ var msigSwapApproveCmd = &cli.Command{
from = defaddr
}
- msgCid, err := api.MsigSwapApprove(ctx, msig, from, txid, prop, oldAdd, newAdd)
+ proto, err := api.MsigSwapApprove(ctx, msig, from, txid, prop, oldAdd, newAdd)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent swap approval in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -1056,11 +1144,13 @@ var msigSwapCancelCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address, transaction id, old signer address, new signer address"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -1098,14 +1188,21 @@ var msigSwapCancelCmd = &cli.Command{
from = defaddr
}
- msgCid, err := api.MsigSwapCancel(ctx, msig, from, txid, oldAdd, newAdd)
+ proto, err := api.MsigSwapCancel(ctx, msig, from, txid, oldAdd, newAdd)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent swap cancellation in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -1133,11 +1230,13 @@ var msigLockProposeCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address, start epoch, unlock duration, and amount"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -1185,14 +1284,21 @@ var msigLockProposeCmd = &cli.Command{
return actErr
}
- msgCid, err := api.MsigPropose(ctx, msig, msig, big.Zero(), from, uint64(multisig.Methods.LockBalance), params)
+ proto, err := api.MsigPropose(ctx, msig, msig, big.Zero(), from, uint64(multisig.Methods.LockBalance), params)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent lock proposal in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -1220,11 +1326,13 @@ var msigLockApproveCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address, proposer address, tx id, start epoch, unlock duration, and amount"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -1282,14 +1390,21 @@ var msigLockApproveCmd = &cli.Command{
return actErr
}
- msgCid, err := api.MsigApproveTxnHash(ctx, msig, txid, prop, msig, big.Zero(), from, uint64(multisig.Methods.LockBalance), params)
+ proto, err := api.MsigApproveTxnHash(ctx, msig, txid, prop, msig, big.Zero(), from, uint64(multisig.Methods.LockBalance), params)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent lock approval in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -1317,11 +1432,13 @@ var msigLockCancelCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address, tx id, start epoch, unlock duration, and amount"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -1374,14 +1491,21 @@ var msigLockCancelCmd = &cli.Command{
return actErr
}
- msgCid, err := api.MsigCancel(ctx, msig, txid, msig, big.Zero(), from, uint64(multisig.Methods.LockBalance), params)
+ proto, err := api.MsigCancel(ctx, msig, txid, msig, big.Zero(), from, uint64(multisig.Methods.LockBalance), params)
if err != nil {
return err
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent lock cancellation in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
@@ -1471,11 +1595,13 @@ var msigProposeThresholdCmd = &cli.Command{
return ShowHelp(cctx, fmt.Errorf("must pass multisig address and new threshold value"))
}
- api, closer, err := GetFullNodeAPI(cctx)
+ srv, err := GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := ReqContext(cctx)
msig, err := address.NewFromString(cctx.Args().Get(0))
@@ -1511,14 +1637,21 @@ var msigProposeThresholdCmd = &cli.Command{
return actErr
}
- msgCid, err := api.MsigPropose(ctx, msig, msig, types.NewInt(0), from, uint64(multisig.Methods.ChangeNumApprovalsThreshold), params)
+ proto, err := api.MsigPropose(ctx, msig, msig, types.NewInt(0), from, uint64(multisig.Methods.ChangeNumApprovalsThreshold), params)
if err != nil {
return fmt.Errorf("failed to propose change of threshold: %w", err)
}
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ msgCid := sm.Cid()
+
fmt.Println("sent change threshold proposal in message: ", msgCid)
- wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")))
+ wait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
diff --git a/cli/multisig_test.go b/cli/multisig_test.go
deleted file mode 100644
index 82472cd62..000000000
--- a/cli/multisig_test.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package cli
-
-import (
- "context"
- "os"
- "testing"
- "time"
-
- clitest "github.com/filecoin-project/lotus/cli/test"
-)
-
-// TestMultisig does a basic test to exercise the multisig CLI
-// commands
-func TestMultisig(t *testing.T) {
- _ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
-
- blocktime := 5 * time.Millisecond
- ctx := context.Background()
- clientNode, _ := clitest.StartOneNodeOneMiner(ctx, t, blocktime)
- clitest.RunMultisigTest(t, Commands, clientNode)
-}
diff --git a/cli/send.go b/cli/send.go
index daf73ccad..a5200d3b8 100644
--- a/cli/send.go
+++ b/cli/send.go
@@ -2,7 +2,6 @@ package cli
import (
"encoding/hex"
- "errors"
"fmt"
"github.com/urfave/cli/v2"
@@ -59,10 +58,14 @@ var sendCmd = &cli.Command{
},
&cli.BoolFlag{
Name: "force",
- Usage: "must be specified for the action to take effect if maybe SysErrInsufficientFunds etc",
+ Usage: "Deprecated: use global 'force-send'",
},
},
Action: func(cctx *cli.Context) error {
+ if cctx.IsSet("force") {
+ fmt.Println("'force' flag is deprecated, use global flag 'force-send'")
+ }
+
if cctx.Args().Len() != 2 {
return ShowHelp(cctx, fmt.Errorf("'send' expects two arguments, target and amount"))
}
@@ -137,23 +140,22 @@ var sendCmd = &cli.Command{
params.Params = decparams
}
- params.Force = cctx.Bool("force")
-
if cctx.IsSet("nonce") {
n := cctx.Uint64("nonce")
params.Nonce = &n
}
- msgCid, err := srv.Send(ctx, params)
-
+ proto, err := srv.MessageForSend(ctx, params)
if err != nil {
- if errors.Is(err, ErrSendBalanceTooLow) {
- return fmt.Errorf("--force must be specified for this action to have an effect; you have been warned: %w", err)
- }
- return xerrors.Errorf("executing send: %w", err)
+ return xerrors.Errorf("creating message prototype: %w", err)
}
- fmt.Fprintf(cctx.App.Writer, "%s\n", msgCid)
+ sm, err := InteractiveSend(ctx, cctx, srv, proto)
+ if err != nil {
+ return err
+ }
+
+ fmt.Fprintf(cctx.App.Writer, "%s\n", sm.Cid())
return nil
},
}
diff --git a/cli/send_test.go b/cli/send_test.go
index ff258346a..52eafda67 100644
--- a/cli/send_test.go
+++ b/cli/send_test.go
@@ -2,24 +2,17 @@ package cli
import (
"bytes"
- "errors"
"testing"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/api"
types "github.com/filecoin-project/lotus/chain/types"
gomock "github.com/golang/mock/gomock"
- cid "github.com/ipfs/go-cid"
"github.com/stretchr/testify/assert"
ucli "github.com/urfave/cli/v2"
)
-var arbtCid = (&types.Message{
- From: mustAddr(address.NewIDAddress(2)),
- To: mustAddr(address.NewIDAddress(1)),
- Value: types.NewInt(1000),
-}).Cid()
-
func mustAddr(a address.Address, err error) address.Address {
if err != nil {
panic(err)
@@ -49,80 +42,26 @@ func TestSendCLI(t *testing.T) {
app, mockSrvcs, buf, done := newMockApp(t, sendCmd)
defer done()
- gomock.InOrder(
- mockSrvcs.EXPECT().Send(gomock.Any(), SendParams{
- To: mustAddr(address.NewIDAddress(1)),
- Val: oneFil,
- }).Return(arbtCid, nil),
- mockSrvcs.EXPECT().Close(),
- )
- err := app.Run([]string{"lotus", "send", "t01", "1"})
- assert.NoError(t, err)
- assert.EqualValues(t, arbtCid.String()+"\n", buf.String())
- })
- t.Run("ErrSendBalanceTooLow", func(t *testing.T) {
- app, mockSrvcs, _, done := newMockApp(t, sendCmd)
- defer done()
-
- gomock.InOrder(
- mockSrvcs.EXPECT().Send(gomock.Any(), SendParams{
- To: mustAddr(address.NewIDAddress(1)),
- Val: oneFil,
- }).Return(cid.Undef, ErrSendBalanceTooLow),
- mockSrvcs.EXPECT().Close(),
- )
- err := app.Run([]string{"lotus", "send", "t01", "1"})
- assert.ErrorIs(t, err, ErrSendBalanceTooLow)
- })
- t.Run("generic-err-is-forwarded", func(t *testing.T) {
- app, mockSrvcs, _, done := newMockApp(t, sendCmd)
- defer done()
-
- errMark := errors.New("something")
- gomock.InOrder(
- mockSrvcs.EXPECT().Send(gomock.Any(), SendParams{
- To: mustAddr(address.NewIDAddress(1)),
- Val: oneFil,
- }).Return(cid.Undef, errMark),
- mockSrvcs.EXPECT().Close(),
- )
- err := app.Run([]string{"lotus", "send", "t01", "1"})
- assert.ErrorIs(t, err, errMark)
- })
-
- t.Run("from-specific", func(t *testing.T) {
- app, mockSrvcs, buf, done := newMockApp(t, sendCmd)
- defer done()
-
- gomock.InOrder(
- mockSrvcs.EXPECT().Send(gomock.Any(), SendParams{
- To: mustAddr(address.NewIDAddress(1)),
- From: mustAddr(address.NewIDAddress(2)),
- Val: oneFil,
- }).Return(arbtCid, nil),
- mockSrvcs.EXPECT().Close(),
- )
- err := app.Run([]string{"lotus", "send", "--from=t02", "t01", "1"})
- assert.NoError(t, err)
- assert.EqualValues(t, arbtCid.String()+"\n", buf.String())
- })
-
- t.Run("nonce-specific", func(t *testing.T) {
- app, mockSrvcs, buf, done := newMockApp(t, sendCmd)
- defer done()
- zero := uint64(0)
-
- gomock.InOrder(
- mockSrvcs.EXPECT().Send(gomock.Any(), SendParams{
+ arbtProto := &api.MessagePrototype{
+ Message: types.Message{
+ From: mustAddr(address.NewIDAddress(1)),
To: mustAddr(address.NewIDAddress(1)),
- Nonce: &zero,
- Val: oneFil,
- }).Return(arbtCid, nil),
+ Value: oneFil,
+ },
+ }
+ sigMsg := fakeSign(&arbtProto.Message)
+
+ gomock.InOrder(
+ mockSrvcs.EXPECT().MessageForSend(gomock.Any(), SendParams{
+ To: mustAddr(address.NewIDAddress(1)),
+ Val: oneFil,
+ }).Return(arbtProto, nil),
+ mockSrvcs.EXPECT().PublishMessage(gomock.Any(), arbtProto, false).
+ Return(sigMsg, nil, nil),
mockSrvcs.EXPECT().Close(),
)
- err := app.Run([]string{"lotus", "send", "--nonce=0", "t01", "1"})
+ err := app.Run([]string{"lotus", "send", "t01", "1"})
assert.NoError(t, err)
- assert.EqualValues(t, arbtCid.String()+"\n", buf.String())
+ assert.EqualValues(t, sigMsg.Cid().String()+"\n", buf.String())
})
-
}
diff --git a/cli/sending_ui.go b/cli/sending_ui.go
new file mode 100644
index 000000000..a70abefb9
--- /dev/null
+++ b/cli/sending_ui.go
@@ -0,0 +1,264 @@
+package cli
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "strings"
+
+ "github.com/Kubuxu/imtui"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ types "github.com/filecoin-project/lotus/chain/types"
+ "github.com/gdamore/tcell/v2"
+ cid "github.com/ipfs/go-cid"
+ "github.com/urfave/cli/v2"
+ "golang.org/x/xerrors"
+)
+
+func InteractiveSend(ctx context.Context, cctx *cli.Context, srv ServicesAPI,
+ proto *api.MessagePrototype) (*types.SignedMessage, error) {
+
+ msg, checks, err := srv.PublishMessage(ctx, proto, cctx.Bool("force") || cctx.Bool("force-send"))
+ printer := cctx.App.Writer
+ if xerrors.Is(err, ErrCheckFailed) {
+ if !cctx.Bool("interactive") {
+ fmt.Fprintf(printer, "Following checks have failed:\n")
+ printChecks(printer, checks, proto.Message.Cid())
+ } else {
+ proto, err = resolveChecks(ctx, srv, cctx.App.Writer, proto, checks)
+ if err != nil {
+ return nil, xerrors.Errorf("from UI: %w", err)
+ }
+
+ msg, _, err = srv.PublishMessage(ctx, proto, true)
+ }
+ }
+ if err != nil {
+ return nil, xerrors.Errorf("publishing message: %w", err)
+ }
+
+ return msg, nil
+}
+
+var interactiveSolves = map[api.CheckStatusCode]bool{
+ api.CheckStatusMessageMinBaseFee: true,
+ api.CheckStatusMessageBaseFee: true,
+ api.CheckStatusMessageBaseFeeLowerBound: true,
+ api.CheckStatusMessageBaseFeeUpperBound: true,
+}
+
+func baseFeeFromHints(hint map[string]interface{}) big.Int {
+ bHint, ok := hint["baseFee"]
+ if !ok {
+ return big.Zero()
+ }
+ bHintS, ok := bHint.(string)
+ if !ok {
+ return big.Zero()
+ }
+
+ var err error
+ baseFee, err := big.FromString(bHintS)
+ if err != nil {
+ return big.Zero()
+ }
+ return baseFee
+}
+
+func resolveChecks(ctx context.Context, s ServicesAPI, printer io.Writer,
+ proto *api.MessagePrototype, checkGroups [][]api.MessageCheckStatus,
+) (*api.MessagePrototype, error) {
+
+ fmt.Fprintf(printer, "Following checks have failed:\n")
+ printChecks(printer, checkGroups, proto.Message.Cid())
+
+ if feeCapBad, baseFee := isFeeCapProblem(checkGroups, proto.Message.Cid()); feeCapBad {
+ fmt.Fprintf(printer, "Fee of the message can be adjusted\n")
+ if askUser(printer, "Do you wish to do that? [Yes/no]: ", true) {
+ var err error
+ proto, err = runFeeCapAdjustmentUI(proto, baseFee)
+ if err != nil {
+ return nil, err
+ }
+ }
+ checks, err := s.RunChecksForPrototype(ctx, proto)
+ if err != nil {
+ return nil, err
+ }
+ fmt.Fprintf(printer, "Following checks still failed:\n")
+ printChecks(printer, checks, proto.Message.Cid())
+ }
+
+ if !askUser(printer, "Do you wish to send this message? [yes/No]: ", false) {
+ return nil, ErrAbortedByUser
+ }
+ return proto, nil
+}
+
+var ErrAbortedByUser = errors.New("aborted by user")
+
+func printChecks(printer io.Writer, checkGroups [][]api.MessageCheckStatus, protoCid cid.Cid) {
+ for _, checks := range checkGroups {
+ for _, c := range checks {
+ if c.OK {
+ continue
+ }
+ aboutProto := c.Cid.Equals(protoCid)
+ msgName := "current"
+ if !aboutProto {
+ msgName = c.Cid.String()
+ }
+ fmt.Fprintf(printer, "%s message failed a check %s: %s\n", msgName, c.Code, c.Err)
+ }
+ }
+}
+
+func askUser(printer io.Writer, q string, def bool) bool {
+ var resp string
+ fmt.Fprint(printer, q)
+ fmt.Scanln(&resp)
+ resp = strings.ToLower(resp)
+ if len(resp) == 0 {
+ return def
+ }
+ return resp[0] == 'y'
+}
+
+func isFeeCapProblem(checkGroups [][]api.MessageCheckStatus, protoCid cid.Cid) (bool, big.Int) {
+ baseFee := big.Zero()
+ yes := false
+ for _, checks := range checkGroups {
+ for _, c := range checks {
+ if c.OK {
+ continue
+ }
+ aboutProto := c.Cid.Equals(protoCid)
+ if aboutProto && interactiveSolves[c.Code] {
+ yes = true
+ if baseFee.IsZero() {
+ baseFee = baseFeeFromHints(c.Hint)
+ }
+ }
+ }
+ }
+ if baseFee.IsZero() {
+ // this will only be the case if failing check is: MessageMinBaseFee
+ baseFee = big.NewInt(build.MinimumBaseFee)
+ }
+
+ return yes, baseFee
+}
+
+func runFeeCapAdjustmentUI(proto *api.MessagePrototype, baseFee abi.TokenAmount) (*api.MessagePrototype, error) {
+ t, err := imtui.NewTui()
+ if err != nil {
+ return nil, err
+ }
+
+ maxFee := big.Mul(proto.Message.GasFeeCap, big.NewInt(proto.Message.GasLimit))
+ send := false
+ t.PushScene(feeUI(baseFee, proto.Message.GasLimit, &maxFee, &send))
+
+ err = t.Run()
+ if err != nil {
+ return nil, err
+ }
+ if !send {
+ return nil, fmt.Errorf("aborted by user")
+ }
+
+ proto.Message.GasFeeCap = big.Div(maxFee, big.NewInt(proto.Message.GasLimit))
+
+ return proto, nil
+}
+
+func feeUI(baseFee abi.TokenAmount, gasLimit int64, maxFee *abi.TokenAmount, send *bool) func(*imtui.Tui) error {
+ orignalMaxFee := *maxFee
+ required := big.Mul(baseFee, big.NewInt(gasLimit))
+ safe := big.Mul(required, big.NewInt(10))
+
+ price := fmt.Sprintf("%s", types.FIL(*maxFee).Unitless())
+
+ return func(t *imtui.Tui) error {
+ if t.CurrentKey != nil {
+ if t.CurrentKey.Key() == tcell.KeyRune {
+ pF, err := types.ParseFIL(price)
+ switch t.CurrentKey.Rune() {
+ case 's', 'S':
+ price = types.FIL(safe).Unitless()
+ case '+':
+ if err == nil {
+ p := big.Mul(big.Int(pF), types.NewInt(11))
+ p = big.Div(p, types.NewInt(10))
+ price = fmt.Sprintf("%s", types.FIL(p).Unitless())
+ }
+ case '-':
+ if err == nil {
+ p := big.Mul(big.Int(pF), types.NewInt(10))
+ p = big.Div(p, types.NewInt(11))
+ price = fmt.Sprintf("%s", types.FIL(p).Unitless())
+ }
+ default:
+ }
+ }
+
+ if t.CurrentKey.Key() == tcell.KeyEnter {
+ *send = true
+ t.PopScene()
+ return nil
+ }
+ }
+
+ defS := tcell.StyleDefault
+
+ row := 0
+ t.Label(0, row, "Fee of the message is too low.", defS)
+ row++
+
+ t.Label(0, row, fmt.Sprintf("Your configured maximum fee is: %s FIL",
+ types.FIL(orignalMaxFee).Unitless()), defS)
+ row++
+ t.Label(0, row, fmt.Sprintf("Required maximum fee for the message: %s FIL",
+ types.FIL(required).Unitless()), defS)
+ row++
+ w := t.Label(0, row, fmt.Sprintf("Safe maximum fee for the message: %s FIL",
+ types.FIL(safe).Unitless()), defS)
+ t.Label(w, row, " Press S to use it", defS)
+ row++
+
+ w = t.Label(0, row, "Current Maximum Fee: ", defS)
+
+ w += t.EditFieldFiltered(w, row, 14, &price, imtui.FilterDecimal, defS.Foreground(tcell.ColorWhite).Background(tcell.ColorBlack))
+
+ w += t.Label(w, row, " FIL", defS)
+
+ pF, err := types.ParseFIL(price)
+ *maxFee = abi.TokenAmount(pF)
+ if err != nil {
+ w += t.Label(w, row, " invalid price", defS.Foreground(tcell.ColorMaroon).Bold(true))
+ } else if maxFee.GreaterThanEqual(safe) {
+ w += t.Label(w, row, " SAFE", defS.Foreground(tcell.ColorDarkGreen).Bold(true))
+ } else if maxFee.GreaterThanEqual(required) {
+ w += t.Label(w, row, " low", defS.Foreground(tcell.ColorYellow).Bold(true))
+ over := big.Div(big.Mul(*maxFee, big.NewInt(100)), required)
+ w += t.Label(w, row,
+ fmt.Sprintf(" %.1fx over the minimum", float64(over.Int64())/100.0), defS)
+ } else {
+ w += t.Label(w, row, " too low", defS.Foreground(tcell.ColorRed).Bold(true))
+ }
+ row += 2
+
+ t.Label(0, row, fmt.Sprintf("Current Base Fee is: %s", types.FIL(baseFee).Nano()), defS)
+ row++
+ t.Label(0, row, fmt.Sprintf("Resulting FeeCap is: %s",
+ types.FIL(big.Div(*maxFee, big.NewInt(gasLimit))).Nano()), defS)
+ row++
+ t.Label(0, row, "You can use '+' and '-' to adjust the fee.", defS)
+
+ return nil
+ }
+}
diff --git a/cli/services.go b/cli/services.go
index 069bed811..0923680aa 100644
--- a/cli/services.go
+++ b/cli/services.go
@@ -4,13 +4,13 @@ import (
"bytes"
"context"
"encoding/json"
- "errors"
"fmt"
"reflect"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/stmgr"
types "github.com/filecoin-project/lotus/chain/types"
@@ -22,12 +22,30 @@ import (
//go:generate go run github.com/golang/mock/mockgen -destination=servicesmock_test.go -package=cli -self_package github.com/filecoin-project/lotus/cli . ServicesAPI
type ServicesAPI interface {
- // Sends executes a send given SendParams
- Send(ctx context.Context, params SendParams) (cid.Cid, error)
+ FullNodeAPI() api.FullNode
+
+ GetBaseFee(ctx context.Context) (abi.TokenAmount, error)
+
+ // MessageForSend creates a prototype of a message based on SendParams
+ MessageForSend(ctx context.Context, params SendParams) (*api.MessagePrototype, error)
+
// DecodeTypedParamsFromJSON takes in information needed to identify a method and converts JSON
// parameters to bytes of their CBOR encoding
DecodeTypedParamsFromJSON(ctx context.Context, to address.Address, method abi.MethodNum, paramstr string) ([]byte, error)
+ RunChecksForPrototype(ctx context.Context, prototype *api.MessagePrototype) ([][]api.MessageCheckStatus, error)
+
+ // PublishMessage takes in a message prototype and publishes it
+ // before publishing the message, it runs checks on the node, message and mpool to verify that
+ // message is valid and won't be stuck.
+ // if `force` is true, it skips the checks
+ PublishMessage(ctx context.Context, prototype *api.MessagePrototype, force bool) (*types.SignedMessage, [][]api.MessageCheckStatus, error)
+
+ LocalAddresses(ctx context.Context) (address.Address, []address.Address, error)
+
+ MpoolPendingFilter(ctx context.Context, filter func(*types.SignedMessage) bool, tsk types.TipSetKey) ([]*types.SignedMessage, error)
+ MpoolCheckPendingMessages(ctx context.Context, a address.Address) ([][]api.MessageCheckStatus, error)
+
// Close ends the session of services and disconnects from RPC, using Services after Close is called
// most likely will result in an error
// Should not be called concurrently
@@ -39,6 +57,10 @@ type ServicesImpl struct {
closer jsonrpc.ClientCloser
}
+func (s *ServicesImpl) FullNodeAPI() api.FullNode {
+ return s.api
+}
+
func (s *ServicesImpl) Close() error {
if s.closer == nil {
return xerrors.Errorf("Services already closed")
@@ -48,6 +70,16 @@ func (s *ServicesImpl) Close() error {
return nil
}
+func (s *ServicesImpl) GetBaseFee(ctx context.Context) (abi.TokenAmount, error) {
+ // not used but useful
+
+ ts, err := s.api.ChainHead(ctx)
+ if err != nil {
+ return big.Zero(), xerrors.Errorf("getting head: %w", err)
+ }
+ return ts.MinTicketBlock().ParentBaseFee, nil
+}
+
func (s *ServicesImpl) DecodeTypedParamsFromJSON(ctx context.Context, to address.Address, method abi.MethodNum, paramstr string) ([]byte, error) {
act, err := s.api.StateGetActor(ctx, to, types.EmptyTSK)
if err != nil {
@@ -72,6 +104,79 @@ func (s *ServicesImpl) DecodeTypedParamsFromJSON(ctx context.Context, to address
return buf.Bytes(), nil
}
+type CheckInfo struct {
+ MessageTie cid.Cid
+ CurrentMessageTie bool
+
+ Check api.MessageCheckStatus
+}
+
+var ErrCheckFailed = fmt.Errorf("check has failed")
+
+func (s *ServicesImpl) RunChecksForPrototype(ctx context.Context, prototype *api.MessagePrototype) ([][]api.MessageCheckStatus, error) {
+ var outChecks [][]api.MessageCheckStatus
+ checks, err := s.api.MpoolCheckMessages(ctx, []*api.MessagePrototype{prototype})
+ if err != nil {
+ return nil, xerrors.Errorf("message check: %w", err)
+ }
+ outChecks = append(outChecks, checks...)
+
+ checks, err = s.api.MpoolCheckPendingMessages(ctx, prototype.Message.From)
+ if err != nil {
+ return nil, xerrors.Errorf("pending mpool check: %w", err)
+ }
+ outChecks = append(outChecks, checks...)
+
+ return outChecks, nil
+}
+
+// PublishMessage modifies prototype to include gas estimation
+// Errors with ErrCheckFailed if any of the checks fail
+// First group of checks is related to the message prototype
+func (s *ServicesImpl) PublishMessage(ctx context.Context,
+ prototype *api.MessagePrototype, force bool) (*types.SignedMessage, [][]api.MessageCheckStatus, error) {
+
+ gasedMsg, err := s.api.GasEstimateMessageGas(ctx, &prototype.Message, nil, types.EmptyTSK)
+ if err != nil {
+ return nil, nil, xerrors.Errorf("estimating gas: %w", err)
+ }
+ prototype.Message = *gasedMsg
+
+ if !force {
+ checks, err := s.RunChecksForPrototype(ctx, prototype)
+ if err != nil {
+ return nil, nil, xerrors.Errorf("running checks: %w", err)
+ }
+ for _, chks := range checks {
+ for _, c := range chks {
+ if !c.OK {
+ return nil, checks, ErrCheckFailed
+ }
+ }
+ }
+ }
+
+ if prototype.ValidNonce {
+ sm, err := s.api.WalletSignMessage(ctx, prototype.Message.From, &prototype.Message)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ _, err = s.api.MpoolPush(ctx, sm)
+ if err != nil {
+ return nil, nil, err
+ }
+ return sm, nil, nil
+ }
+
+ sm, err := s.api.MpoolPushMessage(ctx, &prototype.Message, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ return sm, nil, nil
+}
+
type SendParams struct {
To address.Address
From address.Address
@@ -84,26 +189,18 @@ type SendParams struct {
Nonce *uint64
Method abi.MethodNum
Params []byte
-
- Force bool
}
-// This is specialised Send for Send command
-// There might be room for generic Send that other commands can use to send their messages
-// We will see
-
-var ErrSendBalanceTooLow = errors.New("balance too low")
-
-func (s *ServicesImpl) Send(ctx context.Context, params SendParams) (cid.Cid, error) {
+func (s *ServicesImpl) MessageForSend(ctx context.Context, params SendParams) (*api.MessagePrototype, error) {
if params.From == address.Undef {
defaddr, err := s.api.WalletDefaultAddress(ctx)
if err != nil {
- return cid.Undef, err
+ return nil, err
}
params.From = defaddr
}
- msg := &types.Message{
+ msg := types.Message{
From: params.From,
To: params.To,
Value: params.Val,
@@ -127,40 +224,53 @@ func (s *ServicesImpl) Send(ctx context.Context, params SendParams) (cid.Cid, er
} else {
msg.GasLimit = 0
}
-
- if !params.Force {
- // Funds insufficient check
- fromBalance, err := s.api.WalletBalance(ctx, msg.From)
- if err != nil {
- return cid.Undef, err
- }
- totalCost := types.BigAdd(types.BigMul(msg.GasFeeCap, types.NewInt(uint64(msg.GasLimit))), msg.Value)
-
- if fromBalance.LessThan(totalCost) {
- return cid.Undef, xerrors.Errorf("From balance %s less than total cost %s: %w", types.FIL(fromBalance), types.FIL(totalCost), ErrSendBalanceTooLow)
-
- }
- }
-
+ validNonce := false
if params.Nonce != nil {
msg.Nonce = *params.Nonce
- sm, err := s.api.WalletSignMessage(ctx, params.From, msg)
- if err != nil {
- return cid.Undef, err
- }
-
- _, err = s.api.MpoolPush(ctx, sm)
- if err != nil {
- return cid.Undef, err
- }
-
- return sm.Cid(), nil
+ validNonce = true
}
- sm, err := s.api.MpoolPushMessage(ctx, msg, nil)
- if err != nil {
- return cid.Undef, err
+ prototype := &api.MessagePrototype{
+ Message: msg,
+ ValidNonce: validNonce,
}
-
- return sm.Cid(), nil
+ return prototype, nil
+}
+
+func (s *ServicesImpl) MpoolPendingFilter(ctx context.Context, filter func(*types.SignedMessage) bool,
+ tsk types.TipSetKey) ([]*types.SignedMessage, error) {
+ msgs, err := s.api.MpoolPending(ctx, types.EmptyTSK)
+ if err != nil {
+ return nil, xerrors.Errorf("getting pending messages: %w", err)
+ }
+ out := []*types.SignedMessage{}
+ for _, sm := range msgs {
+ if filter(sm) {
+ out = append(out, sm)
+ }
+ }
+
+ return out, nil
+}
+
+func (s *ServicesImpl) LocalAddresses(ctx context.Context) (address.Address, []address.Address, error) {
+ def, err := s.api.WalletDefaultAddress(ctx)
+ if err != nil {
+ return address.Undef, nil, xerrors.Errorf("getting default addr: %w", err)
+ }
+
+ all, err := s.api.WalletList(ctx)
+ if err != nil {
+ return address.Undef, nil, xerrors.Errorf("getting list of addrs: %w", err)
+ }
+
+ return def, all, nil
+}
+
+func (s *ServicesImpl) MpoolCheckPendingMessages(ctx context.Context, a address.Address) ([][]api.MessageCheckStatus, error) {
+ checks, err := s.api.MpoolCheckPendingMessages(ctx, a)
+ if err != nil {
+ return nil, xerrors.Errorf("pending mpool check: %w", err)
+ }
+ return checks, nil
}
diff --git a/cli/services_send_test.go b/cli/services_send_test.go
index 9dfc3b38a..b7ed78f80 100644
--- a/cli/services_send_test.go
+++ b/cli/services_send_test.go
@@ -9,10 +9,9 @@ import (
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/mocks"
+ mocks "github.com/filecoin-project/lotus/api/mocks"
types "github.com/filecoin-project/lotus/chain/types"
gomock "github.com/golang/mock/gomock"
- cid "github.com/ipfs/go-cid"
"github.com/stretchr/testify/assert"
)
@@ -61,6 +60,7 @@ func setupMockSrvcs(t *testing.T) (*ServicesImpl, *mocks.MockFullNode) {
return srvcs, mockApi
}
+// linter doesn't like dead code, so these are commented out.
func fakeSign(msg *types.Message) *types.SignedMessage {
return &types.SignedMessage{
Message: *msg,
@@ -68,15 +68,15 @@ func fakeSign(msg *types.Message) *types.SignedMessage {
}
}
-func makeMessageSigner() (*cid.Cid, interface{}) {
- smCid := cid.Undef
- return &smCid,
- func(_ context.Context, msg *types.Message, _ *api.MessageSendSpec) (*types.SignedMessage, error) {
- sm := fakeSign(msg)
- smCid = sm.Cid()
- return sm, nil
- }
-}
+//func makeMessageSigner() (*cid.Cid, interface{}) {
+//smCid := cid.Undef
+//return &smCid,
+//func(_ context.Context, msg *types.Message, _ *api.MessageSendSpec) (*types.SignedMessage, error) {
+//sm := fakeSign(msg)
+//smCid = sm.Cid()
+//return sm, nil
+//}
+//}
type MessageMatcher SendParams
@@ -84,11 +84,13 @@ var _ gomock.Matcher = MessageMatcher{}
// Matches returns whether x is a match.
func (mm MessageMatcher) Matches(x interface{}) bool {
- m, ok := x.(*types.Message)
+ proto, ok := x.(*api.MessagePrototype)
if !ok {
return false
}
+ m := &proto.Message
+
if mm.From != address.Undef && mm.From != m.From {
return false
}
@@ -151,47 +153,12 @@ func TestSendService(t *testing.T) {
t.Run("happy", func(t *testing.T) {
params := params
- srvcs, mockApi := setupMockSrvcs(t)
+ srvcs, _ := setupMockSrvcs(t)
defer srvcs.Close() //nolint:errcheck
- msgCid, sign := makeMessageSigner()
- gomock.InOrder(
- mockApi.EXPECT().WalletBalance(ctxM, params.From).Return(types.NewInt(balance), nil),
- mockApi.EXPECT().MpoolPushMessage(ctxM, MessageMatcher(params), nil).DoAndReturn(sign),
- )
- c, err := srvcs.Send(ctx, params)
+ proto, err := srvcs.MessageForSend(ctx, params)
assert.NoError(t, err)
- assert.Equal(t, *msgCid, c)
- })
-
- t.Run("balance-too-low", func(t *testing.T) {
- params := params
- srvcs, mockApi := setupMockSrvcs(t)
- defer srvcs.Close() //nolint:errcheck
- gomock.InOrder(
- mockApi.EXPECT().WalletBalance(ctxM, a1).Return(types.NewInt(balance-200), nil),
- // no MpoolPushMessage
- )
-
- c, err := srvcs.Send(ctx, params)
- assert.Equal(t, c, cid.Undef)
- assert.ErrorIs(t, err, ErrSendBalanceTooLow)
- })
-
- t.Run("force", func(t *testing.T) {
- params := params
- params.Force = true
- srvcs, mockApi := setupMockSrvcs(t)
- defer srvcs.Close() //nolint:errcheck
- msgCid, sign := makeMessageSigner()
- gomock.InOrder(
- mockApi.EXPECT().WalletBalance(ctxM, a1).Return(types.NewInt(balance-200), nil).AnyTimes(),
- mockApi.EXPECT().MpoolPushMessage(ctxM, MessageMatcher(params), nil).DoAndReturn(sign),
- )
-
- c, err := srvcs.Send(ctx, params)
- assert.NoError(t, err)
- assert.Equal(t, *msgCid, c)
+ assert.True(t, MessageMatcher(params).Matches(proto))
})
t.Run("default-from", func(t *testing.T) {
@@ -202,16 +169,14 @@ func TestSendService(t *testing.T) {
srvcs, mockApi := setupMockSrvcs(t)
defer srvcs.Close() //nolint:errcheck
- msgCid, sign := makeMessageSigner()
+
gomock.InOrder(
mockApi.EXPECT().WalletDefaultAddress(ctxM).Return(a1, nil),
- mockApi.EXPECT().WalletBalance(ctxM, a1).Return(types.NewInt(balance), nil),
- mockApi.EXPECT().MpoolPushMessage(ctxM, mm, nil).DoAndReturn(sign),
)
- c, err := srvcs.Send(ctx, params)
+ proto, err := srvcs.MessageForSend(ctx, params)
assert.NoError(t, err)
- assert.Equal(t, *msgCid, c)
+ assert.True(t, mm.Matches(proto))
})
t.Run("set-nonce", func(t *testing.T) {
@@ -220,26 +185,12 @@ func TestSendService(t *testing.T) {
params.Nonce = &n
mm := MessageMatcher(params)
- srvcs, mockApi := setupMockSrvcs(t)
+ srvcs, _ := setupMockSrvcs(t)
defer srvcs.Close() //nolint:errcheck
- _, _ = mm, mockApi
- var sm *types.SignedMessage
- gomock.InOrder(
- mockApi.EXPECT().WalletBalance(ctxM, a1).Return(types.NewInt(balance), nil),
- mockApi.EXPECT().WalletSignMessage(ctxM, a1, mm).DoAndReturn(
- func(_ context.Context, _ address.Address, msg *types.Message) (*types.SignedMessage, error) {
- sm = fakeSign(msg)
-
- // now we expect MpoolPush with that SignedMessage
- mockApi.EXPECT().MpoolPush(ctxM, sm).Return(sm.Cid(), nil)
- return sm, nil
- }),
- )
-
- c, err := srvcs.Send(ctx, params)
+ proto, err := srvcs.MessageForSend(ctx, params)
assert.NoError(t, err)
- assert.Equal(t, sm.Cid(), c)
+ assert.True(t, mm.Matches(proto))
})
t.Run("gas-params", func(t *testing.T) {
@@ -251,16 +202,14 @@ func TestSendService(t *testing.T) {
gp := big.NewInt(10)
params.GasPremium = &gp
- srvcs, mockApi := setupMockSrvcs(t)
- defer srvcs.Close() //nolint:errcheck
- msgCid, sign := makeMessageSigner()
- gomock.InOrder(
- mockApi.EXPECT().WalletBalance(ctxM, params.From).Return(types.NewInt(balance), nil),
- mockApi.EXPECT().MpoolPushMessage(ctxM, MessageMatcher(params), nil).DoAndReturn(sign),
- )
+ mm := MessageMatcher(params)
- c, err := srvcs.Send(ctx, params)
+ srvcs, _ := setupMockSrvcs(t)
+ defer srvcs.Close() //nolint:errcheck
+
+ proto, err := srvcs.MessageForSend(ctx, params)
assert.NoError(t, err)
- assert.Equal(t, *msgCid, c)
+ assert.True(t, mm.Matches(proto))
+
})
}
diff --git a/cli/servicesmock_test.go b/cli/servicesmock_test.go
index 48f1a95ec..5bae52a5e 100644
--- a/cli/servicesmock_test.go
+++ b/cli/servicesmock_test.go
@@ -6,37 +6,40 @@ package cli
import (
context "context"
+ reflect "reflect"
+
go_address "github.com/filecoin-project/go-address"
abi "github.com/filecoin-project/go-state-types/abi"
+ big "github.com/filecoin-project/go-state-types/big"
+ api "github.com/filecoin-project/lotus/api"
+ types "github.com/filecoin-project/lotus/chain/types"
gomock "github.com/golang/mock/gomock"
- go_cid "github.com/ipfs/go-cid"
- reflect "reflect"
)
-// MockServicesAPI is a mock of ServicesAPI interface
+// MockServicesAPI is a mock of ServicesAPI interface.
type MockServicesAPI struct {
ctrl *gomock.Controller
recorder *MockServicesAPIMockRecorder
}
-// MockServicesAPIMockRecorder is the mock recorder for MockServicesAPI
+// MockServicesAPIMockRecorder is the mock recorder for MockServicesAPI.
type MockServicesAPIMockRecorder struct {
mock *MockServicesAPI
}
-// NewMockServicesAPI creates a new mock instance
+// NewMockServicesAPI creates a new mock instance.
func NewMockServicesAPI(ctrl *gomock.Controller) *MockServicesAPI {
mock := &MockServicesAPI{ctrl: ctrl}
mock.recorder = &MockServicesAPIMockRecorder{mock}
return mock
}
-// EXPECT returns an object that allows the caller to indicate expected use
+// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockServicesAPI) EXPECT() *MockServicesAPIMockRecorder {
return m.recorder
}
-// Close mocks base method
+// Close mocks base method.
func (m *MockServicesAPI) Close() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Close")
@@ -44,13 +47,13 @@ func (m *MockServicesAPI) Close() error {
return ret0
}
-// Close indicates an expected call of Close
+// Close indicates an expected call of Close.
func (mr *MockServicesAPIMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockServicesAPI)(nil).Close))
}
-// DecodeTypedParamsFromJSON mocks base method
+// DecodeTypedParamsFromJSON mocks base method.
func (m *MockServicesAPI) DecodeTypedParamsFromJSON(arg0 context.Context, arg1 go_address.Address, arg2 abi.MethodNum, arg3 string) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DecodeTypedParamsFromJSON", arg0, arg1, arg2, arg3)
@@ -59,23 +62,129 @@ func (m *MockServicesAPI) DecodeTypedParamsFromJSON(arg0 context.Context, arg1 g
return ret0, ret1
}
-// DecodeTypedParamsFromJSON indicates an expected call of DecodeTypedParamsFromJSON
+// DecodeTypedParamsFromJSON indicates an expected call of DecodeTypedParamsFromJSON.
func (mr *MockServicesAPIMockRecorder) DecodeTypedParamsFromJSON(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeTypedParamsFromJSON", reflect.TypeOf((*MockServicesAPI)(nil).DecodeTypedParamsFromJSON), arg0, arg1, arg2, arg3)
}
-// Send mocks base method
-func (m *MockServicesAPI) Send(arg0 context.Context, arg1 SendParams) (go_cid.Cid, error) {
+// FullNodeAPI mocks base method.
+func (m *MockServicesAPI) FullNodeAPI() api.FullNode {
m.ctrl.T.Helper()
- ret := m.ctrl.Call(m, "Send", arg0, arg1)
- ret0, _ := ret[0].(go_cid.Cid)
+ ret := m.ctrl.Call(m, "FullNodeAPI")
+ ret0, _ := ret[0].(api.FullNode)
+ return ret0
+}
+
+// FullNodeAPI indicates an expected call of FullNodeAPI.
+func (mr *MockServicesAPIMockRecorder) FullNodeAPI() *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FullNodeAPI", reflect.TypeOf((*MockServicesAPI)(nil).FullNodeAPI))
+}
+
+// GetBaseFee mocks base method.
+func (m *MockServicesAPI) GetBaseFee(arg0 context.Context) (big.Int, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetBaseFee", arg0)
+ ret0, _ := ret[0].(big.Int)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// Send indicates an expected call of Send
-func (mr *MockServicesAPIMockRecorder) Send(arg0, arg1 interface{}) *gomock.Call {
+// GetBaseFee indicates an expected call of GetBaseFee.
+func (mr *MockServicesAPIMockRecorder) GetBaseFee(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockServicesAPI)(nil).Send), arg0, arg1)
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBaseFee", reflect.TypeOf((*MockServicesAPI)(nil).GetBaseFee), arg0)
+}
+
+// LocalAddresses mocks base method.
+func (m *MockServicesAPI) LocalAddresses(arg0 context.Context) (go_address.Address, []go_address.Address, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "LocalAddresses", arg0)
+ ret0, _ := ret[0].(go_address.Address)
+ ret1, _ := ret[1].([]go_address.Address)
+ ret2, _ := ret[2].(error)
+ return ret0, ret1, ret2
+}
+
+// LocalAddresses indicates an expected call of LocalAddresses.
+func (mr *MockServicesAPIMockRecorder) LocalAddresses(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalAddresses", reflect.TypeOf((*MockServicesAPI)(nil).LocalAddresses), arg0)
+}
+
+// MessageForSend mocks base method.
+func (m *MockServicesAPI) MessageForSend(arg0 context.Context, arg1 SendParams) (*api.MessagePrototype, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MessageForSend", arg0, arg1)
+ ret0, _ := ret[0].(*api.MessagePrototype)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MessageForSend indicates an expected call of MessageForSend.
+func (mr *MockServicesAPIMockRecorder) MessageForSend(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessageForSend", reflect.TypeOf((*MockServicesAPI)(nil).MessageForSend), arg0, arg1)
+}
+
+// MpoolCheckPendingMessages mocks base method.
+func (m *MockServicesAPI) MpoolCheckPendingMessages(arg0 context.Context, arg1 go_address.Address) ([][]api.MessageCheckStatus, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolCheckPendingMessages", arg0, arg1)
+ ret0, _ := ret[0].([][]api.MessageCheckStatus)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolCheckPendingMessages indicates an expected call of MpoolCheckPendingMessages.
+func (mr *MockServicesAPIMockRecorder) MpoolCheckPendingMessages(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolCheckPendingMessages", reflect.TypeOf((*MockServicesAPI)(nil).MpoolCheckPendingMessages), arg0, arg1)
+}
+
+// MpoolPendingFilter mocks base method.
+func (m *MockServicesAPI) MpoolPendingFilter(arg0 context.Context, arg1 func(*types.SignedMessage) bool, arg2 types.TipSetKey) ([]*types.SignedMessage, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MpoolPendingFilter", arg0, arg1, arg2)
+ ret0, _ := ret[0].([]*types.SignedMessage)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// MpoolPendingFilter indicates an expected call of MpoolPendingFilter.
+func (mr *MockServicesAPIMockRecorder) MpoolPendingFilter(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPendingFilter", reflect.TypeOf((*MockServicesAPI)(nil).MpoolPendingFilter), arg0, arg1, arg2)
+}
+
+// PublishMessage mocks base method.
+func (m *MockServicesAPI) PublishMessage(arg0 context.Context, arg1 *api.MessagePrototype, arg2 bool) (*types.SignedMessage, [][]api.MessageCheckStatus, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PublishMessage", arg0, arg1, arg2)
+ ret0, _ := ret[0].(*types.SignedMessage)
+ ret1, _ := ret[1].([][]api.MessageCheckStatus)
+ ret2, _ := ret[2].(error)
+ return ret0, ret1, ret2
+}
+
+// PublishMessage indicates an expected call of PublishMessage.
+func (mr *MockServicesAPIMockRecorder) PublishMessage(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishMessage", reflect.TypeOf((*MockServicesAPI)(nil).PublishMessage), arg0, arg1, arg2)
+}
+
+// RunChecksForPrototype mocks base method.
+func (m *MockServicesAPI) RunChecksForPrototype(arg0 context.Context, arg1 *api.MessagePrototype) ([][]api.MessageCheckStatus, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "RunChecksForPrototype", arg0, arg1)
+ ret0, _ := ret[0].([][]api.MessageCheckStatus)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// RunChecksForPrototype indicates an expected call of RunChecksForPrototype.
+func (mr *MockServicesAPIMockRecorder) RunChecksForPrototype(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunChecksForPrototype", reflect.TypeOf((*MockServicesAPI)(nil).RunChecksForPrototype), arg0, arg1)
}
diff --git a/cli/state.go b/cli/state.go
index 3c032127f..b0260f02b 100644
--- a/cli/state.go
+++ b/cli/state.go
@@ -3,6 +3,8 @@ package cli
import (
"bytes"
"context"
+ "encoding/base64"
+ "encoding/hex"
"encoding/json"
"fmt"
"html/template"
@@ -15,12 +17,13 @@ import (
"strings"
"time"
+ "github.com/filecoin-project/lotus/api/v0api"
+
"github.com/fatih/color"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
- "github.com/libp2p/go-libp2p-core/peer"
"github.com/multiformats/go-multiaddr"
"github.com/multiformats/go-multihash"
"github.com/urfave/cli/v2"
@@ -29,7 +32,6 @@ import (
"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/exitcode"
"github.com/filecoin-project/lotus/api"
@@ -73,6 +75,50 @@ var StateCmd = &cli.Command{
StateMarketCmd,
StateExecTraceCmd,
StateNtwkVersionCmd,
+ StateMinerProvingDeadlineCmd,
+ },
+}
+
+var StateMinerProvingDeadlineCmd = &cli.Command{
+ Name: "miner-proving-deadline",
+ Usage: "Retrieve information about a given miner's proving deadline",
+ ArgsUsage: "[minerAddress]",
+ Action: func(cctx *cli.Context) error {
+ api, closer, err := GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+
+ ctx := ReqContext(cctx)
+
+ if !cctx.Args().Present() {
+ return fmt.Errorf("must specify miner to get information for")
+ }
+
+ addr, err := address.NewFromString(cctx.Args().First())
+ if err != nil {
+ return err
+ }
+
+ ts, err := LoadTipSet(ctx, cctx, api)
+ if err != nil {
+ return err
+ }
+
+ cd, err := api.StateMinerProvingDeadline(ctx, addr, ts.Key())
+ if err != nil {
+ return xerrors.Errorf("getting miner info: %w", err)
+ }
+
+ fmt.Printf("Period Start:\t%s\n", cd.PeriodStart)
+ fmt.Printf("Index:\t\t%d\n", cd.Index)
+ fmt.Printf("Open:\t\t%s\n", cd.Open)
+ fmt.Printf("Close:\t\t%s\n", cd.Close)
+ fmt.Printf("Challenge:\t%s\n", cd.Challenge)
+ fmt.Printf("FaultCutoff:\t%s\n", cd.FaultCutoff)
+
+ return nil
},
}
@@ -178,16 +224,19 @@ func ParseTipSetString(ts string) ([]cid.Cid, error) {
return cids, nil
}
-func LoadTipSet(ctx context.Context, cctx *cli.Context, api api.FullNode) (*types.TipSet, error) {
+// LoadTipSet gets the tipset from the context, or the head from the API.
+//
+// It always gets the head from the API so commands use a consistent tipset even if time pases.
+func LoadTipSet(ctx context.Context, cctx *cli.Context, api v0api.FullNode) (*types.TipSet, error) {
tss := cctx.String("tipset")
if tss == "" {
- return nil, nil
+ return api.ChainHead(ctx)
}
return ParseTipSetRef(ctx, api, tss)
}
-func ParseTipSetRef(ctx context.Context, api api.FullNode, tss string) (*types.TipSet, error) {
+func ParseTipSetRef(ctx context.Context, api v0api.FullNode, tss string) (*types.TipSet, error) {
if tss[0] == '@' {
if tss == "@head" {
return api.ChainHead(ctx)
@@ -232,17 +281,26 @@ var StatePowerCmd = &cli.Command{
ctx := ReqContext(cctx)
+ ts, err := LoadTipSet(ctx, cctx, api)
+ if err != nil {
+ return err
+ }
+
var maddr address.Address
if cctx.Args().Present() {
maddr, err = address.NewFromString(cctx.Args().First())
if err != nil {
return err
}
- }
- ts, err := LoadTipSet(ctx, cctx, api)
- if err != nil {
- return err
+ ma, err := api.StateGetActor(ctx, maddr, ts.Key())
+ if err != nil {
+ return err
+ }
+
+ if !builtin.IsStorageMinerActor(ma.Code) {
+ return xerrors.New("provided address does not correspond to a miner actor")
+ }
}
power, err := api.StateMinerPower(ctx, maddr, ts.Key())
@@ -296,7 +354,7 @@ var StateSectorsCmd = &cli.Command{
}
for _, s := range sectors {
- fmt.Printf("%d: %x\n", s.SectorNumber, s.SealedCID)
+ fmt.Printf("%d: %s\n", s.SectorNumber, s.SealedCID)
}
return nil
@@ -336,7 +394,7 @@ var StateActiveSectorsCmd = &cli.Command{
}
for _, s := range sectors {
- fmt.Printf("%d: %x\n", s.SectorNumber, s.SealedCID)
+ fmt.Printf("%d: %s\n", s.SectorNumber, s.SealedCID)
}
return nil
@@ -574,7 +632,7 @@ var StateListMinersCmd = &cli.Command{
},
}
-func getDealsCounts(ctx context.Context, lapi api.FullNode) (map[address.Address]int, error) {
+func getDealsCounts(ctx context.Context, lapi v0api.FullNode) (map[address.Address]int, error) {
allDeals, err := lapi.StateMarketDeals(ctx, types.EmptyTSK)
if err != nil {
return nil, err
@@ -848,14 +906,6 @@ var StateListMessagesCmd = &cli.Command{
return err
}
- if ts == nil {
- head, err := api.ChainHead(ctx)
- if err != nil {
- return err
- }
- ts = head
- }
-
windowSize := abi.ChainEpoch(100)
cur := ts
@@ -955,13 +1005,6 @@ var StateComputeStateCmd = &cli.Command{
}
h := abi.ChainEpoch(cctx.Uint64("vm-height"))
- if ts == nil {
- head, err := api.ChainHead(ctx)
- if err != nil {
- return err
- }
- ts = head
- }
if h == 0 {
h = ts.Height()
}
@@ -1443,7 +1486,7 @@ var StateSearchMsgCmd = &cli.Command{
},
}
-func printReceiptReturn(ctx context.Context, api api.FullNode, m *types.Message, r types.MessageReceipt) error {
+func printReceiptReturn(ctx context.Context, api v0api.FullNode, m *types.Message, r types.MessageReceipt) error {
if len(r.Return) == 0 {
return nil
}
@@ -1463,8 +1506,7 @@ func printReceiptReturn(ctx context.Context, api api.FullNode, m *types.Message,
return nil
}
-func printMsg(ctx context.Context, api api.FullNode, msg cid.Cid, mw *lapi.MsgLookup, m *types.Message) error {
-
+func printMsg(ctx context.Context, api v0api.FullNode, msg cid.Cid, mw *lapi.MsgLookup, m *types.Message) error {
if mw == nil {
fmt.Println("message was not found on chain")
return nil
@@ -1488,7 +1530,7 @@ func printMsg(ctx context.Context, api api.FullNode, msg cid.Cid, mw *lapi.MsgLo
var StateCallCmd = &cli.Command{
Name: "call",
Usage: "Invoke a method on an actor locally",
- ArgsUsage: "[toAddress methodId (optional)]",
+ ArgsUsage: "[toAddress methodId params (optional)]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "from",
@@ -1502,8 +1544,13 @@ var StateCallCmd = &cli.Command{
},
&cli.StringFlag{
Name: "ret",
- Usage: "specify how to parse output (auto, raw, addr, big)",
- Value: "auto",
+ Usage: "specify how to parse output (raw, decoded, base64, hex)",
+ Value: "decoded",
+ },
+ &cli.StringFlag{
+ Name: "encoding",
+ Value: "base64",
+ Usage: "specify params encoding to parse (base64, hex)",
},
},
Action: func(cctx *cli.Context) error {
@@ -1544,14 +1591,23 @@ var StateCallCmd = &cli.Command{
return fmt.Errorf("failed to parse 'value': %s", err)
}
- act, err := api.StateGetActor(ctx, toa, ts.Key())
- if err != nil {
- return fmt.Errorf("failed to lookup target actor: %s", err)
- }
-
- params, err := parseParamsForMethod(act.Code, method, cctx.Args().Slice()[2:])
- if err != nil {
- return fmt.Errorf("failed to parse params: %s", err)
+ var params []byte
+ // If params were passed in, decode them
+ if cctx.Args().Len() > 2 {
+ switch cctx.String("encoding") {
+ case "base64":
+ params, err = base64.StdEncoding.DecodeString(cctx.Args().Get(2))
+ if err != nil {
+ return xerrors.Errorf("decoding base64 value: %w", err)
+ }
+ case "hex":
+ params, err = hex.DecodeString(cctx.Args().Get(2))
+ if err != nil {
+ return xerrors.Errorf("decoding hex value: %w", err)
+ }
+ default:
+ return xerrors.Errorf("unrecognized encoding: %s", cctx.String("encoding"))
+ }
}
ret, err := api.StateCall(ctx, &types.Message{
@@ -1562,137 +1618,42 @@ var StateCallCmd = &cli.Command{
Params: params,
}, ts.Key())
if err != nil {
- return fmt.Errorf("state call failed: %s", err)
+ return fmt.Errorf("state call failed: %w", err)
}
if ret.MsgRct.ExitCode != 0 {
return fmt.Errorf("invocation failed (exit: %d, gasUsed: %d): %s", ret.MsgRct.ExitCode, ret.MsgRct.GasUsed, ret.Error)
}
- s, err := formatOutput(cctx.String("ret"), ret.MsgRct.Return)
- if err != nil {
- return fmt.Errorf("failed to format output: %s", err)
- }
+ fmt.Println("Call receipt:")
+ fmt.Printf("Exit code: %d\n", ret.MsgRct.ExitCode)
+ fmt.Printf("Gas Used: %d\n", ret.MsgRct.GasUsed)
- fmt.Printf("gas used: %d\n", ret.MsgRct.GasUsed)
- fmt.Printf("return: %s\n", s)
+ switch cctx.String("ret") {
+ case "decoded":
+ act, err := api.StateGetActor(ctx, toa, ts.Key())
+ if err != nil {
+ return xerrors.Errorf("getting actor: %w", err)
+ }
+
+ retStr, err := jsonReturn(act.Code, abi.MethodNum(method), ret.MsgRct.Return)
+ if err != nil {
+ return xerrors.Errorf("decoding return: %w", err)
+ }
+
+ fmt.Printf("Return:\n%s\n", retStr)
+ case "raw":
+ fmt.Printf("Return: \n%s\n", ret.MsgRct.Return)
+ case "hex":
+ fmt.Printf("Return: \n%x\n", ret.MsgRct.Return)
+ case "base64":
+ fmt.Printf("Return: \n%s\n", base64.StdEncoding.EncodeToString(ret.MsgRct.Return))
+ }
return nil
},
}
-func formatOutput(t string, val []byte) (string, error) {
- switch t {
- case "raw", "hex":
- return fmt.Sprintf("%x", val), nil
- case "address", "addr", "a":
- a, err := address.NewFromBytes(val)
- if err != nil {
- return "", err
- }
- return a.String(), nil
- case "big", "int", "bigint":
- bi := types.BigFromBytes(val)
- return bi.String(), nil
- case "fil":
- bi := types.FIL(types.BigFromBytes(val))
- return bi.String(), nil
- case "pid", "peerid", "peer":
- pid, err := peer.IDFromBytes(val)
- if err != nil {
- return "", err
- }
-
- return pid.Pretty(), nil
- case "auto":
- if len(val) == 0 {
- return "", nil
- }
-
- a, err := address.NewFromBytes(val)
- if err == nil {
- return "address: " + a.String(), nil
- }
-
- pid, err := peer.IDFromBytes(val)
- if err == nil {
- return "peerID: " + pid.Pretty(), nil
- }
-
- bi := types.BigFromBytes(val)
- return "bigint: " + bi.String(), nil
- default:
- return "", fmt.Errorf("unrecognized output type: %q", t)
- }
-}
-
-func parseParamsForMethod(act cid.Cid, method uint64, args []string) ([]byte, error) {
- if len(args) == 0 {
- return nil, nil
- }
-
- // TODO: consider moving this to a dedicated helper
- actMeta, ok := stmgr.MethodsMap[act]
- if !ok {
- return nil, fmt.Errorf("unknown actor %s", act)
- }
-
- methodMeta, ok := actMeta[abi.MethodNum(method)]
- if !ok {
- return nil, fmt.Errorf("unknown method %d for actor %s", method, act)
- }
-
- paramObj := methodMeta.Params.Elem()
- if paramObj.NumField() != len(args) {
- return nil, fmt.Errorf("not enough arguments given to call that method (expecting %d)", paramObj.NumField())
- }
-
- p := reflect.New(paramObj)
- for i := 0; i < len(args); i++ {
- switch paramObj.Field(i).Type {
- case reflect.TypeOf(address.Address{}):
- a, err := address.NewFromString(args[i])
- if err != nil {
- return nil, fmt.Errorf("failed to parse address: %s", err)
- }
- p.Elem().Field(i).Set(reflect.ValueOf(a))
- case reflect.TypeOf(uint64(0)):
- val, err := strconv.ParseUint(args[i], 10, 64)
- if err != nil {
- return nil, err
- }
- p.Elem().Field(i).Set(reflect.ValueOf(val))
- case reflect.TypeOf(abi.ChainEpoch(0)):
- val, err := strconv.ParseInt(args[i], 10, 64)
- if err != nil {
- return nil, err
- }
- p.Elem().Field(i).Set(reflect.ValueOf(abi.ChainEpoch(val)))
- case reflect.TypeOf(big.Int{}):
- val, err := big.FromString(args[i])
- if err != nil {
- return nil, err
- }
- p.Elem().Field(i).Set(reflect.ValueOf(val))
- case reflect.TypeOf(peer.ID("")):
- pid, err := peer.Decode(args[i])
- if err != nil {
- return nil, fmt.Errorf("failed to parse peer ID: %s", err)
- }
- p.Elem().Field(i).Set(reflect.ValueOf(pid))
- default:
- return nil, fmt.Errorf("unsupported type for call (TODO): %s", paramObj.Field(i).Type)
- }
- }
-
- m := p.Interface().(cbg.CBORMarshaler)
- buf := new(bytes.Buffer)
- if err := m.MarshalCBOR(buf); err != nil {
- return nil, fmt.Errorf("failed to marshal param object: %s", err)
- }
- return buf.Bytes(), nil
-}
-
var StateCircSupplyCmd = &cli.Command{
Name: "circulating-supply",
Usage: "Get the exact current circulating supply of Filecoin",
@@ -1764,13 +1725,6 @@ var StateSectorCmd = &cli.Command{
return err
}
- if ts == nil {
- ts, err = api.ChainHead(ctx)
- if err != nil {
- return err
- }
- }
-
maddr, err := address.NewFromString(cctx.Args().Get(0))
if err != nil {
return err
diff --git a/cli/status.go b/cli/status.go
new file mode 100644
index 000000000..75f91196a
--- /dev/null
+++ b/cli/status.go
@@ -0,0 +1,60 @@
+package cli
+
+import (
+ "fmt"
+
+ "github.com/urfave/cli/v2"
+
+ "github.com/filecoin-project/lotus/build"
+)
+
+var StatusCmd = &cli.Command{
+ Name: "status",
+ Usage: "Check node status",
+ Flags: []cli.Flag{
+ &cli.BoolFlag{
+ Name: "chain",
+ Usage: "include chain health status",
+ },
+ },
+
+ Action: func(cctx *cli.Context) error {
+ apic, closer, err := GetFullNodeAPIV1(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+ ctx := ReqContext(cctx)
+
+ inclChainStatus := cctx.Bool("chain")
+
+ status, err := apic.NodeStatus(ctx, inclChainStatus)
+ if err != nil {
+ return err
+ }
+
+ fmt.Printf("Sync Epoch: %d\n", status.SyncStatus.Epoch)
+ fmt.Printf("Epochs Behind: %d\n", status.SyncStatus.Behind)
+ fmt.Printf("Peers to Publish Messages: %d\n", status.PeerStatus.PeersToPublishMsgs)
+ fmt.Printf("Peers to Publish Blocks: %d\n", status.PeerStatus.PeersToPublishBlocks)
+
+ if inclChainStatus && status.SyncStatus.Epoch > uint64(build.Finality) {
+ var ok100, okFin string
+ if status.ChainStatus.BlocksPerTipsetLast100 >= 4.75 {
+ ok100 = "[OK]"
+ } else {
+ ok100 = "[UNHEALTHY]"
+ }
+ if status.ChainStatus.BlocksPerTipsetLastFinality >= 4.75 {
+ okFin = "[OK]"
+ } else {
+ okFin = "[UNHEALTHY]"
+ }
+
+ fmt.Printf("Blocks per TipSet in last 100 epochs: %f %s\n", status.ChainStatus.BlocksPerTipsetLast100, ok100)
+ fmt.Printf("Blocks per TipSet in last finality: %f %s\n", status.ChainStatus.BlocksPerTipsetLastFinality, okFin)
+ }
+
+ return nil
+ },
+}
diff --git a/cli/sync.go b/cli/sync.go
index 223d50337..c7b010111 100644
--- a/cli/sync.go
+++ b/cli/sync.go
@@ -12,6 +12,7 @@ import (
"github.com/urfave/cli/v2"
"github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
)
@@ -240,7 +241,7 @@ var SyncCheckpointCmd = &cli.Command{
},
}
-func SyncWait(ctx context.Context, napi api.FullNode, watch bool) error {
+func SyncWait(ctx context.Context, napi v0api.FullNode, watch bool) error {
tick := time.Second / 4
lastLines := 0
diff --git a/cli/test/util.go b/cli/test/util.go
deleted file mode 100644
index e3930dc83..000000000
--- a/cli/test/util.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package test
-
-import "github.com/ipfs/go-log/v2"
-
-func QuietMiningLogs() {
- _ = log.SetLogLevel("miner", "ERROR")
- _ = log.SetLogLevel("chainstore", "ERROR")
- _ = log.SetLogLevel("chain", "ERROR")
- _ = log.SetLogLevel("sub", "ERROR")
- _ = log.SetLogLevel("storageminer", "ERROR")
- _ = log.SetLogLevel("pubsub", "ERROR")
-}
diff --git a/cli/util.go b/cli/util.go
index fb555e320..3183e21cf 100644
--- a/cli/util.go
+++ b/cli/util.go
@@ -10,12 +10,12 @@ import (
"github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
)
-func parseTipSet(ctx context.Context, api api.FullNode, vals []string) (*types.TipSet, error) {
+func parseTipSet(ctx context.Context, api v0api.FullNode, vals []string) (*types.TipSet, error) {
var headers []*types.BlockHeader
for _, c := range vals {
blkc, err := cid.Decode(c)
diff --git a/cli/util/api.go b/cli/util/api.go
index ce5945f2e..ec8261604 100644
--- a/cli/util/api.go
+++ b/cli/util/api.go
@@ -18,6 +18,8 @@ import (
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/client"
+ "github.com/filecoin-project/lotus/api/v0api"
+ "github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/node/repo"
)
@@ -133,13 +135,13 @@ func GetAPIInfo(ctx *cli.Context, t repo.RepoType) (APIInfo, error) {
}, nil
}
-func GetRawAPI(ctx *cli.Context, t repo.RepoType) (string, http.Header, error) {
+func GetRawAPI(ctx *cli.Context, t repo.RepoType, version string) (string, http.Header, error) {
ainfo, err := GetAPIInfo(ctx, t)
if err != nil {
return "", nil, xerrors.Errorf("could not get API info: %w", err)
}
- addr, err := ainfo.DialArgs()
+ addr, err := ainfo.DialArgs(version)
if err != nil {
return "", nil, xerrors.Errorf("could not get DialArgs: %w", err)
}
@@ -165,25 +167,38 @@ func GetAPI(ctx *cli.Context) (api.Common, jsonrpc.ClientCloser, error) {
return tn.(api.FullNode), func() {}, nil
}
- addr, headers, err := GetRawAPI(ctx, t)
+ addr, headers, err := GetRawAPI(ctx, t, "v0")
if err != nil {
return nil, nil, err
}
- return client.NewCommonRPC(ctx.Context, addr, headers)
+ return client.NewCommonRPCV0(ctx.Context, addr, headers)
}
-func GetFullNodeAPI(ctx *cli.Context) (api.FullNode, jsonrpc.ClientCloser, error) {
+func GetFullNodeAPI(ctx *cli.Context) (v0api.FullNode, jsonrpc.ClientCloser, error) {
if tn, ok := ctx.App.Metadata["testnode-full"]; ok {
- return tn.(api.FullNode), func() {}, nil
+ return &v0api.WrapperV1Full{FullNode: tn.(v1api.FullNode)}, func() {}, nil
}
- addr, headers, err := GetRawAPI(ctx, repo.FullNode)
+ addr, headers, err := GetRawAPI(ctx, repo.FullNode, "v0")
if err != nil {
return nil, nil, err
}
- return client.NewFullNodeRPC(ctx.Context, addr, headers)
+ return client.NewFullNodeRPCV0(ctx.Context, addr, headers)
+}
+
+func GetFullNodeAPIV1(ctx *cli.Context) (v1api.FullNode, jsonrpc.ClientCloser, error) {
+ if tn, ok := ctx.App.Metadata["testnode-full"]; ok {
+ return tn.(v1api.FullNode), func() {}, nil
+ }
+
+ addr, headers, err := GetRawAPI(ctx, repo.FullNode, "v1")
+ if err != nil {
+ return nil, nil, err
+ }
+
+ return client.NewFullNodeRPCV1(ctx.Context, addr, headers)
}
type GetStorageMinerOptions struct {
@@ -206,7 +221,7 @@ func GetStorageMinerAPI(ctx *cli.Context, opts ...GetStorageMinerOption) (api.St
return tn.(api.StorageMiner), func() {}, nil
}
- addr, headers, err := GetRawAPI(ctx, repo.StorageMiner)
+ addr, headers, err := GetRawAPI(ctx, repo.StorageMiner, "v0")
if err != nil {
return nil, nil, err
}
@@ -227,25 +242,34 @@ func GetStorageMinerAPI(ctx *cli.Context, opts ...GetStorageMinerOption) (api.St
addr = u.String()
}
- return client.NewStorageMinerRPC(ctx.Context, addr, headers)
+ return client.NewStorageMinerRPCV0(ctx.Context, addr, headers)
}
func GetWorkerAPI(ctx *cli.Context) (api.Worker, jsonrpc.ClientCloser, error) {
- addr, headers, err := GetRawAPI(ctx, repo.Worker)
+ addr, headers, err := GetRawAPI(ctx, repo.Worker, "v0")
if err != nil {
return nil, nil, err
}
- return client.NewWorkerRPC(ctx.Context, addr, headers)
+ return client.NewWorkerRPCV0(ctx.Context, addr, headers)
}
func GetGatewayAPI(ctx *cli.Context) (api.Gateway, jsonrpc.ClientCloser, error) {
- addr, headers, err := GetRawAPI(ctx, repo.FullNode)
+ addr, headers, err := GetRawAPI(ctx, repo.FullNode, "v1")
if err != nil {
return nil, nil, err
}
- return client.NewGatewayRPC(ctx.Context, addr, headers)
+ return client.NewGatewayRPCV1(ctx.Context, addr, headers)
+}
+
+func GetGatewayAPIV0(ctx *cli.Context) (v0api.Gateway, jsonrpc.ClientCloser, error) {
+ addr, headers, err := GetRawAPI(ctx, repo.FullNode, "v0")
+ if err != nil {
+ return nil, nil, err
+ }
+
+ return client.NewGatewayRPCV0(ctx.Context, addr, headers)
}
func DaemonContext(cctx *cli.Context) context.Context {
diff --git a/cli/util/apiinfo.go b/cli/util/apiinfo.go
index 1f9a83769..41ca18c61 100644
--- a/cli/util/apiinfo.go
+++ b/cli/util/apiinfo.go
@@ -36,7 +36,7 @@ func ParseApiInfo(s string) APIInfo {
}
}
-func (a APIInfo) DialArgs() (string, error) {
+func (a APIInfo) DialArgs(version string) (string, error) {
ma, err := multiaddr.NewMultiaddr(a.Addr)
if err == nil {
_, addr, err := manet.DialArgs(ma)
@@ -44,14 +44,14 @@ func (a APIInfo) DialArgs() (string, error) {
return "", err
}
- return "ws://" + addr + "/rpc/v0", nil
+ return "ws://" + addr + "/rpc/" + version, nil
}
_, err = url.Parse(a.Addr)
if err != nil {
return "", err
}
- return a.Addr + "/rpc/v0", nil
+ return a.Addr + "/rpc/" + version, nil
}
func (a APIInfo) Host() (string, error) {
diff --git a/cli/wait.go b/cli/wait.go
index 98fc9c0d8..ea897d5ad 100644
--- a/cli/wait.go
+++ b/cli/wait.go
@@ -12,7 +12,7 @@ var WaitApiCmd = &cli.Command{
Usage: "Wait for lotus api to come online",
Action: func(cctx *cli.Context) error {
for i := 0; i < 30; i++ {
- api, closer, err := GetFullNodeAPI(cctx)
+ api, closer, err := GetAPI(cctx)
if err != nil {
fmt.Printf("Not online yet... (%s)\n", err)
time.Sleep(time.Second)
diff --git a/cmd/chain-noise/main.go b/cmd/chain-noise/main.go
index 37d623ce2..8106ce592 100644
--- a/cmd/chain-noise/main.go
+++ b/cmd/chain-noise/main.go
@@ -8,7 +8,7 @@ import (
"time"
"github.com/filecoin-project/go-address"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
@@ -72,7 +72,7 @@ var runCmd = &cli.Command{
},
}
-func sendSmallFundsTxs(ctx context.Context, api api.FullNode, from address.Address, rate, limit int) error {
+func sendSmallFundsTxs(ctx context.Context, api v0api.FullNode, from address.Address, rate, limit int) error {
var sendSet []address.Address
for i := 0; i < 20; i++ {
naddr, err := api.WalletNew(ctx, types.KTSecp256k1)
diff --git a/cmd/lotus-chainwatch/processor/miner.go b/cmd/lotus-chainwatch/processor/miner.go
index 5f2ef55dd..f3514df88 100644
--- a/cmd/lotus-chainwatch/processor/miner.go
+++ b/cmd/lotus-chainwatch/processor/miner.go
@@ -14,7 +14,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
@@ -1026,7 +1026,7 @@ func (p *Processor) storeMinersPower(miners []minerActorInfo) error {
}
// load the power actor state clam as an adt.Map at the tipset `ts`.
-func getPowerActorState(ctx context.Context, api api.FullNode, ts types.TipSetKey) (power.State, error) {
+func getPowerActorState(ctx context.Context, api v0api.FullNode, ts types.TipSetKey) (power.State, error) {
powerActor, err := api.StateGetActor(ctx, power.Address, ts)
if err != nil {
return nil, err
diff --git a/cmd/lotus-chainwatch/processor/processor.go b/cmd/lotus-chainwatch/processor/processor.go
index 8da6b08cc..af5935d47 100644
--- a/cmd/lotus-chainwatch/processor/processor.go
+++ b/cmd/lotus-chainwatch/processor/processor.go
@@ -17,7 +17,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/chain/types"
cw_util "github.com/filecoin-project/lotus/cmd/lotus-chainwatch/util"
"github.com/filecoin-project/lotus/lib/parmap"
@@ -28,7 +28,7 @@ var log = logging.Logger("processor")
type Processor struct {
db *sql.DB
- node api.FullNode
+ node v0api.FullNode
ctxStore *cw_util.APIIpldStore
genesisTs *types.TipSet
@@ -52,7 +52,7 @@ type actorInfo struct {
state string
}
-func NewProcessor(ctx context.Context, db *sql.DB, node api.FullNode, batch int) *Processor {
+func NewProcessor(ctx context.Context, db *sql.DB, node v0api.FullNode, batch int) *Processor {
ctxStore := cw_util.NewAPIIpldStore(ctx, node)
return &Processor{
db: db,
diff --git a/cmd/lotus-chainwatch/run.go b/cmd/lotus-chainwatch/run.go
index 64f242755..6e47a100d 100644
--- a/cmd/lotus-chainwatch/run.go
+++ b/cmd/lotus-chainwatch/run.go
@@ -8,6 +8,8 @@ import (
"os"
"strings"
+ "github.com/filecoin-project/lotus/api/v0api"
+
_ "github.com/lib/pq"
"github.com/filecoin-project/go-jsonrpc"
@@ -15,7 +17,6 @@ import (
"github.com/urfave/cli/v2"
"golang.org/x/xerrors"
- "github.com/filecoin-project/lotus/api"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/cmd/lotus-chainwatch/processor"
"github.com/filecoin-project/lotus/cmd/lotus-chainwatch/scheduler"
@@ -44,7 +45,7 @@ var runCmd = &cli.Command{
return err
}
- var api api.FullNode
+ var api v0api.FullNode
var closer jsonrpc.ClientCloser
var err error
if tokenMaddr := cctx.String("api"); tokenMaddr != "" {
diff --git a/cmd/lotus-chainwatch/syncer/sync.go b/cmd/lotus-chainwatch/syncer/sync.go
index 37af9cce0..b5e9c73d6 100644
--- a/cmd/lotus-chainwatch/syncer/sync.go
+++ b/cmd/lotus-chainwatch/syncer/sync.go
@@ -13,7 +13,7 @@ import (
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/chain/types"
)
@@ -26,10 +26,10 @@ type Syncer struct {
lookbackLimit uint64
headerLk sync.Mutex
- node api.FullNode
+ node v0api.FullNode
}
-func NewSyncer(db *sql.DB, node api.FullNode, lookbackLimit uint64) *Syncer {
+func NewSyncer(db *sql.DB, node v0api.FullNode, lookbackLimit uint64) *Syncer {
return &Syncer{
db: db,
node: node,
diff --git a/cmd/lotus-chainwatch/util/api.go b/cmd/lotus-chainwatch/util/api.go
index cfda833e0..f8f22cbbf 100644
--- a/cmd/lotus-chainwatch/util/api.go
+++ b/cmd/lotus-chainwatch/util/api.go
@@ -5,13 +5,13 @@ import (
"net/http"
"github.com/filecoin-project/go-jsonrpc"
- "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/client"
+ "github.com/filecoin-project/lotus/api/v0api"
ma "github.com/multiformats/go-multiaddr"
manet "github.com/multiformats/go-multiaddr/net"
)
-func GetFullNodeAPIUsingCredentials(ctx context.Context, listenAddr, token string) (api.FullNode, jsonrpc.ClientCloser, error) {
+func GetFullNodeAPIUsingCredentials(ctx context.Context, listenAddr, token string) (v0api.FullNode, jsonrpc.ClientCloser, error) {
parsedAddr, err := ma.NewMultiaddr(listenAddr)
if err != nil {
return nil, nil, err
@@ -22,7 +22,7 @@ func GetFullNodeAPIUsingCredentials(ctx context.Context, listenAddr, token strin
return nil, nil, err
}
- return client.NewFullNodeRPC(ctx, apiURI(addr), apiHeaders(token))
+ return client.NewFullNodeRPCV0(ctx, apiURI(addr), apiHeaders(token))
}
func apiURI(addr string) string {
return "ws://" + addr + "/rpc/v0"
diff --git a/cmd/lotus-chainwatch/util/contextStore.go b/cmd/lotus-chainwatch/util/contextStore.go
index bd812581b..c93f87f9b 100644
--- a/cmd/lotus-chainwatch/util/contextStore.go
+++ b/cmd/lotus-chainwatch/util/contextStore.go
@@ -8,7 +8,7 @@ import (
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
)
// TODO extract this to a common location in lotus and reuse the code
@@ -16,10 +16,10 @@ import (
// APIIpldStore is required for AMT and HAMT access.
type APIIpldStore struct {
ctx context.Context
- api api.FullNode
+ api v0api.FullNode
}
-func NewAPIIpldStore(ctx context.Context, api api.FullNode) *APIIpldStore {
+func NewAPIIpldStore(ctx context.Context, api v0api.FullNode) *APIIpldStore {
return &APIIpldStore{
ctx: ctx,
api: api,
diff --git a/cmd/lotus-fountain/main.go b/cmd/lotus-fountain/main.go
index 79f08aa83..7ac598d8e 100644
--- a/cmd/lotus-fountain/main.go
+++ b/cmd/lotus-fountain/main.go
@@ -15,7 +15,7 @@ import (
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
@@ -143,7 +143,7 @@ func prepFundsHtml(box *rice.Box) http.HandlerFunc {
type handler struct {
ctx context.Context
- api api.FullNode
+ api v0api.FullNode
from address.Address
sendPerRequest types.FIL
diff --git a/cmd/lotus-gateway/api.go b/cmd/lotus-gateway/api.go
deleted file mode 100644
index 6799ef627..000000000
--- a/cmd/lotus-gateway/api.go
+++ /dev/null
@@ -1,411 +0,0 @@
-package main
-
-import (
- "context"
- "fmt"
- "time"
-
- "github.com/filecoin-project/go-address"
- "github.com/filecoin-project/go-bitfield"
- "github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/go-state-types/crypto"
- "github.com/filecoin-project/go-state-types/dline"
- "github.com/filecoin-project/go-state-types/network"
- "github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/build"
- "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
- "github.com/filecoin-project/lotus/chain/types"
- "github.com/filecoin-project/lotus/lib/sigs"
- _ "github.com/filecoin-project/lotus/lib/sigs/bls"
- _ "github.com/filecoin-project/lotus/lib/sigs/secp"
- "github.com/filecoin-project/lotus/node/impl/full"
- "github.com/ipfs/go-cid"
-)
-
-const (
- LookbackCap = time.Hour * 24
- StateWaitLookbackLimit = abi.ChainEpoch(20)
-)
-
-var (
- ErrLookbackTooLong = fmt.Errorf("lookbacks of more than %s are disallowed", LookbackCap)
-)
-
-// gatewayDepsAPI defines the API methods that the GatewayAPI depends on
-// (to make it easy to mock for tests)
-type gatewayDepsAPI interface {
- Version(context.Context) (api.APIVersion, error)
- ChainGetBlockMessages(context.Context, cid.Cid) (*api.BlockMessages, error)
- ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
- ChainGetNode(ctx context.Context, p string) (*api.IpldObject, error)
- ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
- ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
- ChainHasObj(context.Context, cid.Cid) (bool, error)
- ChainHead(ctx context.Context) (*types.TipSet, error)
- ChainNotify(context.Context) (<-chan []*api.HeadChange, error)
- ChainReadObj(context.Context, cid.Cid) ([]byte, error)
- GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
- MpoolPushUntrusted(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
- MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
- MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
- MsigGetPending(ctx context.Context, addr address.Address, ts types.TipSetKey) ([]*api.MsigTransaction, error)
- StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
- StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error)
- StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
- StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)
- StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
- StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
- StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error)
- StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error)
- StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
- StateSearchMsgLimited(ctx context.Context, msg cid.Cid, lookbackLimit abi.ChainEpoch) (*api.MsgLookup, error)
- StateWaitMsgLimited(ctx context.Context, msg cid.Cid, confidence uint64, h abi.ChainEpoch) (*api.MsgLookup, error)
- StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*api.ActorState, error)
- StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)
- StateMinerFaults(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error)
- StateMinerRecoveries(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error)
- StateMinerInfo(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error)
- StateMinerDeadlines(context.Context, address.Address, types.TipSetKey) ([]api.Deadline, error)
- StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error)
- StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error)
- StateCirculatingSupply(context.Context, types.TipSetKey) (abi.TokenAmount, error)
- StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
- StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
- StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (api.CirculatingSupply, error)
-}
-
-type GatewayAPI struct {
- api gatewayDepsAPI
- lookbackCap time.Duration
- stateWaitLookbackLimit abi.ChainEpoch
-}
-
-// NewGatewayAPI creates a new GatewayAPI with the default lookback cap
-func NewGatewayAPI(api gatewayDepsAPI) *GatewayAPI {
- return newGatewayAPI(api, LookbackCap, StateWaitLookbackLimit)
-}
-
-// used by the tests
-func newGatewayAPI(api gatewayDepsAPI, lookbackCap time.Duration, stateWaitLookbackLimit abi.ChainEpoch) *GatewayAPI {
- return &GatewayAPI{api: api, lookbackCap: lookbackCap, stateWaitLookbackLimit: stateWaitLookbackLimit}
-}
-
-func (a *GatewayAPI) checkTipsetKey(ctx context.Context, tsk types.TipSetKey) error {
- if tsk.IsEmpty() {
- return nil
- }
-
- ts, err := a.api.ChainGetTipSet(ctx, tsk)
- if err != nil {
- return err
- }
-
- return a.checkTipset(ts)
-}
-
-func (a *GatewayAPI) checkTipset(ts *types.TipSet) error {
- at := time.Unix(int64(ts.Blocks()[0].Timestamp), 0)
- if err := a.checkTimestamp(at); err != nil {
- return fmt.Errorf("bad tipset: %w", err)
- }
- return nil
-}
-
-func (a *GatewayAPI) checkTipsetHeight(ts *types.TipSet, h abi.ChainEpoch) error {
- tsBlock := ts.Blocks()[0]
- heightDelta := time.Duration(uint64(tsBlock.Height-h)*build.BlockDelaySecs) * time.Second
- timeAtHeight := time.Unix(int64(tsBlock.Timestamp), 0).Add(-heightDelta)
-
- if err := a.checkTimestamp(timeAtHeight); err != nil {
- return fmt.Errorf("bad tipset height: %w", err)
- }
- return nil
-}
-
-func (a *GatewayAPI) checkTimestamp(at time.Time) error {
- if time.Since(at) > a.lookbackCap {
- return ErrLookbackTooLong
- }
-
- return nil
-}
-
-func (a *GatewayAPI) Version(ctx context.Context) (api.APIVersion, error) {
- return a.api.Version(ctx)
-}
-
-func (a *GatewayAPI) ChainGetBlockMessages(ctx context.Context, c cid.Cid) (*api.BlockMessages, error) {
- return a.api.ChainGetBlockMessages(ctx, c)
-}
-
-func (a *GatewayAPI) ChainHasObj(ctx context.Context, c cid.Cid) (bool, error) {
- return a.api.ChainHasObj(ctx, c)
-}
-
-func (a *GatewayAPI) ChainHead(ctx context.Context) (*types.TipSet, error) {
- // TODO: cache and invalidate cache when timestamp is up (or have internal ChainNotify)
-
- return a.api.ChainHead(ctx)
-}
-
-func (a *GatewayAPI) ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error) {
- return a.api.ChainGetMessage(ctx, mc)
-}
-
-func (a *GatewayAPI) ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) {
- return a.api.ChainGetTipSet(ctx, tsk)
-}
-
-func (a *GatewayAPI) ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) {
- var ts *types.TipSet
- if tsk.IsEmpty() {
- head, err := a.api.ChainHead(ctx)
- if err != nil {
- return nil, err
- }
- ts = head
- } else {
- gts, err := a.api.ChainGetTipSet(ctx, tsk)
- if err != nil {
- return nil, err
- }
- ts = gts
- }
-
- // Check if the tipset key refers to a tipset that's too far in the past
- if err := a.checkTipset(ts); err != nil {
- return nil, err
- }
-
- // Check if the height is too far in the past
- if err := a.checkTipsetHeight(ts, h); err != nil {
- return nil, err
- }
-
- return a.api.ChainGetTipSetByHeight(ctx, h, tsk)
-}
-
-func (a *GatewayAPI) ChainGetNode(ctx context.Context, p string) (*api.IpldObject, error) {
- return a.api.ChainGetNode(ctx, p)
-}
-
-func (a *GatewayAPI) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, error) {
- return a.api.ChainNotify(ctx)
-}
-
-func (a *GatewayAPI) ChainReadObj(ctx context.Context, c cid.Cid) ([]byte, error) {
- return a.api.ChainReadObj(ctx, c)
-}
-
-func (a *GatewayAPI) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
-
- return a.api.GasEstimateMessageGas(ctx, msg, spec, tsk)
-}
-
-func (a *GatewayAPI) MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error) {
- // TODO: additional anti-spam checks
- return a.api.MpoolPushUntrusted(ctx, sm)
-}
-
-func (a *GatewayAPI) MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return types.NewInt(0), err
- }
-
- return a.api.MsigGetAvailableBalance(ctx, addr, tsk)
-}
-
-func (a *GatewayAPI) MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error) {
- if err := a.checkTipsetKey(ctx, start); err != nil {
- return types.NewInt(0), err
- }
- if err := a.checkTipsetKey(ctx, end); err != nil {
- return types.NewInt(0), err
- }
-
- return a.api.MsigGetVested(ctx, addr, start, end)
-}
-
-func (a *GatewayAPI) MsigGetPending(ctx context.Context, addr address.Address, tsk types.TipSetKey) ([]*api.MsigTransaction, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
-
- return a.api.MsigGetPending(ctx, addr, tsk)
-}
-
-func (a *GatewayAPI) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return address.Undef, err
- }
-
- return a.api.StateAccountKey(ctx, addr, tsk)
-}
-
-func (a *GatewayAPI) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return api.DealCollateralBounds{}, err
- }
-
- return a.api.StateDealProviderCollateralBounds(ctx, size, verified, tsk)
-}
-
-func (a *GatewayAPI) StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
-
- return a.api.StateGetActor(ctx, actor, tsk)
-}
-
-func (a *GatewayAPI) StateGetReceipt(ctx context.Context, c cid.Cid, tsk types.TipSetKey) (*types.MessageReceipt, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
-
- return a.api.StateGetReceipt(ctx, c, tsk)
-}
-
-func (a *GatewayAPI) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
-
- return a.api.StateListMiners(ctx, tsk)
-}
-
-func (a *GatewayAPI) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return address.Undef, err
- }
-
- return a.api.StateLookupID(ctx, addr, tsk)
-}
-
-func (a *GatewayAPI) StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return api.MarketBalance{}, err
- }
-
- return a.api.StateMarketBalance(ctx, addr, tsk)
-}
-
-func (a *GatewayAPI) StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
-
- return a.api.StateMarketStorageDeal(ctx, dealId, tsk)
-}
-
-func (a *GatewayAPI) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return network.VersionMax, err
- }
-
- return a.api.StateNetworkVersion(ctx, tsk)
-}
-
-func (a *GatewayAPI) StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) {
- return a.api.StateSearchMsgLimited(ctx, msg, a.stateWaitLookbackLimit)
-}
-
-func (a *GatewayAPI) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error) {
- return a.api.StateWaitMsgLimited(ctx, msg, confidence, a.stateWaitLookbackLimit)
-}
-
-func (a *GatewayAPI) StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*api.ActorState, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
- return a.api.StateReadState(ctx, actor, tsk)
-}
-
-func (a *GatewayAPI) StateMinerPower(ctx context.Context, m address.Address, tsk types.TipSetKey) (*api.MinerPower, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
- return a.api.StateMinerPower(ctx, m, tsk)
-}
-
-func (a *GatewayAPI) StateMinerFaults(ctx context.Context, m address.Address, tsk types.TipSetKey) (bitfield.BitField, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return bitfield.BitField{}, err
- }
- return a.api.StateMinerFaults(ctx, m, tsk)
-}
-func (a *GatewayAPI) StateMinerRecoveries(ctx context.Context, m address.Address, tsk types.TipSetKey) (bitfield.BitField, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return bitfield.BitField{}, err
- }
- return a.api.StateMinerRecoveries(ctx, m, tsk)
-}
-
-func (a *GatewayAPI) StateMinerInfo(ctx context.Context, m address.Address, tsk types.TipSetKey) (miner.MinerInfo, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return miner.MinerInfo{}, err
- }
- return a.api.StateMinerInfo(ctx, m, tsk)
-}
-
-func (a *GatewayAPI) StateMinerDeadlines(ctx context.Context, m address.Address, tsk types.TipSetKey) ([]api.Deadline, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
- return a.api.StateMinerDeadlines(ctx, m, tsk)
-}
-
-func (a *GatewayAPI) StateMinerAvailableBalance(ctx context.Context, m address.Address, tsk types.TipSetKey) (types.BigInt, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return types.BigInt{}, err
- }
- return a.api.StateMinerAvailableBalance(ctx, m, tsk)
-}
-
-func (a *GatewayAPI) StateMinerProvingDeadline(ctx context.Context, m address.Address, tsk types.TipSetKey) (*dline.Info, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
- return a.api.StateMinerProvingDeadline(ctx, m, tsk)
-}
-
-func (a *GatewayAPI) StateCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (abi.TokenAmount, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return types.BigInt{}, err
- }
- return a.api.StateCirculatingSupply(ctx, tsk)
-}
-
-func (a *GatewayAPI) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
- return a.api.StateSectorGetInfo(ctx, maddr, n, tsk)
-}
-
-func (a *GatewayAPI) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return nil, err
- }
- return a.api.StateVerifiedClientStatus(ctx, addr, tsk)
-}
-
-func (a *GatewayAPI) StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) {
- if err := a.checkTipsetKey(ctx, tsk); err != nil {
- return api.CirculatingSupply{}, err
- }
- return a.api.StateVMCirculatingSupplyInternal(ctx, tsk)
-}
-
-func (a *GatewayAPI) WalletVerify(ctx context.Context, k address.Address, msg []byte, sig *crypto.Signature) (bool, error) {
- return sigs.Verify(sig, k, msg) == nil, nil
-}
-
-var _ api.Gateway = (*GatewayAPI)(nil)
-var _ full.ChainModuleAPI = (*GatewayAPI)(nil)
-var _ full.GasModuleAPI = (*GatewayAPI)(nil)
-var _ full.MpoolModuleAPI = (*GatewayAPI)(nil)
-var _ full.StateModuleAPI = (*GatewayAPI)(nil)
diff --git a/cmd/lotus-gateway/main.go b/cmd/lotus-gateway/main.go
index cbb143930..cfda02d86 100644
--- a/cmd/lotus-gateway/main.go
+++ b/cmd/lotus-gateway/main.go
@@ -2,25 +2,31 @@ package main
import (
"context"
+ "fmt"
"net"
- "net/http"
"os"
- "contrib.go.opencensus.io/exporter/prometheus"
- "github.com/filecoin-project/go-jsonrpc"
- promclient "github.com/prometheus/client_golang/prometheus"
- "go.opencensus.io/tag"
-
- "github.com/filecoin-project/lotus/build"
- lcli "github.com/filecoin-project/lotus/cli"
- "github.com/filecoin-project/lotus/lib/lotuslog"
- "github.com/filecoin-project/lotus/metrics"
+ "github.com/urfave/cli/v2"
+ "go.opencensus.io/stats/view"
+ "golang.org/x/xerrors"
logging "github.com/ipfs/go-log/v2"
- "go.opencensus.io/stats/view"
- "github.com/gorilla/mux"
- "github.com/urfave/cli/v2"
+ "github.com/filecoin-project/go-jsonrpc"
+ "github.com/filecoin-project/go-state-types/abi"
+
+ manet "github.com/multiformats/go-multiaddr/net"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/lotus/api/client"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/types"
+ lcli "github.com/filecoin-project/lotus/cli"
+ cliutil "github.com/filecoin-project/lotus/cli/util"
+ "github.com/filecoin-project/lotus/gateway"
+ "github.com/filecoin-project/lotus/lib/lotuslog"
+ "github.com/filecoin-project/lotus/metrics"
+ "github.com/filecoin-project/lotus/node"
)
var log = logging.Logger("gateway")
@@ -30,6 +36,7 @@ func main() {
local := []*cli.Command{
runCmd,
+ checkCmd,
}
app := &cli.App{
@@ -49,11 +56,60 @@ func main() {
app.Setup()
if err := app.Run(os.Args); err != nil {
- log.Warnf("%+v", err)
+ log.Errorf("%+v", err)
+ os.Exit(1)
return
}
}
+var checkCmd = &cli.Command{
+ Name: "check",
+ Usage: "performs a simple check to verify that a connection can be made to a gateway",
+ ArgsUsage: "[apiInfo]",
+ Description: `Any valid value for FULLNODE_API_INFO is a valid argument to the check command.
+
+ Examples
+ - ws://127.0.0.1:2346
+ - http://127.0.0.1:2346
+ - /ip4/127.0.0.1/tcp/2346`,
+ Flags: []cli.Flag{},
+ Action: func(cctx *cli.Context) error {
+ ctx := lcli.ReqContext(cctx)
+ ctx, cancel := context.WithCancel(ctx)
+ defer cancel()
+
+ ainfo := cliutil.ParseApiInfo(cctx.Args().First())
+
+ darg, err := ainfo.DialArgs("v1")
+ if err != nil {
+ return err
+ }
+
+ api, closer, err := client.NewFullNodeRPCV1(ctx, darg, nil)
+ if err != nil {
+ return err
+ }
+
+ defer closer()
+
+ addr, err := address.NewIDAddress(100)
+ if err != nil {
+ return err
+ }
+
+ laddr, err := api.StateLookupID(ctx, addr, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ if laddr != addr {
+ return fmt.Errorf("looked up addresses does not match returned address, %s != %s", addr, laddr)
+ }
+
+ return nil
+ },
+}
+
var runCmd = &cli.Command{
Name: "run",
Usage: "Start api server",
@@ -67,14 +123,20 @@ var runCmd = &cli.Command{
Name: "api-max-req-size",
Usage: "maximum API request size accepted by the JSON RPC server",
},
+ &cli.DurationFlag{
+ Name: "api-max-lookback",
+ Usage: "maximum duration allowable for tipset lookbacks",
+ Value: gateway.DefaultLookbackCap,
+ },
+ &cli.Int64Flag{
+ Name: "api-wait-lookback-limit",
+ Usage: "maximum number of blocks to search back through for message inclusion",
+ Value: int64(gateway.DefaultStateWaitLookbackLimit),
+ },
},
Action: func(cctx *cli.Context) error {
log.Info("Starting lotus gateway")
- ctx := lcli.ReqContext(cctx)
- ctx, cancel := context.WithCancel(ctx)
- defer cancel()
-
// Register all metric views
if err := view.Register(
metrics.ChainNodeViews...,
@@ -82,65 +144,50 @@ var runCmd = &cli.Command{
log.Fatalf("Cannot register the view: %v", err)
}
- api, closer, err := lcli.GetFullNodeAPI(cctx)
+ api, closer, err := lcli.GetFullNodeAPIV1(cctx)
if err != nil {
return err
}
defer closer()
- address := cctx.String("listen")
- mux := mux.NewRouter()
-
- log.Info("Setting up API endpoint at " + address)
+ var (
+ lookbackCap = cctx.Duration("api-max-lookback")
+ address = cctx.String("listen")
+ waitLookback = abi.ChainEpoch(cctx.Int64("api-wait-lookback-limit"))
+ )
serverOptions := make([]jsonrpc.ServerOption, 0)
if maxRequestSize := cctx.Int("api-max-req-size"); maxRequestSize != 0 {
serverOptions = append(serverOptions, jsonrpc.WithMaxRequestSize(int64(maxRequestSize)))
}
- rpcServer := jsonrpc.NewServer(serverOptions...)
- rpcServer.Register("Filecoin", metrics.MetricedGatewayAPI(NewGatewayAPI(api)))
- mux.Handle("/rpc/v0", rpcServer)
+ log.Info("setting up API endpoint at " + address)
- registry := promclient.DefaultRegisterer.(*promclient.Registry)
- exporter, err := prometheus.NewExporter(prometheus.Options{
- Registry: registry,
- Namespace: "lotus_gw",
+ addr, err := net.ResolveTCPAddr("tcp", address)
+ if err != nil {
+ return xerrors.Errorf("failed to resolve endpoint address: %w", err)
+ }
+
+ maddr, err := manet.FromNetAddr(addr)
+ if err != nil {
+ return xerrors.Errorf("failed to convert endpoint address to multiaddr: %w", err)
+ }
+
+ gwapi := gateway.NewNode(api, lookbackCap, waitLookback)
+ h, err := gateway.Handler(gwapi, serverOptions...)
+ if err != nil {
+ return xerrors.Errorf("failed to set up gateway HTTP handler")
+ }
+
+ stopFunc, err := node.ServeRPC(h, "lotus-gateway", maddr)
+ if err != nil {
+ return xerrors.Errorf("failed to serve rpc endpoint: %w", err)
+ }
+
+ <-node.MonitorShutdown(nil, node.ShutdownHandler{
+ Component: "rpc",
+ StopFunc: stopFunc,
})
- if err != nil {
- return err
- }
- mux.Handle("/debug/metrics", exporter)
-
- mux.PathPrefix("/").Handler(http.DefaultServeMux)
-
- /*ah := &auth.Handler{
- Verify: nodeApi.AuthVerify,
- Next: mux.ServeHTTP,
- }*/
-
- srv := &http.Server{
- Handler: mux,
- BaseContext: func(listener net.Listener) context.Context {
- ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, "lotus-gateway"))
- return ctx
- },
- }
-
- go func() {
- <-ctx.Done()
- log.Warn("Shutting down...")
- if err := srv.Shutdown(context.TODO()); err != nil {
- log.Errorf("shutting down RPC server failed: %s", err)
- }
- log.Warn("Graceful shutdown successful")
- }()
-
- nl, err := net.Listen("tcp", address)
- if err != nil {
- return err
- }
-
- return srv.Serve(nl)
+ return nil
},
}
diff --git a/cmd/lotus-health/main.go b/cmd/lotus-health/main.go
index a766c0868..da90242c8 100644
--- a/cmd/lotus-health/main.go
+++ b/cmd/lotus-health/main.go
@@ -8,13 +8,14 @@ import (
"syscall"
"time"
+ "github.com/filecoin-project/lotus/api/v0api"
+
cid "github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
"github.com/urfave/cli/v2"
"github.com/filecoin-project/go-jsonrpc"
- "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
@@ -180,7 +181,7 @@ func checkWindow(window CidWindow, t int) bool {
* returns a slice of slices of Cids
* len of slice <= `t` - threshold
*/
-func updateWindow(ctx context.Context, a api.FullNode, w CidWindow, t int, r int, to time.Duration) (CidWindow, error) {
+func updateWindow(ctx context.Context, a v0api.FullNode, w CidWindow, t int, r int, to time.Duration) (CidWindow, error) {
head, err := getHead(ctx, a, r, to)
if err != nil {
return nil, err
@@ -194,7 +195,7 @@ func updateWindow(ctx context.Context, a api.FullNode, w CidWindow, t int, r int
* retries if API no available
* returns tipset
*/
-func getHead(ctx context.Context, a api.FullNode, r int, t time.Duration) (*types.TipSet, error) {
+func getHead(ctx context.Context, a v0api.FullNode, r int, t time.Duration) (*types.TipSet, error) {
for i := 0; i < r; i++ {
head, err := a.ChainHead(ctx)
if err != nil && i == (r-1) {
@@ -226,7 +227,7 @@ func appendCIDsToWindow(w CidWindow, c []cid.Cid, t int) CidWindow {
/*
* wait for node to sync
*/
-func waitForSyncComplete(ctx context.Context, a api.FullNode, r int, t time.Duration) error {
+func waitForSyncComplete(ctx context.Context, a v0api.FullNode, r int, t time.Duration) error {
for {
select {
case <-ctx.Done():
@@ -248,7 +249,7 @@ func waitForSyncComplete(ctx context.Context, a api.FullNode, r int, t time.Dura
* A thin wrapper around lotus cli GetFullNodeAPI
* Adds retry logic
*/
-func getFullNodeAPI(ctx *cli.Context, r int, t time.Duration) (api.FullNode, jsonrpc.ClientCloser, error) {
+func getFullNodeAPI(ctx *cli.Context, r int, t time.Duration) (v0api.FullNode, jsonrpc.ClientCloser, error) {
for i := 0; i < r; i++ {
api, closer, err := lcli.GetFullNodeAPI(ctx)
if err != nil && i == (r-1) {
diff --git a/cmd/lotus-seal-worker/main.go b/cmd/lotus-seal-worker/main.go
index 5a78c6dac..adcf0f869 100644
--- a/cmd/lotus-seal-worker/main.go
+++ b/cmd/lotus-seal-worker/main.go
@@ -28,7 +28,6 @@ import (
"github.com/filecoin-project/go-statestore"
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/apistruct"
"github.com/filecoin-project/lotus/build"
lcli "github.com/filecoin-project/lotus/cli"
cliutil "github.com/filecoin-project/lotus/cli/util"
@@ -64,9 +63,10 @@ func main() {
}
app := &cli.App{
- Name: "lotus-worker",
- Usage: "Remote miner worker",
- Version: build.UserVersion(),
+ Name: "lotus-worker",
+ Usage: "Remote miner worker",
+ Version: build.UserVersion(),
+ EnableBashCompletion: true,
Flags: []cli.Flag{
&cli.StringFlag{
Name: FlagWorkerRepo,
@@ -211,8 +211,8 @@ var runCmd = &cli.Command{
if err != nil {
return err
}
- if v.APIVersion != api.MinerAPIVersion {
- return xerrors.Errorf("lotus-miner API version doesn't match: expected: %s", api.APIVersion{APIVersion: api.MinerAPIVersion})
+ if v.APIVersion != api.MinerAPIVersion0 {
+ return xerrors.Errorf("lotus-miner API version doesn't match: expected: %s", api.APIVersion{APIVersion: api.MinerAPIVersion0})
}
log.Infof("Remote version %s", v)
@@ -362,11 +362,12 @@ var runCmd = &cli.Command{
return xerrors.Errorf("could not get api info: %w", err)
}
- remote := stores.NewRemote(localStore, nodeApi, sminfo.AuthHeader(), cctx.Int("parallel-fetch-limit"))
+ remote := stores.NewRemote(localStore, nodeApi, sminfo.AuthHeader(), cctx.Int("parallel-fetch-limit"),
+ &stores.DefaultPartialFileHandler{})
- fh := &stores.FetchHandler{Local: localStore}
+ fh := &stores.FetchHandler{Local: localStore, PfHandler: &stores.DefaultPartialFileHandler{}}
remoteHandler := func(w http.ResponseWriter, r *http.Request) {
- if !auth.HasPerm(r.Context(), nil, apistruct.PermAdmin) {
+ if !auth.HasPerm(r.Context(), nil, api.PermAdmin) {
w.WriteHeader(401)
_ = json.NewEncoder(w).Encode(struct{ Error string }{"unauthorized: missing admin permission"})
return
@@ -394,7 +395,7 @@ var runCmd = &cli.Command{
readerHandler, readerServerOpt := rpcenc.ReaderParamDecoder()
rpcServer := jsonrpc.NewServer(readerServerOpt)
- rpcServer.Register("Filecoin", apistruct.PermissionedWorkerAPI(metrics.MetricedWorkerAPI(workerApi)))
+ rpcServer.Register("Filecoin", api.PermissionedWorkerAPI(metrics.MetricedWorkerAPI(workerApi)))
mux.Handle("/rpc/v0", rpcServer)
mux.Handle("/rpc/streams/v0/push/{uuid}", readerHandler)
diff --git a/cmd/lotus-seal-worker/rpc.go b/cmd/lotus-seal-worker/rpc.go
index 3649d6c8f..6a6263671 100644
--- a/cmd/lotus-seal-worker/rpc.go
+++ b/cmd/lotus-seal-worker/rpc.go
@@ -26,7 +26,7 @@ type worker struct {
}
func (w *worker) Version(context.Context) (api.Version, error) {
- return api.WorkerAPIVersion, nil
+ return api.WorkerAPIVersion0, nil
}
func (w *worker) StorageAddLocal(ctx context.Context, path string) error {
diff --git a/cmd/lotus-seed/genesis.go b/cmd/lotus-seed/genesis.go
index d5f1d5ad6..66de93888 100644
--- a/cmd/lotus-seed/genesis.go
+++ b/cmd/lotus-seed/genesis.go
@@ -9,6 +9,8 @@ import (
"strconv"
"strings"
+ "github.com/filecoin-project/go-state-types/network"
+
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/vm"
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
@@ -39,6 +41,7 @@ var genesisCmd = &cli.Command{
genesisAddMsigsCmd,
genesisSetVRKCmd,
genesisSetRemainderCmd,
+ genesisSetActorVersionCmd,
genesisCarCmd,
},
}
@@ -56,6 +59,7 @@ var genesisNewCmd = &cli.Command{
return xerrors.New("seed genesis new [genesis.json]")
}
out := genesis.Template{
+ NetworkVersion: build.NewestNetworkVersion,
Accounts: []genesis.Actor{},
Miners: []genesis.Miner{},
VerifregRootKey: gen.DefaultVerifregRootkeyActor,
@@ -503,6 +507,53 @@ var genesisSetRemainderCmd = &cli.Command{
},
}
+var genesisSetActorVersionCmd = &cli.Command{
+ Name: "set-network-version",
+ Usage: "Set the version that this network will start from",
+ ArgsUsage: "",
+ Action: func(cctx *cli.Context) error {
+ if cctx.Args().Len() != 2 {
+ return fmt.Errorf("must specify genesis file and network version (e.g. '0'")
+ }
+
+ genf, err := homedir.Expand(cctx.Args().First())
+ if err != nil {
+ return err
+ }
+
+ var template genesis.Template
+ b, err := ioutil.ReadFile(genf)
+ if err != nil {
+ return xerrors.Errorf("read genesis template: %w", err)
+ }
+
+ if err := json.Unmarshal(b, &template); err != nil {
+ return xerrors.Errorf("unmarshal genesis template: %w", err)
+ }
+
+ nv, err := strconv.ParseUint(cctx.Args().Get(1), 10, 64)
+ if err != nil {
+ return xerrors.Errorf("parsing network version: %w", err)
+ }
+
+ if nv > uint64(build.NewestNetworkVersion) {
+ return xerrors.Errorf("invalid network version: %d", nv)
+ }
+
+ template.NetworkVersion = network.Version(nv)
+
+ b, err = json.MarshalIndent(&template, "", " ")
+ if err != nil {
+ return err
+ }
+
+ if err := ioutil.WriteFile(genf, b, 0644); err != nil {
+ return err
+ }
+ return nil
+ },
+}
+
var genesisCarCmd = &cli.Command{
Name: "car",
Description: "write genesis car file",
diff --git a/cmd/lotus-seed/main.go b/cmd/lotus-seed/main.go
index c4e62b419..42f4b74e4 100644
--- a/cmd/lotus-seed/main.go
+++ b/cmd/lotus-seed/main.go
@@ -94,6 +94,10 @@ var preSealCmd = &cli.Command{
Name: "fake-sectors",
Value: false,
},
+ &cli.IntFlag{
+ Name: "network-version",
+ Usage: "specify network version",
+ },
},
Action: func(c *cli.Context) error {
sdir := c.String("sector-dir")
@@ -129,7 +133,12 @@ var preSealCmd = &cli.Command{
}
sectorSize := abi.SectorSize(sectorSizeInt)
- spt, err := miner.SealProofTypeFromSectorSize(sectorSize, network.Version0)
+ nv := build.NewestNetworkVersion
+ if c.IsSet("network-version") {
+ nv = network.Version(c.Uint64("network-version"))
+ }
+
+ spt, err := miner.SealProofTypeFromSectorSize(sectorSize, nv)
if err != nil {
return err
}
diff --git a/cmd/lotus-shed/actor.go b/cmd/lotus-shed/actor.go
new file mode 100644
index 000000000..9d242e2df
--- /dev/null
+++ b/cmd/lotus-shed/actor.go
@@ -0,0 +1,737 @@
+package main
+
+import (
+ "fmt"
+ "os"
+
+ "github.com/fatih/color"
+ "github.com/urfave/cli/v2"
+ "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/lotus/api"
+
+ miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
+
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/actors"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
+ "github.com/filecoin-project/lotus/chain/types"
+ lcli "github.com/filecoin-project/lotus/cli"
+ "github.com/filecoin-project/lotus/lib/tablewriter"
+)
+
+var actorCmd = &cli.Command{
+ Name: "actor",
+ Usage: "manipulate the miner actor",
+ Subcommands: []*cli.Command{
+ actorWithdrawCmd,
+ actorSetOwnerCmd,
+ actorControl,
+ actorProposeChangeWorker,
+ actorConfirmChangeWorker,
+ },
+}
+
+var actorWithdrawCmd = &cli.Command{
+ Name: "withdraw",
+ Usage: "withdraw available balance",
+ ArgsUsage: "[amount (FIL)]",
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "actor",
+ Usage: "specify the address of miner actor",
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ var maddr address.Address
+ if act := cctx.String("actor"); act != "" {
+ var err error
+ maddr, err = address.NewFromString(act)
+ if err != nil {
+ return fmt.Errorf("parsing address %s: %w", act, err)
+ }
+ }
+
+ nodeAPI, acloser, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer acloser()
+
+ ctx := lcli.ReqContext(cctx)
+
+ if maddr.Empty() {
+ minerAPI, closer, err := lcli.GetStorageMinerAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+
+ maddr, err = minerAPI.ActorAddress(ctx)
+ if err != nil {
+ return err
+ }
+ }
+
+ mi, err := nodeAPI.StateMinerInfo(ctx, maddr, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ available, err := nodeAPI.StateMinerAvailableBalance(ctx, maddr, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ amount := available
+ if cctx.Args().Present() {
+ f, err := types.ParseFIL(cctx.Args().First())
+ if err != nil {
+ return xerrors.Errorf("parsing 'amount' argument: %w", err)
+ }
+
+ amount = abi.TokenAmount(f)
+
+ if amount.GreaterThan(available) {
+ return xerrors.Errorf("can't withdraw more funds than available; requested: %s; available: %s", amount, available)
+ }
+ }
+
+ params, err := actors.SerializeParams(&miner2.WithdrawBalanceParams{
+ AmountRequested: amount, // Default to attempting to withdraw all the extra funds in the miner actor
+ })
+ if err != nil {
+ return err
+ }
+
+ smsg, err := nodeAPI.MpoolPushMessage(ctx, &types.Message{
+ To: maddr,
+ From: mi.Owner,
+ Value: types.NewInt(0),
+ Method: miner.Methods.WithdrawBalance,
+ Params: params,
+ }, &api.MessageSendSpec{MaxFee: abi.TokenAmount(types.MustParseFIL("0.1"))})
+ if err != nil {
+ return err
+ }
+
+ fmt.Printf("Requested rewards withdrawal in message %s\n", smsg.Cid())
+
+ return nil
+ },
+}
+
+var actorSetOwnerCmd = &cli.Command{
+ Name: "set-owner",
+ Usage: "Set owner address (this command should be invoked twice, first with the old owner as the senderAddress, and then with the new owner)",
+ ArgsUsage: "[newOwnerAddress senderAddress]",
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "actor",
+ Usage: "specify the address of miner actor",
+ },
+ &cli.BoolFlag{
+ Name: "really-do-it",
+ Usage: "Actually send transaction performing the action",
+ Value: false,
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ if !cctx.Bool("really-do-it") {
+ fmt.Println("Pass --really-do-it to actually execute this action")
+ return nil
+ }
+
+ if cctx.NArg() != 2 {
+ return fmt.Errorf("must pass new owner address and sender address")
+ }
+
+ var maddr address.Address
+ if act := cctx.String("actor"); act != "" {
+ var err error
+ maddr, err = address.NewFromString(act)
+ if err != nil {
+ return fmt.Errorf("parsing address %s: %w", act, err)
+ }
+ }
+
+ nodeAPI, acloser, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer acloser()
+
+ ctx := lcli.ReqContext(cctx)
+
+ na, err := address.NewFromString(cctx.Args().First())
+ if err != nil {
+ return err
+ }
+
+ newAddrId, err := nodeAPI.StateLookupID(ctx, na, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ fa, err := address.NewFromString(cctx.Args().Get(1))
+ if err != nil {
+ return err
+ }
+
+ fromAddrId, err := nodeAPI.StateLookupID(ctx, fa, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ if maddr.Empty() {
+ minerAPI, closer, err := lcli.GetStorageMinerAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+
+ maddr, err = minerAPI.ActorAddress(ctx)
+ if err != nil {
+ return err
+ }
+ }
+
+ mi, err := nodeAPI.StateMinerInfo(ctx, maddr, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ if fromAddrId != mi.Owner && fromAddrId != newAddrId {
+ return xerrors.New("from address must either be the old owner or the new owner")
+ }
+
+ sp, err := actors.SerializeParams(&newAddrId)
+ if err != nil {
+ return xerrors.Errorf("serializing params: %w", err)
+ }
+
+ smsg, err := nodeAPI.MpoolPushMessage(ctx, &types.Message{
+ From: fromAddrId,
+ To: maddr,
+ Method: miner.Methods.ChangeOwnerAddress,
+ Value: big.Zero(),
+ Params: sp,
+ }, nil)
+ if err != nil {
+ return xerrors.Errorf("mpool push: %w", err)
+ }
+
+ fmt.Println("Message CID:", smsg.Cid())
+
+ // wait for it to get mined into a block
+ wait, err := nodeAPI.StateWaitMsg(ctx, smsg.Cid(), build.MessageConfidence)
+ if err != nil {
+ return err
+ }
+
+ // check it executed successfully
+ if wait.Receipt.ExitCode != 0 {
+ fmt.Println("owner change failed!")
+ return err
+ }
+
+ fmt.Println("message succeeded!")
+
+ return nil
+ },
+}
+
+var actorControl = &cli.Command{
+ Name: "control",
+ Usage: "Manage control addresses",
+ Subcommands: []*cli.Command{
+ actorControlList,
+ actorControlSet,
+ },
+}
+
+var actorControlList = &cli.Command{
+ Name: "list",
+ Usage: "Get currently set control addresses",
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "actor",
+ Usage: "specify the address of miner actor",
+ },
+ &cli.BoolFlag{
+ Name: "verbose",
+ },
+ &cli.BoolFlag{
+ Name: "color",
+ Value: true,
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ color.NoColor = !cctx.Bool("color")
+
+ var maddr address.Address
+ if act := cctx.String("actor"); act != "" {
+ var err error
+ maddr, err = address.NewFromString(act)
+ if err != nil {
+ return fmt.Errorf("parsing address %s: %w", act, err)
+ }
+ }
+
+ nodeAPI, acloser, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer acloser()
+
+ ctx := lcli.ReqContext(cctx)
+
+ if maddr.Empty() {
+ minerAPI, closer, err := lcli.GetStorageMinerAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+
+ maddr, err = minerAPI.ActorAddress(ctx)
+ if err != nil {
+ return err
+ }
+ }
+
+ mi, err := nodeAPI.StateMinerInfo(ctx, maddr, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ tw := tablewriter.New(
+ tablewriter.Col("name"),
+ tablewriter.Col("ID"),
+ tablewriter.Col("key"),
+ tablewriter.Col("balance"),
+ )
+
+ printKey := func(name string, a address.Address) {
+ b, err := nodeAPI.WalletBalance(ctx, a)
+ if err != nil {
+ fmt.Printf("%s\t%s: error getting balance: %s\n", name, a, err)
+ return
+ }
+
+ k, err := nodeAPI.StateAccountKey(ctx, a, types.EmptyTSK)
+ if err != nil {
+ fmt.Printf("%s\t%s: error getting account key: %s\n", name, a, err)
+ return
+ }
+
+ kstr := k.String()
+ if !cctx.Bool("verbose") {
+ kstr = kstr[:9] + "..."
+ }
+
+ bstr := types.FIL(b).String()
+ switch {
+ case b.LessThan(types.FromFil(10)):
+ bstr = color.RedString(bstr)
+ case b.LessThan(types.FromFil(50)):
+ bstr = color.YellowString(bstr)
+ default:
+ bstr = color.GreenString(bstr)
+ }
+
+ tw.Write(map[string]interface{}{
+ "name": name,
+ "ID": a,
+ "key": kstr,
+ "balance": bstr,
+ })
+ }
+
+ printKey("owner", mi.Owner)
+ printKey("worker", mi.Worker)
+ for i, ca := range mi.ControlAddresses {
+ printKey(fmt.Sprintf("control-%d", i), ca)
+ }
+
+ return tw.Flush(os.Stdout)
+ },
+}
+
+var actorControlSet = &cli.Command{
+ Name: "set",
+ Usage: "Set control address(-es)",
+ ArgsUsage: "[...address]",
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "actor",
+ Usage: "specify the address of miner actor",
+ },
+ &cli.BoolFlag{
+ Name: "really-do-it",
+ Usage: "Actually send transaction performing the action",
+ Value: false,
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ if !cctx.Bool("really-do-it") {
+ fmt.Println("Pass --really-do-it to actually execute this action")
+ return nil
+ }
+
+ var maddr address.Address
+ if act := cctx.String("actor"); act != "" {
+ var err error
+ maddr, err = address.NewFromString(act)
+ if err != nil {
+ return fmt.Errorf("parsing address %s: %w", act, err)
+ }
+ }
+
+ nodeAPI, acloser, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer acloser()
+
+ ctx := lcli.ReqContext(cctx)
+
+ if maddr.Empty() {
+ minerAPI, closer, err := lcli.GetStorageMinerAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+
+ maddr, err = minerAPI.ActorAddress(ctx)
+ if err != nil {
+ return err
+ }
+ }
+
+ mi, err := nodeAPI.StateMinerInfo(ctx, maddr, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ del := map[address.Address]struct{}{}
+ existing := map[address.Address]struct{}{}
+ for _, controlAddress := range mi.ControlAddresses {
+ ka, err := nodeAPI.StateAccountKey(ctx, controlAddress, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ del[ka] = struct{}{}
+ existing[ka] = struct{}{}
+ }
+
+ var toSet []address.Address
+
+ for i, as := range cctx.Args().Slice() {
+ a, err := address.NewFromString(as)
+ if err != nil {
+ return xerrors.Errorf("parsing address %d: %w", i, err)
+ }
+
+ ka, err := nodeAPI.StateAccountKey(ctx, a, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ // make sure the address exists on chain
+ _, err = nodeAPI.StateLookupID(ctx, ka, types.EmptyTSK)
+ if err != nil {
+ return xerrors.Errorf("looking up %s: %w", ka, err)
+ }
+
+ delete(del, ka)
+ toSet = append(toSet, ka)
+ }
+
+ for a := range del {
+ fmt.Println("Remove", a)
+ }
+ for _, a := range toSet {
+ if _, exists := existing[a]; !exists {
+ fmt.Println("Add", a)
+ }
+ }
+
+ cwp := &miner2.ChangeWorkerAddressParams{
+ NewWorker: mi.Worker,
+ NewControlAddrs: toSet,
+ }
+
+ sp, err := actors.SerializeParams(cwp)
+ if err != nil {
+ return xerrors.Errorf("serializing params: %w", err)
+ }
+
+ smsg, err := nodeAPI.MpoolPushMessage(ctx, &types.Message{
+ From: mi.Owner,
+ To: maddr,
+ Method: miner.Methods.ChangeWorkerAddress,
+
+ Value: big.Zero(),
+ Params: sp,
+ }, nil)
+ if err != nil {
+ return xerrors.Errorf("mpool push: %w", err)
+ }
+
+ fmt.Println("Message CID:", smsg.Cid())
+
+ return nil
+ },
+}
+
+var actorProposeChangeWorker = &cli.Command{
+ Name: "propose-change-worker",
+ Usage: "Propose a worker address change",
+ ArgsUsage: "[address]",
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "actor",
+ Usage: "specify the address of miner actor",
+ },
+ &cli.BoolFlag{
+ Name: "really-do-it",
+ Usage: "Actually send transaction performing the action",
+ Value: false,
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ if !cctx.Args().Present() {
+ return fmt.Errorf("must pass address of new worker address")
+ }
+
+ if !cctx.Bool("really-do-it") {
+ fmt.Fprintln(cctx.App.Writer, "Pass --really-do-it to actually execute this action")
+ return nil
+ }
+
+ var maddr address.Address
+ if act := cctx.String("actor"); act != "" {
+ var err error
+ maddr, err = address.NewFromString(act)
+ if err != nil {
+ return fmt.Errorf("parsing address %s: %w", act, err)
+ }
+ }
+
+ nodeAPI, acloser, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer acloser()
+
+ ctx := lcli.ReqContext(cctx)
+
+ na, err := address.NewFromString(cctx.Args().First())
+ if err != nil {
+ return err
+ }
+
+ newAddr, err := nodeAPI.StateLookupID(ctx, na, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ if maddr.Empty() {
+ minerAPI, closer, err := lcli.GetStorageMinerAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+
+ maddr, err = minerAPI.ActorAddress(ctx)
+ if err != nil {
+ return err
+ }
+ }
+
+ mi, err := nodeAPI.StateMinerInfo(ctx, maddr, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ if mi.NewWorker.Empty() {
+ if mi.Worker == newAddr {
+ return fmt.Errorf("worker address already set to %s", na)
+ }
+ } else {
+ if mi.NewWorker == newAddr {
+ return fmt.Errorf("change to worker address %s already pending", na)
+ }
+ }
+
+ cwp := &miner2.ChangeWorkerAddressParams{
+ NewWorker: newAddr,
+ NewControlAddrs: mi.ControlAddresses,
+ }
+
+ sp, err := actors.SerializeParams(cwp)
+ if err != nil {
+ return xerrors.Errorf("serializing params: %w", err)
+ }
+
+ smsg, err := nodeAPI.MpoolPushMessage(ctx, &types.Message{
+ From: mi.Owner,
+ To: maddr,
+ Method: miner.Methods.ChangeWorkerAddress,
+ Value: big.Zero(),
+ Params: sp,
+ }, nil)
+ if err != nil {
+ return xerrors.Errorf("mpool push: %w", err)
+ }
+
+ fmt.Fprintln(cctx.App.Writer, "Propose Message CID:", smsg.Cid())
+
+ // wait for it to get mined into a block
+ wait, err := nodeAPI.StateWaitMsg(ctx, smsg.Cid(), build.MessageConfidence)
+ if err != nil {
+ return err
+ }
+
+ // check it executed successfully
+ if wait.Receipt.ExitCode != 0 {
+ fmt.Fprintln(cctx.App.Writer, "Propose worker change failed!")
+ return err
+ }
+
+ mi, err = nodeAPI.StateMinerInfo(ctx, maddr, wait.TipSet)
+ if err != nil {
+ return err
+ }
+ if mi.NewWorker != newAddr {
+ return fmt.Errorf("Proposed worker address change not reflected on chain: expected '%s', found '%s'", na, mi.NewWorker)
+ }
+
+ fmt.Fprintf(cctx.App.Writer, "Worker key change to %s successfully proposed.\n", na)
+ fmt.Fprintf(cctx.App.Writer, "Call 'confirm-change-worker' at or after height %d to complete.\n", mi.WorkerChangeEpoch)
+
+ return nil
+ },
+}
+
+var actorConfirmChangeWorker = &cli.Command{
+ Name: "confirm-change-worker",
+ Usage: "Confirm a worker address change",
+ ArgsUsage: "[address]",
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "actor",
+ Usage: "specify the address of miner actor",
+ },
+ &cli.BoolFlag{
+ Name: "really-do-it",
+ Usage: "Actually send transaction performing the action",
+ Value: false,
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ if !cctx.Args().Present() {
+ return fmt.Errorf("must pass address of new worker address")
+ }
+
+ if !cctx.Bool("really-do-it") {
+ fmt.Fprintln(cctx.App.Writer, "Pass --really-do-it to actually execute this action")
+ return nil
+ }
+
+ var maddr address.Address
+ if act := cctx.String("actor"); act != "" {
+ var err error
+ maddr, err = address.NewFromString(act)
+ if err != nil {
+ return fmt.Errorf("parsing address %s: %w", act, err)
+ }
+ }
+
+ nodeAPI, acloser, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer acloser()
+
+ ctx := lcli.ReqContext(cctx)
+
+ na, err := address.NewFromString(cctx.Args().First())
+ if err != nil {
+ return err
+ }
+
+ newAddr, err := nodeAPI.StateLookupID(ctx, na, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ if maddr.Empty() {
+ minerAPI, closer, err := lcli.GetStorageMinerAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+
+ maddr, err = minerAPI.ActorAddress(ctx)
+ if err != nil {
+ return err
+ }
+ }
+
+ mi, err := nodeAPI.StateMinerInfo(ctx, maddr, types.EmptyTSK)
+ if err != nil {
+ return err
+ }
+
+ if mi.NewWorker.Empty() {
+ return xerrors.Errorf("no worker key change proposed")
+ } else if mi.NewWorker != newAddr {
+ return xerrors.Errorf("worker key %s does not match current worker key proposal %s", newAddr, mi.NewWorker)
+ }
+
+ if head, err := nodeAPI.ChainHead(ctx); err != nil {
+ return xerrors.Errorf("failed to get the chain head: %w", err)
+ } else if head.Height() < mi.WorkerChangeEpoch {
+ return xerrors.Errorf("worker key change cannot be confirmed until %d, current height is %d", mi.WorkerChangeEpoch, head.Height())
+ }
+
+ smsg, err := nodeAPI.MpoolPushMessage(ctx, &types.Message{
+ From: mi.Owner,
+ To: maddr,
+ Method: miner.Methods.ConfirmUpdateWorkerKey,
+ Value: big.Zero(),
+ }, nil)
+ if err != nil {
+ return xerrors.Errorf("mpool push: %w", err)
+ }
+
+ fmt.Fprintln(cctx.App.Writer, "Confirm Message CID:", smsg.Cid())
+
+ // wait for it to get mined into a block
+ wait, err := nodeAPI.StateWaitMsg(ctx, smsg.Cid(), build.MessageConfidence)
+ if err != nil {
+ return err
+ }
+
+ // check it executed successfully
+ if wait.Receipt.ExitCode != 0 {
+ fmt.Fprintln(cctx.App.Writer, "Worker change failed!")
+ return err
+ }
+
+ mi, err = nodeAPI.StateMinerInfo(ctx, maddr, wait.TipSet)
+ if err != nil {
+ return err
+ }
+ if mi.Worker != newAddr {
+ return fmt.Errorf("Confirmed worker address change not reflected on chain: expected '%s', found '%s'", newAddr, mi.Worker)
+ }
+
+ return nil
+ },
+}
diff --git a/cmd/lotus-shed/balances.go b/cmd/lotus-shed/balances.go
index 8c5bfefb8..87530c666 100644
--- a/cmd/lotus-shed/balances.go
+++ b/cmd/lotus-shed/balances.go
@@ -3,13 +3,18 @@ package main
import (
"context"
"encoding/csv"
+ "encoding/json"
"fmt"
"io"
"os"
+ "runtime"
"strconv"
"strings"
+ "sync"
"time"
+ "github.com/filecoin-project/lotus/build"
+
"github.com/filecoin-project/lotus/chain/gen/genesis"
_init "github.com/filecoin-project/lotus/chain/actors/builtin/init"
@@ -64,9 +69,321 @@ var auditsCmd = &cli.Command{
Description: "a collection of utilities for auditing the filecoin chain",
Subcommands: []*cli.Command{
chainBalanceCmd,
+ chainBalanceSanityCheckCmd,
chainBalanceStateCmd,
chainPledgeCmd,
fillBalancesCmd,
+ duplicatedMessagesCmd,
+ },
+}
+
+var duplicatedMessagesCmd = &cli.Command{
+ Name: "duplicate-messages",
+ Usage: "Check for duplicate messages included in a tipset.",
+ UsageText: `Check for duplicate messages included in a tipset.
+
+Due to Filecoin's expected consensus, a tipset may include the same message multiple times in
+different blocks. The message will only be executed once.
+
+This command will find such duplicate messages and print them to standard out as newline-delimited
+JSON. Status messages in the form of "H: $HEIGHT ($PROGRESS%)" will be printed to standard error for
+every day of chain processed.
+`,
+ Flags: []cli.Flag{
+ &cli.IntFlag{
+ Name: "parallel",
+ Usage: "the number of parallel threads for block processing",
+ DefaultText: "half the number of cores",
+ },
+ &cli.IntFlag{
+ Name: "start",
+ Usage: "the first epoch to check",
+ DefaultText: "genesis",
+ },
+ &cli.IntFlag{
+ Name: "end",
+ Usage: "the last epoch to check",
+ DefaultText: "the current head",
+ },
+ &cli.IntSliceFlag{
+ Name: "method",
+ Usage: "filter results by method number",
+ DefaultText: "all methods",
+ },
+ &cli.StringSliceFlag{
+ Name: "include-to",
+ Usage: "include only messages to the given address (does not perform address resolution)",
+ DefaultText: "all recipients",
+ },
+ &cli.StringSliceFlag{
+ Name: "include-from",
+ Usage: "include only messages from the given address (does not perform address resolution)",
+ DefaultText: "all senders",
+ },
+ &cli.StringSliceFlag{
+ Name: "exclude-to",
+ Usage: "exclude messages to the given address (does not perform address resolution)",
+ },
+ &cli.StringSliceFlag{
+ Name: "exclude-from",
+ Usage: "exclude messages from the given address (does not perform address resolution)",
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ api, closer, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+
+ defer closer()
+ ctx := lcli.ReqContext(cctx)
+
+ var head *types.TipSet
+ if cctx.IsSet("end") {
+ epoch := abi.ChainEpoch(cctx.Int("end"))
+ head, err = api.ChainGetTipSetByHeight(ctx, epoch, types.EmptyTSK)
+ } else {
+ head, err = api.ChainHead(ctx)
+ }
+ if err != nil {
+ return err
+ }
+
+ var printLk sync.Mutex
+
+ threads := runtime.NumCPU() / 2
+ if cctx.IsSet("parallel") {
+ threads = cctx.Int("int")
+ if threads <= 0 {
+ return fmt.Errorf("parallelism needs to be at least 1")
+ }
+ } else if threads == 0 {
+ threads = 1 // if we have one core, but who are we kidding...
+ }
+
+ throttle := make(chan struct{}, threads)
+
+ methods := map[abi.MethodNum]bool{}
+ for _, m := range cctx.IntSlice("method") {
+ if m < 0 {
+ return fmt.Errorf("expected method numbers to be non-negative")
+ }
+ methods[abi.MethodNum(m)] = true
+ }
+
+ addressSet := func(flag string) (map[address.Address]bool, error) {
+ if !cctx.IsSet(flag) {
+ return nil, nil
+ }
+ addrs := cctx.StringSlice(flag)
+ set := make(map[address.Address]bool, len(addrs))
+ for _, addrStr := range addrs {
+ addr, err := address.NewFromString(addrStr)
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse address %s: %w", addrStr, err)
+ }
+ set[addr] = true
+ }
+ return set, nil
+ }
+
+ onlyFrom, err := addressSet("include-from")
+ if err != nil {
+ return err
+ }
+ onlyTo, err := addressSet("include-to")
+ if err != nil {
+ return err
+ }
+ excludeFrom, err := addressSet("exclude-from")
+ if err != nil {
+ return err
+ }
+ excludeTo, err := addressSet("exclude-to")
+ if err != nil {
+ return err
+ }
+
+ target := abi.ChainEpoch(cctx.Int("start"))
+ if target < 0 || target > head.Height() {
+ return fmt.Errorf("start height must be greater than 0 and less than the end height")
+ }
+ totalEpochs := head.Height() - target
+
+ for target <= head.Height() {
+ select {
+ case throttle <- struct{}{}:
+ case <-ctx.Done():
+ return ctx.Err()
+ }
+
+ go func(ts *types.TipSet) {
+ defer func() {
+ <-throttle
+ }()
+
+ type addrNonce struct {
+ s address.Address
+ n uint64
+ }
+ anonce := func(m *types.Message) addrNonce {
+ return addrNonce{
+ s: m.From,
+ n: m.Nonce,
+ }
+ }
+
+ msgs := map[addrNonce]map[cid.Cid]*types.Message{}
+
+ processMessage := func(c cid.Cid, m *types.Message) {
+ // Filter
+ if len(methods) > 0 && !methods[m.Method] {
+ return
+ }
+ if len(onlyFrom) > 0 && !onlyFrom[m.From] {
+ return
+ }
+ if len(onlyTo) > 0 && !onlyTo[m.To] {
+ return
+ }
+ if excludeFrom[m.From] || excludeTo[m.To] {
+ return
+ }
+
+ // Record
+ msgSet, ok := msgs[anonce(m)]
+ if !ok {
+ msgSet = make(map[cid.Cid]*types.Message, 1)
+ msgs[anonce(m)] = msgSet
+ }
+ msgSet[c] = m
+ }
+
+ encoder := json.NewEncoder(os.Stdout)
+
+ for _, bh := range ts.Blocks() {
+ bms, err := api.ChainGetBlockMessages(ctx, bh.Cid())
+ if err != nil {
+ fmt.Fprintln(os.Stderr, "ERROR: ", err)
+ return
+ }
+
+ for i, m := range bms.BlsMessages {
+ processMessage(bms.Cids[i], m)
+ }
+
+ for i, m := range bms.SecpkMessages {
+ processMessage(bms.Cids[len(bms.BlsMessages)+i], &m.Message)
+ }
+ }
+ for _, ms := range msgs {
+ if len(ms) == 1 {
+ continue
+ }
+ type Msg struct {
+ Cid string
+ Value string
+ Method uint64
+ }
+ grouped := map[string][]Msg{}
+ for c, m := range ms {
+ addr := m.To.String()
+ grouped[addr] = append(grouped[addr], Msg{
+ Cid: c.String(),
+ Value: types.FIL(m.Value).String(),
+ Method: uint64(m.Method),
+ })
+ }
+ printLk.Lock()
+ err := encoder.Encode(grouped)
+ if err != nil {
+ fmt.Fprintln(os.Stderr, "ERROR: ", err)
+ }
+ printLk.Unlock()
+ }
+ }(head)
+
+ if head.Parents().IsEmpty() {
+ break
+ }
+
+ head, err = api.ChainGetTipSet(ctx, head.Parents())
+ if err != nil {
+ return err
+ }
+
+ if head.Height()%2880 == 0 {
+ printLk.Lock()
+ fmt.Fprintf(os.Stderr, "H: %s (%d%%)\n", head.Height(), (100*(head.Height()-target))/totalEpochs)
+ printLk.Unlock()
+ }
+ }
+
+ for i := 0; i < threads; i++ {
+ select {
+ case throttle <- struct{}{}:
+ case <-ctx.Done():
+ return ctx.Err()
+ }
+
+ }
+
+ printLk.Lock()
+ fmt.Fprintf(os.Stderr, "H: %s (100%%)\n", head.Height())
+ printLk.Unlock()
+
+ return nil
+ },
+}
+
+var chainBalanceSanityCheckCmd = &cli.Command{
+ Name: "chain-balance-sanity",
+ Description: "Confirms that the total balance of every actor in state is still 2 billion",
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "tipset",
+ Usage: "specify tipset to start from",
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ api, closer, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+
+ defer closer()
+ ctx := lcli.ReqContext(cctx)
+
+ ts, err := lcli.LoadTipSet(ctx, cctx, api)
+ if err != nil {
+ return err
+ }
+
+ tsk := ts.Key()
+ actors, err := api.StateListActors(ctx, tsk)
+ if err != nil {
+ return err
+ }
+
+ bal := big.Zero()
+ for _, addr := range actors {
+ act, err := api.StateGetActor(ctx, addr, tsk)
+ if err != nil {
+ return err
+ }
+
+ bal = big.Add(bal, act.Balance)
+ }
+
+ attoBase := big.Mul(big.NewInt(int64(build.FilBase)), big.NewInt(int64(build.FilecoinPrecision)))
+
+ if big.Cmp(attoBase, bal) != 0 {
+ return xerrors.Errorf("sanity check failed (expected %s, actual %s)", attoBase, bal)
+ }
+
+ fmt.Println("sanity check successful")
+
+ return nil
},
}
diff --git a/cmd/lotus-shed/consensus.go b/cmd/lotus-shed/consensus.go
index c78c9c00f..2c5df4ea5 100644
--- a/cmd/lotus-shed/consensus.go
+++ b/cmd/lotus-shed/consensus.go
@@ -113,12 +113,12 @@ var consensusCheckCmd = &cli.Command{
return err
}
ainfo := cliutil.APIInfo{Addr: apima.String()}
- addr, err := ainfo.DialArgs()
+ addr, err := ainfo.DialArgs("v1")
if err != nil {
return err
}
- api, closer, err := client.NewFullNodeRPC(cctx.Context, addr, nil)
+ api, closer, err := client.NewFullNodeRPCV1(cctx.Context, addr, nil)
if err != nil {
return err
}
diff --git a/cmd/lotus-shed/cron-count.go b/cmd/lotus-shed/cron-count.go
new file mode 100644
index 000000000..622f38791
--- /dev/null
+++ b/cmd/lotus-shed/cron-count.go
@@ -0,0 +1,99 @@
+package main
+
+import (
+ "fmt"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/lotus/build"
+ lcli "github.com/filecoin-project/lotus/cli"
+ "github.com/urfave/cli/v2"
+ "golang.org/x/xerrors"
+)
+
+var cronWcCmd = &cli.Command{
+ Name: "cron-wc",
+ Description: "cron stats",
+ Subcommands: []*cli.Command{
+ minerDeadlineCronCountCmd,
+ },
+}
+
+var minerDeadlineCronCountCmd = &cli.Command{
+ Name: "deadline",
+ Description: "list all addresses of miners with active deadline crons",
+ Action: func(c *cli.Context) error {
+ return countDeadlineCrons(c)
+ },
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "tipset",
+ Usage: "specify tipset state to search on (pass comma separated array of cids)",
+ },
+ },
+}
+
+func findDeadlineCrons(c *cli.Context) (map[address.Address]struct{}, error) {
+ api, acloser, err := lcli.GetFullNodeAPI(c)
+ if err != nil {
+ return nil, err
+ }
+ defer acloser()
+ ctx := lcli.ReqContext(c)
+
+ ts, err := lcli.LoadTipSet(ctx, c, api)
+ if err != nil {
+ return nil, err
+ }
+ if ts == nil {
+ ts, err = api.ChainHead(ctx)
+ if err != nil {
+ return nil, err
+ }
+ }
+
+ mAddrs, err := api.StateListMiners(ctx, ts.Key())
+ if err != nil {
+ return nil, err
+ }
+ activeMiners := make(map[address.Address]struct{})
+ for _, mAddr := range mAddrs {
+ // All miners have active cron before v4.
+ // v4 upgrade epoch is last epoch running v3 epoch and api.StateReadState reads
+ // parent state, so v4 state isn't read until upgrade epoch + 2
+ if ts.Height() <= build.UpgradeTurboHeight+1 {
+ activeMiners[mAddr] = struct{}{}
+ continue
+ }
+ st, err := api.StateReadState(ctx, mAddr, ts.Key())
+ if err != nil {
+ return nil, err
+ }
+ minerState, ok := st.State.(map[string]interface{})
+ if !ok {
+ return nil, xerrors.Errorf("internal error: failed to cast miner state to expected map type")
+ }
+
+ activeDlineIface, ok := minerState["DeadlineCronActive"]
+ if !ok {
+ return nil, xerrors.Errorf("miner %s had no deadline state, is this a v3 state root?", mAddr)
+ }
+ active := activeDlineIface.(bool)
+ if active {
+ activeMiners[mAddr] = struct{}{}
+ }
+ }
+
+ return activeMiners, nil
+}
+
+func countDeadlineCrons(c *cli.Context) error {
+ activeMiners, err := findDeadlineCrons(c)
+ if err != nil {
+ return err
+ }
+ for addr := range activeMiners {
+ fmt.Printf("%s\n", addr)
+ }
+
+ return nil
+}
diff --git a/cmd/lotus-shed/export-car.go b/cmd/lotus-shed/export-car.go
new file mode 100644
index 000000000..97e4fb6c6
--- /dev/null
+++ b/cmd/lotus-shed/export-car.go
@@ -0,0 +1,103 @@
+package main
+
+import (
+ "fmt"
+ "io"
+ "os"
+
+ "github.com/ipfs/go-blockservice"
+ "github.com/ipfs/go-cid"
+ offline "github.com/ipfs/go-ipfs-exchange-offline"
+ format "github.com/ipfs/go-ipld-format"
+ "github.com/ipfs/go-merkledag"
+ "github.com/ipld/go-car"
+ "github.com/urfave/cli/v2"
+ "golang.org/x/xerrors"
+
+ lcli "github.com/filecoin-project/lotus/cli"
+ "github.com/filecoin-project/lotus/node/repo"
+)
+
+func carWalkFunc(nd format.Node) (out []*format.Link, err error) {
+ for _, link := range nd.Links() {
+ if link.Cid.Prefix().Codec == cid.FilCommitmentSealed || link.Cid.Prefix().Codec == cid.FilCommitmentUnsealed {
+ continue
+ }
+ out = append(out, link)
+ }
+ return out, nil
+}
+
+var exportCarCmd = &cli.Command{
+ Name: "export-car",
+ Description: "Export a car from repo (requires node to be offline)",
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "repo",
+ Value: "~/.lotus",
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ if cctx.Args().Len() != 2 {
+ return lcli.ShowHelp(cctx, fmt.Errorf("must specify file name and object"))
+ }
+
+ outfile := cctx.Args().First()
+ var roots []cid.Cid
+ for _, arg := range cctx.Args().Tail() {
+ c, err := cid.Decode(arg)
+ if err != nil {
+ return err
+ }
+ roots = append(roots, c)
+ }
+
+ ctx := lcli.ReqContext(cctx)
+
+ r, err := repo.NewFS(cctx.String("repo"))
+ if err != nil {
+ return xerrors.Errorf("opening fs repo: %w", err)
+ }
+
+ exists, err := r.Exists()
+ if err != nil {
+ return err
+ }
+ if !exists {
+ return xerrors.Errorf("lotus repo doesn't exist")
+ }
+
+ lr, err := r.Lock(repo.FullNode)
+ if err != nil {
+ return err
+ }
+ defer lr.Close() //nolint:errcheck
+
+ fi, err := os.Create(outfile)
+ if err != nil {
+ return xerrors.Errorf("opening the output file: %w", err)
+ }
+
+ defer fi.Close() //nolint:errcheck
+
+ bs, err := lr.Blockstore(ctx, repo.UniversalBlockstore)
+ if err != nil {
+ return fmt.Errorf("failed to open blockstore: %w", err)
+ }
+
+ defer func() {
+ if c, ok := bs.(io.Closer); ok {
+ if err := c.Close(); err != nil {
+ log.Warnf("failed to close blockstore: %s", err)
+ }
+ }
+ }()
+
+ dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs)))
+ err = car.WriteCarWithWalker(ctx, dag, roots, fi, carWalkFunc)
+ if err != nil {
+ return err
+ }
+ return nil
+ },
+}
diff --git a/cmd/lotus-shed/frozen-miners.go b/cmd/lotus-shed/frozen-miners.go
index 6b843f0d6..ed09c00c5 100644
--- a/cmd/lotus-shed/frozen-miners.go
+++ b/cmd/lotus-shed/frozen-miners.go
@@ -35,12 +35,6 @@ var frozenMinersCmd = &cli.Command{
if err != nil {
return err
}
- if ts == nil {
- ts, err = api.ChainHead(ctx)
- if err != nil {
- return err
- }
- }
queryEpoch := ts.Height()
diff --git a/cmd/lotus-shed/jwt.go b/cmd/lotus-shed/jwt.go
index 78abcec76..e8853b419 100644
--- a/cmd/lotus-shed/jwt.go
+++ b/cmd/lotus-shed/jwt.go
@@ -15,7 +15,8 @@ import (
"github.com/urfave/cli/v2"
"github.com/filecoin-project/go-jsonrpc/auth"
- "github.com/filecoin-project/lotus/api/apistruct"
+
+ "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/modules"
)
@@ -98,19 +99,19 @@ var jwtTokenCmd = &cli.Command{
perms := []auth.Permission{}
if cctx.Bool("read") {
- perms = append(perms, apistruct.PermRead)
+ perms = append(perms, api.PermRead)
}
if cctx.Bool("write") {
- perms = append(perms, apistruct.PermWrite)
+ perms = append(perms, api.PermWrite)
}
if cctx.Bool("sign") {
- perms = append(perms, apistruct.PermSign)
+ perms = append(perms, api.PermSign)
}
if cctx.Bool("admin") {
- perms = append(perms, apistruct.PermAdmin)
+ perms = append(perms, api.PermAdmin)
}
p := modules.JwtPayload{
@@ -152,7 +153,7 @@ var jwtNewCmd = &cli.Command{
}
p := modules.JwtPayload{
- Allow: apistruct.AllPermissions,
+ Allow: api.AllPermissions,
}
token, err := jwt.Sign(&p, jwt.NewHS256(keyInfo.PrivateKey))
diff --git a/cmd/lotus-shed/ledger.go b/cmd/lotus-shed/ledger.go
index 8d42b0e55..0e9c11742 100644
--- a/cmd/lotus-shed/ledger.go
+++ b/cmd/lotus-shed/ledger.go
@@ -6,13 +6,14 @@ import (
"strconv"
"strings"
+ "github.com/filecoin-project/lotus/api/v0api"
+
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/urfave/cli/v2"
ledgerfil "github.com/whyrusleeping/ledger-filecoin-go"
- "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
ledgerwallet "github.com/filecoin-project/lotus/chain/wallet/ledger"
lcli "github.com/filecoin-project/lotus/cli"
@@ -42,7 +43,7 @@ var ledgerListAddressesCmd = &cli.Command{
},
},
Action: func(cctx *cli.Context) error {
- var api api.FullNode
+ var api v0api.FullNode
if cctx.Bool("print-balances") {
a, closer, err := lcli.GetFullNodeAPI(cctx)
if err != nil {
diff --git a/cmd/lotus-shed/main.go b/cmd/lotus-shed/main.go
index ebe4f014a..7c4391f18 100644
--- a/cmd/lotus-shed/main.go
+++ b/cmd/lotus-shed/main.go
@@ -20,6 +20,7 @@ func main() {
base32Cmd,
base16Cmd,
bitFieldCmd,
+ cronWcCmd,
frozenMinersCmd,
keyinfoCmd,
jwtCmd,
@@ -34,6 +35,7 @@ func main() {
postFindCmd,
proofsCmd,
verifRegCmd,
+ marketCmd,
miscCmd,
mpoolCmd,
genesisVerifyCmd,
@@ -41,6 +43,7 @@ func main() {
minerCmd,
mpoolStatsCmd,
exportChainCmd,
+ exportCarCmd,
consensusCmd,
storageStatsCmd,
syncCmd,
@@ -54,6 +57,8 @@ func main() {
cidCmd,
blockmsgidCmd,
signaturesCmd,
+ actorCmd,
+ minerTypesCmd,
}
app := &cli.App{
diff --git a/cmd/lotus-shed/market.go b/cmd/lotus-shed/market.go
new file mode 100644
index 000000000..e2e322784
--- /dev/null
+++ b/cmd/lotus-shed/market.go
@@ -0,0 +1,102 @@
+package main
+
+import (
+ "fmt"
+
+ lcli "github.com/filecoin-project/lotus/cli"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/big"
+ "github.com/urfave/cli/v2"
+ "golang.org/x/xerrors"
+)
+
+var marketCmd = &cli.Command{
+ Name: "market",
+ Usage: "Interact with the market actor",
+ Flags: []cli.Flag{},
+ Subcommands: []*cli.Command{
+ marketDealFeesCmd,
+ },
+}
+
+var marketDealFeesCmd = &cli.Command{
+ Name: "get-deal-fees",
+ Usage: "View the storage fees associated with a particular deal or storage provider",
+ Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "provider",
+ Usage: "provider whose outstanding fees you'd like to calculate",
+ },
+ &cli.IntFlag{
+ Name: "dealId",
+ Usage: "deal whose outstanding fees you'd like to calculate",
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ api, closer, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+ defer closer()
+
+ ctx := lcli.ReqContext(cctx)
+
+ ts, err := lcli.LoadTipSet(ctx, cctx, api)
+ if err != nil {
+ return err
+ }
+
+ ht := ts.Height()
+
+ if cctx.IsSet("provider") {
+ p, err := address.NewFromString(cctx.String("provider"))
+ if err != nil {
+ return fmt.Errorf("failed to parse provider: %w", err)
+ }
+
+ deals, err := api.StateMarketDeals(ctx, ts.Key())
+ if err != nil {
+ return err
+ }
+
+ ef := big.Zero()
+ pf := big.Zero()
+ count := 0
+
+ for _, deal := range deals {
+ if deal.Proposal.Provider == p {
+ e, p := deal.Proposal.GetDealFees(ht)
+ ef = big.Add(ef, e)
+ pf = big.Add(pf, p)
+ count++
+ }
+ }
+
+ fmt.Println("Total deals: ", count)
+ fmt.Println("Total earned fees: ", ef)
+ fmt.Println("Total pending fees: ", pf)
+ fmt.Println("Total fees: ", big.Add(ef, pf))
+
+ return nil
+ }
+
+ if dealid := cctx.Int("dealId"); dealid != 0 {
+ deal, err := api.StateMarketStorageDeal(ctx, abi.DealID(dealid), ts.Key())
+ if err != nil {
+ return err
+ }
+
+ ef, pf := deal.Proposal.GetDealFees(ht)
+
+ fmt.Println("Earned fees: ", ef)
+ fmt.Println("Pending fees: ", pf)
+ fmt.Println("Total fees: ", big.Add(ef, pf))
+
+ return nil
+ }
+
+ return xerrors.New("must provide either --provider or --dealId flag")
+ },
+}
diff --git a/cmd/lotus-shed/miner-types.go b/cmd/lotus-shed/miner-types.go
new file mode 100644
index 000000000..19a30c4b9
--- /dev/null
+++ b/cmd/lotus-shed/miner-types.go
@@ -0,0 +1,154 @@
+package main
+
+import (
+ "context"
+ "fmt"
+ "io"
+ "math/big"
+
+ big2 "github.com/filecoin-project/go-state-types/big"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/power"
+ "github.com/filecoin-project/lotus/chain/state"
+ "github.com/filecoin-project/lotus/chain/store"
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/chain/vm"
+ "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
+ "github.com/filecoin-project/lotus/node/repo"
+ builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
+ "github.com/filecoin-project/specs-actors/v4/actors/util/adt"
+ "github.com/ipfs/go-cid"
+ cbor "github.com/ipfs/go-ipld-cbor"
+ "github.com/urfave/cli/v2"
+ "golang.org/x/xerrors"
+)
+
+var minerTypesCmd = &cli.Command{
+ Name: "miner-types",
+ Usage: "Scrape state to report on how many miners of each WindowPoStProofType exist", Flags: []cli.Flag{
+ &cli.StringFlag{
+ Name: "repo",
+ Value: "~/.lotus",
+ },
+ },
+ Action: func(cctx *cli.Context) error {
+ ctx := context.TODO()
+
+ if !cctx.Args().Present() {
+ return fmt.Errorf("must pass state root")
+ }
+
+ sroot, err := cid.Decode(cctx.Args().First())
+ if err != nil {
+ return fmt.Errorf("failed to parse input: %w", err)
+ }
+
+ fsrepo, err := repo.NewFS(cctx.String("repo"))
+ if err != nil {
+ return err
+ }
+
+ lkrepo, err := fsrepo.Lock(repo.FullNode)
+ if err != nil {
+ return err
+ }
+
+ defer lkrepo.Close() //nolint:errcheck
+
+ bs, err := lkrepo.Blockstore(ctx, repo.UniversalBlockstore)
+ if err != nil {
+ return fmt.Errorf("failed to open blockstore: %w", err)
+ }
+
+ defer func() {
+ if c, ok := bs.(io.Closer); ok {
+ if err := c.Close(); err != nil {
+ log.Warnf("failed to close blockstore: %s", err)
+ }
+ }
+ }()
+
+ mds, err := lkrepo.Datastore(context.Background(), "/metadata")
+ if err != nil {
+ return err
+ }
+
+ cs := store.NewChainStore(bs, bs, mds, vm.Syscalls(ffiwrapper.ProofVerifier), nil)
+ defer cs.Close() //nolint:errcheck
+
+ cst := cbor.NewCborStore(bs)
+ store := adt.WrapStore(ctx, cst)
+
+ tree, err := state.LoadStateTree(cst, sroot)
+ if err != nil {
+ return err
+ }
+
+ typeMap := make(map[abi.RegisteredPoStProof]int64)
+ pa, err := tree.GetActor(power.Address)
+ if err != nil {
+ return err
+ }
+
+ ps, err := power.Load(store, pa)
+ if err != nil {
+ return err
+ }
+
+ dc := 0
+ dz := power.Claim{
+ RawBytePower: abi.NewStoragePower(0),
+ QualityAdjPower: abi.NewStoragePower(0),
+ }
+
+ err = tree.ForEach(func(addr address.Address, act *types.Actor) error {
+ if act.Code == builtin4.StorageMinerActorCodeID {
+ ms, err := miner.Load(store, act)
+ if err != nil {
+ return err
+ }
+
+ mi, err := ms.Info()
+ if err != nil {
+ return err
+ }
+
+ if mi.WindowPoStProofType == abi.RegisteredPoStProof_StackedDrgWindow64GiBV1 {
+ mp, f, err := ps.MinerPower(addr)
+ if err != nil {
+ return err
+ }
+
+ if f && mp.RawBytePower.Cmp(big.NewInt(10<<40)) >= 0 && mp.RawBytePower.Cmp(big.NewInt(20<<40)) < 0 {
+ dc = dc + 1
+ dz.RawBytePower = big2.Add(dz.RawBytePower, mp.RawBytePower)
+ dz.QualityAdjPower = big2.Add(dz.QualityAdjPower, mp.QualityAdjPower)
+ }
+ }
+
+ c, f := typeMap[mi.WindowPoStProofType]
+ if !f {
+ typeMap[mi.WindowPoStProofType] = 1
+ } else {
+ typeMap[mi.WindowPoStProofType] = c + 1
+ }
+ }
+ return nil
+ })
+ if err != nil {
+ return xerrors.Errorf("failed to loop over actors: %w", err)
+ }
+
+ for k, v := range typeMap {
+ fmt.Println("Type:", k, " Count: ", v)
+ }
+
+ fmt.Println("Mismatched power (raw, QA): ", dz.RawBytePower, " ", dz.QualityAdjPower)
+ fmt.Println("Mismatched 64 GiB miner count: ", dc)
+
+ return nil
+ },
+}
diff --git a/cmd/lotus-shed/postfind.go b/cmd/lotus-shed/postfind.go
index 83006fd09..c8a4c9907 100644
--- a/cmd/lotus-shed/postfind.go
+++ b/cmd/lotus-shed/postfind.go
@@ -49,12 +49,6 @@ var postFindCmd = &cli.Command{
if err != nil {
return err
}
- if startTs == nil {
- startTs, err = api.ChainHead(ctx)
- if err != nil {
- return err
- }
- }
stopEpoch := startTs.Height() - abi.ChainEpoch(c.Int("lookback"))
if verbose {
fmt.Printf("Collecting messages between %d and %d\n", startTs.Height(), stopEpoch)
diff --git a/cmd/lotus-shed/rpc.go b/cmd/lotus-shed/rpc.go
index fe81e5a62..81171916e 100644
--- a/cmd/lotus-shed/rpc.go
+++ b/cmd/lotus-shed/rpc.go
@@ -28,6 +28,10 @@ var rpcCmd = &cli.Command{
&cli.BoolFlag{
Name: "miner",
},
+ &cli.StringFlag{
+ Name: "version",
+ Value: "v0",
+ },
},
Action: func(cctx *cli.Context) error {
rt := repo.FullNode
@@ -35,7 +39,7 @@ var rpcCmd = &cli.Command{
rt = repo.StorageMiner
}
- addr, headers, err := lcli.GetRawAPI(cctx, rt)
+ addr, headers, err := lcli.GetRawAPI(cctx, rt, cctx.String("version"))
if err != nil {
return err
}
diff --git a/cmd/lotus-shed/sectors.go b/cmd/lotus-shed/sectors.go
index 6cf6ee86e..cf40e1152 100644
--- a/cmd/lotus-shed/sectors.go
+++ b/cmd/lotus-shed/sectors.go
@@ -254,7 +254,7 @@ var terminateSectorPenaltyEstimationCmd = &cli.Command{
//TODO: 4667 add an option to give a more precise estimation with pending termination penalty excluded
- invocResult, err := nodeApi.StateCall(ctx, msg, types.TipSetKey{})
+ invocResult, err := nodeApi.StateCall(ctx, msg, types.EmptyTSK)
if err != nil {
return xerrors.Errorf("fail to state call: %w", err)
}
diff --git a/cmd/lotus-shed/stateroot-stats.go b/cmd/lotus-shed/stateroot-stats.go
index 023f782bd..6d5d57708 100644
--- a/cmd/lotus-shed/stateroot-stats.go
+++ b/cmd/lotus-shed/stateroot-stats.go
@@ -56,13 +56,6 @@ var staterootDiffsCmd = &cli.Command{
return err
}
- if ts == nil {
- ts, err = api.ChainHead(ctx)
- if err != nil {
- return err
- }
- }
-
fn := func(ts *types.TipSet) (cid.Cid, []cid.Cid) {
blk := ts.Blocks()[0]
strt := blk.ParentStateRoot
@@ -134,13 +127,6 @@ var staterootStatCmd = &cli.Command{
return err
}
- if ts == nil {
- ts, err = api.ChainHead(ctx)
- if err != nil {
- return err
- }
- }
-
var addrs []address.Address
for _, inp := range cctx.Args().Slice() {
diff --git a/cmd/lotus-shed/verifreg.go b/cmd/lotus-shed/verifreg.go
index 988de5d53..7640e636a 100644
--- a/cmd/lotus-shed/verifreg.go
+++ b/cmd/lotus-shed/verifreg.go
@@ -67,11 +67,13 @@ var verifRegAddVerifierCmd = &cli.Command{
return err
}
- api, closer, err := lcli.GetFullNodeAPI(cctx)
+ srv, err := lcli.GetFullNodeServices(cctx)
if err != nil {
return err
}
- defer closer()
+ defer srv.Close() //nolint:errcheck
+
+ api := srv.FullNodeAPI()
ctx := lcli.ReqContext(cctx)
vrk, err := api.StateVerifiedRegistryRootKey(ctx, types.EmptyTSK)
@@ -79,14 +81,21 @@ var verifRegAddVerifierCmd = &cli.Command{
return err
}
- smsg, err := api.MsigPropose(ctx, vrk, verifreg.Address, big.Zero(), sender, uint64(verifreg.Methods.AddVerifier), params)
+ proto, err := api.MsigPropose(ctx, vrk, verifreg.Address, big.Zero(), sender, uint64(verifreg.Methods.AddVerifier), params)
if err != nil {
return err
}
- fmt.Printf("message sent, now waiting on cid: %s\n", smsg)
+ sm, _, err := srv.PublishMessage(ctx, proto, false)
+ if err != nil {
+ return err
+ }
- mwait, err := api.StateWaitMsg(ctx, smsg, build.MessageConfidence)
+ msgCid := sm.Cid()
+
+ fmt.Printf("message sent, now waiting on cid: %s\n", msgCid)
+
+ mwait, err := api.StateWaitMsg(ctx, msgCid, uint64(cctx.Int("confidence")), build.Finality, true)
if err != nil {
return err
}
diff --git a/cmd/lotus-storage-miner/actor_test.go b/cmd/lotus-storage-miner/actor_test.go
index 5bc82d842..7f36812bc 100644
--- a/cmd/lotus-storage-miner/actor_test.go
+++ b/cmd/lotus-storage-miner/actor_test.go
@@ -7,7 +7,6 @@ import (
"fmt"
"regexp"
"strconv"
- "sync/atomic"
"testing"
"time"
@@ -18,13 +17,11 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/test"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/chain/types"
- "github.com/filecoin-project/lotus/lib/lotuslog"
+ "github.com/filecoin-project/lotus/itests/kit"
"github.com/filecoin-project/lotus/node/repo"
- builder "github.com/filecoin-project/lotus/node/test"
)
func TestWorkerKeyChange(t *testing.T) {
@@ -41,20 +38,16 @@ func TestWorkerKeyChange(t *testing.T) {
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
- lotuslog.SetupLogLevels()
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("pubsub", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
+ kit.QuietMiningLogs()
blocktime := 1 * time.Millisecond
- n, sn := builder.MockSbBuilder(t, []test.FullNodeOpts{test.FullNodeWithLatestActorsAt(-1), test.FullNodeWithLatestActorsAt(-1)}, test.OneMiner)
+ clients, miners := kit.MockMinerBuilder(t,
+ []kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(-1), kit.FullNodeWithLatestActorsAt(-1)},
+ kit.OneMiner)
- client1 := n[0]
- client2 := n[1]
+ client1 := clients[0]
+ client2 := clients[1]
// Connect the nodes.
addrinfo, err := client1.NetAddrsListen(ctx)
@@ -67,8 +60,8 @@ func TestWorkerKeyChange(t *testing.T) {
app := cli.NewApp()
app.Metadata = map[string]interface{}{
"repoType": repo.StorageMiner,
- "testnode-full": n[0],
- "testnode-storage": sn[0],
+ "testnode-full": clients[0],
+ "testnode-storage": miners[0],
}
app.Writer = output
api.RunningNodeType = api.NodeMiner
@@ -85,29 +78,14 @@ func TestWorkerKeyChange(t *testing.T) {
return cmd.Action(cctx)
}
- // setup miner
- mine := int64(1)
- done := make(chan struct{})
- go func() {
- defer close(done)
- for atomic.LoadInt64(&mine) == 1 {
- time.Sleep(blocktime)
- if err := sn[0].MineOne(ctx, test.MineNext); err != nil {
- t.Error(err)
- }
- }
- }()
- defer func() {
- atomic.AddInt64(&mine, -1)
- fmt.Println("shutting down mining")
- <-done
- }()
+ // start mining
+ kit.ConnectAndStartMining(t, blocktime, miners[0], client1, client2)
newKey, err := client1.WalletNew(ctx, types.KTBLS)
require.NoError(t, err)
// Initialize wallet.
- test.SendFunds(ctx, t, client1, newKey, abi.NewTokenAmount(0))
+ kit.SendFunds(ctx, t, client1, newKey, abi.NewTokenAmount(0))
require.NoError(t, run(actorProposeChangeWorker, "--really-do-it", newKey.String()))
diff --git a/cmd/lotus-storage-miner/allinfo_test.go b/cmd/lotus-storage-miner/allinfo_test.go
index 6fa3136d3..cbe65524e 100644
--- a/cmd/lotus-storage-miner/allinfo_test.go
+++ b/cmd/lotus-storage-miner/allinfo_test.go
@@ -1,10 +1,13 @@
package main
import (
+ "context"
"flag"
"testing"
"time"
+ "github.com/filecoin-project/lotus/itests/kit"
+ "github.com/filecoin-project/lotus/node/impl"
logging "github.com/ipfs/go-log/v2"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"
@@ -12,11 +15,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/test"
"github.com/filecoin-project/lotus/chain/actors/policy"
- "github.com/filecoin-project/lotus/lib/lotuslog"
"github.com/filecoin-project/lotus/node/repo"
- builder "github.com/filecoin-project/lotus/node/test"
)
func TestMinerAllInfo(t *testing.T) {
@@ -32,12 +32,7 @@ func TestMinerAllInfo(t *testing.T) {
_test = true
- lotuslog.SetupLogLevels()
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
+ kit.QuietMiningLogs()
oldDelay := policy.GetPreCommitChallengeDelay()
policy.SetPreCommitChallengeDelay(5)
@@ -45,8 +40,9 @@ func TestMinerAllInfo(t *testing.T) {
policy.SetPreCommitChallengeDelay(oldDelay)
})
- var n []test.TestNode
- var sn []test.TestStorageNode
+ n, sn := kit.Builder(t, kit.OneFull, kit.OneMiner)
+ client, miner := n[0].FullNode, sn[0]
+ kit.ConnectAndStartMining(t, time.Second, miner, client.(*impl.FullNodeAPI))
run := func(t *testing.T) {
app := cli.NewApp()
@@ -62,15 +58,10 @@ func TestMinerAllInfo(t *testing.T) {
require.NoError(t, infoAllCmd.Action(cctx))
}
- bp := func(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.StorageMiner) ([]test.TestNode, []test.TestStorageNode) {
- n, sn = builder.Builder(t, fullOpts, storage)
+ t.Run("pre-info-all", run)
- t.Run("pre-info-all", run)
-
- return n, sn
- }
-
- test.TestDealFlow(t, bp, time.Second, false, false, 0)
+ dh := kit.NewDealHarness(t, client, miner)
+ dh.MakeFullDeal(context.Background(), 6, false, false, 0)
t.Run("post-info-all", run)
}
diff --git a/cmd/lotus-storage-miner/init.go b/cmd/lotus-storage-miner/init.go
index bac8444cc..249f0ee03 100644
--- a/cmd/lotus-storage-miner/init.go
+++ b/cmd/lotus-storage-miner/init.go
@@ -8,6 +8,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
+ "net/http"
"os"
"path/filepath"
"strconv"
@@ -37,6 +38,8 @@ import (
power2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/power"
lapi "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
+ "github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
@@ -149,7 +152,11 @@ var initCmd = &cli.Command{
log.Info("Trying to connect to full node RPC")
- api, closer, err := lcli.GetFullNodeAPI(cctx) // TODO: consider storing full node address in config
+ if err := checkV1ApiSupport(ctx, cctx); err != nil {
+ return err
+ }
+
+ api, closer, err := lcli.GetFullNodeAPIV1(cctx) // TODO: consider storing full node address in config
if err != nil {
return err
}
@@ -158,7 +165,7 @@ var initCmd = &cli.Command{
log.Info("Checking full node sync status")
if !cctx.Bool("genesis-miner") && !cctx.Bool("nosync") {
- if err := lcli.SyncWait(ctx, api, false); err != nil {
+ if err := lcli.SyncWait(ctx, &v0api.WrapperV1Full{FullNode: api}, false); err != nil {
return xerrors.Errorf("sync wait: %w", err)
}
}
@@ -186,8 +193,8 @@ var initCmd = &cli.Command{
return err
}
- if !v.APIVersion.EqMajorMinor(lapi.FullAPIVersion) {
- return xerrors.Errorf("Remote API version didn't match (expected %s, remote %s)", lapi.FullAPIVersion, v.APIVersion)
+ if !v.APIVersion.EqMajorMinor(lapi.FullAPIVersion1) {
+ return xerrors.Errorf("Remote API version didn't match (expected %s, remote %s)", lapi.FullAPIVersion1, v.APIVersion)
}
log.Info("Initializing repo")
@@ -269,7 +276,7 @@ var initCmd = &cli.Command{
},
}
-func migratePreSealMeta(ctx context.Context, api lapi.FullNode, metadata string, maddr address.Address, mds dtypes.MetadataDS) error {
+func migratePreSealMeta(ctx context.Context, api v1api.FullNode, metadata string, maddr address.Address, mds dtypes.MetadataDS) error {
metadata, err := homedir.Expand(metadata)
if err != nil {
return xerrors.Errorf("expanding preseal dir: %w", err)
@@ -379,7 +386,7 @@ func migratePreSealMeta(ctx context.Context, api lapi.FullNode, metadata string,
return mds.Put(datastore.NewKey(modules.StorageCounterDSPrefix), buf[:size])
}
-func findMarketDealID(ctx context.Context, api lapi.FullNode, deal market2.DealProposal) (abi.DealID, error) {
+func findMarketDealID(ctx context.Context, api v1api.FullNode, deal market2.DealProposal) (abi.DealID, error) {
// TODO: find a better way
// (this is only used by genesis miners)
@@ -398,7 +405,7 @@ func findMarketDealID(ctx context.Context, api lapi.FullNode, deal market2.DealP
return 0, xerrors.New("deal not found")
}
-func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode, r repo.Repo, ssize abi.SectorSize, gasPrice types.BigInt) error {
+func storageMinerInit(ctx context.Context, cctx *cli.Context, api v1api.FullNode, r repo.Repo, ssize abi.SectorSize, gasPrice types.BigInt) error {
lr, err := r.Lock(repo.StorageMiner)
if err != nil {
return err
@@ -447,14 +454,23 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
wsts := statestore.New(namespace.Wrap(mds, modules.WorkerCallsPrefix))
smsts := statestore.New(namespace.Wrap(mds, modules.ManagerWorkPrefix))
- smgr, err := sectorstorage.New(ctx, lr, stores.NewIndex(), sectorstorage.SealerConfig{
+ si := stores.NewIndex()
+
+ lstor, err := stores.NewLocal(ctx, lr, si, nil)
+ if err != nil {
+ return err
+ }
+ stor := stores.NewRemote(lstor, si, http.Header(sa), 10, &stores.DefaultPartialFileHandler{})
+
+ smgr, err := sectorstorage.New(ctx, lstor, stor, lr, si, sectorstorage.SealerConfig{
ParallelFetchLimit: 10,
AllowAddPiece: true,
AllowPreCommit1: true,
AllowPreCommit2: true,
AllowCommit: true,
AllowUnseal: true,
- }, nil, sa, wsts, smsts)
+ }, wsts, smsts)
+
if err != nil {
return err
}
@@ -562,7 +578,7 @@ func makeHostKey(lr repo.LockedRepo) (crypto.PrivKey, error) {
return pk, nil
}
-func configureStorageMiner(ctx context.Context, api lapi.FullNode, addr address.Address, peerid peer.ID, gasPrice types.BigInt) error {
+func configureStorageMiner(ctx context.Context, api v1api.FullNode, addr address.Address, peerid peer.ID, gasPrice types.BigInt) error {
mi, err := api.StateMinerInfo(ctx, addr, types.EmptyTSK)
if err != nil {
return xerrors.Errorf("getWorkerAddr returned bad address: %w", err)
@@ -588,7 +604,7 @@ func configureStorageMiner(ctx context.Context, api lapi.FullNode, addr address.
}
log.Info("Waiting for message: ", smsg.Cid())
- ret, err := api.StateWaitMsg(ctx, smsg.Cid(), build.MessageConfidence)
+ ret, err := api.StateWaitMsg(ctx, smsg.Cid(), build.MessageConfidence, lapi.LookbackNoLimit, true)
if err != nil {
return err
}
@@ -600,7 +616,7 @@ func configureStorageMiner(ctx context.Context, api lapi.FullNode, addr address.
return nil
}
-func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID, gasPrice types.BigInt, cctx *cli.Context) (address.Address, error) {
+func createStorageMiner(ctx context.Context, api v1api.FullNode, peerid peer.ID, gasPrice types.BigInt, cctx *cli.Context) (address.Address, error) {
var err error
var owner address.Address
if cctx.String("owner") != "" {
@@ -642,7 +658,7 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
log.Infof("Initializing worker account %s, message: %s", worker, signed.Cid())
log.Infof("Waiting for confirmation")
- mw, err := api.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence)
+ mw, err := api.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence, lapi.LookbackNoLimit, true)
if err != nil {
return address.Undef, xerrors.Errorf("waiting for worker init: %w", err)
}
@@ -700,7 +716,7 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
log.Infof("Pushed CreateMiner message: %s", signed.Cid())
log.Infof("Waiting for confirmation")
- mw, err := api.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence)
+ mw, err := api.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence, lapi.LookbackNoLimit, true)
if err != nil {
return address.Undef, xerrors.Errorf("waiting for createMiner message: %w", err)
}
@@ -717,3 +733,24 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
log.Infof("New miners address is: %s (%s)", retval.IDAddress, retval.RobustAddress)
return retval.IDAddress, nil
}
+
+func checkV1ApiSupport(ctx context.Context, cctx *cli.Context) error {
+ // check v0 api version to make sure it supports v1 api
+ api0, closer, err := lcli.GetFullNodeAPI(cctx)
+ if err != nil {
+ return err
+ }
+
+ v, err := api0.Version(ctx)
+ closer()
+
+ if err != nil {
+ return err
+ }
+
+ if !v.APIVersion.EqMajorMinor(lapi.FullAPIVersion0) {
+ return xerrors.Errorf("Remote API version didn't match (expected %s, remote %s)", lapi.FullAPIVersion0, v.APIVersion)
+ }
+
+ return nil
+}
diff --git a/cmd/lotus-storage-miner/init_restore.go b/cmd/lotus-storage-miner/init_restore.go
index af4c43c95..b495e1cd9 100644
--- a/cmd/lotus-storage-miner/init_restore.go
+++ b/cmd/lotus-storage-miner/init_restore.go
@@ -6,6 +6,8 @@ import (
"io/ioutil"
"os"
+ "github.com/filecoin-project/lotus/api/v0api"
+
"github.com/docker/go-units"
"github.com/ipfs/go-datastore"
"github.com/libp2p/go-libp2p-core/peer"
@@ -52,9 +54,15 @@ var initRestoreCmd = &cli.Command{
return xerrors.Errorf("expected 1 argument")
}
+ ctx := lcli.ReqContext(cctx)
+
log.Info("Trying to connect to full node RPC")
- api, closer, err := lcli.GetFullNodeAPI(cctx) // TODO: consider storing full node address in config
+ if err := checkV1ApiSupport(ctx, cctx); err != nil {
+ return err
+ }
+
+ api, closer, err := lcli.GetFullNodeAPIV1(cctx) // TODO: consider storing full node address in config
if err != nil {
return err
}
@@ -62,19 +70,17 @@ var initRestoreCmd = &cli.Command{
log.Info("Checking full node version")
- ctx := lcli.ReqContext(cctx)
-
v, err := api.Version(ctx)
if err != nil {
return err
}
- if !v.APIVersion.EqMajorMinor(lapi.FullAPIVersion) {
- return xerrors.Errorf("Remote API version didn't match (expected %s, remote %s)", lapi.FullAPIVersion, v.APIVersion)
+ if !v.APIVersion.EqMajorMinor(lapi.FullAPIVersion1) {
+ return xerrors.Errorf("Remote API version didn't match (expected %s, remote %s)", lapi.FullAPIVersion1, v.APIVersion)
}
if !cctx.Bool("nosync") {
- if err := lcli.SyncWait(ctx, api, false); err != nil {
+ if err := lcli.SyncWait(ctx, &v0api.WrapperV1Full{FullNode: api}, false); err != nil {
return xerrors.Errorf("sync wait: %w", err)
}
}
diff --git a/cmd/lotus-storage-miner/run.go b/cmd/lotus-storage-miner/run.go
index cdcc4d88f..3daf9a911 100644
--- a/cmd/lotus-storage-miner/run.go
+++ b/cmd/lotus-storage-miner/run.go
@@ -1,34 +1,27 @@
package main
import (
- "context"
- "net"
- "net/http"
+ "fmt"
_ "net/http/pprof"
"os"
- "os/signal"
- "syscall"
- mux "github.com/gorilla/mux"
+ "github.com/filecoin-project/lotus/api/v1api"
+
+ "github.com/filecoin-project/lotus/api/v0api"
+
"github.com/multiformats/go-multiaddr"
- manet "github.com/multiformats/go-multiaddr/net"
"github.com/urfave/cli/v2"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
"golang.org/x/xerrors"
- "github.com/filecoin-project/go-jsonrpc"
- "github.com/filecoin-project/go-jsonrpc/auth"
-
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/apistruct"
"github.com/filecoin-project/lotus/build"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/lib/ulimit"
"github.com/filecoin-project/lotus/metrics"
"github.com/filecoin-project/lotus/node"
- "github.com/filecoin-project/lotus/node/impl"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/repo"
)
@@ -64,19 +57,13 @@ var runCmd = &cli.Command{
}
}
- nodeApi, ncloser, err := lcli.GetFullNodeAPI(cctx)
- if err != nil {
- return xerrors.Errorf("getting full node api: %w", err)
- }
- defer ncloser()
-
ctx, _ := tag.New(lcli.DaemonContext(cctx),
tag.Insert(metrics.Version, build.BuildVersion),
tag.Insert(metrics.Commit, build.CurrentCommit),
tag.Insert(metrics.NodeType, "miner"),
)
// Register all metric views
- if err = view.Register(
+ if err := view.Register(
metrics.MinerNodeViews...,
); err != nil {
log.Fatalf("Cannot register the view: %v", err)
@@ -84,6 +71,16 @@ var runCmd = &cli.Command{
// Set the metric to one so it is published to the exporter
stats.Record(ctx, metrics.LotusInfo.M(1))
+ if err := checkV1ApiSupport(ctx, cctx); err != nil {
+ return err
+ }
+
+ nodeApi, ncloser, err := lcli.GetFullNodeAPIV1(cctx)
+ if err != nil {
+ return xerrors.Errorf("getting full node api: %w", err)
+ }
+ defer ncloser()
+
v, err := nodeApi.Version(ctx)
if err != nil {
return err
@@ -95,14 +92,14 @@ var runCmd = &cli.Command{
}
}
- if v.APIVersion != api.FullAPIVersion {
- return xerrors.Errorf("lotus-daemon API version doesn't match: expected: %s", api.APIVersion{APIVersion: api.FullAPIVersion})
+ if v.APIVersion != api.FullAPIVersion1 {
+ return xerrors.Errorf("lotus-daemon API version doesn't match: expected: %s", api.APIVersion{APIVersion: api.FullAPIVersion1})
}
log.Info("Checking full node sync status")
if !cctx.Bool("nosync") {
- if err := lcli.SyncWait(ctx, nodeApi, false); err != nil {
+ if err := lcli.SyncWait(ctx, &v0api.WrapperV1Full{FullNode: nodeApi}, false); err != nil {
return xerrors.Errorf("sync wait: %w", err)
}
}
@@ -134,7 +131,7 @@ var runCmd = &cli.Command{
node.Override(new(dtypes.APIEndpoint), func() (dtypes.APIEndpoint, error) {
return multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/" + cctx.String("miner-api"))
})),
- node.Override(new(api.FullNode), nodeApi),
+ node.Override(new(v1api.FullNode), nodeApi),
)
if err != nil {
return xerrors.Errorf("creating node: %w", err)
@@ -157,54 +154,25 @@ var runCmd = &cli.Command{
log.Infof("Remote version %s", v)
- lst, err := manet.Listen(endpoint)
+ // Instantiate the miner node handler.
+ handler, err := node.MinerHandler(minerapi, true)
if err != nil {
- return xerrors.Errorf("could not listen: %w", err)
+ return xerrors.Errorf("failed to instantiate rpc handler: %w", err)
}
- mux := mux.NewRouter()
-
- rpcServer := jsonrpc.NewServer()
- rpcServer.Register("Filecoin", apistruct.PermissionedStorMinerAPI(metrics.MetricedStorMinerAPI(minerapi)))
-
- mux.Handle("/rpc/v0", rpcServer)
- mux.PathPrefix("/remote").HandlerFunc(minerapi.(*impl.StorageMinerAPI).ServeRemote)
- mux.Handle("/debug/metrics", metrics.Exporter())
- mux.PathPrefix("/").Handler(http.DefaultServeMux) // pprof
-
- ah := &auth.Handler{
- Verify: minerapi.AuthVerify,
- Next: mux.ServeHTTP,
+ // Serve the RPC.
+ rpcStopper, err := node.ServeRPC(handler, "lotus-miner", endpoint)
+ if err != nil {
+ return fmt.Errorf("failed to start json-rpc endpoint: %s", err)
}
- srv := &http.Server{
- Handler: ah,
- BaseContext: func(listener net.Listener) context.Context {
- ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, "lotus-miner"))
- return ctx
- },
- }
+ // Monitor for shutdown.
+ finishCh := node.MonitorShutdown(shutdownChan,
+ node.ShutdownHandler{Component: "rpc server", StopFunc: rpcStopper},
+ node.ShutdownHandler{Component: "miner", StopFunc: stop},
+ )
- sigChan := make(chan os.Signal, 2)
- go func() {
- select {
- case sig := <-sigChan:
- log.Warnw("received shutdown", "signal", sig)
- case <-shutdownChan:
- log.Warn("received shutdown")
- }
-
- log.Warn("Shutting down...")
- if err := stop(context.TODO()); err != nil {
- log.Errorf("graceful shutting down failed: %s", err)
- }
- if err := srv.Shutdown(context.TODO()); err != nil {
- log.Errorf("shutting down RPC server failed: %s", err)
- }
- log.Warn("Graceful shutdown successful")
- }()
- signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT)
-
- return srv.Serve(manet.NetListener(lst))
+ <-finishCh
+ return nil
},
}
diff --git a/cmd/lotus-storage-miner/storage.go b/cmd/lotus-storage-miner/storage.go
index 2f42fd530..b4ab26ad3 100644
--- a/cmd/lotus-storage-miner/storage.go
+++ b/cmd/lotus-storage-miner/storage.go
@@ -12,6 +12,8 @@ import (
"strings"
"time"
+ "github.com/filecoin-project/lotus/api/v0api"
+
"github.com/docker/go-units"
"github.com/fatih/color"
"github.com/google/uuid"
@@ -668,7 +670,7 @@ var storageCleanupCmd = &cli.Command{
},
}
-func cleanupRemovedSectorData(ctx context.Context, api api.StorageMiner, napi api.FullNode) error {
+func cleanupRemovedSectorData(ctx context.Context, api api.StorageMiner, napi v0api.FullNode) error {
sectors, err := api.SectorsList(ctx)
if err != nil {
return err
diff --git a/cmd/lotus-wallet/interactive.go b/cmd/lotus-wallet/interactive.go
index 91c181e65..e1ad2cbb2 100644
--- a/cmd/lotus-wallet/interactive.go
+++ b/cmd/lotus-wallet/interactive.go
@@ -20,6 +20,7 @@ import (
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/builtin/multisig"
"github.com/filecoin-project/lotus/chain/stmgr"
@@ -30,8 +31,8 @@ import (
type InteractiveWallet struct {
lk sync.Mutex
- apiGetter func() (api.FullNode, jsonrpc.ClientCloser, error)
- under api.Wallet
+ apiGetter func() (v0api.FullNode, jsonrpc.ClientCloser, error)
+ under v0api.Wallet
}
func (c *InteractiveWallet) WalletNew(ctx context.Context, typ types.KeyType) (address.Address, error) {
diff --git a/cmd/lotus-wallet/main.go b/cmd/lotus-wallet/main.go
index 271ed198e..3e3aa1a58 100644
--- a/cmd/lotus-wallet/main.go
+++ b/cmd/lotus-wallet/main.go
@@ -2,25 +2,33 @@ package main
import (
"context"
+ "fmt"
"net"
"net/http"
"os"
+ "github.com/filecoin-project/lotus/api/v0api"
+
+ "github.com/gbrlsnchs/jwt/v3"
"github.com/gorilla/mux"
logging "github.com/ipfs/go-log/v2"
"github.com/urfave/cli/v2"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
+ "golang.org/x/xerrors"
"github.com/filecoin-project/go-jsonrpc"
+ "github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/wallet"
ledgerwallet "github.com/filecoin-project/lotus/chain/wallet/ledger"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/lib/lotuslog"
"github.com/filecoin-project/lotus/metrics"
+ "github.com/filecoin-project/lotus/node/modules"
"github.com/filecoin-project/lotus/node/repo"
)
@@ -28,17 +36,33 @@ var log = logging.Logger("main")
const FlagWalletRepo = "wallet-repo"
+type jwtPayload struct {
+ Allow []auth.Permission
+}
+
func main() {
lotuslog.SetupLogLevels()
local := []*cli.Command{
runCmd,
+ getApiKeyCmd,
}
app := &cli.App{
Name: "lotus-wallet",
Usage: "Basic external wallet",
Version: build.UserVersion(),
+ Description: `
+lotus-wallet provides a remote wallet service for lotus.
+
+To configure your lotus node to use a remote wallet:
+* Run 'lotus-wallet get-api-key' to generate API key
+* Start lotus-wallet using 'lotus-wallet run' (see --help for additional flags)
+* Edit lotus config (~/.lotus/config.toml)
+ * Find the '[Wallet]' section
+ * Set 'RemoteBackend' to '[api key]:http://[wallet ip]:[wallet port]'
+ (the default port is 1777)
+* Start (or restart) the lotus daemon`,
Flags: []cli.Flag{
&cli.StringFlag{
Name: FlagWalletRepo,
@@ -63,6 +87,35 @@ func main() {
}
}
+var getApiKeyCmd = &cli.Command{
+ Name: "get-api-key",
+ Usage: "Generate API Key",
+ Action: func(cctx *cli.Context) error {
+ lr, ks, err := openRepo(cctx)
+ if err != nil {
+ return err
+ }
+ defer lr.Close() // nolint
+
+ p := jwtPayload{
+ Allow: []auth.Permission{api.PermAdmin},
+ }
+
+ authKey, err := modules.APISecret(ks, lr)
+ if err != nil {
+ return xerrors.Errorf("setting up api secret: %w", err)
+ }
+
+ k, err := jwt.Sign(&p, (*jwt.HMACSHA)(authKey))
+ if err != nil {
+ return xerrors.Errorf("jwt sign: %w", err)
+ }
+
+ fmt.Println(string(k))
+ return nil
+ },
+}
+
var runCmd = &cli.Command{
Name: "run",
Usage: "Start lotus wallet",
@@ -84,7 +137,13 @@ var runCmd = &cli.Command{
Name: "offline",
Usage: "don't query chain state in interactive mode",
},
+ &cli.BoolFlag{
+ Name: "disable-auth",
+ Usage: "(insecure) disable api auth",
+ Hidden: true,
+ },
},
+ Description: "For setup instructions see 'lotus-wallet --help'",
Action: func(cctx *cli.Context) error {
log.Info("Starting lotus wallet")
@@ -99,31 +158,11 @@ var runCmd = &cli.Command{
log.Fatalf("Cannot register the view: %v", err)
}
- repoPath := cctx.String(FlagWalletRepo)
- r, err := repo.NewFS(repoPath)
- if err != nil {
- return err
- }
-
- ok, err := r.Exists()
- if err != nil {
- return err
- }
- if !ok {
- if err := r.Init(repo.Worker); err != nil {
- return err
- }
- }
-
- lr, err := r.Lock(repo.Wallet)
- if err != nil {
- return err
- }
-
- ks, err := lr.KeyStore()
+ lr, ks, err := openRepo(cctx)
if err != nil {
return err
}
+ defer lr.Close() // nolint
lw, err := wallet.NewWallet(ks)
if err != nil {
@@ -149,10 +188,10 @@ var runCmd = &cli.Command{
log.Info("Setting up API endpoint at " + address)
if cctx.Bool("interactive") {
- var ag func() (api.FullNode, jsonrpc.ClientCloser, error)
+ var ag func() (v0api.FullNode, jsonrpc.ClientCloser, error)
if !cctx.Bool("offline") {
- ag = func() (api.FullNode, jsonrpc.ClientCloser, error) {
+ ag = func() (v0api.FullNode, jsonrpc.ClientCloser, error) {
return lcli.GetFullNodeAPI(cctx)
}
}
@@ -165,19 +204,43 @@ var runCmd = &cli.Command{
w = &LoggedWallet{under: w}
}
+ rpcApi := metrics.MetricedWalletAPI(w)
+ if !cctx.Bool("disable-auth") {
+ rpcApi = api.PermissionedWalletAPI(rpcApi)
+ }
+
rpcServer := jsonrpc.NewServer()
- rpcServer.Register("Filecoin", metrics.MetricedWalletAPI(w))
+ rpcServer.Register("Filecoin", rpcApi)
mux.Handle("/rpc/v0", rpcServer)
mux.PathPrefix("/").Handler(http.DefaultServeMux) // pprof
- /*ah := &auth.Handler{
- Verify: nodeApi.AuthVerify,
- Next: mux.ServeHTTP,
- }*/
+ var handler http.Handler = mux
+
+ if !cctx.Bool("disable-auth") {
+ authKey, err := modules.APISecret(ks, lr)
+ if err != nil {
+ return xerrors.Errorf("setting up api secret: %w", err)
+ }
+
+ authVerify := func(ctx context.Context, token string) ([]auth.Permission, error) {
+ var payload jwtPayload
+ if _, err := jwt.Verify([]byte(token), (*jwt.HMACSHA)(authKey), &payload); err != nil {
+ return nil, xerrors.Errorf("JWT Verification failed: %w", err)
+ }
+
+ return payload.Allow, nil
+ }
+
+ log.Info("API auth enabled, use 'lotus-wallet get-api-key' to get API key")
+ handler = &auth.Handler{
+ Verify: authVerify,
+ Next: mux.ServeHTTP,
+ }
+ }
srv := &http.Server{
- Handler: mux,
+ Handler: handler,
BaseContext: func(listener net.Listener) context.Context {
ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, "lotus-wallet"))
return ctx
@@ -201,3 +264,33 @@ var runCmd = &cli.Command{
return srv.Serve(nl)
},
}
+
+func openRepo(cctx *cli.Context) (repo.LockedRepo, types.KeyStore, error) {
+ repoPath := cctx.String(FlagWalletRepo)
+ r, err := repo.NewFS(repoPath)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ ok, err := r.Exists()
+ if err != nil {
+ return nil, nil, err
+ }
+ if !ok {
+ if err := r.Init(repo.Worker); err != nil {
+ return nil, nil, err
+ }
+ }
+
+ lr, err := r.Lock(repo.Wallet)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ ks, err := lr.KeyStore()
+ if err != nil {
+ return nil, nil, err
+ }
+
+ return lr, ks, nil
+}
diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go
index 644892ee2..0504c3418 100644
--- a/cmd/lotus/daemon.go
+++ b/cmd/lotus/daemon.go
@@ -15,6 +15,7 @@ import (
"runtime/pprof"
"strings"
+ "github.com/filecoin-project/go-jsonrpc"
paramfetch "github.com/filecoin-project/go-paramfetch"
metricsprom "github.com/ipfs/go-metrics-prometheus"
"github.com/mitchellh/go-homedir"
@@ -351,8 +352,37 @@ var DaemonCmd = &cli.Command{
return xerrors.Errorf("getting api endpoint: %w", err)
}
+ //
+ // Instantiate JSON-RPC endpoint.
+ // ----
+
+ // Populate JSON-RPC options.
+ serverOptions := make([]jsonrpc.ServerOption, 0)
+ if maxRequestSize := cctx.Int("api-max-req-size"); maxRequestSize != 0 {
+ serverOptions = append(serverOptions, jsonrpc.WithMaxRequestSize(int64(maxRequestSize)))
+ }
+
+ // Instantiate the full node handler.
+ h, err := node.FullNodeHandler(api, true, serverOptions...)
+ if err != nil {
+ return fmt.Errorf("failed to instantiate rpc handler: %s", err)
+ }
+
+ // Serve the RPC.
+ rpcStopper, err := node.ServeRPC(h, "lotus-daemon", endpoint)
+ if err != nil {
+ return fmt.Errorf("failed to start json-rpc endpoint: %s", err)
+ }
+
+ // Monitor for shutdown.
+ finishCh := node.MonitorShutdown(shutdownChan,
+ node.ShutdownHandler{Component: "rpc server", StopFunc: rpcStopper},
+ node.ShutdownHandler{Component: "node", StopFunc: stop},
+ )
+ <-finishCh // fires when shutdown is complete.
+
// TODO: properly parse api endpoint (or make it a URL)
- return serveRPC(api, stop, endpoint, shutdownChan, int64(cctx.Int("api-max-req-size")))
+ return nil
},
Subcommands: []*cli.Command{
daemonStopCmd,
diff --git a/cmd/lotus/main.go b/cmd/lotus/main.go
index af9c56735..63d01f891 100644
--- a/cmd/lotus/main.go
+++ b/cmd/lotus/main.go
@@ -2,7 +2,10 @@ package main
import (
"context"
+ "os"
+ logging "github.com/ipfs/go-log/v2"
+ "github.com/mattn/go-isatty"
"github.com/urfave/cli/v2"
"go.opencensus.io/trace"
@@ -14,6 +17,8 @@ import (
"github.com/filecoin-project/lotus/node/repo"
)
+var log = logging.Logger("main")
+
var AdvanceBlockCmd *cli.Command
func main() {
@@ -52,6 +57,8 @@ func main() {
ctx, span := trace.StartSpan(context.Background(), "/cli")
defer span.End()
+ interactiveDef := isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())
+
app := &cli.App{
Name: "lotus",
Usage: "Filecoin decentralized storage network client",
@@ -64,10 +71,20 @@ func main() {
Hidden: true,
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
},
+ &cli.BoolFlag{
+ Name: "interactive",
+ Usage: "setting to false will disable interactive functionality of commands",
+ Value: interactiveDef,
+ },
+ &cli.BoolFlag{
+ Name: "force-send",
+ Usage: "if true, will ignore pre-send checks",
+ },
},
Commands: append(local, lcli.Commands...),
}
+
app.Setup()
app.Metadata["traceContext"] = ctx
app.Metadata["repoType"] = repo.FullNode
diff --git a/cmd/lotus/pprof.go b/cmd/lotus/pprof.go
deleted file mode 100644
index ea6823e48..000000000
--- a/cmd/lotus/pprof.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package main
-
-import (
- "net/http"
- "strconv"
-)
-
-func handleFractionOpt(name string, setter func(int)) http.HandlerFunc {
- return func(rw http.ResponseWriter, r *http.Request) {
- if r.Method != http.MethodPost {
- http.Error(rw, "only POST allowed", http.StatusMethodNotAllowed)
- return
- }
- if err := r.ParseForm(); err != nil {
- http.Error(rw, err.Error(), http.StatusBadRequest)
- return
- }
-
- asfr := r.Form.Get("x")
- if len(asfr) == 0 {
- http.Error(rw, "parameter 'x' must be set", http.StatusBadRequest)
- return
- }
-
- fr, err := strconv.Atoi(asfr)
- if err != nil {
- http.Error(rw, err.Error(), http.StatusBadRequest)
- return
- }
- log.Infof("setting %s to %d", name, fr)
- setter(fr)
- }
-}
diff --git a/cmd/lotus/rpc.go b/cmd/lotus/rpc.go
deleted file mode 100644
index abadfd20c..000000000
--- a/cmd/lotus/rpc.go
+++ /dev/null
@@ -1,131 +0,0 @@
-package main
-
-import (
- "context"
- "encoding/json"
- "net"
- "net/http"
- _ "net/http/pprof"
- "os"
- "os/signal"
- "runtime"
- "syscall"
-
- "github.com/ipfs/go-cid"
- logging "github.com/ipfs/go-log/v2"
- "github.com/multiformats/go-multiaddr"
- manet "github.com/multiformats/go-multiaddr/net"
- "go.opencensus.io/tag"
- "golang.org/x/xerrors"
-
- "github.com/filecoin-project/go-jsonrpc"
- "github.com/filecoin-project/go-jsonrpc/auth"
-
- "github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/apistruct"
- "github.com/filecoin-project/lotus/metrics"
- "github.com/filecoin-project/lotus/node"
- "github.com/filecoin-project/lotus/node/impl"
-)
-
-var log = logging.Logger("main")
-
-func serveRPC(a api.FullNode, stop node.StopFunc, addr multiaddr.Multiaddr, shutdownCh <-chan struct{}, maxRequestSize int64) error {
- serverOptions := make([]jsonrpc.ServerOption, 0)
- if maxRequestSize != 0 { // config set
- serverOptions = append(serverOptions, jsonrpc.WithMaxRequestSize(maxRequestSize))
- }
- rpcServer := jsonrpc.NewServer(serverOptions...)
- rpcServer.Register("Filecoin", apistruct.PermissionedFullAPI(metrics.MetricedFullAPI(a)))
- rpcServer.AliasMethod("rpc.discover", "Filecoin.Discover")
-
- ah := &auth.Handler{
- Verify: a.AuthVerify,
- Next: rpcServer.ServeHTTP,
- }
-
- http.Handle("/rpc/v0", ah)
-
- importAH := &auth.Handler{
- Verify: a.AuthVerify,
- Next: handleImport(a.(*impl.FullNodeAPI)),
- }
-
- http.Handle("/rest/v0/import", importAH)
-
- http.Handle("/debug/metrics", metrics.Exporter())
- http.Handle("/debug/pprof-set/block", handleFractionOpt("BlockProfileRate", runtime.SetBlockProfileRate))
- http.Handle("/debug/pprof-set/mutex", handleFractionOpt("MutexProfileFraction",
- func(x int) { runtime.SetMutexProfileFraction(x) },
- ))
-
- lst, err := manet.Listen(addr)
- if err != nil {
- return xerrors.Errorf("could not listen: %w", err)
- }
-
- srv := &http.Server{
- Handler: http.DefaultServeMux,
- BaseContext: func(listener net.Listener) context.Context {
- ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, "lotus-daemon"))
- return ctx
- },
- }
-
- sigCh := make(chan os.Signal, 2)
- shutdownDone := make(chan struct{})
- go func() {
- select {
- case sig := <-sigCh:
- log.Warnw("received shutdown", "signal", sig)
- case <-shutdownCh:
- log.Warn("received shutdown")
- }
-
- log.Warn("Shutting down...")
- if err := srv.Shutdown(context.TODO()); err != nil {
- log.Errorf("shutting down RPC server failed: %s", err)
- }
- if err := stop(context.TODO()); err != nil {
- log.Errorf("graceful shutting down failed: %s", err)
- }
- log.Warn("Graceful shutdown successful")
- _ = log.Sync() //nolint:errcheck
- close(shutdownDone)
- }()
- signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGINT)
-
- err = srv.Serve(manet.NetListener(lst))
- if err == http.ErrServerClosed {
- <-shutdownDone
- return nil
- }
- return err
-}
-
-func handleImport(a *impl.FullNodeAPI) func(w http.ResponseWriter, r *http.Request) {
- return func(w http.ResponseWriter, r *http.Request) {
- if r.Method != "PUT" {
- w.WriteHeader(404)
- return
- }
- if !auth.HasPerm(r.Context(), nil, apistruct.PermWrite) {
- w.WriteHeader(401)
- _ = json.NewEncoder(w).Encode(struct{ Error string }{"unauthorized: missing write permission"})
- return
- }
-
- c, err := a.ClientImportLocal(r.Context(), r.Body)
- if err != nil {
- w.WriteHeader(500)
- _ = json.NewEncoder(w).Encode(struct{ Error string }{err.Error()})
- return
- }
- w.WriteHeader(200)
- err = json.NewEncoder(w).Encode(struct{ Cid cid.Cid }{c})
- if err != nil {
- log.Errorf("/rest/v0/import: Writing response failed: %+v", err)
- return
- }
- }
-}
diff --git a/cmd/tvx/extract_message.go b/cmd/tvx/extract_message.go
index 0c2fcff4a..8e993cbd3 100644
--- a/cmd/tvx/extract_message.go
+++ b/cmd/tvx/extract_message.go
@@ -8,6 +8,8 @@ import (
"io"
"log"
+ "github.com/filecoin-project/lotus/api/v0api"
+
"github.com/fatih/color"
"github.com/filecoin-project/go-address"
@@ -318,7 +320,7 @@ func doExtractMessage(opts extractOpts) error {
// resolveFromChain queries the chain for the provided message, using the block CID to
// speed up the query, if provided
-func resolveFromChain(ctx context.Context, api api.FullNode, mcid cid.Cid, block string) (msg *types.Message, execTs *types.TipSet, incTs *types.TipSet, err error) {
+func resolveFromChain(ctx context.Context, api v0api.FullNode, mcid cid.Cid, block string) (msg *types.Message, execTs *types.TipSet, incTs *types.TipSet, err error) {
// Extract the full message.
msg, err = api.ChainGetMessage(ctx, mcid)
if err != nil {
@@ -373,7 +375,7 @@ func resolveFromChain(ctx context.Context, api api.FullNode, mcid cid.Cid, block
// as the previous tipset. In the context of vector generation, the target
// tipset is the one where a message was executed, and the previous tipset is
// the one where the message was included.
-func fetchThisAndPrevTipset(ctx context.Context, api api.FullNode, target types.TipSetKey) (targetTs *types.TipSet, prevTs *types.TipSet, err error) {
+func fetchThisAndPrevTipset(ctx context.Context, api v0api.FullNode, target types.TipSetKey) (targetTs *types.TipSet, prevTs *types.TipSet, err error) {
// get the tipset on which this message was "executed" on.
// https://github.com/filecoin-project/lotus/issues/2847
targetTs, err = api.ChainGetTipSet(ctx, target)
diff --git a/cmd/tvx/main.go b/cmd/tvx/main.go
index 94a656c3e..0fed8fad4 100644
--- a/cmd/tvx/main.go
+++ b/cmd/tvx/main.go
@@ -9,13 +9,13 @@ import (
"github.com/filecoin-project/go-jsonrpc"
"github.com/urfave/cli/v2"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
lcli "github.com/filecoin-project/lotus/cli"
)
// FullAPI is a JSON-RPC client targeting a full node. It's initialized in a
// cli.BeforeFunc.
-var FullAPI api.FullNode
+var FullAPI v0api.FullNode
// Closer is the closer for the JSON-RPC client, which must be called on
// cli.AfterFunc.
diff --git a/cmd/tvx/state.go b/cmd/tvx/state.go
index bff5cbd6e..f2d25300a 100644
--- a/cmd/tvx/state.go
+++ b/cmd/tvx/state.go
@@ -6,6 +6,8 @@ import (
"io"
"log"
+ "github.com/filecoin-project/lotus/api/v0api"
+
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
@@ -13,7 +15,6 @@ import (
"github.com/ipld/go-car"
cbg "github.com/whyrusleeping/cbor-gen"
- "github.com/filecoin-project/lotus/api"
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
"github.com/filecoin-project/lotus/chain/state"
"github.com/filecoin-project/lotus/chain/types"
@@ -23,13 +24,13 @@ import (
// StateSurgeon is an object used to fetch and manipulate state.
type StateSurgeon struct {
ctx context.Context
- api api.FullNode
+ api v0api.FullNode
stores *Stores
}
// NewSurgeon returns a state surgeon, an object used to fetch and manipulate
// state.
-func NewSurgeon(ctx context.Context, api api.FullNode, stores *Stores) *StateSurgeon {
+func NewSurgeon(ctx context.Context, api v0api.FullNode, stores *Stores) *StateSurgeon {
return &StateSurgeon{
ctx: ctx,
api: api,
@@ -85,7 +86,7 @@ func (sg *StateSurgeon) GetMaskedStateTree(previousRoot cid.Cid, retain []addres
// GetAccessedActors identifies the actors that were accessed during the
// execution of a message.
-func (sg *StateSurgeon) GetAccessedActors(ctx context.Context, a api.FullNode, mid cid.Cid) ([]address.Address, error) {
+func (sg *StateSurgeon) GetAccessedActors(ctx context.Context, a v0api.FullNode, mid cid.Cid) ([]address.Address, error) {
log.Printf("calculating accessed actors during execution of message: %s", mid)
msgInfo, err := a.StateSearchMsg(ctx, mid)
if err != nil {
diff --git a/cmd/tvx/stores.go b/cmd/tvx/stores.go
index 66445be70..040005641 100644
--- a/cmd/tvx/stores.go
+++ b/cmd/tvx/stores.go
@@ -5,10 +5,11 @@ import (
"log"
"sync"
+ "github.com/filecoin-project/lotus/api/v0api"
+
"github.com/fatih/color"
dssync "github.com/ipfs/go-datastore/sync"
- "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/actors/adt"
@@ -40,7 +41,7 @@ type Stores struct {
// NewProxyingStores is a set of Stores backed by a proxying Blockstore that
// proxies Get requests for unknown CIDs to a Filecoin node, via the
// ChainReadObj RPC.
-func NewProxyingStores(ctx context.Context, api api.FullNode) *Stores {
+func NewProxyingStores(ctx context.Context, api v0api.FullNode) *Stores {
ds := dssync.MutexWrap(ds.NewMapDatastore())
bs := &proxyingBlockstore{
ctx: ctx,
@@ -85,7 +86,7 @@ type TracingBlockstore interface {
// a Filecoin node via JSON-RPC.
type proxyingBlockstore struct {
ctx context.Context
- api api.FullNode
+ api v0api.FullNode
lk sync.Mutex
tracing bool
diff --git a/conformance/driver.go b/conformance/driver.go
index 70100700e..c7fc0d6c4 100644
--- a/conformance/driver.go
+++ b/conformance/driver.go
@@ -141,16 +141,11 @@ func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, params
blocks = append(blocks, sb)
}
- var (
- messages []*types.Message
- results []*vm.ApplyRet
- )
-
- recordOutputs := func(_ cid.Cid, msg *types.Message, ret *vm.ApplyRet) error {
- messages = append(messages, msg)
- results = append(results, ret)
- return nil
+ recordOutputs := &outputRecorder{
+ messages: []*types.Message{},
+ results: []*vm.ApplyRet{},
}
+
postcid, receiptsroot, err := sm.ApplyBlocks(context.Background(),
params.ParentEpoch,
params.Preroot,
@@ -169,8 +164,8 @@ func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, params
ret := &ExecuteTipsetResult{
ReceiptsRoot: receiptsroot,
PostStateRoot: postcid,
- AppliedMessages: messages,
- AppliedResults: results,
+ AppliedMessages: recordOutputs.messages,
+ AppliedResults: recordOutputs.results,
}
return ret, nil
}
@@ -284,3 +279,14 @@ func CircSupplyOrDefault(circSupply *gobig.Int) abi.TokenAmount {
}
return big.NewFromGo(circSupply)
}
+
+type outputRecorder struct {
+ messages []*types.Message
+ results []*vm.ApplyRet
+}
+
+func (o *outputRecorder) MessageApplied(ctx context.Context, ts *types.TipSet, mcid cid.Cid, msg *types.Message, ret *vm.ApplyRet, implicit bool) error {
+ o.messages = append(o.messages, msg)
+ o.results = append(o.results, ret)
+ return nil
+}
diff --git a/conformance/rand_record.go b/conformance/rand_record.go
index 5b4985fef..906d6b73d 100644
--- a/conformance/rand_record.go
+++ b/conformance/rand_record.go
@@ -10,14 +10,14 @@ import (
"github.com/filecoin-project/test-vectors/schema"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/vm"
)
type RecordingRand struct {
reporter Reporter
- api api.FullNode
+ api v0api.FullNode
// once guards the loading of the head tipset.
// can be removed when https://github.com/filecoin-project/lotus/issues/4223
@@ -33,7 +33,7 @@ var _ vm.Rand = (*RecordingRand)(nil)
// NewRecordingRand returns a vm.Rand implementation that proxies calls to a
// full Lotus node via JSON-RPC, and records matching rules and responses so
// they can later be embedded in test vectors.
-func NewRecordingRand(reporter Reporter, api api.FullNode) *RecordingRand {
+func NewRecordingRand(reporter Reporter, api v0api.FullNode) *RecordingRand {
return &RecordingRand{reporter: reporter, api: api}
}
diff --git a/documentation/en/api-methods-miner.md b/documentation/en/api-v0-methods-miner.md
similarity index 99%
rename from documentation/en/api-methods-miner.md
rename to documentation/en/api-v0-methods-miner.md
index 1e8e7cbc5..388213666 100644
--- a/documentation/en/api-methods-miner.md
+++ b/documentation/en/api-v0-methods-miner.md
@@ -197,7 +197,7 @@ Response:
```json
{
"Version": "string value",
- "APIVersion": 66048,
+ "APIVersion": 131328,
"BlockDelay": 42
}
```
@@ -889,8 +889,8 @@ Inputs: `null`
Response:
```json
{
- "Addrs": null,
- "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Addrs": []
}
```
@@ -1039,8 +1039,8 @@ Inputs:
```json
[
{
- "Addrs": null,
- "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Addrs": []
}
]
```
@@ -1090,8 +1090,8 @@ Inputs:
Response:
```json
{
- "Addrs": null,
- "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Addrs": []
}
```
diff --git a/documentation/en/api-methods-worker.md b/documentation/en/api-v0-methods-worker.md
similarity index 94%
rename from documentation/en/api-methods-worker.md
rename to documentation/en/api-v0-methods-worker.md
index ddbc6e7f4..925f8934b 100644
--- a/documentation/en/api-methods-worker.md
+++ b/documentation/en/api-v0-methods-worker.md
@@ -15,8 +15,6 @@
* [MoveStorage](#MoveStorage)
* [Process](#Process)
* [ProcessSession](#ProcessSession)
-* [Read](#Read)
- * [ReadPiece](#ReadPiece)
* [Release](#Release)
* [ReleaseUnsealed](#ReleaseUnsealed)
* [Seal](#Seal)
@@ -145,7 +143,7 @@ Perms: admin
Inputs: `null`
-Response: `66048`
+Response: `131328`
## Add
@@ -263,41 +261,6 @@ Inputs: `null`
Response: `"07070707-0707-0707-0707-070707070707"`
-## Read
-
-
-### ReadPiece
-
-
-Perms: admin
-
-Inputs:
-```json
-[
- {},
- {
- "ID": {
- "Miner": 1000,
- "Number": 9
- },
- "ProofType": 8
- },
- 1040384,
- 1024
-]
-```
-
-Response:
-```json
-{
- "Sector": {
- "Miner": 1000,
- "Number": 9
- },
- "ID": "07070707-0707-0707-0707-070707070707"
-}
-```
-
## Release
diff --git a/documentation/en/api-methods.md b/documentation/en/api-v0-methods.md
similarity index 97%
rename from documentation/en/api-methods.md
rename to documentation/en/api-v0-methods.md
index 743432cb0..f6da2244c 100644
--- a/documentation/en/api-methods.md
+++ b/documentation/en/api-v0-methods.md
@@ -44,11 +44,13 @@
* [ClientGetDealInfo](#ClientGetDealInfo)
* [ClientGetDealStatus](#ClientGetDealStatus)
* [ClientGetDealUpdates](#ClientGetDealUpdates)
+ * [ClientGetRetrievalUpdates](#ClientGetRetrievalUpdates)
* [ClientHasLocal](#ClientHasLocal)
* [ClientImport](#ClientImport)
* [ClientListDataTransfers](#ClientListDataTransfers)
* [ClientListDeals](#ClientListDeals)
* [ClientListImports](#ClientListImports)
+ * [ClientListRetrievals](#ClientListRetrievals)
* [ClientMinerQueryOffer](#ClientMinerQueryOffer)
* [ClientQueryAsk](#ClientQueryAsk)
* [ClientRemoveImport](#ClientRemoveImport)
@@ -57,6 +59,7 @@
* [ClientRetrieveTryRestartInsufficientFunds](#ClientRetrieveTryRestartInsufficientFunds)
* [ClientRetrieveWithEvents](#ClientRetrieveWithEvents)
* [ClientStartDeal](#ClientStartDeal)
+ * [ClientStatelessDeal](#ClientStatelessDeal)
* [Create](#Create)
* [CreateBackup](#CreateBackup)
* [Gas](#Gas)
@@ -276,7 +279,7 @@ Response:
```json
{
"Version": "string value",
- "APIVersion": 66048,
+ "APIVersion": 131328,
"BlockDelay": 42
}
```
@@ -1196,6 +1199,54 @@ Response:
}
```
+### ClientGetRetrievalUpdates
+ClientGetRetrievalUpdates returns status of updated retrieval deals
+
+
+Perms: write
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "PayloadCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "ID": 5,
+ "PieceCID": null,
+ "PricePerByte": "0",
+ "UnsealPrice": "0",
+ "Status": 0,
+ "Message": "string value",
+ "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "BytesReceived": 42,
+ "BytesPaidFor": 42,
+ "TotalPaid": "0",
+ "TransferChannelID": {
+ "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "ID": 3
+ },
+ "DataTransfer": {
+ "TransferID": 3,
+ "Status": 1,
+ "BaseCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "IsInitiator": true,
+ "IsSender": true,
+ "Voucher": "string value",
+ "Message": "string value",
+ "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Transferred": 42,
+ "Stages": {
+ "Stages": null
+ }
+ }
+}
+```
+
### ClientHasLocal
ClientHasLocal indicates whether a certain CID is locally stored.
@@ -1263,6 +1314,17 @@ Response: `null`
ClientListImports lists imported files and their root CIDs
+Perms: write
+
+Inputs: `null`
+
+Response: `null`
+
+### ClientListRetrievals
+ClientQueryAsk returns a signed StorageAsk from the specified miner.
+ClientListRetrievals returns information about retrievals made by the local client
+
+
Perms: write
Inputs: `null`
@@ -1309,7 +1371,6 @@ Response:
```
### ClientQueryAsk
-ClientQueryAsk returns a signed StorageAsk from the specified miner.
Perms: read
@@ -1501,6 +1562,39 @@ Inputs:
Response: `null`
+### ClientStatelessDeal
+ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ {
+ "Data": {
+ "TransferType": "string value",
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "PieceCid": null,
+ "PieceSize": 1024,
+ "RawBlockSize": 42
+ },
+ "Wallet": "f01234",
+ "Miner": "f01234",
+ "EpochPrice": "0",
+ "MinBlocksDuration": 42,
+ "ProviderCollateral": "0",
+ "DealStartEpoch": 10101,
+ "FastRetrieval": true,
+ "VerifiedDeal": true
+ }
+]
+```
+
+Response: `null`
+
## Create
@@ -2747,8 +2841,8 @@ Inputs: `null`
Response:
```json
{
- "Addrs": null,
- "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Addrs": []
}
```
@@ -2897,8 +2991,8 @@ Inputs:
```json
[
{
- "Addrs": null,
- "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Addrs": []
}
]
```
@@ -2948,8 +3042,8 @@ Inputs:
Response:
```json
{
- "Addrs": null,
- "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Addrs": []
}
```
@@ -4943,7 +5037,8 @@ Response:
"FilMined": "0",
"FilBurnt": "0",
"FilLocked": "0",
- "FilCirculating": "0"
+ "FilCirculating": "0",
+ "FilReserveDisbursed": "0"
}
```
diff --git a/documentation/en/api-v1-unstable-methods.md b/documentation/en/api-v1-unstable-methods.md
new file mode 100644
index 000000000..761950829
--- /dev/null
+++ b/documentation/en/api-v1-unstable-methods.md
@@ -0,0 +1,5836 @@
+# Groups
+* [](#)
+ * [Closing](#Closing)
+ * [Discover](#Discover)
+ * [Session](#Session)
+ * [Shutdown](#Shutdown)
+ * [Version](#Version)
+* [Auth](#Auth)
+ * [AuthNew](#AuthNew)
+ * [AuthVerify](#AuthVerify)
+* [Beacon](#Beacon)
+ * [BeaconGetEntry](#BeaconGetEntry)
+* [Chain](#Chain)
+ * [ChainDeleteObj](#ChainDeleteObj)
+ * [ChainExport](#ChainExport)
+ * [ChainGetBlock](#ChainGetBlock)
+ * [ChainGetBlockMessages](#ChainGetBlockMessages)
+ * [ChainGetGenesis](#ChainGetGenesis)
+ * [ChainGetMessage](#ChainGetMessage)
+ * [ChainGetNode](#ChainGetNode)
+ * [ChainGetParentMessages](#ChainGetParentMessages)
+ * [ChainGetParentReceipts](#ChainGetParentReceipts)
+ * [ChainGetPath](#ChainGetPath)
+ * [ChainGetRandomnessFromBeacon](#ChainGetRandomnessFromBeacon)
+ * [ChainGetRandomnessFromTickets](#ChainGetRandomnessFromTickets)
+ * [ChainGetTipSet](#ChainGetTipSet)
+ * [ChainGetTipSetByHeight](#ChainGetTipSetByHeight)
+ * [ChainHasObj](#ChainHasObj)
+ * [ChainHead](#ChainHead)
+ * [ChainNotify](#ChainNotify)
+ * [ChainReadObj](#ChainReadObj)
+ * [ChainSetHead](#ChainSetHead)
+ * [ChainStatObj](#ChainStatObj)
+ * [ChainTipSetWeight](#ChainTipSetWeight)
+* [Client](#Client)
+ * [ClientCalcCommP](#ClientCalcCommP)
+ * [ClientCancelDataTransfer](#ClientCancelDataTransfer)
+ * [ClientCancelRetrievalDeal](#ClientCancelRetrievalDeal)
+ * [ClientDataTransferUpdates](#ClientDataTransferUpdates)
+ * [ClientDealPieceCID](#ClientDealPieceCID)
+ * [ClientDealSize](#ClientDealSize)
+ * [ClientFindData](#ClientFindData)
+ * [ClientGenCar](#ClientGenCar)
+ * [ClientGetDealInfo](#ClientGetDealInfo)
+ * [ClientGetDealStatus](#ClientGetDealStatus)
+ * [ClientGetDealUpdates](#ClientGetDealUpdates)
+ * [ClientGetRetrievalUpdates](#ClientGetRetrievalUpdates)
+ * [ClientHasLocal](#ClientHasLocal)
+ * [ClientImport](#ClientImport)
+ * [ClientListDataTransfers](#ClientListDataTransfers)
+ * [ClientListDeals](#ClientListDeals)
+ * [ClientListImports](#ClientListImports)
+ * [ClientListRetrievals](#ClientListRetrievals)
+ * [ClientMinerQueryOffer](#ClientMinerQueryOffer)
+ * [ClientQueryAsk](#ClientQueryAsk)
+ * [ClientRemoveImport](#ClientRemoveImport)
+ * [ClientRestartDataTransfer](#ClientRestartDataTransfer)
+ * [ClientRetrieve](#ClientRetrieve)
+ * [ClientRetrieveTryRestartInsufficientFunds](#ClientRetrieveTryRestartInsufficientFunds)
+ * [ClientRetrieveWithEvents](#ClientRetrieveWithEvents)
+ * [ClientStartDeal](#ClientStartDeal)
+ * [ClientStatelessDeal](#ClientStatelessDeal)
+* [Create](#Create)
+ * [CreateBackup](#CreateBackup)
+* [Gas](#Gas)
+ * [GasEstimateFeeCap](#GasEstimateFeeCap)
+ * [GasEstimateGasLimit](#GasEstimateGasLimit)
+ * [GasEstimateGasPremium](#GasEstimateGasPremium)
+ * [GasEstimateMessageGas](#GasEstimateMessageGas)
+* [I](#I)
+ * [ID](#ID)
+* [Log](#Log)
+ * [LogList](#LogList)
+ * [LogSetLevel](#LogSetLevel)
+* [Market](#Market)
+ * [MarketAddBalance](#MarketAddBalance)
+ * [MarketGetReserved](#MarketGetReserved)
+ * [MarketReleaseFunds](#MarketReleaseFunds)
+ * [MarketReserveFunds](#MarketReserveFunds)
+ * [MarketWithdraw](#MarketWithdraw)
+* [Miner](#Miner)
+ * [MinerCreateBlock](#MinerCreateBlock)
+ * [MinerGetBaseInfo](#MinerGetBaseInfo)
+* [Mpool](#Mpool)
+ * [MpoolBatchPush](#MpoolBatchPush)
+ * [MpoolBatchPushMessage](#MpoolBatchPushMessage)
+ * [MpoolBatchPushUntrusted](#MpoolBatchPushUntrusted)
+ * [MpoolCheckMessages](#MpoolCheckMessages)
+ * [MpoolCheckPendingMessages](#MpoolCheckPendingMessages)
+ * [MpoolCheckReplaceMessages](#MpoolCheckReplaceMessages)
+ * [MpoolClear](#MpoolClear)
+ * [MpoolGetConfig](#MpoolGetConfig)
+ * [MpoolGetNonce](#MpoolGetNonce)
+ * [MpoolPending](#MpoolPending)
+ * [MpoolPush](#MpoolPush)
+ * [MpoolPushMessage](#MpoolPushMessage)
+ * [MpoolPushUntrusted](#MpoolPushUntrusted)
+ * [MpoolSelect](#MpoolSelect)
+ * [MpoolSetConfig](#MpoolSetConfig)
+ * [MpoolSub](#MpoolSub)
+* [Msig](#Msig)
+ * [MsigAddApprove](#MsigAddApprove)
+ * [MsigAddCancel](#MsigAddCancel)
+ * [MsigAddPropose](#MsigAddPropose)
+ * [MsigApprove](#MsigApprove)
+ * [MsigApproveTxnHash](#MsigApproveTxnHash)
+ * [MsigCancel](#MsigCancel)
+ * [MsigCreate](#MsigCreate)
+ * [MsigGetAvailableBalance](#MsigGetAvailableBalance)
+ * [MsigGetPending](#MsigGetPending)
+ * [MsigGetVested](#MsigGetVested)
+ * [MsigGetVestingSchedule](#MsigGetVestingSchedule)
+ * [MsigPropose](#MsigPropose)
+ * [MsigRemoveSigner](#MsigRemoveSigner)
+ * [MsigSwapApprove](#MsigSwapApprove)
+ * [MsigSwapCancel](#MsigSwapCancel)
+ * [MsigSwapPropose](#MsigSwapPropose)
+* [Net](#Net)
+ * [NetAddrsListen](#NetAddrsListen)
+ * [NetAgentVersion](#NetAgentVersion)
+ * [NetAutoNatStatus](#NetAutoNatStatus)
+ * [NetBandwidthStats](#NetBandwidthStats)
+ * [NetBandwidthStatsByPeer](#NetBandwidthStatsByPeer)
+ * [NetBandwidthStatsByProtocol](#NetBandwidthStatsByProtocol)
+ * [NetBlockAdd](#NetBlockAdd)
+ * [NetBlockList](#NetBlockList)
+ * [NetBlockRemove](#NetBlockRemove)
+ * [NetConnect](#NetConnect)
+ * [NetConnectedness](#NetConnectedness)
+ * [NetDisconnect](#NetDisconnect)
+ * [NetFindPeer](#NetFindPeer)
+ * [NetPeerInfo](#NetPeerInfo)
+ * [NetPeers](#NetPeers)
+ * [NetPubsubScores](#NetPubsubScores)
+* [Node](#Node)
+ * [NodeStatus](#NodeStatus)
+* [Paych](#Paych)
+ * [PaychAllocateLane](#PaychAllocateLane)
+ * [PaychAvailableFunds](#PaychAvailableFunds)
+ * [PaychAvailableFundsByFromTo](#PaychAvailableFundsByFromTo)
+ * [PaychCollect](#PaychCollect)
+ * [PaychGet](#PaychGet)
+ * [PaychGetWaitReady](#PaychGetWaitReady)
+ * [PaychList](#PaychList)
+ * [PaychNewPayment](#PaychNewPayment)
+ * [PaychSettle](#PaychSettle)
+ * [PaychStatus](#PaychStatus)
+ * [PaychVoucherAdd](#PaychVoucherAdd)
+ * [PaychVoucherCheckSpendable](#PaychVoucherCheckSpendable)
+ * [PaychVoucherCheckValid](#PaychVoucherCheckValid)
+ * [PaychVoucherCreate](#PaychVoucherCreate)
+ * [PaychVoucherList](#PaychVoucherList)
+ * [PaychVoucherSubmit](#PaychVoucherSubmit)
+* [State](#State)
+ * [StateAccountKey](#StateAccountKey)
+ * [StateAllMinerFaults](#StateAllMinerFaults)
+ * [StateCall](#StateCall)
+ * [StateChangedActors](#StateChangedActors)
+ * [StateCirculatingSupply](#StateCirculatingSupply)
+ * [StateCompute](#StateCompute)
+ * [StateDealProviderCollateralBounds](#StateDealProviderCollateralBounds)
+ * [StateDecodeParams](#StateDecodeParams)
+ * [StateGetActor](#StateGetActor)
+ * [StateListActors](#StateListActors)
+ * [StateListMessages](#StateListMessages)
+ * [StateListMiners](#StateListMiners)
+ * [StateLookupID](#StateLookupID)
+ * [StateMarketBalance](#StateMarketBalance)
+ * [StateMarketDeals](#StateMarketDeals)
+ * [StateMarketParticipants](#StateMarketParticipants)
+ * [StateMarketStorageDeal](#StateMarketStorageDeal)
+ * [StateMinerActiveSectors](#StateMinerActiveSectors)
+ * [StateMinerAvailableBalance](#StateMinerAvailableBalance)
+ * [StateMinerDeadlines](#StateMinerDeadlines)
+ * [StateMinerFaults](#StateMinerFaults)
+ * [StateMinerInfo](#StateMinerInfo)
+ * [StateMinerInitialPledgeCollateral](#StateMinerInitialPledgeCollateral)
+ * [StateMinerPartitions](#StateMinerPartitions)
+ * [StateMinerPower](#StateMinerPower)
+ * [StateMinerPreCommitDepositForPower](#StateMinerPreCommitDepositForPower)
+ * [StateMinerProvingDeadline](#StateMinerProvingDeadline)
+ * [StateMinerRecoveries](#StateMinerRecoveries)
+ * [StateMinerSectorAllocated](#StateMinerSectorAllocated)
+ * [StateMinerSectorCount](#StateMinerSectorCount)
+ * [StateMinerSectors](#StateMinerSectors)
+ * [StateNetworkName](#StateNetworkName)
+ * [StateNetworkVersion](#StateNetworkVersion)
+ * [StateReadState](#StateReadState)
+ * [StateReplay](#StateReplay)
+ * [StateSearchMsg](#StateSearchMsg)
+ * [StateSectorExpiration](#StateSectorExpiration)
+ * [StateSectorGetInfo](#StateSectorGetInfo)
+ * [StateSectorPartition](#StateSectorPartition)
+ * [StateSectorPreCommitInfo](#StateSectorPreCommitInfo)
+ * [StateVMCirculatingSupplyInternal](#StateVMCirculatingSupplyInternal)
+ * [StateVerifiedClientStatus](#StateVerifiedClientStatus)
+ * [StateVerifiedRegistryRootKey](#StateVerifiedRegistryRootKey)
+ * [StateVerifierStatus](#StateVerifierStatus)
+ * [StateWaitMsg](#StateWaitMsg)
+* [Sync](#Sync)
+ * [SyncCheckBad](#SyncCheckBad)
+ * [SyncCheckpoint](#SyncCheckpoint)
+ * [SyncIncomingBlocks](#SyncIncomingBlocks)
+ * [SyncMarkBad](#SyncMarkBad)
+ * [SyncState](#SyncState)
+ * [SyncSubmitBlock](#SyncSubmitBlock)
+ * [SyncUnmarkAllBad](#SyncUnmarkAllBad)
+ * [SyncUnmarkBad](#SyncUnmarkBad)
+ * [SyncValidateTipset](#SyncValidateTipset)
+* [Wallet](#Wallet)
+ * [WalletBalance](#WalletBalance)
+ * [WalletDefaultAddress](#WalletDefaultAddress)
+ * [WalletDelete](#WalletDelete)
+ * [WalletExport](#WalletExport)
+ * [WalletHas](#WalletHas)
+ * [WalletImport](#WalletImport)
+ * [WalletList](#WalletList)
+ * [WalletNew](#WalletNew)
+ * [WalletSetDefault](#WalletSetDefault)
+ * [WalletSign](#WalletSign)
+ * [WalletSignMessage](#WalletSignMessage)
+ * [WalletValidateAddress](#WalletValidateAddress)
+ * [WalletVerify](#WalletVerify)
+##
+
+
+### Closing
+
+
+Perms: read
+
+Inputs: `null`
+
+Response: `{}`
+
+### Discover
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "info": {
+ "title": "Lotus RPC API",
+ "version": "1.2.1/generated=2020-11-22T08:22:42-06:00"
+ },
+ "methods": [],
+ "openrpc": "1.2.6"
+}
+```
+
+### Session
+
+
+Perms: read
+
+Inputs: `null`
+
+Response: `"07070707-0707-0707-0707-070707070707"`
+
+### Shutdown
+
+
+Perms: admin
+
+Inputs: `null`
+
+Response: `{}`
+
+### Version
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "Version": "string value",
+ "APIVersion": 131328,
+ "BlockDelay": 42
+}
+```
+
+## Auth
+
+
+### AuthNew
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ null
+]
+```
+
+Response: `"Ynl0ZSBhcnJheQ=="`
+
+### AuthVerify
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "string value"
+]
+```
+
+Response: `null`
+
+## Beacon
+The Beacon method group contains methods for interacting with the random beacon (DRAND)
+
+
+### BeaconGetEntry
+BeaconGetEntry returns the beacon entry for the given filecoin epoch. If
+the entry has not yet been produced, the call will block until the entry
+becomes available
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ 10101
+]
+```
+
+Response:
+```json
+{
+ "Round": 42,
+ "Data": "Ynl0ZSBhcnJheQ=="
+}
+```
+
+## Chain
+The Chain method group contains methods for interacting with the
+blockchain, but that do not require any form of state computation.
+
+
+### ChainDeleteObj
+ChainDeleteObj deletes node referenced by the given CID
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `{}`
+
+### ChainExport
+ChainExport returns a stream of bytes with CAR dump of chain data.
+The exported chain data includes the header chain from the given tipset
+back to genesis, the entire genesis state, and the most recent 'nroots'
+state trees.
+If oldmsgskip is set, messages from before the requested roots are also not included.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ 10101,
+ true,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"Ynl0ZSBhcnJheQ=="`
+
+### ChainGetBlock
+ChainGetBlock returns the block specified by the given CID.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response:
+```json
+{
+ "Miner": "f01234",
+ "Ticket": {
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "ElectionProof": {
+ "WinCount": 9,
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "BeaconEntries": null,
+ "WinPoStProof": null,
+ "Parents": null,
+ "ParentWeight": "0",
+ "Height": 10101,
+ "ParentStateRoot": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "ParentMessageReceipts": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Messages": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "BLSAggregate": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "Timestamp": 42,
+ "BlockSig": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "ForkSignaling": 42,
+ "ParentBaseFee": "0"
+}
+```
+
+### ChainGetBlockMessages
+ChainGetBlockMessages returns messages stored in the specified block.
+
+Note: If there are multiple blocks in a tipset, it's likely that some
+messages will be duplicated. It's also possible for blocks in a tipset to have
+different messages from the same sender at the same nonce. When that happens,
+only the first message (in a block with lowest ticket) will be considered
+for execution
+
+NOTE: THIS METHOD SHOULD ONLY BE USED FOR GETTING MESSAGES IN A SPECIFIC BLOCK
+
+DO NOT USE THIS METHOD TO GET MESSAGES INCLUDED IN A TIPSET
+Use ChainGetParentMessages, which will perform correct message deduplication
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response:
+```json
+{
+ "BlsMessages": null,
+ "SecpkMessages": null,
+ "Cids": null
+}
+```
+
+### ChainGetGenesis
+ChainGetGenesis returns the genesis tipset.
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "Cids": null,
+ "Blocks": null,
+ "Height": 0
+}
+```
+
+### ChainGetMessage
+ChainGetMessage reads a message referenced by the specified CID from the
+chain blockstore.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response:
+```json
+{
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+}
+```
+
+### ChainGetNode
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "string value"
+]
+```
+
+Response:
+```json
+{
+ "Cid": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Obj": {}
+}
+```
+
+### ChainGetParentMessages
+ChainGetParentMessages returns messages stored in parent tipset of the
+specified block.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `null`
+
+### ChainGetParentReceipts
+ChainGetParentReceipts returns receipts for messages in parent tipset of
+the specified block. The receipts in the list returned is one-to-one with the
+messages returned by a call to ChainGetParentMessages with the same blockCid.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `null`
+
+### ChainGetPath
+ChainGetPath returns a set of revert/apply operations needed to get from
+one tipset to another, for example:
+```
+ to
+ ^
+from tAA
+ ^ ^
+tBA tAB
+ ^---*--^
+ ^
+ tRR
+```
+Would return `[revert(tBA), apply(tAB), apply(tAA)]`
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### ChainGetRandomnessFromBeacon
+ChainGetRandomnessFromBeacon is used to sample the beacon for randomness.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ 2,
+ 10101,
+ "Ynl0ZSBhcnJheQ=="
+]
+```
+
+Response: `null`
+
+### ChainGetRandomnessFromTickets
+ChainGetRandomnessFromTickets is used to sample the chain for randomness.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ 2,
+ 10101,
+ "Ynl0ZSBhcnJheQ=="
+]
+```
+
+Response: `null`
+
+### ChainGetTipSet
+ChainGetTipSet returns the tipset specified by the given TipSetKey.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Cids": null,
+ "Blocks": null,
+ "Height": 0
+}
+```
+
+### ChainGetTipSetByHeight
+ChainGetTipSetByHeight looks back for a tipset at the specified epoch.
+If there are no blocks at the specified epoch, a tipset at an earlier epoch
+will be returned.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ 10101,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Cids": null,
+ "Blocks": null,
+ "Height": 0
+}
+```
+
+### ChainHasObj
+ChainHasObj checks if a given CID exists in the chain blockstore.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `true`
+
+### ChainHead
+ChainHead returns the current head of the chain.
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "Cids": null,
+ "Blocks": null,
+ "Height": 0
+}
+```
+
+### ChainNotify
+ChainNotify returns channel with chain head updates.
+First message is guaranteed to be of len == 1, and type == 'current'.
+
+
+Perms: read
+
+Inputs: `null`
+
+Response: `null`
+
+### ChainReadObj
+ChainReadObj reads ipld nodes referenced by the specified CID from chain
+blockstore and returns raw bytes.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `"Ynl0ZSBhcnJheQ=="`
+
+### ChainSetHead
+ChainSetHead forcefully sets current chain head. Use with caution.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `{}`
+
+### ChainStatObj
+ChainStatObj returns statistics about the graph referenced by 'obj'.
+If 'base' is also specified, then the returned stat will be a diff
+between the two objects.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response:
+```json
+{
+ "Size": 42,
+ "Links": 42
+}
+```
+
+### ChainTipSetWeight
+ChainTipSetWeight computes weight for the specified tipset.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+## Client
+The Client methods all have to do with interacting with the storage and
+retrieval markets as a client
+
+
+### ClientCalcCommP
+ClientCalcCommP calculates the CommP for a specified file
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ "string value"
+]
+```
+
+Response:
+```json
+{
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Size": 1024
+}
+```
+
+### ClientCancelDataTransfer
+ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ 3,
+ "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ true
+]
+```
+
+Response: `{}`
+
+### ClientCancelRetrievalDeal
+ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ 5
+]
+```
+
+Response: `{}`
+
+### ClientDataTransferUpdates
+
+
+Perms: write
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "TransferID": 3,
+ "Status": 1,
+ "BaseCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "IsInitiator": true,
+ "IsSender": true,
+ "Voucher": "string value",
+ "Message": "string value",
+ "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Transferred": 42,
+ "Stages": {
+ "Stages": null
+ }
+}
+```
+
+### ClientDealPieceCID
+ClientCalcCommP calculates the CommP and data size of the specified CID
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response:
+```json
+{
+ "PayloadSize": 9,
+ "PieceSize": 1032,
+ "PieceCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+}
+```
+
+### ClientDealSize
+ClientDealSize calculates real deal data size
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response:
+```json
+{
+ "PayloadSize": 9,
+ "PieceSize": 1032
+}
+```
+
+### ClientFindData
+ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer).
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ null
+]
+```
+
+Response: `null`
+
+### ClientGenCar
+ClientGenCar generates a CAR file for the specified file.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ {
+ "Path": "string value",
+ "IsCAR": true
+ },
+ "string value"
+]
+```
+
+Response: `{}`
+
+### ClientGetDealInfo
+ClientGetDealInfo returns the latest information about a given deal.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response:
+```json
+{
+ "ProposalCid": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "State": 42,
+ "Message": "string value",
+ "DealStages": {
+ "Stages": null
+ },
+ "Provider": "f01234",
+ "DataRef": {
+ "TransferType": "string value",
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "PieceCid": null,
+ "PieceSize": 1024,
+ "RawBlockSize": 42
+ },
+ "PieceCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Size": 42,
+ "PricePerEpoch": "0",
+ "Duration": 42,
+ "DealID": 5432,
+ "CreationTime": "0001-01-01T00:00:00Z",
+ "Verified": true,
+ "TransferChannelID": {
+ "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "ID": 3
+ },
+ "DataTransfer": {
+ "TransferID": 3,
+ "Status": 1,
+ "BaseCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "IsInitiator": true,
+ "IsSender": true,
+ "Voucher": "string value",
+ "Message": "string value",
+ "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Transferred": 42,
+ "Stages": {
+ "Stages": null
+ }
+ }
+}
+```
+
+### ClientGetDealStatus
+ClientGetDealStatus returns status given a code
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ 42
+]
+```
+
+Response: `"string value"`
+
+### ClientGetDealUpdates
+ClientGetDealUpdates returns the status of updated deals
+
+
+Perms: write
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "ProposalCid": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "State": 42,
+ "Message": "string value",
+ "DealStages": {
+ "Stages": null
+ },
+ "Provider": "f01234",
+ "DataRef": {
+ "TransferType": "string value",
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "PieceCid": null,
+ "PieceSize": 1024,
+ "RawBlockSize": 42
+ },
+ "PieceCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Size": 42,
+ "PricePerEpoch": "0",
+ "Duration": 42,
+ "DealID": 5432,
+ "CreationTime": "0001-01-01T00:00:00Z",
+ "Verified": true,
+ "TransferChannelID": {
+ "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "ID": 3
+ },
+ "DataTransfer": {
+ "TransferID": 3,
+ "Status": 1,
+ "BaseCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "IsInitiator": true,
+ "IsSender": true,
+ "Voucher": "string value",
+ "Message": "string value",
+ "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Transferred": 42,
+ "Stages": {
+ "Stages": null
+ }
+ }
+}
+```
+
+### ClientGetRetrievalUpdates
+ClientGetRetrievalUpdates returns status of updated retrieval deals
+
+
+Perms: write
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "PayloadCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "ID": 5,
+ "PieceCID": null,
+ "PricePerByte": "0",
+ "UnsealPrice": "0",
+ "Status": 0,
+ "Message": "string value",
+ "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "BytesReceived": 42,
+ "BytesPaidFor": 42,
+ "TotalPaid": "0",
+ "TransferChannelID": {
+ "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "ID": 3
+ },
+ "DataTransfer": {
+ "TransferID": 3,
+ "Status": 1,
+ "BaseCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "IsInitiator": true,
+ "IsSender": true,
+ "Voucher": "string value",
+ "Message": "string value",
+ "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Transferred": 42,
+ "Stages": {
+ "Stages": null
+ }
+ }
+}
+```
+
+### ClientHasLocal
+ClientHasLocal indicates whether a certain CID is locally stored.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `true`
+
+### ClientImport
+ClientImport imports file under the specified path into filestore.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "Path": "string value",
+ "IsCAR": true
+ }
+]
+```
+
+Response:
+```json
+{
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "ImportID": 50
+}
+```
+
+### ClientListDataTransfers
+ClientListTransfers returns the status of all ongoing transfers of data
+
+
+Perms: write
+
+Inputs: `null`
+
+Response: `null`
+
+### ClientListDeals
+ClientListDeals returns information about the deals made by the local client.
+
+
+Perms: write
+
+Inputs: `null`
+
+Response: `null`
+
+### ClientListImports
+ClientListImports lists imported files and their root CIDs
+
+
+Perms: write
+
+Inputs: `null`
+
+Response: `null`
+
+### ClientListRetrievals
+ClientListRetrievals returns information about retrievals made by the local client
+
+
+Perms: write
+
+Inputs: `null`
+
+Response: `null`
+
+### ClientMinerQueryOffer
+ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ null
+]
+```
+
+Response:
+```json
+{
+ "Err": "string value",
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Piece": null,
+ "Size": 42,
+ "MinPrice": "0",
+ "UnsealPrice": "0",
+ "PaymentInterval": 42,
+ "PaymentIntervalIncrease": 42,
+ "Miner": "f01234",
+ "MinerPeer": {
+ "Address": "f01234",
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "PieceCID": null
+ }
+}
+```
+
+### ClientQueryAsk
+ClientQueryAsk returns a signed StorageAsk from the specified miner.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "Price": "0",
+ "VerifiedPrice": "0",
+ "MinPieceSize": 1032,
+ "MaxPieceSize": 1032,
+ "Miner": "f01234",
+ "Timestamp": 10101,
+ "Expiry": 10101,
+ "SeqNo": 42
+}
+```
+
+### ClientRemoveImport
+ClientRemoveImport removes file import
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ 50
+]
+```
+
+Response: `{}`
+
+### ClientRestartDataTransfer
+ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ 3,
+ "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ true
+]
+```
+
+Response: `{}`
+
+### ClientRetrieve
+ClientRetrieve initiates the retrieval of a file, as specified in the order.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Piece": null,
+ "Size": 42,
+ "LocalStore": 12,
+ "Total": "0",
+ "UnsealPrice": "0",
+ "PaymentInterval": 42,
+ "PaymentIntervalIncrease": 42,
+ "Client": "f01234",
+ "Miner": "f01234",
+ "MinerPeer": {
+ "Address": "f01234",
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "PieceCID": null
+ }
+ },
+ {
+ "Path": "string value",
+ "IsCAR": true
+ }
+]
+```
+
+Response: `{}`
+
+### ClientRetrieveTryRestartInsufficientFunds
+ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel
+which are stuck due to insufficient funds
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `{}`
+
+### ClientRetrieveWithEvents
+ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
+of status updates.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Piece": null,
+ "Size": 42,
+ "LocalStore": 12,
+ "Total": "0",
+ "UnsealPrice": "0",
+ "PaymentInterval": 42,
+ "PaymentIntervalIncrease": 42,
+ "Client": "f01234",
+ "Miner": "f01234",
+ "MinerPeer": {
+ "Address": "f01234",
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "PieceCID": null
+ }
+ },
+ {
+ "Path": "string value",
+ "IsCAR": true
+ }
+]
+```
+
+Response:
+```json
+{
+ "Event": 5,
+ "Status": 0,
+ "BytesReceived": 42,
+ "FundsSpent": "0",
+ "Err": "string value"
+}
+```
+
+### ClientStartDeal
+ClientStartDeal proposes a deal with a miner.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "Data": {
+ "TransferType": "string value",
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "PieceCid": null,
+ "PieceSize": 1024,
+ "RawBlockSize": 42
+ },
+ "Wallet": "f01234",
+ "Miner": "f01234",
+ "EpochPrice": "0",
+ "MinBlocksDuration": 42,
+ "ProviderCollateral": "0",
+ "DealStartEpoch": 10101,
+ "FastRetrieval": true,
+ "VerifiedDeal": true
+ }
+]
+```
+
+Response: `null`
+
+### ClientStatelessDeal
+ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ {
+ "Data": {
+ "TransferType": "string value",
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "PieceCid": null,
+ "PieceSize": 1024,
+ "RawBlockSize": 42
+ },
+ "Wallet": "f01234",
+ "Miner": "f01234",
+ "EpochPrice": "0",
+ "MinBlocksDuration": 42,
+ "ProviderCollateral": "0",
+ "DealStartEpoch": 10101,
+ "FastRetrieval": true,
+ "VerifiedDeal": true
+ }
+]
+```
+
+Response: `null`
+
+## Create
+
+
+### CreateBackup
+CreateBackup creates node backup onder the specified file name. The
+method requires that the lotus daemon is running with the
+LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that
+the path specified when calling CreateBackup is within the base path
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ "string value"
+]
+```
+
+Response: `{}`
+
+## Gas
+
+
+### GasEstimateFeeCap
+GasEstimateFeeCap estimates gas fee cap
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ 9,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### GasEstimateGasLimit
+GasEstimateGasLimit estimates gas used by the message and returns it.
+It fails if message fails to execute.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `9`
+
+### GasEstimateGasPremium
+GasEstimateGasPremium estimates what gas price should be used for a
+message to have high likelihood of inclusion in `nblocksincl` epochs.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ 42,
+ "f01234",
+ 9,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### GasEstimateMessageGas
+GasEstimateMessageGas estimates gas values for unset message gas fields
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ {
+ "MaxFee": "0"
+ },
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+}
+```
+
+## I
+
+
+### ID
+
+
+Perms: read
+
+Inputs: `null`
+
+Response: `"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"`
+
+## Log
+
+
+### LogList
+
+
+Perms: write
+
+Inputs: `null`
+
+Response: `null`
+
+### LogSetLevel
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ "string value",
+ "string value"
+]
+```
+
+Response: `{}`
+
+## Market
+
+
+### MarketAddBalance
+MarketAddBalance adds funds to the market actor
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ "0"
+]
+```
+
+Response:
+```json
+{
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+}
+```
+
+### MarketGetReserved
+MarketGetReserved gets the amount of funds that are currently reserved for the address
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `"0"`
+
+### MarketReleaseFunds
+MarketReleaseFunds releases funds reserved by MarketReserveFunds
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "0"
+]
+```
+
+Response: `{}`
+
+### MarketReserveFunds
+MarketReserveFunds reserves funds for a deal
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ "0"
+]
+```
+
+Response:
+```json
+{
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+}
+```
+
+### MarketWithdraw
+MarketWithdraw withdraws unlocked funds from the market actor
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ "0"
+]
+```
+
+Response:
+```json
+{
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+}
+```
+
+## Miner
+
+
+### MinerCreateBlock
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ {
+ "Miner": "f01234",
+ "Parents": [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ "Ticket": {
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "Eproof": {
+ "WinCount": 9,
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "BeaconValues": null,
+ "Messages": null,
+ "Epoch": 10101,
+ "Timestamp": 42,
+ "WinningPoStProof": null
+ }
+]
+```
+
+Response:
+```json
+{
+ "Header": {
+ "Miner": "f01234",
+ "Ticket": {
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "ElectionProof": {
+ "WinCount": 9,
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "BeaconEntries": null,
+ "WinPoStProof": null,
+ "Parents": null,
+ "ParentWeight": "0",
+ "Height": 10101,
+ "ParentStateRoot": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "ParentMessageReceipts": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Messages": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "BLSAggregate": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "Timestamp": 42,
+ "BlockSig": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "ForkSignaling": 42,
+ "ParentBaseFee": "0"
+ },
+ "BlsMessages": null,
+ "SecpkMessages": null
+}
+```
+
+### MinerGetBaseInfo
+There are not yet any comments for this method.
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ 10101,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "MinerPower": "0",
+ "NetworkPower": "0",
+ "Sectors": null,
+ "WorkerKey": "f01234",
+ "SectorSize": 34359738368,
+ "PrevBeaconEntry": {
+ "Round": 42,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "BeaconEntries": null,
+ "EligibleForMining": true
+}
+```
+
+## Mpool
+The Mpool methods are for interacting with the message pool. The message pool
+manages all incoming and outgoing 'messages' going over the network.
+
+
+### MpoolBatchPush
+MpoolBatchPush batch pushes a signed message to mempool.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ null
+]
+```
+
+Response: `null`
+
+### MpoolBatchPushMessage
+MpoolBatchPushMessage batch pushes a unsigned message to mempool.
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ null,
+ {
+ "MaxFee": "0"
+ }
+]
+```
+
+Response: `null`
+
+### MpoolBatchPushUntrusted
+MpoolBatchPushUntrusted batch pushes a signed message to mempool from untrusted sources.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ null
+]
+```
+
+Response: `null`
+
+### MpoolCheckMessages
+MpoolCheckMessages performs logical checks on a batch of messages
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ null
+]
+```
+
+Response: `null`
+
+### MpoolCheckPendingMessages
+MpoolCheckPendingMessages performs logical checks for all pending messages from a given address
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `null`
+
+### MpoolCheckReplaceMessages
+MpoolCheckReplaceMessages performs logical checks on pending messages with replacement
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ null
+]
+```
+
+Response: `null`
+
+### MpoolClear
+MpoolClear clears pending messages from the mpool
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ true
+]
+```
+
+Response: `{}`
+
+### MpoolGetConfig
+MpoolGetConfig returns (a copy of) the current mpool config
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "PriorityAddrs": null,
+ "SizeLimitHigh": 123,
+ "SizeLimitLow": 123,
+ "ReplaceByFeeRatio": 12.3,
+ "PruneCooldown": 60000000000,
+ "GasLimitOverestimation": 12.3
+}
+```
+
+### MpoolGetNonce
+MpoolGetNonce gets next nonce for the specified sender.
+Note that this method may not be atomic. Use MpoolPushMessage instead.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `42`
+
+### MpoolPending
+MpoolPending returns pending mempool messages.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### MpoolPush
+MpoolPush pushes a signed message to mempool.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ {
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ }
+]
+```
+
+Response:
+```json
+{
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+}
+```
+
+### MpoolPushMessage
+MpoolPushMessage atomically assigns a nonce, signs, and pushes a message
+to mempool.
+maxFee is only used when GasFeeCap/GasPremium fields aren't specified
+
+When maxFee is set to 0, MpoolPushMessage will guess appropriate fee
+based on current chain conditions
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ {
+ "MaxFee": "0"
+ }
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+}
+```
+
+### MpoolPushUntrusted
+MpoolPushUntrusted pushes a signed message to mempool from untrusted sources.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ {
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ }
+]
+```
+
+Response:
+```json
+{
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+}
+```
+
+### MpoolSelect
+MpoolSelect returns a list of pending messages for inclusion in the next block
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ 12.3
+]
+```
+
+Response: `null`
+
+### MpoolSetConfig
+MpoolSetConfig sets the mpool config to (a copy of) the supplied config
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "PriorityAddrs": null,
+ "SizeLimitHigh": 123,
+ "SizeLimitLow": 123,
+ "ReplaceByFeeRatio": 12.3,
+ "PruneCooldown": 60000000000,
+ "GasLimitOverestimation": 12.3
+ }
+]
+```
+
+Response: `{}`
+
+### MpoolSub
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "Type": 0,
+ "Message": {
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ }
+}
+```
+
+## Msig
+The Msig methods are used to interact with multisig wallets on the
+filecoin network
+
+
+### MsigAddApprove
+MsigAddApprove approves a previously proposed AddSigner message
+It takes the following params: , , ,
+, ,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ 42,
+ "f01234",
+ "f01234",
+ true
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigAddCancel
+MsigAddCancel cancels a previously proposed AddSigner message
+It takes the following params: , , ,
+,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ 42,
+ "f01234",
+ true
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigAddPropose
+MsigAddPropose proposes adding a signer in the multisig
+It takes the following params: , ,
+,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ "f01234",
+ true
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigApprove
+MsigApprove approves a previously-proposed multisig message by transaction ID
+It takes the following params: ,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ 42,
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigApproveTxnHash
+MsigApproveTxnHash approves a previously-proposed multisig message, specified
+using both transaction ID and a hash of the parameters used in the
+proposal. This method of approval can be used to ensure you only approve
+exactly the transaction you think you are.
+It takes the following params: , , , , ,
+, ,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ 42,
+ "f01234",
+ "f01234",
+ "0",
+ "f01234",
+ 42,
+ "Ynl0ZSBhcnJheQ=="
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigCancel
+MsigCancel cancels a previously-proposed multisig message
+It takes the following params: , , , ,
+, ,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ 42,
+ "f01234",
+ "0",
+ "f01234",
+ 42,
+ "Ynl0ZSBhcnJheQ=="
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigCreate
+MsigCreate creates a multisig wallet
+It takes the following params: , ,
+, ,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ 42,
+ null,
+ 10101,
+ "0",
+ "f01234",
+ "0"
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigGetAvailableBalance
+MsigGetAvailableBalance returns the portion of a multisig's balance that can be withdrawn or spent
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### MsigGetPending
+MsigGetPending returns pending transactions for the given multisig
+wallet. Once pending transactions are fully approved, they will no longer
+appear here.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### MsigGetVested
+MsigGetVested returns the amount of FIL that vested in a multisig in a certain period.
+It takes the following params: , ,
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### MsigGetVestingSchedule
+MsigGetVestingSchedule returns the vesting details of a given multisig.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "InitialBalance": "0",
+ "StartEpoch": 10101,
+ "UnlockDuration": 10101
+}
+```
+
+### MsigPropose
+MsigPropose proposes a multisig message
+It takes the following params: , , ,
+, ,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ "0",
+ "f01234",
+ 42,
+ "Ynl0ZSBhcnJheQ=="
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigRemoveSigner
+MsigRemoveSigner proposes the removal of a signer from the multisig.
+It accepts the multisig to make the change on, the proposer address to
+send the message from, the address to be removed, and a boolean
+indicating whether or not the signing threshold should be lowered by one
+along with the address removal.
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ "f01234",
+ true
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigSwapApprove
+MsigSwapApprove approves a previously proposed SwapSigner
+It takes the following params: , , ,
+, ,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ 42,
+ "f01234",
+ "f01234",
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigSwapCancel
+MsigSwapCancel cancels a previously proposed SwapSigner message
+It takes the following params: , , ,
+,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ 42,
+ "f01234",
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+### MsigSwapPropose
+MsigSwapPropose proposes swapping 2 signers in the multisig
+It takes the following params: , ,
+,
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ "f01234",
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "ValidNonce": true
+}
+```
+
+## Net
+
+
+### NetAddrsListen
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Addrs": []
+}
+```
+
+### NetAgentVersion
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+]
+```
+
+Response: `"string value"`
+
+### NetAutoNatStatus
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "Reachability": 1,
+ "PublicAddr": "string value"
+}
+```
+
+### NetBandwidthStats
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "TotalIn": 9,
+ "TotalOut": 9,
+ "RateIn": 12.3,
+ "RateOut": 12.3
+}
+```
+
+### NetBandwidthStatsByPeer
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "12D3KooWSXmXLJmBR1M7i9RW9GQPNUhZSzXKzxDHWtAgNuJAbyEJ": {
+ "TotalIn": 174000,
+ "TotalOut": 12500,
+ "RateIn": 100,
+ "RateOut": 50
+ }
+}
+```
+
+### NetBandwidthStatsByProtocol
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "/fil/hello/1.0.0": {
+ "TotalIn": 174000,
+ "TotalOut": 12500,
+ "RateIn": 100,
+ "RateOut": 50
+ }
+}
+```
+
+### NetBlockAdd
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "Peers": null,
+ "IPAddrs": null,
+ "IPSubnets": null
+ }
+]
+```
+
+Response: `{}`
+
+### NetBlockList
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "Peers": null,
+ "IPAddrs": null,
+ "IPSubnets": null
+}
+```
+
+### NetBlockRemove
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "Peers": null,
+ "IPAddrs": null,
+ "IPSubnets": null
+ }
+]
+```
+
+Response: `{}`
+
+### NetConnect
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ {
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Addrs": []
+ }
+]
+```
+
+Response: `{}`
+
+### NetConnectedness
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+]
+```
+
+Response: `1`
+
+### NetDisconnect
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+]
+```
+
+Response: `{}`
+
+### NetFindPeer
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+]
+```
+
+Response:
+```json
+{
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Addrs": []
+}
+```
+
+### NetPeerInfo
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"
+]
+```
+
+Response:
+```json
+{
+ "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Agent": "string value",
+ "Addrs": null,
+ "Protocols": null,
+ "ConnMgrMeta": {
+ "FirstSeen": "0001-01-01T00:00:00Z",
+ "Value": 123,
+ "Tags": {
+ "name": 42
+ },
+ "Conns": {
+ "name": "2021-03-08T22:52:18Z"
+ }
+ }
+}
+```
+
+### NetPeers
+
+
+Perms: read
+
+Inputs: `null`
+
+Response: `null`
+
+### NetPubsubScores
+
+
+Perms: read
+
+Inputs: `null`
+
+Response: `null`
+
+## Node
+These methods are general node management and status commands
+
+
+### NodeStatus
+There are not yet any comments for this method.
+
+Perms: read
+
+Inputs:
+```json
+[
+ true
+]
+```
+
+Response:
+```json
+{
+ "SyncStatus": {
+ "Epoch": 42,
+ "Behind": 42
+ },
+ "PeerStatus": {
+ "PeersToPublishMsgs": 123,
+ "PeersToPublishBlocks": 123
+ },
+ "ChainStatus": {
+ "BlocksPerTipsetLast100": 12.3,
+ "BlocksPerTipsetLastFinality": 12.3
+ }
+}
+```
+
+## Paych
+The Paych methods are for interacting with and managing payment channels
+
+
+### PaychAllocateLane
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `42`
+
+### PaychAvailableFunds
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "Channel": "\u003cempty\u003e",
+ "From": "f01234",
+ "To": "f01234",
+ "ConfirmedAmt": "0",
+ "PendingAmt": "0",
+ "PendingWaitSentinel": null,
+ "QueuedAmt": "0",
+ "VoucherReedeemedAmt": "0"
+}
+```
+
+### PaychAvailableFundsByFromTo
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "Channel": "\u003cempty\u003e",
+ "From": "f01234",
+ "To": "f01234",
+ "ConfirmedAmt": "0",
+ "PendingAmt": "0",
+ "PendingWaitSentinel": null,
+ "QueuedAmt": "0",
+ "VoucherReedeemedAmt": "0"
+}
+```
+
+### PaychCollect
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+}
+```
+
+### PaychGet
+There are not yet any comments for this method.
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ "0"
+]
+```
+
+Response:
+```json
+{
+ "Channel": "f01234",
+ "WaitSentinel": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+}
+```
+
+### PaychGetWaitReady
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `"f01234"`
+
+### PaychList
+
+
+Perms: read
+
+Inputs: `null`
+
+Response: `null`
+
+### PaychNewPayment
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "f01234",
+ null
+]
+```
+
+Response:
+```json
+{
+ "Channel": "f01234",
+ "WaitSentinel": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Vouchers": null
+}
+```
+
+### PaychSettle
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+}
+```
+
+### PaychStatus
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "ControlAddr": "f01234",
+ "Direction": 1
+}
+```
+
+### PaychVoucherAdd
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ "f01234",
+ {
+ "ChannelAddr": "f01234",
+ "TimeLockMin": 10101,
+ "TimeLockMax": 10101,
+ "SecretPreimage": "Ynl0ZSBhcnJheQ==",
+ "Extra": {
+ "Actor": "f01234",
+ "Method": 1,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "Lane": 42,
+ "Nonce": 42,
+ "Amount": "0",
+ "MinSettleHeight": 10101,
+ "Merges": null,
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ }
+ },
+ "Ynl0ZSBhcnJheQ==",
+ "0"
+]
+```
+
+Response: `"0"`
+
+### PaychVoucherCheckSpendable
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ {
+ "ChannelAddr": "f01234",
+ "TimeLockMin": 10101,
+ "TimeLockMax": 10101,
+ "SecretPreimage": "Ynl0ZSBhcnJheQ==",
+ "Extra": {
+ "Actor": "f01234",
+ "Method": 1,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "Lane": 42,
+ "Nonce": 42,
+ "Amount": "0",
+ "MinSettleHeight": 10101,
+ "Merges": null,
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ }
+ },
+ "Ynl0ZSBhcnJheQ==",
+ "Ynl0ZSBhcnJheQ=="
+]
+```
+
+Response: `true`
+
+### PaychVoucherCheckValid
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ {
+ "ChannelAddr": "f01234",
+ "TimeLockMin": 10101,
+ "TimeLockMax": 10101,
+ "SecretPreimage": "Ynl0ZSBhcnJheQ==",
+ "Extra": {
+ "Actor": "f01234",
+ "Method": 1,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "Lane": 42,
+ "Nonce": 42,
+ "Amount": "0",
+ "MinSettleHeight": 10101,
+ "Merges": null,
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ }
+ }
+]
+```
+
+Response: `{}`
+
+### PaychVoucherCreate
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "0",
+ 42
+]
+```
+
+Response:
+```json
+{
+ "Voucher": {
+ "ChannelAddr": "f01234",
+ "TimeLockMin": 10101,
+ "TimeLockMax": 10101,
+ "SecretPreimage": "Ynl0ZSBhcnJheQ==",
+ "Extra": {
+ "Actor": "f01234",
+ "Method": 1,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "Lane": 42,
+ "Nonce": 42,
+ "Amount": "0",
+ "MinSettleHeight": 10101,
+ "Merges": null,
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ }
+ },
+ "Shortfall": "0"
+}
+```
+
+### PaychVoucherList
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `null`
+
+### PaychVoucherSubmit
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ {
+ "ChannelAddr": "f01234",
+ "TimeLockMin": 10101,
+ "TimeLockMax": 10101,
+ "SecretPreimage": "Ynl0ZSBhcnJheQ==",
+ "Extra": {
+ "Actor": "f01234",
+ "Method": 1,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "Lane": 42,
+ "Nonce": 42,
+ "Amount": "0",
+ "MinSettleHeight": 10101,
+ "Merges": null,
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ }
+ },
+ "Ynl0ZSBhcnJheQ==",
+ "Ynl0ZSBhcnJheQ=="
+]
+```
+
+Response:
+```json
+{
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+}
+```
+
+## State
+The State methods are used to query, inspect, and interact with chain state.
+Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset.
+A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used.
+
+
+### StateAccountKey
+StateAccountKey returns the public key address of the given ID address
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"f01234"`
+
+### StateAllMinerFaults
+StateAllMinerFaults returns all non-expired Faults that occur within lookback epochs of the given tipset
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ 10101,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### StateCall
+StateCall runs the given message and returns its result without any persisted changes.
+
+StateCall applies the message to the tipset's parent state. The
+message is not applied on-top-of the messages in the passed-in
+tipset.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "MsgCid": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Msg": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "MsgRct": {
+ "ExitCode": 0,
+ "Return": "Ynl0ZSBhcnJheQ==",
+ "GasUsed": 9
+ },
+ "GasCost": {
+ "Message": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "GasUsed": "0",
+ "BaseFeeBurn": "0",
+ "OverEstimationBurn": "0",
+ "MinerPenalty": "0",
+ "MinerTip": "0",
+ "Refund": "0",
+ "TotalCost": "0"
+ },
+ "ExecutionTrace": {
+ "Msg": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "MsgRct": {
+ "ExitCode": 0,
+ "Return": "Ynl0ZSBhcnJheQ==",
+ "GasUsed": 9
+ },
+ "Error": "string value",
+ "Duration": 60000000000,
+ "GasCharges": null,
+ "Subcalls": null
+ },
+ "Error": "string value",
+ "Duration": 60000000000
+}
+```
+
+### StateChangedActors
+StateChangedActors returns all the actors whose states change between the two given state CIDs
+TODO: Should this take tipset keys instead?
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response:
+```json
+{
+ "t01236": {
+ "Code": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Head": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Nonce": 42,
+ "Balance": "0"
+ }
+}
+```
+
+### StateCirculatingSupply
+StateCirculatingSupply returns the exact circulating supply of Filecoin at the given tipset.
+This is not used anywhere in the protocol itself, and is only for external consumption.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### StateCompute
+StateCompute is a flexible command that applies the given messages on the given tipset.
+The messages are run as though the VM were at the provided height.
+
+When called, StateCompute will:
+- Load the provided tipset, or use the current chain head if not provided
+- Compute the tipset state of the provided tipset on top of the parent state
+ - (note that this step runs before vmheight is applied to the execution)
+ - Execute state upgrade if any were scheduled at the epoch, or in null
+ blocks preceding the tipset
+ - Call the cron actor on null blocks preceding the tipset
+ - For each block in the tipset
+ - Apply messages in blocks in the specified
+ - Award block reward by calling the reward actor
+ - Call the cron actor for the current epoch
+- If the specified vmheight is higher than the current epoch, apply any
+ needed state upgrades to the state
+- Apply the specified messages to the state
+
+The vmheight parameter sets VM execution epoch, and can be used to simulate
+message execution in different network versions. If the specified vmheight
+epoch is higher than the epoch of the specified tipset, any state upgrades
+until the vmheight will be executed on the state before applying messages
+specified by the user.
+
+Note that the initial tipset state computation is not affected by the
+vmheight parameter - only the messages in the `apply` set are
+
+If the caller wants to simply compute the state, vmheight should be set to
+the epoch of the specified tipset.
+
+Messages in the `apply` parameter must have the correct nonces, and gas
+values set.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ 10101,
+ null,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Root": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Trace": null
+}
+```
+
+### StateDealProviderCollateralBounds
+StateDealProviderCollateralBounds returns the min and max collateral a storage provider
+can issue. It takes the deal size and verified status as parameters.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ 1032,
+ true,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Min": "0",
+ "Max": "0"
+}
+```
+
+### StateDecodeParams
+StateDecodeParams attempts to decode the provided params, based on the recipient actor address and method number.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ 1,
+ "Ynl0ZSBhcnJheQ==",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `{}`
+
+### StateGetActor
+StateGetActor returns the indicated actor's nonce and balance.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Code": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Head": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Nonce": 42,
+ "Balance": "0"
+}
+```
+
+### StateListActors
+StateListActors returns the addresses of every actor in the state
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### StateListMessages
+StateListMessages looks back and returns all messages with a matching to or from address, stopping at the given height.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "To": "f01234",
+ "From": "f01234"
+ },
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ 10101
+]
+```
+
+Response: `null`
+
+### StateListMiners
+StateListMiners returns the addresses of every miner that has claimed power in the Power Actor
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### StateLookupID
+StateLookupID retrieves the ID address of the given address
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"f01234"`
+
+### StateMarketBalance
+StateMarketBalance looks up the Escrow and Locked balances of the given address in the Storage Market
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Escrow": "0",
+ "Locked": "0"
+}
+```
+
+### StateMarketDeals
+StateMarketDeals returns information about every deal in the Storage Market
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "t026363": {
+ "Proposal": {
+ "PieceCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "PieceSize": 1032,
+ "VerifiedDeal": true,
+ "Client": "f01234",
+ "Provider": "f01234",
+ "Label": "string value",
+ "StartEpoch": 10101,
+ "EndEpoch": 10101,
+ "StoragePricePerEpoch": "0",
+ "ProviderCollateral": "0",
+ "ClientCollateral": "0"
+ },
+ "State": {
+ "SectorStartEpoch": 10101,
+ "LastUpdatedEpoch": 10101,
+ "SlashEpoch": 10101
+ }
+ }
+}
+```
+
+### StateMarketParticipants
+StateMarketParticipants returns the Escrow and Locked balances of every participant in the Storage Market
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "t026363": {
+ "Escrow": "0",
+ "Locked": "0"
+ }
+}
+```
+
+### StateMarketStorageDeal
+StateMarketStorageDeal returns information about the indicated deal
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ 5432,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Proposal": {
+ "PieceCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "PieceSize": 1032,
+ "VerifiedDeal": true,
+ "Client": "f01234",
+ "Provider": "f01234",
+ "Label": "string value",
+ "StartEpoch": 10101,
+ "EndEpoch": 10101,
+ "StoragePricePerEpoch": "0",
+ "ProviderCollateral": "0",
+ "ClientCollateral": "0"
+ },
+ "State": {
+ "SectorStartEpoch": 10101,
+ "LastUpdatedEpoch": 10101,
+ "SlashEpoch": 10101
+ }
+}
+```
+
+### StateMinerActiveSectors
+StateMinerActiveSectors returns info about sectors that a given miner is actively proving.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### StateMinerAvailableBalance
+StateMinerAvailableBalance returns the portion of a miner's balance that can be withdrawn or spent
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### StateMinerDeadlines
+StateMinerDeadlines returns all the proving deadlines for the given miner
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### StateMinerFaults
+StateMinerFaults returns a bitfield indicating the faulty sectors of the given miner
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+[
+ 5,
+ 1
+]
+```
+
+### StateMinerInfo
+StateMinerInfo returns info about the indicated miner
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Owner": "f01234",
+ "Worker": "f01234",
+ "NewWorker": "f01234",
+ "ControlAddresses": null,
+ "WorkerChangeEpoch": 10101,
+ "PeerId": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
+ "Multiaddrs": null,
+ "WindowPoStProofType": 8,
+ "SectorSize": 34359738368,
+ "WindowPoStPartitionSectors": 42,
+ "ConsensusFaultElapsed": 10101
+}
+```
+
+### StateMinerInitialPledgeCollateral
+StateMinerInitialPledgeCollateral returns the initial pledge collateral for the specified miner's sector
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ {
+ "SealProof": 8,
+ "SectorNumber": 9,
+ "SealedCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "SealRandEpoch": 10101,
+ "DealIDs": null,
+ "Expiration": 10101,
+ "ReplaceCapacity": true,
+ "ReplaceSectorDeadline": 42,
+ "ReplaceSectorPartition": 42,
+ "ReplaceSectorNumber": 9
+ },
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### StateMinerPartitions
+StateMinerPartitions returns all partitions in the specified deadline
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ 42,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### StateMinerPower
+StateMinerPower returns the power of the indicated miner
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "MinerPower": {
+ "RawBytePower": "0",
+ "QualityAdjPower": "0"
+ },
+ "TotalPower": {
+ "RawBytePower": "0",
+ "QualityAdjPower": "0"
+ },
+ "HasMinPower": true
+}
+```
+
+### StateMinerPreCommitDepositForPower
+StateMinerInitialPledgeCollateral returns the precommit deposit for the specified miner's sector
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ {
+ "SealProof": 8,
+ "SectorNumber": 9,
+ "SealedCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "SealRandEpoch": 10101,
+ "DealIDs": null,
+ "Expiration": 10101,
+ "ReplaceCapacity": true,
+ "ReplaceSectorDeadline": 42,
+ "ReplaceSectorPartition": 42,
+ "ReplaceSectorNumber": 9
+ },
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### StateMinerProvingDeadline
+StateMinerProvingDeadline calculates the deadline at some epoch for a proving period
+and returns the deadline-related calculations.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "CurrentEpoch": 10101,
+ "PeriodStart": 10101,
+ "Index": 42,
+ "Open": 10101,
+ "Close": 10101,
+ "Challenge": 10101,
+ "FaultCutoff": 10101,
+ "WPoStPeriodDeadlines": 42,
+ "WPoStProvingPeriod": 10101,
+ "WPoStChallengeWindow": 10101,
+ "WPoStChallengeLookback": 10101,
+ "FaultDeclarationCutoff": 10101
+}
+```
+
+### StateMinerRecoveries
+StateMinerRecoveries returns a bitfield indicating the recovering sectors of the given miner
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+[
+ 5,
+ 1
+]
+```
+
+### StateMinerSectorAllocated
+StateMinerSectorAllocated checks if a sector is allocated
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ 9,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `true`
+
+### StateMinerSectorCount
+StateMinerSectorCount returns the number of sectors in a miner's sector set and proving set
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Live": 42,
+ "Active": 42,
+ "Faulty": 42
+}
+```
+
+### StateMinerSectors
+StateMinerSectors returns info about the given miner's sectors. If the filter bitfield is nil, all sectors are included.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ 0
+ ],
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `null`
+
+### StateNetworkName
+StateNetworkName returns the name of the network the node is synced to
+
+
+Perms: read
+
+Inputs: `null`
+
+Response: `"lotus"`
+
+### StateNetworkVersion
+StateNetworkVersion returns the network version at the given tipset
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `13`
+
+### StateReadState
+StateReadState returns the indicated actor's state.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Balance": "0",
+ "Code": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "State": {}
+}
+```
+
+### StateReplay
+StateReplay replays a given message, assuming it was included in a block in the specified tipset.
+
+If a tipset key is provided, and a replacing message is found on chain,
+the method will return an error saying that the message wasn't found
+
+If no tipset key is provided, the appropriate tipset is looked up, and if
+the message was gas-repriced, the on-chain message will be replayed - in
+that case the returned InvocResult.MsgCid will not match the Cid param
+
+If the caller wants to ensure that exactly the requested message was executed,
+they MUST check that InvocResult.MsgCid is equal to the provided Cid.
+Without this check both the requested and original message may appear as
+successfully executed on-chain, which may look like a double-spend.
+
+A replacing message is a message with a different CID, any of Gas values, and
+different signature, but with all other parameters matching (source/destination,
+nonce, params, etc.)
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response:
+```json
+{
+ "MsgCid": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Msg": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "MsgRct": {
+ "ExitCode": 0,
+ "Return": "Ynl0ZSBhcnJheQ==",
+ "GasUsed": 9
+ },
+ "GasCost": {
+ "Message": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "GasUsed": "0",
+ "BaseFeeBurn": "0",
+ "OverEstimationBurn": "0",
+ "MinerPenalty": "0",
+ "MinerTip": "0",
+ "Refund": "0",
+ "TotalCost": "0"
+ },
+ "ExecutionTrace": {
+ "Msg": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "MsgRct": {
+ "ExitCode": 0,
+ "Return": "Ynl0ZSBhcnJheQ==",
+ "GasUsed": 9
+ },
+ "Error": "string value",
+ "Duration": 60000000000,
+ "GasCharges": null,
+ "Subcalls": null
+ },
+ "Error": "string value",
+ "Duration": 60000000000
+}
+```
+
+### StateSearchMsg
+StateSearchMsg looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed
+
+NOTE: If a replacing message is found on chain, this method will return
+a MsgLookup for the replacing message - the MsgLookup.Message will be a different
+CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
+result of the execution of the replacing message.
+
+If the caller wants to ensure that exactly the requested message was executed,
+they must check that MsgLookup.Message is equal to the provided 'cid', or set the
+`allowReplaced` parameter to false. Without this check, and with `allowReplaced`
+set to true, both the requested and original message may appear as
+successfully executed on-chain, which may look like a double-spend.
+
+A replacing message is a message with a different CID, any of Gas values, and
+different signature, but with all other parameters matching (source/destination,
+nonce, params, etc.)
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ 10101,
+ true
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Receipt": {
+ "ExitCode": 0,
+ "Return": "Ynl0ZSBhcnJheQ==",
+ "GasUsed": 9
+ },
+ "ReturnDec": {},
+ "TipSet": [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ "Height": 10101
+}
+```
+
+### StateSectorExpiration
+StateSectorExpiration returns epoch at which given sector will expire
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ 9,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "OnTime": 10101,
+ "Early": 10101
+}
+```
+
+### StateSectorGetInfo
+StateSectorGetInfo returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found
+NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate
+expiration epoch
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ 9,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "SectorNumber": 9,
+ "SealProof": 8,
+ "SealedCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "DealIDs": null,
+ "Activation": 10101,
+ "Expiration": 10101,
+ "DealWeight": "0",
+ "VerifiedDealWeight": "0",
+ "InitialPledge": "0",
+ "ExpectedDayReward": "0",
+ "ExpectedStoragePledge": "0"
+}
+```
+
+### StateSectorPartition
+StateSectorPartition finds deadline/partition with the specified sector
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ 9,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Deadline": 42,
+ "Partition": 42
+}
+```
+
+### StateSectorPreCommitInfo
+StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ 9,
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "Info": {
+ "SealProof": 8,
+ "SectorNumber": 9,
+ "SealedCID": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "SealRandEpoch": 10101,
+ "DealIDs": null,
+ "Expiration": 10101,
+ "ReplaceCapacity": true,
+ "ReplaceSectorDeadline": 42,
+ "ReplaceSectorPartition": 42,
+ "ReplaceSectorNumber": 9
+ },
+ "PreCommitDeposit": "0",
+ "PreCommitEpoch": 10101,
+ "DealWeight": "0",
+ "VerifiedDealWeight": "0"
+}
+```
+
+### StateVMCirculatingSupplyInternal
+StateVMCirculatingSupplyInternal returns an approximation of the circulating supply of Filecoin at the given tipset.
+This is the value reported by the runtime interface to actors code.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response:
+```json
+{
+ "FilVested": "0",
+ "FilMined": "0",
+ "FilBurnt": "0",
+ "FilLocked": "0",
+ "FilCirculating": "0",
+ "FilReserveDisbursed": "0"
+}
+```
+
+### StateVerifiedClientStatus
+StateVerifiedClientStatus returns the data cap for the given address.
+Returns nil if there is no entry in the data cap table for the
+address.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### StateVerifiedRegistryRootKey
+StateVerifiedClientStatus returns the address of the Verified Registry's root key
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"f01234"`
+
+### StateVerifierStatus
+StateVerifierStatus returns the data cap for the given address.
+Returns nil if there is no entry in the data cap table for the
+address.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `"0"`
+
+### StateWaitMsg
+StateWaitMsg looks back up to limit epochs in the chain for a message.
+If not found, it blocks until the message arrives on chain, and gets to the
+indicated confidence depth.
+
+NOTE: If a replacing message is found on chain, this method will return
+a MsgLookup for the replacing message - the MsgLookup.Message will be a different
+CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the
+result of the execution of the replacing message.
+
+If the caller wants to ensure that exactly the requested message was executed,
+they must check that MsgLookup.Message is equal to the provided 'cid', or set the
+`allowReplaced` parameter to false. Without this check, and with `allowReplaced`
+set to true, both the requested and original message may appear as
+successfully executed on-chain, which may look like a double-spend.
+
+A replacing message is a message with a different CID, any of Gas values, and
+different signature, but with all other parameters matching (source/destination,
+nonce, params, etc.)
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ 42,
+ 10101,
+ true
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Receipt": {
+ "ExitCode": 0,
+ "Return": "Ynl0ZSBhcnJheQ==",
+ "GasUsed": 9
+ },
+ "ReturnDec": {},
+ "TipSet": [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ],
+ "Height": 10101
+}
+```
+
+## Sync
+The Sync method group contains methods for interacting with and
+observing the lotus sync service.
+
+
+### SyncCheckBad
+SyncCheckBad checks if a block was marked as bad, and if it was, returns
+the reason.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `"string value"`
+
+### SyncCheckpoint
+SyncCheckpoint marks a blocks as checkpointed, meaning that it won't ever fork away from it.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `{}`
+
+### SyncIncomingBlocks
+SyncIncomingBlocks returns a channel streaming incoming, potentially not
+yet synced block headers.
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "Miner": "f01234",
+ "Ticket": {
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "ElectionProof": {
+ "WinCount": 9,
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "BeaconEntries": null,
+ "WinPoStProof": null,
+ "Parents": null,
+ "ParentWeight": "0",
+ "Height": 10101,
+ "ParentStateRoot": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "ParentMessageReceipts": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Messages": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "BLSAggregate": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "Timestamp": 42,
+ "BlockSig": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "ForkSignaling": 42,
+ "ParentBaseFee": "0"
+}
+```
+
+### SyncMarkBad
+SyncMarkBad marks a blocks as bad, meaning that it won't ever by synced.
+Use with extreme caution.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `{}`
+
+### SyncState
+SyncState returns the current status of the lotus sync system.
+
+
+Perms: read
+
+Inputs: `null`
+
+Response:
+```json
+{
+ "ActiveSyncs": null,
+ "VMApplied": 42
+}
+```
+
+### SyncSubmitBlock
+SyncSubmitBlock can be used to submit a newly created block to the.
+network through this node
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ {
+ "Header": {
+ "Miner": "f01234",
+ "Ticket": {
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "ElectionProof": {
+ "WinCount": 9,
+ "VRFProof": "Ynl0ZSBhcnJheQ=="
+ },
+ "BeaconEntries": null,
+ "WinPoStProof": null,
+ "Parents": null,
+ "ParentWeight": "0",
+ "Height": 10101,
+ "ParentStateRoot": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "ParentMessageReceipts": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "Messages": {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ "BLSAggregate": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "Timestamp": 42,
+ "BlockSig": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "ForkSignaling": 42,
+ "ParentBaseFee": "0"
+ },
+ "BlsMessages": null,
+ "SecpkMessages": null
+ }
+]
+```
+
+Response: `{}`
+
+### SyncUnmarkAllBad
+SyncUnmarkAllBad purges bad block cache, making it possible to sync to chains previously marked as bad
+
+
+Perms: admin
+
+Inputs: `null`
+
+Response: `{}`
+
+### SyncUnmarkBad
+SyncUnmarkBad unmarks a blocks as bad, making it possible to be validated and synced again.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ }
+]
+```
+
+Response: `{}`
+
+### SyncValidateTipset
+SyncValidateTipset indicates whether the provided tipset is valid or not
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ [
+ {
+ "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
+ },
+ {
+ "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
+ }
+ ]
+]
+```
+
+Response: `true`
+
+## Wallet
+
+
+### WalletBalance
+WalletBalance returns the balance of the given address at the current head of the chain.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `"0"`
+
+### WalletDefaultAddress
+WalletDefaultAddress returns the address marked as default in the wallet.
+
+
+Perms: write
+
+Inputs: `null`
+
+Response: `"f01234"`
+
+### WalletDelete
+WalletDelete deletes an address from the wallet.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `{}`
+
+### WalletExport
+WalletExport returns the private key of an address in the wallet.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response:
+```json
+{
+ "Type": "bls",
+ "PrivateKey": "Ynl0ZSBhcnJheQ=="
+}
+```
+
+### WalletHas
+WalletHas indicates whether the given address is in the wallet.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `true`
+
+### WalletImport
+WalletImport receives a KeyInfo, which includes a private key, and imports it into the wallet.
+
+
+Perms: admin
+
+Inputs:
+```json
+[
+ {
+ "Type": "bls",
+ "PrivateKey": "Ynl0ZSBhcnJheQ=="
+ }
+]
+```
+
+Response: `"f01234"`
+
+### WalletList
+WalletList lists all the addresses in the wallet.
+
+
+Perms: write
+
+Inputs: `null`
+
+Response: `null`
+
+### WalletNew
+WalletNew creates a new address in the wallet with the given sigType.
+Available key types: bls, secp256k1, secp256k1-ledger
+Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ "bls"
+]
+```
+
+Response: `"f01234"`
+
+### WalletSetDefault
+WalletSetDefault marks the given address as as the default one.
+
+
+Perms: write
+
+Inputs:
+```json
+[
+ "f01234"
+]
+```
+
+Response: `{}`
+
+### WalletSign
+WalletSign signs the given bytes using the given address.
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ "Ynl0ZSBhcnJheQ=="
+]
+```
+
+Response:
+```json
+{
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+}
+```
+
+### WalletSignMessage
+WalletSignMessage signs the given message using the given address.
+
+
+Perms: sign
+
+Inputs:
+```json
+[
+ "f01234",
+ {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ }
+]
+```
+
+Response:
+```json
+{
+ "Message": {
+ "Version": 42,
+ "To": "f01234",
+ "From": "f01234",
+ "Nonce": 42,
+ "Value": "0",
+ "GasLimit": 9,
+ "GasFeeCap": "0",
+ "GasPremium": "0",
+ "Method": 1,
+ "Params": "Ynl0ZSBhcnJheQ==",
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+ },
+ "Signature": {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ },
+ "CID": {
+ "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
+ }
+}
+```
+
+### WalletValidateAddress
+WalletValidateAddress validates whether a given string can be decoded as a well-formed address
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "string value"
+]
+```
+
+Response: `"f01234"`
+
+### WalletVerify
+WalletVerify takes an address, a signature, and some bytes, and indicates whether the signature is valid.
+The address does not have to be in the wallet.
+
+
+Perms: read
+
+Inputs:
+```json
+[
+ "f01234",
+ "Ynl0ZSBhcnJheQ==",
+ {
+ "Type": 2,
+ "Data": "Ynl0ZSBhcnJheQ=="
+ }
+]
+```
+
+Response: `true`
+
diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md
index dfa9072c9..b4b245514 100644
--- a/documentation/en/cli-lotus-miner.md
+++ b/documentation/en/cli-lotus-miner.md
@@ -1533,9 +1533,9 @@ USAGE:
lotus-miner sectors batching command [command options] [arguments...]
COMMANDS:
- pending-commit list sectors waiting in commit batch queue
- pending-precommit list sectors waiting in precommit batch queue
- help, h Shows a list of commands or help for one command
+ commit list sectors waiting in commit batch queue
+ precommit list sectors waiting in precommit batch queue
+ help, h Shows a list of commands or help for one command
OPTIONS:
--help, -h show help (default: false)
@@ -1543,13 +1543,13 @@ OPTIONS:
```
-#### lotus-miner sectors batching pending-commit
+#### lotus-miner sectors batching commit
```
NAME:
- lotus-miner sectors batching pending-commit - list sectors waiting in commit batch queue
+ lotus-miner sectors batching commit - list sectors waiting in commit batch queue
USAGE:
- lotus-miner sectors batching pending-commit [command options] [arguments...]
+ lotus-miner sectors batching commit [command options] [arguments...]
OPTIONS:
--publish-now send a batch now (default: false)
@@ -1557,13 +1557,13 @@ OPTIONS:
```
-#### lotus-miner sectors batching pending-precommit
+#### lotus-miner sectors batching precommit
```
NAME:
- lotus-miner sectors batching pending-precommit - list sectors waiting in precommit batch queue
+ lotus-miner sectors batching precommit - list sectors waiting in precommit batch queue
USAGE:
- lotus-miner sectors batching pending-precommit [command options] [arguments...]
+ lotus-miner sectors batching precommit [command options] [arguments...]
OPTIONS:
--publish-now send a batch now (default: false)
diff --git a/documentation/en/cli-lotus-worker.md b/documentation/en/cli-lotus-worker.md
new file mode 100644
index 000000000..0b29da503
--- /dev/null
+++ b/documentation/en/cli-lotus-worker.md
@@ -0,0 +1,171 @@
+# lotus-worker
+```
+NAME:
+ lotus-worker - Remote miner worker
+
+USAGE:
+ lotus-worker [global options] command [command options] [arguments...]
+
+VERSION:
+ 1.11.0-dev
+
+COMMANDS:
+ run Start lotus worker
+ info Print worker info
+ storage manage sector storage
+ set Manage worker settings
+ wait-quiet Block until all running tasks exit
+ tasks Manage task processing
+ help, h Shows a list of commands or help for one command
+
+GLOBAL OPTIONS:
+ --worker-repo value, --workerrepo value Specify worker repo path. flag workerrepo and env WORKER_PATH are DEPRECATION, will REMOVE SOON (default: "~/.lotusworker") [$LOTUS_WORKER_PATH, $WORKER_PATH]
+ --miner-repo value, --storagerepo value Specify miner repo path. flag storagerepo and env LOTUS_STORAGE_PATH are DEPRECATION, will REMOVE SOON (default: "~/.lotusminer") [$LOTUS_MINER_PATH, $LOTUS_STORAGE_PATH]
+ --enable-gpu-proving enable use of GPU for mining operations (default: true)
+ --help, -h show help (default: false)
+ --version, -v print the version (default: false)
+```
+
+## lotus-worker run
+```
+NAME:
+ lotus-worker run - Start lotus worker
+
+USAGE:
+ lotus-worker run [command options] [arguments...]
+
+OPTIONS:
+ --listen value host address and port the worker api will listen on (default: "0.0.0.0:3456")
+ --no-local-storage don't use storageminer repo for sector storage (default: false)
+ --no-swap don't use swap (default: false)
+ --addpiece enable addpiece (default: true)
+ --precommit1 enable precommit1 (32G sectors: 1 core, 128GiB Memory) (default: true)
+ --unseal enable unsealing (32G sectors: 1 core, 128GiB Memory) (default: true)
+ --precommit2 enable precommit2 (32G sectors: all cores, 96GiB Memory) (default: true)
+ --commit enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap) (default: true)
+ --parallel-fetch-limit value maximum fetch operations to run in parallel (default: 5)
+ --timeout value used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function (default: "30m")
+ --help, -h show help (default: false)
+
+```
+
+## lotus-worker info
+```
+NAME:
+ lotus-worker info - Print worker info
+
+USAGE:
+ lotus-worker info [command options] [arguments...]
+
+OPTIONS:
+ --help, -h show help (default: false)
+
+```
+
+## lotus-worker storage
+```
+NAME:
+ lotus-worker storage - manage sector storage
+
+USAGE:
+ lotus-worker storage command [command options] [arguments...]
+
+COMMANDS:
+ attach attach local storage path
+ help, h Shows a list of commands or help for one command
+
+OPTIONS:
+ --help, -h show help (default: false)
+ --version, -v print the version (default: false)
+
+```
+
+### lotus-worker storage attach
+```
+NAME:
+ lotus-worker storage attach - attach local storage path
+
+USAGE:
+ lotus-worker storage attach [command options] [arguments...]
+
+OPTIONS:
+ --init initialize the path first (default: false)
+ --weight value (for init) path weight (default: 10)
+ --seal (for init) use path for sealing (default: false)
+ --store (for init) use path for long-term storage (default: false)
+ --max-storage value (for init) limit storage space for sectors (expensive for very large paths!)
+ --help, -h show help (default: false)
+
+```
+
+## lotus-worker set
+```
+NAME:
+ lotus-worker set - Manage worker settings
+
+USAGE:
+ lotus-worker set [command options] [arguments...]
+
+OPTIONS:
+ --enabled enable/disable new task processing (default: true)
+ --help, -h show help (default: false)
+
+```
+
+## lotus-worker wait-quiet
+```
+NAME:
+ lotus-worker wait-quiet - Block until all running tasks exit
+
+USAGE:
+ lotus-worker wait-quiet [command options] [arguments...]
+
+OPTIONS:
+ --help, -h show help (default: false)
+
+```
+
+## lotus-worker tasks
+```
+NAME:
+ lotus-worker tasks - Manage task processing
+
+USAGE:
+ lotus-worker tasks command [command options] [arguments...]
+
+COMMANDS:
+ enable Enable a task type
+ disable Disable a task type
+ help, h Shows a list of commands or help for one command
+
+OPTIONS:
+ --help, -h show help (default: false)
+ --version, -v print the version (default: false)
+
+```
+
+### lotus-worker tasks enable
+```
+NAME:
+ lotus-worker tasks enable - Enable a task type
+
+USAGE:
+ lotus-worker tasks enable [command options] [UNS|C2|PC2|PC1|AP]
+
+OPTIONS:
+ --help, -h show help (default: false)
+
+```
+
+### lotus-worker tasks disable
+```
+NAME:
+ lotus-worker tasks disable - Disable a task type
+
+USAGE:
+ lotus-worker tasks disable [command options] [UNS|C2|PC2|PC1|AP]
+
+OPTIONS:
+ --help, -h show help (default: false)
+
+```
diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md
index 82c8dfad3..8ffee3d1a 100644
--- a/documentation/en/cli-lotus.md
+++ b/documentation/en/cli-lotus.md
@@ -15,12 +15,12 @@ COMMANDS:
version Print version
help, h Shows a list of commands or help for one command
BASIC:
- send Send funds between accounts
- wallet Manage wallet
- client Make deals, store data, retrieve data
- msig Interact with a multisig wallet
- verifreg Interact with the verified registry actor
- paych Manage payment channels
+ send Send funds between accounts
+ wallet Manage wallet
+ client Make deals, store data, retrieve data
+ msig Interact with a multisig wallet
+ filplus Interact with the verified registry actor used by Filplus
+ paych Manage payment channels
DEVELOPER:
auth Manage RPC permissions
mpool Manage message pool
@@ -32,8 +32,12 @@ COMMANDS:
NETWORK:
net Manage P2P Network
sync Inspect or interact with the chain syncer
+ STATUS:
+ status Check node status
GLOBAL OPTIONS:
+ --interactive setting to false will disable interactive functionality of commands (default: false)
+ --force-send if true, will ignore pre-send checks (default: false)
--help, -h show help (default: false)
--version, -v print the version (default: false)
```
@@ -137,7 +141,7 @@ OPTIONS:
--method value specify method to invoke (default: 0)
--params-json value specify invocation parameters in json
--params-hex value specify invocation parameters in hex
- --force must be specified for the action to take effect if maybe SysErrInsufficientFunds etc (default: false)
+ --force Deprecated: use global 'force-send' (default: false)
--help, -h show help (default: false)
```
@@ -373,6 +377,7 @@ COMMANDS:
find Find data in the network
retrieve Retrieve data from network
cancel-retrieval Cancel a retrieval deal by deal ID; this also cancels the associated transfer
+ list-retrievals List retrieval market deals
STORAGE:
deal Initialize storage deal with a miner
query-ask Find a miners ask
@@ -517,6 +522,27 @@ OPTIONS:
```
+### lotus client list-retrievals
+```
+NAME:
+ lotus client list-retrievals - List retrieval market deals
+
+USAGE:
+ lotus client list-retrievals [command options] [arguments...]
+
+CATEGORY:
+ RETRIEVAL
+
+OPTIONS:
+ --verbose, -v print verbose deal details (default: false)
+ --color use color in display output (default: true)
+ --show-failed show failed/failing deals (default: true)
+ --completed show completed retrievals (default: false)
+ --watch watch deal updates in real-time, rather than a one time list (default: false)
+ --help, -h show help (default: false)
+
+```
+
### lotus client deal
```
NAME:
@@ -541,6 +567,7 @@ The minimum value is 518400 (6 months).
OPTIONS:
--manual-piece-cid value manually specify piece commitment for data (dataCid must be to a car file)
--manual-piece-size value if manually specifying piece cid, used to specify size (dataCid must be to a car file) (default: 0)
+ --manual-stateless-deal instructs the node to send an offline deal without registering it with the deallist/fsm (default: false)
--from value specify address to fund the deal with
--start-epoch value specify the epoch that the deal should start at (default: -1)
--fast-retrieval indicates that data should be available for fast retrieval (default: true)
@@ -1030,21 +1057,21 @@ OPTIONS:
```
-## lotus verifreg
+## lotus filplus
```
NAME:
- lotus verifreg - Interact with the verified registry actor
+ lotus filplus - Interact with the verified registry actor used by Filplus
USAGE:
- lotus verifreg command [command options] [arguments...]
+ lotus filplus command [command options] [arguments...]
COMMANDS:
- verify-client give allowance to the specified verified client address
- list-verifiers list all verifiers
- list-clients list all verified clients
- check-client check verified client remaining bytes
- check-verifier check verifiers remaining bytes
- help, h Shows a list of commands or help for one command
+ grant-datacap give allowance to the specified verified client address
+ list-notaries list all notaries
+ list-clients list all verified clients
+ check-client-datacap check verified client remaining bytes
+ check-notaries-datacap check notaries remaining bytes
+ help, h Shows a list of commands or help for one command
OPTIONS:
--help, -h show help (default: false)
@@ -1052,66 +1079,66 @@ OPTIONS:
```
-### lotus verifreg verify-client
+### lotus filplus grant-datacap
```
NAME:
- lotus verifreg verify-client - give allowance to the specified verified client address
+ lotus filplus grant-datacap - give allowance to the specified verified client address
USAGE:
- lotus verifreg verify-client [command options] [arguments...]
+ lotus filplus grant-datacap [command options] [arguments...]
OPTIONS:
- --from value specify your verifier address to send the message from
+ --from value specify your notary address to send the message from
--help, -h show help (default: false)
```
-### lotus verifreg list-verifiers
+### lotus filplus list-notaries
```
NAME:
- lotus verifreg list-verifiers - list all verifiers
+ lotus filplus list-notaries - list all notaries
USAGE:
- lotus verifreg list-verifiers [command options] [arguments...]
+ lotus filplus list-notaries [command options] [arguments...]
OPTIONS:
--help, -h show help (default: false)
```
-### lotus verifreg list-clients
+### lotus filplus list-clients
```
NAME:
- lotus verifreg list-clients - list all verified clients
+ lotus filplus list-clients - list all verified clients
USAGE:
- lotus verifreg list-clients [command options] [arguments...]
+ lotus filplus list-clients [command options] [arguments...]
OPTIONS:
--help, -h show help (default: false)
```
-### lotus verifreg check-client
+### lotus filplus check-client-datacap
```
NAME:
- lotus verifreg check-client - check verified client remaining bytes
+ lotus filplus check-client-datacap - check verified client remaining bytes
USAGE:
- lotus verifreg check-client [command options] [arguments...]
+ lotus filplus check-client-datacap [command options] [arguments...]
OPTIONS:
--help, -h show help (default: false)
```
-### lotus verifreg check-verifier
+### lotus filplus check-notaries-datacap
```
NAME:
- lotus verifreg check-verifier - check verifiers remaining bytes
+ lotus filplus check-notaries-datacap - check notaries remaining bytes
USAGE:
- lotus verifreg check-verifier [command options] [arguments...]
+ lotus filplus check-notaries-datacap [command options] [arguments...]
OPTIONS:
--help, -h show help (default: false)
@@ -1388,6 +1415,7 @@ COMMANDS:
find find a message in the mempool
config get or set current mpool configuration
gas-perf Check gas performance of messages in mempool
+ manage
help, h Shows a list of commands or help for one command
OPTIONS:
@@ -1501,6 +1529,9 @@ OPTIONS:
--help, -h show help (default: false)
```
+# nage
+```
+```
## lotus state
```
@@ -1747,13 +1778,14 @@ NAME:
lotus state call - Invoke a method on an actor locally
USAGE:
- lotus state call [command options] [toAddress methodId (optional)]
+ lotus state call [command options] [toAddress methodId params (optional)]
OPTIONS:
- --from value (default: "f00")
- --value value specify value field for invocation (default: "0")
- --ret value specify how to parse output (auto, raw, addr, big) (default: "auto")
- --help, -h show help (default: false)
+ --from value (default: "f00")
+ --value value specify value field for invocation (default: "0")
+ --ret value specify how to parse output (raw, decoded, base64, hex) (default: "decoded")
+ --encoding value specify params encoding to parse (base64, hex) (default: "base64")
+ --help, -h show help (default: false)
```
@@ -2760,3 +2792,20 @@ OPTIONS:
--help, -h show help (default: false)
```
+
+## lotus status
+```
+NAME:
+ lotus status - Check node status
+
+USAGE:
+ lotus status [command options] [arguments...]
+
+CATEGORY:
+ STATUS
+
+OPTIONS:
+ --chain include chain health status (default: false)
+ --help, -h show help (default: false)
+
+```
diff --git a/documentation/en/jaeger-tracing.md b/documentation/en/jaeger-tracing.md
index bbe4d3052..ec9351d53 100644
--- a/documentation/en/jaeger-tracing.md
+++ b/documentation/en/jaeger-tracing.md
@@ -12,7 +12,20 @@ Currently it is set up to use Jaeger, though other tracing backends should be fa
To easily run and view tracing locally, first, install jaeger. The easiest way to do this is to [download the binaries](https://www.jaegertracing.io/download/) and then run the `jaeger-all-in-one` binary. This will start up jaeger, listen for spans on `localhost:6831`, and expose a web UI for viewing traces on `http://localhost:16686/`.
-Now, to start sending traces from Lotus to Jaeger, set the environment variable `LOTUS_JAEGER` to `localhost:6831`, and start the `lotus daemon`.
+Now, to start sending traces from Lotus to Jaeger, set the environment variable and start the daemon.
+
+```bash
+export LOTUS_JAEGER_AGENT_ENDPOINT=127.0.0.1:6831
+lotus daemon
+```
+
+Alternatively, the agent endpoint can also be configured by a pair of environemnt variables to provide the host and port. The following snipit is functionally equivilent to the previous.
+
+```bash
+export LOTUS_JAEGER_AGENT_HOST=127.0.0.1
+export LOTUS_JAEGER_AGENT_PORT=6831
+lotus daemon
+```
Now, to view any generated traces, open up `http://localhost:16686/` in your browser.
diff --git a/documentation/misc/RELEASE_ISSUE_TEMPLATE.md b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md
new file mode 100644
index 000000000..0912a8681
--- /dev/null
+++ b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md
@@ -0,0 +1,120 @@
+> Release Issue Template
+
+# Lotus X.Y.Z Release
+
+We're happy to announce Lotus X.Y.Z...
+
+## đē Must-dos for the release
+
+## đ Nice-to-haves for the release
+
+
+
+## đĸ Estimated shipping date
+
+
+
+## đĻ Highlights
+
+< top highlights for this release notes >
+
+## â Release Checklist
+
+**Note for whomever is owning the release:** please capture notes as comments in this issue for anything you noticed that could be improved for future releases. There is a *Post Release* step below for incorporating changes back into the [RELEASE_ISSUE_TEMPLATE](https://github.com/filecoin-project/lotus/blob/master/documentation/misc/RELEASE_ISSUE_TEMPLATE.md), and this is easier done by collecting notes from along the way rather than just thinking about it at the end.
+
+First steps:
+
+ - [ ] Fork a new branch (`release/vX.Y.Z`) from `master` and make any further release related changes to this branch. If any "non-trivial" changes get added to the release, uncheck all the checkboxes and return to this stage.
+ - [ ] Bump the version in `version.go` in the `master` branch to `vX.(Y+1).0-dev`.
+
+Prepping an RC:
+
+- [ ] version string in `build/version.go` has been updated (in the `release/vX.Y.Z` branch).
+- [ ] tag commit with `vX.Y.Z-rcN`
+- [ ] cut a pre-release [here](https://github.com/filecoin-project/lotus/releases/new?prerelease=true)
+
+Testing an RC:
+
+- [ ] **Stage 0 - Automated Testing**
+ - Automated Testing
+ - [ ] CI: Ensure that all tests are passing.
+ - [ ] Testground tests
+
+- [ ] **Stage 1 - Internal Testing**
+ - Binaries
+ - [ ] Ensure the RC release has downloadable binaries
+ - [ ] Validate the binary is able to run on at least one platform
+ - Upgrade our testnet infra
+ - [ ] 1 bootstrap node
+ - [ ] 1 miner
+ - [ ] Scratch nodes
+ - [ ] Wait 24 hours, confirm nodes stay in sync
+ - [ ] Remaining testnet infra
+ - Upgrade our mainnet infra
+ - [ ] Subset of development full archival nodes
+ - [ ] Subset of bootstrappers (1 per region)
+ - [ ] Confirm nodes stay in sync
+ - Metrics report
+ - Block validation time
+ - Memory / CPU usage
+ - Number of goroutines
+ - IPLD block read latency
+ - Bandwidth usage
+ - [ ] If anything has worsened significantly, investigate + fix
+ - Confirm the following work (some combination of Testground / Calibnet / Mainnet / beta users)
+ - [ ] Seal a sector
+ - [ ] make a deal
+ - [ ] Submit a PoSt
+ - [ ] (optional) let a sector go faulty, and see it be recovered
+
+- [ ] **Stage 2 - Community Testing**
+ - [ ] Inform beta miners (@lotus-early-testers-miner in Filecoin Slack #fil-lotus)
+ - [ ] Ask close ecosystem partners to test their projects (@lotus-early-testers-eco-dev in Filecoin slack #fil-lotus)
+ - [ ] Powergate
+ - [ ] Glif
+ - [ ] Zondax
+ - [ ] Stats dashboard
+ - [ ] Community dashboards
+ - [ ] Infura
+ - [ ] Sentinel
+ - [ ] Protofire
+ - [ ] Fleek
+
+- [ ] **Stage 3 - Community Prod Testing**
+ - [ ] Documentation
+ - [ ] Ensure that [CHANGELOG.md](https://github.com/filecoin-project/lotus/blob/master/CHANGELOG.md) is up to date
+ - [ ] Check if any [config](https://docs.filecoin.io/get-started/lotus/configuration-and-advanced-usage/#configuration) updates are needed
+ - [ ] Invite the wider community through (link to the release issue):
+ - [ ] Check `Create a discussion for this release` when tagging for the major rcs(new features, hot-fixes) release
+ - [ ] Link the disucssion in #fil-lotus on Filecoin slack
+
+- [ ] **Stage 4 - Release**
+ - [ ] Final preparation
+ - [ ] Verify that version string in [`version.go`](https://github.com/ipfs/go-ipfs/tree/master/version.go) has been updated.
+ - [ ] Ensure that [CHANGELOG.md](https://github.com/filecoin-project/lotus/blob/master/CHANGELOG.md) is up to date
+ - [ ] Prep the changelog using `scripts/mkreleaselog`, and add it to `CHANGELOG.md`
+ - [ ] Merge `release-vX.Y.Z` into the `releases` branch.
+ - [ ] Tag this merge commit (on the `releases` branch) with `vX.Y.Z`
+ - [ ] Cut the release [here](https://github.com/filecoin-project/lotus/releases/new?prerelease=true&target=releases).
+ - [ ] Check `Create a discussion for this release` when tagging the release
+ - [ ] Final announcements
+ - [ ] Update network.filecoin.io for mainnet, calib and nerpa.
+ - [ ] repost in #fil-lotus in filecoin slack
+ - [ ] Inform node provides (Protofire, Digital Ocean..)
+
+- [ ] **Post-Release**
+ - [ ] Merge the `releases` branch back into `master`, ignoring the changes to `version.go` (keep the `-dev` version from master). Do NOT delete the `releases` branch when doing so!
+ - [ ] Update [RELEASE_ISSUE_TEMPLATE.md](https://github.com/filecoin-project/lotus/blob/master/documentation/misc/RELEASE_ISSUE_TEMPLATE.md) with any improvements determined from this latest release iteration.
+ - [ ] Create an issue using [RELEASE_ISSUE_TEMPLATE.md](https://github.com/filecoin-project/lotus/blob/master/documentation/misc/RELEASE_ISSUE_TEMPLATE.md) for the _next_ release.
+
+## â¤ī¸ Contributors
+
+< list generated by scripts/mkreleaselog >
+
+Would you like to contribute to Lotus and don't know how? Well, there are a few places you can get started:
+
+- TODO
+
+## âī¸ Do you have questions?
+
+Leave a comment [here]() if you have any questions.
diff --git a/documentation/misc/actors_version_checklist.md b/documentation/misc/actors_version_checklist.md
index 769e9da42..1fae4bd8a 100644
--- a/documentation/misc/actors_version_checklist.md
+++ b/documentation/misc/actors_version_checklist.md
@@ -4,6 +4,8 @@
- [ ] Define upgrade heights in `build/params_`
- [ ] Generate adapters
- [ ] Add the new version in `chain/actors/agen/main.go`
+ - [ ] Update adapter code in `chain/actors/builtin` if needed
+- [ ] Update `chain/actors/policy/policy.go`
- [ ] Update `chain/actors/version.go`
- [ ] Register in `chain/vm/invoker.go`
- [ ] Register in `chain/vm/mkactor.go`
diff --git a/documentation/misc/gas_balancing.md b/documentation/misc/gas_balancing.md
new file mode 100644
index 000000000..64d9fcf0e
--- /dev/null
+++ b/documentation/misc/gas_balancing.md
@@ -0,0 +1,54 @@
+## Gas Balancing
+
+The gas balancing process targets to set gas costs of syscalls to be in line with
+10 gas per nanosecond on reference hardware.
+The process can be either performed for all syscalls based on existing messages and chain or targeted
+at single syscall.
+
+#### Reference hardware
+
+The reference hardware is TR3970x with 128GB of RAM. This is what was available at the time and
+may be subject to change.
+
+### Complete gas balancing
+
+Complete gas balancing is performed using `lotus-bench` the process is based on importing a chain export
+and collecting gas traces which are later aggregated.
+
+Before building `lotus-bench` make sure `EnableGasTracing` in `chain/vm/runtime.go` is set to `true`.
+
+The process can be started using `./lotus-bench import` with `--car` flag set to the location of
+CAR chain export. `--start-epoch` and `--end-epoch` can be used to to limit the range of epochs to run
+the benchmark. Note that state tree of `start-epoch` needs to be in the CAR file or has to be previously computed
+to work.
+
+The output will be a `bench.json` file containing information about every syscall invoked
+and the time taken by these invocations. This file can grow to be quite big in size so make sure you have
+spare space.
+
+After the bench run is complete the `bench.json` file can be analyzed with `./lotus-bench import analyze bench.json`.
+
+It will compute means, standard deviations and co-variances (when applicable) of syscall runtimes.
+The output is in nanoseconds, so the gas values for syscalls should be 10x that. In cases where co-variance of
+execution time to some parameter is evaluated, the strength of the correlation should be taken into account.
+
+#### Special cases
+
+OnImplPut compute gas is based on the flush time to disk of objects created,
+during block execution (when gas traces are formed) objects are only written to memory. Use `vm/flush_copy_ms` and `vm/flush_copy_count` to estimate OnIpldPut compute cost.
+
+
+### Targeted gas balancing
+
+In some cases complete gas balancing is infeasible, either new syscall gets introduced or
+complete balancing is too time consuming.
+
+In these cases the recommended way to estimate gas for given syscall is to perform an `in-vivo` benchmark.
+In the past `in-vitro` as in standalone benchmarks were found to be highly inaccurate when compared to results
+of real execution.
+
+A in-vivo benchmark can be performed by running an example of such syscall during block execution.
+The best place to hook-in such benchmark is message execution loop in
+`chain/stmgr/stmgr.go` in `ApplyBlocks()`. Depending of time required to complete the syscall it might be
+advisable to run the execution only once every few messages.
+
diff --git a/extern/sector-storage/ffiwrapper/sealer_cgo.go b/extern/sector-storage/ffiwrapper/sealer_cgo.go
index dca8b44b5..10fcad6fd 100644
--- a/extern/sector-storage/ffiwrapper/sealer_cgo.go
+++ b/extern/sector-storage/ffiwrapper/sealer_cgo.go
@@ -11,6 +11,7 @@ import (
"os"
"runtime"
+ "github.com/filecoin-project/lotus/extern/sector-storage/partialfile"
"github.com/ipfs/go-cid"
"golang.org/x/xerrors"
@@ -66,7 +67,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
}
var done func()
- var stagedFile *partialFile
+ var stagedFile *partialfile.PartialFile
defer func() {
if done != nil {
@@ -87,7 +88,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
return abi.PieceInfo{}, xerrors.Errorf("acquire unsealed sector: %w", err)
}
- stagedFile, err = createPartialFile(maxPieceSize, stagedPath.Unsealed)
+ stagedFile, err = partialfile.CreatePartialFile(maxPieceSize, stagedPath.Unsealed)
if err != nil {
return abi.PieceInfo{}, xerrors.Errorf("creating unsealed sector file: %w", err)
}
@@ -97,7 +98,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
return abi.PieceInfo{}, xerrors.Errorf("acquire unsealed sector: %w", err)
}
- stagedFile, err = openPartialFile(maxPieceSize, stagedPath.Unsealed)
+ stagedFile, err = partialfile.OpenPartialFile(maxPieceSize, stagedPath.Unsealed)
if err != nil {
return abi.PieceInfo{}, xerrors.Errorf("opening unsealed sector file: %w", err)
}
@@ -195,12 +196,16 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
return piecePromises[0]()
}
+ var payloadRoundedBytes abi.PaddedPieceSize
pieceCids := make([]abi.PieceInfo, len(piecePromises))
for i, promise := range piecePromises {
- pieceCids[i], err = promise()
+ pinfo, err := promise()
if err != nil {
return abi.PieceInfo{}, err
}
+
+ pieceCids[i] = pinfo
+ payloadRoundedBytes += pinfo.Size
}
pieceCID, err := ffi.GenerateUnsealedCID(sector.ProofType, pieceCids)
@@ -213,6 +218,15 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
return abi.PieceInfo{}, err
}
+ if payloadRoundedBytes < pieceSize.Padded() {
+ paddedCid, err := commpffi.ZeroPadPieceCommitment(pieceCID, payloadRoundedBytes.Unpadded(), pieceSize)
+ if err != nil {
+ return abi.PieceInfo{}, xerrors.Errorf("failed to pad data: %w", err)
+ }
+
+ pieceCID = paddedCid
+ }
+
return abi.PieceInfo{
Size: pieceSize.Padded(),
PieceCID: pieceCID,
@@ -244,7 +258,7 @@ func (sb *Sealer) UnsealPiece(ctx context.Context, sector storage.SectorRef, off
// try finding existing
unsealedPath, done, err := sb.sectors.AcquireSector(ctx, sector, storiface.FTUnsealed, storiface.FTNone, storiface.PathStorage)
- var pf *partialFile
+ var pf *partialfile.PartialFile
switch {
case xerrors.Is(err, storiface.ErrSectorNotFound):
@@ -254,7 +268,7 @@ func (sb *Sealer) UnsealPiece(ctx context.Context, sector storage.SectorRef, off
}
defer done()
- pf, err = createPartialFile(maxPieceSize, unsealedPath.Unsealed)
+ pf, err = partialfile.CreatePartialFile(maxPieceSize, unsealedPath.Unsealed)
if err != nil {
return xerrors.Errorf("create unsealed file: %w", err)
}
@@ -262,7 +276,7 @@ func (sb *Sealer) UnsealPiece(ctx context.Context, sector storage.SectorRef, off
case err == nil:
defer done()
- pf, err = openPartialFile(maxPieceSize, unsealedPath.Unsealed)
+ pf, err = partialfile.OpenPartialFile(maxPieceSize, unsealedPath.Unsealed)
if err != nil {
return xerrors.Errorf("opening partial file: %w", err)
}
@@ -414,7 +428,7 @@ func (sb *Sealer) ReadPiece(ctx context.Context, writer io.Writer, sector storag
}
maxPieceSize := abi.PaddedPieceSize(ssize)
- pf, err := openPartialFile(maxPieceSize, path.Unsealed)
+ pf, err := partialfile.OpenPartialFile(maxPieceSize, path.Unsealed)
if err != nil {
if xerrors.Is(err, os.ErrNotExist) {
return false, nil
@@ -576,7 +590,7 @@ func (sb *Sealer) FinalizeSector(ctx context.Context, sector storage.SectorRef,
if len(keepUnsealed) > 0 {
- sr := pieceRun(0, maxPieceSize)
+ sr := partialfile.PieceRun(0, maxPieceSize)
for _, s := range keepUnsealed {
si := &rlepluslazy.RunSliceIterator{}
@@ -598,7 +612,7 @@ func (sb *Sealer) FinalizeSector(ctx context.Context, sector storage.SectorRef,
}
defer done()
- pf, err := openPartialFile(maxPieceSize, paths.Unsealed)
+ pf, err := partialfile.OpenPartialFile(maxPieceSize, paths.Unsealed)
if err == nil {
var at uint64
for sr.HasNext() {
diff --git a/extern/sector-storage/ffiwrapper/sealer_test.go b/extern/sector-storage/ffiwrapper/sealer_test.go
index df657f097..5d96f187f 100644
--- a/extern/sector-storage/ffiwrapper/sealer_test.go
+++ b/extern/sector-storage/ffiwrapper/sealer_test.go
@@ -252,7 +252,7 @@ func getGrothParamFileAndVerifyingKeys(s abi.SectorSize) {
// go test -run=^TestDownloadParams
//
func TestDownloadParams(t *testing.T) {
- defer requireFDsClosed(t, openFDs(t))
+ // defer requireFDsClosed(t, openFDs(t)) flaky likely cause of how go-embed works with param files
getGrothParamFileAndVerifyingKeys(sectorSize)
}
@@ -810,3 +810,46 @@ func BenchmarkAddPiece512M(b *testing.B) {
fmt.Println(c)
}
}
+
+func TestAddPiece512MPadded(t *testing.T) {
+ sz := abi.PaddedPieceSize(512 << 20).Unpadded()
+
+ cdir, err := ioutil.TempDir("", "sbtest-c-")
+ if err != nil {
+ t.Fatal(err)
+ }
+ miner := abi.ActorID(123)
+
+ sp := &basicfs.Provider{
+ Root: cdir,
+ }
+ sb, err := New(sp)
+ if err != nil {
+ t.Fatalf("%+v", err)
+ }
+ cleanup := func() {
+ if t.Failed() {
+ fmt.Printf("not removing %s\n", cdir)
+ return
+ }
+ if err := os.RemoveAll(cdir); err != nil {
+ t.Error(err)
+ }
+ }
+ t.Cleanup(cleanup)
+
+ r := rand.New(rand.NewSource(0x7e5))
+
+ c, err := sb.AddPiece(context.TODO(), storage.SectorRef{
+ ID: abi.SectorID{
+ Miner: miner,
+ Number: 0,
+ },
+ ProofType: abi.RegisteredSealProof_StackedDrg512MiBV1_1,
+ }, nil, sz, io.LimitReader(r, int64(sz/4)))
+ if err != nil {
+ t.Fatalf("add piece failed: %s", err)
+ }
+
+ require.Equal(t, "baga6ea4seaqonenxyku4o7hr5xkzbqsceipf6xgli3on54beqbk6k246sbooobq", c.PieceCID.String())
+}
diff --git a/extern/sector-storage/ffiwrapper/unseal_ranges.go b/extern/sector-storage/ffiwrapper/unseal_ranges.go
index 4519fc21e..bc39abde2 100644
--- a/extern/sector-storage/ffiwrapper/unseal_ranges.go
+++ b/extern/sector-storage/ffiwrapper/unseal_ranges.go
@@ -1,6 +1,7 @@
package ffiwrapper
import (
+ "github.com/filecoin-project/lotus/extern/sector-storage/partialfile"
"golang.org/x/xerrors"
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
@@ -17,7 +18,7 @@ const mergeGaps = 32 << 20
// TODO const expandRuns = 16 << 20 // unseal more than requested for future requests
func computeUnsealRanges(unsealed rlepluslazy.RunIterator, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (rlepluslazy.RunIterator, error) {
- todo := pieceRun(offset.Padded(), size.Padded())
+ todo := partialfile.PieceRun(offset.Padded(), size.Padded())
todo, err := rlepluslazy.Subtract(todo, unsealed)
if err != nil {
return nil, xerrors.Errorf("compute todo-unsealed: %w", err)
diff --git a/extern/sector-storage/fr32/readers.go b/extern/sector-storage/fr32/readers.go
index 20f3e9b31..f14d5bf1c 100644
--- a/extern/sector-storage/fr32/readers.go
+++ b/extern/sector-storage/fr32/readers.go
@@ -51,13 +51,12 @@ func (r *unpadReader) Read(out []byte) (int, error) {
r.left -= uint64(todo)
- n, err := r.src.Read(r.work[:todo])
+ n, err := io.ReadAtLeast(r.src, r.work[:todo], int(todo))
if err != nil && err != io.EOF {
return n, err
}
-
- if n != int(todo) {
- return 0, xerrors.Errorf("didn't read enough: %w", err)
+ if n < int(todo) {
+ return 0, xerrors.Errorf("didn't read enough: %d / %d, left %d, out %d", n, todo, r.left, len(out))
}
Unpad(r.work[:todo], out[:todo.Unpadded()])
diff --git a/extern/sector-storage/manager.go b/extern/sector-storage/manager.go
index 3db7ac9ec..51558aaad 100644
--- a/extern/sector-storage/manager.go
+++ b/extern/sector-storage/manager.go
@@ -47,8 +47,6 @@ type Worker interface {
}
type SectorManager interface {
- ReadPiece(context.Context, io.Writer, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) error
-
ffiwrapper.StorageSealer
storage.Prover
storiface.WorkerReturn
@@ -105,24 +103,18 @@ type StorageAuth http.Header
type WorkerStateStore *statestore.StateStore
type ManagerStateStore *statestore.StateStore
-func New(ctx context.Context, ls stores.LocalStorage, si stores.SectorIndex, sc SealerConfig, urls URLs, sa StorageAuth, wss WorkerStateStore, mss ManagerStateStore) (*Manager, error) {
- lstor, err := stores.NewLocal(ctx, ls, si, urls)
- if err != nil {
- return nil, err
- }
+func New(ctx context.Context, lstor *stores.Local, stor *stores.Remote, ls stores.LocalStorage, si stores.SectorIndex, sc SealerConfig, wss WorkerStateStore, mss ManagerStateStore) (*Manager, error) {
prover, err := ffiwrapper.New(&readonlyProvider{stor: lstor, index: si})
if err != nil {
return nil, xerrors.Errorf("creating prover instance: %w", err)
}
- stor := stores.NewRemote(lstor, si, http.Header(sa), sc.ParallelFetchLimit)
-
m := &Manager{
ls: ls,
storage: stor,
localStore: lstor,
- remoteHnd: &stores.FetchHandler{Local: lstor},
+ remoteHnd: &stores.FetchHandler{Local: lstor, PfHandler: &stores.DefaultPartialFileHandler{}},
index: si,
sched: newScheduler(),
@@ -141,7 +133,7 @@ func New(ctx context.Context, ls stores.LocalStorage, si stores.SectorIndex, sc
go m.sched.runSched()
localTasks := []sealtasks.TaskType{
- sealtasks.TTCommit1, sealtasks.TTFinalize, sealtasks.TTFetch, sealtasks.TTReadUnsealed,
+ sealtasks.TTCommit1, sealtasks.TTFinalize, sealtasks.TTFetch,
}
if sc.AllowAddPiece {
localTasks = append(localTasks, sealtasks.TTAddPiece)
@@ -206,83 +198,31 @@ func (m *Manager) schedFetch(sector storage.SectorRef, ft storiface.SectorFileTy
}
}
-func (m *Manager) readPiece(sink io.Writer, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, rok *bool) func(ctx context.Context, w Worker) error {
- return func(ctx context.Context, w Worker) error {
- r, err := m.waitSimpleCall(ctx)(w.ReadPiece(ctx, sink, sector, offset, size))
- if err != nil {
- return err
- }
- if r != nil {
- *rok = r.(bool)
- }
- return nil
- }
-}
-
-func (m *Manager) tryReadUnsealedPiece(ctx context.Context, sink io.Writer, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (foundUnsealed bool, readOk bool, selector WorkerSelector, returnErr error) {
-
- // acquire a lock purely for reading unsealed sectors
- ctx, cancel := context.WithCancel(ctx)
- defer cancel()
-
- if err := m.index.StorageLock(ctx, sector.ID, storiface.FTUnsealed, storiface.FTNone); err != nil {
- returnErr = xerrors.Errorf("acquiring read sector lock: %w", err)
- return
- }
-
- // passing 0 spt because we only need it when allowFetch is true
- best, err := m.index.StorageFindSector(ctx, sector.ID, storiface.FTUnsealed, 0, false)
- if err != nil {
- returnErr = xerrors.Errorf("read piece: checking for already existing unsealed sector: %w", err)
- return
- }
-
- foundUnsealed = len(best) > 0
- if foundUnsealed { // append to existing
- // There is unsealed sector, see if we can read from it
-
- selector = newExistingSelector(m.index, sector.ID, storiface.FTUnsealed, false)
-
- err = m.sched.Schedule(ctx, sector, sealtasks.TTReadUnsealed, selector, m.schedFetch(sector, storiface.FTUnsealed, storiface.PathSealing, storiface.AcquireMove),
- m.readPiece(sink, sector, offset, size, &readOk))
- if err != nil {
- returnErr = xerrors.Errorf("reading piece from sealed sector: %w", err)
- }
- } else {
- selector = newAllocSelector(m.index, storiface.FTUnsealed, storiface.PathSealing)
- }
- return
-}
-
-func (m *Manager) ReadPiece(ctx context.Context, sink io.Writer, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) error {
- foundUnsealed, readOk, selector, err := m.tryReadUnsealedPiece(ctx, sink, sector, offset, size)
- if err != nil {
- return err
- }
- if readOk {
- return nil
- }
+// SectorsUnsealPiece will Unseal the Sealed sector file for the given sector.
+// It will schedule the Unsealing task on a worker that either already has the sealed sector files or has space in
+// one of it's sealing scratch spaces to store them after fetching them from another worker.
+// If the chosen worker already has the Unsealed sector file, we will NOT Unseal the sealed sector file again.
+func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed *cid.Cid) error {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
+ log.Debugf("acquire unseal sector lock for sector %d", sector.ID)
if err := m.index.StorageLock(ctx, sector.ID, storiface.FTSealed|storiface.FTCache, storiface.FTUnsealed); err != nil {
return xerrors.Errorf("acquiring unseal sector lock: %w", err)
}
- unsealFetch := func(ctx context.Context, worker Worker) error {
+ // if the selected worker does NOT have the sealed files for the sector, instruct it to fetch it from a worker that has them and
+ // put it in the sealing scratch space.
+ sealFetch := func(ctx context.Context, worker Worker) error {
+ log.Debugf("copy sealed/cache sector data for sector %d", sector.ID)
if _, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy)); err != nil {
return xerrors.Errorf("copy sealed/cache sector data: %w", err)
}
- if foundUnsealed {
- if _, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTUnsealed, storiface.PathSealing, storiface.AcquireMove)); err != nil {
- return xerrors.Errorf("copy unsealed sector data: %w", err)
- }
- }
return nil
}
- if unsealed == cid.Undef {
+ if unsealed == nil {
return xerrors.Errorf("cannot unseal piece (sector: %d, offset: %d size: %d) - unsealed cid is undefined", sector, offset, size)
}
@@ -291,29 +231,26 @@ func (m *Manager) ReadPiece(ctx context.Context, sink io.Writer, sector storage.
return xerrors.Errorf("getting sector size: %w", err)
}
- err = m.sched.Schedule(ctx, sector, sealtasks.TTUnseal, selector, unsealFetch, func(ctx context.Context, w Worker) error {
+ // selector will schedule the Unseal task on a worker that either already has the sealed sector files or has space in
+ // one of it's sealing scratch spaces to store them after fetching them from another worker.
+ selector := newExistingSelector(m.index, sector.ID, storiface.FTSealed|storiface.FTCache, true)
+
+ log.Debugf("will schedule unseal for sector %d", sector.ID)
+ err = m.sched.Schedule(ctx, sector, sealtasks.TTUnseal, selector, sealFetch, func(ctx context.Context, w Worker) error {
// TODO: make restartable
// NOTE: we're unsealing the whole sector here as with SDR we can't really
// unseal the sector partially. Requesting the whole sector here can
// save us some work in case another piece is requested from here
- _, err := m.waitSimpleCall(ctx)(w.UnsealPiece(ctx, sector, 0, abi.PaddedPieceSize(ssize).Unpadded(), ticket, unsealed))
+ log.Debugf("calling unseal sector on worker, sectoID=%d", sector.ID)
+
+ // Note: This unseal piece call will essentially become a no-op if the worker already has an Unsealed sector file for the given sector.
+ _, err := m.waitSimpleCall(ctx)(w.UnsealPiece(ctx, sector, 0, abi.PaddedPieceSize(ssize).Unpadded(), ticket, *unsealed))
+ log.Debugf("completed unseal sector %d", sector.ID)
return err
})
if err != nil {
- return err
- }
-
- selector = newExistingSelector(m.index, sector.ID, storiface.FTUnsealed, false)
-
- err = m.sched.Schedule(ctx, sector, sealtasks.TTReadUnsealed, selector, m.schedFetch(sector, storiface.FTUnsealed, storiface.PathSealing, storiface.AcquireMove),
- m.readPiece(sink, sector, offset, size, &readOk))
- if err != nil {
- return xerrors.Errorf("reading piece from sealed sector: %w", err)
- }
-
- if !readOk {
- return xerrors.Errorf("failed to read unsealed piece")
+ return xerrors.Errorf("worker UnsealPiece call: %s", err)
}
return nil
@@ -750,4 +687,5 @@ func (m *Manager) Close(ctx context.Context) error {
return m.sched.Close(ctx)
}
+var _ Unsealer = &Manager{}
var _ SectorManager = &Manager{}
diff --git a/extern/sector-storage/manager_test.go b/extern/sector-storage/manager_test.go
index 1cf9d0aad..d4044bbae 100644
--- a/extern/sector-storage/manager_test.go
+++ b/extern/sector-storage/manager_test.go
@@ -98,7 +98,7 @@ func newTestMgr(ctx context.Context, t *testing.T, ds datastore.Datastore) (*Man
prover, err := ffiwrapper.New(&readonlyProvider{stor: lstor, index: si})
require.NoError(t, err)
- stor := stores.NewRemote(lstor, si, nil, 6000)
+ stor := stores.NewRemote(lstor, si, nil, 6000, &stores.DefaultPartialFileHandler{})
m := &Manager{
ls: st,
diff --git a/extern/sector-storage/mock/mock.go b/extern/sector-storage/mock/mock.go
index 52496f836..1d8a317f1 100644
--- a/extern/sector-storage/mock/mock.go
+++ b/extern/sector-storage/mock/mock.go
@@ -6,6 +6,7 @@ import (
"crypto/sha256"
"fmt"
"io"
+ "io/ioutil"
"math/rand"
"sync"
@@ -34,7 +35,9 @@ type SectorMgr struct {
lk sync.Mutex
}
-type mockVerifProver struct{}
+type mockVerifProver struct {
+ aggregates map[string]proof5.AggregateSealVerifyProofAndInfos // used for logging bad verifies
+}
func NewMockSectorMgr(genesisSectors []abi.SectorID) *SectorMgr {
sectors := make(map[abi.SectorID]*sectorState)
@@ -373,13 +376,12 @@ func generateFakePoSt(sectorInfo []proof5.SectorInfo, rpt func(abi.RegisteredSea
}
}
-func (mgr *SectorMgr) ReadPiece(ctx context.Context, w io.Writer, sectorID storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, c cid.Cid) error {
+func (mgr *SectorMgr) ReadPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (io.ReadCloser, bool, error) {
if offset != 0 {
panic("implme")
}
- _, err := io.CopyN(w, bytes.NewReader(mgr.pieces[mgr.sectors[sectorID.ID].pieces[0]]), int64(size))
- return err
+ return ioutil.NopCloser(bytes.NewReader(mgr.pieces[mgr.sectors[sector.ID].pieces[0]][:size])), false, nil
}
func (mgr *SectorMgr) StageFakeData(mid abi.ActorID, spt abi.RegisteredSealProof) (storage.SectorRef, []abi.PieceInfo, error) {
@@ -490,6 +492,10 @@ func (mgr *SectorMgr) ReturnFetch(ctx context.Context, callID storiface.CallID,
panic("not supported")
}
+func (mgr *SectorMgr) SectorsUnsealPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd *cid.Cid) error {
+ return nil
+}
+
func (m mockVerifProver) VerifySeal(svi proof5.SealVerifyInfo) (bool, error) {
plen, err := svi.SealProof.ProofSize()
if err != nil {
@@ -522,7 +528,19 @@ func (m mockVerifProver) VerifyAggregateSeals(aggregate proof5.AggregateSealVeri
}
}
- return bytes.Equal(aggregate.Proof, out), nil
+ ok := bytes.Equal(aggregate.Proof, out)
+ if !ok {
+ genInfo, found := m.aggregates[string(aggregate.Proof)]
+ if !found {
+ log.Errorf("BAD AGGREGATE: saved generate inputs not found; agg.Proof: %x; expected: %x", aggregate.Proof, out)
+ } else {
+ log.Errorf("BAD AGGREGATE (1): agg.Proof: %x; expected: %x", aggregate.Proof, out)
+ log.Errorf("BAD AGGREGATE (2): Verify Infos: %+v", aggregate.Infos)
+ log.Errorf("BAD AGGREGATE (3): Generate Infos: %+v", genInfo.Infos)
+ }
+ }
+
+ return ok, nil
}
func (m mockVerifProver) AggregateSealProofs(aggregateInfo proof5.AggregateSealVerifyProofAndInfos, proofs [][]byte) ([]byte, error) {
@@ -533,6 +551,8 @@ func (m mockVerifProver) AggregateSealProofs(aggregateInfo proof5.AggregateSealV
}
}
+ m.aggregates[string(out)] = aggregateInfo
+
return out, nil
}
@@ -592,8 +612,11 @@ func (m mockVerifProver) GenerateWinningPoStSectorChallenge(ctx context.Context,
return []uint64{0}, nil
}
-var MockVerifier = mockVerifProver{}
-var MockProver = mockVerifProver{}
+var MockVerifier = mockVerifProver{
+ aggregates: map[string]proof5.AggregateSealVerifyProofAndInfos{},
+}
+
+var MockProver = MockVerifier
var _ storage.Sealer = &SectorMgr{}
var _ ffiwrapper.Verifier = MockVerifier
diff --git a/extern/sector-storage/ffiwrapper/partialfile.go b/extern/sector-storage/partialfile/partialfile.go
similarity index 85%
rename from extern/sector-storage/ffiwrapper/partialfile.go
rename to extern/sector-storage/partialfile/partialfile.go
index e19930ac1..2ef68de73 100644
--- a/extern/sector-storage/ffiwrapper/partialfile.go
+++ b/extern/sector-storage/partialfile/partialfile.go
@@ -1,4 +1,4 @@
-package ffiwrapper
+package partialfile
import (
"encoding/binary"
@@ -7,6 +7,7 @@ import (
"syscall"
"github.com/detailyang/go-fallocate"
+ logging "github.com/ipfs/go-log/v2"
"golang.org/x/xerrors"
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
@@ -16,6 +17,8 @@ import (
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
+var log = logging.Logger("partialfile")
+
const veryLargeRle = 1 << 20
// Sectors can be partially unsealed. We support this by appending a small
@@ -25,7 +28,7 @@ const veryLargeRle = 1 << 20
// unsealed sector files internally have this structure
// [unpadded (raw) data][rle+][4B LE length fo the rle+ field]
-type partialFile struct {
+type PartialFile struct {
maxPiece abi.PaddedPieceSize
path string
@@ -57,7 +60,7 @@ func writeTrailer(maxPieceSize int64, w *os.File, r rlepluslazy.RunIterator) err
return w.Truncate(maxPieceSize + int64(rb) + 4)
}
-func createPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*partialFile, error) {
+func CreatePartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*PartialFile, error) {
f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0644) // nolint
if err != nil {
return nil, xerrors.Errorf("openning partial file '%s': %w", path, err)
@@ -89,10 +92,10 @@ func createPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*partialF
return nil, xerrors.Errorf("close empty partial file: %w", err)
}
- return openPartialFile(maxPieceSize, path)
+ return OpenPartialFile(maxPieceSize, path)
}
-func openPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*partialFile, error) {
+func OpenPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*PartialFile, error) {
f, err := os.OpenFile(path, os.O_RDWR, 0644) // nolint
if err != nil {
return nil, xerrors.Errorf("openning partial file '%s': %w", path, err)
@@ -165,7 +168,7 @@ func openPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*partialFil
return nil, err
}
- return &partialFile{
+ return &PartialFile{
maxPiece: maxPieceSize,
path: path,
allocated: rle,
@@ -173,11 +176,11 @@ func openPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*partialFil
}, nil
}
-func (pf *partialFile) Close() error {
+func (pf *PartialFile) Close() error {
return pf.file.Close()
}
-func (pf *partialFile) Writer(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) (io.Writer, error) {
+func (pf *PartialFile) Writer(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) (io.Writer, error) {
if _, err := pf.file.Seek(int64(offset), io.SeekStart); err != nil {
return nil, xerrors.Errorf("seek piece start: %w", err)
}
@@ -188,7 +191,7 @@ func (pf *partialFile) Writer(offset storiface.PaddedByteIndex, size abi.PaddedP
return nil, err
}
- and, err := rlepluslazy.And(have, pieceRun(offset, size))
+ and, err := rlepluslazy.And(have, PieceRun(offset, size))
if err != nil {
return nil, err
}
@@ -206,13 +209,13 @@ func (pf *partialFile) Writer(offset storiface.PaddedByteIndex, size abi.PaddedP
return pf.file, nil
}
-func (pf *partialFile) MarkAllocated(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) error {
+func (pf *PartialFile) MarkAllocated(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) error {
have, err := pf.allocated.RunIterator()
if err != nil {
return err
}
- ored, err := rlepluslazy.Or(have, pieceRun(offset, size))
+ ored, err := rlepluslazy.Or(have, PieceRun(offset, size))
if err != nil {
return err
}
@@ -224,7 +227,7 @@ func (pf *partialFile) MarkAllocated(offset storiface.PaddedByteIndex, size abi.
return nil
}
-func (pf *partialFile) Free(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) error {
+func (pf *PartialFile) Free(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) error {
have, err := pf.allocated.RunIterator()
if err != nil {
return err
@@ -234,7 +237,7 @@ func (pf *partialFile) Free(offset storiface.PaddedByteIndex, size abi.PaddedPie
return xerrors.Errorf("deallocating: %w", err)
}
- s, err := rlepluslazy.Subtract(have, pieceRun(offset, size))
+ s, err := rlepluslazy.Subtract(have, PieceRun(offset, size))
if err != nil {
return err
}
@@ -246,7 +249,7 @@ func (pf *partialFile) Free(offset storiface.PaddedByteIndex, size abi.PaddedPie
return nil
}
-func (pf *partialFile) Reader(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) (*os.File, error) {
+func (pf *PartialFile) Reader(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) (*os.File, error) {
if _, err := pf.file.Seek(int64(offset), io.SeekStart); err != nil {
return nil, xerrors.Errorf("seek piece start: %w", err)
}
@@ -257,7 +260,7 @@ func (pf *partialFile) Reader(offset storiface.PaddedByteIndex, size abi.PaddedP
return nil, err
}
- and, err := rlepluslazy.And(have, pieceRun(offset, size))
+ and, err := rlepluslazy.And(have, PieceRun(offset, size))
if err != nil {
return nil, err
}
@@ -275,17 +278,17 @@ func (pf *partialFile) Reader(offset storiface.PaddedByteIndex, size abi.PaddedP
return pf.file, nil
}
-func (pf *partialFile) Allocated() (rlepluslazy.RunIterator, error) {
+func (pf *PartialFile) Allocated() (rlepluslazy.RunIterator, error) {
return pf.allocated.RunIterator()
}
-func (pf *partialFile) HasAllocated(offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error) {
+func (pf *PartialFile) HasAllocated(offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error) {
have, err := pf.Allocated()
if err != nil {
return false, err
}
- u, err := rlepluslazy.And(have, pieceRun(offset.Padded(), size.Padded()))
+ u, err := rlepluslazy.And(have, PieceRun(offset.Padded(), size.Padded()))
if err != nil {
return false, err
}
@@ -298,7 +301,7 @@ func (pf *partialFile) HasAllocated(offset storiface.UnpaddedByteIndex, size abi
return abi.PaddedPieceSize(uc) == size.Padded(), nil
}
-func pieceRun(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) rlepluslazy.RunIterator {
+func PieceRun(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) rlepluslazy.RunIterator {
var runs []rlepluslazy.Run
if offset > 0 {
runs = append(runs, rlepluslazy.Run{
diff --git a/extern/sector-storage/piece_provider.go b/extern/sector-storage/piece_provider.go
new file mode 100644
index 000000000..553dcb952
--- /dev/null
+++ b/extern/sector-storage/piece_provider.go
@@ -0,0 +1,153 @@
+package sectorstorage
+
+import (
+ "bufio"
+ "context"
+ "io"
+
+ "github.com/ipfs/go-cid"
+ "golang.org/x/xerrors"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/specs-storage/storage"
+
+ "github.com/filecoin-project/lotus/extern/sector-storage/fr32"
+ "github.com/filecoin-project/lotus/extern/sector-storage/stores"
+ "github.com/filecoin-project/lotus/extern/sector-storage/storiface"
+)
+
+type Unsealer interface {
+ // SectorsUnsealPiece will Unseal a Sealed sector file for the given sector.
+ SectorsUnsealPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd *cid.Cid) error
+}
+
+type PieceProvider interface {
+ // ReadPiece is used to read an Unsealed piece at the given offset and of the given size from a Sector
+ ReadPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (io.ReadCloser, bool, error)
+}
+
+type pieceProvider struct {
+ storage *stores.Remote
+ index stores.SectorIndex
+ uns Unsealer
+}
+
+func NewPieceProvider(storage *stores.Remote, index stores.SectorIndex, uns Unsealer) PieceProvider {
+ return &pieceProvider{
+ storage: storage,
+ index: index,
+ uns: uns,
+ }
+}
+
+// tryReadUnsealedPiece will try to read the unsealed piece from an existing unsealed sector file for the given sector from any worker that has it.
+// It will NOT try to schedule an Unseal of a sealed sector file for the read.
+//
+// Returns a nil reader if the piece does NOT exist in any unsealed file or there is no unsealed file for the given sector on any of the workers.
+func (p *pieceProvider) tryReadUnsealedPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (io.ReadCloser, context.CancelFunc, error) {
+ // acquire a lock purely for reading unsealed sectors
+ ctx, cancel := context.WithCancel(ctx)
+ if err := p.index.StorageLock(ctx, sector.ID, storiface.FTUnsealed, storiface.FTNone); err != nil {
+ cancel()
+ return nil, nil, xerrors.Errorf("acquiring read sector lock: %w", err)
+ }
+
+ // Reader returns a reader for an unsealed piece at the given offset in the given sector.
+ // The returned reader will be nil if none of the workers has an unsealed sector file containing
+ // the unsealed piece.
+ r, err := p.storage.Reader(ctx, sector, abi.PaddedPieceSize(offset.Padded()), size.Padded())
+ if err != nil {
+ log.Debugf("did not get storage reader;sector=%+v, err:%s", sector.ID, err)
+ cancel()
+ return nil, nil, err
+ }
+ if r == nil {
+ cancel()
+ }
+
+ return r, cancel, nil
+}
+
+// ReadPiece is used to read an Unsealed piece at the given offset and of the given size from a Sector
+// If an Unsealed sector file exists with the Piece Unsealed in it, we'll use that for the read.
+// Otherwise, we will Unseal a Sealed sector file for the given sector and read the Unsealed piece from it.
+// If we do NOT have an existing unsealed file containing the given piece thus causing us to schedule an Unseal,
+// the returned boolean parameter will be set to true.
+// If we have an existing unsealed file containing the given piece, the returned boolean will be set to false.
+func (p *pieceProvider) ReadPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (io.ReadCloser, bool, error) {
+ if err := offset.Valid(); err != nil {
+ return nil, false, xerrors.Errorf("offset is not valid: %w", err)
+ }
+ if err := size.Validate(); err != nil {
+ return nil, false, xerrors.Errorf("size is not a valid piece size: %w", err)
+ }
+
+ r, unlock, err := p.tryReadUnsealedPiece(ctx, sector, offset, size)
+
+ log.Debugf("result of first tryReadUnsealedPiece: r=%+v, err=%s", r, err)
+
+ if xerrors.Is(err, storiface.ErrSectorNotFound) {
+ log.Debugf("no unsealed sector file with unsealed piece, sector=%+v, offset=%d, size=%d", sector, offset, size)
+ err = nil
+ }
+ if err != nil {
+ log.Errorf("returning error from ReadPiece:%s", err)
+ return nil, false, err
+ }
+
+ var uns bool
+
+ if r == nil {
+ // a nil reader means that none of the workers has an unsealed sector file
+ // containing the unsealed piece.
+ // we now need to unseal a sealed sector file for the given sector to read the unsealed piece from it.
+ uns = true
+ commd := &unsealed
+ if unsealed == cid.Undef {
+ commd = nil
+ }
+ if err := p.uns.SectorsUnsealPiece(ctx, sector, offset, size, ticket, commd); err != nil {
+ log.Errorf("failed to SectorsUnsealPiece: %s", err)
+ return nil, false, xerrors.Errorf("unsealing piece: %w", err)
+ }
+
+ log.Debugf("unsealed a sector file to read the piece, sector=%+v, offset=%d, size=%d", sector, offset, size)
+
+ r, unlock, err = p.tryReadUnsealedPiece(ctx, sector, offset, size)
+ if err != nil {
+ log.Errorf("failed to tryReadUnsealedPiece after SectorsUnsealPiece: %s", err)
+ return nil, true, xerrors.Errorf("read after unsealing: %w", err)
+ }
+ if r == nil {
+ log.Errorf("got no reader after unsealing piece")
+ return nil, true, xerrors.Errorf("got no reader after unsealing piece")
+ }
+ log.Debugf("got a reader to read unsealed piece, sector=%+v, offset=%d, size=%d", sector, offset, size)
+ } else {
+ log.Debugf("unsealed piece already exists, no need to unseal, sector=%+v, offset=%d, size=%d", sector, offset, size)
+ }
+
+ upr, err := fr32.NewUnpadReader(r, size.Padded())
+ if err != nil {
+ unlock()
+ return nil, uns, xerrors.Errorf("creating unpadded reader: %w", err)
+ }
+
+ log.Debugf("returning reader to read unsealed piece, sector=%+v, offset=%d, size=%d", sector, offset, size)
+
+ return &funcCloser{
+ Reader: bufio.NewReaderSize(upr, 127),
+ close: func() error {
+ err = r.Close()
+ unlock()
+ return err
+ },
+ }, uns, nil
+}
+
+type funcCloser struct {
+ io.Reader
+ close func() error
+}
+
+func (fc *funcCloser) Close() error { return fc.close() }
diff --git a/extern/sector-storage/piece_provider_test.go b/extern/sector-storage/piece_provider_test.go
new file mode 100644
index 000000000..6a58ad945
--- /dev/null
+++ b/extern/sector-storage/piece_provider_test.go
@@ -0,0 +1,332 @@
+package sectorstorage
+
+import (
+ "bytes"
+ "context"
+ "io/ioutil"
+ "math/rand"
+ "net"
+ "net/http"
+ "testing"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-statestore"
+ "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
+ specstorage "github.com/filecoin-project/specs-storage/storage"
+ "github.com/gorilla/mux"
+ "github.com/ipfs/go-cid"
+ "github.com/ipfs/go-datastore"
+ "github.com/ipfs/go-datastore/namespace"
+ ds_sync "github.com/ipfs/go-datastore/sync"
+ logging "github.com/ipfs/go-log/v2"
+ "github.com/stretchr/testify/require"
+
+ "github.com/filecoin-project/lotus/extern/sector-storage/stores"
+ "github.com/filecoin-project/lotus/extern/sector-storage/storiface"
+)
+
+// TestPieceProviderReadPiece verifies that the ReadPiece method works correctly
+// only uses miner and does NOT use any remote worker.
+func TestPieceProviderSimpleNoRemoteWorker(t *testing.T) {
+ // Set up sector storage manager
+ sealerCfg := SealerConfig{
+ ParallelFetchLimit: 10,
+ AllowAddPiece: true,
+ AllowPreCommit1: true,
+ AllowPreCommit2: true,
+ AllowCommit: true,
+ AllowUnseal: true,
+ }
+
+ ppt := newPieceProviderTestHarness(t, sealerCfg, abi.RegisteredSealProof_StackedDrg8MiBV1)
+ defer ppt.shutdown(t)
+
+ // Create some padded data that aligns with the piece boundaries.
+ pieceData := generatePieceData(8 * 127 * 1024 * 8)
+ size := abi.UnpaddedPieceSize(len(pieceData))
+ ppt.addPiece(t, pieceData)
+
+ // read piece
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
+ false, pieceData)
+
+ // pre-commit 1
+ preCommit1 := ppt.preCommit1(t)
+
+ // read piece
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
+ false, pieceData)
+
+ // pre-commit 2
+ ppt.preCommit2(t, preCommit1)
+
+ // read piece
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
+ false, pieceData)
+
+ // finalize -> nil here will remove unsealed file
+ ppt.finalizeSector(t, nil)
+
+ // Read the piece -> will have to unseal
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
+ true, pieceData)
+
+ // read the piece -> will not have to unseal
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
+ false, pieceData)
+
+}
+func TestReadPieceRemoteWorkers(t *testing.T) {
+ logging.SetAllLoggers(logging.LevelDebug)
+
+ // miner's worker can only add pieces to an unsealed sector.
+ sealerCfg := SealerConfig{
+ ParallelFetchLimit: 10,
+ AllowAddPiece: true,
+ AllowPreCommit1: false,
+ AllowPreCommit2: false,
+ AllowCommit: false,
+ AllowUnseal: false,
+ }
+
+ // test harness for an 8M sector.
+ ppt := newPieceProviderTestHarness(t, sealerCfg, abi.RegisteredSealProof_StackedDrg8MiBV1)
+ defer ppt.shutdown(t)
+
+ // worker 2 will ONLY help with the sealing by first fetching
+ // the unsealed file from the miner.
+ ppt.addRemoteWorker(t, []sealtasks.TaskType{
+ sealtasks.TTPreCommit1, sealtasks.TTPreCommit2, sealtasks.TTCommit1,
+ sealtasks.TTFetch, sealtasks.TTFinalize,
+ })
+
+ // create a worker that can ONLY unseal and fetch
+ ppt.addRemoteWorker(t, []sealtasks.TaskType{
+ sealtasks.TTUnseal, sealtasks.TTFetch,
+ })
+
+ // run the test
+
+ // add one piece that aligns with the padding/piece boundaries.
+ pd1 := generatePieceData(8 * 127 * 4 * 1024)
+ pi1 := ppt.addPiece(t, pd1)
+ pd1size := pi1.Size.Unpadded()
+
+ pd2 := generatePieceData(8 * 127 * 4 * 1024)
+ pi2 := ppt.addPiece(t, pd2)
+ pd2size := pi2.Size.Unpadded()
+
+ // pre-commit 1
+ pC1 := ppt.preCommit1(t)
+ // Read the piece -> no need to unseal
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
+ false, pd1)
+
+ // pre-commit 2
+ ppt.preCommit2(t, pC1)
+ // Read the piece -> no need to unseal
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
+ false, pd1)
+
+ // finalize the sector so we declare to the index we have the sealed file
+ // so the unsealing worker can later look it up and fetch it if needed
+ // sending nil here will remove all unsealed files after sector is finalized.
+ ppt.finalizeSector(t, nil)
+
+ // Read the piece -> have to unseal since we removed the file.
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
+ true, pd1)
+
+ // Read the same piece again -> will NOT have to unseal.
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size, false, pd1)
+
+ // remove the unsealed file and read again -> will have to unseal.
+ ppt.removeAllUnsealedSectorFiles(t)
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
+ true, pd1)
+
+ // Read Piece 2 -> no unsealing as it got unsealed above.
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(pd1size), pd2size, false, pd2)
+
+ // remove all unseal files -> Read Piece 2 -> will have to Unseal.
+ ppt.removeAllUnsealedSectorFiles(t)
+ ppt.readPiece(t, storiface.UnpaddedByteIndex(pd1size), pd2size, true, pd2)
+}
+
+type pieceProviderTestHarness struct {
+ ctx context.Context
+ index *stores.Index
+ pp PieceProvider
+ sector specstorage.SectorRef
+ mgr *Manager
+ ticket abi.SealRandomness
+ commD cid.Cid
+ localStores []*stores.Local
+
+ servers []*http.Server
+
+ addedPieces []abi.PieceInfo
+}
+
+func generatePieceData(size uint64) []byte {
+ bz := make([]byte, size)
+ rand.Read(bz)
+ return bz
+}
+
+func newPieceProviderTestHarness(t *testing.T, mgrConfig SealerConfig, sectorProofType abi.RegisteredSealProof) *pieceProviderTestHarness {
+ ctx := context.Background()
+ // listen on tcp socket to create an http server later
+ address := "0.0.0.0:0"
+ nl, err := net.Listen("tcp", address)
+ require.NoError(t, err)
+
+ // create index, storage, local store & remote store.
+ index := stores.NewIndex()
+ storage := newTestStorage(t)
+ localStore, err := stores.NewLocal(ctx, storage, index, []string{"http://" + nl.Addr().String() + "/remote"})
+ require.NoError(t, err)
+ remoteStore := stores.NewRemote(localStore, index, nil, 6000, &stores.DefaultPartialFileHandler{})
+
+ // data stores for state tracking.
+ dstore := ds_sync.MutexWrap(datastore.NewMapDatastore())
+ wsts := statestore.New(namespace.Wrap(dstore, datastore.NewKey("/worker/calls")))
+ smsts := statestore.New(namespace.Wrap(dstore, datastore.NewKey("/stmgr/calls")))
+
+ mgr, err := New(ctx, localStore, remoteStore, storage, index, mgrConfig, wsts, smsts)
+ require.NoError(t, err)
+
+ // start a http server on the manager to serve sector file requests.
+ svc := &http.Server{
+ Addr: nl.Addr().String(),
+ Handler: mgr,
+ }
+ go func() {
+ _ = svc.Serve(nl)
+ }()
+
+ pp := NewPieceProvider(remoteStore, index, mgr)
+
+ sector := specstorage.SectorRef{
+ ID: abi.SectorID{
+ Miner: 100,
+ Number: 10,
+ },
+ ProofType: sectorProofType,
+ }
+
+ ticket := abi.SealRandomness{9, 9, 9, 9, 9, 9, 9, 9}
+
+ ppt := &pieceProviderTestHarness{
+ ctx: ctx,
+ index: index,
+ pp: pp,
+ sector: sector,
+ mgr: mgr,
+ ticket: ticket,
+ }
+ ppt.servers = append(ppt.servers, svc)
+ ppt.localStores = append(ppt.localStores, localStore)
+ return ppt
+}
+
+func (p *pieceProviderTestHarness) addRemoteWorker(t *testing.T, tasks []sealtasks.TaskType) {
+ // start an http Server
+ address := "0.0.0.0:0"
+ nl, err := net.Listen("tcp", address)
+ require.NoError(t, err)
+
+ localStore, err := stores.NewLocal(p.ctx, newTestStorage(t), p.index, []string{"http://" + nl.Addr().String() + "/remote"})
+ require.NoError(t, err)
+
+ fh := &stores.FetchHandler{
+ Local: localStore,
+ PfHandler: &stores.DefaultPartialFileHandler{},
+ }
+
+ mux := mux.NewRouter()
+ mux.PathPrefix("/remote").HandlerFunc(fh.ServeHTTP)
+ svc := &http.Server{
+ Addr: nl.Addr().String(),
+ Handler: mux,
+ }
+
+ go func() {
+ _ = svc.Serve(nl)
+ }()
+
+ remote := stores.NewRemote(localStore, p.index, nil, 1000,
+ &stores.DefaultPartialFileHandler{})
+
+ dstore := ds_sync.MutexWrap(datastore.NewMapDatastore())
+ csts := statestore.New(namespace.Wrap(dstore, datastore.NewKey("/stmgr/calls")))
+
+ worker := newLocalWorker(nil, WorkerConfig{
+ TaskTypes: tasks,
+ }, remote, localStore, p.index, p.mgr, csts)
+
+ p.servers = append(p.servers, svc)
+ p.localStores = append(p.localStores, localStore)
+
+ // register self with manager
+ require.NoError(t, p.mgr.AddWorker(p.ctx, worker))
+}
+
+func (p *pieceProviderTestHarness) removeAllUnsealedSectorFiles(t *testing.T) {
+ for i := range p.localStores {
+ ls := p.localStores[i]
+ require.NoError(t, ls.Remove(p.ctx, p.sector.ID, storiface.FTUnsealed, false))
+ }
+}
+
+func (p *pieceProviderTestHarness) addPiece(t *testing.T, pieceData []byte) abi.PieceInfo {
+ var existing []abi.UnpaddedPieceSize
+ for _, pi := range p.addedPieces {
+ existing = append(existing, pi.Size.Unpadded())
+ }
+
+ size := abi.UnpaddedPieceSize(len(pieceData))
+ pieceInfo, err := p.mgr.AddPiece(p.ctx, p.sector, existing, size, bytes.NewReader(pieceData))
+ require.NoError(t, err)
+
+ p.addedPieces = append(p.addedPieces, pieceInfo)
+ return pieceInfo
+}
+
+func (p *pieceProviderTestHarness) preCommit1(t *testing.T) specstorage.PreCommit1Out {
+ preCommit1, err := p.mgr.SealPreCommit1(p.ctx, p.sector, p.ticket, p.addedPieces)
+ require.NoError(t, err)
+ return preCommit1
+}
+
+func (p *pieceProviderTestHarness) preCommit2(t *testing.T, pc1 specstorage.PreCommit1Out) {
+ sectorCids, err := p.mgr.SealPreCommit2(p.ctx, p.sector, pc1)
+ require.NoError(t, err)
+ commD := sectorCids.Unsealed
+ p.commD = commD
+}
+
+func (p *pieceProviderTestHarness) readPiece(t *testing.T, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize,
+ expectedHadToUnseal bool, expectedBytes []byte) {
+ rd, isUnsealed, err := p.pp.ReadPiece(p.ctx, p.sector, offset, size, p.ticket, p.commD)
+ require.NoError(t, err)
+ require.NotNil(t, rd)
+ require.Equal(t, expectedHadToUnseal, isUnsealed)
+ defer func() { _ = rd.Close() }()
+
+ // Make sure the input matches the output
+ readData, err := ioutil.ReadAll(rd)
+ require.NoError(t, err)
+ require.Equal(t, expectedBytes, readData)
+}
+
+func (p *pieceProviderTestHarness) finalizeSector(t *testing.T, keepUnseal []specstorage.Range) {
+ require.NoError(t, p.mgr.FinalizeSector(p.ctx, p.sector, keepUnseal))
+}
+
+func (p *pieceProviderTestHarness) shutdown(t *testing.T) {
+ for _, svc := range p.servers {
+ s := svc
+ require.NoError(t, s.Shutdown(p.ctx))
+ }
+}
diff --git a/extern/sector-storage/resources.go b/extern/sector-storage/resources.go
index 7da3e96a6..2e989fdf4 100644
--- a/extern/sector-storage/resources.go
+++ b/extern/sector-storage/resources.go
@@ -313,7 +313,6 @@ var ResourceTable = map[sealtasks.TaskType]map[abi.RegisteredSealProof]Resources
func init() {
ResourceTable[sealtasks.TTUnseal] = ResourceTable[sealtasks.TTPreCommit1] // TODO: measure accurately
- ResourceTable[sealtasks.TTReadUnsealed] = ResourceTable[sealtasks.TTFetch]
// V1_1 is the same as V1
for _, m := range ResourceTable {
diff --git a/extern/sector-storage/sealtasks/task.go b/extern/sector-storage/sealtasks/task.go
index 8dd14ca34..6d341a4b3 100644
--- a/extern/sector-storage/sealtasks/task.go
+++ b/extern/sector-storage/sealtasks/task.go
@@ -11,21 +11,19 @@ const (
TTFinalize TaskType = "seal/v0/finalize"
- TTFetch TaskType = "seal/v0/fetch"
- TTUnseal TaskType = "seal/v0/unseal"
- TTReadUnsealed TaskType = "seal/v0/unsealread"
+ TTFetch TaskType = "seal/v0/fetch"
+ TTUnseal TaskType = "seal/v0/unseal"
)
var order = map[TaskType]int{
- TTAddPiece: 6, // least priority
- TTPreCommit1: 5,
- TTPreCommit2: 4,
- TTCommit2: 3,
- TTCommit1: 2,
- TTUnseal: 1,
- TTFetch: -1,
- TTReadUnsealed: -1,
- TTFinalize: -2, // most priority
+ TTAddPiece: 6, // least priority
+ TTPreCommit1: 5,
+ TTPreCommit2: 4,
+ TTCommit2: 3,
+ TTCommit1: 2,
+ TTUnseal: 1,
+ TTFetch: -1,
+ TTFinalize: -2, // most priority
}
var shortNames = map[TaskType]string{
@@ -38,9 +36,8 @@ var shortNames = map[TaskType]string{
TTFinalize: "FIN",
- TTFetch: "GET",
- TTUnseal: "UNS",
- TTReadUnsealed: "RD",
+ TTFetch: "GET",
+ TTUnseal: "UNS",
}
func (a TaskType) MuchLess(b TaskType) (bool, bool) {
diff --git a/extern/sector-storage/stores/http_handler.go b/extern/sector-storage/stores/http_handler.go
index 3e3468470..dc7797157 100644
--- a/extern/sector-storage/stores/http_handler.go
+++ b/extern/sector-storage/stores/http_handler.go
@@ -5,7 +5,10 @@ import (
"io"
"net/http"
"os"
+ "strconv"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/extern/sector-storage/partialfile"
"github.com/gorilla/mux"
logging "github.com/ipfs/go-log/v2"
"golang.org/x/xerrors"
@@ -18,8 +21,32 @@ import (
var log = logging.Logger("stores")
+var _ partialFileHandler = &DefaultPartialFileHandler{}
+
+// DefaultPartialFileHandler is the default implementation of the partialFileHandler interface.
+// This is probably the only implementation we'll ever use because the purpose of the
+// interface to is to mock out partial file related functionality during testing.
+type DefaultPartialFileHandler struct{}
+
+func (d *DefaultPartialFileHandler) OpenPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*partialfile.PartialFile, error) {
+ return partialfile.OpenPartialFile(maxPieceSize, path)
+}
+func (d *DefaultPartialFileHandler) HasAllocated(pf *partialfile.PartialFile, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error) {
+ return pf.HasAllocated(offset, size)
+}
+
+func (d *DefaultPartialFileHandler) Reader(pf *partialfile.PartialFile, offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) (*os.File, error) {
+ return pf.Reader(offset, size)
+}
+
+// Close closes the partial file
+func (d *DefaultPartialFileHandler) Close(pf *partialfile.PartialFile) error {
+ return pf.Close()
+}
+
type FetchHandler struct {
- *Local
+ Local Store
+ PfHandler partialFileHandler
}
func (handler *FetchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // /remote/
@@ -29,6 +56,8 @@ func (handler *FetchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
mux.HandleFunc("/remote/{type}/{id}", handler.remoteGetSector).Methods("GET")
mux.HandleFunc("/remote/{type}/{id}", handler.remoteDeleteSector).Methods("DELETE")
+ mux.HandleFunc("/remote/{type}/{id}/{spt}/allocated/{offset}/{size}", handler.remoteGetAllocated).Methods("GET")
+
mux.ServeHTTP(w, r)
}
@@ -54,6 +83,8 @@ func (handler *FetchHandler) remoteStatFs(w http.ResponseWriter, r *http.Request
}
}
+// remoteGetSector returns the sector file/tared directory byte stream for the sectorID and sector file type sent in the request.
+// returns an error if it does NOT have the required sector file/dir.
func (handler *FetchHandler) remoteGetSector(w http.ResponseWriter, r *http.Request) {
log.Infof("SERVE GET %s", r.URL)
vars := mux.Vars(r)
@@ -73,7 +104,6 @@ func (handler *FetchHandler) remoteGetSector(w http.ResponseWriter, r *http.Requ
}
// The caller has a lock on this sector already, no need to get one here
-
// passing 0 spt because we don't allocate anything
si := storage.SectorRef{
ID: id,
@@ -82,7 +112,7 @@ func (handler *FetchHandler) remoteGetSector(w http.ResponseWriter, r *http.Requ
paths, _, err := handler.Local.AcquireSector(r.Context(), si, ft, storiface.FTNone, storiface.PathStorage, storiface.AcquireMove)
if err != nil {
- log.Errorf("%+v", err)
+ log.Errorf("AcquireSector: %+v", err)
w.WriteHeader(500)
return
}
@@ -98,37 +128,38 @@ func (handler *FetchHandler) remoteGetSector(w http.ResponseWriter, r *http.Requ
stat, err := os.Stat(path)
if err != nil {
- log.Errorf("%+v", err)
+ log.Errorf("os.Stat: %+v", err)
w.WriteHeader(500)
return
}
- var rd io.Reader
if stat.IsDir() {
- rd, err = tarutil.TarDirectory(path)
+ if _, has := r.Header["Range"]; has {
+ log.Error("Range not supported on directories")
+ w.WriteHeader(500)
+ return
+ }
+
+ rd, err := tarutil.TarDirectory(path)
+ if err != nil {
+ log.Errorf("%+v", err)
+ w.WriteHeader(500)
+ return
+ }
+
w.Header().Set("Content-Type", "application/x-tar")
+ w.WriteHeader(200)
+ if _, err := io.CopyBuffer(w, rd, make([]byte, CopyBuf)); err != nil {
+ log.Errorf("%+v", err)
+ return
+ }
} else {
- rd, err = os.OpenFile(path, os.O_RDONLY, 0644) // nolint
w.Header().Set("Content-Type", "application/octet-stream")
- }
- if err != nil {
- log.Errorf("%+v", err)
- w.WriteHeader(500)
- return
- }
- if !stat.IsDir() {
- defer func() {
- if err := rd.(*os.File).Close(); err != nil {
- log.Errorf("closing source file: %+v", err)
- }
- }()
+ // will do a ranged read over the file at the given path if the caller has asked for a ranged read in the request headers.
+ http.ServeFile(w, r, path)
}
- w.WriteHeader(200)
- if _, err := io.CopyBuffer(w, rd, make([]byte, CopyBuf)); err != nil {
- log.Errorf("%+v", err)
- return
- }
+ log.Debugf("served sector file/dir, sectorID=%+v, fileType=%s, path=%s", id, ft, path)
}
func (handler *FetchHandler) remoteDeleteSector(w http.ResponseWriter, r *http.Request) {
@@ -149,13 +180,120 @@ func (handler *FetchHandler) remoteDeleteSector(w http.ResponseWriter, r *http.R
return
}
- if err := handler.Remove(r.Context(), id, ft, false); err != nil {
+ if err := handler.Local.Remove(r.Context(), id, ft, false); err != nil {
log.Errorf("%+v", err)
w.WriteHeader(500)
return
}
}
+// remoteGetAllocated returns `http.StatusOK` if the worker already has an Unsealed sector file
+// containing the Unsealed piece sent in the request.
+// returns `http.StatusRequestedRangeNotSatisfiable` otherwise.
+func (handler *FetchHandler) remoteGetAllocated(w http.ResponseWriter, r *http.Request) {
+ log.Infof("SERVE Alloc check %s", r.URL)
+ vars := mux.Vars(r)
+
+ id, err := storiface.ParseSectorID(vars["id"])
+ if err != nil {
+ log.Errorf("parsing sectorID: %+v", err)
+ w.WriteHeader(500)
+ return
+ }
+
+ ft, err := ftFromString(vars["type"])
+ if err != nil {
+ log.Errorf("ftFromString: %+v", err)
+ w.WriteHeader(500)
+ return
+ }
+ if ft != storiface.FTUnsealed {
+ log.Errorf("/allocated only supports unsealed sector files")
+ w.WriteHeader(500)
+ return
+ }
+
+ spti, err := strconv.ParseInt(vars["spt"], 10, 64)
+ if err != nil {
+ log.Errorf("parsing spt: %+v", err)
+ w.WriteHeader(500)
+ return
+ }
+ spt := abi.RegisteredSealProof(spti)
+ ssize, err := spt.SectorSize()
+ if err != nil {
+ log.Errorf("spt.SectorSize(): %+v", err)
+ w.WriteHeader(500)
+ return
+ }
+
+ offi, err := strconv.ParseInt(vars["offset"], 10, 64)
+ if err != nil {
+ log.Errorf("parsing offset: %+v", err)
+ w.WriteHeader(500)
+ return
+ }
+ szi, err := strconv.ParseInt(vars["size"], 10, 64)
+ if err != nil {
+ log.Errorf("parsing size: %+v", err)
+ w.WriteHeader(500)
+ return
+ }
+
+ // The caller has a lock on this sector already, no need to get one here
+
+ // passing 0 spt because we don't allocate anything
+ si := storage.SectorRef{
+ ID: id,
+ ProofType: 0,
+ }
+
+ // get the path of the local Unsealed file for the given sector.
+ // return error if we do NOT have it.
+ paths, _, err := handler.Local.AcquireSector(r.Context(), si, ft, storiface.FTNone, storiface.PathStorage, storiface.AcquireMove)
+ if err != nil {
+ log.Errorf("AcquireSector: %+v", err)
+ w.WriteHeader(500)
+ return
+ }
+
+ path := storiface.PathByType(paths, ft)
+ if path == "" {
+ log.Error("acquired path was empty")
+ w.WriteHeader(500)
+ return
+ }
+
+ // open the Unsealed file and check if it has the Unsealed sector for the piece at the given offset and size.
+ pf, err := handler.PfHandler.OpenPartialFile(abi.PaddedPieceSize(ssize), path)
+ if err != nil {
+ log.Error("opening partial file: ", err)
+ w.WriteHeader(500)
+ return
+ }
+ defer func() {
+ if err := pf.Close(); err != nil {
+ log.Error("closing partial file: ", err)
+ }
+ }()
+
+ has, err := handler.PfHandler.HasAllocated(pf, storiface.UnpaddedByteIndex(offi), abi.UnpaddedPieceSize(szi))
+ if err != nil {
+ log.Error("has allocated: ", err)
+ w.WriteHeader(500)
+ return
+ }
+
+ if has {
+ log.Debugf("returning ok: worker has unsealed file with unsealed piece, sector:%+v, offset:%d, size:%d", id, offi, szi)
+ w.WriteHeader(http.StatusOK)
+ return
+ }
+
+ log.Debugf("returning StatusRequestedRangeNotSatisfiable: worker does NOT have unsealed file with unsealed piece, sector:%+v, offset:%d, size:%d", id, offi, szi)
+ w.WriteHeader(http.StatusRequestedRangeNotSatisfiable)
+}
+
func ftFromString(t string) (storiface.SectorFileType, error) {
switch t {
case storiface.FTUnsealed.String():
diff --git a/extern/sector-storage/stores/http_handler_test.go b/extern/sector-storage/stores/http_handler_test.go
new file mode 100644
index 000000000..1258d8530
--- /dev/null
+++ b/extern/sector-storage/stores/http_handler_test.go
@@ -0,0 +1,457 @@
+package stores_test
+
+import (
+ "fmt"
+ "io/ioutil"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "testing"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/extern/sector-storage/partialfile"
+ "github.com/filecoin-project/lotus/extern/sector-storage/stores"
+ "github.com/filecoin-project/lotus/extern/sector-storage/stores/mocks"
+ "github.com/filecoin-project/lotus/extern/sector-storage/storiface"
+ "github.com/filecoin-project/specs-storage/storage"
+ "github.com/golang/mock/gomock"
+ "github.com/stretchr/testify/require"
+ "golang.org/x/xerrors"
+)
+
+func TestRemoteGetAllocated(t *testing.T) {
+
+ emptyPartialFile := &partialfile.PartialFile{}
+ pfPath := "path"
+ expectedSectorRef := storage.SectorRef{
+ ID: abi.SectorID{
+ Miner: 123,
+ Number: 123,
+ },
+ ProofType: 0,
+ }
+
+ validSectorName := fmt.Sprintf("s-t0%d-%d", 123, 123)
+ validSectorFileType := storiface.FTUnsealed.String()
+ validSectorType := "1"
+ sectorSize := abi.SealProofInfos[1].SectorSize
+
+ validOffset := "100"
+ validOffsetInt := 100
+
+ validSize := "1000"
+ validSizeInt := 1000
+
+ type pieceInfo struct {
+ sectorName string
+ fileType string
+ sectorType string
+
+ // piece info
+ offset string
+ size string
+ }
+ validPieceInfo := pieceInfo{
+ sectorName: validSectorName,
+ fileType: validSectorFileType,
+ sectorType: validSectorType,
+ offset: validOffset,
+ size: validSize,
+ }
+
+ tcs := map[string]struct {
+ piFnc func(pi *pieceInfo)
+ storeFnc func(s *mocks.MockStore)
+ pfFunc func(s *mocks.MockpartialFileHandler)
+
+ // expectation
+ expectedStatusCode int
+ }{
+ "fails when sector name is invalid": {
+ piFnc: func(pi *pieceInfo) {
+ pi.sectorName = "invalid"
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ },
+ "fails when file type is invalid": {
+ piFnc: func(pi *pieceInfo) {
+ pi.fileType = "invalid"
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ },
+ "fails when sector proof type is invalid": {
+ piFnc: func(pi *pieceInfo) {
+ pi.sectorType = "invalid"
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ },
+ "fails when offset is invalid": {
+ piFnc: func(pi *pieceInfo) {
+ pi.offset = "invalid"
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ },
+ "fails when size is invalid": {
+ piFnc: func(pi *pieceInfo) {
+ pi.size = "invalid"
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ },
+ "fails when errors out during acquiring unsealed sector file": {
+ expectedStatusCode: http.StatusInternalServerError,
+ storeFnc: func(l *mocks.MockStore) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: "path",
+ },
+ storiface.SectorPaths{}, xerrors.New("some error")).Times(1)
+ },
+ },
+ "fails when unsealed sector file is not found locally": {
+ expectedStatusCode: http.StatusInternalServerError,
+ storeFnc: func(l *mocks.MockStore) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{},
+ storiface.SectorPaths{}, nil).Times(1)
+ },
+ },
+ "fails when error while opening partial file": {
+ expectedStatusCode: http.StatusInternalServerError,
+ storeFnc: func(l *mocks.MockStore) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: pfPath,
+ },
+ storiface.SectorPaths{}, nil).Times(1)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ pf.EXPECT().OpenPartialFile(abi.PaddedPieceSize(sectorSize), pfPath).Return(&partialfile.PartialFile{},
+ xerrors.New("some error")).Times(1)
+ },
+ },
+
+ "fails when determining partial file allocation returns an error": {
+ expectedStatusCode: http.StatusInternalServerError,
+ storeFnc: func(l *mocks.MockStore) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: pfPath,
+ },
+ storiface.SectorPaths{}, nil).Times(1)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ pf.EXPECT().OpenPartialFile(abi.PaddedPieceSize(sectorSize), pfPath).Return(emptyPartialFile,
+ nil).Times(1)
+
+ pf.EXPECT().HasAllocated(emptyPartialFile, storiface.UnpaddedByteIndex(validOffsetInt),
+ abi.UnpaddedPieceSize(validSizeInt)).Return(true, xerrors.New("some error")).Times(1)
+ },
+ },
+ "StatusRequestedRangeNotSatisfiable when piece is NOT allocated in partial file": {
+ expectedStatusCode: http.StatusRequestedRangeNotSatisfiable,
+ storeFnc: func(l *mocks.MockStore) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: pfPath,
+ },
+ storiface.SectorPaths{}, nil).Times(1)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ pf.EXPECT().OpenPartialFile(abi.PaddedPieceSize(sectorSize), pfPath).Return(emptyPartialFile,
+ nil).Times(1)
+
+ pf.EXPECT().HasAllocated(emptyPartialFile, storiface.UnpaddedByteIndex(validOffsetInt),
+ abi.UnpaddedPieceSize(validSizeInt)).Return(false, nil).Times(1)
+ },
+ },
+ "OK when piece is allocated in partial file": {
+ expectedStatusCode: http.StatusOK,
+ storeFnc: func(l *mocks.MockStore) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: pfPath,
+ },
+ storiface.SectorPaths{}, nil).Times(1)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ pf.EXPECT().OpenPartialFile(abi.PaddedPieceSize(sectorSize), pfPath).Return(emptyPartialFile,
+ nil).Times(1)
+
+ pf.EXPECT().HasAllocated(emptyPartialFile, storiface.UnpaddedByteIndex(validOffsetInt),
+ abi.UnpaddedPieceSize(validSizeInt)).Return(true, nil).Times(1)
+ },
+ },
+ }
+
+ for name, tc := range tcs {
+ tc := tc
+ t.Run(name, func(t *testing.T) {
+ // create go mock controller here
+ mockCtrl := gomock.NewController(t)
+ // when test is done, assert expectations on all mock objects.
+ defer mockCtrl.Finish()
+
+ lstore := mocks.NewMockStore(mockCtrl)
+ pfhandler := mocks.NewMockpartialFileHandler(mockCtrl)
+
+ handler := &stores.FetchHandler{
+ lstore,
+ pfhandler,
+ }
+
+ // run http server
+ ts := httptest.NewServer(handler)
+ defer ts.Close()
+
+ pi := validPieceInfo
+
+ if tc.piFnc != nil {
+ tc.piFnc(&pi)
+ }
+
+ if tc.storeFnc != nil {
+ tc.storeFnc(lstore)
+ }
+ if tc.pfFunc != nil {
+ tc.pfFunc(pfhandler)
+ }
+
+ // call remoteGetAllocated
+ url := fmt.Sprintf("%s/remote/%s/%s/%s/allocated/%s/%s",
+ ts.URL,
+ pi.fileType,
+ pi.sectorName,
+ pi.sectorType,
+ pi.offset,
+ pi.size)
+ resp, err := http.Get(url)
+ require.NoError(t, err)
+ defer func() {
+ _ = resp.Body.Close()
+ }()
+
+ // assert expected status code
+ require.Equal(t, tc.expectedStatusCode, resp.StatusCode)
+ })
+ }
+}
+
+func TestRemoteGetSector(t *testing.T) {
+ str := "hello-world"
+ fileBytes := []byte(str)
+
+ validSectorName := fmt.Sprintf("s-t0%d-%d", 123, 123)
+ validSectorFileType := storiface.FTUnsealed.String()
+ expectedSectorRef := storage.SectorRef{
+ ID: abi.SectorID{
+ Miner: 123,
+ Number: 123,
+ },
+ ProofType: 0,
+ }
+
+ type sectorInfo struct {
+ sectorName string
+ fileType string
+ }
+ validSectorInfo := sectorInfo{
+ sectorName: validSectorName,
+ fileType: validSectorFileType,
+ }
+
+ tcs := map[string]struct {
+ siFnc func(pi *sectorInfo)
+ storeFnc func(s *mocks.MockStore, path string)
+
+ // reading a file or a dir
+ isDir bool
+
+ // expectation
+ noResponseBytes bool
+ expectedContentType string
+ expectedStatusCode int
+ expectedResponseBytes []byte
+ }{
+ "fails when sector name is invalid": {
+ siFnc: func(si *sectorInfo) {
+ si.sectorName = "invalid"
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ noResponseBytes: true,
+ },
+ "fails when file type is invalid": {
+ siFnc: func(si *sectorInfo) {
+ si.fileType = "invalid"
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ noResponseBytes: true,
+ },
+ "fails when error while acquiring sector file": {
+ storeFnc: func(l *mocks.MockStore, _ string) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: "path",
+ },
+ storiface.SectorPaths{}, xerrors.New("some error")).Times(1)
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ noResponseBytes: true,
+ },
+ "fails when acquired sector file path is empty": {
+ expectedStatusCode: http.StatusInternalServerError,
+ storeFnc: func(l *mocks.MockStore, _ string) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{},
+ storiface.SectorPaths{}, nil).Times(1)
+ },
+ noResponseBytes: true,
+ },
+ "fails when acquired file does not exist": {
+ expectedStatusCode: http.StatusInternalServerError,
+ storeFnc: func(l *mocks.MockStore, _ string) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: "path",
+ },
+ storiface.SectorPaths{}, nil)
+ },
+ noResponseBytes: true,
+ },
+ "successfully read a sector file": {
+ storeFnc: func(l *mocks.MockStore, path string) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: path,
+ },
+ storiface.SectorPaths{}, nil)
+ },
+
+ noResponseBytes: false,
+ expectedContentType: "application/octet-stream",
+ expectedStatusCode: 200,
+ expectedResponseBytes: fileBytes,
+ },
+ "successfully read a sector dir": {
+ storeFnc: func(l *mocks.MockStore, path string) {
+
+ l.EXPECT().AcquireSector(gomock.Any(), expectedSectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: path,
+ },
+ storiface.SectorPaths{}, nil)
+ },
+
+ isDir: true,
+ noResponseBytes: false,
+ expectedContentType: "application/x-tar",
+ expectedStatusCode: 200,
+ expectedResponseBytes: fileBytes,
+ },
+ }
+
+ for name, tc := range tcs {
+ tc := tc
+ t.Run(name, func(t *testing.T) {
+ mockCtrl := gomock.NewController(t)
+ // when test is done, assert expectations on all mock objects.
+ defer mockCtrl.Finish()
+ lstore := mocks.NewMockStore(mockCtrl)
+ pfhandler := mocks.NewMockpartialFileHandler(mockCtrl)
+
+ var path string
+
+ if !tc.isDir {
+ // create file
+ tempFile, err := ioutil.TempFile("", "TestRemoteGetSector-")
+ require.NoError(t, err)
+
+ defer func() {
+ _ = os.Remove(tempFile.Name())
+ }()
+
+ _, err = tempFile.Write(fileBytes)
+ require.NoError(t, err)
+ path = tempFile.Name()
+ } else {
+ // create dir with a file
+ tempFile2, err := ioutil.TempFile("", "TestRemoteGetSector-")
+ require.NoError(t, err)
+ defer func() {
+ _ = os.Remove(tempFile2.Name())
+ }()
+
+ stat, err := os.Stat(tempFile2.Name())
+ require.NoError(t, err)
+ tempDir, err := ioutil.TempDir("", "TestRemoteGetSector-")
+ require.NoError(t, err)
+
+ defer func() {
+ _ = os.RemoveAll(tempDir)
+ }()
+
+ require.NoError(t, os.Rename(tempFile2.Name(), filepath.Join(tempDir, stat.Name())))
+
+ path = tempDir
+ }
+
+ handler := &stores.FetchHandler{
+ lstore,
+ pfhandler,
+ }
+
+ // run http server
+ ts := httptest.NewServer(handler)
+ defer ts.Close()
+
+ si := validSectorInfo
+ if tc.siFnc != nil {
+ tc.siFnc(&si)
+ }
+
+ if tc.storeFnc != nil {
+ tc.storeFnc(lstore, path)
+ }
+
+ // call remoteGetAllocated
+ url := fmt.Sprintf("%s/remote/%s/%s",
+ ts.URL,
+ si.fileType,
+ si.sectorName,
+ )
+ resp, err := http.Get(url)
+ require.NoError(t, err)
+ defer func() {
+ _ = resp.Body.Close()
+ }()
+
+ bz, err := ioutil.ReadAll(resp.Body)
+ require.NoError(t, err)
+
+ // assert expected status code
+ require.Equal(t, tc.expectedStatusCode, resp.StatusCode)
+
+ if !tc.noResponseBytes {
+ if !tc.isDir {
+ require.EqualValues(t, tc.expectedResponseBytes, bz)
+ }
+ }
+
+ require.Equal(t, tc.expectedContentType, resp.Header.Get("Content-Type"))
+ })
+ }
+}
diff --git a/extern/sector-storage/stores/index.go b/extern/sector-storage/stores/index.go
index 4acc2ecdb..a84adf016 100644
--- a/extern/sector-storage/stores/index.go
+++ b/extern/sector-storage/stores/index.go
@@ -3,6 +3,7 @@ package stores
import (
"context"
"errors"
+ "fmt"
"net/url"
gopath "path"
"sort"
@@ -383,7 +384,16 @@ func (i *Index) StorageBestAlloc(ctx context.Context, allocate storiface.SectorF
var candidates []storageEntry
- spaceReq, err := allocate.SealSpaceUse(ssize)
+ var err error
+ var spaceReq uint64
+ switch pathType {
+ case storiface.PathSealing:
+ spaceReq, err = allocate.SealSpaceUse(ssize)
+ case storiface.PathStorage:
+ spaceReq, err = allocate.StoreSpaceUse(ssize)
+ default:
+ panic(fmt.Sprintf("unexpected pathType: %s", pathType))
+ }
if err != nil {
return nil, xerrors.Errorf("estimating required space: %w", err)
}
diff --git a/extern/sector-storage/stores/interface.go b/extern/sector-storage/stores/interface.go
index a997ad3d2..4986e6c80 100644
--- a/extern/sector-storage/stores/interface.go
+++ b/extern/sector-storage/stores/interface.go
@@ -2,8 +2,10 @@ package stores
import (
"context"
+ "os"
"github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/extern/sector-storage/partialfile"
"github.com/filecoin-project/specs-storage/storage"
@@ -11,6 +13,23 @@ import (
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
+// PartialFileHandler helps mock out the partial file functionality during testing.
+type partialFileHandler interface {
+ // OpenPartialFile opens and returns a partial file at the given path and also verifies it has the given
+ // size
+ OpenPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*partialfile.PartialFile, error)
+
+ // HasAllocated returns true if the given partial file has an unsealed piece starting at the given offset with the given size.
+ // returns false otherwise.
+ HasAllocated(pf *partialfile.PartialFile, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error)
+
+ // Reader returns a file from which we can read the unsealed piece in the partial file.
+ Reader(pf *partialfile.PartialFile, offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) (*os.File, error)
+
+ // Close closes the partial file
+ Close(pf *partialfile.PartialFile) error
+}
+
type Store interface {
AcquireSector(ctx context.Context, s storage.SectorRef, existing storiface.SectorFileType, allocate storiface.SectorFileType, sealing storiface.PathType, op storiface.AcquireMode) (paths storiface.SectorPaths, stores storiface.SectorPaths, err error)
Remove(ctx context.Context, s abi.SectorID, types storiface.SectorFileType, force bool) error
@@ -23,4 +42,6 @@ type Store interface {
MoveStorage(ctx context.Context, s storage.SectorRef, types storiface.SectorFileType) error
FsStat(ctx context.Context, id ID) (fsutil.FsStat, error)
+
+ Reserve(ctx context.Context, sid storage.SectorRef, ft storiface.SectorFileType, storageIDs storiface.SectorPaths, overheadTab map[storiface.SectorFileType]int) (func(), error)
}
diff --git a/extern/sector-storage/stores/mocks/index.go b/extern/sector-storage/stores/mocks/index.go
new file mode 100644
index 000000000..e06fa70cc
--- /dev/null
+++ b/extern/sector-storage/stores/mocks/index.go
@@ -0,0 +1,169 @@
+// Code generated by MockGen. DO NOT EDIT.
+// Source: index.go
+
+// Package mock_stores is a generated GoMock package.
+package mocks
+
+import (
+ context "context"
+ reflect "reflect"
+
+ abi "github.com/filecoin-project/go-state-types/abi"
+ fsutil "github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
+ stores "github.com/filecoin-project/lotus/extern/sector-storage/stores"
+ storiface "github.com/filecoin-project/lotus/extern/sector-storage/storiface"
+ gomock "github.com/golang/mock/gomock"
+)
+
+// MockSectorIndex is a mock of SectorIndex interface.
+type MockSectorIndex struct {
+ ctrl *gomock.Controller
+ recorder *MockSectorIndexMockRecorder
+}
+
+// MockSectorIndexMockRecorder is the mock recorder for MockSectorIndex.
+type MockSectorIndexMockRecorder struct {
+ mock *MockSectorIndex
+}
+
+// NewMockSectorIndex creates a new mock instance.
+func NewMockSectorIndex(ctrl *gomock.Controller) *MockSectorIndex {
+ mock := &MockSectorIndex{ctrl: ctrl}
+ mock.recorder = &MockSectorIndexMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use.
+func (m *MockSectorIndex) EXPECT() *MockSectorIndexMockRecorder {
+ return m.recorder
+}
+
+// StorageAttach mocks base method.
+func (m *MockSectorIndex) StorageAttach(arg0 context.Context, arg1 stores.StorageInfo, arg2 fsutil.FsStat) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StorageAttach", arg0, arg1, arg2)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// StorageAttach indicates an expected call of StorageAttach.
+func (mr *MockSectorIndexMockRecorder) StorageAttach(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageAttach", reflect.TypeOf((*MockSectorIndex)(nil).StorageAttach), arg0, arg1, arg2)
+}
+
+// StorageBestAlloc mocks base method.
+func (m *MockSectorIndex) StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType) ([]stores.StorageInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StorageBestAlloc", ctx, allocate, ssize, pathType)
+ ret0, _ := ret[0].([]stores.StorageInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StorageBestAlloc indicates an expected call of StorageBestAlloc.
+func (mr *MockSectorIndexMockRecorder) StorageBestAlloc(ctx, allocate, ssize, pathType interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageBestAlloc", reflect.TypeOf((*MockSectorIndex)(nil).StorageBestAlloc), ctx, allocate, ssize, pathType)
+}
+
+// StorageDeclareSector mocks base method.
+func (m *MockSectorIndex) StorageDeclareSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StorageDeclareSector", ctx, storageID, s, ft, primary)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// StorageDeclareSector indicates an expected call of StorageDeclareSector.
+func (mr *MockSectorIndexMockRecorder) StorageDeclareSector(ctx, storageID, s, ft, primary interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageDeclareSector", reflect.TypeOf((*MockSectorIndex)(nil).StorageDeclareSector), ctx, storageID, s, ft, primary)
+}
+
+// StorageDropSector mocks base method.
+func (m *MockSectorIndex) StorageDropSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StorageDropSector", ctx, storageID, s, ft)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// StorageDropSector indicates an expected call of StorageDropSector.
+func (mr *MockSectorIndexMockRecorder) StorageDropSector(ctx, storageID, s, ft interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageDropSector", reflect.TypeOf((*MockSectorIndex)(nil).StorageDropSector), ctx, storageID, s, ft)
+}
+
+// StorageFindSector mocks base method.
+func (m *MockSectorIndex) StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]stores.SectorStorageInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StorageFindSector", ctx, sector, ft, ssize, allowFetch)
+ ret0, _ := ret[0].([]stores.SectorStorageInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StorageFindSector indicates an expected call of StorageFindSector.
+func (mr *MockSectorIndexMockRecorder) StorageFindSector(ctx, sector, ft, ssize, allowFetch interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageFindSector", reflect.TypeOf((*MockSectorIndex)(nil).StorageFindSector), ctx, sector, ft, ssize, allowFetch)
+}
+
+// StorageInfo mocks base method.
+func (m *MockSectorIndex) StorageInfo(arg0 context.Context, arg1 stores.ID) (stores.StorageInfo, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StorageInfo", arg0, arg1)
+ ret0, _ := ret[0].(stores.StorageInfo)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StorageInfo indicates an expected call of StorageInfo.
+func (mr *MockSectorIndexMockRecorder) StorageInfo(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageInfo", reflect.TypeOf((*MockSectorIndex)(nil).StorageInfo), arg0, arg1)
+}
+
+// StorageLock mocks base method.
+func (m *MockSectorIndex) StorageLock(ctx context.Context, sector abi.SectorID, read, write storiface.SectorFileType) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StorageLock", ctx, sector, read, write)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// StorageLock indicates an expected call of StorageLock.
+func (mr *MockSectorIndexMockRecorder) StorageLock(ctx, sector, read, write interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageLock", reflect.TypeOf((*MockSectorIndex)(nil).StorageLock), ctx, sector, read, write)
+}
+
+// StorageReportHealth mocks base method.
+func (m *MockSectorIndex) StorageReportHealth(arg0 context.Context, arg1 stores.ID, arg2 stores.HealthReport) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StorageReportHealth", arg0, arg1, arg2)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// StorageReportHealth indicates an expected call of StorageReportHealth.
+func (mr *MockSectorIndexMockRecorder) StorageReportHealth(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageReportHealth", reflect.TypeOf((*MockSectorIndex)(nil).StorageReportHealth), arg0, arg1, arg2)
+}
+
+// StorageTryLock mocks base method.
+func (m *MockSectorIndex) StorageTryLock(ctx context.Context, sector abi.SectorID, read, write storiface.SectorFileType) (bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "StorageTryLock", ctx, sector, read, write)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// StorageTryLock indicates an expected call of StorageTryLock.
+func (mr *MockSectorIndexMockRecorder) StorageTryLock(ctx, sector, read, write interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageTryLock", reflect.TypeOf((*MockSectorIndex)(nil).StorageTryLock), ctx, sector, read, write)
+}
diff --git a/extern/sector-storage/stores/mocks/stores.go b/extern/sector-storage/stores/mocks/stores.go
new file mode 100644
index 000000000..a408419a9
--- /dev/null
+++ b/extern/sector-storage/stores/mocks/stores.go
@@ -0,0 +1,212 @@
+// Code generated by MockGen. DO NOT EDIT.
+// Source: interface.go
+
+// Package mock_stores is a generated GoMock package.
+package mocks
+
+import (
+ context "context"
+ os "os"
+ reflect "reflect"
+
+ abi "github.com/filecoin-project/go-state-types/abi"
+ fsutil "github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
+ partialfile "github.com/filecoin-project/lotus/extern/sector-storage/partialfile"
+ stores "github.com/filecoin-project/lotus/extern/sector-storage/stores"
+ storiface "github.com/filecoin-project/lotus/extern/sector-storage/storiface"
+ storage "github.com/filecoin-project/specs-storage/storage"
+ gomock "github.com/golang/mock/gomock"
+)
+
+// MockpartialFileHandler is a mock of partialFileHandler interface.
+type MockpartialFileHandler struct {
+ ctrl *gomock.Controller
+ recorder *MockpartialFileHandlerMockRecorder
+}
+
+// MockpartialFileHandlerMockRecorder is the mock recorder for MockpartialFileHandler.
+type MockpartialFileHandlerMockRecorder struct {
+ mock *MockpartialFileHandler
+}
+
+// NewMockpartialFileHandler creates a new mock instance.
+func NewMockpartialFileHandler(ctrl *gomock.Controller) *MockpartialFileHandler {
+ mock := &MockpartialFileHandler{ctrl: ctrl}
+ mock.recorder = &MockpartialFileHandlerMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use.
+func (m *MockpartialFileHandler) EXPECT() *MockpartialFileHandlerMockRecorder {
+ return m.recorder
+}
+
+// Close mocks base method.
+func (m *MockpartialFileHandler) Close(pf *partialfile.PartialFile) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Close", pf)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// Close indicates an expected call of Close.
+func (mr *MockpartialFileHandlerMockRecorder) Close(pf interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockpartialFileHandler)(nil).Close), pf)
+}
+
+// HasAllocated mocks base method.
+func (m *MockpartialFileHandler) HasAllocated(pf *partialfile.PartialFile, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "HasAllocated", pf, offset, size)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// HasAllocated indicates an expected call of HasAllocated.
+func (mr *MockpartialFileHandlerMockRecorder) HasAllocated(pf, offset, size interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasAllocated", reflect.TypeOf((*MockpartialFileHandler)(nil).HasAllocated), pf, offset, size)
+}
+
+// OpenPartialFile mocks base method.
+func (m *MockpartialFileHandler) OpenPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*partialfile.PartialFile, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "OpenPartialFile", maxPieceSize, path)
+ ret0, _ := ret[0].(*partialfile.PartialFile)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// OpenPartialFile indicates an expected call of OpenPartialFile.
+func (mr *MockpartialFileHandlerMockRecorder) OpenPartialFile(maxPieceSize, path interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenPartialFile", reflect.TypeOf((*MockpartialFileHandler)(nil).OpenPartialFile), maxPieceSize, path)
+}
+
+// Reader mocks base method.
+func (m *MockpartialFileHandler) Reader(pf *partialfile.PartialFile, offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) (*os.File, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Reader", pf, offset, size)
+ ret0, _ := ret[0].(*os.File)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// Reader indicates an expected call of Reader.
+func (mr *MockpartialFileHandlerMockRecorder) Reader(pf, offset, size interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reader", reflect.TypeOf((*MockpartialFileHandler)(nil).Reader), pf, offset, size)
+}
+
+// MockStore is a mock of Store interface.
+type MockStore struct {
+ ctrl *gomock.Controller
+ recorder *MockStoreMockRecorder
+}
+
+// MockStoreMockRecorder is the mock recorder for MockStore.
+type MockStoreMockRecorder struct {
+ mock *MockStore
+}
+
+// NewMockStore creates a new mock instance.
+func NewMockStore(ctrl *gomock.Controller) *MockStore {
+ mock := &MockStore{ctrl: ctrl}
+ mock.recorder = &MockStoreMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use.
+func (m *MockStore) EXPECT() *MockStoreMockRecorder {
+ return m.recorder
+}
+
+// AcquireSector mocks base method.
+func (m *MockStore) AcquireSector(ctx context.Context, s storage.SectorRef, existing, allocate storiface.SectorFileType, sealing storiface.PathType, op storiface.AcquireMode) (storiface.SectorPaths, storiface.SectorPaths, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "AcquireSector", ctx, s, existing, allocate, sealing, op)
+ ret0, _ := ret[0].(storiface.SectorPaths)
+ ret1, _ := ret[1].(storiface.SectorPaths)
+ ret2, _ := ret[2].(error)
+ return ret0, ret1, ret2
+}
+
+// AcquireSector indicates an expected call of AcquireSector.
+func (mr *MockStoreMockRecorder) AcquireSector(ctx, s, existing, allocate, sealing, op interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcquireSector", reflect.TypeOf((*MockStore)(nil).AcquireSector), ctx, s, existing, allocate, sealing, op)
+}
+
+// FsStat mocks base method.
+func (m *MockStore) FsStat(ctx context.Context, id stores.ID) (fsutil.FsStat, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "FsStat", ctx, id)
+ ret0, _ := ret[0].(fsutil.FsStat)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// FsStat indicates an expected call of FsStat.
+func (mr *MockStoreMockRecorder) FsStat(ctx, id interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FsStat", reflect.TypeOf((*MockStore)(nil).FsStat), ctx, id)
+}
+
+// MoveStorage mocks base method.
+func (m *MockStore) MoveStorage(ctx context.Context, s storage.SectorRef, types storiface.SectorFileType) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MoveStorage", ctx, s, types)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// MoveStorage indicates an expected call of MoveStorage.
+func (mr *MockStoreMockRecorder) MoveStorage(ctx, s, types interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MoveStorage", reflect.TypeOf((*MockStore)(nil).MoveStorage), ctx, s, types)
+}
+
+// Remove mocks base method.
+func (m *MockStore) Remove(ctx context.Context, s abi.SectorID, types storiface.SectorFileType, force bool) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Remove", ctx, s, types, force)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// Remove indicates an expected call of Remove.
+func (mr *MockStoreMockRecorder) Remove(ctx, s, types, force interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Remove", reflect.TypeOf((*MockStore)(nil).Remove), ctx, s, types, force)
+}
+
+// RemoveCopies mocks base method.
+func (m *MockStore) RemoveCopies(ctx context.Context, s abi.SectorID, types storiface.SectorFileType) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "RemoveCopies", ctx, s, types)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// RemoveCopies indicates an expected call of RemoveCopies.
+func (mr *MockStoreMockRecorder) RemoveCopies(ctx, s, types interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveCopies", reflect.TypeOf((*MockStore)(nil).RemoveCopies), ctx, s, types)
+}
+
+// Reserve mocks base method.
+func (m *MockStore) Reserve(ctx context.Context, sid storage.SectorRef, ft storiface.SectorFileType, storageIDs storiface.SectorPaths, overheadTab map[storiface.SectorFileType]int) (func(), error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Reserve", ctx, sid, ft, storageIDs, overheadTab)
+ ret0, _ := ret[0].(func())
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// Reserve indicates an expected call of Reserve.
+func (mr *MockStoreMockRecorder) Reserve(ctx, sid, ft, storageIDs, overheadTab interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reserve", reflect.TypeOf((*MockStore)(nil).Reserve), ctx, sid, ft, storageIDs, overheadTab)
+}
diff --git a/extern/sector-storage/stores/remote.go b/extern/sector-storage/stores/remote.go
index 4388a2ffb..18e20ee37 100644
--- a/extern/sector-storage/stores/remote.go
+++ b/extern/sector-storage/stores/remote.go
@@ -3,6 +3,7 @@ package stores
import (
"context"
"encoding/json"
+ "fmt"
"io"
"io/ioutil"
"math/bits"
@@ -31,7 +32,7 @@ var FetchTempSubdir = "fetching"
var CopyBuf = 1 << 20
type Remote struct {
- local *Local
+ local Store
index SectorIndex
auth http.Header
@@ -39,6 +40,8 @@ type Remote struct {
fetchLk sync.Mutex
fetching map[abi.SectorID]chan struct{}
+
+ pfHandler partialFileHandler
}
func (r *Remote) RemoveCopies(ctx context.Context, s abi.SectorID, types storiface.SectorFileType) error {
@@ -49,7 +52,7 @@ func (r *Remote) RemoveCopies(ctx context.Context, s abi.SectorID, types storifa
return r.local.RemoveCopies(ctx, s, types)
}
-func NewRemote(local *Local, index SectorIndex, auth http.Header, fetchLimit int) *Remote {
+func NewRemote(local Store, index SectorIndex, auth http.Header, fetchLimit int, pfHandler partialFileHandler) *Remote {
return &Remote{
local: local,
index: index,
@@ -57,7 +60,8 @@ func NewRemote(local *Local, index SectorIndex, auth http.Header, fetchLimit int
limit: make(chan struct{}, fetchLimit),
- fetching: map[abi.SectorID]chan struct{}{},
+ fetching: map[abi.SectorID]chan struct{}{},
+ pfHandler: pfHandler,
}
}
@@ -415,4 +419,185 @@ func (r *Remote) FsStat(ctx context.Context, id ID) (fsutil.FsStat, error) {
return out, nil
}
+func (r *Remote) checkAllocated(ctx context.Context, url string, spt abi.RegisteredSealProof, offset, size abi.PaddedPieceSize) (bool, error) {
+ url = fmt.Sprintf("%s/%d/allocated/%d/%d", url, spt, offset.Unpadded(), size.Unpadded())
+ req, err := http.NewRequest("GET", url, nil)
+ if err != nil {
+ return false, xerrors.Errorf("request: %w", err)
+ }
+ req.Header = r.auth.Clone()
+ req = req.WithContext(ctx)
+
+ resp, err := http.DefaultClient.Do(req)
+ if err != nil {
+ return false, xerrors.Errorf("do request: %w", err)
+ }
+ defer resp.Body.Close() // nolint
+
+ switch resp.StatusCode {
+ case http.StatusOK:
+ return true, nil
+ case http.StatusRequestedRangeNotSatisfiable:
+ return false, nil
+ default:
+ return false, xerrors.Errorf("unexpected http response: %d", resp.StatusCode)
+ }
+}
+
+func (r *Remote) readRemote(ctx context.Context, url string, offset, size abi.PaddedPieceSize) (io.ReadCloser, error) {
+ if len(r.limit) >= cap(r.limit) {
+ log.Infof("Throttling remote read, %d already running", len(r.limit))
+ }
+
+ // TODO: Smarter throttling
+ // * Priority (just going sequentially is still pretty good)
+ // * Per interface
+ // * Aware of remote load
+ select {
+ case r.limit <- struct{}{}:
+ defer func() { <-r.limit }()
+ case <-ctx.Done():
+ return nil, xerrors.Errorf("context error while waiting for fetch limiter: %w", ctx.Err())
+ }
+
+ req, err := http.NewRequest("GET", url, nil)
+ if err != nil {
+ return nil, xerrors.Errorf("request: %w", err)
+ }
+
+ if r.auth != nil {
+ req.Header = r.auth.Clone()
+ }
+ req.Header.Set("Range", fmt.Sprintf("bytes=%d-%d", offset, offset+size-1))
+ req = req.WithContext(ctx)
+
+ resp, err := http.DefaultClient.Do(req)
+ if err != nil {
+ return nil, xerrors.Errorf("do request: %w", err)
+ }
+
+ if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusPartialContent {
+ resp.Body.Close() // nolint
+ return nil, xerrors.Errorf("non-200 code: %d", resp.StatusCode)
+ }
+
+ return resp.Body, nil
+}
+
+// Reader returns a reader for an unsealed piece at the given offset in the given sector.
+// If the Miner has the unsealed piece locally, it will return a reader that reads from the local copy.
+// If the Miner does NOT have the unsealed piece locally, it will query all workers that have the unsealed sector file
+// to know if they have the unsealed piece and will then read the unsealed piece data from a worker that has it.
+//
+// Returns a nil reader if :
+// 1. no worker(local worker included) has an unsealed file for the given sector OR
+// 2. no worker(local worker included) has the unsealed piece in their unsealed sector file.
+// Will return a nil reader and a nil error in such a case.
+func (r *Remote) Reader(ctx context.Context, s storage.SectorRef, offset, size abi.PaddedPieceSize) (io.ReadCloser, error) {
+ ft := storiface.FTUnsealed
+
+ // check if we have the unsealed sector file locally
+ paths, _, err := r.local.AcquireSector(ctx, s, ft, storiface.FTNone, storiface.PathStorage, storiface.AcquireMove)
+ if err != nil {
+ return nil, xerrors.Errorf("acquire local: %w", err)
+ }
+
+ path := storiface.PathByType(paths, ft)
+
+ if path != "" {
+ // if we have the unsealed file locally, return a reader that can be used to read the contents of the
+ // unsealed piece.
+ log.Infof("Read local %s (+%d,%d)", path, offset, size)
+ ssize, err := s.ProofType.SectorSize()
+ if err != nil {
+ return nil, err
+ }
+ log.Debugf("fetched sector size %s (+%d,%d)", path, offset, size)
+
+ // open the unsealed sector file for the given sector size located at the given path.
+ pf, err := r.pfHandler.OpenPartialFile(abi.PaddedPieceSize(ssize), path)
+ if err != nil {
+ return nil, xerrors.Errorf("opening partial file: %w", err)
+ }
+ log.Debugf("local partial file opened %s (+%d,%d)", path, offset, size)
+
+ // even though we have an unsealed file for the given sector, we still need to determine if we have the unsealed piece
+ // in the unsealed sector file. That is what `HasAllocated` checks for.
+ has, err := r.pfHandler.HasAllocated(pf, storiface.UnpaddedByteIndex(offset.Unpadded()), size.Unpadded())
+ if err != nil {
+ return nil, xerrors.Errorf("has allocated: %w", err)
+ }
+ log.Debugf("check if partial file is allocated %s (+%d,%d)", path, offset, size)
+
+ if !has {
+ log.Debugf("miner has unsealed file but not unseal piece, %s (+%d,%d)", path, offset, size)
+ if err := r.pfHandler.Close(pf); err != nil {
+ return nil, xerrors.Errorf("close partial file: %w", err)
+ }
+ return nil, nil
+ }
+
+ log.Infof("returning piece reader for local unsealed piece sector=%+v, (offset=%d, size=%d)", s.ID, offset, size)
+ return r.pfHandler.Reader(pf, storiface.PaddedByteIndex(offset), size)
+ }
+
+ // --- We don't have the unsealed sector file locally
+
+ // if we don't have the unsealed sector file locally, we'll first lookup the Miner Sector Store Index
+ // to determine which workers have the unsealed file and then query those workers to know
+ // if they have the unsealed piece in the unsealed sector file.
+ si, err := r.index.StorageFindSector(ctx, s.ID, ft, 0, false)
+ if err != nil {
+ log.Debugf("Reader, did not find unsealed file on any of the workers %s (+%d,%d)", path, offset, size)
+ return nil, err
+ }
+
+ if len(si) == 0 {
+ return nil, xerrors.Errorf("failed to read sector %v from remote(%d): %w", s, ft, storiface.ErrSectorNotFound)
+ }
+
+ sort.Slice(si, func(i, j int) bool {
+ return si[i].Weight > si[j].Weight
+ })
+
+ var lastErr error
+ for _, info := range si {
+ for _, url := range info.URLs {
+ // checkAllocated makes a JSON RPC query to a remote worker to determine if it has
+ // unsealed piece in their unsealed sector file.
+ ok, err := r.checkAllocated(ctx, url, s.ProofType, offset, size)
+ if err != nil {
+ log.Warnw("check if remote has piece", "url", url, "error", err)
+ lastErr = err
+ continue
+ }
+ if !ok {
+ continue
+ }
+
+ // readRemote fetches a reader that we can use to read the unsealed piece from the remote worker.
+ // It uses a ranged HTTP query to ensure we ONLY read the unsealed piece and not the entire unsealed file.
+ rd, err := r.readRemote(ctx, url, offset, size)
+ if err != nil {
+ log.Warnw("reading from remote", "url", url, "error", err)
+ lastErr = err
+ continue
+ }
+ log.Infof("Read remote %s (+%d,%d)", url, offset, size)
+ return rd, nil
+ }
+ }
+
+ // we couldn't find a unsealed file with the unsealed piece, will return a nil reader.
+ log.Debugf("returning nil reader, did not find unsealed piece for %+v (+%d,%d), last error=%s", s, offset, size, lastErr)
+ return nil, nil
+}
+
+func (r *Remote) Reserve(ctx context.Context, sid storage.SectorRef, ft storiface.SectorFileType, storageIDs storiface.SectorPaths, overheadTab map[storiface.SectorFileType]int) (func(), error) {
+ log.Warnf("reserve called on remote store, sectorID: %v", sid.ID)
+ return func() {
+
+ }, nil
+}
+
var _ Store = &Remote{}
diff --git a/extern/sector-storage/stores/remote_test.go b/extern/sector-storage/stores/remote_test.go
new file mode 100644
index 000000000..eb06a713d
--- /dev/null
+++ b/extern/sector-storage/stores/remote_test.go
@@ -0,0 +1,418 @@
+package stores_test
+
+import (
+ "context"
+ "fmt"
+ "io/ioutil"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "testing"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/extern/sector-storage/partialfile"
+ "github.com/filecoin-project/lotus/extern/sector-storage/stores"
+ "github.com/filecoin-project/lotus/extern/sector-storage/stores/mocks"
+ "github.com/filecoin-project/lotus/extern/sector-storage/storiface"
+ "github.com/filecoin-project/specs-storage/storage"
+ "github.com/golang/mock/gomock"
+ "github.com/gorilla/mux"
+ logging "github.com/ipfs/go-log/v2"
+ "github.com/stretchr/testify/require"
+ "golang.org/x/xerrors"
+)
+
+func TestReader(t *testing.T) {
+ logging.SetAllLoggers(logging.LevelDebug)
+ bz := []byte("Hello World")
+
+ pfPath := "path"
+ ft := storiface.FTUnsealed
+ emptyPartialFile := &partialfile.PartialFile{}
+
+ sectorRef := storage.SectorRef{
+ ID: abi.SectorID{
+ Miner: 123,
+ Number: 123,
+ },
+ ProofType: 1,
+ }
+ sectorSize := abi.SealProofInfos[1].SectorSize
+
+ offset := abi.PaddedPieceSize(100)
+ size := abi.PaddedPieceSize(1000)
+ ctx := context.Background()
+
+ tcs := map[string]struct {
+ storeFnc func(s *mocks.MockStore)
+ pfFunc func(s *mocks.MockpartialFileHandler)
+ indexFnc func(s *mocks.MockSectorIndex, serverURL string)
+
+ needHttpServer bool
+
+ getAllocatedReturnCode int
+ getSectorReturnCode int
+
+ serverUrl string
+
+ // expectation
+ errStr string
+ expectedNonNilReader bool
+ expectedSectorBytes []byte
+ }{
+
+ // -------- have the unsealed file locally
+ "fails when error while acquiring unsealed file": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, pfPath, xerrors.New("acquire error"))
+ },
+
+ errStr: "acquire error",
+ },
+
+ "fails when error while opening local partial (unsealed) file": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, pfPath, nil)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ mockPartialFileOpen(pf, sectorSize, pfPath, xerrors.New("pf open error"))
+ },
+ errStr: "pf open error",
+ },
+
+ "fails when error while checking if local unsealed file has piece": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, pfPath, nil)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ mockPartialFileOpen(pf, sectorSize, pfPath, nil)
+ mockCheckAllocation(pf, offset, size, emptyPartialFile,
+ true, xerrors.New("piece check error"))
+ },
+
+ errStr: "piece check error",
+ },
+
+ "fails when error while closing local unsealed file that does not have the piece": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, pfPath, nil)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ mockPartialFileOpen(pf, sectorSize, pfPath, nil)
+ mockCheckAllocation(pf, offset, size, emptyPartialFile,
+ false, nil)
+ pf.EXPECT().Close(emptyPartialFile).Return(xerrors.New("close error")).Times(1)
+ },
+ errStr: "close error",
+ },
+
+ "fails when error while fetching reader for the local unsealed file that has the unsealed piece": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, pfPath, nil)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ mockPartialFileOpen(pf, sectorSize, pfPath, nil)
+ mockCheckAllocation(pf, offset, size, emptyPartialFile,
+ true, nil)
+ mockPfReader(pf, emptyPartialFile, offset, size, nil, xerrors.New("reader error"))
+
+ },
+ errStr: "reader error",
+ },
+
+ // ------------------- don't have the unsealed file locally
+
+ "fails when error while finding sector": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, "", nil)
+ },
+
+ indexFnc: func(in *mocks.MockSectorIndex, _ string) {
+ in.EXPECT().StorageFindSector(gomock.Any(), sectorRef.ID, storiface.FTUnsealed, gomock.Any(),
+ false).Return(nil, xerrors.New("find sector error"))
+ },
+ errStr: "find sector error",
+ },
+
+ "fails when no worker has unsealed file": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, "", nil)
+ },
+
+ indexFnc: func(in *mocks.MockSectorIndex, _ string) {
+ in.EXPECT().StorageFindSector(gomock.Any(), sectorRef.ID, storiface.FTUnsealed, gomock.Any(),
+ false).Return(nil, nil)
+ },
+ errStr: storiface.ErrSectorNotFound.Error(),
+ },
+
+ // --- nil reader when local unsealed file does NOT have unsealed piece
+ "nil reader when local unsealed file does not have the piece": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, pfPath, nil)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ mockPartialFileOpen(pf, sectorSize, pfPath, nil)
+ mockCheckAllocation(pf, offset, size, emptyPartialFile,
+ false, nil)
+
+ pf.EXPECT().Close(emptyPartialFile).Return(nil).Times(1)
+ },
+ },
+
+ // ---- nil reader when none of the remote unsealed file has unsealed piece
+ "nil reader when none of the worker has the unsealed piece": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, "", nil)
+ },
+
+ indexFnc: func(in *mocks.MockSectorIndex, url string) {
+ si := stores.SectorStorageInfo{
+ URLs: []string{url},
+ }
+
+ in.EXPECT().StorageFindSector(gomock.Any(), sectorRef.ID, storiface.FTUnsealed, gomock.Any(),
+ false).Return([]stores.SectorStorageInfo{si}, nil).Times(1)
+ },
+
+ needHttpServer: true,
+ getAllocatedReturnCode: 500,
+ },
+
+ "nil reader when none of the worker is able to serve the unsealed piece even though they have it": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, "", nil)
+ },
+
+ indexFnc: func(in *mocks.MockSectorIndex, url string) {
+ si := stores.SectorStorageInfo{
+ URLs: []string{url},
+ }
+
+ in.EXPECT().StorageFindSector(gomock.Any(), sectorRef.ID, storiface.FTUnsealed, gomock.Any(),
+ false).Return([]stores.SectorStorageInfo{si}, nil).Times(1)
+ },
+
+ needHttpServer: true,
+ getSectorReturnCode: 500,
+ getAllocatedReturnCode: 200,
+ },
+
+ // ---- Success for local unsealed file
+ "successfully fetches reader for piece from local unsealed file": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, pfPath, nil)
+ },
+
+ pfFunc: func(pf *mocks.MockpartialFileHandler) {
+ mockPartialFileOpen(pf, sectorSize, pfPath, nil)
+ mockCheckAllocation(pf, offset, size, emptyPartialFile,
+ true, nil)
+
+ f, err := ioutil.TempFile("", "TestReader-")
+ require.NoError(t, err)
+ _, err = f.Write(bz)
+ require.NoError(t, err)
+ require.NoError(t, f.Close())
+ f, err = os.Open(f.Name())
+ require.NoError(t, err)
+
+ mockPfReader(pf, emptyPartialFile, offset, size, f, nil)
+
+ },
+
+ expectedNonNilReader: true,
+ expectedSectorBytes: bz,
+ },
+
+ // --- Success for remote unsealed file
+ "successfully fetches reader for piece from remote unsealed piece": {
+ storeFnc: func(l *mocks.MockStore) {
+ mockSectorAcquire(l, sectorRef, "", nil)
+ },
+
+ indexFnc: func(in *mocks.MockSectorIndex, url string) {
+ si := stores.SectorStorageInfo{
+ URLs: []string{url},
+ }
+
+ in.EXPECT().StorageFindSector(gomock.Any(), sectorRef.ID, storiface.FTUnsealed, gomock.Any(),
+ false).Return([]stores.SectorStorageInfo{si}, nil).Times(1)
+ },
+
+ needHttpServer: true,
+ getSectorReturnCode: 200,
+ getAllocatedReturnCode: 200,
+ expectedSectorBytes: bz,
+ expectedNonNilReader: true,
+ },
+ }
+
+ for name, tc := range tcs {
+ tc := tc
+ t.Run(name, func(t *testing.T) {
+ // create go mock controller here
+ mockCtrl := gomock.NewController(t)
+ // when test is done, assert expectations on all mock objects.
+ defer mockCtrl.Finish()
+
+ // create them mocks
+ lstore := mocks.NewMockStore(mockCtrl)
+ pfhandler := mocks.NewMockpartialFileHandler(mockCtrl)
+ index := mocks.NewMockSectorIndex(mockCtrl)
+
+ if tc.storeFnc != nil {
+ tc.storeFnc(lstore)
+ }
+ if tc.pfFunc != nil {
+ tc.pfFunc(pfhandler)
+ }
+
+ if tc.needHttpServer {
+ // run http server
+ ts := httptest.NewServer(&mockHttpServer{
+ expectedSectorName: storiface.SectorName(sectorRef.ID),
+ expectedFileType: ft.String(),
+ expectedOffset: fmt.Sprintf("%d", offset.Unpadded()),
+ expectedSize: fmt.Sprintf("%d", size.Unpadded()),
+ expectedSectorType: fmt.Sprintf("%d", sectorRef.ProofType),
+
+ getAllocatedReturnCode: tc.getAllocatedReturnCode,
+ getSectorReturnCode: tc.getSectorReturnCode,
+ getSectorBytes: tc.expectedSectorBytes,
+ })
+ defer ts.Close()
+ tc.serverUrl = fmt.Sprintf("%s/remote/%s/%s", ts.URL, ft.String(), storiface.SectorName(sectorRef.ID))
+ }
+ if tc.indexFnc != nil {
+ tc.indexFnc(index, tc.serverUrl)
+ }
+
+ remoteStore := stores.NewRemote(lstore, index, nil, 6000, pfhandler)
+
+ rd, err := remoteStore.Reader(ctx, sectorRef, offset, size)
+
+ if tc.errStr != "" {
+ require.Error(t, err)
+ require.Nil(t, rd)
+ require.Contains(t, err.Error(), tc.errStr)
+ } else {
+ require.NoError(t, err)
+ }
+
+ if !tc.expectedNonNilReader {
+ require.Nil(t, rd)
+ } else {
+ require.NotNil(t, rd)
+ defer func() {
+ require.NoError(t, rd.Close())
+ }()
+
+ if f, ok := rd.(*os.File); ok {
+ require.NoError(t, os.Remove(f.Name()))
+ }
+
+ bz, err := ioutil.ReadAll(rd)
+ require.NoError(t, err)
+ require.Equal(t, tc.expectedSectorBytes, bz)
+ }
+
+ })
+ }
+}
+
+func mockSectorAcquire(l *mocks.MockStore, sectorRef storage.SectorRef, pfPath string, err error) {
+ l.EXPECT().AcquireSector(gomock.Any(), sectorRef, storiface.FTUnsealed,
+ storiface.FTNone, storiface.PathStorage, storiface.AcquireMove).Return(storiface.SectorPaths{
+ Unsealed: pfPath,
+ },
+ storiface.SectorPaths{}, err).Times(1)
+}
+
+func mockPartialFileOpen(pf *mocks.MockpartialFileHandler, sectorSize abi.SectorSize, pfPath string, err error) {
+ pf.EXPECT().OpenPartialFile(abi.PaddedPieceSize(sectorSize), pfPath).Return(&partialfile.PartialFile{},
+ err).Times(1)
+}
+
+func mockCheckAllocation(pf *mocks.MockpartialFileHandler, offset, size abi.PaddedPieceSize, file *partialfile.PartialFile,
+ out bool, err error) {
+ pf.EXPECT().HasAllocated(file, storiface.UnpaddedByteIndex(offset.Unpadded()),
+ size.Unpadded()).Return(out, err).Times(1)
+}
+
+func mockPfReader(pf *mocks.MockpartialFileHandler, file *partialfile.PartialFile, offset, size abi.PaddedPieceSize,
+ outFile *os.File, err error) {
+ pf.EXPECT().Reader(file, storiface.PaddedByteIndex(offset), size).Return(outFile, err)
+}
+
+type mockHttpServer struct {
+ expectedSectorName string
+ expectedFileType string
+ expectedOffset string
+ expectedSize string
+ expectedSectorType string
+
+ getAllocatedReturnCode int
+ getSectorReturnCode int
+ getSectorBytes []byte
+}
+
+func (m *mockHttpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ mux := mux.NewRouter()
+ mux.HandleFunc("/remote/{type}/{id}", m.getSector).Methods("GET")
+ mux.HandleFunc("/remote/{type}/{id}/{spt}/allocated/{offset}/{size}", m.getAllocated).Methods("GET")
+ mux.ServeHTTP(w, r)
+}
+
+func (m *mockHttpServer) getAllocated(w http.ResponseWriter, r *http.Request) {
+ vars := mux.Vars(r)
+
+ if vars["id"] != m.expectedSectorName {
+ w.WriteHeader(http.StatusBadRequest)
+ return
+ }
+
+ if vars["type"] != m.expectedFileType {
+ w.WriteHeader(http.StatusBadRequest)
+ return
+ }
+
+ if vars["spt"] != m.expectedSectorType {
+ w.WriteHeader(http.StatusBadRequest)
+ return
+ }
+
+ if vars["offset"] != m.expectedOffset {
+ w.WriteHeader(http.StatusBadRequest)
+ return
+ }
+
+ if vars["size"] != m.expectedSize {
+ w.WriteHeader(http.StatusBadRequest)
+ return
+ }
+
+ w.WriteHeader(m.getAllocatedReturnCode)
+}
+
+func (m *mockHttpServer) getSector(w http.ResponseWriter, r *http.Request) {
+ vars := mux.Vars(r)
+
+ if vars["id"] != m.expectedSectorName {
+ w.WriteHeader(http.StatusBadRequest)
+ return
+ }
+
+ if vars["type"] != m.expectedFileType {
+ w.WriteHeader(http.StatusBadRequest)
+ return
+ }
+
+ w.WriteHeader(m.getSectorReturnCode)
+ _, _ = w.Write(m.getSectorBytes)
+}
diff --git a/extern/sector-storage/stores/util_unix.go b/extern/sector-storage/stores/util_unix.go
index 2b057468d..943681b49 100644
--- a/extern/sector-storage/stores/util_unix.go
+++ b/extern/sector-storage/stores/util_unix.go
@@ -2,8 +2,10 @@ package stores
import (
"bytes"
+ "os"
"os/exec"
"path/filepath"
+ "runtime"
"strings"
"github.com/mitchellh/go-homedir"
@@ -33,7 +35,18 @@ func move(from, to string) error {
// can do better
var errOut bytes.Buffer
- cmd := exec.Command("/usr/bin/env", "mv", "-t", toDir, from) // nolint
+
+ var cmd *exec.Cmd
+ if runtime.GOOS == "darwin" {
+ if err := os.MkdirAll(toDir, 0777); err != nil {
+ return xerrors.Errorf("failed exec MkdirAll: %s", err)
+ }
+
+ cmd = exec.Command("/usr/bin/env", "mv", from, toDir) // nolint
+ } else {
+ cmd = exec.Command("/usr/bin/env", "mv", "-t", toDir, from) // nolint
+ }
+
cmd.Stderr = &errOut
if err := cmd.Run(); err != nil {
return xerrors.Errorf("exec mv (stderr: %s): %w", strings.TrimSpace(errOut.String()), err)
diff --git a/extern/sector-storage/storiface/ffi.go b/extern/sector-storage/storiface/ffi.go
index f6b2cbdd3..2b6df667a 100644
--- a/extern/sector-storage/storiface/ffi.go
+++ b/extern/sector-storage/storiface/ffi.go
@@ -5,6 +5,7 @@ import (
"errors"
"github.com/ipfs/go-cid"
+ "golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
)
@@ -17,6 +18,14 @@ func (i UnpaddedByteIndex) Padded() PaddedByteIndex {
return PaddedByteIndex(abi.UnpaddedPieceSize(i).Padded())
}
+func (i UnpaddedByteIndex) Valid() error {
+ if i%127 != 0 {
+ return xerrors.Errorf("unpadded byte index must be a multiple of 127")
+ }
+
+ return nil
+}
+
type PaddedByteIndex uint64
type RGetter func(ctx context.Context, id abi.SectorID) (cid.Cid, error)
diff --git a/extern/sector-storage/storiface/filetype.go b/extern/sector-storage/storiface/filetype.go
index 3f7c7455e..2e0999022 100644
--- a/extern/sector-storage/storiface/filetype.go
+++ b/extern/sector-storage/storiface/filetype.go
@@ -73,6 +73,24 @@ func (t SectorFileType) SealSpaceUse(ssize abi.SectorSize) (uint64, error) {
return need, nil
}
+func (t SectorFileType) StoreSpaceUse(ssize abi.SectorSize) (uint64, error) {
+ var need uint64
+ for _, pathType := range PathTypes {
+ if !t.Has(pathType) {
+ continue
+ }
+
+ oh, ok := FsOverheadFinalized[pathType]
+ if !ok {
+ return 0, xerrors.Errorf("no finalized overhead info for %s", pathType)
+ }
+
+ need += uint64(oh) * uint64(ssize) / FSOverheadDen
+ }
+
+ return need, nil
+}
+
func (t SectorFileType) All() [FileTypes]bool {
var out [FileTypes]bool
diff --git a/extern/sector-storage/storiface/worker.go b/extern/sector-storage/storiface/worker.go
index 49d1de357..d3f4a2cd1 100644
--- a/extern/sector-storage/storiface/worker.go
+++ b/extern/sector-storage/storiface/worker.go
@@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
- "io"
"time"
"github.com/google/uuid"
@@ -87,7 +86,6 @@ type WorkerCalls interface {
ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (CallID, error)
MoveStorage(ctx context.Context, sector storage.SectorRef, types SectorFileType) (CallID, error)
UnsealPiece(context.Context, storage.SectorRef, UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (CallID, error)
- ReadPiece(context.Context, io.Writer, storage.SectorRef, UnpaddedByteIndex, abi.UnpaddedPieceSize) (CallID, error)
Fetch(context.Context, storage.SectorRef, SectorFileType, PathType, AcquireMode) (CallID, error)
}
diff --git a/extern/sector-storage/worker_local.go b/extern/sector-storage/worker_local.go
index abbad4d9c..2bb0f8300 100644
--- a/extern/sector-storage/worker_local.go
+++ b/extern/sector-storage/worker_local.go
@@ -161,7 +161,6 @@ const (
ReleaseUnsealed ReturnType = "ReleaseUnsealed"
MoveStorage ReturnType = "MoveStorage"
UnsealPiece ReturnType = "UnsealPiece"
- ReadPiece ReturnType = "ReadPiece"
Fetch ReturnType = "Fetch"
)
@@ -209,7 +208,6 @@ var returnFunc = map[ReturnType]func(context.Context, storiface.CallID, storifac
ReleaseUnsealed: rfunc(storiface.WorkerReturn.ReturnReleaseUnsealed),
MoveStorage: rfunc(storiface.WorkerReturn.ReturnMoveStorage),
UnsealPiece: rfunc(storiface.WorkerReturn.ReturnUnsealPiece),
- ReadPiece: rfunc(storiface.WorkerReturn.ReturnReadPiece),
Fetch: rfunc(storiface.WorkerReturn.ReturnFetch),
}
@@ -430,6 +428,7 @@ func (l *LocalWorker) UnsealPiece(ctx context.Context, sector storage.SectorRef,
}
return l.asyncCall(ctx, sector, UnsealPiece, func(ctx context.Context, ci storiface.CallID) (interface{}, error) {
+ log.Debugf("worker will unseal piece now, sector=%+v", sector.ID)
if err = sb.UnsealPiece(ctx, sector, index, size, randomness, cid); err != nil {
return nil, xerrors.Errorf("unsealing sector: %w", err)
}
@@ -442,21 +441,12 @@ func (l *LocalWorker) UnsealPiece(ctx context.Context, sector storage.SectorRef,
return nil, xerrors.Errorf("removing source data: %w", err)
}
+ log.Debugf("worker has unsealed piece, sector=%+v", sector.ID)
+
return nil, nil
})
}
-func (l *LocalWorker) ReadPiece(ctx context.Context, writer io.Writer, sector storage.SectorRef, index storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (storiface.CallID, error) {
- sb, err := l.executor()
- if err != nil {
- return storiface.UndefCall, err
- }
-
- return l.asyncCall(ctx, sector, ReadPiece, func(ctx context.Context, ci storiface.CallID) (interface{}, error) {
- return sb.ReadPiece(ctx, writer, sector, index, size)
- })
-}
-
func (l *LocalWorker) TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) {
l.taskLk.Lock()
defer l.taskLk.Unlock()
diff --git a/extern/sector-storage/worker_tracked.go b/extern/sector-storage/worker_tracked.go
index aeb3eea74..2160dd8e6 100644
--- a/extern/sector-storage/worker_tracked.go
+++ b/extern/sector-storage/worker_tracked.go
@@ -2,7 +2,6 @@ package sectorstorage
import (
"context"
- "io"
"sync"
"time"
@@ -156,8 +155,4 @@ func (t *trackedWorker) UnsealPiece(ctx context.Context, id storage.SectorRef, i
return t.tracker.track(ctx, t.wid, t.workerInfo, id, sealtasks.TTUnseal)(t.Worker.UnsealPiece(ctx, id, index, size, randomness, cid))
}
-func (t *trackedWorker) ReadPiece(ctx context.Context, writer io.Writer, id storage.SectorRef, index storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (storiface.CallID, error) {
- return t.tracker.track(ctx, t.wid, t.workerInfo, id, sealtasks.TTReadUnsealed)(t.Worker.ReadPiece(ctx, writer, id, index, size))
-}
-
var _ Worker = &trackedWorker{}
diff --git a/extern/storage-sealing/commit_batch.go b/extern/storage-sealing/commit_batch.go
index 819cb7fc7..61553601a 100644
--- a/extern/storage-sealing/commit_batch.go
+++ b/extern/storage-sealing/commit_batch.go
@@ -246,6 +246,8 @@ func (b *CommitBatcher) processBatch(cfg sealiface.Config) ([]sealiface.CommitBa
break
}
+ res.Sectors = append(res.Sectors, id)
+
sc, err := b.getSectorCollateral(id, tok)
if err != nil {
res.FailedSectors[id] = err.Error()
@@ -254,7 +256,6 @@ func (b *CommitBatcher) processBatch(cfg sealiface.Config) ([]sealiface.CommitBa
collateral = big.Add(collateral, sc)
- res.Sectors = append(res.Sectors, id)
params.SectorNumbers.Set(uint64(id))
infos = append(infos, p.info)
}
diff --git a/extern/storage-sealing/currentdealinfo.go b/extern/storage-sealing/currentdealinfo.go
index 105a42d1e..44fa68b54 100644
--- a/extern/storage-sealing/currentdealinfo.go
+++ b/extern/storage-sealing/currentdealinfo.go
@@ -160,7 +160,7 @@ type CurrentDealInfoTskAPI interface {
ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error)
StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error)
- StateSearchMsg(context.Context, cid.Cid) (*api.MsgLookup, error)
+ StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
}
type CurrentDealInfoAPIAdapter struct {
@@ -186,7 +186,7 @@ func (c *CurrentDealInfoAPIAdapter) StateMarketStorageDeal(ctx context.Context,
}
func (c *CurrentDealInfoAPIAdapter) StateSearchMsg(ctx context.Context, k cid.Cid) (*MsgLookup, error) {
- wmsg, err := c.CurrentDealInfoTskAPI.StateSearchMsg(ctx, k)
+ wmsg, err := c.CurrentDealInfoTskAPI.StateSearchMsg(ctx, types.EmptyTSK, k, api.LookbackNoLimit, true)
if err != nil {
return nil, err
}
diff --git a/extern/storage-sealing/fsm.go b/extern/storage-sealing/fsm.go
index a765d2617..e899701cc 100644
--- a/extern/storage-sealing/fsm.go
+++ b/extern/storage-sealing/fsm.go
@@ -51,6 +51,7 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto
AddPiece: planOne(
on(SectorPieceAdded{}, WaitDeals),
apply(SectorStartPacking{}),
+ apply(SectorAddPiece{}),
on(SectorAddPieceFailed{}, AddPieceFailed),
),
Packing: planOne(on(SectorPacked{}, GetTicket)),
@@ -224,6 +225,8 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto
func (m *Sealing) logEvents(events []statemachine.Event, state *SectorInfo) {
for _, event := range events {
+ log.Debugw("sector event", "sector", state.SectorNumber, "type", fmt.Sprintf("%T", event.User), "event", event.User)
+
e, err := json.Marshal(event)
if err != nil {
log.Errorf("marshaling event for logging: %+v", err)
@@ -234,6 +237,10 @@ func (m *Sealing) logEvents(events []statemachine.Event, state *SectorInfo) {
continue // don't log on every fsm restart
}
+ if len(e) > 8000 {
+ e = []byte(string(e[:8000]) + "... truncated")
+ }
+
l := Log{
Timestamp: uint64(time.Now().Unix()),
Message: string(e),
@@ -453,15 +460,16 @@ func (m *Sealing) onUpdateSector(ctx context.Context, state *SectorInfo) error {
if err != nil {
return xerrors.Errorf("getting config: %w", err)
}
- sp, err := m.currentSealProof(ctx)
- if err != nil {
- return xerrors.Errorf("getting seal proof type: %w", err)
- }
shouldUpdateInput := m.stats.updateSector(cfg, m.minerSectorID(state.SectorNumber), state.State)
// trigger more input processing when we've dipped below max sealing limits
if shouldUpdateInput {
+ sp, err := m.currentSealProof(ctx)
+ if err != nil {
+ return xerrors.Errorf("getting seal proof type: %w", err)
+ }
+
go func() {
m.inputLk.Lock()
defer m.inputLk.Unlock()
@@ -579,6 +587,7 @@ func onReturning(mut mutator) func() (mutator, func(*SectorInfo) (bool, error))
func planOne(ts ...func() (mut mutator, next func(*SectorInfo) (more bool, err error))) func(events []statemachine.Event, state *SectorInfo) (uint64, error) {
return func(events []statemachine.Event, state *SectorInfo) (uint64, error) {
+ eloop:
for i, event := range events {
if gm, ok := event.User.(globalMutator); ok {
gm.applyGlobal(state)
@@ -601,6 +610,8 @@ func planOne(ts ...func() (mut mutator, next func(*SectorInfo) (more bool, err e
if err != nil || !more {
return uint64(i + 1), err
}
+
+ continue eloop
}
_, ok := event.User.(Ignorable)
diff --git a/extern/storage-sealing/fsm_test.go b/extern/storage-sealing/fsm_test.go
index 644ddedb4..f269bb96c 100644
--- a/extern/storage-sealing/fsm_test.go
+++ b/extern/storage-sealing/fsm_test.go
@@ -277,3 +277,43 @@ func TestBrokenState(t *testing.T) {
}
}
}
+
+func TestTicketExpired(t *testing.T) {
+ var notif []struct{ before, after SectorInfo }
+ ma, _ := address.NewIDAddress(55151)
+ m := test{
+ s: &Sealing{
+ maddr: ma,
+ stats: SectorStats{
+ bySector: map[abi.SectorID]statSectorState{},
+ },
+ notifee: func(before, after SectorInfo) {
+ notif = append(notif, struct{ before, after SectorInfo }{before, after})
+ },
+ },
+ t: t,
+ state: &SectorInfo{State: Packing},
+ }
+
+ m.planSingle(SectorPacked{})
+ require.Equal(m.t, m.state.State, GetTicket)
+
+ m.planSingle(SectorTicket{})
+ require.Equal(m.t, m.state.State, PreCommit1)
+
+ expired := checkTicketExpired(0, MaxTicketAge+1)
+ require.True(t, expired)
+
+ m.planSingle(SectorOldTicket{})
+ require.Equal(m.t, m.state.State, GetTicket)
+
+ expected := []SectorState{Packing, GetTicket, PreCommit1, GetTicket}
+ for i, n := range notif {
+ if n.before.State != expected[i] {
+ t.Fatalf("expected before state: %s, got: %s", expected[i], n.before.State)
+ }
+ if n.after.State != expected[i+1] {
+ t.Fatalf("expected after state: %s, got: %s", expected[i+1], n.after.State)
+ }
+ }
+}
diff --git a/extern/storage-sealing/input.go b/extern/storage-sealing/input.go
index 44d2e8275..bf66382d3 100644
--- a/extern/storage-sealing/input.go
+++ b/extern/storage-sealing/input.go
@@ -27,6 +27,18 @@ func (m *Sealing) handleWaitDeals(ctx statemachine.Context, sector SectorInfo) e
m.inputLk.Lock()
+ if m.creating != nil && *m.creating == sector.SectorNumber {
+ m.creating = nil
+ }
+
+ sid := m.minerSectorID(sector.SectorNumber)
+
+ if len(m.assignedPieces[sid]) > 0 {
+ m.inputLk.Unlock()
+ // got assigned more pieces in the AddPiece state
+ return ctx.Send(SectorAddPiece{})
+ }
+
started, err := m.maybeStartSealing(ctx, sector, used)
if err != nil || started {
delete(m.openSectors, m.minerSectorID(sector.SectorNumber))
@@ -36,16 +48,16 @@ func (m *Sealing) handleWaitDeals(ctx statemachine.Context, sector SectorInfo) e
return err
}
- m.openSectors[m.minerSectorID(sector.SectorNumber)] = &openSector{
- used: used,
- maybeAccept: func(cid cid.Cid) error {
- // todo check deal start deadline (configurable)
+ if _, has := m.openSectors[sid]; !has {
+ m.openSectors[sid] = &openSector{
+ used: used,
+ maybeAccept: func(cid cid.Cid) error {
+ // todo check deal start deadline (configurable)
+ m.assignedPieces[sid] = append(m.assignedPieces[sid], cid)
- sid := m.minerSectorID(sector.SectorNumber)
- m.assignedPieces[sid] = append(m.assignedPieces[sid], cid)
-
- return ctx.Send(SectorAddPiece{})
- },
+ return ctx.Send(SectorAddPiece{})
+ },
+ }
}
go func() {
@@ -350,11 +362,19 @@ func (m *Sealing) updateInput(ctx context.Context, sp abi.RegisteredSealProof) e
continue
}
+ avail := abi.PaddedPieceSize(ssize).Unpadded() - m.openSectors[mt.sector].used
+
+ if mt.size > avail {
+ continue
+ }
+
err := m.openSectors[mt.sector].maybeAccept(mt.deal)
if err != nil {
m.pendingPieces[mt.deal].accepted(mt.sector.Number, 0, err) // non-error case in handleAddPiece
}
+ m.openSectors[mt.sector].used += mt.padding + mt.size
+
m.pendingPieces[mt.deal].assigned = true
delete(toAssign, mt.deal)
@@ -362,8 +382,6 @@ func (m *Sealing) updateInput(ctx context.Context, sp abi.RegisteredSealProof) e
log.Errorf("sector %d rejected deal %s: %+v", mt.sector, mt.deal, err)
continue
}
-
- delete(m.openSectors, mt.sector)
}
if len(toAssign) > 0 {
@@ -376,6 +394,10 @@ func (m *Sealing) updateInput(ctx context.Context, sp abi.RegisteredSealProof) e
}
func (m *Sealing) tryCreateDealSector(ctx context.Context, sp abi.RegisteredSealProof) error {
+ if m.creating != nil {
+ return nil // new sector is being created right now
+ }
+
cfg, err := m.getConfig()
if err != nil {
return xerrors.Errorf("getting storage config: %w", err)
@@ -394,6 +416,8 @@ func (m *Sealing) tryCreateDealSector(ctx context.Context, sp abi.RegisteredSeal
return err
}
+ m.creating = &sid
+
log.Infow("Creating sector", "number", sid, "type", "deal", "proofType", sp)
return m.sectors.Send(uint64(sid), SectorStart{
ID: sid,
@@ -422,6 +446,7 @@ func (m *Sealing) createSector(ctx context.Context, cfg sealiface.Config, sp abi
}
func (m *Sealing) StartPacking(sid abi.SectorNumber) error {
+ log.Infow("starting to seal deal sector", "sector", sid, "trigger", "user")
return m.sectors.Send(uint64(sid), SectorStartPacking{})
}
diff --git a/extern/storage-sealing/precommit_policy.go b/extern/storage-sealing/precommit_policy.go
index 0b774b56f..a6add5693 100644
--- a/extern/storage-sealing/precommit_policy.go
+++ b/extern/storage-sealing/precommit_policy.go
@@ -40,7 +40,10 @@ type BasicPreCommitPolicy struct {
duration abi.ChainEpoch
}
-// NewBasicPreCommitPolicy produces a BasicPreCommitPolicy
+// NewBasicPreCommitPolicy produces a BasicPreCommitPolicy.
+//
+// The provided duration is used as the default sector expiry when the sector
+// contains no deals. The proving boundary is used to adjust/align the sector's expiration.
func NewBasicPreCommitPolicy(api Chain, duration abi.ChainEpoch, provingBoundary abi.ChainEpoch) BasicPreCommitPolicy {
return BasicPreCommitPolicy{
api: api,
diff --git a/extern/storage-sealing/sealing.go b/extern/storage-sealing/sealing.go
index cfe4b9f90..2d53223db 100644
--- a/extern/storage-sealing/sealing.go
+++ b/extern/storage-sealing/sealing.go
@@ -96,6 +96,7 @@ type Sealing struct {
sectorTimers map[abi.SectorID]*time.Timer
pendingPieces map[cid.Cid]*pendingPiece
assignedPieces map[abi.SectorID][]cid.Cid
+ creating *abi.SectorNumber // used to prevent a race where we could create a new sector more than once
upgradeLk sync.Mutex
toUpgrade map[abi.SectorNumber]struct{}
diff --git a/extern/storage-sealing/states_sealing.go b/extern/storage-sealing/states_sealing.go
index 4f0f1dc80..d0af7118c 100644
--- a/extern/storage-sealing/states_sealing.go
+++ b/extern/storage-sealing/states_sealing.go
@@ -37,7 +37,7 @@ func (m *Sealing) handlePacking(ctx statemachine.Context, sector SectorInfo) err
}
// todo: return to the sealing queue (this is extremely unlikely to happen)
- pp.accepted(sector.SectorNumber, 0, xerrors.Errorf("sector entered packing state early"))
+ pp.accepted(sector.SectorNumber, 0, xerrors.Errorf("sector %d entered packing state early", sector.SectorNumber))
}
delete(m.openSectors, m.minerSectorID(sector.SectorNumber))
@@ -101,8 +101,8 @@ func (m *Sealing) padSector(ctx context.Context, sectorID storage.SectorRef, exi
return out, nil
}
-func checkTicketExpired(sector SectorInfo, epoch abi.ChainEpoch) bool {
- return epoch-sector.TicketEpoch > MaxTicketAge // TODO: allow configuring expected seal durations
+func checkTicketExpired(ticket, head abi.ChainEpoch) bool {
+ return head-ticket > MaxTicketAge // TODO: allow configuring expected seal durations
}
func (m *Sealing) getTicket(ctx statemachine.Context, sector SectorInfo) (abi.SealRandomness, abi.ChainEpoch, error) {
@@ -126,7 +126,7 @@ func (m *Sealing) getTicket(ctx statemachine.Context, sector SectorInfo) (abi.Se
if pci != nil {
ticketEpoch = pci.Info.SealRandEpoch
- if checkTicketExpired(sector, ticketEpoch) {
+ if checkTicketExpired(ticketEpoch, epoch) {
return nil, 0, xerrors.Errorf("ticket expired for precommitted sector")
}
}
@@ -188,7 +188,7 @@ func (m *Sealing) handlePreCommit1(ctx statemachine.Context, sector SectorInfo)
return nil
}
- if checkTicketExpired(sector, height) {
+ if checkTicketExpired(sector.TicketEpoch, height) {
return ctx.Send(SectorOldTicket{}) // go get new ticket
}
diff --git a/gateway/handler.go b/gateway/handler.go
new file mode 100644
index 000000000..3273c66db
--- /dev/null
+++ b/gateway/handler.go
@@ -0,0 +1,48 @@
+package gateway
+
+import (
+ "net/http"
+
+ "contrib.go.opencensus.io/exporter/prometheus"
+ "github.com/filecoin-project/go-jsonrpc"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
+ "github.com/filecoin-project/lotus/api/v1api"
+ "github.com/filecoin-project/lotus/metrics"
+ "github.com/gorilla/mux"
+ promclient "github.com/prometheus/client_golang/prometheus"
+)
+
+// Handler returns a gateway http.Handler, to be mounted as-is on the server.
+func Handler(a api.Gateway, opts ...jsonrpc.ServerOption) (http.Handler, error) {
+ m := mux.NewRouter()
+
+ serveRpc := func(path string, hnd interface{}) {
+ rpcServer := jsonrpc.NewServer(opts...)
+ rpcServer.Register("Filecoin", hnd)
+ m.Handle(path, rpcServer)
+ }
+
+ ma := metrics.MetricedGatewayAPI(a)
+
+ serveRpc("/rpc/v1", ma)
+ serveRpc("/rpc/v0", api.Wrap(new(v1api.FullNodeStruct), new(v0api.WrapperV1Full), ma))
+
+ registry := promclient.DefaultRegisterer.(*promclient.Registry)
+ exporter, err := prometheus.NewExporter(prometheus.Options{
+ Registry: registry,
+ Namespace: "lotus_gw",
+ })
+ if err != nil {
+ return nil, err
+ }
+ m.Handle("/debug/metrics", exporter)
+ m.PathPrefix("/").Handler(http.DefaultServeMux)
+
+ /*ah := &auth.Handler{
+ Verify: nodeApi.AuthVerify,
+ Next: mux.ServeHTTP,
+ }*/
+
+ return m, nil
+}
diff --git a/gateway/node.go b/gateway/node.go
new file mode 100644
index 000000000..3c7a67196
--- /dev/null
+++ b/gateway/node.go
@@ -0,0 +1,424 @@
+package gateway
+
+import (
+ "context"
+ "fmt"
+ "time"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-bitfield"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/crypto"
+ "github.com/filecoin-project/go-state-types/dline"
+ "github.com/filecoin-project/go-state-types/network"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/lib/sigs"
+ _ "github.com/filecoin-project/lotus/lib/sigs/bls"
+ _ "github.com/filecoin-project/lotus/lib/sigs/secp"
+ "github.com/filecoin-project/lotus/node/impl/full"
+ "github.com/ipfs/go-cid"
+)
+
+const (
+ DefaultLookbackCap = time.Hour * 24
+ DefaultStateWaitLookbackLimit = abi.ChainEpoch(20)
+)
+
+// TargetAPI defines the API methods that the Node depends on
+// (to make it easy to mock for tests)
+type TargetAPI interface {
+ Version(context.Context) (api.APIVersion, error)
+ ChainGetBlockMessages(context.Context, cid.Cid) (*api.BlockMessages, error)
+ ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
+ ChainGetNode(ctx context.Context, p string) (*api.IpldObject, error)
+ ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
+ ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
+ ChainHasObj(context.Context, cid.Cid) (bool, error)
+ ChainHead(ctx context.Context) (*types.TipSet, error)
+ ChainNotify(context.Context) (<-chan []*api.HeadChange, error)
+ ChainReadObj(context.Context, cid.Cid) ([]byte, error)
+ GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
+ MpoolPushUntrusted(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
+ MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
+ MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
+ MsigGetPending(ctx context.Context, addr address.Address, ts types.TipSetKey) ([]*api.MsigTransaction, error)
+ StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
+ StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error)
+ StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
+ StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
+ StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
+ StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error)
+ StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error)
+ StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
+ StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
+ StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
+ StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*api.ActorState, error)
+ StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)
+ StateMinerFaults(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error)
+ StateMinerRecoveries(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error)
+ StateMinerInfo(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error)
+ StateMinerDeadlines(context.Context, address.Address, types.TipSetKey) ([]api.Deadline, error)
+ StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error)
+ StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error)
+ StateCirculatingSupply(context.Context, types.TipSetKey) (abi.TokenAmount, error)
+ StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
+ StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
+ StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (api.CirculatingSupply, error)
+ WalletBalance(context.Context, address.Address) (types.BigInt, error) //perm:read
+}
+
+var _ TargetAPI = *new(api.FullNode) // gateway depends on latest
+
+type Node struct {
+ target TargetAPI
+ lookbackCap time.Duration
+ stateWaitLookbackLimit abi.ChainEpoch
+ errLookback error
+}
+
+var (
+ _ api.Gateway = (*Node)(nil)
+ _ full.ChainModuleAPI = (*Node)(nil)
+ _ full.GasModuleAPI = (*Node)(nil)
+ _ full.MpoolModuleAPI = (*Node)(nil)
+ _ full.StateModuleAPI = (*Node)(nil)
+)
+
+// NewNode creates a new gateway node.
+func NewNode(api TargetAPI, lookbackCap time.Duration, stateWaitLookbackLimit abi.ChainEpoch) *Node {
+ return &Node{
+ target: api,
+ lookbackCap: lookbackCap,
+ stateWaitLookbackLimit: stateWaitLookbackLimit,
+ errLookback: fmt.Errorf("lookbacks of more than %s are disallowed", lookbackCap),
+ }
+}
+
+func (gw *Node) checkTipsetKey(ctx context.Context, tsk types.TipSetKey) error {
+ if tsk.IsEmpty() {
+ return nil
+ }
+
+ ts, err := gw.target.ChainGetTipSet(ctx, tsk)
+ if err != nil {
+ return err
+ }
+
+ return gw.checkTipset(ts)
+}
+
+func (gw *Node) checkTipset(ts *types.TipSet) error {
+ at := time.Unix(int64(ts.Blocks()[0].Timestamp), 0)
+ if err := gw.checkTimestamp(at); err != nil {
+ return fmt.Errorf("bad tipset: %w", err)
+ }
+ return nil
+}
+
+func (gw *Node) checkTipsetHeight(ts *types.TipSet, h abi.ChainEpoch) error {
+ tsBlock := ts.Blocks()[0]
+ heightDelta := time.Duration(uint64(tsBlock.Height-h)*build.BlockDelaySecs) * time.Second
+ timeAtHeight := time.Unix(int64(tsBlock.Timestamp), 0).Add(-heightDelta)
+
+ if err := gw.checkTimestamp(timeAtHeight); err != nil {
+ return fmt.Errorf("bad tipset height: %w", err)
+ }
+ return nil
+}
+
+func (gw *Node) checkTimestamp(at time.Time) error {
+ if time.Since(at) > gw.lookbackCap {
+ return gw.errLookback
+ }
+ return nil
+}
+
+func (gw *Node) Version(ctx context.Context) (api.APIVersion, error) {
+ return gw.target.Version(ctx)
+}
+
+func (gw *Node) ChainGetBlockMessages(ctx context.Context, c cid.Cid) (*api.BlockMessages, error) {
+ return gw.target.ChainGetBlockMessages(ctx, c)
+}
+
+func (gw *Node) ChainHasObj(ctx context.Context, c cid.Cid) (bool, error) {
+ return gw.target.ChainHasObj(ctx, c)
+}
+
+func (gw *Node) ChainHead(ctx context.Context) (*types.TipSet, error) {
+ // TODO: cache and invalidate cache when timestamp is up (or have internal ChainNotify)
+
+ return gw.target.ChainHead(ctx)
+}
+
+func (gw *Node) ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error) {
+ return gw.target.ChainGetMessage(ctx, mc)
+}
+
+func (gw *Node) ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) {
+ return gw.target.ChainGetTipSet(ctx, tsk)
+}
+
+func (gw *Node) ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) {
+ var ts *types.TipSet
+ if tsk.IsEmpty() {
+ head, err := gw.target.ChainHead(ctx)
+ if err != nil {
+ return nil, err
+ }
+ ts = head
+ } else {
+ gts, err := gw.target.ChainGetTipSet(ctx, tsk)
+ if err != nil {
+ return nil, err
+ }
+ ts = gts
+ }
+
+ // Check if the tipset key refers to gw tipset that's too far in the past
+ if err := gw.checkTipset(ts); err != nil {
+ return nil, err
+ }
+
+ // Check if the height is too far in the past
+ if err := gw.checkTipsetHeight(ts, h); err != nil {
+ return nil, err
+ }
+
+ return gw.target.ChainGetTipSetByHeight(ctx, h, tsk)
+}
+
+func (gw *Node) ChainGetNode(ctx context.Context, p string) (*api.IpldObject, error) {
+ return gw.target.ChainGetNode(ctx, p)
+}
+
+func (gw *Node) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, error) {
+ return gw.target.ChainNotify(ctx)
+}
+
+func (gw *Node) ChainReadObj(ctx context.Context, c cid.Cid) ([]byte, error) {
+ return gw.target.ChainReadObj(ctx, c)
+}
+
+func (gw *Node) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+
+ return gw.target.GasEstimateMessageGas(ctx, msg, spec, tsk)
+}
+
+func (gw *Node) MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error) {
+ // TODO: additional anti-spam checks
+ return gw.target.MpoolPushUntrusted(ctx, sm)
+}
+
+func (gw *Node) MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return types.NewInt(0), err
+ }
+
+ return gw.target.MsigGetAvailableBalance(ctx, addr, tsk)
+}
+
+func (gw *Node) MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error) {
+ if err := gw.checkTipsetKey(ctx, start); err != nil {
+ return types.NewInt(0), err
+ }
+ if err := gw.checkTipsetKey(ctx, end); err != nil {
+ return types.NewInt(0), err
+ }
+
+ return gw.target.MsigGetVested(ctx, addr, start, end)
+}
+
+func (gw *Node) MsigGetPending(ctx context.Context, addr address.Address, tsk types.TipSetKey) ([]*api.MsigTransaction, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+
+ return gw.target.MsigGetPending(ctx, addr, tsk)
+}
+
+func (gw *Node) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return address.Undef, err
+ }
+
+ return gw.target.StateAccountKey(ctx, addr, tsk)
+}
+
+func (gw *Node) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return api.DealCollateralBounds{}, err
+ }
+
+ return gw.target.StateDealProviderCollateralBounds(ctx, size, verified, tsk)
+}
+
+func (gw *Node) StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+
+ return gw.target.StateGetActor(ctx, actor, tsk)
+}
+
+func (gw *Node) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+
+ return gw.target.StateListMiners(ctx, tsk)
+}
+
+func (gw *Node) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return address.Undef, err
+ }
+
+ return gw.target.StateLookupID(ctx, addr, tsk)
+}
+
+func (gw *Node) StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return api.MarketBalance{}, err
+ }
+
+ return gw.target.StateMarketBalance(ctx, addr, tsk)
+}
+
+func (gw *Node) StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+
+ return gw.target.StateMarketStorageDeal(ctx, dealId, tsk)
+}
+
+func (gw *Node) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return network.VersionMax, err
+ }
+
+ return gw.target.StateNetworkVersion(ctx, tsk)
+}
+
+func (gw *Node) StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) {
+ if limit == api.LookbackNoLimit {
+ limit = gw.stateWaitLookbackLimit
+ }
+ if gw.stateWaitLookbackLimit != api.LookbackNoLimit && limit > gw.stateWaitLookbackLimit {
+ limit = gw.stateWaitLookbackLimit
+ }
+ if err := gw.checkTipsetKey(ctx, from); err != nil {
+ return nil, err
+ }
+
+ return gw.target.StateSearchMsg(ctx, from, msg, limit, allowReplaced)
+}
+
+func (gw *Node) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) {
+ if limit == api.LookbackNoLimit {
+ limit = gw.stateWaitLookbackLimit
+ }
+ if gw.stateWaitLookbackLimit != api.LookbackNoLimit && limit > gw.stateWaitLookbackLimit {
+ limit = gw.stateWaitLookbackLimit
+ }
+
+ return gw.target.StateWaitMsg(ctx, msg, confidence, limit, allowReplaced)
+}
+
+func (gw *Node) StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*api.ActorState, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+ return gw.target.StateReadState(ctx, actor, tsk)
+}
+
+func (gw *Node) StateMinerPower(ctx context.Context, m address.Address, tsk types.TipSetKey) (*api.MinerPower, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+ return gw.target.StateMinerPower(ctx, m, tsk)
+}
+
+func (gw *Node) StateMinerFaults(ctx context.Context, m address.Address, tsk types.TipSetKey) (bitfield.BitField, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return bitfield.BitField{}, err
+ }
+ return gw.target.StateMinerFaults(ctx, m, tsk)
+}
+func (gw *Node) StateMinerRecoveries(ctx context.Context, m address.Address, tsk types.TipSetKey) (bitfield.BitField, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return bitfield.BitField{}, err
+ }
+ return gw.target.StateMinerRecoveries(ctx, m, tsk)
+}
+
+func (gw *Node) StateMinerInfo(ctx context.Context, m address.Address, tsk types.TipSetKey) (miner.MinerInfo, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return miner.MinerInfo{}, err
+ }
+ return gw.target.StateMinerInfo(ctx, m, tsk)
+}
+
+func (gw *Node) StateMinerDeadlines(ctx context.Context, m address.Address, tsk types.TipSetKey) ([]api.Deadline, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+ return gw.target.StateMinerDeadlines(ctx, m, tsk)
+}
+
+func (gw *Node) StateMinerAvailableBalance(ctx context.Context, m address.Address, tsk types.TipSetKey) (types.BigInt, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return types.BigInt{}, err
+ }
+ return gw.target.StateMinerAvailableBalance(ctx, m, tsk)
+}
+
+func (gw *Node) StateMinerProvingDeadline(ctx context.Context, m address.Address, tsk types.TipSetKey) (*dline.Info, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+ return gw.target.StateMinerProvingDeadline(ctx, m, tsk)
+}
+
+func (gw *Node) StateCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (abi.TokenAmount, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return types.BigInt{}, err
+ }
+ return gw.target.StateCirculatingSupply(ctx, tsk)
+}
+
+func (gw *Node) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+ return gw.target.StateSectorGetInfo(ctx, maddr, n, tsk)
+}
+
+func (gw *Node) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return nil, err
+ }
+ return gw.target.StateVerifiedClientStatus(ctx, addr, tsk)
+}
+
+func (gw *Node) StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) {
+ if err := gw.checkTipsetKey(ctx, tsk); err != nil {
+ return api.CirculatingSupply{}, err
+ }
+ return gw.target.StateVMCirculatingSupplyInternal(ctx, tsk)
+}
+
+func (gw *Node) WalletVerify(ctx context.Context, k address.Address, msg []byte, sig *crypto.Signature) (bool, error) {
+ return sigs.Verify(sig, k, msg) == nil, nil
+}
+
+func (gw *Node) WalletBalance(ctx context.Context, k address.Address) (types.BigInt, error) {
+ return gw.target.WalletBalance(ctx, k)
+}
diff --git a/cmd/lotus-gateway/api_test.go b/gateway/node_test.go
similarity index 96%
rename from cmd/lotus-gateway/api_test.go
rename to gateway/node_test.go
index 23d2cbf3a..0d33daa35 100644
--- a/cmd/lotus-gateway/api_test.go
+++ b/gateway/node_test.go
@@ -1,4 +1,4 @@
-package main
+package gateway
import (
"context"
@@ -6,26 +6,24 @@ import (
"testing"
"time"
- "github.com/filecoin-project/go-state-types/network"
- "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
-
- "github.com/filecoin-project/lotus/build"
-
+ "github.com/ipfs/go-cid"
"github.com/stretchr/testify/require"
- "github.com/filecoin-project/lotus/chain/types/mock"
-
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/network"
+
"github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
- "github.com/ipfs/go-cid"
+ "github.com/filecoin-project/lotus/chain/types/mock"
)
func TestGatewayAPIChainGetTipSetByHeight(t *testing.T) {
ctx := context.Background()
- lookbackTimestamp := uint64(time.Now().Unix()) - uint64(LookbackCap.Seconds())
+ lookbackTimestamp := uint64(time.Now().Unix()) - uint64(DefaultLookbackCap.Seconds())
type args struct {
h abi.ChainEpoch
tskh abi.ChainEpoch
@@ -91,7 +89,7 @@ func TestGatewayAPIChainGetTipSetByHeight(t *testing.T) {
tt := tt
t.Run(tt.name, func(t *testing.T) {
mock := &mockGatewayDepsAPI{}
- a := NewGatewayAPI(mock)
+ a := NewNode(mock, DefaultLookbackCap, DefaultStateWaitLookbackLimit)
// Create tipsets from genesis up to tskh and return the highest
ts := mock.createTipSets(tt.args.tskh, tt.args.genesisTS)
@@ -111,7 +109,7 @@ type mockGatewayDepsAPI struct {
lk sync.RWMutex
tipsets []*types.TipSet
- gatewayDepsAPI // satisfies all interface requirements but will panic if
+ TargetAPI // satisfies all interface requirements but will panic if
// methods are called. easier than filling out with panic stubs IMO
}
diff --git a/gen/api/proxygen.go b/gen/api/proxygen.go
index 42aed0965..71c2f414d 100644
--- a/gen/api/proxygen.go
+++ b/gen/api/proxygen.go
@@ -52,40 +52,47 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor {
return v
}
+
func main() {
- if err := runMain(); err != nil {
+ // latest (v1)
+ if err := generate("./api", "api", "api", "./api/proxy_gen.go"); err != nil {
+ fmt.Println("error: ", err)
+ }
+
+ // v0
+ if err := generate("./api/v0api", "v0api", "v0api", "./api/v0api/proxy_gen.go"); err != nil {
fmt.Println("error: ", err)
}
}
-func typeName(e ast.Expr) (string, error) {
+func typeName(e ast.Expr, pkg string) (string, error) {
switch t := e.(type) {
case *ast.SelectorExpr:
return t.X.(*ast.Ident).Name + "." + t.Sel.Name, nil
case *ast.Ident:
pstr := t.Name
- if !unicode.IsLower(rune(pstr[0])) {
+ if !unicode.IsLower(rune(pstr[0])) && pkg != "api" {
pstr = "api." + pstr // todo src pkg name
}
return pstr, nil
case *ast.ArrayType:
- subt, err := typeName(t.Elt)
+ subt, err := typeName(t.Elt, pkg)
if err != nil {
return "", err
}
return "[]" + subt, nil
case *ast.StarExpr:
- subt, err := typeName(t.X)
+ subt, err := typeName(t.X, pkg)
if err != nil {
return "", err
}
return "*" + subt, nil
case *ast.MapType:
- k, err := typeName(t.Key)
+ k, err := typeName(t.Key, pkg)
if err != nil {
return "", err
}
- v, err := typeName(t.Value)
+ v, err := typeName(t.Value, pkg)
if err != nil {
return "", err
}
@@ -101,7 +108,7 @@ func typeName(e ast.Expr) (string, error) {
}
return "interface{}", nil
case *ast.ChanType:
- subt, err := typeName(t.Value)
+ subt, err := typeName(t.Value, pkg)
if err != nil {
return "", err
}
@@ -116,9 +123,13 @@ func typeName(e ast.Expr) (string, error) {
}
}
-func runMain() error {
+func generate(path, pkg, outpkg, outfile string) error {
fset := token.NewFileSet()
- apiDir, err := filepath.Abs("./api")
+ apiDir, err := filepath.Abs(path)
+ if err != nil {
+ return err
+ }
+ outfile, err = filepath.Abs(outfile)
if err != nil {
return err
}
@@ -127,16 +138,16 @@ func runMain() error {
return err
}
- ap := pkgs["api"]
+ ap := pkgs[pkg]
v := &Visitor{make(map[string]map[string]*methodMeta), map[string][]string{}}
ast.Walk(v, ap)
type methodInfo struct {
- Name string
- node ast.Node
- Tags map[string][]string
- NamedParams, ParamNames, Results string
+ Name string
+ node ast.Node
+ Tags map[string][]string
+ NamedParams, ParamNames, Results, DefRes string
}
type strinfo struct {
@@ -148,9 +159,11 @@ func runMain() error {
type meta struct {
Infos map[string]*strinfo
Imports map[string]string
+ OutPkg string
}
m := &meta{
+ OutPkg: outpkg,
Infos: map[string]*strinfo{},
Imports: map[string]string{},
}
@@ -165,6 +178,9 @@ func runMain() error {
for _, im := range f.Imports {
m.Imports[im.Path.Value] = im.Path.Value
+ if im.Name != nil {
+ m.Imports[im.Path.Value] = im.Name.Name + " " + m.Imports[im.Path.Value]
+ }
}
for ifname, methods := range v.Methods {
@@ -182,7 +198,7 @@ func runMain() error {
if _, ok := info.Methods[mname]; !ok {
var params, pnames []string
for _, param := range node.ftype.Params.List {
- pstr, err := typeName(param.Type)
+ pstr, err := typeName(param.Type, outpkg)
if err != nil {
return err
}
@@ -199,15 +215,33 @@ func runMain() error {
}
}
- var results []string
+ results := []string{}
for _, result := range node.ftype.Results.List {
- rs, err := typeName(result.Type)
+ rs, err := typeName(result.Type, outpkg)
if err != nil {
return err
}
results = append(results, rs)
}
+ defRes := ""
+ if len(results) > 1 {
+ defRes = results[0]
+ switch {
+ case defRes[0] == '*' || defRes[0] == '<', defRes == "interface{}":
+ defRes = "nil"
+ case defRes == "bool":
+ defRes = "false"
+ case defRes == "string":
+ defRes = `""`
+ case defRes == "int", defRes == "int64", defRes == "uint64", defRes == "uint":
+ defRes = "0"
+ default:
+ defRes = "*new(" + defRes + ")"
+ }
+ defRes += ", "
+ }
+
info.Methods[mname] = &methodInfo{
Name: mname,
node: node.node,
@@ -215,6 +249,7 @@ func runMain() error {
NamedParams: strings.Join(params, ", "),
ParamNames: strings.Join(pnames, ", "),
Results: strings.Join(results, ", "),
+ DefRes: defRes,
}
}
@@ -244,14 +279,17 @@ func runMain() error {
}
fmt.Println(string(jb))*/
- w := os.Stdout
+ w, err := os.OpenFile(outfile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0666)
+ if err != nil {
+ return err
+ }
err = doTemplate(w, m, `// Code generated by github.com/filecoin-project/lotus/gen/api. DO NOT EDIT.
-package apistruct
+package {{.OutPkg}}
import (
-{{range .Imports}}{{.}}
+{{range .Imports}} {{.}}
{{end}}
)
`)
@@ -271,6 +309,12 @@ type {{.Name}}Struct struct {
{{end}}
}
}
+
+type {{.Name}}Stub struct {
+{{range .Include}}
+ {{.}}Stub
+{{end}}
+}
{{end}}
{{range .Infos}}
@@ -279,10 +323,14 @@ type {{.Name}}Struct struct {
func (s *{{$name}}Struct) {{.Name}}({{.NamedParams}}) ({{.Results}}) {
return s.Internal.{{.Name}}({{.ParamNames}})
}
+
+func (s *{{$name}}Stub) {{.Name}}({{.NamedParams}}) ({{.Results}}) {
+ return {{.DefRes}}xerrors.New("method not supported")
+}
{{end}}
{{end}}
-{{range .Infos}}var _ api.{{.Name}} = new({{.Name}}Struct)
+{{range .Infos}}var _ {{.Name}} = new({{.Name}}Struct)
{{end}}
`)
diff --git a/genesis/types.go b/genesis/types.go
index db8d32a3b..d4c04113a 100644
--- a/genesis/types.go
+++ b/genesis/types.go
@@ -3,6 +3,8 @@ package genesis
import (
"encoding/json"
+ "github.com/filecoin-project/go-state-types/network"
+
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
@@ -75,8 +77,9 @@ type Actor struct {
}
type Template struct {
- Accounts []Actor
- Miners []Miner
+ NetworkVersion network.Version
+ Accounts []Actor
+ Miners []Miner
NetworkName string
Timestamp uint64 `json:",omitempty"`
diff --git a/go.mod b/go.mod
index 3e9792843..a61a3da50 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/filecoin-project/lotus
-go 1.15
+go 1.16
require (
contrib.go.opencensus.io/exporter/jaeger v0.1.0
@@ -8,6 +8,7 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/GeertJohan/go.rice v1.0.0
github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee
+ github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921
@@ -30,11 +31,11 @@ require (
github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349 // indirect
github.com/filecoin-project/go-bitfield v0.2.4
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2
- github.com/filecoin-project/go-commp-utils v0.1.0
+ github.com/filecoin-project/go-commp-utils v0.1.1-0.20210427191551-70bf140d31c7
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03
- github.com/filecoin-project/go-data-transfer v1.4.3
+ github.com/filecoin-project/go-data-transfer v1.6.0
github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a
- github.com/filecoin-project/go-fil-markets v1.2.5
+ github.com/filecoin-project/go-fil-markets v1.4.0
github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec
github.com/filecoin-project/go-multistore v0.0.3
github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20
@@ -43,17 +44,18 @@ require (
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe
github.com/filecoin-project/go-statestore v0.1.1
github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b
- github.com/filecoin-project/specs-actors v0.9.13
- github.com/filecoin-project/specs-actors/v2 v2.3.5-0.20210114162132-5b58b773f4fb
- github.com/filecoin-project/specs-actors/v3 v3.1.0
- github.com/filecoin-project/specs-actors/v4 v4.0.0
+ github.com/filecoin-project/specs-actors v0.9.14
+ github.com/filecoin-project/specs-actors/v2 v2.3.5
+ github.com/filecoin-project/specs-actors/v3 v3.1.1
+ github.com/filecoin-project/specs-actors/v4 v4.0.1
github.com/filecoin-project/specs-actors/v5 v5.0.0-20210609212542-73e0409ac77c
github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506
github.com/filecoin-project/test-vectors/schema v0.0.5
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1
+ github.com/gdamore/tcell/v2 v2.2.0
github.com/go-kit/kit v0.10.0
github.com/go-ole/go-ole v1.2.4 // indirect
- github.com/golang/mock v1.4.4
+ github.com/golang/mock v1.5.0
github.com/google/uuid v1.1.2
github.com/gorilla/mux v1.7.4
github.com/gorilla/websocket v1.4.2
@@ -75,7 +77,7 @@ require (
github.com/ipfs/go-ds-pebble v0.0.2-0.20200921225637-ce220f8ac459
github.com/ipfs/go-filestore v1.0.0
github.com/ipfs/go-fs-lock v0.0.6
- github.com/ipfs/go-graphsync v0.6.0
+ github.com/ipfs/go-graphsync v0.6.1
github.com/ipfs/go-ipfs-blockstore v1.0.3
github.com/ipfs/go-ipfs-chunker v0.0.5
github.com/ipfs/go-ipfs-ds-help v1.0.0
@@ -87,7 +89,7 @@ require (
github.com/ipfs/go-ipfs-util v0.0.2
github.com/ipfs/go-ipld-cbor v0.0.5
github.com/ipfs/go-ipld-format v0.2.0
- github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4
+ github.com/ipfs/go-log/v2 v2.1.3
github.com/ipfs/go-merkledag v0.3.2
github.com/ipfs/go-metrics-interface v0.0.1
github.com/ipfs/go-metrics-prometheus v0.0.2
@@ -100,31 +102,31 @@ require (
github.com/lib/pq v1.7.0
github.com/libp2p/go-buffer-pool v0.0.2
github.com/libp2p/go-eventbus v0.2.1
- github.com/libp2p/go-libp2p v0.12.0
+ github.com/libp2p/go-libp2p v0.14.2
github.com/libp2p/go-libp2p-connmgr v0.2.4
- github.com/libp2p/go-libp2p-core v0.7.0
+ github.com/libp2p/go-libp2p-core v0.8.5
github.com/libp2p/go-libp2p-discovery v0.5.0
github.com/libp2p/go-libp2p-kad-dht v0.11.0
- github.com/libp2p/go-libp2p-mplex v0.3.0
- github.com/libp2p/go-libp2p-noise v0.1.2
- github.com/libp2p/go-libp2p-peerstore v0.2.6
+ github.com/libp2p/go-libp2p-mplex v0.4.1
+ github.com/libp2p/go-libp2p-noise v0.2.0
+ github.com/libp2p/go-libp2p-peerstore v0.2.7
github.com/libp2p/go-libp2p-pubsub v0.4.2-0.20210212194758-6c1addf493eb
- github.com/libp2p/go-libp2p-quic-transport v0.9.0
+ github.com/libp2p/go-libp2p-quic-transport v0.10.0
github.com/libp2p/go-libp2p-record v0.1.3
github.com/libp2p/go-libp2p-routing-helpers v0.2.3
- github.com/libp2p/go-libp2p-swarm v0.3.1
+ github.com/libp2p/go-libp2p-swarm v0.5.0
github.com/libp2p/go-libp2p-tls v0.1.3
- github.com/libp2p/go-libp2p-yamux v0.4.1
+ github.com/libp2p/go-libp2p-yamux v0.5.4
github.com/libp2p/go-maddr-filter v0.1.0
github.com/mattn/go-colorable v0.1.6 // indirect
+ github.com/mattn/go-isatty v0.0.12
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-base32 v0.0.3
github.com/multiformats/go-multiaddr v0.3.1
- github.com/multiformats/go-multiaddr-dns v0.2.0
+ github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/multiformats/go-multibase v0.0.3
github.com/multiformats/go-multihash v0.0.14
- github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333
github.com/opentracing/opentracing-go v1.2.0
github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a
@@ -142,17 +144,17 @@ require (
github.com/whyrusleeping/pubsub v0.0.0-20190708150250-92bcb0691325
github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542
go.etcd.io/bbolt v1.3.4
- go.opencensus.io v0.22.5
+ go.opencensus.io v0.23.0
go.uber.org/dig v1.10.0 // indirect
go.uber.org/fx v1.9.0
go.uber.org/multierr v1.6.0
go.uber.org/zap v1.16.0
- golang.org/x/net v0.0.0-20201022231255-08b38378de70
- golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
- golang.org/x/sys v0.0.0-20201119102817-f84b799fce68
+ golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6
+ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
+ golang.org/x/sys v0.0.0-20210426080607-c94f62235c83
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
+ golang.org/x/tools v0.0.0-20210106214847-113979e3529a
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
- gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.28
gotest.tools v2.2.0+incompatible
honnef.co/go/tools v0.0.1-2020.1.3 // indirect
diff --git a/go.sum b/go.sum
index f13c674a9..bbaef9beb 100644
--- a/go.sum
+++ b/go.sum
@@ -42,6 +42,8 @@ github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee h1:8doiS7ib3zi6/K1
github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee/go.mod h1:W0GbEAA4uFNYOGG2cJpmFJ04E6SD1NLELPYZB57/7AY=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y=
+github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa h1:1PPxEyGdIGVkX/kqMvLJ95a1dGS1Sz7tpNEgehEYYt0=
+github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa/go.mod h1:WUmMvh9wMtqj1Xhf1hf3kp9RvL+y6odtdYxpyZjb90U=
github.com/Masterminds/glide v0.13.2/go.mod h1:STyF5vcenH/rUqTEv+/hBXlSTo7KYwg2oc2f4tzPWic=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA=
@@ -96,6 +98,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/bep/debounce v1.2.0 h1:wXds8Kq8qRfwAOpAxHrJDbCXgC5aHSzgQb/0gKsHQqo=
+github.com/bep/debounce v1.2.0/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/briandowns/spinner v1.11.1/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ=
@@ -103,14 +107,18 @@ github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dm
github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
-github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw=
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
+github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M=
+github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
+github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts=
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
+github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
+github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 h1:gfAMKE626QEuKG3si0pdTRcr/YEbBoxY+3GOH3gWvl4=
@@ -147,7 +155,6 @@ github.com/cockroachdb/pebble v0.0.0-20201001221639-879f3bfeef07 h1:Cb2pZUCFXlLA
github.com/cockroachdb/pebble v0.0.0-20201001221639-879f3bfeef07/go.mod h1:hU7vhtrqonEphNF+xt8/lHdaBprxmV1h8BOGrd9XwmQ=
github.com/cockroachdb/redact v0.0.0-20200622112456-cd282804bbd3 h1:2+dpIJzYMSbLi0587YXpi8tOJT52qCOI/1I0UNThc/I=
github.com/cockroachdb/redact v0.0.0-20200622112456-cd282804bbd3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
-github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA=
github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327 h1:7grrpcfCtbZLsjtB0DgMuzs1umsJmpzaHMZ6cO6iAWw=
@@ -183,8 +190,10 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4=
-github.com/davidlazar/go-crypto v0.0.0-20190912175916-7055855a373f h1:BOaYiTvg8p9vBUXpklC22XSK/mifLF7lG9jtmYYi3Tc=
github.com/davidlazar/go-crypto v0.0.0-20190912175916-7055855a373f/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4=
+github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU=
+github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U=
+github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e h1:lj77EKYUpYXTd8CD/+QMIf8b6OIOTsfEBSXiAzuEHTU=
github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e/go.mod h1:3ZQK6DMPSz/QZ73jlWxBtUhNA8xZx7LzUFSq/OfP8vk=
github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ=
@@ -261,21 +270,21 @@ github.com/filecoin-project/go-bitfield v0.2.4/go.mod h1:CNl9WG8hgR5mttCnUErjcQj
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8=
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg=
github.com/filecoin-project/go-commp-utils v0.0.0-20201119054358-b88f7a96a434/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U=
-github.com/filecoin-project/go-commp-utils v0.1.0 h1:PaDxoXYh1TXnnz5kA/xSObpAQwcJSUs4Szb72nuaNdk=
-github.com/filecoin-project/go-commp-utils v0.1.0/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U=
+github.com/filecoin-project/go-commp-utils v0.1.1-0.20210427191551-70bf140d31c7 h1:U9Z+76pHCKBmtdxFV7JFZJj7OVm12I6dEKwtMVbq5p0=
+github.com/filecoin-project/go-commp-utils v0.1.1-0.20210427191551-70bf140d31c7/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U=
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus=
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ=
github.com/filecoin-project/go-data-transfer v1.0.1/go.mod h1:UxvfUAY9v3ub0a21BSK9u3pB2aq30Y0KMsG+w9/ysyo=
-github.com/filecoin-project/go-data-transfer v1.4.3 h1:ECEw69NOfmEZ7XN1NSBvj3KTbbH2mIczQs+Z2w4bD7c=
-github.com/filecoin-project/go-data-transfer v1.4.3/go.mod h1:n8kbDQXWrY1c4UgfMa9KERxNCWbOTDwdNhf2MpN9dpo=
+github.com/filecoin-project/go-data-transfer v1.6.0 h1:DHIzEc23ydRCCBwtFet3MfgO8gMpZEnw60Y+s71oX6o=
+github.com/filecoin-project/go-data-transfer v1.6.0/go.mod h1:E3WW4mCEYwU2y65swPEajSZoFWFmfXt7uwGduoACZQc=
github.com/filecoin-project/go-ds-versioning v0.1.0 h1:y/X6UksYTsK8TLCI7rttCKEvl8btmWxyFMEeeWGUxIQ=
github.com/filecoin-project/go-ds-versioning v0.1.0/go.mod h1:mp16rb4i2QPmxBnmanUx8i/XANp+PFCCJWiAb+VW4/s=
github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ=
github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a h1:hyJ+pUm/4U4RdEZBlg6k8Ma4rDiuvqyGpoICXAxwsTg=
github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ=
github.com/filecoin-project/go-fil-markets v1.0.5-0.20201113164554-c5eba40d5335/go.mod h1:AJySOJC00JRWEZzRG2KsfUnqEf5ITXxeX09BE9N4f9c=
-github.com/filecoin-project/go-fil-markets v1.2.5 h1:bQgtXbwxKyPxSEQoUI5EaTHJ0qfzyd5NosspuADCm6Y=
-github.com/filecoin-project/go-fil-markets v1.2.5/go.mod h1:7JIqNBmFvOyBzk/EiPYnweVdQnWhshixb5B9b1653Ag=
+github.com/filecoin-project/go-fil-markets v1.4.0 h1:J4L6o+FVOmS7ZWV6wxLPiuoDzGC7iS3S5NRFL1enEr0=
+github.com/filecoin-project/go-fil-markets v1.4.0/go.mod h1:7be6zzFwaN8kxVeYZf/UUj/JilHC0ogPvWqE1TW8Ptk=
github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM=
github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24=
github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 h1:b3UDemBYN2HNfk3KOXNuxgTTxlWi3xVvbQP0IT38fvM=
@@ -307,16 +316,20 @@ github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b
github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b/go.mod h1:Q0GQOBtKf1oE10eSXSlhN45kDBdGvEcVOqMiffqX+N8=
github.com/filecoin-project/specs-actors v0.9.4/go.mod h1:BStZQzx5x7TmCkLv0Bpa07U6cPKol6fd3w9KjMPZ6Z4=
github.com/filecoin-project/specs-actors v0.9.12/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
-github.com/filecoin-project/specs-actors v0.9.13 h1:rUEOQouefi9fuVY/2HOroROJlZbOzWYXXeIh41KF2M4=
github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
+github.com/filecoin-project/specs-actors v0.9.14 h1:68PVstg2UB3ZsMLF+DKFTAs/YKsqhKWynkr0IqmVRQY=
+github.com/filecoin-project/specs-actors v0.9.14/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
github.com/filecoin-project/specs-actors/v2 v2.0.1/go.mod h1:v2NZVYinNIKA9acEMBm5wWXxqv5+frFEbekBFemYghY=
github.com/filecoin-project/specs-actors/v2 v2.3.2/go.mod h1:UuJQLoTx/HPvvWeqlIFmC/ywlOLHNe8SNQ3OunFbu2Y=
-github.com/filecoin-project/specs-actors/v2 v2.3.5-0.20210114162132-5b58b773f4fb h1:orr/sMzrDZUPAveRE+paBdu1kScIUO5zm+HYeh+VlhA=
github.com/filecoin-project/specs-actors/v2 v2.3.5-0.20210114162132-5b58b773f4fb/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc=
-github.com/filecoin-project/specs-actors/v3 v3.1.0 h1:s4qiPw8pgypqBGAy853u/zdZJ7K9cTZdM1rTiSonHrg=
+github.com/filecoin-project/specs-actors/v2 v2.3.5 h1:PbT4tPlSXZ8sRgajhb4D8AOEmiaaZ+jg6tc6BBv8VQc=
+github.com/filecoin-project/specs-actors/v2 v2.3.5/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc=
github.com/filecoin-project/specs-actors/v3 v3.1.0/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww=
-github.com/filecoin-project/specs-actors/v4 v4.0.0 h1:vMALksY5G3J5rj3q9rbcyB+f4Tk1xrLqSgdB3jOok4s=
+github.com/filecoin-project/specs-actors/v3 v3.1.1 h1:BE8fsns1GnEOxt1DTE5LxBK2FThXtWmCChgcJoHTg0E=
+github.com/filecoin-project/specs-actors/v3 v3.1.1/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww=
github.com/filecoin-project/specs-actors/v4 v4.0.0/go.mod h1:TkHXf/l7Wyw4ZejyXIPS2rK8bBO0rdwhTZyQQgaglng=
+github.com/filecoin-project/specs-actors/v4 v4.0.1 h1:AiWrtvJZ63MHGe6rn7tPu4nSUY8bA1KDNszqJaD5+Fg=
+github.com/filecoin-project/specs-actors/v4 v4.0.1/go.mod h1:TkHXf/l7Wyw4ZejyXIPS2rK8bBO0rdwhTZyQQgaglng=
github.com/filecoin-project/specs-actors/v5 v5.0.0-20210512015452-4fe3889fff57/go.mod h1:283yBMMUSDB2abcjP/hhrwTkhb9h3sfM6KGrep/ZlBI=
github.com/filecoin-project/specs-actors/v5 v5.0.0-20210609212542-73e0409ac77c h1:GnDJ6q3QEm2ytTKjPFQSvczAltgCSb3j9F1FeynwvPA=
github.com/filecoin-project/specs-actors/v5 v5.0.0-20210609212542-73e0409ac77c/go.mod h1:b/btpRl84Q9SeDKlyIoORBQwe2OTmq14POrYrVvBWCM=
@@ -325,8 +338,9 @@ github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506/g
github.com/filecoin-project/test-vectors/schema v0.0.5 h1:w3zHQhzM4pYxJDl21avXjOKBLF8egrvwUwjpT8TquDg=
github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
-github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as=
github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ=
+github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ=
+github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
@@ -336,6 +350,10 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1 h1:EzDjxMg43q1tA2c0MV3tNbaontnHLplHyFF6M5KiVP0=
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1/go.mod h1:0eHX/BVySxPc6SE2mZRoppGq7qcEagxdmQnA3dzork8=
+github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
+github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
+github.com/gdamore/tcell/v2 v2.2.0 h1:vSyEgKwraXPSOkvCk7IwOSyX+Pv3V2cV9CikJMXg4U4=
+github.com/gdamore/tcell/v2 v2.2.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=
github.com/getsentry/raven-go v0.2.0 h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs=
github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs=
@@ -387,8 +405,9 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
-github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
+github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
+github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc=
github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA=
github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM=
@@ -405,8 +424,9 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
+github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g=
+github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -418,8 +438,9 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
-github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
+github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf h1:gFVkHXmVAhEbxZVDln5V9GKrLaluNoFHDbrZwAWZgws=
@@ -431,14 +452,16 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.3 h1:x95R7cp+rSeeqAMI2knLtQ0DKlaBhv2NrtrOvafPHRo=
+github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM=
-github.com/google/gopacket v1.1.18 h1:lum7VRA9kdlvBi7/v2p7/zcbkduHaCH/SVVyurs7OpY=
github.com/google/gopacket v1.1.18/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM=
+github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
+github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
@@ -603,8 +626,8 @@ github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28
github.com/ipfs/go-graphsync v0.1.0/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE=
github.com/ipfs/go-graphsync v0.4.2/go.mod h1:/VmbZTUdUMTbNkgzAiCEucIIAU3BkLE2cZrDCVUhyi0=
github.com/ipfs/go-graphsync v0.4.3/go.mod h1:mPOwDYv128gf8gxPFgXnz4fNrSYPsWyqisJ7ych+XDY=
-github.com/ipfs/go-graphsync v0.6.0 h1:x6UvDUGA7wjaKNqx5Vbo7FGT8aJ5ryYA0dMQ5jN3dF0=
-github.com/ipfs/go-graphsync v0.6.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk=
+github.com/ipfs/go-graphsync v0.6.1 h1:i9wN7YkBXWwIsUjVQeuaDxFB59yWZrG1xL564Nz7aGE=
+github.com/ipfs/go-graphsync v0.6.1/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk=
github.com/ipfs/go-hamt-ipld v0.1.1/go.mod h1:1EZCr2v0jlCnhpa+aZ0JZYp8Tt2w16+JJOAVz17YcDk=
github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08=
github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw=
@@ -678,8 +701,10 @@ github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBW
github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw=
github.com/ipfs/go-log/v2 v2.0.8/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw=
github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM=
-github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4 h1:3bijxqzQ1O9yg7gd7Aqk80oaEvsJ+uXw0zSvi2qR3Jw=
github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM=
+github.com/ipfs/go-log/v2 v2.1.2/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM=
+github.com/ipfs/go-log/v2 v2.1.3 h1:1iS3IU7aXRlbgUpN8yTTpJ53NXYjAe37vcI5+5nYrzk=
+github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g=
github.com/ipfs/go-merkledag v0.0.3/go.mod h1:Oc5kIXLHokkE1hWGMBHw+oxehkAaTOqtEb7Zbh6BhLA=
github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto=
github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk=
@@ -770,7 +795,6 @@ github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVY
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/kabukky/httpscerts v0.0.0-20150320125433-617593d7dcb3 h1:Iy7Ifq2ysilWU4QlCx/97OoI4xT1IV7i8byT/EyIT/M=
github.com/kabukky/httpscerts v0.0.0-20150320125433-617593d7dcb3/go.mod h1:BYpt4ufZiIGv2nXn4gMxnfKV306n3mWXgNu/d2TqdTU=
github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
@@ -781,6 +805,7 @@ github.com/kilic/bls12-381 v0.0.0-20200820230200-6b2c19996391 h1:51kHw7l/dUDdOdW
github.com/kilic/bls12-381 v0.0.0-20200820230200-6b2c19996391/go.mod h1:XXfR6YFCRSrkEXbNlIyDsgXVNJWVUV30m/ebkVy9n6s=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
+github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -811,8 +836,9 @@ github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40J
github.com/libp2p/go-conn-security-multistream v0.0.1/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE=
github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE=
github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc=
-github.com/libp2p/go-conn-security-multistream v0.2.0 h1:uNiDjS58vrvJTg9jO6bySd1rMKejieG7v45ekqHbZ1M=
github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU=
+github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDaXFU0iWB4yVTYrioC6Zy0=
+github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70=
github.com/libp2p/go-eventbus v0.0.2/go.mod h1:Hr/yGlwxA/stuLnpMiu82lpNKpvRy3EaJxPu40XYOwk=
github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4=
github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc=
@@ -835,8 +861,9 @@ github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qD
github.com/libp2p/go-libp2p v0.8.3/go.mod h1:EsH1A+8yoWK+L4iKcbPYu6MPluZ+CHWI9El8cTaefiM=
github.com/libp2p/go-libp2p v0.9.2/go.mod h1:cunHNLDVus66Ct9iXXcjKRLdmHdFdHVe1TAnbubJQqQ=
github.com/libp2p/go-libp2p v0.10.0/go.mod h1:yBJNpb+mGJdgrwbKAKrhPU0u3ogyNFTfjJ6bdM+Q/G8=
-github.com/libp2p/go-libp2p v0.12.0 h1:+xai9RQnQ9l5elFOKvp5wRyjyWisSwEx+6nU2+onpUA=
github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0=
+github.com/libp2p/go-libp2p v0.14.2 h1:qs0ABtjjNjS+RIXT1uM7sMJEvIc0pq2nKR0VQxFXhHI=
+github.com/libp2p/go-libp2p v0.14.2/go.mod h1:0PQMADQEjCM2l8cSMYDpTgsb8gr6Zq7i4LUgq1mlW2E=
github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 h1:BM7aaOF7RpmNn9+9g6uTjGJ0cTzWr5j9i9IKeun2M8U=
github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo=
github.com/libp2p/go-libp2p-autonat v0.0.2/go.mod h1:fs71q5Xk+pdnKU014o2iq1RhMs9/PMaG5zXRFNnIIT4=
@@ -847,8 +874,9 @@ github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQ
github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI=
github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A=
github.com/libp2p/go-libp2p-autonat v0.2.3/go.mod h1:2U6bNWCNsAG9LEbwccBDQbjzQ8Krdjge1jLTE9rdoMM=
-github.com/libp2p/go-libp2p-autonat v0.4.0 h1:3y8XQbpr+ssX8QfZUHekjHCYK64sj6/4hnf/awD4+Ug=
github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk=
+github.com/libp2p/go-libp2p-autonat v0.4.2 h1:YMp7StMi2dof+baaxkbxaizXjY1RPvU71CXfxExzcUU=
+github.com/libp2p/go-libp2p-autonat v0.4.2/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk=
github.com/libp2p/go-libp2p-autonat-svc v0.1.0/go.mod h1:fqi8Obl/z3R4PFVLm8xFtZ6PBL9MlV/xumymRFkKq5A=
github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc=
github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro=
@@ -895,8 +923,12 @@ github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX
github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo=
github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo=
github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8=
-github.com/libp2p/go-libp2p-core v0.7.0 h1:4a0TMjrWNTZlNvcqxZmrMRDi/NQWrhwO2pkTuLSQ/IQ=
github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8=
+github.com/libp2p/go-libp2p-core v0.8.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8=
+github.com/libp2p/go-libp2p-core v0.8.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8=
+github.com/libp2p/go-libp2p-core v0.8.2/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8=
+github.com/libp2p/go-libp2p-core v0.8.5 h1:aEgbIcPGsKy6zYcC+5AJivYFedhYa4sW7mIpWpUaLKw=
+github.com/libp2p/go-libp2p-core v0.8.5/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8=
github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE=
github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I=
github.com/libp2p/go-libp2p-crypto v0.1.0 h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ=
@@ -931,8 +963,10 @@ github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3
github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE=
github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo=
github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek=
-github.com/libp2p/go-libp2p-mplex v0.3.0 h1:CZyqqKP0BSGQyPLvpRQougbfXaaaJZdGgzhCpJNuNSk=
github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs=
+github.com/libp2p/go-libp2p-mplex v0.4.0/go.mod h1:yCyWJE2sc6TBTnFpjvLuEJgTSw/u+MamvzILKdX7asw=
+github.com/libp2p/go-libp2p-mplex v0.4.1 h1:/pyhkP1nLwjG3OM+VuaNJkQT/Pqq73WzB3aDN3Fx1sc=
+github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g=
github.com/libp2p/go-libp2p-nat v0.0.2/go.mod h1:QrjXQSD5Dj4IJOdEcjHRkWTSomyxRo6HnUkf/TfQpLQ=
github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY=
github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE=
@@ -944,8 +978,8 @@ github.com/libp2p/go-libp2p-netutil v0.0.1/go.mod h1:GdusFvujWZI9Vt0X5BKqwWWmZFx
github.com/libp2p/go-libp2p-netutil v0.1.0 h1:zscYDNVEcGxyUpMd0JReUZTrpMfia8PmLKcKF72EAMQ=
github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU=
github.com/libp2p/go-libp2p-noise v0.1.1/go.mod h1:QDFLdKX7nluB7DEnlVPbz7xlLHdwHFA9HiohJRr3vwM=
-github.com/libp2p/go-libp2p-noise v0.1.2 h1:IH9GRihQJTx56obm+GnpdPX4KeVIlvpXrP6xnJ0wxWk=
-github.com/libp2p/go-libp2p-noise v0.1.2/go.mod h1:9B10b7ueo7TIxZHHcjcDCo5Hd6kfKT2m77by82SFRfE=
+github.com/libp2p/go-libp2p-noise v0.2.0 h1:wmk5nhB9a2w2RxMOyvsoKjizgJOEaJdfAakr0jN8gds=
+github.com/libp2p/go-libp2p-noise v0.2.0/go.mod h1:IEbYhBBzGyvdLBoxxULL/SGbJARhUeqlO8lVSREYu2Q=
github.com/libp2p/go-libp2p-peer v0.0.1/go.mod h1:nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo=
github.com/libp2p/go-libp2p-peer v0.1.1/go.mod h1:jkF12jGB4Gk/IOo+yomm+7oLWxF278F7UnrYUQ1Q8es=
github.com/libp2p/go-libp2p-peer v0.2.0 h1:EQ8kMjaCUwt/Y5uLgjT8iY2qg0mGUT0N1zUjer50DsY=
@@ -960,8 +994,9 @@ github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRj
github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA=
github.com/libp2p/go-libp2p-peerstore v0.2.3/go.mod h1:K8ljLdFn590GMttg/luh4caB/3g0vKuY01psze0upRw=
github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s=
-github.com/libp2p/go-libp2p-peerstore v0.2.6 h1:2ACefBX23iMdJU9Ke+dcXt3w86MIryes9v7In4+Qq3U=
github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s=
+github.com/libp2p/go-libp2p-peerstore v0.2.7 h1:83JoLxyR9OYTnNfB5vvFqvMUv/xDNa6NoPHnENhBsGw=
+github.com/libp2p/go-libp2p-peerstore v0.2.7/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s=
github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k=
github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA=
github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s=
@@ -972,8 +1007,8 @@ github.com/libp2p/go-libp2p-pubsub v0.4.2-0.20210212194758-6c1addf493eb h1:HExLc
github.com/libp2p/go-libp2p-pubsub v0.4.2-0.20210212194758-6c1addf493eb/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ=
github.com/libp2p/go-libp2p-quic-transport v0.1.1/go.mod h1:wqG/jzhF3Pu2NrhJEvE+IE0NTHNXslOPn9JQzyCAxzU=
github.com/libp2p/go-libp2p-quic-transport v0.5.0/go.mod h1:IEcuC5MLxvZ5KuHKjRu+dr3LjCT1Be3rcD/4d8JrX8M=
-github.com/libp2p/go-libp2p-quic-transport v0.9.0 h1:WPuq5nV/chmIZIzvrkC2ulSdAQ0P0BDvgvAhZFOZ59E=
-github.com/libp2p/go-libp2p-quic-transport v0.9.0/go.mod h1:xyY+IgxL0qsW7Kiutab0+NlxM0/p9yRtrGTYsuMWf70=
+github.com/libp2p/go-libp2p-quic-transport v0.10.0 h1:koDCbWD9CCHwcHZL3/WEvP2A+e/o5/W5L3QS/2SPMA0=
+github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA=
github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q=
github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q=
github.com/libp2p/go-libp2p-record v0.1.1/go.mod h1:VRgKajOyMVgP/F0L5g3kH7SVskp17vFi2xheb5uMJtg=
@@ -1000,8 +1035,9 @@ github.com/libp2p/go-libp2p-swarm v0.2.4/go.mod h1:/xIpHFPPh3wmSthtxdGbkHZ0OET1h
github.com/libp2p/go-libp2p-swarm v0.2.7/go.mod h1:ZSJ0Q+oq/B1JgfPHJAT2HTall+xYRNYp1xs4S2FBWKA=
github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM=
github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk=
-github.com/libp2p/go-libp2p-swarm v0.3.1 h1:UTobu+oQHGdXTOGpZ4RefuVqYoJXcT0EBtSR74m2LkI=
github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk=
+github.com/libp2p/go-libp2p-swarm v0.5.0 h1:HIK0z3Eqoo8ugmN8YqWAhD2RORgR+3iNXYG4U2PFd1E=
+github.com/libp2p/go-libp2p-swarm v0.5.0/go.mod h1:sU9i6BoHE0Ve5SKz3y9WfKrh8dUat6JknzUehFx8xW4=
github.com/libp2p/go-libp2p-testing v0.0.1/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E=
github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E=
github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E=
@@ -1009,8 +1045,9 @@ github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MB
github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0=
github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0=
github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc=
-github.com/libp2p/go-libp2p-testing v0.3.0 h1:ZiBYstPamsi7y6NJZebRudUzsYmVkt998hltyLqf8+g=
github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g=
+github.com/libp2p/go-libp2p-testing v0.4.0 h1:PrwHRi0IGqOwVQWR3xzgigSlhlLfxgfXgkHxr77EghQ=
+github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0=
github.com/libp2p/go-libp2p-tls v0.1.3 h1:twKMhMu44jQO+HgQK9X8NHO5HkeJu2QbhLzLJpa8oNM=
github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M=
github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk=
@@ -1020,8 +1057,9 @@ github.com/libp2p/go-libp2p-transport-upgrader v0.0.1/go.mod h1:NJpUAgQab/8K6K0m
github.com/libp2p/go-libp2p-transport-upgrader v0.0.4/go.mod h1:RGq+tupk+oj7PzL2kn/m1w6YXxcIAYJYeI90h6BGgUc=
github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA=
github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns=
-github.com/libp2p/go-libp2p-transport-upgrader v0.3.0 h1:q3ULhsknEQ34eVDhv4YwKS8iet69ffs9+Fir6a7weN4=
github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o=
+github.com/libp2p/go-libp2p-transport-upgrader v0.4.2 h1:4JsnbfJzgZeRS9AWN7B9dPqn/LY/HoQTlO9gtdJTIYM=
+github.com/libp2p/go-libp2p-transport-upgrader v0.4.2/go.mod h1:NR8ne1VwfreD5VIWIU62Agt/J18ekORFU/j1i2y8zvk=
github.com/libp2p/go-libp2p-yamux v0.1.2/go.mod h1:xUoV/RmYkg6BW/qGxA9XJyg+HzXFYkeXbnhjmnYzKp8=
github.com/libp2p/go-libp2p-yamux v0.1.3/go.mod h1:VGSQVrqkh6y4nm0189qqxMtvyBft44MOYYPpYKXiVt4=
github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8=
@@ -1031,8 +1069,9 @@ github.com/libp2p/go-libp2p-yamux v0.2.5/go.mod h1:Zpgj6arbyQrmZ3wxSZxfBmbdnWtbZ
github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhLEn0XhIoZ5viCwU=
github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4=
github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30=
-github.com/libp2p/go-libp2p-yamux v0.4.1 h1:TJxRVPY9SjH7TNrNC80l1OJMBiWhs1qpKmeB+1Ug3xU=
-github.com/libp2p/go-libp2p-yamux v0.4.1/go.mod h1:FA/NjRYRVNjqOzpGuGqcruH7jAU2mYIjtKBicVOL3dc=
+github.com/libp2p/go-libp2p-yamux v0.5.0/go.mod h1:AyR8k5EzyM2QN9Bbdg6X1SkVVuqLwTGf0L4DFq9g6po=
+github.com/libp2p/go-libp2p-yamux v0.5.4 h1:/UOPtT/6DHPtr3TtKXBHa6g0Le0szYuI33Xc/Xpd7fQ=
+github.com/libp2p/go-libp2p-yamux v0.5.4/go.mod h1:tfrXbyaTqqSU654GTvK3ocnSZL3BuHoeTSqhcel1wsE=
github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q=
github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q=
github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M=
@@ -1044,8 +1083,9 @@ github.com/libp2p/go-mplex v0.0.4/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTW
github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU=
github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk=
github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk=
-github.com/libp2p/go-mplex v0.2.0 h1:Ov/D+8oBlbRkjBs1R1Iua8hJ8cUfbdiW8EOdZuxcgaI=
github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ=
+github.com/libp2p/go-mplex v0.3.0 h1:U1T+vmCYJaEoDJPV1aq31N56hS+lJgb397GsylNSgrU=
+github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ=
github.com/libp2p/go-msgio v0.0.1/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ=
github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ=
github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ=
@@ -1057,8 +1097,9 @@ github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/
github.com/libp2p/go-nat v0.0.5 h1:qxnwkco8RLKqVh1NmjQ+tJ8p8khNLFxuElYG/TwqW4Q=
github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU=
github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk=
-github.com/libp2p/go-netroute v0.1.3 h1:1ngWRx61us/EpaKkdqkMjKk/ufr/JlIFYQAxV2XX8Ig=
github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk=
+github.com/libp2p/go-netroute v0.1.6 h1:ruPJStbYyXVYGQ81uzEDzuvbYRLKRrLvTYd33yomC38=
+github.com/libp2p/go-netroute v0.1.6/go.mod h1:AqhkMh0VuWmfgtxKPp3Oc1LdU5QSWS7wl0QLhSZqXxQ=
github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0=
github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc=
github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc=
@@ -1074,8 +1115,9 @@ github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2
github.com/libp2p/go-reuseport-transport v0.0.4 h1:OZGz0RB620QDGpv300n1zaOcKGGAoGVf8h9txtt/1uM=
github.com/libp2p/go-reuseport-transport v0.0.4/go.mod h1:trPa7r/7TJK/d+0hdBLOCGvpQQVOU74OXbNCIMkufGw=
github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k=
-github.com/libp2p/go-sockaddr v0.1.0 h1:Y4s3/jNoryVRKEBrkJ576F17CPOaMIzUeCsg7dlTDj0=
github.com/libp2p/go-sockaddr v0.1.0/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k=
+github.com/libp2p/go-sockaddr v0.1.1 h1:yD80l2ZOdGksnOyHrhxDdTDFrf7Oy+v3FMVArIRgZxQ=
+github.com/libp2p/go-sockaddr v0.1.1/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k=
github.com/libp2p/go-stream-muxer v0.0.1/go.mod h1:bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14=
github.com/libp2p/go-stream-muxer v0.1.0/go.mod h1:8JAVsjeRBCWwPoZeH0W1imLOcriqXJyFvB0mR4A04sQ=
github.com/libp2p/go-stream-muxer-multistream v0.1.1/go.mod h1:zmGdfkQ1AzOECIAcccoL8L//laqawOsO03zX8Sa+eGw=
@@ -1097,8 +1139,9 @@ github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw
github.com/libp2p/go-ws-transport v0.1.2/go.mod h1:dsh2Ld8F+XNmzpkaAijmg5Is+e9l6/1tK/6VFOdN69Y=
github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM=
github.com/libp2p/go-ws-transport v0.3.0/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk=
-github.com/libp2p/go-ws-transport v0.3.1 h1:ZX5rWB8nhRRJVaPO6tmkGI/Xx8XNboYX20PW5hXIscw=
github.com/libp2p/go-ws-transport v0.3.1/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk=
+github.com/libp2p/go-ws-transport v0.4.0 h1:9tvtQ9xbws6cA5LvqdE6Ne3vcmGB4f1z9SByggk4s0k=
+github.com/libp2p/go-ws-transport v0.4.0/go.mod h1:EcIEKqf/7GDjth6ksuS/6p7R49V4CBY6/E7R/iyhYUA=
github.com/libp2p/go-yamux v1.2.1/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow=
github.com/libp2p/go-yamux v1.2.2/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow=
github.com/libp2p/go-yamux v1.2.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow=
@@ -1110,12 +1153,16 @@ github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/h
github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE=
github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI=
github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE=
+github.com/libp2p/go-yamux/v2 v2.2.0 h1:RwtpYZ2/wVviZ5+3pjC8qdQ4TKnrak0/E01N1UWoAFU=
+github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ=
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw=
github.com/lucas-clemente/quic-go v0.16.0/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE=
-github.com/lucas-clemente/quic-go v0.18.1 h1:DMR7guC0NtVS8zNZR3IO7NARZvZygkSC56GGtC6cyys=
-github.com/lucas-clemente/quic-go v0.18.1/go.mod h1:yXttHsSNxQi8AWijC/vLP+OJczXqzHSOcJrM5ITUlCg=
+github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4=
+github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8=
+github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=
+github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lufia/iostat v1.1.0/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
@@ -1128,13 +1175,13 @@ github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7
github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI=
-github.com/marten-seemann/qpack v0.2.0/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc=
+github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc=
github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk=
github.com/marten-seemann/qtls v0.9.1/go.mod h1:T1MmAdDPyISzxlK6kjRr0pcZFBVd1OZbBb/j3cvzHhk=
github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc=
github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs=
-github.com/marten-seemann/qtls-go1-15 v0.1.0 h1:i/YPXVxz8q9umso/5y474CNcHmTpA+5DH+mFPjx6PZg=
-github.com/marten-seemann/qtls-go1-15 v0.1.0/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I=
+github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ=
+github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
@@ -1149,8 +1196,9 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
-github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
+github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
+github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-xmlrpc v0.0.3/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
@@ -1167,6 +1215,8 @@ github.com/miekg/dns v1.1.4/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nr
github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
+github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY=
+github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g=
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ=
github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
@@ -1213,8 +1263,9 @@ github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/94
github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q=
github.com/multiformats/go-multiaddr-dns v0.0.3/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q=
github.com/multiformats/go-multiaddr-dns v0.1.0/go.mod h1:01k2RAqtoXIuPa3DCavAE9/6jc6nM0H3EgZyfUhN2oY=
-github.com/multiformats/go-multiaddr-dns v0.2.0 h1:YWJoIDwLePniH7OU5hBnDZV6SWuvJqJ0YtN6pLeH9zA=
github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0=
+github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A=
+github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk=
github.com/multiformats/go-multiaddr-fmt v0.0.1/go.mod h1:aBYjqL4T/7j4Qx+R73XSv/8JsgnRFlf0w2KGLCmXl3Q=
github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E=
github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo=
@@ -1244,8 +1295,10 @@ github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wS
github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg=
github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg=
github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38=
-github.com/multiformats/go-multistream v0.2.0 h1:6AuNmQVKUkRnddw2YiDjt5Elit40SFxMJkVnhmETXtU=
github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k=
+github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k=
+github.com/multiformats/go-multistream v0.2.2 h1:TCYu1BHTDr1F/Qm75qwYISQdzGcRdC21nFgQW7l7GBo=
+github.com/multiformats/go-multistream v0.2.2/go.mod h1:UIcnm7Zuo8HKG+HkWgfQsGL+/MIEhyTqbODbIUwSXKs=
github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
@@ -1262,8 +1315,6 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
github.com/ngdinhtoan/glide-cleanup v0.2.0/go.mod h1:UQzsmiDOb8YV3nOsCxK/c9zPpCZVNoHScRE3EO9pVMM=
-github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
-github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nikkolasg/hexjson v0.0.0-20181101101858-78e39397e00c h1:5bFTChQxSKNwy8ALwOebjekYExl9HTT9urdawqC95tA=
github.com/nikkolasg/hexjson v0.0.0-20181101101858-78e39397e00c/go.mod h1:7qN3Y0BvzRUf4LofcoJplQL10lsFDb4PYlePTVwrP28=
github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229 h1:E2B8qYyeSgv5MXpmzZXRNp8IAQ4vjxIjhpAf5hv/tAg=
@@ -1281,6 +1332,7 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
+github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
@@ -1375,6 +1427,8 @@ github.com/raulk/go-watchdog v1.0.1/go.mod h1:lzSbAl5sh4rtI8tYHU01BWIDzgzqaQLj6R
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
+github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
+github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
@@ -1563,6 +1617,7 @@ github.com/xorcare/golden v0.6.0/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/
github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 h1:oWgZJmC1DorFZDpfMfWg7xk29yEOZiXmo/wZl+utTI8=
github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
+github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8=
@@ -1572,7 +1627,6 @@ github.com/zondax/ledger-go v0.12.1/go.mod h1:KatxXrVDzgWwbssUWsF5+cOJHXPvzQ09YS
go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs=
go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw=
go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ=
-go.dedis.ch/kyber/v3 v3.0.9 h1:i0ZbOQocHUjfFasBiUql5zVeC7u/vahFd96DFA8UOWk=
go.dedis.ch/kyber/v3 v3.0.9/go.mod h1:rhNjUUg6ahf8HEg5HUvVBYoWY4boAafX8tYxX+PS+qg=
go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRLo=
go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4=
@@ -1591,8 +1645,8 @@ go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0=
-go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
+go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
+go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
@@ -1645,16 +1699,19 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w=
+golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -1677,8 +1734,9 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
-golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
+golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
+golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
@@ -1689,6 +1747,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1724,6 +1783,7 @@ golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200519113804-d87ec0cfa476/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
@@ -1731,8 +1791,11 @@ golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20201022231255-08b38378de70 h1:Z6x4N9mAi4oF0TbHweCsH618MO6OI6UFgV0FP5n0wBY=
golang.org/x/net v0.0.0-20201022231255-08b38378de70/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6 h1:0PC75Fz/kyMGhL0e1QnypqK2kQMqKt9csD1GnMJR+Zk=
+golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -1750,8 +1813,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
-golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -1818,14 +1881,21 @@ golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200812155832-6a926be9bd1d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210426080607-c94f62235c83 h1:kHSDPqCtsHZOg0nVylfTo20DDhE9gG4Y0jn7hKQ0QAM=
+golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M=
+golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
-golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1869,10 +1939,12 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200711155855-7342f9734a7d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20201112185108-eeaa07dd7696 h1:Bfazo+enXJET5SbHeh95NtxabJF6fJ9r/jpfRJgd3j4=
golang.org/x/tools v0.0.0-20201112185108-eeaa07dd7696/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ=
+golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -1940,8 +2012,9 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
-google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs=
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
+google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -1957,8 +2030,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk=
gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
diff --git a/itests/api_test.go b/itests/api_test.go
new file mode 100644
index 000000000..ee70a337b
--- /dev/null
+++ b/itests/api_test.go
@@ -0,0 +1,267 @@
+package itests
+
+import (
+ "context"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/big"
+ lapi "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/itests/kit"
+ "github.com/filecoin-project/lotus/node/impl"
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestAPI(t *testing.T) {
+ t.Run("direct", func(t *testing.T) {
+ runAPITest(t, kit.Builder)
+ })
+ t.Run("rpc", func(t *testing.T) {
+ runAPITest(t, kit.RPCBuilder)
+ })
+}
+
+type apiSuite struct {
+ makeNodes kit.APIBuilder
+}
+
+// runAPITest is the entry point to API test suite
+func runAPITest(t *testing.T, b kit.APIBuilder) {
+ ts := apiSuite{
+ makeNodes: b,
+ }
+
+ t.Run("version", ts.testVersion)
+ t.Run("id", ts.testID)
+ t.Run("testConnectTwo", ts.testConnectTwo)
+ t.Run("testMining", ts.testMining)
+ t.Run("testMiningReal", ts.testMiningReal)
+ t.Run("testSearchMsg", ts.testSearchMsg)
+ t.Run("testNonGenesisMiner", ts.testNonGenesisMiner)
+}
+
+func (ts *apiSuite) testVersion(t *testing.T) {
+ lapi.RunningNodeType = lapi.NodeFull
+ t.Cleanup(func() {
+ lapi.RunningNodeType = lapi.NodeUnknown
+ })
+
+ ctx := context.Background()
+ apis, _ := ts.makeNodes(t, kit.OneFull, kit.OneMiner)
+ napi := apis[0]
+
+ v, err := napi.Version(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ versions := strings.Split(v.Version, "+")
+ if len(versions) <= 0 {
+ t.Fatal("empty version")
+ }
+ require.Equal(t, versions[0], build.BuildVersion)
+}
+
+func (ts *apiSuite) testSearchMsg(t *testing.T) {
+ apis, miners := ts.makeNodes(t, kit.OneFull, kit.OneMiner)
+
+ api := apis[0]
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+ senderAddr, err := api.WalletDefaultAddress(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ msg := &types.Message{
+ From: senderAddr,
+ To: senderAddr,
+ Value: big.Zero(),
+ }
+ bm := kit.NewBlockMiner(t, miners[0])
+ bm.MineBlocks(ctx, 100*time.Millisecond)
+ defer bm.Stop()
+
+ sm, err := api.MpoolPushMessage(ctx, msg, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ res, err := api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if res.Receipt.ExitCode != 0 {
+ t.Fatal("did not successfully send message")
+ }
+
+ searchRes, err := api.StateSearchMsg(ctx, types.EmptyTSK, sm.Cid(), lapi.LookbackNoLimit, true)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if searchRes.TipSet != res.TipSet {
+ t.Fatalf("search ts: %s, different from wait ts: %s", searchRes.TipSet, res.TipSet)
+ }
+
+}
+
+func (ts *apiSuite) testID(t *testing.T) {
+ ctx := context.Background()
+ apis, _ := ts.makeNodes(t, kit.OneFull, kit.OneMiner)
+ api := apis[0]
+
+ id, err := api.ID(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ assert.Regexp(t, "^12", id.Pretty())
+}
+
+func (ts *apiSuite) testConnectTwo(t *testing.T) {
+ ctx := context.Background()
+ apis, _ := ts.makeNodes(t, kit.TwoFull, kit.OneMiner)
+
+ p, err := apis[0].NetPeers(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(p) != 0 {
+ t.Error("Node 0 has a peer")
+ }
+
+ p, err = apis[1].NetPeers(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(p) != 0 {
+ t.Error("Node 1 has a peer")
+ }
+
+ addrs, err := apis[1].NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := apis[0].NetConnect(ctx, addrs); err != nil {
+ t.Fatal(err)
+ }
+
+ p, err = apis[0].NetPeers(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(p) != 1 {
+ t.Error("Node 0 doesn't have 1 peer")
+ }
+
+ p, err = apis[1].NetPeers(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(p) != 1 {
+ t.Error("Node 0 doesn't have 1 peer")
+ }
+}
+
+func (ts *apiSuite) testMining(t *testing.T) {
+ ctx := context.Background()
+ fulls, miners := ts.makeNodes(t, kit.OneFull, kit.OneMiner)
+ api := fulls[0]
+
+ newHeads, err := api.ChainNotify(ctx)
+ require.NoError(t, err)
+ initHead := (<-newHeads)[0]
+ baseHeight := initHead.Val.Height()
+
+ h1, err := api.ChainHead(ctx)
+ require.NoError(t, err)
+ require.Equal(t, int64(h1.Height()), int64(baseHeight))
+
+ bm := kit.NewBlockMiner(t, miners[0])
+ bm.MineUntilBlock(ctx, fulls[0], nil)
+ require.NoError(t, err)
+
+ <-newHeads
+
+ h2, err := api.ChainHead(ctx)
+ require.NoError(t, err)
+ require.Greater(t, int64(h2.Height()), int64(h1.Height()))
+}
+
+func (ts *apiSuite) testMiningReal(t *testing.T) {
+ build.InsecurePoStValidation = false
+ defer func() {
+ build.InsecurePoStValidation = true
+ }()
+
+ ctx := context.Background()
+ fulls, miners := ts.makeNodes(t, kit.OneFull, kit.OneMiner)
+ api := fulls[0]
+
+ newHeads, err := api.ChainNotify(ctx)
+ require.NoError(t, err)
+ at := (<-newHeads)[0].Val.Height()
+
+ h1, err := api.ChainHead(ctx)
+ require.NoError(t, err)
+ require.Equal(t, int64(at), int64(h1.Height()))
+
+ bm := kit.NewBlockMiner(t, miners[0])
+
+ bm.MineUntilBlock(ctx, fulls[0], nil)
+ require.NoError(t, err)
+
+ <-newHeads
+
+ h2, err := api.ChainHead(ctx)
+ require.NoError(t, err)
+ require.Greater(t, int64(h2.Height()), int64(h1.Height()))
+
+ bm.MineUntilBlock(ctx, fulls[0], nil)
+ require.NoError(t, err)
+
+ <-newHeads
+
+ h3, err := api.ChainHead(ctx)
+ require.NoError(t, err)
+ require.Greater(t, int64(h3.Height()), int64(h2.Height()))
+}
+
+func (ts *apiSuite) testNonGenesisMiner(t *testing.T) {
+ ctx := context.Background()
+ n, sn := ts.makeNodes(t,
+ []kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(-1)},
+ []kit.StorageMiner{{Full: 0, Preseal: kit.PresealGenesis}},
+ )
+
+ full, ok := n[0].FullNode.(*impl.FullNodeAPI)
+ if !ok {
+ t.Skip("not testing with a full node")
+ return
+ }
+ genesisMiner := sn[0]
+
+ bm := kit.NewBlockMiner(t, genesisMiner)
+ bm.MineBlocks(ctx, 4*time.Millisecond)
+ t.Cleanup(bm.Stop)
+
+ gaa, err := genesisMiner.ActorAddress(ctx)
+ require.NoError(t, err)
+
+ gmi, err := full.StateMinerInfo(ctx, gaa, types.EmptyTSK)
+ require.NoError(t, err)
+
+ testm := n[0].Stb(ctx, t, kit.TestSpt, gmi.Owner)
+
+ ta, err := testm.ActorAddress(ctx)
+ require.NoError(t, err)
+
+ tid, err := address.IDFromAddress(ta)
+ require.NoError(t, err)
+
+ require.Equal(t, uint64(1001), tid)
+}
diff --git a/itests/batch_deal_test.go b/itests/batch_deal_test.go
new file mode 100644
index 000000000..9676dffcc
--- /dev/null
+++ b/itests/batch_deal_test.go
@@ -0,0 +1,140 @@
+package itests
+
+import (
+ "context"
+ "fmt"
+ "sort"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
+ "github.com/filecoin-project/lotus/itests/kit"
+ "github.com/filecoin-project/lotus/markets/storageadapter"
+ "github.com/filecoin-project/lotus/node"
+ "github.com/filecoin-project/lotus/node/impl"
+ "github.com/filecoin-project/lotus/node/modules/dtypes"
+ "github.com/stretchr/testify/require"
+)
+
+func TestBatchDealInput(t *testing.T) {
+ kit.QuietMiningLogs()
+
+ var (
+ blockTime = 10 * time.Millisecond
+
+ // For these tests where the block time is artificially short, just use
+ // a deal start epoch that is guaranteed to be far enough in the future
+ // so that the deal starts sealing in time
+ dealStartEpoch = abi.ChainEpoch(2 << 12)
+ )
+
+ run := func(piece, deals, expectSectors int) func(t *testing.T) {
+ return func(t *testing.T) {
+ publishPeriod := 10 * time.Second
+ maxDealsPerMsg := uint64(deals)
+
+ // Set max deals per publish deals message to maxDealsPerMsg
+ minerDef := []kit.StorageMiner{{
+ Full: 0,
+ Opts: node.Options(
+ node.Override(
+ new(*storageadapter.DealPublisher),
+ storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{
+ Period: publishPeriod,
+ MaxDealsPerMsg: maxDealsPerMsg,
+ })),
+ node.Override(new(dtypes.GetSealingConfigFunc), func() (dtypes.GetSealingConfigFunc, error) {
+ return func() (sealiface.Config, error) {
+ return sealiface.Config{
+ MaxWaitDealsSectors: 2,
+ MaxSealingSectors: 1,
+ MaxSealingSectorsForDeals: 3,
+ AlwaysKeepUnsealedCopy: true,
+ WaitDealsDelay: time.Hour,
+ }, nil
+ }, nil
+ }),
+ ),
+ Preseal: kit.PresealGenesis,
+ }}
+
+ // Create a connect client and miner node
+ n, sn := kit.MockMinerBuilder(t, kit.OneFull, minerDef)
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+
+ blockMiner := kit.ConnectAndStartMining(t, blockTime, miner, client)
+ t.Cleanup(blockMiner.Stop)
+
+ dh := kit.NewDealHarness(t, client, miner)
+ ctx := context.Background()
+
+ err := miner.MarketSetAsk(ctx, big.Zero(), big.Zero(), 200, 128, 32<<30)
+ require.NoError(t, err)
+
+ checkNoPadding := func() {
+ sl, err := sn[0].SectorsList(ctx)
+ require.NoError(t, err)
+
+ sort.Slice(sl, func(i, j int) bool {
+ return sl[i] < sl[j]
+ })
+
+ for _, snum := range sl {
+ si, err := sn[0].SectorsStatus(ctx, snum, false)
+ require.NoError(t, err)
+
+ // fmt.Printf("S %d: %+v %s\n", snum, si.Deals, si.State)
+
+ for _, deal := range si.Deals {
+ if deal == 0 {
+ fmt.Printf("sector %d had a padding piece!\n", snum)
+ }
+ }
+ }
+ }
+
+ // Starts a deal and waits until it's published
+ runDealTillSeal := func(rseed int) {
+ res, _, _, err := kit.CreateImportFile(ctx, client, rseed, piece)
+ require.NoError(t, err)
+
+ deal := dh.StartDeal(ctx, res.Root, false, dealStartEpoch)
+ dh.WaitDealSealed(ctx, deal, false, true, checkNoPadding)
+ }
+
+ // Run maxDealsPerMsg deals in parallel
+ done := make(chan struct{}, maxDealsPerMsg)
+ for rseed := 0; rseed < int(maxDealsPerMsg); rseed++ {
+ rseed := rseed
+ go func() {
+ runDealTillSeal(rseed)
+ done <- struct{}{}
+ }()
+ }
+
+ // Wait for maxDealsPerMsg of the deals to be published
+ for i := 0; i < int(maxDealsPerMsg); i++ {
+ <-done
+ }
+
+ checkNoPadding()
+
+ sl, err := sn[0].SectorsList(ctx)
+ require.NoError(t, err)
+ require.Equal(t, len(sl), expectSectors)
+ }
+ }
+
+ t.Run("4-p1600B", run(1600, 4, 4))
+ t.Run("4-p513B", run(513, 4, 2))
+ if !testing.Short() {
+ t.Run("32-p257B", run(257, 32, 8))
+ t.Run("32-p10B", run(10, 32, 2))
+
+ // fixme: this appears to break data-transfer / markets in some really creative ways
+ // t.Run("128-p10B", run(10, 128, 8))
+ }
+}
diff --git a/api/test/ccupgrade.go b/itests/ccupgrade_test.go
similarity index 78%
rename from api/test/ccupgrade.go
rename to itests/ccupgrade_test.go
index 283c8f610..28abac171 100644
--- a/api/test/ccupgrade.go
+++ b/itests/ccupgrade_test.go
@@ -1,4 +1,4 @@
-package test
+package itests
import (
"context"
@@ -7,6 +7,7 @@ import (
"testing"
"time"
+ "github.com/filecoin-project/lotus/itests/kit"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-state-types/abi"
@@ -15,7 +16,9 @@ import (
"github.com/filecoin-project/lotus/node/impl"
)
-func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {
+func TestCCUpgrade(t *testing.T) {
+ kit.QuietMiningLogs()
+
for _, height := range []abi.ChainEpoch{
-1, // before
162, // while sealing
@@ -24,14 +27,14 @@ func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {
} {
height := height // make linters happy by copying
t.Run(fmt.Sprintf("upgrade-%d", height), func(t *testing.T) {
- testCCUpgrade(t, b, blocktime, height)
+ runTestCCUpgrade(t, kit.MockMinerBuilder, 5*time.Millisecond, height)
})
}
}
-func testCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, upgradeHeight abi.ChainEpoch) {
+func runTestCCUpgrade(t *testing.T, b kit.APIBuilder, blocktime time.Duration, upgradeHeight abi.ChainEpoch) {
ctx := context.Background()
- n, sn := b(t, []FullNodeOpts{FullNodeWithLatestActorsAt(upgradeHeight)}, OneMiner)
+ n, sn := b(t, []kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(upgradeHeight)}, kit.OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
@@ -51,7 +54,7 @@ func testCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, upgradeH
defer close(done)
for atomic.LoadInt64(&mine) == 1 {
time.Sleep(blocktime)
- if err := sn[0].MineOne(ctx, MineNext); err != nil {
+ if err := sn[0].MineOne(ctx, kit.MineNext); err != nil {
t.Error(err)
}
}
@@ -62,10 +65,10 @@ func testCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, upgradeH
t.Fatal(err)
}
- CC := abi.SectorNumber(GenesisPreseals + 1)
+ CC := abi.SectorNumber(kit.GenesisPreseals + 1)
Upgraded := CC + 1
- pledgeSectors(t, ctx, miner, 1, 0, nil)
+ kit.PledgeSectors(t, ctx, miner, 1, 0, nil)
sl, err := miner.SectorsList(ctx)
if err != nil {
@@ -89,7 +92,9 @@ func testCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration, upgradeH
t.Fatal(err)
}
- MakeDeal(t, ctx, 6, client, miner, false, false, 0)
+ dh := kit.NewDealHarness(t, client, miner)
+
+ dh.MakeFullDeal(context.Background(), 6, false, false, 0)
// Validate upgrade
diff --git a/itests/cli_test.go b/itests/cli_test.go
new file mode 100644
index 000000000..10e2af15c
--- /dev/null
+++ b/itests/cli_test.go
@@ -0,0 +1,22 @@
+package itests
+
+import (
+ "context"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/lotus/cli"
+ "github.com/filecoin-project/lotus/itests/kit"
+)
+
+// TestClient does a basic test to exercise the client CLI commands.
+func TestClient(t *testing.T) {
+ _ = os.Setenv("BELLMAN_NO_GPU", "1")
+ kit.QuietMiningLogs()
+
+ blocktime := 5 * time.Millisecond
+ ctx := context.Background()
+ clientNode, _ := kit.StartOneNodeOneMiner(ctx, t, blocktime)
+ kit.RunClientTest(t, cli.Commands, clientNode)
+}
diff --git a/api/test/deadlines.go b/itests/deadlines_test.go
similarity index 69%
rename from api/test/deadlines.go
rename to itests/deadlines_test.go
index 68186f0e1..9551465a5 100644
--- a/api/test/deadlines.go
+++ b/itests/deadlines_test.go
@@ -1,24 +1,20 @@
-package test
+package itests
import (
"bytes"
"context"
"fmt"
+ "os"
"testing"
"time"
- "github.com/stretchr/testify/require"
-
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/go-state-types/network"
- miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
- "github.com/ipfs/go-cid"
- cbor "github.com/ipfs/go-ipld-cbor"
-
+ "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
@@ -26,7 +22,13 @@ import (
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/extern/sector-storage/mock"
+ "github.com/filecoin-project/lotus/itests/kit"
"github.com/filecoin-project/lotus/node/impl"
+ miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
+ "github.com/ipfs/go-cid"
+ cbor "github.com/ipfs/go-ipld-cbor"
+ logging "github.com/ipfs/go-log/v2"
+ "github.com/stretchr/testify/require"
)
// TestDeadlineToggling:
@@ -52,16 +54,28 @@ import (
// * goes through another PP
// * asserts that miner B loses power
// * asserts that miner D loses power, is inactive
-func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
- var upgradeH abi.ChainEpoch = 4000
- var provingPeriod abi.ChainEpoch = 2880
+func TestDeadlineToggling(t *testing.T) {
+ if os.Getenv("LOTUS_TEST_DEADLINE_TOGGLING") != "1" {
+ t.Skip("this takes a few minutes, set LOTUS_TEST_DEADLINE_TOGGLING=1 to run")
+ }
+ _ = logging.SetLogLevel("miner", "ERROR")
+ _ = logging.SetLogLevel("chainstore", "ERROR")
+ _ = logging.SetLogLevel("chain", "ERROR")
+ _ = logging.SetLogLevel("sub", "ERROR")
+ _ = logging.SetLogLevel("storageminer", "FATAL")
- const sectorsC, sectorsD, sectersB = 10, 9, 8
+ const sectorsC, sectorsD, sectorsB = 10, 9, 8
+
+ var (
+ upgradeH abi.ChainEpoch = 4000
+ provingPeriod abi.ChainEpoch = 2880
+ blocktime = 2 * time.Millisecond
+ )
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
- n, sn := b(t, []FullNodeOpts{FullNodeWithV4ActorsAt(upgradeH)}, OneMiner)
+ n, sn := kit.MockMinerBuilder(t, []kit.FullNodeOpts{kit.FullNodeWithNetworkUpgradeAt(network.Version12, upgradeH)}, kit.OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
minerA := sn[0]
@@ -90,7 +104,7 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
defer close(done)
for ctx.Err() == nil {
build.Clock.Sleep(blocktime)
- if err := minerA.MineOne(ctx, MineNext); err != nil {
+ if err := minerA.MineOne(ctx, kit.MineNext); err != nil {
if ctx.Err() != nil {
// context was canceled, ignore the error.
return
@@ -104,8 +118,8 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
<-done
}()
- minerB := n[0].Stb(ctx, t, TestSpt, defaultFrom)
- minerC := n[0].Stb(ctx, t, TestSpt, defaultFrom)
+ minerB := n[0].Stb(ctx, t, kit.TestSpt, defaultFrom)
+ minerC := n[0].Stb(ctx, t, kit.TestSpt, defaultFrom)
maddrB, err := minerB.ActorAddress(ctx)
require.NoError(t, err)
@@ -117,7 +131,7 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
// pledge sectors on C, go through a PP, check for power
{
- pledgeSectors(t, ctx, minerC, sectorsC, 0, nil)
+ kit.PledgeSectors(t, ctx, minerC, sectorsC, 0, nil)
di, err := client.StateMinerProvingDeadline(ctx, maddrC, types.EmptyTSK)
require.NoError(t, err)
@@ -157,7 +171,7 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
build.Clock.Sleep(blocktime)
}
- checkMiner := func(ma address.Address, power abi.StoragePower, active bool, tsk types.TipSetKey) {
+ checkMiner := func(ma address.Address, power abi.StoragePower, active, activeIfCron bool, tsk types.TipSetKey) {
p, err := client.StateMinerPower(ctx, ma, tsk)
require.NoError(t, err)
@@ -172,6 +186,22 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
act, err := mst.DeadlineCronActive()
require.NoError(t, err)
+
+ if tsk != types.EmptyTSK {
+ ts, err := client.ChainGetTipSet(ctx, tsk)
+ require.NoError(t, err)
+ di, err := mst.DeadlineInfo(ts.Height())
+ require.NoError(t, err)
+
+ // cron happened on the same epoch some other condition would have happened
+ if di.Open == ts.Height() {
+ act, err := mst.DeadlineCronActive()
+ require.NoError(t, err)
+ require.Equal(t, activeIfCron, act)
+ return
+ }
+ }
+
require.Equal(t, active, act)
}
@@ -179,15 +209,15 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
{
uts, err := client.ChainGetTipSetByHeight(ctx, upgradeH+2, types.EmptyTSK)
require.NoError(t, err)
- checkMiner(maddrB, types.NewInt(0), true, uts.Key())
+ checkMiner(maddrB, types.NewInt(0), true, true, uts.Key())
}
nv, err := client.StateNetworkVersion(ctx, types.EmptyTSK)
require.NoError(t, err)
require.GreaterOrEqual(t, nv, network.Version12)
- minerD := n[0].Stb(ctx, t, TestSpt, defaultFrom)
- minerE := n[0].Stb(ctx, t, TestSpt, defaultFrom)
+ minerD := n[0].Stb(ctx, t, kit.TestSpt, defaultFrom)
+ minerE := n[0].Stb(ctx, t, kit.TestSpt, defaultFrom)
maddrD, err := minerD.ActorAddress(ctx)
require.NoError(t, err)
@@ -195,19 +225,19 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
require.NoError(t, err)
// first round of miner checks
- checkMiner(maddrA, types.NewInt(uint64(ssz)*GenesisPreseals), true, types.EmptyTSK)
- checkMiner(maddrC, types.NewInt(uint64(ssz)*sectorsC), true, types.EmptyTSK)
+ checkMiner(maddrA, types.NewInt(uint64(ssz)*kit.GenesisPreseals), true, true, types.EmptyTSK)
+ checkMiner(maddrC, types.NewInt(uint64(ssz)*sectorsC), true, true, types.EmptyTSK)
- checkMiner(maddrB, types.NewInt(0), false, types.EmptyTSK)
- checkMiner(maddrD, types.NewInt(0), false, types.EmptyTSK)
- checkMiner(maddrE, types.NewInt(0), false, types.EmptyTSK)
+ checkMiner(maddrB, types.NewInt(0), false, false, types.EmptyTSK)
+ checkMiner(maddrD, types.NewInt(0), false, false, types.EmptyTSK)
+ checkMiner(maddrE, types.NewInt(0), false, false, types.EmptyTSK)
// pledge sectors on minerB/minerD, stop post on minerC
- pledgeSectors(t, ctx, minerB, sectersB, 0, nil)
- checkMiner(maddrB, types.NewInt(0), true, types.EmptyTSK)
+ kit.PledgeSectors(t, ctx, minerB, sectorsB, 0, nil)
+ checkMiner(maddrB, types.NewInt(0), true, true, types.EmptyTSK)
- pledgeSectors(t, ctx, minerD, sectorsD, 0, nil)
- checkMiner(maddrD, types.NewInt(0), true, types.EmptyTSK)
+ kit.PledgeSectors(t, ctx, minerD, sectorsD, 0, nil)
+ checkMiner(maddrD, types.NewInt(0), true, true, types.EmptyTSK)
minerC.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).Fail()
@@ -222,7 +252,7 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
params := &miner.SectorPreCommitInfo{
Expiration: 2880 * 300,
SectorNumber: 22,
- SealProof: TestSpt,
+ SealProof: kit.TestSpt,
SealedCID: cr,
SealRandEpoch: head.Height() - 200,
@@ -240,7 +270,7 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
}, nil)
require.NoError(t, err)
- r, err := client.StateWaitMsg(ctx, m.Cid(), 2)
+ r, err := client.StateWaitMsg(ctx, m.Cid(), 2, api.LookbackNoLimit, true)
require.NoError(t, err)
require.Equal(t, exitcode.Ok, r.Receipt.ExitCode)
}
@@ -257,7 +287,7 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
build.Clock.Sleep(blocktime)
}
- checkMiner(maddrE, types.NewInt(0), true, types.EmptyTSK)
+ checkMiner(maddrE, types.NewInt(0), true, true, types.EmptyTSK)
// go through rest of the PP
for {
@@ -272,11 +302,11 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
}
// second round of miner checks
- checkMiner(maddrA, types.NewInt(uint64(ssz)*GenesisPreseals), true, types.EmptyTSK)
- checkMiner(maddrC, types.NewInt(0), true, types.EmptyTSK)
- checkMiner(maddrB, types.NewInt(uint64(ssz)*sectersB), true, types.EmptyTSK)
- checkMiner(maddrD, types.NewInt(uint64(ssz)*sectorsD), true, types.EmptyTSK)
- checkMiner(maddrE, types.NewInt(0), false, types.EmptyTSK)
+ checkMiner(maddrA, types.NewInt(uint64(ssz)*kit.GenesisPreseals), true, true, types.EmptyTSK)
+ checkMiner(maddrC, types.NewInt(0), true, true, types.EmptyTSK)
+ checkMiner(maddrB, types.NewInt(uint64(ssz)*sectorsB), true, true, types.EmptyTSK)
+ checkMiner(maddrD, types.NewInt(uint64(ssz)*sectorsD), true, true, types.EmptyTSK)
+ checkMiner(maddrE, types.NewInt(0), false, false, types.EmptyTSK)
// disable post on minerB
minerB.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).Fail()
@@ -323,11 +353,12 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
fmt.Println("sent termination message:", smsg.Cid())
- r, err := client.StateWaitMsg(ctx, smsg.Cid(), 2)
+ r, err := client.StateWaitMsg(ctx, smsg.Cid(), 2, api.LookbackNoLimit, true)
require.NoError(t, err)
require.Equal(t, exitcode.Ok, r.Receipt.ExitCode)
- checkMiner(maddrD, types.NewInt(0), true, r.TipSet)
+ // assert inactive if the message landed in the tipset we run cron in
+ checkMiner(maddrD, types.NewInt(0), true, false, r.TipSet)
}
// go through another PP
@@ -342,9 +373,8 @@ func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration) {
build.Clock.Sleep(blocktime)
}
- // third round of miner checks
- checkMiner(maddrA, types.NewInt(uint64(ssz)*GenesisPreseals), true, types.EmptyTSK)
- checkMiner(maddrC, types.NewInt(0), true, types.EmptyTSK)
- checkMiner(maddrB, types.NewInt(0), true, types.EmptyTSK)
- checkMiner(maddrD, types.NewInt(0), false, types.EmptyTSK)
+ checkMiner(maddrA, types.NewInt(uint64(ssz)*kit.GenesisPreseals), true, true, types.EmptyTSK)
+ checkMiner(maddrC, types.NewInt(0), true, true, types.EmptyTSK)
+ checkMiner(maddrB, types.NewInt(0), true, true, types.EmptyTSK)
+ checkMiner(maddrD, types.NewInt(0), false, false, types.EmptyTSK)
}
diff --git a/itests/deals_test.go b/itests/deals_test.go
new file mode 100644
index 000000000..6db335afb
--- /dev/null
+++ b/itests/deals_test.go
@@ -0,0 +1,523 @@
+package itests
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io/ioutil"
+ "math/rand"
+ "os"
+ "path/filepath"
+ "sync/atomic"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-fil-markets/storagemarket"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/market"
+ "github.com/filecoin-project/lotus/chain/actors/policy"
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/itests/kit"
+ "github.com/filecoin-project/lotus/markets/storageadapter"
+ "github.com/filecoin-project/lotus/miner"
+ "github.com/filecoin-project/lotus/node"
+ "github.com/filecoin-project/lotus/node/impl"
+ market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
+ "github.com/stretchr/testify/require"
+)
+
+func TestDealCycle(t *testing.T) {
+ kit.QuietMiningLogs()
+
+ blockTime := 10 * time.Millisecond
+
+ // For these tests where the block time is artificially short, just use
+ // a deal start epoch that is guaranteed to be far enough in the future
+ // so that the deal starts sealing in time
+ dealStartEpoch := abi.ChainEpoch(2 << 12)
+
+ t.Run("TestFullDealCycle_Single", func(t *testing.T) {
+ runFullDealCycles(t, 1, kit.MockMinerBuilder, blockTime, false, false, dealStartEpoch)
+ })
+ t.Run("TestFullDealCycle_Two", func(t *testing.T) {
+ runFullDealCycles(t, 2, kit.MockMinerBuilder, blockTime, false, false, dealStartEpoch)
+ })
+ t.Run("WithExportedCAR", func(t *testing.T) {
+ runFullDealCycles(t, 1, kit.MockMinerBuilder, blockTime, true, false, dealStartEpoch)
+ })
+ t.Run("TestFastRetrievalDealCycle", func(t *testing.T) {
+ runFastRetrievalDealFlowT(t, kit.MockMinerBuilder, blockTime, dealStartEpoch)
+ })
+ t.Run("TestZeroPricePerByteRetrievalDealFlow", func(t *testing.T) {
+ runZeroPricePerByteRetrievalDealFlow(t, kit.MockMinerBuilder, blockTime, dealStartEpoch)
+ })
+}
+
+func TestAPIDealFlowReal(t *testing.T) {
+ if testing.Short() {
+ t.Skip("skipping test in short mode")
+ }
+
+ kit.QuietMiningLogs()
+
+ // TODO: just set this globally?
+ oldDelay := policy.GetPreCommitChallengeDelay()
+ policy.SetPreCommitChallengeDelay(5)
+ t.Cleanup(func() {
+ policy.SetPreCommitChallengeDelay(oldDelay)
+ })
+
+ t.Run("basic", func(t *testing.T) {
+ runFullDealCycles(t, 1, kit.Builder, time.Second, false, false, 0)
+ })
+
+ t.Run("fast-retrieval", func(t *testing.T) {
+ runFullDealCycles(t, 1, kit.Builder, time.Second, false, true, 0)
+ })
+
+ t.Run("retrieval-second", func(t *testing.T) {
+ runSecondDealRetrievalTest(t, kit.Builder, time.Second)
+ })
+}
+
+func TestPublishDealsBatching(t *testing.T) {
+ ctx := context.Background()
+
+ kit.QuietMiningLogs()
+
+ b := kit.MockMinerBuilder
+ blocktime := 10 * time.Millisecond
+ startEpoch := abi.ChainEpoch(2 << 12)
+
+ publishPeriod := 10 * time.Second
+ maxDealsPerMsg := uint64(2)
+
+ // Set max deals per publish deals message to 2
+ minerDef := []kit.StorageMiner{{
+ Full: 0,
+ Opts: node.Override(
+ new(*storageadapter.DealPublisher),
+ storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{
+ Period: publishPeriod,
+ MaxDealsPerMsg: maxDealsPerMsg,
+ })),
+ Preseal: kit.PresealGenesis,
+ }}
+
+ // Create a connect client and miner node
+ n, sn := b(t, kit.OneFull, minerDef)
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+
+ kit.ConnectAndStartMining(t, blocktime, miner, client)
+
+ dh := kit.NewDealHarness(t, client, miner)
+
+ // Starts a deal and waits until it's published
+ runDealTillPublish := func(rseed int) {
+ res, _, _, err := kit.CreateImportFile(ctx, client, rseed, 0)
+ require.NoError(t, err)
+
+ upds, err := client.ClientGetDealUpdates(ctx)
+ require.NoError(t, err)
+
+ dh.StartDeal(ctx, res.Root, false, startEpoch)
+
+ // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
+ time.Sleep(time.Second)
+
+ done := make(chan struct{})
+ go func() {
+ for upd := range upds {
+ if upd.DataRef.Root == res.Root && upd.State == storagemarket.StorageDealAwaitingPreCommit {
+ done <- struct{}{}
+ }
+ }
+ }()
+ <-done
+ }
+
+ // Run three deals in parallel
+ done := make(chan struct{}, maxDealsPerMsg+1)
+ for rseed := 1; rseed <= 3; rseed++ {
+ rseed := rseed
+ go func() {
+ runDealTillPublish(rseed)
+ done <- struct{}{}
+ }()
+ }
+
+ // Wait for two of the deals to be published
+ for i := 0; i < int(maxDealsPerMsg); i++ {
+ <-done
+ }
+
+ // Expect a single PublishStorageDeals message that includes the first two deals
+ msgCids, err := client.StateListMessages(ctx, &api.MessageMatch{To: market.Address}, types.EmptyTSK, 1)
+ require.NoError(t, err)
+ count := 0
+ for _, msgCid := range msgCids {
+ msg, err := client.ChainGetMessage(ctx, msgCid)
+ require.NoError(t, err)
+
+ if msg.Method == market.Methods.PublishStorageDeals {
+ count++
+ var pubDealsParams market2.PublishStorageDealsParams
+ err = pubDealsParams.UnmarshalCBOR(bytes.NewReader(msg.Params))
+ require.NoError(t, err)
+ require.Len(t, pubDealsParams.Deals, int(maxDealsPerMsg))
+ }
+ }
+ require.Equal(t, 1, count)
+
+ // The third deal should be published once the publish period expires.
+ // Allow a little padding as it takes a moment for the state change to
+ // be noticed by the client.
+ padding := 10 * time.Second
+ select {
+ case <-time.After(publishPeriod + padding):
+ require.Fail(t, "Expected 3rd deal to be published once publish period elapsed")
+ case <-done: // Success
+ }
+}
+
+func TestDealMining(t *testing.T) {
+ // test making a deal with a fresh miner, and see if it starts to mine.
+ if testing.Short() {
+ t.Skip("skipping test in short mode")
+ }
+
+ kit.QuietMiningLogs()
+
+ b := kit.MockMinerBuilder
+ blocktime := 50 * time.Millisecond
+
+ ctx := context.Background()
+ fulls, miners := b(t,
+ kit.OneFull,
+ []kit.StorageMiner{
+ {Full: 0, Preseal: kit.PresealGenesis},
+ {Full: 0, Preseal: 0}, // TODO: Add support for miners on non-first full node
+ })
+ client := fulls[0].FullNode.(*impl.FullNodeAPI)
+ genesisMiner := miners[0]
+ provider := miners[1]
+
+ addrinfo, err := client.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := provider.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+
+ if err := genesisMiner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+
+ time.Sleep(time.Second)
+
+ data := make([]byte, 600)
+ rand.New(rand.NewSource(5)).Read(data)
+
+ r := bytes.NewReader(data)
+ fcid, err := client.ClientImportLocal(ctx, r)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ fmt.Println("FILE CID: ", fcid)
+
+ var mine int32 = 1
+ done := make(chan struct{})
+ minedTwo := make(chan struct{})
+
+ m2addr, err := miners[1].ActorAddress(context.TODO())
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ go func() {
+ defer close(done)
+
+ complChan := minedTwo
+ for atomic.LoadInt32(&mine) != 0 {
+ wait := make(chan int)
+ mdone := func(mined bool, _ abi.ChainEpoch, err error) {
+ n := 0
+ if mined {
+ n = 1
+ }
+ wait <- n
+ }
+
+ if err := miners[0].MineOne(ctx, miner.MineReq{Done: mdone}); err != nil {
+ t.Error(err)
+ }
+
+ if err := miners[1].MineOne(ctx, miner.MineReq{Done: mdone}); err != nil {
+ t.Error(err)
+ }
+
+ expect := <-wait
+ expect += <-wait
+
+ time.Sleep(blocktime)
+ if expect == 0 {
+ // null block
+ continue
+ }
+
+ var nodeOneMined bool
+ for _, node := range miners {
+ mb, err := node.MiningBase(ctx)
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ for _, b := range mb.Blocks() {
+ if b.Miner == m2addr {
+ nodeOneMined = true
+ break
+ }
+ }
+
+ }
+
+ if nodeOneMined && complChan != nil {
+ close(complChan)
+ complChan = nil
+ }
+
+ }
+ }()
+
+ dh := kit.NewDealHarness(t, client, provider)
+
+ deal := dh.StartDeal(ctx, fcid, false, 0)
+
+ // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
+ time.Sleep(time.Second)
+
+ dh.WaitDealSealed(ctx, deal, false, false, nil)
+
+ <-minedTwo
+
+ atomic.StoreInt32(&mine, 0)
+ fmt.Println("shutting down mining")
+ <-done
+}
+
+func TestOfflineDealFlow(t *testing.T) {
+ blocktime := 10 * time.Millisecond
+
+ // For these tests where the block time is artificially short, just use
+ // a deal start epoch that is guaranteed to be far enough in the future
+ // so that the deal starts sealing in time
+ startEpoch := abi.ChainEpoch(2 << 12)
+
+ runTest := func(t *testing.T, fastRet bool) {
+ ctx := context.Background()
+ fulls, miners := kit.MockMinerBuilder(t, kit.OneFull, kit.OneMiner)
+ client, miner := fulls[0].FullNode.(*impl.FullNodeAPI), miners[0]
+
+ kit.ConnectAndStartMining(t, blocktime, miner, client)
+
+ dh := kit.NewDealHarness(t, client, miner)
+
+ // Create a random file and import on the client.
+ res, path, data, err := kit.CreateImportFile(ctx, client, 1, 0)
+ require.NoError(t, err)
+
+ // Get the piece size and commP
+ fcid := res.Root
+ pieceInfo, err := client.ClientDealPieceCID(ctx, fcid)
+ require.NoError(t, err)
+ fmt.Println("FILE CID: ", fcid)
+
+ // Create a storage deal with the miner
+ maddr, err := miner.ActorAddress(ctx)
+ require.NoError(t, err)
+
+ addr, err := client.WalletDefaultAddress(ctx)
+ require.NoError(t, err)
+
+ // Manual storage deal (offline deal)
+ dataRef := &storagemarket.DataRef{
+ TransferType: storagemarket.TTManual,
+ Root: fcid,
+ PieceCid: &pieceInfo.PieceCID,
+ PieceSize: pieceInfo.PieceSize.Unpadded(),
+ }
+
+ proposalCid, err := client.ClientStartDeal(ctx, &api.StartDealParams{
+ Data: dataRef,
+ Wallet: addr,
+ Miner: maddr,
+ EpochPrice: types.NewInt(1000000),
+ DealStartEpoch: startEpoch,
+ MinBlocksDuration: uint64(build.MinDealDuration),
+ FastRetrieval: fastRet,
+ })
+ require.NoError(t, err)
+
+ // Wait for the deal to reach StorageDealCheckForAcceptance on the client
+ cd, err := client.ClientGetDealInfo(ctx, *proposalCid)
+ require.NoError(t, err)
+ require.Eventually(t, func() bool {
+ cd, _ := client.ClientGetDealInfo(ctx, *proposalCid)
+ return cd.State == storagemarket.StorageDealCheckForAcceptance
+ }, 30*time.Second, 1*time.Second, "actual deal status is %s", storagemarket.DealStates[cd.State])
+
+ // Create a CAR file from the raw file
+ carFileDir, err := ioutil.TempDir(os.TempDir(), "test-make-deal-car")
+ require.NoError(t, err)
+ carFilePath := filepath.Join(carFileDir, "out.car")
+ err = client.ClientGenCar(ctx, api.FileRef{Path: path}, carFilePath)
+ require.NoError(t, err)
+
+ // Import the CAR file on the miner - this is the equivalent to
+ // transferring the file across the wire in a normal (non-offline) deal
+ err = miner.DealsImportData(ctx, *proposalCid, carFilePath)
+ require.NoError(t, err)
+
+ // Wait for the deal to be published
+ dh.WaitDealPublished(ctx, proposalCid)
+
+ t.Logf("deal published, retrieving")
+
+ // Retrieve the deal
+ dh.TestRetrieval(ctx, fcid, &pieceInfo.PieceCID, false, data)
+ }
+
+ t.Run("NormalRetrieval", func(t *testing.T) {
+ runTest(t, false)
+ })
+ t.Run("FastRetrieval", func(t *testing.T) {
+ runTest(t, true)
+ })
+
+}
+
+func runFullDealCycles(t *testing.T, n int, b kit.APIBuilder, blocktime time.Duration, carExport, fastRet bool, startEpoch abi.ChainEpoch) {
+ fulls, miners := b(t, kit.OneFull, kit.OneMiner)
+ client, miner := fulls[0].FullNode.(*impl.FullNodeAPI), miners[0]
+
+ kit.ConnectAndStartMining(t, blocktime, miner, client)
+
+ dh := kit.NewDealHarness(t, client, miner)
+
+ baseseed := 6
+ for i := 0; i < n; i++ {
+ dh.MakeFullDeal(context.Background(), baseseed+i, carExport, fastRet, startEpoch)
+ }
+}
+
+func runFastRetrievalDealFlowT(t *testing.T, b kit.APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
+ ctx := context.Background()
+
+ fulls, miners := b(t, kit.OneFull, kit.OneMiner)
+ client, miner := fulls[0].FullNode.(*impl.FullNodeAPI), miners[0]
+
+ kit.ConnectAndStartMining(t, blocktime, miner, client)
+
+ dh := kit.NewDealHarness(t, client, miner)
+
+ data := make([]byte, 1600)
+ rand.New(rand.NewSource(int64(8))).Read(data)
+
+ r := bytes.NewReader(data)
+ fcid, err := client.ClientImportLocal(ctx, r)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ fmt.Println("FILE CID: ", fcid)
+
+ deal := dh.StartDeal(ctx, fcid, true, startEpoch)
+ dh.WaitDealPublished(ctx, deal)
+
+ fmt.Println("deal published, retrieving")
+
+ // Retrieval
+ info, err := client.ClientGetDealInfo(ctx, *deal)
+ require.NoError(t, err)
+
+ dh.TestRetrieval(ctx, fcid, &info.PieceCID, false, data)
+}
+
+func runSecondDealRetrievalTest(t *testing.T, b kit.APIBuilder, blocktime time.Duration) {
+ ctx := context.Background()
+
+ fulls, miners := b(t, kit.OneFull, kit.OneMiner)
+ client, miner := fulls[0].FullNode.(*impl.FullNodeAPI), miners[0]
+
+ kit.ConnectAndStartMining(t, blocktime, miner, client)
+
+ dh := kit.NewDealHarness(t, client, miner)
+
+ {
+ data1 := make([]byte, 800)
+ rand.New(rand.NewSource(int64(3))).Read(data1)
+ r := bytes.NewReader(data1)
+
+ fcid1, err := client.ClientImportLocal(ctx, r)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ data2 := make([]byte, 800)
+ rand.New(rand.NewSource(int64(9))).Read(data2)
+ r2 := bytes.NewReader(data2)
+
+ fcid2, err := client.ClientImportLocal(ctx, r2)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ deal1 := dh.StartDeal(ctx, fcid1, true, 0)
+
+ // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
+ time.Sleep(time.Second)
+ dh.WaitDealSealed(ctx, deal1, true, false, nil)
+
+ deal2 := dh.StartDeal(ctx, fcid2, true, 0)
+
+ time.Sleep(time.Second)
+ dh.WaitDealSealed(ctx, deal2, false, false, nil)
+
+ // Retrieval
+ info, err := client.ClientGetDealInfo(ctx, *deal2)
+ require.NoError(t, err)
+
+ rf, _ := miner.SectorsRefs(ctx)
+ fmt.Printf("refs: %+v\n", rf)
+
+ dh.TestRetrieval(ctx, fcid2, &info.PieceCID, false, data2)
+ }
+}
+
+func runZeroPricePerByteRetrievalDealFlow(t *testing.T, b kit.APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
+ ctx := context.Background()
+
+ fulls, miners := b(t, kit.OneFull, kit.OneMiner)
+ client, miner := fulls[0].FullNode.(*impl.FullNodeAPI), miners[0]
+
+ kit.ConnectAndStartMining(t, blocktime, miner, client)
+
+ dh := kit.NewDealHarness(t, client, miner)
+
+ // Set price-per-byte to zero
+ ask, err := miner.MarketGetRetrievalAsk(ctx)
+ require.NoError(t, err)
+
+ ask.PricePerByte = abi.NewTokenAmount(0)
+ err = miner.MarketSetRetrievalAsk(ctx, ask)
+ require.NoError(t, err)
+
+ dh.MakeFullDeal(ctx, 6, false, false, startEpoch)
+}
diff --git a/itests/doc.go b/itests/doc.go
new file mode 100644
index 000000000..474e57277
--- /dev/null
+++ b/itests/doc.go
@@ -0,0 +1,2 @@
+// Package itests contains integration tests for Lotus.
+package itests
diff --git a/cmd/lotus-gateway/endtoend_test.go b/itests/gateway_test.go
similarity index 73%
rename from cmd/lotus-gateway/endtoend_test.go
rename to itests/gateway_test.go
index 8c1901d65..7f1b70f2d 100644
--- a/cmd/lotus-gateway/endtoend_test.go
+++ b/itests/gateway_test.go
@@ -1,4 +1,4 @@
-package main
+package itests
import (
"bytes"
@@ -9,30 +9,32 @@ import (
"testing"
"time"
- "github.com/filecoin-project/lotus/cli"
- clitest "github.com/filecoin-project/lotus/cli/test"
-
- init2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/init"
- multisig2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/multisig"
-
+ "github.com/filecoin-project/lotus/chain/stmgr"
"github.com/stretchr/testify/require"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/go-state-types/abi"
+ "github.com/ipfs/go-cid"
+
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/client"
- "github.com/filecoin-project/lotus/api/test"
"github.com/filecoin-project/lotus/chain/actors/policy"
- "github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/cli"
+ "github.com/filecoin-project/lotus/gateway"
+ "github.com/filecoin-project/lotus/itests/kit"
"github.com/filecoin-project/lotus/node"
- builder "github.com/filecoin-project/lotus/node/test"
+
+ init2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/init"
+ multisig2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/multisig"
)
-const maxLookbackCap = time.Duration(math.MaxInt64)
-const maxStateWaitLookbackLimit = stmgr.LookbackNoLimit
+const (
+ maxLookbackCap = time.Duration(math.MaxInt64)
+ maxStateWaitLookbackLimit = stmgr.LookbackNoLimit
+)
func init() {
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
@@ -40,11 +42,11 @@ func init() {
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
}
-// TestWalletMsig tests that API calls to wallet and msig can be made on a lite
+// TestGatewayWalletMsig tests that API calls to wallet and msig can be made on a lite
// node that is connected through a gateway to a full API node
-func TestWalletMsig(t *testing.T) {
+func TestGatewayWalletMsig(t *testing.T) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
+ kit.QuietMiningLogs()
blocktime := 5 * time.Millisecond
ctx := context.Background()
@@ -100,10 +102,31 @@ func TestWalletMsig(t *testing.T) {
// Create an msig with three of the addresses and threshold of two sigs
msigAddrs := walletAddrs[:3]
amt := types.NewInt(1000)
- addProposal, err := lite.MsigCreate(ctx, 2, msigAddrs, abi.ChainEpoch(50), amt, liteWalletAddr, types.NewInt(0))
+ proto, err := lite.MsigCreate(ctx, 2, msigAddrs, abi.ChainEpoch(50), amt, liteWalletAddr, types.NewInt(0))
require.NoError(t, err)
- res, err := lite.StateWaitMsg(ctx, addProposal, 1)
+ doSend := func(proto *api.MessagePrototype) (cid.Cid, error) {
+ if proto.ValidNonce {
+ sm, err := lite.WalletSignMessage(ctx, proto.Message.From, &proto.Message)
+ if err != nil {
+ return cid.Undef, err
+ }
+
+ return lite.MpoolPush(ctx, sm)
+ }
+
+ sm, err := lite.MpoolPushMessage(ctx, &proto.Message, nil)
+ if err != nil {
+ return cid.Undef, err
+ }
+
+ return sm.Cid(), nil
+ }
+
+ addProposal, err := doSend(proto)
+ require.NoError(t, err)
+
+ res, err := lite.StateWaitMsg(ctx, addProposal, 1, api.LookbackNoLimit, true)
require.NoError(t, err)
require.EqualValues(t, 0, res.Receipt.ExitCode)
@@ -120,10 +143,13 @@ func TestWalletMsig(t *testing.T) {
require.Less(t, msigBalance.Int64(), amt.Int64())
// Propose to add a new address to the msig
- addProposal, err = lite.MsigAddPropose(ctx, msig, walletAddrs[0], walletAddrs[3], false)
+ proto, err = lite.MsigAddPropose(ctx, msig, walletAddrs[0], walletAddrs[3], false)
require.NoError(t, err)
- res, err = lite.StateWaitMsg(ctx, addProposal, 1)
+ addProposal, err = doSend(proto)
+ require.NoError(t, err)
+
+ res, err = lite.StateWaitMsg(ctx, addProposal, 1, api.LookbackNoLimit, true)
require.NoError(t, err)
require.EqualValues(t, 0, res.Receipt.ExitCode)
@@ -134,10 +160,13 @@ func TestWalletMsig(t *testing.T) {
// Approve proposal (proposer is first (implicit) signer, approver is
// second signer
txnID := uint64(proposeReturn.TxnID)
- approval1, err := lite.MsigAddApprove(ctx, msig, walletAddrs[1], txnID, walletAddrs[0], walletAddrs[3], false)
+ proto, err = lite.MsigAddApprove(ctx, msig, walletAddrs[1], txnID, walletAddrs[0], walletAddrs[3], false)
require.NoError(t, err)
- res, err = lite.StateWaitMsg(ctx, approval1, 1)
+ approval1, err := doSend(proto)
+ require.NoError(t, err)
+
+ res, err = lite.StateWaitMsg(ctx, approval1, 1, api.LookbackNoLimit, true)
require.NoError(t, err)
require.EqualValues(t, 0, res.Receipt.ExitCode)
@@ -147,11 +176,11 @@ func TestWalletMsig(t *testing.T) {
require.True(t, approveReturn.Applied)
}
-// TestMsigCLI tests that msig CLI calls can be made
+// TestGatewayMsigCLI tests that msig CLI calls can be made
// on a lite node that is connected through a gateway to a full API node
-func TestMsigCLI(t *testing.T) {
+func TestGatewayMsigCLI(t *testing.T) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
+ kit.QuietMiningLogs()
blocktime := 5 * time.Millisecond
ctx := context.Background()
@@ -159,12 +188,12 @@ func TestMsigCLI(t *testing.T) {
defer nodes.closer()
lite := nodes.lite
- clitest.RunMultisigTest(t, cli.Commands, lite)
+ runMultisigTests(t, lite)
}
-func TestDealFlow(t *testing.T) {
+func TestGatewayDealFlow(t *testing.T) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
+ kit.QuietMiningLogs()
blocktime := 5 * time.Millisecond
ctx := context.Background()
@@ -175,25 +204,27 @@ func TestDealFlow(t *testing.T) {
// a deal start epoch that is guaranteed to be far enough in the future
// so that the deal starts sealing in time
dealStartEpoch := abi.ChainEpoch(2 << 12)
- test.MakeDeal(t, ctx, 6, nodes.lite, nodes.miner, false, false, dealStartEpoch)
+
+ dh := kit.NewDealHarness(t, nodes.lite, nodes.miner)
+ dh.MakeFullDeal(ctx, 6, false, false, dealStartEpoch)
}
-func TestCLIDealFlow(t *testing.T) {
+func TestGatewayCLIDealFlow(t *testing.T) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
+ kit.QuietMiningLogs()
blocktime := 5 * time.Millisecond
ctx := context.Background()
nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit)
defer nodes.closer()
- clitest.RunClientTest(t, cli.Commands, nodes.lite)
+ kit.RunClientTest(t, cli.Commands, nodes.lite)
}
type testNodes struct {
- lite test.TestNode
- full test.TestNode
- miner test.TestStorageNode
+ lite kit.TestFullNode
+ full kit.TestFullNode
+ miner kit.TestMiner
closer jsonrpc.ClientCloser
}
@@ -236,21 +267,23 @@ func startNodes(
// - Connect lite node -> gateway server -> full node
opts := append(
// Full node
- test.OneFull,
+ kit.OneFull,
// Lite node
- test.FullNodeOpts{
+ kit.FullNodeOpts{
Lite: true,
- Opts: func(nodes []test.TestNode) node.Option {
+ Opts: func(nodes []kit.TestFullNode) node.Option {
fullNode := nodes[0]
// Create a gateway server in front of the full node
- gapiImpl := newGatewayAPI(fullNode, lookbackCap, stateWaitLookbackLimit)
- _, addr, err := builder.CreateRPCServer(t, gapiImpl)
+ gwapi := gateway.NewNode(fullNode, lookbackCap, stateWaitLookbackLimit)
+ handler, err := gateway.Handler(gwapi)
require.NoError(t, err)
+ srv, _ := kit.CreateRPCServer(t, handler)
+
// Create a gateway client API that connects to the gateway server
var gapi api.Gateway
- gapi, closer, err = client.NewGatewayRPC(ctx, addr, nil)
+ gapi, closer, err = client.NewGatewayRPCV1(ctx, "ws://"+srv.Listener.Addr().String()+"/rpc/v1", nil)
require.NoError(t, err)
// Provide the gateway API to dependency injection
@@ -258,7 +291,7 @@ func startNodes(
},
},
)
- n, sn := builder.RPCMockSbBuilder(t, opts, test.OneMiner)
+ n, sn := kit.RPCMockMinerBuilder(t, opts, kit.OneMiner)
full := n[0]
lite := n[1]
@@ -280,14 +313,14 @@ func startNodes(
require.NoError(t, err)
// Start mining blocks
- bm := test.NewBlockMiner(ctx, t, miner, blocktime)
- bm.MineBlocks()
+ bm := kit.NewBlockMiner(t, miner)
+ bm.MineBlocks(ctx, blocktime)
t.Cleanup(bm.Stop)
return &testNodes{lite: lite, full: full, miner: miner, closer: closer}
}
-func sendFunds(ctx context.Context, fromNode test.TestNode, fromAddr address.Address, toAddr address.Address, amt types.BigInt) error {
+func sendFunds(ctx context.Context, fromNode kit.TestFullNode, fromAddr address.Address, toAddr address.Address, amt types.BigInt) error {
msg := &types.Message{
From: fromAddr,
To: toAddr,
@@ -299,7 +332,7 @@ func sendFunds(ctx context.Context, fromNode test.TestNode, fromAddr address.Add
return err
}
- res, err := fromNode.StateWaitMsg(ctx, sm.Cid(), 1)
+ res, err := fromNode.StateWaitMsg(ctx, sm.Cid(), 3, api.LookbackNoLimit, true)
if err != nil {
return err
}
diff --git a/itests/kit/blockminer.go b/itests/kit/blockminer.go
new file mode 100644
index 000000000..3b1f1fedf
--- /dev/null
+++ b/itests/kit/blockminer.go
@@ -0,0 +1,124 @@
+package kit
+
+import (
+ "context"
+ "sync"
+ "sync/atomic"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/miner"
+ "github.com/stretchr/testify/require"
+)
+
+// BlockMiner is a utility that makes a test miner Mine blocks on a timer.
+type BlockMiner struct {
+ t *testing.T
+ miner TestMiner
+
+ nextNulls int64
+ wg sync.WaitGroup
+ cancel context.CancelFunc
+}
+
+func NewBlockMiner(t *testing.T, miner TestMiner) *BlockMiner {
+ return &BlockMiner{
+ t: t,
+ miner: miner,
+ cancel: func() {},
+ }
+}
+
+func (bm *BlockMiner) MineBlocks(ctx context.Context, blocktime time.Duration) {
+ time.Sleep(time.Second)
+
+ // wrap context in a cancellable context.
+ ctx, bm.cancel = context.WithCancel(ctx)
+
+ bm.wg.Add(1)
+ go func() {
+ defer bm.wg.Done()
+
+ for {
+ select {
+ case <-time.After(blocktime):
+ case <-ctx.Done():
+ return
+ }
+
+ nulls := atomic.SwapInt64(&bm.nextNulls, 0)
+ err := bm.miner.MineOne(ctx, miner.MineReq{
+ InjectNulls: abi.ChainEpoch(nulls),
+ Done: func(bool, abi.ChainEpoch, error) {},
+ })
+ switch {
+ case err == nil: // wrap around
+ case ctx.Err() != nil: // context fired.
+ return
+ default: // log error
+ bm.t.Error(err)
+ }
+ }
+ }()
+}
+
+// InjectNulls injects the specified amount of null rounds in the next
+// mining rounds.
+func (bm *BlockMiner) InjectNulls(rounds abi.ChainEpoch) {
+ atomic.AddInt64(&bm.nextNulls, int64(rounds))
+}
+
+func (bm *BlockMiner) MineUntilBlock(ctx context.Context, fn TestFullNode, cb func(abi.ChainEpoch)) {
+ for i := 0; i < 1000; i++ {
+ var (
+ success bool
+ err error
+ epoch abi.ChainEpoch
+ wait = make(chan struct{})
+ )
+
+ doneFn := func(win bool, ep abi.ChainEpoch, e error) {
+ success = win
+ err = e
+ epoch = ep
+ wait <- struct{}{}
+ }
+
+ mineErr := bm.miner.MineOne(ctx, miner.MineReq{Done: doneFn})
+ require.NoError(bm.t, mineErr)
+ <-wait
+
+ require.NoError(bm.t, err)
+
+ if success {
+ // Wait until it shows up on the given full nodes ChainHead
+ nloops := 50
+ for i := 0; i < nloops; i++ {
+ ts, err := fn.ChainHead(ctx)
+ require.NoError(bm.t, err)
+
+ if ts.Height() == epoch {
+ break
+ }
+
+ require.NotEqual(bm.t, i, nloops-1, "block never managed to sync to node")
+ time.Sleep(time.Millisecond * 10)
+ }
+
+ if cb != nil {
+ cb(epoch)
+ }
+ return
+ }
+ bm.t.Log("did not Mine block, trying again", i)
+ }
+ bm.t.Fatal("failed to Mine 1000 times in a row...")
+}
+
+// Stop stops the block miner.
+func (bm *BlockMiner) Stop() {
+ bm.t.Log("shutting down mining")
+ bm.cancel()
+ bm.wg.Wait()
+}
diff --git a/cli/test/client.go b/itests/kit/client.go
similarity index 63%
rename from cli/test/client.go
rename to itests/kit/client.go
index 4a49f732a..6b7d46265 100644
--- a/cli/test/client.go
+++ b/itests/kit/client.go
@@ -1,9 +1,10 @@
-package test
+package kit
import (
"context"
"fmt"
"io/ioutil"
+ "math/rand"
"os"
"path/filepath"
"regexp"
@@ -11,9 +12,7 @@ import (
"testing"
"time"
- "golang.org/x/xerrors"
-
- "github.com/filecoin-project/lotus/api/test"
+ "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/specs-actors/v2/actors/builtin"
@@ -21,8 +20,8 @@ import (
lcli "github.com/urfave/cli/v2"
)
-// RunClientTest exercises some of the client CLI commands
-func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode test.TestNode) {
+// RunClientTest exercises some of the Client CLI commands
+func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode TestFullNode) {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
@@ -30,7 +29,7 @@ func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode test.TestNode)
mockCLI := NewMockCLI(ctx, t, cmds)
clientCLI := mockCLI.Client(clientNode.ListenAddr)
- // Get the miner address
+ // Get the Miner address
addrs, err := clientNode.StateListMiners(ctx, types.EmptyTSK)
require.NoError(t, err)
require.Len(t, addrs, 1)
@@ -38,13 +37,14 @@ func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode test.TestNode)
minerAddr := addrs[0]
fmt.Println("Miner:", minerAddr)
- // client query-ask
+ // client query-ask
out := clientCLI.RunCmd("client", "query-ask", minerAddr.String())
require.Regexp(t, regexp.MustCompile("Ask:"), out)
// Create a deal (non-interactive)
- // client deal --start-epoch= 1000000attofil
- res, _, err := test.CreateClientFile(ctx, clientNode, 1)
+ // client deal --start-epoch= 1000000attofil
+ res, _, _, err := CreateImportFile(ctx, clientNode, 1, 0)
+
require.NoError(t, err)
startEpoch := fmt.Sprintf("--start-epoch=%d", 2<<12)
dataCid := res.Root
@@ -58,9 +58,9 @@ func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode test.TestNode)
//
// (in days)
//
- // "no" (verified client)
+ // "no" (verified Client)
// "yes" (confirm deal)
- res, _, err = test.CreateClientFile(ctx, clientNode, 2)
+ res, _, _, err = CreateImportFile(ctx, clientNode, 2, 0)
require.NoError(t, err)
dataCid2 := res.Root
duration = fmt.Sprintf("%d", build.MinDealDuration/builtin.EpochsInDay)
@@ -91,16 +91,19 @@ func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode test.TestNode)
}
dealStatus = parts[3]
fmt.Println(" Deal status:", dealStatus)
- if dealComplete(t, dealStatus) {
+
+ st := CategorizeDealState(dealStatus)
+ require.NotEqual(t, TestDealStateFailed, st)
+ if st == TestDealStateComplete {
break
}
time.Sleep(time.Second)
}
- // Retrieve the first file from the miner
+ // Retrieve the first file from the Miner
// client retrieve
- tmpdir, err := ioutil.TempDir(os.TempDir(), "test-cli-client")
+ tmpdir, err := ioutil.TempDir(os.TempDir(), "test-cli-Client")
require.NoError(t, err)
path := filepath.Join(tmpdir, "outfile.dat")
out = clientCLI.RunCmd("client", "retrieve", dataCid.String(), path)
@@ -108,13 +111,36 @@ func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode test.TestNode)
require.Regexp(t, regexp.MustCompile("Success"), out)
}
-func dealComplete(t *testing.T, dealStatus string) bool {
- switch dealStatus {
- case "StorageDealFailing", "StorageDealError":
- t.Fatal(xerrors.Errorf("Storage deal failed with status: " + dealStatus))
- case "StorageDealStaged", "StorageDealAwaitingPreCommit", "StorageDealSealing", "StorageDealActive", "StorageDealExpired", "StorageDealSlashed":
- return true
+func CreateImportFile(ctx context.Context, client api.FullNode, rseed int, size int) (res *api.ImportRes, path string, data []byte, err error) {
+ data, path, err = createRandomFile(rseed, size)
+ if err != nil {
+ return nil, "", nil, err
}
- return false
+ res, err = client.ClientImport(ctx, api.FileRef{Path: path})
+ if err != nil {
+ return nil, "", nil, err
+ }
+ return res, path, data, nil
+}
+
+func createRandomFile(rseed, size int) ([]byte, string, error) {
+ if size == 0 {
+ size = 1600
+ }
+ data := make([]byte, size)
+ rand.New(rand.NewSource(int64(rseed))).Read(data)
+
+ dir, err := ioutil.TempDir(os.TempDir(), "test-make-deal-")
+ if err != nil {
+ return nil, "", err
+ }
+
+ path := filepath.Join(dir, "sourcefile.dat")
+ err = ioutil.WriteFile(path, data, 0644)
+ if err != nil {
+ return nil, "", err
+ }
+
+ return data, path, nil
}
diff --git a/itests/kit/deals.go b/itests/kit/deals.go
new file mode 100644
index 000000000..c768eb87f
--- /dev/null
+++ b/itests/kit/deals.go
@@ -0,0 +1,312 @@
+package kit
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "testing"
+ "time"
+
+ "github.com/ipfs/go-cid"
+ files "github.com/ipfs/go-ipfs-files"
+ "github.com/ipld/go-car"
+ "github.com/stretchr/testify/require"
+
+ "github.com/filecoin-project/go-fil-markets/storagemarket"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/types"
+ sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
+ "github.com/filecoin-project/lotus/node/impl"
+ ipld "github.com/ipfs/go-ipld-format"
+ dag "github.com/ipfs/go-merkledag"
+ dstest "github.com/ipfs/go-merkledag/test"
+ unixfile "github.com/ipfs/go-unixfs/file"
+)
+
+type DealHarness struct {
+ t *testing.T
+ client api.FullNode
+ miner TestMiner
+}
+
+// NewDealHarness creates a test harness that contains testing utilities for deals.
+func NewDealHarness(t *testing.T, client api.FullNode, miner TestMiner) *DealHarness {
+ return &DealHarness{
+ t: t,
+ client: client,
+ miner: miner,
+ }
+}
+
+func (dh *DealHarness) MakeFullDeal(ctx context.Context, rseed int, carExport, fastRet bool, startEpoch abi.ChainEpoch) {
+ res, _, data, err := CreateImportFile(ctx, dh.client, rseed, 0)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+
+ fcid := res.Root
+ fmt.Println("FILE CID: ", fcid)
+
+ deal := dh.StartDeal(ctx, fcid, fastRet, startEpoch)
+
+ // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this
+ time.Sleep(time.Second)
+ dh.WaitDealSealed(ctx, deal, false, false, nil)
+
+ // Retrieval
+ info, err := dh.client.ClientGetDealInfo(ctx, *deal)
+ require.NoError(dh.t, err)
+
+ dh.TestRetrieval(ctx, fcid, &info.PieceCID, carExport, data)
+}
+
+func (dh *DealHarness) StartDeal(ctx context.Context, fcid cid.Cid, fastRet bool, startEpoch abi.ChainEpoch) *cid.Cid {
+ maddr, err := dh.miner.ActorAddress(ctx)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+
+ addr, err := dh.client.WalletDefaultAddress(ctx)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+ deal, err := dh.client.ClientStartDeal(ctx, &api.StartDealParams{
+ Data: &storagemarket.DataRef{
+ TransferType: storagemarket.TTGraphsync,
+ Root: fcid,
+ },
+ Wallet: addr,
+ Miner: maddr,
+ EpochPrice: types.NewInt(1000000),
+ DealStartEpoch: startEpoch,
+ MinBlocksDuration: uint64(build.MinDealDuration),
+ FastRetrieval: fastRet,
+ })
+ if err != nil {
+ dh.t.Fatalf("%+v", err)
+ }
+ return deal
+}
+
+func (dh *DealHarness) WaitDealSealed(ctx context.Context, deal *cid.Cid, noseal, noSealStart bool, cb func()) {
+loop:
+ for {
+ di, err := dh.client.ClientGetDealInfo(ctx, *deal)
+ require.NoError(dh.t, err)
+
+ switch di.State {
+ case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing:
+ if noseal {
+ return
+ }
+ if !noSealStart {
+ dh.StartSealingWaiting(ctx)
+ }
+ case storagemarket.StorageDealProposalRejected:
+ dh.t.Fatal("deal rejected")
+ case storagemarket.StorageDealFailing:
+ dh.t.Fatal("deal failed")
+ case storagemarket.StorageDealError:
+ dh.t.Fatal("deal errored", di.Message)
+ case storagemarket.StorageDealActive:
+ fmt.Println("COMPLETE", di)
+ break loop
+ }
+
+ mds, err := dh.miner.MarketListIncompleteDeals(ctx)
+ require.NoError(dh.t, err)
+
+ var minerState storagemarket.StorageDealStatus
+ for _, md := range mds {
+ if md.DealID == di.DealID {
+ minerState = md.State
+ break
+ }
+ }
+
+ fmt.Printf("Deal %d state: client:%s provider:%s\n", di.DealID, storagemarket.DealStates[di.State], storagemarket.DealStates[minerState])
+ time.Sleep(time.Second / 2)
+ if cb != nil {
+ cb()
+ }
+ }
+}
+
+func (dh *DealHarness) WaitDealPublished(ctx context.Context, deal *cid.Cid) {
+ subCtx, cancel := context.WithCancel(ctx)
+ defer cancel()
+ updates, err := dh.miner.MarketGetDealUpdates(subCtx)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+ for {
+ select {
+ case <-ctx.Done():
+ dh.t.Fatal("context timeout")
+ case di := <-updates:
+ if deal.Equals(di.ProposalCid) {
+ switch di.State {
+ case storagemarket.StorageDealProposalRejected:
+ dh.t.Fatal("deal rejected")
+ case storagemarket.StorageDealFailing:
+ dh.t.Fatal("deal failed")
+ case storagemarket.StorageDealError:
+ dh.t.Fatal("deal errored", di.Message)
+ case storagemarket.StorageDealFinalizing, storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing, storagemarket.StorageDealActive:
+ fmt.Println("COMPLETE", di)
+ return
+ }
+ fmt.Println("Deal state: ", storagemarket.DealStates[di.State])
+ }
+ }
+ }
+}
+
+func (dh *DealHarness) StartSealingWaiting(ctx context.Context) {
+ snums, err := dh.miner.SectorsList(ctx)
+ require.NoError(dh.t, err)
+
+ for _, snum := range snums {
+ si, err := dh.miner.SectorsStatus(ctx, snum, false)
+ require.NoError(dh.t, err)
+
+ dh.t.Logf("Sector state: %s", si.State)
+ if si.State == api.SectorState(sealing.WaitDeals) {
+ require.NoError(dh.t, dh.miner.SectorStartSealing(ctx, snum))
+ }
+
+ flushSealingBatches(dh.t, ctx, dh.miner)
+ }
+}
+
+func (dh *DealHarness) TestRetrieval(ctx context.Context, fcid cid.Cid, piece *cid.Cid, carExport bool, expect []byte) {
+ offers, err := dh.client.ClientFindData(ctx, fcid, piece)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+
+ if len(offers) < 1 {
+ dh.t.Fatal("no offers")
+ }
+
+ rpath, err := ioutil.TempDir("", "lotus-retrieve-test-")
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+ defer os.RemoveAll(rpath) //nolint:errcheck
+
+ caddr, err := dh.client.WalletDefaultAddress(ctx)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+
+ ref := &api.FileRef{
+ Path: filepath.Join(rpath, "ret"),
+ IsCAR: carExport,
+ }
+ updates, err := dh.client.ClientRetrieveWithEvents(ctx, offers[0].Order(caddr), ref)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+ for update := range updates {
+ if update.Err != "" {
+ dh.t.Fatalf("retrieval failed: %s", update.Err)
+ }
+ }
+
+ rdata, err := ioutil.ReadFile(filepath.Join(rpath, "ret"))
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+
+ if carExport {
+ rdata = dh.ExtractCarData(ctx, rdata, rpath)
+ }
+
+ if !bytes.Equal(rdata, expect) {
+ dh.t.Fatal("wrong expect retrieved")
+ }
+}
+
+func (dh *DealHarness) ExtractCarData(ctx context.Context, rdata []byte, rpath string) []byte {
+ bserv := dstest.Bserv()
+ ch, err := car.LoadCar(bserv.Blockstore(), bytes.NewReader(rdata))
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+ b, err := bserv.GetBlock(ctx, ch.Roots[0])
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+ nd, err := ipld.Decode(b)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+ dserv := dag.NewDAGService(bserv)
+ fil, err := unixfile.NewUnixfsFile(ctx, dserv, nd)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+ outPath := filepath.Join(rpath, "retLoadedCAR")
+ if err := files.WriteTo(fil, outPath); err != nil {
+ dh.t.Fatal(err)
+ }
+ rdata, err = ioutil.ReadFile(outPath)
+ if err != nil {
+ dh.t.Fatal(err)
+ }
+ return rdata
+}
+
+type DealsScaffold struct {
+ Ctx context.Context
+ Client *impl.FullNodeAPI
+ Miner TestMiner
+ BlockMiner *BlockMiner
+}
+
+func ConnectAndStartMining(t *testing.T, blocktime time.Duration, miner TestMiner, clients ...api.FullNode) *BlockMiner {
+ ctx := context.Background()
+
+ for _, c := range clients {
+ addrinfo, err := c.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := miner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+ }
+
+ time.Sleep(time.Second)
+
+ blockMiner := NewBlockMiner(t, miner)
+ blockMiner.MineBlocks(ctx, blocktime)
+ t.Cleanup(blockMiner.Stop)
+ return blockMiner
+}
+
+type TestDealState int
+
+const (
+ TestDealStateFailed = TestDealState(-1)
+ TestDealStateInProgress = TestDealState(0)
+ TestDealStateComplete = TestDealState(1)
+)
+
+// CategorizeDealState categorizes deal states into one of three states:
+// Complete, InProgress, Failed.
+func CategorizeDealState(dealStatus string) TestDealState {
+ switch dealStatus {
+ case "StorageDealFailing", "StorageDealError":
+ return TestDealStateFailed
+ case "StorageDealStaged", "StorageDealAwaitingPreCommit", "StorageDealSealing", "StorageDealActive", "StorageDealExpired", "StorageDealSlashed":
+ return TestDealStateComplete
+ }
+ return TestDealStateInProgress
+}
diff --git a/itests/kit/funds.go b/itests/kit/funds.go
new file mode 100644
index 000000000..4c739dc62
--- /dev/null
+++ b/itests/kit/funds.go
@@ -0,0 +1,39 @@
+package kit
+
+import (
+ "context"
+ "testing"
+
+ "github.com/filecoin-project/go-state-types/abi"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/chain/types"
+)
+
+// SendFunds sends funds from the default wallet of the specified sender node
+// to the recipient address.
+func SendFunds(ctx context.Context, t *testing.T, sender TestFullNode, recipient address.Address, amount abi.TokenAmount) {
+ senderAddr, err := sender.WalletDefaultAddress(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ msg := &types.Message{
+ From: senderAddr,
+ To: recipient,
+ Value: amount,
+ }
+
+ sm, err := sender.MpoolPushMessage(ctx, msg, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ res, err := sender.StateWaitMsg(ctx, sm.Cid(), 3, api.LookbackNoLimit, true)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if res.Receipt.ExitCode != 0 {
+ t.Fatal("did not successfully send money")
+ }
+}
diff --git a/itests/kit/init.go b/itests/kit/init.go
new file mode 100644
index 000000000..2f40ca0f0
--- /dev/null
+++ b/itests/kit/init.go
@@ -0,0 +1,32 @@
+package kit
+
+import (
+ "fmt"
+ "os"
+ "strings"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/actors/policy"
+ logging "github.com/ipfs/go-log/v2"
+)
+
+func init() {
+ bin := os.Args[0]
+ if !strings.HasSuffix(bin, ".test") {
+ panic("package itests/kit must only be imported from tests")
+ }
+
+ _ = logging.SetLogLevel("*", "INFO")
+
+ policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
+ policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
+ policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
+
+ err := os.Setenv("BELLMAN_NO_GPU", "1")
+ if err != nil {
+ panic(fmt.Sprintf("failed to set BELLMAN_NO_GPU env variable: %s", err))
+ }
+ build.InsecurePoStValidation = true
+
+}
diff --git a/itests/kit/log.go b/itests/kit/log.go
new file mode 100644
index 000000000..638e768d8
--- /dev/null
+++ b/itests/kit/log.go
@@ -0,0 +1,19 @@
+package kit
+
+import (
+ "github.com/filecoin-project/lotus/lib/lotuslog"
+ logging "github.com/ipfs/go-log/v2"
+)
+
+func QuietMiningLogs() {
+ lotuslog.SetupLogLevels()
+
+ _ = logging.SetLogLevel("miner", "ERROR")
+ _ = logging.SetLogLevel("chainstore", "ERROR")
+ _ = logging.SetLogLevel("chain", "ERROR")
+ _ = logging.SetLogLevel("sub", "ERROR")
+ _ = logging.SetLogLevel("storageminer", "ERROR")
+ _ = logging.SetLogLevel("pubsub", "ERROR")
+ _ = logging.SetLogLevel("gen", "ERROR")
+ _ = logging.SetLogLevel("dht/RtRefreshManager", "ERROR")
+}
diff --git a/cli/test/mockcli.go b/itests/kit/mockcli.go
similarity index 98%
rename from cli/test/mockcli.go
rename to itests/kit/mockcli.go
index e8eb78f1b..c0f218920 100644
--- a/cli/test/mockcli.go
+++ b/itests/kit/mockcli.go
@@ -1,4 +1,4 @@
-package test
+package kit
import (
"bytes"
@@ -56,7 +56,7 @@ type MockCLIClient struct {
func (c *MockCLIClient) RunCmd(input ...string) string {
out, err := c.RunCmdRaw(input...)
- require.NoError(c.t, err)
+ require.NoError(c.t, err, "output:\n%s", out)
return out
}
diff --git a/cli/test/net.go b/itests/kit/net.go
similarity index 71%
rename from cli/test/net.go
rename to itests/kit/net.go
index 8e45e3aed..54c72443f 100644
--- a/cli/test/net.go
+++ b/itests/kit/net.go
@@ -1,4 +1,4 @@
-package test
+package kit
import (
"context"
@@ -9,12 +9,10 @@ import (
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/go-address"
- "github.com/filecoin-project/lotus/api/test"
- test2 "github.com/filecoin-project/lotus/node/test"
)
-func StartOneNodeOneMiner(ctx context.Context, t *testing.T, blocktime time.Duration) (test.TestNode, address.Address) {
- n, sn := test2.RPCMockSbBuilder(t, test.OneFull, test.OneMiner)
+func StartOneNodeOneMiner(ctx context.Context, t *testing.T, blocktime time.Duration) (TestFullNode, address.Address) {
+ n, sn := RPCMockMinerBuilder(t, OneFull, OneMiner)
full := n[0]
miner := sn[0]
@@ -30,8 +28,8 @@ func StartOneNodeOneMiner(ctx context.Context, t *testing.T, blocktime time.Dura
}
// Start mining blocks
- bm := test.NewBlockMiner(ctx, t, miner, blocktime)
- bm.MineBlocks()
+ bm := NewBlockMiner(t, miner)
+ bm.MineBlocks(ctx, blocktime)
t.Cleanup(bm.Stop)
// Get the full node's wallet address
@@ -44,8 +42,8 @@ func StartOneNodeOneMiner(ctx context.Context, t *testing.T, blocktime time.Dura
return full, fullAddr
}
-func StartTwoNodesOneMiner(ctx context.Context, t *testing.T, blocktime time.Duration) ([]test.TestNode, []address.Address) {
- n, sn := test2.RPCMockSbBuilder(t, test.TwoFull, test.OneMiner)
+func StartTwoNodesOneMiner(ctx context.Context, t *testing.T, blocktime time.Duration) ([]TestFullNode, []address.Address) {
+ n, sn := RPCMockMinerBuilder(t, TwoFull, OneMiner)
fullNode1 := n[0]
fullNode2 := n[1]
@@ -66,8 +64,8 @@ func StartTwoNodesOneMiner(ctx context.Context, t *testing.T, blocktime time.Dur
}
// Start mining blocks
- bm := test.NewBlockMiner(ctx, t, miner, blocktime)
- bm.MineBlocks()
+ bm := NewBlockMiner(t, miner)
+ bm.MineBlocks(ctx, blocktime)
t.Cleanup(bm.Stop)
// Send some funds to register the second node
@@ -76,7 +74,7 @@ func StartTwoNodesOneMiner(ctx context.Context, t *testing.T, blocktime time.Dur
t.Fatal(err)
}
- test.SendFunds(ctx, t, fullNode1, fullNodeAddr2, abi.NewTokenAmount(1e18))
+ SendFunds(ctx, t, fullNode1, fullNodeAddr2, abi.NewTokenAmount(1e18))
// Get the first node's address
fullNodeAddr1, err := fullNode1.WalletDefaultAddress(ctx)
diff --git a/node/test/builder.go b/itests/kit/node_builder.go
similarity index 69%
rename from node/test/builder.go
rename to itests/kit/node_builder.go
index 174f07592..3780a7669 100644
--- a/node/test/builder.go
+++ b/itests/kit/node_builder.go
@@ -1,28 +1,26 @@
-package test
+package kit
import (
"bytes"
"context"
"crypto/rand"
"io/ioutil"
- "net"
+ "net/http"
"net/http/httptest"
- "strings"
"sync"
"testing"
"time"
- "golang.org/x/xerrors"
+ "github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/go-address"
- "github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/go-storedcounter"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/client"
- "github.com/filecoin-project/lotus/api/test"
+ "github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain"
"github.com/filecoin-project/lotus/chain/actors"
@@ -52,6 +50,7 @@ import (
"github.com/libp2p/go-libp2p-core/peer"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
"github.com/multiformats/go-multiaddr"
+ manet "github.com/multiformats/go-multiaddr/net"
"github.com/stretchr/testify/require"
)
@@ -62,7 +61,7 @@ func init() {
messagepool.HeadChangeCoalesceMergeInterval = 100 * time.Nanosecond
}
-func CreateTestStorageNode(ctx context.Context, t *testing.T, waddr address.Address, act address.Address, pk crypto.PrivKey, tnd test.TestNode, mn mocknet.Mocknet, opts node.Option) test.TestStorageNode {
+func CreateTestStorageNode(ctx context.Context, t *testing.T, waddr address.Address, act address.Address, pk crypto.PrivKey, tnd TestFullNode, mn mocknet.Mocknet, opts node.Option) TestMiner {
r := repo.NewMemory(nil)
lr, err := r.Lock(repo.StorageMiner)
@@ -86,7 +85,7 @@ func CreateTestStorageNode(ctx context.Context, t *testing.T, waddr address.Addr
require.NoError(t, err)
nic := storedcounter.New(ds, datastore.NewKey(modules.StorageCounterDSPrefix))
- for i := 0; i < test.GenesisPreseals; i++ {
+ for i := 0; i < GenesisPreseals; i++ {
_, err := nic.Next()
require.NoError(t, err)
}
@@ -125,7 +124,7 @@ func CreateTestStorageNode(ctx context.Context, t *testing.T, waddr address.Addr
node.MockHost(mn),
- node.Override(new(api.FullNode), tnd),
+ node.Override(new(v1api.FullNode), tnd),
node.Override(new(*lotusminer.Miner), lotusminer.NewTestMiner(mineBlock, act)),
opts,
@@ -137,10 +136,10 @@ func CreateTestStorageNode(ctx context.Context, t *testing.T, waddr address.Addr
t.Cleanup(func() { _ = stop(context.Background()) })
/*// Bootstrap with full node
- remoteAddrs, err := tnd.NetAddrsListen(ctx)
+ remoteAddrs, err := tnd.NetAddrsListen(Ctx)
require.NoError(t, err)
- err = minerapi.NetConnect(ctx, remoteAddrs)
+ err = minerapi.NetConnect(Ctx, remoteAddrs)
require.NoError(t, err)*/
mineOne := func(ctx context.Context, req lotusminer.MineReq) error {
select {
@@ -151,11 +150,11 @@ func CreateTestStorageNode(ctx context.Context, t *testing.T, waddr address.Addr
}
}
- return test.TestStorageNode{StorageMiner: minerapi, MineOne: mineOne, Stop: stop}
+ return TestMiner{StorageMiner: minerapi, MineOne: mineOne, Stop: stop}
}
-func storageBuilder(parentNode test.TestNode, mn mocknet.Mocknet, opts node.Option) test.StorageBuilder {
- return func(ctx context.Context, t *testing.T, spt abi.RegisteredSealProof, owner address.Address) test.TestStorageNode {
+func storageBuilder(parentNode TestFullNode, mn mocknet.Mocknet, opts node.Option) MinerBuilder {
+ return func(ctx context.Context, t *testing.T, spt abi.RegisteredSealProof, owner address.Address) TestMiner {
pk, _, err := crypto.GenerateEd25519Key(rand.Reader)
require.NoError(t, err)
@@ -185,7 +184,7 @@ func storageBuilder(parentNode test.TestNode, mn mocknet.Mocknet, opts node.Opti
signed, err := parentNode.MpoolPushMessage(ctx, createStorageMinerMsg, nil)
require.NoError(t, err)
- mw, err := parentNode.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence)
+ mw, err := parentNode.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence, api.LookbackNoLimit, true)
require.NoError(t, err)
require.Equal(t, exitcode.Ok, mw.Receipt.ExitCode)
@@ -197,31 +196,32 @@ func storageBuilder(parentNode test.TestNode, mn mocknet.Mocknet, opts node.Opti
}
}
-func Builder(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.StorageMiner) ([]test.TestNode, []test.TestStorageNode) {
+func Builder(t *testing.T, fullOpts []FullNodeOpts, storage []StorageMiner) ([]TestFullNode, []TestMiner) {
return mockBuilderOpts(t, fullOpts, storage, false)
}
-func MockSbBuilder(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.StorageMiner) ([]test.TestNode, []test.TestStorageNode) {
- return mockSbBuilderOpts(t, fullOpts, storage, false)
-}
-
-func RPCBuilder(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.StorageMiner) ([]test.TestNode, []test.TestStorageNode) {
+func RPCBuilder(t *testing.T, fullOpts []FullNodeOpts, storage []StorageMiner) ([]TestFullNode, []TestMiner) {
return mockBuilderOpts(t, fullOpts, storage, true)
}
-func RPCMockSbBuilder(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.StorageMiner) ([]test.TestNode, []test.TestStorageNode) {
- return mockSbBuilderOpts(t, fullOpts, storage, true)
+func MockMinerBuilder(t *testing.T, fullOpts []FullNodeOpts, storage []StorageMiner) ([]TestFullNode, []TestMiner) {
+ return mockMinerBuilderOpts(t, fullOpts, storage, false)
}
-func mockBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.StorageMiner, rpc bool) ([]test.TestNode, []test.TestStorageNode) {
+func RPCMockMinerBuilder(t *testing.T, fullOpts []FullNodeOpts, storage []StorageMiner) ([]TestFullNode, []TestMiner) {
+ return mockMinerBuilderOpts(t, fullOpts, storage, true)
+}
+
+func mockBuilderOpts(t *testing.T, fullOpts []FullNodeOpts, storage []StorageMiner, rpc bool) ([]TestFullNode, []TestMiner) {
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
mn := mocknet.New(ctx)
- fulls := make([]test.TestNode, len(fullOpts))
- storers := make([]test.TestStorageNode, len(storage))
+ fulls := make([]TestFullNode, len(fullOpts))
+ miners := make([]TestMiner, len(storage))
+ // *****
pk, _, err := crypto.GenerateEd25519Key(rand.Reader)
require.NoError(t, err)
@@ -233,13 +233,17 @@ func mockBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.
if len(storage) > 1 {
panic("need more peer IDs")
}
+ // *****
+
// PRESEAL SECTION, TRY TO REPLACE WITH BETTER IN THE FUTURE
// TODO: would be great if there was a better way to fake the preseals
- var genms []genesis.Miner
- var maddrs []address.Address
- var genaccs []genesis.Actor
- var keys []*wallet.Key
+ var (
+ genms []genesis.Miner
+ maddrs []address.Address
+ genaccs []genesis.Actor
+ keys []*wallet.Key
+ )
var presealDirs []string
for i := 0; i < len(storage); i++ {
@@ -251,7 +255,7 @@ func mockBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.
if err != nil {
t.Fatal(err)
}
- genm, k, err := seed.PreSeal(maddr, abi.RegisteredSealProof_StackedDrg2KiBV1, 0, test.GenesisPreseals, tdir, []byte("make genesis mem random"), nil, true)
+ genm, k, err := seed.PreSeal(maddr, abi.RegisteredSealProof_StackedDrg2KiBV1, 0, GenesisPreseals, tdir, []byte("make genesis mem random"), nil, true)
if err != nil {
t.Fatal(err)
}
@@ -273,12 +277,26 @@ func mockBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.
maddrs = append(maddrs, maddr)
genms = append(genms, *genm)
}
+
+ rkhKey, err := wallet.GenerateKey(types.KTSecp256k1)
+ if err != nil {
+ return nil, nil
+ }
+
+ vrk := genesis.Actor{
+ Type: genesis.TAccount,
+ Balance: big.Mul(big.Div(big.NewInt(int64(build.FilBase)), big.NewInt(100)), big.NewInt(int64(build.FilecoinPrecision))),
+ Meta: (&genesis.AccountMeta{Owner: rkhKey.Address}).ActorMeta(),
+ }
+ keys = append(keys, rkhKey)
+
templ := &genesis.Template{
+ NetworkVersion: network.Version0,
Accounts: genaccs,
Miners: genms,
NetworkName: "test",
Timestamp: uint64(time.Now().Unix() - 10000), // some time sufficiently far in the past
- VerifregRootKey: gen.DefaultVerifregRootkeyActor,
+ VerifregRootKey: vrk,
RemainderAccount: gen.DefaultRemainderAccountActor,
}
@@ -303,6 +321,7 @@ func mockBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.
fullOpts[i].Opts(fulls),
)
+
if err != nil {
t.Fatal(err)
}
@@ -316,6 +335,10 @@ func mockBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.
fulls[i].Stb = storageBuilder(fulls[i], mn, node.Options())
}
+ if _, err := fulls[0].FullNode.WalletImport(ctx, &rkhKey.KeyInfo); err != nil {
+ t.Fatal(err)
+ }
+
for i, def := range storage {
// TODO: support non-bootstrap miners
if i != 0 {
@@ -340,17 +363,17 @@ func mockBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.
if opts == nil {
opts = node.Options()
}
- storers[i] = CreateTestStorageNode(ctx, t, wa, genMiner, pk, f, mn, opts)
- if err := storers[i].StorageAddLocal(ctx, presealDirs[i]); err != nil {
+ miners[i] = CreateTestStorageNode(ctx, t, wa, genMiner, pk, f, mn, opts)
+ if err := miners[i].StorageAddLocal(ctx, presealDirs[i]); err != nil {
t.Fatalf("%+v", err)
}
/*
- sma := storers[i].StorageMiner.(*impl.StorageMinerAPI)
+ sma := miners[i].StorageMiner.(*impl.StorageMinerAPI)
psd := presealDirs[i]
*/
if rpc {
- storers[i] = storerRpc(t, storers[i])
+ miners[i] = storerRpc(t, miners[i])
}
}
@@ -358,44 +381,49 @@ func mockBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.
t.Fatal(err)
}
- if len(storers) > 0 {
+ if len(miners) > 0 {
// Mine 2 blocks to setup some CE stuff in some actors
var wait sync.Mutex
wait.Lock()
- test.MineUntilBlock(ctx, t, fulls[0], storers[0], func(epoch abi.ChainEpoch) {
+ bm := NewBlockMiner(t, miners[0])
+ t.Cleanup(bm.Stop)
+
+ bm.MineUntilBlock(ctx, fulls[0], func(epoch abi.ChainEpoch) {
wait.Unlock()
})
wait.Lock()
- test.MineUntilBlock(ctx, t, fulls[0], storers[0], func(epoch abi.ChainEpoch) {
+ bm.MineUntilBlock(ctx, fulls[0], func(epoch abi.ChainEpoch) {
wait.Unlock()
})
wait.Lock()
}
- return fulls, storers
+ return fulls, miners
}
-func mockSbBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []test.StorageMiner, rpc bool) ([]test.TestNode, []test.TestStorageNode) {
+func mockMinerBuilderOpts(t *testing.T, fullOpts []FullNodeOpts, storage []StorageMiner, rpc bool) ([]TestFullNode, []TestMiner) {
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
mn := mocknet.New(ctx)
- fulls := make([]test.TestNode, len(fullOpts))
- storers := make([]test.TestStorageNode, len(storage))
+ fulls := make([]TestFullNode, len(fullOpts))
+ miners := make([]TestMiner, len(storage))
var genbuf bytes.Buffer
// PRESEAL SECTION, TRY TO REPLACE WITH BETTER IN THE FUTURE
// TODO: would be great if there was a better way to fake the preseals
- var genms []genesis.Miner
- var genaccs []genesis.Actor
- var maddrs []address.Address
- var keys []*wallet.Key
- var pidKeys []crypto.PrivKey
+ var (
+ genms []genesis.Miner
+ genaccs []genesis.Actor
+ maddrs []address.Address
+ keys []*wallet.Key
+ pidKeys []crypto.PrivKey
+ )
for i := 0; i < len(storage); i++ {
maddr, err := address.NewIDAddress(genesis2.MinerStart + uint64(i))
if err != nil {
@@ -403,8 +431,8 @@ func mockSbBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []tes
}
preseals := storage[i].Preseal
- if preseals == test.PresealGenesis {
- preseals = test.GenesisPreseals
+ if preseals == PresealGenesis {
+ preseals = GenesisPreseals
}
genm, k, err := mockstorage.PreSeal(abi.RegisteredSealProof_StackedDrg2KiBV1, maddr, preseals)
@@ -436,12 +464,26 @@ func mockSbBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []tes
maddrs = append(maddrs, maddr)
genms = append(genms, *genm)
}
+
+ rkhKey, err := wallet.GenerateKey(types.KTSecp256k1)
+ if err != nil {
+ return nil, nil
+ }
+
+ vrk := genesis.Actor{
+ Type: genesis.TAccount,
+ Balance: big.Mul(big.Div(big.NewInt(int64(build.FilBase)), big.NewInt(100)), big.NewInt(int64(build.FilecoinPrecision))),
+ Meta: (&genesis.AccountMeta{Owner: rkhKey.Address}).ActorMeta(),
+ }
+ keys = append(keys, rkhKey)
+
templ := &genesis.Template{
+ NetworkVersion: network.Version0,
Accounts: genaccs,
Miners: genms,
NetworkName: "test",
Timestamp: uint64(time.Now().Unix()) - (build.BlockDelaySecs * 20000),
- VerifregRootKey: gen.DefaultVerifregRootkeyActor,
+ VerifregRootKey: vrk,
RemainderAccount: gen.DefaultRemainderAccountActor,
}
@@ -483,15 +525,24 @@ func mockSbBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []tes
}
fulls[i].Stb = storageBuilder(fulls[i], mn, node.Options(
- node.Override(new(sectorstorage.SectorManager), func() (sectorstorage.SectorManager, error) {
+ node.Override(new(*mock.SectorMgr), func() (*mock.SectorMgr, error) {
return mock.NewMockSectorMgr(nil), nil
}),
+
+ node.Override(new(sectorstorage.SectorManager), node.From(new(*mock.SectorMgr))),
+ node.Override(new(sectorstorage.Unsealer), node.From(new(*mock.SectorMgr))),
+ node.Override(new(sectorstorage.PieceProvider), node.From(new(*mock.SectorMgr))),
+
node.Override(new(ffiwrapper.Verifier), mock.MockVerifier),
node.Override(new(ffiwrapper.Prover), mock.MockProver),
node.Unset(new(*sectorstorage.Manager)),
))
}
+ if _, err := fulls[0].FullNode.WalletImport(ctx, &rkhKey.KeyInfo); err != nil {
+ t.Fatal(err)
+ }
+
for i, def := range storage {
// TODO: support non-bootstrap miners
@@ -521,10 +572,15 @@ func mockSbBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []tes
if opts == nil {
opts = node.Options()
}
- storers[i] = CreateTestStorageNode(ctx, t, genms[i].Worker, maddrs[i], pidKeys[i], f, mn, node.Options(
- node.Override(new(sectorstorage.SectorManager), func() (sectorstorage.SectorManager, error) {
+ miners[i] = CreateTestStorageNode(ctx, t, genms[i].Worker, maddrs[i], pidKeys[i], f, mn, node.Options(
+ node.Override(new(*mock.SectorMgr), func() (*mock.SectorMgr, error) {
return mock.NewMockSectorMgr(sectors), nil
}),
+
+ node.Override(new(sectorstorage.SectorManager), node.From(new(*mock.SectorMgr))),
+ node.Override(new(sectorstorage.Unsealer), node.From(new(*mock.SectorMgr))),
+ node.Override(new(sectorstorage.PieceProvider), node.From(new(*mock.SectorMgr))),
+
node.Override(new(ffiwrapper.Verifier), mock.MockVerifier),
node.Override(new(ffiwrapper.Prover), mock.MockProver),
node.Unset(new(*sectorstorage.Manager)),
@@ -532,7 +588,7 @@ func mockSbBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []tes
))
if rpc {
- storers[i] = storerRpc(t, storers[i])
+ miners[i] = storerRpc(t, miners[i])
}
}
@@ -540,90 +596,63 @@ func mockSbBuilderOpts(t *testing.T, fullOpts []test.FullNodeOpts, storage []tes
t.Fatal(err)
}
- if len(storers) > 0 {
+ bm := NewBlockMiner(t, miners[0])
+
+ if len(miners) > 0 {
// Mine 2 blocks to setup some CE stuff in some actors
var wait sync.Mutex
wait.Lock()
- test.MineUntilBlock(ctx, t, fulls[0], storers[0], func(abi.ChainEpoch) {
+ bm.MineUntilBlock(ctx, fulls[0], func(abi.ChainEpoch) {
wait.Unlock()
})
wait.Lock()
- test.MineUntilBlock(ctx, t, fulls[0], storers[0], func(abi.ChainEpoch) {
+ bm.MineUntilBlock(ctx, fulls[0], func(abi.ChainEpoch) {
wait.Unlock()
})
wait.Lock()
}
- return fulls, storers
+ return fulls, miners
}
-func fullRpc(t *testing.T, nd test.TestNode) test.TestNode {
- ma, listenAddr, err := CreateRPCServer(t, nd)
- require.NoError(t, err)
-
- var stop func()
- var full test.TestNode
- full.FullNode, stop, err = client.NewFullNodeRPC(context.Background(), listenAddr, nil)
- require.NoError(t, err)
- t.Cleanup(stop)
-
- full.ListenAddr = ma
- return full
-}
-
-func storerRpc(t *testing.T, nd test.TestStorageNode) test.TestStorageNode {
- ma, listenAddr, err := CreateRPCServer(t, nd)
- require.NoError(t, err)
-
- var stop func()
- var storer test.TestStorageNode
- storer.StorageMiner, stop, err = client.NewStorageMinerRPC(context.Background(), listenAddr, nil)
- require.NoError(t, err)
- t.Cleanup(stop)
-
- storer.ListenAddr = ma
- storer.MineOne = nd.MineOne
- return storer
-}
-
-func CreateRPCServer(t *testing.T, handler interface{}) (multiaddr.Multiaddr, string, error) {
- rpcServer := jsonrpc.NewServer()
- rpcServer.Register("Filecoin", handler)
- testServ := httptest.NewServer(rpcServer) // todo: close
+func CreateRPCServer(t *testing.T, handler http.Handler) (*httptest.Server, multiaddr.Multiaddr) {
+ testServ := httptest.NewServer(handler)
t.Cleanup(testServ.Close)
t.Cleanup(testServ.CloseClientConnections)
addr := testServ.Listener.Addr()
- listenAddr := "ws://" + addr.String()
- ma, err := parseWSMultiAddr(addr)
- if err != nil {
- return nil, "", err
- }
- return ma, listenAddr, err
+ maddr, err := manet.FromNetAddr(addr)
+ require.NoError(t, err)
+ return testServ, maddr
}
-func parseWSMultiAddr(addr net.Addr) (multiaddr.Multiaddr, error) {
- host, port, err := net.SplitHostPort(addr.String())
- if err != nil {
- return nil, err
- }
- ma, err := multiaddr.NewMultiaddr("/ip4/" + host + "/" + addr.Network() + "/" + port + "/ws")
- if err != nil {
- return nil, err
- }
- return ma, nil
+func fullRpc(t *testing.T, nd TestFullNode) TestFullNode {
+ handler, err := node.FullNodeHandler(nd.FullNode, false)
+ require.NoError(t, err)
+
+ srv, maddr := CreateRPCServer(t, handler)
+
+ var ret TestFullNode
+ cl, stop, err := client.NewFullNodeRPCV1(context.Background(), "ws://"+srv.Listener.Addr().String()+"/rpc/v1", nil)
+ require.NoError(t, err)
+ t.Cleanup(stop)
+ ret.ListenAddr, ret.FullNode = maddr, cl
+
+ return ret
}
-func WSMultiAddrToString(addr multiaddr.Multiaddr) (string, error) {
- parts := strings.Split(addr.String(), "/")
- if len(parts) != 6 || parts[0] != "" {
- return "", xerrors.Errorf("Malformed ws multiaddr %s", addr)
- }
+func storerRpc(t *testing.T, nd TestMiner) TestMiner {
+ handler, err := node.MinerHandler(nd.StorageMiner, false)
+ require.NoError(t, err)
- host := parts[2]
- port := parts[4]
- proto := parts[5]
+ srv, maddr := CreateRPCServer(t, handler)
- return proto + "://" + host + ":" + port + "/rpc/v0", nil
+ var ret TestMiner
+ cl, stop, err := client.NewStorageMinerRPCV0(context.Background(), "ws://"+srv.Listener.Addr().String()+"/rpc/v0", nil)
+ require.NoError(t, err)
+ t.Cleanup(stop)
+
+ ret.ListenAddr, ret.StorageMiner, ret.MineOne = maddr, cl, nd.MineOne
+ return ret
}
diff --git a/itests/kit/nodes.go b/itests/kit/nodes.go
new file mode 100644
index 000000000..d9b04166a
--- /dev/null
+++ b/itests/kit/nodes.go
@@ -0,0 +1,153 @@
+package kit
+
+import (
+ "context"
+ "testing"
+
+ "github.com/multiformats/go-multiaddr"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/network"
+
+ lapi "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v1api"
+ "github.com/filecoin-project/lotus/chain/stmgr"
+ "github.com/filecoin-project/lotus/miner"
+ "github.com/filecoin-project/lotus/node"
+)
+
+type MinerBuilder func(context.Context, *testing.T, abi.RegisteredSealProof, address.Address) TestMiner
+
+type TestFullNode struct {
+ v1api.FullNode
+ // ListenAddr is the address on which an API server is listening, if an
+ // API server is created for this Node
+ ListenAddr multiaddr.Multiaddr
+
+ Stb MinerBuilder
+}
+
+type TestMiner struct {
+ lapi.StorageMiner
+ // ListenAddr is the address on which an API server is listening, if an
+ // API server is created for this Node
+ ListenAddr multiaddr.Multiaddr
+
+ MineOne func(context.Context, miner.MineReq) error
+ Stop func(context.Context) error
+}
+
+var PresealGenesis = -1
+
+const GenesisPreseals = 2
+
+const TestSpt = abi.RegisteredSealProof_StackedDrg2KiBV1_1
+
+// Options for setting up a mock storage Miner
+type StorageMiner struct {
+ Full int
+ Opts node.Option
+ Preseal int
+}
+
+type OptionGenerator func([]TestFullNode) node.Option
+
+// Options for setting up a mock full node
+type FullNodeOpts struct {
+ Lite bool // run node in "lite" mode
+ Opts OptionGenerator // generate dependency injection options
+}
+
+// APIBuilder is a function which is invoked in test suite to provide
+// test nodes and networks
+//
+// fullOpts array defines options for each full node
+// storage array defines storage nodes, numbers in the array specify full node
+// index the storage node 'belongs' to
+type APIBuilder func(t *testing.T, full []FullNodeOpts, storage []StorageMiner) ([]TestFullNode, []TestMiner)
+
+func DefaultFullOpts(nFull int) []FullNodeOpts {
+ full := make([]FullNodeOpts, nFull)
+ for i := range full {
+ full[i] = FullNodeOpts{
+ Opts: func(nodes []TestFullNode) node.Option {
+ return node.Options()
+ },
+ }
+ }
+ return full
+}
+
+var OneMiner = []StorageMiner{{Full: 0, Preseal: PresealGenesis}}
+var OneFull = DefaultFullOpts(1)
+var TwoFull = DefaultFullOpts(2)
+
+var FullNodeWithLatestActorsAt = func(upgradeHeight abi.ChainEpoch) FullNodeOpts {
+ // Attention: Update this when introducing new actor versions or your tests will be sad
+ return FullNodeWithNetworkUpgradeAt(network.Version13, upgradeHeight)
+}
+
+var FullNodeWithNetworkUpgradeAt = func(version network.Version, upgradeHeight abi.ChainEpoch) FullNodeOpts {
+ fullSchedule := stmgr.UpgradeSchedule{{
+ // prepare for upgrade.
+ Network: network.Version9,
+ Height: 1,
+ Migration: stmgr.UpgradeActorsV2,
+ }, {
+ Network: network.Version10,
+ Height: 2,
+ Migration: stmgr.UpgradeActorsV3,
+ }, {
+ Network: network.Version12,
+ Height: 3,
+ Migration: stmgr.UpgradeActorsV4,
+ }, {
+ Network: network.Version13,
+ Height: 4,
+ Migration: stmgr.UpgradeActorsV5,
+ }}
+
+ schedule := stmgr.UpgradeSchedule{}
+ for _, upgrade := range fullSchedule {
+ if upgrade.Network > version {
+ break
+ }
+
+ schedule = append(schedule, upgrade)
+ }
+
+ if upgradeHeight > 0 {
+ schedule[len(schedule)-1].Height = upgradeHeight
+ }
+
+ return FullNodeOpts{
+ Opts: func(nodes []TestFullNode) node.Option {
+ return node.Override(new(stmgr.UpgradeSchedule), schedule)
+ },
+ }
+}
+
+var FullNodeWithSDRAt = func(calico, persian abi.ChainEpoch) FullNodeOpts {
+ return FullNodeOpts{
+ Opts: func(nodes []TestFullNode) node.Option {
+ return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
+ Network: network.Version6,
+ Height: 1,
+ Migration: stmgr.UpgradeActorsV2,
+ }, {
+ Network: network.Version7,
+ Height: calico,
+ Migration: stmgr.UpgradeCalico,
+ }, {
+ Network: network.Version8,
+ Height: persian,
+ }})
+ },
+ }
+}
+
+var MineNext = miner.MineReq{
+ InjectNulls: 0,
+ Done: func(bool, abi.ChainEpoch, error) {},
+}
diff --git a/itests/kit/pledge.go b/itests/kit/pledge.go
new file mode 100644
index 000000000..254f87bac
--- /dev/null
+++ b/itests/kit/pledge.go
@@ -0,0 +1,88 @@
+package kit
+
+import (
+ "context"
+ "fmt"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
+ "github.com/stretchr/testify/require"
+)
+
+func PledgeSectors(t *testing.T, ctx context.Context, miner TestMiner, n, existing int, blockNotif <-chan struct{}) { //nolint:golint
+ toCheck := StartPledge(t, ctx, miner, n, existing, blockNotif)
+
+ for len(toCheck) > 0 {
+ flushSealingBatches(t, ctx, miner)
+
+ states := map[api.SectorState]int{}
+ for n := range toCheck {
+ st, err := miner.SectorsStatus(ctx, n, false)
+ require.NoError(t, err)
+ states[st.State]++
+ if st.State == api.SectorState(sealing.Proving) {
+ delete(toCheck, n)
+ }
+ if strings.Contains(string(st.State), "Fail") {
+ t.Fatal("sector in a failed state", st.State)
+ }
+ }
+
+ build.Clock.Sleep(100 * time.Millisecond)
+ fmt.Printf("WaitSeal: %d %+v\n", len(toCheck), states)
+ }
+}
+
+func flushSealingBatches(t *testing.T, ctx context.Context, miner TestMiner) { //nolint:golint
+ pcb, err := miner.SectorPreCommitFlush(ctx)
+ require.NoError(t, err)
+ if pcb != nil {
+ fmt.Printf("PRECOMMIT BATCH: %+v\n", pcb)
+ }
+
+ cb, err := miner.SectorCommitFlush(ctx)
+ require.NoError(t, err)
+ if cb != nil {
+ fmt.Printf("COMMIT BATCH: %+v\n", cb)
+ }
+}
+
+func StartPledge(t *testing.T, ctx context.Context, miner TestMiner, n, existing int, blockNotif <-chan struct{}) map[abi.SectorNumber]struct{} { //nolint:golint
+ for i := 0; i < n; i++ {
+ if i%3 == 0 && blockNotif != nil {
+ <-blockNotif
+ t.Log("WAIT")
+ }
+ t.Logf("PLEDGING %d", i)
+ _, err := miner.PledgeSector(ctx)
+ require.NoError(t, err)
+ }
+
+ for {
+ s, err := miner.SectorsList(ctx) // Note - the test builder doesn't import genesis sectors into FSM
+ require.NoError(t, err)
+ fmt.Printf("Sectors: %d\n", len(s))
+ if len(s) >= n+existing {
+ break
+ }
+
+ build.Clock.Sleep(100 * time.Millisecond)
+ }
+
+ fmt.Printf("All sectors is fsm\n")
+
+ s, err := miner.SectorsList(ctx)
+ require.NoError(t, err)
+
+ toCheck := map[abi.SectorNumber]struct{}{}
+ for _, number := range s {
+ toCheck[number] = struct{}{}
+ }
+
+ return toCheck
+}
diff --git a/cli/test/multisig.go b/itests/multisig_test.go
similarity index 80%
rename from cli/test/multisig.go
rename to itests/multisig_test.go
index 5a60894e6..4c513640d 100644
--- a/cli/test/multisig.go
+++ b/itests/multisig_test.go
@@ -1,24 +1,37 @@
-package test
+package itests
import (
"context"
"fmt"
+ "os"
"regexp"
"strings"
"testing"
+ "time"
"github.com/filecoin-project/go-address"
- "github.com/filecoin-project/lotus/api/test"
"github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/cli"
+ "github.com/filecoin-project/lotus/itests/kit"
"github.com/stretchr/testify/require"
- lcli "github.com/urfave/cli/v2"
)
-func RunMultisigTest(t *testing.T, cmds []*lcli.Command, clientNode test.TestNode) {
- ctx := context.Background()
+// TestMultisig does a basic test to exercise the multisig CLI commands
+func TestMultisig(t *testing.T) {
+ _ = os.Setenv("BELLMAN_NO_GPU", "1")
+ kit.QuietMiningLogs()
+ blocktime := 5 * time.Millisecond
+ ctx := context.Background()
+ clientNode, _ := kit.StartOneNodeOneMiner(ctx, t, blocktime)
+
+ runMultisigTests(t, clientNode)
+}
+
+func runMultisigTests(t *testing.T, clientNode kit.TestFullNode) {
// Create mock CLI
- mockCLI := NewMockCLI(ctx, t, cmds)
+ ctx := context.Background()
+ mockCLI := kit.NewMockCLI(ctx, t, cli.Commands)
clientCLI := mockCLI.Client(clientNode.ListenAddr)
// Create some wallets on the node to use for testing multisig
@@ -29,7 +42,7 @@ func RunMultisigTest(t *testing.T, cmds []*lcli.Command, clientNode test.TestNod
walletAddrs = append(walletAddrs, addr)
- test.SendFunds(ctx, t, clientNode, addr, types.NewInt(1e15))
+ kit.SendFunds(ctx, t, clientNode, addr, types.NewInt(1e15))
}
// Create an msig with three of the addresses and threshold of two sigs
diff --git a/api/test/paych.go b/itests/paych_api_test.go
similarity index 89%
rename from api/test/paych.go
rename to itests/paych_api_test.go
index b38ba6189..23fec855b 100644
--- a/api/test/paych.go
+++ b/itests/paych_api_test.go
@@ -1,14 +1,14 @@
-package test
+package itests
import (
"context"
"fmt"
- "sync/atomic"
"testing"
"time"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/itests/kit"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
@@ -26,9 +26,11 @@ import (
"github.com/filecoin-project/lotus/chain/types"
)
-func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
+func TestPaymentChannelsAPI(t *testing.T) {
+ kit.QuietMiningLogs()
+
ctx := context.Background()
- n, sn := b(t, TwoFull, OneMiner)
+ n, sn := kit.MockMinerBuilder(t, kit.TwoFull, kit.OneMiner)
paymentCreator := n[0]
paymentReceiver := n[1]
@@ -49,8 +51,9 @@ func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
}
// start mining blocks
- bm := NewBlockMiner(ctx, t, miner, blocktime)
- bm.MineBlocks()
+ bm := kit.NewBlockMiner(t, miner)
+ bm.MineBlocks(ctx, 5*time.Millisecond)
+ t.Cleanup(bm.Stop)
// send some funds to register the receiver
receiverAddr, err := paymentReceiver.WalletNew(ctx, types.KTSecp256k1)
@@ -58,7 +61,7 @@ func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
t.Fatal(err)
}
- SendFunds(ctx, t, paymentCreator, receiverAddr, abi.NewTokenAmount(1e18))
+ kit.SendFunds(ctx, t, paymentCreator, receiverAddr, abi.NewTokenAmount(1e18))
// setup the payment channel
createrAddr, err := paymentCreator.WalletDefaultAddress(ctx)
@@ -173,7 +176,7 @@ func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
select {
case <-finished:
- case <-time.After(time.Second):
+ case <-time.After(10 * time.Second):
t.Fatal("Timed out waiting for receiver to submit vouchers")
}
@@ -235,7 +238,7 @@ func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
if err != nil {
t.Fatal(err)
}
- res, err = paymentReceiver.StateWaitMsg(ctx, collectMsg, 3)
+ res, err = paymentReceiver.StateWaitMsg(ctx, collectMsg, 3, api.LookbackNoLimit, true)
if err != nil {
t.Fatal(err)
}
@@ -265,7 +268,7 @@ func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration) {
bm.Stop()
}
-func waitForBlocks(ctx context.Context, t *testing.T, bm *BlockMiner, paymentReceiver TestNode, receiverAddr address.Address, count int) {
+func waitForBlocks(ctx context.Context, t *testing.T, bm *kit.BlockMiner, paymentReceiver kit.TestFullNode, receiverAddr address.Address, count int) {
// We need to add null blocks in batches, if we add too many the chain can't sync
batchSize := 60
for i := 0; i < count; i += batchSize {
@@ -274,8 +277,8 @@ func waitForBlocks(ctx context.Context, t *testing.T, bm *BlockMiner, paymentRec
size = count - i
}
- // Add a batch of null blocks
- atomic.StoreInt64(&bm.nulls, int64(size-1))
+ // Add a batch of null blocks to advance the chain quicker through finalities.
+ bm.InjectNulls(abi.ChainEpoch(size - 1))
// Add a real block
m, err := paymentReceiver.MpoolPushMessage(ctx, &types.Message{
@@ -287,19 +290,19 @@ func waitForBlocks(ctx context.Context, t *testing.T, bm *BlockMiner, paymentRec
t.Fatal(err)
}
- _, err = paymentReceiver.StateWaitMsg(ctx, m.Cid(), 1)
+ _, err = paymentReceiver.StateWaitMsg(ctx, m.Cid(), 1, api.LookbackNoLimit, true)
if err != nil {
t.Fatal(err)
}
}
}
-func waitForMessage(ctx context.Context, t *testing.T, paymentCreator TestNode, msgCid cid.Cid, duration time.Duration, desc string) *api.MsgLookup {
+func waitForMessage(ctx context.Context, t *testing.T, paymentCreator kit.TestFullNode, msgCid cid.Cid, duration time.Duration, desc string) *api.MsgLookup {
ctx, cancel := context.WithTimeout(ctx, duration)
defer cancel()
fmt.Println("Waiting for", desc)
- res, err := paymentCreator.StateWaitMsg(ctx, msgCid, 1)
+ res, err := paymentCreator.StateWaitMsg(ctx, msgCid, 1, api.LookbackNoLimit, true)
if err != nil {
fmt.Println("Error waiting for", desc, err)
t.Fatal(err)
diff --git a/cli/paych_test.go b/itests/paych_cli_test.go
similarity index 93%
rename from cli/paych_test.go
rename to itests/paych_cli_test.go
index 44d0a41e7..373b6f43b 100644
--- a/cli/paych_test.go
+++ b/itests/paych_cli_test.go
@@ -1,4 +1,4 @@
-package cli
+package itests
import (
"context"
@@ -10,7 +10,8 @@ import (
"testing"
"time"
- clitest "github.com/filecoin-project/lotus/cli/test"
+ "github.com/filecoin-project/lotus/cli"
+ "github.com/filecoin-project/lotus/itests/kit"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
@@ -20,7 +21,6 @@ import (
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/stretchr/testify/require"
- "github.com/filecoin-project/lotus/api/test"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/events"
@@ -35,20 +35,20 @@ func init() {
// TestPaymentChannels does a basic test to exercise the payment channel CLI
// commands
-func TestPaymentChannels(t *testing.T) {
+func TestPaymentChannelsBasic(t *testing.T) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
+ kit.QuietMiningLogs()
blocktime := 5 * time.Millisecond
ctx := context.Background()
- nodes, addrs := clitest.StartTwoNodesOneMiner(ctx, t, blocktime)
+ nodes, addrs := kit.StartTwoNodesOneMiner(ctx, t, blocktime)
paymentCreator := nodes[0]
paymentReceiver := nodes[1]
creatorAddr := addrs[0]
receiverAddr := addrs[1]
// Create mock CLI
- mockCLI := clitest.NewMockCLI(ctx, t, Commands)
+ mockCLI := kit.NewMockCLI(ctx, t, cli.Commands)
creatorCLI := mockCLI.Client(paymentCreator.ListenAddr)
receiverCLI := mockCLI.Client(paymentReceiver.ListenAddr)
@@ -89,17 +89,17 @@ type voucherSpec struct {
// TestPaymentChannelStatus tests the payment channel status CLI command
func TestPaymentChannelStatus(t *testing.T) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
+ kit.QuietMiningLogs()
blocktime := 5 * time.Millisecond
ctx := context.Background()
- nodes, addrs := clitest.StartTwoNodesOneMiner(ctx, t, blocktime)
+ nodes, addrs := kit.StartTwoNodesOneMiner(ctx, t, blocktime)
paymentCreator := nodes[0]
creatorAddr := addrs[0]
receiverAddr := addrs[1]
// Create mock CLI
- mockCLI := clitest.NewMockCLI(ctx, t, Commands)
+ mockCLI := kit.NewMockCLI(ctx, t, cli.Commands)
creatorCLI := mockCLI.Client(paymentCreator.ListenAddr)
// creator: paych status-by-from-to
@@ -168,18 +168,18 @@ func TestPaymentChannelStatus(t *testing.T) {
// channel voucher commands
func TestPaymentChannelVouchers(t *testing.T) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
+ kit.QuietMiningLogs()
blocktime := 5 * time.Millisecond
ctx := context.Background()
- nodes, addrs := clitest.StartTwoNodesOneMiner(ctx, t, blocktime)
+ nodes, addrs := kit.StartTwoNodesOneMiner(ctx, t, blocktime)
paymentCreator := nodes[0]
paymentReceiver := nodes[1]
creatorAddr := addrs[0]
receiverAddr := addrs[1]
// Create mock CLI
- mockCLI := clitest.NewMockCLI(ctx, t, Commands)
+ mockCLI := kit.NewMockCLI(ctx, t, cli.Commands)
creatorCLI := mockCLI.Client(paymentCreator.ListenAddr)
receiverCLI := mockCLI.Client(paymentReceiver.ListenAddr)
@@ -300,17 +300,17 @@ func TestPaymentChannelVouchers(t *testing.T) {
// is greater than what's left in the channel, voucher create fails
func TestPaymentChannelVoucherCreateShortfall(t *testing.T) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
- clitest.QuietMiningLogs()
+ kit.QuietMiningLogs()
blocktime := 5 * time.Millisecond
ctx := context.Background()
- nodes, addrs := clitest.StartTwoNodesOneMiner(ctx, t, blocktime)
+ nodes, addrs := kit.StartTwoNodesOneMiner(ctx, t, blocktime)
paymentCreator := nodes[0]
creatorAddr := addrs[0]
receiverAddr := addrs[1]
// Create mock CLI
- mockCLI := clitest.NewMockCLI(ctx, t, Commands)
+ mockCLI := kit.NewMockCLI(ctx, t, cli.Commands)
creatorCLI := mockCLI.Client(paymentCreator.ListenAddr)
// creator: paych add-funds
@@ -378,7 +378,7 @@ func checkVoucherOutput(t *testing.T, list string, vouchers []voucherSpec) {
}
// waitForHeight waits for the node to reach the given chain epoch
-func waitForHeight(ctx context.Context, t *testing.T, node test.TestNode, height abi.ChainEpoch) {
+func waitForHeight(ctx context.Context, t *testing.T, node kit.TestFullNode, height abi.ChainEpoch) {
atHeight := make(chan struct{})
chainEvents := events.NewEvents(ctx, node)
err := chainEvents.ChainAt(func(ctx context.Context, ts *types.TipSet, curH abi.ChainEpoch) error {
@@ -396,7 +396,7 @@ func waitForHeight(ctx context.Context, t *testing.T, node test.TestNode, height
}
// getPaychState gets the state of the payment channel with the given address
-func getPaychState(ctx context.Context, t *testing.T, node test.TestNode, chAddr address.Address) paych.State {
+func getPaychState(ctx context.Context, t *testing.T, node kit.TestFullNode, chAddr address.Address) paych.State {
act, err := node.StateGetActor(ctx, chAddr, types.EmptyTSK)
require.NoError(t, err)
diff --git a/itests/sdr_upgrade_test.go b/itests/sdr_upgrade_test.go
new file mode 100644
index 000000000..dfb4284b9
--- /dev/null
+++ b/itests/sdr_upgrade_test.go
@@ -0,0 +1,112 @@
+package itests
+
+import (
+ "context"
+ "sort"
+ "sync/atomic"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/network"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/itests/kit"
+ bminer "github.com/filecoin-project/lotus/miner"
+ "github.com/filecoin-project/lotus/node/impl"
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestSDRUpgrade(t *testing.T) {
+ kit.QuietMiningLogs()
+
+ // oldDelay := policy.GetPreCommitChallengeDelay()
+ // policy.SetPreCommitChallengeDelay(5)
+ // t.Cleanup(func() {
+ // policy.SetPreCommitChallengeDelay(oldDelay)
+ // })
+
+ blocktime := 50 * time.Millisecond
+
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ n, sn := kit.MockMinerBuilder(t, []kit.FullNodeOpts{kit.FullNodeWithSDRAt(500, 1000)}, kit.OneMiner)
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+
+ addrinfo, err := client.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := miner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+ build.Clock.Sleep(time.Second)
+
+ pledge := make(chan struct{})
+ mine := int64(1)
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ round := 0
+ for atomic.LoadInt64(&mine) != 0 {
+ build.Clock.Sleep(blocktime)
+ if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
+
+ }}); err != nil {
+ t.Error(err)
+ }
+
+ // 3 sealing rounds: before, during after.
+ if round >= 3 {
+ continue
+ }
+
+ head, err := client.ChainHead(ctx)
+ assert.NoError(t, err)
+
+ // rounds happen every 100 blocks, with a 50 block offset.
+ if head.Height() >= abi.ChainEpoch(round*500+50) {
+ round++
+ pledge <- struct{}{}
+
+ ver, err := client.StateNetworkVersion(ctx, head.Key())
+ assert.NoError(t, err)
+ switch round {
+ case 1:
+ assert.Equal(t, network.Version6, ver)
+ case 2:
+ assert.Equal(t, network.Version7, ver)
+ case 3:
+ assert.Equal(t, network.Version8, ver)
+ }
+ }
+
+ }
+ }()
+
+ // before.
+ kit.PledgeSectors(t, ctx, miner, 9, 0, pledge)
+
+ s, err := miner.SectorsList(ctx)
+ require.NoError(t, err)
+ sort.Slice(s, func(i, j int) bool {
+ return s[i] < s[j]
+ })
+
+ for i, id := range s {
+ info, err := miner.SectorsStatus(ctx, id, true)
+ require.NoError(t, err)
+ expectProof := abi.RegisteredSealProof_StackedDrg2KiBV1
+ if i >= 3 {
+ // after
+ expectProof = abi.RegisteredSealProof_StackedDrg2KiBV1_1
+ }
+ assert.Equal(t, expectProof, info.SealProof, "sector %d, id %d", i, id)
+ }
+
+ atomic.StoreInt64(&mine, 0)
+ <-done
+}
diff --git a/itests/sector_pledge_test.go b/itests/sector_pledge_test.go
new file mode 100644
index 000000000..e3d2a843c
--- /dev/null
+++ b/itests/sector_pledge_test.go
@@ -0,0 +1,261 @@
+package itests
+
+import (
+ "context"
+ "fmt"
+ "strings"
+ "sync/atomic"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/go-state-types/network"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/stmgr"
+ sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
+ "github.com/filecoin-project/lotus/itests/kit"
+ bminer "github.com/filecoin-project/lotus/miner"
+ "github.com/filecoin-project/lotus/node"
+ "github.com/filecoin-project/lotus/node/impl"
+ "github.com/stretchr/testify/require"
+)
+
+func TestPledgeSectors(t *testing.T) {
+ kit.QuietMiningLogs()
+
+ runTest := func(t *testing.T, b kit.APIBuilder, blocktime time.Duration, nSectors int) {
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ n, sn := b(t, kit.OneFull, kit.OneMiner)
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+
+ addrinfo, err := client.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := miner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+ build.Clock.Sleep(time.Second)
+
+ mine := int64(1)
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ for atomic.LoadInt64(&mine) != 0 {
+ build.Clock.Sleep(blocktime)
+ if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
+
+ }}); err != nil {
+ t.Error(err)
+ }
+ }
+ }()
+
+ kit.PledgeSectors(t, ctx, miner, nSectors, 0, nil)
+
+ atomic.StoreInt64(&mine, 0)
+ <-done
+ }
+
+ t.Run("1", func(t *testing.T) {
+ runTest(t, kit.MockMinerBuilder, 50*time.Millisecond, 1)
+ })
+
+ t.Run("100", func(t *testing.T) {
+ runTest(t, kit.MockMinerBuilder, 50*time.Millisecond, 100)
+ })
+
+ t.Run("1000", func(t *testing.T) {
+ if testing.Short() { // takes ~16s
+ t.Skip("skipping test in short mode")
+ }
+
+ runTest(t, kit.MockMinerBuilder, 50*time.Millisecond, 1000)
+ })
+}
+
+func TestPledgeBatching(t *testing.T) {
+ runTest := func(t *testing.T, b kit.APIBuilder, blocktime time.Duration, nSectors int) {
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ n, sn := b(t, []kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(-1)}, kit.OneMiner)
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+
+ addrinfo, err := client.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := miner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+ build.Clock.Sleep(time.Second)
+
+ mine := int64(1)
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ for atomic.LoadInt64(&mine) != 0 {
+ build.Clock.Sleep(blocktime)
+ if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
+
+ }}); err != nil {
+ t.Error(err)
+ }
+ }
+ }()
+
+ for {
+ h, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+ if h.Height() > 10 {
+ break
+ }
+ }
+
+ toCheck := kit.StartPledge(t, ctx, miner, nSectors, 0, nil)
+
+ for len(toCheck) > 0 {
+ states := map[api.SectorState]int{}
+
+ for n := range toCheck {
+ st, err := miner.SectorsStatus(ctx, n, false)
+ require.NoError(t, err)
+ states[st.State]++
+ if st.State == api.SectorState(sealing.Proving) {
+ delete(toCheck, n)
+ }
+ if strings.Contains(string(st.State), "Fail") {
+ t.Fatal("sector in a failed state", st.State)
+ }
+ }
+ if states[api.SectorState(sealing.SubmitPreCommitBatch)] == nSectors ||
+ (states[api.SectorState(sealing.SubmitPreCommitBatch)] > 0 && states[api.SectorState(sealing.PreCommit1)] == 0 && states[api.SectorState(sealing.PreCommit2)] == 0) {
+ pcb, err := miner.SectorPreCommitFlush(ctx)
+ require.NoError(t, err)
+ if pcb != nil {
+ fmt.Printf("PRECOMMIT BATCH: %+v\n", pcb)
+ }
+ }
+
+ if states[api.SectorState(sealing.SubmitCommitAggregate)] == nSectors ||
+ (states[api.SectorState(sealing.SubmitCommitAggregate)] > 0 && states[api.SectorState(sealing.WaitSeed)] == 0 && states[api.SectorState(sealing.Committing)] == 0) {
+ cb, err := miner.SectorCommitFlush(ctx)
+ require.NoError(t, err)
+ if cb != nil {
+ fmt.Printf("COMMIT BATCH: %+v\n", cb)
+ }
+ }
+
+ build.Clock.Sleep(100 * time.Millisecond)
+ fmt.Printf("WaitSeal: %d %+v\n", len(toCheck), states)
+ }
+
+ atomic.StoreInt64(&mine, 0)
+ <-done
+ }
+
+ t.Run("100", func(t *testing.T) {
+ runTest(t, kit.MockMinerBuilder, 50*time.Millisecond, 100)
+ })
+}
+
+func TestPledgeBeforeNv13(t *testing.T) {
+ runTest := func(t *testing.T, b kit.APIBuilder, blocktime time.Duration, nSectors int) {
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ n, sn := b(t, []kit.FullNodeOpts{
+ {
+ Opts: func(nodes []kit.TestFullNode) node.Option {
+ return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{
+ Network: network.Version9,
+ Height: 1,
+ Migration: stmgr.UpgradeActorsV2,
+ }, {
+ Network: network.Version10,
+ Height: 2,
+ Migration: stmgr.UpgradeActorsV3,
+ }, {
+ Network: network.Version12,
+ Height: 3,
+ Migration: stmgr.UpgradeActorsV4,
+ }, {
+ Network: network.Version13,
+ Height: 1000000000,
+ Migration: stmgr.UpgradeActorsV5,
+ }})
+ },
+ },
+ }, kit.OneMiner)
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+
+ addrinfo, err := client.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := miner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+ build.Clock.Sleep(time.Second)
+
+ mine := int64(1)
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ for atomic.LoadInt64(&mine) != 0 {
+ build.Clock.Sleep(blocktime)
+ if err := sn[0].MineOne(ctx, bminer.MineReq{Done: func(bool, abi.ChainEpoch, error) {
+
+ }}); err != nil {
+ t.Error(err)
+ }
+ }
+ }()
+
+ for {
+ h, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+ if h.Height() > 10 {
+ break
+ }
+ }
+
+ toCheck := kit.StartPledge(t, ctx, miner, nSectors, 0, nil)
+
+ for len(toCheck) > 0 {
+ states := map[api.SectorState]int{}
+
+ for n := range toCheck {
+ st, err := miner.SectorsStatus(ctx, n, false)
+ require.NoError(t, err)
+ states[st.State]++
+ if st.State == api.SectorState(sealing.Proving) {
+ delete(toCheck, n)
+ }
+ if strings.Contains(string(st.State), "Fail") {
+ t.Fatal("sector in a failed state", st.State)
+ }
+ }
+
+ build.Clock.Sleep(100 * time.Millisecond)
+ fmt.Printf("WaitSeal: %d %+v\n", len(toCheck), states)
+ }
+
+ atomic.StoreInt64(&mine, 0)
+ <-done
+ }
+
+ t.Run("100-before-nv13", func(t *testing.T) {
+ runTest(t, kit.MockMinerBuilder, 50*time.Millisecond, 100)
+ })
+}
diff --git a/itests/sector_terminate_test.go b/itests/sector_terminate_test.go
new file mode 100644
index 000000000..b00337c7e
--- /dev/null
+++ b/itests/sector_terminate_test.go
@@ -0,0 +1,201 @@
+package itests
+
+import (
+ "context"
+ "fmt"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-bitfield"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/types"
+ sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
+ "github.com/filecoin-project/lotus/itests/kit"
+ "github.com/filecoin-project/lotus/node/impl"
+ "github.com/stretchr/testify/require"
+)
+
+func TestTerminate(t *testing.T) {
+ if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
+ t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
+ }
+
+ kit.QuietMiningLogs()
+
+ const blocktime = 2 * time.Millisecond
+
+ nSectors := uint64(2)
+
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ n, sn := kit.MockMinerBuilder(t,
+ []kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(-1)},
+ []kit.StorageMiner{{Full: 0, Preseal: int(nSectors)}},
+ )
+
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+
+ addrinfo, err := client.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := miner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+ build.Clock.Sleep(time.Second)
+
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ for ctx.Err() == nil {
+ build.Clock.Sleep(blocktime)
+ if err := sn[0].MineOne(ctx, kit.MineNext); err != nil {
+ if ctx.Err() != nil {
+ // context was canceled, ignore the error.
+ return
+ }
+ t.Error(err)
+ }
+ }
+ }()
+ defer func() {
+ cancel()
+ <-done
+ }()
+
+ maddr, err := miner.ActorAddress(ctx)
+ require.NoError(t, err)
+
+ ssz, err := miner.ActorSectorSize(ctx, maddr)
+ require.NoError(t, err)
+
+ p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+ require.Equal(t, p.MinerPower, p.TotalPower)
+ require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*nSectors))
+
+ fmt.Printf("Seal a sector\n")
+
+ kit.PledgeSectors(t, ctx, miner, 1, 0, nil)
+
+ fmt.Printf("wait for power\n")
+
+ {
+ // Wait until proven.
+ di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ waitUntil := di.PeriodStart + di.WPoStProvingPeriod + 2
+ fmt.Printf("End for head.Height > %d\n", waitUntil)
+
+ for {
+ head, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+
+ if head.Height() > waitUntil {
+ fmt.Printf("Now head.Height = %d\n", head.Height())
+ break
+ }
+ }
+ }
+
+ nSectors++
+
+ p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+ require.Equal(t, p.MinerPower, p.TotalPower)
+ require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*nSectors))
+
+ fmt.Println("Terminate a sector")
+
+ toTerminate := abi.SectorNumber(3)
+
+ err = miner.SectorTerminate(ctx, toTerminate)
+ require.NoError(t, err)
+
+ msgTriggerred := false
+loop:
+ for {
+ si, err := miner.SectorsStatus(ctx, toTerminate, false)
+ require.NoError(t, err)
+
+ fmt.Println("state: ", si.State, msgTriggerred)
+
+ switch sealing.SectorState(si.State) {
+ case sealing.Terminating:
+ if !msgTriggerred {
+ {
+ p, err := miner.SectorTerminatePending(ctx)
+ require.NoError(t, err)
+ require.Len(t, p, 1)
+ require.Equal(t, abi.SectorNumber(3), p[0].Number)
+ }
+
+ c, err := miner.SectorTerminateFlush(ctx)
+ require.NoError(t, err)
+ if c != nil {
+ msgTriggerred = true
+ fmt.Println("terminate message:", c)
+
+ {
+ p, err := miner.SectorTerminatePending(ctx)
+ require.NoError(t, err)
+ require.Len(t, p, 0)
+ }
+ }
+ }
+ case sealing.TerminateWait, sealing.TerminateFinality, sealing.Removed:
+ break loop
+ }
+
+ time.Sleep(100 * time.Millisecond)
+ }
+
+ // check power decreased
+ p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+ require.Equal(t, p.MinerPower, p.TotalPower)
+ require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*(nSectors-1)))
+
+ // check in terminated set
+ {
+ parts, err := client.StateMinerPartitions(ctx, maddr, 1, types.EmptyTSK)
+ require.NoError(t, err)
+ require.Greater(t, len(parts), 0)
+
+ bflen := func(b bitfield.BitField) uint64 {
+ l, err := b.Count()
+ require.NoError(t, err)
+ return l
+ }
+
+ require.Equal(t, uint64(1), bflen(parts[0].AllSectors))
+ require.Equal(t, uint64(0), bflen(parts[0].LiveSectors))
+ }
+
+ di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+ for {
+ head, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+
+ if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 {
+ fmt.Printf("Now head.Height = %d\n", head.Height())
+ break
+ }
+ build.Clock.Sleep(blocktime)
+ }
+ require.NoError(t, err)
+ fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
+
+ p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ require.Equal(t, p.MinerPower, p.TotalPower)
+ require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*(nSectors-1)))
+}
diff --git a/api/test/tape.go b/itests/tape_test.go
similarity index 78%
rename from api/test/tape.go
rename to itests/tape_test.go
index 74206a97a..5c0cadc3f 100644
--- a/api/test/tape.go
+++ b/itests/tape_test.go
@@ -1,4 +1,4 @@
-package test
+package itests
import (
"context"
@@ -11,18 +11,24 @@ import (
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/stmgr"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
+ "github.com/filecoin-project/lotus/itests/kit"
"github.com/filecoin-project/lotus/node"
"github.com/filecoin-project/lotus/node/impl"
"github.com/stretchr/testify/require"
)
-func TestTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration) {
+func TestTapeFix(t *testing.T) {
+ kit.QuietMiningLogs()
+
+ var blocktime = 2 * time.Millisecond
+
// The "before" case is disabled, because we need the builder to mock 32 GiB sectors to accurately repro this case
// TODO: Make the mock sector size configurable and reenable this
- //t.Run("before", func(t *testing.T) { testTapeFix(t, b, blocktime, false) })
- t.Run("after", func(t *testing.T) { testTapeFix(t, b, blocktime, true) })
+ // t.Run("before", func(t *testing.T) { testTapeFix(t, b, blocktime, false) })
+ t.Run("after", func(t *testing.T) { testTapeFix(t, kit.MockMinerBuilder, blocktime, true) })
}
-func testTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration, after bool) {
+
+func testTapeFix(t *testing.T, b kit.APIBuilder, blocktime time.Duration, after bool) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -38,9 +44,9 @@ func testTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration, after bool
})
}
- n, sn := b(t, []FullNodeOpts{{Opts: func(_ []TestNode) node.Option {
+ n, sn := b(t, []kit.FullNodeOpts{{Opts: func(_ []kit.TestFullNode) node.Option {
return node.Override(new(stmgr.UpgradeSchedule), upgradeSchedule)
- }}}, OneMiner)
+ }}}, kit.OneMiner)
client := n[0].FullNode.(*impl.FullNodeAPI)
miner := sn[0]
@@ -60,7 +66,7 @@ func testTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration, after bool
defer close(done)
for ctx.Err() == nil {
build.Clock.Sleep(blocktime)
- if err := sn[0].MineOne(ctx, MineNext); err != nil {
+ if err := sn[0].MineOne(ctx, kit.MineNext); err != nil {
if ctx.Err() != nil {
// context was canceled, ignore the error.
return
@@ -97,5 +103,4 @@ func testTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration, after bool
build.Clock.Sleep(100 * time.Millisecond)
fmt.Println("WaitSeal")
}
-
}
diff --git a/itests/verifreg_test.go b/itests/verifreg_test.go
new file mode 100644
index 000000000..b3555cc06
--- /dev/null
+++ b/itests/verifreg_test.go
@@ -0,0 +1,139 @@
+package itests
+
+import (
+ "context"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-state-types/network"
+ "github.com/filecoin-project/lotus/itests/kit"
+
+ lapi "github.com/filecoin-project/lotus/api"
+
+ "github.com/filecoin-project/lotus/chain/actors"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/verifreg"
+ "github.com/filecoin-project/lotus/node/impl"
+ verifreg4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/verifreg"
+
+ "github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/chain/types"
+)
+
+func TestVerifiedClientTopUp(t *testing.T) {
+ test := func(nv network.Version, shouldWork bool) func(*testing.T) {
+ return func(t *testing.T) {
+ nodes, miners := kit.MockMinerBuilder(t, []kit.FullNodeOpts{kit.FullNodeWithNetworkUpgradeAt(nv, -1)}, kit.OneMiner)
+ api := nodes[0].FullNode.(*impl.FullNodeAPI)
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ //Get VRH
+ vrh, err := api.StateVerifiedRegistryRootKey(ctx, types.TipSetKey{})
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ //Add verifier
+ verifier, err := api.WalletDefaultAddress(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ params, err := actors.SerializeParams(&verifreg4.AddVerifierParams{Address: verifier, Allowance: big.NewInt(100000000000)})
+ if err != nil {
+ t.Fatal(err)
+ }
+ msg := &types.Message{
+ To: verifreg.Address,
+ From: vrh,
+ Method: verifreg.Methods.AddVerifier,
+ Params: params,
+ Value: big.Zero(),
+ }
+
+ bm := kit.NewBlockMiner(t, miners[0])
+ bm.MineBlocks(ctx, 100*time.Millisecond)
+ t.Cleanup(bm.Stop)
+
+ sm, err := api.MpoolPushMessage(ctx, msg, nil)
+ if err != nil {
+ t.Fatal("AddVerifier failed: ", err)
+ }
+ res, err := api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if res.Receipt.ExitCode != 0 {
+ t.Fatal("did not successfully send message")
+ }
+
+ //Assign datacap to a client
+ datacap := big.NewInt(10000)
+ clientAddress, err := api.WalletNew(ctx, types.KTBLS)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ params, err = actors.SerializeParams(&verifreg4.AddVerifiedClientParams{Address: clientAddress, Allowance: datacap})
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ msg = &types.Message{
+ To: verifreg.Address,
+ From: verifier,
+ Method: verifreg.Methods.AddVerifiedClient,
+ Params: params,
+ Value: big.Zero(),
+ }
+
+ sm, err = api.MpoolPushMessage(ctx, msg, nil)
+ if err != nil {
+ t.Fatal("AddVerifiedClient faield: ", err)
+ }
+ res, err = api.StateWaitMsg(ctx, sm.Cid(), 1, lapi.LookbackNoLimit, true)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if res.Receipt.ExitCode != 0 {
+ t.Fatal("did not successfully send message")
+ }
+
+ //check datacap balance
+ dcap, err := api.StateVerifiedClientStatus(ctx, clientAddress, types.EmptyTSK)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !dcap.Equals(datacap) {
+ t.Fatal("")
+ }
+
+ //try to assign datacap to the same client should fail for actor v4 and below
+ params, err = actors.SerializeParams(&verifreg4.AddVerifiedClientParams{Address: clientAddress, Allowance: datacap})
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ msg = &types.Message{
+ To: verifreg.Address,
+ From: verifier,
+ Method: verifreg.Methods.AddVerifiedClient,
+ Params: params,
+ Value: big.Zero(),
+ }
+
+ _, err = api.MpoolPushMessage(ctx, msg, nil)
+ if shouldWork && err != nil {
+ t.Fatal("expected nil err", err)
+ }
+
+ if !shouldWork && (err == nil || !strings.Contains(err.Error(), "verified client already exists")) {
+ t.Fatal("Add datacap to an existing verified client should fail")
+ }
+ }
+ }
+
+ t.Run("nv12", test(network.Version12, false))
+ t.Run("nv13", test(network.Version13, true))
+}
diff --git a/itests/wdpost_dispute_test.go b/itests/wdpost_dispute_test.go
new file mode 100644
index 000000000..6c7302af3
--- /dev/null
+++ b/itests/wdpost_dispute_test.go
@@ -0,0 +1,458 @@
+package itests
+
+import (
+ "context"
+ "fmt"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-bitfield"
+ "github.com/filecoin-project/go-state-types/crypto"
+ "github.com/filecoin-project/go-state-types/dline"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/actors"
+ minerActor "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/itests/kit"
+ "github.com/filecoin-project/lotus/node/impl"
+ proof3 "github.com/filecoin-project/specs-actors/v3/actors/runtime/proof"
+ "github.com/stretchr/testify/require"
+)
+
+func TestWindowPostDispute(t *testing.T) {
+ if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
+ t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
+ }
+
+ kit.QuietMiningLogs()
+
+ b := kit.MockMinerBuilder
+ blocktime := 2 * time.Millisecond
+
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ // First, we configure two miners. After sealing, we're going to turn off the first miner so
+ // it doesn't submit proofs.
+ //
+ // Then we're going to manually submit bad proofs.
+ n, sn := b(t,
+ []kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(-1)},
+ []kit.StorageMiner{
+ {Full: 0, Preseal: kit.PresealGenesis},
+ {Full: 0},
+ })
+
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ chainMiner := sn[0]
+ evilMiner := sn[1]
+
+ {
+ addrinfo, err := client.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := chainMiner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+
+ if err := evilMiner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+ }
+
+ defaultFrom, err := client.WalletDefaultAddress(ctx)
+ require.NoError(t, err)
+
+ build.Clock.Sleep(time.Second)
+
+ // Mine with the _second_ node (the good one).
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ for ctx.Err() == nil {
+ build.Clock.Sleep(blocktime)
+ if err := chainMiner.MineOne(ctx, kit.MineNext); err != nil {
+ if ctx.Err() != nil {
+ // context was canceled, ignore the error.
+ return
+ }
+ t.Error(err)
+ }
+ }
+ }()
+ defer func() {
+ cancel()
+ <-done
+ }()
+
+ // Give the chain miner enough sectors to win every block.
+ kit.PledgeSectors(t, ctx, chainMiner, 10, 0, nil)
+ // And the evil one 1 sector. No cookie for you.
+ kit.PledgeSectors(t, ctx, evilMiner, 1, 0, nil)
+
+ // Let the evil miner's sectors gain power.
+ evilMinerAddr, err := evilMiner.ActorAddress(ctx)
+ require.NoError(t, err)
+
+ di, err := client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ fmt.Printf("Running one proving period\n")
+ fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod*2)
+
+ for {
+ head, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+
+ if head.Height() > di.PeriodStart+di.WPoStProvingPeriod*2 {
+ fmt.Printf("Now head.Height = %d\n", head.Height())
+ break
+ }
+ build.Clock.Sleep(blocktime)
+ }
+
+ p, err := client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ ssz, err := evilMiner.ActorSectorSize(ctx, evilMinerAddr)
+ require.NoError(t, err)
+
+ // make sure it has gained power.
+ require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)))
+
+ evilSectors, err := evilMiner.SectorsList(ctx)
+ require.NoError(t, err)
+ evilSectorNo := evilSectors[0] // only one.
+ evilSectorLoc, err := client.StateSectorPartition(ctx, evilMinerAddr, evilSectorNo, types.EmptyTSK)
+ require.NoError(t, err)
+
+ fmt.Println("evil miner stopping")
+
+ // Now stop the evil miner, and start manually submitting bad proofs.
+ require.NoError(t, evilMiner.Stop(ctx))
+
+ fmt.Println("evil miner stopped")
+
+ // Wait until we need to prove our sector.
+ for {
+ di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
+ require.NoError(t, err)
+ if di.Index == evilSectorLoc.Deadline && di.CurrentEpoch-di.PeriodStart > 1 {
+ break
+ }
+ build.Clock.Sleep(blocktime)
+ }
+
+ err = submitBadProof(ctx, client, evilMinerAddr, di, evilSectorLoc.Deadline, evilSectorLoc.Partition)
+ require.NoError(t, err, "evil proof not accepted")
+
+ // Wait until after the proving period.
+ for {
+ di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
+ require.NoError(t, err)
+ if di.Index != evilSectorLoc.Deadline {
+ break
+ }
+ build.Clock.Sleep(blocktime)
+ }
+
+ fmt.Println("accepted evil proof")
+
+ // Make sure the evil node didn't lose any power.
+ p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK)
+ require.NoError(t, err)
+ require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)))
+
+ // OBJECTION! The good miner files a DISPUTE!!!!
+ {
+ params := &minerActor.DisputeWindowedPoStParams{
+ Deadline: evilSectorLoc.Deadline,
+ PoStIndex: 0,
+ }
+
+ enc, aerr := actors.SerializeParams(params)
+ require.NoError(t, aerr)
+
+ msg := &types.Message{
+ To: evilMinerAddr,
+ Method: minerActor.Methods.DisputeWindowedPoSt,
+ Params: enc,
+ Value: types.NewInt(0),
+ From: defaultFrom,
+ }
+ sm, err := client.MpoolPushMessage(ctx, msg, nil)
+ require.NoError(t, err)
+
+ fmt.Println("waiting dispute")
+ rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence, api.LookbackNoLimit, true)
+ require.NoError(t, err)
+ require.Zero(t, rec.Receipt.ExitCode, "dispute not accepted: %s", rec.Receipt.ExitCode.Error())
+ }
+
+ // Objection SUSTAINED!
+ // Make sure the evil node lost power.
+ p, err = client.StateMinerPower(ctx, evilMinerAddr, types.EmptyTSK)
+ require.NoError(t, err)
+ require.True(t, p.MinerPower.RawBytePower.IsZero())
+
+ // Now we begin the redemption arc.
+ require.True(t, p.MinerPower.RawBytePower.IsZero())
+
+ // First, recover the sector.
+
+ {
+ minerInfo, err := client.StateMinerInfo(ctx, evilMinerAddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ params := &minerActor.DeclareFaultsRecoveredParams{
+ Recoveries: []minerActor.RecoveryDeclaration{{
+ Deadline: evilSectorLoc.Deadline,
+ Partition: evilSectorLoc.Partition,
+ Sectors: bitfield.NewFromSet([]uint64{uint64(evilSectorNo)}),
+ }},
+ }
+
+ enc, aerr := actors.SerializeParams(params)
+ require.NoError(t, aerr)
+
+ msg := &types.Message{
+ To: evilMinerAddr,
+ Method: minerActor.Methods.DeclareFaultsRecovered,
+ Params: enc,
+ Value: types.FromFil(30), // repay debt.
+ From: minerInfo.Owner,
+ }
+ sm, err := client.MpoolPushMessage(ctx, msg, nil)
+ require.NoError(t, err)
+
+ rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence, api.LookbackNoLimit, true)
+ require.NoError(t, err)
+ require.Zero(t, rec.Receipt.ExitCode, "recovery not accepted: %s", rec.Receipt.ExitCode.Error())
+ }
+
+ // Then wait for the deadline.
+ for {
+ di, err = client.StateMinerProvingDeadline(ctx, evilMinerAddr, types.EmptyTSK)
+ require.NoError(t, err)
+ if di.Index == evilSectorLoc.Deadline {
+ break
+ }
+ build.Clock.Sleep(blocktime)
+ }
+
+ // Now try to be evil again
+ err = submitBadProof(ctx, client, evilMinerAddr, di, evilSectorLoc.Deadline, evilSectorLoc.Partition)
+ require.Error(t, err)
+ require.Contains(t, err.Error(), "message execution failed: exit 16, reason: window post failed: invalid PoSt")
+
+ // It didn't work because we're recovering.
+}
+
+func TestWindowPostDisputeFails(t *testing.T) {
+ if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
+ t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
+ }
+
+ kit.QuietMiningLogs()
+
+ b := kit.MockMinerBuilder
+ blocktime := 2 * time.Millisecond
+
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ n, sn := b(t, []kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(-1)}, kit.OneMiner)
+
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+
+ {
+ addrinfo, err := client.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := miner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+ }
+
+ defaultFrom, err := client.WalletDefaultAddress(ctx)
+ require.NoError(t, err)
+
+ maddr, err := miner.ActorAddress(ctx)
+ require.NoError(t, err)
+
+ build.Clock.Sleep(time.Second)
+
+ // Mine with the _second_ node (the good one).
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ for ctx.Err() == nil {
+ build.Clock.Sleep(blocktime)
+ if err := miner.MineOne(ctx, kit.MineNext); err != nil {
+ if ctx.Err() != nil {
+ // context was canceled, ignore the error.
+ return
+ }
+ t.Error(err)
+ }
+ }
+ }()
+ defer func() {
+ cancel()
+ <-done
+ }()
+
+ kit.PledgeSectors(t, ctx, miner, 10, 0, nil)
+
+ di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ fmt.Printf("Running one proving period\n")
+ fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod*2)
+
+ for {
+ head, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+
+ if head.Height() > di.PeriodStart+di.WPoStProvingPeriod*2 {
+ fmt.Printf("Now head.Height = %d\n", head.Height())
+ break
+ }
+ build.Clock.Sleep(blocktime)
+ }
+
+ ssz, err := miner.ActorSectorSize(ctx, maddr)
+ require.NoError(t, err)
+ expectedPower := types.NewInt(uint64(ssz) * (kit.GenesisPreseals + 10))
+
+ p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ // make sure it has gained power.
+ require.Equal(t, p.MinerPower.RawBytePower, expectedPower)
+
+ // Wait until a proof has been submitted.
+ var targetDeadline uint64
+waitForProof:
+ for {
+ deadlines, err := client.StateMinerDeadlines(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+ for dlIdx, dl := range deadlines {
+ nonEmpty, err := dl.PostSubmissions.IsEmpty()
+ require.NoError(t, err)
+ if nonEmpty {
+ targetDeadline = uint64(dlIdx)
+ break waitForProof
+ }
+ }
+
+ build.Clock.Sleep(blocktime)
+ }
+
+ for {
+ di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+ // wait until the deadline finishes.
+ if di.Index == ((targetDeadline + 1) % di.WPoStPeriodDeadlines) {
+ break
+ }
+
+ build.Clock.Sleep(blocktime)
+ }
+
+ // Try to object to the proof. This should fail.
+ {
+ params := &minerActor.DisputeWindowedPoStParams{
+ Deadline: targetDeadline,
+ PoStIndex: 0,
+ }
+
+ enc, aerr := actors.SerializeParams(params)
+ require.NoError(t, aerr)
+
+ msg := &types.Message{
+ To: maddr,
+ Method: minerActor.Methods.DisputeWindowedPoSt,
+ Params: enc,
+ Value: types.NewInt(0),
+ From: defaultFrom,
+ }
+ _, err := client.MpoolPushMessage(ctx, msg, nil)
+ require.Error(t, err)
+ require.Contains(t, err.Error(), "failed to dispute valid post (RetCode=16)")
+ }
+}
+
+func submitBadProof(
+ ctx context.Context,
+ client api.FullNode, maddr address.Address,
+ di *dline.Info, dlIdx, partIdx uint64,
+) error {
+ head, err := client.ChainHead(ctx)
+ if err != nil {
+ return err
+ }
+
+ from, err := client.WalletDefaultAddress(ctx)
+ if err != nil {
+ return err
+ }
+
+ minerInfo, err := client.StateMinerInfo(ctx, maddr, head.Key())
+ if err != nil {
+ return err
+ }
+
+ commEpoch := di.Open
+ commRand, err := client.ChainGetRandomnessFromTickets(
+ ctx, head.Key(), crypto.DomainSeparationTag_PoStChainCommit,
+ commEpoch, nil,
+ )
+ if err != nil {
+ return err
+ }
+ params := &minerActor.SubmitWindowedPoStParams{
+ ChainCommitEpoch: commEpoch,
+ ChainCommitRand: commRand,
+ Deadline: dlIdx,
+ Partitions: []minerActor.PoStPartition{{Index: partIdx}},
+ Proofs: []proof3.PoStProof{{
+ PoStProof: minerInfo.WindowPoStProofType,
+ ProofBytes: []byte("I'm soooo very evil."),
+ }},
+ }
+
+ enc, aerr := actors.SerializeParams(params)
+ if aerr != nil {
+ return aerr
+ }
+
+ msg := &types.Message{
+ To: maddr,
+ Method: minerActor.Methods.SubmitWindowedPoSt,
+ Params: enc,
+ Value: types.NewInt(0),
+ From: from,
+ }
+ sm, err := client.MpoolPushMessage(ctx, msg, nil)
+ if err != nil {
+ return err
+ }
+
+ rec, err := client.StateWaitMsg(ctx, sm.Cid(), build.MessageConfidence, api.LookbackNoLimit, true)
+ if err != nil {
+ return err
+ }
+ if rec.Receipt.ExitCode.IsError() {
+ return rec.Receipt.ExitCode
+ }
+ return nil
+}
diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go
new file mode 100644
index 000000000..f59465f05
--- /dev/null
+++ b/itests/wdpost_test.go
@@ -0,0 +1,374 @@
+package itests
+
+import (
+ "context"
+ "fmt"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/itests/kit"
+ "github.com/stretchr/testify/require"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/extern/sector-storage/mock"
+ "github.com/filecoin-project/specs-storage/storage"
+
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/node/impl"
+)
+
+func TestWindowedPost(t *testing.T) {
+ if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
+ t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
+ }
+
+ kit.QuietMiningLogs()
+
+ var (
+ blocktime = 2 * time.Millisecond
+ nSectors = 10
+ )
+
+ for _, height := range []abi.ChainEpoch{
+ -1, // before
+ 162, // while sealing
+ 5000, // while proving
+ } {
+ height := height // copy to satisfy lints
+ t.Run(fmt.Sprintf("upgrade-%d", height), func(t *testing.T) {
+ testWindowPostUpgrade(t, kit.MockMinerBuilder, blocktime, nSectors, height)
+ })
+ }
+}
+
+func testWindowPostUpgrade(t *testing.T, b kit.APIBuilder, blocktime time.Duration, nSectors int, upgradeHeight abi.ChainEpoch) {
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ n, sn := b(t, []kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(upgradeHeight)}, kit.OneMiner)
+
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+
+ addrinfo, err := client.NetAddrsListen(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if err := miner.NetConnect(ctx, addrinfo); err != nil {
+ t.Fatal(err)
+ }
+ build.Clock.Sleep(time.Second)
+
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ for ctx.Err() == nil {
+ build.Clock.Sleep(blocktime)
+ if err := sn[0].MineOne(ctx, kit.MineNext); err != nil {
+ if ctx.Err() != nil {
+ // context was canceled, ignore the error.
+ return
+ }
+ t.Error(err)
+ }
+ }
+ }()
+ defer func() {
+ cancel()
+ <-done
+ }()
+
+ kit.PledgeSectors(t, ctx, miner, nSectors, 0, nil)
+
+ maddr, err := miner.ActorAddress(ctx)
+ require.NoError(t, err)
+
+ di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ mid, err := address.IDFromAddress(maddr)
+ require.NoError(t, err)
+
+ fmt.Printf("Running one proving period\n")
+ fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
+
+ for {
+ head, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+
+ if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 {
+ fmt.Printf("Now head.Height = %d\n", head.Height())
+ break
+ }
+ build.Clock.Sleep(blocktime)
+ }
+
+ p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ ssz, err := miner.ActorSectorSize(ctx, maddr)
+ require.NoError(t, err)
+
+ require.Equal(t, p.MinerPower, p.TotalPower)
+ require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*uint64(nSectors+kit.GenesisPreseals)))
+
+ fmt.Printf("Drop some sectors\n")
+
+ // Drop 2 sectors from deadline 2 partition 0 (full partition / deadline)
+ {
+ parts, err := client.StateMinerPartitions(ctx, maddr, 2, types.EmptyTSK)
+ require.NoError(t, err)
+ require.Greater(t, len(parts), 0)
+
+ secs := parts[0].AllSectors
+ n, err := secs.Count()
+ require.NoError(t, err)
+ require.Equal(t, uint64(2), n)
+
+ // Drop the partition
+ err = secs.ForEach(func(sid uint64) error {
+ return miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkCorrupted(storage.SectorRef{
+ ID: abi.SectorID{
+ Miner: abi.ActorID(mid),
+ Number: abi.SectorNumber(sid),
+ },
+ }, true)
+ })
+ require.NoError(t, err)
+ }
+
+ var s storage.SectorRef
+
+ // Drop 1 sectors from deadline 3 partition 0
+ {
+ parts, err := client.StateMinerPartitions(ctx, maddr, 3, types.EmptyTSK)
+ require.NoError(t, err)
+ require.Greater(t, len(parts), 0)
+
+ secs := parts[0].AllSectors
+ n, err := secs.Count()
+ require.NoError(t, err)
+ require.Equal(t, uint64(2), n)
+
+ // Drop the sector
+ sn, err := secs.First()
+ require.NoError(t, err)
+
+ all, err := secs.All(2)
+ require.NoError(t, err)
+ fmt.Println("the sectors", all)
+
+ s = storage.SectorRef{
+ ID: abi.SectorID{
+ Miner: abi.ActorID(mid),
+ Number: abi.SectorNumber(sn),
+ },
+ }
+
+ err = miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkFailed(s, true)
+ require.NoError(t, err)
+ }
+
+ di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ fmt.Printf("Go through another PP, wait for sectors to become faulty\n")
+ fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
+
+ for {
+ head, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+
+ if head.Height() > di.PeriodStart+(di.WPoStProvingPeriod)+2 {
+ fmt.Printf("Now head.Height = %d\n", head.Height())
+ break
+ }
+
+ build.Clock.Sleep(blocktime)
+ }
+
+ p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ require.Equal(t, p.MinerPower, p.TotalPower)
+
+ sectors := p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
+ require.Equal(t, nSectors+kit.GenesisPreseals-3, int(sectors)) // -3 just removed sectors
+
+ fmt.Printf("Recover one sector\n")
+
+ err = miner.StorageMiner.(*impl.StorageMinerAPI).IStorageMgr.(*mock.SectorMgr).MarkFailed(s, false)
+ require.NoError(t, err)
+
+ di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2)
+
+ for {
+ head, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+
+ if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 {
+ fmt.Printf("Now head.Height = %d\n", head.Height())
+ break
+ }
+
+ build.Clock.Sleep(blocktime)
+ }
+
+ p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ require.Equal(t, p.MinerPower, p.TotalPower)
+
+ sectors = p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
+ require.Equal(t, nSectors+kit.GenesisPreseals-2, int(sectors)) // -2 not recovered sectors
+
+ // pledge a sector after recovery
+
+ kit.PledgeSectors(t, ctx, miner, 1, nSectors, nil)
+
+ {
+ // Wait until proven.
+ di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ waitUntil := di.PeriodStart + di.WPoStProvingPeriod + 2
+ fmt.Printf("End for head.Height > %d\n", waitUntil)
+
+ for {
+ head, err := client.ChainHead(ctx)
+ require.NoError(t, err)
+
+ if head.Height() > waitUntil {
+ fmt.Printf("Now head.Height = %d\n", head.Height())
+ break
+ }
+ }
+ }
+
+ p, err = client.StateMinerPower(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ require.Equal(t, p.MinerPower, p.TotalPower)
+
+ sectors = p.MinerPower.RawBytePower.Uint64() / uint64(ssz)
+ require.Equal(t, nSectors+kit.GenesisPreseals-2+1, int(sectors)) // -2 not recovered sectors + 1 just pledged
+}
+
+func TestWindowPostBaseFeeNoBurn(t *testing.T) {
+ if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
+ t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
+ }
+
+ kit.QuietMiningLogs()
+
+ var (
+ blocktime = 2 * time.Millisecond
+ nSectors = 10
+ )
+
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ och := build.UpgradeClausHeight
+ build.UpgradeClausHeight = 10
+
+ n, sn := kit.MockMinerBuilder(t, kit.DefaultFullOpts(1), kit.OneMiner)
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+ bm := kit.ConnectAndStartMining(t, blocktime, miner, client)
+ t.Cleanup(bm.Stop)
+
+ maddr, err := miner.ActorAddress(ctx)
+ require.NoError(t, err)
+
+ mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ kit.PledgeSectors(t, ctx, miner, nSectors, 0, nil)
+ wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
+ require.NoError(t, err)
+ en := wact.Nonce
+
+ // wait for a new message to be sent from worker address, it will be a PoSt
+
+waitForProof:
+ for {
+ wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
+ require.NoError(t, err)
+ if wact.Nonce > en {
+ break waitForProof
+ }
+
+ build.Clock.Sleep(blocktime)
+ }
+
+ slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0)
+ require.NoError(t, err)
+
+ pmr, err := client.StateReplay(ctx, types.EmptyTSK, slm[0])
+ require.NoError(t, err)
+
+ require.Equal(t, pmr.GasCost.BaseFeeBurn, big.Zero())
+
+ build.UpgradeClausHeight = och
+}
+
+func TestWindowPostBaseFeeBurn(t *testing.T) {
+ if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
+ t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
+ }
+
+ kit.QuietMiningLogs()
+
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ blocktime := 2 * time.Millisecond
+
+ n, sn := kit.MockMinerBuilder(t, []kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(-1)}, kit.OneMiner)
+ client := n[0].FullNode.(*impl.FullNodeAPI)
+ miner := sn[0]
+ bm := kit.ConnectAndStartMining(t, blocktime, miner, client)
+ t.Cleanup(bm.Stop)
+
+ maddr, err := miner.ActorAddress(ctx)
+ require.NoError(t, err)
+
+ mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK)
+ require.NoError(t, err)
+
+ kit.PledgeSectors(t, ctx, miner, 10, 0, nil)
+ wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
+ require.NoError(t, err)
+ en := wact.Nonce
+
+ // wait for a new message to be sent from worker address, it will be a PoSt
+
+waitForProof:
+ for {
+ wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
+ require.NoError(t, err)
+ if wact.Nonce > en {
+ break waitForProof
+ }
+
+ build.Clock.Sleep(blocktime)
+ }
+
+ slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0)
+ require.NoError(t, err)
+
+ pmr, err := client.StateReplay(ctx, types.EmptyTSK, slm[0])
+ require.NoError(t, err)
+
+ require.NotEqual(t, pmr.GasCost.BaseFeeBurn, big.Zero())
+}
diff --git a/lib/sigs/bls/bls_test.go b/lib/sigs/bls/bls_test.go
new file mode 100644
index 000000000..4508d0eb9
--- /dev/null
+++ b/lib/sigs/bls/bls_test.go
@@ -0,0 +1,77 @@
+package bls_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/crypto"
+
+ "github.com/filecoin-project/lotus/chain/types"
+ "github.com/filecoin-project/lotus/chain/wallet"
+ "github.com/filecoin-project/lotus/lib/sigs"
+ _ "github.com/filecoin-project/lotus/lib/sigs/bls"
+)
+
+func TestRoundtrip(t *testing.T) {
+ pk, err := sigs.Generate(crypto.SigTypeBLS)
+ require.NoError(t, err)
+
+ ki := types.KeyInfo{
+ Type: types.KTBLS,
+ PrivateKey: pk,
+ }
+ k, err := wallet.NewKey(ki)
+ require.NoError(t, err)
+
+ p := []byte("potato")
+
+ si, err := sigs.Sign(crypto.SigTypeBLS, pk, p)
+ require.NoError(t, err)
+
+ err = sigs.Verify(si, k.Address, p)
+ require.NoError(t, err)
+}
+
+func TestUncompressedFails(t *testing.T) {
+ // compressed
+ err := sigs.Verify(&crypto.Signature{
+ Type: crypto.SigTypeBLS,
+ Data: []byte{0x99, 0x27, 0x44, 0x4b, 0xfc, 0xff, 0xdc, 0xa3, 0x4a, 0xf5, 0x7b, 0x78, 0x75, 0x7b, 0x9b, 0x90, 0xf1, 0xcd, 0x28, 0xd2, 0xa3, 0xae, 0xed, 0x2a, 0xa6, 0xbd, 0xe2, 0x99, 0xf8, 0xbb, 0xb9, 0x18, 0x47, 0x56, 0xf2, 0x28, 0x7b, 0x5, 0x88, 0xe6, 0xd3, 0xf2, 0x86, 0xd, 0x2b, 0xb2, 0x6, 0x6e, 0xc, 0x59, 0x77, 0x8c, 0x1e, 0x64, 0x4f, 0xb2, 0xcf, 0xb3, 0x5f, 0xba, 0x8f, 0x9, 0xfa, 0x82, 0x4a, 0x9e, 0xd8, 0x25, 0x10, 0x8c, 0x82, 0xff, 0x4b, 0xf6, 0x34, 0xc1, 0x3, 0x7e, 0xea, 0xf1, 0x85, 0xf4, 0x56, 0x73, 0xd4, 0xa1, 0xc1, 0xc6, 0xee, 0xb7, 0x12, 0xb7, 0xd7, 0x2a, 0x54, 0x98},
+ }, mustAddr("f3tcgq5scpfhdwh4dbalwktzf6mbv3ng2nw7tyzni5cyrsgvineid6jybnweecpa6misa6lk4tvwtxj2gkwpzq"), []byte{0x70, 0x6f, 0x74, 0x61, 0x74, 0x6f})
+ require.NoError(t, err)
+
+ // compressed byte changed
+ err = sigs.Verify(&crypto.Signature{
+ Type: crypto.SigTypeBLS,
+ Data: []byte{0x99, 0x27, 0x44, 0x4b, 0xfc, 0xff, 0xdc, 0xa3, 0x4a, 0xf5, 0x7b, 0x78, 0x75, 0x7b, 0x9b, 0x90, 0xf1, 0xcd, 0x28, 0xd2, 0xa3, 0xae, 0xed, 0x2a, 0xa6, 0xbd, 0xe2, 0x99, 0xf8, 0xbb, 0xb9, 0x18, 0x47, 0x56, 0xf2, 0x28, 0x7b, 0x5, 0x88, 0xf6, 0xd3, 0xf2, 0x86, 0xd, 0x2b, 0xb2, 0x6, 0x6e, 0xc, 0x59, 0x77, 0x8c, 0x1e, 0x64, 0x4f, 0xb2, 0xcf, 0xb3, 0x5f, 0xba, 0x8f, 0x9, 0xfa, 0x82, 0x4a, 0x9e, 0xd8, 0x25, 0x10, 0x8c, 0x82, 0xff, 0x4b, 0xf6, 0x34, 0xc1, 0x3, 0x7e, 0xea, 0xf1, 0x85, 0xf4, 0x56, 0x73, 0xd4, 0xa1, 0xc1, 0xc6, 0xee, 0xb7, 0x12, 0xb7, 0xd7, 0x2a, 0x54, 0x98},
+ }, mustAddr("f3tcgq5scpfhdwh4dbalwktzf6mbv3ng2nw7tyzni5cyrsgvineid6jybnweecpa6misa6lk4tvwtxj2gkwpzq"), []byte{0x70, 0x6f, 0x74, 0x61, 0x74, 0x6f})
+ require.Error(t, err)
+
+ // compressed prefix
+ err = sigs.Verify(&crypto.Signature{
+ Type: crypto.SigTypeBLS,
+ Data: []byte{0x99, 0x27, 0x44, 0x4b, 0xfc, 0xff, 0xdc, 0xa3, 0x4a, 0xf5, 0x7b, 0x78, 0x75, 0x7b, 0x9b, 0x90, 0xf1, 0xcd, 0x28, 0xd2, 0xa3, 0xae, 0xed, 0x2a, 0xa6, 0xbd, 0xe2, 0x99, 0xf8, 0xbb, 0xb9, 0x18, 0x47, 0x56, 0xf2, 0x28, 0x7b, 0x5, 0x88, 0xe6, 0xd3, 0xf2, 0x86, 0xd, 0x2b, 0xb2, 0x6, 0x6e, 0xc, 0x59, 0x77, 0x8c, 0x1e, 0x64, 0x4f, 0xb2, 0xcf, 0xb3, 0x5f, 0xba, 0x8f, 0x9, 0xfa, 0x82, 0x4a, 0x9e, 0xd8, 0x25, 0x10, 0x8c, 0x82, 0xff, 0x4b, 0xf6, 0x34, 0xc1, 0x3, 0x7e, 0xea, 0xf1, 0x85, 0xf4, 0x56, 0x73, 0xd4, 0xa1, 0xc1, 0xc6, 0xee, 0xb7, 0x12, 0xb7, 0xd7, 0x2a, 0x54, 0x98, 0x55},
+ }, mustAddr("f3tcgq5scpfhdwh4dbalwktzf6mbv3ng2nw7tyzni5cyrsgvineid6jybnweecpa6misa6lk4tvwtxj2gkwpzq"), []byte{0x70, 0x6f, 0x74, 0x61, 0x74, 0x6f})
+ require.Error(t, err)
+
+ // uncompressed
+ err = sigs.Verify(&crypto.Signature{
+ Type: crypto.SigTypeBLS,
+ Data: []byte{0x19, 0x27, 0x44, 0x4b, 0xfc, 0xff, 0xdc, 0xa3, 0x4a, 0xf5, 0x7b, 0x78, 0x75, 0x7b, 0x9b, 0x90, 0xf1, 0xcd, 0x28, 0xd2, 0xa3, 0xae, 0xed, 0x2a, 0xa6, 0xbd, 0xe2, 0x99, 0xf8, 0xbb, 0xb9, 0x18, 0x47, 0x56, 0xf2, 0x28, 0x7b, 0x5, 0x88, 0xe6, 0xd3, 0xf2, 0x86, 0xd, 0x2b, 0xb2, 0x6, 0x6e, 0xc, 0x59, 0x77, 0x8c, 0x1e, 0x64, 0x4f, 0xb2, 0xcf, 0xb3, 0x5f, 0xba, 0x8f, 0x9, 0xfa, 0x82, 0x4a, 0x9e, 0xd8, 0x25, 0x10, 0x8c, 0x82, 0xff, 0x4b, 0xf6, 0x34, 0xc1, 0x3, 0x7e, 0xea, 0xf1, 0x85, 0xf4, 0x56, 0x73, 0xd4, 0xa1, 0xc1, 0xc6, 0xee, 0xb7, 0x12, 0xb7, 0xd7, 0x2a, 0x54, 0x98, 0x8, 0x94, 0x23, 0x78, 0xdb, 0xce, 0x2a, 0xd7, 0x2e, 0x87, 0xdf, 0x8, 0x3b, 0x66, 0xc6, 0x31, 0xc1, 0x8c, 0x58, 0x2f, 0x9f, 0x9e, 0x10, 0x4d, 0x2a, 0x7e, 0x13, 0xe7, 0x9c, 0xbb, 0x22, 0xde, 0xcc, 0xf6, 0x77, 0x77, 0xb0, 0x9c, 0x25, 0x5d, 0x5d, 0xe6, 0x88, 0x9, 0x8c, 0x63, 0x35, 0xd4, 0xa, 0x85, 0x76, 0x8d, 0xb7, 0x66, 0xa6, 0xc6, 0xec, 0xe6, 0xde, 0x2a, 0x9f, 0x34, 0x87, 0x28, 0x1a, 0x48, 0xfe, 0xca, 0xb1, 0x47, 0x2, 0xf6, 0x51, 0x26, 0x52, 0x70, 0x9d, 0x7e, 0xdb, 0x7e, 0x8b, 0xc9, 0xf6, 0x41, 0xaa, 0xa8, 0x3b, 0x7e, 0x8a, 0xfd, 0x7a, 0xe4, 0x79, 0xe6, 0x59, 0xe4},
+ }, mustAddr("f3tcgq5scpfhdwh4dbalwktzf6mbv3ng2nw7tyzni5cyrsgvineid6jybnweecpa6misa6lk4tvwtxj2gkwpzq"), []byte{0x70, 0x6f, 0x74, 0x61, 0x74, 0x6f})
+ require.Error(t, err)
+
+ // uncompressed one byte change
+ err = sigs.Verify(&crypto.Signature{
+ Type: crypto.SigTypeBLS,
+ Data: []byte{0x19, 0x27, 0x44, 0x4b, 0xfc, 0xff, 0xdc, 0xa3, 0x4a, 0xf5, 0x7b, 0x78, 0x75, 0x7b, 0x9b, 0x90, 0xf1, 0xcd, 0x28, 0xd2, 0xa3, 0xae, 0xed, 0x2a, 0xa6, 0xbd, 0xe2, 0x99, 0xf8, 0xbb, 0xb9, 0x18, 0x47, 0x56, 0xf2, 0x28, 0x7b, 0x5, 0x88, 0xe6, 0xd3, 0xf2, 0x86, 0xd, 0x2b, 0xb2, 0x6, 0x6e, 0xc, 0x59, 0x77, 0x8c, 0x1e, 0x64, 0x4f, 0xb2, 0xcf, 0xb3, 0x5f, 0xba, 0x8f, 0x9, 0xfa, 0x82, 0x4a, 0x9e, 0xd8, 0x25, 0x10, 0x8c, 0x82, 0xff, 0x4b, 0xf6, 0x34, 0xc1, 0x3, 0x7e, 0xea, 0xf1, 0x85, 0xf4, 0x56, 0x73, 0xd4, 0xa1, 0xc1, 0xc6, 0xee, 0xb7, 0x12, 0xb7, 0xd7, 0x2a, 0x54, 0x98, 0x8, 0x94, 0x23, 0x78, 0xdb, 0xce, 0x2a, 0xd7, 0x2e, 0x87, 0xdf, 0x8, 0x3b, 0x66, 0xc6, 0x31, 0xc1, 0x8c, 0x58, 0x2f, 0x9f, 0x9e, 0x10, 0x4d, 0x2a, 0x7e, 0x13, 0xe7, 0x9c, 0xbb, 0x22, 0xde, 0xcc, 0xf6, 0x77, 0x77, 0xb0, 0x9c, 0x25, 0x5d, 0x5d, 0xe6, 0x88, 0x9, 0x8c, 0x63, 0x35, 0xd4, 0xa, 0x85, 0x66, 0x8d, 0xb7, 0x66, 0xa6, 0xc6, 0xec, 0xe6, 0xde, 0x2a, 0x9f, 0x34, 0x87, 0x28, 0x1a, 0x48, 0xfe, 0xca, 0xb1, 0x47, 0x2, 0xf6, 0x51, 0x26, 0x52, 0x70, 0x9d, 0x7e, 0xdb, 0x7e, 0x8b, 0xc9, 0xf6, 0x41, 0xaa, 0xa8, 0x3b, 0x7e, 0x8a, 0xfd, 0x7a, 0xe4, 0x79, 0xe6, 0x59, 0xe4},
+ }, mustAddr("f3tcgq5scpfhdwh4dbalwktzf6mbv3ng2nw7tyzni5cyrsgvineid6jybnweecpa6misa6lk4tvwtxj2gkwpzq"), []byte{0x70, 0x6f, 0x74, 0x61, 0x74, 0x6f})
+ require.Error(t, err)
+}
+
+func mustAddr(a string) address.Address {
+ ad, _ := address.NewFromString(a)
+ return ad
+}
diff --git a/lib/tracing/setup.go b/lib/tracing/setup.go
index 141683b39..b8c0399ad 100644
--- a/lib/tracing/setup.go
+++ b/lib/tracing/setup.go
@@ -2,6 +2,7 @@ package tracing
import (
"os"
+ "strings"
"contrib.go.opencensus.io/exporter/jaeger"
logging "github.com/ipfs/go-log/v2"
@@ -10,19 +11,63 @@ import (
var log = logging.Logger("tracing")
-func SetupJaegerTracing(serviceName string) *jaeger.Exporter {
+const (
+ // environment variable names
+ envCollectorEndpoint = "LOTUS_JAEGER_COLLECTOR_ENDPOINT"
+ envAgentEndpoint = "LOTUS_JAEGER_AGENT_ENDPOINT"
+ envAgentHost = "LOTUS_JAEGER_AGENT_HOST"
+ envAgentPort = "LOTUS_JAEGER_AGENT_PORT"
+ envJaegerUser = "LOTUS_JAEGER_USERNAME"
+ envJaegerCred = "LOTUS_JAEGER_PASSWORD"
+)
- if _, ok := os.LookupEnv("LOTUS_JAEGER"); !ok {
+// When sending directly to the collector, agent options are ignored.
+// The collector endpoint is an HTTP or HTTPs URL.
+// The agent endpoint is a thrift/udp protocol and should be given
+// as a string like "hostname:port". The agent can also be configured
+// with separate host and port variables.
+func jaegerOptsFromEnv(opts *jaeger.Options) bool {
+ var e string
+ var ok bool
+ if e, ok = os.LookupEnv(envJaegerUser); ok {
+ if p, ok := os.LookupEnv(envJaegerCred); ok {
+ opts.Username = e
+ opts.Password = p
+ } else {
+ log.Warn("jaeger username supplied with no password. authentication will not be used.")
+ }
+ }
+ if e, ok = os.LookupEnv(envCollectorEndpoint); ok {
+ opts.CollectorEndpoint = e
+ log.Infof("jaeger tracess will send to collector %s", e)
+ return true
+ }
+ if e, ok = os.LookupEnv(envAgentEndpoint); ok {
+ log.Infof("jaeger traces will be sent to agent %s", e)
+ opts.AgentEndpoint = e
+ return true
+ }
+ if e, ok = os.LookupEnv(envAgentHost); ok {
+ if p, ok := os.LookupEnv(envAgentPort); ok {
+ opts.AgentEndpoint = strings.Join([]string{e, p}, ":")
+ } else {
+ opts.AgentEndpoint = strings.Join([]string{e, "6831"}, ":")
+ }
+ log.Infof("jaeger traces will be sent to agent %s", opts.AgentEndpoint)
+ return true
+ }
+ return false
+}
+
+func SetupJaegerTracing(serviceName string) *jaeger.Exporter {
+ opts := jaeger.Options{}
+ if !jaegerOptsFromEnv(&opts) {
return nil
}
- agentEndpointURI := os.Getenv("LOTUS_JAEGER")
-
- je, err := jaeger.NewExporter(jaeger.Options{
- AgentEndpoint: agentEndpointURI,
- ServiceName: serviceName,
- })
+ opts.ServiceName = serviceName
+ je, err := jaeger.NewExporter(opts)
if err != nil {
- log.Errorw("Failed to create the Jaeger exporter", "error", err)
+ log.Errorw("failed to create the jaeger exporter", "error", err)
return nil
}
diff --git a/lotuspond/spawn.go b/lotuspond/spawn.go
index ce01b115e..900c372b1 100644
--- a/lotuspond/spawn.go
+++ b/lotuspond/spawn.go
@@ -11,6 +11,9 @@ import (
"sync/atomic"
"time"
+ "github.com/filecoin-project/lotus/build"
+ "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
+
"github.com/google/uuid"
"golang.org/x/xerrors"
@@ -48,7 +51,12 @@ func (api *api) Spawn() (nodeInfo, error) {
}
sbroot := filepath.Join(dir, "preseal")
- genm, ki, err := seed.PreSeal(genMiner, abi.RegisteredSealProof_StackedDrg2KiBV1, 0, 2, sbroot, []byte("8"), nil, false)
+ spt, err := miner.SealProofTypeFromSectorSize(2<<10, build.NewestNetworkVersion)
+ if err != nil {
+ return nodeInfo{}, err
+ }
+
+ genm, ki, err := seed.PreSeal(genMiner, spt, 0, 2, sbroot, []byte("8"), nil, false)
if err != nil {
return nodeInfo{}, xerrors.Errorf("preseal failed: %w", err)
}
@@ -71,6 +79,7 @@ func (api *api) Spawn() (nodeInfo, error) {
template.VerifregRootKey = gen.DefaultVerifregRootkeyActor
template.RemainderAccount = gen.DefaultRemainderAccountActor
template.NetworkName = "pond-" + uuid.New().String()
+ template.NetworkVersion = build.NewestNetworkVersion
tb, err := json.Marshal(&template)
if err != nil {
@@ -142,11 +151,6 @@ func (api *api) Spawn() (nodeInfo, error) {
api.runningLk.Lock()
api.running[id].meta.State = NodeStopped
api.runningLk.Unlock()
-
- //logfile.Close()
- //errlogfile.Close()
-
- //close(mux.stop)
},
}
api.runningLk.Unlock()
@@ -221,11 +225,6 @@ func (api *api) SpawnStorage(fullNodeRepo string) (nodeInfo, error) {
api.runningLk.Lock()
api.running[id].meta.State = NodeStopped
api.runningLk.Unlock()
-
- //logfile.Close()
- //errlogfile.Close()
-
- //close(mux.stop)
},
}
api.runningLk.Unlock()
@@ -272,11 +271,6 @@ func (api *api) RestartNode(id int32) (nodeInfo, error) {
api.runningLk.Lock()
api.running[id].meta.State = NodeStopped
api.runningLk.Unlock()
-
- //logfile.Close()
- //errlogfile.Close()
-
- //close(mux.stop)
}
nd.meta.State = NodeRunning
diff --git a/markets/retrievaladapter/provider.go b/markets/retrievaladapter/provider.go
index 3c8505c51..c13a0b03d 100644
--- a/markets/retrievaladapter/provider.go
+++ b/markets/retrievaladapter/provider.go
@@ -4,10 +4,12 @@ import (
"context"
"io"
+ "github.com/filecoin-project/lotus/api/v1api"
+ "golang.org/x/xerrors"
+
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
- "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
"github.com/filecoin-project/lotus/chain/types"
sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage"
@@ -24,15 +26,15 @@ import (
var log = logging.Logger("retrievaladapter")
type retrievalProviderNode struct {
- miner *storage.Miner
- sealer sectorstorage.SectorManager
- full api.FullNode
+ miner *storage.Miner
+ pp sectorstorage.PieceProvider
+ full v1api.FullNode
}
// NewRetrievalProviderNode returns a new node adapter for a retrieval provider that talks to the
// Lotus Node
-func NewRetrievalProviderNode(miner *storage.Miner, sealer sectorstorage.SectorManager, full api.FullNode) retrievalmarket.RetrievalProviderNode {
- return &retrievalProviderNode{miner, sealer, full}
+func NewRetrievalProviderNode(miner *storage.Miner, pp sectorstorage.PieceProvider, full v1api.FullNode) retrievalmarket.RetrievalProviderNode {
+ return &retrievalProviderNode{miner, pp, full}
}
func (rpn *retrievalProviderNode) GetMinerWorkerAddress(ctx context.Context, miner address.Address, tok shared.TipSetToken) (address.Address, error) {
@@ -46,6 +48,8 @@ func (rpn *retrievalProviderNode) GetMinerWorkerAddress(ctx context.Context, min
}
func (rpn *retrievalProviderNode) UnsealSector(ctx context.Context, sectorID abi.SectorNumber, offset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (io.ReadCloser, error) {
+ log.Debugf("get sector %d, offset %d, length %d", sectorID, offset, length)
+
si, err := rpn.miner.GetSectorInfo(sectorID)
if err != nil {
return nil, err
@@ -64,22 +68,18 @@ func (rpn *retrievalProviderNode) UnsealSector(ctx context.Context, sectorID abi
ProofType: si.SectorType,
}
- // Set up a pipe so that data can be written from the unsealing process
- // into the reader returned by this function
- r, w := io.Pipe()
- go func() {
- var commD cid.Cid
- if si.CommD != nil {
- commD = *si.CommD
- }
- // Read the piece into the pipe's writer, unsealing the piece if necessary
- err := rpn.sealer.ReadPiece(ctx, w, ref, storiface.UnpaddedByteIndex(offset), length, si.TicketValue, commD)
- if err != nil {
- log.Errorf("failed to unseal piece from sector %d: %s", sectorID, err)
- }
- // Close the reader with any error that was returned while reading the piece
- _ = w.CloseWithError(err)
- }()
+ var commD cid.Cid
+ if si.CommD != nil {
+ commD = *si.CommD
+ }
+
+ // Get a reader for the piece, unsealing the piece if necessary
+ log.Debugf("read piece in sector %d, offset %d, length %d from miner %d", sectorID, offset, length, mid)
+ r, unsealed, err := rpn.pp.ReadPiece(ctx, ref, storiface.UnpaddedByteIndex(offset), length, si.TicketValue, commD)
+ if err != nil {
+ return nil, xerrors.Errorf("failed to unseal piece from sector %d: %w", sectorID, err)
+ }
+ _ = unsealed // todo: use
return r, nil
}
diff --git a/markets/storageadapter/client.go b/markets/storageadapter/client.go
index c0d78a506..9357cc271 100644
--- a/markets/storageadapter/client.go
+++ b/markets/storageadapter/client.go
@@ -196,7 +196,7 @@ func (c *ClientNodeAdapter) ValidatePublishedDeal(ctx context.Context, deal stor
}
// TODO: timeout
- ret, err := c.StateWaitMsg(ctx, *deal.PublishMessage, build.MessageConfidence)
+ ret, err := c.StateWaitMsg(ctx, *deal.PublishMessage, build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
return 0, xerrors.Errorf("waiting for deal publish message: %w", err)
}
@@ -212,7 +212,13 @@ func (c *ClientNodeAdapter) ValidatePublishedDeal(ctx context.Context, deal stor
return res.IDs[dealIdx], nil
}
-const clientOverestimation = 2
+var clientOverestimation = struct {
+ numerator int64
+ denominator int64
+}{
+ numerator: 12,
+ denominator: 10,
+}
func (c *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error) {
bounds, err := c.StateDealProviderCollateralBounds(ctx, size, isVerified, types.EmptyTSK)
@@ -220,7 +226,9 @@ func (c *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, si
return abi.TokenAmount{}, abi.TokenAmount{}, err
}
- return big.Mul(bounds.Min, big.NewInt(clientOverestimation)), bounds.Max, nil
+ min := big.Mul(bounds.Min, big.NewInt(clientOverestimation.numerator))
+ min = big.Div(min, big.NewInt(clientOverestimation.denominator))
+ return min, bounds.Max, nil
}
// TODO: Remove dealID parameter, change publishCid to be cid.Cid (instead of pointer)
@@ -363,7 +371,7 @@ func (c *ClientNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToke
}
func (c *ClientNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, cb func(code exitcode.ExitCode, bytes []byte, finalCid cid.Cid, err error) error) error {
- receipt, err := c.StateWaitMsg(ctx, mcid, build.MessageConfidence)
+ receipt, err := c.StateWaitMsg(ctx, mcid, build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
return cb(0, nil, cid.Undef, err)
}
diff --git a/markets/storageadapter/provider.go b/markets/storageadapter/provider.go
index dcfcdcbcf..fbeaf3b3d 100644
--- a/markets/storageadapter/provider.go
+++ b/markets/storageadapter/provider.go
@@ -21,6 +21,7 @@ import (
market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
"github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
@@ -42,7 +43,7 @@ var defaultMaxProviderCollateralMultiplier = uint64(2)
var log = logging.Logger("storageadapter")
type ProviderNodeAdapter struct {
- api.FullNode
+ v1api.FullNode
// this goes away with the data transfer module
dag dtypes.StagingDAG
@@ -58,8 +59,8 @@ type ProviderNodeAdapter struct {
scMgr *SectorCommittedManager
}
-func NewProviderNodeAdapter(fc *config.MinerFeeConfig, dc *config.DealmakingConfig) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, dag dtypes.StagingDAG, secb *sectorblocks.SectorBlocks, full api.FullNode, dealPublisher *DealPublisher) storagemarket.StorageProviderNode {
- return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, dag dtypes.StagingDAG, secb *sectorblocks.SectorBlocks, full api.FullNode, dealPublisher *DealPublisher) storagemarket.StorageProviderNode {
+func NewProviderNodeAdapter(fc *config.MinerFeeConfig, dc *config.DealmakingConfig) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, dag dtypes.StagingDAG, secb *sectorblocks.SectorBlocks, full v1api.FullNode, dealPublisher *DealPublisher) storagemarket.StorageProviderNode {
+ return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, dag dtypes.StagingDAG, secb *sectorblocks.SectorBlocks, full v1api.FullNode, dealPublisher *DealPublisher) storagemarket.StorageProviderNode {
ctx := helpers.LifecycleCtx(mctx, lc)
ev := events.NewEvents(ctx, full)
@@ -290,7 +291,7 @@ func (n *ProviderNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetTo
}
func (n *ProviderNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, cb func(code exitcode.ExitCode, bytes []byte, finalCid cid.Cid, err error) error) error {
- receipt, err := n.StateWaitMsg(ctx, mcid, 2*build.MessageConfidence)
+ receipt, err := n.StateWaitMsg(ctx, mcid, 2*build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
return cb(0, nil, cid.Undef, err)
}
@@ -299,7 +300,7 @@ func (n *ProviderNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid,
func (n *ProviderNodeAdapter) WaitForPublishDeals(ctx context.Context, publishCid cid.Cid, proposal market2.DealProposal) (*storagemarket.PublishDealsWaitResult, error) {
// Wait for deal to be published (plus additional time for confidence)
- receipt, err := n.StateWaitMsg(ctx, publishCid, 2*build.MessageConfidence)
+ receipt, err := n.StateWaitMsg(ctx, publishCid, 2*build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
return nil, xerrors.Errorf("WaitForPublishDeals errored: %w", err)
}
diff --git a/metrics/metrics.go b/metrics/metrics.go
index 08c20e634..33fecc606 100644
--- a/metrics/metrics.go
+++ b/metrics/metrics.go
@@ -83,6 +83,13 @@ var (
PubsubDropRPC = stats.Int64("pubsub/drop_rpc", "Counter for total dropped RPCs", stats.UnitDimensionless)
VMFlushCopyDuration = stats.Float64("vm/flush_copy_ms", "Time spent in VM Flush Copy", stats.UnitMilliseconds)
VMFlushCopyCount = stats.Int64("vm/flush_copy_count", "Number of copied objects", stats.UnitDimensionless)
+ VMApplyBlocksTotal = stats.Float64("vm/applyblocks_total_ms", "Time spent applying block state", stats.UnitMilliseconds)
+ VMApplyMessages = stats.Float64("vm/applyblocks_messages", "Time spent applying block messages", stats.UnitMilliseconds)
+ VMApplyEarly = stats.Float64("vm/applyblocks_early", "Time spent in early apply-blocks (null cron, upgrades)", stats.UnitMilliseconds)
+ VMApplyCron = stats.Float64("vm/applyblocks_cron", "Time spent in cron", stats.UnitMilliseconds)
+ VMApplyFlush = stats.Float64("vm/applyblocks_flush", "Time spent flushing vm state", stats.UnitMilliseconds)
+ VMSends = stats.Int64("vm/sends", "Counter for sends processed by the VM", stats.UnitDimensionless)
+ VMApplied = stats.Int64("vm/applied", "Counter for messages (including internal messages) processed by the VM", stats.UnitDimensionless)
// miner
WorkerCallsStarted = stats.Int64("sealing/worker_calls_started", "Counter of started worker tasks", stats.UnitDimensionless)
@@ -240,6 +247,34 @@ var (
Measure: VMFlushCopyCount,
Aggregation: view.Sum(),
}
+ VMApplyBlocksTotalView = &view.View{
+ Measure: VMApplyBlocksTotal,
+ Aggregation: defaultMillisecondsDistribution,
+ }
+ VMApplyMessagesView = &view.View{
+ Measure: VMApplyMessages,
+ Aggregation: defaultMillisecondsDistribution,
+ }
+ VMApplyEarlyView = &view.View{
+ Measure: VMApplyEarly,
+ Aggregation: defaultMillisecondsDistribution,
+ }
+ VMApplyCronView = &view.View{
+ Measure: VMApplyCron,
+ Aggregation: defaultMillisecondsDistribution,
+ }
+ VMApplyFlushView = &view.View{
+ Measure: VMApplyFlush,
+ Aggregation: defaultMillisecondsDistribution,
+ }
+ VMSendsView = &view.View{
+ Measure: VMSends,
+ Aggregation: view.LastValue(),
+ }
+ VMAppliedView = &view.View{
+ Measure: VMApplied,
+ Aggregation: view.LastValue(),
+ }
// miner
WorkerCallsStartedView = &view.View{
@@ -330,6 +365,13 @@ var ChainNodeViews = append([]*view.View{
SplitstoreCompactionHotView,
SplitstoreCompactionColdView,
SplitstoreCompactionDeadView,
+ VMApplyBlocksTotalView,
+ VMApplyMessagesView,
+ VMApplyEarlyView,
+ VMApplyCronView,
+ VMApplyFlushView,
+ VMSendsView,
+ VMAppliedView,
}, DefaultViews...)
var MinerNodeViews = append([]*view.View{
diff --git a/metrics/proxy.go b/metrics/proxy.go
index 309ef80e1..7253a76c2 100644
--- a/metrics/proxy.go
+++ b/metrics/proxy.go
@@ -7,37 +7,36 @@ import (
"go.opencensus.io/tag"
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/apistruct"
)
func MetricedStorMinerAPI(a api.StorageMiner) api.StorageMiner {
- var out apistruct.StorageMinerStruct
+ var out api.StorageMinerStruct
proxy(a, &out.Internal)
proxy(a, &out.CommonStruct.Internal)
return &out
}
func MetricedFullAPI(a api.FullNode) api.FullNode {
- var out apistruct.FullNodeStruct
+ var out api.FullNodeStruct
proxy(a, &out.Internal)
proxy(a, &out.CommonStruct.Internal)
return &out
}
func MetricedWorkerAPI(a api.Worker) api.Worker {
- var out apistruct.WorkerStruct
+ var out api.WorkerStruct
proxy(a, &out.Internal)
return &out
}
func MetricedWalletAPI(a api.Wallet) api.Wallet {
- var out apistruct.WalletStruct
+ var out api.WalletStruct
proxy(a, &out.Internal)
return &out
}
func MetricedGatewayAPI(a api.Gateway) api.Gateway {
- var out apistruct.GatewayStruct
+ var out api.GatewayStruct
proxy(a, &out.Internal)
return &out
}
diff --git a/miner/miner.go b/miner/miner.go
index 2ad0f638e..ee7d40c4f 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -9,13 +9,17 @@ import (
"sync"
"time"
+ "github.com/filecoin-project/lotus/api/v1api"
+
proof2 "github.com/filecoin-project/specs-actors/v2/actors/runtime/proof"
+ "github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/chain/gen/slashfilter"
"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/crypto"
lru "github.com/hashicorp/golang-lru"
@@ -57,7 +61,7 @@ func randTimeOffset(width time.Duration) time.Duration {
// NewMiner instantiates a miner with a concrete WinningPoStProver and a miner
// address (which can be different from the worker's address).
-func NewMiner(api api.FullNode, epp gen.WinningPoStProver, addr address.Address, sf *slashfilter.SlashFilter, j journal.Journal) *Miner {
+func NewMiner(api v1api.FullNode, epp gen.WinningPoStProver, addr address.Address, sf *slashfilter.SlashFilter, j journal.Journal) *Miner {
arc, err := lru.NewARC(10000)
if err != nil {
panic(err)
@@ -101,7 +105,7 @@ func NewMiner(api api.FullNode, epp gen.WinningPoStProver, addr address.Address,
//
// Refer to the godocs on mineOne and mine methods for more detail.
type Miner struct {
- api api.FullNode
+ api v1api.FullNode
epp gen.WinningPoStProver
@@ -413,65 +417,97 @@ func (m *Miner) GetBestMiningCandidate(ctx context.Context) (*MiningBase, error)
// This method does the following:
//
// 1.
-func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg, error) {
+func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *types.BlockMsg, err error) {
log.Debugw("attempting to mine a block", "tipset", types.LogCids(base.TipSet.Cids()))
- start := build.Clock.Now()
+ tStart := build.Clock.Now()
round := base.TipSet.Height() + base.NullRounds + 1
- mbi, err := m.api.MinerGetBaseInfo(ctx, m.address, round, base.TipSet.Key())
- if err != nil {
- return nil, xerrors.Errorf("failed to get mining base info: %w", err)
- }
- if mbi == nil {
- log.Warnf("mineOne: unexpectedly nil MiningBaseInfo for round %d, off tipset %d/%s", round, base.TipSet.Height(), base.TipSet.Key().String())
- return nil, nil
- }
-
- // always write out a log from this point out
+ // always write out a log
var winner *types.ElectionProof
+ var mbi *api.MiningBaseInfo
+ var rbase types.BeaconEntry
defer func() {
- log.Infow(
- "completed mineOne",
+
+ var hasMinPower bool
+
+ // mbi can be nil if we are deep in penalty and there are 0 eligible sectors
+ // in the current deadline. If this case - put together a dummy one for reporting
+ // https://github.com/filecoin-project/lotus/blob/v1.9.0/chain/stmgr/utils.go#L500-L502
+ if mbi == nil {
+ mbi = &api.MiningBaseInfo{
+ NetworkPower: big.NewInt(-1), // we do not know how big the network is at this point
+ EligibleForMining: false,
+ MinerPower: big.NewInt(0), // but we do know we do not have anything eligible
+ }
+
+ // try to opportunistically pull actual power and plug it into the fake mbi
+ if pow, err := m.api.StateMinerPower(ctx, m.address, base.TipSet.Key()); err == nil && pow != nil {
+ hasMinPower = pow.HasMinPower
+ mbi.MinerPower = pow.MinerPower.QualityAdjPower
+ mbi.NetworkPower = pow.TotalPower.QualityAdjPower
+ }
+ }
+
+ isLate := uint64(tStart.Unix()) > (base.TipSet.MinTimestamp() + uint64(base.NullRounds*builtin.EpochDurationSeconds) + build.PropagationDelaySecs)
+
+ logStruct := []interface{}{
+ "tookMilliseconds", (build.Clock.Now().UnixNano() - tStart.UnixNano()) / 1_000_000,
"forRound", int64(round),
"baseEpoch", int64(base.TipSet.Height()),
+ "baseDeltaSeconds", uint64(tStart.Unix()) - base.TipSet.MinTimestamp(),
+ "nullRounds", int64(base.NullRounds),
+ "lateStart", isLate,
+ "beaconEpoch", rbase.Round,
"lookbackEpochs", int64(policy.ChainFinality), // hardcoded as it is unlikely to change again: https://github.com/filecoin-project/lotus/blob/v1.8.0/chain/actors/policy/policy.go#L180-L186
"networkPowerAtLookback", mbi.NetworkPower.String(),
"minerPowerAtLookback", mbi.MinerPower.String(),
"isEligible", mbi.EligibleForMining,
"isWinner", (winner != nil),
- )
+ "error", err,
+ }
+
+ if err != nil {
+ log.Errorw("completed mineOne", logStruct...)
+ } else if isLate || (hasMinPower && !mbi.EligibleForMining) {
+ log.Warnw("completed mineOne", logStruct...)
+ } else {
+ log.Infow("completed mineOne", logStruct...)
+ }
}()
+ mbi, err = m.api.MinerGetBaseInfo(ctx, m.address, round, base.TipSet.Key())
+ if err != nil {
+ err = xerrors.Errorf("failed to get mining base info: %w", err)
+ return nil, err
+ }
+ if mbi == nil {
+ return nil, nil
+ }
+
if !mbi.EligibleForMining {
// slashed or just have no power yet
return nil, nil
}
- tMBI := build.Clock.Now()
-
- beaconPrev := mbi.PrevBeaconEntry
-
- tDrand := build.Clock.Now()
- bvals := mbi.BeaconEntries
-
tPowercheck := build.Clock.Now()
- log.Infof("Time delta between now and our mining base: %ds (nulls: %d)", uint64(build.Clock.Now().Unix())-base.TipSet.MinTimestamp(), base.NullRounds)
-
- rbase := beaconPrev
+ bvals := mbi.BeaconEntries
+ rbase = mbi.PrevBeaconEntry
if len(bvals) > 0 {
rbase = bvals[len(bvals)-1]
}
ticket, err := m.computeTicket(ctx, &rbase, base, mbi)
if err != nil {
- return nil, xerrors.Errorf("scratching ticket failed: %w", err)
+ err = xerrors.Errorf("scratching ticket failed: %w", err)
+ return nil, err
}
winner, err = gen.IsRoundWinner(ctx, base.TipSet, round, m.address, rbase, mbi, m.api)
if err != nil {
- return nil, xerrors.Errorf("failed to check if we win next round: %w", err)
+ err = xerrors.Errorf("failed to check if we win next round: %w", err)
+ return nil, err
}
if winner == nil {
@@ -482,12 +518,14 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg,
buf := new(bytes.Buffer)
if err := m.address.MarshalCBOR(buf); err != nil {
- return nil, xerrors.Errorf("failed to marshal miner address: %w", err)
+ err = xerrors.Errorf("failed to marshal miner address: %w", err)
+ return nil, err
}
rand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_WinningPoStChallengeSeed, round, buf.Bytes())
if err != nil {
- return nil, xerrors.Errorf("failed to get randomness for winning post: %w", err)
+ err = xerrors.Errorf("failed to get randomness for winning post: %w", err)
+ return nil, err
}
prand := abi.PoStRandomness(rand)
@@ -496,7 +534,8 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg,
postProof, err := m.epp.ComputeProof(ctx, mbi.Sectors, prand)
if err != nil {
- return nil, xerrors.Errorf("failed to compute winning post proof: %w", err)
+ err = xerrors.Errorf("failed to compute winning post proof: %w", err)
+ return nil, err
}
tProof := build.Clock.Now()
@@ -504,29 +543,29 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg,
// get pending messages early,
msgs, err := m.api.MpoolSelect(context.TODO(), base.TipSet.Key(), ticket.Quality())
if err != nil {
- return nil, xerrors.Errorf("failed to select messages for block: %w", err)
+ err = xerrors.Errorf("failed to select messages for block: %w", err)
+ return nil, err
}
tPending := build.Clock.Now()
// TODO: winning post proof
- b, err := m.createBlock(base, m.address, ticket, winner, bvals, postProof, msgs)
+ minedBlock, err = m.createBlock(base, m.address, ticket, winner, bvals, postProof, msgs)
if err != nil {
- return nil, xerrors.Errorf("failed to create block: %w", err)
+ err = xerrors.Errorf("failed to create block: %w", err)
+ return nil, err
}
tCreateBlock := build.Clock.Now()
- dur := tCreateBlock.Sub(start)
+ dur := tCreateBlock.Sub(tStart)
parentMiners := make([]address.Address, len(base.TipSet.Blocks()))
for i, header := range base.TipSet.Blocks() {
parentMiners[i] = header.Miner
}
- log.Infow("mined new block", "cid", b.Cid(), "height", int64(b.Header.Height), "miner", b.Header.Miner, "parents", parentMiners, "parentTipset", base.TipSet.Key().String(), "took", dur)
+ log.Infow("mined new block", "cid", minedBlock.Cid(), "height", int64(minedBlock.Header.Height), "miner", minedBlock.Header.Miner, "parents", parentMiners, "parentTipset", base.TipSet.Key().String(), "took", dur)
if dur > time.Second*time.Duration(build.BlockDelaySecs) {
log.Warnw("CAUTION: block production took longer than the block delay. Your computer may not be fast enough to keep up",
- "tMinerBaseInfo ", tMBI.Sub(start),
- "tDrand ", tDrand.Sub(tMBI),
- "tPowercheck ", tPowercheck.Sub(tDrand),
+ "tPowercheck ", tPowercheck.Sub(tStart),
"tTicket ", tTicket.Sub(tPowercheck),
"tSeed ", tSeed.Sub(tTicket),
"tProof ", tProof.Sub(tSeed),
@@ -534,7 +573,7 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg,
"tCreateBlock ", tCreateBlock.Sub(tPending))
}
- return b, nil
+ return minedBlock, nil
}
func (m *Miner) computeTicket(ctx context.Context, brand *types.BeaconEntry, base *MiningBase, mbi *api.MiningBaseInfo) (*types.Ticket, error) {
diff --git a/miner/testminer.go b/miner/testminer.go
index 5f461d884..7f29a7ae0 100644
--- a/miner/testminer.go
+++ b/miner/testminer.go
@@ -8,7 +8,8 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/lotus/api"
+
+ "github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/chain/gen"
"github.com/filecoin-project/lotus/chain/gen/slashfilter"
"github.com/filecoin-project/lotus/journal"
@@ -19,8 +20,8 @@ type MineReq struct {
Done func(bool, abi.ChainEpoch, error)
}
-func NewTestMiner(nextCh <-chan MineReq, addr address.Address) func(api.FullNode, gen.WinningPoStProver) *Miner {
- return func(api api.FullNode, epp gen.WinningPoStProver) *Miner {
+func NewTestMiner(nextCh <-chan MineReq, addr address.Address) func(v1api.FullNode, gen.WinningPoStProver) *Miner {
+ return func(api v1api.FullNode, epp gen.WinningPoStProver) *Miner {
arc, err := lru.NewARC(10000)
if err != nil {
panic(err)
diff --git a/node/builder.go b/node/builder.go
index ce00fc18d..f05dd8164 100644
--- a/node/builder.go
+++ b/node/builder.go
@@ -333,6 +333,7 @@ var ChainNode = Options(
// Lite node API
ApplyIf(isLiteNode,
+ Override(new(messagepool.Provider), messagepool.NewProviderLite),
Override(new(messagesigner.MpoolNonceAPI), From(new(modules.MpoolNonceAPI))),
Override(new(full.ChainModuleAPI), From(new(api.Gateway))),
Override(new(full.GasModuleAPI), From(new(api.Gateway))),
@@ -343,6 +344,7 @@ var ChainNode = Options(
// Full node API / service startup
ApplyIf(isFullNode,
+ Override(new(messagepool.Provider), messagepool.NewProvider),
Override(new(messagesigner.MpoolNonceAPI), From(new(*messagepool.MessagePool))),
Override(new(full.ChainModuleAPI), From(new(full.ChainModule))),
Override(new(full.GasModuleAPI), From(new(full.GasModule))),
@@ -373,9 +375,12 @@ var MinerNode = Options(
Override(new(*stores.Index), stores.NewIndex),
Override(new(stores.SectorIndex), From(new(*stores.Index))),
Override(new(stores.LocalStorage), From(new(repo.LockedRepo))),
+ Override(new(*stores.Local), modules.LocalStorage),
+ Override(new(*stores.Remote), modules.RemoteStorage),
Override(new(*sectorstorage.Manager), modules.SectorStorage),
Override(new(sectorstorage.SectorManager), From(new(*sectorstorage.Manager))),
Override(new(storiface.WorkerReturn), From(new(sectorstorage.SectorManager))),
+ Override(new(sectorstorage.Unsealer), From(new(*sectorstorage.Manager))),
// Sector storage: Proofs
Override(new(ffiwrapper.Verifier), ffiwrapper.ProofVerifier),
@@ -403,6 +408,7 @@ var MinerNode = Options(
Override(new(*sectorblocks.SectorBlocks), sectorblocks.NewSectorBlocks),
// Markets (retrieval)
+ Override(new(sectorstorage.PieceProvider), sectorstorage.NewPieceProvider),
Override(new(retrievalmarket.RetrievalProvider), modules.RetrievalProvider),
Override(new(dtypes.RetrievalDealFilter), modules.RetrievalDealFilter(nil)),
Override(HandleRetrievalKey, modules.HandleRetrieval),
diff --git a/node/config/def.go b/node/config/def.go
index 1f3505e7d..177871cc5 100644
--- a/node/config/def.go
+++ b/node/config/def.go
@@ -250,7 +250,7 @@ func defCommon() Common {
}
-var DefaultDefaultMaxFee = types.MustParseFIL("0.007")
+var DefaultDefaultMaxFee = types.MustParseFIL("0.07")
var DefaultSimultaneousTransfers = uint64(20)
// DefaultFullNode returns the default config
diff --git a/node/hello/hello.go b/node/hello/hello.go
index d4c631206..e31b7d25b 100644
--- a/node/hello/hello.go
+++ b/node/hello/hello.go
@@ -5,7 +5,7 @@ import (
"time"
"github.com/filecoin-project/go-state-types/abi"
- xerrors "golang.org/x/xerrors"
+ "golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/big"
"github.com/ipfs/go-cid"
@@ -13,7 +13,7 @@ import (
"github.com/libp2p/go-libp2p-core/host"
inet "github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
- protocol "github.com/libp2p/go-libp2p-core/protocol"
+ "github.com/libp2p/go-libp2p-core/protocol"
cborutil "github.com/filecoin-project/go-cbor-util"
"github.com/filecoin-project/lotus/build"
@@ -23,6 +23,8 @@ import (
"github.com/filecoin-project/lotus/lib/peermgr"
)
+// TODO(TEST): missing test coverage.
+
const ProtocolID = "/fil/hello/1.0.0"
var log = logging.Logger("hello")
@@ -33,12 +35,14 @@ type HelloMessage struct {
HeaviestTipSetWeight big.Int
GenesisHash cid.Cid
}
+
type LatencyMessage struct {
TArrival int64
TSent int64
}
type NewStreamFunc func(context.Context, peer.ID, ...protocol.ID) (inet.Stream, error)
+
type Service struct {
h host.Host
@@ -62,7 +66,6 @@ func NewHelloService(h host.Host, cs *store.ChainStore, syncer *chain.Syncer, pm
}
func (hs *Service) HandleStream(s inet.Stream) {
-
var hmsg HelloMessage
if err := cborutil.ReadCborRPC(s, &hmsg); err != nil {
log.Infow("failed to read hello message, disconnecting", "error", err)
@@ -77,7 +80,7 @@ func (hs *Service) HandleStream(s inet.Stream) {
"hash", hmsg.GenesisHash)
if hmsg.GenesisHash != hs.syncer.Genesis.Cids()[0] {
- log.Warnf("other peer has different genesis! (%s)", hmsg.GenesisHash)
+ log.Debugf("other peer has different genesis! (%s)", hmsg.GenesisHash)
_ = s.Conn().Close()
return
}
@@ -121,7 +124,6 @@ func (hs *Service) HandleStream(s inet.Stream) {
log.Debugf("Got new tipset through Hello: %s from %s", ts.Cids(), s.Conn().RemotePeer())
hs.syncer.InformNewHead(s.Conn().RemotePeer(), ts)
}
-
}
func (hs *Service) SayHello(ctx context.Context, pid peer.ID) error {
diff --git a/node/impl/client/client.go b/node/impl/client/client.go
index c2987ddd2..4732e5c92 100644
--- a/node/impl/client/client.go
+++ b/node/impl/client/client.go
@@ -6,6 +6,8 @@ import (
"fmt"
"io"
"os"
+ "sort"
+ "time"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
@@ -31,10 +33,12 @@ import (
"github.com/ipld/go-ipld-prime/traversal/selector/builder"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
+ "github.com/multiformats/go-multibase"
mh "github.com/multiformats/go-multihash"
"go.uber.org/fx"
"github.com/filecoin-project/go-address"
+ cborutil "github.com/filecoin-project/go-cbor-util"
"github.com/filecoin-project/go-commp-utils/ffiwrapper"
"github.com/filecoin-project/go-commp-utils/writer"
datatransfer "github.com/filecoin-project/go-data-transfer"
@@ -43,8 +47,10 @@ import (
rm "github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/shared"
"github.com/filecoin-project/go-fil-markets/storagemarket"
+ "github.com/filecoin-project/go-fil-markets/storagemarket/network"
"github.com/filecoin-project/go-multistore"
"github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/specs-actors/v3/actors/builtin/market"
marketevents "github.com/filecoin-project/lotus/markets/loggers"
@@ -92,7 +98,13 @@ func calcDealExpiration(minDuration uint64, md *dline.Info, startEpoch abi.Chain
minExp := startEpoch + abi.ChainEpoch(minDuration)
// Align on miners ProvingPeriodBoundary
- return minExp + md.WPoStProvingPeriod - (minExp % md.WPoStProvingPeriod) + (md.PeriodStart % md.WPoStProvingPeriod) - 1
+ exp := minExp + md.WPoStProvingPeriod - (minExp % md.WPoStProvingPeriod) + (md.PeriodStart % md.WPoStProvingPeriod) - 1
+ // Should only be possible for miners created around genesis
+ for exp < minExp {
+ exp += md.WPoStProvingPeriod
+ }
+
+ return exp
}
func (a *API) imgr() *importmgr.Mgr {
@@ -100,8 +112,23 @@ func (a *API) imgr() *importmgr.Mgr {
}
func (a *API) ClientStartDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) {
+ return a.dealStarter(ctx, params, false)
+}
+
+func (a *API) ClientStatelessDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) {
+ return a.dealStarter(ctx, params, true)
+}
+
+func (a *API) dealStarter(ctx context.Context, params *api.StartDealParams, isStateless bool) (*cid.Cid, error) {
var storeID *multistore.StoreID
- if params.Data.TransferType == storagemarket.TTGraphsync {
+ if isStateless {
+ if params.Data.TransferType != storagemarket.TTManual {
+ return nil, xerrors.Errorf("invalid transfer type %s for stateless storage deal", params.Data.TransferType)
+ }
+ if !params.EpochPrice.IsZero() {
+ return nil, xerrors.New("stateless storage deals can only be initiated with storage price of 0")
+ }
+ } else if params.Data.TransferType == storagemarket.TTGraphsync {
importIDs := a.imgr().List()
for _, importID := range importIDs {
info, err := a.imgr().Info(importID)
@@ -149,8 +176,6 @@ func (a *API) ClientStartDeal(ctx context.Context, params *api.StartDealParams)
return nil, xerrors.New("data doesn't fit in a sector")
}
- providerInfo := utils.NewStorageProviderInfo(params.Miner, mi.Worker, mi.SectorSize, *mi.PeerId, mi.Multiaddrs)
-
dealStart := params.DealStartEpoch
if dealStart <= 0 { // unset, or explicitly 'epoch undefined'
ts, err := a.ChainHead(ctx)
@@ -172,25 +197,112 @@ func (a *API) ClientStartDeal(ctx context.Context, params *api.StartDealParams)
return nil, xerrors.Errorf("failed to get seal proof type: %w", err)
}
- result, err := a.SMDealClient.ProposeStorageDeal(ctx, storagemarket.ProposeStorageDealParams{
- Addr: params.Wallet,
- Info: &providerInfo,
- Data: params.Data,
- StartEpoch: dealStart,
- EndEpoch: calcDealExpiration(params.MinBlocksDuration, md, dealStart),
- Price: params.EpochPrice,
- Collateral: params.ProviderCollateral,
- Rt: st,
- FastRetrieval: params.FastRetrieval,
- VerifiedDeal: params.VerifiedDeal,
- StoreID: storeID,
- })
+ // regular flow
+ if !isStateless {
+ providerInfo := utils.NewStorageProviderInfo(params.Miner, mi.Worker, mi.SectorSize, *mi.PeerId, mi.Multiaddrs)
- if err != nil {
- return nil, xerrors.Errorf("failed to start deal: %w", err)
+ result, err := a.SMDealClient.ProposeStorageDeal(ctx, storagemarket.ProposeStorageDealParams{
+ Addr: params.Wallet,
+ Info: &providerInfo,
+ Data: params.Data,
+ StartEpoch: dealStart,
+ EndEpoch: calcDealExpiration(params.MinBlocksDuration, md, dealStart),
+ Price: params.EpochPrice,
+ Collateral: params.ProviderCollateral,
+ Rt: st,
+ FastRetrieval: params.FastRetrieval,
+ VerifiedDeal: params.VerifiedDeal,
+ StoreID: storeID,
+ })
+
+ if err != nil {
+ return nil, xerrors.Errorf("failed to start deal: %w", err)
+ }
+
+ return &result.ProposalCid, nil
}
- return &result.ProposalCid, nil
+ //
+ // stateless flow from here to the end
+ //
+
+ dealProposal := &market.DealProposal{
+ PieceCID: *params.Data.PieceCid,
+ PieceSize: params.Data.PieceSize.Padded(),
+ Client: walletKey,
+ Provider: params.Miner,
+ Label: params.Data.Root.Encode(multibase.MustNewEncoder('u')),
+ StartEpoch: dealStart,
+ EndEpoch: calcDealExpiration(params.MinBlocksDuration, md, dealStart),
+ StoragePricePerEpoch: big.Zero(),
+ ProviderCollateral: params.ProviderCollateral,
+ ClientCollateral: big.Zero(),
+ VerifiedDeal: params.VerifiedDeal,
+ }
+
+ if dealProposal.ProviderCollateral.IsZero() {
+ networkCollateral, err := a.StateDealProviderCollateralBounds(ctx, params.Data.PieceSize.Padded(), params.VerifiedDeal, types.EmptyTSK)
+ if err != nil {
+ return nil, xerrors.Errorf("failed to determine minimum provider collateral: %w", err)
+ }
+ dealProposal.ProviderCollateral = networkCollateral.Min
+ }
+
+ dealProposalSerialized, err := cborutil.Dump(dealProposal)
+ if err != nil {
+ return nil, xerrors.Errorf("failed to serialize deal proposal: %w", err)
+ }
+
+ dealProposalSig, err := a.WalletSign(ctx, walletKey, dealProposalSerialized)
+ if err != nil {
+ return nil, xerrors.Errorf("failed to sign proposal : %w", err)
+ }
+
+ dealProposalSigned := &market.ClientDealProposal{
+ Proposal: *dealProposal,
+ ClientSignature: *dealProposalSig,
+ }
+ dStream, err := network.NewFromLibp2pHost(a.Host,
+ // params duplicated from .../node/modules/client.go
+ // https://github.com/filecoin-project/lotus/pull/5961#discussion_r629768011
+ network.RetryParameters(time.Second, 5*time.Minute, 15, 5),
+ ).NewDealStream(ctx, *mi.PeerId)
+ if err != nil {
+ return nil, xerrors.Errorf("opening dealstream to %s/%s failed: %w", params.Miner, *mi.PeerId, err)
+ }
+
+ if err = dStream.WriteDealProposal(network.Proposal{
+ FastRetrieval: true,
+ DealProposal: dealProposalSigned,
+ Piece: &storagemarket.DataRef{
+ TransferType: storagemarket.TTManual,
+ Root: params.Data.Root,
+ PieceCid: params.Data.PieceCid,
+ PieceSize: params.Data.PieceSize,
+ },
+ }); err != nil {
+ return nil, xerrors.Errorf("sending deal proposal failed: %w", err)
+ }
+
+ resp, _, err := dStream.ReadDealResponse()
+ if err != nil {
+ return nil, xerrors.Errorf("reading proposal response failed: %w", err)
+ }
+
+ dealProposalIpld, err := cborutil.AsIpld(dealProposalSigned)
+ if err != nil {
+ return nil, xerrors.Errorf("serializing proposal node failed: %w", err)
+ }
+
+ if !dealProposalIpld.Cid().Equals(resp.Response.Proposal) {
+ return nil, xerrors.Errorf("provider returned proposal cid %s but we expected %s", resp.Response.Proposal, dealProposalIpld.Cid())
+ }
+
+ if resp.Response.State != storagemarket.StorageDealWaitingForData {
+ return nil, xerrors.Errorf("provider returned unexpected state %d for proposal %s, with message: %s", resp.Response.State, resp.Response.Proposal, resp.Response.Message)
+ }
+
+ return &resp.Response.Proposal, nil
}
func (a *API) ClientListDeals(ctx context.Context) ([]api.DealInfo, error) {
@@ -601,6 +713,11 @@ func (a *API) clientRetrieve(ctx context.Context, order api.RetrievalOrder, ref
}
}
+ if order.Total.Int == nil {
+ finish(xerrors.Errorf("cannot make retrieval deal for null total"))
+ return
+ }
+
if order.Size == 0 {
finish(xerrors.Errorf("cannot make retrieval deal for zero bytes"))
return
@@ -720,6 +837,83 @@ func (a *API) clientRetrieve(ctx context.Context, order api.RetrievalOrder, ref
return
}
+func (a *API) ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) {
+ deals, err := a.Retrieval.ListDeals()
+ if err != nil {
+ return nil, err
+ }
+ dataTransfersByID, err := a.transfersByID(ctx)
+ if err != nil {
+ return nil, err
+ }
+ out := make([]api.RetrievalInfo, 0, len(deals))
+ for _, v := range deals {
+ // Find the data transfer associated with this deal
+ var transferCh *api.DataTransferChannel
+ if v.ChannelID != nil {
+ if ch, ok := dataTransfersByID[*v.ChannelID]; ok {
+ transferCh = &ch
+ }
+ }
+ out = append(out, a.newRetrievalInfoWithTransfer(transferCh, v))
+ }
+ sort.Slice(out, func(a, b int) bool {
+ return out[a].ID < out[b].ID
+ })
+ return out, nil
+}
+
+func (a *API) ClientGetRetrievalUpdates(ctx context.Context) (<-chan api.RetrievalInfo, error) {
+ updates := make(chan api.RetrievalInfo)
+
+ unsub := a.Retrieval.SubscribeToEvents(func(_ rm.ClientEvent, deal rm.ClientDealState) {
+ updates <- a.newRetrievalInfo(ctx, deal)
+ })
+
+ go func() {
+ defer unsub()
+ <-ctx.Done()
+ }()
+
+ return updates, nil
+}
+
+func (a *API) newRetrievalInfoWithTransfer(ch *api.DataTransferChannel, deal rm.ClientDealState) api.RetrievalInfo {
+ return api.RetrievalInfo{
+ PayloadCID: deal.PayloadCID,
+ ID: deal.ID,
+ PieceCID: deal.PieceCID,
+ PricePerByte: deal.PricePerByte,
+ UnsealPrice: deal.UnsealPrice,
+ Status: deal.Status,
+ Message: deal.Message,
+ Provider: deal.Sender,
+ BytesReceived: deal.TotalReceived,
+ BytesPaidFor: deal.BytesPaidFor,
+ TotalPaid: deal.FundsSpent,
+ TransferChannelID: deal.ChannelID,
+ DataTransfer: ch,
+ }
+}
+
+func (a *API) newRetrievalInfo(ctx context.Context, v rm.ClientDealState) api.RetrievalInfo {
+ // Find the data transfer associated with this deal
+ var transferCh *api.DataTransferChannel
+ if v.ChannelID != nil {
+ state, err := a.DataTransfer.ChannelState(ctx, *v.ChannelID)
+
+ // Note: If there was an error just ignore it, as the data transfer may
+ // be not found if it's no longer active
+ if err == nil {
+ ch := api.NewDataTransferChannel(a.Host.ID(), state)
+ ch.Stages = state.Stages()
+ transferCh = &ch
+ }
+ }
+
+ return a.newRetrievalInfoWithTransfer(transferCh, v)
+}
+
type multiStoreRetrievalStore struct {
storeID multistore.StoreID
store *multistore.Store
diff --git a/node/impl/common/common.go b/node/impl/common/common.go
index 7d99fb42a..f1c57665c 100644
--- a/node/impl/common/common.go
+++ b/node/impl/common/common.go
@@ -156,7 +156,7 @@ func (a *CommonAPI) NetFindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo,
}
func (a *CommonAPI) NetAutoNatStatus(ctx context.Context) (i api.NatInfo, err error) {
- autonat := a.RawHost.(*basichost.BasicHost).AutoNat
+ autonat := a.RawHost.(*basichost.BasicHost).GetAutoNat()
if autonat == nil {
return api.NatInfo{
diff --git a/node/impl/full.go b/node/impl/full.go
index add40917c..50fd09cdf 100644
--- a/node/impl/full.go
+++ b/node/impl/full.go
@@ -2,16 +2,21 @@ package impl
import (
"context"
+ "time"
+
+ "github.com/libp2p/go-libp2p-core/peer"
logging "github.com/ipfs/go-log/v2"
"github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/node/impl/client"
"github.com/filecoin-project/lotus/node/impl/common"
"github.com/filecoin-project/lotus/node/impl/full"
"github.com/filecoin-project/lotus/node/impl/market"
"github.com/filecoin-project/lotus/node/impl/paych"
"github.com/filecoin-project/lotus/node/modules/dtypes"
+ "github.com/filecoin-project/lotus/node/modules/lp2p"
)
var log = logging.Logger("node")
@@ -30,11 +35,86 @@ type FullNodeAPI struct {
full.SyncAPI
full.BeaconAPI
- DS dtypes.MetadataDS
+ DS dtypes.MetadataDS
+ NetworkName dtypes.NetworkName
}
func (n *FullNodeAPI) CreateBackup(ctx context.Context, fpath string) error {
return backup(n.DS, fpath)
}
+func (n *FullNodeAPI) NodeStatus(ctx context.Context, inclChainStatus bool) (status api.NodeStatus, err error) {
+ curTs, err := n.ChainHead(ctx)
+ if err != nil {
+ return status, err
+ }
+
+ status.SyncStatus.Epoch = uint64(curTs.Height())
+ timestamp := time.Unix(int64(curTs.MinTimestamp()), 0)
+ delta := time.Since(timestamp).Seconds()
+ status.SyncStatus.Behind = uint64(delta / 30)
+
+ // get peers in the messages and blocks topics
+ peersMsgs := make(map[peer.ID]struct{})
+ peersBlocks := make(map[peer.ID]struct{})
+
+ for _, p := range n.PubSub.ListPeers(build.MessagesTopic(n.NetworkName)) {
+ peersMsgs[p] = struct{}{}
+ }
+
+ for _, p := range n.PubSub.ListPeers(build.BlocksTopic(n.NetworkName)) {
+ peersBlocks[p] = struct{}{}
+ }
+
+ // get scores for all connected and recent peers
+ scores, err := n.NetPubsubScores(ctx)
+ if err != nil {
+ return status, err
+ }
+
+ for _, score := range scores {
+ if score.Score.Score > lp2p.PublishScoreThreshold {
+ _, inMsgs := peersMsgs[score.ID]
+ if inMsgs {
+ status.PeerStatus.PeersToPublishMsgs++
+ }
+
+ _, inBlocks := peersBlocks[score.ID]
+ if inBlocks {
+ status.PeerStatus.PeersToPublishBlocks++
+ }
+ }
+ }
+
+ if inclChainStatus && status.SyncStatus.Epoch > uint64(build.Finality) {
+ blockCnt := 0
+ ts := curTs
+
+ for i := 0; i < 100; i++ {
+ blockCnt += len(ts.Blocks())
+ tsk := ts.Parents()
+ ts, err = n.ChainGetTipSet(ctx, tsk)
+ if err != nil {
+ return status, err
+ }
+ }
+
+ status.ChainStatus.BlocksPerTipsetLast100 = float64(blockCnt) / 100
+
+ for i := 100; i < int(build.Finality); i++ {
+ blockCnt += len(ts.Blocks())
+ tsk := ts.Parents()
+ ts, err = n.ChainGetTipSet(ctx, tsk)
+ if err != nil {
+ return status, err
+ }
+ }
+
+ status.ChainStatus.BlocksPerTipsetLastFinality = float64(blockCnt) / float64(build.Finality)
+
+ }
+
+ return status, nil
+}
+
var _ api.FullNode = &FullNodeAPI{}
diff --git a/node/impl/full/chain.go b/node/impl/full/chain.go
index 845c0ce60..d26c2d7ea 100644
--- a/node/impl/full/chain.go
+++ b/node/impl/full/chain.go
@@ -53,6 +53,8 @@ type ChainModuleAPI interface {
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
}
+var _ ChainModuleAPI = *new(api.FullNode)
+
// ChainModule provides a default implementation of ChainModuleAPI.
// It can be swapped out with another implementation through Dependency
// Injection (for example with a thin RPC client).
diff --git a/node/impl/full/gas.go b/node/impl/full/gas.go
index acd2eccfe..edf53ff63 100644
--- a/node/impl/full/gas.go
+++ b/node/impl/full/gas.go
@@ -31,6 +31,8 @@ type GasModuleAPI interface {
GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
}
+var _ GasModuleAPI = *new(api.FullNode)
+
// GasModule provides a default implementation of GasModuleAPI.
// It can be swapped out with another implementation through Dependency
// Injection (for example with a thin RPC client).
@@ -322,7 +324,7 @@ func gasEstimateGasLimit(
func (m *GasModule) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, _ types.TipSetKey) (*types.Message, error) {
if msg.GasLimit == 0 {
- gasLimit, err := m.GasEstimateGasLimit(ctx, msg, types.TipSetKey{})
+ gasLimit, err := m.GasEstimateGasLimit(ctx, msg, types.EmptyTSK)
if err != nil {
return nil, xerrors.Errorf("estimating gas used: %w", err)
}
@@ -330,7 +332,7 @@ func (m *GasModule) GasEstimateMessageGas(ctx context.Context, msg *types.Messag
}
if msg.GasPremium == types.EmptyInt || types.BigCmp(msg.GasPremium, types.NewInt(0)) == 0 {
- gasPremium, err := m.GasEstimateGasPremium(ctx, 10, msg.From, msg.GasLimit, types.TipSetKey{})
+ gasPremium, err := m.GasEstimateGasPremium(ctx, 10, msg.From, msg.GasLimit, types.EmptyTSK)
if err != nil {
return nil, xerrors.Errorf("estimating gas price: %w", err)
}
diff --git a/node/impl/full/mpool.go b/node/impl/full/mpool.go
index d2552e1d5..bd91387a2 100644
--- a/node/impl/full/mpool.go
+++ b/node/impl/full/mpool.go
@@ -20,6 +20,8 @@ type MpoolModuleAPI interface {
MpoolPush(ctx context.Context, smsg *types.SignedMessage) (cid.Cid, error)
}
+var _ MpoolModuleAPI = *new(api.FullNode)
+
// MpoolModule provides a default implementation of MpoolModuleAPI.
// It can be swapped out with another implementation through Dependency
// Injection (for example with a thin RPC client).
@@ -223,8 +225,20 @@ func (a *MpoolAPI) MpoolBatchPushMessage(ctx context.Context, msgs []*types.Mess
return smsgs, nil
}
+func (a *MpoolAPI) MpoolCheckMessages(ctx context.Context, protos []*api.MessagePrototype) ([][]api.MessageCheckStatus, error) {
+ return a.Mpool.CheckMessages(ctx, protos)
+}
+
+func (a *MpoolAPI) MpoolCheckPendingMessages(ctx context.Context, from address.Address) ([][]api.MessageCheckStatus, error) {
+ return a.Mpool.CheckPendingMessages(ctx, from)
+}
+
+func (a *MpoolAPI) MpoolCheckReplaceMessages(ctx context.Context, msgs []*types.Message) ([][]api.MessageCheckStatus, error) {
+ return a.Mpool.CheckReplaceMessages(ctx, msgs)
+}
+
func (a *MpoolAPI) MpoolGetNonce(ctx context.Context, addr address.Address) (uint64, error) {
- return a.Mpool.GetNonce(ctx, addr)
+ return a.Mpool.GetNonce(ctx, addr, types.EmptyTSK)
}
func (a *MpoolAPI) MpoolSub(ctx context.Context) (<-chan api.MpoolUpdate, error) {
diff --git a/node/impl/full/multisig.go b/node/impl/full/multisig.go
index 9c5f683c4..e44509d7c 100644
--- a/node/impl/full/multisig.go
+++ b/node/impl/full/multisig.go
@@ -14,7 +14,6 @@ import (
multisig2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/multisig"
- "github.com/ipfs/go-cid"
"go.uber.org/fx"
"golang.org/x/xerrors"
)
@@ -37,134 +36,129 @@ func (a *MsigAPI) messageBuilder(ctx context.Context, from address.Address) (mul
// TODO: remove gp (gasPrice) from arguments
// TODO: Add "vesting start" to arguments.
-func (a *MsigAPI) MsigCreate(ctx context.Context, req uint64, addrs []address.Address, duration abi.ChainEpoch, val types.BigInt, src address.Address, gp types.BigInt) (cid.Cid, error) {
+func (a *MsigAPI) MsigCreate(ctx context.Context, req uint64, addrs []address.Address, duration abi.ChainEpoch, val types.BigInt, src address.Address, gp types.BigInt) (*api.MessagePrototype, error) {
mb, err := a.messageBuilder(ctx, src)
if err != nil {
- return cid.Undef, err
+ return nil, err
}
msg, err := mb.Create(addrs, req, 0, duration, val)
if err != nil {
- return cid.Undef, err
+ return nil, err
}
- // send the message out to the network
- smsg, err := a.MpoolAPI.MpoolPushMessage(ctx, msg, nil)
- if err != nil {
- return cid.Undef, err
- }
-
- return smsg.Cid(), nil
+ return &api.MessagePrototype{
+ Message: *msg,
+ ValidNonce: false,
+ }, nil
}
-func (a *MsigAPI) MsigPropose(ctx context.Context, msig address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
+func (a *MsigAPI) MsigPropose(ctx context.Context, msig address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (*api.MessagePrototype, error) {
mb, err := a.messageBuilder(ctx, src)
if err != nil {
- return cid.Undef, err
+ return nil, err
}
msg, err := mb.Propose(msig, to, amt, abi.MethodNum(method), params)
if err != nil {
- return cid.Undef, xerrors.Errorf("failed to create proposal: %w", err)
+ return nil, xerrors.Errorf("failed to create proposal: %w", err)
}
- smsg, err := a.MpoolAPI.MpoolPushMessage(ctx, msg, nil)
- if err != nil {
- return cid.Undef, xerrors.Errorf("failed to push message: %w", err)
- }
-
- return smsg.Cid(), nil
+ return &api.MessagePrototype{
+ Message: *msg,
+ ValidNonce: false,
+ }, nil
}
-func (a *MsigAPI) MsigAddPropose(ctx context.Context, msig address.Address, src address.Address, newAdd address.Address, inc bool) (cid.Cid, error) {
+func (a *MsigAPI) MsigAddPropose(ctx context.Context, msig address.Address, src address.Address, newAdd address.Address, inc bool) (*api.MessagePrototype, error) {
enc, actErr := serializeAddParams(newAdd, inc)
if actErr != nil {
- return cid.Undef, actErr
+ return nil, actErr
}
return a.MsigPropose(ctx, msig, msig, big.Zero(), src, uint64(multisig.Methods.AddSigner), enc)
}
-func (a *MsigAPI) MsigAddApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, newAdd address.Address, inc bool) (cid.Cid, error) {
+func (a *MsigAPI) MsigAddApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, newAdd address.Address, inc bool) (*api.MessagePrototype, error) {
enc, actErr := serializeAddParams(newAdd, inc)
if actErr != nil {
- return cid.Undef, actErr
+ return nil, actErr
}
return a.MsigApproveTxnHash(ctx, msig, txID, proposer, msig, big.Zero(), src, uint64(multisig.Methods.AddSigner), enc)
}
-func (a *MsigAPI) MsigAddCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, newAdd address.Address, inc bool) (cid.Cid, error) {
+func (a *MsigAPI) MsigAddCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, newAdd address.Address, inc bool) (*api.MessagePrototype, error) {
enc, actErr := serializeAddParams(newAdd, inc)
if actErr != nil {
- return cid.Undef, actErr
+ return nil, actErr
}
return a.MsigCancel(ctx, msig, txID, msig, big.Zero(), src, uint64(multisig.Methods.AddSigner), enc)
}
-func (a *MsigAPI) MsigSwapPropose(ctx context.Context, msig address.Address, src address.Address, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) {
+func (a *MsigAPI) MsigSwapPropose(ctx context.Context, msig address.Address, src address.Address, oldAdd address.Address, newAdd address.Address) (*api.MessagePrototype, error) {
enc, actErr := serializeSwapParams(oldAdd, newAdd)
if actErr != nil {
- return cid.Undef, actErr
+ return nil, actErr
}
return a.MsigPropose(ctx, msig, msig, big.Zero(), src, uint64(multisig.Methods.SwapSigner), enc)
}
-func (a *MsigAPI) MsigSwapApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) {
+func (a *MsigAPI) MsigSwapApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, oldAdd address.Address, newAdd address.Address) (*api.MessagePrototype, error) {
enc, actErr := serializeSwapParams(oldAdd, newAdd)
if actErr != nil {
- return cid.Undef, actErr
+ return nil, actErr
}
return a.MsigApproveTxnHash(ctx, msig, txID, proposer, msig, big.Zero(), src, uint64(multisig.Methods.SwapSigner), enc)
}
-func (a *MsigAPI) MsigSwapCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) {
+func (a *MsigAPI) MsigSwapCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, oldAdd address.Address, newAdd address.Address) (*api.MessagePrototype, error) {
enc, actErr := serializeSwapParams(oldAdd, newAdd)
if actErr != nil {
- return cid.Undef, actErr
+ return nil, actErr
}
return a.MsigCancel(ctx, msig, txID, msig, big.Zero(), src, uint64(multisig.Methods.SwapSigner), enc)
}
-func (a *MsigAPI) MsigApprove(ctx context.Context, msig address.Address, txID uint64, src address.Address) (cid.Cid, error) {
+func (a *MsigAPI) MsigApprove(ctx context.Context, msig address.Address, txID uint64, src address.Address) (*api.MessagePrototype, error) {
return a.msigApproveOrCancelSimple(ctx, api.MsigApprove, msig, txID, src)
}
-func (a *MsigAPI) MsigApproveTxnHash(ctx context.Context, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
+func (a *MsigAPI) MsigApproveTxnHash(ctx context.Context, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (*api.MessagePrototype, error) {
return a.msigApproveOrCancelTxnHash(ctx, api.MsigApprove, msig, txID, proposer, to, amt, src, method, params)
}
-func (a *MsigAPI) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
+func (a *MsigAPI) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (*api.MessagePrototype, error) {
return a.msigApproveOrCancelTxnHash(ctx, api.MsigCancel, msig, txID, src, to, amt, src, method, params)
}
-func (a *MsigAPI) MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) {
+func (a *MsigAPI) MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (*api.MessagePrototype, error) {
enc, actErr := serializeRemoveParams(toRemove, decrease)
if actErr != nil {
- return cid.Undef, actErr
+ return nil, actErr
}
return a.MsigPropose(ctx, msig, msig, types.NewInt(0), proposer, uint64(multisig.Methods.RemoveSigner), enc)
}
-func (a *MsigAPI) msigApproveOrCancelSimple(ctx context.Context, operation api.MsigProposeResponse, msig address.Address, txID uint64, src address.Address) (cid.Cid, error) {
+func (a *MsigAPI) msigApproveOrCancelSimple(ctx context.Context, operation api.MsigProposeResponse, msig address.Address, txID uint64, src address.Address) (*api.MessagePrototype, error) {
if msig == address.Undef {
- return cid.Undef, xerrors.Errorf("must provide multisig address")
+ return nil, xerrors.Errorf("must provide multisig address")
}
if src == address.Undef {
- return cid.Undef, xerrors.Errorf("must provide source address")
+ return nil, xerrors.Errorf("must provide source address")
}
mb, err := a.messageBuilder(ctx, src)
if err != nil {
- return cid.Undef, err
+ return nil, err
}
var msg *types.Message
@@ -174,34 +168,31 @@ func (a *MsigAPI) msigApproveOrCancelSimple(ctx context.Context, operation api.M
case api.MsigCancel:
msg, err = mb.Cancel(msig, txID, nil)
default:
- return cid.Undef, xerrors.Errorf("Invalid operation for msigApproveOrCancel")
+ return nil, xerrors.Errorf("Invalid operation for msigApproveOrCancel")
}
if err != nil {
- return cid.Undef, err
+ return nil, err
}
- smsg, err := a.MpoolAPI.MpoolPushMessage(ctx, msg, nil)
- if err != nil {
- return cid.Undef, err
- }
-
- return smsg.Cid(), nil
-
+ return &api.MessagePrototype{
+ Message: *msg,
+ ValidNonce: false,
+ }, nil
}
-func (a *MsigAPI) msigApproveOrCancelTxnHash(ctx context.Context, operation api.MsigProposeResponse, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
+func (a *MsigAPI) msigApproveOrCancelTxnHash(ctx context.Context, operation api.MsigProposeResponse, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (*api.MessagePrototype, error) {
if msig == address.Undef {
- return cid.Undef, xerrors.Errorf("must provide multisig address")
+ return nil, xerrors.Errorf("must provide multisig address")
}
if src == address.Undef {
- return cid.Undef, xerrors.Errorf("must provide source address")
+ return nil, xerrors.Errorf("must provide source address")
}
if proposer.Protocol() != address.ID {
proposerID, err := a.StateAPI.StateLookupID(ctx, proposer, types.EmptyTSK)
if err != nil {
- return cid.Undef, err
+ return nil, err
}
proposer = proposerID
}
@@ -216,7 +207,7 @@ func (a *MsigAPI) msigApproveOrCancelTxnHash(ctx context.Context, operation api.
mb, err := a.messageBuilder(ctx, src)
if err != nil {
- return cid.Undef, err
+ return nil, err
}
var msg *types.Message
@@ -226,18 +217,16 @@ func (a *MsigAPI) msigApproveOrCancelTxnHash(ctx context.Context, operation api.
case api.MsigCancel:
msg, err = mb.Cancel(msig, txID, &p)
default:
- return cid.Undef, xerrors.Errorf("Invalid operation for msigApproveOrCancel")
+ return nil, xerrors.Errorf("Invalid operation for msigApproveOrCancel")
}
if err != nil {
- return cid.Undef, err
+ return nil, err
}
- smsg, err := a.MpoolAPI.MpoolPushMessage(ctx, msg, nil)
- if err != nil {
- return cid.Undef, err
- }
-
- return smsg.Cid(), nil
+ return &api.MessagePrototype{
+ Message: *msg,
+ ValidNonce: false,
+ }, nil
}
func serializeAddParams(new address.Address, inc bool) ([]byte, error) {
diff --git a/node/impl/full/state.go b/node/impl/full/state.go
index 7fcd9dc13..b3639c5e0 100644
--- a/node/impl/full/state.go
+++ b/node/impl/full/state.go
@@ -44,7 +44,6 @@ type StateModuleAPI interface {
StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error)
StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error)
- StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)
StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error)
@@ -53,12 +52,14 @@ type StateModuleAPI interface {
StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)
StateNetworkVersion(ctx context.Context, key types.TipSetKey) (network.Version, error)
- StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error)
StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
- StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error)
+ StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
+ StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
}
+var _ StateModuleAPI = *new(api.FullNode)
+
// StateModule provides a default implementation of StateModuleAPI.
// It can be swapped out with another implementation through Dependency
// Injection (for example with a thin RPC client).
@@ -378,7 +379,7 @@ func (a *StateAPI) StateReplay(ctx context.Context, tsk types.TipSetKey, mc cid.
var ts *types.TipSet
var err error
if tsk == types.EmptyTSK {
- mlkp, err := a.StateSearchMsg(ctx, mc)
+ mlkp, err := a.StateSearchMsg(ctx, types.EmptyTSK, mc, stmgr.LookbackNoLimit, true)
if err != nil {
return nil, xerrors.Errorf("searching for msg %s: %w", mc, err)
}
@@ -425,7 +426,7 @@ func (a *StateAPI) StateReplay(ctx context.Context, tsk types.TipSetKey, mc cid.
}, nil
}
-func (m *StateModule) StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) {
+func (m *StateModule) StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (a *types.Actor, err error) {
ts, err := m.Chain.GetTipSetFromKey(tsk)
if err != nil {
return nil, xerrors.Errorf("loading tipset %s: %w", tsk, err)
@@ -520,28 +521,22 @@ func (a *StateAPI) MinerCreateBlock(ctx context.Context, bt *api.BlockTemplate)
return &out, nil
}
-func (m *StateModule) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error) {
- return stateWaitMsgLimited(ctx, m.StateManager, m.Chain, msg, confidence, stmgr.LookbackNoLimit)
-}
-func (a *StateAPI) StateWaitMsgLimited(ctx context.Context, msg cid.Cid, confidence uint64, lookbackLimit abi.ChainEpoch) (*api.MsgLookup, error) {
- return stateWaitMsgLimited(ctx, a.StateManager, a.Chain, msg, confidence, lookbackLimit)
-}
-func stateWaitMsgLimited(ctx context.Context, smgr *stmgr.StateManager, cstore *store.ChainStore, msg cid.Cid, confidence uint64, lookbackLimit abi.ChainEpoch) (*api.MsgLookup, error) {
- ts, recpt, found, err := smgr.WaitForMessage(ctx, msg, confidence, lookbackLimit)
+func (m *StateModule) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) {
+ ts, recpt, found, err := m.StateManager.WaitForMessage(ctx, msg, confidence, lookbackLimit, allowReplaced)
if err != nil {
return nil, err
}
var returndec interface{}
if recpt.ExitCode == 0 && len(recpt.Return) > 0 {
- cmsg, err := cstore.GetCMessage(msg)
+ cmsg, err := m.Chain.GetCMessage(msg)
if err != nil {
return nil, xerrors.Errorf("failed to load message after successful receipt search: %w", err)
}
vmsg := cmsg.VMMessage()
- t, err := stmgr.GetReturnType(ctx, smgr, vmsg.To, vmsg.Method, ts)
+ t, err := stmgr.GetReturnType(ctx, m.StateManager, vmsg.To, vmsg.Method, ts)
if err != nil {
return nil, xerrors.Errorf("failed to get return type: %w", err)
}
@@ -562,14 +557,13 @@ func stateWaitMsgLimited(ctx context.Context, smgr *stmgr.StateManager, cstore *
}, nil
}
-func (m *StateModule) StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) {
- return stateSearchMsgLimited(ctx, m.StateManager, msg, stmgr.LookbackNoLimit)
-}
-func (a *StateAPI) StateSearchMsgLimited(ctx context.Context, msg cid.Cid, lookbackLimit abi.ChainEpoch) (*api.MsgLookup, error) {
- return stateSearchMsgLimited(ctx, a.StateManager, msg, lookbackLimit)
-}
-func stateSearchMsgLimited(ctx context.Context, smgr *stmgr.StateManager, msg cid.Cid, lookbackLimit abi.ChainEpoch) (*api.MsgLookup, error) {
- ts, recpt, found, err := smgr.SearchForMessage(ctx, msg, lookbackLimit)
+func (m *StateModule) StateSearchMsg(ctx context.Context, tsk types.TipSetKey, msg cid.Cid, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) {
+ fromTs, err := m.Chain.GetTipSetFromKey(tsk)
+ if err != nil {
+ return nil, xerrors.Errorf("loading tipset %s: %w", tsk, err)
+ }
+
+ ts, recpt, found, err := m.StateManager.SearchForMessage(ctx, fromTs, msg, lookbackLimit, allowReplaced)
if err != nil {
return nil, err
}
@@ -585,14 +579,6 @@ func stateSearchMsgLimited(ctx context.Context, smgr *stmgr.StateManager, msg ci
return nil, nil
}
-func (m *StateModule) StateGetReceipt(ctx context.Context, msg cid.Cid, tsk types.TipSetKey) (*types.MessageReceipt, error) {
- ts, err := m.Chain.GetTipSetFromKey(tsk)
- if err != nil {
- return nil, xerrors.Errorf("loading tipset %s: %w", tsk, err)
- }
- return m.StateManager.GetReceipt(ctx, msg, ts)
-}
-
func (m *StateModule) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) {
ts, err := m.Chain.GetTipSetFromKey(tsk)
if err != nil {
@@ -822,8 +808,31 @@ func (a *StateAPI) StateListMessages(ctx context.Context, match *api.MessageMatc
if match.To == address.Undef && match.From == address.Undef {
return nil, xerrors.Errorf("must specify at least To or From in message filter")
+ } else if match.To != address.Undef {
+ _, err := a.StateLookupID(ctx, match.To, tsk)
+
+ // if the recipient doesn't exist at the start point, we're not gonna find any matches
+ if xerrors.Is(err, types.ErrActorNotFound) {
+ return nil, nil
+ }
+
+ if err != nil {
+ return nil, xerrors.Errorf("looking up match.To: %w", err)
+ }
+ } else if match.From != address.Undef {
+ _, err := a.StateLookupID(ctx, match.From, tsk)
+
+ // if the sender doesn't exist at the start point, we're not gonna find any matches
+ if xerrors.Is(err, types.ErrActorNotFound) {
+ return nil, nil
+ }
+
+ if err != nil {
+ return nil, xerrors.Errorf("looking up match.From: %w", err)
+ }
}
+ // TODO: This should probably match on both ID and robust address, no?
matchFunc := func(msg *types.Message) bool {
if match.From != address.Undef && match.From != msg.From {
return false
diff --git a/node/impl/full/sync.go b/node/impl/full/sync.go
index 1a088fb77..2c697483b 100644
--- a/node/impl/full/sync.go
+++ b/node/impl/full/sync.go
@@ -104,7 +104,7 @@ func (a *SyncAPI) SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHe
func (a *SyncAPI) SyncCheckpoint(ctx context.Context, tsk types.TipSetKey) error {
log.Warnf("Marking tipset %s as checkpoint", tsk)
- return a.Syncer.SetCheckpoint(tsk)
+ return a.Syncer.SyncCheckpoint(ctx, tsk)
}
func (a *SyncAPI) SyncMarkBad(ctx context.Context, bcid cid.Cid) error {
diff --git a/node/impl/remoteworker.go b/node/impl/remoteworker.go
index 1369dc248..d27b3baff 100644
--- a/node/impl/remoteworker.go
+++ b/node/impl/remoteworker.go
@@ -33,11 +33,21 @@ func connectRemoteWorker(ctx context.Context, fa api.Common, url string) (*remot
headers := http.Header{}
headers.Add("Authorization", "Bearer "+string(token))
- wapi, closer, err := client.NewWorkerRPC(context.TODO(), url, headers)
+ wapi, closer, err := client.NewWorkerRPCV0(context.TODO(), url, headers)
if err != nil {
return nil, xerrors.Errorf("creating jsonrpc client: %w", err)
}
+ wver, err := wapi.Version(ctx)
+ if err != nil {
+ closer()
+ return nil, err
+ }
+
+ if !wver.EqMajorMinor(api.WorkerAPIVersion0) {
+ return nil, xerrors.Errorf("unsupported worker api version: %s (expected %s)", wver, api.WorkerAPIVersion0)
+ }
+
return &remoteWorker{wapi, closer}, nil
}
diff --git a/node/impl/storminer.go b/node/impl/storminer.go
index e10925927..61c69b2ba 100644
--- a/node/impl/storminer.go
+++ b/node/impl/storminer.go
@@ -35,7 +35,6 @@ import (
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/apistruct"
apitypes "github.com/filecoin-project/lotus/api/types"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/markets/storageadapter"
@@ -91,7 +90,7 @@ type StorageMinerAPI struct {
}
func (sm *StorageMinerAPI) ServeRemote(w http.ResponseWriter, r *http.Request) {
- if !auth.HasPerm(r.Context(), nil, apistruct.PermAdmin) {
+ if !auth.HasPerm(r.Context(), nil, api.PermAdmin) {
w.WriteHeader(401)
_ = json.NewEncoder(w).Encode(struct{ Error string }{"unauthorized: missing write permission"})
return
@@ -246,13 +245,13 @@ func (sm *StorageMinerAPI) SectorsList(context.Context) ([]abi.SectorNumber, err
return nil, err
}
- out := make([]abi.SectorNumber, len(sectors))
- for i, sector := range sectors {
+ out := make([]abi.SectorNumber, 0, len(sectors))
+ for _, sector := range sectors {
if sector.State == sealing.UndefinedSectorState {
continue // sector ID not set yet
}
- out[i] = sector.SectorNumber
+ out = append(out, sector.SectorNumber)
}
return out, nil
}
diff --git a/node/modules/chain.go b/node/modules/chain.go
index ffdf3aa3a..954322948 100644
--- a/node/modules/chain.go
+++ b/node/modules/chain.go
@@ -9,7 +9,6 @@ import (
"github.com/ipfs/go-blockservice"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/routing"
- pubsub "github.com/libp2p/go-libp2p-pubsub"
"go.uber.org/fx"
"golang.org/x/xerrors"
@@ -59,8 +58,7 @@ func ChainBlockService(bs dtypes.ExposedBlockstore, rem dtypes.ChainBitswap) dty
return blockservice.New(bs, rem)
}
-func MessagePool(lc fx.Lifecycle, sm *stmgr.StateManager, ps *pubsub.PubSub, ds dtypes.MetadataDS, nn dtypes.NetworkName, j journal.Journal) (*messagepool.MessagePool, error) {
- mpp := messagepool.NewProvider(sm, ps)
+func MessagePool(lc fx.Lifecycle, mpp messagepool.Provider, ds dtypes.MetadataDS, nn dtypes.NetworkName, j journal.Journal) (*messagepool.MessagePool, error) {
mp, err := messagepool.New(mpp, ds, nn, j)
if err != nil {
return nil, xerrors.Errorf("constructing mpool: %w", err)
diff --git a/node/modules/client.go b/node/modules/client.go
index c5dbff9bd..e0bcc13c7 100644
--- a/node/modules/client.go
+++ b/node/modules/client.go
@@ -134,26 +134,21 @@ func NewClientGraphsyncDataTransfer(lc fx.Lifecycle, h host.Host, gs dtypes.Grap
// data-transfer push / pull channel restart configuration:
dtRestartConfig := dtimpl.ChannelRestartConfig(channelmonitor.Config{
- // For now only monitor push channels (for storage deals)
- MonitorPushChannels: true,
- // TODO: Enable pull channel monitoring (for retrievals) when the
- // following issue has been fixed:
- // https://github.com/filecoin-project/go-data-transfer/issues/172
- MonitorPullChannels: false,
- // Wait up to 30s for the other side to respond to an Open channel message
- AcceptTimeout: 30 * time.Second,
- // Send a restart message if the data rate falls below 1024 bytes / minute
- Interval: time.Minute,
- MinBytesTransferred: 1024,
- // Perform check 10 times / minute
- ChecksPerInterval: 10,
+ // Disable Accept and Complete timeouts until this issue is resolved:
+ // https://github.com/filecoin-project/lotus/issues/6343#
+ // Wait for the other side to respond to an Open channel message
+ AcceptTimeout: 0,
+ // Wait for the other side to send a Complete message once all
+ // data has been sent / received
+ CompleteTimeout: 0,
+
+ // When an error occurs, wait a little while until all related errors
+ // have fired before sending a restart message
+ RestartDebounce: 10 * time.Second,
// After sending a restart, wait for at least 1 minute before sending another
RestartBackoff: time.Minute,
// After trying to restart 3 times, give up and fail the transfer
MaxConsecutiveRestarts: 3,
- // Wait up to 30s for the other side to send a Complete message once all
- // data has been sent / received
- CompleteTimeout: 30 * time.Second,
})
dt, err := dtimpl.NewDataTransfer(dtDs, filepath.Join(r.Path(), "data-transfer"), net, transport, dtRestartConfig)
if err != nil {
diff --git a/node/modules/core.go b/node/modules/core.go
index 83a7e8d42..e089333e7 100644
--- a/node/modules/core.go
+++ b/node/modules/core.go
@@ -22,7 +22,7 @@ import (
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/lotus/api/apistruct"
+ "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/lib/addrutil"
@@ -163,7 +163,7 @@ func APISecret(keystore types.KeyStore, lr repo.LockedRepo) (*dtypes.APIAlg, err
// TODO: make this configurable
p := JwtPayload{
- Allow: apistruct.AllPermissions,
+ Allow: api.AllPermissions,
}
cliToken, err := jwt.Sign(&p, jwt.NewHS256(key.PrivateKey))
diff --git a/node/modules/dtypes/miner.go b/node/modules/dtypes/miner.go
index 16af48add..b7a1be2e1 100644
--- a/node/modules/dtypes/miner.go
+++ b/node/modules/dtypes/miner.go
@@ -74,10 +74,12 @@ type ConsiderUnverifiedStorageDealsConfigFunc func() (bool, error)
// disable or enable unverified storage deal acceptance.
type SetConsiderUnverifiedStorageDealsConfigFunc func(bool) error
-// SetSealingDelay sets how long a sector waits for more deals before sealing begins.
+// SetSealingConfigFunc is a function which is used to
+// sets the sealing config.
type SetSealingConfigFunc func(sealiface.Config) error
-// GetSealingDelay returns how long a sector waits for more deals before sealing begins.
+// GetSealingConfigFunc is a function which is used to
+// get the sealing config.
type GetSealingConfigFunc func() (sealiface.Config, error)
// SetExpectedSealDurationFunc is a function which is used to set how long sealing is expected to take.
diff --git a/node/modules/lp2p/pubsub.go b/node/modules/lp2p/pubsub.go
index 748167d95..32b85daf3 100644
--- a/node/modules/lp2p/pubsub.go
+++ b/node/modules/lp2p/pubsub.go
@@ -36,6 +36,15 @@ func init() {
pubsub.GossipSubHistoryLength = 10
pubsub.GossipSubGossipFactor = 0.1
}
+
+const (
+ GossipScoreThreshold = -500
+ PublishScoreThreshold = -1000
+ GraylistScoreThreshold = -2500
+ AcceptPXScoreThreshold = 1000
+ OpportunisticGraftScoreThreshold = 3.5
+)
+
func ScoreKeeper() *dtypes.ScoreKeeper {
return new(dtypes.ScoreKeeper)
}
@@ -256,11 +265,11 @@ func GossipSub(in GossipIn) (service *pubsub.PubSub, err error) {
Topics: topicParams,
},
&pubsub.PeerScoreThresholds{
- GossipThreshold: -500,
- PublishThreshold: -1000,
- GraylistThreshold: -2500,
- AcceptPXThreshold: 1000,
- OpportunisticGraftThreshold: 3.5,
+ GossipThreshold: GossipScoreThreshold,
+ PublishThreshold: PublishScoreThreshold,
+ GraylistThreshold: GraylistScoreThreshold,
+ AcceptPXThreshold: AcceptPXScoreThreshold,
+ OpportunisticGraftThreshold: OpportunisticGraftScoreThreshold,
},
),
pubsub.WithPeerScoreInspect(in.Sk.Update, 10*time.Second),
diff --git a/node/modules/mpoolnonceapi.go b/node/modules/mpoolnonceapi.go
index 6d775f010..67f512960 100644
--- a/node/modules/mpoolnonceapi.go
+++ b/node/modules/mpoolnonceapi.go
@@ -2,6 +2,7 @@ package modules
import (
"context"
+ "strings"
"go.uber.org/fx"
"golang.org/x/xerrors"
@@ -19,44 +20,89 @@ import (
type MpoolNonceAPI struct {
fx.In
- StateAPI full.StateAPI
+ ChainModule full.ChainModuleAPI
+ StateModule full.StateModuleAPI
}
// GetNonce gets the nonce from current chain head.
-func (a *MpoolNonceAPI) GetNonce(ctx context.Context, addr address.Address) (uint64, error) {
- ts := a.StateAPI.Chain.GetHeaviestTipSet()
+func (a *MpoolNonceAPI) GetNonce(ctx context.Context, addr address.Address, tsk types.TipSetKey) (uint64, error) {
+ var err error
+ var ts *types.TipSet
+ if tsk == types.EmptyTSK {
+ // we need consistent tsk
+ ts, err = a.ChainModule.ChainHead(ctx)
+ if err != nil {
+ return 0, xerrors.Errorf("getting head: %w", err)
+ }
+ tsk = ts.Key()
+ } else {
+ ts, err = a.ChainModule.ChainGetTipSet(ctx, tsk)
+ if err != nil {
+ return 0, xerrors.Errorf("getting tipset: %w", err)
+ }
+ }
- // make sure we have a key address so we can compare with messages
- keyAddr, err := a.StateAPI.StateManager.ResolveToKeyAddress(ctx, addr, ts)
- if err != nil {
- return 0, err
+ keyAddr := addr
+
+ if addr.Protocol() == address.ID {
+ // make sure we have a key address so we can compare with messages
+ keyAddr, err = a.StateModule.StateAccountKey(ctx, addr, tsk)
+ if err != nil {
+ return 0, xerrors.Errorf("getting account key: %w", err)
+ }
+ } else {
+ addr, err = a.StateModule.StateLookupID(ctx, addr, types.EmptyTSK)
+ if err != nil {
+ log.Infof("failed to look up id addr for %s: %w", addr, err)
+ addr = address.Undef
+ }
}
// Load the last nonce from the state, if it exists.
highestNonce := uint64(0)
- if baseActor, err := a.StateAPI.StateManager.LoadActorRaw(ctx, addr, ts.ParentState()); err != nil {
- if !xerrors.Is(err, types.ErrActorNotFound) {
- return 0, err
+ act, err := a.StateModule.StateGetActor(ctx, keyAddr, ts.Key())
+ if err != nil {
+ if strings.Contains(err.Error(), types.ErrActorNotFound.Error()) {
+ return 0, xerrors.Errorf("getting actor converted: %w", types.ErrActorNotFound)
+ }
+ return 0, xerrors.Errorf("getting actor: %w", err)
+ }
+ highestNonce = act.Nonce
+
+ apply := func(msg *types.Message) {
+ if msg.From != addr && msg.From != keyAddr {
+ return
+ }
+ if msg.Nonce == highestNonce {
+ highestNonce = msg.Nonce + 1
}
- } else {
- highestNonce = baseActor.Nonce
}
- // Otherwise, find the highest nonce in the tipset.
- msgs, err := a.StateAPI.Chain.MessagesForTipset(ts)
- if err != nil {
- return 0, err
- }
- for _, msg := range msgs {
- vmmsg := msg.VMMessage()
- if vmmsg.From != keyAddr {
- continue
+ for _, b := range ts.Blocks() {
+ msgs, err := a.ChainModule.ChainGetBlockMessages(ctx, b.Cid())
+ if err != nil {
+ return 0, xerrors.Errorf("getting block messages: %w", err)
}
- if vmmsg.Nonce >= highestNonce {
- highestNonce = vmmsg.Nonce + 1
+ if keyAddr.Protocol() == address.BLS {
+ for _, m := range msgs.BlsMessages {
+ apply(m)
+ }
+ } else {
+ for _, sm := range msgs.SecpkMessages {
+ apply(&sm.Message)
+ }
}
}
return highestNonce, nil
}
+func (a *MpoolNonceAPI) GetActor(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*types.Actor, error) {
+ act, err := a.StateModule.StateGetActor(ctx, addr, tsk)
+ if err != nil {
+ return nil, xerrors.Errorf("calling StateGetActor: %w", err)
+ }
+
+ return act, nil
+}
+
var _ messagesigner.MpoolNonceAPI = (*MpoolNonceAPI)(nil)
diff --git a/node/modules/paych.go b/node/modules/paych.go
index a9fd25a3e..905590057 100644
--- a/node/modules/paych.go
+++ b/node/modules/paych.go
@@ -32,6 +32,8 @@ type PaychAPI struct {
full.StateAPI
}
+var _ paychmgr.PaychAPI = &PaychAPI{}
+
// HandlePaychManager is called by dependency injection to set up hooks
func HandlePaychManager(lc fx.Lifecycle, pm *paychmgr.Manager) {
lc.Append(fx.Hook{
diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go
index 55b18eac0..296f1c10e 100644
--- a/node/modules/storageminer.go
+++ b/node/modules/storageminer.go
@@ -55,7 +55,8 @@ import (
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
- lapi "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
+ "github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin"
@@ -116,14 +117,14 @@ func MinerID(ma dtypes.MinerAddress) (dtypes.MinerID, error) {
return dtypes.MinerID(id), err
}
-func StorageNetworkName(ctx helpers.MetricsCtx, a lapi.FullNode) (dtypes.NetworkName, error) {
+func StorageNetworkName(ctx helpers.MetricsCtx, a v1api.FullNode) (dtypes.NetworkName, error) {
if !build.Devnet {
return "testnetnet", nil
}
return a.StateNetworkName(ctx)
}
-func SealProofType(maddr dtypes.MinerAddress, fnapi lapi.FullNode) (abi.RegisteredSealProof, error) {
+func SealProofType(maddr dtypes.MinerAddress, fnapi v1api.FullNode) (abi.RegisteredSealProof, error) {
mi, err := fnapi.StateMinerInfo(context.TODO(), address.Address(maddr), types.EmptyTSK)
if err != nil {
return 0, err
@@ -196,7 +197,7 @@ type StorageMinerParams struct {
Lifecycle fx.Lifecycle
MetricsCtx helpers.MetricsCtx
- API lapi.FullNode
+ API v1api.FullNode
Host host.Host
MetadataDS dtypes.MetadataDS
Sealer sectorstorage.SectorManager
@@ -439,7 +440,7 @@ func StagingGraphsync(mctx helpers.MetricsCtx, lc fx.Lifecycle, ibs dtypes.Stagi
return gs
}
-func SetupBlockProducer(lc fx.Lifecycle, ds dtypes.MetadataDS, api lapi.FullNode, epp gen.WinningPoStProver, sf *slashfilter.SlashFilter, j journal.Journal) (*lotusminer.Miner, error) {
+func SetupBlockProducer(lc fx.Lifecycle, ds dtypes.MetadataDS, api v1api.FullNode, epp gen.WinningPoStProver, sf *slashfilter.SlashFilter, j journal.Journal) (*lotusminer.Miner, error) {
minerAddr, err := minerAddrFromDS(ds)
if err != nil {
return nil, err
@@ -462,7 +463,7 @@ func SetupBlockProducer(lc fx.Lifecycle, ds dtypes.MetadataDS, api lapi.FullNode
return m, nil
}
-func NewStorageAsk(ctx helpers.MetricsCtx, fapi lapi.FullNode, ds dtypes.MetadataDS, minerAddress dtypes.MinerAddress, spn storagemarket.StorageProviderNode) (*storedask.StoredAsk, error) {
+func NewStorageAsk(ctx helpers.MetricsCtx, fapi v1api.FullNode, ds dtypes.MetadataDS, minerAddress dtypes.MinerAddress, spn storagemarket.StorageProviderNode) (*storedask.StoredAsk, error) {
mi, err := fapi.StateMinerInfo(ctx, address.Address(minerAddress), types.EmptyTSK)
if err != nil {
@@ -636,17 +637,15 @@ func RetrievalDealFilter(userFilter dtypes.RetrievalDealFilter) func(onlineOk dt
// RetrievalProvider creates a new retrieval provider attached to the provider blockstore
func RetrievalProvider(h host.Host,
miner *storage.Miner,
- sealer sectorstorage.SectorManager,
- full lapi.FullNode,
+ full v1api.FullNode,
ds dtypes.MetadataDS,
pieceStore dtypes.ProviderPieceStore,
mds dtypes.StagingMultiDstore,
dt dtypes.ProviderDataTransfer,
- onlineOk dtypes.ConsiderOnlineRetrievalDealsConfigFunc,
- offlineOk dtypes.ConsiderOfflineRetrievalDealsConfigFunc,
+ pieceProvider sectorstorage.PieceProvider,
userFilter dtypes.RetrievalDealFilter,
) (retrievalmarket.RetrievalProvider, error) {
- adapter := retrievaladapter.NewRetrievalProviderNode(miner, sealer, full)
+ adapter := retrievaladapter.NewRetrievalProviderNode(miner, pieceProvider, full)
maddr, err := minerAddrFromDS(ds)
if err != nil {
@@ -662,13 +661,22 @@ func RetrievalProvider(h host.Host,
var WorkerCallsPrefix = datastore.NewKey("/worker/calls")
var ManagerWorkPrefix = datastore.NewKey("/stmgr/calls")
-func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, ls stores.LocalStorage, si stores.SectorIndex, sc sectorstorage.SealerConfig, urls sectorstorage.URLs, sa sectorstorage.StorageAuth, ds dtypes.MetadataDS) (*sectorstorage.Manager, error) {
+func LocalStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, ls stores.LocalStorage, si stores.SectorIndex, urls sectorstorage.URLs) (*stores.Local, error) {
+ ctx := helpers.LifecycleCtx(mctx, lc)
+ return stores.NewLocal(ctx, ls, si, urls)
+}
+
+func RemoteStorage(lstor *stores.Local, si stores.SectorIndex, sa sectorstorage.StorageAuth, sc sectorstorage.SealerConfig) *stores.Remote {
+ return stores.NewRemote(lstor, si, http.Header(sa), sc.ParallelFetchLimit, &stores.DefaultPartialFileHandler{})
+}
+
+func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, lstor *stores.Local, stor *stores.Remote, ls stores.LocalStorage, si stores.SectorIndex, sc sectorstorage.SealerConfig, ds dtypes.MetadataDS) (*sectorstorage.Manager, error) {
ctx := helpers.LifecycleCtx(mctx, lc)
wsts := statestore.New(namespace.Wrap(ds, WorkerCallsPrefix))
smsts := statestore.New(namespace.Wrap(ds, ManagerWorkPrefix))
- sst, err := sectorstorage.New(ctx, ls, si, sc, urls, sa, wsts, smsts)
+ sst, err := sectorstorage.New(ctx, lstor, stor, ls, si, sc, wsts, smsts)
if err != nil {
return nil, err
}
@@ -680,7 +688,7 @@ func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, ls stores.LocalStor
return sst, nil
}
-func StorageAuth(ctx helpers.MetricsCtx, ca lapi.Common) (sectorstorage.StorageAuth, error) {
+func StorageAuth(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) {
token, err := ca.AuthNew(ctx, []auth.Permission{"admin"})
if err != nil {
return nil, xerrors.Errorf("creating storage auth header: %w", err)
diff --git a/node/node_test.go b/node/node_test.go
deleted file mode 100644
index 933a0f614..000000000
--- a/node/node_test.go
+++ /dev/null
@@ -1,288 +0,0 @@
-package node_test
-
-import (
- "os"
- "testing"
- "time"
-
- "github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/lotus/api/test"
- "github.com/filecoin-project/lotus/chain/actors/policy"
- "github.com/filecoin-project/lotus/lib/lotuslog"
- builder "github.com/filecoin-project/lotus/node/test"
- logging "github.com/ipfs/go-log/v2"
-)
-
-func init() {
- _ = logging.SetLogLevel("*", "INFO")
-
- policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
- policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
- policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
-}
-
-func TestAPI(t *testing.T) {
- test.TestApis(t, builder.Builder)
-}
-
-func TestAPIRPC(t *testing.T) {
- test.TestApis(t, builder.RPCBuilder)
-}
-
-func TestAPIDealFlow(t *testing.T) {
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- blockTime := 10 * time.Millisecond
-
- // For these tests where the block time is artificially short, just use
- // a deal start epoch that is guaranteed to be far enough in the future
- // so that the deal starts sealing in time
- dealStartEpoch := abi.ChainEpoch(2 << 12)
-
- t.Run("TestDealFlow", func(t *testing.T) {
- test.TestDealFlow(t, builder.MockSbBuilder, blockTime, false, false, dealStartEpoch)
- })
- t.Run("WithExportedCAR", func(t *testing.T) {
- test.TestDealFlow(t, builder.MockSbBuilder, blockTime, true, false, dealStartEpoch)
- })
- t.Run("TestDoubleDealFlow", func(t *testing.T) {
- test.TestDoubleDealFlow(t, builder.MockSbBuilder, blockTime, dealStartEpoch)
- })
- t.Run("TestFastRetrievalDealFlow", func(t *testing.T) {
- test.TestFastRetrievalDealFlow(t, builder.MockSbBuilder, blockTime, dealStartEpoch)
- })
- t.Run("TestPublishDealsBatching", func(t *testing.T) {
- test.TestPublishDealsBatching(t, builder.MockSbBuilder, blockTime, dealStartEpoch)
- })
- t.Run("TestBatchDealInput", func(t *testing.T) {
- test.TestBatchDealInput(t, builder.MockSbBuilder, blockTime, dealStartEpoch)
- })
-}
-
-func TestAPIDealFlowReal(t *testing.T) {
- if testing.Short() {
- t.Skip("skipping test in short mode")
- }
- lotuslog.SetupLogLevels()
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- // TODO: just set this globally?
- oldDelay := policy.GetPreCommitChallengeDelay()
- policy.SetPreCommitChallengeDelay(5)
- t.Cleanup(func() {
- policy.SetPreCommitChallengeDelay(oldDelay)
- })
-
- t.Run("basic", func(t *testing.T) {
- test.TestDealFlow(t, builder.Builder, time.Second, false, false, 0)
- })
-
- t.Run("fast-retrieval", func(t *testing.T) {
- test.TestDealFlow(t, builder.Builder, time.Second, false, true, 0)
- })
-
- t.Run("retrieval-second", func(t *testing.T) {
- test.TestSecondDealRetrieval(t, builder.Builder, time.Second)
- })
-}
-
-func TestDealMining(t *testing.T) {
- if testing.Short() {
- t.Skip("skipping test in short mode")
- }
-
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestDealMining(t, builder.MockSbBuilder, 50*time.Millisecond, false)
-}
-
-func TestSDRUpgrade(t *testing.T) {
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- oldDelay := policy.GetPreCommitChallengeDelay()
- policy.SetPreCommitChallengeDelay(5)
- t.Cleanup(func() {
- policy.SetPreCommitChallengeDelay(oldDelay)
- })
-
- test.TestSDRUpgrade(t, builder.MockSbBuilder, 50*time.Millisecond)
-}
-
-func TestPledgeSectors(t *testing.T) {
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- t.Run("1", func(t *testing.T) {
- test.TestPledgeSector(t, builder.MockSbBuilder, 50*time.Millisecond, 1)
- })
-
- t.Run("100", func(t *testing.T) {
- test.TestPledgeSector(t, builder.MockSbBuilder, 50*time.Millisecond, 100)
- })
-
- t.Run("1000", func(t *testing.T) {
- if testing.Short() { // takes ~16s
- t.Skip("skipping test in short mode")
- }
-
- test.TestPledgeSector(t, builder.MockSbBuilder, 50*time.Millisecond, 1000)
- })
-}
-
-func TestPledgeBatching(t *testing.T) {
- t.Run("100", func(t *testing.T) {
- test.TestPledgeBatching(t, builder.MockSbBuilder, 50*time.Millisecond, 100)
- })
- t.Run("100-before-nv13", func(t *testing.T) {
- test.TestPledgeBeforeNv13(t, builder.MockSbBuilder, 50*time.Millisecond, 100)
- })
-}
-
-func TestTapeFix(t *testing.T) {
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestTapeFix(t, builder.MockSbBuilder, 2*time.Millisecond)
-}
-
-func TestWindowedPost(t *testing.T) {
- if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
- t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
- }
-
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("gen", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestWindowPost(t, builder.MockSbBuilder, 2*time.Millisecond, 10)
-}
-
-func TestTerminate(t *testing.T) {
- if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
- t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
- }
-
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestTerminate(t, builder.MockSbBuilder, 2*time.Millisecond)
-}
-
-func TestCCUpgrade(t *testing.T) {
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestCCUpgrade(t, builder.MockSbBuilder, 5*time.Millisecond)
-}
-
-func TestPaymentChannels(t *testing.T) {
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("pubsub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestPaymentChannels(t, builder.MockSbBuilder, 5*time.Millisecond)
-}
-
-func TestWindowPostDispute(t *testing.T) {
- if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
- t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
- }
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("gen", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestWindowPostDispute(t, builder.MockSbBuilder, 2*time.Millisecond)
-}
-
-func TestWindowPostDisputeFails(t *testing.T) {
- if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
- t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
- }
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("gen", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestWindowPostDisputeFails(t, builder.MockSbBuilder, 2*time.Millisecond)
-}
-
-func TestWindowPostBaseFeeNoBurn(t *testing.T) {
- if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
- t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
- }
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("gen", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestWindowPostBaseFeeNoBurn(t, builder.MockSbBuilder, 2*time.Millisecond)
-}
-
-func TestWindowPostBaseFeeBurn(t *testing.T) {
- if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
- t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
- }
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("gen", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "ERROR")
-
- test.TestWindowPostBaseFeeBurn(t, builder.MockSbBuilder, 2*time.Millisecond)
-}
-
-func TestDeadlineToggling(t *testing.T) {
- if os.Getenv("LOTUS_TEST_DEADLINE_TOGGLING") != "1" {
- t.Skip("this takes a few minutes, set LOTUS_TEST_DEADLINE_TOGGLING=1 to run")
- }
- logging.SetLogLevel("miner", "ERROR")
- logging.SetLogLevel("gen", "ERROR")
- logging.SetLogLevel("chainstore", "ERROR")
- logging.SetLogLevel("chain", "ERROR")
- logging.SetLogLevel("sub", "ERROR")
- logging.SetLogLevel("storageminer", "FATAL")
-
- test.TestDeadlineToggling(t, builder.MockSbBuilder, 2*time.Millisecond)
-}
diff --git a/node/rpc.go b/node/rpc.go
new file mode 100644
index 000000000..9b84792bb
--- /dev/null
+++ b/node/rpc.go
@@ -0,0 +1,193 @@
+package node
+
+import (
+ "context"
+ "encoding/json"
+ "net"
+ "net/http"
+ _ "net/http/pprof"
+ "runtime"
+ "strconv"
+
+ "github.com/gorilla/mux"
+ "github.com/ipfs/go-cid"
+ logging "github.com/ipfs/go-log/v2"
+ "github.com/multiformats/go-multiaddr"
+ manet "github.com/multiformats/go-multiaddr/net"
+ "go.opencensus.io/tag"
+ "golang.org/x/xerrors"
+
+ "github.com/filecoin-project/go-jsonrpc"
+ "github.com/filecoin-project/go-jsonrpc/auth"
+
+ "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
+ "github.com/filecoin-project/lotus/api/v1api"
+ "github.com/filecoin-project/lotus/metrics"
+ "github.com/filecoin-project/lotus/node/impl"
+)
+
+var rpclog = logging.Logger("rpc")
+
+// ServeRPC serves an HTTP handler over the supplied listen multiaddr.
+//
+// This function spawns a goroutine to run the server, and returns immediately.
+// It returns the stop function to be called to terminate the endpoint.
+//
+// The supplied ID is used in tracing, by inserting a tag in the context.
+func ServeRPC(h http.Handler, id string, addr multiaddr.Multiaddr) (StopFunc, error) {
+ // Start listening to the addr; if invalid or occupied, we will fail early.
+ lst, err := manet.Listen(addr)
+ if err != nil {
+ return nil, xerrors.Errorf("could not listen: %w", err)
+ }
+
+ // Instantiate the server and start listening.
+ srv := &http.Server{
+ Handler: h,
+ BaseContext: func(listener net.Listener) context.Context {
+ ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, id))
+ return ctx
+ },
+ }
+
+ go func() {
+ err = srv.Serve(manet.NetListener(lst))
+ if err != http.ErrServerClosed {
+ rpclog.Warnf("rpc server failed: %s", err)
+ }
+ }()
+
+ return srv.Shutdown, err
+}
+
+// FullNodeHandler returns a full node handler, to be mounted as-is on the server.
+func FullNodeHandler(a v1api.FullNode, permissioned bool, opts ...jsonrpc.ServerOption) (http.Handler, error) {
+ m := mux.NewRouter()
+
+ serveRpc := func(path string, hnd interface{}) {
+ rpcServer := jsonrpc.NewServer(opts...)
+ rpcServer.Register("Filecoin", hnd)
+
+ var handler http.Handler = rpcServer
+ if permissioned {
+ handler = &auth.Handler{Verify: a.AuthVerify, Next: rpcServer.ServeHTTP}
+ }
+
+ m.Handle(path, handler)
+ }
+
+ fnapi := metrics.MetricedFullAPI(a)
+ if permissioned {
+ fnapi = api.PermissionedFullAPI(fnapi)
+ }
+
+ serveRpc("/rpc/v1", fnapi)
+ serveRpc("/rpc/v0", &v0api.WrapperV1Full{FullNode: fnapi})
+
+ // Import handler
+ handleImportFunc := handleImport(a.(*impl.FullNodeAPI))
+ if permissioned {
+ importAH := &auth.Handler{
+ Verify: a.AuthVerify,
+ Next: handleImportFunc,
+ }
+ m.Handle("/rest/v0/import", importAH)
+ } else {
+ m.HandleFunc("/rest/v0/import", handleImportFunc)
+ }
+
+ // debugging
+ m.Handle("/debug/metrics", metrics.Exporter())
+ m.Handle("/debug/pprof-set/block", handleFractionOpt("BlockProfileRate", runtime.SetBlockProfileRate))
+ m.Handle("/debug/pprof-set/mutex", handleFractionOpt("MutexProfileFraction", func(x int) {
+ runtime.SetMutexProfileFraction(x)
+ }))
+ m.PathPrefix("/").Handler(http.DefaultServeMux) // pprof
+
+ return m, nil
+}
+
+// MinerHandler returns a miner handler, to be mounted as-is on the server.
+func MinerHandler(a api.StorageMiner, permissioned bool) (http.Handler, error) {
+ m := mux.NewRouter()
+
+ mapi := metrics.MetricedStorMinerAPI(a)
+ if permissioned {
+ mapi = api.PermissionedStorMinerAPI(mapi)
+ }
+
+ rpcServer := jsonrpc.NewServer()
+ rpcServer.Register("Filecoin", mapi)
+
+ m.Handle("/rpc/v0", rpcServer)
+ m.PathPrefix("/remote").HandlerFunc(a.(*impl.StorageMinerAPI).ServeRemote)
+
+ // debugging
+ m.Handle("/debug/metrics", metrics.Exporter())
+ m.PathPrefix("/").Handler(http.DefaultServeMux) // pprof
+
+ if !permissioned {
+ return rpcServer, nil
+ }
+
+ ah := &auth.Handler{
+ Verify: a.AuthVerify,
+ Next: m.ServeHTTP,
+ }
+ return ah, nil
+}
+
+func handleImport(a *impl.FullNodeAPI) func(w http.ResponseWriter, r *http.Request) {
+ return func(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "PUT" {
+ w.WriteHeader(404)
+ return
+ }
+ if !auth.HasPerm(r.Context(), nil, api.PermWrite) {
+ w.WriteHeader(401)
+ _ = json.NewEncoder(w).Encode(struct{ Error string }{"unauthorized: missing write permission"})
+ return
+ }
+
+ c, err := a.ClientImportLocal(r.Context(), r.Body)
+ if err != nil {
+ w.WriteHeader(500)
+ _ = json.NewEncoder(w).Encode(struct{ Error string }{err.Error()})
+ return
+ }
+ w.WriteHeader(200)
+ err = json.NewEncoder(w).Encode(struct{ Cid cid.Cid }{c})
+ if err != nil {
+ rpclog.Errorf("/rest/v0/import: Writing response failed: %+v", err)
+ return
+ }
+ }
+}
+
+func handleFractionOpt(name string, setter func(int)) http.HandlerFunc {
+ return func(rw http.ResponseWriter, r *http.Request) {
+ if r.Method != http.MethodPost {
+ http.Error(rw, "only POST allowed", http.StatusMethodNotAllowed)
+ return
+ }
+ if err := r.ParseForm(); err != nil {
+ http.Error(rw, err.Error(), http.StatusBadRequest)
+ return
+ }
+
+ asfr := r.Form.Get("x")
+ if len(asfr) == 0 {
+ http.Error(rw, "parameter 'x' must be set", http.StatusBadRequest)
+ return
+ }
+
+ fr, err := strconv.Atoi(asfr)
+ if err != nil {
+ http.Error(rw, err.Error(), http.StatusBadRequest)
+ return
+ }
+ rpclog.Infof("setting %s to %d", name, fr)
+ setter(fr)
+ }
+}
diff --git a/node/shutdown.go b/node/shutdown.go
new file mode 100644
index 000000000..e630031da
--- /dev/null
+++ b/node/shutdown.go
@@ -0,0 +1,56 @@
+package node
+
+import (
+ "context"
+ "os"
+ "os/signal"
+ "syscall"
+)
+
+type ShutdownHandler struct {
+ Component string
+ StopFunc StopFunc
+}
+
+// MonitorShutdown manages shutdown requests, by watching signals and invoking
+// the supplied handlers in order.
+//
+// It watches SIGTERM and SIGINT OS signals, as well as the trigger channel.
+// When any of them fire, it calls the supplied handlers in order. If any of
+// them errors, it merely logs the error.
+//
+// Once the shutdown has completed, it closes the returned channel. The caller
+// can watch this channel
+func MonitorShutdown(triggerCh <-chan struct{}, handlers ...ShutdownHandler) <-chan struct{} {
+ sigCh := make(chan os.Signal, 2)
+ out := make(chan struct{})
+
+ go func() {
+ select {
+ case sig := <-sigCh:
+ log.Warnw("received shutdown", "signal", sig)
+ case <-triggerCh:
+ log.Warn("received shutdown")
+ }
+
+ log.Warn("Shutting down...")
+
+ // Call all the handlers, logging on failure and success.
+ for _, h := range handlers {
+ if err := h.StopFunc(context.TODO()); err != nil {
+ log.Errorf("shutting down %s failed: %s", h.Component, err)
+ continue
+ }
+ log.Infof("%s shut down successfully ", h.Component)
+ }
+
+ log.Warn("Graceful shutdown successful")
+
+ // Sync all loggers.
+ _ = log.Sync() //nolint:errcheck
+ close(out)
+ }()
+
+ signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGINT)
+ return out
+}
diff --git a/node/shutdown_test.go b/node/shutdown_test.go
new file mode 100644
index 000000000..15e2af93e
--- /dev/null
+++ b/node/shutdown_test.go
@@ -0,0 +1,36 @@
+package node
+
+import (
+ "context"
+ "sync"
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/require"
+)
+
+func TestMonitorShutdown(t *testing.T) {
+ signalCh := make(chan struct{})
+
+ // Three shutdown handlers.
+ var wg sync.WaitGroup
+ wg.Add(3)
+ h := ShutdownHandler{
+ Component: "handler",
+ StopFunc: func(_ context.Context) error {
+ wg.Done()
+ return nil
+ },
+ }
+
+ finishCh := MonitorShutdown(signalCh, h, h, h)
+
+ // Nothing here after 10ms.
+ time.Sleep(10 * time.Millisecond)
+ require.Len(t, finishCh, 0)
+
+ // Now trigger the shutdown.
+ close(signalCh)
+ wg.Wait()
+ <-finishCh
+}
diff --git a/paychmgr/manager.go b/paychmgr/manager.go
index e9700bc9d..6f6efa7ea 100644
--- a/paychmgr/manager.go
+++ b/paychmgr/manager.go
@@ -11,6 +11,7 @@ import (
xerrors "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/crypto"
"github.com/filecoin-project/go-state-types/network"
@@ -34,7 +35,7 @@ type stateManagerAPI interface {
// paychAPI defines the API methods needed by the payment channel manager
type PaychAPI interface {
StateAccountKey(context.Context, address.Address, types.TipSetKey) (address.Address, error)
- StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error)
+ StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
MpoolPushMessage(ctx context.Context, msg *types.Message, maxFee *api.MessageSendSpec) (*types.SignedMessage, error)
WalletHas(ctx context.Context, addr address.Address) (bool, error)
WalletSign(ctx context.Context, k address.Address, msg []byte) (*crypto.Signature, error)
diff --git a/paychmgr/mock_test.go b/paychmgr/mock_test.go
index 3393a3072..2c891803b 100644
--- a/paychmgr/mock_test.go
+++ b/paychmgr/mock_test.go
@@ -8,6 +8,7 @@ import (
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
+ "github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/network"
@@ -132,7 +133,7 @@ func newMockPaychAPI() *mockPaychAPI {
}
}
-func (pchapi *mockPaychAPI) StateWaitMsg(ctx context.Context, mcid cid.Cid, confidence uint64) (*api.MsgLookup, error) {
+func (pchapi *mockPaychAPI) StateWaitMsg(ctx context.Context, mcid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) {
pchapi.lk.Lock()
response := make(chan types.MessageReceipt)
diff --git a/paychmgr/settler/settler.go b/paychmgr/settler/settler.go
index 3abd136fc..ce31ab223 100644
--- a/paychmgr/settler/settler.go
+++ b/paychmgr/settler/settler.go
@@ -41,7 +41,7 @@ type settlerAPI interface {
PaychVoucherCheckSpendable(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (bool, error)
PaychVoucherList(context.Context, address.Address) ([]*paych.SignedVoucher, error)
PaychVoucherSubmit(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (cid.Cid, error)
- StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*api.MsgLookup, error)
+ StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
}
type paymentChannelSettler struct {
@@ -51,12 +51,12 @@ type paymentChannelSettler struct {
// SettlePaymentChannels checks the chain for events related to payment channels settling and
// submits any vouchers for inbound channels tracked for this node
-func SettlePaymentChannels(mctx helpers.MetricsCtx, lc fx.Lifecycle, api API) error {
+func SettlePaymentChannels(mctx helpers.MetricsCtx, lc fx.Lifecycle, papi API) error {
ctx := helpers.LifecycleCtx(mctx, lc)
lc.Append(fx.Hook{
OnStart: func(context.Context) error {
- pcs := newPaymentChannelSettler(ctx, &api)
- ev := events.NewEvents(ctx, &api)
+ pcs := newPaymentChannelSettler(ctx, &papi)
+ ev := events.NewEvents(ctx, papi)
return ev.Called(pcs.check, pcs.messageHandler, pcs.revertHandler, int(build.MessageConfidence+1), events.NoTimeout, pcs.matcher)
},
})
@@ -93,9 +93,10 @@ func (pcs *paymentChannelSettler) messageHandler(msg *types.Message, rec *types.
}
go func(voucher *paych.SignedVoucher, submitMessageCID cid.Cid) {
defer wg.Done()
- msgLookup, err := pcs.api.StateWaitMsg(pcs.ctx, submitMessageCID, build.MessageConfidence)
+ msgLookup, err := pcs.api.StateWaitMsg(pcs.ctx, submitMessageCID, build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
log.Errorf("submitting voucher: %s", err.Error())
+ return
}
if msgLookup.Receipt.ExitCode != 0 {
log.Errorf("failed submitting voucher: %+v", voucher)
diff --git a/paychmgr/simple.go b/paychmgr/simple.go
index 939a5a5be..f93c6d5bd 100644
--- a/paychmgr/simple.go
+++ b/paychmgr/simple.go
@@ -413,7 +413,7 @@ func (ca *channelAccessor) waitForPaychCreateMsg(channelID string, mcid cid.Cid)
}
func (ca *channelAccessor) waitPaychCreateMsg(channelID string, mcid cid.Cid) error {
- mwait, err := ca.api.StateWaitMsg(ca.chctx, mcid, build.MessageConfidence)
+ mwait, err := ca.api.StateWaitMsg(ca.chctx, mcid, build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
log.Errorf("wait msg: %v", err)
return err
@@ -499,7 +499,7 @@ func (ca *channelAccessor) waitForAddFundsMsg(channelID string, mcid cid.Cid) {
}
func (ca *channelAccessor) waitAddFundsMsg(channelID string, mcid cid.Cid) error {
- mwait, err := ca.api.StateWaitMsg(ca.chctx, mcid, build.MessageConfidence)
+ mwait, err := ca.api.StateWaitMsg(ca.chctx, mcid, build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
log.Error(err)
return err
diff --git a/scripts/bash-completion/lotus b/scripts/bash-completion/lotus
index 20c312b6c..b572ab320 100644
--- a/scripts/bash-completion/lotus
+++ b/scripts/bash-completion/lotus
@@ -1,10 +1,18 @@
#!/usr/bin/env bash
+
_cli_bash_autocomplete() {
- local cur opts base;
- COMPREPLY=();
- cur="${COMP_WORDS[COMP_CWORD]}";
- opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-completion );
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
- return 0;
-};
-complete -F _cli_bash_autocomplete lotus
\ No newline at end of file
+ if [[ "${COMP_WORDS[0]}" != "source" ]]; then
+ local cur opts base
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ if [[ "$cur" == "-"* ]]; then
+ opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} ${cur} --generate-bash-completion )
+ else
+ opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion )
+ fi
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ fi
+}
+
+complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete lotus lotus-miner lotus-worker
diff --git a/scripts/bash-completion/lotus-miner b/scripts/bash-completion/lotus-miner
deleted file mode 100644
index df5cc01cc..000000000
--- a/scripts/bash-completion/lotus-miner
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-_cli_bash_autocomplete() {
- local cur opts base;
- COMPREPLY=();
- cur="${COMP_WORDS[COMP_CWORD]}";
- opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-completion );
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
- return 0;
-};
-complete -F _cli_bash_autocomplete lotus-miner
\ No newline at end of file
diff --git a/scripts/build-bundle.sh b/scripts/build-bundle.sh
index 7d37edff8..fe1c88611 100755
--- a/scripts/build-bundle.sh
+++ b/scripts/build-bundle.sh
@@ -49,4 +49,7 @@ do
ipfs add -q "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz" > "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz.cid"
done
+cp "../appimage/Lotus-${CIRCLE_TAG}-x86_64.AppImage" .
+sha512sum "Lotus-${CIRCLE_TAG}-x86_64.AppImage" > "Lotus-${CIRCLE_TAG}-x86_64.AppImage.sha512"
+ipfs add -q "Lotus-${CIRCLE_TAG}-x86_64.AppImage" > "Lotus-${CIRCLE_TAG}-x86_64.AppImage.cid"
popd
diff --git a/scripts/generate-lotus-cli.py b/scripts/generate-lotus-cli.py
new file mode 100644
index 000000000..8018962e9
--- /dev/null
+++ b/scripts/generate-lotus-cli.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+# Generate lotus command lines documents as text and markdown in folder "lotus/documentation/en".
+# Python 2.7
+
+import os
+
+
+def generate_lotus_cli(prog):
+ output_folder = 'documentation/en'
+ md_file = open('%s/cli-%s.md' % (output_folder, prog), 'w') # set the name of md output
+
+ def get_cmd_recursively(cur_cmd):
+ depth = cur_cmd.count(' ')
+ md_file.writelines(('\n' * min(depth, 1)) + ('#' * depth) + '# ' + cur_cmd[2:] + '\n')
+
+ cmd_flag = False
+
+ print('> ' + cur_cmd)
+ cmd_help_output = os.popen(cur_cmd + ' -h')
+ cmd_help_output_lines = cmd_help_output.readlines()
+
+ md_file.writelines('```\n')
+ md_file.writelines(cmd_help_output_lines)
+ md_file.writelines('```\n')
+
+ for line in cmd_help_output_lines:
+ try:
+ line = line.strip()
+ if line == 'COMMANDS:':
+ cmd_flag = True
+ if cmd_flag is True and line == '':
+ cmd_flag = False
+ if cmd_flag is True and line[-1] != ':' and 'help, h' not in line:
+ gap_pos = 0
+ sub_cmd = line
+ if ' ' in line:
+ gap_pos = sub_cmd.index(' ')
+ if gap_pos:
+ sub_cmd = cur_cmd + ' ' + sub_cmd[:gap_pos]
+ get_cmd_recursively(sub_cmd)
+ except Exception as e:
+ print('Fail to deal with "%s" with error:\n%s' % (line, e))
+
+ get_cmd_recursively('./' + prog)
+ md_file.close()
+
+
+if __name__ == "__main__":
+ os.putenv("LOTUS_VERSION_IGNORE_COMMIT", "1")
+ generate_lotus_cli('lotus')
+ generate_lotus_cli('lotus-miner')
+ generate_lotus_cli('lotus-worker')
diff --git a/scripts/make-completions.sh b/scripts/make-completions.sh
deleted file mode 100755
index 1bfd59bf3..000000000
--- a/scripts/make-completions.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-# scripts/make-completions.sh [progname]
-
-echo '#!/usr/bin/env bash' > "scripts/bash-completion/$1"
-echo '#!/usr/bin/env zsh' > "scripts/zsh-completion/$1"
-
-$1 --init-completion=bash >> "scripts/bash-completion/$1"
-$1 --init-completion=zsh >> "scripts/zsh-completion/$1"
diff --git a/scripts/mkreleaselog b/scripts/mkreleaselog
new file mode 100755
index 000000000..ffc3d935e
--- /dev/null
+++ b/scripts/mkreleaselog
@@ -0,0 +1,248 @@
+#!/bin/zsh
+set -x
+set -euo pipefail
+export GO111MODULE=on
+export GOPATH="$(go env GOPATH)"
+
+alias jq="jq --unbuffered"
+
+AUTHORS=(
+ # orgs
+ ipfs
+ ipld
+ libp2p
+ multiformats
+ filecoin-project
+ ipfs-shipyard
+
+ # Authors of personal repos used by go-ipfs that should be mentioned in the
+ # release notes.
+ whyrusleeping
+ Kubuxu
+ jbenet
+ Stebalien
+ marten-seemann
+ hsanjuan
+ lucas-clemente
+ warpfork
+)
+
+[[ -n "${REPO_FILTER+x}" ]] || REPO_FILTER="github.com/(${$(printf "|%s" "${AUTHORS[@]}"):1})"
+
+[[ -n "${IGNORED_FILES+x}" ]] || IGNORED_FILES='^\(\.gx\|package\.json\|\.travis\.yml\|go.mod\|go\.sum|\.github|\.circleci\)$'
+
+NL=$'\n'
+
+ROOT_DIR="$(git rev-parse --show-toplevel)"
+
+msg() {
+ echo "$*" >&2
+}
+
+statlog() {
+ local module="$1"
+ local rpath="$GOPATH/src/$(strip_version "$module")"
+ local start="${2:-}"
+ local end="${3:-HEAD}"
+ local mailmap_file="$rpath/.mailmap"
+ if ! [[ -e "$mailmap_file" ]]; then
+ mailmap_file="$ROOT_DIR/.mailmap"
+ fi
+
+ git -C "$rpath" -c mailmap.file="$mailmap_file" log --use-mailmap --shortstat --no-merges --pretty="tformat:%H%n%aN%n%aE" "$start..$end" | while
+ read hash
+ read name
+ read email
+ read _ # empty line
+ read changes
+ do
+ changed=0
+ insertions=0
+ deletions=0
+ while read count event; do
+ if [[ "$event" =~ ^file ]]; then
+ changed=$count
+ elif [[ "$event" =~ ^insertion ]]; then
+ insertions=$count
+ elif [[ "$event" =~ ^deletion ]]; then
+ deletions=$count
+ else
+ echo "unknown event $event" >&2
+ exit 1
+ fi
+ done<<<"${changes//,/$NL}"
+
+ jq -n \
+ --arg "hash" "$hash" \
+ --arg "name" "$name" \
+ --arg "email" "$email" \
+ --argjson "changed" "$changed" \
+ --argjson "insertions" "$insertions" \
+ --argjson "deletions" "$deletions" \
+ '{Commit: $hash, Author: $name, Email: $email, Files: $changed, Insertions: $insertions, Deletions: $deletions}'
+ done
+}
+
+# Returns a stream of deps changed between $1 and $2.
+dep_changes() {
+ {
+ <"$1"
+ <"$2"
+ } | jq -s 'JOIN(INDEX(.[0][]; .Path); .[1][]; .Path; {Path: .[0].Path, Old: (.[1] | del(.Path)), New: (.[0] | del(.Path))}) | select(.New.Version != .Old.Version)'
+}
+
+# resolve_commits resolves a git ref for each version.
+resolve_commits() {
+ jq '. + {Ref: (.Version|capture("^((?.*)\\+incompatible|v.*-(0\\.)?[0-9]{14}-(?[a-f0-9]{12})|(?v.*))$") | .ref1 // .ref2 // .ref3)}'
+}
+
+pr_link() {
+ local repo="$1"
+ local prnum="$2"
+ local ghname="${repo##github.com/}"
+ printf -- "[%s#%s](https://%s/pull/%s)" "$ghname" "$prnum" "$repo" "$prnum"
+}
+
+# Generate a release log for a range of commits in a single repo.
+release_log() {
+ setopt local_options BASH_REMATCH
+
+ local module="$1"
+ local start="$2"
+ local end="${3:-HEAD}"
+ local repo="$(strip_version "$1")"
+ local dir="$GOPATH/src/$repo"
+
+ local commit pr
+ git -C "$dir" log \
+ --format='tformat:%H %s' \
+ --first-parent \
+ "$start..$end" |
+ while read commit subject; do
+ # Skip gx-only PRs.
+ git -C "$dir" diff-tree --no-commit-id --name-only "$commit^" "$commit" |
+ grep -v "${IGNORED_FILES}" >/dev/null || continue
+
+ if [[ "$subject" =~ '^Merge pull request #([0-9]+) from' ]]; then
+ local prnum="${BASH_REMATCH[2]}"
+ local desc="$(git -C "$dir" show --summary --format='tformat:%b' "$commit" | head -1)"
+ printf -- "- %s (%s)\n" "$desc" "$(pr_link "$repo" "$prnum")"
+ elif [[ "$subject" =~ '\(#([0-9]+)\)$' ]]; then
+ local prnum="${BASH_REMATCH[2]}"
+ printf -- "- %s (%s)\n" "$subject" "$(pr_link "$repo" "$prnum")"
+ else
+ printf -- "- %s\n" "$subject"
+ fi
+ done
+}
+
+indent() {
+ sed -e 's/^/ /'
+}
+
+mod_deps() {
+ go list -mod=mod -json -m all | jq 'select(.Version != null)'
+}
+
+ensure() {
+ local repo="$(strip_version "$1")"
+ local commit="$2"
+ local rpath="$GOPATH/src/$repo"
+ if [[ ! -d "$rpath" ]]; then
+ msg "Cloning $repo..."
+ git clone "http://$repo" "$rpath" >&2
+ fi
+
+ if ! git -C "$rpath" rev-parse --verify "$commit" >/dev/null; then
+ msg "Fetching $repo..."
+ git -C "$rpath" fetch --all >&2
+ fi
+
+ git -C "$rpath" rev-parse --verify "$commit" >/dev/null || return 1
+}
+
+statsummary() {
+ jq -s 'group_by(.Author)[] | {Author: .[0].Author, Commits: (. | length), Insertions: (map(.Insertions) | add), Deletions: (map(.Deletions) | add), Files: (map(.Files) | add)}' |
+ jq '. + {Lines: (.Deletions + .Insertions)}'
+}
+
+strip_version() {
+ local repo="$1"
+ if [[ "$repo" =~ '.*/v[0-9]+$' ]]; then
+ repo="$(dirname "$repo")"
+ fi
+ echo "$repo"
+}
+
+recursive_release_log() {
+ local start="${1:-$(git tag -l | sort -V | grep -v -- '-rc' | grep 'v'| tail -n1)}"
+ local end="${2:-$(git rev-parse HEAD)}"
+ local repo_root="$(git rev-parse --show-toplevel)"
+ local module="$(go list -m)"
+ local dir="$(go list -m -f '{{.Dir}}')"
+
+ if [[ "${GOPATH}/${module}" -ef "${dir}" ]]; then
+ echo "This script requires the target module and all dependencies to live in a GOPATH."
+ return 1
+ fi
+
+ (
+ local result=0
+ local workspace="$(mktemp -d)"
+ trap "$(printf 'rm -rf "%q"' "$workspace")" INT TERM EXIT
+ cd "$workspace"
+
+ mkdir extern
+ ln -s "$repo_root"/extern/filecoin-ffi extern/filecoin-ffi
+ ln -s "$repo_root"/extern/test-vectors extern/test-vectors
+
+ echo "Computing old deps..." >&2
+ git -C "$repo_root" show "$start:go.mod" >go.mod
+ mod_deps | resolve_commits | jq -s > old_deps.json
+
+ echo "Computing new deps..." >&2
+ git -C "$repo_root" show "$end:go.mod" >go.mod
+ mod_deps | resolve_commits | jq -s > new_deps.json
+
+ rm -f go.mod go.sum
+
+ printf -- "Generating Changelog for %s %s..%s\n" "$module" "$start" "$end" >&2
+
+ printf -- "- %s:\n" "$module"
+ release_log "$module" "$start" "$end" | indent
+
+
+ statlog "$module" "$start" "$end" > statlog.json
+
+ dep_changes old_deps.json new_deps.json |
+ jq --arg filter "$REPO_FILTER" 'select(.Path | match($filter))' |
+ # Compute changelogs
+ jq -r '"\(.Path) \(.New.Version) \(.New.Ref) \(.Old.Version) \(.Old.Ref // "")"' |
+ while read module new new_ref old old_ref; do
+ if ! ensure "$module" "$new_ref"; then
+ result=1
+ local changelog="failed to fetch repo"
+ else
+ statlog "$module" "$old_ref" "$new_ref" >> statlog.json
+ local changelog="$(release_log "$module" "$old_ref" "$new_ref")"
+ fi
+ if [[ -n "$changelog" ]]; then
+ printf -- "- %s (%s -> %s):\n" "$module" "$old" "$new"
+ echo "$changelog" | indent
+ fi
+ done
+
+ echo
+ echo "Contributors"
+ echo
+
+ echo "| Contributor | Commits | Lines Âą | Files Changed |"
+ echo "|-------------|---------|---------|---------------|"
+ statsummary
\ No newline at end of file
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
new file mode 100644
index 000000000..472621c2a
--- /dev/null
+++ b/snap/snapcraft.yaml
@@ -0,0 +1,76 @@
+name: lotus-filecoin
+base: core20
+version: latest
+summary: filecoin daemon/client
+icon: snap/local/icon.svg
+description: |
+ Filecoin is a peer-to-peer network that stores files on the internet
+ with built-in economic incentives to ensure files are stored reliably over time
+
+ For documentation and additional information, please see the following resources
+
+ https://filecoin.io
+
+ https://fil.org
+
+ https://docs.filecoin.io
+
+ https://github.com/filecoin-project/lotus
+
+grade: devel
+confinement: strict
+
+parts:
+ lotus:
+ plugin: make
+ source: ./
+ build-snaps:
+ - go
+ - rustup
+ build-packages:
+ - git
+ - jq
+ - libhwloc-dev
+ - ocl-icd-opencl-dev
+ - pkg-config
+ stage-packages:
+ - libhwloc15
+ - ocl-icd-libopencl1
+ override-build: |
+ LDFLAGS="" make lotus lotus-miner lotus-worker
+ cp lotus lotus-miner lotus-worker $SNAPCRAFT_PART_INSTALL
+
+apps:
+ lotus:
+ command: lotus
+ plugs:
+ - network
+ - network-bind
+ - home
+ environment:
+ FIL_PROOFS_PARAMETER_CACHE: $SNAP_USER_COMMON/filecoin-proof-parameters
+ LOTUS_PATH: $SNAP_USER_COMMON/lotus
+ LOTUS_MINER_PATH: $SNAP_USER_COMMON/lotus-miner
+ LOTUS_WORKER_PATH: $SNAP_USER_COMMON/lotus-worker
+ lotus-miner:
+ command: lotus-miner
+ plugs:
+ - network
+ - network-bind
+ - opengl
+ environment:
+ FIL_PROOFS_PARAMETER_CACHE: $SNAP_USER_COMMON/filecoin-proof-parameters
+ LOTUS_PATH: $SNAP_USER_COMMON/lotus
+ LOTUS_MINER_PATH: $SNAP_USER_COMMON/lotus-miner
+ LOTUS_WORKER_PATH: $SNAP_USER_COMMON/lotus-worker
+ lotus-worker:
+ command: lotus-worker
+ plugs:
+ - network
+ - network-bind
+ - opengl
+ environment:
+ FIL_PROOFS_PARAMETER_CACHE: $SNAP_USER_COMMON/filecoin-proof-parameters
+ LOTUS_PATH: $SNAP_USER_COMMON/lotus
+ LOTUS_MINER_PATH: $SNAP_USER_COMMON/lotus-miner
+ LOTUS_WORKER_PATH: $SNAP_USER_COMMON/lotus-worker
diff --git a/storage/adapter_storage_miner.go b/storage/adapter_storage_miner.go
index a37361769..895e7846d 100644
--- a/storage/adapter_storage_miner.go
+++ b/storage/adapter_storage_miner.go
@@ -32,10 +32,10 @@ import (
var _ sealing.SealingAPI = new(SealingAPIAdapter)
type SealingAPIAdapter struct {
- delegate storageMinerApi
+ delegate fullNodeFilteredAPI
}
-func NewSealingAPIAdapter(api storageMinerApi) SealingAPIAdapter {
+func NewSealingAPIAdapter(api fullNodeFilteredAPI) SealingAPIAdapter {
return SealingAPIAdapter{delegate: api}
}
@@ -104,7 +104,7 @@ func (s SealingAPIAdapter) StateMinerSectorAllocated(ctx context.Context, maddr
}
func (s SealingAPIAdapter) StateWaitMsg(ctx context.Context, mcid cid.Cid) (sealing.MsgLookup, error) {
- wmsg, err := s.delegate.StateWaitMsg(ctx, mcid, build.MessageConfidence)
+ wmsg, err := s.delegate.StateWaitMsg(ctx, mcid, build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
return sealing.MsgLookup{}, err
}
@@ -121,7 +121,7 @@ func (s SealingAPIAdapter) StateWaitMsg(ctx context.Context, mcid cid.Cid) (seal
}
func (s SealingAPIAdapter) StateSearchMsg(ctx context.Context, c cid.Cid) (*sealing.MsgLookup, error) {
- wmsg, err := s.delegate.StateSearchMsg(ctx, c)
+ wmsg, err := s.delegate.StateSearchMsg(ctx, types.EmptyTSK, c, api.LookbackNoLimit, true)
if err != nil {
return nil, err
}
diff --git a/storage/miner.go b/storage/miner.go
index 6fa9c5922..b4c590ae3 100644
--- a/storage/miner.go
+++ b/storage/miner.go
@@ -5,10 +5,6 @@ import (
"errors"
"time"
- "github.com/filecoin-project/go-state-types/network"
-
- "github.com/filecoin-project/go-state-types/dline"
-
"github.com/filecoin-project/go-bitfield"
"github.com/ipfs/go-cid"
@@ -20,11 +16,16 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/crypto"
- sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage"
- "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
+ "github.com/filecoin-project/go-state-types/dline"
+ "github.com/filecoin-project/go-state-types/network"
+
"github.com/filecoin-project/specs-storage/storage"
+ sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage"
+ "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
+
"github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
@@ -40,8 +41,16 @@ import (
var log = logging.Logger("storageminer")
+// Miner is the central miner entrypoint object inside Lotus. It is
+// instantiated in the node builder, along with the WindowPoStScheduler.
+//
+// This object is the owner of the sealing pipeline. Most of the actual logic
+// lives in the storage-sealing module (sealing.Sealing), and the Miner object
+// exposes it to the rest of the system by proxying calls.
+//
+// Miner#Run starts the sealing FSM.
type Miner struct {
- api storageMinerApi
+ api fullNodeFilteredAPI
feeCfg config.MinerFeeConfig
h host.Host
sealer sectorstorage.SectorManager
@@ -70,7 +79,9 @@ type SealingStateEvt struct {
Error string
}
-type storageMinerApi interface {
+// fullNodeFilteredAPI is the subset of the full node API the Miner needs from
+// a Lotus full node.
+type fullNodeFilteredAPI interface {
// Call a read only method on actors (no interaction with the chain required)
StateCall(context.Context, *types.Message, types.TipSetKey) (*api.InvocResult, error)
StateMinerSectors(context.Context, address.Address, *bitfield.BitField, types.TipSetKey) ([]*miner.SectorOnChainInfo, error)
@@ -84,10 +95,9 @@ type storageMinerApi interface {
StateMinerPreCommitDepositForPower(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error)
StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error)
StateMinerSectorAllocated(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error)
- StateSearchMsg(context.Context, cid.Cid) (*api.MsgLookup, error)
- StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*api.MsgLookup, error) // TODO: removeme eventually
+ StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
+ StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
- StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)
StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error)
StateMinerFaults(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error)
StateMinerRecoveries(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error)
@@ -117,7 +127,19 @@ type storageMinerApi interface {
WalletHas(context.Context, address.Address) (bool, error)
}
-func NewMiner(api storageMinerApi, maddr address.Address, h host.Host, ds datastore.Batching, sealer sectorstorage.SectorManager, sc sealing.SectorIDCounter, verif ffiwrapper.Verifier, prover ffiwrapper.Prover, gsd dtypes.GetSealingConfigFunc, feeCfg config.MinerFeeConfig, journal journal.Journal, as *AddressSelector) (*Miner, error) {
+// NewMiner creates a new Miner object.
+func NewMiner(api fullNodeFilteredAPI,
+ maddr address.Address,
+ h host.Host,
+ ds datastore.Batching,
+ sealer sectorstorage.SectorManager,
+ sc sealing.SectorIDCounter,
+ verif ffiwrapper.Verifier,
+ prover ffiwrapper.Prover,
+ gsd dtypes.GetSealingConfigFunc,
+ feeCfg config.MinerFeeConfig,
+ journal journal.Journal,
+ as *AddressSelector) (*Miner, error) {
m := &Miner{
api: api,
feeCfg: feeCfg,
@@ -138,6 +160,7 @@ func NewMiner(api storageMinerApi, maddr address.Address, h host.Host, ds datast
return m, nil
}
+// Run starts the sealing FSM in the background, running preliminary checks first.
func (m *Miner) Run(ctx context.Context) error {
if err := m.runPreflightChecks(ctx); err != nil {
return xerrors.Errorf("miner preflight checks failed: %w", err)
@@ -148,17 +171,37 @@ func (m *Miner) Run(ctx context.Context) error {
return xerrors.Errorf("getting miner info: %w", err)
}
- evts := events.NewEvents(ctx, m.api)
- adaptedAPI := NewSealingAPIAdapter(m.api)
- // TODO: Maybe we update this policy after actor upgrades?
- pcp := sealing.NewBasicPreCommitPolicy(adaptedAPI, policy.GetMaxSectorExpirationExtension()-(md.WPoStProvingPeriod*2), md.PeriodStart%md.WPoStProvingPeriod)
+ var (
+ // consumer of chain head changes.
+ evts = events.NewEvents(ctx, m.api)
+ evtsAdapter = NewEventsAdapter(evts)
- as := func(ctx context.Context, mi miner.MinerInfo, use api.AddrUse, goodFunds, minFunds abi.TokenAmount) (address.Address, abi.TokenAmount, error) {
- return m.addrSel.AddressFor(ctx, m.api, mi, use, goodFunds, minFunds)
- }
+ // Create a shim to glue the API required by the sealing component
+ // with the API that Lotus is capable of providing.
+ // The shim translates between "tipset tokens" and tipset keys, and
+ // provides extra methods.
+ adaptedAPI = NewSealingAPIAdapter(m.api)
- m.sealing = sealing.New(adaptedAPI, m.feeCfg, NewEventsAdapter(evts), m.maddr, m.ds, m.sealer, m.sc, m.verif, m.prover, &pcp, sealing.GetSealingConfigFunc(m.getSealConfig), m.handleSealingNotifications, as)
+ // Instantiate a precommit policy.
+ defaultDuration = policy.GetMaxSectorExpirationExtension() - (md.WPoStProvingPeriod * 2)
+ provingBoundary = md.PeriodStart % md.WPoStProvingPeriod
+ // TODO: Maybe we update this policy after actor upgrades?
+ pcp = sealing.NewBasicPreCommitPolicy(adaptedAPI, defaultDuration, provingBoundary)
+
+ // address selector.
+ as = func(ctx context.Context, mi miner.MinerInfo, use api.AddrUse, goodFunds, minFunds abi.TokenAmount) (address.Address, abi.TokenAmount, error) {
+ return m.addrSel.AddressFor(ctx, m.api, mi, use, goodFunds, minFunds)
+ }
+
+ // sealing configuration.
+ cfg = sealing.GetSealingConfigFunc(m.getSealConfig)
+ )
+
+ // Instantiate the sealing FSM.
+ m.sealing = sealing.New(adaptedAPI, m.feeCfg, evtsAdapter, m.maddr, m.ds, m.sealer, m.sc, m.verif, m.prover, &pcp, cfg, m.handleSealingNotifications, as)
+
+ // Run the sealing FSM.
go m.sealing.Run(ctx) //nolint:errcheck // logged intside the function
return nil
@@ -180,6 +223,7 @@ func (m *Miner) Stop(ctx context.Context) error {
return m.sealing.Stop(ctx)
}
+// runPreflightChecks verifies that preconditions to run the miner are satisfied.
func (m *Miner) runPreflightChecks(ctx context.Context) error {
mi, err := m.api.StateMinerInfo(ctx, m.maddr, types.EmptyTSK)
if err != nil {
@@ -211,7 +255,7 @@ type StorageWpp struct {
winnRpt abi.RegisteredPoStProof
}
-func NewWinningPoStProver(api api.FullNode, prover storage.Prover, verifier ffiwrapper.Verifier, miner dtypes.MinerID) (*StorageWpp, error) {
+func NewWinningPoStProver(api v1api.FullNode, prover storage.Prover, verifier ffiwrapper.Verifier, miner dtypes.MinerID) (*StorageWpp, error) {
ma, err := address.NewIDAddress(uint64(miner))
if err != nil {
return nil, err
diff --git a/storage/sealing.go b/storage/miner_sealing.go
similarity index 100%
rename from storage/sealing.go
rename to storage/miner_sealing.go
diff --git a/storage/wdpost_changehandler.go b/storage/wdpost_changehandler.go
index 188d7e93a..7b80f2744 100644
--- a/storage/wdpost_changehandler.go
+++ b/storage/wdpost_changehandler.go
@@ -21,22 +21,25 @@ const (
type CompleteGeneratePoSTCb func(posts []miner.SubmitWindowedPoStParams, err error)
type CompleteSubmitPoSTCb func(err error)
-type changeHandlerAPI interface {
+// wdPoStCommands is the subset of the WindowPoStScheduler + full node APIs used
+// by the changeHandler to execute actions and query state.
+type wdPoStCommands interface {
StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error)
+
startGeneratePoST(ctx context.Context, ts *types.TipSet, deadline *dline.Info, onComplete CompleteGeneratePoSTCb) context.CancelFunc
startSubmitPoST(ctx context.Context, ts *types.TipSet, deadline *dline.Info, posts []miner.SubmitWindowedPoStParams, onComplete CompleteSubmitPoSTCb) context.CancelFunc
onAbort(ts *types.TipSet, deadline *dline.Info)
- failPost(err error, ts *types.TipSet, deadline *dline.Info)
+ recordPoStFailure(err error, ts *types.TipSet, deadline *dline.Info)
}
type changeHandler struct {
- api changeHandlerAPI
+ api wdPoStCommands
actor address.Address
proveHdlr *proveHandler
submitHdlr *submitHandler
}
-func newChangeHandler(api changeHandlerAPI, actor address.Address) *changeHandler {
+func newChangeHandler(api wdPoStCommands, actor address.Address) *changeHandler {
posts := newPostsCache()
p := newProver(api, posts)
s := newSubmitter(api, posts)
@@ -146,7 +149,7 @@ type postResult struct {
// proveHandler generates proofs
type proveHandler struct {
- api changeHandlerAPI
+ api wdPoStCommands
posts *postsCache
postResults chan *postResult
@@ -163,7 +166,7 @@ type proveHandler struct {
}
func newProver(
- api changeHandlerAPI,
+ api wdPoStCommands,
posts *postsCache,
) *proveHandler {
ctx, cancel := context.WithCancel(context.Background())
@@ -248,7 +251,7 @@ func (p *proveHandler) processPostResult(res *postResult) {
di := res.currPost.di
if res.err != nil {
// Proving failed so inform the API
- p.api.failPost(res.err, res.ts, di)
+ p.api.recordPoStFailure(res.err, res.ts, di)
log.Warnf("Aborted window post Proving (Deadline: %+v)", di)
p.api.onAbort(res.ts, di)
@@ -295,7 +298,7 @@ type postInfo struct {
// submitHandler submits proofs on-chain
type submitHandler struct {
- api changeHandlerAPI
+ api wdPoStCommands
posts *postsCache
submitResults chan *submitResult
@@ -319,7 +322,7 @@ type submitHandler struct {
}
func newSubmitter(
- api changeHandlerAPI,
+ api wdPoStCommands,
posts *postsCache,
) *submitHandler {
ctx, cancel := context.WithCancel(context.Background())
@@ -488,7 +491,7 @@ func (s *submitHandler) submitIfReady(ctx context.Context, advance *types.TipSet
func (s *submitHandler) processSubmitResult(res *submitResult) {
if res.err != nil {
// Submit failed so inform the API and go back to the start state
- s.api.failPost(res.err, res.pw.ts, res.pw.di)
+ s.api.recordPoStFailure(res.err, res.pw.ts, res.pw.di)
log.Warnf("Aborted window post Submitting (Deadline: %+v)", res.pw.di)
s.api.onAbort(res.pw.ts, res.pw.di)
diff --git a/storage/wdpost_changehandler_test.go b/storage/wdpost_changehandler_test.go
index bae4f40fd..a2283cb7c 100644
--- a/storage/wdpost_changehandler_test.go
+++ b/storage/wdpost_changehandler_test.go
@@ -191,7 +191,7 @@ func (m *mockAPI) wasAbortCalled() bool {
return m.abortCalled
}
-func (m *mockAPI) failPost(err error, ts *types.TipSet, deadline *dline.Info) {
+func (m *mockAPI) recordPoStFailure(err error, ts *types.TipSet, deadline *dline.Info) {
}
func (m *mockAPI) setChangeHandler(ch *changeHandler) {
diff --git a/storage/wdpost_run.go b/storage/wdpost_run.go
index ca149aec3..d62b5e851 100644
--- a/storage/wdpost_run.go
+++ b/storage/wdpost_run.go
@@ -31,7 +31,8 @@ import (
"github.com/filecoin-project/lotus/chain/types"
)
-func (s *WindowPoStScheduler) failPost(err error, ts *types.TipSet, deadline *dline.Info) {
+// recordPoStFailure records a failure in the journal.
+func (s *WindowPoStScheduler) recordPoStFailure(err error, ts *types.TipSet, deadline *dline.Info) {
s.journal.RecordEvent(s.evtTypes[evtTypeWdPoStScheduler], func() interface{} {
c := evtCommon{Error: err}
if ts != nil {
@@ -99,9 +100,9 @@ func (s *WindowPoStScheduler) runGeneratePoST(
ctx, span := trace.StartSpan(ctx, "WindowPoStScheduler.generatePoST")
defer span.End()
- posts, err := s.runPost(ctx, *deadline, ts)
+ posts, err := s.runPoStCycle(ctx, *deadline, ts)
if err != nil {
- log.Errorf("runPost failed: %+v", err)
+ log.Errorf("runPoStCycle failed: %+v", err)
return nil, err
}
@@ -167,7 +168,7 @@ func (s *WindowPoStScheduler) runSubmitPoST(
commRand, err := s.api.ChainGetRandomnessFromTickets(ctx, ts.Key(), crypto.DomainSeparationTag_PoStChainCommit, commEpoch, nil)
if err != nil {
err = xerrors.Errorf("failed to get chain randomness from tickets for windowPost (ts=%d; deadline=%d): %w", ts.Height(), commEpoch, err)
- log.Errorf("submitPost failed: %+v", err)
+ log.Errorf("submitPoStMessage failed: %+v", err)
return err
}
@@ -180,7 +181,7 @@ func (s *WindowPoStScheduler) runSubmitPoST(
post.ChainCommitRand = commRand
// Submit PoST
- sm, submitErr := s.submitPost(ctx, post)
+ sm, submitErr := s.submitPoStMessage(ctx, post)
if submitErr != nil {
log.Errorf("submit window post failed: %+v", submitErr)
} else {
@@ -233,8 +234,25 @@ func (s *WindowPoStScheduler) checkSectors(ctx context.Context, check bitfield.B
return sbf, nil
}
-func (s *WindowPoStScheduler) checkNextRecoveries(ctx context.Context, dlIdx uint64, partitions []api.Partition, tsk types.TipSetKey) ([]miner.RecoveryDeclaration, *types.SignedMessage, error) {
- ctx, span := trace.StartSpan(ctx, "storage.checkNextRecoveries")
+// declareRecoveries identifies sectors that were previously marked as faulty
+// for our miner, but are now recovered (i.e. are now provable again) and
+// still not reported as such.
+//
+// It then reports the recovery on chain via a `DeclareFaultsRecovered`
+// message to our miner actor.
+//
+// This is always invoked ahead of time, before the deadline for the evaluated
+// sectors arrives. That way, recoveries are declared in preparation for those
+// sectors to be proven.
+//
+// If a declaration is made, it awaits for build.MessageConfidence confirmations
+// on chain before returning.
+//
+// TODO: the waiting should happen in the background. Right now this
+// is blocking/delaying the actual generation and submission of WindowPoSts in
+// this deadline!
+func (s *WindowPoStScheduler) declareRecoveries(ctx context.Context, dlIdx uint64, partitions []api.Partition, tsk types.TipSetKey) ([]miner.RecoveryDeclaration, *types.SignedMessage, error) {
+ ctx, span := trace.StartSpan(ctx, "storage.declareRecoveries")
defer span.End()
faulty := uint64(0)
@@ -302,7 +320,7 @@ func (s *WindowPoStScheduler) checkNextRecoveries(ctx context.Context, dlIdx uin
Value: types.NewInt(0),
}
spec := &api.MessageSendSpec{MaxFee: abi.TokenAmount(s.feeCfg.MaxWindowPoStGasFee)}
- if err := s.setSender(ctx, msg, spec); err != nil {
+ if err := s.prepareMessage(ctx, msg, spec); err != nil {
return recoveries, nil, err
}
@@ -313,7 +331,7 @@ func (s *WindowPoStScheduler) checkNextRecoveries(ctx context.Context, dlIdx uin
log.Warnw("declare faults recovered Message CID", "cid", sm.Cid())
- rec, err := s.api.StateWaitMsg(context.TODO(), sm.Cid(), build.MessageConfidence)
+ rec, err := s.api.StateWaitMsg(context.TODO(), sm.Cid(), build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
return recoveries, sm, xerrors.Errorf("declare faults recovered wait error: %w", err)
}
@@ -325,8 +343,21 @@ func (s *WindowPoStScheduler) checkNextRecoveries(ctx context.Context, dlIdx uin
return recoveries, sm, nil
}
-func (s *WindowPoStScheduler) checkNextFaults(ctx context.Context, dlIdx uint64, partitions []api.Partition, tsk types.TipSetKey) ([]miner.FaultDeclaration, *types.SignedMessage, error) {
- ctx, span := trace.StartSpan(ctx, "storage.checkNextFaults")
+// declareFaults identifies the sectors on the specified proving deadline that
+// are faulty, and reports the faults on chain via the `DeclareFaults` message
+// to our miner actor.
+//
+// This is always invoked ahead of time, before the deadline for the evaluated
+// sectors arrives. That way, faults are declared before a penalty is accrued.
+//
+// If a declaration is made, it awaits for build.MessageConfidence confirmations
+// on chain before returning.
+//
+// TODO: the waiting should happen in the background. Right now this
+// is blocking/delaying the actual generation and submission of WindowPoSts in
+// this deadline!
+func (s *WindowPoStScheduler) declareFaults(ctx context.Context, dlIdx uint64, partitions []api.Partition, tsk types.TipSetKey) ([]miner.FaultDeclaration, *types.SignedMessage, error) {
+ ctx, span := trace.StartSpan(ctx, "storage.declareFaults")
defer span.End()
bad := uint64(0)
@@ -387,7 +418,7 @@ func (s *WindowPoStScheduler) checkNextFaults(ctx context.Context, dlIdx uint64,
Value: types.NewInt(0), // TODO: Is there a fee?
}
spec := &api.MessageSendSpec{MaxFee: abi.TokenAmount(s.feeCfg.MaxWindowPoStGasFee)}
- if err := s.setSender(ctx, msg, spec); err != nil {
+ if err := s.prepareMessage(ctx, msg, spec); err != nil {
return faults, nil, err
}
@@ -398,7 +429,7 @@ func (s *WindowPoStScheduler) checkNextFaults(ctx context.Context, dlIdx uint64,
log.Warnw("declare faults Message CID", "cid", sm.Cid())
- rec, err := s.api.StateWaitMsg(context.TODO(), sm.Cid(), build.MessageConfidence)
+ rec, err := s.api.StateWaitMsg(context.TODO(), sm.Cid(), build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
return faults, sm, xerrors.Errorf("declare faults wait error: %w", err)
}
@@ -410,12 +441,18 @@ func (s *WindowPoStScheduler) checkNextFaults(ctx context.Context, dlIdx uint64,
return faults, sm, nil
}
-func (s *WindowPoStScheduler) runPost(ctx context.Context, di dline.Info, ts *types.TipSet) ([]miner.SubmitWindowedPoStParams, error) {
- ctx, span := trace.StartSpan(ctx, "storage.runPost")
+// runPoStCycle runs a full cycle of the PoSt process:
+//
+// 1. performs recovery declarations for the next deadline.
+// 2. performs fault declarations for the next deadline.
+// 3. computes and submits proofs, batching partitions and making sure they
+// don't exceed message capacity.
+func (s *WindowPoStScheduler) runPoStCycle(ctx context.Context, di dline.Info, ts *types.TipSet) ([]miner.SubmitWindowedPoStParams, error) {
+ ctx, span := trace.StartSpan(ctx, "storage.runPoStCycle")
defer span.End()
go func() {
- // TODO: extract from runPost, run on fault cutoff boundaries
+ // TODO: extract from runPoStCycle, run on fault cutoff boundaries
// check faults / recoveries for the *next* deadline. It's already too
// late to declare them for this deadline
@@ -443,7 +480,7 @@ func (s *WindowPoStScheduler) runPost(ctx context.Context, di dline.Info, ts *ty
}
)
- if recoveries, sigmsg, err = s.checkNextRecoveries(context.TODO(), declDeadline, partitions, ts.Key()); err != nil {
+ if recoveries, sigmsg, err = s.declareRecoveries(context.TODO(), declDeadline, partitions, ts.Key()); err != nil {
// TODO: This is potentially quite bad, but not even trying to post when this fails is objectively worse
log.Errorf("checking sector recoveries: %v", err)
}
@@ -462,7 +499,7 @@ func (s *WindowPoStScheduler) runPost(ctx context.Context, di dline.Info, ts *ty
return // FORK: declaring faults after ignition upgrade makes no sense
}
- if faults, sigmsg, err = s.checkNextFaults(context.TODO(), declDeadline, partitions, ts.Key()); err != nil {
+ if faults, sigmsg, err = s.declareFaults(context.TODO(), declDeadline, partitions, ts.Key()); err != nil {
// TODO: This is also potentially really bad, but we try to post anyways
log.Errorf("checking sector faults: %v", err)
}
@@ -765,7 +802,10 @@ func (s *WindowPoStScheduler) sectorsForProof(ctx context.Context, goodSectors,
return proofSectors, nil
}
-func (s *WindowPoStScheduler) submitPost(ctx context.Context, proof *miner.SubmitWindowedPoStParams) (*types.SignedMessage, error) {
+// submitPoStMessage builds a SubmitWindowedPoSt message and submits it to
+// the mpool. It doesn't synchronously block on confirmations, but it does
+// monitor in the background simply for the purposes of logging.
+func (s *WindowPoStScheduler) submitPoStMessage(ctx context.Context, proof *miner.SubmitWindowedPoStParams) (*types.SignedMessage, error) {
ctx, span := trace.StartSpan(ctx, "storage.commitPost")
defer span.End()
@@ -783,13 +823,11 @@ func (s *WindowPoStScheduler) submitPost(ctx context.Context, proof *miner.Submi
Value: types.NewInt(0),
}
spec := &api.MessageSendSpec{MaxFee: abi.TokenAmount(s.feeCfg.MaxWindowPoStGasFee)}
- if err := s.setSender(ctx, msg, spec); err != nil {
+ if err := s.prepareMessage(ctx, msg, spec); err != nil {
return nil, err
}
- // TODO: consider maybe caring about the output
sm, err := s.api.MpoolPushMessage(ctx, msg, spec)
-
if err != nil {
return nil, xerrors.Errorf("pushing message to mpool: %w", err)
}
@@ -797,7 +835,7 @@ func (s *WindowPoStScheduler) submitPost(ctx context.Context, proof *miner.Submi
log.Infof("Submitted window post: %s", sm.Cid())
go func() {
- rec, err := s.api.StateWaitMsg(context.TODO(), sm.Cid(), build.MessageConfidence)
+ rec, err := s.api.StateWaitMsg(context.TODO(), sm.Cid(), build.MessageConfidence, api.LookbackNoLimit, true)
if err != nil {
log.Error(err)
return
@@ -813,14 +851,20 @@ func (s *WindowPoStScheduler) submitPost(ctx context.Context, proof *miner.Submi
return sm, nil
}
-func (s *WindowPoStScheduler) setSender(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) error {
+// prepareMessage prepares a message before sending it, setting:
+//
+// * the sender (from the AddressSelector, falling back to the worker address if none set)
+// * the right gas parameters
+func (s *WindowPoStScheduler) prepareMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) error {
mi, err := s.api.StateMinerInfo(ctx, s.actor, types.EmptyTSK)
if err != nil {
return xerrors.Errorf("error getting miner info: %w", err)
}
- // use the worker as a fallback
+ // set the worker as a fallback
msg.From = mi.Worker
+ // (optimal) initial estimation with some overestimation that guarantees
+ // block inclusion within the next 20 tipsets.
gm, err := s.api.GasEstimateMessageGas(ctx, msg, spec, types.EmptyTSK)
if err != nil {
log.Errorw("estimating gas", "error", err)
@@ -828,10 +872,12 @@ func (s *WindowPoStScheduler) setSender(ctx context.Context, msg *types.Message,
}
*msg = *gm
- // estimate
+ // calculate a more frugal estimation; premium is estimated to guarantee
+ // inclusion within 5 tipsets, and fee cap is estimated for inclusion
+ // within 4 tipsets.
minGasFeeMsg := *msg
- minGasFeeMsg.GasPremium, err = s.api.GasEstimateGasPremium(ctx, 5, msg.From, msg.GasLimit, types.TipSetKey{})
+ minGasFeeMsg.GasPremium, err = s.api.GasEstimateGasPremium(ctx, 5, msg.From, msg.GasLimit, types.EmptyTSK)
if err != nil {
log.Errorf("failed to estimate minimum gas premium: %+v", err)
minGasFeeMsg.GasPremium = msg.GasPremium
@@ -843,6 +889,8 @@ func (s *WindowPoStScheduler) setSender(ctx context.Context, msg *types.Message,
minGasFeeMsg.GasFeeCap = msg.GasFeeCap
}
+ // goodFunds = funds needed for optimal inclusion probability.
+ // minFunds = funds needed for more speculative inclusion probability.
goodFunds := big.Add(msg.RequiredFunds(), msg.Value)
minFunds := big.Min(big.Add(minGasFeeMsg.RequiredFunds(), minGasFeeMsg.Value), goodFunds)
diff --git a/storage/wdpost_run_test.go b/storage/wdpost_run_test.go
index f80f6bee2..b878ff97e 100644
--- a/storage/wdpost_run_test.go
+++ b/storage/wdpost_run_test.go
@@ -39,7 +39,7 @@ import (
type mockStorageMinerAPI struct {
partitions []api.Partition
pushedMessages chan *types.Message
- storageMinerApi
+ fullNodeFilteredAPI
}
func newMockStorageMinerAPI() *mockStorageMinerAPI {
@@ -96,7 +96,7 @@ func (m *mockStorageMinerAPI) MpoolPushMessage(ctx context.Context, message *typ
}, nil
}
-func (m *mockStorageMinerAPI) StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*api.MsgLookup, error) {
+func (m *mockStorageMinerAPI) StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) {
return &api.MsgLookup{
Receipt: types.MessageReceipt{
ExitCode: 0,
@@ -322,7 +322,7 @@ func (m *mockStorageMinerAPI) StateMinerInitialPledgeCollateral(ctx context.Cont
panic("implement me")
}
-func (m *mockStorageMinerAPI) StateSearchMsg(ctx context.Context, cid cid.Cid) (*api.MsgLookup, error) {
+func (m *mockStorageMinerAPI) StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) {
panic("implement me")
}
@@ -400,4 +400,4 @@ func (m *mockStorageMinerAPI) WalletHas(ctx context.Context, address address.Add
return true, nil
}
-var _ storageMinerApi = &mockStorageMinerAPI{}
+var _ fullNodeFilteredAPI = &mockStorageMinerAPI{}
diff --git a/storage/wdpost_sched.go b/storage/wdpost_sched.go
index 8c24a5516..88357c5b3 100644
--- a/storage/wdpost_sched.go
+++ b/storage/wdpost_sched.go
@@ -23,8 +23,14 @@ import (
"go.opencensus.io/trace"
)
+// WindowPoStScheduler is the coordinator for WindowPoSt submissions, fault
+// declaration, and recovery declarations. It watches the chain for reverts and
+// applies, and schedules/run those processes as partition deadlines arrive.
+//
+// WindowPoStScheduler watches the chain though the changeHandler, which in turn
+// turn calls the scheduler when the time arrives to do work.
type WindowPoStScheduler struct {
- api storageMinerApi
+ api fullNodeFilteredAPI
feeCfg config.MinerFeeConfig
addrSel *AddressSelector
prover storage.Prover
@@ -43,7 +49,15 @@ type WindowPoStScheduler struct {
// failLk sync.Mutex
}
-func NewWindowedPoStScheduler(api storageMinerApi, fc config.MinerFeeConfig, as *AddressSelector, sb storage.Prover, verif ffiwrapper.Verifier, ft sectorstorage.FaultTracker, j journal.Journal, actor address.Address) (*WindowPoStScheduler, error) {
+// NewWindowedPoStScheduler creates a new WindowPoStScheduler scheduler.
+func NewWindowedPoStScheduler(api fullNodeFilteredAPI,
+ cfg config.MinerFeeConfig,
+ as *AddressSelector,
+ sp storage.Prover,
+ verif ffiwrapper.Verifier,
+ ft sectorstorage.FaultTracker,
+ j journal.Journal,
+ actor address.Address) (*WindowPoStScheduler, error) {
mi, err := api.StateMinerInfo(context.TODO(), actor, types.EmptyTSK)
if err != nil {
return nil, xerrors.Errorf("getting sector size: %w", err)
@@ -51,9 +65,9 @@ func NewWindowedPoStScheduler(api storageMinerApi, fc config.MinerFeeConfig, as
return &WindowPoStScheduler{
api: api,
- feeCfg: fc,
+ feeCfg: cfg,
addrSel: as,
- prover: sb,
+ prover: sp,
verifier: verif,
faultTracker: ft,
proofType: mi.WindowPoStProofType,
@@ -70,21 +84,24 @@ func NewWindowedPoStScheduler(api storageMinerApi, fc config.MinerFeeConfig, as
}, nil
}
-type changeHandlerAPIImpl struct {
- storageMinerApi
- *WindowPoStScheduler
-}
-
func (s *WindowPoStScheduler) Run(ctx context.Context) {
- // Initialize change handler
- chImpl := &changeHandlerAPIImpl{storageMinerApi: s.api, WindowPoStScheduler: s}
- s.ch = newChangeHandler(chImpl, s.actor)
+ // Initialize change handler.
+
+ // callbacks is a union of the fullNodeFilteredAPI and ourselves.
+ callbacks := struct {
+ fullNodeFilteredAPI
+ *WindowPoStScheduler
+ }{s.api, s}
+
+ s.ch = newChangeHandler(callbacks, s.actor)
defer s.ch.shutdown()
s.ch.start()
- var notifs <-chan []*api.HeadChange
- var err error
- var gotCur bool
+ var (
+ notifs <-chan []*api.HeadChange
+ err error
+ gotCur bool
+ )
// not fine to panic after this point
for {
diff --git a/testplans/Makefile b/testplans/Makefile
index 410553b90..38f46baa8 100644
--- a/testplans/Makefile
+++ b/testplans/Makefile
@@ -6,18 +6,18 @@ download-proofs:
go run github.com/filecoin-project/go-paramfetch/paramfetch 2048 ./docker-images/proof-parameters.json
build-images:
- docker build -t "iptestground/oni-buildbase:v13-lotus" -f "docker-images/Dockerfile.oni-buildbase" "docker-images"
- docker build -t "iptestground/oni-runtime:v7" -f "docker-images/Dockerfile.oni-runtime" "docker-images"
- docker build -t "iptestground/oni-runtime:v8-debug" -f "docker-images/Dockerfile.oni-runtime-debug" "docker-images"
+ docker build -t "iptestground/oni-buildbase:v15-lotus" -f "docker-images/Dockerfile.oni-buildbase" "docker-images"
+ docker build -t "iptestground/oni-runtime:v10" -f "docker-images/Dockerfile.oni-runtime" "docker-images"
+ docker build -t "iptestground/oni-runtime:v10-debug" -f "docker-images/Dockerfile.oni-runtime-debug" "docker-images"
push-images:
- docker push iptestground/oni-buildbase:v13-lotus
- docker push iptestground/oni-runtime:v7
- docker push iptestground/oni-runtime:v8-debug
+ docker push iptestground/oni-buildbase:v15-lotus
+ docker push iptestground/oni-runtime:v10
+ docker push iptestground/oni-runtime:v10-debug
pull-images:
- docker pull iptestground/oni-buildbase:v13-lotus
- docker pull iptestground/oni-runtime:v7
- docker pull iptestground/oni-runtime:v8-debug
+ docker pull iptestground/oni-buildbase:v15-lotus
+ docker pull iptestground/oni-runtime:v10
+ docker pull iptestground/oni-runtime:v10-debug
.PHONY: download-proofs build-images push-images pull-images
diff --git a/testplans/docker-images/Dockerfile.oni-buildbase b/testplans/docker-images/Dockerfile.oni-buildbase
index 012a27fc7..265066537 100644
--- a/testplans/docker-images/Dockerfile.oni-buildbase
+++ b/testplans/docker-images/Dockerfile.oni-buildbase
@@ -1,10 +1,10 @@
-ARG GO_VERSION=1.15.6
+ARG GO_VERSION=1.16.3
FROM golang:${GO_VERSION}-buster
RUN apt-get update && apt-get install -y ca-certificates llvm clang mesa-opencl-icd ocl-icd-opencl-dev jq gcc git pkg-config bzr libhwloc-dev
-ARG FILECOIN_FFI_COMMIT=62f89f108a6a8fe9ad6ed52fb7ffbf8594d7ae5c
+ARG FILECOIN_FFI_COMMIT=8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
ARG FFI_DIR=/extern/filecoin-ffi
RUN mkdir -p ${FFI_DIR} \
diff --git a/testplans/docker-images/Dockerfile.oni-runtime b/testplans/docker-images/Dockerfile.oni-runtime
index 2ccb7337c..27144069a 100644
--- a/testplans/docker-images/Dockerfile.oni-runtime
+++ b/testplans/docker-images/Dockerfile.oni-runtime
@@ -1,4 +1,4 @@
-ARG GO_VERSION=1.15.6
+ARG GO_VERSION=1.16.3
FROM golang:${GO_VERSION}-buster as downloader
@@ -8,7 +8,7 @@ FROM golang:${GO_VERSION}-buster as downloader
## 3. Trigger the download.
## Output will be in /var/tmp/filecoin-proof-parameters.
-RUN go get github.com/filecoin-project/go-paramfetch/paramfetch
+RUN go get github.com/filecoin-project/go-paramfetch/paramfetch@master
COPY /proof-parameters.json /
RUN paramfetch 8388608 /proof-parameters.json
diff --git a/testplans/docker-images/Dockerfile.oni-runtime-debug b/testplans/docker-images/Dockerfile.oni-runtime-debug
index a349a70da..856fcc1fc 100644
--- a/testplans/docker-images/Dockerfile.oni-runtime-debug
+++ b/testplans/docker-images/Dockerfile.oni-runtime-debug
@@ -1,4 +1,4 @@
-ARG GO_VERSION=1.15.6
+ARG GO_VERSION=1.16.3
FROM golang:${GO_VERSION}-buster as downloader
@@ -8,11 +8,11 @@ FROM golang:${GO_VERSION}-buster as downloader
## 3. Trigger the download.
## Output will be in /var/tmp/filecoin-proof-parameters.
-RUN go get github.com/filecoin-project/go-paramfetch/paramfetch
+RUN go get github.com/filecoin-project/go-paramfetch/paramfetch@master
COPY /proof-parameters.json /
RUN paramfetch 8388608 /proof-parameters.json
-ARG LOTUS_COMMIT=b4ad2e5e93dc710d985eb9cf3ee04142efb47bf0
+ARG LOTUS_COMMIT=b8deee048eaf850113e8626a73f64b17ba69a9f6
## for debug purposes
RUN apt update && apt install -y mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config libhwloc-dev curl && git clone https://github.com/filecoin-project/lotus.git && cd lotus/ && git checkout ${LOTUS_COMMIT} && make clean && make all && make install
diff --git a/testplans/lotus-soup/_compositions/baseline-docker-1-1-with-restarts.toml b/testplans/lotus-soup/_compositions/baseline-docker-1-1-with-restarts.toml
new file mode 100644
index 000000000..28865a03b
--- /dev/null
+++ b/testplans/lotus-soup/_compositions/baseline-docker-1-1-with-restarts.toml
@@ -0,0 +1,59 @@
+[metadata]
+ name = "lotus-soup"
+ author = ""
+
+[global]
+ plan = "lotus-soup"
+ case = "deals-e2e"
+ total_instances = 3
+ builder = "docker:go"
+ runner = "local:docker"
+
+[global.build]
+ selectors = ["testground"]
+
+[global.run_config]
+ exposed_ports = { pprof = "6060", node_rpc = "1234", miner_rpc = "2345" }
+
+[global.build_config]
+ enable_go_build_cache = true
+
+[global.run.test_params]
+ clients = "1"
+ miners = "1"
+ genesis_timestamp_offset = "0"
+ balance = "20000000" # These balances will work for maximum 100 nodes, as TotalFilecoin is 2B
+ sectors = "3"
+ random_beacon_type = "mock"
+ mining_mode = "natural"
+ bandwidth = "4MB"
+
+
+[[groups]]
+ id = "bootstrapper"
+ [groups.instances]
+ count = 1
+ percentage = 0.0
+ [groups.run]
+ [groups.run.test_params]
+ role = "bootstrapper"
+
+[[groups]]
+ id = "miners"
+ [groups.instances]
+ count = 1
+ percentage = 0.0
+ [groups.run]
+ [groups.run.test_params]
+ role = "miner"
+
+[[groups]]
+ id = "clients"
+ [groups.instances]
+ count = 1
+ percentage = 0.0
+ [groups.run]
+ [groups.run.test_params]
+ role = "client"
+ # Bounce the connection during push and pull requests
+ bounce_conn_data_transfers = "true"
diff --git a/testplans/lotus-soup/_compositions/baseline-docker-1-1.toml b/testplans/lotus-soup/_compositions/baseline-docker-1-1.toml
index 9012be69c..25a31f9ec 100644
--- a/testplans/lotus-soup/_compositions/baseline-docker-1-1.toml
+++ b/testplans/lotus-soup/_compositions/baseline-docker-1-1.toml
@@ -23,7 +23,7 @@
miners = "1"
genesis_timestamp_offset = "0"
balance = "20000000" # These balances will work for maximum 100 nodes, as TotalFilecoin is 2B
- sectors = "10"
+ sectors = "3"
random_beacon_type = "mock"
mining_mode = "natural"
diff --git a/testplans/lotus-soup/_compositions/baseline-k8s-1-1-versions.toml b/testplans/lotus-soup/_compositions/baseline-k8s-1-1-versions.toml
new file mode 100644
index 000000000..051d8e0c6
--- /dev/null
+++ b/testplans/lotus-soup/_compositions/baseline-k8s-1-1-versions.toml
@@ -0,0 +1,74 @@
+[metadata]
+ name = "lotus-soup"
+ author = ""
+
+[global]
+ plan = "lotus-soup"
+ case = "deals-e2e"
+ total_instances = 3
+ builder = "docker:go"
+ runner = "cluster:k8s"
+
+[global.build]
+ selectors = ["testground"]
+
+[global.run_config]
+ exposed_ports = { pprof = "6060", node_rpc = "1234", miner_rpc = "2345" }
+
+[global.build_config]
+ push_registry=true
+ go_proxy_mode="remote"
+ go_proxy_url="http://localhost:8081"
+ registry_type="aws"
+
+[global.run.test_params]
+ clients = "1"
+ miners = "1"
+ genesis_timestamp_offset = "0"
+ balance = "20000000" # These balances will work for maximum 100 nodes, as TotalFilecoin is 2B
+ sectors = "10"
+ random_beacon_type = "mock"
+ mining_mode = "natural"
+
+[[groups]]
+ id = "bootstrapper"
+ [groups.resources]
+ memory = "512Mi"
+ cpu = "1000m"
+ [groups.instances]
+ count = 1
+ percentage = 0.0
+ [groups.run]
+ [groups.run.test_params]
+ role = "bootstrapper"
+
+[[groups]]
+ id = "miners"
+ [groups.resources]
+ memory = "4096Mi"
+ cpu = "1000m"
+ [groups.instances]
+ count = 1
+ percentage = 0.0
+ [groups.run]
+ [groups.run.test_params]
+ role = "miner"
+ [groups.build]
+ dependencies = [
+ { module = "github.com/filecoin-project/lotus", version = "{{.Env.LOTUS_VERSION_MINER}}"},
+ ]
+[[groups]]
+ id = "clients"
+ [groups.resources]
+ memory = "1024Mi"
+ cpu = "1000m"
+ [groups.instances]
+ count = 1
+ percentage = 0.0
+ [groups.run]
+ [groups.run.test_params]
+ role = "client"
+ [groups.build]
+ dependencies = [
+ { module = "github.com/filecoin-project/lotus", version = "{{.Env.LOTUS_VERSION_CLIENT}}"},
+ ]
diff --git a/testplans/lotus-soup/_compositions/baseline-k8s-3-1.toml b/testplans/lotus-soup/_compositions/baseline-k8s-3-1.toml
index 18ce024bb..dc6519656 100644
--- a/testplans/lotus-soup/_compositions/baseline-k8s-3-1.toml
+++ b/testplans/lotus-soup/_compositions/baseline-k8s-3-1.toml
@@ -45,7 +45,7 @@
[[groups]]
id = "miners"
[groups.resources]
- memory = "4096Mi"
+ memory = "8192Mi"
cpu = "1000m"
[groups.instances]
count = 1
diff --git a/testplans/lotus-soup/_compositions/paych-stress-k8s.toml b/testplans/lotus-soup/_compositions/paych-stress-k8s.toml
index cf98960b7..b5d7f9bd4 100644
--- a/testplans/lotus-soup/_compositions/paych-stress-k8s.toml
+++ b/testplans/lotus-soup/_compositions/paych-stress-k8s.toml
@@ -5,7 +5,7 @@
[global]
plan = "lotus-soup"
case = "paych-stress"
- total_instances = 5 # 2 clients + 2 miners + 1 bootstrapper
+ total_instances = 4 # 2 clients + 1 miners + 1 bootstrapper
builder = "docker:go"
runner = "cluster:k8s"
@@ -23,7 +23,7 @@
[global.run.test_params]
clients = "2"
- miners = "2"
+ miners = "1"
genesis_timestamp_offset = "0"
balance = "100" ## be careful, this is in FIL.
sectors = "10"
@@ -44,7 +44,7 @@
[[groups]]
id = "miners"
- instances = { count = 2 }
+ instances = { count = 1 }
[groups.run.test_params]
role = "miner"
[groups.resources]
diff --git a/testplans/lotus-soup/deals_e2e.go b/testplans/lotus-soup/deals_e2e.go
index ee7b2c9e8..6737bdae2 100644
--- a/testplans/lotus-soup/deals_e2e.go
+++ b/testplans/lotus-soup/deals_e2e.go
@@ -4,19 +4,19 @@ import (
"context"
"fmt"
"io/ioutil"
+ mbig "math/big"
"math/rand"
"os"
"time"
- "github.com/filecoin-project/go-address"
- "github.com/filecoin-project/go-state-types/big"
- "github.com/filecoin-project/lotus/api"
+ "github.com/libp2p/go-libp2p-core/peer"
"github.com/testground/sdk-go/sync"
- mbig "math/big"
-
+ "github.com/filecoin-project/go-address"
+ datatransfer "github.com/filecoin-project/go-data-transfer"
+ "github.com/filecoin-project/go-state-types/big"
+ "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
-
"github.com/filecoin-project/lotus/testplans/lotus-soup/testkit"
)
@@ -39,6 +39,8 @@ import (
// Then we create a genesis block that allocates some funds to each node and collects
// the presealed sectors.
func dealsE2E(t *testkit.TestEnvironment) error {
+ t.RecordMessage("running node with role '%s'", t.Role)
+
// Dispatch/forward non-client roles to defaults.
if t.Role != "client" {
return testkit.HandleDefaultRole(t)
@@ -75,9 +77,11 @@ func dealsE2E(t *testkit.TestEnvironment) error {
// give some time to the miner, otherwise, we get errors like:
// deal errored deal failed: (State=26) error calling node: publishing deal: GasEstimateMessageGas
// error: estimating gas used: message execution failed: exit 19, reason: failed to lock balance: failed to lock client funds: not enough balance to lock for addr t0102: escrow balance 0 < locked 0 + required 640297000 (RetCode=19)
- time.Sleep(50 * time.Second)
+ time.Sleep(40 * time.Second)
- // generate 1600 bytes of random data
+ time.Sleep(time.Duration(t.GlobalSeq) * 5 * time.Second)
+
+ // generate 5000000 bytes of random data
data := make([]byte, 5000000)
rand.New(rand.NewSource(time.Now().UnixNano())).Read(data)
@@ -98,6 +102,15 @@ func dealsE2E(t *testkit.TestEnvironment) error {
}
t.RecordMessage("file cid: %s", fcid)
+ // Check if we should bounce the connection during data transfers
+ if t.BooleanParam("bounce_conn_data_transfers") {
+ t.RecordMessage("Will bounce connection during push and pull data-transfers")
+ err = bounceConnInTransfers(ctx, t, client, minerAddr.MinerNetAddrs.ID)
+ if err != nil {
+ return err
+ }
+ }
+
// start deal
t1 := time.Now()
deal := testkit.StartDeal(ctx, minerAddr.MinerActorAddr, client, fcid.Root, fastRetrieval)
@@ -131,6 +144,55 @@ func dealsE2E(t *testkit.TestEnvironment) error {
return nil
}
+func bounceConnInTransfers(ctx context.Context, t *testkit.TestEnvironment, client api.FullNode, minerPeerID peer.ID) error {
+ storageConnBroken := false
+ retrievalConnBroken := false
+ upds, err := client.ClientDataTransferUpdates(ctx)
+ if err != nil {
+ return err
+ }
+
+ go func() {
+ for upd := range upds {
+ dir := "push"
+ if !upd.IsSender {
+ dir = "pull"
+ }
+
+ t.RecordMessage("%s data transfer status: %s, transferred: %d", dir, datatransfer.Statuses[upd.Status], upd.Transferred)
+
+ // Bounce the connection after the first block is sent for the storage deal
+ if upd.IsSender && upd.Transferred > 0 && !storageConnBroken {
+ storageConnBroken = true
+ bounceConnection(ctx, t, client, minerPeerID)
+ }
+
+ // Bounce the connection after the first block is received for the retrieval deal
+ if !upd.IsSender && upd.Transferred > 0 && !retrievalConnBroken {
+ retrievalConnBroken = true
+ bounceConnection(ctx, t, client, minerPeerID)
+ }
+ }
+ }()
+
+ return nil
+}
+
+func bounceConnection(ctx context.Context, t *testkit.TestEnvironment, client api.FullNode, minerPeerID peer.ID) {
+ t.RecordMessage("disconnecting peer %s", minerPeerID)
+ client.NetBlockAdd(ctx, api.NetBlockList{
+ Peers: []peer.ID{minerPeerID},
+ })
+
+ go func() {
+ time.Sleep(3 * time.Second)
+ t.RecordMessage("reconnecting to peer %s", minerPeerID)
+ client.NetBlockRemove(ctx, api.NetBlockList{
+ Peers: []peer.ID{minerPeerID},
+ })
+ }()
+}
+
// filToAttoFil converts a fractional filecoin value into AttoFIL, rounding if necessary
func filToAttoFil(f float64) big.Int {
a := mbig.NewFloat(f)
@@ -158,7 +220,7 @@ func initPaymentChannel(t *testkit.TestEnvironment, ctx context.Context, cl *tes
t.RecordMessage("waiting for payment channel message to appear on chain")
// wait for the channel creation message to appear on chain.
- _, err = cl.FullApi.StateWaitMsg(ctx, channel.WaitSentinel, 2)
+ _, err = cl.FullApi.StateWaitMsg(ctx, channel.WaitSentinel, 2, api.LookbackNoLimit, true)
if err != nil {
return fmt.Errorf("failed while waiting for payment channel creation msg to appear on chain: %w", err)
}
diff --git a/testplans/lotus-soup/go.mod b/testplans/lotus-soup/go.mod
index cefdc799b..0c8e92a1b 100644
--- a/testplans/lotus-soup/go.mod
+++ b/testplans/lotus-soup/go.mod
@@ -1,6 +1,6 @@
module github.com/filecoin-project/lotus/testplans/lotus-soup
-go 1.15
+go 1.16
require (
contrib.go.opencensus.io/exporter/prometheus v0.1.0
@@ -8,21 +8,24 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/drand/drand v1.2.1
github.com/filecoin-project/go-address v0.0.5
- github.com/filecoin-project/go-fil-markets v1.1.9
+ github.com/filecoin-project/go-data-transfer v1.6.0
+ github.com/filecoin-project/go-fil-markets v1.4.0
github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec
github.com/filecoin-project/go-state-types v0.1.1-0.20210506134452-99b279731c48
github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b
- github.com/filecoin-project/lotus v1.5.2
- github.com/filecoin-project/specs-actors v0.9.13
+ github.com/filecoin-project/lotus v1.9.1-0.20210602131226-e1dc7ad6eb9e
+ github.com/filecoin-project/specs-actors v0.9.14
+ github.com/filecoin-project/specs-actors/v5 v5.0.0-20210602024058-0c296bb386bf // indirect
github.com/google/uuid v1.1.2
github.com/gorilla/mux v1.7.4
github.com/hashicorp/go-multierror v1.1.0
github.com/influxdata/influxdb v1.8.3 // indirect
github.com/ipfs/go-cid v0.0.7
github.com/ipfs/go-datastore v0.4.5
+ github.com/ipfs/go-graphsync v0.6.2-0.20210428121800-88edb5462e17 // indirect
github.com/ipfs/go-ipfs-files v0.0.8
github.com/ipfs/go-ipld-format v0.2.0
- github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4
+ github.com/ipfs/go-log/v2 v2.1.2
github.com/ipfs/go-merkledag v0.3.2
github.com/ipfs/go-unixfs v0.2.4
github.com/ipld/go-car v0.1.1-0.20201119040415-11b6074b6d4d
diff --git a/testplans/lotus-soup/go.sum b/testplans/lotus-soup/go.sum
index 6d83c40a1..926f625cf 100644
--- a/testplans/lotus-soup/go.sum
+++ b/testplans/lotus-soup/go.sum
@@ -46,8 +46,15 @@ github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee h1:8doiS7ib3zi6/K1
github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee/go.mod h1:W0GbEAA4uFNYOGG2cJpmFJ04E6SD1NLELPYZB57/7AY=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y=
+github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa h1:1PPxEyGdIGVkX/kqMvLJ95a1dGS1Sz7tpNEgehEYYt0=
+github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa/go.mod h1:WUmMvh9wMtqj1Xhf1hf3kp9RvL+y6odtdYxpyZjb90U=
+github.com/Masterminds/glide v0.13.2/go.mod h1:STyF5vcenH/rUqTEv+/hBXlSTo7KYwg2oc2f4tzPWic=
+github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
+github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
+github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
@@ -63,6 +70,7 @@ github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/akavel/rsrc v0.8.0 h1:zjWn7ukO9Kc5Q62DOJCcxGpXC18RawVtYAGdz2aLlfw=
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
+github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@@ -95,6 +103,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/bep/debounce v1.2.0 h1:wXds8Kq8qRfwAOpAxHrJDbCXgC5aHSzgQb/0gKsHQqo=
+github.com/bep/debounce v1.2.0/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
@@ -146,6 +156,7 @@ github.com/cockroachdb/pebble v0.0.0-20201001221639-879f3bfeef07/go.mod h1:hU7vh
github.com/cockroachdb/redact v0.0.0-20200622112456-cd282804bbd3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
+github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA=
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q=
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
github.com/codeskyblue/go-sh v0.0.0-20200712050446-30169cf553fe h1:69JI97HlzP+PH5Mi1thcGlDoBr6PS2Oe+l3mNmAkbs4=
@@ -165,6 +176,7 @@ github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7
github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg=
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU=
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
@@ -236,6 +248,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/etclabscore/go-jsonschema-walk v0.0.6/go.mod h1:VdfDY72AFAiUhy0ZXEaWSpveGjMT5JcDIm903NGqFwQ=
+github.com/etclabscore/go-openrpc-reflect v0.0.36/go.mod h1:0404Ky3igAasAOpyj1eESjstTyneBAIk5PgJFbK4s5E=
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A=
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
@@ -249,43 +263,46 @@ github.com/filecoin-project/go-address v0.0.5/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+
github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoCcSuHN1XcbN0c6KBh7yvP5fs=
github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349 h1:pIuR0dnMD0i+as8wNnjjHyQrnhP5O5bmba/lmgQeRgU=
github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349/go.mod h1:vgmwKBkx+ca5OIeEvstiQgzAZnb7R6QaqE1oEDSqa6g=
-github.com/filecoin-project/go-amt-ipld/v3 v3.0.0 h1:Ou/q82QeHGOhpkedvaxxzpBYuqTxLCcj5OChkDNx4qc=
github.com/filecoin-project/go-amt-ipld/v3 v3.0.0/go.mod h1:Qa95YNAbtoVCTSVtX38aAC1ptBnJfPma1R/zZsKmx4o=
+github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 h1:ZNJ9tEG5bE72vBWYiuh5bkxJVM3ViHNOmQ7qew9n6RE=
+github.com/filecoin-project/go-amt-ipld/v3 v3.1.0/go.mod h1:UjM2QhDFrrjD5s1CdnkJkat4ga+LqZBZgTMniypABRo=
github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM=
github.com/filecoin-project/go-bitfield v0.2.3/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM=
github.com/filecoin-project/go-bitfield v0.2.4 h1:uZ7MeE+XfM5lqrHJZ93OnhQKc/rveW8p9au0C68JPgk=
github.com/filecoin-project/go-bitfield v0.2.4/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM=
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8=
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg=
-github.com/filecoin-project/go-commp-utils v0.0.0-20201119054358-b88f7a96a434 h1:0kHszkYP3hgApcjl5x4rpwONhN9+j7XDobf6at5XfHs=
github.com/filecoin-project/go-commp-utils v0.0.0-20201119054358-b88f7a96a434/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U=
+github.com/filecoin-project/go-commp-utils v0.1.1-0.20210427191551-70bf140d31c7 h1:U9Z+76pHCKBmtdxFV7JFZJj7OVm12I6dEKwtMVbq5p0=
+github.com/filecoin-project/go-commp-utils v0.1.1-0.20210427191551-70bf140d31c7/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U=
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus=
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ=
github.com/filecoin-project/go-data-transfer v1.0.1/go.mod h1:UxvfUAY9v3ub0a21BSK9u3pB2aq30Y0KMsG+w9/ysyo=
-github.com/filecoin-project/go-data-transfer v1.2.7 h1:WE5Cpp9eMt5BDoWOVR64QegSn6bwHQaDzyyjVU377Y0=
-github.com/filecoin-project/go-data-transfer v1.2.7/go.mod h1:mvjZ+C3NkBX10JP4JMu27DCjUouHFjHwUGh+Xc4yvDA=
+github.com/filecoin-project/go-data-transfer v1.6.0 h1:DHIzEc23ydRCCBwtFet3MfgO8gMpZEnw60Y+s71oX6o=
+github.com/filecoin-project/go-data-transfer v1.6.0/go.mod h1:E3WW4mCEYwU2y65swPEajSZoFWFmfXt7uwGduoACZQc=
github.com/filecoin-project/go-ds-versioning v0.1.0 h1:y/X6UksYTsK8TLCI7rttCKEvl8btmWxyFMEeeWGUxIQ=
github.com/filecoin-project/go-ds-versioning v0.1.0/go.mod h1:mp16rb4i2QPmxBnmanUx8i/XANp+PFCCJWiAb+VW4/s=
github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ=
github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a h1:hyJ+pUm/4U4RdEZBlg6k8Ma4rDiuvqyGpoICXAxwsTg=
github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ=
github.com/filecoin-project/go-fil-markets v1.0.5-0.20201113164554-c5eba40d5335/go.mod h1:AJySOJC00JRWEZzRG2KsfUnqEf5ITXxeX09BE9N4f9c=
-github.com/filecoin-project/go-fil-markets v1.1.9 h1:sA0NIEOpy7brZaeXeNgdXg5pvHaBtD5OTRlraOUbI0w=
-github.com/filecoin-project/go-fil-markets v1.1.9/go.mod h1:0yQu5gvrjFoAIyzPSSJ+xUdCG83vjInAFbTswIB5/hk=
+github.com/filecoin-project/go-fil-markets v1.4.0 h1:J4L6o+FVOmS7ZWV6wxLPiuoDzGC7iS3S5NRFL1enEr0=
+github.com/filecoin-project/go-fil-markets v1.4.0/go.mod h1:7be6zzFwaN8kxVeYZf/UUj/JilHC0ogPvWqE1TW8Ptk=
github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM=
github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24=
github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 h1:b3UDemBYN2HNfk3KOXNuxgTTxlWi3xVvbQP0IT38fvM=
github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0/go.mod h1:7aWZdaQ1b16BVoQUYR+eEvrDCGJoPLxFpDynFjYfBjI=
-github.com/filecoin-project/go-hamt-ipld/v3 v3.0.1 h1:zbzs46G7bOctkZ+JUX3xirrj0RaEsi+27dtlsgrTNBg=
github.com/filecoin-project/go-hamt-ipld/v3 v3.0.1/go.mod h1:gXpNmr3oQx8l3o7qkGyDjJjYSRX7hp/FGOStdqrWyDI=
+github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 h1:rVVNq0x6RGQIzCo1iiJlGFm9AGIZzeifggxtKMU7zmI=
+github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0/go.mod h1:bxmzgT8tmeVQA1/gvBwFmYdT8SOFUwB3ovSUfG1Ux0g=
github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec h1:rGI5I7fdU4viManxmDdbk5deZO7afe6L1Wc04dAmlOM=
github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec/go.mod h1:XBBpuKIMaXIIzeqzO1iucq4GvbF8CxmXRFoezRh+Cx4=
github.com/filecoin-project/go-multistore v0.0.3 h1:vaRBY4YiA2UZFPK57RNuewypB8u0DzzQwqsL0XarpnI=
github.com/filecoin-project/go-multistore v0.0.3/go.mod h1:kaNqCC4IhU4B1uyr7YWFHd23TL4KM32aChS0jNkyUvQ=
github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20 h1:+/4aUeUoKr6AKfPE3mBhXA5spIV6UcKdTYDPNU2Tdmg=
github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20/go.mod h1:mPn+LRRd5gEKNAtc+r3ScpW2JRU/pj4NBKdADYWHiak=
-github.com/filecoin-project/go-paramfetch v0.0.2-0.20200701152213-3e0f0afdc261 h1:A256QonvzRaknIIAuWhe/M2dpV2otzs3NBhi5TWa/UA=
-github.com/filecoin-project/go-paramfetch v0.0.2-0.20200701152213-3e0f0afdc261/go.mod h1:fZzmf4tftbwf9S37XRifoJlz7nCjRdIrMGLR07dKLCc=
+github.com/filecoin-project/go-paramfetch v0.0.2-0.20210330140417-936748d3f5ec h1:gExwWUiT1TcARkxGneS4nvp9C+wBsKU0bFdg7qFpNco=
+github.com/filecoin-project/go-paramfetch v0.0.2-0.20210330140417-936748d3f5ec/go.mod h1:fZzmf4tftbwf9S37XRifoJlz7nCjRdIrMGLR07dKLCc=
github.com/filecoin-project/go-state-types v0.0.0-20200903145444-247639ffa6ad/go.mod h1:IQ0MBPnonv35CJHtWSN3YY1Hz2gkPru1Q9qoaYLxx9I=
github.com/filecoin-project/go-state-types v0.0.0-20200904021452-1883f36ca2f4/go.mod h1:IQ0MBPnonv35CJHtWSN3YY1Hz2gkPru1Q9qoaYLxx9I=
github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
@@ -295,27 +312,33 @@ github.com/filecoin-project/go-state-types v0.1.1-0.20210506134452-99b279731c48
github.com/filecoin-project/go-state-types v0.1.1-0.20210506134452-99b279731c48/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe h1:dF8u+LEWeIcTcfUcCf3WFVlc81Fr2JKg8zPzIbBDKDw=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
-github.com/filecoin-project/go-statestore v0.1.0 h1:t56reH59843TwXHkMcwyuayStBIiWBRilQjQ+5IiwdQ=
github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI=
+github.com/filecoin-project/go-statestore v0.1.1 h1:ufMFq00VqnT2CAuDpcGnwLnCX1I/c3OROw/kXVNSTZk=
+github.com/filecoin-project/go-statestore v0.1.1/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI=
github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b h1:fkRZSPrYpk42PV3/lIXiL0LHetxde7vyYYvSsttQtfg=
github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b/go.mod h1:Q0GQOBtKf1oE10eSXSlhN45kDBdGvEcVOqMiffqX+N8=
-github.com/filecoin-project/lotus v1.5.2 h1:JXMTx9HYJ1G/sRPceNs4ZmGtYra5qpD22f3qDr2i0Zc=
-github.com/filecoin-project/lotus v1.5.2/go.mod h1:ogeUSGizrAVxRbETP7Xe2muIXvxSyf+OfIb0kS4q3DQ=
+github.com/filecoin-project/lotus v1.9.1-0.20210602131226-e1dc7ad6eb9e h1:JvtYGk30nM7K0TD4sTOUKYUePcSzZNj5ZD6g5vdrqMI=
+github.com/filecoin-project/lotus v1.9.1-0.20210602131226-e1dc7ad6eb9e/go.mod h1:/ZeMXR8jPxJslaHSIW3ZxO9YPIaxcnsP+niEoBatzo8=
github.com/filecoin-project/specs-actors v0.9.4/go.mod h1:BStZQzx5x7TmCkLv0Bpa07U6cPKol6fd3w9KjMPZ6Z4=
github.com/filecoin-project/specs-actors v0.9.12/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
-github.com/filecoin-project/specs-actors v0.9.13 h1:rUEOQouefi9fuVY/2HOroROJlZbOzWYXXeIh41KF2M4=
github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
+github.com/filecoin-project/specs-actors v0.9.14 h1:68PVstg2UB3ZsMLF+DKFTAs/YKsqhKWynkr0IqmVRQY=
+github.com/filecoin-project/specs-actors v0.9.14/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
github.com/filecoin-project/specs-actors/v2 v2.0.1/go.mod h1:v2NZVYinNIKA9acEMBm5wWXxqv5+frFEbekBFemYghY=
github.com/filecoin-project/specs-actors/v2 v2.3.2/go.mod h1:UuJQLoTx/HPvvWeqlIFmC/ywlOLHNe8SNQ3OunFbu2Y=
-github.com/filecoin-project/specs-actors/v2 v2.3.4/go.mod h1:UuJQLoTx/HPvvWeqlIFmC/ywlOLHNe8SNQ3OunFbu2Y=
-github.com/filecoin-project/specs-actors/v2 v2.3.5-0.20210114162132-5b58b773f4fb h1:orr/sMzrDZUPAveRE+paBdu1kScIUO5zm+HYeh+VlhA=
github.com/filecoin-project/specs-actors/v2 v2.3.5-0.20210114162132-5b58b773f4fb/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc=
-github.com/filecoin-project/specs-actors/v3 v3.0.3/go.mod h1:oMcmEed6B7H/wHabM3RQphTIhq0ibAKsbpYs+bQ/uxQ=
-github.com/filecoin-project/specs-actors/v3 v3.1.0 h1:s4qiPw8pgypqBGAy853u/zdZJ7K9cTZdM1rTiSonHrg=
+github.com/filecoin-project/specs-actors/v2 v2.3.5 h1:PbT4tPlSXZ8sRgajhb4D8AOEmiaaZ+jg6tc6BBv8VQc=
+github.com/filecoin-project/specs-actors/v2 v2.3.5/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc=
github.com/filecoin-project/specs-actors/v3 v3.1.0/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww=
+github.com/filecoin-project/specs-actors/v3 v3.1.1 h1:BE8fsns1GnEOxt1DTE5LxBK2FThXtWmCChgcJoHTg0E=
+github.com/filecoin-project/specs-actors/v3 v3.1.1/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww=
github.com/filecoin-project/specs-actors/v4 v4.0.0/go.mod h1:TkHXf/l7Wyw4ZejyXIPS2rK8bBO0rdwhTZyQQgaglng=
-github.com/filecoin-project/specs-actors/v5 v5.0.0-20210512015452-4fe3889fff57 h1:N6IBsnGXfAMXd677G6EiOKewFwQ7Ulcuupi4U6wYmXE=
+github.com/filecoin-project/specs-actors/v4 v4.0.1 h1:AiWrtvJZ63MHGe6rn7tPu4nSUY8bA1KDNszqJaD5+Fg=
+github.com/filecoin-project/specs-actors/v4 v4.0.1/go.mod h1:TkHXf/l7Wyw4ZejyXIPS2rK8bBO0rdwhTZyQQgaglng=
github.com/filecoin-project/specs-actors/v5 v5.0.0-20210512015452-4fe3889fff57/go.mod h1:283yBMMUSDB2abcjP/hhrwTkhb9h3sfM6KGrep/ZlBI=
+github.com/filecoin-project/specs-actors/v5 v5.0.0-20210528202914-a9f9f95f5e93/go.mod h1:kSDmoQuO8jlhMVzKNoesbhka1e6gHKcLQjKm9mE9Qhw=
+github.com/filecoin-project/specs-actors/v5 v5.0.0-20210602024058-0c296bb386bf h1:xt9A1omyhSDbQvpVk7Na1J15a/n8y0y4GQDLeiWLpFs=
+github.com/filecoin-project/specs-actors/v5 v5.0.0-20210602024058-0c296bb386bf/go.mod h1:b/btpRl84Q9SeDKlyIoORBQwe2OTmq14POrYrVvBWCM=
github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506 h1:Ur/l2+6qN+lQiqjozWWc5p9UDaAMDZKTlDS98oRnlIw=
github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g=
github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E=
@@ -332,6 +355,10 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1 h1:EzDjxMg43q1tA2c0MV3tNbaontnHLplHyFF6M5KiVP0=
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1/go.mod h1:0eHX/BVySxPc6SE2mZRoppGq7qcEagxdmQnA3dzork8=
+github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
+github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
+github.com/gdamore/tcell/v2 v2.2.0 h1:vSyEgKwraXPSOkvCk7IwOSyX+Pv3V2cV9CikJMXg4U4=
+github.com/gdamore/tcell/v2 v2.2.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=
github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
@@ -353,6 +380,17 @@ github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
+github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
+github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
+github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
+github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
+github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg=
+github.com/go-openapi/spec v0.19.7/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk=
+github.com/go-openapi/spec v0.19.11/go.mod h1:vqK/dIdLGCosfvYsQV3WfC7N3TiZSnGY2RZKoFK7X28=
+github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
+github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
+github.com/go-openapi/swag v0.19.8/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
+github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY=
github.com/go-redis/redis/v7 v7.4.0 h1:7obg6wUoj05T0EpY0o8B59S9w5yeMWql7sw2kwNW1x4=
github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
@@ -392,6 +430,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
+github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -512,7 +551,10 @@ github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324/go.mod h1:MZ2ZmwcBpvOo
github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo=
github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc=
github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o=
+github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
+github.com/iancoleman/orderedmap v0.1.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428/go.mod h1:uhpZMVGznybq1itEKXj6RYw9I71qK4kH+OGMjRC4KEo=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY=
github.com/influxdata/influxdb v1.8.3 h1:WEypI1BQFTT4teLM+1qkEcvUi0dAvopAI/ir0vAiBg8=
@@ -597,9 +639,9 @@ github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28
github.com/ipfs/go-graphsync v0.1.0/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE=
github.com/ipfs/go-graphsync v0.4.2/go.mod h1:/VmbZTUdUMTbNkgzAiCEucIIAU3BkLE2cZrDCVUhyi0=
github.com/ipfs/go-graphsync v0.4.3/go.mod h1:mPOwDYv128gf8gxPFgXnz4fNrSYPsWyqisJ7ych+XDY=
-github.com/ipfs/go-graphsync v0.5.2/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk=
-github.com/ipfs/go-graphsync v0.6.0 h1:x6UvDUGA7wjaKNqx5Vbo7FGT8aJ5ryYA0dMQ5jN3dF0=
-github.com/ipfs/go-graphsync v0.6.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk=
+github.com/ipfs/go-graphsync v0.6.1/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk=
+github.com/ipfs/go-graphsync v0.6.2-0.20210428121800-88edb5462e17 h1:rOoF88dVuDGbIx7idSdimN7JvXriyOIT96WD3eX9sHA=
+github.com/ipfs/go-graphsync v0.6.2-0.20210428121800-88edb5462e17/go.mod h1:5WyaeigpNdpiYQuW2vwpuecOoEfB4h747ZGEOKmAGTg=
github.com/ipfs/go-hamt-ipld v0.1.1/go.mod h1:1EZCr2v0jlCnhpa+aZ0JZYp8Tt2w16+JJOAVz17YcDk=
github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08=
github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw=
@@ -673,8 +715,9 @@ github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBW
github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw=
github.com/ipfs/go-log/v2 v2.0.8/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw=
github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM=
-github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4 h1:3bijxqzQ1O9yg7gd7Aqk80oaEvsJ+uXw0zSvi2qR3Jw=
github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM=
+github.com/ipfs/go-log/v2 v2.1.2 h1:a0dRiL098zY23vay1h3dimx6y94XchEUyt5h0l4VvQU=
+github.com/ipfs/go-log/v2 v2.1.2/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM=
github.com/ipfs/go-merkledag v0.0.3/go.mod h1:Oc5kIXLHokkE1hWGMBHw+oxehkAaTOqtEb7Zbh6BhLA=
github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto=
github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk=
@@ -746,6 +789,7 @@ github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.1.1-0.20190114141812-62fb9bc030d1 h1:qBCV/RLV02TSfQa7tFmxTihnG+u+7JXByOkhlkR5rmQ=
github.com/jonboulle/clockwork v0.1.1-0.20190114141812-62fb9bc030d1/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
+github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
@@ -1120,12 +1164,18 @@ github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdf
github.com/lucas-clemente/quic-go v0.16.0/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE=
github.com/lucas-clemente/quic-go v0.18.1 h1:DMR7guC0NtVS8zNZR3IO7NARZvZygkSC56GGtC6cyys=
github.com/lucas-clemente/quic-go v0.18.1/go.mod h1:yXttHsSNxQi8AWijC/vLP+OJczXqzHSOcJrM5ITUlCg=
+github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=
+github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lufia/iostat v1.1.0/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
+github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI=
github.com/marten-seemann/qpack v0.2.0/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc=
github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk=
@@ -1149,8 +1199,9 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
-github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
+github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
+github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
github.com/mattn/go-xmlrpc v0.0.3/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA=
@@ -1264,6 +1315,7 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
+github.com/ngdinhtoan/glide-cleanup v0.2.0/go.mod h1:UQzsmiDOb8YV3nOsCxK/c9zPpCZVNoHScRE3EO9pVMM=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nikkolasg/hexjson v0.0.0-20181101101858-78e39397e00c h1:5bFTChQxSKNwy8ALwOebjekYExl9HTT9urdawqC95tA=
@@ -1293,6 +1345,7 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
+github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333/go.mod h1:Ag6rSXkHIckQmjFBCweJEEt1mrTPBv8b9W4aU/NQWfI=
github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc=
@@ -1387,6 +1440,8 @@ github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqn
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc=
+github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
+github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
@@ -1472,11 +1527,13 @@ github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
+github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
@@ -1489,6 +1546,9 @@ github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cb
github.com/testground/sdk-go v0.2.6 h1:sMwv0/caNNODKfdPigNqmSSIZLcse7pZX6fgrjCGBIs=
github.com/testground/sdk-go v0.2.6/go.mod h1:Q4dnWsUBH+dZ1u7aEGDBHWGUaLfhitjUq3UJQqxeTmk=
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g=
+github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
+github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
+github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tj/go-spin v1.1.0 h1:lhdWZsvImxvZ3q1C5OIB7d72DuOwP4O2NdBg9PyzNds=
github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4=
@@ -1741,13 +1801,15 @@ golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200519113804-d87ec0cfa476/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20201022231255-08b38378de70 h1:Z6x4N9mAi4oF0TbHweCsH618MO6OI6UFgV0FP5n0wBY=
+golang.org/x/net v0.0.0-20201022231255-08b38378de70/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -1838,6 +1900,8 @@ golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M=
+golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1879,6 +1943,7 @@ golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
@@ -2017,8 +2082,9 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
+honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
+honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M=
howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0=
modernc.org/cc v1.0.0 h1:nPibNuDEx6tvYrUAtvDTTw98rx5juGsa5zuDnKwEEQQ=
diff --git a/testplans/lotus-soup/init.go b/testplans/lotus-soup/init.go
index a8d8e7478..c20f5f2b8 100644
--- a/testplans/lotus-soup/init.go
+++ b/testplans/lotus-soup/init.go
@@ -22,6 +22,12 @@ func init() {
_ = log.SetLogLevel("stats", "WARN")
_ = log.SetLogLevel("dht/RtRefreshManager", "ERROR") // noisy
_ = log.SetLogLevel("bitswap", "ERROR") // noisy
+ _ = log.SetLogLevel("badgerbs", "ERROR") // noisy
+ _ = log.SetLogLevel("sub", "ERROR") // noisy
+ _ = log.SetLogLevel("pubsub", "ERROR") // noisy
+ _ = log.SetLogLevel("chain", "ERROR") // noisy
+ _ = log.SetLogLevel("chainstore", "ERROR") // noisy
+ _ = log.SetLogLevel("basichost", "ERROR") // noisy
_ = os.Setenv("BELLMAN_NO_GPU", "1")
@@ -36,7 +42,7 @@ func init() {
// deadline when the challenge is available.
//
// This will auto-scale the proving period.
- policy.SetWPoStChallengeWindow(abi.ChainEpoch(5))
+ // policy.SetWPoStChallengeWindow(abi.ChainEpoch(5)) // commented-out until we enable PoSt faults tests
// Number of epochs between publishing the precommit and when the challenge for interactive PoRep is drawn
// used to ensure it is not predictable by miner.
diff --git a/testplans/lotus-soup/manifest.toml b/testplans/lotus-soup/manifest.toml
index 8cc2f4caf..9f5a57444 100644
--- a/testplans/lotus-soup/manifest.toml
+++ b/testplans/lotus-soup/manifest.toml
@@ -9,8 +9,8 @@ enabled = true
[builders."docker:go"]
enabled = true
-build_base_image = "iptestground/oni-buildbase:v13-lotus"
-runtime_image = "iptestground/oni-runtime:v8-debug"
+build_base_image = "iptestground/oni-buildbase:v15-lotus"
+runtime_image = "iptestground/oni-runtime:v10-debug"
[runners."local:exec"]
enabled = true
@@ -58,6 +58,9 @@ instances = { min = 1, max = 100, default = 5 }
# Fast retrieval
fast_retrieval = { type = "bool", default = false }
+ # Bounce connection during push and pull data transfers
+ bounce_conn_data_transfers = { type = "bool", default = false }
+
[[testcases]]
name = "drand-halting"
diff --git a/testplans/lotus-soup/paych/stress.go b/testplans/lotus-soup/paych/stress.go
index e3f2fb6b7..85246603f 100644
--- a/testplans/lotus-soup/paych/stress.go
+++ b/testplans/lotus-soup/paych/stress.go
@@ -8,6 +8,7 @@ import (
"github.com/ipfs/go-cid"
+ "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/specs-actors/actors/builtin/paych"
@@ -136,7 +137,7 @@ func runSender(ctx context.Context, t *testkit.TestEnvironment, clients []*testk
t.RecordMessage("waiting for payment channel message to appear on chain")
// wait for the channel creation message to appear on chain.
- _, err = cl.FullApi.StateWaitMsg(ctx, channel.WaitSentinel, 2)
+ _, err = cl.FullApi.StateWaitMsg(ctx, channel.WaitSentinel, 2, api.LookbackNoLimit, true)
if err != nil {
return fmt.Errorf("failed while waiting for payment channel creation msg to appear on chain: %w", err)
}
@@ -285,7 +286,7 @@ func runReceiver(t *testkit.TestEnvironment, ctx context.Context, cl *testkit.Lo
time.Sleep(5 * time.Second)
t.RecordMessage("waiting for confirmation of settle message on chain: %s", settleMsgCid)
- _, err = cl.FullApi.StateWaitMsg(ctx, settleMsgCid, 10)
+ _, err = cl.FullApi.StateWaitMsg(ctx, settleMsgCid, 10, api.LookbackNoLimit, true)
if err != nil {
return fmt.Errorf("failed to wait for settle message: %w", err)
}
diff --git a/testplans/lotus-soup/rfwp/chain_state.go b/testplans/lotus-soup/rfwp/chain_state.go
index 676dca03d..90159e924 100644
--- a/testplans/lotus-soup/rfwp/chain_state.go
+++ b/testplans/lotus-soup/rfwp/chain_state.go
@@ -18,6 +18,7 @@ import (
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/chain/types"
@@ -36,7 +37,7 @@ func UpdateChainState(t *testkit.TestEnvironment, m *testkit.LotusMiner) error {
ctx := context.Background()
- tipsetsCh, err := tstats.GetTips(ctx, m.FullApi, abi.ChainEpoch(height), headlag)
+ tipsetsCh, err := tstats.GetTips(ctx, &v0api.WrapperV1Full{FullNode: m.FullApi}, abi.ChainEpoch(height), headlag)
if err != nil {
return err
}
diff --git a/testplans/lotus-soup/rfwp/html_chain_state.go b/testplans/lotus-soup/rfwp/html_chain_state.go
index 4b288b8c5..7a3d56be4 100644
--- a/testplans/lotus-soup/rfwp/html_chain_state.go
+++ b/testplans/lotus-soup/rfwp/html_chain_state.go
@@ -9,6 +9,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/cli"
tstats "github.com/filecoin-project/lotus/tools/stats"
"github.com/ipfs/go-cid"
@@ -21,7 +22,7 @@ func FetchChainState(t *testkit.TestEnvironment, m *testkit.LotusMiner) error {
ctx := context.Background()
api := m.FullApi
- tipsetsCh, err := tstats.GetTips(ctx, m.FullApi, abi.ChainEpoch(height), headlag)
+ tipsetsCh, err := tstats.GetTips(ctx, &v0api.WrapperV1Full{FullNode: m.FullApi}, abi.ChainEpoch(height), headlag)
if err != nil {
return err
}
diff --git a/testplans/lotus-soup/testkit/deals.go b/testplans/lotus-soup/testkit/deals.go
index 0696af8a2..f0910537d 100644
--- a/testplans/lotus-soup/testkit/deals.go
+++ b/testplans/lotus-soup/testkit/deals.go
@@ -8,6 +8,7 @@ import (
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/chain/types"
"github.com/ipfs/go-cid"
@@ -45,7 +46,7 @@ func WaitDealSealed(t *TestEnvironment, ctx context.Context, client api.FullNode
cctx, cancel := context.WithCancel(ctx)
defer cancel()
- tipsetsCh, err := tstats.GetTips(cctx, client, abi.ChainEpoch(height), headlag)
+ tipsetsCh, err := tstats.GetTips(cctx, &v0api.WrapperV1Full{FullNode: client}, abi.ChainEpoch(height), headlag)
if err != nil {
panic(err)
}
diff --git a/testplans/lotus-soup/testkit/net.go b/testplans/lotus-soup/testkit/net.go
index 018813830..d2dbc2ae6 100644
--- a/testplans/lotus-soup/testkit/net.go
+++ b/testplans/lotus-soup/testkit/net.go
@@ -74,6 +74,11 @@ func ApplyNetworkParameters(t *TestEnvironment) {
t.D().RecordPoint("duplicate_packet_correlation", float64(ls.DuplicateCorr))
}
+ if t.IsParamSet("bandwidth") {
+ ls.Bandwidth = t.SizeParam("bandwidth")
+ t.D().RecordPoint("bandwidth_bytes", float64(ls.Bandwidth))
+ }
+
t.NetClient.MustConfigureNetwork(ctx, &network.Config{
Network: "default",
Enable: true,
diff --git a/testplans/lotus-soup/testkit/node.go b/testplans/lotus-soup/testkit/node.go
index 08439bfcb..915f2a1ac 100644
--- a/testplans/lotus-soup/testkit/node.go
+++ b/testplans/lotus-soup/testkit/node.go
@@ -9,6 +9,7 @@ import (
"time"
"github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/chain/beacon"
"github.com/filecoin-project/lotus/chain/wallet"
"github.com/filecoin-project/lotus/metrics"
@@ -245,7 +246,7 @@ func collectStats(t *TestEnvironment, ctx context.Context, api api.FullNode) err
go func() {
time.Sleep(15 * time.Second)
t.RecordMessage("calling tstats.Collect")
- tstats.Collect(context.Background(), api, influx, influxDb, height, headlag)
+ tstats.Collect(context.Background(), &v0api.WrapperV1Full{FullNode: api}, influx, influxDb, height, headlag)
}()
return nil
diff --git a/testplans/lotus-soup/testkit/role_client.go b/testplans/lotus-soup/testkit/role_client.go
index 8db68bddf..9fcd42902 100644
--- a/testplans/lotus-soup/testkit/role_client.go
+++ b/testplans/lotus-soup/testkit/role_client.go
@@ -10,7 +10,6 @@ import (
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/apistruct"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/wallet"
"github.com/filecoin-project/lotus/node"
@@ -157,11 +156,11 @@ func (c *LotusClient) RunDefault() error {
return nil
}
-func startFullNodeAPIServer(t *TestEnvironment, repo repo.Repo, api api.FullNode) (*http.Server, error) {
+func startFullNodeAPIServer(t *TestEnvironment, repo repo.Repo, napi api.FullNode) (*http.Server, error) {
mux := mux.NewRouter()
rpcServer := jsonrpc.NewServer()
- rpcServer.Register("Filecoin", api)
+ rpcServer.Register("Filecoin", napi)
mux.Handle("/rpc/v0", rpcServer)
@@ -176,7 +175,7 @@ func startFullNodeAPIServer(t *TestEnvironment, repo repo.Repo, api api.FullNode
ah := &auth.Handler{
Verify: func(ctx context.Context, token string) ([]auth.Permission, error) {
- return apistruct.AllPermissions, nil
+ return api.AllPermissions, nil
},
Next: mux.ServeHTTP,
}
diff --git a/testplans/lotus-soup/testkit/role_miner.go b/testplans/lotus-soup/testkit/role_miner.go
index 7bd688780..a0248cfdd 100644
--- a/testplans/lotus-soup/testkit/role_miner.go
+++ b/testplans/lotus-soup/testkit/role_miner.go
@@ -17,7 +17,6 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-storedcounter"
"github.com/filecoin-project/lotus/api"
- "github.com/filecoin-project/lotus/api/apistruct"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
genesis_chain "github.com/filecoin-project/lotus/chain/gen/genesis"
@@ -321,7 +320,7 @@ func PrepareMiner(t *TestEnvironment) (*LotusMiner, error) {
}
// print out the admin auth token
- token, err := n.MinerApi.AuthNew(ctx, apistruct.AllPermissions)
+ token, err := n.MinerApi.AuthNew(ctx, api.AllPermissions)
if err != nil {
return nil, err
}
@@ -615,7 +614,7 @@ func startStorageMinerAPIServer(t *TestEnvironment, repo repo.Repo, minerApi api
ah := &auth.Handler{
Verify: func(ctx context.Context, token string) ([]auth.Permission, error) {
- return apistruct.AllPermissions, nil
+ return api.AllPermissions, nil
},
Next: mux.ServeHTTP,
}
diff --git a/tools/stats/collect.go b/tools/stats/collect.go
index 221dc37e2..e33ec994b 100644
--- a/tools/stats/collect.go
+++ b/tools/stats/collect.go
@@ -5,11 +5,11 @@ import (
"time"
"github.com/filecoin-project/go-state-types/abi"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
client "github.com/influxdata/influxdb1-client/v2"
)
-func Collect(ctx context.Context, api api.FullNode, influx client.Client, database string, height int64, headlag int) {
+func Collect(ctx context.Context, api v0api.FullNode, influx client.Client, database string, height int64, headlag int) {
tipsetsCh, err := GetTips(ctx, api, abi.ChainEpoch(height), headlag)
if err != nil {
log.Fatal(err)
diff --git a/tools/stats/metrics.go b/tools/stats/metrics.go
index 795203c40..7764c4bca 100644
--- a/tools/stats/metrics.go
+++ b/tools/stats/metrics.go
@@ -11,7 +11,7 @@ import (
"time"
"github.com/filecoin-project/go-address"
- "github.com/filecoin-project/lotus/api"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
"github.com/filecoin-project/lotus/chain/actors/builtin/reward"
@@ -115,7 +115,7 @@ func NewPointFrom(p models.Point) *client.Point {
return client.NewPointFrom(p)
}
-func RecordTipsetPoints(ctx context.Context, api api.FullNode, pl *PointList, tipset *types.TipSet) error {
+func RecordTipsetPoints(ctx context.Context, api v0api.FullNode, pl *PointList, tipset *types.TipSet) error {
cids := []string{}
for _, cid := range tipset.Cids() {
cids = append(cids, cid.String())
@@ -238,7 +238,7 @@ func (ht *ApiIpldStore) Put(ctx context.Context, v interface{}) (cid.Cid, error)
return cid.Undef, fmt.Errorf("Put is not implemented on ApiIpldStore")
}
-func RecordTipsetStatePoints(ctx context.Context, api api.FullNode, pl *PointList, tipset *types.TipSet) error {
+func RecordTipsetStatePoints(ctx context.Context, api v0api.FullNode, pl *PointList, tipset *types.TipSet) error {
attoFil := types.NewInt(build.FilecoinPrecision).Int
//TODO: StatePledgeCollateral API is not implemented and is commented out - re-enable this block once the API is implemented again.
@@ -299,7 +299,7 @@ type msgTag struct {
exitcode uint8
}
-func RecordTipsetMessagesPoints(ctx context.Context, api api.FullNode, pl *PointList, tipset *types.TipSet) error {
+func RecordTipsetMessagesPoints(ctx context.Context, api v0api.FullNode, pl *PointList, tipset *types.TipSet) error {
cids := tipset.Cids()
if len(cids) == 0 {
return fmt.Errorf("no cids in tipset")
diff --git a/tools/stats/rpc.go b/tools/stats/rpc.go
index b01c07a35..0aa3d141e 100644
--- a/tools/stats/rpc.go
+++ b/tools/stats/rpc.go
@@ -13,6 +13,7 @@ import (
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/client"
+ "github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/chain/types"
@@ -45,7 +46,7 @@ func getAPI(path string) (string, http.Header, error) {
return "ws://" + addr + "/rpc/v0", headers, nil
}
-func WaitForSyncComplete(ctx context.Context, napi api.FullNode) error {
+func WaitForSyncComplete(ctx context.Context, napi v0api.FullNode) error {
sync_complete:
for {
select {
@@ -120,7 +121,7 @@ sync_complete:
}
}
-func GetTips(ctx context.Context, api api.FullNode, lastHeight abi.ChainEpoch, headlag int) (<-chan *types.TipSet, error) {
+func GetTips(ctx context.Context, api v0api.FullNode, lastHeight abi.ChainEpoch, headlag int) (<-chan *types.TipSet, error) {
chmain := make(chan *types.TipSet)
hb := newHeadBuffer(headlag)
@@ -184,7 +185,7 @@ func GetTips(ctx context.Context, api api.FullNode, lastHeight abi.ChainEpoch, h
return chmain, nil
}
-func loadTipsets(ctx context.Context, api api.FullNode, curr *types.TipSet, lowestHeight abi.ChainEpoch) ([]*types.TipSet, error) {
+func loadTipsets(ctx context.Context, api v0api.FullNode, curr *types.TipSet, lowestHeight abi.ChainEpoch) ([]*types.TipSet, error) {
tipsets := []*types.TipSet{}
for {
if curr.Height() == 0 {
@@ -214,11 +215,11 @@ func loadTipsets(ctx context.Context, api api.FullNode, curr *types.TipSet, lowe
return tipsets, nil
}
-func GetFullNodeAPI(ctx context.Context, repo string) (api.FullNode, jsonrpc.ClientCloser, error) {
+func GetFullNodeAPI(ctx context.Context, repo string) (v0api.FullNode, jsonrpc.ClientCloser, error) {
addr, headers, err := getAPI(repo)
if err != nil {
return nil, nil, err
}
- return client.NewFullNodeRPC(ctx, addr, headers)
+ return client.NewFullNodeRPCV0(ctx, addr, headers)
}