upgrading to upstream v1.27.1-rc1

This commit is contained in:
jonathan@vulcanize.io 2024-06-21 18:48:22 +00:00
parent 95c42dc5c4
commit 3b7f71f533
474 changed files with 9796 additions and 62469 deletions

View File

@ -1,6 +1,11 @@
name: Install Go
description: Install Go for Filecoin Lotus
inputs:
working-directory:
description: Specifies the working directory where the command is run.
required: false
runs:
using: composite
steps:
@ -10,6 +15,8 @@ runs:
cache: false
- id: go-mod
uses: ipdxco/unified-github-workflows/.github/actions/read-go-mod@main
with:
working-directory: ${{ inputs.working-directory || github.workspace }}
- uses: actions/setup-go@v5
with:
go-version: ${{ fromJSON(steps.go-mod.outputs.json).Go }}.x

View File

@ -4,7 +4,7 @@ description: Install Yugabyte Database for Filecoin Lotus
runs:
using: composite
steps:
- run: docker run --rm --name yugabyte -d -p 5433:5433 yugabytedb/yugabyte:2.18.0.0-b65 bin/yugabyted start --daemon=false
- run: docker run --rm --name yugabyte -d -p 5433:5433 yugabytedb/yugabyte:2.21.0.1-b1 bin/yugabyted start --daemon=false
shell: bash
- run: |
while true; do

View File

@ -16,7 +16,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions: {}
permissions:
contents: read
jobs:
build:

View File

@ -8,7 +8,8 @@ on:
branches:
- release/*
permissions: {}
permissions:
contents: read
jobs:
release:

View File

@ -16,7 +16,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions: {}
permissions:
contents: read
jobs:
check-docsgen:
@ -43,7 +44,6 @@ jobs:
- uses: ./.github/actions/install-go
- run: make deps lotus
- run: go install golang.org/x/tools/cmd/goimports
- run: go install github.com/hannahhoward/cbor-gen-for
- run: make gen
- run: git diff --exit-code
- run: make docsgen-cli
@ -57,7 +57,7 @@ jobs:
submodules: 'recursive'
- uses: ./.github/actions/install-system-dependencies
- uses: ./.github/actions/install-go
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.2
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
- run: make deps
- run: golangci-lint run -v --timeout 10m --concurrency 4
check-fmt:

View File

@ -10,16 +10,21 @@ on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
ref:
description: The GitHub ref (e.g. refs/tags/v1.0.0) to release
required: false
defaults:
run:
shell: bash
permissions: {}
permissions:
contents: read
jobs:
docker:
name: Docker (${{ matrix.image }} / ${{ matrix.network }}) [publish=${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}]
name: Docker (${{ matrix.image }} / ${{ matrix.network }}) [publish=${{ (inputs.ref || github.ref) == 'refs/heads/master' || startsWith(inputs.ref || github.ref, 'refs/tags/') }}]
runs-on: ubuntu-latest
strategy:
fail-fast: false
@ -35,13 +40,13 @@ jobs:
- image: lotus
network: mainnet
env:
PUBLISH: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
PUBLISH: ${{ github.ref == 'refs/heads/master' || startsWith(inputs.ref || github.ref, 'refs/tags/') }}
steps:
- id: channel
env:
IS_MASTER: ${{ github.ref == 'refs/heads/master' }}
IS_TAG: ${{ startsWith(github.ref, 'refs/tags/') }}
IS_RC: ${{ endsWith(github.ref, '-rc') }}
IS_MASTER: ${{ (inputs.ref || github.ref) == 'refs/heads/master' }}
IS_TAG: ${{ startsWith(inputs.ref || github.ref, 'refs/tags/') }}
IS_RC: ${{ contains(inputs.ref || github.ref, '-rc') }}
IS_SCHEDULED: ${{ github.event_name == 'schedule' }}
run: |
channel=''
@ -58,10 +63,20 @@ jobs:
channel=stable
fi
fi
echo "channel=$channel" | tee -a $GITHUB_ENV
echo "channel=$channel" | tee -a $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
submodules: 'recursive'
ref: ${{ inputs.ref || github.ref }}
- id: git
env:
REF: ${{ inputs.ref || github.ref }}
run: |
ref="${REF#refs/heads/}"
ref="${ref#refs/tags/}"
sha="$(git rev-parse --short HEAD)"
echo "ref=$ref" | tee -a "$GITHUB_OUTPUT"
echo "sha=$sha" | tee -a "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
@ -70,10 +85,9 @@ jobs:
with:
images: filecoin/${{ matrix.image }}
tags: |
type=schedule
type=raw,enable=${{ github.event_name != 'schedule' && steps.channel.outputs.channel != '' }},value=${{ steps.channel.outputs.channel }}
type=ref,event=tag
type=sha,prefix=
type=raw,enable=${{ steps.channel.outputs.channel != '' }},value=${{ steps.channel.outputs.channel }}
type=raw,enable=${{ startsWith(inputs.ref || github.ref, 'refs/tags/') }},value=${{ steps.git.outputs.ref }}
type=raw,value=${{ steps.git.outputs.sha }}
flavor: |
latest=false
suffix=${{ matrix.network != 'mainnet' && format('-{0}', matrix.network) || '' }}

View File

@ -8,12 +8,17 @@ on:
tags:
- v*
workflow_dispatch:
inputs:
ref:
description: The GitHub ref (e.g. refs/tags/v1.0.0) to release
required: false
defaults:
run:
shell: bash
permissions: {}
permissions:
contents: read
jobs:
build:
@ -41,38 +46,57 @@ jobs:
echo "::error title=Unexpected Runner::Expected $OS/$ARCH, got $RUNNER_OS/$RUNNER_ARCH"
exit 1
fi
- uses: actions/checkout@v4
with:
path: actions
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: ./.github/actions/install-system-dependencies
- uses: ./.github/actions/install-go
ref: ${{ inputs.ref || github.ref }}
path: lotus
- uses: ./actions/.github/actions/install-system-dependencies
- uses: ./actions/.github/actions/install-go
with:
working-directory: lotus
- env:
GITHUB_TOKEN: ${{ github.token }}
run: make deps lotus lotus-miner lotus-worker
working-directory: lotus
- if: runner.os == 'macOS'
run: otool -hv lotus
- run: ./scripts/version-check.sh ./lotus
working-directory: lotus
- env:
INPUTS_REF: ${{ inputs.ref }}
run: |
export GITHUB_REF=${INPUTS_REF:-$GITHUB_REF}
../actions/scripts/version-check.sh ./lotus
working-directory: lotus
- uses: actions/upload-artifact@v4
with:
name: lotus-${{ matrix.os }}-${{ matrix.arch }}
path: |
lotus
lotus-miner
lotus-worker
lotus/lotus
lotus/lotus-miner
lotus/lotus-worker
release:
name: Release [publish=${{ startsWith(github.ref, 'refs/tags/') }}]
name: Release [publish=${{ startsWith(inputs.ref || github.ref, 'refs/tags/') }}]
permissions:
# This enables the job to create and/or update GitHub releases
contents: write
runs-on: ubuntu-latest
needs: [build]
env:
PUBLISH: ${{ startsWith(github.ref, 'refs/tags/') }}
PUBLISH: ${{ startsWith(inputs.ref || github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v4
with:
path: actions
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
path: lotus
ref: ${{ inputs.ref || github.ref }}
- uses: actions/download-artifact@v4
with:
name: lotus-Linux-X64
@ -85,7 +109,9 @@ jobs:
with:
name: lotus-macOS-ARM64
path: darwin_arm64
- uses: ./.github/actions/install-go
- uses: ./actions/.github/actions/install-go
with:
working-directory: lotus
- uses: ipfs/download-ipfs-distribution-action@v1
with:
name: kubo
@ -95,11 +121,21 @@ jobs:
distribution: goreleaser-pro
version: latest
args: release --clean --debug ${{ env.PUBLISH == 'false' && '--snapshot' || '' }}
workdir: lotus
env:
GITHUB_TOKEN: ${{ env.PUBLISH == 'true' && github.token || '' }}
GITHUB_TOKEN: ${{ env.PUBLISH == 'true' && secrets.GORELEASER_GITUB_TOKEN || github.token || '' }}
GORELEASER_KEY: ${{ env.PUBLISH == 'true' && secrets.GORELEASER_KEY || '' }}
- run: ./scripts/generate-checksums.sh
- env:
INPUTS_REF: ${{ inputs.ref }}
run: |
export GITHUB_REF=${INPUTS_REF:-$GITHUB_REF}
../actions/scripts/generate-checksums.sh
working-directory: lotus
- if: env.PUBLISH == 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
run: ./scripts/publish-checksums.sh
INPUTS_REF: ${{ inputs.ref }}
run: |
export GITHUB_REF=${INPUTS_REF:-$GITHUB_REF}
../actions/scripts/publish-checksums.sh
working-directory: lotus

View File

@ -17,15 +17,17 @@ on:
- completed
permissions:
actions: read
checks: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.inputs.pull_number || github.event.workflow_run.pull_requests[0].number || 'unknown' }}
group: ${{ github.workflow }}-${{ github.event.inputs.pull_number || github.event.workflow_run.pull_requests[0].number }}
cancel-in-progress: true
jobs:
comment:
if: github.event.inputs.pull_number || github.event.workflow_run.pull_requests[0]
if: github.event.inputs.pull_number || github.event.workflow_run.event == 'pull_request'
uses: ipdxco/sorted-pr-checks/.github/workflows/comment.yml@v1
with:
pull_number: ${{ github.event.inputs.pull_number || github.event.workflow_run.pull_requests[0].number }}

View File

@ -4,7 +4,8 @@ on:
schedule:
- cron: '0 12 * * *'
permissions: {}
permissions:
contents: read
jobs:
stale:

View File

@ -5,7 +5,8 @@ on:
branches:
- master
permissions: {}
permissions:
contents: read
jobs:
sync:

View File

@ -16,7 +16,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions: {}
permissions:
contents: read
jobs:
discover:
@ -96,6 +97,7 @@ jobs:
"itest-get_messages_in_ts": ["self-hosted", "linux", "x64", "xlarge"],
"itest-lite_migration": ["self-hosted", "linux", "x64", "xlarge"],
"itest-lookup_robust_address": ["self-hosted", "linux", "x64", "xlarge"],
"itest-manual_onboarding": ["self-hosted", "linux", "x64", "xlarge"],
"itest-mempool": ["self-hosted", "linux", "x64", "xlarge"],
"itest-mpool_msg_uuid": ["self-hosted", "linux", "x64", "xlarge"],
"itest-mpool_push_with_uuid": ["self-hosted", "linux", "x64", "xlarge"],
@ -115,7 +117,7 @@ jobs:
}
# A list of test groups that require YugabyteDB to be running
yugabytedb: |
["itest-harmonydb", "itest-harmonytask", "itest-curio"]
["itest-harmonydb"]
# A list of test groups that require Proof Parameters to be fetched
parameters: |
[
@ -128,6 +130,7 @@ jobs:
"itest-deals",
"itest-direct_data_onboard_verified",
"itest-direct_data_onboard",
"itest-manual_onboarding",
"itest-net",
"itest-path_detach_redeclare",
"itest-path_type_filters",
@ -144,7 +147,8 @@ jobs:
"itest-worker",
"multicore-sdr",
"unit-cli",
"unit-storage"
"unit-storage",
"itest-curio"
]
run: |
# Create a list of integration test groups
@ -203,7 +207,7 @@ jobs:
echo -e "path<<EOF\n$CACHE_PATH\nEOF" | tee -a $GITHUB_OUTPUT
- id: make_deps
env:
CACHE_KEY: ${{ runner.os }}-${{ runner.arch }}-make-deps-${{ hashFiles('./extern/filecoin-ffi/install-filcrypto') }}-${{ hashFiles('./extern/filecoin-ffi/rust/rustc-target-features-optimized.json') }}
CACHE_KEY: ${{ runner.os }}-${{ runner.arch }}-make-deps-${{ hashFiles('./.git/modules/extern/filecoin-ffi/HEAD') }}
CACHE_PATH: |
./extern/filecoin-ffi/filcrypto.h
./extern/filecoin-ffi/libfilcrypto.a

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
/lotus
/lotus-miner
/lotus-worker
/lotus-provider
/lotus-seed
/lotus-health
/lotus-chainwatch

View File

@ -6,6 +6,145 @@
## Improvements
# v1.27.1 / 2024-06-10
This is the first release candidate of the upcoming optional release of Lotus v1.27.1
## ☢️ Upgrade Warnings ☢️
There are no upgrade warnings for this release candidate.
### JSON-RPC 2.0 Specification Conformance
The JSON-RPC 2.0 specification requires that a `"result"` property be present in the case of no error from an API call. This release ensures that all API calls that return a result have a `"result"` property in the response. This is a behaviour change over Lotus v1.26 and will impact any API call that only has a single error return value, where no error has occurred.
For example, a successful `WalletSetDefault` in v1.26 would return:
```json
{
"jsonrpc": "2.0",
"id": 1
}
```
As of this change, in conformance with the JSON-RPC 2.0 specification it will return:
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}
```
There is no change in the behaviour when a call returns an error, as the error object will still be present in the response.
## New features
- feat: Add trace transaction API supporting RPC method `trace_transaction` ([filecoin-project/lotus#12068](https://github.com/filecoin-project/lotus/pull/12068))
- feat: Skeleton for nv23 (#11964) ([filecoin-project/lotus#11964](https://github.com/filecoin-project/lotus/pull/11964))
- feat: state: Ignore market balance after nv23 (#11976) ([filecoin-project/lotus#11976](https://github.com/filecoin-project/lotus/pull/11976))
- feat: ETH compatibility in Filecoin : Support Homestead and EIP-155 Ethereum transactions("legacy" transactions) in Filecoin after NV23 (#11969) ([filecoin-project/lotus#11969](https://github.com/filecoin-project/lotus/pull/11969))
- fix: hello: avoid dialing when fetching hello tipset (#12032) ([filecoin-project/lotus#12032](https://github.com/filecoin-project/lotus/pull/12032))
- feat: cli,events: speed up backfill with temporary index (#11953) ([filecoin-project/lotus#11953](https://github.com/filecoin-project/lotus/pull/11953))
## Improvements
- Event index should be unique for tipsets (#11952) ([filecoin-project/lotus#11952](https://github.com/filecoin-project/lotus/pull/11952))
- cleanup: Lotus client: Remove markets and deal-making from Lotus Client (#11999) ([filecoin-project/lotus#11999](https://github.com/filecoin-project/lotus/pull/11999))
- fix: ci: use filecoin-ffi hash to cache make deps outputs (#11961) ([filecoin-project/lotus#11961](https://github.com/filecoin-project/lotus/pull/11961))
- add ETH addrs API to Gateway (#11979) ([filecoin-project/lotus#11979](https://github.com/filecoin-project/lotus/pull/11979))
- chore: remove unmaintained bootstrappers (#11983) ([filecoin-project/lotus#11983](https://github.com/filecoin-project/lotus/pull/11983))
- feat: api: add SectorNumber to MarketDealState (nv22)
- fix: copy Flags field from SectorOnChainInfo
## Dependencies
- chore: libp2p: update to v0.34.1 (#12027) ([filecoin-project/lotus#12027](https://github.com/filecoin-project/lotus/pull/12027))
- chore: update drand (#12021) ([filecoin-project/lotus#12021](https://github.com/filecoin-project/lotus/pull/12021))
- Bump pubsub-dep (#11966) ([filecoin-project/lotus#11966](https://github.com/filecoin-project/lotus/pull/11966))
- fix: update go-jsonrpc to v0.3.2
- Bump go-jsonrpc to v0.4.0 (#12034) ([filecoin-project/lotus#12034](https://github.com/filecoin-project/lotus/pull/12034))
- docs: rpc: document go-jsonrpc behaviour change
- chore: update go-data-transfer and go-graphsync
- github.com/filecoin-project/go-jsonrpc (v0.3.1 -> v0.3.2)
- github.com/filecoin-project/go-state-types (v0.13.3 -> v0.14.0-dev)
## Lotus-Miner / Curio related changes
- fix logs (#12036) ([filecoin-project/lotus#12036](https://github.com/filecoin-project/lotus/pull/12036))
- feat: curioweb: Improve task_history indexes (#11911) ([filecoin-project/lotus#11911](https://github.com/filecoin-project/lotus/pull/11911))
- fix: curio taskstorage: Don't try to free reservations by nulled TaskID (#12018) ([filecoin-project/lotus#12018](https://github.com/filecoin-project/lotus/pull/12018))
- fix actor string (#12019) ([filecoin-project/lotus#12019](https://github.com/filecoin-project/lotus/pull/12019))
- fix: curio: Update pgx imports, fix db_storage alloc
- feat: curioweb: Show piece info on the sector page (#11955) ([filecoin-project/lotus#11955](https://github.com/filecoin-project/lotus/pull/11955))
- curio: feat: break trees task into TreeD(prefetch) and TreeRC (#11895) ([filecoin-project/lotus#11895](https://github.com/filecoin-project/lotus/pull/11895))
- fix: curio: node UI & darwin gpu count (#11950) ([filecoin-project/lotus#11950](https://github.com/filecoin-project/lotus/pull/11950))
- feat: curio: Keep more sector metadata in the DB long-term (#11933) ([filecoin-project/lotus#11933](https://github.com/filecoin-project/lotus/pull/11933))
- fix: curio/lmrpc: Check ParkPiece success before creating sectors (#11975) ([filecoin-project/lotus#11975](https://github.com/filecoin-project/lotus/pull/11975))
- feat: curio: docker devnet (#11954) ([filecoin-project/lotus#11954](https://github.com/filecoin-project/lotus/pull/11954))
- feat: curio: alertManager (#11926) ([filecoin-project/lotus#11926](https://github.com/filecoin-project/lotus/pull/11926))
- curio cfg edit: ux cleanups (#11985) ([filecoin-project/lotus#11985](https://github.com/filecoin-project/lotus/pull/11985))
- fix: curio: Drop FKs from pipeline to fix retry loops (#11973) ([filecoin-project/lotus#11973](https://github.com/filecoin-project/lotus/pull/11973))
- Produce DEB files for amd64 for openCL and cuda (#11885) ([filecoin-project/lotus#11885](https://github.com/filecoin-project/lotus/pull/11885))
- gui-listen fix (#12013) ([filecoin-project/lotus#12013](https://github.com/filecoin-project/lotus/pull/12013))
- feat: curio: allow multiple pieces per sector (#11935) ([filecoin-project/lotus#11935](https://github.com/filecoin-project/lotus/pull/11935))
- chore: update yugabyte deps (#12022) ([filecoin-project/lotus#12022](https://github.com/filecoin-project/lotus/pull/12022))
- fix: harmonydb: Use timestampz instead of timestamp across the schema (#12030) ([filecoin-project/lotus#12030](https://github.com/filecoin-project/lotus/pull/12030))
- cleanup: miner: remove markets and deal-making from Lotus Miner (#12005) ([filecoin-project/lotus#12005](https://github.com/filecoin-project/lotus/pull/12005))
- fix non existing sector (#12012) ([filecoin-project/lotus#12012](https://github.com/filecoin-project/lotus/pull/12012))
- feat: curio ffiselect: Isolate gpu calls in a subprocess (#11994) ([filecoin-project/lotus#11994](https://github.com/filecoin-project/lotus/pull/11994))
- feat: curio: jsonrpc in webui (#11904) ([filecoin-project/lotus#11904](https://github.com/filecoin-project/lotus/pull/11904))
- fix: itests: Fix flaky curio itest (#12037) ([filecoin-project/lotus#12037](https://github.com/filecoin-project/lotus/pull/12037))
- feat: curio: wdPost and wnPost alerts (#12029) ([filecoin-project/lotus#12029](https://github.com/filecoin-project/lotus/pull/12029))
- fix: storage: Fix a race in GenerateWindowPoStAdv (#12064) ([filecoin-project/lotus#12064](https://github.com/filecoin-project/lotus/pull/12064))
- Remove "provider" relics (#11992) ([filecoin-project/lotus#11992](https://github.com/filecoin-project/lotus/pull/11992))
- fix sector UI (#12016) ([filecoin-project/lotus#12016](https://github.com/filecoin-project/lotus/pull/12016))
## Others
- ci: deprecate circle ci in favour of github actions (#11786) ([filecoin-project/lotus#11786](https://github.com/filecoin-project/lotus/pull/11786))
- src: chain: remove C dependency from builtin types (#12015) ([filecoin-project/lotus#12015](https://github.com/filecoin-project/lotus/pull/12015))
- chore: fix function names (#12043) ([filecoin-project/lotus#12043](https://github.com/filecoin-project/lotus/pull/12043))
- chore: bump build version in master (#11946) ([filecoin-project/lotus#11946](https://github.com/filecoin-project/lotus/pull/11946))
- fix: test: no snap deals in immutable deadlines (#12071) ([filecoin-project/lotus#12071](https://github.com/filecoin-project/lotus/pull/12071))
- test: actors: manual CC onboarding and proving integration test (#12017) ([filecoin-project/lotus#12017](https://github.com/filecoin-project/lotus/pull/12017))
- fix: ci: keep lotus checkout clean in the release workflow (#12028) ([filecoin-project/lotus#12028](https://github.com/filecoin-project/lotus/pull/12028))
- feat!: build: separate miner and node version strings
- chore: lint: address feedback from reviews
- chore: lint: fix lint errors with new linting config
- chore: lint: update golangci lint config
- ci: fix when sorted pr checks workflow is executed
- doc: eth: restore comment lost in linter cleanup
- fix: ci: publish correct docker tags on workflow dispatch (#12060) ([filecoin-project/lotus#12060](https://github.com/filecoin-project/lotus/pull/12060))
- feat: libp2p: Lotus stream cleanup (#11993) ([filecoin-project/lotus#11993](https://github.com/filecoin-project/lotus/pull/11993))
- Update SupportedProofTypes (#11988) ([filecoin-project/lotus#11988](https://github.com/filecoin-project/lotus/pull/11988))
- Revert "Update SupportedProofTypes (#11988)" (#11990) ([filecoin-project/lotus#11990](https://github.com/filecoin-project/lotus/pull/11990))
- chore: docs: Update skeleton guide (#11960) ([filecoin-project/lotus#11960](https://github.com/filecoin-project/lotus/pull/11960))
- chore: ci: request contents read permissions explicitly in gha (#12055) ([filecoin-project/lotus#12055](https://github.com/filecoin-project/lotus/pull/12055))
- fix: ci: use custom GITHUB_TOKEN for GoReleaser (#12059) ([filecoin-project/lotus#12059](https://github.com/filecoin-project/lotus/pull/12059))
- chore: pin golanglint-ci to v1.58.2 (#12054) ([filecoin-project/lotus#12054](https://github.com/filecoin-project/lotus/pull/12054))
- chore: fix some function names (#12031) ([filecoin-project/lotus#12031](https://github.com/filecoin-project/lotus/pull/12031))
- src: lint: bump golangci-lint to 1.59, address unchecked fmt.Fprint*
## Contributors
| Contributor | Commits | Lines ± | Files Changed |
|-------------|---------|---------|---------------|
| Aarsh Shah | 9 | +5710/-35899 | 201 |
| Łukasz Magiera | 21 | +1891/-33776 | 335 |
| LexLuthr | 9 | +4916/-1637 | 107 |
| Phi-rjan | 9 | +3544/-187 | 92 |
| Rod Vagg | 15 | +2183/-479 | 164 |
| Piotr Galar | 6 | +130/-2386 | 30 |
| Andrew Jackson (Ajax) | 6 | +1072/-533 | 63 |
| ZenGround0 | 1 | +235/-13 | 3 |
| Hubert Bugaj | 3 | +57/-37 | 5 |
| Steven Allen | 3 | +25/-15 | 6 |
| Peter Rabbitson | 1 | +16/-8 | 4 |
| tomfees | 1 | +6/-6 | 5 |
| imxyb | 1 | +6/-0 | 1 |
| yumeiyin | 1 | +2/-2 | 2 |
| galargh | 1 | +2/-2 | 1 |
# v1.27.0 / 2024-05-27
This is an optional feature release of Lotus. Lotus v1.27.0 includes numerous improvements, bugfixes and enhancements for node operators, RPC- and ETH RPC-providers. This feature release also introduces Curio in a Beta release. Check out the Curio Beta release section for how you can get started with Curio.
@ -25,7 +164,6 @@ This release includes a lot of improvements and fixes for indexers, RPC- and ETH
- [Length check the array sent to eth_feeHistory RPC](https://github.com/filecoin-project/lotus/pull/11696)
- [ETH subscribe tipsets API should only return tipsets that have been executed](https://github.com/filecoin-project/lotus/pull/11858)
- [Adjust indexes in event index db to match query patterns](https://github.com/filecoin-project/lotus/pull/111934)
-
## ⭐️ Curio Beta Release ⭐️
@ -147,7 +285,6 @@ Visit the Curio Official Website insert link
- github.com/libp2p/go-libp2p-pubsub (v0.10.0 -> v0.10.1)
- github.com/libp2p/go-libp2p (v0.33.2 -> v0.34.1)
## Others
- ci: ci: create gh workflow that runs go checks (#11761) ([filecoin-project/lotus#11761](https://github.com/filecoin-project/lotus/pull/11761))
@ -172,6 +309,7 @@ Visit the Curio Official Website insert link
- chore: Add v13 support to invariants-checker (#11931) ([filecoin-project/lotus#11931](https://github.com/filecoin-project/lotus/pull/11931))
- chore: remove unmaintained bootstrappers (#11983) ([filecoin-project/lotus#11983](https://github.com/filecoin-project/lotus/pull/11983))
- chore: go mod: revert go version change as it breaks Docker build (#12050) ([filecoin-project/lotus#12050](https://github.com/filecoin-project/lotus/pull/12050))
- chore: pin golanglint-ci to v1.58.2 ([filecoin-project/lotus#12054](https://github.com/filecoin-project/lotus/pull/12054))
## Contributors

View File

@ -109,7 +109,6 @@ COPY --from=lotus-builder /opt/filecoin/lotus-wallet /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-gateway /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-miner /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-worker /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/curio /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-stats /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-fountain /usr/local/bin/
@ -118,13 +117,11 @@ RUN mkdir /var/lib/lotus
RUN mkdir /var/lib/lotus-miner
RUN mkdir /var/lib/lotus-worker
RUN mkdir /var/lib/lotus-wallet
RUN mkdir /var/lib/curio
RUN chown fc: /var/tmp/filecoin-proof-parameters
RUN chown fc: /var/lib/lotus
RUN chown fc: /var/lib/lotus-miner
RUN chown fc: /var/lib/lotus-worker
RUN chown fc: /var/lib/lotus-wallet
RUN chown fc: /var/lib/curio
VOLUME /var/tmp/filecoin-proof-parameters
@ -132,7 +129,6 @@ VOLUME /var/lib/lotus
VOLUME /var/lib/lotus-miner
VOLUME /var/lib/lotus-worker
VOLUME /var/lib/lotus-wallet
VOLUME /var/lib/curio
EXPOSE 1234
EXPOSE 2345

View File

@ -66,7 +66,7 @@ CLEAN+=build/.update-modules
deps: $(BUILD_DEPS)
.PHONY: deps
build-devnets: build lotus-seed lotus-shed curio sptool
build-devnets: build lotus-seed lotus-shed
.PHONY: build-devnets
debug: GOFLAGS+=-tags=debug
@ -97,21 +97,6 @@ lotus-miner: $(BUILD_DEPS)
.PHONY: lotus-miner
BINS+=lotus-miner
curio: $(BUILD_DEPS)
rm -f curio
$(GOCC) build $(GOFLAGS) -o curio ./cmd/curio
.PHONY: curio
BINS+=curio
cu2k: GOFLAGS+=-tags=2k
cu2k: curio
sptool: $(BUILD_DEPS)
rm -f sptool
$(GOCC) build $(GOFLAGS) -o sptool ./cmd/sptool
.PHONY: sptool
BINS+=sptool
lotus-worker: $(BUILD_DEPS)
rm -f lotus-worker
$(GOCC) build $(GOFLAGS) -o lotus-worker ./cmd/lotus-worker
@ -130,13 +115,13 @@ lotus-gateway: $(BUILD_DEPS)
.PHONY: lotus-gateway
BINS+=lotus-gateway
build: lotus lotus-miner lotus-worker curio sptool
build: lotus lotus-miner lotus-worker
@[[ $$(type -P "lotus") ]] && echo "Caution: you have \
an existing lotus binary in your PATH. This may cause problems if you don't run 'sudo make install'" || true
.PHONY: build
install: install-daemon install-miner install-worker install-curio install-sptool
install: install-daemon install-miner install-worker
install-daemon:
install -C ./lotus /usr/local/bin/lotus
@ -144,12 +129,6 @@ install-daemon:
install-miner:
install -C ./lotus-miner /usr/local/bin/lotus-miner
install-curio:
install -C ./curio /usr/local/bin/curio
install-sptool:
install -C ./sptool /usr/local/bin/sptool
install-worker:
install -C ./lotus-worker /usr/local/bin/lotus-worker
@ -165,12 +144,6 @@ uninstall-daemon:
uninstall-miner:
rm -f /usr/local/bin/lotus-miner
uninstall-curio:
rm -f /usr/local/bin/curio
uninstall-sptool:
rm -f /usr/local/bin/sptool
uninstall-worker:
rm -f /usr/local/bin/lotus-worker
@ -272,14 +245,6 @@ install-miner-service: install-miner install-daemon-service
@echo "To start the service, run: 'sudo systemctl start lotus-miner'"
@echo "To enable the service on startup, run: 'sudo systemctl enable lotus-miner'"
install-curio-service: install-curio install-sptool install-daemon-service
mkdir -p /etc/systemd/system
mkdir -p /var/log/lotus
install -C -m 0644 ./scripts/curio.service /etc/systemd/system/curio.service
systemctl daemon-reload
@echo
@echo "Curio service installed. Don't forget to run 'sudo systemctl start curio' to start it and 'sudo systemctl enable curio' for it to be enabled on startup."
install-main-services: install-miner-service
install-all-services: install-main-services
@ -298,12 +263,6 @@ clean-miner-service:
rm -f /etc/systemd/system/lotus-miner.service
systemctl daemon-reload
clean-curio-service:
-systemctl stop curio
-systemctl disable curio
rm -f /etc/systemd/system/curio.service
systemctl daemon-reload
clean-main-services: clean-daemon-service
clean-all-services: clean-main-services
@ -378,7 +337,7 @@ docsgen-md-bin: api-gen actors-gen
docsgen-openrpc-bin: api-gen actors-gen
$(GOCC) build $(GOFLAGS) -o docgen-openrpc ./api/docgen-openrpc/cmd
docsgen-md: docsgen-md-full docsgen-md-storage docsgen-md-worker docsgen-md-curio
docsgen-md: docsgen-md-full docsgen-md-storage docsgen-md-worker
docsgen-md-full: docsgen-md-bin
./docgen-md "api/api_full.go" "FullNode" "api" "./api" > documentation/en/api-v1-unstable-methods.md
@ -387,8 +346,6 @@ docsgen-md-storage: docsgen-md-bin
./docgen-md "api/api_storage.go" "StorageMiner" "api" "./api" > documentation/en/api-v0-methods-miner.md
docsgen-md-worker: docsgen-md-bin
./docgen-md "api/api_worker.go" "Worker" "api" "./api" > documentation/en/api-v0-methods-worker.md
docsgen-md-curio: docsgen-md-bin
./docgen-md "api/api_curio.go" "Curio" "api" "./api" > documentation/en/api-v0-methods-curio.md
docsgen-openrpc: docsgen-openrpc-full docsgen-openrpc-storage docsgen-openrpc-worker docsgen-openrpc-gateway
@ -413,47 +370,17 @@ gen: actors-code-gen type-gen cfgdoc-gen docsgen api-gen
jen: gen
snap: lotus lotus-miner lotus-worker curio sptool
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 curio sptool
docsgen-cli: lotus lotus-miner lotus-worker
python3 ./scripts/generate-lotus-cli.py
./lotus config default > documentation/en/default-lotus-config.toml
./lotus-miner config default > documentation/en/default-lotus-miner-config.toml
./curio config default > documentation/en/default-curio-config.toml
.PHONY: docsgen-cli
print-%:
@echo $*=$($*)
### Curio devnet images
curio_docker_user?=curio
curio_base_image=$(curio_docker_user)/curio-all-in-one:latest-debug
ffi_from_source?=0
curio-devnet: lotus lotus-miner lotus-shed lotus-seed curio sptool
.PHONY: curio-devnet
curio_docker_build_cmd=docker build --build-arg CURIO_TEST_IMAGE=$(curio_base_image) \
--build-arg FFI_BUILD_FROM_SOURCE=$(ffi_from_source) $(docker_args)
docker/curio-all-in-one:
$(curio_docker_build_cmd) -f Dockerfile.curio --target curio-all-in-one \
-t $(curio_base_image) --build-arg GOFLAGS=-tags=debug .
.PHONY: docker/curio-all-in-one
docker/%:
cd curiosrc/docker/$* && DOCKER_BUILDKIT=1 $(curio_docker_build_cmd) -t $(curio_docker_user)/$*-dev:dev \
--build-arg BUILD_VERSION=dev .
docker/curio-devnet: $(lotus_build_cmd) \
docker/curio-all-in-one docker/lotus docker/lotus-miner docker/curio docker/yugabyte
.PHONY: docker/curio-devnet
curio-devnet/up:
rm -rf ./curiosrc/docker/data && docker compose -f ./curiosrc/docker/docker-compose.yaml up -d
curio-devnet/down:
docker compose -f ./curiosrc/docker/docker-compose.yaml down --rmi=local && sleep 2 && rm -rf ./curiosrc/docker/data

View File

@ -1,34 +0,0 @@
package api
import (
"context"
"net/http"
"net/url"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)
type Curio interface {
Version(context.Context) (Version, error) //perm:admin
AllocatePieceToSector(ctx context.Context, maddr address.Address, piece PieceDealInfo, rawSize int64, source url.URL, header http.Header) (SectorOffset, error) //perm:write
StorageInit(ctx context.Context, path string, opts storiface.LocalStorageMeta) error //perm:admin
StorageAddLocal(ctx context.Context, path string) error //perm:admin
StorageDetachLocal(ctx context.Context, path string) error //perm:admin
StorageList(ctx context.Context) (map[storiface.ID][]storiface.Decl, error) //perm:admin
StorageLocal(ctx context.Context) (map[storiface.ID]string, error) //perm:admin
StorageStat(ctx context.Context, id storiface.ID) (fsutil.FsStat, error) //perm:admin
StorageInfo(context.Context, storiface.ID) (storiface.StorageInfo, error) //perm:admin
StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]storiface.SectorStorageInfo, error) //perm:admin
LogList(ctx context.Context) ([]string, error) //perm:read
LogSetLevel(ctx context.Context, subsystem, level string) error //perm:admin
// Trigger shutdown
Shutdown(context.Context) error //perm:admin
}

View File

@ -9,13 +9,9 @@ import (
"github.com/google/uuid"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer/v2"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
@ -34,7 +30,6 @@ import (
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/types/ethtypes"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/repo/imports"
)
//go:generate go run github.com/golang/mock/mockgen -destination=mocks/mock_full.go -package=mocks . FullNode
@ -348,74 +343,6 @@ type FullNode interface {
// 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 FileRef) (*ImportRes, error) //perm:admin
// ClientRemoveImport removes file import
ClientRemoveImport(ctx context.Context, importID imports.ID) 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.
ClientListDeals(ctx context.Context) ([]DealInfo, error) //perm:write
// ClientGetDealUpdates returns the status of updated deals
ClientGetDealUpdates(ctx context.Context) (<-chan 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) ([]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) (QueryOffer, error) //perm:read
// ClientRetrieve initiates the retrieval of a file, as specified in the order.
ClientRetrieve(ctx context.Context, params RetrievalOrder) (*RestrievalRes, error) //perm:admin
// ClientRetrieveWait waits for retrieval to be complete
ClientRetrieveWait(ctx context.Context, deal retrievalmarket.DealID) error //perm:admin
// ClientExport exports a file stored in the local filestore to a system file
ClientExport(ctx context.Context, exportRef ExportRef, fileRef FileRef) 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) (*StorageAsk, error) //perm:read
// ClientCalcCommP calculates the CommP and data size of the specified CID
ClientDealPieceCID(ctx context.Context, root cid.Cid) (DataCIDSize, error) //perm:read
// ClientCalcCommP calculates the CommP for a specified file
ClientCalcCommP(ctx context.Context, inpath string) (*CommPRet, error) //perm:write
// ClientGenCar generates a CAR file for the specified file.
ClientGenCar(ctx context.Context, ref FileRef, outpath string) error //perm:write
// ClientDealSize calculates real deal data size
ClientDealSize(ctx context.Context, root cid.Cid) (DataSize, error) //perm:read
// ClientListTransfers returns the status of all ongoing transfers of data
ClientListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) //perm:write
ClientDataTransferUpdates(ctx context.Context) (<-chan 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) ([]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.
@ -898,6 +825,9 @@ type FullNode interface {
// Replays all transactions in a block returning the requested traces for each transaction
EthTraceReplayBlockTransactions(ctx context.Context, blkNum string, traceTypes []string) ([]*ethtypes.EthTraceReplayBlockTransaction, error) //perm:read
// Implmements OpenEthereum-compatible API method trace_transaction
EthTraceTransaction(ctx context.Context, txHash string) ([]*ethtypes.EthTraceTransaction, 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
@ -938,17 +868,6 @@ type EthSubscriber interface {
EthSubscription(ctx context.Context, r jsonrpc.RawParams) error // rpc_method:eth_subscription notify:true
}
type StorageAsk struct {
Response *storagemarket.StorageAsk
DealProtocols []string
}
type FileRef struct {
Path string
IsCAR bool
}
type MinerSectors struct {
// Live sectors that should be proven.
Live uint64
@ -958,55 +877,6 @@ type MinerSectors struct {
Faulty uint64
}
type ImportRes struct {
Root cid.Cid
ImportID imports.ID
}
type Import struct {
Key imports.ID
Err string
Root *cid.Cid
// Source is the provenance of the import, e.g. "import", "unknown", else.
// Currently useless but may be used in the future.
Source string
// FilePath is the path of the original file. It is important that the file
// is retained at this path, because it will be referenced during
// the transfer (when we do the UnixFS chunking, we don't duplicate the
// leaves, but rather point to chunks of the original data through
// positional references).
FilePath string
// CARPath is the path of the CAR file containing the DAG for this import.
CARPath string
}
type DealInfo struct {
ProposalCid cid.Cid
State storagemarket.StorageDealStatus
Message string // more information about deal state, particularly errors
DealStages *storagemarket.DealStages
Provider address.Address
DataRef *storagemarket.DataRef
PieceCID cid.Cid
Size uint64
PricePerEpoch types.BigInt
Duration uint64
DealID abi.DealID
CreationTime time.Time
Verified bool
TransferChannelID *datatransfer.ChannelID
DataTransfer *DataTransferChannel
}
type MsgLookup struct {
Message cid.Cid // Can be different than requested, in case it was replaced, but only gas values changed
Receipt types.MessageReceipt
@ -1128,51 +998,21 @@ type MinerPower struct {
HasMinPower bool
}
type QueryOffer struct {
Err string
Root cid.Cid
Piece *cid.Cid
Size uint64
MinPrice types.BigInt
UnsealPrice types.BigInt
PricePerByte abi.TokenAmount
PaymentInterval uint64
PaymentIntervalIncrease uint64
Miner address.Address
MinerPeer retrievalmarket.RetrievalPeer
}
func (o *QueryOffer) Order(client address.Address) RetrievalOrder {
return RetrievalOrder{
Root: o.Root,
Piece: o.Piece,
Size: o.Size,
Total: o.MinPrice,
UnsealPrice: o.UnsealPrice,
PaymentInterval: o.PaymentInterval,
PaymentIntervalIncrease: o.PaymentIntervalIncrease,
Client: client,
Miner: o.Miner,
MinerPeer: &o.MinerPeer,
}
}
type MarketBalance struct {
Escrow big.Int
Locked big.Int
}
type MarketDealState struct {
SectorStartEpoch abi.ChainEpoch // -1 if not yet included in proven sector
LastUpdatedEpoch abi.ChainEpoch // -1 if deal state never updated
SlashEpoch abi.ChainEpoch // -1 if deal never slashed
SectorNumber abi.SectorNumber // 0 if not yet included in proven sector (0 is also a valid sector number).
SectorStartEpoch abi.ChainEpoch // -1 if not yet included in proven sector
LastUpdatedEpoch abi.ChainEpoch // -1 if deal state never updated
SlashEpoch abi.ChainEpoch // -1 if deal never slashed
}
func MakeDealState(mds market.DealState) MarketDealState {
return MarketDealState{
SectorNumber: mds.SectorNumber(),
SectorStartEpoch: mds.SectorStartEpoch(),
LastUpdatedEpoch: mds.LastUpdatedEpoch(),
SlashEpoch: mds.SlashEpoch(),
@ -1183,6 +1023,10 @@ type mstate struct {
s MarketDealState
}
func (m mstate) SectorNumber() abi.SectorNumber {
return m.s.SectorNumber
}
func (m mstate) SectorStartEpoch() abi.ChainEpoch {
return m.s.SectorStartEpoch
}
@ -1208,25 +1052,6 @@ type MarketDeal struct {
State MarketDealState
}
type RetrievalOrder struct {
Root cid.Cid
Piece *cid.Cid
DataSelector *Selector
// todo: Size/Total are only used for calculating price per byte; we should let users just pass that
Size uint64
Total types.BigInt
UnsealPrice types.BigInt
PaymentInterval uint64
PaymentIntervalIncrease uint64
Client address.Address
Miner address.Address
MinerPeer *retrievalmarket.RetrievalPeer
RemoteStore *RemoteStoreID `json:"RemoteStore,omitempty"`
}
type RemoteStoreID = uuid.UUID
type InvocResult struct {
@ -1244,34 +1069,6 @@ type MethodCall struct {
Error string
}
type StartDealParams struct {
Data *storagemarket.DataRef
Wallet address.Address
Miner address.Address
EpochPrice types.BigInt
MinBlocksDuration uint64
ProviderCollateral big.Int
DealStartEpoch abi.ChainEpoch
FastRetrieval bool
VerifiedDeal bool
}
func (s *StartDealParams) UnmarshalJSON(raw []byte) (err error) {
type sdpAlias StartDealParams
sdp := sdpAlias{
FastRetrieval: true,
}
if err := json.Unmarshal(raw, &sdp); err != nil {
return err
}
*s = StartDealParams(sdp)
return nil
}
type IpldObject struct {
Cid cid.Cid
Obj interface{}

View File

@ -132,6 +132,7 @@ type Gateway interface {
Web3ClientVersion(ctx context.Context) (string, error)
EthTraceBlock(ctx context.Context, blkNum string) ([]*ethtypes.EthTraceBlock, error)
EthTraceReplayBlockTransactions(ctx context.Context, blkNum string, traceTypes []string) ([]*ethtypes.EthTraceReplayBlockTransaction, error)
EthTraceTransaction(ctx context.Context, txHash string) ([]*ethtypes.EthTraceTransaction, error)
GetActorEventsRaw(ctx context.Context, filter *types.ActorEventFilter) ([]*types.ActorEvent, error)
SubscribeActorEventsRaw(ctx context.Context, filter *types.ActorEventFilter) (<-chan *types.ActorEvent, error)

View File

@ -7,14 +7,9 @@ import (
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer/v2"
"github.com/filecoin-project/go-fil-markets/piecestore"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
@ -215,110 +210,12 @@ type StorageMiner interface {
StorageDetachLocal(ctx context.Context, path string) error //perm:admin
StorageRedeclareLocal(ctx context.Context, id *storiface.ID, dropMissing bool) error //perm:admin
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:write
MarketListDeals(ctx context.Context) ([]*MarketDeal, error) //perm:read
// MarketListRetrievalDeals is deprecated, returns empty list
MarketListRetrievalDeals(ctx context.Context) ([]struct{}, error) //perm:read
MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) //perm:read
MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error) //perm:read
MarketSetAsk(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error //perm:admin
MarketGetAsk(ctx context.Context) (*storagemarket.SignedStorageAsk, error) //perm:read
MarketSetRetrievalAsk(ctx context.Context, rask *retrievalmarket.Ask) error //perm:admin
MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error) //perm:read
MarketListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) //perm:write
MarketDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) //perm:write
// MarketDataTransferDiagnostics generates debugging information about current data transfers over graphsync
MarketDataTransferDiagnostics(ctx context.Context, p peer.ID) (*TransferDiagnostics, error) //perm:write
// MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer
MarketRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
// MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer
MarketCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
MarketPendingDeals(ctx context.Context) (PendingDealInfo, error) //perm:write
MarketPublishPendingDeals(ctx context.Context) error //perm:admin
MarketRetryPublishDeal(ctx context.Context, propcid cid.Cid) error //perm:admin
// DagstoreListShards returns information about all shards known to the
// DAG store. Only available on nodes running the markets subsystem.
DagstoreListShards(ctx context.Context) ([]DagstoreShardInfo, error) //perm:read
// DagstoreInitializeShard initializes an uninitialized shard.
//
// Initialization consists of fetching the shard's data (deal payload) from
// the storage subsystem, generating an index, and persisting the index
// to facilitate later retrievals, and/or to publish to external sources.
//
// This operation is intended to complement the initial migration. The
// migration registers a shard for every unique piece CID, with lazy
// initialization. Thus, shards are not initialized immediately to avoid
// IO activity competing with proving. Instead, shard are initialized
// when first accessed. This method forces the initialization of a shard by
// accessing it and immediately releasing it. This is useful to warm up the
// cache to facilitate subsequent retrievals, and to generate the indexes
// to publish them externally.
//
// This operation fails if the shard is not in ShardStateNew state.
// It blocks until initialization finishes.
DagstoreInitializeShard(ctx context.Context, key string) error //perm:write
// DagstoreRecoverShard attempts to recover a failed shard.
//
// This operation fails if the shard is not in ShardStateErrored state.
// It blocks until recovery finishes. If recovery failed, it returns the
// error.
DagstoreRecoverShard(ctx context.Context, key string) error //perm:write
// DagstoreInitializeAll initializes all uninitialized shards in bulk,
// according to the policy passed in the parameters.
//
// It is recommended to set a maximum concurrency to avoid extreme
// IO pressure if the storage subsystem has a large amount of deals.
//
// It returns a stream of events to report progress.
DagstoreInitializeAll(ctx context.Context, params DagstoreInitializeAllParams) (<-chan DagstoreInitializeAllEvent, error) //perm:write
// DagstoreGC runs garbage collection on the DAG store.
DagstoreGC(ctx context.Context) ([]DagstoreShardResult, error) //perm:admin
// DagstoreRegisterShard registers a shard manually with dagstore with given pieceCID
DagstoreRegisterShard(ctx context.Context, key string) error //perm:admin
// IndexerAnnounceDeal informs indexer nodes that a new deal was received,
// so they can download its index
IndexerAnnounceDeal(ctx context.Context, proposalCid cid.Cid) error //perm:admin
// IndexerAnnounceAllDeals informs the indexer nodes aboutall active deals.
IndexerAnnounceAllDeals(ctx context.Context) error //perm:admin
// DagstoreLookupPieces returns information about shards that contain the given CID.
DagstoreLookupPieces(ctx context.Context, cid cid.Cid) ([]DagstoreShardInfo, error) //perm:admin
MarketListDeals(ctx context.Context) ([]*MarketDeal, error) //perm:read
// RuntimeSubsystems returns the subsystems that are enabled
// in this instance.
RuntimeSubsystems(ctx context.Context) (MinerSubsystems, error) //perm:read
DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error //perm:admin
DealsList(ctx context.Context) ([]*MarketDeal, error) //perm:admin
DealsConsiderOnlineStorageDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderOnlineStorageDeals(context.Context, bool) error //perm:admin
DealsConsiderOnlineRetrievalDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderOnlineRetrievalDeals(context.Context, bool) error //perm:admin
DealsPieceCidBlocklist(context.Context) ([]cid.Cid, error) //perm:admin
DealsSetPieceCidBlocklist(context.Context, []cid.Cid) error //perm:admin
DealsConsiderOfflineStorageDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderOfflineStorageDeals(context.Context, bool) error //perm:admin
DealsConsiderOfflineRetrievalDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderOfflineRetrievalDeals(context.Context, bool) error //perm:admin
DealsConsiderVerifiedStorageDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderVerifiedStorageDeals(context.Context, bool) error //perm:admin
DealsConsiderUnverifiedStorageDeals(context.Context) (bool, error) //perm:admin
DealsSetConsiderUnverifiedStorageDeals(context.Context, bool) error //perm:admin
PiecesListPieces(ctx context.Context) ([]cid.Cid, error) //perm:read
PiecesListCidInfos(ctx context.Context) ([]cid.Cid, error) //perm:read
PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) //perm:read
PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) //perm:read
// CreateBackup creates node backup onder the specified file name. The
// method requires that the lotus-miner is running with the
// LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that
@ -471,37 +368,6 @@ type SectorOffset struct {
Offset abi.PaddedPieceSize
}
// DagstoreShardInfo is the serialized form of dagstore.DagstoreShardInfo that
// we expose through JSON-RPC to avoid clients having to depend on the
// dagstore lib.
type DagstoreShardInfo struct {
Key string
State string
Error string
}
// DagstoreShardResult enumerates results per shard.
type DagstoreShardResult struct {
Key string
Success bool
Error string
}
type DagstoreInitializeAllParams struct {
MaxConcurrency int
IncludeSealed bool
}
// DagstoreInitializeAllEvent represents an initialization event.
type DagstoreInitializeAllEvent struct {
Key string
Event string // "start", "end"
Success bool
Error string
Total int
Current int
}
type NumAssignerMeta struct {
Reserved bitfield.BitField
Allocated bitfield.BitField

View File

@ -15,16 +15,6 @@ import (
"github.com/filecoin-project/lotus/lib/rpcenc"
)
// NewCurioRpc creates a new http jsonrpc client.
func NewCurioRpc(ctx context.Context, addr string, requestHeader http.Header) (api.Curio, jsonrpc.ClientCloser, error) {
var res v1api.CurioStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res), requestHeader, jsonrpc.WithErrors(api.RPCErrors))
return &res, closer, err
}
// NewCommonRPCV0 creates a new http jsonrpc client.
func NewCommonRPCV0(ctx context.Context, addr string, requestHeader http.Header) (api.CommonNet, jsonrpc.ClientCloser, error) {
var res v0api.CommonNetStruct

View File

@ -106,7 +106,7 @@ func NewLotusOpenRPCDocument(Comments, GroupDocs map[string]string) *go_openrpc_
title := "Lotus RPC API"
info.Title = (*meta_schema.InfoObjectProperties)(&title)
version := build.BuildVersion
version := build.NodeBuildVersion
info.Version = (*meta_schema.InfoObjectVersion)(&version)
return info
},

View File

@ -16,7 +16,6 @@ import (
"github.com/google/uuid"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-graphsync"
textselector "github.com/ipld/go-ipld-selector-text-lite"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/core/metrics"
@ -27,9 +26,6 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer/v2"
"github.com/filecoin-project/go-fil-markets/filestore"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
@ -44,7 +40,6 @@ import (
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/types/ethtypes"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/repo/imports"
sealing "github.com/filecoin-project/lotus/storage/pipeline"
"github.com/filecoin-project/lotus/storage/sealer/sealtasks"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
@ -96,10 +91,8 @@ func init() {
addExample(pid)
addExample(&pid)
storeIDExample := imports.ID(50)
textSelExample := textselector.Expression("Links/21/Hash/Links/42/Hash")
apiSelExample := api.Selector("Links/21/Hash/Links/42/Hash")
clientEvent := retrievalmarket.ClientEventDealAccepted
block := blocks.Block(&blocks.BasicBlock{})
ExampleValues[reflect.TypeOf(&block).Elem()] = block
@ -130,15 +123,7 @@ func init() {
addExample(api.FullAPIVersion1)
addExample(api.PCHInbound)
addExample(time.Minute)
addExample(graphsync.NewRequestID())
addExample(datatransfer.TransferID(3))
addExample(datatransfer.Ongoing)
addExample(storeIDExample)
addExample(&storeIDExample)
addExample(clientEvent)
addExample(&clientEvent)
addExample(retrievalmarket.ClientEventDealAccepted)
addExample(retrievalmarket.DealStatusNew)
addExample(&textSelExample)
addExample(&apiSelExample)
addExample(network.ReachabilityPublic)
@ -206,10 +191,9 @@ func init() {
ExampleValues[reflect.TypeOf(struct{ A multiaddr.Multiaddr }{}).Field(0).Type] = maddr
// miner specific
addExample(filestore.Path(".lotusminer/fstmp123"))
si := uint64(12)
addExample(&si)
addExample(retrievalmarket.DealID(5))
addExample(map[string]cid.Cid{})
addExample(map[string][]api.SealedRef{
"98000": {
@ -313,17 +297,8 @@ func init() {
api.SubsystemMining,
api.SubsystemSealing,
api.SubsystemSectorStorage,
api.SubsystemMarkets,
})
addExample(api.DagstoreShardResult{
Key: "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq",
Error: "<error>",
})
addExample(api.DagstoreShardInfo{
Key: "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq",
State: "ShardStateAvailable",
Error: "<error>",
})
addExample(storiface.ResourceTable)
addExample(network.ScopeStat{
Memory: 123,
@ -456,10 +431,6 @@ func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []r
i = &api.GatewayStruct{}
t = reflect.TypeOf(new(struct{ api.Gateway })).Elem()
permStruct = append(permStruct, reflect.TypeOf(api.GatewayStruct{}.Internal))
case "Curio":
i = &api.CurioStruct{}
t = reflect.TypeOf(new(struct{ api.Curio })).Elem()
permStruct = append(permStruct, reflect.TypeOf(api.CurioStruct{}.Internal))
default:
panic("unknown type")
}

View File

@ -42,6 +42,7 @@ func CreateEthRPCAliases(as apitypes.Aliaser) {
as.AliasMethod("trace_block", "Filecoin.EthTraceBlock")
as.AliasMethod("trace_replayBlockTransactions", "Filecoin.EthTraceReplayBlockTransactions")
as.AliasMethod("trace_transaction", "Filecoin.EthTraceTransaction")
as.AliasMethod("net_version", "Filecoin.NetVersion")
as.AliasMethod("net_listening", "Filecoin.NetListening")

View File

@ -13,9 +13,6 @@ const (
// SubsystemUnknown is a placeholder for the zero value. It should never
// be used.
SubsystemUnknown MinerSubsystem = iota
// SubsystemMarkets signifies the storage and retrieval
// deal-making subsystem.
SubsystemMarkets
// SubsystemMining signifies the mining subsystem.
SubsystemMining
// SubsystemSealing signifies the sealing subsystem.
@ -26,7 +23,6 @@ const (
var MinerSubsystemToString = map[MinerSubsystem]string{
SubsystemUnknown: "Unknown",
SubsystemMarkets: "Markets",
SubsystemMining: "Mining",
SubsystemSealing: "Sealing",
SubsystemSectorStorage: "SectorStorage",
@ -34,7 +30,6 @@ var MinerSubsystemToString = map[MinerSubsystem]string{
var MinerSubsystemToID = map[string]MinerSubsystem{
"Unknown": SubsystemUnknown,
"Markets": SubsystemMarkets,
"Mining": SubsystemMining,
"Sealing": SubsystemSealing,
"SectorStorage": SubsystemSectorStorage,

View File

@ -21,8 +21,6 @@ import (
address "github.com/filecoin-project/go-address"
bitfield "github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer/v2"
retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket"
jsonrpc "github.com/filecoin-project/go-jsonrpc"
auth "github.com/filecoin-project/go-jsonrpc/auth"
abi "github.com/filecoin-project/go-state-types/abi"
@ -42,7 +40,6 @@ import (
ethtypes "github.com/filecoin-project/lotus/chain/types/ethtypes"
alerting "github.com/filecoin-project/lotus/journal/alerting"
dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
imports "github.com/filecoin-project/lotus/node/repo/imports"
)
// MockFullNode is a mock of FullNode interface.
@ -511,418 +508,6 @@ func (mr *MockFullNodeMockRecorder) ChainTipSetWeight(arg0, arg1 interface{}) *g
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)
}
// ClientExport mocks base method.
func (m *MockFullNode) ClientExport(arg0 context.Context, arg1 api.ExportRef, arg2 api.FileRef) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientExport", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// ClientExport indicates an expected call of ClientExport.
func (mr *MockFullNodeMockRecorder) ClientExport(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientExport", reflect.TypeOf((*MockFullNode)(nil).ClientExport), arg0, arg1, arg2)
}
// 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) (*api.StorageAsk, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientQueryAsk", arg0, arg1, arg2)
ret0, _ := ret[0].(*api.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 imports.ID) 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) (*api.RestrievalRes, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1)
ret0, _ := ret[0].(*api.RestrievalRes)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ClientRetrieve indicates an expected call of ClientRetrieve.
func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1)
}
// 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)
}
// ClientRetrieveWait mocks base method.
func (m *MockFullNode) ClientRetrieveWait(arg0 context.Context, arg1 retrievalmarket.DealID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ClientRetrieveWait", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// ClientRetrieveWait indicates an expected call of ClientRetrieveWait.
func (mr *MockFullNodeMockRecorder) ClientRetrieveWait(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWait", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWait), arg0, arg1)
}
// 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()
@ -1522,6 +1107,21 @@ func (mr *MockFullNodeMockRecorder) EthTraceReplayBlockTransactions(arg0, arg1,
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthTraceReplayBlockTransactions", reflect.TypeOf((*MockFullNode)(nil).EthTraceReplayBlockTransactions), arg0, arg1, arg2)
}
// EthTraceTransaction mocks base method.
func (m *MockFullNode) EthTraceTransaction(arg0 context.Context, arg1 string) ([]*ethtypes.EthTraceTransaction, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "EthTraceTransaction", arg0, arg1)
ret0, _ := ret[0].([]*ethtypes.EthTraceTransaction)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// EthTraceTransaction indicates an expected call of EthTraceTransaction.
func (mr *MockFullNodeMockRecorder) EthTraceTransaction(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthTraceTransaction", reflect.TypeOf((*MockFullNode)(nil).EthTraceTransaction), arg0, arg1)
}
// EthUninstallFilter mocks base method.
func (m *MockFullNode) EthUninstallFilter(arg0 context.Context, arg1 ethtypes.EthFilterID) (bool, error) {
m.ctrl.T.Helper()

File diff suppressed because it is too large Load Diff

View File

@ -2,22 +2,16 @@ package api
import (
"encoding/json"
"fmt"
"time"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-graphsync"
"github.com/ipld/go-ipld-prime"
"github.com/ipld/go-ipld-prime/codec/dagjson"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
ma "github.com/multiformats/go-multiaddr"
"github.com/filecoin-project/go-address"
datatransfer "github.com/filecoin-project/go-data-transfer/v2"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
@ -69,71 +63,6 @@ type MessageSendSpec struct {
MaximizeFeeCap bool
}
// GraphSyncDataTransfer provides diagnostics on a data transfer happening over graphsync
type GraphSyncDataTransfer struct {
// GraphSync request id for this transfer
RequestID *graphsync.RequestID
// Graphsync state for this transfer
RequestState string
// If a channel ID is present, indicates whether this is the current graphsync request for this channel
// (could have changed in a restart)
IsCurrentChannelRequest bool
// Data transfer channel ID for this transfer
ChannelID *datatransfer.ChannelID
// Data transfer state for this transfer
ChannelState *DataTransferChannel
// Diagnostic information about this request -- and unexpected inconsistencies in
// request state
Diagnostics []string
}
// TransferDiagnostics give current information about transfers going over graphsync that may be helpful for debugging
type TransferDiagnostics struct {
ReceivingTransfers []*GraphSyncDataTransfer
SendingTransfers []*GraphSyncDataTransfer
}
type DataTransferChannel struct {
TransferID datatransfer.TransferID
Status datatransfer.Status
BaseCID cid.Cid
IsInitiator bool
IsSender bool
Voucher string
Message string
OtherPeer peer.ID
Transferred uint64
Stages *datatransfer.ChannelStages
}
// NewDataTransferChannel constructs an API DataTransferChannel type from full channel state snapshot and a host id
func NewDataTransferChannel(hostID peer.ID, channelState datatransfer.ChannelState) DataTransferChannel {
channel := DataTransferChannel{
TransferID: channelState.TransferID(),
Status: channelState.Status(),
BaseCID: channelState.BaseCID(),
IsSender: channelState.Sender() == hostID,
Message: channelState.Message(),
}
voucher := channelState.Voucher()
voucherJSON, err := ipld.Encode(voucher.Voucher, dagjson.Encode)
if err != nil {
channel.Voucher = fmt.Errorf("Voucher Serialization: %w", err).Error()
} else {
channel.Voucher = string(voucherJSON)
}
if channel.IsSender {
channel.IsInitiator = !channelState.IsPull()
channel.Transferred = channelState.Sent()
channel.OtherPeer = channelState.Recipient()
} else {
channel.IsInitiator = channelState.IsPull()
channel.Transferred = channelState.Received()
channel.OtherPeer = channelState.Sender()
}
return channel
}
type NetStat struct {
System *network.ScopeStat `json:",omitempty"`
Transient *network.ScopeStat `json:",omitempty"`
@ -229,31 +158,6 @@ type MessagePrototype struct {
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
// optional event if part of ClientGetRetrievalUpdates
Event *retrievalmarket.ClientEvent
}
type RestrievalRes struct {
DealID retrievalmarket.DealID
}
// Selector specifies ipld selector string
// - if the string starts with '{', it's interpreted as json selector string
// see https://ipld.io/specs/selectors/ and https://ipld.io/specs/selectors/fixtures/selector-fixtures-1/
@ -261,35 +165,6 @@ type RestrievalRes struct {
// see https://github.com/ipld/go-ipld-selector-text-lite
type Selector string
type DagSpec struct {
// DataSelector matches data to be retrieved
// - when using textselector, the path specifies subtree
// - the matched graph must have a single root
DataSelector *Selector
// ExportMerkleProof is applicable only when exporting to a CAR file via a path textselector
// When true, in addition to the selection target, the resulting CAR will contain every block along the
// path back to, and including the original root
// When false the resulting CAR contains only the blocks of the target subdag
ExportMerkleProof bool
}
type ExportRef struct {
Root cid.Cid
// DAGs array specifies a list of DAGs to export
// - If exporting into unixfs files, only one DAG is supported, DataSelector is only used to find the targeted root node
// - If exporting into a car file
// - When exactly one text-path DataSelector is specified exports the subgraph and its full merkle-path from the original root
// - Otherwise ( multiple paths and/or JSON selector specs) determines each individual subroot and exports the subtrees as a multi-root car
// - When not specified defaults to a single DAG:
// - Data - the entire DAG: `{"R":{"l":{"none":{}},":>":{"a":{">":{"@":{}}}}}}`
DAGs []DagSpec
FromLocalCAR string // if specified, get data from a local CARv2 file.
DealID retrievalmarket.DealID
}
type MinerInfo struct {
Owner address.Address // Must be an ID-address.
Worker address.Address // Must be an ID-address.
@ -346,6 +221,7 @@ type ForkUpgradeParams struct {
UpgradeWatermelonHeight abi.ChainEpoch
UpgradeDragonHeight abi.ChainEpoch
UpgradePhoenixHeight abi.ChainEpoch
UpgradeAussieHeight abi.ChainEpoch
}
// ChainExportConfig holds configuration for chain ranged exports.

View File

@ -5,14 +5,9 @@ import (
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
textselector "github.com/ipld/go-ipld-selector-text-lite"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer/v2"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
@ -24,9 +19,7 @@ import (
apitypes "github.com/filecoin-project/lotus/api/types"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
marketevents "github.com/filecoin-project/lotus/markets/loggers"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/repo/imports"
)
//go:generate go run github.com/golang/mock/mockgen -destination=v0mocks/mock_full.go -package=v0mocks . FullNode
@ -305,74 +298,6 @@ type FullNode interface {
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 imports.ID) 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 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 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.
@ -743,37 +668,3 @@ type FullNode interface {
// the path specified when calling CreateBackup is within the base path
CreateBackup(ctx context.Context, fpath string) error //perm:admin
}
func OfferOrder(o api.QueryOffer, client address.Address) RetrievalOrder {
return RetrievalOrder{
Root: o.Root,
Piece: o.Piece,
Size: o.Size,
Total: o.MinPrice,
UnsealPrice: o.UnsealPrice,
PaymentInterval: o.PaymentInterval,
PaymentIntervalIncrease: o.PaymentIntervalIncrease,
Client: client,
Miner: o.Miner,
MinerPeer: &o.MinerPeer,
}
}
type RetrievalOrder struct {
// TODO: make this less unixfs specific
Root cid.Cid
Piece *cid.Cid
DatamodelPathSelector *textselector.Expression
Size uint64
FromLocalCAR string // if specified, get data from a local CARv2 file.
// TODO: support offset
Total types.BigInt
UnsealPrice types.BigInt
PaymentInterval uint64
PaymentIntervalIncrease uint64
Client address.Address
Miner address.Address
MinerPeer *retrievalmarket.RetrievalPeer
}

View File

@ -7,14 +7,10 @@ import (
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer/v2"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
@ -26,9 +22,7 @@ import (
apitypes "github.com/filecoin-project/lotus/api/types"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
marketevents "github.com/filecoin-project/lotus/markets/loggers"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/repo/imports"
)
var ErrNotSupported = xerrors.New("method not supported")
@ -90,60 +84,6 @@ type FullNodeMethods struct {
ChainTipSetWeight func(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) `perm:"read"`
ClientCalcCommP func(p0 context.Context, p1 string) (*api.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 api.DataTransferChannel, error) `perm:"write"`
ClientDealPieceCID func(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) `perm:"read"`
ClientDealSize func(p0 context.Context, p1 cid.Cid) (api.DataSize, error) `perm:"read"`
ClientFindData func(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) `perm:"read"`
ClientGenCar func(p0 context.Context, p1 api.FileRef, p2 string) error `perm:"write"`
ClientGetDealInfo func(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) `perm:"read"`
ClientGetDealStatus func(p0 context.Context, p1 uint64) (string, error) `perm:"read"`
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"`
ClientListDataTransfers func(p0 context.Context) ([]api.DataTransferChannel, error) `perm:"write"`
ClientListDeals func(p0 context.Context) ([]api.DealInfo, error) `perm:"write"`
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"`
ClientRemoveImport func(p0 context.Context, p1 imports.ID) 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 *api.FileRef) error `perm:"admin"`
ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"`
ClientRetrieveWithEvents func(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"`
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"`
@ -796,303 +736,6 @@ func (s *FullNodeStub) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey)
return *new(types.BigInt), ErrNotSupported
}
func (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*api.CommPRet, error) {
if s.Internal.ClientCalcCommP == nil {
return nil, ErrNotSupported
}
return s.Internal.ClientCalcCommP(p0, p1)
}
func (s *FullNodeStub) ClientCalcCommP(p0 context.Context, p1 string) (*api.CommPRet, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
if s.Internal.ClientCancelDataTransfer == nil {
return ErrNotSupported
}
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 ErrNotSupported
}
func (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error {
if s.Internal.ClientCancelRetrievalDeal == nil {
return ErrNotSupported
}
return s.Internal.ClientCancelRetrievalDeal(p0, p1)
}
func (s *FullNodeStub) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error {
return ErrNotSupported
}
func (s *FullNodeStruct) ClientDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) {
if s.Internal.ClientDataTransferUpdates == nil {
return nil, ErrNotSupported
}
return s.Internal.ClientDataTransferUpdates(p0)
}
func (s *FullNodeStub) ClientDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) {
if s.Internal.ClientDealPieceCID == nil {
return *new(api.DataCIDSize), ErrNotSupported
}
return s.Internal.ClientDealPieceCID(p0, p1)
}
func (s *FullNodeStub) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) {
return *new(api.DataCIDSize), ErrNotSupported
}
func (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (api.DataSize, error) {
if s.Internal.ClientDealSize == nil {
return *new(api.DataSize), ErrNotSupported
}
return s.Internal.ClientDealSize(p0, p1)
}
func (s *FullNodeStub) ClientDealSize(p0 context.Context, p1 cid.Cid) (api.DataSize, error) {
return *new(api.DataSize), ErrNotSupported
}
func (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) {
if s.Internal.ClientFindData == nil {
return *new([]api.QueryOffer), ErrNotSupported
}
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), ErrNotSupported
}
func (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 api.FileRef, p2 string) error {
if s.Internal.ClientGenCar == nil {
return ErrNotSupported
}
return s.Internal.ClientGenCar(p0, p1, p2)
}
func (s *FullNodeStub) ClientGenCar(p0 context.Context, p1 api.FileRef, p2 string) error {
return ErrNotSupported
}
func (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) {
if s.Internal.ClientGetDealInfo == nil {
return nil, ErrNotSupported
}
return s.Internal.ClientGetDealInfo(p0, p1)
}
func (s *FullNodeStub) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) {
if s.Internal.ClientGetDealStatus == nil {
return "", ErrNotSupported
}
return s.Internal.ClientGetDealStatus(p0, p1)
}
func (s *FullNodeStub) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) {
return "", ErrNotSupported
}
func (s *FullNodeStruct) ClientGetDealUpdates(p0 context.Context) (<-chan api.DealInfo, error) {
if s.Internal.ClientGetDealUpdates == nil {
return nil, ErrNotSupported
}
return s.Internal.ClientGetDealUpdates(p0)
}
func (s *FullNodeStub) ClientGetDealUpdates(p0 context.Context) (<-chan api.DealInfo, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) ClientGetRetrievalUpdates(p0 context.Context) (<-chan api.RetrievalInfo, error) {
if s.Internal.ClientGetRetrievalUpdates == nil {
return nil, ErrNotSupported
}
return s.Internal.ClientGetRetrievalUpdates(p0)
}
func (s *FullNodeStub) ClientGetRetrievalUpdates(p0 context.Context) (<-chan api.RetrievalInfo, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) {
if s.Internal.ClientHasLocal == nil {
return false, ErrNotSupported
}
return s.Internal.ClientHasLocal(p0, p1)
}
func (s *FullNodeStub) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) {
return false, ErrNotSupported
}
func (s *FullNodeStruct) ClientImport(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) {
if s.Internal.ClientImport == nil {
return nil, ErrNotSupported
}
return s.Internal.ClientImport(p0, p1)
}
func (s *FullNodeStub) ClientImport(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) {
if s.Internal.ClientListDataTransfers == nil {
return *new([]api.DataTransferChannel), ErrNotSupported
}
return s.Internal.ClientListDataTransfers(p0)
}
func (s *FullNodeStub) ClientListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) {
return *new([]api.DataTransferChannel), ErrNotSupported
}
func (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]api.DealInfo, error) {
if s.Internal.ClientListDeals == nil {
return *new([]api.DealInfo), ErrNotSupported
}
return s.Internal.ClientListDeals(p0)
}
func (s *FullNodeStub) ClientListDeals(p0 context.Context) ([]api.DealInfo, error) {
return *new([]api.DealInfo), ErrNotSupported
}
func (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]api.Import, error) {
if s.Internal.ClientListImports == nil {
return *new([]api.Import), ErrNotSupported
}
return s.Internal.ClientListImports(p0)
}
func (s *FullNodeStub) ClientListImports(p0 context.Context) ([]api.Import, error) {
return *new([]api.Import), ErrNotSupported
}
func (s *FullNodeStruct) ClientListRetrievals(p0 context.Context) ([]api.RetrievalInfo, error) {
if s.Internal.ClientListRetrievals == nil {
return *new([]api.RetrievalInfo), ErrNotSupported
}
return s.Internal.ClientListRetrievals(p0)
}
func (s *FullNodeStub) ClientListRetrievals(p0 context.Context) ([]api.RetrievalInfo, error) {
return *new([]api.RetrievalInfo), ErrNotSupported
}
func (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) {
if s.Internal.ClientMinerQueryOffer == nil {
return *new(api.QueryOffer), ErrNotSupported
}
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), ErrNotSupported
}
func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) {
if s.Internal.ClientQueryAsk == nil {
return nil, ErrNotSupported
}
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, ErrNotSupported
}
func (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 imports.ID) error {
if s.Internal.ClientRemoveImport == nil {
return ErrNotSupported
}
return s.Internal.ClientRemoveImport(p0, p1)
}
func (s *FullNodeStub) ClientRemoveImport(p0 context.Context, p1 imports.ID) error {
return ErrNotSupported
}
func (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {
if s.Internal.ClientRestartDataTransfer == nil {
return ErrNotSupported
}
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 ErrNotSupported
}
func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error {
if s.Internal.ClientRetrieve == nil {
return ErrNotSupported
}
return s.Internal.ClientRetrieve(p0, p1, p2)
}
func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error {
return ErrNotSupported
}
func (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error {
if s.Internal.ClientRetrieveTryRestartInsufficientFunds == nil {
return ErrNotSupported
}
return s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1)
}
func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error {
return ErrNotSupported
}
func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
if s.Internal.ClientRetrieveWithEvents == nil {
return nil, ErrNotSupported
}
return s.Internal.ClientRetrieveWithEvents(p0, p1, p2)
}
func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) {
if s.Internal.ClientStartDeal == nil {
return nil, ErrNotSupported
}
return s.Internal.ClientStartDeal(p0, p1)
}
func (s *FullNodeStub) ClientStartDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) {
if s.Internal.ClientStatelessDeal == nil {
return nil, ErrNotSupported
}
return s.Internal.ClientStatelessDeal(p0, p1)
}
func (s *FullNodeStub) ClientStatelessDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) {
return nil, ErrNotSupported
}
func (s *FullNodeStruct) CreateBackup(p0 context.Context, p1 string) error {
if s.Internal.CreateBackup == nil {
return ErrNotSupported

View File

@ -20,9 +20,6 @@ import (
address "github.com/filecoin-project/go-address"
bitfield "github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer/v2"
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"
abi "github.com/filecoin-project/go-state-types/abi"
big "github.com/filecoin-project/go-state-types/big"
@ -36,13 +33,10 @@ import (
api "github.com/filecoin-project/lotus/api"
apitypes "github.com/filecoin-project/lotus/api/types"
v0api "github.com/filecoin-project/lotus/api/v0api"
miner1 "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
types "github.com/filecoin-project/lotus/chain/types"
alerting "github.com/filecoin-project/lotus/journal/alerting"
marketevents "github.com/filecoin-project/lotus/markets/loggers"
dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
imports "github.com/filecoin-project/lotus/node/repo/imports"
)
// MockFullNode is a mock of FullNode interface.
@ -455,404 +449,6 @@ func (mr *MockFullNodeMockRecorder) ChainTipSetWeight(arg0, arg1 interface{}) *g
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 imports.ID) 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 v0api.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 v0api.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()

View File

@ -4,21 +4,16 @@ import (
"context"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/types"
marketevents "github.com/filecoin-project/lotus/markets/loggers"
)
type WrapperV1Full struct {
@ -210,158 +205,10 @@ func (w *WrapperV1Full) ChainGetRandomnessFromBeacon(ctx context.Context, tsk ty
return w.StateGetRandomnessFromBeacon(ctx, personalization, randEpoch, entropy, tsk)
}
func (w *WrapperV1Full) ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef) error {
events := make(chan marketevents.RetrievalEvent)
go w.clientRetrieve(ctx, order, ref, events)
for {
select {
case evt, ok := <-events:
if !ok { // done successfully
return nil
}
if evt.Err != "" {
return xerrors.Errorf("retrieval failed: %s", evt.Err)
}
case <-ctx.Done():
return xerrors.Errorf("retrieval timed out")
}
}
}
func (w *WrapperV1Full) ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
events := make(chan marketevents.RetrievalEvent)
go w.clientRetrieve(ctx, order, ref, events)
return events, nil
}
func readSubscribeEvents(ctx context.Context, dealID retrievalmarket.DealID, subscribeEvents <-chan api.RetrievalInfo, events chan marketevents.RetrievalEvent) error {
for {
var subscribeEvent api.RetrievalInfo
var evt retrievalmarket.ClientEvent
select {
case <-ctx.Done():
return xerrors.New("Retrieval Timed Out")
case subscribeEvent = <-subscribeEvents:
if subscribeEvent.ID != dealID {
// we can't check the deal ID ahead of time because:
// 1. We need to subscribe before retrieving.
// 2. We won't know the deal ID until after retrieving.
continue
}
if subscribeEvent.Event != nil {
evt = *subscribeEvent.Event
}
}
select {
case <-ctx.Done():
return xerrors.New("Retrieval Timed Out")
case events <- marketevents.RetrievalEvent{
Event: evt,
Status: subscribeEvent.Status,
BytesReceived: subscribeEvent.BytesReceived,
FundsSpent: subscribeEvent.TotalPaid,
}:
}
switch subscribeEvent.Status {
case retrievalmarket.DealStatusCompleted:
return nil
case retrievalmarket.DealStatusRejected:
return xerrors.Errorf("Retrieval Proposal Rejected: %s", subscribeEvent.Message)
case
retrievalmarket.DealStatusDealNotFound,
retrievalmarket.DealStatusErrored:
return xerrors.Errorf("Retrieval Error: %s", subscribeEvent.Message)
}
}
}
func (w *WrapperV1Full) clientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef, events chan marketevents.RetrievalEvent) {
defer close(events)
finish := func(e error) {
if e != nil {
events <- marketevents.RetrievalEvent{Err: e.Error(), FundsSpent: big.Zero()}
}
}
var dealID retrievalmarket.DealID
if order.FromLocalCAR == "" {
// Subscribe to events before retrieving to avoid losing events.
subscribeCtx, cancel := context.WithCancel(ctx)
defer cancel()
retrievalEvents, err := w.ClientGetRetrievalUpdates(subscribeCtx)
if err != nil {
finish(xerrors.Errorf("GetRetrievalUpdates failed: %w", err))
return
}
retrievalRes, err := w.FullNode.ClientRetrieve(ctx, api.RetrievalOrder{
Root: order.Root,
Piece: order.Piece,
Size: order.Size,
Total: order.Total,
UnsealPrice: order.UnsealPrice,
PaymentInterval: order.PaymentInterval,
PaymentIntervalIncrease: order.PaymentIntervalIncrease,
Client: order.Client,
Miner: order.Miner,
MinerPeer: order.MinerPeer,
})
if err != nil {
finish(xerrors.Errorf("Retrieve failed: %w", err))
return
}
dealID = retrievalRes.DealID
err = readSubscribeEvents(ctx, retrievalRes.DealID, retrievalEvents, events)
if err != nil {
finish(xerrors.Errorf("Retrieve: %w", err))
return
}
}
// If ref is nil, it only fetches the data into the configured blockstore.
if ref == nil {
finish(nil)
return
}
eref := api.ExportRef{
Root: order.Root,
FromLocalCAR: order.FromLocalCAR,
DealID: dealID,
}
if order.DatamodelPathSelector != nil {
s := api.Selector(*order.DatamodelPathSelector)
eref.DAGs = append(eref.DAGs, api.DagSpec{
DataSelector: &s,
ExportMerkleProof: true,
})
}
finish(w.ClientExport(ctx, eref, *ref))
}
func (w *WrapperV1Full) PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) {
return w.FullNode.PaychFund(ctx, from, to, amt)
}
func (w *WrapperV1Full) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) {
a, err := w.FullNode.ClientQueryAsk(ctx, p, miner)
if err != nil {
return nil, err
}
return a.Response, nil
}
func (w *WrapperV1Full) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) {
return w.StateGetBeaconEntry(ctx, epoch)
}

View File

@ -12,5 +12,3 @@ type RawFullNodeAPI FullNode
func PermissionedFullAPI(a FullNode) FullNode {
return api.PermissionedFullAPI(a)
}
type CurioStruct = api.CurioStruct

View File

@ -59,8 +59,6 @@ var (
MinerAPIVersion0 = newVer(1, 5, 0)
WorkerAPIVersion0 = newVer(1, 7, 0)
CurioAPIVersion0 = newVer(1, 0, 0)
)
//nolint:varcheck,deadcode

View File

@ -47,7 +47,7 @@ var (
PruneThreshold = 7 * build.Finality
)
// GCHotstore runs online GC on the chain state in the hotstore according the to options specified
// GCHotStore runs online GC on the chain state in the hotstore according the to options specified
func (s *SplitStore) GCHotStore(opts api.HotGCOpts) error {
if opts.Moving {
gcOpts := []bstore.BlockstoreGCOption{bstore.WithFullGC(true)}

BIN
build/actors/v14.tar.zst Normal file

Binary file not shown.

View File

@ -12,10 +12,10 @@ import (
"strconv"
"strings"
"github.com/DataDog/zstd"
"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/ipld/go-car"
"github.com/klauspost/compress/zstd"
"golang.org/x/xerrors"
actorstypes "github.com/filecoin-project/go-state-types/actors"
@ -160,7 +160,10 @@ func readEmbeddedBuiltinActorsMetadata(bundle string) ([]*BuiltinActorsMetadata,
}
defer fi.Close() //nolint
uncompressed := zstd.NewReader(fi)
uncompressed, err := zstd.NewReader(fi)
if err != nil {
return nil, err
}
defer uncompressed.Close() //nolint
var bundles []*BuiltinActorsMetadata
@ -255,7 +258,10 @@ func GetEmbeddedBuiltinActorsBundle(version actorstypes.Version, networkBundleNa
}
defer fi.Close() //nolint
uncompressed := zstd.NewReader(fi)
uncompressed, err := zstd.NewReader(fi)
if err != nil {
return nil, false
}
defer uncompressed.Close() //nolint
tarReader := tar.NewReader(uncompressed)

View File

@ -117,9 +117,32 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{
"system": MustParseCid("bafk2bzacec3vwj2chzaram3iqupkbfiein5h2l5qiltlrngbju2vg5umelclm"),
"verifiedregistry": MustParseCid("bafk2bzacedv2irkql7nil3w5v3ohqq3e54w62pxeoppjmaktzokolaaoh5ksu"),
},
}, {
Network: "butterflynet",
Version: 13,
ManifestCid: MustParseCid("bafy2bzacec75zk7ufzwx6tg5avls5fxdjx5asaqmd2bfqdvkqrkzoxgyflosu"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacedl533kwbzouqxibejpwp6syfdekvmzy4vmmno6j4iaydbdmv4xek"),
"cron": MustParseCid("bafk2bzacecimv5xnuwyoqgxk26qt4xqpgntleret475pnh35s3vvhqtdct4ow"),
"datacap": MustParseCid("bafk2bzacebpdd4ctavhs7wkcykfahpifct3p4hbptgtf4jfrqcp2trtlygvow"),
"eam": MustParseCid("bafk2bzaceahw5rrgj7prgbnmn237di7ymjz2ssea32wr525jydpfrwpuhs67m"),
"ethaccount": MustParseCid("bafk2bzacebrslcbew5mq3le2zsn36xqxd4gt5hryeoslxnuqwgw3rhuwh6ygu"),
"evm": MustParseCid("bafk2bzaced5smz4lhpem4mbr7igcskv3e5qopbdp7dqshww2qs4ahacgzjzo4"),
"init": MustParseCid("bafk2bzacedgj6hawhdw2ot2ufisci374o2bq6bfkvlvdt6q7s3uoe5ffyv43k"),
"multisig": MustParseCid("bafk2bzacectnnnpwyqiccaymy3h6ghu74ghjrqyhtqv5odfd4opivzebjj6to"),
"paymentchannel": MustParseCid("bafk2bzaceckhx44jawhzhkz6k23gfnv2gcutgb4j4ekhonj2plwaent4b2tpk"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacebbs3rlg7y3wbvxrj4wgbsqmasw4ksbbr3lyqbkaxj2t25qz6zzuy"),
"storagemarket": MustParseCid("bafk2bzaced3zmxsmlhp2nsiwkxcp2ugonbsebcd53t7htzo2jcoidvu464xmm"),
"storageminer": MustParseCid("bafk2bzacebedx7iaa2ruspxvghkg46ez7un5b7oiijjtnvddq2aot5wk7p7ry"),
"storagepower": MustParseCid("bafk2bzacebvne7m2l3hxxw4xa6oujol75x35yqpnlqiwx74jilyrop4cs7cse"),
"system": MustParseCid("bafk2bzaceacjmlxrvydlud77ilpzbscez46yedx6zjsj6olxsdeuv6d4x4cwe"),
"verifiedregistry": MustParseCid("bafk2bzacebs5muoq7ft2wgqojhjio7a4vltbyprqkmlr43ojlzbil4nwvj3jg"),
},
}, {
Network: "butterflynet",
Version: 13,
Version: 14,
BundleGitTag: "v13.0.0",
ManifestCid: MustParseCid("bafy2bzacec75zk7ufzwx6tg5avls5fxdjx5asaqmd2bfqdvkqrkzoxgyflosu"),
Actors: map[string]cid.Cid{
@ -246,9 +269,32 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{
"system": MustParseCid("bafk2bzacecioupndtcnyw6iq2hbrxag3aufvczlv5nobnfbkbywqzcyfaa376"),
"verifiedregistry": MustParseCid("bafk2bzaceavldupmf7bimeeacs67z5xdfdlfca6p7sn6bev3mt5ggepfqvhqo"),
},
}, {
Network: "calibrationnet",
Version: 13,
ManifestCid: MustParseCid("bafy2bzacect4ktyujrwp6mjlsitnpvuw2pbuppz6w52sfljyo4agjevzm75qs"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceb3j36ri5y5mfklgp5emlvrms6g4733ss2j3l7jismrxq6ng3tcc6"),
"cron": MustParseCid("bafk2bzaceaz6rocamdxehgpwcbku6wlapwpgzyyvkrploj66mlqptsulf52bs"),
"datacap": MustParseCid("bafk2bzacea22nv5g3yngpxvonqfj4r2nkfk64y6yw2malicm7odk77x7zuads"),
"eam": MustParseCid("bafk2bzaceatqtjzj7623i426noaslouvluhz6e3md3vvquqzku5qj3532uaxg"),
"ethaccount": MustParseCid("bafk2bzacean3hs7ga5csw6g3uu7watxfnqv5uvxviebn3ba6vg4sagwdur5pu"),
"evm": MustParseCid("bafk2bzacec5ibmbtzuzjgwjmksm2n6zfq3gkicxqywwu7tsscqgdzajpfctxk"),
"init": MustParseCid("bafk2bzaced5sq72oemz6qwi6yssxwlos2g54zfprslrx5qfhhx2vlgsbvdpcs"),
"multisig": MustParseCid("bafk2bzacedbgei6jkx36fwdgvoohce4aghvpohqdhoco7p4thszgssms7olv2"),
"paymentchannel": MustParseCid("bafk2bzaceasmgmfsi4mjanxlowsub65fmevhzky4toeqbtw4kp6tmu4kxjpgq"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacedjyp6ll5ez27dfgldjj4tntxfvyp4pa5zkk7s5uhipzqjyx2gmuc"),
"storagemarket": MustParseCid("bafk2bzaceabolct6qdnefwcrtati2us3sxtxfghyqk6aamfhl6byyefmtssqi"),
"storageminer": MustParseCid("bafk2bzaceckzw3v7wqliyggvjvihz4wywchnnsie4frfvkm3fm5znb64mofri"),
"storagepower": MustParseCid("bafk2bzacea7t4wynzjajl442mpdqbnh3wusjusqtnzgpvefvweh4n2tgzgqhu"),
"system": MustParseCid("bafk2bzacedjnrb5glewazsxpcx6rwiuhl4kwrfcqolyprn6rrjtlzmthlhdq6"),
"verifiedregistry": MustParseCid("bafk2bzacebj2zdquagzy2xxn7up574oemg3w7ed3fe4aujkyhgdwj57voesn2"),
},
}, {
Network: "calibrationnet",
Version: 13,
Version: 14,
BundleGitTag: "v13.0.0",
ManifestCid: MustParseCid("bafy2bzacect4ktyujrwp6mjlsitnpvuw2pbuppz6w52sfljyo4agjevzm75qs"),
Actors: map[string]cid.Cid{
@ -384,9 +430,32 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{
"system": MustParseCid("bafk2bzacedye5j5uxox7knb6zlnhseaadztyav76mjbyk5qslhhbpiy5cdtt2"),
"verifiedregistry": MustParseCid("bafk2bzacecduww5pirr7dvaijjijw4gf6ygf7vipgxh4scvv6vseo46gueb46"),
},
}, {
Network: "caterpillarnet",
Version: 13,
ManifestCid: MustParseCid("bafy2bzacedu7kk2zngxp7y3lynhtaht6vgadgn5jzkxe5nuowtwzasnogx63w"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacecro3uo6ypqhfzwdhnamzcole5qmhrbkx7qny6t2qsrcpqxelt6s2"),
"cron": MustParseCid("bafk2bzaceam3kci46y4siltbw7f4itoap34kp7b7pvn2fco5s2bvnotomwdbe"),
"datacap": MustParseCid("bafk2bzacecmtdspcbqmmjtsaz4vucuqoqjqfsgxjonns7tom7eblkngbcm7bw"),
"eam": MustParseCid("bafk2bzaceaudqhrt7djewopqdnryvwxagfufyt7ja4gdvovrxbh6edh6evgrw"),
"ethaccount": MustParseCid("bafk2bzaced676ds3z6xe333wr7frwq3f2iq5kjwp4okl3te6rne3xf7kuqrwm"),
"evm": MustParseCid("bafk2bzacebeih4jt2s6mel6x4hje7xmnugh6twul2a5axx4iczu7fu4wcdi6k"),
"init": MustParseCid("bafk2bzaceba7vvuzzwj5wqnq2bvpbgtxup53mhr3qybezbllftnxvpqbfymxo"),
"multisig": MustParseCid("bafk2bzaceapkajhnqoczrgry5javqbl7uebgmsbpqqfemzc4yb5q2dqia2qog"),
"paymentchannel": MustParseCid("bafk2bzacebg7xq4ca22gafmdbkcq357x7v6slflib4h3fnj4amsovg6ulqg3o"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzaceajt4idf26ffnyipybcib55fykjxnek7oszkqzi7lu7mbgijmkgos"),
"storagemarket": MustParseCid("bafk2bzaceadfmay7pyl7osjsdmrireafasnjnoziacljy5ewrcsxpp56kzqbw"),
"storageminer": MustParseCid("bafk2bzaceardbn5a7aq5jxl7efr4btmsbl7txnxm4hrrd3llyhujuc2cr5vcs"),
"storagepower": MustParseCid("bafk2bzacear4563jznjqyseoy42xl6kenyqk6umv6xl3bp5bsjb3hbs6sp6bm"),
"system": MustParseCid("bafk2bzacecc5oavxivfnvirx2g7megpdf6lugooyoc2wijloju247xzjcdezy"),
"verifiedregistry": MustParseCid("bafk2bzacebnkdt42mpf5emypo6iroux3hszfh5yt54v2mmnnura3ketholly4"),
},
}, {
Network: "caterpillarnet",
Version: 13,
Version: 14,
BundleGitTag: "v13.0.0",
ManifestCid: MustParseCid("bafy2bzacedu7kk2zngxp7y3lynhtaht6vgadgn5jzkxe5nuowtwzasnogx63w"),
Actors: map[string]cid.Cid{
@ -513,9 +582,32 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{
"system": MustParseCid("bafk2bzacecnau5wddulbsvwn75tc3w75jrlvkybgrlxs4ngonqab6xq3eowvg"),
"verifiedregistry": MustParseCid("bafk2bzacec37mddea65nvh4htsagtryfa3sq6i67utcupslyhzbhjhoy6hopa"),
},
}, {
Network: "devnet",
Version: 13,
ManifestCid: MustParseCid("bafy2bzacecn7uxgehrqbcs462ktl2h23u23cmduy2etqj6xrd6tkkja56fna4"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacebev3fu5geeehpx577b3kvza4xsmmggmepjj7rlsnr27hpoq27q2i"),
"cron": MustParseCid("bafk2bzacedalzqahtuz2bmnf7uawbcujfhhe5xzv5ys5ufadu6ggs3tcu6lsy"),
"datacap": MustParseCid("bafk2bzaceb7ou2vn7ac4xidespoowq2q5w7ognr7s4ujy3xzzgiishajpe7le"),
"eam": MustParseCid("bafk2bzacedqic2qskattorj4svf6mbto2k76ej3ll3ugsyorqramrg7rpq3by"),
"ethaccount": MustParseCid("bafk2bzaceaoad7iknpywijigv2h3jyvkijff2oxvohzue533v5hby3iix5vdu"),
"evm": MustParseCid("bafk2bzacecjgiw26gagsn6a7tffkrgoor4zfgzfokp76u6cwervtmvjbopmwg"),
"init": MustParseCid("bafk2bzaced2obubqojxggeddr246cpwtyzi6knnq52jsvsc2fs3tuk2kh6dtg"),
"multisig": MustParseCid("bafk2bzacebquruzb6zho45orbdkku624t6w6jt4tudaqzraz4yh3li3jfstpg"),
"paymentchannel": MustParseCid("bafk2bzaceaydrilyxvflsuzr24hmw32qwz6sy4hgls73bhpveydcsqskdgpca"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzaceb74owpuzdddqoj2tson6ymbyuguqrnqefyiaxqvwm4ygitpabjrq"),
"storagemarket": MustParseCid("bafk2bzaceaw6dslv6pfqha4ynghq2imij5khnnjrie22kmfgtpie3bvxho6jq"),
"storageminer": MustParseCid("bafk2bzacecsputz6xygjfyrvx2d7bxkpp7b5v4icrmpckec7gnbabx2w377qs"),
"storagepower": MustParseCid("bafk2bzaceceyaa5yjwhxvvcqouob4l746zp5nesivr6enhtpimakdtby6kafi"),
"system": MustParseCid("bafk2bzaceaxg6k5vuozxlemfi5hv663m6jcawzu5puboo4znj73i36e3tsovs"),
"verifiedregistry": MustParseCid("bafk2bzacea2czkb4vt2iiiwdb6e57qfwqse4mk2pcyvwjmdl5ojbnla57oh2u"),
},
}, {
Network: "devnet",
Version: 13,
Version: 14,
BundleGitTag: "v13.0.0",
ManifestCid: MustParseCid("bafy2bzacecn7uxgehrqbcs462ktl2h23u23cmduy2etqj6xrd6tkkja56fna4"),
Actors: map[string]cid.Cid{
@ -665,9 +757,32 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{
"system": MustParseCid("bafk2bzacebfqrja2hip7esf4eafxjmu6xcogoqu5xxtgdg7xa5szgvvdguchu"),
"verifiedregistry": MustParseCid("bafk2bzacedudgflxc75c77c6zkmfyq4u2xuk7k6xw6dfdccarjrvxx453b77q"),
},
}, {
Network: "mainnet",
Version: 13,
ManifestCid: MustParseCid("bafy2bzacecdhvfmtirtojwhw2tyciu4jkbpsbk5g53oe24br27oy62sn4dc4e"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacedxnbtlsqdk76fsfmnhyvsblwyfducerwwtp3mqtx2wbrvs5idl52"),
"cron": MustParseCid("bafk2bzacebbopddyn5csb3fsuhh2an4ttd23x6qnwixgohlirj5ahtcudphyc"),
"datacap": MustParseCid("bafk2bzaceah42tfnhd7xnztawgf46gbvc3m2gudoxshlba2ucmmo2vy67t7ci"),
"eam": MustParseCid("bafk2bzaceb23bhvvcjsth7cn7vp3gbaphrutsaz7v6hkls3ogotzs4bnhm4mk"),
"ethaccount": MustParseCid("bafk2bzaceautge6zhuy6jbj3uldwoxwhpywuon6z3xfvmdbzpbdribc6zzmei"),
"evm": MustParseCid("bafk2bzacedq6v2lyuhgywhlllwmudfj2zufzcauxcsvvd34m2ek5xr55mvh2q"),
"init": MustParseCid("bafk2bzacedr4xacm3fts4vilyeiacjr2hpmwzclyzulbdo24lrfxbtau2wbai"),
"multisig": MustParseCid("bafk2bzacecr5zqarfqak42xqcfeulsxlavcltawsx2fvc7zsjtby6ti4b3wqc"),
"paymentchannel": MustParseCid("bafk2bzacebntdhfmyc24e7tm52ggx5tnw4i3hrr3jmllsepv3mibez4hywsa2"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacedq4q2kwkruu4xm7rkyygumlbw2yt4nimna2ivea4qarvtkohnuwu"),
"storagemarket": MustParseCid("bafk2bzacebjtoltdviyznpj34hh5qp6u257jnnbjole5rhqfixm7ug3epvrfu"),
"storageminer": MustParseCid("bafk2bzacebf4rrqyk7gcfggggul6nfpzay7f2ordnkwm7z2wcf4mq6r7i77t2"),
"storagepower": MustParseCid("bafk2bzacecjy4dkulvxppg3ocbmeixe2wgg6yxoyjxrm4ko2fm3uhpvfvam6e"),
"system": MustParseCid("bafk2bzacecyf523quuq2kdjfdvyty446z2ounmamtgtgeqnr3ynlu5cqrlt6e"),
"verifiedregistry": MustParseCid("bafk2bzacedkxehp7y7iyukbcje3wbpqcvufisos6exatkanyrbotoecdkrbta"),
},
}, {
Network: "mainnet",
Version: 13,
Version: 14,
BundleGitTag: "v13.0.0",
ManifestCid: MustParseCid("bafy2bzacecdhvfmtirtojwhw2tyciu4jkbpsbk5g53oe24br27oy62sn4dc4e"),
Actors: map[string]cid.Cid{
@ -794,9 +909,32 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{
"system": MustParseCid("bafk2bzacecp4roanbxq3bflftlkipsoqqxio5etjjnzxus5pcu7lq43fnxb34"),
"verifiedregistry": MustParseCid("bafk2bzaceandytrgcnuvizfi47sijbqh6c243vjtzlzumexm6kjv7s7hye45g"),
},
}, {
Network: "testing",
Version: 13,
ManifestCid: MustParseCid("bafy2bzacedg47dqxmtgzjch6i42kth72esd7w23gujyd6c6oppg3n6auag5ou"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceb3tncntgeqvzzr5fzhvpsc5ntv3tpqrsh4jst4irfyzpkdyigibc"),
"cron": MustParseCid("bafk2bzacecwwasmhixpgtshczm5cfspwciyawc25mrefknqhlxfrd6m57tqmc"),
"datacap": MustParseCid("bafk2bzaceckj66by6eohjrybazh5cymmovgl5bmikpvzki2q7huwk2fweoef2"),
"eam": MustParseCid("bafk2bzaceafzm65wvnaam3775homn4vzsv7odftn5tkifmn44wd2t6gupy63y"),
"ethaccount": MustParseCid("bafk2bzaced4q7m4mha2dsezhwub3ru64rgimkg52t25ul4gnekax6uq7hbkqu"),
"evm": MustParseCid("bafk2bzaceakpknw5cuizil3552jr5z35rs6ijaignjigciswtok67drhzdss6"),
"init": MustParseCid("bafk2bzacec7mbkemwugyg2p4oy2xgnovykk4dnsu5ym4wkreooujvxfsxbo3i"),
"multisig": MustParseCid("bafk2bzacebmftoql6dcyqf54xznwjg2bfgdsi67spqquwslpvvtvcx6qenhz2"),
"paymentchannel": MustParseCid("bafk2bzaceau57wpiiikea6pu5om4ryyqjrxjzfksfl4reqosnohydzv3pf4qq"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacecvlcdgbqlk3dyfzkcjrywg2th5bmn7ilijifikulpxr4ffcrw23o"),
"storagemarket": MustParseCid("bafk2bzacecgj53dwqla7eiubs2uiza7cgxkxtefxkfpjontj5jxefl3a4i2nq"),
"storageminer": MustParseCid("bafk2bzaceailclue4dba2edjethfjw6ycufcwsx4qjjmgsh77xcyprmogdjvu"),
"storagepower": MustParseCid("bafk2bzaceaqw6dhdjlqovhk3p4lb4sb25i5d6mhln2ir5m7tj6m4fegkgkinw"),
"system": MustParseCid("bafk2bzaceby6aiiosnrtb5kzlmrvd4k3o27oo3idmbd6llydz2uqibbp23pzq"),
"verifiedregistry": MustParseCid("bafk2bzaceadw6mxuyb6ipaq3fhekk7u5osyyiis3c4wbkvysy2ut6qfsua5zs"),
},
}, {
Network: "testing",
Version: 13,
Version: 14,
BundleGitTag: "v13.0.0",
ManifestCid: MustParseCid("bafy2bzacedg47dqxmtgzjch6i42kth72esd7w23gujyd6c6oppg3n6auag5ou"),
Actors: map[string]cid.Cid{
@ -923,9 +1061,32 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{
"system": MustParseCid("bafk2bzacecp4roanbxq3bflftlkipsoqqxio5etjjnzxus5pcu7lq43fnxb34"),
"verifiedregistry": MustParseCid("bafk2bzaceandytrgcnuvizfi47sijbqh6c243vjtzlzumexm6kjv7s7hye45g"),
},
}, {
Network: "testing-fake-proofs",
Version: 13,
ManifestCid: MustParseCid("bafy2bzaceaf7fz33sp2i5ag5xg5ompn3dwppqlbwfacrwuvzaqdbqrtni7m5q"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceb3tncntgeqvzzr5fzhvpsc5ntv3tpqrsh4jst4irfyzpkdyigibc"),
"cron": MustParseCid("bafk2bzacecwwasmhixpgtshczm5cfspwciyawc25mrefknqhlxfrd6m57tqmc"),
"datacap": MustParseCid("bafk2bzaceckj66by6eohjrybazh5cymmovgl5bmikpvzki2q7huwk2fweoef2"),
"eam": MustParseCid("bafk2bzaceafzm65wvnaam3775homn4vzsv7odftn5tkifmn44wd2t6gupy63y"),
"ethaccount": MustParseCid("bafk2bzaced4q7m4mha2dsezhwub3ru64rgimkg52t25ul4gnekax6uq7hbkqu"),
"evm": MustParseCid("bafk2bzaceakpknw5cuizil3552jr5z35rs6ijaignjigciswtok67drhzdss6"),
"init": MustParseCid("bafk2bzacec7mbkemwugyg2p4oy2xgnovykk4dnsu5ym4wkreooujvxfsxbo3i"),
"multisig": MustParseCid("bafk2bzacedy4vldq4viv6bzzh4fueip3by3axsbgbh655lashddgumknc6pvs"),
"paymentchannel": MustParseCid("bafk2bzaceau57wpiiikea6pu5om4ryyqjrxjzfksfl4reqosnohydzv3pf4qq"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacecvlcdgbqlk3dyfzkcjrywg2th5bmn7ilijifikulpxr4ffcrw23o"),
"storagemarket": MustParseCid("bafk2bzacecgj53dwqla7eiubs2uiza7cgxkxtefxkfpjontj5jxefl3a4i2nq"),
"storageminer": MustParseCid("bafk2bzaceb6atn3k6yhmskgmc3lgfiwpzpfmaxzacohtnb2hivme2oroycqr6"),
"storagepower": MustParseCid("bafk2bzacedameh56mp2g4y7nprhax5sddbzcmpk5p7l523l45rtn2wjc6ah4e"),
"system": MustParseCid("bafk2bzaceby6aiiosnrtb5kzlmrvd4k3o27oo3idmbd6llydz2uqibbp23pzq"),
"verifiedregistry": MustParseCid("bafk2bzaceadw6mxuyb6ipaq3fhekk7u5osyyiis3c4wbkvysy2ut6qfsua5zs"),
},
}, {
Network: "testing-fake-proofs",
Version: 13,
Version: 14,
BundleGitTag: "v13.0.0",
ManifestCid: MustParseCid("bafy2bzaceaf7fz33sp2i5ag5xg5ompn3dwppqlbwfacrwuvzaqdbqrtni7m5q"),
Actors: map[string]cid.Cid{

View File

@ -15,9 +15,9 @@ import (
"strings"
"testing"
"github.com/DataDog/zstd"
"github.com/ipfs/go-cid"
"github.com/ipld/go-car/v2"
"github.com/klauspost/compress/zstd"
"github.com/stretchr/testify/require"
actorstypes "github.com/filecoin-project/go-state-types/actors"
@ -46,7 +46,9 @@ func TestEmbeddedBuiltinActorsMetadata(t *testing.T) {
cachedCar, err := os.Open(fmt.Sprintf("./actors/v%v.tar.zst", version))
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, cachedCar.Close()) })
tarReader := tar.NewReader(zstd.NewReader(cachedCar))
zstReader, err := zstd.NewReader(cachedCar)
require.NoError(t, err)
tarReader := tar.NewReader(zstReader)
for {
header, err := tarReader.Next()
if errors.Is(err, io.EOF) {

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
"openrpc": "1.2.6",
"info": {
"title": "Lotus RPC API",
"version": "1.27.0"
"version": "1.27.1-rc1"
},
"methods": [
{
@ -242,7 +242,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4416"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3792"
}
},
{
@ -473,7 +473,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4427"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3803"
}
},
{
@ -572,7 +572,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4438"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3814"
}
},
{
@ -604,7 +604,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4449"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3825"
}
},
{
@ -710,7 +710,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4460"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3836"
}
},
{
@ -803,7 +803,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4471"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3847"
}
},
{
@ -887,7 +887,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4482"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3858"
}
},
{
@ -987,7 +987,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4493"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3869"
}
},
{
@ -1043,7 +1043,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4504"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3880"
}
},
{
@ -1116,7 +1116,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4515"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3891"
}
},
{
@ -1189,7 +1189,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4526"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3902"
}
},
{
@ -1236,7 +1236,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4537"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3913"
}
},
{
@ -1268,7 +1268,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4548"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3924"
}
},
{
@ -1305,7 +1305,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4570"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3946"
}
},
{
@ -1352,7 +1352,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4581"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3957"
}
},
{
@ -1392,7 +1392,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4592"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3968"
}
},
{
@ -1439,7 +1439,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4603"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3979"
}
},
{
@ -1494,7 +1494,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4614"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3990"
}
},
{
@ -1523,7 +1523,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4625"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4001"
}
},
{
@ -1660,7 +1660,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4636"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4012"
}
},
{
@ -1689,7 +1689,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4647"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4023"
}
},
{
@ -1743,7 +1743,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4658"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4034"
}
},
{
@ -1834,7 +1834,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4669"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4045"
}
},
{
@ -1862,7 +1862,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4680"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4056"
}
},
{
@ -1952,7 +1952,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4691"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4067"
}
},
{
@ -2208,7 +2208,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4702"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4078"
}
},
{
@ -2453,7 +2453,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4713"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4089"
}
},
{
@ -2509,7 +2509,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4724"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4100"
}
},
{
@ -2556,7 +2556,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4735"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4111"
}
},
{
@ -2654,7 +2654,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4746"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4122"
}
},
{
@ -2720,7 +2720,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4757"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4133"
}
},
{
@ -2786,7 +2786,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4768"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4144"
}
},
{
@ -2895,7 +2895,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4779"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4155"
}
},
{
@ -2953,7 +2953,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4790"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4166"
}
},
{
@ -3075,7 +3075,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4801"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4177"
}
},
{
@ -3132,6 +3132,7 @@
"gas": "0x5",
"maxFeePerGas": "0x0",
"maxPriorityFeePerGas": "0x0",
"gasPrice": "0x0",
"accessList": [
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"
],
@ -3187,6 +3188,10 @@
"title": "number",
"type": "number"
},
"gasPrice": {
"additionalProperties": false,
"type": "object"
},
"hash": {
"items": {
"description": "Number is a number",
@ -3262,7 +3267,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4812"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4188"
}
},
{
@ -3336,6 +3341,7 @@
"gas": "0x5",
"maxFeePerGas": "0x0",
"maxPriorityFeePerGas": "0x0",
"gasPrice": "0x0",
"accessList": [
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"
],
@ -3391,6 +3397,10 @@
"title": "number",
"type": "number"
},
"gasPrice": {
"additionalProperties": false,
"type": "object"
},
"hash": {
"items": {
"description": "Number is a number",
@ -3466,7 +3476,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4823"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4199"
}
},
{
@ -3557,7 +3567,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4834"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4210"
}
},
{
@ -3615,7 +3625,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4845"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4221"
}
},
{
@ -3873,7 +3883,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4856"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4232"
}
},
{
@ -4148,7 +4158,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4867"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4243"
}
},
{
@ -4176,7 +4186,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4878"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4254"
}
},
{
@ -4214,7 +4224,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4889"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4265"
}
},
{
@ -4322,7 +4332,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4900"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4276"
}
},
{
@ -4360,7 +4370,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4911"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4287"
}
},
{
@ -4389,7 +4399,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4922"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4298"
}
},
{
@ -4452,7 +4462,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4933"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4309"
}
},
{
@ -4515,7 +4525,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4944"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4320"
}
},
{
@ -4560,7 +4570,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4955"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4331"
}
},
{
@ -4682,7 +4692,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4966"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4342"
}
},
{
@ -4837,7 +4847,129 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4977"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4353"
}
},
{
"name": "Filecoin.EthTraceTransaction",
"description": "```go\nfunc (s *GatewayStruct) EthTraceTransaction(p0 context.Context, p1 string) ([]*ethtypes.EthTraceTransaction, error) {\n\tif s.Internal.EthTraceTransaction == nil {\n\t\treturn *new([]*ethtypes.EthTraceTransaction), ErrNotSupported\n\t}\n\treturn s.Internal.EthTraceTransaction(p0, p1)\n}\n```",
"summary": "There are not yet any comments for this method.",
"paramStructure": "by-position",
"params": [
{
"name": "p1",
"description": "string",
"summary": "",
"schema": {
"examples": [
"string value"
],
"type": [
"string"
]
},
"required": true,
"deprecated": false
}
],
"result": {
"name": "[]*ethtypes.EthTraceTransaction",
"description": "[]*ethtypes.EthTraceTransaction",
"summary": "",
"schema": {
"examples": [
[
{
"type": "string value",
"error": "string value",
"subtraces": 123,
"traceAddress": [
123
],
"action": {},
"result": {},
"blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockNumber": 9,
"transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"transactionPosition": 123
}
]
],
"items": [
{
"additionalProperties": false,
"properties": {
"action": {
"additionalProperties": true,
"type": "object"
},
"blockHash": {
"items": {
"description": "Number is a number",
"title": "number",
"type": "number"
},
"maxItems": 32,
"minItems": 32,
"type": "array"
},
"blockNumber": {
"title": "number",
"type": "number"
},
"error": {
"type": "string"
},
"result": {
"additionalProperties": true,
"type": "object"
},
"subtraces": {
"title": "number",
"type": "number"
},
"traceAddress": {
"items": {
"description": "Number is a number",
"title": "number",
"type": "number"
},
"type": "array"
},
"transactionHash": {
"items": {
"description": "Number is a number",
"title": "number",
"type": "number"
},
"maxItems": 32,
"minItems": 32,
"type": "array"
},
"transactionPosition": {
"title": "number",
"type": "number"
},
"type": {
"type": "string"
}
},
"type": [
"object"
]
}
],
"type": [
"array"
]
},
"required": true,
"deprecated": false
},
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4364"
}
},
{
@ -4891,7 +5023,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4988"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4375"
}
},
{
@ -4945,7 +5077,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4999"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4386"
}
},
{
@ -5000,7 +5132,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5010"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4397"
}
},
{
@ -5102,7 +5234,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5021"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4408"
}
},
{
@ -5325,7 +5457,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5032"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4419"
}
},
{
@ -5508,7 +5640,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5043"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4430"
}
},
{
@ -5702,7 +5834,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5054"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4441"
}
},
{
@ -5748,7 +5880,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5065"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4452"
}
},
{
@ -5898,7 +6030,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5076"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4463"
}
},
{
@ -6035,7 +6167,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5087"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4474"
}
},
{
@ -6103,7 +6235,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5098"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4485"
}
},
{
@ -6220,7 +6352,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5109"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4496"
}
},
{
@ -6311,7 +6443,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5120"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4507"
}
},
{
@ -6397,7 +6529,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5131"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4518"
}
},
{
@ -6424,7 +6556,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5142"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4529"
}
},
{
@ -6451,7 +6583,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5153"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4540"
}
},
{
@ -6519,7 +6651,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5164"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4551"
}
},
{
@ -7025,7 +7157,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5175"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4562"
}
},
{
@ -7122,7 +7254,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5186"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4573"
}
},
{
@ -7222,7 +7354,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5197"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4584"
}
},
{
@ -7322,7 +7454,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5208"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4595"
}
},
{
@ -7447,7 +7579,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5219"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4606"
}
},
{
@ -7556,7 +7688,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5230"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4617"
}
},
{
@ -7659,7 +7791,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5241"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4628"
}
},
{
@ -7789,7 +7921,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5252"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4639"
}
},
{
@ -7896,7 +8028,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5263"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4650"
}
},
{
@ -7957,7 +8089,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5274"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4661"
}
},
{
@ -8025,7 +8157,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5285"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4672"
}
},
{
@ -8106,7 +8238,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5296"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4683"
}
},
{
@ -8179,6 +8311,7 @@
"ClientCollateral": "0"
},
"State": {
"SectorNumber": 9,
"SectorStartEpoch": 10101,
"LastUpdatedEpoch": 10101,
"SlashEpoch": 10101
@ -8243,6 +8376,10 @@
"title": "number",
"type": "number"
},
"SectorNumber": {
"title": "number",
"type": "number"
},
"SectorStartEpoch": {
"title": "number",
"type": "number"
@ -8265,7 +8402,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5307"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4694"
}
},
{
@ -8358,7 +8495,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5318"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4705"
}
},
{
@ -8559,7 +8696,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5329"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4716"
}
},
{
@ -8670,7 +8807,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5340"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4727"
}
},
{
@ -8801,7 +8938,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5351"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4738"
}
},
{
@ -8887,7 +9024,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5362"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4749"
}
},
{
@ -8914,7 +9051,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5373"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4760"
}
},
{
@ -8955,7 +9092,7 @@
"title": "number",
"description": "Number is a number",
"examples": [
22
23
],
"type": [
"number"
@ -8967,7 +9104,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5384"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4771"
}
},
{
@ -9055,7 +9192,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5395"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4782"
}
},
{
@ -9506,7 +9643,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5406"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4793"
}
},
{
@ -9673,7 +9810,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5417"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4804"
}
},
{
@ -9846,7 +9983,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5428"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4815"
}
},
{
@ -9914,7 +10051,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5439"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4826"
}
},
{
@ -9982,7 +10119,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5450"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4837"
}
},
{
@ -10143,7 +10280,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5461"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4848"
}
},
{
@ -10188,7 +10325,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5483"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4870"
}
},
{
@ -10233,7 +10370,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5494"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4881"
}
},
{
@ -10260,7 +10397,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5505"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4892"
}
}
]

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
"openrpc": "1.2.6",
"info": {
"title": "Lotus RPC API",
"version": "1.27.0"
"version": "1.27.1-rc1"
},
"methods": [
{
@ -161,7 +161,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7331"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6223"
}
},
{
@ -252,7 +252,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7342"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6234"
}
},
{
@ -420,7 +420,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7353"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6245"
}
},
{
@ -447,7 +447,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7364"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6256"
}
},
{
@ -597,7 +597,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7375"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6267"
}
},
{
@ -700,7 +700,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7386"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6278"
}
},
{
@ -803,7 +803,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7397"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6289"
}
},
{
@ -925,7 +925,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7408"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6300"
}
},
{
@ -1135,7 +1135,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7419"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6311"
}
},
{
@ -1306,7 +1306,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7430"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6322"
}
},
{
@ -3350,7 +3350,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7441"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6333"
}
},
{
@ -3470,7 +3470,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7452"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6344"
}
},
{
@ -3531,7 +3531,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7463"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6355"
}
},
{
@ -3569,7 +3569,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7474"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6366"
}
},
{
@ -3729,7 +3729,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7485"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6377"
}
},
{
@ -3913,7 +3913,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7496"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6388"
}
},
{
@ -4054,7 +4054,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7507"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6399"
}
},
{
@ -4107,7 +4107,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7518"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6410"
}
},
{
@ -4250,7 +4250,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7529"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6421"
}
},
{
@ -4474,7 +4474,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7540"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6432"
}
},
{
@ -4601,7 +4601,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7551"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6443"
}
},
{
@ -4768,7 +4768,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7562"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6454"
}
},
{
@ -4895,7 +4895,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7573"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6465"
}
},
{
@ -4933,7 +4933,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7584"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6476"
}
},
{
@ -4972,7 +4972,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7595"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6487"
}
},
{
@ -4995,7 +4995,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7606"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6498"
}
},
{
@ -5034,7 +5034,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7617"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6509"
}
},
{
@ -5057,7 +5057,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7628"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6520"
}
},
{
@ -5096,7 +5096,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7639"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6531"
}
},
{
@ -5130,7 +5130,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7650"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6542"
}
},
{
@ -5184,7 +5184,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7661"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6553"
}
},
{
@ -5223,7 +5223,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7672"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6564"
}
},
{
@ -5262,7 +5262,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7683"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6575"
}
},
{
@ -5297,7 +5297,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7694"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6586"
}
},
{
@ -5477,7 +5477,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7705"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6597"
}
},
{
@ -5506,7 +5506,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7716"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6608"
}
},
{
@ -5529,7 +5529,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7727"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6619"
}
}
]

View File

@ -28,13 +28,31 @@ var PanicReportingPath = "panic-reports"
// the lotus journal to be included in the panic report.
var PanicReportJournalTail = defaultJournalTail
// GeneratePanicReport produces a timestamped dump of the application state
// GenerateNodePanicReport produces a timestamped dump of the application state
// for inspection and debugging purposes. Call this function from any place
// where a panic or severe error needs to be examined. `persistPath` is the
// path where the reports should be saved. `repoPath` is the path where the
// journal should be read from. `label` is an optional string to include
// next to the report timestamp.
func GeneratePanicReport(persistPath, repoPath, label string) {
//
// This function should be called for panics originating from the Lotus daemon.
func GenerateNodePanicReport(persistPath, repoPath, label string) {
generatePanicReport(NodeUserVersion(), persistPath, repoPath, label)
}
// GenerateMinerPanicReport produces a timestamped dump of the application state
// for inspection and debugging purposes. Call this function from any place
// where a panic or severe error needs to be examined. `persistPath` is the
// path where the reports should be saved. `repoPath` is the path where the
// journal should be read from. `label` is an optional string to include
// next to the report timestamp.
//
// This function should be called for panics originating from the Lotus miner.
func GenerateMinerPanicReport(persistPath, repoPath, label string) {
generatePanicReport(MinerUserVersion(), persistPath, repoPath, label)
}
func generatePanicReport(buildVersion BuildVersion, persistPath, repoPath, label string) {
// make sure we always dump the latest logs on the way out
// especially since we're probably panicking
defer panicLog.Sync() //nolint:errcheck
@ -64,21 +82,21 @@ func GeneratePanicReport(persistPath, repoPath, label string) {
return
}
writeAppVersion(filepath.Join(reportPath, "version"))
writeAppVersion(buildVersion, filepath.Join(reportPath, "version"))
writeStackTrace(filepath.Join(reportPath, "stacktrace.dump"))
writeProfile("goroutines", filepath.Join(reportPath, "goroutines.pprof.gz"))
writeProfile("heap", filepath.Join(reportPath, "heap.pprof.gz"))
writeJournalTail(PanicReportJournalTail, repoPath, filepath.Join(reportPath, "journal.ndjson"))
}
func writeAppVersion(file string) {
func writeAppVersion(buildVersion BuildVersion, file string) {
f, err := os.Create(file)
if err != nil {
panicLog.Error(err.Error())
}
defer f.Close() //nolint:errcheck
versionString := []byte(BuildVersion + BuildTypeString() + CurrentCommit + "\n")
versionString := []byte(string(buildVersion) + BuildTypeString() + CurrentCommit + "\n")
if _, err := f.Write(versionString); err != nil {
panicLog.Error(err.Error())
}

View File

@ -23,7 +23,7 @@ var NetworkBundle = "devnet"
var BundleOverrides map[actorstypes.Version]string
var ActorDebugging = true
var GenesisNetworkVersion = network.Version21
var GenesisNetworkVersion = network.Version22
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
@ -67,9 +67,11 @@ var UpgradeThunderHeight = abi.ChainEpoch(-23)
var UpgradeWatermelonHeight = abi.ChainEpoch(-24)
var UpgradeDragonHeight = abi.ChainEpoch(20)
var UpgradeDragonHeight = abi.ChainEpoch(-24)
var UpgradePhoenixHeight = UpgradeDragonHeight + 120
var UpgradePhoenixHeight = abi.ChainEpoch(-25)
var UpgradeAussieHeight = abi.ChainEpoch(200)
// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight = -100
@ -154,6 +156,7 @@ func init() {
UpgradeThunderHeight = getUpgradeHeight("LOTUS_THUNDER_HEIGHT", UpgradeThunderHeight)
UpgradeWatermelonHeight = getUpgradeHeight("LOTUS_WATERMELON_HEIGHT", UpgradeWatermelonHeight)
UpgradeDragonHeight = getUpgradeHeight("LOTUS_DRAGON_HEIGHT", UpgradeDragonHeight)
UpgradeAussieHeight = getUpgradeHeight("LOTUS_AUSSIE_HEIGHT", UpgradeAussieHeight)
UpgradePhoenixHeight = getUpgradeHeight("LOTUS_PHOENIX_HEIGHT", UpgradePhoenixHeight)
DrandSchedule = map[abi.ChainEpoch]DrandEnum{

View File

@ -56,10 +56,10 @@ const UpgradeHyggeHeight = -21
const UpgradeLightningHeight = -22
const UpgradeThunderHeight = -23
const UpgradeWatermelonHeight = -24
const UpgradeDragonHeight = -25
const UpgradePhoenixHeight = -26
const UpgradeDragonHeight = 5760
const UpgradePhoenixHeight = UpgradeDragonHeight + 120
const UpgradeAussieHeight = 400
// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight = -100

View File

@ -98,6 +98,9 @@ const UpgradePhoenixHeight = UpgradeDragonHeight + 120
// 2024-04-03T11:00:00Z
const UpgradeCalibrationDragonFixHeight = 1493854
// ?????
const UpgradeAussieHeight = 999999999999999
var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,

View File

@ -54,8 +54,9 @@ var UpgradeHyggeHeight = abi.ChainEpoch(-21)
var UpgradeLightningHeight = abi.ChainEpoch(-22)
var UpgradeThunderHeight = abi.ChainEpoch(-23)
var UpgradeWatermelonHeight = abi.ChainEpoch(-24)
var UpgradeDragonHeight = abi.ChainEpoch(-25)
const UpgradeDragonHeight = 50
const UpgradeAussieHeight = 50
const UpgradePhoenixHeight = UpgradeDragonHeight + 100

View File

@ -100,11 +100,14 @@ const UpgradeThunderHeight = UpgradeLightningHeight + 2880*21
const UpgradeWatermelonHeight = 3469380
// 2024-04-24T14:00:00Z
var UpgradeDragonHeight = abi.ChainEpoch(3855360)
const UpgradeDragonHeight = 3855360
// This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet
// 2024-04-11T15:00:00Z
var UpgradePhoenixHeight = UpgradeDragonHeight + 120
const UpgradePhoenixHeight = UpgradeDragonHeight + 120
// ??????
var UpgradeAussieHeight = abi.ChainEpoch(9999999999)
// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight = -1
@ -130,10 +133,8 @@ func init() {
SetAddressNetwork(address.Mainnet)
}
if os.Getenv("LOTUS_DISABLE_DRAGON") == "1" {
UpgradeDragonHeight = math.MaxInt64 - 1
delete(DrandSchedule, UpgradePhoenixHeight)
UpgradePhoenixHeight = math.MaxInt64
if os.Getenv("LOTUS_DISABLE_AUSSIE") == "1" {
UpgradeAussieHeight = math.MaxInt64 - 1
}
// NOTE: DO NOT change this unless you REALLY know what you're doing. This is not consensus critical, however,

View File

@ -30,7 +30,7 @@ const AllowableClockDriftSecs = uint64(1)
/* inline-gen template
const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
/* inline-gen start */
const TestNetworkVersion = network.Version22
const TestNetworkVersion = network.Version23
/* inline-gen end */

View File

@ -115,6 +115,7 @@ var (
UpgradeDragonHeight abi.ChainEpoch = -26
UpgradePhoenixHeight abi.ChainEpoch = -27
UpgradeCalibrationDragonFixHeight abi.ChainEpoch = -28
UpgradeAussieHeight abi.ChainEpoch = -29
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,

View File

@ -2,6 +2,8 @@ package build
import "os"
type BuildVersion string
var CurrentCommit string
var BuildType int
@ -36,13 +38,24 @@ func BuildTypeString() string {
}
}
// BuildVersion is the local build version
const BuildVersion = "1.27.0"
// NodeBuildVersion is the local build version of the Lotus daemon
const NodeBuildVersion string = "1.27.1-rc1"
func UserVersion() string {
func NodeUserVersion() BuildVersion {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
return BuildVersion
return BuildVersion(NodeBuildVersion)
}
return BuildVersion + BuildTypeString() + CurrentCommit
return BuildVersion(NodeBuildVersion + BuildTypeString() + CurrentCommit)
}
// MinerBuildVersion is the local build version of the Lotus miner
const MinerBuildVersion = "1.27.1-rc1"
func MinerUserVersion() BuildVersion {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
return BuildVersion(MinerBuildVersion)
}
return BuildVersion(MinerBuildVersion + BuildTypeString() + CurrentCommit)
}

View File

@ -6,7 +6,7 @@ import (
"github.com/filecoin-project/go-address"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/manifest"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
@ -22,7 +22,7 @@ import (
"github.com/filecoin-project/lotus/chain/types"
)
var Methods = builtin13.MethodsAccount
var Methods = builtin14.MethodsAccount
func Load(store adt.Store, act *types.Actor) (State, error) {
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
@ -50,6 +50,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -123,6 +126,9 @@ func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (S
case actorstypes.Version13:
return make13(store, addr)
case actorstypes.Version14:
return make14(store, addr)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@ -153,5 +159,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

62
chain/actors/builtin/account/v14.go generated Normal file
View File

@ -0,0 +1,62 @@
package account
import (
"fmt"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
actorstypes "github.com/filecoin-project/go-state-types/actors"
account14 "github.com/filecoin-project/go-state-types/builtin/v14/account"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store, addr address.Address) (State, error) {
out := state14{store: store}
out.State = account14.State{Address: addr}
return &out, nil
}
type state14 struct {
account14.State
store adt.Store
}
func (s *state14) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) ActorKey() string {
return manifest.AccountKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

View File

@ -5,7 +5,7 @@ import (
"golang.org/x/xerrors"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/manifest"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
@ -46,6 +46,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -119,13 +122,16 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
case actorstypes.Version13:
return make13(store)
case actorstypes.Version14:
return make14(store)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
var (
Address = builtin13.CronActorAddr
Methods = builtin13.MethodsCron
Address = builtin14.CronActorAddr
Methods = builtin14.MethodsCron
)
type State interface {
@ -151,5 +157,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

57
chain/actors/builtin/cron/v14.go generated Normal file
View File

@ -0,0 +1,57 @@
package cron
import (
"fmt"
"github.com/ipfs/go-cid"
actorstypes "github.com/filecoin-project/go-state-types/actors"
cron14 "github.com/filecoin-project/go-state-types/builtin/v14/cron"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store) (State, error) {
out := state14{store: store}
out.State = *cron14.ConstructState(cron14.BuiltInEntries())
return &out, nil
}
type state14 struct {
cron14.State
store adt.Store
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) ActorKey() string {
return manifest.CronKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

View File

@ -7,7 +7,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/manifest"
@ -17,8 +17,8 @@ import (
)
var (
Address = builtin13.DatacapActorAddr
Methods = builtin13.MethodsDatacap
Address = builtin14.DatacapActorAddr
Methods = builtin14.MethodsDatacap
)
func Load(store adt.Store, act *types.Actor) (State, error) {
@ -44,6 +44,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -68,6 +71,9 @@ func MakeState(store adt.Store, av actorstypes.Version, governor address.Address
case actorstypes.Version13:
return make13(store, governor, bitwidth)
case actorstypes.Version14:
return make14(store, governor, bitwidth)
default:
return nil, xerrors.Errorf("datacap actor only valid for actors v9 and above, got %d", av)
}
@ -93,5 +99,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

82
chain/actors/builtin/datacap/v14.go generated Normal file
View File

@ -0,0 +1,82 @@
package datacap
import (
"fmt"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
datacap14 "github.com/filecoin-project/go-state-types/builtin/v14/datacap"
adt14 "github.com/filecoin-project/go-state-types/builtin/v14/util/adt"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store, governor address.Address, bitwidth uint64) (State, error) {
out := state14{store: store}
s, err := datacap14.ConstructState(store, governor, bitwidth)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state14 struct {
datacap14.State
store adt.Store
}
func (s *state14) Governor() (address.Address, error) {
return s.State.Governor, nil
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) ForEachClient(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachClient(s.store, actors.Version14, s.verifiedClients, cb)
}
func (s *state14) verifiedClients() (adt.Map, error) {
return adt14.AsMap(s.store, s.Token.Balances, int(s.Token.HamtBitWidth))
}
func (s *state14) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
return getDataCap(s.store, actors.Version14, s.verifiedClients, addr)
}
func (s *state14) ActorKey() string {
return manifest.DatacapKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

View File

@ -5,7 +5,7 @@ import (
"golang.org/x/xerrors"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/go-state-types/manifest"
@ -15,7 +15,7 @@ import (
"github.com/filecoin-project/lotus/chain/types"
)
var Methods = builtin13.MethodsEVM
var Methods = builtin14.MethodsEVM
// See https://github.com/filecoin-project/builtin-actors/blob/6e781444cee5965278c46ef4ffe1fb1970f18d7d/actors/evm/src/lib.rs#L35-L42
const (
@ -49,6 +49,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -70,6 +73,9 @@ func MakeState(store adt.Store, av actorstypes.Version, bytecode cid.Cid) (State
case actorstypes.Version13:
return make13(store, bytecode)
case actorstypes.Version14:
return make14(store, bytecode)
default:
return nil, xerrors.Errorf("evm actor only valid for actors v10 and above, got %d", av)
}

72
chain/actors/builtin/evm/v14.go generated Normal file
View File

@ -0,0 +1,72 @@
package evm
import (
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-state-types/abi"
evm14 "github.com/filecoin-project/go-state-types/builtin/v14/evm"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store, bytecode cid.Cid) (State, error) {
out := state14{store: store}
s, err := evm14.ConstructState(store, bytecode)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state14 struct {
evm14.State
store adt.Store
}
func (s *state14) Nonce() (uint64, error) {
return s.State.Nonce, nil
}
func (s *state14) IsAlive() (bool, error) {
return s.State.Tombstone == nil, nil
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) GetBytecodeCID() (cid.Cid, error) {
return s.State.Bytecode, nil
}
func (s *state14) GetBytecodeHash() ([32]byte, error) {
return s.State.BytecodeHash, nil
}
func (s *state14) GetBytecode() ([]byte, error) {
bc, err := s.GetBytecodeCID()
if err != nil {
return nil, err
}
var byteCode abi.CborBytesTransparent
if err := s.store.Get(s.store.Context(), bc, &byteCode); err != nil {
return nil, err
}
return byteCode, nil
}

View File

@ -7,7 +7,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/manifest"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
@ -25,8 +25,8 @@ import (
)
var (
Address = builtin13.InitActorAddr
Methods = builtin13.MethodsInit
Address = builtin14.InitActorAddr
Methods = builtin14.MethodsInit
)
func Load(store adt.Store, act *types.Actor) (State, error) {
@ -55,6 +55,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -128,6 +131,9 @@ func MakeState(store adt.Store, av actorstypes.Version, networkName string) (Sta
case actorstypes.Version13:
return make13(store, networkName)
case actorstypes.Version14:
return make14(store, networkName)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@ -181,5 +187,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

147
chain/actors/builtin/init/v14.go generated Normal file
View File

@ -0,0 +1,147 @@
package init
import (
"crypto/sha256"
"fmt"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
adt14 "github.com/filecoin-project/go-state-types/builtin/v14/util/adt"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store, networkName string) (State, error) {
out := state14{store: store}
s, err := init14.ConstructState(store, networkName)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state14 struct {
init14.State
store adt.Store
}
func (s *state14) ResolveAddress(address address.Address) (address.Address, bool, error) {
return s.State.ResolveAddress(s.store, address)
}
func (s *state14) MapAddressToNewID(address address.Address) (address.Address, error) {
return s.State.MapAddressToNewID(s.store, address)
}
func (s *state14) ForEachActor(cb func(id abi.ActorID, address address.Address) error) error {
addrs, err := adt14.AsMap(s.store, s.State.AddressMap, builtin14.DefaultHamtBitwidth)
if err != nil {
return err
}
var actorID cbg.CborInt
return addrs.ForEach(&actorID, func(key string) error {
addr, err := address.NewFromBytes([]byte(key))
if err != nil {
return err
}
return cb(abi.ActorID(actorID), addr)
})
}
func (s *state14) NetworkName() (dtypes.NetworkName, error) {
return dtypes.NetworkName(s.State.NetworkName), nil
}
func (s *state14) SetNetworkName(name string) error {
s.State.NetworkName = name
return nil
}
func (s *state14) SetNextID(id abi.ActorID) error {
s.State.NextID = id
return nil
}
func (s *state14) Remove(addrs ...address.Address) (err error) {
m, err := adt14.AsMap(s.store, s.State.AddressMap, builtin14.DefaultHamtBitwidth)
if err != nil {
return err
}
for _, addr := range addrs {
if err = m.Delete(abi.AddrKey(addr)); err != nil {
return xerrors.Errorf("failed to delete entry for address: %s; err: %w", addr, err)
}
}
amr, err := m.Root()
if err != nil {
return xerrors.Errorf("failed to get address map root: %w", err)
}
s.State.AddressMap = amr
return nil
}
func (s *state14) SetAddressMap(mcid cid.Cid) error {
s.State.AddressMap = mcid
return nil
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) AddressMap() (adt.Map, error) {
return adt14.AsMap(s.store, s.State.AddressMap, builtin14.DefaultHamtBitwidth)
}
func (s *state14) AddressMapBitWidth() int {
return builtin14.DefaultHamtBitwidth
}
func (s *state14) AddressMapHashFunction() func(input []byte) []byte {
return func(input []byte) []byte {
res := sha256.Sum256(input)
return res[:]
}
}
func (s *state14) ActorKey() string {
return manifest.InitKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

View File

@ -143,6 +143,7 @@ type DealProposal = markettypes.DealProposal
type DealLabel = markettypes.DealLabel
type DealState interface {
SectorNumber() abi.SectorNumber // 0 if not yet included in proven sector (0 is also a valid sector number)
SectorStartEpoch() abi.ChainEpoch // -1 if not yet included in proven sector
LastUpdatedEpoch() abi.ChainEpoch // -1 if deal state never updated
SlashEpoch() abi.ChainEpoch // -1 if deal never slashed
@ -185,6 +186,10 @@ type ProposalIDState struct {
type emptyDealState struct{}
func (e *emptyDealState) SectorNumber() abi.SectorNumber {
return 0
}
func (e *emptyDealState) SectorStartEpoch() abi.ChainEpoch {
return -1
}

View File

@ -61,6 +61,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -134,6 +137,9 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
case actorstypes.Version13:
return make13(store)
case actorstypes.Version14:
return make14(store)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@ -235,6 +241,9 @@ func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStora
case actorstypes.Version13:
return decodePublishStorageDealsReturn13(b)
case actorstypes.Version14:
return decodePublishStorageDealsReturn14(b)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@ -243,6 +252,7 @@ type DealProposal = markettypes.DealProposal
type DealLabel = markettypes.DealLabel
type DealState interface {
SectorNumber() abi.SectorNumber // 0 if not yet included in proven sector (0 is also a valid sector number)
SectorStartEpoch() abi.ChainEpoch // -1 if not yet included in proven sector
LastUpdatedEpoch() abi.ChainEpoch // -1 if deal state never updated
SlashEpoch() abi.ChainEpoch // -1 if deal never slashed
@ -284,6 +294,10 @@ type ProposalIDState struct {
type emptyDealState struct{}
func (e *emptyDealState) SectorNumber() abi.SectorNumber {
return 0
}
func (e *emptyDealState) SectorStartEpoch() abi.ChainEpoch {
return -1
}
@ -356,5 +370,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

View File

@ -212,6 +212,14 @@ type dealStateV{{.v}} struct {
ds{{.v}} market{{.v}}.DealState
}
func (d dealStateV{{.v}}) SectorNumber() abi.SectorNumber {
{{if (le .v 12)}}
return 0
{{else}}
return d.ds{{.v}}.SectorNumber
{{end}}
}
func (d dealStateV{{.v}}) SectorStartEpoch() abi.ChainEpoch {
return d.ds{{.v}}.SectorStartEpoch
}

View File

@ -191,6 +191,12 @@ type dealStateV0 struct {
ds0 market0.DealState
}
func (d dealStateV0) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV0) SectorStartEpoch() abi.ChainEpoch {
return d.ds0.SectorStartEpoch
}

View File

@ -190,6 +190,12 @@ type dealStateV10 struct {
ds10 market10.DealState
}
func (d dealStateV10) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV10) SectorStartEpoch() abi.ChainEpoch {
return d.ds10.SectorStartEpoch
}

View File

@ -190,6 +190,12 @@ type dealStateV11 struct {
ds11 market11.DealState
}
func (d dealStateV11) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV11) SectorStartEpoch() abi.ChainEpoch {
return d.ds11.SectorStartEpoch
}

View File

@ -190,6 +190,12 @@ type dealStateV12 struct {
ds12 market12.DealState
}
func (d dealStateV12) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV12) SectorStartEpoch() abi.ChainEpoch {
return d.ds12.SectorStartEpoch
}

View File

@ -190,6 +190,12 @@ type dealStateV13 struct {
ds13 market13.DealState
}
func (d dealStateV13) SectorNumber() abi.SectorNumber {
return d.ds13.SectorNumber
}
func (d dealStateV13) SectorStartEpoch() abi.ChainEpoch {
return d.ds13.SectorStartEpoch
}

410
chain/actors/builtin/market/v14.go generated Normal file
View File

@ -0,0 +1,410 @@
package market
import (
"bytes"
"fmt"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/builtin"
market14 "github.com/filecoin-project/go-state-types/builtin/v14/market"
adt14 "github.com/filecoin-project/go-state-types/builtin/v14/util/adt"
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
verifregtypes "github.com/filecoin-project/lotus/chain/actors/builtin/verifreg"
"github.com/filecoin-project/lotus/chain/types"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store) (State, error) {
out := state14{store: store}
s, err := market14.ConstructState(store)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state14 struct {
market14.State
store adt.Store
}
func (s *state14) TotalLocked() (abi.TokenAmount, error) {
fml := types.BigAdd(s.TotalClientLockedCollateral, s.TotalProviderLockedCollateral)
fml = types.BigAdd(fml, s.TotalClientStorageFee)
return fml, nil
}
func (s *state14) BalancesChanged(otherState State) (bool, error) {
otherState14, ok := otherState.(*state14)
if !ok {
// there's no way to compare different versions of the state, so let's
// just say that means the state of balances has changed
return true, nil
}
return !s.State.EscrowTable.Equals(otherState14.State.EscrowTable) || !s.State.LockedTable.Equals(otherState14.State.LockedTable), nil
}
func (s *state14) StatesChanged(otherState State) (bool, error) {
otherState14, ok := otherState.(*state14)
if !ok {
// there's no way to compare different versions of the state, so let's
// just say that means the state of balances has changed
return true, nil
}
return !s.State.States.Equals(otherState14.State.States), nil
}
func (s *state14) States() (DealStates, error) {
stateArray, err := adt14.AsArray(s.store, s.State.States, market14.StatesAmtBitwidth)
if err != nil {
return nil, err
}
return &dealStates14{stateArray}, nil
}
func (s *state14) ProposalsChanged(otherState State) (bool, error) {
otherState14, ok := otherState.(*state14)
if !ok {
// there's no way to compare different versions of the state, so let's
// just say that means the state of balances has changed
return true, nil
}
return !s.State.Proposals.Equals(otherState14.State.Proposals), nil
}
func (s *state14) Proposals() (DealProposals, error) {
proposalArray, err := adt14.AsArray(s.store, s.State.Proposals, market14.ProposalsAmtBitwidth)
if err != nil {
return nil, err
}
return &dealProposals14{proposalArray}, nil
}
func (s *state14) EscrowTable() (BalanceTable, error) {
bt, err := adt14.AsBalanceTable(s.store, s.State.EscrowTable)
if err != nil {
return nil, err
}
return &balanceTable14{bt}, nil
}
func (s *state14) LockedTable() (BalanceTable, error) {
bt, err := adt14.AsBalanceTable(s.store, s.State.LockedTable)
if err != nil {
return nil, err
}
return &balanceTable14{bt}, nil
}
func (s *state14) VerifyDealsForActivation(
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
) (weight, verifiedWeight abi.DealWeight, err error) {
w, vw, _, err := market14.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch)
return w, vw, err
}
func (s *state14) NextID() (abi.DealID, error) {
return s.State.NextID, nil
}
type balanceTable14 struct {
*adt14.BalanceTable
}
func (bt *balanceTable14) ForEach(cb func(address.Address, abi.TokenAmount) error) error {
asMap := (*adt14.Map)(bt.BalanceTable)
var ta abi.TokenAmount
return asMap.ForEach(&ta, func(key string) error {
a, err := address.NewFromBytes([]byte(key))
if err != nil {
return err
}
return cb(a, ta)
})
}
type dealStates14 struct {
adt.Array
}
func (s *dealStates14) Get(dealID abi.DealID) (DealState, bool, error) {
var deal14 market14.DealState
found, err := s.Array.Get(uint64(dealID), &deal14)
if err != nil {
return nil, false, err
}
if !found {
return nil, false, nil
}
deal := fromV14DealState(deal14)
return deal, true, nil
}
func (s *dealStates14) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
var ds14 market14.DealState
return s.Array.ForEach(&ds14, func(idx int64) error {
return cb(abi.DealID(idx), fromV14DealState(ds14))
})
}
func (s *dealStates14) decode(val *cbg.Deferred) (DealState, error) {
var ds14 market14.DealState
if err := ds14.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
return nil, err
}
ds := fromV14DealState(ds14)
return ds, nil
}
func (s *dealStates14) array() adt.Array {
return s.Array
}
type dealStateV14 struct {
ds14 market14.DealState
}
func (d dealStateV14) SectorNumber() abi.SectorNumber {
return d.ds14.SectorNumber
}
func (d dealStateV14) SectorStartEpoch() abi.ChainEpoch {
return d.ds14.SectorStartEpoch
}
func (d dealStateV14) LastUpdatedEpoch() abi.ChainEpoch {
return d.ds14.LastUpdatedEpoch
}
func (d dealStateV14) SlashEpoch() abi.ChainEpoch {
return d.ds14.SlashEpoch
}
func (d dealStateV14) Equals(other DealState) bool {
if ov14, ok := other.(dealStateV14); ok {
return d.ds14 == ov14.ds14
}
if d.SectorStartEpoch() != other.SectorStartEpoch() {
return false
}
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
return false
}
if d.SlashEpoch() != other.SlashEpoch() {
return false
}
return true
}
var _ DealState = (*dealStateV14)(nil)
func fromV14DealState(v14 market14.DealState) DealState {
return dealStateV14{v14}
}
type dealProposals14 struct {
adt.Array
}
func (s *dealProposals14) Get(dealID abi.DealID) (*DealProposal, bool, error) {
var proposal14 market14.DealProposal
found, err := s.Array.Get(uint64(dealID), &proposal14)
if err != nil {
return nil, false, err
}
if !found {
return nil, false, nil
}
proposal, err := fromV14DealProposal(proposal14)
if err != nil {
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
}
return &proposal, true, nil
}
func (s *dealProposals14) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
var dp14 market14.DealProposal
return s.Array.ForEach(&dp14, func(idx int64) error {
dp, err := fromV14DealProposal(dp14)
if err != nil {
return xerrors.Errorf("decoding proposal: %w", err)
}
return cb(abi.DealID(idx), dp)
})
}
func (s *dealProposals14) decode(val *cbg.Deferred) (*DealProposal, error) {
var dp14 market14.DealProposal
if err := dp14.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
return nil, err
}
dp, err := fromV14DealProposal(dp14)
if err != nil {
return nil, err
}
return &dp, nil
}
func (s *dealProposals14) array() adt.Array {
return s.Array
}
func fromV14DealProposal(v14 market14.DealProposal) (DealProposal, error) {
label, err := fromV14Label(v14.Label)
if err != nil {
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
}
return DealProposal{
PieceCID: v14.PieceCID,
PieceSize: v14.PieceSize,
VerifiedDeal: v14.VerifiedDeal,
Client: v14.Client,
Provider: v14.Provider,
Label: label,
StartEpoch: v14.StartEpoch,
EndEpoch: v14.EndEpoch,
StoragePricePerEpoch: v14.StoragePricePerEpoch,
ProviderCollateral: v14.ProviderCollateral,
ClientCollateral: v14.ClientCollateral,
}, nil
}
func fromV14Label(v14 market14.DealLabel) (DealLabel, error) {
if v14.IsString() {
str, err := v14.ToString()
if err != nil {
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert string label to string: %w", err)
}
return markettypes.NewLabelFromString(str)
}
bs, err := v14.ToBytes()
if err != nil {
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert bytes label to bytes: %w", err)
}
return markettypes.NewLabelFromBytes(bs)
}
func (s *state14) GetState() interface{} {
return &s.State
}
var _ PublishStorageDealsReturn = (*publishStorageDealsReturn14)(nil)
func decodePublishStorageDealsReturn14(b []byte) (PublishStorageDealsReturn, error) {
var retval market14.PublishStorageDealsReturn
if err := retval.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
return nil, xerrors.Errorf("failed to unmarshal PublishStorageDealsReturn: %w", err)
}
return &publishStorageDealsReturn14{retval}, nil
}
type publishStorageDealsReturn14 struct {
market14.PublishStorageDealsReturn
}
func (r *publishStorageDealsReturn14) IsDealValid(index uint64) (bool, int, error) {
set, err := r.ValidDeals.IsSet(index)
if err != nil || !set {
return false, -1, err
}
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
if err != nil {
return false, -1, err
}
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
if err != nil {
return false, -1, err
}
outIdx, err := before.Count()
if err != nil {
return false, -1, err
}
return set, int(outIdx), nil
}
func (r *publishStorageDealsReturn14) DealIDs() ([]abi.DealID, error) {
return r.IDs, nil
}
func (s *state14) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
allocations, err := adt14.AsMap(s.store, s.PendingDealAllocationIds, builtin.DefaultHamtBitwidth)
if err != nil {
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
}
var allocationId cbg.CborInt
found, err := allocations.Get(abi.UIntKey(uint64(dealId)), &allocationId)
if err != nil {
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
}
if !found {
return verifregtypes.NoAllocationID, nil
}
return verifregtypes.AllocationId(allocationId), nil
}
func (s *state14) ActorKey() string {
return manifest.MarketKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

View File

@ -191,6 +191,12 @@ type dealStateV2 struct {
ds2 market2.DealState
}
func (d dealStateV2) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV2) SectorStartEpoch() abi.ChainEpoch {
return d.ds2.SectorStartEpoch
}

View File

@ -186,6 +186,12 @@ type dealStateV3 struct {
ds3 market3.DealState
}
func (d dealStateV3) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV3) SectorStartEpoch() abi.ChainEpoch {
return d.ds3.SectorStartEpoch
}

View File

@ -186,6 +186,12 @@ type dealStateV4 struct {
ds4 market4.DealState
}
func (d dealStateV4) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV4) SectorStartEpoch() abi.ChainEpoch {
return d.ds4.SectorStartEpoch
}

View File

@ -186,6 +186,12 @@ type dealStateV5 struct {
ds5 market5.DealState
}
func (d dealStateV5) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV5) SectorStartEpoch() abi.ChainEpoch {
return d.ds5.SectorStartEpoch
}

View File

@ -188,6 +188,12 @@ type dealStateV6 struct {
ds6 market6.DealState
}
func (d dealStateV6) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV6) SectorStartEpoch() abi.ChainEpoch {
return d.ds6.SectorStartEpoch
}

View File

@ -188,6 +188,12 @@ type dealStateV7 struct {
ds7 market7.DealState
}
func (d dealStateV7) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV7) SectorStartEpoch() abi.ChainEpoch {
return d.ds7.SectorStartEpoch
}

View File

@ -189,6 +189,12 @@ type dealStateV8 struct {
ds8 market8.DealState
}
func (d dealStateV8) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV8) SectorStartEpoch() abi.ChainEpoch {
return d.ds8.SectorStartEpoch
}

View File

@ -190,6 +190,12 @@ type dealStateV9 struct {
ds9 market9.DealState
}
func (d dealStateV9) SectorNumber() abi.SectorNumber {
return 0
}
func (d dealStateV9) SectorStartEpoch() abi.ChainEpoch {
return d.ds9.SectorStartEpoch
}

View File

@ -55,6 +55,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -128,6 +131,9 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
case actors.Version13:
return make13(store)
case actors.Version14:
return make14(store)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@ -391,5 +397,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

595
chain/actors/builtin/miner/v14.go generated Normal file
View File

@ -0,0 +1,595 @@
package miner
import (
"bytes"
"errors"
"fmt"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-bitfield"
rle "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner"
adt14 "github.com/filecoin-project/go-state-types/builtin/v14/util/adt"
"github.com/filecoin-project/go-state-types/dline"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store) (State, error) {
out := state14{store: store}
out.State = miner14.State{}
return &out, nil
}
type state14 struct {
miner14.State
store adt.Store
}
type deadline14 struct {
miner14.Deadline
store adt.Store
}
type partition14 struct {
miner14.Partition
store adt.Store
}
func (s *state14) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmount, err error) {
defer func() {
if r := recover(); r != nil {
err = xerrors.Errorf("failed to get available balance: %w", r)
available = abi.NewTokenAmount(0)
}
}()
// this panics if the miner doesn't have enough funds to cover their locked pledge
available, err = s.GetAvailableBalance(bal)
return available, err
}
func (s *state14) VestedFunds(epoch abi.ChainEpoch) (abi.TokenAmount, error) {
return s.CheckVestedFunds(s.store, epoch)
}
func (s *state14) LockedFunds() (LockedFunds, error) {
return LockedFunds{
VestingFunds: s.State.LockedFunds,
InitialPledgeRequirement: s.State.InitialPledge,
PreCommitDeposits: s.State.PreCommitDeposits,
}, nil
}
func (s *state14) FeeDebt() (abi.TokenAmount, error) {
return s.State.FeeDebt, nil
}
func (s *state14) InitialPledge() (abi.TokenAmount, error) {
return s.State.InitialPledge, nil
}
func (s *state14) PreCommitDeposits() (abi.TokenAmount, error) {
return s.State.PreCommitDeposits, nil
}
// Returns nil, nil if sector is not found
func (s *state14) GetSector(num abi.SectorNumber) (*SectorOnChainInfo, error) {
info, ok, err := s.State.GetSector(s.store, num)
if !ok || err != nil {
return nil, err
}
ret := fromV14SectorOnChainInfo(*info)
return &ret, nil
}
func (s *state14) FindSector(num abi.SectorNumber) (*SectorLocation, error) {
dlIdx, partIdx, err := s.State.FindSector(s.store, num)
if err != nil {
return nil, err
}
return &SectorLocation{
Deadline: dlIdx,
Partition: partIdx,
}, nil
}
func (s *state14) NumLiveSectors() (uint64, error) {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
return 0, err
}
var total uint64
if err := dls.ForEach(s.store, func(dlIdx uint64, dl *miner14.Deadline) error {
total += dl.LiveSectors
return nil
}); err != nil {
return 0, err
}
return total, nil
}
// GetSectorExpiration returns the effective expiration of the given sector.
//
// If the sector does not expire early, the Early expiration field is 0.
func (s *state14) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, error) {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
return nil, err
}
// NOTE: this can be optimized significantly.
// 1. If the sector is non-faulty, it will expire on-time (can be
// learned from the sector info).
// 2. If it's faulty, it will expire early within the first 42 entries
// of the expiration queue.
stopErr := errors.New("stop")
out := SectorExpiration{}
err = dls.ForEach(s.store, func(dlIdx uint64, dl *miner14.Deadline) error {
partitions, err := dl.PartitionsArray(s.store)
if err != nil {
return err
}
quant := s.State.QuantSpecForDeadline(dlIdx)
var part miner14.Partition
return partitions.ForEach(&part, func(partIdx int64) error {
if found, err := part.Sectors.IsSet(uint64(num)); err != nil {
return err
} else if !found {
return nil
}
if found, err := part.Terminated.IsSet(uint64(num)); err != nil {
return err
} else if found {
// already terminated
return stopErr
}
q, err := miner14.LoadExpirationQueue(s.store, part.ExpirationsEpochs, quant, miner14.PartitionExpirationAmtBitwidth)
if err != nil {
return err
}
var exp miner14.ExpirationSet
return q.ForEach(&exp, func(epoch int64) error {
if early, err := exp.EarlySectors.IsSet(uint64(num)); err != nil {
return err
} else if early {
out.Early = abi.ChainEpoch(epoch)
return nil
}
if onTime, err := exp.OnTimeSectors.IsSet(uint64(num)); err != nil {
return err
} else if onTime {
out.OnTime = abi.ChainEpoch(epoch)
return stopErr
}
return nil
})
})
})
if err == stopErr {
err = nil
}
if err != nil {
return nil, err
}
if out.Early == 0 && out.OnTime == 0 {
return nil, xerrors.Errorf("failed to find sector %d", num)
}
return &out, nil
}
func (s *state14) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
if !ok || err != nil {
return nil, err
}
ret := fromV14SectorPreCommitOnChainInfo(*info)
return &ret, nil
}
func (s *state14) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
precommitted, err := adt14.AsMap(s.store, s.State.PreCommittedSectors, builtin14.DefaultHamtBitwidth)
if err != nil {
return err
}
var info miner14.SectorPreCommitOnChainInfo
if err := precommitted.ForEach(&info, func(_ string) error {
return cb(fromV14SectorPreCommitOnChainInfo(info))
}); err != nil {
return err
}
return nil
}
func (s *state14) LoadSectors(snos *bitfield.BitField) ([]*SectorOnChainInfo, error) {
sectors, err := miner14.LoadSectors(s.store, s.State.Sectors)
if err != nil {
return nil, err
}
// If no sector numbers are specified, load all.
if snos == nil {
infos := make([]*SectorOnChainInfo, 0, sectors.Length())
var info14 miner14.SectorOnChainInfo
if err := sectors.ForEach(&info14, func(_ int64) error {
info := fromV14SectorOnChainInfo(info14)
infos = append(infos, &info)
return nil
}); err != nil {
return nil, err
}
return infos, nil
}
// Otherwise, load selected.
infos14, err := sectors.Load(*snos)
if err != nil {
return nil, err
}
infos := make([]*SectorOnChainInfo, len(infos14))
for i, info14 := range infos14 {
info := fromV14SectorOnChainInfo(*info14)
infos[i] = &info
}
return infos, nil
}
func (s *state14) loadAllocatedSectorNumbers() (bitfield.BitField, error) {
var allocatedSectors bitfield.BitField
err := s.store.Get(s.store.Context(), s.State.AllocatedSectors, &allocatedSectors)
return allocatedSectors, err
}
func (s *state14) IsAllocated(num abi.SectorNumber) (bool, error) {
allocatedSectors, err := s.loadAllocatedSectorNumbers()
if err != nil {
return false, err
}
return allocatedSectors.IsSet(uint64(num))
}
func (s *state14) GetProvingPeriodStart() (abi.ChainEpoch, error) {
return s.State.ProvingPeriodStart, nil
}
func (s *state14) UnallocatedSectorNumbers(count int) ([]abi.SectorNumber, error) {
allocatedSectors, err := s.loadAllocatedSectorNumbers()
if err != nil {
return nil, err
}
allocatedRuns, err := allocatedSectors.RunIterator()
if err != nil {
return nil, err
}
unallocatedRuns, err := rle.Subtract(
&rle.RunSliceIterator{Runs: []rle.Run{{Val: true, Len: abi.MaxSectorNumber}}},
allocatedRuns,
)
if err != nil {
return nil, err
}
iter, err := rle.BitsFromRuns(unallocatedRuns)
if err != nil {
return nil, err
}
sectors := make([]abi.SectorNumber, 0, count)
for iter.HasNext() && len(sectors) < count {
nextNo, err := iter.Next()
if err != nil {
return nil, err
}
sectors = append(sectors, abi.SectorNumber(nextNo))
}
return sectors, nil
}
func (s *state14) GetAllocatedSectors() (*bitfield.BitField, error) {
var allocatedSectors bitfield.BitField
if err := s.store.Get(s.store.Context(), s.State.AllocatedSectors, &allocatedSectors); err != nil {
return nil, err
}
return &allocatedSectors, nil
}
func (s *state14) LoadDeadline(idx uint64) (Deadline, error) {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
return nil, err
}
dl, err := dls.LoadDeadline(s.store, idx)
if err != nil {
return nil, err
}
return &deadline14{*dl, s.store}, nil
}
func (s *state14) ForEachDeadline(cb func(uint64, Deadline) error) error {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
return err
}
return dls.ForEach(s.store, func(i uint64, dl *miner14.Deadline) error {
return cb(i, &deadline14{*dl, s.store})
})
}
func (s *state14) NumDeadlines() (uint64, error) {
return miner14.WPoStPeriodDeadlines, nil
}
func (s *state14) DeadlinesChanged(other State) (bool, error) {
other14, ok := other.(*state14)
if !ok {
// treat an upgrade as a change, always
return true, nil
}
return !s.State.Deadlines.Equals(other14.Deadlines), nil
}
func (s *state14) MinerInfoChanged(other State) (bool, error) {
other0, ok := other.(*state14)
if !ok {
// treat an upgrade as a change, always
return true, nil
}
return !s.State.Info.Equals(other0.State.Info), nil
}
func (s *state14) Info() (MinerInfo, error) {
info, err := s.State.GetInfo(s.store)
if err != nil {
return MinerInfo{}, err
}
mi := MinerInfo{
Owner: info.Owner,
Worker: info.Worker,
ControlAddresses: info.ControlAddresses,
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
PeerId: info.PeerId,
Multiaddrs: info.Multiaddrs,
WindowPoStProofType: info.WindowPoStProofType,
SectorSize: info.SectorSize,
WindowPoStPartitionSectors: info.WindowPoStPartitionSectors,
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
Beneficiary: info.Beneficiary,
BeneficiaryTerm: BeneficiaryTerm(info.BeneficiaryTerm),
PendingBeneficiaryTerm: (*PendingBeneficiaryChange)(info.PendingBeneficiaryTerm),
}
return mi, nil
}
func (s *state14) DeadlineInfo(epoch abi.ChainEpoch) (*dline.Info, error) {
return s.State.RecordedDeadlineInfo(epoch), nil
}
func (s *state14) DeadlineCronActive() (bool, error) {
return s.State.DeadlineCronActive, nil
}
func (s *state14) sectors() (adt.Array, error) {
return adt14.AsArray(s.store, s.Sectors, miner14.SectorsAmtBitwidth)
}
func (s *state14) decodeSectorOnChainInfo(val *cbg.Deferred) (SectorOnChainInfo, error) {
var si miner14.SectorOnChainInfo
err := si.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return SectorOnChainInfo{}, err
}
return fromV14SectorOnChainInfo(si), nil
}
func (s *state14) precommits() (adt.Map, error) {
return adt14.AsMap(s.store, s.PreCommittedSectors, builtin14.DefaultHamtBitwidth)
}
func (s *state14) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
var sp miner14.SectorPreCommitOnChainInfo
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
if err != nil {
return SectorPreCommitOnChainInfo{}, err
}
return fromV14SectorPreCommitOnChainInfo(sp), nil
}
func (s *state14) EraseAllUnproven() error {
dls, err := s.State.LoadDeadlines(s.store)
if err != nil {
return err
}
err = dls.ForEach(s.store, func(dindx uint64, dl *miner14.Deadline) error {
ps, err := dl.PartitionsArray(s.store)
if err != nil {
return err
}
var part miner14.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)
})
if err != nil {
return err
}
return s.State.SaveDeadlines(s.store, dls)
}
func (d *deadline14) LoadPartition(idx uint64) (Partition, error) {
p, err := d.Deadline.LoadPartition(d.store, idx)
if err != nil {
return nil, err
}
return &partition14{*p, d.store}, nil
}
func (d *deadline14) ForEachPartition(cb func(uint64, Partition) error) error {
ps, err := d.Deadline.PartitionsArray(d.store)
if err != nil {
return err
}
var part miner14.Partition
return ps.ForEach(&part, func(i int64) error {
return cb(uint64(i), &partition14{part, d.store})
})
}
func (d *deadline14) PartitionsChanged(other Deadline) (bool, error) {
other14, ok := other.(*deadline14)
if !ok {
// treat an upgrade as a change, always
return true, nil
}
return !d.Deadline.Partitions.Equals(other14.Deadline.Partitions), nil
}
func (d *deadline14) PartitionsPoSted() (bitfield.BitField, error) {
return d.Deadline.PartitionsPoSted, nil
}
func (d *deadline14) DisputableProofCount() (uint64, error) {
ops, err := d.OptimisticProofsSnapshotArray(d.store)
if err != nil {
return 0, err
}
return ops.Length(), nil
}
func (p *partition14) AllSectors() (bitfield.BitField, error) {
return p.Partition.Sectors, nil
}
func (p *partition14) FaultySectors() (bitfield.BitField, error) {
return p.Partition.Faults, nil
}
func (p *partition14) RecoveringSectors() (bitfield.BitField, error) {
return p.Partition.Recoveries, nil
}
func (p *partition14) UnprovenSectors() (bitfield.BitField, error) {
return p.Partition.Unproven, nil
}
func fromV14SectorOnChainInfo(v14 miner14.SectorOnChainInfo) SectorOnChainInfo {
info := SectorOnChainInfo{
SectorNumber: v14.SectorNumber,
SealProof: v14.SealProof,
SealedCID: v14.SealedCID,
DealIDs: v14.DealIDs,
Activation: v14.Activation,
Expiration: v14.Expiration,
DealWeight: v14.DealWeight,
VerifiedDealWeight: v14.VerifiedDealWeight,
InitialPledge: v14.InitialPledge,
ExpectedDayReward: v14.ExpectedDayReward,
ExpectedStoragePledge: v14.ExpectedStoragePledge,
SectorKeyCID: v14.SectorKeyCID,
PowerBaseEpoch: v14.PowerBaseEpoch,
ReplacedDayReward: v14.ReplacedDayReward,
Flags: SectorOnChainInfoFlags(v14.Flags),
}
return info
}
func fromV14SectorPreCommitOnChainInfo(v14 miner14.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
ret := SectorPreCommitOnChainInfo{
Info: SectorPreCommitInfo{
SealProof: v14.Info.SealProof,
SectorNumber: v14.Info.SectorNumber,
SealedCID: v14.Info.SealedCID,
SealRandEpoch: v14.Info.SealRandEpoch,
DealIDs: v14.Info.DealIDs,
Expiration: v14.Info.Expiration,
UnsealedCid: nil,
},
PreCommitDeposit: v14.PreCommitDeposit,
PreCommitEpoch: v14.PreCommitEpoch,
}
ret.Info.UnsealedCid = v14.Info.UnsealedCid
return ret
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) ActorKey() string {
return manifest.MinerKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

View File

@ -8,7 +8,7 @@ import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
multisig10 "github.com/filecoin-project/go-state-types/builtin/v10/multisig"
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
@ -57,7 +57,7 @@ func (m message10) Create(
}
// new actors are created by invoking 'exec' on the init actor with the constructor params
execParams := &init13.ExecParams{
execParams := &init14.ExecParams{
CodeCID: code,
ConstructorParams: enc,
}

View File

@ -8,7 +8,7 @@ import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
multisig11 "github.com/filecoin-project/go-state-types/builtin/v11/multisig"
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
@ -57,7 +57,7 @@ func (m message11) Create(
}
// new actors are created by invoking 'exec' on the init actor with the constructor params
execParams := &init13.ExecParams{
execParams := &init14.ExecParams{
CodeCID: code,
ConstructorParams: enc,
}

View File

@ -8,7 +8,7 @@ import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
multisig12 "github.com/filecoin-project/go-state-types/builtin/v12/multisig"
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
@ -57,7 +57,7 @@ func (m message12) Create(
}
// new actors are created by invoking 'exec' on the init actor with the constructor params
execParams := &init13.ExecParams{
execParams := &init14.ExecParams{
CodeCID: code,
ConstructorParams: enc,
}

View File

@ -7,8 +7,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
multisig13 "github.com/filecoin-project/go-state-types/builtin/v13/multisig"
init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
@ -57,7 +57,7 @@ func (m message13) Create(
}
// new actors are created by invoking 'exec' on the init actor with the constructor params
execParams := &init13.ExecParams{
execParams := &init14.ExecParams{
CodeCID: code,
ConstructorParams: enc,
}

View File

@ -0,0 +1,77 @@
package multisig
import (
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
multisig14 "github.com/filecoin-project/go-state-types/builtin/v14/multisig"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
"github.com/filecoin-project/lotus/chain/types"
)
type message14 struct{ message0 }
func (m message14) Create(
signers []address.Address, threshold uint64,
unlockStart, unlockDuration abi.ChainEpoch,
initialAmount abi.TokenAmount,
) (*types.Message, error) {
lenAddrs := uint64(len(signers))
if lenAddrs < threshold {
return nil, xerrors.Errorf("cannot require signing of more addresses than provided for multisig")
}
if threshold == 0 {
threshold = lenAddrs
}
if m.from == address.Undef {
return nil, xerrors.Errorf("must provide source address")
}
// Set up constructor parameters for multisig
msigParams := &multisig14.ConstructorParams{
Signers: signers,
NumApprovalsThreshold: threshold,
UnlockDuration: unlockDuration,
StartEpoch: unlockStart,
}
enc, actErr := actors.SerializeParams(msigParams)
if actErr != nil {
return nil, actErr
}
code, ok := actors.GetActorCodeID(actorstypes.Version14, manifest.MultisigKey)
if !ok {
return nil, xerrors.Errorf("failed to get multisig code ID")
}
// new actors are created by invoking 'exec' on the init actor with the constructor params
execParams := &init14.ExecParams{
CodeCID: code,
ConstructorParams: enc,
}
enc, actErr = actors.SerializeParams(execParams)
if actErr != nil {
return nil, actErr
}
return &types.Message{
To: init_.Address,
From: m.from,
Method: builtintypes.MethodsInit.Exec,
Params: enc,
Value: initialAmount,
}, nil
}

View File

@ -7,7 +7,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
multisig8 "github.com/filecoin-project/go-state-types/builtin/v8/multisig"
"github.com/filecoin-project/go-state-types/manifest"
@ -57,7 +57,7 @@ func (m message8) Create(
}
// new actors are created by invoking 'exec' on the init actor with the constructor params
execParams := &init13.ExecParams{
execParams := &init14.ExecParams{
CodeCID: code,
ConstructorParams: enc,
}

View File

@ -7,7 +7,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
multisig9 "github.com/filecoin-project/go-state-types/builtin/v9/multisig"
"github.com/filecoin-project/go-state-types/manifest"
@ -57,7 +57,7 @@ func (m message9) Create(
}
// new actors are created by invoking 'exec' on the init actor with the constructor params
execParams := &init13.ExecParams{
execParams := &init14.ExecParams{
CodeCID: code,
ConstructorParams: enc,
}

View File

@ -12,7 +12,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
msig13 "github.com/filecoin-project/go-state-types/builtin/v13/multisig"
msig14 "github.com/filecoin-project/go-state-types/builtin/v14/multisig"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/manifest"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
@ -54,6 +54,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -127,6 +130,9 @@ func MakeState(store adt.Store, av actorstypes.Version, signers []address.Addres
case actorstypes.Version13:
return make13(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
case actorstypes.Version14:
return make14(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@ -153,7 +159,7 @@ type State interface {
GetState() interface{}
}
type Transaction = msig13.Transaction
type Transaction = msig14.Transaction
var Methods = builtintypes.MethodsMultisig
@ -198,6 +204,9 @@ func Message(version actorstypes.Version, from address.Address) MessageBuilder {
case actorstypes.Version13:
return message13{message0{from}}
case actorstypes.Version14:
return message14{message0{from}}
default:
panic(fmt.Sprintf("unsupported actors version: %d", version))
}
@ -221,13 +230,13 @@ type MessageBuilder interface {
}
// this type is the same between v0 and v2
type ProposalHashData = msig13.ProposalHashData
type ProposeReturn = msig13.ProposeReturn
type ProposeParams = msig13.ProposeParams
type ApproveReturn = msig13.ApproveReturn
type ProposalHashData = msig14.ProposalHashData
type ProposeReturn = msig14.ProposeReturn
type ProposeParams = msig14.ProposeParams
type ApproveReturn = msig14.ApproveReturn
func txnParams(id uint64, data *ProposalHashData) ([]byte, error) {
params := msig13.TxnIDParams{ID: msig13.TxnID(id)}
params := msig14.TxnIDParams{ID: msig14.TxnID(id)}
if data != nil {
if data.Requester.Protocol() != address.ID {
return nil, xerrors.Errorf("proposer address must be an ID address, was %s", data.Requester)
@ -264,5 +273,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

138
chain/actors/builtin/multisig/v14.go generated Normal file
View File

@ -0,0 +1,138 @@
package multisig
import (
"bytes"
"encoding/binary"
"fmt"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
msig14 "github.com/filecoin-project/go-state-types/builtin/v14/multisig"
adt14 "github.com/filecoin-project/go-state-types/builtin/v14/util/adt"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
out := state14{store: store}
out.State = msig14.State{}
out.State.Signers = signers
out.State.NumApprovalsThreshold = threshold
out.State.StartEpoch = startEpoch
out.State.UnlockDuration = unlockDuration
out.State.InitialBalance = initialBalance
em, err := adt14.StoreEmptyMap(store, builtin14.DefaultHamtBitwidth)
if err != nil {
return nil, err
}
out.State.PendingTxns = em
return &out, nil
}
type state14 struct {
msig14.State
store adt.Store
}
func (s *state14) LockedBalance(currEpoch abi.ChainEpoch) (abi.TokenAmount, error) {
return s.State.AmountLocked(currEpoch - s.State.StartEpoch), nil
}
func (s *state14) StartEpoch() (abi.ChainEpoch, error) {
return s.State.StartEpoch, nil
}
func (s *state14) UnlockDuration() (abi.ChainEpoch, error) {
return s.State.UnlockDuration, nil
}
func (s *state14) InitialBalance() (abi.TokenAmount, error) {
return s.State.InitialBalance, nil
}
func (s *state14) Threshold() (uint64, error) {
return s.State.NumApprovalsThreshold, nil
}
func (s *state14) Signers() ([]address.Address, error) {
return s.State.Signers, nil
}
func (s *state14) ForEachPendingTxn(cb func(id int64, txn Transaction) error) error {
arr, err := adt14.AsMap(s.store, s.State.PendingTxns, builtin14.DefaultHamtBitwidth)
if err != nil {
return err
}
var out msig14.Transaction
return arr.ForEach(&out, func(key string) error {
txid, n := binary.Varint([]byte(key))
if n <= 0 {
return xerrors.Errorf("invalid pending transaction key: %v", key)
}
return cb(txid, (Transaction)(out)) //nolint:unconvert
})
}
func (s *state14) PendingTxnChanged(other State) (bool, error) {
other14, ok := other.(*state14)
if !ok {
// treat an upgrade as a change, always
return true, nil
}
return !s.State.PendingTxns.Equals(other14.PendingTxns), nil
}
func (s *state14) transactions() (adt.Map, error) {
return adt14.AsMap(s.store, s.PendingTxns, builtin14.DefaultHamtBitwidth)
}
func (s *state14) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
var tx msig14.Transaction
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
return Transaction{}, err
}
return Transaction(tx), nil
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) ActorKey() string {
return manifest.MultisigKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

109
chain/actors/builtin/paych/message14.go generated Normal file
View File

@ -0,0 +1,109 @@
package paych
import (
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
paych14 "github.com/filecoin-project/go-state-types/builtin/v14/paych"
paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych"
"github.com/filecoin-project/lotus/chain/actors"
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
"github.com/filecoin-project/lotus/chain/types"
)
type message14 struct{ from address.Address }
func (m message14) Create(to address.Address, initialAmount abi.TokenAmount) (*types.Message, error) {
actorCodeID, ok := actors.GetActorCodeID(actorstypes.Version14, "paymentchannel")
if !ok {
return nil, xerrors.Errorf("error getting actor paymentchannel code id for actor version %d", 14)
}
params, aerr := actors.SerializeParams(&paych14.ConstructorParams{From: m.from, To: to})
if aerr != nil {
return nil, aerr
}
enc, aerr := actors.SerializeParams(&init14.ExecParams{
CodeCID: actorCodeID,
ConstructorParams: params,
})
if aerr != nil {
return nil, aerr
}
return &types.Message{
To: init_.Address,
From: m.from,
Value: initialAmount,
Method: builtin14.MethodsInit.Exec,
Params: enc,
}, nil
}
func (m message14) Update(paych address.Address, sv *paychtypes.SignedVoucher, secret []byte) (*types.Message, error) {
params, aerr := actors.SerializeParams(&paych14.UpdateChannelStateParams{
Sv: toV14SignedVoucher(*sv),
Secret: secret,
})
if aerr != nil {
return nil, aerr
}
return &types.Message{
To: paych,
From: m.from,
Value: abi.NewTokenAmount(0),
Method: builtin14.MethodsPaych.UpdateChannelState,
Params: params,
}, nil
}
func toV14SignedVoucher(sv paychtypes.SignedVoucher) paych14.SignedVoucher {
merges := make([]paych14.Merge, len(sv.Merges))
for i := range sv.Merges {
merges[i] = paych14.Merge{
Lane: sv.Merges[i].Lane,
Nonce: sv.Merges[i].Nonce,
}
}
return paych14.SignedVoucher{
ChannelAddr: sv.ChannelAddr,
TimeLockMin: sv.TimeLockMin,
TimeLockMax: sv.TimeLockMax,
SecretHash: sv.SecretHash,
Extra: (*paych14.ModVerifyParams)(sv.Extra),
Lane: sv.Lane,
Nonce: sv.Nonce,
Amount: sv.Amount,
MinSettleHeight: sv.MinSettleHeight,
Merges: merges,
Signature: sv.Signature,
}
}
func (m message14) Settle(paych address.Address) (*types.Message, error) {
return &types.Message{
To: paych,
From: m.from,
Value: abi.NewTokenAmount(0),
Method: builtin14.MethodsPaych.Settle,
}, nil
}
func (m message14) Collect(paych address.Address) (*types.Message, error) {
return &types.Message{
To: paych,
From: m.from,
Value: abi.NewTokenAmount(0),
Method: builtin14.MethodsPaych.Collect,
}, nil
}

View File

@ -56,6 +56,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -179,6 +182,9 @@ func Message(version actorstypes.Version, from address.Address) MessageBuilder {
case actorstypes.Version13:
return message13{from}
case actorstypes.Version14:
return message14{from}
default:
panic(fmt.Sprintf("unsupported actors version: %d", version))
}
@ -222,5 +228,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

135
chain/actors/builtin/paych/v14.go generated Normal file
View File

@ -0,0 +1,135 @@
package paych
import (
"fmt"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
paych14 "github.com/filecoin-project/go-state-types/builtin/v14/paych"
adt14 "github.com/filecoin-project/go-state-types/builtin/v14/util/adt"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store) (State, error) {
out := state14{store: store}
out.State = paych14.State{}
return &out, nil
}
type state14 struct {
paych14.State
store adt.Store
lsAmt *adt14.Array
}
// Channel owner, who has funded the actor
func (s *state14) From() (address.Address, error) {
return s.State.From, nil
}
// Recipient of payouts from channel
func (s *state14) To() (address.Address, error) {
return s.State.To, nil
}
// Height at which the channel can be `Collected`
func (s *state14) SettlingAt() (abi.ChainEpoch, error) {
return s.State.SettlingAt, nil
}
// Amount successfully redeemed through the payment channel, paid out on `Collect()`
func (s *state14) ToSend() (abi.TokenAmount, error) {
return s.State.ToSend, nil
}
func (s *state14) getOrLoadLsAmt() (*adt14.Array, error) {
if s.lsAmt != nil {
return s.lsAmt, nil
}
// Get the lane state from the chain
lsamt, err := adt14.AsArray(s.store, s.State.LaneStates, paych14.LaneStatesAmtBitwidth)
if err != nil {
return nil, err
}
s.lsAmt = lsamt
return lsamt, nil
}
// Get total number of lanes
func (s *state14) LaneCount() (uint64, error) {
lsamt, err := s.getOrLoadLsAmt()
if err != nil {
return 0, err
}
return lsamt.Length(), nil
}
func (s *state14) GetState() interface{} {
return &s.State
}
// Iterate lane states
func (s *state14) ForEachLaneState(cb func(idx uint64, dl LaneState) error) error {
// Get the lane state from the chain
lsamt, err := s.getOrLoadLsAmt()
if err != nil {
return err
}
// Note: we use a map instead of an array to store laneStates because the
// client sets the lane ID (the index) and potentially they could use a
// very large index.
var ls paych14.LaneState
return lsamt.ForEach(&ls, func(i int64) error {
return cb(uint64(i), &laneState14{ls})
})
}
type laneState14 struct {
paych14.LaneState
}
func (ls *laneState14) Redeemed() (big.Int, error) {
return ls.LaneState.Redeemed, nil
}
func (ls *laneState14) Nonce() (uint64, error) {
return ls.LaneState.Nonce, nil
}
func (s *state14) ActorKey() string {
return manifest.PaychKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

View File

@ -9,7 +9,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/manifest"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
@ -27,8 +27,8 @@ import (
)
var (
Address = builtin13.StoragePowerActorAddr
Methods = builtin13.MethodsPower
Address = builtin14.StoragePowerActorAddr
Methods = builtin14.MethodsPower
)
func Load(store adt.Store, act *types.Actor) (State, error) {
@ -57,6 +57,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -130,6 +133,9 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
case actorstypes.Version13:
return make13(store)
case actorstypes.Version14:
return make14(store)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@ -197,5 +203,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

207
chain/actors/builtin/power/v14.go generated Normal file
View File

@ -0,0 +1,207 @@
package power
import (
"bytes"
"fmt"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
power14 "github.com/filecoin-project/go-state-types/builtin/v14/power"
adt14 "github.com/filecoin-project/go-state-types/builtin/v14/util/adt"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/actors/builtin"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store) (State, error) {
out := state14{store: store}
s, err := power14.ConstructState(store)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state14 struct {
power14.State
store adt.Store
}
func (s *state14) TotalLocked() (abi.TokenAmount, error) {
return s.TotalPledgeCollateral, nil
}
func (s *state14) TotalPower() (Claim, error) {
return Claim{
RawBytePower: s.TotalRawBytePower,
QualityAdjPower: s.TotalQualityAdjPower,
}, nil
}
// Committed power to the network. Includes miners below the minimum threshold.
func (s *state14) TotalCommitted() (Claim, error) {
return Claim{
RawBytePower: s.TotalBytesCommitted,
QualityAdjPower: s.TotalQABytesCommitted,
}, nil
}
func (s *state14) MinerPower(addr address.Address) (Claim, bool, error) {
claims, err := s.claims()
if err != nil {
return Claim{}, false, err
}
var claim power14.Claim
ok, err := claims.Get(abi.AddrKey(addr), &claim)
if err != nil {
return Claim{}, false, err
}
return Claim{
RawBytePower: claim.RawBytePower,
QualityAdjPower: claim.QualityAdjPower,
}, ok, nil
}
func (s *state14) MinerNominalPowerMeetsConsensusMinimum(a address.Address) (bool, error) {
return s.State.MinerNominalPowerMeetsConsensusMinimum(s.store, a)
}
func (s *state14) TotalPowerSmoothed() (builtin.FilterEstimate, error) {
return builtin.FilterEstimate(s.State.ThisEpochQAPowerSmoothed), nil
}
func (s *state14) MinerCounts() (uint64, uint64, error) {
return uint64(s.State.MinerAboveMinPowerCount), uint64(s.State.MinerCount), nil
}
func (s *state14) ListAllMiners() ([]address.Address, error) {
claims, err := s.claims()
if err != nil {
return nil, err
}
var miners []address.Address
err = claims.ForEach(nil, func(k string) error {
a, err := address.NewFromBytes([]byte(k))
if err != nil {
return err
}
miners = append(miners, a)
return nil
})
if err != nil {
return nil, err
}
return miners, nil
}
func (s *state14) ForEachClaim(cb func(miner address.Address, claim Claim) error) error {
claims, err := s.claims()
if err != nil {
return err
}
var claim power14.Claim
return claims.ForEach(&claim, func(k string) error {
a, err := address.NewFromBytes([]byte(k))
if err != nil {
return err
}
return cb(a, Claim{
RawBytePower: claim.RawBytePower,
QualityAdjPower: claim.QualityAdjPower,
})
})
}
func (s *state14) ClaimsChanged(other State) (bool, error) {
other14, ok := other.(*state14)
if !ok {
// treat an upgrade as a change, always
return true, nil
}
return !s.State.Claims.Equals(other14.State.Claims), nil
}
func (s *state14) SetTotalQualityAdjPower(p abi.StoragePower) error {
s.State.TotalQualityAdjPower = p
return nil
}
func (s *state14) SetTotalRawBytePower(p abi.StoragePower) error {
s.State.TotalRawBytePower = p
return nil
}
func (s *state14) SetThisEpochQualityAdjPower(p abi.StoragePower) error {
s.State.ThisEpochQualityAdjPower = p
return nil
}
func (s *state14) SetThisEpochRawBytePower(p abi.StoragePower) error {
s.State.ThisEpochRawBytePower = p
return nil
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) claims() (adt.Map, error) {
return adt14.AsMap(s.store, s.Claims, builtin14.DefaultHamtBitwidth)
}
func (s *state14) decodeClaim(val *cbg.Deferred) (Claim, error) {
var ci power14.Claim
if err := ci.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
return Claim{}, err
}
return fromV14Claim(ci), nil
}
func fromV14Claim(v14 power14.Claim) Claim {
return Claim{
RawBytePower: v14.RawBytePower,
QualityAdjPower: v14.QualityAdjPower,
}
}
func (s *state14) ActorKey() string {
return manifest.PowerKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

View File

@ -74,6 +74,22 @@ import (
reward13 "github.com/filecoin-project/go-state-types/builtin/v13/reward"
system13 "github.com/filecoin-project/go-state-types/builtin/v13/system"
verifreg13 "github.com/filecoin-project/go-state-types/builtin/v13/verifreg"
account14 "github.com/filecoin-project/go-state-types/builtin/v14/account"
cron14 "github.com/filecoin-project/go-state-types/builtin/v14/cron"
datacap14 "github.com/filecoin-project/go-state-types/builtin/v14/datacap"
eam14 "github.com/filecoin-project/go-state-types/builtin/v14/eam"
ethaccount14 "github.com/filecoin-project/go-state-types/builtin/v14/ethaccount"
evm14 "github.com/filecoin-project/go-state-types/builtin/v14/evm"
_init14 "github.com/filecoin-project/go-state-types/builtin/v14/init"
market14 "github.com/filecoin-project/go-state-types/builtin/v14/market"
miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner"
multisig14 "github.com/filecoin-project/go-state-types/builtin/v14/multisig"
paych14 "github.com/filecoin-project/go-state-types/builtin/v14/paych"
placeholder14 "github.com/filecoin-project/go-state-types/builtin/v14/placeholder"
power14 "github.com/filecoin-project/go-state-types/builtin/v14/power"
reward14 "github.com/filecoin-project/go-state-types/builtin/v14/reward"
system14 "github.com/filecoin-project/go-state-types/builtin/v14/system"
verifreg14 "github.com/filecoin-project/go-state-types/builtin/v14/verifreg"
account8 "github.com/filecoin-project/go-state-types/builtin/v8/account"
cron8 "github.com/filecoin-project/go-state-types/builtin/v8/cron"
_init8 "github.com/filecoin-project/go-state-types/builtin/v8/init"
@ -737,6 +753,110 @@ func MakeRegistry(av actorstypes.Version) []RegistryEntry {
}
}
case actorstypes.Version14:
for key, codeID := range codeIDs {
switch key {
case manifest.AccountKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: account14.Methods,
state: new(account14.State),
})
case manifest.CronKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: cron14.Methods,
state: new(cron14.State),
})
case manifest.InitKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: _init14.Methods,
state: new(_init14.State),
})
case manifest.MarketKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: market14.Methods,
state: new(market14.State),
})
case manifest.MinerKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: miner14.Methods,
state: new(miner14.State),
})
case manifest.MultisigKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: multisig14.Methods,
state: new(multisig14.State),
})
case manifest.PaychKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: paych14.Methods,
state: new(paych14.State),
})
case manifest.PowerKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: power14.Methods,
state: new(power14.State),
})
case manifest.RewardKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: reward14.Methods,
state: new(reward14.State),
})
case manifest.SystemKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: system14.Methods,
state: new(system14.State),
})
case manifest.VerifregKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: verifreg14.Methods,
state: new(verifreg14.State),
})
case manifest.DatacapKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: datacap14.Methods,
state: new(datacap14.State),
})
case manifest.EvmKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: evm14.Methods,
state: new(evm14.State),
})
case manifest.EamKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: eam14.Methods,
state: nil,
})
case manifest.PlaceholderKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: placeholder14.Methods,
state: nil,
})
case manifest.EthAccountKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: ethaccount14.Methods,
state: nil,
})
}
}
default:
panic("expected version v8 and up only, use specs-actors for v0-7")
}

View File

@ -6,7 +6,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/manifest"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
@ -25,8 +25,8 @@ import (
)
var (
Address = builtin13.RewardActorAddr
Methods = builtin13.MethodsReward
Address = builtin14.RewardActorAddr
Methods = builtin14.MethodsReward
)
func Load(store adt.Store, act *types.Actor) (State, error) {
@ -55,6 +55,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -128,6 +131,9 @@ func MakeState(store adt.Store, av actorstypes.Version, currRealizedPower abi.St
case actorstypes.Version13:
return make13(store, currRealizedPower)
case actorstypes.Version14:
return make14(store, currRealizedPower)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@ -173,5 +179,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

120
chain/actors/builtin/reward/v14.go generated Normal file
View File

@ -0,0 +1,120 @@
package reward
import (
"fmt"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner"
reward14 "github.com/filecoin-project/go-state-types/builtin/v14/reward"
smoothing14 "github.com/filecoin-project/go-state-types/builtin/v14/util/smoothing"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/actors/builtin"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store, currRealizedPower abi.StoragePower) (State, error) {
out := state14{store: store}
out.State = *reward14.ConstructState(currRealizedPower)
return &out, nil
}
type state14 struct {
reward14.State
store adt.Store
}
func (s *state14) ThisEpochReward() (abi.TokenAmount, error) {
return s.State.ThisEpochReward, nil
}
func (s *state14) ThisEpochRewardSmoothed() (builtin.FilterEstimate, error) {
return builtin.FilterEstimate{
PositionEstimate: s.State.ThisEpochRewardSmoothed.PositionEstimate,
VelocityEstimate: s.State.ThisEpochRewardSmoothed.VelocityEstimate,
}, nil
}
func (s *state14) ThisEpochBaselinePower() (abi.StoragePower, error) {
return s.State.ThisEpochBaselinePower, nil
}
func (s *state14) TotalStoragePowerReward() (abi.TokenAmount, error) {
return s.State.TotalStoragePowerReward, nil
}
func (s *state14) EffectiveBaselinePower() (abi.StoragePower, error) {
return s.State.EffectiveBaselinePower, nil
}
func (s *state14) EffectiveNetworkTime() (abi.ChainEpoch, error) {
return s.State.EffectiveNetworkTime, nil
}
func (s *state14) CumsumBaseline() (reward14.Spacetime, error) {
return s.State.CumsumBaseline, nil
}
func (s *state14) CumsumRealized() (reward14.Spacetime, error) {
return s.State.CumsumRealized, nil
}
func (s *state14) InitialPledgeForPower(qaPower abi.StoragePower, networkTotalPledge abi.TokenAmount, networkQAPower *builtin.FilterEstimate, circSupply abi.TokenAmount) (abi.TokenAmount, error) {
return miner14.InitialPledgeForPower(
qaPower,
s.State.ThisEpochBaselinePower,
s.State.ThisEpochRewardSmoothed,
smoothing14.FilterEstimate{
PositionEstimate: networkQAPower.PositionEstimate,
VelocityEstimate: networkQAPower.VelocityEstimate,
},
circSupply,
), nil
}
func (s *state14) PreCommitDepositForPower(networkQAPower builtin.FilterEstimate, sectorWeight abi.StoragePower) (abi.TokenAmount, error) {
return miner14.PreCommitDepositForPower(s.State.ThisEpochRewardSmoothed,
smoothing14.FilterEstimate{
PositionEstimate: networkQAPower.PositionEstimate,
VelocityEstimate: networkQAPower.VelocityEstimate,
},
sectorWeight), nil
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) ActorKey() string {
return manifest.RewardKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

View File

@ -5,7 +5,7 @@ import (
"golang.org/x/xerrors"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/manifest"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
@ -21,7 +21,7 @@ import (
)
var (
Address = builtin13.SystemActorAddr
Address = builtin14.SystemActorAddr
)
func Load(store adt.Store, act *types.Actor) (State, error) {
@ -50,6 +50,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)
case actorstypes.Version14:
return load14(store, act.Head)
}
}
@ -123,6 +126,9 @@ func MakeState(store adt.Store, av actorstypes.Version, builtinActors cid.Cid) (
case actorstypes.Version13:
return make13(store, builtinActors)
case actorstypes.Version14:
return make14(store, builtinActors)
}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
@ -152,5 +158,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}

72
chain/actors/builtin/system/v14.go generated Normal file
View File

@ -0,0 +1,72 @@
package system
import (
"fmt"
"github.com/ipfs/go-cid"
actorstypes "github.com/filecoin-project/go-state-types/actors"
system14 "github.com/filecoin-project/go-state-types/builtin/v14/system"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store, builtinActors cid.Cid) (State, error) {
out := state14{store: store}
out.State = system14.State{
BuiltinActors: builtinActors,
}
return &out, nil
}
type state14 struct {
system14.State
store adt.Store
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) GetBuiltinActors() cid.Cid {
return s.State.BuiltinActors
}
func (s *state14) SetBuiltinActors(c cid.Cid) error {
s.State.BuiltinActors = c
return nil
}
func (s *state14) ActorKey() string {
return manifest.SystemKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

196
chain/actors/builtin/verifreg/v14.go generated Normal file
View File

@ -0,0 +1,196 @@
package verifreg
import (
"fmt"
"github.com/ipfs/go-cid"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
builtin14 "github.com/filecoin-project/go-state-types/builtin"
adt14 "github.com/filecoin-project/go-state-types/builtin/v14/util/adt"
verifreg14 "github.com/filecoin-project/go-state-types/builtin/v14/verifreg"
verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var _ State = (*state14)(nil)
func load14(store adt.Store, root cid.Cid) (State, error) {
out := state14{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}
func make14(store adt.Store, rootKeyAddress address.Address) (State, error) {
out := state14{store: store}
s, err := verifreg14.ConstructState(store, rootKeyAddress)
if err != nil {
return nil, err
}
out.State = *s
return &out, nil
}
type state14 struct {
verifreg14.State
store adt.Store
}
func (s *state14) RootKey() (address.Address, error) {
return s.State.RootKey, nil
}
func (s *state14) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
return false, big.Zero(), xerrors.Errorf("unsupported in actors v14")
}
func (s *state14) VerifierDataCap(addr address.Address) (bool, abi.StoragePower, error) {
return getDataCap(s.store, actors.Version14, s.verifiers, addr)
}
func (s *state14) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
return getRemoveDataCapProposalID(s.store, actors.Version14, s.removeDataCapProposalIDs, verifier, client)
}
func (s *state14) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return forEachCap(s.store, actors.Version14, s.verifiers, cb)
}
func (s *state14) ForEachClient(cb func(addr address.Address, dcap abi.StoragePower) error) error {
return xerrors.Errorf("unsupported in actors v14")
}
func (s *state14) verifiedClients() (adt.Map, error) {
return nil, xerrors.Errorf("unsupported in actors v14")
}
func (s *state14) verifiers() (adt.Map, error) {
return adt14.AsMap(s.store, s.Verifiers, builtin14.DefaultHamtBitwidth)
}
func (s *state14) removeDataCapProposalIDs() (adt.Map, error) {
return adt14.AsMap(s.store, s.RemoveDataCapProposalIDs, builtin14.DefaultHamtBitwidth)
}
func (s *state14) GetState() interface{} {
return &s.State
}
func (s *state14) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
alloc, ok, err := s.FindAllocation(s.store, clientIdAddr, verifreg14.AllocationId(allocationId))
return (*Allocation)(alloc), ok, err
}
func (s *state14) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
v14Map, err := s.LoadAllocationsToMap(s.store, clientIdAddr)
retMap := make(map[AllocationId]Allocation, len(v14Map))
for k, v := range v14Map {
retMap[AllocationId(k)] = Allocation(v)
}
return retMap, err
}
func (s *state14) GetAllAllocations() (map[AllocationId]Allocation, error) {
v14Map, err := s.State.GetAllAllocations(s.store)
retMap := make(map[AllocationId]Allocation, len(v14Map))
for k, v := range v14Map {
retMap[AllocationId(k)] = Allocation(v)
}
return retMap, err
}
func (s *state14) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg14.ClaimId(claimId))
return (*Claim)(claim), ok, err
}
func (s *state14) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
v14Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
retMap := make(map[ClaimId]Claim, len(v14Map))
for k, v := range v14Map {
retMap[ClaimId(k)] = Claim(v)
}
return retMap, err
}
func (s *state14) GetAllClaims() (map[ClaimId]Claim, error) {
v14Map, err := s.State.GetAllClaims(s.store)
retMap := make(map[ClaimId]Claim, len(v14Map))
for k, v := range v14Map {
retMap[ClaimId(k)] = Claim(v)
}
return retMap, err
}
func (s *state14) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
v14Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
retMap := make(map[abi.SectorNumber][]ClaimId)
for k, v := range v14Map {
claims, ok := retMap[v.Sector]
if !ok {
retMap[v.Sector] = []ClaimId{ClaimId(k)}
} else {
retMap[v.Sector] = append(claims, ClaimId(k))
}
}
return retMap, err
}
func (s *state14) ActorKey() string {
return manifest.VerifregKey
}
func (s *state14) ActorVersion() actorstypes.Version {
return actorstypes.Version14
}
func (s *state14) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}
return code
}

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