diff --git a/.circleci/config.yml b/.circleci/config.yml index ae6c36545f..fef27768a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ orbs: executors: golang: docker: - - image: cimg/go:1.18.8 + - image: cimg/go:1.19.7 resource_class: 2xlarge ubuntu: docker: @@ -395,63 +395,62 @@ jobs: name: "trigger payment channel stress testplan on taas" command: ~/testground-cli run composition -f $HOME/testground/plans/lotus-soup/_compositions/paych-stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH - build-macos: + build-darwin-amd64: description: build darwin lotus binary - macos: - xcode: "12.5.1" working_directory: ~/go/src/github.com/filecoin-project/lotus + macos: + xcode: "13.4.1" steps: - - prepare: + - build-platform-specific: linux: false darwin: true - - run: - name: Install go - command: | - curl -O https://dl.google.com/go/go1.18.8.darwin-amd64.pkg && \ - sudo installer -pkg go1.18.8.darwin-amd64.pkg -target / - - run: - name: Install pkg-config - command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config - - run: go version - - run: - name: Install Rust - command: | - curl https://sh.rustup.rs -sSf | sh -s -- -y - - run: - name: Install hwloc - command: | - mkdir ~/hwloc - curl --location https://download.open-mpi.org/release/hwloc/v2.4/hwloc-2.4.1.tar.gz --output ~/hwloc/hwloc-2.4.1.tar.gz - cd ~/hwloc - tar -xvzpf hwloc-2.4.1.tar.gz - cd hwloc-2.4.1 - ./configure && make && sudo make install - - restore_cache: - name: restore cargo cache - key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }} - - run: - command: make build - no_output_timeout: 30m + darwin-architecture: amd64 + - run: make lotus lotus-miner lotus-worker + - run: otool -hv lotus - run: name: check tag and version output match - command: ./scripts/version-check.sh ./eudico - - store_artifacts: - path: lotus - - store_artifacts: - path: lotus-miner - - store_artifacts: - path: lotus-worker - - run: mkdir darwin && mv lotus lotus-miner lotus-worker darwin/ + command: ./scripts/version-check.sh ./lotus + - run: | + mkdir -p /tmp/workspace/darwin_amd64_v1 && \ + mv lotus lotus-miner lotus-worker /tmp/workspace/darwin_amd64_v1/ - persist_to_workspace: - root: "." + root: /tmp/workspace paths: - - darwin - - save_cache: - name: save cargo cache - key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }} + - darwin_amd64_v1 + + build-darwin-arm64: + description: self-hosted m1 runner + working_directory: ~/go/src/github.com/filecoin-project/lotus + machine: true + resource_class: filecoin-project/self-hosted-m1 + steps: + - run: echo 'export PATH=/opt/homebrew/bin:"$PATH"' >> "$BASH_ENV" + - build-platform-specific: + linux: false + darwin: true + darwin-architecture: arm64 + - run: | + export CPATH=$(brew --prefix)/include + export LIBRARY_PATH=$(brew --prefix)/lib + make lotus lotus-miner lotus-worker + - run: otool -hv lotus + - run: + name: check tag and version output match + command: ./scripts/version-check.sh ./lotus + - run: | + mkdir -p /tmp/workspace/darwin_arm64 && \ + mv lotus lotus-miner lotus-worker /tmp/workspace/darwin_arm64/ + - persist_to_workspace: + root: /tmp/workspace paths: - - "~/.rustup" - - "~/.cargo" + - darwin_arm64 + - run: + command: make clean + when: always + - run: + name: cleanup homebrew + command: HOMEBREW_NO_AUTO_UPDATE=1 brew uninstall pkg-config coreutils jq hwloc + when: always gofmt: executor: golang @@ -548,11 +547,6 @@ workflows: tags: only: - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - - build-macos: - filters: - tags: - only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ nightly: triggers: diff --git a/.circleci/template.yml b/.circleci/template.yml index 6781b2833a..102634ab39 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -16,12 +16,12 @@ executors: golang: docker: # Must match GO_VERSION_MIN in project root - - image: cimg/go:1.18.8 + - image: cimg/go:1.19.7 resource_class: medium+ golang-2xl: docker: # Must match GO_VERSION_MIN in project root - - image: cimg/go:1.18.8 + - image: cimg/go:1.19.7 resource_class: 2xlarge ubuntu: docker: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..e5ae608b38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: Ask a question about Lotus or get support + url: https://github.com/filecoin-project/lotus/discussions/new/choose + about: Ask a question or request support for using Lotus + - name: Filecoin protocol feature or enhancement + url: https://github.com/filecoin-project/FIPs/discussions/new/choose + about: Write a discussion in the Filecoin Improvement Proposal repo diff --git a/.github/ISSUE_TEMPLATE/service_developer_bug_report.yml b/.github/ISSUE_TEMPLATE/service_developer_bug_report.yml new file mode 100644 index 0000000000..8174d13f55 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/service_developer_bug_report.yml @@ -0,0 +1,83 @@ +name: "Bug Report - developer/service provider" +description: "Bug report template about FEVM/FVM for developers/service providers" +labels: [need/triage, kind/bug, area/fevm] +body: +- type: checkboxes + attributes: + label: Checklist + description: Please check off the following boxes before continuing to file a bug report! + options: + - label: This is **not** a security-related bug/issue. If it is, please follow please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy). + required: true + - label: I **have** searched on the [issue tracker](https://github.com/filecoin-project/lotus/issues) and the [lotus forum](https://github.com/filecoin-project/lotus/discussions), and there is no existing related issue or discussion. + required: true + - label: I did not make any code changes to lotus. + required: false +- type: checkboxes + attributes: + label: Lotus component + description: Please select the lotus component you are filing a bug for + options: + - label: lotus Ethereum RPC + required: false + - label: lotus FVM - Lotus FVM interactions + required: false + - label: FEVM tooling + required: false + - label: Other + required: false +- type: textarea + id: version + attributes: + label: Lotus Version + render: text + description: Enter the output of `lotus version` if applicable. + placeholder: | + e.g. + Daemon: 1.19.0+mainnet+git.64059ca87+api1.5.0 + Local: lotus-miner version 1.19.0+mainnet+git.64059ca87 + validations: + required: true +- type: textarea + id: repro + attributes: + label: Repro Steps + description: "Steps to reproduce the behavior" + value: | + 1. Run '...' + 2. Do '...' + 3. See error '...' + ... + validations: + required: false +- type: textarea + id: Description + attributes: + label: Describe the Bug + description: | + This is where you get to tell us what went wrong, when doing so, please try to provide a clear and concise description of the bug with all related information: + * What you were doing when you experienced the bug? What are you trying to build? + * Any *error* messages and logs you saw, *where* you saw them, and what you believe may have caused them (if you have any ideas). + * What is the expected behaviour? Links to the actual code? + validations: + required: true +- type: textarea + id: toolingInfo + attributes: + label: Tooling + render: text + description: | + What kind of tooling are you using: + * Are you using ether.js, Alchemy, Hardhat, etc. + validations: + required: true +- type: textarea + id: extraInfo + attributes: + label: Configuration Options + render: text + description: | + Please provide your updated FEVM related configuration options, or custome enviroment variables related to Lotus FEVM + * lotus: use `lotus config updated` to get your configuration options, and copy the [FEVM] section + validations: + required: true diff --git a/.gitignore b/.gitignore index 3a20e51049..8f51387af5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -/AppDir -/appimage-builder-cache -*.AppImage /eudico /lotus /lotus-miner diff --git a/CHANGELOG.md b/CHANGELOG.md index cd450afd23..7ea39b6040 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,552 @@ # Lotus changelog +# v1.21.0-rc2 / 2023-03-29 + +This is an optional but highly recommended feature release of Lotus. It includes numerous improvements and enhancements for node operators, ETH RPC-providers and storage providers. + +## ☢️ Upgrade Warnings ☢️ + +Before upgrading to this feature release read carefully through these bullet points: + +- Starting from this release, the SplitStore feature is automatically activated on new nodes. However, for existing Lotus users, you need to explicitly configure SplitStore by uncommenting the `EnableSplitstore` option in your `config.toml` file. To enable SplitStore, set `EnableSplitstore=true`, and to disable it, set `EnableSplitstore=false`. **It's important to note that your Lotus node will not start unless this configuration is properly set. Set it to false if you are running a full archival node!** +- This feature release requires a **minimum Go version of v1.19.7 or higher to successfully build Lotus**. Additionally, Go version v1.20 and higher is now also supported. +- **Storage Providers:** The proofs libraries now have CUDA enabled by default, which requires you to install (CUDA)[https://lotus.filecoin.io/tutorials/lotus-miner/cuda/] if you haven't already done so. If you prefer to use OpenCL on your GPUs instead, you can use the `FFI_USE_OPENCL=1` flag when building from source. On the other hand, if you want to disable GPUs altogether, you can use the `FFI_NO_GPU=1` environment variable when building from source. +- **Storage Providers:** The `lotus-miner sectors extend` command has been refactored to the functionality of `lotus-miner sectors renew`. The issue where extions did not work has been fixed in this release candidate. +- **Exchanges/Node operators/RPC-providers::** Execution traces (returned from `lotus state exec-trace`, `lotus state replay`, etc.), has changed to account for changes introduced by the by the FVM. **Please make sure to read the `Execution trace format change` section carefully, as these are interface breaking changes** +- **Syncing issues:** If you have been struggling with syncing issues in normal operations you can try to adjust the amount of threads used for more concurrent FMV execution through via the `LOTUS_FVM_CONCURRENCY` enviroment variable. It is set to 4 threads by default. Recommended formula for concurrency == YOUR_RAM/4 , but max is 128. If you are a Storage Provider and are pushing many messages within a short period of time, exporting `LOTUS_SKIP_APPLY_TS_MESSAGE_CALL_WITH_GAS=1` will also help with keeping in sync. +- **Catching up from a Snapshot:** Users have noticed that catching up sync from a snapshot is taking a lot longer these day. This is largely related to the built-in market actor consuming a lot of computational demand for block validation. A FIP for a short-term mitigation for this is currently in Last Call and will be included network version 19 upgrade if accepted. You [can read the FIP here.](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md) + +## Highlights + +**SplitStore** + +This feature release introduces numerous improvements and fixes to tackle SplitStore related issues that has been reported. With this feature release SplitStore is automatically activated by default on new nodes. However, for existing Lotus users, you need to explicitly configure SplitStore by uncommenting the `EnableSplitstore` option in your `config.toml` file. To enable SplitStore, set `EnableSplitstore=true`, and to disable it, set `EnableSplitstore=false`. **It's important to note that your Lotus node will not start unless this configuration is properly set. Set it to false if you are running a full archival node!** + +SplitStore also has some new configuration settings that you can set in your config.toml file: +- `HotstoreMaxSpaceTarget` suggests the max allowed space (in bytes) the hotstore can take. +- `HotstoreMaxSpaceThreshold` a moving GC will be triggered when total moving size exceeds this threshold (in bytes). +- `HotstoreMaxSpaceSafetyBuffer` a safety buffer to prevent moving GC from an overflowing disk. + +The SplitStore also has two new commands: + +- `lotus chain prune hot` is a much less resource-intensive GC and is best suited for situations where you don't have the spare disk space for a full GC. +- `lotus chain prune hot-moving` will run a full moving garbage collection of the hotstore. This commands create a new hotstore before deleting the old one so you need working room in the hotstore directory. The current size of a fully GC'd hotstore is around 295 GiB so you need to make sure you have at least that available. + +You can read more about the new SplitStore commands in [the documentation](https://lotus.filecoin.io/lotus/configure/splitstore/#manual-chain-store-garbage-collection). + +**RPC API improvements** + +This feature release includes all the RPC API improvements made in the Lotus v1.20.x patch releases. It includes an updated FFI that sets the FVM parallelism to 4 by default. + +Node operators with higher memory specs can experiment with setting LOTUS_FVM_CONCURRENCY to higher values, up to 48, to allow for more concurrent FVM execution. + +**Experimental scheduler assigners** + +In this release there are four new expirmental scheduler assigners: + +- The `experiment-spread-qcount` - similar to the spread assigner but also takes nto account task counts which are in running/preparing/queued states. +- The `experiment-spread-tasks` - similar to the spread assigner, but counts running tasks on a per-task-type basis +- The `experiment-spread-tasks-qcount` - similar to the spread assigner, but also takes into account task counts which are in running/preparing/queued states, as well as counting running tasks on a per-task-type basis. Check the results for this assigner on ([storage-only lotus-workers here](https://github.com/filecoin-project/lotus/issues/8566#issuecomment-1446978856)). +- The `experiment-random` - In each schedule loop the assinger figures a set of all workers which can handle the task and then picks a random one. Check the results for this assigner on ([storage-only lotus-workers here](https://github.com/filecoin-project/lotus/issues/8566#issuecomment-1447064218)). + +**Graceful shutdown of lotus-workers** +We have cleaned up some commands in the `lotus-worker` to make it less confusing how to gracefully shutting down a `lotus-worker` while there are incoming sealing tasks in the pipeline. To shut down a `lotus-worker` gracefully: + +1. `lotus-worker tasks disable --all` and wait for the worker to finish processing its current tasks. +2. `lotus-worker stop` to detach it and do maintenance/upgrades. + +**CLI speedups** + +The `lotus-Miner sector list` is now running in parallel - which should speed up the process from anywhere between 2x-10x+. You can tune it additionally with the `check-parallelism` option in the command. The `Lotus-Miner info` command also has a large speed improvement, as calls to the lotus legacy market has been removed. + +## New features +- feat: splitstore: Splitstore enabled by default (#10429) ([filecoin-project/lotus#10429](https://github.com/filecoin-project/lotus/pull/10429)) + - Enables SplitStore by default on new Lotus nodes. Existing Lotus users need to explicitly configure +- feat: splitstore: Configure max space used by hotstore and GC makes best effort to respect ([filecoin-project/lotus#10391](https://github.com/filecoin-project/lotus/pull/10391)) + - Adds three new configs for setting the maximum allowed space the hotstore can take. +- feat: splitstore: Badger GC of hotstore command ([filecoin-project/lotus#10387](https://github.com/filecoin-project/lotus/pull/10387)) + - Adds a `lotus chain prune hot` command, to run the garbage collection of the hotstore in a user driven way. +- feat: sched: Assigner experiments ([filecoin-project/lotus#10356](https://github.com/filecoin-project/lotus/pull/10356)) + - Introduces experimental scheduler assigners that works better for setups that uses storage-only lotus-workers. +- fix: wdpost: disabled post worker handling ([filecoin-project/lotus#10394](https://github.com/filecoin-project/lotus/pull/10394)) + - Improved scheduling logic for Proof-of-SpaceTime workers. +- feat: cli: list claims and remove expired claims ([filecoin-project/lotus#9875](https://github.com/filecoin-project/lotus/pull/9875)) + - Adds a command to list claims made by a provider `lotus filplus list-claims`. And `lotus filplus remove-expired-claims` to remove expired claims. +- feat: cli: make sectors list much faster ([filecoin-project/lotus#10202](https://github.com/filecoin-project/lotus/pull/10202)) + - Makes `lotus-miner sector list` checks run in parallel. +- feat: cli: Add an EVM command to fetch a contract's bytecode ([filecoin-project/lotus#10443](https://github.com/filecoin-project/lotus/pull/10443)) + - Adds an `lotus evm bytecode` command to fetch a contract's bytecode. +- feat: mempool: Reduce minimum replace fee from 1.25x to 1.1x (#10416) ([filecoin-project/lotus#10416](https://github.com/filecoin-project/lotus/pull/10416)) + - Reduces replacement message fee logic to help include update message replacements from developers using Ethereum tools like MetaMask. +- feat: update renew-sectors with FIP-0045 logic ([filecoin-project/lotus#10328](https://github.com/filecoin-project/lotus/pull/10328)) + - Updates the `lotus-miner sectors extend` with FIP-0045 logic to include the ability to drop claims and set the maximum number of messages contained in a message. +- feat: IPC: Abstract common consensus functions and consensus interface ([filecoin-project/lotus#9481](https://github.com/filecoin-project/lotus/pull/9481)) + - Add eudico's consensus interface to Lotus and implement EC behind that interface. This abstraction is the stepping-stone for Mir's integration. +- fix: worker: add all tasks flag ([filecoin-project/lotus#10232](https://github.com/filecoin-project/lotus/pull/10232)) + - Adds an `all` flag for the `lotus-worker tasks enable/disable` cmds. +- feat:shed:add cid to cbor serialization command ([filecoin-project/lotus#10032](https://github.com/filecoin-project/lotus/pull/10032)) + - Adds two `lotus-shed` commands, `lotus-shed cid bytes` and `lotus-shed cid cbor` to serialize cid to cbor and cid to bytes. +- feat: add toolshed commands to inspect statetree size ([filecoin-project/lotus#9982](https://github.com/filecoin-project/lotus/pull/9982)) + - Adds two commands, `lotus-shed stat-actor` and `lotus-shed stat-obj` that work with an offline lotus repo to report dag size stats. +- feat: shed: encode address to bytes ([filecoin-project/lotus#10105](https://github.com/filecoin-project/lotus/pull/10105)) + - Adds a `lotus-shed address encode` for encoding a filecoin address to hex bytes. +- feat: chain: export-range ([filecoin-project/lotus#10145](https://github.com/filecoin-project/lotus/pull/10145)) + - Adds a `lotus chain export-range` command that can create archival-grade ranged exports of the chain as quickly as possible. +- feat: stmgr: cache migrated stateroots ([filecoin-project/lotus#10282](https://github.com/filecoin-project/lotus/pull/10282)) + - Cache network migration results to avoid running migrations twice. +- feat: shed: Add a tool to read data from sectors ([filecoin-project/lotus#10169](https://github.com/filecoin-project/lotus/pull/10169)) + - Adds a lotus-shed sectors read command that extract data from sectors from a running lotus-miner deployment. +- feat: cli: Refactor renew and remove extend ([filecoin-project/lotus#9920](https://github.com/filecoin-project/lotus/pull/9920)) + - Refactors the `lotus-miner sectors extend` command to have the functionality of `lotus-miner sectors renew`. The `lotus-miner sectors renew` command has been deprecated. +- feat: shed: Add beneficiary commands ([filecoin-project/lotus#10037](https://github.com/filecoin-project/lotus/pull/10037)) + - Adds the beneficiary address command to `lotus-shed`. You can now use `lotus-shed actor propose-change-beneficiary` and `lotus-shed actor confirm-change-beneficiary` to change beneficiary addresses. + +## Improvements + +- backport: fix: miner: correctly count sector extensions (10555) ([filecoin-project/lotus#10555](https://github.com/filecoin-project/lotus/pull/10555)) + - Fixes the issue with sector extensions. +- fix: proving: Initialize slice with with same length as partition (#10574) ([filecoin-project/lotus#10574])(https://github.com/filecoin-project/lotus/pull/10574) + - Fixes an issue where `lotus-miner proving compute window-post` paniced when trying to make skipped sectors human readable. +- feat: stmgr: speed up calculation of genesis circ supply (#10553) ([filecoin-project/lotus#10553])(https://github.com/filecoin-project/lotus/pull/10553) +- perf: eth: gas estimate set applyTsMessages false (#10546) ([filecoin-project/lotus#10456](https://github.com/filecoin-project/lotus/pull/10546)) +- feat: config: Force existing users to opt into new defaults (#10488) ([filecoin-project/lotus#10488](https://github.com/filecoin-project/lotus/pull/10488)) + - Force existing users to opt into the new SplitStore defaults. +- fix: splitstore: Demote now common logs (#10516) ([filecoin-project/lotus#10516](https://github.com/filecoin-project/lotus/pull/10516)) +- fix: splitstore: Don't enforce walking receipt tree during compaction ([filecoin-project/lotus#10502](https://github.com/filecoin-project/lotus/pull/10502)) +- fix: splitstore: Fix the overzealous fix (#10366) ([filecoin-project/lotus#10366](https://github.com/filecoin-project/lotus/pull/10366)) +- fix: splitstore: Two fixes, better logging and comments (#10332) ([filecoin-project/lotus#10332](https://github.com/filecoin-project/lotus/pull/10332)) +- fix: fsm: shutdown removed sectors FSMs ([filecoin-project/lotus#10363](https://github.com/filecoin-project/lotus/pull/10363)) + - Fixes an issue where removed sectors still got state machine events. +- fix: rpcenc: Don't hang when source dies ([filecoin-project/lotus#10116](https://github.com/filecoin-project/lotus/pull/10116)) + - Fixes an issue where AddPiece tasks could get stuck if the Boost process was abruptly lost. +- fix: make debugging windowPoSt-failures human readable ([filecoin-project/lotus#10390](https://github.com/filecoin-project/lotus/pull/10390)) + - Makes the skipped sector list in `lotus-miner proving compute window-post` human readable. +- fix: cli: Hide `lotus-worker set` command ([filecoin-project/lotus#10384](https://github.com/filecoin-project/lotus/pull/10384)) + - Hides the `lotus-worker set` command. This command will be deprecated later. +- fix: worker: Hide `wait-quiet` cmd ([filecoin-project/lotus#10331](https://github.com/filecoin-project/lotus/pull/10331)) + - Hides the `lotus-worker wait-quiet` command. This command will be deprecated later. +- fix: post: Tune down default post-parallel-reads ([filecoin-project/lotus#10365](https://github.com/filecoin-project/lotus/pull/10365)) + - Tuning down the default post-parallel-reads to a more conservative number to prevent sectors from being skipped due to network timeouts. +- fix: cli: error if backup file already exists ([filecoin-project/lotus#10209](https://github.com/filecoin-project/lotus/pull/10209)) + - Error out if a backup file with the same name already exists when using the `lotus-miner backup` or `lotus backup` command +- fix: cli: option to set-seal-delay in seconds ([filecoin-project/lotus#10208](https://github.com/filecoin-project/lotus/pull/10208)) + - Adds the option to specify `lotus-miner sectors set-seal-delay` in seconds +- fix: cli: extend cmd to get the right sector number ([filecoin-project/lotus#10182](https://github.com/filecoin-project/lotus/pull/10182)) + - Making sure the `lotus-miner sectors extend` command gets the correct sector number. +- feat: wdpost: Emit more detailed errors ([filecoin-project/lotus#10121](https://github.com/filecoin-project/lotus/pull/10121)) + - Emits more detailed windowPoSt error messages, making it easier to debug PoSt issues. +- fix: Lotus Gateway: Add missing methods - master ([filecoin-project/lotus#10420](https://github.com/filecoin-project/lotus/pull/10420)) + - Adds `StateNetworkName`, `MpoolGetNonce`, `StateCall` and `StateDecodeParams` methods to Lotus Gateway. +- fix: stmgr: don't attempt to lookup genesis state (#10472) ([filecoin-project/lotus#10472](https://github.com/filecoin-project/lotus/pull/10472)) +- feat: gateway: export StateVerifierStatus ([filecoin-project/lotus#10477](https://github.com/filecoin-project/lotus/pull/10477)) +- fix: gateway: correctly apply the fee history lookback max ([filecoin-project/lotus#10464](https://github.com/filecoin-project/lotus/pull/10464)) +- fix: gateway: drop overzealous guard on MsigGetVested ([filecoin-project/lotus#10451](https://github.com/filecoin-project/lotus/pull/10451)) +- feat: apply gateway lookback limit to eth API lookback ([filecoin-project/lotus#10467](https://github.com/filecoin-project/lotus/pull/10467)) +- fix: revert "Eth API: drop support for 'pending' block parameter." ([filecoin-project/lotus#10474](https://github.com/filecoin-project/lotus/pull/10474)) +- fix: Eth API: make net_version return the chain ID ([filecoin-project/lotus#10456](https://github.com/filecoin-project/lotus/pull/10456)) +- fix: eth: handle a potential divide by zero in receipt handling ([filecoin-project/lotus#10495](https://github.com/filecoin-project/lotus/pull/10495)) +- fix: ethrpc: Don't lock up when eth subscriber goes away ([filecoin-project/lotus#10485](https://github.com/filecoin-project/lotus/pull/10485)) +- feat: eth: Avoid StateCompute in EthTxnReceipt lookup (#10460) ([filecoin-project/lotus#10460](https://github.com/filecoin-project/lotus/pull/10460)) +- feat: eth: optimize eth block loading + eth_feeHistory ([filecoin-project/lotus#10446](https://github.com/filecoin-project/lotus/pull/10446)) +- feat: state: skip tipset execution when possible ([filecoin-project/lotus#10445](https://github.com/filecoin-project/lotus/pull/10445)) +- feat: eth API: reject masked ID addresses embedded in f410f payloads ([filecoin-project/lotus#10440](https://github.com/filecoin-project/lotus/pull/10440)) +- fix: Eth API: make block parameter parsing sounder. ([filecoin-project/lotus#10427](https://github.com/filecoin-project/lotus/pull/10427)) +- fix: eth API: return correct txIdx around null blocks (#10419) ([filecoin-project/lotus#10419](https://github.com/filecoin-project/lotus/pull/10419)) +- fix: EthAPI: use StateCompute for feeHistory; apply minimum gas premium (#10413) ([filecoin-project/lotus#10413](https://github.com/filecoin-project/lotus/pull/10413)) +- refactor: EthAPI: Drop unnecessary param from newEthTxReceipt ([filecoin-project/lotus#10411](https://github.com/filecoin-project/lotus/pull/10411)) +- fix: eth API: correct gateway restrictions, drop unimplemented methods ([filecoin-project/lotus#10409](https://github.com/filecoin-project/lotus/pull/10409)) +- fix: EthAPI: Correctly get parent hash ([filecoin-project/lotus#10389](https://github.com/filecoin-project/lotus/pull/10389)) +- fix: EthAPI: Make newEthBlockFromFilecoinTipSet faster and correct ([filecoin-project/lotus#10380](https://github.com/filecoin-project/lotus/pull/10380)) +- fix: eth: incorrect struct tags (#10309) ([filecoin-project/lotus#10309](https://github.com/filecoin-project/lotus/pull/10309)) +- refactor: update cache to the new generic version (#10463) ([filecoin-project/lotus#10463](https://github.com/filecoin-project/lotus/pull/10463)) +- feat: consensus: log ApplyBlock timing/gas stats ([filecoin-project/lotus#10470](https://github.com/filecoin-project/lotus/pull/10470)) +- feat: chain: make chain tipset fetching 1000x faster ([filecoin-project/lotus#10423](https://github.com/filecoin-project/lotus/pull/10423)) +- chain: explicitly check that gasLimit is above zero ([filecoin-project/lotus#10198](https://github.com/filecoin-project/lotus/pull/10198)) +- feat: blockstore: Envvar can adjust badger compaction worker poolsize ([filecoin-project/lotus#9973](https://github.com/filecoin-project/lotus/pull/9973)) +- feat: stmgr: add env to disable premigrations ([filecoin-project/lotus#10283](https://github.com/filecoin-project/lotus/pull/10283)) +- chore: Remove legacy market info from lotus-miner info ([filecoin-project/lotus#10364](https://github.com/filecoin-project/lotus/pull/10364)) + - Removes the legacy market info in the `Lotus-Miner info`. Speeds up the command significantly. +- chore: blockstore: Plumb through a proper Flush() method on all blockstores ([filecoin-project/lotus#10465](https://github.com/filecoin-project/lotus/pull/10465)) +- fix: extend LOTUS_CHAIN_BADGERSTORE_DISABLE_FSYNC to the markset ([filecoin-project/lotus#10172](https://github.com/filecoin-project/lotus/pull/10172)) +- feat: vm: switch to the new exec trace format (#10372) ([filecoin-project/lotus#10372](https://github.com/filecoin-project/lotus/pull/10372)) +- fix: Remove workaround that is no longer needed ([filecoin-project/lotus#9995](https://github.com/filecoin-project/lotus/pull/9995)) +- feat: Check for allocation expiry when waiting to seal sectors ([filecoin-project/lotus#9878](https://github.com/filecoin-project/lotus/pull/9878)) +- feat: Allow libp2p user agent to be overriden ([filecoin-project/lotus#10149](https://github.com/filecoin-project/lotus/pull/10149)) +- feat: cli: Add global color flag ([filecoin-project/lotus#10022](https://github.com/filecoin-project/lotus/pull/10022)) +- fix: should not serve non v0 api in v0 ([filecoin-project/lotus#10066](https://github.com/filecoin-project/lotus/pull/10066)) +- fix: build: drop drand incentinet servers ([filecoin-project/lotus#10476](https://github.com/filecoin-project/lotus/pull/10476)) +- fix: sealing: stub out the FileSize function on Windows ([filecoin-project/lotus#10035](https://github.com/filecoin-project/lotus/pull/10035)) + +## Dependencies +- github.com/filecoin-project/go-dagaggregator-unixfs (v0.2.0 -> v0.3.0): +- github.com/filecoin-project/go-fil-markets (v1.25.2 -> v1.27.0-rc1): +- github.com/filecoin-project/go-jsonrpc (v0.2.1 -> v0.2.3): +- github.com/filecoin-project/go-statemachine (v1.0.2 -> v1.0.3): +- github.com/ipfs/go-cid (v0.3.2 -> v0.4.0): +- github.com/ipfs/go-libipfs (v0.5.0 -> v0.7.0): +- github.com/ipfs/go-path (v0.3.0 -> v0.3.1): +- deps: update go-libp2p-pubsub to v0.9.3 ([filecoin-project/lotus#10483](https://github.com/filecoin-project/lotus/pull/10483)) +- deps: Update go-jsonrpc to v0.2.2 ([filecoin-project/lotus#10395](https://github.com/filecoin-project/lotus/pull/10395)) +- Update to go-data-transfer v2 and libp2p, still wip ([filecoin-project/lotus#10382](https://github.com/filecoin-project/lotus/pull/10382)) +- dep: ipld: update ipld prime to v0.20.0 ([filecoin-project/lotus#10247](https://github.com/filecoin-project/lotus/pull/10247)) +- chore: node: migrate go-bitswap to go-libipfs/bitswap ([filecoin-project/lotus#10138](https://github.com/filecoin-project/lotus/pull/10138)) +- chore: all: bump go-libipfs to replace go-block-format ([filecoin-project/lotus#10126](https://github.com/filecoin-project/lotus/pull/10126)) +- chore: market: Upgrade to index-provider 0.10.0 ([filecoin-project/lotus#9981](https://github.com/filecoin-project/lotus/pull/9981)) +- chore: all: bump go-libipfs ([filecoin-project/lotus#10563](https://github.com/filecoin-project/lotus/pull/10563)) + +## Others +- Update service_developer_bug_report.yml ([filecoin-project/lotus#10321](https://github.com/filecoin-project/lotus/pull/10321)) +- Update service_developer_bug_report.yml ([filecoin-project/lotus#10321](https://github.com/filecoin-project/lotus/pull/10321)) +- chore: github: Service-provider/dev bug template ([filecoin-project/lotus#10321](https://github.com/filecoin-project/lotus/pull/10321)) +- chore: github: update enhancement and feature templates ([filecoin-project/lotus#10291](https://github.com/filecoin-project/lotus/pull/10291)) +- chore: github: Update bug_report template ([filecoin-project/lotus#10289](https://github.com/filecoin-project/lotus/pull/10289)) +- fix: itest: avoid failing the test when we race the miner ([filecoin-project/lotus#10461](https://github.com/filecoin-project/lotus/pull/10461)) +- fix: github: Discussion and FIP links in `New Issue` ([filecoin-project/lotus#10268](https://github.com/filecoin-project/lotus/pull/10268)) +- fix: state: short-circuit genesis state computation ([filecoin-project/lotus#10397](https://github.com/filecoin-project/lotus/pull/10397)) +- fix: rpcenc: deflake TestReaderRedirectDrop ([filecoin-project/lotus#10406](https://github.com/filecoin-project/lotus/pull/10406)) +- fix: tests: Fix TestMinerAllInfo test ([filecoin-project/lotus#10319](https://github.com/filecoin-project/lotus/pull/10319)) +- fix: tests: Make TestWorkerKeyChange not flaky ([filecoin-project/lotus#10320](https://github.com/filecoin-project/lotus/pull/10320)) +- test: eth: make sure we can deploy a new placeholder on transfer (#10281) ([filecoin-project/lotus#10281](https://github.com/filecoin-project/lotus/pull/10281)) +- fix: itests: Fix flaky paych test ([filecoin-project/lotus#10100](https://github.com/filecoin-project/lotus/pull/10100)) +- fix: cli: add ArgsUsage ([filecoin-project/lotus#10147](https://github.com/filecoin-project/lotus/pull/10147)) +- chore: cli: cleanup cli ([filecoin-project/lotus#10114](https://github.com/filecoin-project/lotus/pull/10114)) +- chore: cli: Remove unneeded individual color flags ([filecoin-project/lotus#10028](https://github.com/filecoin-project/lotus/pull/10028)) +- fix: cli: remove requirements in helptext ([filecoin-project/lotus#9969](https://github.com/filecoin-project/lotus/pull/9969)) +- chore: build: release v1.21.0-rc1 prep ([filecoin-project/lotus#10524](https://github.com/filecoin-project/lotus/pull/10524)) +- chore: merge release/v1.20.0 into master ([filecoin-project/lotus#10308](https://github.com/filecoin-project/lotus/pull/10308)) +- chore: merge release branch into master ([filecoin-project/lotus#10272](https://github.com/filecoin-project/lotus/pull/10272)) +- chore: merge release/v1.20.0 into master ([filecoin-project/lotus#10238](https://github.com/filecoin-project/lotus/pull/10238)) +- chore: releases to master ([filecoin-project/lotus#10490](https://github.com/filecoin-project/lotus/pull/10490)) +- chore: merge releases into master ([filecoin-project/lotus#10377](https://github.com/filecoin-project/lotus/pull/10377)) +- chore: merge release/v1.20.0 into master ([filecoin-project/lotus#10030](https://github.com/filecoin-project/lotus/pull/10030)) +- chore: update ffi to increase execution parallelism (#10480) ([filecoin-project/lotus#10480](https://github.com/filecoin-project/lotus/pull/10480)) +- chore: update the FFI for release (#10435) ([filecoin-project/lotus#10444](https://github.com/filecoin-project/lotus/pull/10444)) +- build: bump version to v1.21.0-dev ([filecoin-project/lotus#10249](https://github.com/filecoin-project/lotus/pull/10249)) +- build: docker: Update GO-version (#10591) ([filecoin-project/lotus#10249](https://github.com/filecoin-project/lotus/pull/10591)) +- chore: merge release/v1.20.0 into master ([filecoin-project/lotus#10184](https://github.com/filecoin-project/lotus/pull/10184)) +- docs: API Gateway: patch documentation note about make gen command ([filecoin-project/lotus#10422](https://github.com/filecoin-project/lotus/pull/10422)) +- chore: docs: fix docs typos ([filecoin-project/lotus#10155](https://github.com/filecoin-project/lotus/pull/10155)) +- chore: docker: Add back <> parameter for docker push ([filecoin-project/lotus#10096](https://github.com/filecoin-project/lotus/pull/10096)) +- chore: docker: Properly balance <> in circleci docker config ([filecoin-project/lotus#10088](https://github.com/filecoin-project/lotus/pull/10088)) +- chore: ci: Fix dirty git state when building docker images ([filecoin-project/lotus#10125](https://github.com/filecoin-project/lotus/pull/10125)) +- chore: build: Remove AppImage and Snapcraft build automation ([filecoin-project/lotus#10003](https://github.com/filecoin-project/lotus/pull/10003)) +- chore: ci: Update codeql to v2 ([filecoin-project/lotus#10120](https://github.com/filecoin-project/lotus/pull/10120)) +- feat: ci: make ci more efficient ([filecoin-project/lotus#9910](https://github.com/filecoin-project/lotus/pull/9910)) +- feat: scripts: go.mod dep diff script ([filecoin-project/lotus#9711](https://github.com/filecoin-project/lotus/pull/9711)) + +## Execution Trace Format Changes + +Execution traces (returned from `lotus state exec-trace`, `lotus state replay`, etc.), has changed to account for changes introduced by the FVM. Specifically: + +- The `Msg` field no longer matches the Filecoin message format as many of the message fields didn't make sense in on-chain sub-calls. Instead, it now has the fields `To`, `From`, `Value`, `Method`, `Params`, and `ParamsCodec` where `ParamsCodec` is a new field indicating the IPLD codec of the parameters. + - Importantly, the `Msg.CID` field has been removed. This field is still present in top-level invocation results, just not inside the execution trace itself. +- The `MsgRct` field no longer includes a `GasUsed` field and now has a `ReturnCodec` field to indicating the IPLD codec of the return value. +- The `Error` and `Duration` fields have been removed as these are not set by the FVM. The top-level message "invocation result" retains the `Error` and `Duration` fields, they've only been removed from the trace itself. +- Gas Charges no longer include "virtual" gas fields (those starting with `v...`) or source location information (`loc`) as neither field is set by the FVM. + +A note on "codecs": FVM parameters and return values are IPLD blocks where the "codec" specifies the data encoding. The codec will generally be one of: + +- `0x51`, `0x71` - CBOR or DagCBOR. You should generally treat these as equivalent. +- `0x55` - Raw bytes. +- `0x00` - Nothing. If the codec is `0x00`, the parameter and/or return value should be empty and should be treated as "void" (not specified). + +
+ +Old ExecutionTrace: + + +```json +{ + "Msg": { + "Version": 0, + "To": "f01234", + "From": "f04321", + "Nonce": 1, + "Value": "0", + "GasLimit": 0, + "GasFeeCap": "1234", + "GasPremium": "1234", + "Method": 42, + "Params": "", + "CID": { + "/": "bafyxyz....." + }, + }, + "MsgRct": { + "ExitCode": 0, + "Return": "", + "GasUsed": 12345, + }, + "Error": "", + "Duration": 568191845, + "GasCharges": [ + { + "Name": "OnMethodInvocation", + "loc": null, + "tg": 23856, + "cg": 23856, + "sg": 0, + "vtg": 0, + "vcg": 0, + "vsg": 0, + "tt": 0 + }, + { + "Name": "wasm_exec", + "loc": null, + "tg": 1764, + "cg": 1764, + "sg": 0, + "vtg": 0, + "vcg": 0, + "vsg": 0, + "tt": 0 + }, + { + "Name": "OnSyscall", + "loc": null, + "tg": 14000, + "cg": 14000, + "sg": 0, + "vtg": 0, + "vcg": 0, + "vsg": 0, + "tt": 0 + }, + ], + "Subcalls": [ + { + "Msg": { }, + "MsgRct": { }, + "Error": "", + "Duration": 1235, + "GasCharges": [], + "Subcalls": [], + }, + ] +} +``` +
+ +
+ +New ExecutionTrace: + + +```json +{ + "Msg": { + "To": "f01234", + "From": "f04321", + "Value": "0", + "Method": 42, + "Params": "", + "ParamsCodec": 81 + }, + "MsgRct": { + "ExitCode": 0, + "Return": "", + "ReturnCodec": 81 + }, + "GasCharges": [ + { + "Name": "OnMethodInvocation", + "loc": null, + "tg": 23856, + "cg": 23856, + "tt": 0 + }, + { + "Name": "wasm_exec", + "loc": null, + "tg": 1764, + "cg": 1764, + "sg": 0, + "tt": 0 + }, + { + "Name": "OnSyscall", + "loc": null, + "tg": 14000, + "cg": 14000, + "sg": 0, + "tt": 0 + }, + ], + "Subcalls": [ + { + "Msg": { }, + "MsgRct": { }, + "GasCharges": [], + "Subcalls": [], + }, + ] +} +``` + +
+ +## Contributors + +| Contributor | Commits | Lines ± | Files Changed | +|-------------|---------|---------|---------------| +| Hannah Howard | 2 | +2909/-6026 | 84 | +| Łukasz Magiera | 42 | +2967/-1848 | 95 | +| Steven Allen | 20 | +1703/-1345 | 88 | +| Alfonso de la Rocha | 17 | +823/-1808 | 86 | +| Peter Rabbitson | 9 | +1957/-219 | 34 | +| Geoff Stuart | 12 | +818/-848 | 29 | +| hannahhoward | 5 | +507/-718 | 36 | +| Hector Sanjuan | 6 | +443/-726 | 35 | +| Kevin Li | 1 | +1124/-14 | 22 | +| zenground0 | 30 | +791/-269 | 88 | +| frrist | 1 | +992/-16 | 13 | +| Travis Person | 4 | +837/-53 | 24 | +| Phi | 20 | +622/-254 | 34 | +| Ian Davis | 7 | +35/-729 | 20 | +| Aayush | 10 | +378/-177 | 40 | +| Raúl Kripalani | 15 | +207/-138 | 19 | +| Arsenii Petrovich | 7 | +248/-94 | 30 | +| ZenGround0 | 5 | +238/-39 | 15 | +| Neel Virdy | 1 | +109/-107 | 58 | +| ychiao | 1 | +135/-39 | 3 | +| Jorropo | 2 | +87/-82 | 67 | +| Marten Seemann | 8 | +69/-64 | 17 | +| Rod Vagg | 1 | +55/-16 | 3 | +| Masih H. Derkani | 3 | +39/-27 | 12 | +| raulk | 2 | +30/-29 | 5 | +| dependabot[bot] | 4 | +37/-17 | 8 | +| beck | 2 | +38/-2 | 2 | +| Jennifer Wang | 4 | +20/-19 | 19 | +| Richard Guan | 3 | +28/-8 | 5 | +| omahs | 7 | +14/-14 | 7 | +| dirkmc | 2 | +19/-7 | 6 | +| David Choi | 2 | +16/-5 | 2 | +| Mike Greenberg | 1 | +18/-1 | 1 | +| Adin Schmahmann | 1 | +19/-0 | 2 | +| Phi-rjan | 5 | +12/-4 | 5 | +| Dirk McCormick | 2 | +6/-6 | 3 | +| Aayush Rajasekaran | 2 | +9/-3 | 2 | +| Jiaying Wang | 5 | +6/-4 | 5 | +| Anjor Kanekar | 1 | +5/-5 | 1 | +| vyzo | 1 | +3/-3 | 2 | +| 0x5459 | 1 | +1/-1 | 1 | + +# v1.20.3 / 2023-03-09 + +A 🐈 stepped on the ⌨️ and made a mistake while resolving conflicts 😨. This releases only includes #10439 to fix that mistake. v1.20.2 is retracted - Please skip v1.20.2 and **only** update to v1.20.3!!! + +## Changelog +> compare to v1.20.1 + +This is a HIGHLY RECOMMENDED patch release for node operators/API service providers that run ETH RPC service and an optional release for Storage Providers. + +## Bug fixes +- fix: EthAPI: use StateCompute for feeHistory; apply minimum gas premium #10413 +- fix: eth API: return correct txIdx around null blocks #10419 +- fix: Eth API: make block parameter parsing sounder. #10427 + +## Improvement +- feat: Lotus Gateway: Add missing methods - master #10420 +- feat: mempool: Reduce minimum replace fee from 1.25x to 1.1x #10416 +- We recommend storage providers to update your nodes to this patch, that will help improve developers who use Ethereum tooling's experience. + +# v1.20.2 / 2023-03-09 + +This is a HIGHLY RECOMMENDED patch release for node operators/API service providers that run ETH RPC service and an optional release for Storage Providers. + +## Bug fixes +- fix: EthAPI: use StateCompute for feeHistory; apply minimum gas premium #10413 +- fix: eth API: return correct txIdx around null blocks #10419 +- fix: Eth API: make block parameter parsing sounder. #10427 + +## Improvement +- feat: Lotus Gateway: Add missing methods - master #10420 +- feat: mempool: Reduce minimum replace fee from 1.25x to 1.1x #10416 + - We recommend storage providers to update your nodes to this patch, that will help improve developers who use Ethereum tooling's experience. + +# v1.20.1 / 2023-03-06 + +This an optional patch releases for node operators/API service providers that run ETH RPC service. + +## Bug fixes +- fix: EthAPI: Correctly get parent hash #10389 +- fix: EthAPI: Make newEthBlockFromFilecoinTipSet faster and correct #10380 +- fix: state: short-circuit genesis state computation + +# 1.20.0 / 2023-02-28 + +This is a MANDATORY release of Lotus that delivers the [Hygge network upgrade](https://github.com/filecoin-project/community/discussions/74?sort=top#discussioncomment-4313888), introducing Filecoin network version 18. The centerpiece of the upgrade is the introduction of the [Filecoin Virtual Machine (FVM)’s Milestone 2.1](https://fvm.filecoin.io/), which will allow for EVM-compatible contracts to be deployed on the Filecoin network. This upgrade delivers user-programmablity to the Filecoin network for the first time! + +The Filecoin mainnet is scheduled to upgrade to nv18 at epoch 2683348, on March 14th at 2023-03-14T15:14:00Z. All node operators, including storage providers, must upgrade to this release before that time. Storage providers must update their daemons, miners, market and worker(s)/boost. +At the upgrade, a short migration will run that converts code actors v9 code CIDs to v10 CIDs, and installs the new Ethereum Address Manager singleton (see below). This is expected to be a lightweight migration that causes no service disruption. + +The Hygge upgrade introduces the following Filecoin Improvement Proposals (FIPs), delivered in FVM3 (see FVM [v3.0.0](https://github.com/filecoin-project/ref-fvm/pull/1683)) and builtin-actors v10 (see actors [v10.0.0](https://github.com/filecoin-project/builtin-actors/releases/tag/v10.0.0)): + +- [FIP-0048](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md): f4 Address Class +- [FIP-0049](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0049.md): Actor events +- [FIP-0050](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0050.md): API between user-programmed actors and built-in actors +- [FIP-0054](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0054.md): Filecoin EVM runtime (FEVM) +- [FIP-0055](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0055.md): Supporting Ethereum Accounts, Addresses, and Transactions +- [FIP-0057](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0057.md): Update gas charging schedule and system limits for FEVM + +## Filecoin Ethereum Virtual Machine (FEVM) + +The Filecoin Ethereum Virtual Machine (FEVM) is built on top of the WASM-based execution environment introduced in the Skyr v16 upgrade. The chief feature introduced is the ability for anyone participating in the Filecoin network to deploy their own EVM-compatible contracts onto the blockchain, and invoke them as appropriate. + +## New Built-in Actors + +The FEVM is principally delivered through the introduction of **the new [EVM actor](https://github.com/filecoin-project/builtin-actors/tree/master/actors/evm)**. This actor “represents” smart contracts on the Filecoin network, and includes an interpreter that implements all EVM opcodes as their Filecoin equivalents, and translates state I/O operations to be compatible with Filecoin’s IPLD-based data model. For more on the EVM actors, please see [FIP-0054](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0054.md). + +The creation of EVM actors is managed by **the new** [Ethereum Address Manager actor (EAM)](https://github.com/filecoin-project/builtin-actors/tree/master/actors/eam), a singleton that is invoked in order to deploy EVM actors. In order to make usage of the FEVM as seamless as possible for users familiar with the Ethereum ecosystem, this upgrades also introduces **a dedicated actor to serve as “[Ethereum Accounts](https://github.com/filecoin-project/builtin-actors/tree/master/actors/ethaccount)”**. This actor exists to allow for secp keys to be used in the Ethereum addressing scheme. **The last new built-in actor introduced is [the Placeholder actor](https://github.com/filecoin-project/builtin-actors/tree/master/actors/placeholder)**, a thin “shell” of an actor that can transform into either EVM or EthAccount actors. For more on the EAM, EthAccount, and Placeholder actors, please see [FIP-0055](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0055.md). + +### v10 Built-in actor bundles + +Bundles for all networks (mainnet, calibnet, etc.) are included in the lotus source tree (`build/actors/`) and embedded on build, for v10 actors you can find it [here](https://github.com/filecoin-project/lotus/blob/master/build/actors/v10.tar.zst). +Reminder: Lotus verifies that the bundle CIDs are the right ones upon build & upgrade against the values in `build/builtin_actors_gen.go`, according to the network you are building. You may also check the bundle manifest CID matches the bundle gen-ed values by running `lotus state actor-cids --network-version 18`. + +The manifest CID & full list of actor code CIDs for nv18 using [actor v10](https://github.com/filecoin-project/builtin-actors/releases/tag/v10.0.0) is: + + "_manifest": "bafy2bzacecsuyf7mmvrhkx2evng5gnz5canlnz2fdlzu2lvcgptiq2pzuovos" + "account": "bafk2bzaceampw4romta75hyz5p4cqriypmpbgnkxncgxgqn6zptv5lsp2w2bo" + "cron": "bafk2bzacedcbtsifegiu432m5tysjzkxkmoczxscb6hqpmrr6img7xzdbbs2g" + "datacap": "bafk2bzacealj5uk7wixhvk7l5tnredtelralwnceafqq34nb2lbylhtuyo64u" + "eam": "bafk2bzacedrpm5gbleh4xkyo2jvs7p5g6f34soa6dpv7ashcdgy676snsum6g" + "ethaccount": "bafk2bzaceaqoc5zakbhjxn3jljc4lxnthllzunhdor7sxhwgmskvc6drqc3fa" + "evm": "bafk2bzaceahmzdxhqsm7cu2mexusjp6frm7r4kdesvti3etv5evfqboos2j4g" + "init": "bafk2bzaced2f5rhir3hbpqbz5ght7ohv2kgj42g5ykxrypuo2opxsup3ykwl6" + "multisig": "bafk2bzaceduf3hayh63jnl4z2knxv7cnrdenoubni22fxersc4octlwpxpmy4" + "paymentchannel": "bafk2bzaceartlg4mrbwgzcwric6mtvyawpbgx2xclo2vj27nna57nxynf3pgc" + "placeholder": "bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro" + "reward": "bafk2bzacebnhtaejfjtzymyfmbdrfmo7vgj3zsof6zlucbmkhrvcuotw5dxpq" + "storagemarket": "bafk2bzaceclejwjtpu2dhw3qbx6ow7b4pmhwa7ocrbbiqwp36sq5yeg6jz2bc" + "storageminer": "bafk2bzaced4h7noksockro7glnssz2jnmo2rpzd7dvnmfs4p24zx3h6gtx47s" + "storagepower": "bafk2bzacec4ay4crzo73ypmh7o3fjendhbqrxake46bprabw67fvwjz5q6ixq" + "system": "bafk2bzacedakk5nofebyup4m7nvx6djksfwhnxzrfuq4oyemhpl4lllaikr64" + "verifiedregistry": "bafk2bzacedfel6edzqpe5oujno7fog4i526go4dtcs6vwrdtbpy2xq6htvcg6" + +## Node Operators + +FVM has been running in lotus since v1.16.0 and up, and the new FEVM does not increase any node hardware spec requirement. + +With FEVM on Filecoin, we aim to provide full compatibility with the existing EVM ecosystem and its tooling out of the box. +Consequently, lotus now provides a full set of [Ethereum-styled APIs](https://github.com/filecoin-project/lotus/blob/release/v1.20.0/node/impl/full/eth.go) for developers and token holders to interact with the Filecoin network as well. +For full documentation on this new tooling, please see the [Lotus docs website](https://lotus.filecoin.io/lotus/configure/ethereum-rpc/). + +**Enabling Ethereum JSON RPC API** + +Note that Ethereum APIs are only supported in the lotus v1 API, meaning that any node operator who wants to enable Eth API services must be using the v1 API, instead of the v0 API. To enable Eth RPC, simply set `EnableEthRPC` to `true` in your node config.toml file; or set env var `LOTUS_FEVM_ENABLEETHRPC` to `1` before starting your lotus node. + +**Eth tx hash and Filecoin message CID** + +Most of the Eth APIs take Eth accounts and tx has as an input, and they start with `0x` , and that is what Ethereum tooling support. However, in Filecoin, we have Filecoin account formats where things start with `f` (`f410` specifically for eth accounts on Filecoin) and the messages are in the format of CIDs. To enable a smooth developer experience, Lotus internally converts between Ethereum address and Filecoin account address as needed. In addition, lotus also keeps a Eth tx hash <> Filecoin message CID map and stores them in a SQLite database as node sees a FEVM messages. The database is initiated and the maps are populated automatically in `~//sqlite/txhash.db` for any node that as Eth RPC enabled. Node operators can configure how many historical mappings they wanna store by configuring `EthTxHashMappingLifetimeDays` . + +**Events** + +[FIP-0049 introduces actor events](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0049.md) that can be emitted and externally observable during message execution. An `events.db` is created automatically under `~//sqlite` to store these events if the node has Eth RPC enabled. Node operators can configure the events support base on their needs by configuration `Events` configurations. + +Note: All three features are new, and we welcome user feedback, please create an issue if you have any enhancements that you’d like to see! + # 1.19.0 / 2022-12-07 This is an optional feature release of Lotus. This feature release includes the SplitStore beta, the experimental Lotus node cluster feature, as well as numerous enhancments and bugfixes. diff --git a/Dockerfile b/Dockerfile index 9a93c3bcd2..a2b2fb68d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ##################################### -FROM golang:1.18.8-buster AS lotus-builder +FROM golang:1.19.7-buster AS lotus-builder MAINTAINER Lotus Development Team RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev diff --git a/Dockerfile.lotus b/Dockerfile.lotus index 2278e8511f..91373b62f8 100644 --- a/Dockerfile.lotus +++ b/Dockerfile.lotus @@ -1,6 +1,6 @@ ##### DEPRECATED -FROM golang:1.18.8-buster AS builder-deps +FROM golang:1.19.7-buster AS builder-deps MAINTAINER Lotus Development Team RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev diff --git a/GO_VERSION_MIN b/GO_VERSION_MIN index 1a31d398cf..98adfe8e12 100644 --- a/GO_VERSION_MIN +++ b/GO_VERSION_MIN @@ -1 +1 @@ -1.18.8 +1.19.7 diff --git a/Makefile b/Makefile index 970f4eb34d..b8cdf98e70 100644 --- a/Makefile +++ b/Makefile @@ -347,7 +347,7 @@ actors-gen: actors-code-gen fiximports .PHONY: actors-gen bundle-gen: - $(GOCC) run ./gen/bundle $(RELEASE) + $(GOCC) run ./gen/bundle $(VERSION) $(RELEASE) $(RELEASE_OVERRIDES) $(GOCC) fmt ./build/... .PHONY: bundle-gen diff --git a/README.md b/README.md index 570e1d6c17..a7dc411302 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,10 @@ For other distributions you can find the required dependencies [here.](https://l #### Go -To build Lotus, you need a working installation of [Go 1.18.8 or higher](https://golang.org/dl/): +To build Lotus, you need a working installation of [Go 1.19.7 or higher](https://golang.org/dl/): ```bash -wget -c https://golang.org/dl/go1.18.8.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local +wget -c https://golang.org/dl/go1.19.7.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local ``` **TIP:** diff --git a/api/api_full.go b/api/api_full.go index cb25c2f9f8..933c44e509 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -11,12 +11,12 @@ import ( "github.com/consensus-shipyard/go-ipc-types/subnetactor" "github.com/google/uuid" "github.com/ipfs/go-cid" - "github.com/ipfs/go-libipfs/blocks" + blocks "github.com/ipfs/go-libipfs/blocks" "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" + 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" @@ -176,10 +176,24 @@ type FullNode interface { // If oldmsgskip is set, messages from before the requested roots are also not included. ChainExport(ctx context.Context, nroots abi.ChainEpoch, oldmsgskip bool, tsk types.TipSetKey) (<-chan []byte, error) //perm:read - // ChainPrune prunes the stored chain state and garbage collects; only supported if you + // ChainExportRangeInternal triggers the export of a chain + // CAR-snapshot directly to disk. It is similar to ChainExport, + // except, depending on options, the snapshot can include receipts, + // messages and stateroots for the length between the specified head + // and tail, thus producing "archival-grade" snapshots that include + // all the on-chain data. The header chain is included back to + // genesis and these snapshots can be used to initialize Filecoin + // nodes. + ChainExportRangeInternal(ctx context.Context, head, tail types.TipSetKey, cfg ChainExportConfig) error //perm:admin + + // ChainPrune forces compaction on cold store and garbage collects; only supported if you // are using the splitstore ChainPrune(ctx context.Context, opts PruneOpts) error //perm:admin + // ChainHotGC does online (badger) GC on the hot store; only supported if you are using + // the splitstore + ChainHotGC(ctx context.Context, opts HotGCOpts) error //perm:admin + // ChainCheckBlockstore performs an (asynchronous) health check on the chain/state blockstore // if supported by the underlying implementation. ChainCheckBlockstore(context.Context) error //perm:admin @@ -782,6 +796,10 @@ type FullNode interface { // // EthAccounts will always return [] since we don't expect Lotus to manage private keys EthAccounts(ctx context.Context) ([]ethtypes.EthAddress, error) //perm:read + // EthAddressToFilecoinAddress converts an EthAddress into an f410 Filecoin Address + EthAddressToFilecoinAddress(ctx context.Context, ethAddress ethtypes.EthAddress) (address.Address, error) //perm:read + // FilecoinAddressToEthAddress converts an f410 or f0 Filecoin Address to an EthAddress + FilecoinAddressToEthAddress(ctx context.Context, filecoinAddress address.Address) (ethtypes.EthAddress, error) //perm:read // EthBlockNumber returns the height of the latest (heaviest) TipSet EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error) //perm:read // EthGetBlockTransactionCountByNumber returns the number of messages in the TipSet @@ -792,10 +810,12 @@ type FullNode interface { EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthHash, fullTxInfo bool) (ethtypes.EthBlock, error) //perm:read EthGetBlockByNumber(ctx context.Context, blkNum string, fullTxInfo bool) (ethtypes.EthBlock, error) //perm:read EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error) //perm:read + EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error) //perm:read EthGetTransactionHashByCid(ctx context.Context, cid cid.Cid) (*ethtypes.EthHash, error) //perm:read EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error) //perm:read EthGetTransactionCount(ctx context.Context, sender ethtypes.EthAddress, blkOpt string) (ethtypes.EthUint64, error) //perm:read EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*EthTxReceipt, error) //perm:read + EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*EthTxReceipt, error) //perm:read EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) //perm:read EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) //perm:read @@ -1370,6 +1390,12 @@ type PruneOpts struct { RetainState int64 } +type HotGCOpts struct { + Threshold float64 + Periodic bool + Moving bool +} + type EthTxReceipt struct { TransactionHash ethtypes.EthHash `json:"transactionHash"` TransactionIndex ethtypes.EthUint64 `json:"transactionIndex"` diff --git a/api/api_gateway.go b/api/api_gateway.go index 2e877fb1a0..4389fc34b8 100644 --- a/api/api_gateway.go +++ b/api/api_gateway.go @@ -15,6 +15,7 @@ import ( apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" + "github.com/filecoin-project/lotus/node/modules/dtypes" ) // MODIFYING THE API INTERFACE @@ -25,7 +26,7 @@ import ( // When adding / changing methods in this file: // * Do the change here // * Adjust implementation in `node/impl/` -// * Run `make gen` - this will: +// * Run `make clean && make deps && make gen` - this will: // * Generate proxy structs // * Generate mocks // * Generate markdown docs @@ -47,15 +48,18 @@ type Gateway interface { ChainReadObj(context.Context, cid.Cid) ([]byte, error) ChainGetGenesis(context.Context) (*types.TipSet, error) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *MessageSendSpec, tsk types.TipSetKey) (*types.Message, error) + MpoolGetNonce(ctx context.Context, addr address.Address) (uint64, error) MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error) MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error) MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*MsigTransaction, error) MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error) MsigGetVestingSchedule(ctx context.Context, addr address.Address, tsk types.TipSetKey) (MsigVesting, error) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) + StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*InvocResult, error) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (DealCollateralBounds, error) + StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error) - StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*ActorState, error) //perm:read + StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*ActorState, error) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (MarketBalance, error) @@ -63,8 +67,10 @@ type Gateway interface { StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (MinerInfo, error) StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error) StateMinerPower(context.Context, address.Address, types.TipSetKey) (*MinerPower, error) + StateNetworkName(context.Context) (dtypes.NetworkName, error) StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) + StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error) StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error) @@ -79,12 +85,12 @@ type Gateway interface { EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthHash, fullTxInfo bool) (ethtypes.EthBlock, error) EthGetBlockByNumber(ctx context.Context, blkNum string, fullTxInfo bool) (ethtypes.EthBlock, error) EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error) + EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error) EthGetTransactionHashByCid(ctx context.Context, cid cid.Cid) (*ethtypes.EthHash, error) EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error) EthGetTransactionCount(ctx context.Context, sender ethtypes.EthAddress, blkOpt string) (ethtypes.EthUint64, error) EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*EthTxReceipt, error) - EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) - EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) + EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*EthTxReceipt, error) EthGetCode(ctx context.Context, address ethtypes.EthAddress, blkOpt string) (ethtypes.EthBytes, error) EthGetStorageAt(ctx context.Context, address ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error) EthGetBalance(ctx context.Context, address ethtypes.EthAddress, blkParam string) (ethtypes.EthBigInt, error) diff --git a/api/api_storage.go b/api/api_storage.go index 0c00b9b933..9e65c1ced7 100644 --- a/api/api_storage.go +++ b/api/api_storage.go @@ -11,7 +11,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer" + 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" @@ -212,9 +212,11 @@ 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(ctx context.Context) ([]retrievalmarket.ProviderDealState, error) //perm:read + 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 diff --git a/api/cbor_gen.go b/api/cbor_gen.go index efa1cd1a15..80392b2127 100644 --- a/api/cbor_gen.go +++ b/api/cbor_gen.go @@ -50,22 +50,6 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error { return err } - // t.WaitSentinel (cid.Cid) (struct) - if len("WaitSentinel") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"WaitSentinel\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("WaitSentinel"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("WaitSentinel")); err != nil { - return err - } - - if err := cbg.WriteCid(cw, t.WaitSentinel); err != nil { - return xerrors.Errorf("failed to write cid field t.WaitSentinel: %w", err) - } - // t.Vouchers ([]*paych.SignedVoucher) (slice) if len("Vouchers") > cbg.MaxLength { return xerrors.Errorf("Value in field \"Vouchers\" was too long") @@ -90,6 +74,23 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error { return err } } + + // t.WaitSentinel (cid.Cid) (struct) + if len("WaitSentinel") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"WaitSentinel\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("WaitSentinel"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("WaitSentinel")); err != nil { + return err + } + + if err := cbg.WriteCid(cw, t.WaitSentinel); err != nil { + return xerrors.Errorf("failed to write cid field t.WaitSentinel: %w", err) + } + return nil } @@ -140,19 +141,6 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error) { return xerrors.Errorf("unmarshaling t.Channel: %w", err) } - } - // t.WaitSentinel (cid.Cid) (struct) - case "WaitSentinel": - - { - - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("failed to read cid field t.WaitSentinel: %w", err) - } - - t.WaitSentinel = c - } // t.Vouchers ([]*paych.SignedVoucher) (slice) case "Vouchers": @@ -184,6 +172,20 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error) { t.Vouchers[i] = &v } + // t.WaitSentinel (cid.Cid) (struct) + case "WaitSentinel": + + { + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.WaitSentinel: %w", err) + } + + t.WaitSentinel = c + + } + default: // Field doesn't exist on this type, so ignore it cbg.ScanForLinks(r, func(cid.Cid) {}) @@ -204,19 +206,19 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error { return err } - // t.SectorID (abi.SectorNumber) (uint64) - if len("SectorID") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"SectorID\" was too long") + // t.Size (abi.UnpaddedPieceSize) (uint64) + if len("Size") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Size\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SectorID"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Size"))); err != nil { return err } - if _, err := io.WriteString(w, string("SectorID")); err != nil { + if _, err := io.WriteString(w, string("Size")); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SectorID)); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Size)); err != nil { return err } @@ -236,19 +238,19 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error { return err } - // t.Size (abi.UnpaddedPieceSize) (uint64) - if len("Size") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Size\" was too long") + // t.SectorID (abi.SectorNumber) (uint64) + if len("SectorID") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"SectorID\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Size"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SectorID"))); err != nil { return err } - if _, err := io.WriteString(w, string("Size")); err != nil { + if _, err := io.WriteString(w, string("SectorID")); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Size)); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SectorID)); err != nil { return err } @@ -293,8 +295,8 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.SectorID (abi.SectorNumber) (uint64) - case "SectorID": + // t.Size (abi.UnpaddedPieceSize) (uint64) + case "Size": { @@ -305,7 +307,7 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) { if maj != cbg.MajUnsignedInt { return fmt.Errorf("wrong type for uint64 field") } - t.SectorID = abi.SectorNumber(extra) + t.Size = abi.UnpaddedPieceSize(extra) } // t.Offset (abi.PaddedPieceSize) (uint64) @@ -323,8 +325,8 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) { t.Offset = abi.PaddedPieceSize(extra) } - // t.Size (abi.UnpaddedPieceSize) (uint64) - case "Size": + // t.SectorID (abi.SectorNumber) (uint64) + case "SectorID": { @@ -335,7 +337,7 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) { if maj != cbg.MajUnsignedInt { return fmt.Errorf("wrong type for uint64 field") } - t.Size = abi.UnpaddedPieceSize(extra) + t.SectorID = abi.SectorNumber(extra) } @@ -474,6 +476,28 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error { return err } + // t.Epoch (abi.ChainEpoch) (int64) + if len("Epoch") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Epoch\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("Epoch")); err != nil { + return err + } + + if t.Epoch >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil { + return err + } + } + // t.Value (abi.SealRandomness) (slice) if len("Value") > cbg.MaxLength { return xerrors.Errorf("Value in field \"Value\" was too long") @@ -497,28 +521,6 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error { if _, err := cw.Write(t.Value[:]); err != nil { return err } - - // t.Epoch (abi.ChainEpoch) (int64) - if len("Epoch") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Epoch\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("Epoch")); err != nil { - return err - } - - if t.Epoch >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil { - return err - } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil { - return err - } - } return nil } @@ -560,29 +562,7 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.Value (abi.SealRandomness) (slice) - case "Value": - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - - if extra > cbg.ByteArrayMaxLen { - return fmt.Errorf("t.Value: byte array too large (%d)", extra) - } - if maj != cbg.MajByteString { - return fmt.Errorf("expected byte array") - } - - if extra > 0 { - t.Value = make([]uint8, extra) - } - - if _, err := io.ReadFull(cr, t.Value[:]); err != nil { - return err - } - // t.Epoch (abi.ChainEpoch) (int64) + // t.Epoch (abi.ChainEpoch) (int64) case "Epoch": { maj, extra, err := cr.ReadHeader() @@ -599,7 +579,7 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -608,6 +588,28 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) { t.Epoch = abi.ChainEpoch(extraI) } + // t.Value (abi.SealRandomness) (slice) + case "Value": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > cbg.ByteArrayMaxLen { + return fmt.Errorf("t.Value: byte array too large (%d)", extra) + } + if maj != cbg.MajByteString { + return fmt.Errorf("expected byte array") + } + + if extra > 0 { + t.Value = make([]uint8, extra) + } + + if _, err := io.ReadFull(cr, t.Value[:]); err != nil { + return err + } default: // Field doesn't exist on this type, so ignore it @@ -629,6 +631,28 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error { return err } + // t.Epoch (abi.ChainEpoch) (int64) + if len("Epoch") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Epoch\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("Epoch")); err != nil { + return err + } + + if t.Epoch >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil { + return err + } + } + // t.Value (abi.InteractiveSealRandomness) (slice) if len("Value") > cbg.MaxLength { return xerrors.Errorf("Value in field \"Value\" was too long") @@ -652,28 +676,6 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error { if _, err := cw.Write(t.Value[:]); err != nil { return err } - - // t.Epoch (abi.ChainEpoch) (int64) - if len("Epoch") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Epoch\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("Epoch")); err != nil { - return err - } - - if t.Epoch >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil { - return err - } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil { - return err - } - } return nil } @@ -715,29 +717,7 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.Value (abi.InteractiveSealRandomness) (slice) - case "Value": - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - - if extra > cbg.ByteArrayMaxLen { - return fmt.Errorf("t.Value: byte array too large (%d)", extra) - } - if maj != cbg.MajByteString { - return fmt.Errorf("expected byte array") - } - - if extra > 0 { - t.Value = make([]uint8, extra) - } - - if _, err := io.ReadFull(cr, t.Value[:]); err != nil { - return err - } - // t.Epoch (abi.ChainEpoch) (int64) + // t.Epoch (abi.ChainEpoch) (int64) case "Epoch": { maj, extra, err := cr.ReadHeader() @@ -754,7 +734,7 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -763,6 +743,28 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) { t.Epoch = abi.ChainEpoch(extraI) } + // t.Value (abi.InteractiveSealRandomness) (slice) + case "Value": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > cbg.ByteArrayMaxLen { + return fmt.Errorf("t.Value: byte array too large (%d)", extra) + } + if maj != cbg.MajByteString { + return fmt.Errorf("expected byte array") + } + + if extra > 0 { + t.Value = make([]uint8, extra) + } + + if _, err := io.ReadFull(cr, t.Value[:]); err != nil { + return err + } default: // Field doesn't exist on this type, so ignore it @@ -784,6 +786,22 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error { return err } + // t.DealID (abi.DealID) (uint64) + if len("DealID") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"DealID\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealID"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("DealID")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.DealID)); err != nil { + return err + } + // t.PublishCid (cid.Cid) (struct) if len("PublishCid") > cbg.MaxLength { return xerrors.Errorf("Value in field \"PublishCid\" was too long") @@ -806,22 +824,6 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error { } } - // t.DealID (abi.DealID) (uint64) - if len("DealID") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"DealID\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealID"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("DealID")); err != nil { - return err - } - - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.DealID)); err != nil { - return err - } - // t.DealProposal (market.DealProposal) (struct) if len("DealProposal") > cbg.MaxLength { return xerrors.Errorf("Value in field \"DealProposal\" was too long") @@ -910,7 +912,22 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.PublishCid (cid.Cid) (struct) + // t.DealID (abi.DealID) (uint64) + case "DealID": + + { + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajUnsignedInt { + return fmt.Errorf("wrong type for uint64 field") + } + t.DealID = abi.DealID(extra) + + } + // t.PublishCid (cid.Cid) (struct) case "PublishCid": { @@ -932,21 +949,6 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) (err error) { t.PublishCid = &c } - } - // t.DealID (abi.DealID) (uint64) - case "DealID": - - { - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - if maj != cbg.MajUnsignedInt { - return fmt.Errorf("wrong type for uint64 field") - } - t.DealID = abi.DealID(extra) - } // t.DealProposal (market.DealProposal) (struct) case "DealProposal": @@ -1140,46 +1142,46 @@ func (t *DealSchedule) MarshalCBOR(w io.Writer) error { return err } - // t.StartEpoch (abi.ChainEpoch) (int64) - if len("StartEpoch") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"StartEpoch\" was too long") + // t.EndEpoch (abi.ChainEpoch) (int64) + if len("EndEpoch") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"EndEpoch\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartEpoch"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("EndEpoch"))); err != nil { return err } - if _, err := io.WriteString(w, string("StartEpoch")); err != nil { + if _, err := io.WriteString(w, string("EndEpoch")); err != nil { return err } - if t.StartEpoch >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartEpoch)); err != nil { + if t.EndEpoch >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.EndEpoch)); err != nil { return err } } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartEpoch-1)); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.EndEpoch-1)); err != nil { return err } } - // t.EndEpoch (abi.ChainEpoch) (int64) - if len("EndEpoch") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"EndEpoch\" was too long") + // t.StartEpoch (abi.ChainEpoch) (int64) + if len("StartEpoch") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"StartEpoch\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("EndEpoch"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartEpoch"))); err != nil { return err } - if _, err := io.WriteString(w, string("EndEpoch")); err != nil { + if _, err := io.WriteString(w, string("StartEpoch")); err != nil { return err } - if t.EndEpoch >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.EndEpoch)); err != nil { + if t.StartEpoch >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartEpoch)); err != nil { return err } } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.EndEpoch-1)); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartEpoch-1)); err != nil { return err } } @@ -1224,8 +1226,8 @@ func (t *DealSchedule) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.StartEpoch (abi.ChainEpoch) (int64) - case "StartEpoch": + // t.EndEpoch (abi.ChainEpoch) (int64) + case "EndEpoch": { maj, extra, err := cr.ReadHeader() var extraI int64 @@ -1241,17 +1243,17 @@ func (t *DealSchedule) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: return fmt.Errorf("wrong type for int64 field: %d", maj) } - t.StartEpoch = abi.ChainEpoch(extraI) + t.EndEpoch = abi.ChainEpoch(extraI) } - // t.EndEpoch (abi.ChainEpoch) (int64) - case "EndEpoch": + // t.StartEpoch (abi.ChainEpoch) (int64) + case "StartEpoch": { maj, extra, err := cr.ReadHeader() var extraI int64 @@ -1267,14 +1269,14 @@ func (t *DealSchedule) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: return fmt.Errorf("wrong type for int64 field: %d", maj) } - t.EndEpoch = abi.ChainEpoch(extraI) + t.StartEpoch = abi.ChainEpoch(extraI) } default: diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go index b6f6e308e5..515c8b7f66 100644 --- a/api/docgen/docgen.go +++ b/api/docgen/docgen.go @@ -29,7 +29,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer" + 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" @@ -154,8 +154,8 @@ func init() { addExample(map[string]int{"name": 42}) addExample(map[string]time.Time{"name": time.Unix(1615243938, 0).UTC()}) addExample(&types.ExecutionTrace{ - Msg: ExampleValue("init", reflect.TypeOf(&types.Message{}), nil).(*types.Message), - MsgRct: ExampleValue("init", reflect.TypeOf(&types.MessageReceipt{}), nil).(*types.MessageReceipt), + Msg: ExampleValue("init", reflect.TypeOf(types.MessageTrace{}), nil).(types.MessageTrace), + MsgRct: ExampleValue("init", reflect.TypeOf(types.ReturnTrace{}), nil).(types.ReturnTrace), }) addExample(map[string]types.Actor{ "t01236": ExampleValue("init", reflect.TypeOf(types.Actor{}), nil).(types.Actor), @@ -404,6 +404,10 @@ func init() { Address: []ethtypes.EthAddress{ethaddr}, }) + percent := types.Percent(123) + addExample(percent) + addExample(&percent) + addExample(subnetactor.ConsensusType(0)) addExample(sdk.Status(0)) } diff --git a/api/mocks/mock_full.go b/api/mocks/mock_full.go index 4b276b89c9..2fa5565bc3 100644 --- a/api/mocks/mock_full.go +++ b/api/mocks/mock_full.go @@ -24,7 +24,7 @@ import ( address "github.com/filecoin-project/go-address" bitfield "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer" + 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" @@ -158,6 +158,20 @@ func (mr *MockFullNodeMockRecorder) ChainExport(arg0, arg1, arg2, arg3 interface return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainExport", reflect.TypeOf((*MockFullNode)(nil).ChainExport), arg0, arg1, arg2, arg3) } +// ChainExportRangeInternal mocks base method. +func (m *MockFullNode) ChainExportRangeInternal(arg0 context.Context, arg1, arg2 types.TipSetKey, arg3 api.ChainExportConfig) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ChainExportRangeInternal", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(error) + return ret0 +} + +// ChainExportRangeInternal indicates an expected call of ChainExportRangeInternal. +func (mr *MockFullNodeMockRecorder) ChainExportRangeInternal(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainExportRangeInternal", reflect.TypeOf((*MockFullNode)(nil).ChainExportRangeInternal), arg0, arg1, arg2, arg3) +} + // ChainGetBlock mocks base method. func (m *MockFullNode) ChainGetBlock(arg0 context.Context, arg1 cid.Cid) (*types.BlockHeader, error) { m.ctrl.T.Helper() @@ -383,6 +397,20 @@ func (mr *MockFullNodeMockRecorder) ChainHead(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockFullNode)(nil).ChainHead), arg0) } +// ChainHotGC mocks base method. +func (m *MockFullNode) ChainHotGC(arg0 context.Context, arg1 api.HotGCOpts) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ChainHotGC", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ChainHotGC indicates an expected call of ChainHotGC. +func (mr *MockFullNodeMockRecorder) ChainHotGC(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHotGC", reflect.TypeOf((*MockFullNode)(nil).ChainHotGC), arg0, arg1) +} + // ChainNotify mocks base method. func (m *MockFullNode) ChainNotify(arg0 context.Context) (<-chan []*api.HeadChange, error) { m.ctrl.T.Helper() @@ -956,6 +984,21 @@ func (mr *MockFullNodeMockRecorder) EthAccounts(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthAccounts", reflect.TypeOf((*MockFullNode)(nil).EthAccounts), arg0) } +// EthAddressToFilecoinAddress mocks base method. +func (m *MockFullNode) EthAddressToFilecoinAddress(arg0 context.Context, arg1 ethtypes.EthAddress) (address.Address, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EthAddressToFilecoinAddress", arg0, arg1) + ret0, _ := ret[0].(address.Address) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// EthAddressToFilecoinAddress indicates an expected call of EthAddressToFilecoinAddress. +func (mr *MockFullNodeMockRecorder) EthAddressToFilecoinAddress(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthAddressToFilecoinAddress", reflect.TypeOf((*MockFullNode)(nil).EthAddressToFilecoinAddress), arg0, arg1) +} + // EthBlockNumber mocks base method. func (m *MockFullNode) EthBlockNumber(arg0 context.Context) (ethtypes.EthUint64, error) { m.ctrl.T.Helper() @@ -1256,6 +1299,21 @@ func (mr *MockFullNodeMockRecorder) EthGetTransactionByHash(arg0, arg1 interface return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthGetTransactionByHash", reflect.TypeOf((*MockFullNode)(nil).EthGetTransactionByHash), arg0, arg1) } +// EthGetTransactionByHashLimited mocks base method. +func (m *MockFullNode) EthGetTransactionByHashLimited(arg0 context.Context, arg1 *ethtypes.EthHash, arg2 abi.ChainEpoch) (*ethtypes.EthTx, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EthGetTransactionByHashLimited", arg0, arg1, arg2) + ret0, _ := ret[0].(*ethtypes.EthTx) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// EthGetTransactionByHashLimited indicates an expected call of EthGetTransactionByHashLimited. +func (mr *MockFullNodeMockRecorder) EthGetTransactionByHashLimited(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthGetTransactionByHashLimited", reflect.TypeOf((*MockFullNode)(nil).EthGetTransactionByHashLimited), arg0, arg1, arg2) +} + // EthGetTransactionCount mocks base method. func (m *MockFullNode) EthGetTransactionCount(arg0 context.Context, arg1 ethtypes.EthAddress, arg2 string) (ethtypes.EthUint64, error) { m.ctrl.T.Helper() @@ -1301,6 +1359,21 @@ func (mr *MockFullNodeMockRecorder) EthGetTransactionReceipt(arg0, arg1 interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthGetTransactionReceipt", reflect.TypeOf((*MockFullNode)(nil).EthGetTransactionReceipt), arg0, arg1) } +// EthGetTransactionReceiptLimited mocks base method. +func (m *MockFullNode) EthGetTransactionReceiptLimited(arg0 context.Context, arg1 ethtypes.EthHash, arg2 abi.ChainEpoch) (*api.EthTxReceipt, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EthGetTransactionReceiptLimited", arg0, arg1, arg2) + ret0, _ := ret[0].(*api.EthTxReceipt) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// EthGetTransactionReceiptLimited indicates an expected call of EthGetTransactionReceiptLimited. +func (mr *MockFullNodeMockRecorder) EthGetTransactionReceiptLimited(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthGetTransactionReceiptLimited", reflect.TypeOf((*MockFullNode)(nil).EthGetTransactionReceiptLimited), arg0, arg1, arg2) +} + // EthMaxPriorityFeePerGas mocks base method. func (m *MockFullNode) EthMaxPriorityFeePerGas(arg0 context.Context) (ethtypes.EthBigInt, error) { m.ctrl.T.Helper() @@ -1436,6 +1509,21 @@ func (mr *MockFullNodeMockRecorder) EthUnsubscribe(arg0, arg1 interface{}) *gomo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthUnsubscribe", reflect.TypeOf((*MockFullNode)(nil).EthUnsubscribe), arg0, arg1) } +// FilecoinAddressToEthAddress mocks base method. +func (m *MockFullNode) FilecoinAddressToEthAddress(arg0 context.Context, arg1 address.Address) (ethtypes.EthAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FilecoinAddressToEthAddress", arg0, arg1) + ret0, _ := ret[0].(ethtypes.EthAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// FilecoinAddressToEthAddress indicates an expected call of FilecoinAddressToEthAddress. +func (mr *MockFullNodeMockRecorder) FilecoinAddressToEthAddress(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilecoinAddressToEthAddress", reflect.TypeOf((*MockFullNode)(nil).FilecoinAddressToEthAddress), arg0, arg1) +} + // GasEstimateFeeCap mocks base method. func (m *MockFullNode) GasEstimateFeeCap(arg0 context.Context, arg1 *types.Message, arg2 int64, arg3 types.TipSetKey) (big.Int, error) { m.ctrl.T.Helper() diff --git a/api/proxy_gen.go b/api/proxy_gen.go index 42433bb852..5bbc6e96a1 100644 --- a/api/proxy_gen.go +++ b/api/proxy_gen.go @@ -12,7 +12,7 @@ import ( "github.com/consensus-shipyard/go-ipc-types/subnetactor" "github.com/google/uuid" "github.com/ipfs/go-cid" - "github.com/ipfs/go-libipfs/blocks" + blocks "github.com/ipfs/go-libipfs/blocks" "github.com/libp2p/go-libp2p/core/metrics" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" @@ -21,7 +21,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer" + 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" @@ -120,7 +120,7 @@ type EthSubscriberStruct struct { } type EthSubscriberMethods struct { - EthSubscription func(p0 context.Context, p1 jsonrpc.RawParams) error `notify:"true"rpc_method:"eth_subscription"` + EthSubscription func(p0 context.Context, p1 jsonrpc.RawParams) error `notify:"true" rpc_method:"eth_subscription"` } type EthSubscriberStub struct { @@ -143,6 +143,8 @@ type FullNodeMethods struct { ChainExport func(p0 context.Context, p1 abi.ChainEpoch, p2 bool, p3 types.TipSetKey) (<-chan []byte, error) `perm:"read"` + ChainExportRangeInternal func(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey, p3 ChainExportConfig) error `perm:"admin"` + ChainGetBlock func(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) `perm:"read"` ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) `perm:"read"` @@ -173,6 +175,8 @@ type FullNodeMethods struct { ChainHead func(p0 context.Context) (*types.TipSet, error) `perm:"read"` + ChainHotGC func(p0 context.Context, p1 HotGCOpts) error `perm:"admin"` + ChainNotify func(p0 context.Context) (<-chan []*HeadChange, error) `perm:"read"` ChainPrune func(p0 context.Context, p1 PruneOpts) error `perm:"admin"` @@ -247,6 +251,8 @@ type FullNodeMethods struct { EthAccounts func(p0 context.Context) ([]ethtypes.EthAddress, error) `perm:"read"` + EthAddressToFilecoinAddress func(p0 context.Context, p1 ethtypes.EthAddress) (address.Address, error) `perm:"read"` + EthBlockNumber func(p0 context.Context) (ethtypes.EthUint64, error) `perm:"read"` EthCall func(p0 context.Context, p1 ethtypes.EthCall, p2 string) (ethtypes.EthBytes, error) `perm:"read"` @@ -287,12 +293,16 @@ type FullNodeMethods struct { EthGetTransactionByHash func(p0 context.Context, p1 *ethtypes.EthHash) (*ethtypes.EthTx, error) `perm:"read"` + EthGetTransactionByHashLimited func(p0 context.Context, p1 *ethtypes.EthHash, p2 abi.ChainEpoch) (*ethtypes.EthTx, error) `perm:"read"` + EthGetTransactionCount func(p0 context.Context, p1 ethtypes.EthAddress, p2 string) (ethtypes.EthUint64, error) `perm:"read"` EthGetTransactionHashByCid func(p0 context.Context, p1 cid.Cid) (*ethtypes.EthHash, error) `perm:"read"` EthGetTransactionReceipt func(p0 context.Context, p1 ethtypes.EthHash) (*EthTxReceipt, error) `perm:"read"` + EthGetTransactionReceiptLimited func(p0 context.Context, p1 ethtypes.EthHash, p2 abi.ChainEpoch) (*EthTxReceipt, error) `perm:"read"` + EthMaxPriorityFeePerGas func(p0 context.Context) (ethtypes.EthBigInt, error) `perm:"read"` EthNewBlockFilter func(p0 context.Context) (ethtypes.EthFilterID, error) `perm:"write"` @@ -311,6 +321,8 @@ type FullNodeMethods struct { EthUnsubscribe func(p0 context.Context, p1 ethtypes.EthSubscriptionID) (bool, error) `perm:"write"` + FilecoinAddressToEthAddress func(p0 context.Context, p1 address.Address) (ethtypes.EthAddress, error) `perm:"read"` + GasEstimateFeeCap func(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"` GasEstimateGasLimit func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (int64, error) `perm:"read"` @@ -715,18 +727,18 @@ type GatewayMethods struct { EthGetStorageAt func(p0 context.Context, p1 ethtypes.EthAddress, p2 ethtypes.EthBytes, p3 string) (ethtypes.EthBytes, error) `` - EthGetTransactionByBlockHashAndIndex func(p0 context.Context, p1 ethtypes.EthHash, p2 ethtypes.EthUint64) (ethtypes.EthTx, error) `` - - EthGetTransactionByBlockNumberAndIndex func(p0 context.Context, p1 ethtypes.EthUint64, p2 ethtypes.EthUint64) (ethtypes.EthTx, error) `` - EthGetTransactionByHash func(p0 context.Context, p1 *ethtypes.EthHash) (*ethtypes.EthTx, error) `` + EthGetTransactionByHashLimited func(p0 context.Context, p1 *ethtypes.EthHash, p2 abi.ChainEpoch) (*ethtypes.EthTx, error) `` + EthGetTransactionCount func(p0 context.Context, p1 ethtypes.EthAddress, p2 string) (ethtypes.EthUint64, error) `` EthGetTransactionHashByCid func(p0 context.Context, p1 cid.Cid) (*ethtypes.EthHash, error) `` EthGetTransactionReceipt func(p0 context.Context, p1 ethtypes.EthHash) (*EthTxReceipt, error) `` + EthGetTransactionReceiptLimited func(p0 context.Context, p1 ethtypes.EthHash, p2 abi.ChainEpoch) (*EthTxReceipt, error) `` + EthMaxPriorityFeePerGas func(p0 context.Context) (ethtypes.EthBigInt, error) `` EthNewBlockFilter func(p0 context.Context) (ethtypes.EthFilterID, error) `` @@ -747,6 +759,8 @@ type GatewayMethods struct { GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) `` + MpoolGetNonce func(p0 context.Context, p1 address.Address) (uint64, error) `` + MpoolPush func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) `` MsigGetAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) `` @@ -763,8 +777,12 @@ type GatewayMethods struct { StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `` + StateCall func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*InvocResult, error) `` + StateDealProviderCollateralBounds func(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (DealCollateralBounds, error) `` + StateDecodeParams func(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) `` + StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `` StateListMiners func(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) `` @@ -781,9 +799,11 @@ type GatewayMethods struct { StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) `` + StateNetworkName func(p0 context.Context) (dtypes.NetworkName, error) `` + StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) `` - StateReadState func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*ActorState, error) `perm:"read"` + StateReadState func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*ActorState, error) `` StateSearchMsg func(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) `` @@ -791,6 +811,8 @@ type GatewayMethods struct { StateVerifiedClientStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) `` + StateVerifierStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) `` + StateWaitMsg func(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) `` Version func(p0 context.Context) (APIVersion, error) `` @@ -970,7 +992,7 @@ type StorageMinerMethods struct { MarketListIncompleteDeals func(p0 context.Context) ([]storagemarket.MinerDeal, error) `perm:"read"` - MarketListRetrievalDeals func(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) `perm:"read"` + MarketListRetrievalDeals func(p0 context.Context) ([]struct{}, error) `perm:"read"` MarketPendingDeals func(p0 context.Context) (PendingDealInfo, error) `perm:"write"` @@ -1466,6 +1488,17 @@ func (s *FullNodeStub) ChainExport(p0 context.Context, p1 abi.ChainEpoch, p2 boo return nil, ErrNotSupported } +func (s *FullNodeStruct) ChainExportRangeInternal(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey, p3 ChainExportConfig) error { + if s.Internal.ChainExportRangeInternal == nil { + return ErrNotSupported + } + return s.Internal.ChainExportRangeInternal(p0, p1, p2, p3) +} + +func (s *FullNodeStub) ChainExportRangeInternal(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey, p3 ChainExportConfig) error { + return ErrNotSupported +} + func (s *FullNodeStruct) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) { if s.Internal.ChainGetBlock == nil { return nil, ErrNotSupported @@ -1631,6 +1664,17 @@ func (s *FullNodeStub) ChainHead(p0 context.Context) (*types.TipSet, error) { return nil, ErrNotSupported } +func (s *FullNodeStruct) ChainHotGC(p0 context.Context, p1 HotGCOpts) error { + if s.Internal.ChainHotGC == nil { + return ErrNotSupported + } + return s.Internal.ChainHotGC(p0, p1) +} + +func (s *FullNodeStub) ChainHotGC(p0 context.Context, p1 HotGCOpts) error { + return ErrNotSupported +} + func (s *FullNodeStruct) ChainNotify(p0 context.Context) (<-chan []*HeadChange, error) { if s.Internal.ChainNotify == nil { return nil, ErrNotSupported @@ -2038,6 +2082,17 @@ func (s *FullNodeStub) EthAccounts(p0 context.Context) ([]ethtypes.EthAddress, e return *new([]ethtypes.EthAddress), ErrNotSupported } +func (s *FullNodeStruct) EthAddressToFilecoinAddress(p0 context.Context, p1 ethtypes.EthAddress) (address.Address, error) { + if s.Internal.EthAddressToFilecoinAddress == nil { + return *new(address.Address), ErrNotSupported + } + return s.Internal.EthAddressToFilecoinAddress(p0, p1) +} + +func (s *FullNodeStub) EthAddressToFilecoinAddress(p0 context.Context, p1 ethtypes.EthAddress) (address.Address, error) { + return *new(address.Address), ErrNotSupported +} + func (s *FullNodeStruct) EthBlockNumber(p0 context.Context) (ethtypes.EthUint64, error) { if s.Internal.EthBlockNumber == nil { return *new(ethtypes.EthUint64), ErrNotSupported @@ -2258,6 +2313,17 @@ func (s *FullNodeStub) EthGetTransactionByHash(p0 context.Context, p1 *ethtypes. return nil, ErrNotSupported } +func (s *FullNodeStruct) EthGetTransactionByHashLimited(p0 context.Context, p1 *ethtypes.EthHash, p2 abi.ChainEpoch) (*ethtypes.EthTx, error) { + if s.Internal.EthGetTransactionByHashLimited == nil { + return nil, ErrNotSupported + } + return s.Internal.EthGetTransactionByHashLimited(p0, p1, p2) +} + +func (s *FullNodeStub) EthGetTransactionByHashLimited(p0 context.Context, p1 *ethtypes.EthHash, p2 abi.ChainEpoch) (*ethtypes.EthTx, error) { + return nil, ErrNotSupported +} + func (s *FullNodeStruct) EthGetTransactionCount(p0 context.Context, p1 ethtypes.EthAddress, p2 string) (ethtypes.EthUint64, error) { if s.Internal.EthGetTransactionCount == nil { return *new(ethtypes.EthUint64), ErrNotSupported @@ -2291,6 +2357,17 @@ func (s *FullNodeStub) EthGetTransactionReceipt(p0 context.Context, p1 ethtypes. return nil, ErrNotSupported } +func (s *FullNodeStruct) EthGetTransactionReceiptLimited(p0 context.Context, p1 ethtypes.EthHash, p2 abi.ChainEpoch) (*EthTxReceipt, error) { + if s.Internal.EthGetTransactionReceiptLimited == nil { + return nil, ErrNotSupported + } + return s.Internal.EthGetTransactionReceiptLimited(p0, p1, p2) +} + +func (s *FullNodeStub) EthGetTransactionReceiptLimited(p0 context.Context, p1 ethtypes.EthHash, p2 abi.ChainEpoch) (*EthTxReceipt, error) { + return nil, ErrNotSupported +} + func (s *FullNodeStruct) EthMaxPriorityFeePerGas(p0 context.Context) (ethtypes.EthBigInt, error) { if s.Internal.EthMaxPriorityFeePerGas == nil { return *new(ethtypes.EthBigInt), ErrNotSupported @@ -2390,6 +2467,17 @@ func (s *FullNodeStub) EthUnsubscribe(p0 context.Context, p1 ethtypes.EthSubscri return false, ErrNotSupported } +func (s *FullNodeStruct) FilecoinAddressToEthAddress(p0 context.Context, p1 address.Address) (ethtypes.EthAddress, error) { + if s.Internal.FilecoinAddressToEthAddress == nil { + return *new(ethtypes.EthAddress), ErrNotSupported + } + return s.Internal.FilecoinAddressToEthAddress(p0, p1) +} + +func (s *FullNodeStub) FilecoinAddressToEthAddress(p0 context.Context, p1 address.Address) (ethtypes.EthAddress, error) { + return *new(ethtypes.EthAddress), ErrNotSupported +} + func (s *FullNodeStruct) GasEstimateFeeCap(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) { if s.Internal.GasEstimateFeeCap == nil { return *new(types.BigInt), ErrNotSupported @@ -4546,36 +4634,25 @@ func (s *GatewayStub) EthGetStorageAt(p0 context.Context, p1 ethtypes.EthAddress return *new(ethtypes.EthBytes), ErrNotSupported } -func (s *GatewayStruct) EthGetTransactionByBlockHashAndIndex(p0 context.Context, p1 ethtypes.EthHash, p2 ethtypes.EthUint64) (ethtypes.EthTx, error) { - if s.Internal.EthGetTransactionByBlockHashAndIndex == nil { - return *new(ethtypes.EthTx), ErrNotSupported - } - return s.Internal.EthGetTransactionByBlockHashAndIndex(p0, p1, p2) -} - -func (s *GatewayStub) EthGetTransactionByBlockHashAndIndex(p0 context.Context, p1 ethtypes.EthHash, p2 ethtypes.EthUint64) (ethtypes.EthTx, error) { - return *new(ethtypes.EthTx), ErrNotSupported -} - -func (s *GatewayStruct) EthGetTransactionByBlockNumberAndIndex(p0 context.Context, p1 ethtypes.EthUint64, p2 ethtypes.EthUint64) (ethtypes.EthTx, error) { - if s.Internal.EthGetTransactionByBlockNumberAndIndex == nil { - return *new(ethtypes.EthTx), ErrNotSupported +func (s *GatewayStruct) EthGetTransactionByHash(p0 context.Context, p1 *ethtypes.EthHash) (*ethtypes.EthTx, error) { + if s.Internal.EthGetTransactionByHash == nil { + return nil, ErrNotSupported } - return s.Internal.EthGetTransactionByBlockNumberAndIndex(p0, p1, p2) + return s.Internal.EthGetTransactionByHash(p0, p1) } -func (s *GatewayStub) EthGetTransactionByBlockNumberAndIndex(p0 context.Context, p1 ethtypes.EthUint64, p2 ethtypes.EthUint64) (ethtypes.EthTx, error) { - return *new(ethtypes.EthTx), ErrNotSupported +func (s *GatewayStub) EthGetTransactionByHash(p0 context.Context, p1 *ethtypes.EthHash) (*ethtypes.EthTx, error) { + return nil, ErrNotSupported } -func (s *GatewayStruct) EthGetTransactionByHash(p0 context.Context, p1 *ethtypes.EthHash) (*ethtypes.EthTx, error) { - if s.Internal.EthGetTransactionByHash == nil { +func (s *GatewayStruct) EthGetTransactionByHashLimited(p0 context.Context, p1 *ethtypes.EthHash, p2 abi.ChainEpoch) (*ethtypes.EthTx, error) { + if s.Internal.EthGetTransactionByHashLimited == nil { return nil, ErrNotSupported } - return s.Internal.EthGetTransactionByHash(p0, p1) + return s.Internal.EthGetTransactionByHashLimited(p0, p1, p2) } -func (s *GatewayStub) EthGetTransactionByHash(p0 context.Context, p1 *ethtypes.EthHash) (*ethtypes.EthTx, error) { +func (s *GatewayStub) EthGetTransactionByHashLimited(p0 context.Context, p1 *ethtypes.EthHash, p2 abi.ChainEpoch) (*ethtypes.EthTx, error) { return nil, ErrNotSupported } @@ -4612,6 +4689,17 @@ func (s *GatewayStub) EthGetTransactionReceipt(p0 context.Context, p1 ethtypes.E return nil, ErrNotSupported } +func (s *GatewayStruct) EthGetTransactionReceiptLimited(p0 context.Context, p1 ethtypes.EthHash, p2 abi.ChainEpoch) (*EthTxReceipt, error) { + if s.Internal.EthGetTransactionReceiptLimited == nil { + return nil, ErrNotSupported + } + return s.Internal.EthGetTransactionReceiptLimited(p0, p1, p2) +} + +func (s *GatewayStub) EthGetTransactionReceiptLimited(p0 context.Context, p1 ethtypes.EthHash, p2 abi.ChainEpoch) (*EthTxReceipt, error) { + return nil, ErrNotSupported +} + func (s *GatewayStruct) EthMaxPriorityFeePerGas(p0 context.Context) (ethtypes.EthBigInt, error) { if s.Internal.EthMaxPriorityFeePerGas == nil { return *new(ethtypes.EthBigInt), ErrNotSupported @@ -4722,6 +4810,17 @@ func (s *GatewayStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Messag return nil, ErrNotSupported } +func (s *GatewayStruct) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) { + if s.Internal.MpoolGetNonce == nil { + return 0, ErrNotSupported + } + return s.Internal.MpoolGetNonce(p0, p1) +} + +func (s *GatewayStub) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) { + return 0, ErrNotSupported +} + func (s *GatewayStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) { if s.Internal.MpoolPush == nil { return *new(cid.Cid), ErrNotSupported @@ -4810,6 +4909,17 @@ func (s *GatewayStub) StateAccountKey(p0 context.Context, p1 address.Address, p2 return *new(address.Address), ErrNotSupported } +func (s *GatewayStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*InvocResult, error) { + if s.Internal.StateCall == nil { + return nil, ErrNotSupported + } + return s.Internal.StateCall(p0, p1, p2) +} + +func (s *GatewayStub) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*InvocResult, error) { + return nil, ErrNotSupported +} + func (s *GatewayStruct) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (DealCollateralBounds, error) { if s.Internal.StateDealProviderCollateralBounds == nil { return *new(DealCollateralBounds), ErrNotSupported @@ -4821,6 +4931,17 @@ func (s *GatewayStub) StateDealProviderCollateralBounds(p0 context.Context, p1 a return *new(DealCollateralBounds), ErrNotSupported } +func (s *GatewayStruct) StateDecodeParams(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) { + if s.Internal.StateDecodeParams == nil { + return nil, ErrNotSupported + } + return s.Internal.StateDecodeParams(p0, p1, p2, p3, p4) +} + +func (s *GatewayStub) StateDecodeParams(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) { + return nil, ErrNotSupported +} + func (s *GatewayStruct) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) { if s.Internal.StateGetActor == nil { return nil, ErrNotSupported @@ -4909,6 +5030,17 @@ func (s *GatewayStub) StateMinerProvingDeadline(p0 context.Context, p1 address.A return nil, ErrNotSupported } +func (s *GatewayStruct) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) { + if s.Internal.StateNetworkName == nil { + return *new(dtypes.NetworkName), ErrNotSupported + } + return s.Internal.StateNetworkName(p0) +} + +func (s *GatewayStub) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) { + return *new(dtypes.NetworkName), ErrNotSupported +} + func (s *GatewayStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) { if s.Internal.StateNetworkVersion == nil { return *new(apitypes.NetworkVersion), ErrNotSupported @@ -4964,6 +5096,17 @@ func (s *GatewayStub) StateVerifiedClientStatus(p0 context.Context, p1 address.A return nil, ErrNotSupported } +func (s *GatewayStruct) StateVerifierStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) { + if s.Internal.StateVerifierStatus == nil { + return nil, ErrNotSupported + } + return s.Internal.StateVerifierStatus(p0, p1, p2) +} + +func (s *GatewayStub) StateVerifierStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) { + return nil, ErrNotSupported +} + func (s *GatewayStruct) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) { if s.Internal.StateWaitMsg == nil { return nil, ErrNotSupported @@ -5778,15 +5921,15 @@ func (s *StorageMinerStub) MarketListIncompleteDeals(p0 context.Context) ([]stor return *new([]storagemarket.MinerDeal), ErrNotSupported } -func (s *StorageMinerStruct) MarketListRetrievalDeals(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) { +func (s *StorageMinerStruct) MarketListRetrievalDeals(p0 context.Context) ([]struct{}, error) { if s.Internal.MarketListRetrievalDeals == nil { - return *new([]retrievalmarket.ProviderDealState), ErrNotSupported + return *new([]struct{}), ErrNotSupported } return s.Internal.MarketListRetrievalDeals(p0) } -func (s *StorageMinerStub) MarketListRetrievalDeals(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) { - return *new([]retrievalmarket.ProviderDealState), ErrNotSupported +func (s *StorageMinerStub) MarketListRetrievalDeals(p0 context.Context) ([]struct{}, error) { + return *new([]struct{}), ErrNotSupported } func (s *StorageMinerStruct) MarketPendingDeals(p0 context.Context) (PendingDealInfo, error) { diff --git a/api/types.go b/api/types.go index e679034368..a8cd2bfa78 100644 --- a/api/types.go +++ b/api/types.go @@ -8,13 +8,15 @@ import ( "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" + 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/go-state-types/builtin/v9/miner" @@ -110,16 +112,12 @@ func NewDataTransferChannel(hostID peer.ID, channelState datatransfer.ChannelSta IsSender: channelState.Sender() == hostID, Message: channelState.Message(), } - stringer, ok := channelState.Voucher().(fmt.Stringer) - if ok { - channel.Voucher = stringer.String() + voucher := channelState.Voucher() + voucherJSON, err := ipld.Encode(voucher.Voucher, dagjson.Encode) + if err != nil { + channel.Voucher = fmt.Errorf("Voucher Serialization: %w", err).Error() } else { - voucherJSON, err := json.Marshal(channelState.Voucher()) - if err != nil { - channel.Voucher = fmt.Errorf("Voucher Serialization: %w", err).Error() - } else { - channel.Voucher = string(voucherJSON) - } + channel.Voucher = string(voucherJSON) } if channel.IsSender { channel.IsInitiator = !channelState.IsPull() @@ -398,3 +396,12 @@ func (m *MsgUuidMapType) UnmarshalJSON(b []byte) error { } return nil } + +// ChainExportConfig holds configuration for chain ranged exports. +type ChainExportConfig struct { + WriteBufferSize int + NumWorkers int + IncludeMessages bool + IncludeReceipts bool + IncludeStateRoots bool +} diff --git a/api/v0api/full.go b/api/v0api/full.go index 490cd73c83..86a4ce47a2 100644 --- a/api/v0api/full.go +++ b/api/v0api/full.go @@ -10,7 +10,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer" + 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" diff --git a/api/v0api/gateway.go b/api/v0api/gateway.go index 674371c144..2a0bfb2f7f 100644 --- a/api/v0api/gateway.go +++ b/api/v0api/gateway.go @@ -14,6 +14,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/node/modules/dtypes" ) // MODIFYING THE API INTERFACE @@ -44,12 +45,15 @@ type Gateway interface { ChainNotify(context.Context) (<-chan []*api.HeadChange, error) ChainReadObj(context.Context, cid.Cid) ([]byte, error) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error) + MpoolGetNonce(ctx context.Context, addr address.Address) (uint64, error) MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error) MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error) MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error) MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*api.MsigTransaction, error) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) + StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*api.InvocResult, error) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error) + StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error) StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) @@ -59,6 +63,7 @@ type Gateway interface { StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (api.MinerInfo, error) StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error) StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error) + StateNetworkName(context.Context) (dtypes.NetworkName, error) StateNetworkVersion(context.Context, types.TipSetKey) (abinetwork.Version, error) StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) diff --git a/api/v0api/proxy_gen.go b/api/v0api/proxy_gen.go index 5fa0d949c6..3d4a60f1c7 100644 --- a/api/v0api/proxy_gen.go +++ b/api/v0api/proxy_gen.go @@ -12,7 +12,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer" + 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" @@ -451,6 +451,8 @@ type GatewayMethods struct { GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) `` + MpoolGetNonce func(p0 context.Context, p1 address.Address) (uint64, error) `` + MpoolPush func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) `` MsigGetAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) `` @@ -461,8 +463,12 @@ type GatewayMethods struct { StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `` + StateCall func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*api.InvocResult, error) `` + StateDealProviderCollateralBounds func(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) `` + StateDecodeParams func(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) `` + StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `` StateGetReceipt func(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) `` @@ -481,6 +487,8 @@ type GatewayMethods struct { StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) `` + StateNetworkName func(p0 context.Context) (dtypes.NetworkName, error) `` + StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (abinetwork.Version, error) `` StateSearchMsg func(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) `` @@ -2677,6 +2685,17 @@ func (s *GatewayStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Messag return nil, ErrNotSupported } +func (s *GatewayStruct) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) { + if s.Internal.MpoolGetNonce == nil { + return 0, ErrNotSupported + } + return s.Internal.MpoolGetNonce(p0, p1) +} + +func (s *GatewayStub) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) { + return 0, ErrNotSupported +} + func (s *GatewayStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) { if s.Internal.MpoolPush == nil { return *new(cid.Cid), ErrNotSupported @@ -2732,6 +2751,17 @@ func (s *GatewayStub) StateAccountKey(p0 context.Context, p1 address.Address, p2 return *new(address.Address), ErrNotSupported } +func (s *GatewayStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*api.InvocResult, error) { + if s.Internal.StateCall == nil { + return nil, ErrNotSupported + } + return s.Internal.StateCall(p0, p1, p2) +} + +func (s *GatewayStub) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*api.InvocResult, error) { + return nil, ErrNotSupported +} + func (s *GatewayStruct) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) { if s.Internal.StateDealProviderCollateralBounds == nil { return *new(api.DealCollateralBounds), ErrNotSupported @@ -2743,6 +2773,17 @@ func (s *GatewayStub) StateDealProviderCollateralBounds(p0 context.Context, p1 a return *new(api.DealCollateralBounds), ErrNotSupported } +func (s *GatewayStruct) StateDecodeParams(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) { + if s.Internal.StateDecodeParams == nil { + return nil, ErrNotSupported + } + return s.Internal.StateDecodeParams(p0, p1, p2, p3, p4) +} + +func (s *GatewayStub) StateDecodeParams(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) { + return nil, ErrNotSupported +} + func (s *GatewayStruct) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) { if s.Internal.StateGetActor == nil { return nil, ErrNotSupported @@ -2842,6 +2883,17 @@ func (s *GatewayStub) StateMinerProvingDeadline(p0 context.Context, p1 address.A return nil, ErrNotSupported } +func (s *GatewayStruct) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) { + if s.Internal.StateNetworkName == nil { + return *new(dtypes.NetworkName), ErrNotSupported + } + return s.Internal.StateNetworkName(p0) +} + +func (s *GatewayStub) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) { + return *new(dtypes.NetworkName), ErrNotSupported +} + func (s *GatewayStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (abinetwork.Version, error) { if s.Internal.StateNetworkVersion == nil { return *new(abinetwork.Version), ErrNotSupported diff --git a/api/v0api/v0mocks/mock_full.go b/api/v0api/v0mocks/mock_full.go index 619f19d35b..a4adfc9440 100644 --- a/api/v0api/v0mocks/mock_full.go +++ b/api/v0api/v0mocks/mock_full.go @@ -20,7 +20,7 @@ import ( address "github.com/filecoin-project/go-address" bitfield "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer" + 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" diff --git a/blockstore/badger/blockstore.go b/blockstore/badger/blockstore.go index da4f9f67dd..1b52eb548d 100644 --- a/blockstore/badger/blockstore.go +++ b/blockstore/badger/blockstore.go @@ -20,6 +20,7 @@ import ( pool "github.com/libp2p/go-buffer-pool" "github.com/multiformats/go-base32" "go.uber.org/zap" + "golang.org/x/xerrors" "github.com/filecoin-project/lotus/blockstore" ) @@ -44,7 +45,8 @@ const ( // MemoryMap is equivalent to badger/options.MemoryMap. MemoryMap = options.MemoryMap // LoadToRAM is equivalent to badger/options.LoadToRAM. - LoadToRAM = options.LoadToRAM + LoadToRAM = options.LoadToRAM + defaultGCThreshold = 0.125 ) // Options embeds the badger options themselves, and augments them with @@ -439,7 +441,7 @@ func (b *Blockstore) deleteDB(path string) { } } -func (b *Blockstore) onlineGC() error { +func (b *Blockstore) onlineGC(ctx context.Context, threshold float64) error { b.lockDB() defer b.unlockDB() @@ -448,6 +450,9 @@ func (b *Blockstore) onlineGC() error { if nworkers < 2 { nworkers = 2 } + if nworkers > 7 { // max out at 1 goroutine per badger level + nworkers = 7 + } err := b.db.Flatten(nworkers) if err != nil { @@ -455,7 +460,12 @@ func (b *Blockstore) onlineGC() error { } for err == nil { - err = b.db.RunValueLogGC(0.125) + select { + case <-ctx.Done(): + err = ctx.Err() + default: + err = b.db.RunValueLogGC(threshold) + } } if err == badger.ErrNoRewrite { @@ -468,7 +478,7 @@ func (b *Blockstore) onlineGC() error { // CollectGarbage compacts and runs garbage collection on the value log; // implements the BlockstoreGC trait -func (b *Blockstore) CollectGarbage(opts ...blockstore.BlockstoreGCOption) error { +func (b *Blockstore) CollectGarbage(ctx context.Context, opts ...blockstore.BlockstoreGCOption) error { if err := b.access(); err != nil { return err } @@ -485,8 +495,48 @@ func (b *Blockstore) CollectGarbage(opts ...blockstore.BlockstoreGCOption) error if options.FullGC { return b.movingGC() } + threshold := options.Threshold + if threshold == 0 { + threshold = defaultGCThreshold + } + return b.onlineGC(ctx, threshold) +} - return b.onlineGC() +// GCOnce runs garbage collection on the value log; +// implements BlockstoreGCOnce trait +func (b *Blockstore) GCOnce(ctx context.Context, opts ...blockstore.BlockstoreGCOption) error { + if err := b.access(); err != nil { + return err + } + defer b.viewers.Done() + + var options blockstore.BlockstoreGCOptions + for _, opt := range opts { + err := opt(&options) + if err != nil { + return err + } + } + if options.FullGC { + return xerrors.Errorf("FullGC option specified for GCOnce but full GC is non incremental") + } + + threshold := options.Threshold + if threshold == 0 { + threshold = defaultGCThreshold + } + + b.lockDB() + defer b.unlockDB() + + // Note no compaction needed before single GC as we will hit at most one vlog anyway + err := b.db.RunValueLogGC(threshold) + if err == badger.ErrNoRewrite { + // not really an error in this case, it signals the end of GC + return nil + } + + return err } // Size returns the aggregate size of the blockstore @@ -551,6 +601,18 @@ func (b *Blockstore) View(ctx context.Context, cid cid.Cid, fn func([]byte) erro }) } +func (b *Blockstore) Flush(context.Context) error { + if err := b.access(); err != nil { + return err + } + defer b.viewers.Done() + + b.lockDB() + defer b.unlockDB() + + return b.db.Sync() +} + // Has implements Blockstore.Has. func (b *Blockstore) Has(ctx context.Context, cid cid.Cid) (bool, error) { if err := b.access(); err != nil { diff --git a/blockstore/badger/blockstore_test.go b/blockstore/badger/blockstore_test.go index fc81be43e7..bf85104bb5 100644 --- a/blockstore/badger/blockstore_test.go +++ b/blockstore/badger/blockstore_test.go @@ -145,7 +145,7 @@ func testMove(t *testing.T, optsF func(string) Options) { return nil }) g.Go(func() error { - return db.CollectGarbage(blockstore.WithFullGC(true)) + return db.CollectGarbage(ctx, blockstore.WithFullGC(true)) }) err = g.Wait() @@ -230,7 +230,7 @@ func testMove(t *testing.T, optsF func(string) Options) { checkPath() // now do another FullGC to test the double move and following of symlinks - if err := db.CollectGarbage(blockstore.WithFullGC(true)); err != nil { + if err := db.CollectGarbage(ctx, blockstore.WithFullGC(true)); err != nil { t.Fatal(err) } diff --git a/blockstore/blockstore.go b/blockstore/blockstore.go index f2fb00e8a5..8d16bbd509 100644 --- a/blockstore/blockstore.go +++ b/blockstore/blockstore.go @@ -18,6 +18,7 @@ type Blockstore interface { blockstore.Blockstore blockstore.Viewer BatchDeleter + Flusher } // BasicBlockstore is an alias to the original IPFS Blockstore. @@ -25,6 +26,10 @@ type BasicBlockstore = blockstore.Blockstore type Viewer = blockstore.Viewer +type Flusher interface { + Flush(context.Context) error +} + type BatchDeleter interface { DeleteMany(ctx context.Context, cids []cid.Cid) error } @@ -36,7 +41,12 @@ type BlockstoreIterator interface { // BlockstoreGC is a trait for blockstores that support online garbage collection type BlockstoreGC interface { - CollectGarbage(options ...BlockstoreGCOption) error + CollectGarbage(ctx context.Context, options ...BlockstoreGCOption) error +} + +// BlockstoreGCOnce is a trait for a blockstore that supports incremental online garbage collection +type BlockstoreGCOnce interface { + GCOnce(ctx context.Context, options ...BlockstoreGCOption) error } // BlockstoreGCOption is a functional interface for controlling blockstore GC options @@ -45,6 +55,8 @@ type BlockstoreGCOption = func(*BlockstoreGCOptions) error // BlockstoreGCOptions is a struct with GC options type BlockstoreGCOptions struct { FullGC bool + // fraction of garbage in badger vlog before its worth processing in online GC + Threshold float64 } func WithFullGC(fullgc bool) BlockstoreGCOption { @@ -54,6 +66,13 @@ func WithFullGC(fullgc bool) BlockstoreGCOption { } } +func WithThreshold(threshold float64) BlockstoreGCOption { + return func(opts *BlockstoreGCOptions) error { + opts.Threshold = threshold + return nil + } +} + // BlockstoreSize is a trait for on-disk blockstores that can report their size type BlockstoreSize interface { Size() (int64, error) @@ -92,6 +111,13 @@ type adaptedBlockstore struct { var _ Blockstore = (*adaptedBlockstore)(nil) +func (a *adaptedBlockstore) Flush(ctx context.Context) error { + if flusher, canFlush := a.Blockstore.(Flusher); canFlush { + return flusher.Flush(ctx) + } + return nil +} + func (a *adaptedBlockstore) View(ctx context.Context, cid cid.Cid, callback func([]byte) error) error { blk, err := a.Get(ctx, cid) if err != nil { diff --git a/blockstore/buffered.go b/blockstore/buffered.go index e089ed561f..bc37b2f69e 100644 --- a/blockstore/buffered.go +++ b/blockstore/buffered.go @@ -46,6 +46,8 @@ var ( _ Viewer = (*BufferedBlockstore)(nil) ) +func (bs *BufferedBlockstore) Flush(ctx context.Context) error { return bs.write.Flush(ctx) } + func (bs *BufferedBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) { a, err := bs.read.AllKeysChan(ctx) if err != nil { diff --git a/blockstore/discard.go b/blockstore/discard.go index 7f1a76a228..8787975618 100644 --- a/blockstore/discard.go +++ b/blockstore/discard.go @@ -38,6 +38,10 @@ func (b *discardstore) View(ctx context.Context, cid cid.Cid, f func([]byte) err return b.bs.View(ctx, cid, f) } +func (b *discardstore) Flush(ctx context.Context) error { + return nil +} + func (b *discardstore) Put(ctx context.Context, blk blocks.Block) error { return nil } diff --git a/blockstore/idstore.go b/blockstore/idstore.go index a0ecec5f07..ae807076d3 100644 --- a/blockstore/idstore.go +++ b/blockstore/idstore.go @@ -179,3 +179,7 @@ func (b *idstore) Close() error { } return nil } + +func (b *idstore) Flush(ctx context.Context) error { + return b.bs.Flush(ctx) +} diff --git a/blockstore/ipfs.go b/blockstore/ipfs.go index 756314f2de..c7dbb480a4 100644 --- a/blockstore/ipfs.go +++ b/blockstore/ipfs.go @@ -3,7 +3,7 @@ package blockstore import ( "bytes" "context" - "io/ioutil" + "io" "github.com/ipfs/go-cid" httpapi "github.com/ipfs/go-ipfs-http-client" @@ -103,7 +103,7 @@ func (i *IPFSBlockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, er return nil, xerrors.Errorf("getting ipfs block: %w", err) } - data, err := ioutil.ReadAll(rd) + data, err := io.ReadAll(rd) if err != nil { return nil, err } diff --git a/blockstore/mem.go b/blockstore/mem.go index 05da287c58..5b06634de1 100644 --- a/blockstore/mem.go +++ b/blockstore/mem.go @@ -17,6 +17,8 @@ func NewMemory() MemBlockstore { // To match behavior of badger blockstore we index by multihash only. type MemBlockstore map[string]blocks.Block +func (MemBlockstore) Flush(context.Context) error { return nil } + func (m MemBlockstore) DeleteBlock(ctx context.Context, k cid.Cid) error { delete(m, string(k.Hash())) return nil diff --git a/blockstore/net.go b/blockstore/net.go index a6b008af2b..62aceed71f 100644 --- a/blockstore/net.go +++ b/blockstore/net.go @@ -410,6 +410,8 @@ func (n *NetworkStore) HashOnRead(enabled bool) { return } +func (*NetworkStore) Flush(context.Context) error { return nil } + func (n *NetworkStore) Stop(ctx context.Context) error { close(n.closing) diff --git a/blockstore/splitstore/markset_badger.go b/blockstore/splitstore/markset_badger.go index 8808a62170..2dac673cd7 100644 --- a/blockstore/splitstore/markset_badger.go +++ b/blockstore/splitstore/markset_badger.go @@ -351,7 +351,7 @@ func (s *BadgerMarkSet) write(seqno int) (err error) { persist := s.persist s.mx.RUnlock() - if persist && !system.BadgerFsyncDisable { + if persist && !system.BadgerFsyncDisable { // WARNING: disabling sync makes recovery from crash during critical section unsound return s.db.Sync() } diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index 0afb15c11c..bd9efb630b 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -115,6 +115,23 @@ type Config struct { // A positive value is the number of compactions before a full GC is performed; // a value of 1 will perform full GC in every compaction. HotStoreFullGCFrequency uint64 + + // HotstoreMaxSpaceTarget suggests the max allowed space the hotstore can take. + // This is not a hard limit, it is possible for the hotstore to exceed the target + // for example if state grows massively between compactions. The splitstore + // will make a best effort to avoid overflowing the target and in practice should + // never overflow. This field is used when doing GC at the end of a compaction to + // adaptively choose moving GC + HotstoreMaxSpaceTarget uint64 + + // Moving GC will be triggered when total moving size exceeds + // HotstoreMaxSpaceTarget - HotstoreMaxSpaceThreshold + HotstoreMaxSpaceThreshold uint64 + + // Safety buffer to prevent moving GC from overflowing disk. + // Moving GC will not occur when total moving size exceeds + // HotstoreMaxSpaceTarget - HotstoreMaxSpaceSafetyBuffer + HotstoreMaxSpaceSafetyBuffer uint64 } // ChainAccessor allows the Splitstore to access the chain. It will most likely @@ -165,6 +182,7 @@ type SplitStore struct { compactionIndex int64 pruneIndex int64 + onlineGCCnt int64 ctx context.Context cancel func() @@ -195,6 +213,17 @@ type SplitStore struct { // registered protectors protectors []func(func(cid.Cid) error) error + + // dag sizes measured during latest compaction + // logged and used for GC strategy + + // protected by compaction lock + szWalk int64 + szProtectedTxns int64 + szKeys int64 // approximate, not counting keys protected when entering critical section + + // protected by txnLk + szMarkedLiveRefs int64 } var _ bstore.Blockstore = (*SplitStore)(nil) @@ -447,6 +476,23 @@ func (s *SplitStore) GetSize(ctx context.Context, cid cid.Cid) (int, error) { } } +func (s *SplitStore) Flush(ctx context.Context) error { + s.txnLk.RLock() + defer s.txnLk.RUnlock() + + if err := s.cold.Flush(ctx); err != nil { + return err + } + if err := s.hot.Flush(ctx); err != nil { + return err + } + if err := s.ds.Sync(ctx, dstore.Key{}); err != nil { + return err + } + + return nil +} + func (s *SplitStore) Put(ctx context.Context, blk blocks.Block) error { if isIdentiyCid(blk.Cid()) { return nil diff --git a/blockstore/splitstore/splitstore_check.go b/blockstore/splitstore/splitstore_check.go index 3365159802..2645c78c5b 100644 --- a/blockstore/splitstore/splitstore_check.go +++ b/blockstore/splitstore/splitstore_check.go @@ -95,7 +95,7 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error { } defer visitor.Close() //nolint - err = s.walkChain(curTs, boundaryEpoch, boundaryEpoch, visitor, + size := s.walkChain(curTs, boundaryEpoch, boundaryEpoch, visitor, func(c cid.Cid) error { if isUnitaryObject(c) { return errStopWalk @@ -133,7 +133,7 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error { return err } - log.Infow("check done", "cold", *coldCnt, "missing", *missingCnt) + log.Infow("check done", "cold", *coldCnt, "missing", *missingCnt, "walk size", size) write("--") write("cold: %d missing: %d", *coldCnt, *missingCnt) write("DONE") diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index 0422736f03..e5cfec0e47 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -66,7 +66,8 @@ var ( ) const ( - batchSize = 16384 + batchSize = 16384 + cidKeySize = 128 ) func (s *SplitStore) HeadChange(_, apply []*types.TipSet) error { @@ -115,8 +116,6 @@ func (s *SplitStore) HeadChange(_, apply []*types.TipSet) error { return nil } - // Prioritize hot store compaction over cold store prune - if epoch-s.baseEpoch > CompactionThreshold { // it's time to compact -- prepare the transaction and go! s.beginTxnProtect() @@ -176,6 +175,8 @@ func (s *SplitStore) protectTipSets(apply []*types.TipSet) { timestamp := time.Unix(int64(curTs.MinTimestamp()), 0) doSync := time.Since(timestamp) < SyncWaitTime go func() { + // we are holding the txnLk while marking + // so critical section cannot delete if doSync { defer func() { s.txnSyncMx.Lock() @@ -199,9 +200,11 @@ func (s *SplitStore) markLiveRefs(cids []cid.Cid) { log.Debugf("marking %d live refs", len(cids)) startMark := time.Now() + szMarked := new(int64) + count := new(int32) visitor := newConcurrentVisitor() - walkObject := func(c cid.Cid) error { + walkObject := func(c cid.Cid) (int64, error) { return s.walkObjectIncomplete(c, visitor, func(c cid.Cid) error { if isUnitaryObject(c) { @@ -228,10 +231,12 @@ func (s *SplitStore) markLiveRefs(cids []cid.Cid) { // optimize the common case of single put if len(cids) == 1 { - if err := walkObject(cids[0]); err != nil { + sz, err := walkObject(cids[0]) + if err != nil { log.Errorf("error marking tipset refs: %s", err) } log.Debugw("marking live refs done", "took", time.Since(startMark), "marked", *count) + atomic.AddInt64(szMarked, sz) return } @@ -243,9 +248,11 @@ func (s *SplitStore) markLiveRefs(cids []cid.Cid) { worker := func() error { for c := range workch { - if err := walkObject(c); err != nil { + sz, err := walkObject(c) + if err != nil { return err } + atomic.AddInt64(szMarked, sz) } return nil @@ -268,7 +275,8 @@ func (s *SplitStore) markLiveRefs(cids []cid.Cid) { log.Errorf("error marking tipset refs: %s", err) } - log.Debugw("marking live refs done", "took", time.Since(startMark), "marked", *count) + log.Debugw("marking live refs done", "took", time.Since(startMark), "marked", *count, "size marked", *szMarked) + s.szMarkedLiveRefs += atomic.LoadInt64(szMarked) } // transactionally protect a view @@ -361,6 +369,7 @@ func (s *SplitStore) protectTxnRefs(markSet MarkSet) error { log.Infow("protecting transactional references", "refs", len(txnRefs)) count := 0 + sz := new(int64) workch := make(chan cid.Cid, len(txnRefs)) startProtect := time.Now() @@ -393,10 +402,11 @@ func (s *SplitStore) protectTxnRefs(markSet MarkSet) error { worker := func() error { for c := range workch { - err := s.doTxnProtect(c, markSet) + szTxn, err := s.doTxnProtect(c, markSet) if err != nil { return xerrors.Errorf("error protecting transactional references to %s: %w", c, err) } + atomic.AddInt64(sz, szTxn) } return nil } @@ -409,16 +419,16 @@ func (s *SplitStore) protectTxnRefs(markSet MarkSet) error { if err := g.Wait(); err != nil { return err } - - log.Infow("protecting transactional refs done", "took", time.Since(startProtect), "protected", count) + s.szProtectedTxns += atomic.LoadInt64(sz) + log.Infow("protecting transactional refs done", "took", time.Since(startProtect), "protected", count, "protected size", sz) } } // transactionally protect a reference by walking the object and marking. // concurrent markings are short circuited by checking the markset. -func (s *SplitStore) doTxnProtect(root cid.Cid, markSet MarkSet) error { +func (s *SplitStore) doTxnProtect(root cid.Cid, markSet MarkSet) (int64, error) { if err := s.checkClosing(); err != nil { - return err + return 0, err } // Note: cold objects are deleted heaviest first, so the consituents of an object @@ -442,7 +452,7 @@ func (s *SplitStore) doTxnProtect(root cid.Cid, markSet MarkSet) error { }, func(c cid.Cid) error { if s.txnMissing != nil { - log.Warnf("missing object reference %s in %s", c, root) + log.Debugf("missing object reference %s in %s", c, root) s.txnRefsMx.Lock() s.txnMissing[c] = struct{}{} s.txnRefsMx.Unlock() @@ -509,6 +519,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error { // might be potentially inconsistent; abort compaction and notify the user to intervene. return xerrors.Errorf("checkpoint exists; aborting compaction") } + s.clearSizeMeasurements() currentEpoch := curTs.Height() boundaryEpoch := currentEpoch - CompactionBoundary @@ -598,7 +609,6 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error { } err = s.walkChain(curTs, boundaryEpoch, inclMsgsEpoch, &noopVisitor{}, fHot, fCold) - if err != nil { return xerrors.Errorf("error marking: %w", err) } @@ -638,7 +648,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error { defer purgew.Close() //nolint:errcheck // some stats for logging - var hotCnt, coldCnt, purgeCnt int + var hotCnt, coldCnt, purgeCnt int64 err = s.hot.ForEachKey(func(c cid.Cid) error { // was it marked? mark, err := markSet.Has(c) @@ -689,9 +699,10 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error { log.Infow("cold collection done", "took", time.Since(startCollect)) - log.Infow("compaction stats", "hot", hotCnt, "cold", coldCnt) - stats.Record(s.ctx, metrics.SplitstoreCompactionHot.M(int64(hotCnt))) - stats.Record(s.ctx, metrics.SplitstoreCompactionCold.M(int64(coldCnt))) + log.Infow("compaction stats", "hot", hotCnt, "cold", coldCnt, "purge", purgeCnt) + s.szKeys = hotCnt * cidKeySize + stats.Record(s.ctx, metrics.SplitstoreCompactionHot.M(hotCnt)) + stats.Record(s.ctx, metrics.SplitstoreCompactionCold.M(coldCnt)) if err := s.checkClosing(); err != nil { return err @@ -773,8 +784,8 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error { return xerrors.Errorf("error purging cold objects: %w", err) } log.Infow("purging cold objects from hotstore done", "took", time.Since(startPurge)) - s.endCriticalSection() + log.Infow("critical section done", "total protected size", s.szProtectedTxns, "total marked live size", s.szMarkedLiveRefs) if err := checkpoint.Close(); err != nil { log.Warnf("error closing checkpoint: %s", err) @@ -788,10 +799,13 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error { if err := os.Remove(s.coldSetPath()); err != nil { log.Warnf("error removing coldset: %s", err) } + if err := os.Remove(s.discardSetPath()); err != nil { + log.Warnf("error removing discardset: %s", err) + } // we are done; do some housekeeping s.endTxnProtect() - s.gcHotstore() + s.gcHotAfterCompaction() err = s.setBaseEpoch(boundaryEpoch) if err != nil { @@ -904,6 +918,7 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp copy(toWalk, ts.Cids()) walkCnt := new(int64) scanCnt := new(int64) + szWalk := new(int64) tsRef := func(blkCids []cid.Cid) (cid.Cid, error) { return types.NewTipSetKey(blkCids...).Cid() @@ -939,48 +954,64 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp if err != nil { return xerrors.Errorf("error computing cid reference to parent tipset") } - if err := s.walkObjectIncomplete(pRef, visitor, fHot, stopWalk); err != nil { + sz, err := s.walkObjectIncomplete(pRef, visitor, fHot, stopWalk) + if err != nil { return xerrors.Errorf("error walking parent tipset cid reference") } + atomic.AddInt64(szWalk, sz) // message are retained if within the inclMsgs boundary if hdr.Height >= inclMsgs && hdr.Height > 0 { if inclMsgs < inclState { // we need to use walkObjectIncomplete here, as messages/receipts may be missing early on if we // synced from snapshot and have a long HotStoreMessageRetentionPolicy. - if err := s.walkObjectIncomplete(hdr.Messages, visitor, fHot, stopWalk); err != nil { + sz, err := s.walkObjectIncomplete(hdr.Messages, visitor, fHot, stopWalk) + if err != nil { return xerrors.Errorf("error walking messages (cid: %s): %w", hdr.Messages, err) } + atomic.AddInt64(szWalk, sz) - if err := s.walkObjectIncomplete(hdr.ParentMessageReceipts, visitor, fHot, stopWalk); err != nil { + sz, err = s.walkObjectIncomplete(hdr.ParentMessageReceipts, visitor, fHot, stopWalk) + if err != nil { return xerrors.Errorf("error walking messages receipts (cid: %s): %w", hdr.ParentMessageReceipts, err) } + atomic.AddInt64(szWalk, sz) } else { - if err := s.walkObject(hdr.Messages, visitor, fHot); err != nil { + sz, err = s.walkObject(hdr.Messages, visitor, fHot) + if err != nil { return xerrors.Errorf("error walking messages (cid: %s): %w", hdr.Messages, err) } + atomic.AddInt64(szWalk, sz) - if err := s.walkObject(hdr.ParentMessageReceipts, visitor, fHot); err != nil { + sz, err := s.walkObjectIncomplete(hdr.ParentMessageReceipts, visitor, fHot, stopWalk) + if err != nil { return xerrors.Errorf("error walking message receipts (cid: %s): %w", hdr.ParentMessageReceipts, err) } + atomic.AddInt64(szWalk, sz) } } // messages and receipts outside of inclMsgs are included in the cold store if hdr.Height < inclMsgs && hdr.Height > 0 { - if err := s.walkObjectIncomplete(hdr.Messages, visitor, fCold, stopWalk); err != nil { + sz, err := s.walkObjectIncomplete(hdr.Messages, visitor, fCold, stopWalk) + if err != nil { return xerrors.Errorf("error walking messages (cid: %s): %w", hdr.Messages, err) } - if err := s.walkObjectIncomplete(hdr.ParentMessageReceipts, visitor, fCold, stopWalk); err != nil { + atomic.AddInt64(szWalk, sz) + sz, err = s.walkObjectIncomplete(hdr.ParentMessageReceipts, visitor, fCold, stopWalk) + if err != nil { return xerrors.Errorf("error walking messages receipts (cid: %s): %w", hdr.ParentMessageReceipts, err) } + atomic.AddInt64(szWalk, sz) } // state is only retained if within the inclState boundary, with the exception of genesis if hdr.Height >= inclState || hdr.Height == 0 { - if err := s.walkObject(hdr.ParentStateRoot, visitor, fHot); err != nil { + sz, err := s.walkObject(hdr.ParentStateRoot, visitor, fHot) + if err != nil { return xerrors.Errorf("error walking state root (cid: %s): %w", hdr.ParentStateRoot, err) } + atomic.AddInt64(szWalk, sz) atomic.AddInt64(scanCnt, 1) } @@ -998,9 +1029,11 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp if err != nil { return xerrors.Errorf("error computing cid reference to parent tipset") } - if err := s.walkObjectIncomplete(hRef, visitor, fHot, stopWalk); err != nil { + sz, err := s.walkObjectIncomplete(hRef, visitor, fHot, stopWalk) + if err != nil { return xerrors.Errorf("error walking parent tipset cid reference") } + atomic.AddInt64(szWalk, sz) for len(toWalk) > 0 { // walking can take a while, so check this with every opportunity @@ -1044,123 +1077,129 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp } } - log.Infow("chain walk done", "walked", *walkCnt, "scanned", *scanCnt) - + log.Infow("chain walk done", "walked", *walkCnt, "scanned", *scanCnt, "walk size", szWalk) + s.szWalk = atomic.LoadInt64(szWalk) return nil } -func (s *SplitStore) walkObject(c cid.Cid, visitor ObjectVisitor, f func(cid.Cid) error) error { +func (s *SplitStore) walkObject(c cid.Cid, visitor ObjectVisitor, f func(cid.Cid) error) (int64, error) { + var sz int64 visit, err := visitor.Visit(c) if err != nil { - return xerrors.Errorf("error visiting object: %w", err) + return 0, xerrors.Errorf("error visiting object: %w", err) } if !visit { - return nil + return sz, nil } if err := f(c); err != nil { if err == errStopWalk { - return nil + return sz, nil } - return err + return 0, err } if c.Prefix().Codec != cid.DagCBOR { - return nil + return sz, nil } // check this before recursing if err := s.checkClosing(); err != nil { - return err + return 0, err } var links []cid.Cid err = s.view(c, func(data []byte) error { + sz += int64(len(data)) return cbg.ScanForLinks(bytes.NewReader(data), func(c cid.Cid) { links = append(links, c) }) }) if err != nil { - return xerrors.Errorf("error scanning linked block (cid: %s): %w", c, err) + return 0, xerrors.Errorf("error scanning linked block (cid: %s): %w", c, err) } for _, c := range links { - err := s.walkObject(c, visitor, f) + szLink, err := s.walkObject(c, visitor, f) if err != nil { - return xerrors.Errorf("error walking link (cid: %s): %w", c, err) + return 0, xerrors.Errorf("error walking link (cid: %s): %w", c, err) } + sz += szLink } - return nil + return sz, nil } // like walkObject, but the object may be potentially incomplete (references missing) -func (s *SplitStore) walkObjectIncomplete(c cid.Cid, visitor ObjectVisitor, f, missing func(cid.Cid) error) error { +func (s *SplitStore) walkObjectIncomplete(c cid.Cid, visitor ObjectVisitor, f, missing func(cid.Cid) error) (int64, error) { + var sz int64 visit, err := visitor.Visit(c) if err != nil { - return xerrors.Errorf("error visiting object: %w", err) + return 0, xerrors.Errorf("error visiting object: %w", err) } if !visit { - return nil + return sz, nil } // occurs check -- only for DAGs if c.Prefix().Codec == cid.DagCBOR { has, err := s.has(c) if err != nil { - return xerrors.Errorf("error occur checking %s: %w", c, err) + return 0, xerrors.Errorf("error occur checking %s: %w", c, err) } if !has { err = missing(c) if err == errStopWalk { - return nil + return sz, nil } - return err + return 0, err } } if err := f(c); err != nil { if err == errStopWalk { - return nil + return sz, nil } - return err + return 0, err } if c.Prefix().Codec != cid.DagCBOR { - return nil + return sz, nil } // check this before recursing if err := s.checkClosing(); err != nil { - return err + return sz, err } var links []cid.Cid err = s.view(c, func(data []byte) error { + sz += int64(len(data)) return cbg.ScanForLinks(bytes.NewReader(data), func(c cid.Cid) { links = append(links, c) }) }) if err != nil { - return xerrors.Errorf("error scanning linked block (cid: %s): %w", c, err) + return 0, xerrors.Errorf("error scanning linked block (cid: %s): %w", c, err) } for _, c := range links { - err := s.walkObjectIncomplete(c, visitor, f, missing) + szLink, err := s.walkObjectIncomplete(c, visitor, f, missing) if err != nil { - return xerrors.Errorf("error walking link (cid: %s): %w", c, err) + return 0, xerrors.Errorf("error walking link (cid: %s): %w", c, err) } + sz += szLink } - return nil + return sz, nil } // internal version used during compaction and related operations @@ -1426,8 +1465,9 @@ func (s *SplitStore) completeCompaction() error { } s.compactType = none - // Note: at this point we can start the splitstore; a compaction should run on - // the first head change, which will trigger gc on the hotstore. + // Note: at this point we can start the splitstore; base epoch is not + // incremented here so a compaction should run on the first head + // change, which will trigger gc on the hotstore. // We don't mind the second (back-to-back) compaction as the head will // have advanced during marking and coldset accumulation. return nil @@ -1485,6 +1525,13 @@ func (s *SplitStore) completePurge(coldr *ColdSetReader, checkpoint *Checkpoint, return nil } +func (s *SplitStore) clearSizeMeasurements() { + s.szKeys = 0 + s.szMarkedLiveRefs = 0 + s.szProtectedTxns = 0 + s.szWalk = 0 +} + // I really don't like having this code, but we seem to have some occasional DAG references with // missing constituents. During testing in mainnet *some* of these references *sometimes* appeared // after a little bit. @@ -1525,7 +1572,7 @@ func (s *SplitStore) waitForMissingRefs(markSet MarkSet) { missing = make(map[cid.Cid]struct{}) for c := range towalk { - err := s.walkObjectIncomplete(c, visitor, + _, err := s.walkObjectIncomplete(c, visitor, func(c cid.Cid) error { if isUnitaryObject(c) { return errStopWalk diff --git a/blockstore/splitstore/splitstore_expose.go b/blockstore/splitstore/splitstore_expose.go index d092fbb9bd..7461e338db 100644 --- a/blockstore/splitstore/splitstore_expose.go +++ b/blockstore/splitstore/splitstore_expose.go @@ -77,6 +77,10 @@ func (es *exposedSplitStore) GetSize(ctx context.Context, c cid.Cid) (int, error return size, err } +func (es *exposedSplitStore) Flush(ctx context.Context) error { + return es.s.Flush(ctx) +} + func (es *exposedSplitStore) Put(ctx context.Context, blk blocks.Block) error { return es.s.Put(ctx, blk) } diff --git a/blockstore/splitstore/splitstore_gc.go b/blockstore/splitstore/splitstore_gc.go index c9be94d2ea..2ddb7d404e 100644 --- a/blockstore/splitstore/splitstore_gc.go +++ b/blockstore/splitstore/splitstore_gc.go @@ -7,15 +7,61 @@ import ( bstore "github.com/filecoin-project/lotus/blockstore" ) -func (s *SplitStore) gcHotstore() { +const ( + // Fraction of garbage in badger vlog for online GC traversal to collect garbage + AggressiveOnlineGCThreshold = 0.0001 +) + +func (s *SplitStore) gcHotAfterCompaction() { + // Measure hotstore size, determine if we should do full GC, determine if we can do full GC. + // We should do full GC if + // FullGCFrequency is specified and compaction index matches frequency + // OR HotstoreMaxSpaceTarget is specified and total moving space is within 150 GB of target + // We can do full if + // HotstoreMaxSpaceTarget is not specified + // OR total moving space would not exceed 50 GB below target + // + // a) If we should not do full GC => online GC + // b) If we should do full GC and can => moving GC + // c) If we should do full GC and can't => aggressive online GC + getSize := func() int64 { + sizer, ok := s.hot.(bstore.BlockstoreSize) + if ok { + size, err := sizer.Size() + if err != nil { + log.Warnf("error getting hotstore size: %s, estimating empty hot store for targeting", err) + return 0 + } + return size + } + log.Errorf("Could not measure hotstore size, assuming it is 0 bytes, which it is not") + return 0 + } + hotSize := getSize() + + copySizeApprox := s.szKeys + s.szMarkedLiveRefs + s.szProtectedTxns + s.szWalk + shouldTarget := s.cfg.HotstoreMaxSpaceTarget > 0 && hotSize+copySizeApprox > int64(s.cfg.HotstoreMaxSpaceTarget)-int64(s.cfg.HotstoreMaxSpaceThreshold) + shouldFreq := s.cfg.HotStoreFullGCFrequency > 0 && s.compactionIndex%int64(s.cfg.HotStoreFullGCFrequency) == 0 + shouldDoFull := shouldTarget || shouldFreq + canDoFull := s.cfg.HotstoreMaxSpaceTarget == 0 || hotSize+copySizeApprox < int64(s.cfg.HotstoreMaxSpaceTarget)-int64(s.cfg.HotstoreMaxSpaceSafetyBuffer) + log.Debugw("approximating new hot store size", "key size", s.szKeys, "marked live refs", s.szMarkedLiveRefs, "protected txns", s.szProtectedTxns, "walked DAG", s.szWalk) + log.Infof("measured hot store size: %d, approximate new size: %d, should do full %t, can do full %t", hotSize, copySizeApprox, shouldDoFull, canDoFull) + var opts []bstore.BlockstoreGCOption - if s.cfg.HotStoreFullGCFrequency > 0 && s.compactionIndex%int64(s.cfg.HotStoreFullGCFrequency) == 0 { + if shouldDoFull && canDoFull { opts = append(opts, bstore.WithFullGC(true)) + } else if shouldDoFull && !canDoFull { + log.Warnf("Attention! Estimated moving GC size %d is not within safety buffer %d of target max %d, performing aggressive online GC to attempt to bring hotstore size down safely", copySizeApprox, s.cfg.HotstoreMaxSpaceSafetyBuffer, s.cfg.HotstoreMaxSpaceTarget) + log.Warn("If problem continues you can 1) temporarily allocate more disk space to hotstore and 2) reflect in HotstoreMaxSpaceTarget OR trigger manual move with `lotus chain prune hot-moving`") + log.Warn("If problem continues and you do not have any more disk space you can run continue to manually trigger online GC at aggressive thresholds (< 0.01) with `lotus chain prune hot`") + + opts = append(opts, bstore.WithThreshold(AggressiveOnlineGCThreshold)) } if err := s.gcBlockstore(s.hot, opts); err != nil { log.Warnf("error garbage collecting hostore: %s", err) } + log.Infof("measured hot store size after GC: %d", getSize()) } func (s *SplitStore) gcBlockstore(b bstore.Blockstore, opts []bstore.BlockstoreGCOption) error { @@ -23,7 +69,7 @@ func (s *SplitStore) gcBlockstore(b bstore.Blockstore, opts []bstore.BlockstoreG log.Info("garbage collecting blockstore") startGC := time.Now() - if err := gc.CollectGarbage(opts...); err != nil { + if err := gc.CollectGarbage(s.ctx, opts...); err != nil { return err } @@ -33,3 +79,19 @@ func (s *SplitStore) gcBlockstore(b bstore.Blockstore, opts []bstore.BlockstoreG return fmt.Errorf("blockstore doesn't support garbage collection: %T", b) } + +func (s *SplitStore) gcBlockstoreOnce(b bstore.Blockstore, opts []bstore.BlockstoreGCOption) error { + if gc, ok := b.(bstore.BlockstoreGCOnce); ok { + log.Debug("gc blockstore once") + startGC := time.Now() + + if err := gc.GCOnce(s.ctx, opts...); err != nil { + return err + } + + log.Debugw("gc blockstore once done", "took", time.Since(startGC)) + return nil + } + + return fmt.Errorf("blockstore doesn't support gc once: %T", b) +} diff --git a/blockstore/splitstore/splitstore_prune.go b/blockstore/splitstore/splitstore_prune.go index 6a26c00d27..08d5b8cca1 100644 --- a/blockstore/splitstore/splitstore_prune.go +++ b/blockstore/splitstore/splitstore_prune.go @@ -47,6 +47,23 @@ var ( PruneThreshold = 7 * build.Finality ) +// 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)} + return s.gcBlockstore(s.hot, gcOpts) + } + + gcOpts := []bstore.BlockstoreGCOption{bstore.WithThreshold(opts.Threshold)} + var err error + if opts.Periodic { + err = s.gcBlockstore(s.hot, gcOpts) + } else { + err = s.gcBlockstoreOnce(s.hot, gcOpts) + } + return err +} + // PruneChain instructs the SplitStore to prune chain state in the coldstore, according to the // options specified. func (s *SplitStore) PruneChain(opts api.PruneOpts) error { @@ -329,9 +346,9 @@ func (s *SplitStore) doPrune(curTs *types.TipSet, retainStateP func(int64) bool, } s.pruneIndex++ - err = s.ds.Put(s.ctx, pruneIndexKey, int64ToBytes(s.compactionIndex)) + err = s.ds.Put(s.ctx, pruneIndexKey, int64ToBytes(s.pruneIndex)) if err != nil { - return xerrors.Errorf("error saving compaction index: %w", err) + return xerrors.Errorf("error saving prune index: %w", err) } return nil diff --git a/blockstore/splitstore/splitstore_reify.go b/blockstore/splitstore/splitstore_reify.go index aa14f090af..07efedead3 100644 --- a/blockstore/splitstore/splitstore_reify.go +++ b/blockstore/splitstore/splitstore_reify.go @@ -101,7 +101,7 @@ func (s *SplitStore) doReify(c cid.Cid) { defer s.txnLk.RUnlock() count := 0 - err := s.walkObjectIncomplete(c, newTmpVisitor(), + _, err := s.walkObjectIncomplete(c, newTmpVisitor(), func(c cid.Cid) error { if isUnitaryObject(c) { return errStopWalk diff --git a/blockstore/splitstore/splitstore_test.go b/blockstore/splitstore/splitstore_test.go index c97a9d01cc..68e1bfb658 100644 --- a/blockstore/splitstore/splitstore_test.go +++ b/blockstore/splitstore/splitstore_test.go @@ -757,6 +757,8 @@ func (b *mockStore) DeleteMany(_ context.Context, cids []cid.Cid) error { return nil } +func (b *mockStore) Flush(context.Context) error { return nil } + func (b *mockStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) { return nil, errors.New("not implemented") } diff --git a/blockstore/sync.go b/blockstore/sync.go index 4f97027ae1..652943dca1 100644 --- a/blockstore/sync.go +++ b/blockstore/sync.go @@ -20,6 +20,8 @@ type SyncBlockstore struct { bs MemBlockstore // specifically use a memStore to save indirection overhead. } +func (*SyncBlockstore) Flush(context.Context) error { return nil } + func (m *SyncBlockstore) DeleteBlock(ctx context.Context, k cid.Cid) error { m.mu.Lock() defer m.mu.Unlock() diff --git a/blockstore/timed.go b/blockstore/timed.go index dda2e19589..3deabb7b88 100644 --- a/blockstore/timed.go +++ b/blockstore/timed.go @@ -93,6 +93,16 @@ func (t *TimedCacheBlockstore) rotate() { t.mu.Unlock() } +func (t *TimedCacheBlockstore) Flush(ctx context.Context) error { + t.mu.Lock() + defer t.mu.Unlock() + + if err := t.active.Flush(ctx); err != nil { + return err + } + return t.inactive.Flush(ctx) +} + func (t *TimedCacheBlockstore) Put(ctx context.Context, b blocks.Block) error { // Don't check the inactive set here. We want to keep this block for at // least one interval. diff --git a/blockstore/union.go b/blockstore/union.go index 3372cd20c9..ae6f819558 100644 --- a/blockstore/union.go +++ b/blockstore/union.go @@ -55,6 +55,15 @@ func (m unionBlockstore) GetSize(ctx context.Context, cid cid.Cid) (size int, er return size, err } +func (m unionBlockstore) Flush(ctx context.Context) (err error) { + for _, bs := range m { + if err = bs.Flush(ctx); err != nil { + break + } + } + return err +} + func (m unionBlockstore) Put(ctx context.Context, block blocks.Block) (err error) { for _, bs := range m { if err = bs.Put(ctx, block); err != nil { diff --git a/build/actors/ipc-actors.car b/build/actors/ipc-actors.car index d3def79f19..22fe0c8417 100644 Binary files a/build/actors/ipc-actors.car and b/build/actors/ipc-actors.car differ diff --git a/build/actors/pack.sh b/build/actors/pack.sh index 863a3c5c70..e594bb2daf 100755 --- a/build/actors/pack.sh +++ b/build/actors/pack.sh @@ -52,4 +52,4 @@ popd echo "Generating metadata..." -make -C ../../ RELEASE="$RELEASE" bundle-gen +make -C ../../ VERSION="$VERSION" RELEASE="$RELEASE" RELEASE_OVERRIDES="${RELEASE_OVERRIDES[*]}" bundle-gen diff --git a/build/actors/v10.tar.zst b/build/actors/v10.tar.zst index 8453eba42d..9ac6453f8c 100644 Binary files a/build/actors/v10.tar.zst and b/build/actors/v10.tar.zst differ diff --git a/build/bootstrap/butterflynet.pi b/build/bootstrap/butterflynet.pi index 1def01c7cc..5b10e2bc4a 100644 --- a/build/bootstrap/butterflynet.pi +++ b/build/bootstrap/butterflynet.pi @@ -1,2 +1,2 @@ -/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWHkVVMJ1rfVLM5poNrgwTJiaDkpDLkPqQ9zVuNPQ7AJ6p -/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWRyzqeQd51HCvVK3nvegmnBsYYPLSZbxR3Q9XAoUrUZ18 +/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWCa1wgMMBB9JjA2kYqaN1v5uh7xvcsc2gQJBHzPp7G57H +/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWD6fCvo1dyci6wsjTLyv7eJK73pCVz6RCQjbtPvbc8LYw diff --git a/build/builtin_actors_gen.go b/build/builtin_actors_gen.go index 70ab8e20bb..2b28870ec5 100644 --- a/build/builtin_actors_gen.go +++ b/build/builtin_actors_gen.go @@ -49,27 +49,27 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": MustParseCid("bafk2bzacecjkesz766626ab4svnzpq3jfs26a75vfktlfaku5fjdao2eyiqyq"), }, }, { - Network: "butterflynet", - Version: 10, - - ManifestCid: MustParseCid("bafy2bzacec4tgdtsrgbdywc5nzf5ekiw5zuefrasiahb4n5yqwcrwjzcdp4nk"), + Network: "butterflynet", + Version: 10, + BundleGitTag: "v10.0.0", + ManifestCid: MustParseCid("bafy2bzaceckjhsggacixv2d377zfdcnuio4hzkveprio3xnhm3gohi3zy3zco"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzaceae6holtld4caox2xood5rpcjotrxj7lnfxvfmhivb3s2ddyj22qw"), - "cron": MustParseCid("bafk2bzaceab2vrkun6ps3hactaumfzgm6zk4sdasiqiedxzdttkvw64hndcdg"), - "datacap": MustParseCid("bafk2bzacecixx45mf6chwktsd2g5krlr35p3g7pkkrvzjeujz4ryhlztpl7fq"), - "eam": MustParseCid("bafk2bzaceciekaxrlgnmosmthbgptpdu2bzdoo7mt67p7cqbdvnxup6xpd6ns"), - "ethaccount": MustParseCid("bafk2bzacecb4ttgbjzkaqrg7phqgao2kxsgeet4wnrr5qmftlfad26v6jpk4o"), - "evm": MustParseCid("bafk2bzacecrwejr7bedjww67ppof3abb6df66w76r7wpuzc426arc4oibndeu"), - "init": MustParseCid("bafk2bzacea5ke6q7je2ofrai7dpw67vat463d5f74g4evvwtcu7dhp4ff6ztk"), - "multisig": MustParseCid("bafk2bzacecs6aws25bvqmyzny3vcilr2xw35jymryu4yzodg7l7gf4bhjpolw"), - "paymentchannel": MustParseCid("bafk2bzacedtewkfsicz2rm4hsjsbagrl2mhmqfdikpsq3ggoct5iqa6caka6a"), + "account": MustParseCid("bafk2bzacedkt3uzgugcsdrcsyfvizcpyr5eshltmienbyhjne2t7t3ktkihny"), + "cron": MustParseCid("bafk2bzacecrehknegmfnhmhwy2g43cw52mvl7ptfpp44syus4iph7az7uveuq"), + "datacap": MustParseCid("bafk2bzaced4krgbpj4sywcc453l3pygqr4qocc6nxylhztsm4duvkgfwd7vws"), + "eam": MustParseCid("bafk2bzacebn5lyg5pfhjpdlf3r7lnah4x33bhp5afftdgbr4kbpuioytr4bhe"), + "ethaccount": MustParseCid("bafk2bzaceaxyu24a2tbiacfr4p367xjtptrbang4qrh3fx65cojyrzolwyi4u"), + "evm": MustParseCid("bafk2bzacea5bqaubqeuqmpguxrem2pgocjr43wcfi5e3jpw2e3b4o6tcvs746"), + "init": MustParseCid("bafk2bzaceaufptkdg2gc4eq4ijqxtqp7wxwifusxb6kxay3vdz3wr5epqjbho"), + "multisig": MustParseCid("bafk2bzacedp3c26ccw3l7fci4xhedxhqeqevkubuf5okuslq7o7rcqwqfahci"), + "paymentchannel": MustParseCid("bafk2bzacedlmiqvbutz4ebx2mezy3pqj72x2yt4gwea7sf4dv4a4s7xidelok"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzacecqmh47zzzlzbtaueaz2fvhiqnktccfrcqicul4j6tca2bruvtn44"), - "storagemarket": MustParseCid("bafk2bzacecbvqe4k6jyvwovxfnkylj3zpb2vjxkc3ar53x7c2pe5mkokxuyk6"), - "storageminer": MustParseCid("bafk2bzaceczbh2aofwcif4aqycydmnsjkkww4i4yfl4zca5j2dqopbz46dvrg"), - "storagepower": MustParseCid("bafk2bzacealioyiirrvov5rnh63omtsifppcsgba7my2tp7bslhd454wczepy"), - "system": MustParseCid("bafk2bzaceax2qvj3ap2dxvzgjps2vtmfgfrej3hdgk7a5euqdgsmak7ptalaa"), - "verifiedregistry": MustParseCid("bafk2bzaceaeqg3nqpjrgklq6nli6hz73s76hp4bwn6jsa64y22dj3csvmcl32"), + "reward": MustParseCid("bafk2bzacecrzxiowkhzpgz4rl2pdldzwmmnctuq5zzntqjkgyhyfllo3afb5s"), + "storagemarket": MustParseCid("bafk2bzacebh2q3ofolirt5q2jpx367dfv22aecevsmybba3yhnxfs3foe6c5q"), + "storageminer": MustParseCid("bafk2bzaceavop4j7iwneew6h7p667gvx37baloxilxetwkhsrr26jme6yye5o"), + "storagepower": MustParseCid("bafk2bzacecfblbat4w7jkxx7kjst33lowyb7s6apdnl7fsnpmy5c3jfq5kvye"), + "system": MustParseCid("bafk2bzacebojf25kc5yo7gskdbdgg5f52oppej2jp6nknzlvrww4ue5vkddd2"), + "verifiedregistry": MustParseCid("bafk2bzaceavue3zekq4wmvttck2vgxlcensrsgh5niu5qhna2owejycorftcc"), }, }, { Network: "calibrationnet", @@ -109,10 +109,10 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": MustParseCid("bafk2bzacebh7dj6j7yi5vadh7lgqjtq42qi2uq4n6zy2g5vjeathacwn2tscu"), }, }, { - Network: "calibrationnet", - Version: 10, - - ManifestCid: MustParseCid("bafy2bzaced25ta3j6ygs34roprilbtb3f6mxifyfnm7z7ndquaruxzdq3y7lo"), + Network: "calibrationnet", + Version: 10, + BundleGitTag: "v10.0.0-rc.1", + ManifestCid: MustParseCid("bafy2bzaced25ta3j6ygs34roprilbtb3f6mxifyfnm7z7ndquaruxzdq3y7lo"), Actors: map[string]cid.Cid{ "account": MustParseCid("bafk2bzacebhfuz3sv7duvk653544xsxhdn4lsmy7ol7k6gdgancyctvmd7lnq"), "cron": MustParseCid("bafk2bzacecw2yjb6ysieffa7lk7xd32b3n4ssowvafolt7eq52lp6lk4lkhji"), @@ -178,27 +178,27 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": MustParseCid("bafk2bzacebzndvdqtdck2y35smcxezldgh6nm6rbkj3g3fmiknsgg2uah235y"), }, }, { - Network: "caterpillarnet", - Version: 10, - - ManifestCid: MustParseCid("bafy2bzacedn6med544h6r7frzvyq5cvd7dqgnwgpmzgf42d4agoysx6tf475i"), + Network: "caterpillarnet", + Version: 10, + BundleGitTag: "v10.0.0", + ManifestCid: MustParseCid("bafy2bzaceajftd7jawqnwf4kzkotksrwy6ag7mu2apkvypzrrmxboheuum5oi"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzaceaysjus6ldo45qnedaopwctamtvvk4ga2l4dh7dmdtltsfin4puuk"), - "cron": MustParseCid("bafk2bzaceatq2ltzs2p37nniek3qpkitzlfd7iu2qtupzjtgvtggxglrhj7ay"), - "datacap": MustParseCid("bafk2bzacecgwe56okusbtsfimiwstxe7ova25uvrkj4osk3w5wl2qclvd64bi"), - "eam": MustParseCid("bafk2bzaceak3xbmmyj5glnm65kv5p7zc6u7x2xallwpz7aphqqouadn3jvumm"), - "ethaccount": MustParseCid("bafk2bzacec5bcn2i4ktsc54wx7gf4gwdd6xjcukh43szfya47jicxlwrhfrhk"), - "evm": MustParseCid("bafk2bzacebbc2iv4tw2kfmmcm7k3uxilpqvbjg6jsqbov4n7wqcxvvmtazfbc"), - "init": MustParseCid("bafk2bzacecvlqa2szdyem4gwgks2yk7bfernmzbxgo5felnpqgikyesdyiury"), - "multisig": MustParseCid("bafk2bzacebvqjxop2ald5f5hvu7qqb7ali7iluxcbdd3ssllawco6kafjteqw"), - "paymentchannel": MustParseCid("bafk2bzacebux5gmkddtur2kfebwzrxwqyqh2almlt4bw3v7f4bg3gy2zqjhbe"), + "account": MustParseCid("bafk2bzacecsbx4tovnr5x2ifcpqbpx33oht74mgtvmaauzrqcq2wnm7prr7ak"), + "cron": MustParseCid("bafk2bzacecpzfajba6m4v4ty342jw6lcu6n63bwtldmzko733wpd2q5jzfdvu"), + "datacap": MustParseCid("bafk2bzaceaa5zplkxvguwvnecfen62buhli5rraa3ga74b33a3sbscanzx4ok"), + "eam": MustParseCid("bafk2bzaceaffoa3eqmj7h53lwjatfqrjw63l3czk3vthyjz6oyhgwka3xwp6g"), + "ethaccount": MustParseCid("bafk2bzaceb7suh5m4xagoq6ap5v5x7vrhex2coq6gu6d54jteblm36cxhk5b2"), + "evm": MustParseCid("bafk2bzaceccmwmnb42pn7y7skbjwjur7b2eqxuw4lvm3he2xpvudjzluss4os"), + "init": MustParseCid("bafk2bzaceai72h4hxbgbp6gwm3m24uujscrj4bmbh6pxoerqtduijxt6dchfq"), + "multisig": MustParseCid("bafk2bzacebycdokda2gysqpnl3dwksgidujgsksf4n6qotjq4erj5zd7clkzy"), + "paymentchannel": MustParseCid("bafk2bzaceb5ucvftftiim6cxjusdpsmbht4x33kgexxgv5447gevk47h7jjqk"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzacebhm5w7q7wlxrwgbldolzq5qfcdmcu66j6ty37ppvpwafxzlizxn4"), - "storagemarket": MustParseCid("bafk2bzacebgniq7x22ep4oiithvlzepxo5jsvhuang2vqfz3prozihmviw5ey"), - "storageminer": MustParseCid("bafk2bzacecchnrfi4cgbpis4aagiqkhalgqudjlu25da7rer4ltlgpojersgm"), - "storagepower": MustParseCid("bafk2bzaceaxomr5xbhacbbn5ib6unekjz6igoqr4r4a2taxqcpyb4gpwi6zvk"), - "system": MustParseCid("bafk2bzacebmymcxtwkk6dzgtmkbradncjpsxdqkcwtemhio5acvpm742rguv6"), - "verifiedregistry": MustParseCid("bafk2bzaceae5zbc2h6gpyu6uzsvelvww53p5mujq2dvs3zi74w6mvnigwc3va"), + "reward": MustParseCid("bafk2bzaceajqygfkhamlzfsquqjgoy4p7pc2fruouqajapfucf22rbmtt5yf6"), + "storagemarket": MustParseCid("bafk2bzacednmzko2o5iv5kc6qxvpqfx5rq72krxzvna6cqoqem6flbfukglby"), + "storageminer": MustParseCid("bafk2bzacedayzz5qw7t7ykycf3a2hp666j5hb23a3mnmgp4xbbpvrx3h3ags4"), + "storagepower": MustParseCid("bafk2bzacedd3eiejzp35xuwjf3cvgd43b5ukqhelqmtgzqzqnt2wcy56pb744"), + "system": MustParseCid("bafk2bzacecfivztuulqqv4o5oyvvvrkblwix4hqt24pqru6ivnpioefhuhria"), + "verifiedregistry": MustParseCid("bafk2bzacecdhw6x7dfrxfysmn6tdbn2ny464omgqppxhjuawxauscidppd7pc"), }, }, { Network: "devnet", @@ -238,27 +238,27 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": MustParseCid("bafk2bzacednorhcy446agy7ecpmfms2u4aoa3mj2eqomffuoerbik5yavrxyi"), }, }, { - Network: "devnet", - Version: 10, - - ManifestCid: MustParseCid("bafy2bzaceco52tjbexpijsegolhdkhlziflum4bl27hcjrpnny273t3lsa6tc"), + Network: "devnet", + Version: 10, + BundleGitTag: "v10.0.0", + ManifestCid: MustParseCid("bafy2bzacebzz376j5kizfck56366kdz5aut6ktqrvqbi3efa2d4l2o2m653ts"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzacec6mdvynyu4cxb53tcdbkcu7w7jzxduxqqadi2y2rx2tsm42627tk"), - "cron": MustParseCid("bafk2bzaceaiscwdpdzdooja7hwz56ee3zztjogl4gljkccpefi7uliqtaq2ek"), - "datacap": MustParseCid("bafk2bzacedmfwrwwqmwxtfpvhp33mvt5btq2ewbjfrvfetwnrxt5r37i3ymzk"), - "eam": MustParseCid("bafk2bzaced2lwwrqtkgwxdgadpdbxpxjoh2gsunjg3bgtoubs47p7fbktbu26"), - "ethaccount": MustParseCid("bafk2bzacea5zob56gdcxudkubhol4gijzgwgtaaix4pmv3vpg4ihtsuxbdhqa"), - "evm": MustParseCid("bafk2bzaceacw53ajmggrugzfiag75suv27hvqoduypk24xru3cumctpxotbya"), - "init": MustParseCid("bafk2bzaceahgtz6647nbarvyjwtvjadzd2i2m75jv6nnrq3kgwrjxnvkykmhs"), - "multisig": MustParseCid("bafk2bzaceduhknhgd45j5aey7c7pszbbwqm4vuih4iwbuffjxekqteebuja5q"), - "paymentchannel": MustParseCid("bafk2bzacec5x44xqfgmdvsxr4nwzbcwaotodzffsjsslw64xblr7xgx7jr6c4"), + "account": MustParseCid("bafk2bzacedkj5dqs5xxamnlug2d5dyjl6askf7wlmvwzhmsrzcvogv7acqfe6"), + "cron": MustParseCid("bafk2bzaceabslrigld2vshng6sppbp3bsptjtttvbxctwqe5lkyl2efom2wu4"), + "datacap": MustParseCid("bafk2bzaceagg4qklzhhg5oj4shwqpoeykeyxus7xhj2abuot2tycdwsf2oaaa"), + "eam": MustParseCid("bafk2bzaceafttsbglcetxwtzqtdniittwczogkefgnxztgsp7mymcpvdlhdik"), + "ethaccount": MustParseCid("bafk2bzacedypn6tf3yrj4bavmscddygeima3puih37fbkxuhjhlrzbjh3dbo4"), + "evm": MustParseCid("bafk2bzacec5ywczgg73fnwi36nlxso3zduop3fwj3pq6ynn5zltrs4dpcwglg"), + "init": MustParseCid("bafk2bzacebkanlbkwwtniyz4fawevnkoyje67l5nflltmciplqiutekxzzfh4"), + "multisig": MustParseCid("bafk2bzacectxa2izvpaybmmpvearekrybxtglctwnexzzneyn6xrnrmectmpa"), + "paymentchannel": MustParseCid("bafk2bzacectov7vawkhsvq7aobyjq3oppamytq425wpkxejmq65vvcdm4bt2e"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzacebzyuwya26rjjxmtzcszf5hcv54b3l7bz6hbflbx3wmpycbqcq6fa"), - "storagemarket": MustParseCid("bafk2bzaceav2nt4ek457u3ngn7da2gaqblwdumpzhsohp4d7whmubvarkllac"), - "storageminer": MustParseCid("bafk2bzacecxr3rdjaive7opvfyqv3p7tft6ragdozlqd6hciprlknda7u5hk6"), - "storagepower": MustParseCid("bafk2bzaceabvb7af55pgm3xpcc7lqjaupw3dyyokbmhjvbo2ebelizalmugfq"), - "system": MustParseCid("bafk2bzacecp7sswldmz6cbl7lh6y5vtwnn43mvdkgcazcyjjcpjjbtydb2f3w"), - "verifiedregistry": MustParseCid("bafk2bzaced27273xjvuyhxlne2kmbrbtupcxxpdchqbkiyr3dcqoijaok2k7e"), + "reward": MustParseCid("bafk2bzacec3xpbrxw2rnpuve4mxfhny44lxbpbwmduy4ula4ohj2bp6wplpvc"), + "storagemarket": MustParseCid("bafk2bzacec5nexsejraoqraywka7zcacjoxgpdbopehdkhiwqwcyghtof4s3w"), + "storageminer": MustParseCid("bafk2bzacecw5xzj6z5b7qxx5xca5py4aoecmqj2pxb6nw673alufy22zckkyo"), + "storagepower": MustParseCid("bafk2bzaceckhnpxoaanjf474wxzkntlnzdofoy75ehyuydfjkuw4swhotws4y"), + "system": MustParseCid("bafk2bzaceairk5qz5hyzt4yyaxa356aszyifswiust5ilxizwxujcmtzvjzoa"), + "verifiedregistry": MustParseCid("bafk2bzaced2mkyqobpgna5jevosym3adv2bvraggigyz2jgn5cxymirxj4x3i"), }, }, { Network: "hyperspace", @@ -321,27 +321,27 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": MustParseCid("bafk2bzacecf3yodlyudzukumehbuabgqljyhjt5ifiv4vetcfohnvsxzynwga"), }, }, { - Network: "mainnet", - Version: 10, - - ManifestCid: MustParseCid("bafy2bzacecyg4biu2uccoekdzen4qxf4qt24deyx6j5rpwfys7qp6lixvzsxo"), + Network: "mainnet", + Version: 10, + BundleGitTag: "v10.0.0", + ManifestCid: MustParseCid("bafy2bzacecsuyf7mmvrhkx2evng5gnz5canlnz2fdlzu2lvcgptiq2pzuovos"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzacect72amqxedrtjymuq5lfrskk2itnniyfa5gdvqp5sjoeeb33oi2e"), - "cron": MustParseCid("bafk2bzaceb3nfsu5jbftadzxy24caz4tlgi6476yml25tfq2g7higtgnifys4"), - "datacap": MustParseCid("bafk2bzacec3s7oovwjxdx3hnhtqr75fsvhj7p4545gedt3kf2iuaw7zqhym2c"), - "eam": MustParseCid("bafk2bzacebw4ye6kvufarvrtqebs57idw6ydtzli7egd4h2t33jwoi547trra"), - "ethaccount": MustParseCid("bafk2bzaceavrimh4mcla6zi25uhs3ystix2n5rp4kfqeiewkh337zpjbo3egq"), - "evm": MustParseCid("bafk2bzacecnsk2ydh2q6wxf2fzsvivo6cfrka3jos62io2ds2xou4gl2byqvw"), - "init": MustParseCid("bafk2bzacebb3l4gw6hfszizw5zwho3pfpnmgrmxqm4ie42dgn62325lo4vwc2"), - "multisig": MustParseCid("bafk2bzacedi6ii3ewygygjukn4viros3uiztonnf6tg6b3ppqk4pdtqrwgeuw"), - "paymentchannel": MustParseCid("bafk2bzacebwqqfhodha2jl7tbws3dpy2dkngepbllqx6hy72zdokui3ow6eeq"), + "account": MustParseCid("bafk2bzaceampw4romta75hyz5p4cqriypmpbgnkxncgxgqn6zptv5lsp2w2bo"), + "cron": MustParseCid("bafk2bzacedcbtsifegiu432m5tysjzkxkmoczxscb6hqpmrr6img7xzdbbs2g"), + "datacap": MustParseCid("bafk2bzacealj5uk7wixhvk7l5tnredtelralwnceafqq34nb2lbylhtuyo64u"), + "eam": MustParseCid("bafk2bzacedrpm5gbleh4xkyo2jvs7p5g6f34soa6dpv7ashcdgy676snsum6g"), + "ethaccount": MustParseCid("bafk2bzaceaqoc5zakbhjxn3jljc4lxnthllzunhdor7sxhwgmskvc6drqc3fa"), + "evm": MustParseCid("bafk2bzaceahmzdxhqsm7cu2mexusjp6frm7r4kdesvti3etv5evfqboos2j4g"), + "init": MustParseCid("bafk2bzaced2f5rhir3hbpqbz5ght7ohv2kgj42g5ykxrypuo2opxsup3ykwl6"), + "multisig": MustParseCid("bafk2bzaceduf3hayh63jnl4z2knxv7cnrdenoubni22fxersc4octlwpxpmy4"), + "paymentchannel": MustParseCid("bafk2bzaceartlg4mrbwgzcwric6mtvyawpbgx2xclo2vj27nna57nxynf3pgc"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzacedbeexrv2d4kiridcvqgdatcwo2an4xsmg3ckdrptxu6c3y7mm6ji"), - "storagemarket": MustParseCid("bafk2bzacedalaigmokrtimabt7y7bkok5nd2j5gmifdahht3dsz5ulj7vxdgu"), - "storageminer": MustParseCid("bafk2bzacecpq5wjp3frz3b4cd2pozegi7sykgcawnaowjm6ddyai2epbphxvw"), - "storagepower": MustParseCid("bafk2bzacedfxlpyj5uxlh5uuhl55lazmhm7q6pr3qoywxb25qrytbptpy7zb6"), - "system": MustParseCid("bafk2bzacecbscw26oyfgdse6y6ij5fqtaq5uo2ehfom26mle4rk4ann2xf2jq"), - "verifiedregistry": MustParseCid("bafk2bzaceanpda37bvefmzfemikyokwnspzxdxqz5kriaqex4hpevdhphu6sq"), + "reward": MustParseCid("bafk2bzacebnhtaejfjtzymyfmbdrfmo7vgj3zsof6zlucbmkhrvcuotw5dxpq"), + "storagemarket": MustParseCid("bafk2bzaceclejwjtpu2dhw3qbx6ow7b4pmhwa7ocrbbiqwp36sq5yeg6jz2bc"), + "storageminer": MustParseCid("bafk2bzaced4h7noksockro7glnssz2jnmo2rpzd7dvnmfs4p24zx3h6gtx47s"), + "storagepower": MustParseCid("bafk2bzacec4ay4crzo73ypmh7o3fjendhbqrxake46bprabw67fvwjz5q6ixq"), + "system": MustParseCid("bafk2bzacedakk5nofebyup4m7nvx6djksfwhnxzrfuq4oyemhpl4lllaikr64"), + "verifiedregistry": MustParseCid("bafk2bzacedfel6edzqpe5oujno7fog4i526go4dtcs6vwrdtbpy2xq6htvcg6"), }, }, { Network: "testing", @@ -381,27 +381,27 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": MustParseCid("bafk2bzaceatmqip2o3ausbntvdhj7yemu6hb3b5yqv6hm42gylbbmz7geocpm"), }, }, { - Network: "testing", - Version: 10, - - ManifestCid: MustParseCid("bafy2bzacedjgfy7dmbd4i3io5r47eokprndhucdvwaxqyw4ijhhtldhewojk4"), + Network: "testing", + Version: 10, + BundleGitTag: "v10.0.0", + ManifestCid: MustParseCid("bafy2bzacebsp3bkxwsijenqeimhvhtg52d6o76hn6qhzxveqfq7d5hdd5l2ee"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzacedhme5nkedu2x3vwwfakrs4zwqrbdcb7epevety7peisq4bcahyke"), - "cron": MustParseCid("bafk2bzaced5ky3x7w6naz45tsx4omkfztyy4flmr72hfr725ksrxdhvzuulwm"), - "datacap": MustParseCid("bafk2bzacedlhpgrdwzyfhcywoud5n5gwx2arwmyqvg7yogmrpt7h5gfmotjpc"), - "eam": MustParseCid("bafk2bzaceb754ghlrlmiqref2snlqsgvmpmg3tsjokok6eshh4pt4guv64zg4"), - "ethaccount": MustParseCid("bafk2bzaceaa5vdnlqdbf5tamzxvmuva3e5zfvy5vycw4gem2b6hmintnx6ye4"), - "evm": MustParseCid("bafk2bzaceaq5fequmt5jeuixw3qn6exx4atcpveugvblpz5oacy2xnypz2mww"), - "init": MustParseCid("bafk2bzaced275afmy4htdxsgff557owyteyl32vrntbdeemzqf3qkw22n6n4u"), - "multisig": MustParseCid("bafk2bzacebiao7jb3c7svwcphkdvixj6z3genj5ufwtattmp3cmelhqinq4na"), - "paymentchannel": MustParseCid("bafk2bzacecjuud657ydp5fwlbeiqzknzkqcrqh4d5huunmtubhas55fsj3n4k"), + "account": MustParseCid("bafk2bzaceazxb6p2xg6caivmie6k2bvutyesngwyvhwv4eemwu7ia4vnqkcuy"), + "cron": MustParseCid("bafk2bzaceax6ym73boyl5zdpbcr6zmbajzylmcdvlapz5zcqgzcshakz44jbq"), + "datacap": MustParseCid("bafk2bzacea63x3v6lvtb4ast5uq3nhrpokvylymvezyr5xyjl6vtlfwkuw6qo"), + "eam": MustParseCid("bafk2bzacebhualcn7fofyqr6lhrel32ud23hcwzeenfqu3rrn5nmt6gugqgo6"), + "ethaccount": MustParseCid("bafk2bzacecgft7e3v4kbpb3tlt5s6hng74ptu3ggcdi4wmt5p4vr6qkmkw2zc"), + "evm": MustParseCid("bafk2bzaceaoqvbqetgicqpvwvcnpjx5aa74kwlhq3u7mwv4yseszxkimwz5pk"), + "init": MustParseCid("bafk2bzaceapmoyg2qppzle24t25ncyycn2uwhnw6crqkqlokkbc7w4mn74wko"), + "multisig": MustParseCid("bafk2bzacecn3dlepgaps3h6iwlq65dx6zyrbfi4pmgdqxphb5idubb6ibflwe"), + "paymentchannel": MustParseCid("bafk2bzaceaanxurr2k3ueolwcnminmdfp3tyxtntqg5fou37smeulb5dxqjzk"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzaceae7eic2i2cmpxmkssezmutfc635tyzxxsmnu6ctnvkd33akrpipq"), - "storagemarket": MustParseCid("bafk2bzaceaj36pbc7sxzdelygq4ew3n2w3l5y442ogvznw3mw54fxafavjcru"), - "storageminer": MustParseCid("bafk2bzacednqbtebg7xxsr2sle42pfxmz5chxn32bsjssgc3mzt7iw2eevaly"), - "storagepower": MustParseCid("bafk2bzacebovido4zxtywaz32ejagvtk4v7z5w5nwxrflaldsf56xd7pecu4w"), - "system": MustParseCid("bafk2bzacecxbbatjxkfjm5f27esjghqe2o5ajmcalp4rbqq5vtxdmpq4ylmb2"), - "verifiedregistry": MustParseCid("bafk2bzacecwzauoon6sngmiiv4ppoxshirgzyfssfircvampxjkv673vlim6m"), + "reward": MustParseCid("bafk2bzacedujdvwk4omjexdnmh2qrkqbw27v4c2g3krajhtzyfzart36bimum"), + "storagemarket": MustParseCid("bafk2bzacecdbjjxvdtltobiu7thwyyr2puunoz3q4vyfnhhxl2sbp4ovwq37s"), + "storageminer": MustParseCid("bafk2bzacebo5q7jrf4qjrhtotwt5ouzlygvml4bzofs2egdnbxyfmuo7tro6c"), + "storagepower": MustParseCid("bafk2bzacebt2ipqnorxbzncwjadkulip6blzksmwd4mmyrfjsmjyf55itra2k"), + "system": MustParseCid("bafk2bzacecf2jimdz7knhngs64ximfz3eaud6s3kiunmkybgrkupdjyo2dw7o"), + "verifiedregistry": MustParseCid("bafk2bzacecdmek2htsgcyoyl35glakyab66cojqo2y335njnm7krleb6yfbps"), }, }, { Network: "testing-fake-proofs", @@ -441,26 +441,26 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": MustParseCid("bafk2bzaceatmqip2o3ausbntvdhj7yemu6hb3b5yqv6hm42gylbbmz7geocpm"), }, }, { - Network: "testing-fake-proofs", - Version: 10, - - ManifestCid: MustParseCid("bafy2bzaceblvi7d3yosakpuux27gqzr34gcjr6a2f6uzbyagmwybgfsk4xeu2"), + Network: "testing-fake-proofs", + Version: 10, + BundleGitTag: "v10.0.0", + ManifestCid: MustParseCid("bafy2bzacedwap2uuii4luljckrnb4vkur2unb6fyinn7xjie6xlva2wmlygj2"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzacedhme5nkedu2x3vwwfakrs4zwqrbdcb7epevety7peisq4bcahyke"), - "cron": MustParseCid("bafk2bzaced5ky3x7w6naz45tsx4omkfztyy4flmr72hfr725ksrxdhvzuulwm"), - "datacap": MustParseCid("bafk2bzacedlhpgrdwzyfhcywoud5n5gwx2arwmyqvg7yogmrpt7h5gfmotjpc"), - "eam": MustParseCid("bafk2bzaceb754ghlrlmiqref2snlqsgvmpmg3tsjokok6eshh4pt4guv64zg4"), - "ethaccount": MustParseCid("bafk2bzaceaa5vdnlqdbf5tamzxvmuva3e5zfvy5vycw4gem2b6hmintnx6ye4"), - "evm": MustParseCid("bafk2bzaceaq5fequmt5jeuixw3qn6exx4atcpveugvblpz5oacy2xnypz2mww"), - "init": MustParseCid("bafk2bzaced275afmy4htdxsgff557owyteyl32vrntbdeemzqf3qkw22n6n4u"), - "multisig": MustParseCid("bafk2bzacebiao7jb3c7svwcphkdvixj6z3genj5ufwtattmp3cmelhqinq4na"), - "paymentchannel": MustParseCid("bafk2bzacecjuud657ydp5fwlbeiqzknzkqcrqh4d5huunmtubhas55fsj3n4k"), + "account": MustParseCid("bafk2bzaceazxb6p2xg6caivmie6k2bvutyesngwyvhwv4eemwu7ia4vnqkcuy"), + "cron": MustParseCid("bafk2bzaceax6ym73boyl5zdpbcr6zmbajzylmcdvlapz5zcqgzcshakz44jbq"), + "datacap": MustParseCid("bafk2bzacea63x3v6lvtb4ast5uq3nhrpokvylymvezyr5xyjl6vtlfwkuw6qo"), + "eam": MustParseCid("bafk2bzacebhualcn7fofyqr6lhrel32ud23hcwzeenfqu3rrn5nmt6gugqgo6"), + "ethaccount": MustParseCid("bafk2bzacecgft7e3v4kbpb3tlt5s6hng74ptu3ggcdi4wmt5p4vr6qkmkw2zc"), + "evm": MustParseCid("bafk2bzaceaoqvbqetgicqpvwvcnpjx5aa74kwlhq3u7mwv4yseszxkimwz5pk"), + "init": MustParseCid("bafk2bzaceapmoyg2qppzle24t25ncyycn2uwhnw6crqkqlokkbc7w4mn74wko"), + "multisig": MustParseCid("bafk2bzacecn3dlepgaps3h6iwlq65dx6zyrbfi4pmgdqxphb5idubb6ibflwe"), + "paymentchannel": MustParseCid("bafk2bzaceaanxurr2k3ueolwcnminmdfp3tyxtntqg5fou37smeulb5dxqjzk"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzaceae7eic2i2cmpxmkssezmutfc635tyzxxsmnu6ctnvkd33akrpipq"), - "storagemarket": MustParseCid("bafk2bzaceaj36pbc7sxzdelygq4ew3n2w3l5y442ogvznw3mw54fxafavjcru"), - "storageminer": MustParseCid("bafk2bzaceaoaduzssj46mse6gizcy764ingsgvuavafkowf4vexluindct3ji"), - "storagepower": MustParseCid("bafk2bzacedqvicpfdcegfsj6p4rb3judx7v5v6trpnca7djbim4pts5appis4"), - "system": MustParseCid("bafk2bzacecxbbatjxkfjm5f27esjghqe2o5ajmcalp4rbqq5vtxdmpq4ylmb2"), - "verifiedregistry": MustParseCid("bafk2bzacecwzauoon6sngmiiv4ppoxshirgzyfssfircvampxjkv673vlim6m"), + "reward": MustParseCid("bafk2bzacedujdvwk4omjexdnmh2qrkqbw27v4c2g3krajhtzyfzart36bimum"), + "storagemarket": MustParseCid("bafk2bzacecdbjjxvdtltobiu7thwyyr2puunoz3q4vyfnhhxl2sbp4ovwq37s"), + "storageminer": MustParseCid("bafk2bzacedc5klueery4fn2voso4u76rgo54uctsculesdbxxbeh6rgp2q4te"), + "storagepower": MustParseCid("bafk2bzacecuz2h2renlfio4xkyrvvro7nwidf7utpjy3oizk2xuszoz3gmea6"), + "system": MustParseCid("bafk2bzacecf2jimdz7knhngs64ximfz3eaud6s3kiunmkybgrkupdjyo2dw7o"), + "verifiedregistry": MustParseCid("bafk2bzacecdmek2htsgcyoyl35glakyab66cojqo2y335njnm7krleb6yfbps"), }, }} diff --git a/build/drand.go b/build/drand.go index 3027d930b5..3b976ac925 100644 --- a/build/drand.go +++ b/build/drand.go @@ -69,10 +69,6 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{ ChainInfoJSON: `{"public_key":"8cda589f88914aa728fd183f383980b35789ce81b274e5daee1f338b77d02566ef4d3fb0098af1f844f10f9c803c1827","period":25,"genesis_time":1595348225,"hash":"e73b7dc3c4f6a236378220c0dd6aa110eb16eed26c11259606e07ee122838d4f","groupHash":"567d4785122a5a3e75a9bc9911d7ea807dd85ff76b78dc4ff06b075712898607"}`, }, DrandIncentinet: { - Servers: []string{ - "https://dev1.drand.sh", - "https://dev2.drand.sh", - }, ChainInfoJSON: `{"public_key":"8cad0c72c606ab27d36ee06de1d5b2db1faf92e447025ca37575ab3a8aac2eaae83192f846fc9e158bc738423753d000","period":30,"genesis_time":1595873820,"hash":"80c8b872c714f4c00fdd3daa465d5514049f457f01f85a4caf68cdcd394ba039","groupHash":"d9406aaed487f7af71851b4399448e311f2328923d454e971536c05398ce2d9b"}`, }, } diff --git a/build/genesis/butterflynet.car b/build/genesis/butterflynet.car index cb0c4162b4..589e5ab757 100644 Binary files a/build/genesis/butterflynet.car and b/build/genesis/butterflynet.car differ diff --git a/build/genesis/spacenet.car b/build/genesis/spacenet.car index d380539606..4b62680cc5 100644 Binary files a/build/genesis/spacenet.car and b/build/genesis/spacenet.car differ diff --git a/build/openrpc/full.json.gz b/build/openrpc/full.json.gz index dabf3602cd..9dbd634683 100644 Binary files a/build/openrpc/full.json.gz and b/build/openrpc/full.json.gz differ diff --git a/build/openrpc/gateway.json.gz b/build/openrpc/gateway.json.gz index 01ae7aaff7..726f4741b9 100644 Binary files a/build/openrpc/gateway.json.gz and b/build/openrpc/gateway.json.gz differ diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz index 046dd2e9d3..37f7ae5f43 100644 Binary files a/build/openrpc/miner.json.gz and b/build/openrpc/miner.json.gz differ diff --git a/build/openrpc/worker.json.gz b/build/openrpc/worker.json.gz index f494eb719a..0a32579967 100644 Binary files a/build/openrpc/worker.json.gz and b/build/openrpc/worker.json.gz differ diff --git a/build/params_2k.go b/build/params_2k.go index 67cfe9327e..962b2f9ba4 100644 --- a/build/params_2k.go +++ b/build/params_2k.go @@ -59,7 +59,7 @@ var UpgradeSkyrHeight = abi.ChainEpoch(-19) var UpgradeSharkHeight = abi.ChainEpoch(-20) -var UpgradeHyggeHeight = abi.ChainEpoch(-21) +var UpgradeHyggeHeight = abi.ChainEpoch(30) var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ 0: DrandMainnet, diff --git a/build/params_calibnet.go b/build/params_calibnet.go index 0661bb8392..32923f7a86 100644 --- a/build/params_calibnet.go +++ b/build/params_calibnet.go @@ -4,7 +4,6 @@ package build import ( - "math" "os" "strconv" @@ -71,7 +70,8 @@ const UpgradeSkyrHeight = 510 const UpgradeSharkHeight = 16800 // 6 days after genesis -const UpgradeHyggeHeight = math.MaxInt64 +// 2023-02-21T16:30:00Z +const UpgradeHyggeHeight = 322354 var SupportedProofTypes = []abi.RegisteredSealProof{ abi.RegisteredSealProof_StackedDrg32GiBV1, diff --git a/build/params_mainnet.go b/build/params_mainnet.go index b1de360006..b76ff6e789 100644 --- a/build/params_mainnet.go +++ b/build/params_mainnet.go @@ -86,8 +86,8 @@ const UpgradeSkyrHeight = 1960320 // 2022-11-30T14:00:00Z const UpgradeSharkHeight = 2383680 -// ?????????????? -var UpgradeHyggeHeight = abi.ChainEpoch(math.MaxInt64) +// 2023-03-14T15:14:00Z +var UpgradeHyggeHeight = abi.ChainEpoch(2683348) var SupportedProofTypes = []abi.RegisteredSealProof{ abi.RegisteredSealProof_StackedDrg32GiBV1, diff --git a/build/version.go b/build/version.go index 915f867cd3..1220484163 100644 --- a/build/version.go +++ b/build/version.go @@ -40,7 +40,7 @@ func BuildTypeString() string { } // BuildVersion is the local build version -const BuildVersion = "1.19.1-dev" +const BuildVersion = "1.21.0-rc2" func UserVersion() string { if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" { diff --git a/chain/actors/agen/main.go b/chain/actors/agen/main.go index b9f3a22a43..811ea27e98 100644 --- a/chain/actors/agen/main.go +++ b/chain/actors/agen/main.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "go/format" - "io/ioutil" "os" "path/filepath" "strconv" @@ -66,7 +65,7 @@ func generateAdapters() error { } { - af, err := ioutil.ReadFile(filepath.Join(actDir, "actor.go.template")) + af, err := os.ReadFile(filepath.Join(actDir, "actor.go.template")) if err != nil { return xerrors.Errorf("loading actor template: %w", err) } @@ -90,7 +89,7 @@ func generateAdapters() error { return err } - if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("%s.go", act)), fmted, 0666); err != nil { + if err := os.WriteFile(filepath.Join(actDir, fmt.Sprintf("%s.go", act)), fmted, 0666); err != nil { return err } } @@ -100,7 +99,7 @@ func generateAdapters() error { } func generateState(actDir string, versions []int) error { - af, err := ioutil.ReadFile(filepath.Join(actDir, "state.go.template")) + af, err := os.ReadFile(filepath.Join(actDir, "state.go.template")) if err != nil { if os.IsNotExist(err) { return nil // skip @@ -123,7 +122,7 @@ func generateState(actDir string, versions []int) error { return err } - if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("v%d.go", version)), b.Bytes(), 0666); err != nil { + if err := os.WriteFile(filepath.Join(actDir, fmt.Sprintf("v%d.go", version)), b.Bytes(), 0666); err != nil { return err } } @@ -132,7 +131,7 @@ func generateState(actDir string, versions []int) error { } func generateMessages(actDir string) error { - af, err := ioutil.ReadFile(filepath.Join(actDir, "message.go.template")) + af, err := os.ReadFile(filepath.Join(actDir, "message.go.template")) if err != nil { if os.IsNotExist(err) { return nil // skip @@ -155,7 +154,7 @@ func generateMessages(actDir string) error { return err } - if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("message%d.go", version)), b.Bytes(), 0666); err != nil { + if err := os.WriteFile(filepath.Join(actDir, fmt.Sprintf("message%d.go", version)), b.Bytes(), 0666); err != nil { return err } } @@ -165,7 +164,7 @@ func generateMessages(actDir string) error { func generatePolicy(policyPath string) error { - pf, err := ioutil.ReadFile(policyPath + ".template") + pf, err := os.ReadFile(policyPath + ".template") if err != nil { if os.IsNotExist(err) { return nil // skip @@ -187,7 +186,7 @@ func generatePolicy(policyPath string) error { return err } - if err := ioutil.WriteFile(policyPath, b.Bytes(), 0666); err != nil { + if err := os.WriteFile(policyPath, b.Bytes(), 0666); err != nil { return err } @@ -196,7 +195,7 @@ func generatePolicy(policyPath string) error { func generateBuiltin(builtinPath string) error { - bf, err := ioutil.ReadFile(builtinPath + ".template") + bf, err := os.ReadFile(builtinPath + ".template") if err != nil { if os.IsNotExist(err) { return nil // skip @@ -218,7 +217,7 @@ func generateBuiltin(builtinPath string) error { return err } - if err := ioutil.WriteFile(builtinPath, b.Bytes(), 0666); err != nil { + if err := os.WriteFile(builtinPath, b.Bytes(), 0666); err != nil { return err } @@ -227,7 +226,7 @@ func generateBuiltin(builtinPath string) error { func generateRegistry(registryPath string) error { - bf, err := ioutil.ReadFile(registryPath + ".template") + bf, err := os.ReadFile(registryPath + ".template") if err != nil { if os.IsNotExist(err) { return nil // skip @@ -248,7 +247,7 @@ func generateRegistry(registryPath string) error { return err } - if err := ioutil.WriteFile(registryPath, b.Bytes(), 0666); err != nil { + if err := os.WriteFile(registryPath, b.Bytes(), 0666); err != nil { return err } diff --git a/chain/actors/builtin/account/account.go b/chain/actors/builtin/account/account.go index 3198a5ae52..4542ad7670 100644 --- a/chain/actors/builtin/account/account.go +++ b/chain/actors/builtin/account/account.go @@ -1,33 +1,25 @@ package account import ( - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/lotus/chain/actors" "github.com/ipfs/go-cid" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" + builtin10 "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/cbor" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/types" - builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - builtin10 "github.com/filecoin-project/go-state-types/builtin" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/types" ) var Methods = builtin10.MethodsAccount diff --git a/chain/actors/builtin/account/v0.go b/chain/actors/builtin/account/v0.go index cc01773070..a41ee3879e 100644 --- a/chain/actors/builtin/account/v0.go +++ b/chain/actors/builtin/account/v0.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + account0 "github.com/filecoin-project/specs-actors/actors/builtin/account" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account0 "github.com/filecoin-project/specs-actors/actors/builtin/account" ) var _ State = (*state0)(nil) diff --git a/chain/actors/builtin/account/v10.go b/chain/actors/builtin/account/v10.go index 3e455ea112..ff87c42122 100644 --- a/chain/actors/builtin/account/v10.go +++ b/chain/actors/builtin/account/v10.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" + account10 "github.com/filecoin-project/go-state-types/builtin/v10/account" "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account10 "github.com/filecoin-project/go-state-types/builtin/v10/account" ) var _ State = (*state10)(nil) diff --git a/chain/actors/builtin/account/v2.go b/chain/actors/builtin/account/v2.go index 4b3ebaa55c..db0af77e2a 100644 --- a/chain/actors/builtin/account/v2.go +++ b/chain/actors/builtin/account/v2.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + account2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/account" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/account" ) var _ State = (*state2)(nil) diff --git a/chain/actors/builtin/account/v3.go b/chain/actors/builtin/account/v3.go index e6a549b1bf..9e6c71ad0f 100644 --- a/chain/actors/builtin/account/v3.go +++ b/chain/actors/builtin/account/v3.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + account3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/account" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/account" ) var _ State = (*state3)(nil) diff --git a/chain/actors/builtin/account/v4.go b/chain/actors/builtin/account/v4.go index e2a5e77ad4..907896312e 100644 --- a/chain/actors/builtin/account/v4.go +++ b/chain/actors/builtin/account/v4.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + account4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/account" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/account" ) var _ State = (*state4)(nil) diff --git a/chain/actors/builtin/account/v5.go b/chain/actors/builtin/account/v5.go index a8437e3622..8514ab325e 100644 --- a/chain/actors/builtin/account/v5.go +++ b/chain/actors/builtin/account/v5.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + account5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/account" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/account" ) var _ State = (*state5)(nil) diff --git a/chain/actors/builtin/account/v6.go b/chain/actors/builtin/account/v6.go index ae362c28f3..16369f38c2 100644 --- a/chain/actors/builtin/account/v6.go +++ b/chain/actors/builtin/account/v6.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + account6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/account" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/account" ) var _ State = (*state6)(nil) diff --git a/chain/actors/builtin/account/v7.go b/chain/actors/builtin/account/v7.go index 9ca3be4d2a..cd420da92a 100644 --- a/chain/actors/builtin/account/v7.go +++ b/chain/actors/builtin/account/v7.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + account7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/account" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/account" ) var _ State = (*state7)(nil) diff --git a/chain/actors/builtin/account/v8.go b/chain/actors/builtin/account/v8.go index 26b80397d4..13b478de89 100644 --- a/chain/actors/builtin/account/v8.go +++ b/chain/actors/builtin/account/v8.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" + account8 "github.com/filecoin-project/go-state-types/builtin/v8/account" "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account8 "github.com/filecoin-project/go-state-types/builtin/v8/account" ) var _ State = (*state8)(nil) diff --git a/chain/actors/builtin/account/v9.go b/chain/actors/builtin/account/v9.go index 36971360e7..fc1fc4d14b 100644 --- a/chain/actors/builtin/account/v9.go +++ b/chain/actors/builtin/account/v9.go @@ -2,16 +2,16 @@ package account import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + actorstypes "github.com/filecoin-project/go-state-types/actors" + account9 "github.com/filecoin-project/go-state-types/builtin/v9/account" "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - account9 "github.com/filecoin-project/go-state-types/builtin/v9/account" ) var _ State = (*state9)(nil) diff --git a/chain/actors/builtin/builtin.go b/chain/actors/builtin/builtin.go index 509d596a04..414a11e72e 100644 --- a/chain/actors/builtin/builtin.go +++ b/chain/actors/builtin/builtin.go @@ -3,32 +3,24 @@ package builtin import ( "fmt" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/builtin" + smoothingtypes "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing" + minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner" + "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/go-state-types/proof" builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/builtin" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/go-state-types/proof" - "github.com/filecoin-project/lotus/chain/actors" - - smoothingtypes "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing" - minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner" ) var SystemActorAddr = builtin.SystemActorAddr diff --git a/chain/actors/builtin/cron/cron.go b/chain/actors/builtin/cron/cron.go index 10d72028e5..43b8c0eaa2 100644 --- a/chain/actors/builtin/cron/cron.go +++ b/chain/actors/builtin/cron/cron.go @@ -1,29 +1,23 @@ package cron import ( - actorstypes "github.com/filecoin-project/go-state-types/actors" - "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/types" "github.com/ipfs/go-cid" "golang.org/x/xerrors" + actorstypes "github.com/filecoin-project/go-state-types/actors" + builtin10 "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" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - builtin10 "github.com/filecoin-project/go-state-types/builtin" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/types" ) func Load(store adt.Store, act *types.Actor) (State, error) { diff --git a/chain/actors/builtin/cron/v0.go b/chain/actors/builtin/cron/v0.go index 89da7875f7..6dce524f64 100644 --- a/chain/actors/builtin/cron/v0.go +++ b/chain/actors/builtin/cron/v0.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + cron0 "github.com/filecoin-project/specs-actors/actors/builtin/cron" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron0 "github.com/filecoin-project/specs-actors/actors/builtin/cron" ) var _ State = (*state0)(nil) diff --git a/chain/actors/builtin/cron/v10.go b/chain/actors/builtin/cron/v10.go index 413c856755..2d20e2401c 100644 --- a/chain/actors/builtin/cron/v10.go +++ b/chain/actors/builtin/cron/v10.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" + cron10 "github.com/filecoin-project/go-state-types/builtin/v10/cron" "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron10 "github.com/filecoin-project/go-state-types/builtin/v10/cron" ) var _ State = (*state10)(nil) diff --git a/chain/actors/builtin/cron/v2.go b/chain/actors/builtin/cron/v2.go index c295a0d181..97b3ffbe08 100644 --- a/chain/actors/builtin/cron/v2.go +++ b/chain/actors/builtin/cron/v2.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + cron2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/cron" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/cron" ) var _ State = (*state2)(nil) diff --git a/chain/actors/builtin/cron/v3.go b/chain/actors/builtin/cron/v3.go index d8eb09bf02..4c0d4f1d93 100644 --- a/chain/actors/builtin/cron/v3.go +++ b/chain/actors/builtin/cron/v3.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + cron3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/cron" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/cron" ) var _ State = (*state3)(nil) diff --git a/chain/actors/builtin/cron/v4.go b/chain/actors/builtin/cron/v4.go index c56cf19871..a222f0d93d 100644 --- a/chain/actors/builtin/cron/v4.go +++ b/chain/actors/builtin/cron/v4.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + cron4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/cron" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/cron" ) var _ State = (*state4)(nil) diff --git a/chain/actors/builtin/cron/v5.go b/chain/actors/builtin/cron/v5.go index 813420858e..2487cbbc68 100644 --- a/chain/actors/builtin/cron/v5.go +++ b/chain/actors/builtin/cron/v5.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + cron5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/cron" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/cron" ) var _ State = (*state5)(nil) diff --git a/chain/actors/builtin/cron/v6.go b/chain/actors/builtin/cron/v6.go index d6a9412ac1..673e7588a9 100644 --- a/chain/actors/builtin/cron/v6.go +++ b/chain/actors/builtin/cron/v6.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + cron6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/cron" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/cron" ) var _ State = (*state6)(nil) diff --git a/chain/actors/builtin/cron/v7.go b/chain/actors/builtin/cron/v7.go index 4808c1c193..cd71bd4183 100644 --- a/chain/actors/builtin/cron/v7.go +++ b/chain/actors/builtin/cron/v7.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" + cron7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/cron" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/cron" ) var _ State = (*state7)(nil) diff --git a/chain/actors/builtin/cron/v8.go b/chain/actors/builtin/cron/v8.go index 57895b2031..904de5496a 100644 --- a/chain/actors/builtin/cron/v8.go +++ b/chain/actors/builtin/cron/v8.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" + cron8 "github.com/filecoin-project/go-state-types/builtin/v8/cron" "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron8 "github.com/filecoin-project/go-state-types/builtin/v8/cron" ) var _ State = (*state8)(nil) diff --git a/chain/actors/builtin/cron/v9.go b/chain/actors/builtin/cron/v9.go index bae20fd534..201348b6cd 100644 --- a/chain/actors/builtin/cron/v9.go +++ b/chain/actors/builtin/cron/v9.go @@ -2,14 +2,15 @@ package cron import ( "fmt" + "github.com/ipfs/go-cid" actorstypes "github.com/filecoin-project/go-state-types/actors" + cron9 "github.com/filecoin-project/go-state-types/builtin/v9/cron" "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - cron9 "github.com/filecoin-project/go-state-types/builtin/v9/cron" ) var _ State = (*state9)(nil) diff --git a/chain/actors/builtin/datacap/datacap.go b/chain/actors/builtin/datacap/datacap.go index b8d01b68cb..c12c772309 100644 --- a/chain/actors/builtin/datacap/datacap.go +++ b/chain/actors/builtin/datacap/datacap.go @@ -1,17 +1,16 @@ package datacap import ( - "golang.org/x/xerrors" - "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" builtin10 "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/cbor" - "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/types" diff --git a/chain/actors/builtin/datacap/v10.go b/chain/actors/builtin/datacap/v10.go index 224e4cb69a..25eec4ea81 100644 --- a/chain/actors/builtin/datacap/v10.go +++ b/chain/actors/builtin/datacap/v10.go @@ -2,17 +2,18 @@ package datacap import ( "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" + "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/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - datacap10 "github.com/filecoin-project/go-state-types/builtin/v10/datacap" adt10 "github.com/filecoin-project/go-state-types/builtin/v10/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 = (*state10)(nil) diff --git a/chain/actors/builtin/datacap/v9.go b/chain/actors/builtin/datacap/v9.go index ef30481049..1d239fb95b 100644 --- a/chain/actors/builtin/datacap/v9.go +++ b/chain/actors/builtin/datacap/v9.go @@ -2,17 +2,18 @@ package datacap import ( "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" + "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/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - datacap9 "github.com/filecoin-project/go-state-types/builtin/v9/datacap" adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" "github.com/filecoin-project/go-state-types/manifest" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state9)(nil) diff --git a/chain/actors/builtin/evm/actor.go.template b/chain/actors/builtin/evm/actor.go.template index aa23b5f11a..62da068679 100644 --- a/chain/actors/builtin/evm/actor.go.template +++ b/chain/actors/builtin/evm/actor.go.template @@ -48,6 +48,7 @@ type State interface { cbor.Marshaler Nonce() (uint64, error) + IsAlive() (bool, error) GetState() interface{} GetBytecode() ([]byte, error) diff --git a/chain/actors/builtin/evm/evm.go b/chain/actors/builtin/evm/evm.go index 8657b3c76a..f214cdc13d 100644 --- a/chain/actors/builtin/evm/evm.go +++ b/chain/actors/builtin/evm/evm.go @@ -5,14 +5,13 @@ import ( "golang.org/x/xerrors" actorstypes "github.com/filecoin-project/go-state-types/actors" + builtin10 "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/cbor" - "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/types" - - builtin10 "github.com/filecoin-project/go-state-types/builtin" ) var Methods = builtin10.MethodsEVM @@ -49,6 +48,7 @@ type State interface { cbor.Marshaler Nonce() (uint64, error) + IsAlive() (bool, error) GetState() interface{} GetBytecode() ([]byte, error) diff --git a/chain/actors/builtin/evm/state.go.template b/chain/actors/builtin/evm/state.go.template index eb55a84635..f193733d15 100644 --- a/chain/actors/builtin/evm/state.go.template +++ b/chain/actors/builtin/evm/state.go.template @@ -4,6 +4,8 @@ import ( "github.com/ipfs/go-cid" "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/go-state-types/abi" evm{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}evm" ) @@ -40,6 +42,10 @@ func (s *state{{.v}}) Nonce() (uint64, error) { return s.State.Nonce, nil } +func (s *state{{.v}}) IsAlive() (bool, error) { + return s.State.Tombstone == nil, nil +} + func (s *state{{.v}}) GetState() interface{} { return &s.State } diff --git a/chain/actors/builtin/evm/v10.go b/chain/actors/builtin/evm/v10.go index b2272c2100..d467aa187d 100644 --- a/chain/actors/builtin/evm/v10.go +++ b/chain/actors/builtin/evm/v10.go @@ -3,9 +3,10 @@ package evm import ( "github.com/ipfs/go-cid" - "github.com/filecoin-project/lotus/chain/actors/adt" - + "github.com/filecoin-project/go-state-types/abi" evm10 "github.com/filecoin-project/go-state-types/builtin/v10/evm" + + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state10)(nil) @@ -40,6 +41,10 @@ func (s *state10) Nonce() (uint64, error) { return s.State.Nonce, nil } +func (s *state10) IsAlive() (bool, error) { + return s.State.Tombstone == nil, nil +} + func (s *state10) GetState() interface{} { return &s.State } diff --git a/chain/actors/builtin/init/init.go b/chain/actors/builtin/init/init.go index 804cce9db2..c38629d2d5 100644 --- a/chain/actors/builtin/init/init.go +++ b/chain/actors/builtin/init/init.go @@ -1,35 +1,27 @@ package init import ( - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/lotus/chain/actors" + "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" + builtin10 "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/cbor" - "github.com/ipfs/go-cid" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/node/modules/dtypes" - builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - builtin10 "github.com/filecoin-project/go-state-types/builtin" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/node/modules/dtypes" ) var ( diff --git a/chain/actors/builtin/init/v0.go b/chain/actors/builtin/init/v0.go index 0e4eaa524e..7e48dda9e1 100644 --- a/chain/actors/builtin/init/v0.go +++ b/chain/actors/builtin/init/v0.go @@ -4,20 +4,20 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" + init0 "github.com/filecoin-project/specs-actors/actors/builtin/init" + adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/node/modules/dtypes" - - init0 "github.com/filecoin-project/specs-actors/actors/builtin/init" - adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" ) var _ State = (*state0)(nil) diff --git a/chain/actors/builtin/init/v10.go b/chain/actors/builtin/init/v10.go index 2d0bc763e1..dd8c778dd4 100644 --- a/chain/actors/builtin/init/v10.go +++ b/chain/actors/builtin/init/v10.go @@ -4,21 +4,21 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" + builtin10 "github.com/filecoin-project/go-state-types/builtin" + init10 "github.com/filecoin-project/go-state-types/builtin/v10/init" + adt10 "github.com/filecoin-project/go-state-types/builtin/v10/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" - - builtin10 "github.com/filecoin-project/go-state-types/builtin" - init10 "github.com/filecoin-project/go-state-types/builtin/v10/init" - adt10 "github.com/filecoin-project/go-state-types/builtin/v10/util/adt" ) var _ State = (*state10)(nil) diff --git a/chain/actors/builtin/init/v2.go b/chain/actors/builtin/init/v2.go index 3520f83bc8..c107bd52d5 100644 --- a/chain/actors/builtin/init/v2.go +++ b/chain/actors/builtin/init/v2.go @@ -4,20 +4,20 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" + init2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/init" + adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/node/modules/dtypes" - - init2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/init" - adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" ) var _ State = (*state2)(nil) diff --git a/chain/actors/builtin/init/v3.go b/chain/actors/builtin/init/v3.go index 88f6f1014a..0be11f9761 100644 --- a/chain/actors/builtin/init/v3.go +++ b/chain/actors/builtin/init/v3.go @@ -4,22 +4,21 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - init3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/init" adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt" + + "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 = (*state3)(nil) diff --git a/chain/actors/builtin/init/v4.go b/chain/actors/builtin/init/v4.go index 46e22db2ef..5ca6bc1c81 100644 --- a/chain/actors/builtin/init/v4.go +++ b/chain/actors/builtin/init/v4.go @@ -4,22 +4,21 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - init4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/init" adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt" + + "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 = (*state4)(nil) diff --git a/chain/actors/builtin/init/v5.go b/chain/actors/builtin/init/v5.go index faabd57339..f6450789d7 100644 --- a/chain/actors/builtin/init/v5.go +++ b/chain/actors/builtin/init/v5.go @@ -4,22 +4,21 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - init5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/init" adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt" + + "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 = (*state5)(nil) diff --git a/chain/actors/builtin/init/v6.go b/chain/actors/builtin/init/v6.go index 1950dc7751..4d2267aa1d 100644 --- a/chain/actors/builtin/init/v6.go +++ b/chain/actors/builtin/init/v6.go @@ -4,22 +4,21 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - init6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/init" adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt" + + "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 = (*state6)(nil) diff --git a/chain/actors/builtin/init/v7.go b/chain/actors/builtin/init/v7.go index 451cb535fc..052faf9850 100644 --- a/chain/actors/builtin/init/v7.go +++ b/chain/actors/builtin/init/v7.go @@ -4,22 +4,21 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - init7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/init" adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt" + + "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 = (*state7)(nil) diff --git a/chain/actors/builtin/init/v8.go b/chain/actors/builtin/init/v8.go index 35e6d15397..c7c7860d39 100644 --- a/chain/actors/builtin/init/v8.go +++ b/chain/actors/builtin/init/v8.go @@ -4,21 +4,21 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" + builtin8 "github.com/filecoin-project/go-state-types/builtin" + init8 "github.com/filecoin-project/go-state-types/builtin/v8/init" + adt8 "github.com/filecoin-project/go-state-types/builtin/v8/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" - - builtin8 "github.com/filecoin-project/go-state-types/builtin" - init8 "github.com/filecoin-project/go-state-types/builtin/v8/init" - adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" ) var _ State = (*state8)(nil) diff --git a/chain/actors/builtin/init/v9.go b/chain/actors/builtin/init/v9.go index 93797ad7de..a221a4a7c4 100644 --- a/chain/actors/builtin/init/v9.go +++ b/chain/actors/builtin/init/v9.go @@ -4,21 +4,21 @@ import ( "crypto/sha256" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" + builtin9 "github.com/filecoin-project/go-state-types/builtin" + init9 "github.com/filecoin-project/go-state-types/builtin/v9/init" + adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" "github.com/filecoin-project/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" - - builtin9 "github.com/filecoin-project/go-state-types/builtin" - init9 "github.com/filecoin-project/go-state-types/builtin/v9/init" - adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" ) var _ State = (*state9)(nil) diff --git a/chain/actors/builtin/market/market.go b/chain/actors/builtin/market/market.go index 11947cc124..fc057549d7 100644 --- a/chain/actors/builtin/market/market.go +++ b/chain/actors/builtin/market/market.go @@ -1,39 +1,30 @@ package market import ( - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/ipfs/go-cid" "unicode/utf8" - "github.com/filecoin-project/go-state-types/network" + "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" "github.com/filecoin-project/go-state-types/big" - "github.com/filecoin-project/go-state-types/cbor" - "github.com/filecoin-project/go-state-types/manifest" - cbg "github.com/whyrusleeping/cbor-gen" - + builtintypes "github.com/filecoin-project/go-state-types/builtin" markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" - + "github.com/filecoin-project/go-state-types/cbor" + "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/go-state-types/network" builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - builtintypes "github.com/filecoin-project/go-state-types/builtin" - "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/market/v0.go b/chain/actors/builtin/market/v0.go index df8a912d80..c0a628b47f 100644 --- a/chain/actors/builtin/market/v0.go +++ b/chain/actors/builtin/market/v0.go @@ -4,21 +4,21 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" + market0 "github.com/filecoin-project/specs-actors/actors/builtin/market" + adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" - - market0 "github.com/filecoin-project/specs-actors/actors/builtin/market" - adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" ) var _ State = (*state0)(nil) diff --git a/chain/actors/builtin/market/v10.go b/chain/actors/builtin/market/v10.go index ff8dcfc6f8..aaa0ee0f1b 100644 --- a/chain/actors/builtin/market/v10.go +++ b/chain/actors/builtin/market/v10.go @@ -4,27 +4,25 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" + market10 "github.com/filecoin-project/go-state-types/builtin/v10/market" + adt10 "github.com/filecoin-project/go-state-types/builtin/v10/util/adt" + markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/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/types" - - market10 "github.com/filecoin-project/go-state-types/builtin/v10/market" - adt10 "github.com/filecoin-project/go-state-types/builtin/v10/util/adt" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" - - "github.com/filecoin-project/go-state-types/builtin" ) var _ State = (*state10)(nil) diff --git a/chain/actors/builtin/market/v2.go b/chain/actors/builtin/market/v2.go index 8cc2e9a964..89ffdde8f5 100644 --- a/chain/actors/builtin/market/v2.go +++ b/chain/actors/builtin/market/v2.go @@ -4,21 +4,21 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" + market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" + adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" - - market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" - adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" ) var _ State = (*state2)(nil) diff --git a/chain/actors/builtin/market/v3.go b/chain/actors/builtin/market/v3.go index d83a79a2a0..f4d073ed86 100644 --- a/chain/actors/builtin/market/v3.go +++ b/chain/actors/builtin/market/v3.go @@ -4,21 +4,21 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" + market3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/market" + adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" - - market3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/market" - adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt" ) var _ State = (*state3)(nil) diff --git a/chain/actors/builtin/market/v4.go b/chain/actors/builtin/market/v4.go index 705efd84b7..422a30cbb1 100644 --- a/chain/actors/builtin/market/v4.go +++ b/chain/actors/builtin/market/v4.go @@ -4,21 +4,21 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" + market4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/market" + adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" - - market4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/market" - adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt" ) var _ State = (*state4)(nil) diff --git a/chain/actors/builtin/market/v5.go b/chain/actors/builtin/market/v5.go index d765c38118..b30decb03a 100644 --- a/chain/actors/builtin/market/v5.go +++ b/chain/actors/builtin/market/v5.go @@ -4,21 +4,21 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" + market5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/market" + adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" - - market5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/market" - adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt" ) var _ State = (*state5)(nil) diff --git a/chain/actors/builtin/market/v6.go b/chain/actors/builtin/market/v6.go index 9bab892a1b..377b278ae1 100644 --- a/chain/actors/builtin/market/v6.go +++ b/chain/actors/builtin/market/v6.go @@ -4,24 +4,23 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" + market6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/market" + adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" - - market6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/market" - adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt" ) var _ State = (*state6)(nil) diff --git a/chain/actors/builtin/market/v7.go b/chain/actors/builtin/market/v7.go index 3c1a7ead29..cd4607cbef 100644 --- a/chain/actors/builtin/market/v7.go +++ b/chain/actors/builtin/market/v7.go @@ -4,24 +4,23 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" + market7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/market" + adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" - - market7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/market" - adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt" ) var _ State = (*state7)(nil) diff --git a/chain/actors/builtin/market/v8.go b/chain/actors/builtin/market/v8.go index c40474236a..5cce06d3a0 100644 --- a/chain/actors/builtin/market/v8.go +++ b/chain/actors/builtin/market/v8.go @@ -4,25 +4,24 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" + market8 "github.com/filecoin-project/go-state-types/builtin/v8/market" + adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" + markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/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/types" - - market8 "github.com/filecoin-project/go-state-types/builtin/v8/market" - adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" ) var _ State = (*state8)(nil) diff --git a/chain/actors/builtin/market/v9.go b/chain/actors/builtin/market/v9.go index 2f44a89cdc..095c208500 100644 --- a/chain/actors/builtin/market/v9.go +++ b/chain/actors/builtin/market/v9.go @@ -4,27 +4,25 @@ import ( "bytes" "fmt" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" + market9 "github.com/filecoin-project/go-state-types/builtin/v9/market" + markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" + adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/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/types" - - market9 "github.com/filecoin-project/go-state-types/builtin/v9/market" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" - adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" - - "github.com/filecoin-project/go-state-types/builtin" ) var _ State = (*state9)(nil) diff --git a/chain/actors/builtin/miner/miner.go b/chain/actors/builtin/miner/miner.go index ac7854dd75..1931af3d37 100644 --- a/chain/actors/builtin/miner/miner.go +++ b/chain/actors/builtin/miner/miner.go @@ -1,38 +1,31 @@ package miner import ( - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/big" - "github.com/filecoin-project/go-state-types/network" - "github.com/filecoin-project/lotus/chain/actors" "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" "github.com/filecoin-project/go-bitfield" "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/big" + minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner" "github.com/filecoin-project/go-state-types/cbor" "github.com/filecoin-project/go-state-types/dline" - "github.com/filecoin-project/go-state-types/proof" - - minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/types" - + "github.com/filecoin-project/go-state-types/network" + "github.com/filecoin-project/go-state-types/proof" builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/types" ) func Load(store adt.Store, act *types.Actor) (State, error) { diff --git a/chain/actors/builtin/miner/v0.go b/chain/actors/builtin/miner/v0.go index 4d3f7b3a21..7d5eaf8e0a 100644 --- a/chain/actors/builtin/miner/v0.go +++ b/chain/actors/builtin/miner/v0.go @@ -5,23 +5,22 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-state-types/big" - - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" + "github.com/filecoin-project/go-state-types/big" + "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" - miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner" adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state0)(nil) diff --git a/chain/actors/builtin/miner/v10.go b/chain/actors/builtin/miner/v10.go index bba645da5b..4d47ba396c 100644 --- a/chain/actors/builtin/miner/v10.go +++ b/chain/actors/builtin/miner/v10.go @@ -5,22 +5,22 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - builtin10 "github.com/filecoin-project/go-state-types/builtin" miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" adt10 "github.com/filecoin-project/go-state-types/builtin/v10/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 = (*state10)(nil) diff --git a/chain/actors/builtin/miner/v2.go b/chain/actors/builtin/miner/v2.go index f8ae1ef1e9..14341ae383 100644 --- a/chain/actors/builtin/miner/v2.go +++ b/chain/actors/builtin/miner/v2.go @@ -5,21 +5,21 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" + "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" - miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state2)(nil) diff --git a/chain/actors/builtin/miner/v3.go b/chain/actors/builtin/miner/v3.go index 9a81c2683f..52808da8ca 100644 --- a/chain/actors/builtin/miner/v3.go +++ b/chain/actors/builtin/miner/v3.go @@ -5,23 +5,22 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" + "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" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - miner3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/miner" adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state3)(nil) diff --git a/chain/actors/builtin/miner/v4.go b/chain/actors/builtin/miner/v4.go index a61bbcf2ba..5980ef769b 100644 --- a/chain/actors/builtin/miner/v4.go +++ b/chain/actors/builtin/miner/v4.go @@ -5,23 +5,22 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" + "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" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - miner4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/miner" adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state4)(nil) diff --git a/chain/actors/builtin/miner/v5.go b/chain/actors/builtin/miner/v5.go index 0b74ef3047..886300ea3d 100644 --- a/chain/actors/builtin/miner/v5.go +++ b/chain/actors/builtin/miner/v5.go @@ -5,23 +5,22 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" + "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" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner" adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state5)(nil) diff --git a/chain/actors/builtin/miner/v6.go b/chain/actors/builtin/miner/v6.go index c02d0b4bdf..4737b0ee2f 100644 --- a/chain/actors/builtin/miner/v6.go +++ b/chain/actors/builtin/miner/v6.go @@ -5,23 +5,22 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" + "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" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner" adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state6)(nil) diff --git a/chain/actors/builtin/miner/v7.go b/chain/actors/builtin/miner/v7.go index 5be07d1a25..72803eb750 100644 --- a/chain/actors/builtin/miner/v7.go +++ b/chain/actors/builtin/miner/v7.go @@ -5,23 +5,22 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" + "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" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner" adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state7)(nil) diff --git a/chain/actors/builtin/miner/v8.go b/chain/actors/builtin/miner/v8.go index 3f1269f2ad..3e3739591f 100644 --- a/chain/actors/builtin/miner/v8.go +++ b/chain/actors/builtin/miner/v8.go @@ -5,22 +5,22 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - builtin8 "github.com/filecoin-project/go-state-types/builtin" miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner" adt8 "github.com/filecoin-project/go-state-types/builtin/v8/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 = (*state8)(nil) diff --git a/chain/actors/builtin/miner/v9.go b/chain/actors/builtin/miner/v9.go index 3c7f7447c1..72d9dbd59f 100644 --- a/chain/actors/builtin/miner/v9.go +++ b/chain/actors/builtin/miner/v9.go @@ -5,22 +5,22 @@ import ( "errors" "fmt" - "github.com/filecoin-project/go-bitfield" - rle "github.com/filecoin-project/go-bitfield/rle" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/dline" "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - builtin9 "github.com/filecoin-project/go-state-types/builtin" miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" adt9 "github.com/filecoin-project/go-state-types/builtin/v9/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 = (*state9)(nil) diff --git a/chain/actors/builtin/multisig/message0.go b/chain/actors/builtin/multisig/message0.go index c8e97cb49a..7dbdf444ce 100644 --- a/chain/actors/builtin/multisig/message0.go +++ b/chain/actors/builtin/multisig/message0.go @@ -5,12 +5,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - + builtintypes "github.com/filecoin-project/go-state-types/builtin" builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" init0 "github.com/filecoin-project/specs-actors/actors/builtin/init" multisig0 "github.com/filecoin-project/specs-actors/actors/builtin/multisig" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/message10.go b/chain/actors/builtin/multisig/message10.go index 367d1d9145..87ee759bd7 100644 --- a/chain/actors/builtin/multisig/message10.go +++ b/chain/actors/builtin/multisig/message10.go @@ -5,13 +5,12 @@ import ( "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" init10 "github.com/filecoin-project/go-state-types/builtin/v10/init" multisig10 "github.com/filecoin-project/go-state-types/builtin/v10/multisig" "github.com/filecoin-project/go-state-types/manifest" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/message2.go b/chain/actors/builtin/multisig/message2.go index c316c9fddd..91ad17b84a 100644 --- a/chain/actors/builtin/multisig/message2.go +++ b/chain/actors/builtin/multisig/message2.go @@ -5,12 +5,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - + builtintypes "github.com/filecoin-project/go-state-types/builtin" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" init2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/init" multisig2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/multisig" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/message3.go b/chain/actors/builtin/multisig/message3.go index 6c842c471c..4124e00c86 100644 --- a/chain/actors/builtin/multisig/message3.go +++ b/chain/actors/builtin/multisig/message3.go @@ -5,12 +5,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - + builtintypes "github.com/filecoin-project/go-state-types/builtin" builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" init3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/init" multisig3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/multisig" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/message4.go b/chain/actors/builtin/multisig/message4.go index 11ba46da9a..33449df75f 100644 --- a/chain/actors/builtin/multisig/message4.go +++ b/chain/actors/builtin/multisig/message4.go @@ -5,12 +5,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - + builtintypes "github.com/filecoin-project/go-state-types/builtin" builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" init4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/init" multisig4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/multisig" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/message5.go b/chain/actors/builtin/multisig/message5.go index a6292c0ac6..46c35dabce 100644 --- a/chain/actors/builtin/multisig/message5.go +++ b/chain/actors/builtin/multisig/message5.go @@ -5,12 +5,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - + builtintypes "github.com/filecoin-project/go-state-types/builtin" builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" init5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/init" multisig5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/multisig" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/message6.go b/chain/actors/builtin/multisig/message6.go index e497fbaacc..f528cfbb5d 100644 --- a/chain/actors/builtin/multisig/message6.go +++ b/chain/actors/builtin/multisig/message6.go @@ -5,12 +5,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - + builtintypes "github.com/filecoin-project/go-state-types/builtin" builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" init6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/init" multisig6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/multisig" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/message7.go b/chain/actors/builtin/multisig/message7.go index 79af7d19d6..6e62dad13a 100644 --- a/chain/actors/builtin/multisig/message7.go +++ b/chain/actors/builtin/multisig/message7.go @@ -5,12 +5,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - + builtintypes "github.com/filecoin-project/go-state-types/builtin" builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" init7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/init" multisig7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/multisig" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/message8.go b/chain/actors/builtin/multisig/message8.go index 48895f51db..4131a1b768 100644 --- a/chain/actors/builtin/multisig/message8.go +++ b/chain/actors/builtin/multisig/message8.go @@ -5,13 +5,12 @@ import ( "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" init10 "github.com/filecoin-project/go-state-types/builtin/v10/init" multisig8 "github.com/filecoin-project/go-state-types/builtin/v8/multisig" "github.com/filecoin-project/go-state-types/manifest" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/message9.go b/chain/actors/builtin/multisig/message9.go index 522f284e1e..f9c8c31037 100644 --- a/chain/actors/builtin/multisig/message9.go +++ b/chain/actors/builtin/multisig/message9.go @@ -5,13 +5,12 @@ import ( "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" init10 "github.com/filecoin-project/go-state-types/builtin/v10/init" multisig9 "github.com/filecoin-project/go-state-types/builtin/v9/multisig" "github.com/filecoin-project/go-state-types/manifest" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors" init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/multisig/multisig.go b/chain/actors/builtin/multisig/multisig.go index 654cacc70b..4abdf7bbbd 100644 --- a/chain/actors/builtin/multisig/multisig.go +++ b/chain/actors/builtin/multisig/multisig.go @@ -2,36 +2,27 @@ package multisig import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/ipfs/go-cid" + "github.com/ipfs/go-cid" "github.com/minio/blake2b-simd" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/cbor" - + actorstypes "github.com/filecoin-project/go-state-types/actors" + builtintypes "github.com/filecoin-project/go-state-types/builtin" msig10 "github.com/filecoin-project/go-state-types/builtin/v10/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" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - builtintypes "github.com/filecoin-project/go-state-types/builtin" - "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/types" diff --git a/chain/actors/builtin/multisig/v0.go b/chain/actors/builtin/multisig/v0.go index 49cf6ce1b1..86bfdaaf37 100644 --- a/chain/actors/builtin/multisig/v0.go +++ b/chain/actors/builtin/multisig/v0.go @@ -5,20 +5,19 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - msig0 "github.com/filecoin-project/specs-actors/actors/builtin/multisig" adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state0)(nil) diff --git a/chain/actors/builtin/multisig/v10.go b/chain/actors/builtin/multisig/v10.go index 26f7027e8f..d87fc5807a 100644 --- a/chain/actors/builtin/multisig/v10.go +++ b/chain/actors/builtin/multisig/v10.go @@ -5,21 +5,20 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" - "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/go-address" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" builtin10 "github.com/filecoin-project/go-state-types/builtin" msig10 "github.com/filecoin-project/go-state-types/builtin/v10/multisig" adt10 "github.com/filecoin-project/go-state-types/builtin/v10/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 = (*state10)(nil) diff --git a/chain/actors/builtin/multisig/v2.go b/chain/actors/builtin/multisig/v2.go index c56061b597..77330d5139 100644 --- a/chain/actors/builtin/multisig/v2.go +++ b/chain/actors/builtin/multisig/v2.go @@ -5,20 +5,19 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - msig2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/multisig" adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state2)(nil) diff --git a/chain/actors/builtin/multisig/v3.go b/chain/actors/builtin/multisig/v3.go index 04d23f3e21..e8659093fc 100644 --- a/chain/actors/builtin/multisig/v3.go +++ b/chain/actors/builtin/multisig/v3.go @@ -5,22 +5,20 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - msig3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/multisig" adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state3)(nil) diff --git a/chain/actors/builtin/multisig/v4.go b/chain/actors/builtin/multisig/v4.go index f7177a7d05..ddaac54705 100644 --- a/chain/actors/builtin/multisig/v4.go +++ b/chain/actors/builtin/multisig/v4.go @@ -5,22 +5,20 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - msig4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/multisig" adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state4)(nil) diff --git a/chain/actors/builtin/multisig/v5.go b/chain/actors/builtin/multisig/v5.go index 6de3243125..50474d5fd4 100644 --- a/chain/actors/builtin/multisig/v5.go +++ b/chain/actors/builtin/multisig/v5.go @@ -5,22 +5,20 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - msig5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/multisig" adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state5)(nil) diff --git a/chain/actors/builtin/multisig/v6.go b/chain/actors/builtin/multisig/v6.go index edc5f67fd4..c51404dc49 100644 --- a/chain/actors/builtin/multisig/v6.go +++ b/chain/actors/builtin/multisig/v6.go @@ -5,22 +5,20 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - msig6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/multisig" adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state6)(nil) diff --git a/chain/actors/builtin/multisig/v7.go b/chain/actors/builtin/multisig/v7.go index 55138bcfe9..9ddce167af 100644 --- a/chain/actors/builtin/multisig/v7.go +++ b/chain/actors/builtin/multisig/v7.go @@ -5,22 +5,20 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - msig7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/multisig" adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state7)(nil) diff --git a/chain/actors/builtin/multisig/v8.go b/chain/actors/builtin/multisig/v8.go index 4ea54ac16f..b28ec5684d 100644 --- a/chain/actors/builtin/multisig/v8.go +++ b/chain/actors/builtin/multisig/v8.go @@ -5,21 +5,20 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" - "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/go-address" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" builtin8 "github.com/filecoin-project/go-state-types/builtin" msig8 "github.com/filecoin-project/go-state-types/builtin/v8/multisig" adt8 "github.com/filecoin-project/go-state-types/builtin/v8/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 = (*state8)(nil) diff --git a/chain/actors/builtin/multisig/v9.go b/chain/actors/builtin/multisig/v9.go index 14e472814c..faa3b7d373 100644 --- a/chain/actors/builtin/multisig/v9.go +++ b/chain/actors/builtin/multisig/v9.go @@ -5,21 +5,20 @@ import ( "encoding/binary" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" - "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/go-address" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" builtin9 "github.com/filecoin-project/go-state-types/builtin" msig9 "github.com/filecoin-project/go-state-types/builtin/v9/multisig" adt9 "github.com/filecoin-project/go-state-types/builtin/v9/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 = (*state9)(nil) diff --git a/chain/actors/builtin/paych/message0.go b/chain/actors/builtin/paych/message0.go index 2daa0301bf..d5a112d43b 100644 --- a/chain/actors/builtin/paych/message0.go +++ b/chain/actors/builtin/paych/message0.go @@ -3,9 +3,7 @@ package paych import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" init0 "github.com/filecoin-project/specs-actors/actors/builtin/init" paych0 "github.com/filecoin-project/specs-actors/actors/builtin/paych" diff --git a/chain/actors/builtin/paych/message10.go b/chain/actors/builtin/paych/message10.go index 0086052170..03daa7bcf2 100644 --- a/chain/actors/builtin/paych/message10.go +++ b/chain/actors/builtin/paych/message10.go @@ -5,13 +5,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - actorstypes "github.com/filecoin-project/go-state-types/actors" builtin10 "github.com/filecoin-project/go-state-types/builtin" init10 "github.com/filecoin-project/go-state-types/builtin/v10/init" paych10 "github.com/filecoin-project/go-state-types/builtin/v10/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" diff --git a/chain/actors/builtin/paych/message2.go b/chain/actors/builtin/paych/message2.go index 925ad0ed9d..89a6e74ce9 100644 --- a/chain/actors/builtin/paych/message2.go +++ b/chain/actors/builtin/paych/message2.go @@ -3,9 +3,7 @@ package paych import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" init2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/init" paych2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/paych" diff --git a/chain/actors/builtin/paych/message3.go b/chain/actors/builtin/paych/message3.go index e8ae585fce..47f8e7e9e2 100644 --- a/chain/actors/builtin/paych/message3.go +++ b/chain/actors/builtin/paych/message3.go @@ -3,9 +3,7 @@ package paych import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" init3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/init" paych3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/paych" diff --git a/chain/actors/builtin/paych/message4.go b/chain/actors/builtin/paych/message4.go index b32b0fa579..65e63149d9 100644 --- a/chain/actors/builtin/paych/message4.go +++ b/chain/actors/builtin/paych/message4.go @@ -3,9 +3,7 @@ package paych import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" init4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/init" paych4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/paych" diff --git a/chain/actors/builtin/paych/message5.go b/chain/actors/builtin/paych/message5.go index 897bebe7a7..ede1c8ceb7 100644 --- a/chain/actors/builtin/paych/message5.go +++ b/chain/actors/builtin/paych/message5.go @@ -3,9 +3,7 @@ package paych import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" init5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/init" paych5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/paych" diff --git a/chain/actors/builtin/paych/message6.go b/chain/actors/builtin/paych/message6.go index 11bd3a8a5d..009e8641fe 100644 --- a/chain/actors/builtin/paych/message6.go +++ b/chain/actors/builtin/paych/message6.go @@ -3,9 +3,7 @@ package paych import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" init6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/init" paych6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/paych" diff --git a/chain/actors/builtin/paych/message7.go b/chain/actors/builtin/paych/message7.go index 446e54eade..430fb93415 100644 --- a/chain/actors/builtin/paych/message7.go +++ b/chain/actors/builtin/paych/message7.go @@ -3,9 +3,7 @@ package paych import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" init7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/init" paych7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/paych" diff --git a/chain/actors/builtin/paych/message8.go b/chain/actors/builtin/paych/message8.go index 6d9df4f4cd..a72c5fbb38 100644 --- a/chain/actors/builtin/paych/message8.go +++ b/chain/actors/builtin/paych/message8.go @@ -5,13 +5,11 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - actorstypes "github.com/filecoin-project/go-state-types/actors" builtin8 "github.com/filecoin-project/go-state-types/builtin" init8 "github.com/filecoin-project/go-state-types/builtin/v8/init" paych8 "github.com/filecoin-project/go-state-types/builtin/v8/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" diff --git a/chain/actors/builtin/paych/message9.go b/chain/actors/builtin/paych/message9.go index c0e68a4c3f..350c760eaf 100644 --- a/chain/actors/builtin/paych/message9.go +++ b/chain/actors/builtin/paych/message9.go @@ -5,11 +5,9 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - actorstypes "github.com/filecoin-project/go-state-types/actors" builtin9 "github.com/filecoin-project/go-state-types/builtin" + paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" init9 "github.com/filecoin-project/go-state-types/builtin/v9/init" paych9 "github.com/filecoin-project/go-state-types/builtin/v9/paych" diff --git a/chain/actors/builtin/paych/paych.go b/chain/actors/builtin/paych/paych.go index dd6ca505f0..0e6a3ca076 100644 --- a/chain/actors/builtin/paych/paych.go +++ b/chain/actors/builtin/paych/paych.go @@ -3,33 +3,25 @@ package paych import ( "encoding/base64" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/ipfs/go-cid" + "github.com/ipfs/go-cid" + ipldcbor "github.com/ipfs/go-ipld-cbor" "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" + paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" "github.com/filecoin-project/go-state-types/cbor" "github.com/filecoin-project/go-state-types/manifest" - ipldcbor "github.com/ipfs/go-ipld-cbor" - - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - paych0 "github.com/filecoin-project/specs-actors/actors/builtin/paych" - builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" - + paych0 "github.com/filecoin-project/specs-actors/actors/builtin/paych" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" "github.com/filecoin-project/lotus/chain/actors" diff --git a/chain/actors/builtin/paych/v0.go b/chain/actors/builtin/paych/v0.go index 7188757931..facc7f6567 100644 --- a/chain/actors/builtin/paych/v0.go +++ b/chain/actors/builtin/paych/v0.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - paych0 "github.com/filecoin-project/specs-actors/actors/builtin/paych" adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state0)(nil) diff --git a/chain/actors/builtin/paych/v10.go b/chain/actors/builtin/paych/v10.go index c303abe4bd..edc6c96b6c 100644 --- a/chain/actors/builtin/paych/v10.go +++ b/chain/actors/builtin/paych/v10.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - + paych10 "github.com/filecoin-project/go-state-types/builtin/v10/paych" + adt10 "github.com/filecoin-project/go-state-types/builtin/v10/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" - - paych10 "github.com/filecoin-project/go-state-types/builtin/v10/paych" - adt10 "github.com/filecoin-project/go-state-types/builtin/v10/util/adt" ) var _ State = (*state10)(nil) diff --git a/chain/actors/builtin/paych/v2.go b/chain/actors/builtin/paych/v2.go index d7e1174f34..63a3cc75eb 100644 --- a/chain/actors/builtin/paych/v2.go +++ b/chain/actors/builtin/paych/v2.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - paych2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/paych" adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state2)(nil) diff --git a/chain/actors/builtin/paych/v3.go b/chain/actors/builtin/paych/v3.go index 00e752c4fa..c672c0027e 100644 --- a/chain/actors/builtin/paych/v3.go +++ b/chain/actors/builtin/paych/v3.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - paych3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/paych" adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state3)(nil) diff --git a/chain/actors/builtin/paych/v4.go b/chain/actors/builtin/paych/v4.go index 6b632da869..842e520938 100644 --- a/chain/actors/builtin/paych/v4.go +++ b/chain/actors/builtin/paych/v4.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - paych4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/paych" adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state4)(nil) diff --git a/chain/actors/builtin/paych/v5.go b/chain/actors/builtin/paych/v5.go index 0302330ff4..8f53fe43fa 100644 --- a/chain/actors/builtin/paych/v5.go +++ b/chain/actors/builtin/paych/v5.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - paych5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/paych" adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state5)(nil) diff --git a/chain/actors/builtin/paych/v6.go b/chain/actors/builtin/paych/v6.go index 73d4cb8732..0a8a938960 100644 --- a/chain/actors/builtin/paych/v6.go +++ b/chain/actors/builtin/paych/v6.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - paych6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/paych" adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state6)(nil) diff --git a/chain/actors/builtin/paych/v7.go b/chain/actors/builtin/paych/v7.go index cce3fee7ee..ce0dcba0aa 100644 --- a/chain/actors/builtin/paych/v7.go +++ b/chain/actors/builtin/paych/v7.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - paych7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/paych" adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state7)(nil) diff --git a/chain/actors/builtin/paych/v8.go b/chain/actors/builtin/paych/v8.go index ea7d89448b..51067e87b0 100644 --- a/chain/actors/builtin/paych/v8.go +++ b/chain/actors/builtin/paych/v8.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - + paych8 "github.com/filecoin-project/go-state-types/builtin/v8/paych" + adt8 "github.com/filecoin-project/go-state-types/builtin/v8/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" - - paych8 "github.com/filecoin-project/go-state-types/builtin/v8/paych" - adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" ) var _ State = (*state8)(nil) diff --git a/chain/actors/builtin/paych/v9.go b/chain/actors/builtin/paych/v9.go index da8f47030d..8a69e16d4f 100644 --- a/chain/actors/builtin/paych/v9.go +++ b/chain/actors/builtin/paych/v9.go @@ -2,19 +2,19 @@ package paych import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "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" - + paych9 "github.com/filecoin-project/go-state-types/builtin/v9/paych" + adt9 "github.com/filecoin-project/go-state-types/builtin/v9/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" - - paych9 "github.com/filecoin-project/go-state-types/builtin/v9/paych" - adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" ) var _ State = (*state9)(nil) diff --git a/chain/actors/builtin/power/power.go b/chain/actors/builtin/power/power.go index f22c4d0ef0..6dca61435b 100644 --- a/chain/actors/builtin/power/power.go +++ b/chain/actors/builtin/power/power.go @@ -1,37 +1,29 @@ package power import ( - "github.com/filecoin-project/go-address" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/big" - "github.com/filecoin-project/lotus/chain/actors" "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" + "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" + builtin10 "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/cbor" - "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/actors/builtin" - "github.com/filecoin-project/lotus/chain/types" - builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - builtin10 "github.com/filecoin-project/go-state-types/builtin" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/actors/builtin" + "github.com/filecoin-project/lotus/chain/types" ) var ( diff --git a/chain/actors/builtin/power/v0.go b/chain/actors/builtin/power/v0.go index 7985215a28..4cf550616b 100644 --- a/chain/actors/builtin/power/v0.go +++ b/chain/actors/builtin/power/v0.go @@ -3,20 +3,20 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" + power0 "github.com/filecoin-project/specs-actors/actors/builtin/power" + adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/actors/builtin" - - power0 "github.com/filecoin-project/specs-actors/actors/builtin/power" - adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" ) var _ State = (*state0)(nil) diff --git a/chain/actors/builtin/power/v10.go b/chain/actors/builtin/power/v10.go index 03c9599450..dd7a9decf0 100644 --- a/chain/actors/builtin/power/v10.go +++ b/chain/actors/builtin/power/v10.go @@ -3,21 +3,21 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" + builtin10 "github.com/filecoin-project/go-state-types/builtin" + power10 "github.com/filecoin-project/go-state-types/builtin/v10/power" + adt10 "github.com/filecoin-project/go-state-types/builtin/v10/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" - - builtin10 "github.com/filecoin-project/go-state-types/builtin" - power10 "github.com/filecoin-project/go-state-types/builtin/v10/power" - adt10 "github.com/filecoin-project/go-state-types/builtin/v10/util/adt" ) var _ State = (*state10)(nil) diff --git a/chain/actors/builtin/power/v2.go b/chain/actors/builtin/power/v2.go index 397b44877f..bac0fa1792 100644 --- a/chain/actors/builtin/power/v2.go +++ b/chain/actors/builtin/power/v2.go @@ -3,20 +3,20 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "github.com/filecoin-project/go-state-types/manifest" + power2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/power" + adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/actors/builtin" - - power2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/power" - adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" ) var _ State = (*state2)(nil) diff --git a/chain/actors/builtin/power/v3.go b/chain/actors/builtin/power/v3.go index 341c156cde..bdb66e3842 100644 --- a/chain/actors/builtin/power/v3.go +++ b/chain/actors/builtin/power/v3.go @@ -3,22 +3,21 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - power3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/power" adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/actors/builtin" ) var _ State = (*state3)(nil) diff --git a/chain/actors/builtin/power/v4.go b/chain/actors/builtin/power/v4.go index 482b52d9e1..b2dc953475 100644 --- a/chain/actors/builtin/power/v4.go +++ b/chain/actors/builtin/power/v4.go @@ -3,22 +3,21 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - power4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/power" adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/actors/builtin" ) var _ State = (*state4)(nil) diff --git a/chain/actors/builtin/power/v5.go b/chain/actors/builtin/power/v5.go index b2854284bd..3a3adaf32d 100644 --- a/chain/actors/builtin/power/v5.go +++ b/chain/actors/builtin/power/v5.go @@ -3,22 +3,21 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - power5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/power" adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/actors/builtin" ) var _ State = (*state5)(nil) diff --git a/chain/actors/builtin/power/v6.go b/chain/actors/builtin/power/v6.go index 3d73313ec0..7e8eb36546 100644 --- a/chain/actors/builtin/power/v6.go +++ b/chain/actors/builtin/power/v6.go @@ -3,22 +3,21 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - power6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/power" adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/actors/builtin" ) var _ State = (*state6)(nil) diff --git a/chain/actors/builtin/power/v7.go b/chain/actors/builtin/power/v7.go index 66d40748ee..893c58667d 100644 --- a/chain/actors/builtin/power/v7.go +++ b/chain/actors/builtin/power/v7.go @@ -3,22 +3,21 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" "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" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - power7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/power" adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt" + + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/actors/builtin" ) var _ State = (*state7)(nil) diff --git a/chain/actors/builtin/power/v8.go b/chain/actors/builtin/power/v8.go index af03e99727..b15fe43559 100644 --- a/chain/actors/builtin/power/v8.go +++ b/chain/actors/builtin/power/v8.go @@ -3,21 +3,21 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" + builtin8 "github.com/filecoin-project/go-state-types/builtin" + power8 "github.com/filecoin-project/go-state-types/builtin/v8/power" + adt8 "github.com/filecoin-project/go-state-types/builtin/v8/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" - - builtin8 "github.com/filecoin-project/go-state-types/builtin" - power8 "github.com/filecoin-project/go-state-types/builtin/v8/power" - adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" ) var _ State = (*state8)(nil) diff --git a/chain/actors/builtin/power/v9.go b/chain/actors/builtin/power/v9.go index 66e3e62fe9..126fbbfbf6 100644 --- a/chain/actors/builtin/power/v9.go +++ b/chain/actors/builtin/power/v9.go @@ -3,21 +3,21 @@ package power import ( "bytes" "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "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" + builtin9 "github.com/filecoin-project/go-state-types/builtin" + power9 "github.com/filecoin-project/go-state-types/builtin/v9/power" + adt9 "github.com/filecoin-project/go-state-types/builtin/v9/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" - - builtin9 "github.com/filecoin-project/go-state-types/builtin" - power9 "github.com/filecoin-project/go-state-types/builtin/v9/power" - adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" ) var _ State = (*state9)(nil) diff --git a/chain/actors/builtin/registry.go b/chain/actors/builtin/registry.go index 5cc396703c..4ce48098d6 100644 --- a/chain/actors/builtin/registry.go +++ b/chain/actors/builtin/registry.go @@ -1,14 +1,31 @@ package builtin import ( - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/ipfs/go-cid" "reflect" "runtime" "strings" - "github.com/filecoin-project/go-state-types/builtin" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/builtin" + account10 "github.com/filecoin-project/go-state-types/builtin/v10/account" + cron10 "github.com/filecoin-project/go-state-types/builtin/v10/cron" + datacap10 "github.com/filecoin-project/go-state-types/builtin/v10/datacap" + eam10 "github.com/filecoin-project/go-state-types/builtin/v10/eam" + ethaccount10 "github.com/filecoin-project/go-state-types/builtin/v10/ethaccount" + evm10 "github.com/filecoin-project/go-state-types/builtin/v10/evm" + _init10 "github.com/filecoin-project/go-state-types/builtin/v10/init" + market10 "github.com/filecoin-project/go-state-types/builtin/v10/market" + miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" + multisig10 "github.com/filecoin-project/go-state-types/builtin/v10/multisig" + paych10 "github.com/filecoin-project/go-state-types/builtin/v10/paych" + placeholder10 "github.com/filecoin-project/go-state-types/builtin/v10/placeholder" + power10 "github.com/filecoin-project/go-state-types/builtin/v10/power" + reward10 "github.com/filecoin-project/go-state-types/builtin/v10/reward" + system10 "github.com/filecoin-project/go-state-types/builtin/v10/system" + verifreg10 "github.com/filecoin-project/go-state-types/builtin/v10/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" @@ -20,9 +37,9 @@ import ( reward8 "github.com/filecoin-project/go-state-types/builtin/v8/reward" system8 "github.com/filecoin-project/go-state-types/builtin/v8/system" verifreg8 "github.com/filecoin-project/go-state-types/builtin/v8/verifreg" - account9 "github.com/filecoin-project/go-state-types/builtin/v9/account" cron9 "github.com/filecoin-project/go-state-types/builtin/v9/cron" + datacap9 "github.com/filecoin-project/go-state-types/builtin/v9/datacap" _init9 "github.com/filecoin-project/go-state-types/builtin/v9/init" market9 "github.com/filecoin-project/go-state-types/builtin/v9/market" miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" @@ -32,32 +49,10 @@ import ( reward9 "github.com/filecoin-project/go-state-types/builtin/v9/reward" system9 "github.com/filecoin-project/go-state-types/builtin/v9/system" verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" - - datacap9 "github.com/filecoin-project/go-state-types/builtin/v9/datacap" - - account10 "github.com/filecoin-project/go-state-types/builtin/v10/account" - cron10 "github.com/filecoin-project/go-state-types/builtin/v10/cron" - _init10 "github.com/filecoin-project/go-state-types/builtin/v10/init" - market10 "github.com/filecoin-project/go-state-types/builtin/v10/market" - miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" - multisig10 "github.com/filecoin-project/go-state-types/builtin/v10/multisig" - paych10 "github.com/filecoin-project/go-state-types/builtin/v10/paych" - power10 "github.com/filecoin-project/go-state-types/builtin/v10/power" - reward10 "github.com/filecoin-project/go-state-types/builtin/v10/reward" - system10 "github.com/filecoin-project/go-state-types/builtin/v10/system" - verifreg10 "github.com/filecoin-project/go-state-types/builtin/v10/verifreg" - - datacap10 "github.com/filecoin-project/go-state-types/builtin/v10/datacap" - - eam10 "github.com/filecoin-project/go-state-types/builtin/v10/eam" - ethaccount10 "github.com/filecoin-project/go-state-types/builtin/v10/ethaccount" - evm10 "github.com/filecoin-project/go-state-types/builtin/v10/evm" - placeholder10 "github.com/filecoin-project/go-state-types/builtin/v10/placeholder" - - "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/cbor" "github.com/filecoin-project/go-state-types/manifest" rtt "github.com/filecoin-project/go-state-types/rt" + "github.com/filecoin-project/lotus/chain/actors" ) diff --git a/chain/actors/builtin/reward/reward.go b/chain/actors/builtin/reward/reward.go index e39dca0f96..01462d6804 100644 --- a/chain/actors/builtin/reward/reward.go +++ b/chain/actors/builtin/reward/reward.go @@ -1,32 +1,24 @@ package reward import ( - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/lotus/chain/actors" - reward0 "github.com/filecoin-project/specs-actors/actors/builtin/reward" "github.com/ipfs/go-cid" "golang.org/x/xerrors" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" + builtin10 "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" - + reward0 "github.com/filecoin-project/specs-actors/actors/builtin/reward" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - builtin10 "github.com/filecoin-project/go-state-types/builtin" - - "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" "github.com/filecoin-project/lotus/chain/types" diff --git a/chain/actors/builtin/reward/v0.go b/chain/actors/builtin/reward/v0.go index e379bd5bbc..66736f9e00 100644 --- a/chain/actors/builtin/reward/v0.go +++ b/chain/actors/builtin/reward/v0.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/actors/builtin" - miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner" reward0 "github.com/filecoin-project/specs-actors/actors/builtin/reward" smoothing0 "github.com/filecoin-project/specs-actors/actors/util/smoothing" + + "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 = (*state0)(nil) diff --git a/chain/actors/builtin/reward/v10.go b/chain/actors/builtin/reward/v10.go index ad411ed71b..3ffe9a2674 100644 --- a/chain/actors/builtin/reward/v10.go +++ b/chain/actors/builtin/reward/v10.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" + miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" + reward10 "github.com/filecoin-project/go-state-types/builtin/v10/reward" + smoothing10 "github.com/filecoin-project/go-state-types/builtin/v10/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" - - miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" - reward10 "github.com/filecoin-project/go-state-types/builtin/v10/reward" - smoothing10 "github.com/filecoin-project/go-state-types/builtin/v10/util/smoothing" ) var _ State = (*state10)(nil) diff --git a/chain/actors/builtin/reward/v2.go b/chain/actors/builtin/reward/v2.go index dd3e647a9b..6d640f2e97 100644 --- a/chain/actors/builtin/reward/v2.go +++ b/chain/actors/builtin/reward/v2.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/actors/builtin" - miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" reward2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/reward" smoothing2 "github.com/filecoin-project/specs-actors/v2/actors/util/smoothing" + + "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 = (*state2)(nil) diff --git a/chain/actors/builtin/reward/v3.go b/chain/actors/builtin/reward/v3.go index 0bd5a3d7ab..fe8e555c91 100644 --- a/chain/actors/builtin/reward/v3.go +++ b/chain/actors/builtin/reward/v3.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/actors/builtin" - miner3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/miner" reward3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/reward" smoothing3 "github.com/filecoin-project/specs-actors/v3/actors/util/smoothing" + + "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 = (*state3)(nil) diff --git a/chain/actors/builtin/reward/v4.go b/chain/actors/builtin/reward/v4.go index 88c138a064..f0decd3921 100644 --- a/chain/actors/builtin/reward/v4.go +++ b/chain/actors/builtin/reward/v4.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/actors/builtin" - miner4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/miner" reward4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/reward" smoothing4 "github.com/filecoin-project/specs-actors/v4/actors/util/smoothing" + + "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 = (*state4)(nil) diff --git a/chain/actors/builtin/reward/v5.go b/chain/actors/builtin/reward/v5.go index 45553c43c5..82be12c0ae 100644 --- a/chain/actors/builtin/reward/v5.go +++ b/chain/actors/builtin/reward/v5.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/actors/builtin" - miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner" reward5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/reward" smoothing5 "github.com/filecoin-project/specs-actors/v5/actors/util/smoothing" + + "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 = (*state5)(nil) diff --git a/chain/actors/builtin/reward/v6.go b/chain/actors/builtin/reward/v6.go index f8ee7d20a6..71884dadaa 100644 --- a/chain/actors/builtin/reward/v6.go +++ b/chain/actors/builtin/reward/v6.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/actors/builtin" - miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner" reward6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/reward" smoothing6 "github.com/filecoin-project/specs-actors/v6/actors/util/smoothing" + + "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 = (*state6)(nil) diff --git a/chain/actors/builtin/reward/v7.go b/chain/actors/builtin/reward/v7.go index b99171aede..bc39f36661 100644 --- a/chain/actors/builtin/reward/v7.go +++ b/chain/actors/builtin/reward/v7.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/actors/builtin" - miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner" reward7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/reward" smoothing7 "github.com/filecoin-project/specs-actors/v7/actors/util/smoothing" + + "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 = (*state7)(nil) diff --git a/chain/actors/builtin/reward/v8.go b/chain/actors/builtin/reward/v8.go index effafe3c38..5f6b96d29b 100644 --- a/chain/actors/builtin/reward/v8.go +++ b/chain/actors/builtin/reward/v8.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" + miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner" + reward8 "github.com/filecoin-project/go-state-types/builtin/v8/reward" + smoothing8 "github.com/filecoin-project/go-state-types/builtin/v8/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" - - miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner" - reward8 "github.com/filecoin-project/go-state-types/builtin/v8/reward" - smoothing8 "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing" ) var _ State = (*state8)(nil) diff --git a/chain/actors/builtin/reward/v9.go b/chain/actors/builtin/reward/v9.go index ee77f84bc8..6118e2b302 100644 --- a/chain/actors/builtin/reward/v9.go +++ b/chain/actors/builtin/reward/v9.go @@ -2,18 +2,19 @@ package reward import ( "fmt" - "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" + miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" + reward9 "github.com/filecoin-project/go-state-types/builtin/v9/reward" + smoothing9 "github.com/filecoin-project/go-state-types/builtin/v9/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" - - miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" - reward9 "github.com/filecoin-project/go-state-types/builtin/v9/reward" - smoothing9 "github.com/filecoin-project/go-state-types/builtin/v9/util/smoothing" ) var _ State = (*state9)(nil) diff --git a/chain/actors/builtin/system/system.go b/chain/actors/builtin/system/system.go index b6f91e5669..c7589efa18 100644 --- a/chain/actors/builtin/system/system.go +++ b/chain/actors/builtin/system/system.go @@ -1,30 +1,23 @@ package system import ( - actorstypes "github.com/filecoin-project/go-state-types/actors" - "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/types" "github.com/ipfs/go-cid" - "golang.org/x/xerrors" + actorstypes "github.com/filecoin-project/go-state-types/actors" + builtin10 "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" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - builtin10 "github.com/filecoin-project/go-state-types/builtin" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" + "github.com/filecoin-project/lotus/chain/types" ) var ( diff --git a/chain/actors/builtin/system/v0.go b/chain/actors/builtin/system/v0.go index 788b23026c..d5f0f079e2 100644 --- a/chain/actors/builtin/system/v0.go +++ b/chain/actors/builtin/system/v0.go @@ -2,16 +2,16 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + "golang.org/x/xerrors" + + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/manifest" + system0 "github.com/filecoin-project/specs-actors/actors/builtin/system" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system0 "github.com/filecoin-project/specs-actors/actors/builtin/system" - "golang.org/x/xerrors" ) var _ State = (*state0)(nil) diff --git a/chain/actors/builtin/system/v10.go b/chain/actors/builtin/system/v10.go index 87216629da..2cdb396826 100644 --- a/chain/actors/builtin/system/v10.go +++ b/chain/actors/builtin/system/v10.go @@ -2,15 +2,15 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + actorstypes "github.com/filecoin-project/go-state-types/actors" + system10 "github.com/filecoin-project/go-state-types/builtin/v10/system" + "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system10 "github.com/filecoin-project/go-state-types/builtin/v10/system" ) var _ State = (*state10)(nil) diff --git a/chain/actors/builtin/system/v2.go b/chain/actors/builtin/system/v2.go index 05d3f4cf09..b0c6420541 100644 --- a/chain/actors/builtin/system/v2.go +++ b/chain/actors/builtin/system/v2.go @@ -2,16 +2,16 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + "golang.org/x/xerrors" + + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/manifest" + system2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/system" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/system" - "golang.org/x/xerrors" ) var _ State = (*state2)(nil) diff --git a/chain/actors/builtin/system/v3.go b/chain/actors/builtin/system/v3.go index 542b7cc742..8334f780e3 100644 --- a/chain/actors/builtin/system/v3.go +++ b/chain/actors/builtin/system/v3.go @@ -2,16 +2,16 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + "golang.org/x/xerrors" + + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/manifest" + system3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/system" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/system" - "golang.org/x/xerrors" ) var _ State = (*state3)(nil) diff --git a/chain/actors/builtin/system/v4.go b/chain/actors/builtin/system/v4.go index 9d58c9752e..227104f378 100644 --- a/chain/actors/builtin/system/v4.go +++ b/chain/actors/builtin/system/v4.go @@ -2,16 +2,16 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + "golang.org/x/xerrors" + + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/manifest" + system4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/system" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/system" - "golang.org/x/xerrors" ) var _ State = (*state4)(nil) diff --git a/chain/actors/builtin/system/v5.go b/chain/actors/builtin/system/v5.go index 0bfdaaf314..bbfb70b51b 100644 --- a/chain/actors/builtin/system/v5.go +++ b/chain/actors/builtin/system/v5.go @@ -2,16 +2,16 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + "golang.org/x/xerrors" + + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/manifest" + system5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/system" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/system" - "golang.org/x/xerrors" ) var _ State = (*state5)(nil) diff --git a/chain/actors/builtin/system/v6.go b/chain/actors/builtin/system/v6.go index 5b22169af3..2319b5929a 100644 --- a/chain/actors/builtin/system/v6.go +++ b/chain/actors/builtin/system/v6.go @@ -2,16 +2,16 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + "golang.org/x/xerrors" + + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/manifest" + system6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/system" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/system" - "golang.org/x/xerrors" ) var _ State = (*state6)(nil) diff --git a/chain/actors/builtin/system/v7.go b/chain/actors/builtin/system/v7.go index 0c476b5e42..0b10129e85 100644 --- a/chain/actors/builtin/system/v7.go +++ b/chain/actors/builtin/system/v7.go @@ -2,16 +2,16 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + "golang.org/x/xerrors" + + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/manifest" + system7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/system" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/system" - "golang.org/x/xerrors" ) var _ State = (*state7)(nil) diff --git a/chain/actors/builtin/system/v8.go b/chain/actors/builtin/system/v8.go index 4e913fc1db..eca3b0c044 100644 --- a/chain/actors/builtin/system/v8.go +++ b/chain/actors/builtin/system/v8.go @@ -2,15 +2,15 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + actorstypes "github.com/filecoin-project/go-state-types/actors" + system8 "github.com/filecoin-project/go-state-types/builtin/v8/system" + "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system8 "github.com/filecoin-project/go-state-types/builtin/v8/system" ) var _ State = (*state8)(nil) diff --git a/chain/actors/builtin/system/v9.go b/chain/actors/builtin/system/v9.go index 8bad14ce69..55e073efe9 100644 --- a/chain/actors/builtin/system/v9.go +++ b/chain/actors/builtin/system/v9.go @@ -2,15 +2,15 @@ package system import ( "fmt" - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "github.com/ipfs/go-cid" + actorstypes "github.com/filecoin-project/go-state-types/actors" + system9 "github.com/filecoin-project/go-state-types/builtin/v9/system" + "github.com/filecoin-project/go-state-types/manifest" + "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" - - system9 "github.com/filecoin-project/go-state-types/builtin/v9/system" ) var _ State = (*state9)(nil) diff --git a/chain/actors/builtin/verifreg/actor.go.template b/chain/actors/builtin/verifreg/actor.go.template index 9f9efef922..9b779a68df 100644 --- a/chain/actors/builtin/verifreg/actor.go.template +++ b/chain/actors/builtin/verifreg/actor.go.template @@ -83,6 +83,7 @@ type State interface { GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) GetClaim(providerIdAddr address.Address, claimId ClaimId) (*Claim, bool, error) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) + GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) GetState() interface{} } diff --git a/chain/actors/builtin/verifreg/state.go.template b/chain/actors/builtin/verifreg/state.go.template index 526dff54eb..adcbc22c2e 100644 --- a/chain/actors/builtin/verifreg/state.go.template +++ b/chain/actors/builtin/verifreg/state.go.template @@ -170,6 +170,27 @@ func (s *state{{.v}}) GetClaims(providerIdAddr address.Address) (map[ClaimId]Cla {{end}} } +func (s *state{{.v}}) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { +{{if (le .v 8)}} + return nil, xerrors.Errorf("unsupported in actors v{{.v}}") +{{else}} + v{{.v}}Map, err := s.LoadClaimsToMap(s.store, providerIdAddr) + + retMap := make(map[abi.SectorNumber][]ClaimId) + for k, v := range v{{.v}}Map { + claims, ok := retMap[v.Sector] + if !ok { + retMap[v.Sector] = []ClaimId{ClaimId(k)} + } else { + retMap[v.Sector] = append(claims, ClaimId(k)) + } + } + + return retMap, err + +{{end}} +} + func (s *state{{.v}}) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v0.go b/chain/actors/builtin/verifreg/v0.go index 0ba0e41301..9913c42c0c 100644 --- a/chain/actors/builtin/verifreg/v0.go +++ b/chain/actors/builtin/verifreg/v0.go @@ -2,20 +2,20 @@ 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" + verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" - "github.com/ipfs/go-cid" - - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "golang.org/x/xerrors" - verifreg0 "github.com/filecoin-project/specs-actors/actors/builtin/verifreg" adt0 "github.com/filecoin-project/specs-actors/actors/util/adt" - verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state0)(nil) @@ -118,6 +118,12 @@ func (s *state0) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e } +func (s *state0) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + return nil, xerrors.Errorf("unsupported in actors v0") + +} + func (s *state0) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v10.go b/chain/actors/builtin/verifreg/v10.go index 8b7b08d734..256f4d2f88 100644 --- a/chain/actors/builtin/verifreg/v10.go +++ b/chain/actors/builtin/verifreg/v10.go @@ -2,23 +2,22 @@ package verifreg import ( "fmt" - "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/manifest" - "github.com/ipfs/go-cid" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" + "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" builtin10 "github.com/filecoin-project/go-state-types/builtin" adt10 "github.com/filecoin-project/go-state-types/builtin/v10/util/adt" verifreg10 "github.com/filecoin-project/go-state-types/builtin/v10/verifreg" - - "github.com/filecoin-project/go-state-types/big" - 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 = (*state10)(nil) @@ -135,6 +134,24 @@ func (s *state10) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, } +func (s *state10) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + v10Map, err := s.LoadClaimsToMap(s.store, providerIdAddr) + + retMap := make(map[abi.SectorNumber][]ClaimId) + for k, v := range v10Map { + 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 *state10) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v2.go b/chain/actors/builtin/verifreg/v2.go index 872644db6d..31f7f775df 100644 --- a/chain/actors/builtin/verifreg/v2.go +++ b/chain/actors/builtin/verifreg/v2.go @@ -2,20 +2,20 @@ 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" + verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" - "github.com/ipfs/go-cid" - - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "golang.org/x/xerrors" - verifreg2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/verifreg" adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" - verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state2)(nil) @@ -118,6 +118,12 @@ func (s *state2) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e } +func (s *state2) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + return nil, xerrors.Errorf("unsupported in actors v2") + +} + func (s *state2) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v3.go b/chain/actors/builtin/verifreg/v3.go index 74b85e4718..3ea016fd5c 100644 --- a/chain/actors/builtin/verifreg/v3.go +++ b/chain/actors/builtin/verifreg/v3.go @@ -2,22 +2,21 @@ 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" + verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" - "github.com/ipfs/go-cid" - - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "golang.org/x/xerrors" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - verifreg3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/verifreg" adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt" - verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state3)(nil) @@ -120,6 +119,12 @@ func (s *state3) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e } +func (s *state3) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + return nil, xerrors.Errorf("unsupported in actors v3") + +} + func (s *state3) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v4.go b/chain/actors/builtin/verifreg/v4.go index c671f66b3c..464cc9fdc2 100644 --- a/chain/actors/builtin/verifreg/v4.go +++ b/chain/actors/builtin/verifreg/v4.go @@ -2,22 +2,21 @@ 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" + verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" - "github.com/ipfs/go-cid" - - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "golang.org/x/xerrors" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - verifreg4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/verifreg" adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt" - verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state4)(nil) @@ -120,6 +119,12 @@ func (s *state4) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e } +func (s *state4) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + return nil, xerrors.Errorf("unsupported in actors v4") + +} + func (s *state4) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v5.go b/chain/actors/builtin/verifreg/v5.go index 45062e8119..17901dd23a 100644 --- a/chain/actors/builtin/verifreg/v5.go +++ b/chain/actors/builtin/verifreg/v5.go @@ -2,22 +2,21 @@ 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" + verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" - "github.com/ipfs/go-cid" - - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "golang.org/x/xerrors" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - verifreg5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/verifreg" adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt" - verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state5)(nil) @@ -120,6 +119,12 @@ func (s *state5) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e } +func (s *state5) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + return nil, xerrors.Errorf("unsupported in actors v5") + +} + func (s *state5) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v6.go b/chain/actors/builtin/verifreg/v6.go index d2ac24e890..68fac64cb4 100644 --- a/chain/actors/builtin/verifreg/v6.go +++ b/chain/actors/builtin/verifreg/v6.go @@ -2,22 +2,21 @@ 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" + verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" - "github.com/ipfs/go-cid" - - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "golang.org/x/xerrors" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - verifreg6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/verifreg" adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt" - verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state6)(nil) @@ -120,6 +119,12 @@ func (s *state6) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e } +func (s *state6) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + return nil, xerrors.Errorf("unsupported in actors v6") + +} + func (s *state6) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v7.go b/chain/actors/builtin/verifreg/v7.go index 7e7df7642a..e8f3ac7398 100644 --- a/chain/actors/builtin/verifreg/v7.go +++ b/chain/actors/builtin/verifreg/v7.go @@ -2,22 +2,21 @@ 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" + verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/manifest" - "github.com/ipfs/go-cid" - - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" - "golang.org/x/xerrors" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - verifreg7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/verifreg" adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt" - verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state7)(nil) @@ -119,6 +118,12 @@ func (s *state7) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e } +func (s *state7) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + return nil, xerrors.Errorf("unsupported in actors v7") + +} + func (s *state7) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v8.go b/chain/actors/builtin/verifreg/v8.go index 27beab3f1f..89393c4d9c 100644 --- a/chain/actors/builtin/verifreg/v8.go +++ b/chain/actors/builtin/verifreg/v8.go @@ -2,21 +2,21 @@ package verifreg import ( "fmt" - "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/manifest" - "github.com/ipfs/go-cid" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" + "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" builtin8 "github.com/filecoin-project/go-state-types/builtin" adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" verifreg8 "github.com/filecoin-project/go-state-types/builtin/v8/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 = (*state8)(nil) @@ -118,6 +118,12 @@ func (s *state8) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e } +func (s *state8) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + return nil, xerrors.Errorf("unsupported in actors v8") + +} + func (s *state8) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/v9.go b/chain/actors/builtin/verifreg/v9.go index 0c1d829800..ce63c7f94b 100644 --- a/chain/actors/builtin/verifreg/v9.go +++ b/chain/actors/builtin/verifreg/v9.go @@ -2,21 +2,21 @@ package verifreg import ( "fmt" - "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/manifest" - "github.com/ipfs/go-cid" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/actors/adt" + "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" builtin9 "github.com/filecoin-project/go-state-types/builtin" adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt" verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" + "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/adt" ) var _ State = (*state9)(nil) @@ -133,6 +133,24 @@ func (s *state9) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e } +func (s *state9) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) { + + v9Map, err := s.LoadClaimsToMap(s.store, providerIdAddr) + + retMap := make(map[abi.SectorNumber][]ClaimId) + for k, v := range v9Map { + 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 *state9) ActorKey() string { return manifest.VerifregKey } diff --git a/chain/actors/builtin/verifreg/verifreg.go b/chain/actors/builtin/verifreg/verifreg.go index e24a2ac4d6..8e025b242d 100644 --- a/chain/actors/builtin/verifreg/verifreg.go +++ b/chain/actors/builtin/verifreg/verifreg.go @@ -1,33 +1,24 @@ package verifreg import ( - actorstypes "github.com/filecoin-project/go-state-types/actors" - "github.com/filecoin-project/go-state-types/manifest" "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" + builtin10 "github.com/filecoin-project/go-state-types/builtin" + verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/cbor" - + "github.com/filecoin-project/go-state-types/manifest" builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - builtin10 "github.com/filecoin-project/go-state-types/builtin" - - verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" @@ -140,6 +131,7 @@ type State interface { GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) GetClaim(providerIdAddr address.Address, claimId ClaimId) (*Claim, bool, error) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) + GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) GetState() interface{} } diff --git a/chain/actors/policy/policy.go b/chain/actors/policy/policy.go index 00e9fe0665..eff7ba8998 100644 --- a/chain/actors/policy/policy.go +++ b/chain/actors/policy/policy.go @@ -1,72 +1,53 @@ package policy import ( - actorstypes "github.com/filecoin-project/go-state-types/actors" - - "github.com/filecoin-project/go-state-types/big" "golang.org/x/xerrors" "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" + builtin10 "github.com/filecoin-project/go-state-types/builtin" + builtin8 "github.com/filecoin-project/go-state-types/builtin" + builtin9 "github.com/filecoin-project/go-state-types/builtin" + market10 "github.com/filecoin-project/go-state-types/builtin/v10/market" + miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" + paych10 "github.com/filecoin-project/go-state-types/builtin/v10/paych" + verifreg10 "github.com/filecoin-project/go-state-types/builtin/v10/verifreg" + market8 "github.com/filecoin-project/go-state-types/builtin/v8/market" + miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner" + verifreg8 "github.com/filecoin-project/go-state-types/builtin/v8/verifreg" + market9 "github.com/filecoin-project/go-state-types/builtin/v9/market" + miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" + verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/network" - market0 "github.com/filecoin-project/specs-actors/actors/builtin/market" miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner" - verifreg0 "github.com/filecoin-project/specs-actors/actors/builtin/verifreg" - power0 "github.com/filecoin-project/specs-actors/actors/builtin/power" - + verifreg0 "github.com/filecoin-project/specs-actors/actors/builtin/verifreg" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" verifreg2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/verifreg" - builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" - market3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/market" miner3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/miner" verifreg3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/verifreg" - builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" - market4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/market" miner4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/miner" verifreg4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/verifreg" - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - market5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/market" miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner" verifreg5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/verifreg" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - market6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/market" miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner" verifreg6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/verifreg" - builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin" - market7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/market" miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner" verifreg7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/verifreg" - - builtin8 "github.com/filecoin-project/go-state-types/builtin" - market8 "github.com/filecoin-project/go-state-types/builtin/v8/market" - miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner" - verifreg8 "github.com/filecoin-project/go-state-types/builtin/v8/verifreg" - - builtin9 "github.com/filecoin-project/go-state-types/builtin" - market9 "github.com/filecoin-project/go-state-types/builtin/v9/market" - miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" - verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" - - builtin10 "github.com/filecoin-project/go-state-types/builtin" - market10 "github.com/filecoin-project/go-state-types/builtin/v10/market" - miner10 "github.com/filecoin-project/go-state-types/builtin/v10/miner" - verifreg10 "github.com/filecoin-project/go-state-types/builtin/v10/verifreg" - - paych10 "github.com/filecoin-project/go-state-types/builtin/v10/paych" ) const ( diff --git a/chain/badtscache.go b/chain/badtscache.go index 19b79bb9be..0f215dcdc2 100644 --- a/chain/badtscache.go +++ b/chain/badtscache.go @@ -3,14 +3,14 @@ package chain import ( "fmt" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "github.com/ipfs/go-cid" "github.com/filecoin-project/lotus/build" ) type BadBlockCache struct { - badBlocks *lru.ARCCache + badBlocks *lru.ARCCache[cid.Cid, BadBlockReason] } type BadBlockReason struct { @@ -43,7 +43,7 @@ func (bbr BadBlockReason) String() string { } func NewBadBlockCache() *BadBlockCache { - cache, err := lru.NewARC(build.BadBlockCacheSize) + cache, err := lru.NewARC[cid.Cid, BadBlockReason](build.BadBlockCacheSize) if err != nil { panic(err) // ok } @@ -66,10 +66,5 @@ func (bts *BadBlockCache) Purge() { } func (bts *BadBlockCache) Has(c cid.Cid) (BadBlockReason, bool) { - rval, ok := bts.badBlocks.Get(c) - if !ok { - return BadBlockReason{}, false - } - - return rval.(BadBlockReason), true + return bts.badBlocks.Get(c) } diff --git a/chain/beacon/drand/drand.go b/chain/beacon/drand/drand.go index 181fa30467..9b62a79287 100644 --- a/chain/beacon/drand/drand.go +++ b/chain/beacon/drand/drand.go @@ -8,14 +8,14 @@ import ( dchain "github.com/drand/drand/chain" dclient "github.com/drand/drand/client" hclient "github.com/drand/drand/client/http" + "github.com/drand/drand/common/scheme" dlog "github.com/drand/drand/log" gclient "github.com/drand/drand/lp2p/client" "github.com/drand/kyber" - kzap "github.com/go-kit/kit/log/zap" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" logging "github.com/ipfs/go-log/v2" pubsub "github.com/libp2p/go-libp2p-pubsub" - "go.uber.org/zap/zapcore" + "go.uber.org/zap" "golang.org/x/xerrors" "github.com/filecoin-project/go-state-types/abi" @@ -61,7 +61,7 @@ type DrandBeacon struct { filGenTime uint64 filRoundTime uint64 - localCache *lru.Cache + localCache *lru.Cache[uint64, *types.BeaconEntry] } // DrandHTTPClient interface overrides the user agent used by drand @@ -69,6 +69,18 @@ type DrandHTTPClient interface { SetUserAgent(string) } +type logger struct { + *zap.SugaredLogger +} + +func (l *logger) With(args ...interface{}) dlog.Logger { + return &logger{l.SugaredLogger.With(args...)} +} + +func (l *logger) Named(s string) dlog.Logger { + return &logger{l.SugaredLogger.Named(s)} +} + func NewDrandBeacon(genesisTs, interval uint64, ps *pubsub.PubSub, config dtypes.DrandConfig) (*DrandBeacon, error) { if genesisTs == 0 { panic("what are you doing this cant be zero") @@ -79,9 +91,6 @@ func NewDrandBeacon(genesisTs, interval uint64, ps *pubsub.PubSub, config dtypes return nil, xerrors.Errorf("unable to unmarshal drand chain info: %w", err) } - dlogger := dlog.NewKitLoggerFrom(kzap.NewZapSugarLogger( - log.SugaredLogger.Desugar(), zapcore.InfoLevel)) - var clients []dclient.Client for _, url := range config.Servers { hc, err := hclient.NewWithInfo(url, drandChain, nil) @@ -96,7 +105,7 @@ func NewDrandBeacon(genesisTs, interval uint64, ps *pubsub.PubSub, config dtypes opts := []dclient.Option{ dclient.WithChainInfo(drandChain), dclient.WithCacheSize(1024), - dclient.WithLogger(dlogger), + dclient.WithLogger(&logger{&log.SugaredLogger}), } if ps != nil { @@ -110,7 +119,7 @@ func NewDrandBeacon(genesisTs, interval uint64, ps *pubsub.PubSub, config dtypes return nil, xerrors.Errorf("creating drand client: %w", err) } - lc, err := lru.New(1024) + lc, err := lru.New[uint64, *types.BeaconEntry](1024) if err != nil { return nil, err } @@ -160,16 +169,12 @@ func (db *DrandBeacon) Entry(ctx context.Context, round uint64) <-chan beacon.Re return out } func (db *DrandBeacon) cacheValue(e types.BeaconEntry) { - db.localCache.Add(e.Round, e) + db.localCache.Add(e.Round, &e) } func (db *DrandBeacon) getCachedValue(round uint64) *types.BeaconEntry { - v, ok := db.localCache.Get(round) - if !ok { - return nil - } - e, _ := v.(types.BeaconEntry) - return &e + v, _ := db.localCache.Get(round) + return v } func (db *DrandBeacon) VerifyEntry(curr types.BeaconEntry, prev types.BeaconEntry) error { @@ -194,7 +199,7 @@ func (db *DrandBeacon) VerifyEntry(curr types.BeaconEntry, prev types.BeaconEntr Round: curr.Round, Signature: curr.Data, } - err := dchain.VerifyBeacon(db.pubkey, b) + err := dchain.NewVerifier(scheme.GetSchemeFromEnv()).VerifyBeacon(*b, db.pubkey) if err == nil { db.cacheValue(curr) } diff --git a/chain/beacon/drand/drand_test.go b/chain/beacon/drand/drand_test.go index e2819f4e9c..7269139ca7 100644 --- a/chain/beacon/drand/drand_test.go +++ b/chain/beacon/drand/drand_test.go @@ -3,6 +3,7 @@ package drand import ( + "context" "os" "testing" @@ -20,11 +21,11 @@ func TestPrintGroupInfo(t *testing.T) { c, err := hclient.New(server, nil, nil) assert.NoError(t, err) cg := c.(interface { - FetchChainInfo(groupHash []byte) (*dchain.Info, error) + FetchChainInfo(ctx context.Context, groupHash []byte) (*dchain.Info, error) }) - chain, err := cg.FetchChainInfo(nil) + chain, err := cg.FetchChainInfo(context.Background(), nil) assert.NoError(t, err) - err = chain.ToJSON(os.Stdout) + err = chain.ToJSON(os.Stdout, nil) assert.NoError(t, err) } diff --git a/chain/block_receipt_tracker.go b/chain/block_receipt_tracker.go index 58de71e192..9c1e035a27 100644 --- a/chain/block_receipt_tracker.go +++ b/chain/block_receipt_tracker.go @@ -5,7 +5,7 @@ import ( "sync" "time" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "github.com/libp2p/go-libp2p/core/peer" "github.com/filecoin-project/lotus/build" @@ -17,7 +17,7 @@ type blockReceiptTracker struct { // using an LRU cache because i don't want to handle all the edge cases for // manual cleanup and maintenance of a fixed size set - cache *lru.Cache + cache *lru.Cache[types.TipSetKey, *peerSet] } type peerSet struct { @@ -25,7 +25,7 @@ type peerSet struct { } func newBlockReceiptTracker() *blockReceiptTracker { - c, _ := lru.New(512) + c, _ := lru.New[types.TipSetKey, *peerSet](512) return &blockReceiptTracker{ cache: c, } @@ -46,20 +46,18 @@ func (brt *blockReceiptTracker) Add(p peer.ID, ts *types.TipSet) { return } - val.(*peerSet).peers[p] = build.Clock.Now() + val.peers[p] = build.Clock.Now() } func (brt *blockReceiptTracker) GetPeers(ts *types.TipSet) []peer.ID { brt.lk.Lock() defer brt.lk.Unlock() - val, ok := brt.cache.Get(ts.Key()) + ps, ok := brt.cache.Get(ts.Key()) if !ok { return nil } - ps := val.(*peerSet) - out := make([]peer.ID, 0, len(ps.peers)) for p := range ps.peers { out = append(out, p) diff --git a/chain/consensus/compute_state.go b/chain/consensus/compute_state.go index 747992e0a2..e627a62d2a 100644 --- a/chain/consensus/compute_state.go +++ b/chain/consensus/compute_state.go @@ -3,6 +3,7 @@ package consensus import ( "context" "sync/atomic" + "time" "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" @@ -113,6 +114,8 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, return sm.VMConstructor()(ctx, vmopt) } + var cronGas int64 + runCron := func(vmCron vm.Interface, epoch abi.ChainEpoch) error { cronMsg := &types.Message{ To: cron.Address, @@ -130,6 +133,8 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, return xerrors.Errorf("running cron: %w", err) } + cronGas += ret.GasUsed + if em != nil { if err := em.MessageApplied(ctx, ts, cronMsg.Cid(), cronMsg, ret, true); err != nil { return xerrors.Errorf("callback failed on cron message: %w", err) @@ -181,7 +186,9 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, } } - partDone() + vmEarly := partDone() + earlyCronGas := cronGas + cronGas = 0 partDone = metrics.Timer(ctx, metrics.VMApplyMessages) vmi, err := makeVm(pstate, epoch, ts.MinTimestamp()) @@ -196,6 +203,8 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, processedMsgs = make(map[cid.Cid]struct{}) ) + var msgGas int64 + for _, b := range bms { penalty := types.NewInt(0) gasReward := big.Zero() @@ -210,6 +219,8 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, return cid.Undef, cid.Undef, err } + msgGas += r.GasUsed + receipts = append(receipts, &r.MessageReceipt) gasReward = big.Add(gasReward, r.GasCosts.MinerTip) penalty = big.Add(penalty, r.GasCosts.MinerPenalty) @@ -235,18 +246,18 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, } rErr := t.reward(ctx, vmi, em, epoch, ts, params) if rErr != nil { - return cid.Undef, cid.Undef, xerrors.Errorf("error applying reward: %w", err) + return cid.Undef, cid.Undef, xerrors.Errorf("error applying reward: %w", rErr) } } - partDone() + vmMsg := partDone() partDone = metrics.Timer(ctx, metrics.VMApplyCron) if err := runCron(vmi, epoch); err != nil { return cid.Cid{}, cid.Cid{}, err } - partDone() + vmCron := partDone() partDone = metrics.Timer(ctx, metrics.VMApplyFlush) rectarr := blockadt.MakeEmptyArray(sm.ChainStore().ActorStore(ctx)) @@ -282,6 +293,11 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, return cid.Undef, cid.Undef, xerrors.Errorf("vm flush failed: %w", err) } + vmFlush := partDone() + partDone = func() time.Duration { return time.Duration(0) } + + log.Infow("ApplyBlocks stats", "early", vmEarly, "earlyCronGas", earlyCronGas, "vmMsg", vmMsg, "msgGas", msgGas, "vmCron", vmCron, "cronGas", cronGas, "vmFlush", vmFlush, "epoch", epoch, "tsk", ts.Key()) + stats.Record(ctx, metrics.VMSends.M(int64(atomic.LoadUint64(&vm.StatSends))), metrics.VMApplied.M(int64(atomic.LoadUint64(&vm.StatApplied)))) @@ -308,6 +324,14 @@ func (t *TipSetExecutor) ExecuteTipSet(ctx context.Context, } } + if ts.Height() == 0 { + // NB: This is here because the process that executes blocks requires that the + // block miner reference a valid miner in the state tree. Unless we create some + // magical genesis miner, this won't work properly, so we short circuit here + // This avoids the question of 'who gets paid the genesis block reward' + return blks[0].ParentStateRoot, blks[0].ParentMessageReceipts, nil + } + var parentEpoch abi.ChainEpoch pstate := blks[0].ParentStateRoot if blks[0].Height > 0 { diff --git a/chain/consensus/filcns/upgrades.go b/chain/consensus/filcns/upgrades.go index 5a268c8a69..34fbdf0f29 100644 --- a/chain/consensus/filcns/upgrades.go +++ b/chain/consensus/filcns/upgrades.go @@ -240,8 +240,8 @@ func DefaultUpgradeSchedule() stmgr.UpgradeSchedule { Migration: UpgradeActorsV10, PreMigrations: []stmgr.PreMigration{{ PreMigration: PreUpgradeActorsV10, - StartWithin: 180, - DontStartWithin: 60, + StartWithin: 60, + DontStartWithin: 10, StopWithin: 5, }}, Expensive: true, @@ -517,12 +517,11 @@ func UpgradeFaucetBurnRecovery(ctx context.Context, sm *stmgr.StateManager, _ st MessageReceipt: *stmgr.MakeFakeRct(), ActorErr: nil, ExecutionTrace: types.ExecutionTrace{ - Msg: fakeMsg, - MsgRct: stmgr.MakeFakeRct(), - Error: "", - Duration: 0, - GasCharges: nil, - Subcalls: subcalls, + Msg: types.MessageTrace{ + To: fakeMsg.To, + From: fakeMsg.From, + }, + Subcalls: subcalls, }, Duration: 0, GasCosts: nil, @@ -695,12 +694,11 @@ func splitGenesisMultisig0(ctx context.Context, em stmgr.ExecMonitor, addr addre MessageReceipt: *stmgr.MakeFakeRct(), ActorErr: nil, ExecutionTrace: types.ExecutionTrace{ - Msg: fakeMsg, - MsgRct: stmgr.MakeFakeRct(), - Error: "", - Duration: 0, - GasCharges: nil, - Subcalls: subcalls, + Msg: types.MessageTrace{ + From: fakeMsg.From, + To: fakeMsg.To, + }, + Subcalls: subcalls, }, Duration: 0, GasCosts: nil, diff --git a/chain/consensus/mir/cbor_gen.go b/chain/consensus/mir/cbor_gen.go index 8a2726d4e1..1ccf995474 100644 --- a/chain/consensus/mir/cbor_gen.go +++ b/chain/consensus/mir/cbor_gen.go @@ -8,10 +8,11 @@ import ( "math" "sort" - abi "github.com/filecoin-project/go-state-types/abi" cid "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" + + abi "github.com/filecoin-project/go-state-types/abi" ) var _ = xerrors.Errorf @@ -111,7 +112,7 @@ func (t *Checkpoint) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -247,7 +248,7 @@ func (t *ParentMeta) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: diff --git a/chain/consensus/mir/conf_manager.go b/chain/consensus/mir/conf_manager.go index 0af0ad9b0c..171bf095bc 100644 --- a/chain/consensus/mir/conf_manager.go +++ b/chain/consensus/mir/conf_manager.go @@ -11,10 +11,11 @@ import ( "github.com/ipfs/go-datastore" "google.golang.org/protobuf/proto" - "github.com/filecoin-project/lotus/chain/consensus/mir/db" "github.com/filecoin-project/mir/pkg/client" mirproto "github.com/filecoin-project/mir/pkg/pb/requestpb" t "github.com/filecoin-project/mir/pkg/types" + + "github.com/filecoin-project/lotus/chain/consensus/mir/db" ) const ( diff --git a/chain/consensus/mir/conf_manager_test.go b/chain/consensus/mir/conf_manager_test.go index 39101143d4..8c6c9d17d2 100644 --- a/chain/consensus/mir/conf_manager_test.go +++ b/chain/consensus/mir/conf_manager_test.go @@ -10,9 +10,10 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - mirkv "github.com/filecoin-project/lotus/chain/consensus/mir/db/kv" "github.com/filecoin-project/mir/pkg/pb/requestpb" "github.com/filecoin-project/mir/pkg/types" + + mirkv "github.com/filecoin-project/lotus/chain/consensus/mir/db/kv" ) func TestRestoreConfigurationVotes(t *testing.T) { diff --git a/chain/consensus/mir/config.go b/chain/consensus/mir/config.go index 502e898472..d8eedbf50c 100644 --- a/chain/consensus/mir/config.go +++ b/chain/consensus/mir/config.go @@ -6,9 +6,9 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/chain/consensus/mir/membership" "github.com/filecoin-project/mir/pkg/checkpoint" + "github.com/filecoin-project/lotus/chain/consensus/mir/membership" "github.com/filecoin-project/lotus/chain/ipcagent/rpc" ) diff --git a/chain/consensus/mir/config_test.go b/chain/consensus/mir/config_test.go index 941e56719a..74860f0484 100644 --- a/chain/consensus/mir/config_test.go +++ b/chain/consensus/mir/config_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/lotus/chain/consensus/mir/membership" ) diff --git a/chain/consensus/mir/manager.go b/chain/consensus/mir/manager.go index babc3b3d4e..b2f7d7bed1 100644 --- a/chain/consensus/mir/manager.go +++ b/chain/consensus/mir/manager.go @@ -10,9 +10,8 @@ import ( "path" "time" - "golang.org/x/xerrors" - "github.com/consensus-shipyard/go-ipc-types/validator" + "golang.org/x/xerrors" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/mir" diff --git a/chain/consensus/mir/membership/membership.go b/chain/consensus/mir/membership/membership.go index 71824d36d3..352d112dfa 100644 --- a/chain/consensus/mir/membership/membership.go +++ b/chain/consensus/mir/membership/membership.go @@ -4,10 +4,9 @@ import ( "fmt" "strings" - "github.com/multiformats/go-multiaddr" - "github.com/consensus-shipyard/go-ipc-types/sdk" "github.com/consensus-shipyard/go-ipc-types/validator" + "github.com/multiformats/go-multiaddr" t "github.com/filecoin-project/mir/pkg/types" diff --git a/chain/consensus/mir/membership/membership_test.go b/chain/consensus/mir/membership/membership_test.go index 46fc1977b6..c8ee9b0745 100644 --- a/chain/consensus/mir/membership/membership_test.go +++ b/chain/consensus/mir/membership/membership_test.go @@ -4,9 +4,8 @@ import ( "os" "testing" - "github.com/stretchr/testify/require" - "github.com/consensus-shipyard/go-ipc-types/validator" + "github.com/stretchr/testify/require" ) func TestMembership(t *testing.T) { diff --git a/chain/consensus/mir/state_manager.go b/chain/consensus/mir/state_manager.go index cd012eb10a..b742202cd5 100644 --- a/chain/consensus/mir/state_manager.go +++ b/chain/consensus/mir/state_manager.go @@ -7,15 +7,13 @@ import ( "path" "time" + "github.com/consensus-shipyard/go-ipc-types/validator" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/libp2p/go-libp2p/core/peer" "golang.org/x/xerrors" - "github.com/consensus-shipyard/go-ipc-types/validator" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/mir/pkg/checkpoint" "github.com/filecoin-project/mir/pkg/pb/requestpb" "github.com/filecoin-project/mir/pkg/systems/trantor" diff --git a/chain/events/message_cache.go b/chain/events/message_cache.go index 81b79cb383..d47d3a168e 100644 --- a/chain/events/message_cache.go +++ b/chain/events/message_cache.go @@ -4,7 +4,7 @@ import ( "context" "sync" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "github.com/ipfs/go-cid" "github.com/filecoin-project/lotus/api" @@ -14,14 +14,14 @@ type messageCache struct { api EventAPI blockMsgLk sync.Mutex - blockMsgCache *lru.ARCCache + blockMsgCache *lru.ARCCache[cid.Cid, *api.BlockMessages] } -func newMessageCache(api EventAPI) *messageCache { - blsMsgCache, _ := lru.NewARC(500) +func newMessageCache(a EventAPI) *messageCache { + blsMsgCache, _ := lru.NewARC[cid.Cid, *api.BlockMessages](500) return &messageCache{ - api: api, + api: a, blockMsgCache: blsMsgCache, } } @@ -30,14 +30,14 @@ func (c *messageCache) ChainGetBlockMessages(ctx context.Context, blkCid cid.Cid c.blockMsgLk.Lock() defer c.blockMsgLk.Unlock() - msgsI, ok := c.blockMsgCache.Get(blkCid) + msgs, ok := c.blockMsgCache.Get(blkCid) var err error if !ok { - msgsI, err = c.api.ChainGetBlockMessages(ctx, blkCid) + msgs, err = c.api.ChainGetBlockMessages(ctx, blkCid) if err != nil { return nil, err } - c.blockMsgCache.Add(blkCid, msgsI) + c.blockMsgCache.Add(blkCid, msgs) } - return msgsI.(*api.BlockMessages), nil + return msgs, nil } diff --git a/chain/exchange/cbor_gen.go b/chain/exchange/cbor_gen.go index 9c7f68ab8e..d1eb271e99 100644 --- a/chain/exchange/cbor_gen.go +++ b/chain/exchange/cbor_gen.go @@ -8,10 +8,11 @@ import ( "math" "sort" - types "github.com/filecoin-project/lotus/chain/types" cid "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" + + types "github.com/filecoin-project/lotus/chain/types" ) var _ = xerrors.Errorf diff --git a/chain/gen/gen.go b/chain/gen/gen.go index 35e4107b5f..8cc98d0dbd 100644 --- a/chain/gen/gen.go +++ b/chain/gen/gen.go @@ -5,7 +5,7 @@ import ( "context" "fmt" "io" - "io/ioutil" + "os" "sync/atomic" "time" @@ -167,7 +167,7 @@ func NewGeneratorWithSectorsAndUpgradeSchedule(numSectors int, us stmgr.UpgradeS maddr1 := genesis2.MinerAddress(0) - m1temp, err := ioutil.TempDir("", "preseal") + m1temp, err := os.MkdirTemp("", "preseal") if err != nil { return nil, err } @@ -179,7 +179,7 @@ func NewGeneratorWithSectorsAndUpgradeSchedule(numSectors int, us stmgr.UpgradeS maddr2 := genesis2.MinerAddress(1) - m2temp, err := ioutil.TempDir("", "preseal") + m2temp, err := os.MkdirTemp("", "preseal") if err != nil { return nil, err } @@ -256,7 +256,7 @@ func NewGeneratorWithSectorsAndUpgradeSchedule(numSectors int, us stmgr.UpgradeS //return nil, xerrors.Errorf("creating drand beacon: %w", err) //} - sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), sys, us, beac) + sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), sys, us, beac, ds) if err != nil { return nil, xerrors.Errorf("initing stmgr: %w", err) } diff --git a/chain/ipcagent/rpc/rpc_test.go b/chain/ipcagent/rpc/rpc_test.go index 9e0307ea7d..2971f9b7e2 100644 --- a/chain/ipcagent/rpc/rpc_test.go +++ b/chain/ipcagent/rpc/rpc_test.go @@ -7,11 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/consensus-shipyard/go-ipc-types/validator" "github.com/gorilla/rpc/v2" "github.com/gorilla/rpc/v2/json2" "github.com/stretchr/testify/require" - - "github.com/consensus-shipyard/go-ipc-types/validator" ) type TestService struct{} diff --git a/chain/messagepool/config.go b/chain/messagepool/config.go index 5b7e2c5905..72b7d9567b 100644 --- a/chain/messagepool/config.go +++ b/chain/messagepool/config.go @@ -13,7 +13,11 @@ import ( ) var ( - ReplaceByFeeRatioDefault = 1.25 + ReplaceByFeePercentageMinimum types.Percent = 110 + ReplaceByFeePercentageDefault types.Percent = 125 +) + +var ( MemPoolSizeLimitHiDefault = 30000 MemPoolSizeLimitLoDefault = 20000 PruneCooldownDefault = time.Minute @@ -60,9 +64,9 @@ func (mp *MessagePool) getConfig() *types.MpoolConfig { } func validateConfg(cfg *types.MpoolConfig) error { - if cfg.ReplaceByFeeRatio < ReplaceByFeeRatioDefault { - return fmt.Errorf("'ReplaceByFeeRatio' is less than required %f < %f", - cfg.ReplaceByFeeRatio, ReplaceByFeeRatioDefault) + if cfg.ReplaceByFeeRatio < ReplaceByFeePercentageMinimum { + return fmt.Errorf("'ReplaceByFeeRatio' is less than required %s < %s", + cfg.ReplaceByFeeRatio, ReplaceByFeePercentageMinimum) } if cfg.GasLimitOverestimation < 1 { return fmt.Errorf("'GasLimitOverestimation' cannot be less than 1") @@ -91,7 +95,7 @@ func DefaultConfig() *types.MpoolConfig { return &types.MpoolConfig{ SizeLimitHigh: MemPoolSizeLimitHiDefault, SizeLimitLow: MemPoolSizeLimitLoDefault, - ReplaceByFeeRatio: ReplaceByFeeRatioDefault, + ReplaceByFeeRatio: ReplaceByFeePercentageDefault, PruneCooldown: PruneCooldownDefault, GasLimitOverestimation: GasLimitOverestimation, } diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 9abe38648c..0d787bd50e 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -12,7 +12,7 @@ import ( "time" "github.com/hashicorp/go-multierror" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" @@ -47,10 +47,8 @@ var log = logging.Logger("messagepool") var futureDebug = false -var rbfNumBig = types.NewInt(uint64((ReplaceByFeeRatioDefault - 1) * RbfDenom)) -var rbfDenomBig = types.NewInt(RbfDenom) - -const RbfDenom = 256 +var rbfNumBig = types.NewInt(uint64(ReplaceByFeePercentageMinimum)) +var rbfDenomBig = types.NewInt(100) var RepublishInterval = time.Duration(10*build.BlockDelaySecs+build.PropagationDelaySecs) * time.Second @@ -161,7 +159,7 @@ type MessagePool struct { // pruneCooldown is a channel used to allow a cooldown time between prunes pruneCooldown chan struct{} - blsSigCache *lru.TwoQueueCache + blsSigCache *lru.TwoQueueCache[cid.Cid, crypto.Signature] changes *lps.PubSub @@ -169,9 +167,9 @@ type MessagePool struct { netName dtypes.NetworkName - sigValCache *lru.TwoQueueCache + sigValCache *lru.TwoQueueCache[string, struct{}] - nonceCache *lru.Cache + nonceCache *lru.Cache[nonceCacheKey, uint64] evtTypes [3]journal.EventType journal journal.Journal @@ -197,7 +195,13 @@ func newMsgSet(nonce uint64) *msgSet { } func ComputeMinRBF(curPrem abi.TokenAmount) abi.TokenAmount { - minPrice := types.BigAdd(curPrem, types.BigDiv(types.BigMul(curPrem, rbfNumBig), rbfDenomBig)) + minPrice := types.BigDiv(types.BigMul(curPrem, rbfNumBig), rbfDenomBig) + return types.BigAdd(minPrice, types.NewInt(1)) +} + +func ComputeRBF(curPrem abi.TokenAmount, replaceByFeeRatio types.Percent) abi.TokenAmount { + rbfNumBig := types.NewInt(uint64(replaceByFeeRatio)) + minPrice := types.BigDiv(types.BigMul(curPrem, rbfNumBig), rbfDenomBig) return types.BigAdd(minPrice, types.NewInt(1)) } @@ -365,9 +369,9 @@ func (ms *msgSet) toSlice() []*types.SignedMessage { } func New(ctx context.Context, api Provider, ds dtypes.MetadataDS, us stmgr.UpgradeSchedule, netName dtypes.NetworkName, j journal.Journal) (*MessagePool, error) { - cache, _ := lru.New2Q(build.BlsSignatureCacheSize) - verifcache, _ := lru.New2Q(build.VerifSigCacheSize) - noncecache, _ := lru.New(256) + cache, _ := lru.New2Q[cid.Cid, crypto.Signature](build.BlsSignatureCacheSize) + verifcache, _ := lru.New2Q[string, struct{}](build.VerifSigCacheSize) + noncecache, _ := lru.New[nonceCacheKey, uint64](256) cfg, err := loadConfig(ctx, ds) if err != nil { @@ -1049,7 +1053,7 @@ func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address, n, ok := mp.nonceCache.Get(nk) if ok { - return n.(uint64), nil + return n, nil } act, err := mp.api.GetActorAfter(addr, ts) @@ -1469,13 +1473,8 @@ func (mp *MessagePool) MessagesForBlocks(ctx context.Context, blks []*types.Bloc } func (mp *MessagePool) RecoverSig(msg *types.Message) *types.SignedMessage { - val, ok := mp.blsSigCache.Get(msg.Cid()) - if !ok { - return nil - } - sig, ok := val.(crypto.Signature) + sig, ok := mp.blsSigCache.Get(msg.Cid()) if !ok { - log.Errorf("value in signature cache was not a signature (got %T)", val) return nil } diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go index ea2758705f..61056528f1 100644 --- a/chain/stmgr/call.go +++ b/chain/stmgr/call.go @@ -31,6 +31,10 @@ var ErrExpensiveFork = errors.New("refusing explicit call due to state fork at e // tipset's parent. In the presence of null blocks, the height at which the message is invoked may // be less than the specified tipset. func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.TipSet) (*api.InvocResult, error) { + // Copy the message as we modify it below. + msgCopy := *msg + msg = &msgCopy + if msg.GasLimit == 0 { msg.GasLimit = build.BlockGasLimit } @@ -48,8 +52,8 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types. } // CallWithGas calculates the state for a given tipset, and then applies the given message on top of that state. -func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, priorMsgs []types.ChainMsg, ts *types.TipSet) (*api.InvocResult, error) { - return sm.callInternal(ctx, msg, priorMsgs, ts, cid.Undef, sm.GetNetworkVersion, true, true) +func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, priorMsgs []types.ChainMsg, ts *types.TipSet, applyTsMessages bool) (*api.InvocResult, error) { + return sm.callInternal(ctx, msg, priorMsgs, ts, cid.Undef, sm.GetNetworkVersion, true, applyTsMessages) } // CallAtStateAndVersion allows you to specify a message to execute on the given stateCid and network version. @@ -113,12 +117,22 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr if stateCid == cid.Undef { stateCid = ts.ParentState() } + tsMsgs, err := sm.cs.MessagesForTipset(ctx, ts) + if err != nil { + return nil, xerrors.Errorf("failed to lookup messages for parent tipset: %w", err) + } + if applyTsMessages { - tsMsgs, err := sm.cs.MessagesForTipset(ctx, ts) - if err != nil { - return nil, xerrors.Errorf("failed to lookup messages for parent tipset: %w", err) - } priorMsgs = append(tsMsgs, priorMsgs...) + } else { + var filteredTsMsgs []types.ChainMsg + for _, tsMsg := range tsMsgs { + //TODO we should technically be normalizing the filecoin address of from when we compare here + if tsMsg.VMMessage().From == msg.VMMessage().From { + filteredTsMsgs = append(filteredTsMsgs, tsMsg) + } + } + priorMsgs = append(filteredTsMsgs, priorMsgs...) } // Technically, the tipset we're passing in here should be ts+1, but that may not exist. diff --git a/chain/stmgr/execute.go b/chain/stmgr/execute.go index 60ee069d04..f85ff7c043 100644 --- a/chain/stmgr/execute.go +++ b/chain/stmgr/execute.go @@ -8,6 +8,7 @@ import ( "go.opencensus.io/trace" "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" ) @@ -56,10 +57,18 @@ func (sm *StateManager) TipSetState(ctx context.Context, ts *types.TipSet) (st c // NB: This is here because the process that executes blocks requires that the // block miner reference a valid miner in the state tree. Unless we create some // magical genesis miner, this won't work properly, so we short circuit here - // This avoids the question of 'who gets paid the genesis block reward' + // This avoids the question of 'who gets paid the genesis block reward'. + // This also makes us not attempt to lookup the tipset state with + // tryLookupTipsetState, which would cause a very long, very slow walk. return ts.Blocks()[0].ParentStateRoot, ts.Blocks()[0].ParentMessageReceipts, nil } + // First, try to find the tipset in the current chain. If found, we can avoid re-executing + // it. + if st, rec, found := tryLookupTipsetState(ctx, sm.cs, ts); found { + return st, rec, nil + } + st, rec, err = sm.tsExec.ExecuteTipSet(ctx, sm, ts, sm.tsExecMonitor, false) if err != nil { return cid.Undef, cid.Undef, err @@ -68,6 +77,51 @@ func (sm *StateManager) TipSetState(ctx context.Context, ts *types.TipSet) (st c return st, rec, nil } +// Try to lookup a state & receipt CID for a given tipset by walking the chain instead of executing +// it. This will only successfully return the state/receipt CIDs if they're found in the state +// store. +// +// NOTE: This _won't_ recursively walk the receipt/state trees. It assumes that having the root +// implies having the rest of the tree. However, lotus generally makes that assumption anyways. +func tryLookupTipsetState(ctx context.Context, cs *store.ChainStore, ts *types.TipSet) (cid.Cid, cid.Cid, bool) { + nextTs, err := cs.GetTipsetByHeight(ctx, ts.Height()+1, nil, false) + if err != nil { + // Nothing to see here. The requested height may be beyond the current head. + return cid.Undef, cid.Undef, false + } + + // Make sure we're on the correct fork. + if nextTs.Parents() != ts.Key() { + // Also nothing to see here. This just means that the requested tipset is on a + // different fork. + return cid.Undef, cid.Undef, false + } + + stateCid := nextTs.ParentState() + receiptCid := nextTs.ParentMessageReceipts() + + // Make sure we have the parent state. + if hasState, err := cs.StateBlockstore().Has(ctx, stateCid); err != nil { + log.Errorw("failed to lookup state-root in blockstore", "cid", stateCid, "error", err) + return cid.Undef, cid.Undef, false + } else if !hasState { + // We have the chain but don't have the state. It looks like we need to try + // executing? + return cid.Undef, cid.Undef, false + } + + // Make sure we have the receipts. + if hasReceipts, err := cs.ChainBlockstore().Has(ctx, receiptCid); err != nil { + log.Errorw("failed to lookup receipts in blockstore", "cid", receiptCid, "error", err) + return cid.Undef, cid.Undef, false + } else if !hasReceipts { + // If we don't have the receipts, re-execute and try again. + return cid.Undef, cid.Undef, false + } + + return stateCid, receiptCid, true +} + func (sm *StateManager) ExecutionTraceWithMonitor(ctx context.Context, ts *types.TipSet, em ExecMonitor) (cid.Cid, error) { st, _, err := sm.tsExec.ExecuteTipSet(ctx, sm, ts, em, true) return st, err diff --git a/chain/stmgr/forks.go b/chain/stmgr/forks.go index 514f78f762..1f9977d961 100644 --- a/chain/stmgr/forks.go +++ b/chain/stmgr/forks.go @@ -4,7 +4,9 @@ import ( "bytes" "context" "encoding/binary" + "os" "sort" + "strings" "sync" "time" @@ -26,6 +28,9 @@ import ( "github.com/filecoin-project/lotus/chain/vm" ) +// EnvDisablePreMigrations when set to '1' stops pre-migrations from running +const EnvDisablePreMigrations = "LOTUS_DISABLE_PRE_MIGRATIONS" + // MigrationCache can be used to cache information used by a migration. This is primarily useful to // "pre-compute" some migration state ahead of time, and make it accessible in the migration itself. type MigrationCache interface { @@ -169,9 +174,16 @@ func (us UpgradeSchedule) GetNtwkVersion(e abi.ChainEpoch) (network.Version, err func (sm *StateManager) HandleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, cb ExecMonitor, ts *types.TipSet) (cid.Cid, error) { retCid := root - var err error u := sm.stateMigrations[height] if u != nil && u.upgrade != nil { + migCid, ok, err := u.migrationResultCache.Get(ctx, root) + if err == nil && ok { + log.Infow("CACHED migration", "height", height, "from", root, "to", migCid) + return migCid, nil + } else if err != nil { + log.Errorw("failed to lookup previous migration result", "err", err) + } + startTime := time.Now() log.Warnw("STARTING migration", "height", height, "from", root) // Yes, we clone the cache, even for the final upgrade epoch. Why? Reverts. We may @@ -192,6 +204,11 @@ func (sm *StateManager) HandleStateForks(ctx context.Context, root cid.Cid, heig "to", retCid, "duration", time.Since(startTime), ) + + // Only set if migration ran, we do not want a root => root mapping + if err := u.migrationResultCache.Store(ctx, root, retCid); err != nil { + log.Errorw("failed to store migration result", "err", err) + } } return retCid, nil @@ -218,6 +235,11 @@ func runPreMigration(ctx context.Context, sm *StateManager, fn PreMigrationFunc, height := ts.Height() parent := ts.ParentState() + if disabled := os.Getenv(EnvDisablePreMigrations); strings.TrimSpace(disabled) == "1" { + log.Warnw("SKIPPING pre-migration", "height", height) + return + } + startTime := time.Now() log.Warn("STARTING pre-migration") @@ -347,12 +369,11 @@ func DoTransfer(tree types.StateTree, from, to address.Address, amt abi.TokenAmo // record the transfer in execution traces cb(types.ExecutionTrace{ - Msg: MakeFakeMsg(from, to, amt, 0), - MsgRct: MakeFakeRct(), - Error: "", - Duration: 0, - GasCharges: nil, - Subcalls: nil, + Msg: types.MessageTrace{ + From: from, + To: to, + Value: amt, + }, }) } diff --git a/chain/stmgr/forks_test.go b/chain/stmgr/forks_test.go index f56fc5ed1e..caf2c22ce1 100644 --- a/chain/stmgr/forks_test.go +++ b/chain/stmgr/forks_test.go @@ -5,10 +5,12 @@ import ( "context" "fmt" "io" + "os" "sync" "testing" "github.com/ipfs/go-cid" + "github.com/ipfs/go-datastore" ipldcbor "github.com/ipfs/go-ipld-cbor" logging "github.com/ipfs/go-log/v2" "github.com/stretchr/testify/require" @@ -34,6 +36,7 @@ import ( "github.com/filecoin-project/lotus/chain/consensus" "github.com/filecoin-project/lotus/chain/consensus/filcns" "github.com/filecoin-project/lotus/chain/gen" + "github.com/filecoin-project/lotus/chain/stmgr" . "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" @@ -165,7 +168,7 @@ func TestForkHeightTriggers(t *testing.T) { } return st.Flush(ctx) - }}}, cg.BeaconSchedule()) + }}}, cg.BeaconSchedule(), datastore.NewMapDatastore()) if err != nil { t.Fatal(err) } @@ -283,7 +286,7 @@ func testForkRefuseCall(t *testing.T, nullsBefore, nullsAfter int) { root cid.Cid, height abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) { migrationCount++ return root, nil - }}}, cg.BeaconSchedule()) + }}}, cg.BeaconSchedule(), datastore.NewMapDatastore()) if err != nil { t.Fatal(err) } @@ -337,7 +340,7 @@ func testForkRefuseCall(t *testing.T, nullsBefore, nullsAfter int) { currentHeight := ts.TipSet.TipSet().Height() // CallWithGas calls on top of the given tipset. - ret, err := sm.CallWithGas(ctx, m, nil, ts.TipSet.TipSet()) + ret, err := sm.CallWithGas(ctx, m, nil, ts.TipSet.TipSet(), true) if parentHeight <= testForkHeight && currentHeight >= testForkHeight { // If I had a fork, or I _will_ have a fork, it should fail. require.Equal(t, ErrExpensiveFork, err) @@ -358,7 +361,7 @@ func testForkRefuseCall(t *testing.T, nullsBefore, nullsAfter int) { // Calls without a tipset should walk back to the last non-fork tipset. // We _verify_ that the migration wasn't run multiple times at the end of the // test. - ret, err = sm.CallWithGas(ctx, m, nil, nil) + ret, err = sm.CallWithGas(ctx, m, nil, nil, true) require.NoError(t, err) require.True(t, ret.MsgRct.ExitCode.IsSuccess()) @@ -501,7 +504,7 @@ func TestForkPreMigration(t *testing.T) { return nil }, }}}, - }, cg.BeaconSchedule()) + }, cg.BeaconSchedule(), datastore.NewMapDatastore()) if err != nil { t.Fatal(err) } @@ -535,3 +538,170 @@ func TestForkPreMigration(t *testing.T) { // to this channel. require.Equal(t, 6, len(counter)) } + +func TestDisablePreMigration(t *testing.T) { + logging.SetAllLoggers(logging.LevelInfo) + + cg, err := gen.NewGenerator() + require.NoError(t, err) + + err = os.Setenv(EnvDisablePreMigrations, "1") + require.NoError(t, err) + + defer func() { + err := os.Unsetenv(EnvDisablePreMigrations) + require.NoError(t, err) + }() + + counter := make(chan struct{}, 10) + + sm, err := NewStateManager( + cg.ChainStore(), + consensus.NewTipSetExecutor(filcns.RewardFunc), + cg.StateManager().VMSys(), + UpgradeSchedule{{ + Network: network.Version1, + Height: testForkHeight, + Migration: func(_ context.Context, _ *StateManager, _ MigrationCache, _ ExecMonitor, + root cid.Cid, _ abi.ChainEpoch, _ *types.TipSet) (cid.Cid, error) { + + counter <- struct{}{} + + return root, nil + }, + PreMigrations: []PreMigration{{ + StartWithin: 20, + PreMigration: func(ctx context.Context, _ *StateManager, _ MigrationCache, + _ cid.Cid, _ abi.ChainEpoch, _ *types.TipSet) error { + panic("should be skipped") + }, + }}}, + }, + cg.BeaconSchedule(), + datastore.NewMapDatastore(), + ) + require.NoError(t, err) + require.NoError(t, sm.Start(context.Background())) + defer func() { + require.NoError(t, sm.Stop(context.Background())) + }() + + inv := consensus.NewActorRegistry() + registry := builtin.MakeRegistryLegacy([]rtt.VMActor{testActor{}}) + inv.Register(actorstypes.Version0, nil, registry) + + sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (vm.Interface, error) { + nvm, err := vm.NewLegacyVM(ctx, vmopt) + require.NoError(t, err) + nvm.SetInvoker(inv) + return nvm, nil + }) + + cg.SetStateManager(sm) + + for i := 0; i < 50; i++ { + _, err := cg.NextTipSet() + require.NoError(t, err) + } + + require.Equal(t, 1, len(counter)) +} + +func TestMigrtionCache(t *testing.T) { + logging.SetAllLoggers(logging.LevelInfo) + + cg, err := gen.NewGenerator() + require.NoError(t, err) + + counter := make(chan struct{}, 10) + metadataDs := datastore.NewMapDatastore() + + sm, err := NewStateManager( + cg.ChainStore(), + consensus.NewTipSetExecutor(filcns.RewardFunc), + cg.StateManager().VMSys(), + UpgradeSchedule{{ + Network: network.Version1, + Height: testForkHeight, + Migration: func(_ context.Context, _ *StateManager, _ MigrationCache, _ ExecMonitor, + root cid.Cid, _ abi.ChainEpoch, _ *types.TipSet) (cid.Cid, error) { + + counter <- struct{}{} + + return root, nil + }}, + }, + cg.BeaconSchedule(), + metadataDs, + ) + require.NoError(t, err) + require.NoError(t, sm.Start(context.Background())) + defer func() { + require.NoError(t, sm.Stop(context.Background())) + }() + + inv := consensus.NewActorRegistry() + registry := builtin.MakeRegistryLegacy([]rtt.VMActor{testActor{}}) + inv.Register(actorstypes.Version0, nil, registry) + + sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (vm.Interface, error) { + nvm, err := vm.NewLegacyVM(ctx, vmopt) + require.NoError(t, err) + nvm.SetInvoker(inv) + return nvm, nil + }) + + cg.SetStateManager(sm) + + for i := 0; i < 50; i++ { + _, err := cg.NextTipSet() + require.NoError(t, err) + } + + ts, err := cg.ChainStore().GetTipsetByHeight(context.Background(), testForkHeight, nil, false) + require.NoError(t, err) + + root, _, err := stmgr.ComputeState(context.Background(), sm, testForkHeight+1, []*types.Message{}, ts) + require.NoError(t, err) + t.Log(root) + + require.Equal(t, 1, len(counter)) + + { + sm, err := NewStateManager( + cg.ChainStore(), + consensus.NewTipSetExecutor(filcns.RewardFunc), + cg.StateManager().VMSys(), + UpgradeSchedule{{ + Network: network.Version1, + Height: testForkHeight, + Migration: func(_ context.Context, _ *StateManager, _ MigrationCache, _ ExecMonitor, + root cid.Cid, _ abi.ChainEpoch, _ *types.TipSet) (cid.Cid, error) { + + counter <- struct{}{} + + return root, nil + }}, + }, + cg.BeaconSchedule(), + metadataDs, + ) + require.NoError(t, err) + sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (vm.Interface, error) { + nvm, err := vm.NewLegacyVM(ctx, vmopt) + require.NoError(t, err) + nvm.SetInvoker(inv) + return nvm, nil + }) + + ctx := context.Background() + + base, _, err := sm.ExecutionTrace(ctx, ts) + require.NoError(t, err) + _, err = sm.HandleStateForks(context.Background(), base, ts.Height(), nil, ts) + require.NoError(t, err) + + // Should not have increased as we should be using the cached results in the metadataDs + require.Equal(t, 1, len(counter)) + } +} diff --git a/chain/stmgr/stmgr.go b/chain/stmgr/stmgr.go index ee9338e63d..575e6ac2e4 100644 --- a/chain/stmgr/stmgr.go +++ b/chain/stmgr/stmgr.go @@ -2,10 +2,13 @@ package stmgr import ( "context" + "fmt" "sync" "github.com/ipfs/go-cid" + dstore "github.com/ipfs/go-datastore" cbor "github.com/ipfs/go-ipld-cbor" + ipld "github.com/ipfs/go-ipld-format" logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" @@ -51,9 +54,47 @@ type versionSpec struct { } type migration struct { - upgrade MigrationFunc - preMigrations []PreMigration - cache *nv16.MemMigrationCache + upgrade MigrationFunc + preMigrations []PreMigration + cache *nv16.MemMigrationCache + migrationResultCache *migrationResultCache +} + +type migrationResultCache struct { + ds dstore.Batching + keyPrefix string +} + +func (m *migrationResultCache) keyForMigration(root cid.Cid) dstore.Key { + kStr := fmt.Sprintf("%s/%s", m.keyPrefix, root) + return dstore.NewKey(kStr) +} + +func (m *migrationResultCache) Get(ctx context.Context, root cid.Cid) (cid.Cid, bool, error) { + k := m.keyForMigration(root) + + bs, err := m.ds.Get(ctx, k) + if ipld.IsNotFound(err) { + return cid.Undef, false, nil + } else if err != nil { + return cid.Undef, false, xerrors.Errorf("error loading migration result: %w", err) + } + + c, err := cid.Parse(bs) + if err != nil { + return cid.Undef, false, xerrors.Errorf("error parsing migration result: %w", err) + } + + return c, true, nil +} + +func (m *migrationResultCache) Store(ctx context.Context, root cid.Cid, resultCid cid.Cid) error { + k := m.keyForMigration(root) + if err := m.ds.Put(ctx, k, resultCid.Bytes()); err != nil { + return err + } + + return nil } type Executor interface { @@ -89,8 +130,7 @@ type StateManager struct { postIgnitionVesting []msig0.State postCalicoVesting []msig0.State - genesisPledge abi.TokenAmount - genesisMarketFunds abi.TokenAmount + genesisPledge abi.TokenAmount tsExec Executor tsExecMonitor ExecMonitor @@ -103,7 +143,7 @@ type treeCache struct { tree *state.StateTree } -func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, us UpgradeSchedule, beacon beacon.Schedule) (*StateManager, error) { +func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, us UpgradeSchedule, beacon beacon.Schedule, metadataDs dstore.Batching) (*StateManager, error) { // If we have upgrades, make sure they're in-order and make sense. if err := us.Validate(); err != nil { return nil, err @@ -122,12 +162,18 @@ func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, upgrade: upgrade.Migration, preMigrations: upgrade.PreMigrations, cache: nv16.NewMemMigrationCache(), + migrationResultCache: &migrationResultCache{ + keyPrefix: fmt.Sprintf("/migration-cache/nv%d", upgrade.Network), + ds: metadataDs, + }, } + stateMigrations[upgrade.Height] = migration } if upgrade.Expensive { expensiveUpgrades[upgrade.Height] = struct{}{} } + networkVersions = append(networkVersions, versionSpec{ networkVersion: lastVersion, atOrBelow: upgrade.Height, @@ -155,8 +201,8 @@ func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, }, nil } -func NewStateManagerWithUpgradeScheduleAndMonitor(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, us UpgradeSchedule, b beacon.Schedule, em ExecMonitor) (*StateManager, error) { - sm, err := NewStateManager(cs, exec, sys, us, b) +func NewStateManagerWithUpgradeScheduleAndMonitor(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, us UpgradeSchedule, b beacon.Schedule, em ExecMonitor, metadataDs dstore.Batching) (*StateManager, error) { + sm, err := NewStateManager(cs, exec, sys, us, b, metadataDs) if err != nil { return nil, err } diff --git a/chain/stmgr/supply.go b/chain/stmgr/supply.go index a48ff36c7f..b48f9af43d 100644 --- a/chain/stmgr/supply.go +++ b/chain/stmgr/supply.go @@ -51,17 +51,13 @@ func (sm *StateManager) setupGenesisVestingSchedule(ctx context.Context) error { return xerrors.Errorf("loading state tree: %w", err) } - gmf, err := getFilMarketLocked(ctx, sTree) - if err != nil { - return xerrors.Errorf("setting up genesis market funds: %w", err) - } - gp, err := getFilPowerLocked(ctx, sTree) if err != nil { return xerrors.Errorf("setting up genesis pledge: %w", err) } - sm.genesisMarketFunds = gmf + sm.genesisMsigLk.Lock() + defer sm.genesisMsigLk.Unlock() sm.genesisPledge = gp totalsByEpoch := make(map[abi.ChainEpoch]abi.TokenAmount) @@ -128,6 +124,8 @@ func (sm *StateManager) setupPostIgnitionVesting(ctx context.Context) error { totalsByEpoch[sixYears] = big.NewInt(100_000_000) totalsByEpoch[sixYears] = big.Add(totalsByEpoch[sixYears], big.NewInt(300_000_000)) + sm.genesisMsigLk.Lock() + defer sm.genesisMsigLk.Unlock() sm.postIgnitionVesting = make([]msig0.State, 0, len(totalsByEpoch)) for k, v := range totalsByEpoch { ns := msig0.State{ @@ -178,6 +176,9 @@ func (sm *StateManager) setupPostCalicoVesting(ctx context.Context) error { totalsByEpoch[sixYears] = big.Add(totalsByEpoch[sixYears], big.NewInt(300_000_000)) totalsByEpoch[sixYears] = big.Add(totalsByEpoch[sixYears], big.NewInt(9_805_053)) + sm.genesisMsigLk.Lock() + defer sm.genesisMsigLk.Unlock() + sm.postCalicoVesting = make([]msig0.State, 0, len(totalsByEpoch)) for k, v := range totalsByEpoch { ns := msig0.State{ @@ -198,21 +199,20 @@ func (sm *StateManager) setupPostCalicoVesting(ctx context.Context) error { func (sm *StateManager) GetFilVested(ctx context.Context, height abi.ChainEpoch) (abi.TokenAmount, error) { vf := big.Zero() - sm.genesisMsigLk.Lock() - defer sm.genesisMsigLk.Unlock() - // TODO: combine all this? - if sm.preIgnitionVesting == nil || sm.genesisPledge.IsZero() || sm.genesisMarketFunds.IsZero() { + if sm.preIgnitionVesting == nil || sm.genesisPledge.IsZero() { err := sm.setupGenesisVestingSchedule(ctx) if err != nil { return vf, xerrors.Errorf("failed to setup pre-ignition vesting schedule: %w", err) } + } if sm.postIgnitionVesting == nil { err := sm.setupPostIgnitionVesting(ctx) if err != nil { return vf, xerrors.Errorf("failed to setup post-ignition vesting schedule: %w", err) } + } if sm.postCalicoVesting == nil { err := sm.setupPostCalicoVesting(ctx) @@ -246,8 +246,6 @@ func (sm *StateManager) GetFilVested(ctx context.Context, height abi.ChainEpoch) if height <= build.UpgradeAssemblyHeight { // continue to use preIgnitionGenInfos, nothing changed at the Ignition epoch vf = big.Add(vf, sm.genesisPledge) - // continue to use preIgnitionGenInfos, nothing changed at the Ignition epoch - vf = big.Add(vf, sm.genesisMarketFunds) } return vf, nil diff --git a/chain/store/index.go b/chain/store/index.go index fe8f399ee2..620cb2deeb 100644 --- a/chain/store/index.go +++ b/chain/store/index.go @@ -4,8 +4,8 @@ import ( "context" "os" "strconv" + "sync" - lru "github.com/hashicorp/golang-lru" "golang.org/x/xerrors" "github.com/filecoin-project/go-state-types/abi" @@ -13,7 +13,7 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -var DefaultChainIndexCacheSize = 32 << 10 +var DefaultChainIndexCacheSize = 32 << 15 func init() { if s := os.Getenv("LOTUS_CHAIN_INDEX_CACHE"); s != "" { @@ -27,7 +27,8 @@ func init() { } type ChainIndex struct { - skipCache *lru.ARCCache + indexCacheLk sync.Mutex + indexCache map[types.TipSetKey]*lbEntry loadTipSet loadTipSetFunc @@ -36,17 +37,14 @@ type ChainIndex struct { type loadTipSetFunc func(context.Context, types.TipSetKey) (*types.TipSet, error) func NewChainIndex(lts loadTipSetFunc) *ChainIndex { - sc, _ := lru.NewARC(DefaultChainIndexCacheSize) return &ChainIndex{ - skipCache: sc, + indexCache: make(map[types.TipSetKey]*lbEntry, DefaultChainIndexCacheSize), loadTipSet: lts, skipLength: 20, } } type lbEntry struct { - ts *types.TipSet - parentHeight abi.ChainEpoch targetHeight abi.ChainEpoch target types.TipSetKey } @@ -58,25 +56,36 @@ func (ci *ChainIndex) GetTipsetByHeight(ctx context.Context, from *types.TipSet, rounded, err := ci.roundDown(ctx, from) if err != nil { - return nil, err + return nil, xerrors.Errorf("failed to round down: %w", err) } + ci.indexCacheLk.Lock() + defer ci.indexCacheLk.Unlock() cur := rounded.Key() for { - cval, ok := ci.skipCache.Get(cur) + lbe, ok := ci.indexCache[cur] if !ok { fc, err := ci.fillCache(ctx, cur) if err != nil { - return nil, err + return nil, xerrors.Errorf("failed to fill cache: %w", err) } - cval = fc + lbe = fc } - lbe := cval.(*lbEntry) - if lbe.ts.Height() == to || lbe.parentHeight < to { - return lbe.ts, nil - } else if to > lbe.targetHeight { - return ci.walkBack(ctx, lbe.ts, to) + if to == lbe.targetHeight { + ts, err := ci.loadTipSet(ctx, lbe.target) + if err != nil { + return nil, xerrors.Errorf("failed to load tipset: %w", err) + } + + return ts, nil + } + if to > lbe.targetHeight { + ts, err := ci.loadTipSet(ctx, cur) + if err != nil { + return nil, xerrors.Errorf("failed to load tipset: %w", err) + } + return ci.walkBack(ctx, ts, to) } cur = lbe.target @@ -87,16 +96,17 @@ func (ci *ChainIndex) GetTipsetByHeightWithoutCache(ctx context.Context, from *t return ci.walkBack(ctx, from, to) } +// Caller must hold indexCacheLk func (ci *ChainIndex) fillCache(ctx context.Context, tsk types.TipSetKey) (*lbEntry, error) { ts, err := ci.loadTipSet(ctx, tsk) if err != nil { - return nil, err + return nil, xerrors.Errorf("failed to load tipset: %w", err) } if ts.Height() == 0 { return &lbEntry{ - ts: ts, - parentHeight: 0, + targetHeight: 0, + target: tsk, }, nil } @@ -124,12 +134,10 @@ func (ci *ChainIndex) fillCache(ctx context.Context, tsk types.TipSetKey) (*lbEn } lbe := &lbEntry{ - ts: ts, - parentHeight: parent.Height(), targetHeight: skipTarget.Height(), target: skipTarget.Key(), } - ci.skipCache.Add(tsk, lbe) + ci.indexCache[tsk] = lbe return lbe, nil } @@ -144,7 +152,7 @@ func (ci *ChainIndex) roundDown(ctx context.Context, ts *types.TipSet) (*types.T rounded, err := ci.walkBack(ctx, ts, target) if err != nil { - return nil, err + return nil, xerrors.Errorf("failed to walk back: %w", err) } return rounded, nil @@ -164,7 +172,7 @@ func (ci *ChainIndex) walkBack(ctx context.Context, from *types.TipSet, to abi.C for { pts, err := ci.loadTipSet(ctx, ts.Parents()) if err != nil { - return nil, err + return nil, xerrors.Errorf("failed to load tipset: %w", err) } if to > pts.Height() { diff --git a/chain/store/messages.go b/chain/store/messages.go index 5ac62d394b..c39cb3f9b9 100644 --- a/chain/store/messages.go +++ b/chain/store/messages.go @@ -207,9 +207,7 @@ type mmCids struct { } func (cs *ChainStore) ReadMsgMetaCids(ctx context.Context, mmc cid.Cid) ([]cid.Cid, []cid.Cid, error) { - o, ok := cs.mmCache.Get(mmc) - if ok { - mmcids := o.(*mmCids) + if mmcids, ok := cs.mmCache.Get(mmc); ok { return mmcids.bls, mmcids.secpk, nil } @@ -229,7 +227,7 @@ func (cs *ChainStore) ReadMsgMetaCids(ctx context.Context, mmc cid.Cid) ([]cid.C return nil, nil, xerrors.Errorf("loading secpk message cids for block: %w", err) } - cs.mmCache.Add(mmc, &mmCids{ + cs.mmCache.Add(mmc, mmCids{ bls: blscids, secpk: secpkcids, }) @@ -237,6 +235,26 @@ func (cs *ChainStore) ReadMsgMetaCids(ctx context.Context, mmc cid.Cid) ([]cid.C return blscids, secpkcids, nil } +func (cs *ChainStore) ReadReceipts(ctx context.Context, root cid.Cid) ([]types.MessageReceipt, error) { + a, err := blockadt.AsArray(cs.ActorStore(ctx), root) + if err != nil { + return nil, err + } + + receipts := make([]types.MessageReceipt, 0, a.Length()) + var rcpt types.MessageReceipt + if err := a.ForEach(&rcpt, func(i int64) error { + if int64(len(receipts)) != i { + return xerrors.Errorf("missing receipt %d", i) + } + receipts = append(receipts, rcpt) + return nil + }); err != nil { + return nil, err + } + return receipts, nil +} + func (cs *ChainStore) MessagesForBlock(ctx context.Context, b *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) { blscids, secpkcids, err := cs.ReadMsgMetaCids(ctx, b.Messages) if err != nil { diff --git a/chain/store/snapshot.go b/chain/store/snapshot.go index 36435152ee..da568d0fba 100644 --- a/chain/store/snapshot.go +++ b/chain/store/snapshot.go @@ -3,7 +3,10 @@ package store import ( "bytes" "context" + "fmt" "io" + "sync" + "time" "github.com/ipfs/go-cid" blocks "github.com/ipfs/go-libipfs/blocks" @@ -12,6 +15,8 @@ import ( carv2 "github.com/ipld/go-car/v2" mh "github.com/multiformats/go-multihash" cbg "github.com/whyrusleeping/cbor-gen" + "go.uber.org/atomic" + "golang.org/x/sync/errgroup" "golang.org/x/xerrors" "github.com/filecoin-project/go-state-types/abi" @@ -132,6 +137,423 @@ func (cs *ChainStore) Import(ctx context.Context, r io.Reader) (*types.TipSet, e return root, nil } +type walkSchedTaskType int + +const ( + finishTask walkSchedTaskType = -1 + blockTask walkSchedTaskType = iota + messageTask + receiptTask + stateTask + dagTask +) + +func (t walkSchedTaskType) String() string { + switch t { + case finishTask: + return "finish" + case blockTask: + return "block" + case messageTask: + return "message" + case receiptTask: + return "receipt" + case stateTask: + return "state" + case dagTask: + return "dag" + } + panic(fmt.Sprintf("unknow task %d", t)) +} + +type walkTask struct { + c cid.Cid + taskType walkSchedTaskType +} + +// an ever growing FIFO +type taskFifo struct { + in chan walkTask + out chan walkTask + fifo []walkTask +} + +type taskResult struct { + c cid.Cid + b blocks.Block +} + +func newTaskFifo(bufferLen int) *taskFifo { + f := taskFifo{ + in: make(chan walkTask, bufferLen), + out: make(chan walkTask, bufferLen), + fifo: make([]walkTask, 0), + } + + go f.run() + + return &f +} + +func (f *taskFifo) Close() error { + close(f.in) + return nil +} + +func (f *taskFifo) run() { + for { + if len(f.fifo) > 0 { + // we have items in slice + // try to put next out or read something in. + // blocks if nothing works. + next := f.fifo[0] + select { + case f.out <- next: + f.fifo = f.fifo[1:] + case elem, ok := <-f.in: + if !ok { + // drain and close out. + for _, elem := range f.fifo { + f.out <- elem + } + close(f.out) + return + } + f.fifo = append(f.fifo, elem) + } + } else { + // no elements in fifo to put out. + // Try to read in and block. + // When done, try to put out or add to fifo. + select { + case elem, ok := <-f.in: + if !ok { + close(f.out) + return + } + select { + case f.out <- elem: + default: + f.fifo = append(f.fifo, elem) + } + } + } + } +} + +type walkSchedulerConfig struct { + numWorkers int + + head *types.TipSet // Tipset to start walking from. + tail *types.TipSet // Tipset to end at. + includeMessages bool + includeReceipts bool + includeState bool +} + +type walkScheduler struct { + ctx context.Context + cancel context.CancelFunc + + store bstore.Blockstore + cfg walkSchedulerConfig + writer io.Writer + + workerTasks *taskFifo + totalTasks atomic.Int64 + results chan taskResult + writeErrorChan chan error + + // tracks number of inflight tasks + //taskWg sync.WaitGroup + // launches workers and collects errors if any occur + workers *errgroup.Group + // set of CIDs already exported + seen sync.Map +} + +func newWalkScheduler(ctx context.Context, store bstore.Blockstore, cfg walkSchedulerConfig, w io.Writer) (*walkScheduler, error) { + ctx, cancel := context.WithCancel(ctx) + workers, ctx := errgroup.WithContext(ctx) + s := &walkScheduler{ + ctx: ctx, + cancel: cancel, + store: store, + cfg: cfg, + writer: w, + results: make(chan taskResult, cfg.numWorkers*64), + workerTasks: newTaskFifo(cfg.numWorkers * 64), + writeErrorChan: make(chan error, 1), + workers: workers, + } + + go func() { + defer close(s.writeErrorChan) + for r := range s.results { + // Write + if err := carutil.LdWrite(s.writer, r.c.Bytes(), r.b.RawData()); err != nil { + // abort operations + cancel() + s.writeErrorChan <- err + } + } + }() + + // workers + for i := 0; i < cfg.numWorkers; i++ { + f := func(n int) func() error { + return func() error { + return s.workerFunc(n) + } + }(i) + s.workers.Go(f) + } + + s.totalTasks.Add(int64(len(cfg.head.Blocks()))) + for _, b := range cfg.head.Blocks() { + select { + case <-ctx.Done(): + log.Errorw("context done while sending root tasks", ctx.Err()) + cancel() // kill workers + return nil, ctx.Err() + case s.workerTasks.in <- walkTask{ + c: b.Cid(), + taskType: blockTask, + }: + } + } + + return s, nil +} + +func (s *walkScheduler) Wait() error { + err := s.workers.Wait() + // all workers done. One would have reached genesis and notified the + // rest to exit. Yet, there might be some pending tasks in the queue, + // so we need to run a "single worker". + if err != nil { + log.Errorw("export workers finished with error", "error", err) + } + + for { + if n := s.totalTasks.Load(); n == 0 { + break // finally fully done + } + select { + case task := <-s.workerTasks.out: + s.totalTasks.Add(-1) + if err != nil { + continue // just drain if errors happened. + } + err = s.processTask(task, 0) + } + } + close(s.results) + errWrite := <-s.writeErrorChan + if errWrite != nil { + log.Errorw("error writing to CAR file", "error", err) + return errWrite + } + s.workerTasks.Close() //nolint:errcheck + return err +} + +func (s *walkScheduler) enqueueIfNew(task walkTask) { + if task.c.Prefix().MhType == mh.IDENTITY { + //log.Infow("ignored", "cid", todo.c.String()) + return + } + if task.c.Prefix().Codec != cid.Raw && task.c.Prefix().Codec != cid.DagCBOR { + //log.Infow("ignored", "cid", todo.c.String()) + return + } + if _, loaded := s.seen.LoadOrStore(task.c, struct{}{}); loaded { + // we already had it on the map + return + } + + log.Debugw("enqueue", "type", task.taskType.String(), "cid", task.c.String()) + s.totalTasks.Add(1) + s.workerTasks.in <- task +} + +func (s *walkScheduler) sendFinish(workerN int) error { + log.Infow("worker finished work", "worker", workerN) + s.totalTasks.Add(1) + s.workerTasks.in <- walkTask{ + taskType: finishTask, + } + return nil +} + +func (s *walkScheduler) workerFunc(workerN int) error { + log.Infow("starting worker", "worker", workerN) + for t := range s.workerTasks.out { + s.totalTasks.Add(-1) + select { + case <-s.ctx.Done(): + return s.ctx.Err() + default: + // A worker reached genesis, so we wind down and let others do + // the same. Exit. + if t.taskType == finishTask { + return s.sendFinish(workerN) + } + } + + err := s.processTask(t, workerN) + if err != nil { + return err + } + // continue + } + return nil +} + +func (s *walkScheduler) processTask(t walkTask, workerN int) error { + if t.taskType == finishTask { + return nil + } + + blk, err := s.store.Get(s.ctx, t.c) + if err != nil { + return xerrors.Errorf("writing object to car, bs.Get: %w", err) + } + + s.results <- taskResult{ + c: t.c, + b: blk, + } + + // extract relevant dags to walk from the block + if t.taskType == blockTask { + blk := t.c + data, err := s.store.Get(s.ctx, blk) + if err != nil { + return err + } + var b types.BlockHeader + if err := b.UnmarshalCBOR(bytes.NewBuffer(data.RawData())); err != nil { + return xerrors.Errorf("unmarshalling block header (cid=%s): %w", blk, err) + } + if b.Height%1_000 == 0 { + log.Infow("block export", "height", b.Height) + } + if b.Height == 0 { + log.Info("exporting genesis block") + for i := range b.Parents { + s.enqueueIfNew(walkTask{ + c: b.Parents[i], + taskType: dagTask, + }) + } + s.enqueueIfNew(walkTask{ + c: b.ParentStateRoot, + taskType: stateTask, + }) + + return s.sendFinish(workerN) + } + // enqueue block parents + for i := range b.Parents { + s.enqueueIfNew(walkTask{ + c: b.Parents[i], + taskType: blockTask, + }) + } + if s.cfg.tail.Height() >= b.Height { + log.Debugw("tail reached: only blocks will be exported from now until genesis", "cid", blk.String()) + return nil + } + + if s.cfg.includeMessages { + // enqueue block messages + s.enqueueIfNew(walkTask{ + c: b.Messages, + taskType: messageTask, + }) + } + if s.cfg.includeReceipts { + // enqueue block receipts + s.enqueueIfNew(walkTask{ + c: b.ParentMessageReceipts, + taskType: receiptTask, + }) + } + if s.cfg.includeState { + s.enqueueIfNew(walkTask{ + c: b.ParentStateRoot, + taskType: stateTask, + }) + } + + return nil + } + + // Not a chain-block: we scan for CIDs in the raw block-data + return cbg.ScanForLinks(bytes.NewReader(blk.RawData()), func(c cid.Cid) { + if t.c.Prefix().Codec != cid.DagCBOR || t.c.Prefix().MhType == mh.IDENTITY { + return + } + + s.enqueueIfNew(walkTask{ + c: c, + taskType: dagTask, + }) + }) +} + +func (cs *ChainStore) ExportRange( + ctx context.Context, + w io.Writer, + head, tail *types.TipSet, + messages, receipts, stateroots bool, + workers int) error { + + h := &car.CarHeader{ + Roots: head.Cids(), + Version: 1, + } + + if err := car.WriteHeader(h, w); err != nil { + return xerrors.Errorf("failed to write car header: %s", err) + } + + start := time.Now() + log.Infow("walking snapshot range", + "head", head.Key(), + "tail", tail.Key(), + "messages", messages, + "receipts", receipts, + "stateroots", + stateroots, + "workers", workers) + + cfg := walkSchedulerConfig{ + numWorkers: workers, + head: head, + tail: tail, + includeMessages: messages, + includeState: stateroots, + includeReceipts: receipts, + } + + pw, err := newWalkScheduler(ctx, cs.UnionStore(), cfg, w) + if err != nil { + return err + } + + // wait until all workers are done. + err = pw.Wait() + if err != nil { + log.Errorw("walker scheduler", "error", err) + return err + } + + log.Infow("walking snapshot range complete", "duration", time.Since(start), "success", err == nil) + return nil +} + func (cs *ChainStore) WalkSnapshot(ctx context.Context, ts *types.TipSet, inclRecentRoots abi.ChainEpoch, skipOldMsgs, skipMsgReceipts bool, cb func(cid.Cid) error) error { if ts == nil { ts = cs.GetHeaviestTipSet() diff --git a/chain/store/store.go b/chain/store/store.go index 754e3a1234..d7188a7bfd 100644 --- a/chain/store/store.go +++ b/chain/store/store.go @@ -11,7 +11,7 @@ import ( "sync" "time" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "github.com/ipfs/go-cid" dstore "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/query" @@ -120,8 +120,8 @@ type ChainStore struct { reorgCh chan<- reorg reorgNotifeeCh chan ReorgNotifee - mmCache *lru.ARCCache // msg meta cache (mh.Messages -> secp, bls []cid) - tsCache *lru.ARCCache + mmCache *lru.ARCCache[cid.Cid, mmCids] + tsCache *lru.ARCCache[types.TipSetKey, *types.TipSet] evtTypes [1]journal.EventType journal journal.Journal @@ -133,8 +133,8 @@ type ChainStore struct { } func NewChainStore(chainBs bstore.Blockstore, stateBs bstore.Blockstore, ds dstore.Batching, weight WeightFunc, j journal.Journal) *ChainStore { - c, _ := lru.NewARC(DefaultMsgMetaCacheSize) - tsc, _ := lru.NewARC(DefaultTipSetCacheSize) + c, _ := lru.NewARC[cid.Cid, mmCids](DefaultMsgMetaCacheSize) + tsc, _ := lru.NewARC[types.TipSetKey, *types.TipSet](DefaultTipSetCacheSize) if j == nil { j = journal.NilJournal() } @@ -818,9 +818,8 @@ func (cs *ChainStore) GetBlock(ctx context.Context, c cid.Cid) (*types.BlockHead } func (cs *ChainStore) LoadTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) { - v, ok := cs.tsCache.Get(tsk) - if ok { - return v.(*types.TipSet), nil + if ts, ok := cs.tsCache.Get(tsk); ok { + return ts, nil } // Fetch tipset block headers from blockstore in parallel diff --git a/chain/store/store_test.go b/chain/store/store_test.go index f5765fddc0..cc72acc95b 100644 --- a/chain/store/store_test.go +++ b/chain/store/store_test.go @@ -196,7 +196,8 @@ func TestChainExportImportFull(t *testing.T) { } nbs := blockstore.NewMemorySync() - cs := store.NewChainStore(nbs, nbs, datastore.NewMapDatastore(), filcns.Weight, nil) + ds := datastore.NewMapDatastore() + cs := store.NewChainStore(nbs, nbs, ds, filcns.Weight, nil) defer cs.Close() //nolint:errcheck root, err := cs.Import(context.TODO(), buf) @@ -213,7 +214,7 @@ func TestChainExportImportFull(t *testing.T) { t.Fatal("imported chain differed from exported chain") } - sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), nil, filcns.DefaultUpgradeSchedule(), cg.BeaconSchedule()) + sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), nil, filcns.DefaultUpgradeSchedule(), cg.BeaconSchedule(), ds) if err != nil { t.Fatal(err) } diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index 5e353044d6..f641f0ff93 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -7,11 +7,12 @@ import ( "sync" "time" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" bserv "github.com/ipfs/go-blockservice" "github.com/ipfs/go-cid" - "github.com/ipfs/go-libipfs/blocks" + blocks "github.com/ipfs/go-libipfs/blocks" logging "github.com/ipfs/go-log/v2" + "github.com/ipni/storetheindex/announce/message" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/connmgr" "github.com/libp2p/go-libp2p/core/peer" @@ -20,7 +21,6 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-legs/dtsync" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain" @@ -217,7 +217,7 @@ func fetchCids( type BlockValidator struct { self peer.ID - peers *lru.TwoQueueCache + peers *lru.TwoQueueCache[peer.ID, int] killThresh int @@ -231,7 +231,7 @@ type BlockValidator struct { } func NewBlockValidator(self peer.ID, chain *store.ChainStore, cns consensus.Consensus, blacklist func(peer.ID)) *BlockValidator { - p, _ := lru.New2Q(4096) + p, _ := lru.New2Q[peer.ID, int](4096) return &BlockValidator{ self: self, peers: p, @@ -244,21 +244,19 @@ func NewBlockValidator(self peer.ID, chain *store.ChainStore, cns consensus.Cons } func (bv *BlockValidator) flagPeer(p peer.ID) { - v, ok := bv.peers.Get(p) + val, ok := bv.peers.Get(p) if !ok { - bv.peers.Add(p, int(1)) + bv.peers.Add(p, 1) return } - val := v.(int) - if val >= bv.killThresh { log.Warnf("blacklisting peer %s", p) bv.blacklist(p) return } - bv.peers.Add(p, v.(int)+1) + bv.peers.Add(p, val+1) } func (bv *BlockValidator) Validate(ctx context.Context, pid peer.ID, msg *pubsub.Message) (res pubsub.ValidationResult) { @@ -293,11 +291,11 @@ func (bv *BlockValidator) Validate(ctx context.Context, pid peer.ID, msg *pubsub } type blockReceiptCache struct { - blocks *lru.TwoQueueCache + blocks *lru.TwoQueueCache[cid.Cid, int] } func newBlockReceiptCache() *blockReceiptCache { - c, _ := lru.New2Q(8192) + c, _ := lru.New2Q[cid.Cid, int](8192) return &blockReceiptCache{ blocks: c, @@ -307,12 +305,12 @@ func newBlockReceiptCache() *blockReceiptCache { func (brc *blockReceiptCache) add(bcid cid.Cid) int { val, ok := brc.blocks.Get(bcid) if !ok { - brc.blocks.Add(bcid, int(1)) + brc.blocks.Add(bcid, 1) return 0 } - brc.blocks.Add(bcid, val.(int)+1) - return val.(int) + brc.blocks.Add(bcid, val+1) + return val } type MessageValidator struct { @@ -466,13 +464,13 @@ type peerMsgInfo struct { type IndexerMessageValidator struct { self peer.ID - peerCache *lru.TwoQueueCache + peerCache *lru.TwoQueueCache[address.Address, *peerMsgInfo] chainApi full.ChainModuleAPI stateApi full.StateModuleAPI } func NewIndexerMessageValidator(self peer.ID, chainApi full.ChainModuleAPI, stateApi full.StateModuleAPI) *IndexerMessageValidator { - peerCache, _ := lru.New2Q(8192) + peerCache, _ := lru.New2Q[address.Address, *peerMsgInfo](8192) return &IndexerMessageValidator{ self: self, @@ -497,7 +495,7 @@ func (v *IndexerMessageValidator) Validate(ctx context.Context, pid peer.ID, msg return pubsub.ValidationIgnore } - idxrMsg := dtsync.Message{} + idxrMsg := message.Message{} err := idxrMsg.UnmarshalCBOR(bytes.NewBuffer(msg.Data)) if err != nil { log.Errorw("Could not decode indexer pubsub message", "err", err) @@ -515,15 +513,12 @@ func (v *IndexerMessageValidator) Validate(ctx context.Context, pid peer.ID, msg return pubsub.ValidationReject } - minerID := minerAddr.String() msgCid := idxrMsg.Cid var msgInfo *peerMsgInfo - val, ok := v.peerCache.Get(minerID) + msgInfo, ok := v.peerCache.Get(minerAddr) if !ok { msgInfo = &peerMsgInfo{} - } else { - msgInfo = val.(*peerMsgInfo) } // Lock this peer's message info. @@ -544,7 +539,7 @@ func (v *IndexerMessageValidator) Validate(ctx context.Context, pid peer.ID, msg // Check that the miner ID maps to the peer that sent the message. err = v.authenticateMessage(ctx, minerAddr, originPeer) if err != nil { - log.Warnw("cannot authenticate messsage", "err", err, "peer", originPeer, "minerID", minerID) + log.Warnw("cannot authenticate messsage", "err", err, "peer", originPeer, "minerID", minerAddr) stats.Record(ctx, metrics.IndexerMessageValidationFailure.M(1)) return pubsub.ValidationReject } @@ -554,7 +549,7 @@ func (v *IndexerMessageValidator) Validate(ctx context.Context, pid peer.ID, msg // messages from the same peer are handled concurrently, there is a // small chance that one msgInfo could replace the other here when // the info is first cached. This is OK, so no need to prevent it. - v.peerCache.Add(minerID, msgInfo) + v.peerCache.Add(minerAddr, msgInfo) } } diff --git a/chain/sub/incoming_test.go b/chain/sub/incoming_test.go index d17b088255..03f880c581 100644 --- a/chain/sub/incoming_test.go +++ b/chain/sub/incoming_test.go @@ -9,12 +9,12 @@ import ( "github.com/golang/mock/gomock" "github.com/ipfs/go-cid" blocks "github.com/ipfs/go-libipfs/blocks" + "github.com/ipni/storetheindex/announce/message" pubsub "github.com/libp2p/go-libp2p-pubsub" pb "github.com/libp2p/go-libp2p-pubsub/pb" "github.com/libp2p/go-libp2p/core/peer" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-legs/dtsync" "github.com/filecoin-project/lotus/api/mocks" "github.com/filecoin-project/lotus/chain/types" @@ -105,7 +105,7 @@ func TestIndexerMessageValidator_Validate(t *testing.T) { mc := gomock.NewController(t) node := mocks.NewMockFullNode(mc) subject := NewIndexerMessageValidator(peer.ID(tc.selfPID), node, node) - message := dtsync.Message{ + message := message.Message{ Cid: validCid, Addrs: nil, ExtraData: tc.extraData, diff --git a/chain/types/cbor_gen.go b/chain/types/cbor_gen.go index 314b2be6c5..90d1a14c59 100644 --- a/chain/types/cbor_gen.go +++ b/chain/types/cbor_gen.go @@ -7,6 +7,7 @@ import ( "io" "math" "sort" + time "time" cid "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" @@ -15,6 +16,7 @@ import ( address "github.com/filecoin-project/go-address" abi "github.com/filecoin-project/go-state-types/abi" crypto "github.com/filecoin-project/go-state-types/crypto" + exitcode "github.com/filecoin-project/go-state-types/exitcode" proof "github.com/filecoin-project/go-state-types/proof" ) @@ -338,7 +340,7 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -616,7 +618,7 @@ func (t *ElectionProof) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -826,7 +828,7 @@ func (t *Message) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -1589,7 +1591,7 @@ func (t *ExpTipSet) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -2078,3 +2080,659 @@ func (t *EventEntry) UnmarshalCBOR(r io.Reader) (err error) { } return nil } + +var lengthBufGasTrace = []byte{133} + +func (t *GasTrace) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write(lengthBufGasTrace); err != nil { + return err + } + + // t.Name (string) (string) + if len(t.Name) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.Name was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { + return err + } + if _, err := io.WriteString(w, string(t.Name)); err != nil { + return err + } + + // t.TotalGas (int64) (int64) + if t.TotalGas >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.TotalGas)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.TotalGas-1)); err != nil { + return err + } + } + + // t.ComputeGas (int64) (int64) + if t.ComputeGas >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.ComputeGas)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.ComputeGas-1)); err != nil { + return err + } + } + + // t.StorageGas (int64) (int64) + if t.StorageGas >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StorageGas)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StorageGas-1)); err != nil { + return err + } + } + + // t.TimeTaken (time.Duration) (int64) + if t.TimeTaken >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.TimeTaken)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.TimeTaken-1)); err != nil { + return err + } + } + return nil +} + +func (t *GasTrace) UnmarshalCBOR(r io.Reader) (err error) { + *t = GasTrace{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajArray { + return fmt.Errorf("cbor input should be of type array") + } + + if extra != 5 { + return fmt.Errorf("cbor input had wrong number of fields") + } + + // t.Name (string) (string) + + { + sval, err := cbg.ReadString(cr) + if err != nil { + return err + } + + t.Name = string(sval) + } + // t.TotalGas (int64) (int64) + { + maj, extra, err := cr.ReadHeader() + var extraI int64 + if err != nil { + return err + } + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) + } + + t.TotalGas = int64(extraI) + } + // t.ComputeGas (int64) (int64) + { + maj, extra, err := cr.ReadHeader() + var extraI int64 + if err != nil { + return err + } + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) + } + + t.ComputeGas = int64(extraI) + } + // t.StorageGas (int64) (int64) + { + maj, extra, err := cr.ReadHeader() + var extraI int64 + if err != nil { + return err + } + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) + } + + t.StorageGas = int64(extraI) + } + // t.TimeTaken (time.Duration) (int64) + { + maj, extra, err := cr.ReadHeader() + var extraI int64 + if err != nil { + return err + } + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) + } + + t.TimeTaken = time.Duration(extraI) + } + return nil +} + +var lengthBufMessageTrace = []byte{134} + +func (t *MessageTrace) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write(lengthBufMessageTrace); err != nil { + return err + } + + // t.From (address.Address) (struct) + if err := t.From.MarshalCBOR(cw); err != nil { + return err + } + + // t.To (address.Address) (struct) + if err := t.To.MarshalCBOR(cw); err != nil { + return err + } + + // t.Value (big.Int) (struct) + if err := t.Value.MarshalCBOR(cw); err != nil { + return err + } + + // t.Method (abi.MethodNum) (uint64) + + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Method)); err != nil { + return err + } + + // t.Params ([]uint8) (slice) + if len(t.Params) > cbg.ByteArrayMaxLen { + return xerrors.Errorf("Byte array in field t.Params was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.Params))); err != nil { + return err + } + + if _, err := cw.Write(t.Params[:]); err != nil { + return err + } + + // t.ParamsCodec (uint64) (uint64) + + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.ParamsCodec)); err != nil { + return err + } + + return nil +} + +func (t *MessageTrace) UnmarshalCBOR(r io.Reader) (err error) { + *t = MessageTrace{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajArray { + return fmt.Errorf("cbor input should be of type array") + } + + if extra != 6 { + return fmt.Errorf("cbor input had wrong number of fields") + } + + // t.From (address.Address) (struct) + + { + + if err := t.From.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.From: %w", err) + } + + } + // t.To (address.Address) (struct) + + { + + if err := t.To.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.To: %w", err) + } + + } + // t.Value (big.Int) (struct) + + { + + if err := t.Value.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Value: %w", err) + } + + } + // t.Method (abi.MethodNum) (uint64) + + { + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajUnsignedInt { + return fmt.Errorf("wrong type for uint64 field") + } + t.Method = abi.MethodNum(extra) + + } + // t.Params ([]uint8) (slice) + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > cbg.ByteArrayMaxLen { + return fmt.Errorf("t.Params: byte array too large (%d)", extra) + } + if maj != cbg.MajByteString { + return fmt.Errorf("expected byte array") + } + + if extra > 0 { + t.Params = make([]uint8, extra) + } + + if _, err := io.ReadFull(cr, t.Params[:]); err != nil { + return err + } + // t.ParamsCodec (uint64) (uint64) + + { + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajUnsignedInt { + return fmt.Errorf("wrong type for uint64 field") + } + t.ParamsCodec = uint64(extra) + + } + return nil +} + +var lengthBufReturnTrace = []byte{131} + +func (t *ReturnTrace) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write(lengthBufReturnTrace); err != nil { + return err + } + + // t.ExitCode (exitcode.ExitCode) (int64) + if t.ExitCode >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.ExitCode)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.ExitCode-1)); err != nil { + return err + } + } + + // t.Return ([]uint8) (slice) + if len(t.Return) > cbg.ByteArrayMaxLen { + return xerrors.Errorf("Byte array in field t.Return was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.Return))); err != nil { + return err + } + + if _, err := cw.Write(t.Return[:]); err != nil { + return err + } + + // t.ReturnCodec (uint64) (uint64) + + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.ReturnCodec)); err != nil { + return err + } + + return nil +} + +func (t *ReturnTrace) UnmarshalCBOR(r io.Reader) (err error) { + *t = ReturnTrace{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajArray { + return fmt.Errorf("cbor input should be of type array") + } + + if extra != 3 { + return fmt.Errorf("cbor input had wrong number of fields") + } + + // t.ExitCode (exitcode.ExitCode) (int64) + { + maj, extra, err := cr.ReadHeader() + var extraI int64 + if err != nil { + return err + } + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) + } + + t.ExitCode = exitcode.ExitCode(extraI) + } + // t.Return ([]uint8) (slice) + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > cbg.ByteArrayMaxLen { + return fmt.Errorf("t.Return: byte array too large (%d)", extra) + } + if maj != cbg.MajByteString { + return fmt.Errorf("expected byte array") + } + + if extra > 0 { + t.Return = make([]uint8, extra) + } + + if _, err := io.ReadFull(cr, t.Return[:]); err != nil { + return err + } + // t.ReturnCodec (uint64) (uint64) + + { + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajUnsignedInt { + return fmt.Errorf("wrong type for uint64 field") + } + t.ReturnCodec = uint64(extra) + + } + return nil +} + +var lengthBufExecutionTrace = []byte{132} + +func (t *ExecutionTrace) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write(lengthBufExecutionTrace); err != nil { + return err + } + + // t.Msg (types.MessageTrace) (struct) + if err := t.Msg.MarshalCBOR(cw); err != nil { + return err + } + + // t.MsgRct (types.ReturnTrace) (struct) + if err := t.MsgRct.MarshalCBOR(cw); err != nil { + return err + } + + // t.GasCharges ([]*types.GasTrace) (slice) + if len(t.GasCharges) > 1000000000 { + return xerrors.Errorf("Slice value in field t.GasCharges was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.GasCharges))); err != nil { + return err + } + for _, v := range t.GasCharges { + if err := v.MarshalCBOR(cw); err != nil { + return err + } + } + + // t.Subcalls ([]types.ExecutionTrace) (slice) + if len(t.Subcalls) > 1000000000 { + return xerrors.Errorf("Slice value in field t.Subcalls was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Subcalls))); err != nil { + return err + } + for _, v := range t.Subcalls { + if err := v.MarshalCBOR(cw); err != nil { + return err + } + } + return nil +} + +func (t *ExecutionTrace) UnmarshalCBOR(r io.Reader) (err error) { + *t = ExecutionTrace{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajArray { + return fmt.Errorf("cbor input should be of type array") + } + + if extra != 4 { + return fmt.Errorf("cbor input had wrong number of fields") + } + + // t.Msg (types.MessageTrace) (struct) + + { + + if err := t.Msg.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Msg: %w", err) + } + + } + // t.MsgRct (types.ReturnTrace) (struct) + + { + + if err := t.MsgRct.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.MsgRct: %w", err) + } + + } + // t.GasCharges ([]*types.GasTrace) (slice) + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 1000000000 { + return fmt.Errorf("t.GasCharges: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.GasCharges = make([]*GasTrace, extra) + } + + for i := 0; i < int(extra); i++ { + + var v GasTrace + if err := v.UnmarshalCBOR(cr); err != nil { + return err + } + + t.GasCharges[i] = &v + } + + // t.Subcalls ([]types.ExecutionTrace) (slice) + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 1000000000 { + return fmt.Errorf("t.Subcalls: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.Subcalls = make([]ExecutionTrace, extra) + } + + for i := 0; i < int(extra); i++ { + + var v ExecutionTrace + if err := v.UnmarshalCBOR(cr); err != nil { + return err + } + + t.Subcalls[i] = v + } + + return nil +} diff --git a/chain/types/ethtypes/eth_transactions.go b/chain/types/ethtypes/eth_transactions.go index 7c065928e9..6c13c5bf6a 100644 --- a/chain/types/ethtypes/eth_transactions.go +++ b/chain/types/ethtypes/eth_transactions.go @@ -12,6 +12,7 @@ import ( "github.com/filecoin-project/go-address" gocrypto "github.com/filecoin-project/go-crypto" + "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" builtintypes "github.com/filecoin-project/go-state-types/builtin" typescrypto "github.com/filecoin-project/go-state-types/crypto" @@ -38,7 +39,7 @@ type EthTx struct { MaxFeePerGas EthBigInt `json:"maxFeePerGas"` MaxPriorityFeePerGas EthBigInt `json:"maxPriorityFeePerGas"` AccessList []EthHash `json:"accessList"` - V EthBigInt `json:"yParity"` + V EthBigInt `json:"v"` R EthBigInt `json:"r"` S EthBigInt `json:"s"` } @@ -97,24 +98,31 @@ func EthTxFromSignedEthMessage(smsg *types.SignedMessage) (EthTx, error) { func EthTxArgsFromUnsignedEthMessage(msg *types.Message) (EthTxArgs, error) { var ( - to *EthAddress - params []byte - paramsReader = bytes.NewReader(msg.Params) - err error + to *EthAddress + params []byte + err error ) if msg.Version != 0 { return EthTxArgs{}, xerrors.Errorf("unsupported msg version: %d", msg.Version) } + if len(msg.Params) > 0 { + paramsReader := bytes.NewReader(msg.Params) + params, err = cbg.ReadByteArray(paramsReader, uint64(len(msg.Params))) + if err != nil { + return EthTxArgs{}, xerrors.Errorf("failed to read params byte array: %w", err) + } + if paramsReader.Len() != 0 { + return EthTxArgs{}, xerrors.Errorf("extra data found in params") + } + if len(params) == 0 { + return EthTxArgs{}, xerrors.Errorf("non-empty params encode empty byte array") + } + } + if msg.To == builtintypes.EthereumAddressManagerActorAddr { - switch msg.Method { - case builtintypes.MethodsEAM.CreateExternal: - params, err = cbg.ReadByteArray(paramsReader, uint64(len(msg.Params))) - if err != nil { - return EthTxArgs{}, xerrors.Errorf("failed to read params byte array: %w", err) - } - default: + if msg.Method != builtintypes.MethodsEAM.CreateExternal { return EthTxArgs{}, fmt.Errorf("unsupported EAM method") } } else if msg.Method == builtintypes.MethodsEVM.InvokeContract { @@ -123,23 +131,12 @@ func EthTxArgsFromUnsignedEthMessage(msg *types.Message) (EthTxArgs, error) { return EthTxArgs{}, err } to = &addr - - if len(msg.Params) > 0 { - params, err = cbg.ReadByteArray(paramsReader, uint64(len(msg.Params))) - if err != nil { - return EthTxArgs{}, xerrors.Errorf("failed to read params byte array: %w", err) - } - } } else { return EthTxArgs{}, xerrors.Errorf("invalid methodnum %d: only allowed method is InvokeContract(%d)", msg.Method, builtintypes.MethodsEVM.InvokeContract) } - if paramsReader.Len() != 0 { - return EthTxArgs{}, xerrors.Errorf("extra data found in params") - } - return EthTxArgs{ ChainID: build.Eip155ChainId, Nonce: int(msg.Nonce), @@ -159,34 +156,26 @@ func (tx *EthTxArgs) ToUnsignedMessage(from address.Address) (*types.Message, er var err error var params []byte - var to address.Address - method := builtintypes.MethodsEVM.InvokeContract - // nil indicates the EAM, only CreateExternal is allowed - if tx.To == nil { - to = builtintypes.EthereumAddressManagerActorAddr - method = builtintypes.MethodsEAM.CreateExternal - if len(tx.Input) == 0 { - return nil, xerrors.New("cannot call CreateExternal without params") - } - + if len(tx.Input) > 0 { buf := new(bytes.Buffer) if err = cbg.WriteByteArray(buf, tx.Input); err != nil { - return nil, xerrors.Errorf("failed to serialize Create params: %w", err) + return nil, xerrors.Errorf("failed to write input args: %w", err) } - params = buf.Bytes() + } + + var to address.Address + var method abi.MethodNum + // nil indicates the EAM, only CreateExternal is allowed + if tx.To == nil { + method = builtintypes.MethodsEAM.CreateExternal + to = builtintypes.EthereumAddressManagerActorAddr } else { + method = builtintypes.MethodsEVM.InvokeContract to, err = tx.To.ToFilecoinAddress() if err != nil { return nil, xerrors.Errorf("failed to convert To into filecoin addr: %w", err) } - if len(tx.Input) > 0 { - buf := new(bytes.Buffer) - if err = cbg.WriteByteArray(buf, tx.Input); err != nil { - return nil, xerrors.Errorf("failed to write input args: %w", err) - } - params = buf.Bytes() - } } return &types.Message{ diff --git a/chain/types/ethtypes/eth_types.go b/chain/types/ethtypes/eth_types.go index 1539a638b6..f157c7f94c 100644 --- a/chain/types/ethtypes/eth_types.go +++ b/chain/types/ethtypes/eth_types.go @@ -66,6 +66,18 @@ func EthUint64FromHex(s string) (EthUint64, error) { return EthUint64(parsedInt), nil } +// Parse a uint64 from big-endian encoded bytes. +func EthUint64FromBytes(b []byte) (EthUint64, error) { + if len(b) != 32 { + return 0, xerrors.Errorf("eth int must be 32 bytes long") + } + var zeros [32 - 8]byte + if !bytes.Equal(b[:len(zeros)], zeros[:]) { + return 0, xerrors.Errorf("eth int overflows 64 bits") + } + return EthUint64(binary.BigEndian.Uint64(b[len(zeros):])), nil +} + func (e EthUint64) Hex() string { if e == 0 { return "0x0" @@ -78,11 +90,15 @@ type EthBigInt big.Int var EthBigIntZero = EthBigInt{Int: big.Zero().Int} -func (e EthBigInt) MarshalJSON() ([]byte, error) { +func (e EthBigInt) String() string { if e.Int == nil || e.Int.BitLen() == 0 { - return json.Marshal("0x0") + return "0x0" } - return json.Marshal(fmt.Sprintf("0x%x", e.Int)) + return fmt.Sprintf("0x%x", e.Int) +} + +func (e EthBigInt) MarshalJSON() ([]byte, error) { + return json.Marshal(e.String()) } func (e *EthBigInt) UnmarshalJSON(b []byte) error { @@ -106,12 +122,15 @@ func (e *EthBigInt) UnmarshalJSON(b []byte) error { // EthBytes represent arbitrary bytes. A nil or empty slice serializes to "0x". type EthBytes []byte -func (e EthBytes) MarshalJSON() ([]byte, error) { +func (e EthBytes) String() string { if len(e) == 0 { - return json.Marshal("0x") + return "0x" } - s := hex.EncodeToString(e) - return json.Marshal("0x" + s) + return "0x" + hex.EncodeToString(e) +} + +func (e EthBytes) MarshalJSON() ([]byte, error) { + return json.Marshal(e.String()) } func (e *EthBytes) UnmarshalJSON(b []byte) error { @@ -276,6 +295,23 @@ func EthAddressFromPubKey(pubk []byte) ([]byte, error) { return ethAddr, nil } +var maskedIDPrefix = [20 - 8]byte{0xff} + +func IsEthAddress(addr address.Address) bool { + if addr.Protocol() != address.Delegated { + return false + } + payload := addr.Payload() + namespace, offset, err := varint.FromUvarint(payload) + if err != nil { + return false + } + + payload = payload[offset:] + + return namespace == builtintypes.EthereumAddressManagerActorID && len(payload) == 20 && !bytes.HasPrefix(payload, maskedIDPrefix[:]) +} + func EthAddressFromFilecoinAddress(addr address.Address) (EthAddress, error) { switch addr.Protocol() { case address.ID: @@ -294,9 +330,17 @@ func EthAddressFromFilecoinAddress(addr address.Address) (EthAddress, error) { return EthAddress{}, xerrors.Errorf("invalid delegated address namespace in: %s", addr) } payload = payload[n:] - if namespace == builtintypes.EthereumAddressManagerActorID { - return CastEthAddress(payload) + if namespace != builtintypes.EthereumAddressManagerActorID { + return EthAddress{}, ErrInvalidAddress + } + ethAddr, err := CastEthAddress(payload) + if err != nil { + return EthAddress{}, err + } + if ethAddr.IsMaskedID() { + return EthAddress{}, xerrors.Errorf("f410f addresses cannot embed masked-ID payloads: %s", ethAddr) } + return ethAddr, nil } return EthAddress{}, ErrInvalidAddress } @@ -344,8 +388,7 @@ func (ea *EthAddress) UnmarshalJSON(b []byte) error { } func (ea EthAddress) IsMaskedID() bool { - idmask := [12]byte{0xff} - return bytes.Equal(ea[:12], idmask[:]) + return bytes.HasPrefix(ea[:], maskedIDPrefix[:]) } func (ea EthAddress) ToFilecoinAddress() (address.Address, error) { diff --git a/chain/types/ethtypes/eth_types_test.go b/chain/types/ethtypes/eth_types_test.go index 118fbc9016..4a73184c2a 100644 --- a/chain/types/ethtypes/eth_types_test.go +++ b/chain/types/ethtypes/eth_types_test.go @@ -9,6 +9,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/go-state-types/builtin" ) type TestCase struct { @@ -178,6 +179,20 @@ func TestParseEthAddr(t *testing.T) { } } +func TestMaskedIDInF4(t *testing.T) { + addr, err := address.NewIDAddress(100) + require.NoError(t, err) + + eaddr, err := EthAddressFromFilecoinAddress(addr) + require.NoError(t, err) + + badaddr, err := address.NewDelegatedAddress(builtin.EthereumAddressManagerActorID, eaddr[:]) + require.NoError(t, err) + + _, err = EthAddressFromFilecoinAddress(badaddr) + require.Error(t, err) +} + func TestUnmarshalEthCall(t *testing.T) { data := `{"from":"0x4D6D86b31a112a05A473c4aE84afaF873f632325","to":"0xFe01CC39f5Ae8553D6914DBb9dC27D219fa22D7f","gas":"0x5","gasPrice":"0x6","value":"0x123","data":""}` diff --git a/chain/types/execresult.go b/chain/types/execresult.go index 98d06a390a..2a25d22e28 100644 --- a/chain/types/execresult.go +++ b/chain/types/execresult.go @@ -2,44 +2,41 @@ package types import ( "encoding/json" - "fmt" - "regexp" - "runtime" - "strings" "time" -) - -type ExecutionTrace struct { - Msg *Message - MsgRct *MessageReceipt - Error string - Duration time.Duration - GasCharges []*GasTrace - Subcalls []ExecutionTrace -} + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/exitcode" +) type GasTrace struct { - Name string - - Location []Loc `json:"loc"` - TotalGas int64 `json:"tg"` - ComputeGas int64 `json:"cg"` - StorageGas int64 `json:"sg"` - TotalVirtualGas int64 `json:"vtg"` - VirtualComputeGas int64 `json:"vcg"` - VirtualStorageGas int64 `json:"vsg"` + Name string + TotalGas int64 `json:"tg"` + ComputeGas int64 `json:"cg"` + StorageGas int64 `json:"sg"` + TimeTaken time.Duration `json:"tt"` +} - TimeTaken time.Duration `json:"tt"` - Extra interface{} `json:"ex,omitempty"` +type MessageTrace struct { + From address.Address + To address.Address + Value abi.TokenAmount + Method abi.MethodNum + Params []byte + ParamsCodec uint64 +} - Callers []uintptr `json:"-"` +type ReturnTrace struct { + ExitCode exitcode.ExitCode + Return []byte + ReturnCodec uint64 } -type Loc struct { - File string - Line int - Function string +type ExecutionTrace struct { + Msg MessageTrace + MsgRct ReturnTrace + GasCharges []*GasTrace `cborgen:"maxlen=1000000000"` + Subcalls []ExecutionTrace `cborgen:"maxlen=1000000000"` } func (et ExecutionTrace) SumGas() GasTrace { @@ -52,71 +49,13 @@ func SumGas(charges []*GasTrace) GasTrace { out.TotalGas += gc.TotalGas out.ComputeGas += gc.ComputeGas out.StorageGas += gc.StorageGas - - out.TotalVirtualGas += gc.TotalVirtualGas - out.VirtualComputeGas += gc.VirtualComputeGas - out.VirtualStorageGas += gc.VirtualStorageGas } return out } -func (l Loc) Show() bool { - ignorePrefix := []string{ - "reflect.", - "github.com/filecoin-project/lotus/chain/vm.(*Invoker).transform", - "github.com/filecoin-project/go-amt-ipld/", - } - for _, pre := range ignorePrefix { - if strings.HasPrefix(l.Function, pre) { - return false - } - } - return true -} -func (l Loc) String() string { - file := strings.Split(l.File, "/") - - fn := strings.Split(l.Function, "/") - var fnpkg string - if len(fn) > 2 { - fnpkg = strings.Join(fn[len(fn)-2:], "/") - } else { - fnpkg = l.Function - } - - return fmt.Sprintf("%s@%s:%d", fnpkg, file[len(file)-1], l.Line) -} - -var importantRegex = regexp.MustCompile(`github.com/filecoin-project/specs-actors/(v\d+/)?actors/builtin`) - -func (l Loc) Important() bool { - return importantRegex.MatchString(l.Function) -} - func (gt *GasTrace) MarshalJSON() ([]byte, error) { type GasTraceCopy GasTrace - if len(gt.Location) == 0 { - if len(gt.Callers) != 0 { - frames := runtime.CallersFrames(gt.Callers) - for { - frame, more := frames.Next() - if frame.Function == "github.com/filecoin-project/lotus/chain/vm.(*VM).ApplyMessage" { - break - } - l := Loc{ - File: frame.File, - Line: frame.Line, - Function: frame.Function, - } - gt.Location = append(gt.Location, l) - if !more { - break - } - } - } - } - cpy := (*GasTraceCopy)(gt) return json.Marshal(cpy) } diff --git a/chain/types/message.go b/chain/types/message.go index becd2c010f..4304ba659f 100644 --- a/chain/types/message.go +++ b/chain/types/message.go @@ -219,4 +219,17 @@ func (m *Message) ValidForBlockInclusion(minGas int64, version network.Version) return nil } +// EffectiveGasPremium returns the effective gas premium claimable by the miner +// given the supplied base fee. +// +// Filecoin clamps the gas premium at GasFeeCap - BaseFee, if lower than the +// specified premium. +func (m *Message) EffectiveGasPremium(baseFee abi.TokenAmount) abi.TokenAmount { + available := big.Sub(m.GasFeeCap, baseFee) + if big.Cmp(m.GasPremium, available) <= 0 { + return m.GasPremium + } + return available +} + const TestGasLimit = 100e6 diff --git a/chain/types/mpool.go b/chain/types/mpool.go index cf08177e9c..497d5c590e 100644 --- a/chain/types/mpool.go +++ b/chain/types/mpool.go @@ -10,7 +10,7 @@ type MpoolConfig struct { PriorityAddrs []address.Address SizeLimitHigh int SizeLimitLow int - ReplaceByFeeRatio float64 + ReplaceByFeeRatio Percent PruneCooldown time.Duration GasLimitOverestimation float64 } diff --git a/chain/types/percent.go b/chain/types/percent.go new file mode 100644 index 0000000000..858d9a2e3e --- /dev/null +++ b/chain/types/percent.go @@ -0,0 +1,39 @@ +package types + +import ( + "fmt" + "math" + "strconv" + + "golang.org/x/xerrors" +) + +// Percent stores a signed percentage as an int64. When converted to a string (or json), it's stored +// as a decimal with two places (e.g., 100% -> 1.00). +type Percent int64 + +func (p Percent) String() string { + abs := p + sign := "" + if abs < 0 { + abs = -abs + sign = "-" + } + return fmt.Sprintf(`%s%d.%d`, sign, abs/100, abs%100) +} + +func (p Percent) MarshalJSON() ([]byte, error) { + return []byte(p.String()), nil +} + +func (p *Percent) UnmarshalJSON(b []byte) error { + flt, err := strconv.ParseFloat(string(b)+"e2", 64) + if err != nil { + return xerrors.Errorf("unable to parse ratio %s: %w", string(b), err) + } + if math.Trunc(flt) != flt { + return xerrors.Errorf("ratio may only have two decimals: %s", string(b)) + } + *p = Percent(flt) + return nil +} diff --git a/chain/types/percent_test.go b/chain/types/percent_test.go new file mode 100644 index 0000000000..7364c24479 --- /dev/null +++ b/chain/types/percent_test.go @@ -0,0 +1,34 @@ +package types + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestPercent(t *testing.T) { + for _, tc := range []struct { + p Percent + s string + }{ + {100, "1.0"}, + {111, "1.11"}, + {12, "0.12"}, + {-12, "-0.12"}, + {1012, "10.12"}, + {-1012, "-10.12"}, + {0, "0.0"}, + } { + tc := tc + t.Run(fmt.Sprintf("%d <> %s", tc.p, tc.s), func(t *testing.T) { + m, err := tc.p.MarshalJSON() + require.NoError(t, err) + require.Equal(t, tc.s, string(m)) + var p Percent + require.NoError(t, p.UnmarshalJSON([]byte(tc.s))) + require.Equal(t, tc.p, p) + }) + } + +} diff --git a/chain/types/tipset.go b/chain/types/tipset.go index c1aa90fc9d..047a1c00e0 100644 --- a/chain/types/tipset.go +++ b/chain/types/tipset.go @@ -234,6 +234,10 @@ func (ts *TipSet) MinTicketBlock() *BlockHeader { return min } +func (ts *TipSet) ParentMessageReceipts() cid.Cid { + return ts.blks[0].ParentMessageReceipts +} + func (ts *TipSet) ParentState() cid.Cid { return ts.blks[0].ParentStateRoot } diff --git a/chain/vm/cbor_gen.go b/chain/vm/cbor_gen.go deleted file mode 100644 index edcf065608..0000000000 --- a/chain/vm/cbor_gen.go +++ /dev/null @@ -1,391 +0,0 @@ -// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT. - -package vm - -import ( - "fmt" - "io" - "math" - "sort" - - cid "github.com/ipfs/go-cid" - cbg "github.com/whyrusleeping/cbor-gen" - xerrors "golang.org/x/xerrors" - - types "github.com/filecoin-project/lotus/chain/types" -) - -var _ = xerrors.Errorf -var _ = cid.Undef -var _ = math.E -var _ = sort.Sort - -var lengthBufFvmExecutionTrace = []byte{133} - -func (t *FvmExecutionTrace) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - - cw := cbg.NewCborWriter(w) - - if _, err := cw.Write(lengthBufFvmExecutionTrace); err != nil { - return err - } - - // t.Msg (types.Message) (struct) - if err := t.Msg.MarshalCBOR(cw); err != nil { - return err - } - - // t.MsgRct (types.MessageReceipt) (struct) - if err := t.MsgRct.MarshalCBOR(cw); err != nil { - return err - } - - // t.Error (string) (string) - if len(t.Error) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.Error was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Error))); err != nil { - return err - } - if _, err := io.WriteString(w, string(t.Error)); err != nil { - return err - } - - // t.GasCharges ([]vm.FvmGasCharge) (slice) - if len(t.GasCharges) > 1000000000 { - return xerrors.Errorf("Slice value in field t.GasCharges was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.GasCharges))); err != nil { - return err - } - for _, v := range t.GasCharges { - if err := v.MarshalCBOR(cw); err != nil { - return err - } - } - - // t.Subcalls ([]vm.FvmExecutionTrace) (slice) - if len(t.Subcalls) > 1000000000 { - return xerrors.Errorf("Slice value in field t.Subcalls was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Subcalls))); err != nil { - return err - } - for _, v := range t.Subcalls { - if err := v.MarshalCBOR(cw); err != nil { - return err - } - } - return nil -} - -func (t *FvmExecutionTrace) UnmarshalCBOR(r io.Reader) (err error) { - *t = FvmExecutionTrace{} - - cr := cbg.NewCborReader(r) - - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - defer func() { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - }() - - if maj != cbg.MajArray { - return fmt.Errorf("cbor input should be of type array") - } - - if extra != 5 { - return fmt.Errorf("cbor input had wrong number of fields") - } - - // t.Msg (types.Message) (struct) - - { - - b, err := cr.ReadByte() - if err != nil { - return err - } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - t.Msg = new(types.Message) - if err := t.Msg.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.Msg pointer: %w", err) - } - } - - } - // t.MsgRct (types.MessageReceipt) (struct) - - { - - b, err := cr.ReadByte() - if err != nil { - return err - } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - t.MsgRct = new(types.MessageReceipt) - if err := t.MsgRct.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.MsgRct pointer: %w", err) - } - } - - } - // t.Error (string) (string) - - { - sval, err := cbg.ReadString(cr) - if err != nil { - return err - } - - t.Error = string(sval) - } - // t.GasCharges ([]vm.FvmGasCharge) (slice) - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - - if extra > 1000000000 { - return fmt.Errorf("t.GasCharges: array too large (%d)", extra) - } - - if maj != cbg.MajArray { - return fmt.Errorf("expected cbor array") - } - - if extra > 0 { - t.GasCharges = make([]FvmGasCharge, extra) - } - - for i := 0; i < int(extra); i++ { - - var v FvmGasCharge - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } - - t.GasCharges[i] = v - } - - // t.Subcalls ([]vm.FvmExecutionTrace) (slice) - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - - if extra > 1000000000 { - return fmt.Errorf("t.Subcalls: array too large (%d)", extra) - } - - if maj != cbg.MajArray { - return fmt.Errorf("expected cbor array") - } - - if extra > 0 { - t.Subcalls = make([]FvmExecutionTrace, extra) - } - - for i := 0; i < int(extra); i++ { - - var v FvmExecutionTrace - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } - - t.Subcalls[i] = v - } - - return nil -} - -var lengthBufFvmGasCharge = []byte{132} - -func (t *FvmGasCharge) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - - cw := cbg.NewCborWriter(w) - - if _, err := cw.Write(lengthBufFvmGasCharge); err != nil { - return err - } - - // t.Name (string) (string) - if len(t.Name) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.Name was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { - return err - } - if _, err := io.WriteString(w, string(t.Name)); err != nil { - return err - } - - // t.TotalGas (int64) (int64) - if t.TotalGas >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.TotalGas)); err != nil { - return err - } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.TotalGas-1)); err != nil { - return err - } - } - - // t.ComputeGas (int64) (int64) - if t.ComputeGas >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.ComputeGas)); err != nil { - return err - } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.ComputeGas-1)); err != nil { - return err - } - } - - // t.StorageGas (int64) (int64) - if t.StorageGas >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StorageGas)); err != nil { - return err - } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StorageGas-1)); err != nil { - return err - } - } - return nil -} - -func (t *FvmGasCharge) UnmarshalCBOR(r io.Reader) (err error) { - *t = FvmGasCharge{} - - cr := cbg.NewCborReader(r) - - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - defer func() { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - }() - - if maj != cbg.MajArray { - return fmt.Errorf("cbor input should be of type array") - } - - if extra != 4 { - return fmt.Errorf("cbor input had wrong number of fields") - } - - // t.Name (string) (string) - - { - sval, err := cbg.ReadString(cr) - if err != nil { - return err - } - - t.Name = string(sval) - } - // t.TotalGas (int64) (int64) - { - maj, extra, err := cr.ReadHeader() - var extraI int64 - if err != nil { - return err - } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") - } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") - } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) - } - - t.TotalGas = int64(extraI) - } - // t.ComputeGas (int64) (int64) - { - maj, extra, err := cr.ReadHeader() - var extraI int64 - if err != nil { - return err - } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") - } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") - } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) - } - - t.ComputeGas = int64(extraI) - } - // t.StorageGas (int64) (int64) - { - maj, extra, err := cr.ReadHeader() - var extraI int64 - if err != nil { - return err - } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") - } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") - } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) - } - - t.StorageGas = int64(extraI) - } - return nil -} diff --git a/chain/vm/fvm.go b/chain/vm/fvm.go index 8e78e58d9d..7c79972c7e 100644 --- a/chain/vm/fvm.go +++ b/chain/vm/fvm.go @@ -51,57 +51,6 @@ type FvmExtern struct { base cid.Cid } -type FvmGasCharge struct { - Name string - TotalGas int64 - ComputeGas int64 - StorageGas int64 -} - -// This may eventually become identical to ExecutionTrace, but we can make incremental progress towards that -type FvmExecutionTrace struct { - Msg *types.Message - MsgRct *types.MessageReceipt - Error string - GasCharges []FvmGasCharge `cborgen:"maxlen=1000000000"` - Subcalls []FvmExecutionTrace `cborgen:"maxlen=1000000000"` -} - -func (t *FvmExecutionTrace) ToExecutionTrace() types.ExecutionTrace { - if t == nil { - return types.ExecutionTrace{} - } - - ret := types.ExecutionTrace{ - Msg: t.Msg, - MsgRct: t.MsgRct, - Error: t.Error, - Subcalls: nil, // Should be nil when there are no subcalls for backwards compatibility - } - - if len(t.GasCharges) > 0 { - ret.GasCharges = make([]*types.GasTrace, len(t.GasCharges)) - for i, v := range t.GasCharges { - ret.GasCharges[i] = &types.GasTrace{ - Name: v.Name, - TotalGas: v.TotalGas, - ComputeGas: v.ComputeGas, - StorageGas: v.StorageGas, - } - } - } - - if len(t.Subcalls) > 0 { - ret.Subcalls = make([]types.ExecutionTrace, len(t.Subcalls)) - - for i, v := range t.Subcalls { - ret.Subcalls[i] = v.ToExecutionTrace() - } - } - - return ret -} - func (x *FvmExtern) TipsetCid(ctx context.Context, epoch abi.ChainEpoch) (cid.Cid, error) { tsk, err := x.tsGet(ctx, epoch) if err != nil { @@ -487,19 +436,9 @@ func (vm *FVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet var et types.ExecutionTrace if len(ret.ExecTraceBytes) != 0 { - var fvmEt FvmExecutionTrace - if err = fvmEt.UnmarshalCBOR(bytes.NewReader(ret.ExecTraceBytes)); err != nil { + if err = et.UnmarshalCBOR(bytes.NewReader(ret.ExecTraceBytes)); err != nil { return nil, xerrors.Errorf("failed to unmarshal exectrace: %w", err) } - et = fvmEt.ToExecutionTrace() - } - - // Set the top-level exectrace info from the message and receipt for backwards compatibility - et.Msg = vmMsg - et.MsgRct = &receipt - et.Duration = duration - if aerr != nil { - et.Error = aerr.Error() } applyRet := &ApplyRet{ @@ -562,18 +501,9 @@ func (vm *FVM) ApplyImplicitMessage(ctx context.Context, cmsg *types.Message) (* var et types.ExecutionTrace if len(ret.ExecTraceBytes) != 0 { - var fvmEt FvmExecutionTrace - if err = fvmEt.UnmarshalCBOR(bytes.NewReader(ret.ExecTraceBytes)); err != nil { + if err = et.UnmarshalCBOR(bytes.NewReader(ret.ExecTraceBytes)); err != nil { return nil, xerrors.Errorf("failed to unmarshal exectrace: %w", err) } - et = fvmEt.ToExecutionTrace() - } else { - et.Msg = vmMsg - et.MsgRct = &receipt - et.Duration = duration - if aerr != nil { - et.Error = aerr.Error() - } } applyRet := &ApplyRet{ diff --git a/chain/vm/runtime.go b/chain/vm/runtime.go index daa55e4f4b..a5b1082381 100644 --- a/chain/vm/runtime.go +++ b/chain/vm/runtime.go @@ -6,7 +6,6 @@ import ( "encoding/binary" "fmt" "os" - gruntime "runtime" "time" "github.com/ipfs/go-cid" @@ -571,35 +570,18 @@ func (rt *Runtime) chargeGasFunc(skip int) func(GasCharge) { func (rt *Runtime) chargeGasInternal(gas GasCharge, skip int) aerrors.ActorError { toUse := gas.Total() if EnableDetailedTracing { - var callers [10]uintptr - - cout := gruntime.Callers(2+skip, callers[:]) - now := build.Clock.Now() if rt.lastGasCharge != nil { rt.lastGasCharge.TimeTaken = now.Sub(rt.lastGasChargeTime) } gasTrace := types.GasTrace{ - Name: gas.Name, - Extra: gas.Extra, + Name: gas.Name, TotalGas: toUse, ComputeGas: gas.ComputeGas, StorageGas: gas.StorageGas, - - VirtualComputeGas: gas.VirtualCompute, - VirtualStorageGas: gas.VirtualStorage, - - Callers: callers[:cout], - } - if gasTrace.VirtualStorageGas == 0 { - gasTrace.VirtualStorageGas = gasTrace.StorageGas - } - if gasTrace.VirtualComputeGas == 0 { - gasTrace.VirtualComputeGas = gasTrace.ComputeGas } - gasTrace.TotalVirtualGas = gasTrace.VirtualComputeGas + gasTrace.VirtualStorageGas rt.executionTrace.GasCharges = append(rt.executionTrace.GasCharges, &gasTrace) rt.lastGasChargeTime = now diff --git a/chain/vm/vm.go b/chain/vm/vm.go index f09864c2dd..c8e3f25190 100644 --- a/chain/vm/vm.go +++ b/chain/vm/vm.go @@ -38,6 +38,7 @@ import ( ) const MaxCallDepth = 4096 +const CborCodec = 0x51 var ( log = logging.Logger("vm") @@ -125,6 +126,10 @@ func (bs *gasChargingBlocks) Put(ctx context.Context, blk block.Block) error { } func (vm *LegacyVM) makeRuntime(ctx context.Context, msg *types.Message, parent *Runtime) *Runtime { + paramsCodec := uint64(0) + if len(msg.Params) > 0 { + paramsCodec = CborCodec + } rt := &Runtime{ ctx: ctx, vm: vm, @@ -140,7 +145,14 @@ func (vm *LegacyVM) makeRuntime(ctx context.Context, msg *types.Message, parent pricelist: PricelistByEpoch(vm.blockHeight), allowInternal: true, callerValidated: false, - executionTrace: types.ExecutionTrace{Msg: msg}, + executionTrace: types.ExecutionTrace{Msg: types.MessageTrace{ + From: msg.From, + To: msg.To, + Value: msg.Value, + Method: msg.Method, + Params: msg.Params, + ParamsCodec: paramsCodec, + }}, } if parent != nil { @@ -369,15 +381,14 @@ func (vm *LegacyVM) send(ctx context.Context, msg *types.Message, parent *Runtim return nil, nil }() - mr := types.MessageReceipt{ - ExitCode: aerrors.RetCode(err), - Return: ret, - GasUsed: rt.gasUsed, + retCodec := uint64(0) + if len(ret) > 0 { + retCodec = CborCodec } - rt.executionTrace.MsgRct = &mr - rt.executionTrace.Duration = time.Since(start) - if err != nil { - rt.executionTrace.Error = err.Error() + rt.executionTrace.MsgRct = types.ReturnTrace{ + ExitCode: aerrors.RetCode(err), + Return: ret, + ReturnCodec: retCodec, } return ret, err, rt diff --git a/cli/chain.go b/cli/chain.go index 549b8646e0..4344b07739 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -6,6 +6,7 @@ import ( "encoding/base64" "encoding/hex" "encoding/json" + "errors" "fmt" "io" "os" @@ -56,6 +57,7 @@ var ChainCmd = &cli.Command{ ChainGetCmd, ChainBisectCmd, ChainExportCmd, + ChainExportRangeCmd, SlashConsensusFault, ChainGasPriceCmd, ChainInspectUsage, @@ -1145,6 +1147,109 @@ var ChainExportCmd = &cli.Command{ }, } +var ChainExportRangeCmd = &cli.Command{ + Name: "export-range", + Usage: "export chain to a car file", + ArgsUsage: "", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "head", + Usage: "specify tipset to start the export from (higher epoch)", + Value: "@head", + }, + &cli.StringFlag{ + Name: "tail", + Usage: "specify tipset to end the export at (lower epoch)", + Value: "@tail", + }, + &cli.BoolFlag{ + Name: "messages", + Usage: "specify if messages should be include", + Value: false, + }, + &cli.BoolFlag{ + Name: "receipts", + Usage: "specify if receipts should be include", + Value: false, + }, + &cli.BoolFlag{ + Name: "stateroots", + Usage: "specify if stateroots should be include", + Value: false, + }, + &cli.IntFlag{ + Name: "workers", + Usage: "specify the number of workers", + Value: 1, + }, + &cli.IntFlag{ + Name: "write-buffer", + Usage: "specify write buffer size", + Value: 1 << 20, + }, + &cli.BoolFlag{ + Name: "internal", + Usage: "write the file locally to disk", + Value: true, + Hidden: true, // currently, non-internal export is not implemented. + }, + }, + Action: func(cctx *cli.Context) error { + api, closer, err := GetFullNodeAPIV1(cctx) + if err != nil { + return err + } + defer closer() + ctx := ReqContext(cctx) + + var head, tail *types.TipSet + headstr := cctx.String("head") + if headstr == "@head" { + head, err = api.ChainHead(ctx) + if err != nil { + return err + } + } else { + head, err = ParseTipSetRef(ctx, api, headstr) + if err != nil { + return fmt.Errorf("parsing head: %w", err) + } + } + tailstr := cctx.String("tail") + if tailstr == "@tail" { + tail, err = api.ChainGetGenesis(ctx) + if err != nil { + return err + } + } else { + tail, err = ParseTipSetRef(ctx, api, tailstr) + if err != nil { + return fmt.Errorf("parsing tail: %w", err) + } + } + + if head.Height() < tail.Height() { + return errors.New("Height of --head tipset must be greater or equal to the height of the --tail tipset") + } + + if !cctx.Bool("internal") { + return errors.New("Non-internal exports are not implemented") + } + + err = api.ChainExportRangeInternal(ctx, head.Key(), tail.Key(), lapi.ChainExportConfig{ + WriteBufferSize: cctx.Int("write-buffer"), + NumWorkers: cctx.Int("workers"), + IncludeMessages: cctx.Bool("messages"), + IncludeReceipts: cctx.Bool("receipts"), + IncludeStateRoots: cctx.Bool("stateroots"), + }) + if err != nil { + return err + } + return nil + }, +} + var SlashConsensusFault = &cli.Command{ Name: "slash-consensus", Usage: "Report consensus fault", @@ -1486,7 +1591,64 @@ func createExportFile(app *cli.App, path string) (io.WriteCloser, error) { var ChainPruneCmd = &cli.Command{ Name: "prune", - Usage: "prune the stored chain state and perform garbage collection", + Usage: "splitstore gc", + Subcommands: []*cli.Command{ + chainPruneColdCmd, + chainPruneHotGCCmd, + chainPruneHotMovingGCCmd, + }, +} + +var chainPruneHotGCCmd = &cli.Command{ + Name: "hot", + Usage: "run online (badger vlog) garbage collection on hotstore", + Flags: []cli.Flag{ + &cli.Float64Flag{Name: "threshold", Value: 0.01, Usage: "Threshold of vlog garbage for gc"}, + &cli.BoolFlag{Name: "periodic", Value: false, Usage: "Run periodic gc over multiple vlogs. Otherwise run gc once"}, + }, + Action: func(cctx *cli.Context) error { + api, closer, err := GetFullNodeAPIV1(cctx) + if err != nil { + return err + } + defer closer() + ctx := ReqContext(cctx) + opts := lapi.HotGCOpts{} + opts.Periodic = cctx.Bool("periodic") + opts.Threshold = cctx.Float64("threshold") + + gcStart := time.Now() + err = api.ChainHotGC(ctx, opts) + gcTime := time.Since(gcStart) + fmt.Printf("Online GC took %v (periodic <%t> threshold <%f>)", gcTime, opts.Periodic, opts.Threshold) + return err + }, +} + +var chainPruneHotMovingGCCmd = &cli.Command{ + Name: "hot-moving", + Usage: "run moving gc on hotstore", + Action: func(cctx *cli.Context) error { + api, closer, err := GetFullNodeAPIV1(cctx) + if err != nil { + return err + } + defer closer() + ctx := ReqContext(cctx) + opts := lapi.HotGCOpts{} + opts.Moving = true + + gcStart := time.Now() + err = api.ChainHotGC(ctx, opts) + gcTime := time.Since(gcStart) + fmt.Printf("Moving GC took %v", gcTime) + return err + }, +} + +var chainPruneColdCmd = &cli.Command{ + Name: "compact-cold", + Usage: "force splitstore compaction on cold store state and run gc", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "online-gc", diff --git a/cli/client.go b/cli/client.go index 3e917e8de0..88f7ed2087 100644 --- a/cli/client.go +++ b/cli/client.go @@ -31,7 +31,7 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - datatransfer "github.com/filecoin-project/go-data-transfer" + 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" diff --git a/cli/evm.go b/cli/evm.go index 2169a34866..84cbf8c61f 100644 --- a/cli/evm.go +++ b/cli/evm.go @@ -21,6 +21,7 @@ import ( "github.com/filecoin-project/lotus/api/v0api" "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" ) @@ -34,6 +35,7 @@ var EvmCmd = &cli.Command{ EvmGetInfoCmd, EvmCallSimulateCmd, EvmGetContractAddress, + EvmGetBytecode, }, } @@ -75,13 +77,18 @@ var EvmGetInfoCmd = &cli.Command{ } actor, err := api.StateGetActor(ctx, faddr, types.EmptyTSK) - if err != nil { - return err - } - fmt.Println("Filecoin address: ", faddr) fmt.Println("Eth address: ", eaddr) - fmt.Println("Code cid: ", actor.Code.String()) + if err != nil { + fmt.Printf("Actor lookup failed for faddr %s with error: %s\n", faddr, err) + } else { + idAddr, err := api.StateLookupID(ctx, faddr, types.EmptyTSK) + if err == nil { + fmt.Println("ID address: ", idAddr) + fmt.Println("Code cid: ", actor.Code.String()) + fmt.Println("Actor Type: ", builtin.ActorNameByCode(actor.Code)) + } + } return nil }, @@ -480,3 +487,51 @@ func ethAddrFromFilecoinAddress(ctx context.Context, addr address.Address, fnapi return ethAddr, faddr, nil } + +var EvmGetBytecode = &cli.Command{ + Name: "bytecode", + Usage: "Write the bytecode of a smart contract to a file", + ArgsUsage: "[contract-address] [file-name]", + Flags: []cli.Flag{ + &cli.BoolFlag{ + Name: "bin", + Usage: "write the bytecode as raw binary and don't hex-encode", + }, + }, + Action: func(cctx *cli.Context) error { + + if cctx.NArg() != 2 { + return IncorrectNumArgs(cctx) + } + + contractAddr, err := ethtypes.ParseEthAddress(cctx.Args().Get(0)) + if err != nil { + return err + } + + fileName := cctx.Args().Get(1) + + api, closer, err := GetFullNodeAPIV1(cctx) + if err != nil { + return err + } + defer closer() + ctx := ReqContext(cctx) + + code, err := api.EthGetCode(ctx, contractAddr, "latest") + if err != nil { + return err + } + if !cctx.Bool("bin") { + newCode := make([]byte, hex.EncodedLen(len(code))) + hex.Encode(newCode, code) + code = newCode + } + if err := os.WriteFile(fileName, code, 0o666); err != nil { + return xerrors.Errorf("failed to write bytecode to file %s: %w", fileName, err) + } + + fmt.Printf("Code for %s written to %s\n", contractAddr, fileName) + return nil + }, +} diff --git a/cli/mpool.go b/cli/mpool.go index e098806cbf..c83fb4b614 100644 --- a/cli/mpool.go +++ b/cli/mpool.go @@ -461,7 +461,12 @@ var MpoolReplaceCmd = &cli.Command{ msg := found.Message if cctx.Bool("auto") { - minRBF := messagepool.ComputeMinRBF(msg.GasPremium) + cfg, err := api.MpoolGetConfig(ctx) + if err != nil { + return xerrors.Errorf("failed to lookup the message pool config: %w", err) + } + + defaultRBF := messagepool.ComputeRBF(msg.GasPremium, cfg.ReplaceByFeeRatio) var mss *lapi.MessageSendSpec if cctx.IsSet("fee-limit") { @@ -482,7 +487,7 @@ var MpoolReplaceCmd = &cli.Command{ return xerrors.Errorf("failed to estimate gas values: %w", err) } - msg.GasPremium = big.Max(retm.GasPremium, minRBF) + msg.GasPremium = big.Max(retm.GasPremium, defaultRBF) msg.GasFeeCap = big.Max(retm.GasFeeCap, msg.GasPremium) mff := func() (abi.TokenAmount, error) { diff --git a/cli/mpool_test.go b/cli/mpool_test.go index 01b49d4b3f..0aa055ba31 100644 --- a/cli/mpool_test.go +++ b/cli/mpool_test.go @@ -15,6 +15,7 @@ import ( "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/chain/messagepool" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/mock" "github.com/filecoin-project/lotus/chain/wallet" @@ -298,6 +299,7 @@ func TestReplace(t *testing.T) { mockApi.EXPECT().ChainGetMessage(ctx, sm.Cid()).Return(&sm.Message, nil), mockApi.EXPECT().ChainHead(ctx).Return(nil, nil), mockApi.EXPECT().MpoolPending(ctx, types.EmptyTSK).Return([]*types.SignedMessage{sm}, nil), + mockApi.EXPECT().MpoolGetConfig(ctx).Return(messagepool.DefaultConfig(), nil), // use gomock.any to match the message in expected api calls // since the replace function modifies the message between calls, it would be pointless to try to match the exact argument mockApi.EXPECT().GasEstimateMessageGas(ctx, gomock.Any(), &mss, types.EmptyTSK).Return(&sm.Message, nil), @@ -342,6 +344,7 @@ func TestReplace(t *testing.T) { gomock.InOrder( mockApi.EXPECT().ChainHead(ctx).Return(nil, nil), mockApi.EXPECT().MpoolPending(ctx, types.EmptyTSK).Return([]*types.SignedMessage{sm}, nil), + mockApi.EXPECT().MpoolGetConfig(ctx).Return(messagepool.DefaultConfig(), nil), // use gomock.any to match the message in expected api calls // since the replace function modifies the message between calls, it would be pointless to try to match the exact argument mockApi.EXPECT().GasEstimateMessageGas(ctx, gomock.Any(), &mss, types.EmptyTSK).Return(&sm.Message, nil), @@ -538,7 +541,7 @@ func TestConfig(t *testing.T) { t.Fatal(err) } - mpoolCfg := &types.MpoolConfig{PriorityAddrs: []address.Address{senderAddr}, SizeLimitHigh: 1234567, SizeLimitLow: 6, ReplaceByFeeRatio: 0.25} + mpoolCfg := &types.MpoolConfig{PriorityAddrs: []address.Address{senderAddr}, SizeLimitHigh: 1234567, SizeLimitLow: 6, ReplaceByFeeRatio: types.Percent(25)} gomock.InOrder( mockApi.EXPECT().MpoolGetConfig(ctx).Return(mpoolCfg, nil), ) @@ -566,7 +569,7 @@ func TestConfig(t *testing.T) { t.Fatal(err) } - mpoolCfg := &types.MpoolConfig{PriorityAddrs: []address.Address{senderAddr}, SizeLimitHigh: 234567, SizeLimitLow: 3, ReplaceByFeeRatio: 0.33} + mpoolCfg := &types.MpoolConfig{PriorityAddrs: []address.Address{senderAddr}, SizeLimitHigh: 234567, SizeLimitLow: 3, ReplaceByFeeRatio: types.Percent(33)} gomock.InOrder( mockApi.EXPECT().MpoolSetConfig(ctx, mpoolCfg).Return(nil), ) diff --git a/cli/send.go b/cli/send.go index e18aa544e1..cfa2515c07 100644 --- a/cli/send.go +++ b/cli/send.go @@ -1,15 +1,18 @@ package cli import ( + "bytes" "encoding/hex" "fmt" "strings" "github.com/urfave/cli/v2" + cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" + builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/types" @@ -117,15 +120,51 @@ var sendCmd = &cli.Command{ params.From = faddr } - if params.From.Protocol() == address.Delegated { + if cctx.IsSet("params-hex") { + decparams, err := hex.DecodeString(cctx.String("params-hex")) + if err != nil { + return fmt.Errorf("failed to decode hex params: %w", err) + } + params.Params = decparams + } + + if ethtypes.IsEthAddress(params.From) { + // Method numbers don't make sense from eth accounts. + if cctx.IsSet("method") { + return xerrors.Errorf("messages from f410f addresses may not specify a method number") + } + + // Now, figure out the correct method number from the recipient. + if params.To == builtintypes.EthereumAddressManagerActorAddr { + params.Method = builtintypes.MethodsEAM.CreateExternal + } else { + params.Method = builtintypes.MethodsEVM.InvokeContract + } + + if cctx.IsSet("params-json") { + return xerrors.Errorf("may not call with json parameters from an eth account") + } + + // And format the parameters, if present. + if len(params.Params) > 0 { + var buf bytes.Buffer + if err := cbg.WriteByteArray(&buf, params.Params); err != nil { + return xerrors.Errorf("failed to marshal EVM parameters") + } + params.Params = buf.Bytes() + } + + // We can only send to an f410f or f0 address. if !(params.To.Protocol() == address.ID || params.To.Protocol() == address.Delegated) { api := srv.FullNodeAPI() // Resolve id addr if possible. params.To, err = api.StateLookupID(ctx, params.To, types.EmptyTSK) if err != nil { - return xerrors.Errorf("f4 addresses can only send to other f4 or id addresses. could not find id address for %s", params.To.String()) + return xerrors.Errorf("addresses starting with f410f can only send to other addresses starting with f410f, or id addresses. could not find id address for %s", params.To.String()) } } + } else { + params.Method = abi.MethodNum(cctx.Uint64("method")) } if cctx.IsSet("gas-premium") { @@ -149,22 +188,13 @@ var sendCmd = &cli.Command{ params.GasLimit = &limit } - params.Method = abi.MethodNum(cctx.Uint64("method")) - if cctx.IsSet("params-json") { - decparams, err := srv.DecodeTypedParamsFromJSON(ctx, params.To, params.Method, cctx.String("params-json")) - if err != nil { - return fmt.Errorf("failed to decode json params: %w", err) - } - params.Params = decparams - } - if cctx.IsSet("params-hex") { if params.Params != nil { return fmt.Errorf("can only specify one of 'params-json' and 'params-hex'") } - decparams, err := hex.DecodeString(cctx.String("params-hex")) + decparams, err := srv.DecodeTypedParamsFromJSON(ctx, params.To, params.Method, cctx.String("params-json")) if err != nil { - return fmt.Errorf("failed to decode hex params: %w", err) + return fmt.Errorf("failed to decode json params: %w", err) } params.Params = decparams } diff --git a/cli/send_test.go b/cli/send_test.go index ec858774ce..2c59a9641f 100644 --- a/cli/send_test.go +++ b/cli/send_test.go @@ -7,14 +7,16 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ucli "github.com/urfave/cli/v2" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/chain/types/ethtypes" ) func mustAddr(a address.Address, err error) address.Address { @@ -65,7 +67,51 @@ func TestSendCLI(t *testing.T) { mockSrvcs.EXPECT().Close(), ) err := app.Run([]string{"lotus", "send", "t01", "1"}) - assert.NoError(t, err) - assert.EqualValues(t, sigMsg.Cid().String()+"\n", buf.String()) + require.NoError(t, err) + require.EqualValues(t, sigMsg.Cid().String()+"\n", buf.String()) + }) +} + +func TestSendEthereum(t *testing.T) { + oneFil := abi.TokenAmount(types.MustParseFIL("1")) + + t.Run("simple", func(t *testing.T) { + app, mockSrvcs, buf, done := newMockApp(t, sendCmd) + defer done() + + testEthAddr, err := ethtypes.CastEthAddress(make([]byte, 20)) + require.NoError(t, err) + testAddr := mustAddr(testEthAddr.ToFilecoinAddress()) + + params := abi.CborBytes([]byte{1, 2, 3, 4}) + var paramsBuf bytes.Buffer + require.NoError(t, params.MarshalCBOR(¶msBuf)) + + arbtProto := &api.MessagePrototype{ + Message: types.Message{ + From: testAddr, + To: mustAddr(address.NewIDAddress(1)), + Value: oneFil, + Method: builtin.MethodsEVM.InvokeContract, + Params: paramsBuf.Bytes(), + }, + } + sigMsg := fakeSign(&arbtProto.Message) + + gomock.InOrder( + mockSrvcs.EXPECT().MessageForSend(gomock.Any(), SendParams{ + From: testAddr, + To: mustAddr(address.NewIDAddress(1)), + Val: oneFil, + Method: builtin.MethodsEVM.InvokeContract, + Params: paramsBuf.Bytes(), + }).Return(arbtProto, nil), + mockSrvcs.EXPECT().PublishMessage(gomock.Any(), arbtProto, false). + Return(sigMsg, nil, nil), + mockSrvcs.EXPECT().Close(), + ) + err = app.Run([]string{"lotus", "send", "--from-eth-addr", testEthAddr.String(), "--params-hex", "01020304", "f01", "1"}) + require.NoError(t, err) + require.EqualValues(t, sigMsg.Cid().String()+"\n", buf.String()) }) } diff --git a/cli/state.go b/cli/state.go index 93ede1f5a1..3099bff17d 100644 --- a/cli/state.go +++ b/cli/state.go @@ -9,7 +9,6 @@ import ( "fmt" "html/template" "io" - "io/ioutil" "os" "reflect" "sort" @@ -22,7 +21,6 @@ import ( "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" "github.com/multiformats/go-multiaddr" - "github.com/multiformats/go-multihash" "github.com/urfave/cli/v2" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" @@ -1091,7 +1089,7 @@ var StateComputeStateCmd = &cli.Command{ var stout *lapi.ComputeStateOutput if csofile := cctx.String("compute-state-output"); csofile != "" { - data, err := ioutil.ReadFile(csofile) + data, err := os.ReadFile(csofile) if err != nil { return err } @@ -1234,7 +1232,7 @@ var compStateTemplate = `
State CID: {{.Comp.Root}}
Calls
{{range .Comp.Trace}} - {{template "message" (Call .ExecutionTrace false .Msg.Cid.String)}} + {{template "message" (Call .ExecutionTrace false .MsgCid.String)}} {{end}} @@ -1259,16 +1257,12 @@ var compStateMsg = ` -
{{.Msg.From}} -> {{.Msg.To}} ({{ToFil .Msg.Value}} FIL), M{{.Msg.Method}}
- {{if not .Subcall}}
Msg CID: {{.Msg.Cid}}
{{end}} +
{{.Msg.From}} -> {{.Msg.To}} ({{ToFil .Msg.Value}}), M{{.Msg.Method}}
+ {{if not .Subcall}}
Msg CID: {{.Hash}}
{{end}} {{if gt (len .Msg.Params) 0}}
{{JsonParams ($code) (.Msg.Method) (.Msg.Params) | html}}
{{end}} - {{if PrintTiming}} -
Took {{.Duration}}, Exit: {{.MsgRct.ExitCode}}{{if gt (len .MsgRct.Return) 0}}, Return{{end}}
- {{else}}
Exit: {{.MsgRct.ExitCode}}{{if gt (len .MsgRct.Return) 0}}, Return{{end}}
- {{end}} {{if gt (len .MsgRct.Return) 0}}
{{JsonReturn ($code) (.Msg.Method) (.MsgRct.Return) | html}}
{{end}} @@ -1280,62 +1274,26 @@ var compStateMsg = `
Gas Trace - - {{define "virt" -}} - {{- if . -}} - +({{.}}) - {{- end -}} - {{- end}} + {{define "gasC" -}} - + {{- end}} {{range .GasCharges}} - - {{template "gasC" .}} - - - {{end}} - {{with sumGas .GasCharges}} - - {{template "gasC" .}} - - - {{end}} + + + {{template "gasC" .}} + + + {{end}} + {{with sumGas .GasCharges}} + + + {{template "gasC" .}} + + + {{end}}
NameTotal/Compute/StorageTime TakenLocation
NameTotal/Compute/StorageTime Taken
{{.TotalGas}}{{template "virt" .TotalVirtualGas }}/{{.ComputeGas}}{{template "virt" .VirtualComputeGas}}/{{.StorageGas}}{{template "virt" .VirtualStorageGas}}{{.TotalGas}}/{{.ComputeGas}}/{{.StorageGas}}
{{.Name}}{{if .Extra}}:{{.Extra}}{{end}}{{if PrintTiming}}{{.TimeTaken}}{{end}} - {{ $fImp := FirstImportant .Location }} - {{ if $fImp }} -
- {{ $fImp }}
- {{ $elipOn := false }} - {{ range $index, $ele := .Location -}} - {{- if $index }}
{{end -}} - {{- if .Show -}} - {{ if $elipOn }} - {{ $elipOn = false }} - - {{end}} - - {{- if .Important }}{{end -}} - {{- . -}} - {{if .Important }}{{end}} - {{else}} - {{ if not $elipOn }} - {{ $elipOn = true }} - - {{end}} -
- {{end}} -
Sum{{if PrintTiming}}{{.TimeTaken}}{{end}}
{{.Name}}{{if PrintTiming}}{{.TimeTaken}}{{end}}
Sum{{if PrintTiming}}{{.TimeTaken}}{{end}}
@@ -1343,8 +1301,8 @@ var compStateMsg = ` {{if gt (len .Subcalls) 0}}
Subcalls:
{{$hash := .Hash}} - {{range .Subcalls}} - {{template "message" (Call . true (printf "%s-%s" $hash .Msg.Cid.String))}} + {{range $i, $call := .Subcalls}} + {{template "message" (Call $call true (printf "%s-%d" $hash $i))}} {{end}} {{end}} ` @@ -1365,20 +1323,9 @@ func ComputeStateHTMLTempl(w io.Writer, ts *types.TipSet, o *api.ComputeStateOut "IsVerySlow": isVerySlow, "IntExit": func(i exitcode.ExitCode) int64 { return int64(i) }, "sumGas": types.SumGas, - "CodeStr": codeStr, + "CodeStr": builtin.ActorNameByCode, "Call": call, "PrintTiming": func() bool { return printTiming }, - "FirstImportant": func(locs []types.Loc) *types.Loc { - if len(locs) != 0 { - for _, l := range locs { - if l.Important() { - return &l - } - } - return &locs[0] - } - return nil - }, }).Parse(compStateTemplate) if err != nil { return err @@ -1408,14 +1355,6 @@ func call(e types.ExecutionTrace, subcall bool, hash string) callMeta { } } -func codeStr(c cid.Cid) string { - cmh, err := multihash.Decode(c.Hash()) - if err != nil { - panic(err) - } - return string(cmh.Digest) -} - func getMethod(code cid.Cid, method abi.MethodNum) string { return consensus.NewActorRegistry().Methods[code][method].Name // todo: use remote } diff --git a/cli/util/retrieval.go b/cli/util/retrieval.go index 3a2ef60770..ac34fcf3a4 100644 --- a/cli/util/retrieval.go +++ b/cli/util/retrieval.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" "path" @@ -65,7 +64,7 @@ func ClientExportStream(apiAddr string, apiAuth http.Header, eref api.ExportRef, } if resp.StatusCode != http.StatusOK { - em, err := ioutil.ReadAll(resp.Body) + em, err := io.ReadAll(resp.Body) if err != nil { return nil, xerrors.Errorf("reading error body: %w", err) } diff --git a/cli/wallet.go b/cli/wallet.go index b57e1cb213..59f65be6a9 100644 --- a/cli/wallet.go +++ b/cli/wallet.go @@ -6,7 +6,6 @@ import ( "encoding/hex" "encoding/json" "fmt" - "io/ioutil" "os" "strings" @@ -348,7 +347,7 @@ var walletImport = &cli.Command{ inpdata = indata } else { - fdata, err := ioutil.ReadFile(cctx.Args().First()) + fdata, err := os.ReadFile(cctx.Args().First()) if err != nil { return err } diff --git a/cmd/eudico/mirvalidator/cfg.go b/cmd/eudico/mirvalidator/cfg.go index 2eeb464063..f2f9573f8e 100644 --- a/cmd/eudico/mirvalidator/cfg.go +++ b/cmd/eudico/mirvalidator/cfg.go @@ -7,12 +7,11 @@ import ( "path" "path/filepath" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/consensus-shipyard/go-ipc-types/validator" + "github.com/libp2p/go-libp2p/core/peer" "github.com/urfave/cli/v2" "golang.org/x/xerrors" - "github.com/consensus-shipyard/go-ipc-types/validator" - lcli "github.com/filecoin-project/lotus/cli" ) diff --git a/cmd/eudico/mirvalidator/init.go b/cmd/eudico/mirvalidator/init.go index 225ae60d2d..334db94519 100644 --- a/cmd/eudico/mirvalidator/init.go +++ b/cmd/eudico/mirvalidator/init.go @@ -7,9 +7,8 @@ import ( "path" "path/filepath" - "github.com/urfave/cli/v2" - "github.com/consensus-shipyard/go-ipc-types/validator" + "github.com/urfave/cli/v2" ) var initCmd = &cli.Command{ diff --git a/cmd/eudico/mirvalidator/run.go b/cmd/eudico/mirvalidator/run.go index 2d1b19fa49..b77e0dfc8f 100644 --- a/cmd/eudico/mirvalidator/run.go +++ b/cmd/eudico/mirvalidator/run.go @@ -5,21 +5,19 @@ import ( _ "net/http/pprof" "path/filepath" + "github.com/consensus-shipyard/go-ipc-types/sdk" "github.com/urfave/cli/v2" "go.opencensus.io/stats" "go.opencensus.io/stats/view" "go.opencensus.io/tag" "golang.org/x/xerrors" - "github.com/consensus-shipyard/go-ipc-types/sdk" - + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/mir/pkg/checkpoint" mirlibp2p "github.com/filecoin-project/mir/pkg/net/libp2p" t "github.com/filecoin-project/mir/pkg/types" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v0api" "github.com/filecoin-project/lotus/build" diff --git a/cmd/eudico/mirvalidator/utils.go b/cmd/eudico/mirvalidator/utils.go index 6a77689f25..12abaf57ce 100644 --- a/cmd/eudico/mirvalidator/utils.go +++ b/cmd/eudico/mirvalidator/utils.go @@ -11,8 +11,8 @@ import ( logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/host" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/host" "github.com/multiformats/go-multiaddr" "github.com/urfave/cli/v2" "golang.org/x/xerrors" diff --git a/cmd/lotus-bench/import.go b/cmd/lotus-bench/import.go index bb7dc69071..babf9342b1 100644 --- a/cmd/lotus-bench/import.go +++ b/cmd/lotus-bench/import.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "math" "net/http" _ "net/http/pprof" @@ -158,7 +157,7 @@ var importBenchCmd = &cli.Command{ if rdir := cctx.String("repodir"); rdir != "" { tdir = rdir } else { - tmp, err := ioutil.TempDir("", "lotus-import-bench") + tmp, err := os.MkdirTemp("", "lotus-import-bench") if err != nil { return err } @@ -229,7 +228,7 @@ var importBenchCmd = &cli.Command{ defer cs.Close() //nolint:errcheck // TODO: We need to supply the actual beacon after v14 - stm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(verifier), filcns.DefaultUpgradeSchedule(), nil) + stm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(verifier), filcns.DefaultUpgradeSchedule(), nil, metadataDs) if err != nil { return err } @@ -467,14 +466,11 @@ var importBenchCmd = &cli.Command{ Duration: time.Since(start), } if enc != nil { - stripCallers(tse.Trace) - if err := enc.Encode(tse); err != nil { return xerrors.Errorf("failed to write out tipsetexec: %w", err) } } if inverseChain[i-1].ParentState() != st { - stripCallers(tse.Trace) lastTrace := tse.Trace d, err := json.MarshalIndent(lastTrace, "", " ") if err != nil { @@ -493,21 +489,6 @@ var importBenchCmd = &cli.Command{ }, } -func walkExecutionTrace(et *types.ExecutionTrace) { - for _, gc := range et.GasCharges { - gc.Callers = nil - } - for _, sub := range et.Subcalls { - walkExecutionTrace(&sub) //nolint:scopelint,gosec - } -} - -func stripCallers(trace []*api.InvocResult) { - for _, t := range trace { - walkExecutionTrace(&t.ExecutionTrace) - } -} - type Invocation struct { TipSet types.TipSetKey Invoc *api.InvocResult @@ -515,28 +496,24 @@ type Invocation struct { const GasPerNs = 10 -func countGasCosts(et *types.ExecutionTrace) (int64, int64) { - var cgas, vgas int64 +func countGasCosts(et *types.ExecutionTrace) int64 { + var cgas int64 for _, gc := range et.GasCharges { cgas += gc.ComputeGas - vgas += gc.VirtualComputeGas } for _, sub := range et.Subcalls { - c, v := countGasCosts(&sub) //nolint + c := countGasCosts(&sub) //nolint cgas += c - vgas += v } - return cgas, vgas + return cgas } type stats struct { timeTaken meanVar gasRatio meanVar - - extraCovar *covar } type covar struct { @@ -681,32 +658,8 @@ func (v1 *meanVar) Combine(v2 *meanVar) { v1.m2 = m2 } -func getExtras(ex interface{}) (*string, *float64) { - if t, ok := ex.(string); ok { - return &t, nil - } - if size, ok := ex.(float64); ok { - return nil, &size - } - if exMap, ok := ex.(map[string]interface{}); ok { - t, tok := exMap["type"].(string) - size, sok := exMap["size"].(float64) - if tok && sok { - return &t, &size - } - if tok { - return &t, nil - } - if sok { - return nil, &size - } - return nil, nil - } - return nil, nil -} - func tallyGasCharges(charges map[string]*stats, et types.ExecutionTrace) { - for i, gc := range et.GasCharges { + for _, gc := range et.GasCharges { name := gc.Name if name == "OnIpldGetEnd" { continue @@ -717,45 +670,18 @@ func tallyGasCharges(charges map[string]*stats, et types.ExecutionTrace) { // discard initial very long OnVerifyPost continue } - eType, eSize := getExtras(gc.Extra) - - if name == "OnIpldGet" { - next := &types.GasTrace{} - if i+1 < len(et.GasCharges) { - next = et.GasCharges[i+1] - } - if next.Name != "OnIpldGetEnd" { - log.Warn("OnIpldGet without OnIpldGetEnd") - } else { - _, size := getExtras(next.Extra) - eSize = size - } - } - if eType != nil { - name += "-" + *eType - } compGas := gc.ComputeGas - if compGas == 0 { - compGas = gc.VirtualComputeGas - } - if compGas == 0 { - compGas = 1 - } s := charges[name] if s == nil { s = new(stats) charges[name] = s } - if eSize != nil { - if s.extraCovar == nil { - s.extraCovar = &covar{} - } - s.extraCovar.AddPoint(*eSize, tt) - } - s.timeTaken.AddPoint(tt) + if compGas == 0 { + compGas = 1 + } ratio := tt / float64(compGas) * GasPerNs s.gasRatio.AddPoint(ratio) } @@ -881,13 +807,6 @@ var importAnalyzeCmd = &cli.Command{ } s.timeTaken.Combine(&v.timeTaken) s.gasRatio.Combine(&v.gasRatio) - - if v.extraCovar != nil { - if s.extraCovar == nil { - s.extraCovar = &covar{} - } - s.extraCovar.Combine(v.extraCovar) - } } totalTime += res.totalTime } @@ -903,13 +822,6 @@ var importAnalyzeCmd = &cli.Command{ s := charges[k] fmt.Printf("%s: incr by %.4f~%.4f; tt %.4f~%.4f\n", k, s.gasRatio.Mean(), s.gasRatio.Stddev(), s.timeTaken.Mean(), s.timeTaken.Stddev()) - if s.extraCovar != nil { - fmt.Printf("\t correll: %.2f, tt = %.2f * extra + %.2f\n", s.extraCovar.Correl(), - s.extraCovar.A(), s.extraCovar.B()) - fmt.Printf("\t covar: %.2f, extra: %.2f~%.2f, tt2: %.2f~%.2f, count %.0f\n", - s.extraCovar.Covariance(), s.extraCovar.meanX, s.extraCovar.StddevX(), - s.extraCovar.meanY, s.extraCovar.StddevY(), s.extraCovar.n) - } } sort.Slice(invocs, func(i, j int) bool { diff --git a/cmd/lotus-bench/main.go b/cmd/lotus-bench/main.go index 279f2d5fdb..43972b1877 100644 --- a/cmd/lotus-bench/main.go +++ b/cmd/lotus-bench/main.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "math/big" "math/rand" "os" @@ -197,7 +196,7 @@ var sealBenchCmd = &cli.Command{ return xerrors.Errorf("creating sectorbuilder dir: %w", err) } - tsdir, err := ioutil.TempDir(sdir, "bench") + tsdir, err := os.MkdirTemp(sdir, "bench") if err != nil { return err } @@ -287,7 +286,7 @@ var sealBenchCmd = &cli.Command{ // sectorbuilder directory... we need a better way to handle // this in other cases - fdata, err := ioutil.ReadFile(filepath.Join(sbdir, "pre-seal-"+maddr.String()+".json")) + fdata, err := os.ReadFile(filepath.Join(sbdir, "pre-seal-"+maddr.String()+".json")) if err != nil { return err } @@ -637,7 +636,7 @@ func runSeals(sb *ffiwrapper.Sealer, sbfs *basicfs.Provider, numSectors int, par return err } - if err := ioutil.WriteFile(saveC2inp, b, 0664); err != nil { + if err := os.WriteFile(saveC2inp, b, 0664); err != nil { log.Warnf("%+v", err) } } @@ -751,7 +750,7 @@ var proveCmd = &cli.Command{ return xerrors.Errorf("Usage: lotus-bench prove [input.json]") } - inb, err := ioutil.ReadFile(c.Args().First()) + inb, err := os.ReadFile(c.Args().First()) if err != nil { return xerrors.Errorf("reading input file: %w", err) } diff --git a/cmd/lotus-bench/simple.go b/cmd/lotus-bench/simple.go index 87e2c3bc03..a742b0fb38 100644 --- a/cmd/lotus-bench/simple.go +++ b/cmd/lotus-bench/simple.go @@ -5,7 +5,6 @@ import ( "encoding/base64" "encoding/json" "fmt" - "io/ioutil" "os" "strconv" "time" @@ -444,7 +443,7 @@ var simpleCommit1 = &cli.Command{ return err } - if err := ioutil.WriteFile(cctx.Args().Get(4), b, 0664); err != nil { + if err := os.WriteFile(cctx.Args().Get(4), b, 0664); err != nil { log.Warnf("%+v", err) } @@ -478,7 +477,7 @@ var simpleCommit2 = &cli.Command{ return xerrors.Errorf("Usage: lotus-bench prove [input.json]") } - inb, err := ioutil.ReadFile(c.Args().First()) + inb, err := os.ReadFile(c.Args().First()) if err != nil { return xerrors.Errorf("reading input file: %w", err) } @@ -861,7 +860,7 @@ var simpleProveReplicaUpdate1 = &cli.Command{ return xerrors.Errorf("json marshal vanilla proofs: %w", err) } - if err := ioutil.WriteFile(cctx.Args().Get(7), vpjb, 0666); err != nil { + if err := os.WriteFile(cctx.Args().Get(7), vpjb, 0666); err != nil { return xerrors.Errorf("writing vanilla proofs file: %w", err) } @@ -934,7 +933,7 @@ var simpleProveReplicaUpdate2 = &cli.Command{ return xerrors.Errorf("parse commr: %w", err) } - vpb, err := ioutil.ReadFile(cctx.Args().Get(3)) + vpb, err := os.ReadFile(cctx.Args().Get(3)) if err != nil { return xerrors.Errorf("reading valilla proof file: %w", err) } diff --git a/cmd/lotus-fountain/recaptcha.go b/cmd/lotus-fountain/recaptcha.go index 69359faa3b..6b2327a033 100644 --- a/cmd/lotus-fountain/recaptcha.go +++ b/cmd/lotus-fountain/recaptcha.go @@ -6,7 +6,7 @@ package main import ( "encoding/json" - "io/ioutil" + "io" "net/http" "net/url" "os" @@ -63,7 +63,7 @@ func VerifyToken(token, remoteIP string) (Response, error) { return resp, err } - b, err := ioutil.ReadAll(r.Body) + b, err := io.ReadAll(r.Body) _ = r.Body.Close() // close immediately after reading finished if err != nil { return resp, err diff --git a/cmd/lotus-miner/actor_test.go b/cmd/lotus-miner/actor_test.go index 791298ffa9..dfb4522137 100644 --- a/cmd/lotus-miner/actor_test.go +++ b/cmd/lotus-miner/actor_test.go @@ -34,8 +34,8 @@ func TestWorkerKeyChange(t *testing.T) { kit.QuietMiningLogs() - blocktime := 1 * time.Millisecond - client1, client2, miner, ens := kit.EnsembleTwoOne(t, kit.MockProofs()) + blocktime := 5 * time.Millisecond + client1, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs()) ens.InterconnectAll().BeginMining(blocktime) output := bytes.NewBuffer(nil) @@ -96,7 +96,4 @@ func TestWorkerKeyChange(t *testing.T) { // Wait for finality (worker key switch). targetHeight := head.Height() + policy.ChainFinality client1.WaitTillChain(ctx, kit.HeightAtLeast(targetHeight)) - - // Make sure the other node can catch up. - client2.WaitTillChain(ctx, kit.HeightAtLeast(targetHeight)) } diff --git a/cmd/lotus-miner/allinfo_test.go b/cmd/lotus-miner/allinfo_test.go index 144bdff709..2388f2f7ae 100644 --- a/cmd/lotus-miner/allinfo_test.go +++ b/cmd/lotus-miner/allinfo_test.go @@ -25,7 +25,7 @@ func TestMinerAllInfo(t *testing.T) { kit.QuietMiningLogs() client, miner, ens := kit.EnsembleMinimal(t) - ens.InterconnectAll().BeginMining(time.Second) + ens.InterconnectAll().BeginMiningMustPost(5 * time.Millisecond) run := func(t *testing.T) { app := cli.NewApp() diff --git a/cmd/lotus-miner/config.go b/cmd/lotus-miner/config.go index 652426583e..b7af1b2e51 100644 --- a/cmd/lotus-miner/config.go +++ b/cmd/lotus-miner/config.go @@ -31,7 +31,7 @@ var configDefaultCmd = &cli.Command{ Action: func(cctx *cli.Context) error { c := config.DefaultStorageMiner() - cb, err := config.ConfigUpdate(c, nil, !cctx.Bool("no-comment")) + cb, err := config.ConfigUpdate(c, nil, config.Commented(!cctx.Bool("no-comment"))) if err != nil { return err } @@ -83,7 +83,7 @@ var configUpdateCmd = &cli.Command{ cfgDef := config.DefaultStorageMiner() - updated, err := config.ConfigUpdate(cfgNode, cfgDef, !cctx.Bool("no-comment")) + updated, err := config.ConfigUpdate(cfgNode, cfgDef, config.Commented(!cctx.Bool("no-comment"))) if err != nil { return err } diff --git a/cmd/lotus-miner/info.go b/cmd/lotus-miner/info.go index d791b07608..974635eb2b 100644 --- a/cmd/lotus-miner/info.go +++ b/cmd/lotus-miner/info.go @@ -7,8 +7,6 @@ import ( corebig "math/big" "os" "sort" - "strings" - "text/tabwriter" "time" "github.com/fatih/color" @@ -18,8 +16,6 @@ import ( "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/specs-actors/actors/builtin" @@ -65,12 +61,6 @@ func infoCmdAct(cctx *cli.Context) error { } defer closer() - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - fullapi, acloser, err := lcli.GetFullNodeAPIV1(cctx) if err != nil { return err @@ -84,14 +74,7 @@ func infoCmdAct(cctx *cli.Context) error { return err } - fmt.Println("Enabled subsystems (from miner API):", subsystems) - - subsystems, err = marketsApi.RuntimeSubsystems(ctx) - if err != nil { - return err - } - - fmt.Println("Enabled subsystems (from markets API):", subsystems) + fmt.Println("Enabled subsystems:", subsystems) start, err := minerApi.StartTime(ctx) if err != nil { @@ -128,11 +111,6 @@ func infoCmdAct(cctx *cli.Context) error { return err } - err = handleMarketsInfo(ctx, marketsApi) - if err != nil { - return err - } - return nil } @@ -393,105 +371,6 @@ func handleMiningInfo(ctx context.Context, cctx *cli.Context, fullapi v1api.Full return nil } -func handleMarketsInfo(ctx context.Context, nodeApi api.StorageMiner) error { - deals, err := nodeApi.MarketListIncompleteDeals(ctx) - if err != nil { - return err - } - - type dealStat struct { - count, verifCount int - bytes, verifBytes uint64 - } - dsAdd := func(ds *dealStat, deal storagemarket.MinerDeal) { - ds.count++ - ds.bytes += uint64(deal.Proposal.PieceSize) - if deal.Proposal.VerifiedDeal { - ds.verifCount++ - ds.verifBytes += uint64(deal.Proposal.PieceSize) - } - } - - showDealStates := map[storagemarket.StorageDealStatus]struct{}{ - storagemarket.StorageDealActive: {}, - storagemarket.StorageDealAcceptWait: {}, - storagemarket.StorageDealReserveProviderFunds: {}, - storagemarket.StorageDealProviderFunding: {}, - storagemarket.StorageDealTransferring: {}, - storagemarket.StorageDealValidating: {}, - storagemarket.StorageDealStaged: {}, - storagemarket.StorageDealAwaitingPreCommit: {}, - storagemarket.StorageDealSealing: {}, - storagemarket.StorageDealPublish: {}, - storagemarket.StorageDealCheckForAcceptance: {}, - storagemarket.StorageDealPublishing: {}, - } - - var total dealStat - perState := map[storagemarket.StorageDealStatus]*dealStat{} - for _, deal := range deals { - if _, ok := showDealStates[deal.State]; !ok { - continue - } - if perState[deal.State] == nil { - perState[deal.State] = new(dealStat) - } - - dsAdd(&total, deal) - dsAdd(perState[deal.State], deal) - } - - type wstr struct { - str string - status storagemarket.StorageDealStatus - } - sorted := make([]wstr, 0, len(perState)) - for status, stat := range perState { - st := strings.TrimPrefix(storagemarket.DealStates[status], "StorageDeal") - sorted = append(sorted, wstr{ - str: fmt.Sprintf(" %s:\t%d\t\t%s\t(Verified: %d\t%s)\n", st, stat.count, types.SizeStr(types.NewInt(stat.bytes)), stat.verifCount, types.SizeStr(types.NewInt(stat.verifBytes))), - status: status, - }, - ) - } - sort.Slice(sorted, func(i, j int) bool { - if sorted[i].status == storagemarket.StorageDealActive || sorted[j].status == storagemarket.StorageDealActive { - return sorted[i].status == storagemarket.StorageDealActive - } - return sorted[i].status > sorted[j].status - }) - - fmt.Println() - fmt.Printf("Storage Deals: %d, %s\n", total.count, types.SizeStr(types.NewInt(total.bytes))) - - tw := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0) - for _, e := range sorted { - _, _ = tw.Write([]byte(e.str)) - } - - _ = tw.Flush() - fmt.Println() - - retrievals, err := nodeApi.MarketListRetrievalDeals(ctx) - if err != nil { - return xerrors.Errorf("getting retrieval deal list: %w", err) - } - - var retrComplete dealStat - for _, retrieval := range retrievals { - if retrieval.Status == retrievalmarket.DealStatusCompleted { - retrComplete.count++ - retrComplete.bytes += retrieval.TotalSent - } - } - - fmt.Printf("Retrieval Deals (complete): %d, %s\n", retrComplete.count, types.SizeStr(types.NewInt(retrComplete.bytes))) - - fmt.Println() - - return nil -} - type stateMeta struct { i int col color.Attribute diff --git a/cmd/lotus-miner/info_all.go b/cmd/lotus-miner/info_all.go index bf6d7e4b92..2cf07385c0 100644 --- a/cmd/lotus-miner/info_all.go +++ b/cmd/lotus-miner/info_all.go @@ -150,11 +150,6 @@ var infoAllCmd = &cli.Command{ } } - fmt.Println("\n#: Retrieval Deals") - if err := retrievalDealsListCmd.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) - } - fmt.Println("\n#: Data Transfers") { fs := &flag.FlagSet{} @@ -198,8 +193,17 @@ var infoAllCmd = &cli.Command{ } fmt.Println("\n#: Sector List") - if err := sectorsListCmd.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) + { + fs := &flag.FlagSet{} + for _, f := range sectorsListCmd.Flags { + if err := f.Apply(fs); err != nil { + fmt.Println("ERROR: ", err) + } + } + + if err := sectorsListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { + fmt.Println("ERROR: ", err) + } } fmt.Println("\n#: Storage Sector List") diff --git a/cmd/lotus-miner/init.go b/cmd/lotus-miner/init.go index 66a6691af1..e752839ece 100644 --- a/cmd/lotus-miner/init.go +++ b/cmd/lotus-miner/init.go @@ -7,7 +7,6 @@ import ( "encoding/binary" "encoding/json" "fmt" - "io/ioutil" "net/http" "os" "path/filepath" @@ -246,7 +245,7 @@ var initCmd = &cli.Command{ return xerrors.Errorf("marshaling storage config: %w", err) } - if err := ioutil.WriteFile(filepath.Join(lr.Path(), "sectorstore.json"), b, 0644); err != nil { + if err := os.WriteFile(filepath.Join(lr.Path(), "sectorstore.json"), b, 0644); err != nil { return xerrors.Errorf("persisting storage metadata (%s): %w", filepath.Join(lr.Path(), "sectorstore.json"), err) } @@ -292,7 +291,7 @@ func migratePreSealMeta(ctx context.Context, api v1api.FullNode, metadata string return xerrors.Errorf("expanding preseal dir: %w", err) } - b, err := ioutil.ReadFile(metadata) + b, err := os.ReadFile(metadata) if err != nil { return xerrors.Errorf("reading preseal metadata: %w", err) } diff --git a/cmd/lotus-miner/init_restore.go b/cmd/lotus-miner/init_restore.go index 618825a27b..7e28729bbe 100644 --- a/cmd/lotus-miner/init_restore.go +++ b/cmd/lotus-miner/init_restore.go @@ -3,7 +3,6 @@ package main import ( "context" "encoding/json" - "io/ioutil" "os" "github.com/docker/go-units" @@ -59,7 +58,7 @@ var restoreCmd = &cli.Command{ return xerrors.Errorf("expanding storage config path: %w", err) } - cfb, err := ioutil.ReadFile(cf) + cfb, err := os.ReadFile(cf) if err != nil { return xerrors.Errorf("reading storage config: %w", err) } @@ -189,7 +188,7 @@ func restore(ctx context.Context, cctx *cli.Context, targetPath string, strConfi return } - ff, err := config.FromFile(cf, rcfg) + ff, err := config.FromFile(cf, config.SetDefault(func() (interface{}, error) { return rcfg, nil })) if err != nil { cerr = xerrors.Errorf("loading config: %w", err) return diff --git a/cmd/lotus-miner/market.go b/cmd/lotus-miner/market.go index ce0d6890c8..29eb662a78 100644 --- a/cmd/lotus-miner/market.go +++ b/cmd/lotus-miner/market.go @@ -24,7 +24,7 @@ import ( "golang.org/x/xerrors" cborutil "github.com/filecoin-project/go-cbor-util" - datatransfer "github.com/filecoin-project/go-data-transfer" + datatransfer "github.com/filecoin-project/go-data-transfer/v2" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/abi" diff --git a/cmd/lotus-miner/proving.go b/cmd/lotus-miner/proving.go index 9ae8bdd485..3ecc58ba7a 100644 --- a/cmd/lotus-miner/proving.go +++ b/cmd/lotus-miner/proving.go @@ -19,6 +19,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/proof" "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/build" @@ -640,7 +641,46 @@ It will not send any messages to the chain.`, if err != nil { return err } - jr, err := json.Marshal(res) + + //convert sector information into easily readable information + type PoStPartition struct { + Index uint64 + Skipped []uint64 + } + type SubmitWindowedPoStParams struct { + Deadline uint64 + Partitions []PoStPartition + Proofs []proof.PoStProof + ChainCommitEpoch abi.ChainEpoch + ChainCommitRand abi.Randomness + } + var postParams []SubmitWindowedPoStParams + for _, i := range res { + var postParam SubmitWindowedPoStParams + postParam.Deadline = i.Deadline + + // Initialize the postParam.Partitions slice with the same length as i.Partitions + postParam.Partitions = make([]PoStPartition, len(i.Partitions)) + + for id, part := range i.Partitions { + postParam.Partitions[id].Index = part.Index + count, err := part.Skipped.Count() + if err != nil { + return err + } + sectors, err := part.Skipped.All(count) + if err != nil { + return err + } + postParam.Partitions[id].Skipped = sectors + } + postParam.Proofs = i.Proofs + postParam.ChainCommitEpoch = i.ChainCommitEpoch + postParam.ChainCommitRand = i.ChainCommitRand + postParams = append(postParams, postParam) + } + + jr, err := json.MarshalIndent(postParams, "", " ") if err != nil { return err } diff --git a/cmd/lotus-miner/retrieval-deals.go b/cmd/lotus-miner/retrieval-deals.go index 9fa943f4f9..42b0fa1f6f 100644 --- a/cmd/lotus-miner/retrieval-deals.go +++ b/cmd/lotus-miner/retrieval-deals.go @@ -3,13 +3,11 @@ package main import ( "fmt" "os" - "sort" "text/tabwriter" "github.com/docker/go-units" "github.com/urfave/cli/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/chain/types" @@ -21,7 +19,6 @@ var retrievalDealsCmd = &cli.Command{ Usage: "Manage retrieval deals and related configuration", Subcommands: []*cli.Command{ retrievalDealSelectionCmd, - retrievalDealsListCmd, retrievalSetAskCmd, retrievalGetAskCmd, }, @@ -124,48 +121,6 @@ var retrievalDealSelectionRejectCmd = &cli.Command{ }, } -var retrievalDealsListCmd = &cli.Command{ - Name: "list", - Usage: "List all active retrieval deals for this miner", - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - deals, err := api.MarketListRetrievalDeals(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - sort.Slice(deals, func(i, j int) bool { - return deals[i].ID < deals[j].ID - }) - - w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0) - - _, _ = fmt.Fprintf(w, "Receiver\tDealID\tPayload\tState\tPricePerByte\tBytesSent\tMessage\n") - - for _, deal := range deals { - payloadCid := deal.PayloadCID.String() - - _, _ = fmt.Fprintf(w, - "%s\t%d\t%s\t%s\t%s\t%d\t%s\n", - deal.Receiver.String(), - deal.ID, - "..."+payloadCid[len(payloadCid)-8:], - retrievalmarket.DealStatuses[deal.Status], - deal.PricePerByte.String(), - deal.TotalSent, - deal.Message, - ) - } - - return w.Flush() - }, -} - var retrievalSetAskCmd = &cli.Command{ Name: "set-ask", Usage: "Configure the provider's retrieval ask", diff --git a/cmd/lotus-miner/sectors.go b/cmd/lotus-miner/sectors.go index da07901f79..8d3a4c8847 100644 --- a/cmd/lotus-miner/sectors.go +++ b/cmd/lotus-miner/sectors.go @@ -9,6 +9,7 @@ import ( "sort" "strconv" "strings" + "sync" "time" "github.com/docker/go-units" @@ -29,15 +30,19 @@ import ( "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner" + "github.com/filecoin-project/lotus/chain/actors/builtin/verifreg" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" cliutil "github.com/filecoin-project/lotus/cli/util" + "github.com/filecoin-project/lotus/lib/result" "github.com/filecoin-project/lotus/lib/strle" "github.com/filecoin-project/lotus/lib/tablewriter" sealing "github.com/filecoin-project/lotus/storage/pipeline" ) +const parallelSectorChecks = 300 + var sectorsCmd = &cli.Command{ Name: "sectors", Usage: "interact with sector store", @@ -306,9 +311,15 @@ var sectorsListCmd = &cli.Command{ Usage: "only show sectors which aren't in the 'Proving' state", Aliases: []string{"u"}, }, + &cli.Int64Flag{ + Name: "check-parallelism", + Usage: "number of parallel requests to make for checking sector states", + Value: parallelSectorChecks, + }, }, Action: func(cctx *cli.Context) error { - minerApi, closer, err := lcli.GetStorageMinerAPI(cctx) + // http mode allows for parallel json decoding/encoding, which was a bottleneck here + minerApi, closer, err := lcli.GetStorageMinerAPI(cctx, cliutil.StorageMinerUseHttp) if err != nil { return err } @@ -407,16 +418,37 @@ var sectorsListCmd = &cli.Command{ fast := cctx.Bool("fast") - for _, s := range list { - st, err := minerApi.SectorsStatus(ctx, s, !fast) - if err != nil { + throttle := make(chan struct{}, cctx.Int64("check-parallelism")) + + slist := make([]result.Result[api.SectorInfo], len(list)) + var wg sync.WaitGroup + for i, s := range list { + throttle <- struct{}{} + wg.Add(1) + go func(i int, s abi.SectorNumber) { + defer wg.Done() + defer func() { <-throttle }() + r := result.Wrap(minerApi.SectorsStatus(ctx, s, !fast)) + if r.Error != nil { + r.Value.SectorID = s + } + slist[i] = r + }(i, s) + } + wg.Wait() + + for _, rsn := range slist { + if rsn.Error != nil { tw.Write(map[string]interface{}{ - "ID": s, + "ID": rsn.Value.SectorID, "Error": err, }) continue } + st := rsn.Value + s := st.SectorID + if !showRemoved && st.State == api.SectorState(sealing.Removed) { continue } @@ -678,7 +710,7 @@ type PseudoExtendSectorExpirationParams struct { Extensions []PseudoExpirationExtension } -func NewPseudoExtendParams(p *miner.ExtendSectorExpirationParams) (*PseudoExtendSectorExpirationParams, error) { +func NewPseudoExtendParams(p *miner.ExtendSectorExpiration2Params) (*PseudoExtendSectorExpirationParams, error) { res := PseudoExtendSectorExpirationParams{} for _, ext := range p.Extensions { scount, err := ext.Sectors.Count() @@ -802,6 +834,10 @@ var sectorsExtendCmd = &cli.Command{ Name: "only-cc", Usage: "only extend CC sectors (useful for making sector ready for snap upgrade)", }, + &cli.BoolFlag{ + Name: "drop-claims", + Usage: "drop claims for sectors that can be extended, but only by dropping some of their verified power claims", + }, &cli.Int64Flag{ Name: "tolerance", Usage: "don't try to extend sectors by fewer than this number of epochs, defaults to 7 days", @@ -814,7 +850,7 @@ var sectorsExtendCmd = &cli.Command{ }, &cli.Int64Flag{ Name: "max-sectors", - Usage: "the maximum number of sectors contained in each message message", + Usage: "the maximum number of sectors contained in each message", }, &cli.BoolFlag{ Name: "really-do-it", @@ -869,7 +905,8 @@ var sectorsExtendCmd = &cli.Command{ } tbs := blockstore.NewTieredBstore(blockstore.NewAPIBlockstore(fullApi), blockstore.NewMemory()) - mas, err := lminer.Load(adt.WrapStore(ctx, cbor.NewCborStore(tbs)), mact) + adtStore := adt.WrapStore(ctx, cbor.NewCborStore(tbs)) + mas, err := lminer.Load(adtStore, mact) if err != nil { return err } @@ -1020,44 +1057,125 @@ var sectorsExtendCmd = &cli.Command{ } } - var params []miner.ExtendSectorExpirationParams + verifregAct, err := fullApi.StateGetActor(ctx, builtin.VerifiedRegistryActorAddr, types.EmptyTSK) + if err != nil { + return xerrors.Errorf("failed to lookup verifreg actor: %w", err) + } + + verifregSt, err := verifreg.Load(adtStore, verifregAct) + if err != nil { + return xerrors.Errorf("failed to load verifreg state: %w", err) + } + + claimsMap, err := verifregSt.GetClaims(maddr) + if err != nil { + return xerrors.Errorf("failed to lookup claims for miner: %w", err) + } + + claimIdsBySector, err := verifregSt.GetClaimIdsBySector(maddr) + if err != nil { + return xerrors.Errorf("failed to lookup claim IDs by sector: %w", err) + } + + sectorsMax, err := policy.GetAddressedSectorsMax(nv) + if err != nil { + return err + } + + declMax, err := policy.GetDeclarationsMax(nv) + if err != nil { + return err + } + + addrSectors := sectorsMax + if cctx.Int("max-sectors") != 0 { + addrSectors = cctx.Int("max-sectors") + if addrSectors > sectorsMax { + return xerrors.Errorf("the specified max-sectors exceeds the maximum limit") + } + } + + var params []miner.ExtendSectorExpiration2Params - p := miner.ExtendSectorExpirationParams{} + p := miner.ExtendSectorExpiration2Params{} scount := 0 for l, exts := range extensions { for newExp, numbers := range exts { - scount += len(numbers) - var addrSectors int - sectorsMax, err := policy.GetAddressedSectorsMax(nv) - if err != nil { - return err - } - if cctx.Int("max-sectors") == 0 { - addrSectors = sectorsMax - } else { - addrSectors = cctx.Int("max-sectors") - if addrSectors > sectorsMax { - return xerrors.Errorf("the specified max-sectors exceeds the maximum limit") + sectorsWithoutClaimsToExtend := bitfield.New() + var sectorsWithClaims []miner.SectorClaim + for _, sectorNumber := range numbers { + claimIdsToMaintain := make([]verifreg.ClaimId, 0) + claimIdsToDrop := make([]verifreg.ClaimId, 0) + cannotExtendSector := false + claimIds, ok := claimIdsBySector[sectorNumber] + // Nothing to check, add to ccSectors + if !ok { + sectorsWithoutClaimsToExtend.Set(uint64(sectorNumber)) + } else { + for _, claimId := range claimIds { + claim, ok := claimsMap[claimId] + if !ok { + return xerrors.Errorf("failed to find claim for claimId %d", claimId) + } + claimExpiration := claim.TermStart + claim.TermMax + // can be maintained in the extended sector + if claimExpiration > newExp { + claimIdsToMaintain = append(claimIdsToMaintain, claimId) + } else { + sectorInfo, ok := activeSectorsInfo[sectorNumber] + if !ok { + return xerrors.Errorf("failed to find sector in active sector set: %w", err) + } + if !cctx.Bool("drop-claims") || + // FIP-0045 requires the claim minimum duration to have passed + currEpoch <= (claim.TermStart+claim.TermMin) || + // FIP-0045 requires the sector to be in its last 30 days of life + (currEpoch <= sectorInfo.Expiration-builtin.EndOfLifeClaimDropPeriod) { + fmt.Printf("skipping sector %d because claim %d does not live long enough \n", sectorNumber, claimId) + cannotExtendSector = true + break + } + + claimIdsToDrop = append(claimIdsToDrop, claimId) + } + } + if cannotExtendSector { + continue + } + + if len(claimIdsToMaintain)+len(claimIdsToDrop) != 0 { + sectorsWithClaims = append(sectorsWithClaims, miner.SectorClaim{ + SectorNumber: sectorNumber, + MaintainClaims: claimIdsToMaintain, + DropClaims: claimIdsToDrop, + }) + } } } - declMax, err := policy.GetDeclarationsMax(nv) + sectorsWithoutClaimsCount, err := sectorsWithoutClaimsToExtend.Count() if err != nil { - return err + return xerrors.Errorf("failed to count cc sectors: %w", err) } - if scount > addrSectors || len(p.Extensions) == declMax { + + sectorsInDecl := int(sectorsWithoutClaimsCount) + len(sectorsWithClaims) + scount += sectorsInDecl + + if scount > addrSectors || len(p.Extensions) >= declMax { params = append(params, p) - p = miner.ExtendSectorExpirationParams{} - scount = len(numbers) + p = miner.ExtendSectorExpiration2Params{} + scount = sectorsInDecl } - p.Extensions = append(p.Extensions, miner.ExpirationExtension{ - Deadline: l.Deadline, - Partition: l.Partition, - Sectors: SectorNumsToBitfield(numbers), - NewExpiration: newExp, + p.Extensions = append(p.Extensions, miner.ExpirationExtension2{ + Deadline: l.Deadline, + Partition: l.Partition, + Sectors: SectorNumsToBitfield(numbers), + SectorsWithClaims: sectorsWithClaims, + NewExpiration: newExp, }) + } } @@ -1113,7 +1231,7 @@ var sectorsExtendCmd = &cli.Command{ smsg, err := fullApi.MpoolPushMessage(ctx, &types.Message{ From: mi.Worker, To: maddr, - Method: builtin.MethodsMiner.ExtendSectorExpiration, + Method: builtin.MethodsMiner.ExtendSectorExpiration2, Value: big.Zero(), Params: sp, }, spec) diff --git a/cmd/lotus-miner/storage.go b/cmd/lotus-miner/storage.go index a5aa354f8d..89353497dc 100644 --- a/cmd/lotus-miner/storage.go +++ b/cmd/lotus-miner/storage.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "math/bits" "os" "path/filepath" @@ -167,7 +166,7 @@ over time return xerrors.Errorf("marshaling storage config: %w", err) } - if err := ioutil.WriteFile(filepath.Join(p, metaFile), b, 0644); err != nil { + if err := os.WriteFile(filepath.Join(p, metaFile), b, 0644); err != nil { return xerrors.Errorf("persisting storage metadata (%s): %w", filepath.Join(p, metaFile), err) } } diff --git a/cmd/lotus-pcr/main.go b/cmd/lotus-pcr/main.go index 57eaf0ad67..199810e03c 100644 --- a/cmd/lotus-pcr/main.go +++ b/cmd/lotus-pcr/main.go @@ -7,7 +7,6 @@ import ( "encoding/csv" "fmt" "io" - "io/ioutil" "net/http" _ "net/http/pprof" "os" @@ -759,7 +758,7 @@ func (r *refunder) EnsureMinerMinimums(ctx context.Context, tipset *types.TipSet return nil, err } - w := ioutil.Discard + w := io.Discard if len(output) != 0 { f, err := os.Create(output) if err != nil { @@ -1299,7 +1298,7 @@ func loadChainEpoch(fn string) (abi.ChainEpoch, error) { err = f.Close() }() - raw, err := ioutil.ReadAll(f) + raw, err := io.ReadAll(f) if err != nil { return 0, err } diff --git a/cmd/lotus-seed/genesis.go b/cmd/lotus-seed/genesis.go index 1ab6a465af..9fdce456bf 100644 --- a/cmd/lotus-seed/genesis.go +++ b/cmd/lotus-seed/genesis.go @@ -4,7 +4,6 @@ import ( "encoding/csv" "encoding/json" "fmt" - "io/ioutil" "os" "strconv" "strings" @@ -80,7 +79,7 @@ var genesisNewCmd = &cli.Command{ return err } - if err := ioutil.WriteFile(genf, genb, 0644); err != nil { + if err := os.WriteFile(genf, genb, 0644); err != nil { return err } @@ -103,7 +102,7 @@ var genesisAddMinerCmd = &cli.Command{ } var template genesis.Template - genb, err := ioutil.ReadFile(genf) + genb, err := os.ReadFile(genf) if err != nil { return xerrors.Errorf("read genesis template: %w", err) } @@ -117,7 +116,7 @@ var genesisAddMinerCmd = &cli.Command{ return xerrors.Errorf("expand preseal file path: %w", err) } miners := map[string]genesis.Miner{} - minb, err := ioutil.ReadFile(minf) + minb, err := os.ReadFile(minf) if err != nil { return xerrors.Errorf("read preseal file: %w", err) } @@ -156,7 +155,7 @@ var genesisAddMinerCmd = &cli.Command{ return err } - if err := ioutil.WriteFile(genf, genb, 0644); err != nil { + if err := os.WriteFile(genf, genb, 0644); err != nil { return err } @@ -196,7 +195,7 @@ var genesisAddMsigsCmd = &cli.Command{ } var template genesis.Template - b, err := ioutil.ReadFile(genf) + b, err := os.ReadFile(genf) if err != nil { return xerrors.Errorf("read genesis template: %w", err) } @@ -237,7 +236,7 @@ var genesisAddMsigsCmd = &cli.Command{ return err } - if err := ioutil.WriteFile(genf, b, 0644); err != nil { + if err := os.WriteFile(genf, b, 0644); err != nil { return err } return nil @@ -339,7 +338,7 @@ var genesisSetVRKCmd = &cli.Command{ } var template genesis.Template - b, err := ioutil.ReadFile(genf) + b, err := os.ReadFile(genf) if err != nil { return xerrors.Errorf("read genesis template: %w", err) } @@ -404,7 +403,7 @@ var genesisSetVRKCmd = &cli.Command{ return err } - if err := ioutil.WriteFile(genf, b, 0644); err != nil { + if err := os.WriteFile(genf, b, 0644); err != nil { return err } return nil @@ -435,7 +434,7 @@ var genesisSetRemainderCmd = &cli.Command{ } var template genesis.Template - b, err := ioutil.ReadFile(genf) + b, err := os.ReadFile(genf) if err != nil { return xerrors.Errorf("read genesis template: %w", err) } @@ -500,7 +499,7 @@ var genesisSetRemainderCmd = &cli.Command{ return err } - if err := ioutil.WriteFile(genf, b, 0644); err != nil { + if err := os.WriteFile(genf, b, 0644); err != nil { return err } return nil @@ -529,7 +528,7 @@ var genesisSetActorVersionCmd = &cli.Command{ } var template genesis.Template - b, err := ioutil.ReadFile(genf) + b, err := os.ReadFile(genf) if err != nil { return xerrors.Errorf("read genesis template: %w", err) } @@ -550,7 +549,7 @@ var genesisSetActorVersionCmd = &cli.Command{ return err } - if err := ioutil.WriteFile(genf, b, 0644); err != nil { + if err := os.WriteFile(genf, b, 0644); err != nil { return err } return nil @@ -607,7 +606,7 @@ var genesisSetVRKSignersCmd = &cli.Command{ } var template genesis.Template - b, err := ioutil.ReadFile(genf) + b, err := os.ReadFile(genf) if err != nil { return xerrors.Errorf("read genesis template: %w", err) } @@ -662,7 +661,7 @@ var genesisSetVRKSignersCmd = &cli.Command{ return err } - if err := ioutil.WriteFile(genf, b, 0644); err != nil { + if err := os.WriteFile(genf, b, 0644); err != nil { return err } return nil diff --git a/cmd/lotus-seed/main.go b/cmd/lotus-seed/main.go index 7567f63939..863a508f22 100644 --- a/cmd/lotus-seed/main.go +++ b/cmd/lotus-seed/main.go @@ -4,7 +4,6 @@ import ( "encoding/hex" "encoding/json" "fmt" - "io/ioutil" "os" "github.com/docker/go-units" @@ -114,7 +113,7 @@ var preSealCmd = &cli.Command{ var k *types.KeyInfo if c.String("key") != "" { k = new(types.KeyInfo) - kh, err := ioutil.ReadFile(c.String("key")) + kh, err := os.ReadFile(c.String("key")) if err != nil { return err } diff --git a/cmd/lotus-seed/seed/seed.go b/cmd/lotus-seed/seed/seed.go index b986737127..48f00f8a63 100644 --- a/cmd/lotus-seed/seed/seed.go +++ b/cmd/lotus-seed/seed/seed.go @@ -6,7 +6,6 @@ import ( "encoding/hex" "encoding/json" "fmt" - "io/ioutil" "os" "path/filepath" @@ -135,7 +134,7 @@ func PreSeal(maddr address.Address, spt abi.RegisteredSealProof, offset abi.Sect return nil, nil, xerrors.Errorf("marshaling storage config: %w", err) } - if err := ioutil.WriteFile(filepath.Join(sbroot, "sectorstore.json"), b, 0644); err != nil { + if err := os.WriteFile(filepath.Join(sbroot, "sectorstore.json"), b, 0644); err != nil { return nil, nil, xerrors.Errorf("persisting storage metadata (%s): %w", filepath.Join(sbroot, "storage.json"), err) } } @@ -228,7 +227,7 @@ func WriteGenesisMiner(maddr address.Address, sbroot string, gm *genesis.Miner, log.Infof("Writing preseal manifest to %s", filepath.Join(sbroot, "pre-seal-"+maddr.String()+".json")) - if err := ioutil.WriteFile(filepath.Join(sbroot, "pre-seal-"+maddr.String()+".json"), out, 0664); err != nil { + if err := os.WriteFile(filepath.Join(sbroot, "pre-seal-"+maddr.String()+".json"), out, 0664); err != nil { return err } @@ -239,7 +238,7 @@ func WriteGenesisMiner(maddr address.Address, sbroot string, gm *genesis.Miner, } // TODO: allow providing key - if err := ioutil.WriteFile(filepath.Join(sbroot, "pre-seal-"+maddr.String()+".key"), []byte(hex.EncodeToString(b)), 0664); err != nil { + if err := os.WriteFile(filepath.Join(sbroot, "pre-seal-"+maddr.String()+".key"), []byte(hex.EncodeToString(b)), 0664); err != nil { return err } } diff --git a/cmd/lotus-shed/balances.go b/cmd/lotus-shed/balances.go index bd3476ea83..445ace9bb9 100644 --- a/cmd/lotus-shed/balances.go +++ b/cmd/lotus-shed/balances.go @@ -514,7 +514,7 @@ var chainBalanceStateCmd = &cli.Command{ cst := cbor.NewCborStore(bs) store := adt.WrapStore(ctx, cst) - sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil) + sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil, mds) if err != nil { return err } @@ -739,7 +739,7 @@ var chainPledgeCmd = &cli.Command{ cst := cbor.NewCborStore(bs) store := adt.WrapStore(ctx, cst) - sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil) + sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil, mds) if err != nil { return err } diff --git a/cmd/lotus-shed/base16.go b/cmd/lotus-shed/base16.go index a5d3848154..28ea4916ff 100644 --- a/cmd/lotus-shed/base16.go +++ b/cmd/lotus-shed/base16.go @@ -4,7 +4,6 @@ import ( "encoding/hex" "fmt" "io" - "io/ioutil" "os" "strings" @@ -30,7 +29,7 @@ var base16Cmd = &cli.Command{ input = strings.NewReader(cctx.Args().First()) } - bytes, err := ioutil.ReadAll(input) + bytes, err := io.ReadAll(input) if err != nil { return nil } diff --git a/cmd/lotus-shed/base32.go b/cmd/lotus-shed/base32.go index 66e180ddc0..d2ea3dd7ab 100644 --- a/cmd/lotus-shed/base32.go +++ b/cmd/lotus-shed/base32.go @@ -3,7 +3,6 @@ package main import ( "fmt" "io" - "io/ioutil" "os" "strings" @@ -30,7 +29,7 @@ var base32Cmd = &cli.Command{ input = strings.NewReader(cctx.Args().First()) } - bytes, err := ioutil.ReadAll(input) + bytes, err := io.ReadAll(input) if err != nil { return nil } diff --git a/cmd/lotus-shed/base64.go b/cmd/lotus-shed/base64.go index cacc601528..19afa66134 100644 --- a/cmd/lotus-shed/base64.go +++ b/cmd/lotus-shed/base64.go @@ -4,7 +4,6 @@ import ( "encoding/base64" "fmt" "io" - "io/ioutil" "os" "strings" @@ -38,7 +37,7 @@ var base64Cmd = &cli.Command{ input = strings.NewReader(cctx.Args().First()) } - bytes, err := ioutil.ReadAll(input) + bytes, err := io.ReadAll(input) if err != nil { return nil } diff --git a/cmd/lotus-shed/bitfield.go b/cmd/lotus-shed/bitfield.go index f0824de4f2..5ac75b2c61 100644 --- a/cmd/lotus-shed/bitfield.go +++ b/cmd/lotus-shed/bitfield.go @@ -5,7 +5,6 @@ import ( "encoding/hex" "fmt" "io" - "io/ioutil" "os" "github.com/urfave/cli/v2" @@ -318,7 +317,7 @@ func decodeToByte(cctx *cli.Context, i int) ([]byte, error) { if i > 0 { return nil, xerrors.Errorf("need more than %d args", i) } - r, err := ioutil.ReadAll(os.Stdin) + r, err := io.ReadAll(os.Stdin) if err != nil { return nil, err } diff --git a/cmd/lotus-shed/fip-0036.go b/cmd/lotus-shed/fip-0036.go index 1929eb4ddb..6a4609eed8 100644 --- a/cmd/lotus-shed/fip-0036.go +++ b/cmd/lotus-shed/fip-0036.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" + "os" "sort" "strconv" @@ -532,7 +532,7 @@ var finalResultCmd = &cli.Command{ // Returns voted sorted by votes from earliest to latest func getVotesMap(file string) ([]Vote, error) { var votes []Vote - vb, err := ioutil.ReadFile(file) + vb, err := os.ReadFile(file) if err != nil { return nil, xerrors.Errorf("read vote: %w", err) } diff --git a/cmd/lotus-shed/gas-estimation.go b/cmd/lotus-shed/gas-estimation.go index 6a16770f1f..3538e0abe5 100644 --- a/cmd/lotus-shed/gas-estimation.go +++ b/cmd/lotus-shed/gas-estimation.go @@ -112,7 +112,7 @@ var gasTraceCmd = &cli.Command{ cs := store.NewChainStore(bs, bs, mds, filcns.Weight, nil) defer cs.Close() //nolint:errcheck - sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), shd) + sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), shd, mds) if err != nil { return err } @@ -214,7 +214,7 @@ var replayOfflineCmd = &cli.Command{ cs := store.NewChainStore(bs, bs, mds, filcns.Weight, nil) defer cs.Close() //nolint:errcheck - sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), shd) + sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), shd, mds) if err != nil { return err } @@ -242,7 +242,7 @@ var replayOfflineCmd = &cli.Command{ } tw := tabwriter.NewWriter(os.Stdout, 8, 2, 2, ' ', tabwriter.AlignRight) - res, err := sm.CallWithGas(ctx, msg, []types.ChainMsg{}, executionTs) + res, err := sm.CallWithGas(ctx, msg, []types.ChainMsg{}, executionTs, true) if err != nil { return err } diff --git a/cmd/lotus-shed/invariants.go b/cmd/lotus-shed/invariants.go index 08b015bf10..3465ea051a 100644 --- a/cmd/lotus-shed/invariants.go +++ b/cmd/lotus-shed/invariants.go @@ -91,7 +91,7 @@ var invariantsCmd = &cli.Command{ cs := store.NewChainStore(bs, bs, mds, filcns.Weight, nil) defer cs.Close() //nolint:errcheck - sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil) + sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil, mds) if err != nil { return err } diff --git a/cmd/lotus-shed/jwt.go b/cmd/lotus-shed/jwt.go index e8853b419b..2a24c25693 100644 --- a/cmd/lotus-shed/jwt.go +++ b/cmd/lotus-shed/jwt.go @@ -7,7 +7,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "strings" @@ -81,7 +80,7 @@ var jwtTokenCmd = &cli.Command{ defer inputFile.Close() //nolint:errcheck input := bufio.NewReader(inputFile) - encoded, err := ioutil.ReadAll(input) + encoded, err := io.ReadAll(input) if err != nil { return err } @@ -123,7 +122,7 @@ var jwtTokenCmd = &cli.Command{ return err } - return ioutil.WriteFile(cctx.String("output"), token, 0600) + return os.WriteFile(cctx.String("output"), token, 0600) }, } @@ -142,7 +141,7 @@ var jwtNewCmd = &cli.Command{ keyName := cctx.Args().First() - sk, err := ioutil.ReadAll(io.LimitReader(rand.Reader, 32)) + sk, err := io.ReadAll(io.LimitReader(rand.Reader, 32)) if err != nil { return err } @@ -184,6 +183,6 @@ var jwtNewCmd = &cli.Command{ } filenameToken := fmt.Sprintf("jwt-%s.token", keyName) - return ioutil.WriteFile(filenameToken, token, 0600) + return os.WriteFile(filenameToken, token, 0600) }, } diff --git a/cmd/lotus-shed/keyinfo.go b/cmd/lotus-shed/keyinfo.go index 1c322f7d6a..d9a1e8dcbc 100644 --- a/cmd/lotus-shed/keyinfo.go +++ b/cmd/lotus-shed/keyinfo.go @@ -7,7 +7,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "path" "strings" @@ -68,7 +67,7 @@ var keyinfoVerifyCmd = &cli.Command{ defer inputFile.Close() //nolint:errcheck input := bufio.NewReader(inputFile) - keyContent, err := ioutil.ReadAll(input) + keyContent, err := io.ReadAll(input) if err != nil { return err } @@ -167,7 +166,7 @@ var keyinfoImportCmd = &cli.Command{ input = bufio.NewReader(inputFile) } - encoded, err := ioutil.ReadAll(input) + encoded, err := io.ReadAll(input) if err != nil { return err } @@ -279,7 +278,7 @@ var keyinfoInfoCmd = &cli.Command{ input = bufio.NewReader(inputFile) } - encoded, err := ioutil.ReadAll(input) + encoded, err := io.ReadAll(input) if err != nil { return err } diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index bcbf3d7329..41506f6388 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -8,6 +8,7 @@ import ( "time" "github.com/ipfs/go-cid" + "github.com/ipfs/go-datastore" "github.com/urfave/cli/v2" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" @@ -17,6 +18,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/builtin" + v10 "github.com/filecoin-project/go-state-types/builtin/v10" market8 "github.com/filecoin-project/go-state-types/builtin/v8/market" adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" v9 "github.com/filecoin-project/go-state-types/builtin/v9" @@ -121,7 +123,8 @@ var migrationsCmd = &cli.Command{ cs := store.NewChainStore(bs, bs, mds, filcns.Weight, nil) defer cs.Close() //nolint:errcheck - sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil) + // Note: we use a map datastore for the metadata to avoid writing / using cached migration results in the metadata store + sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil, datastore.NewMapDatastore()) if err != nil { return err } @@ -153,7 +156,7 @@ var migrationsCmd = &cli.Command{ if !cctx.IsSet("skip-pre-migration") { cache := mutil.NewMemMigrationCache() - ts1, err := cs.GetTipsetByHeight(ctx, blk.Height-240, migrationTs, false) + ts1, err := cs.GetTipsetByHeight(ctx, blk.Height-60, migrationTs, false) if err != nil { return err } @@ -165,21 +168,7 @@ var migrationsCmd = &cli.Command{ return err } - preMigration1Time := time.Since(startTime) - - ts2, err := cs.GetTipsetByHeight(ctx, blk.Height-15, migrationTs, false) - if err != nil { - return err - } - - startTime = time.Now() - - err = preUpgradeActorsFunc(ctx, sm, cache, ts2.ParentState(), ts2.Height()-1, ts2) - if err != nil { - return err - } - - preMigration2Time := time.Since(startTime) + preMigrationTime := time.Since(startTime) startTime = time.Now() @@ -194,8 +183,7 @@ var migrationsCmd = &cli.Command{ return xerrors.Errorf("got different results with and without the cache: %s, %s", newCid1, newCid2) } - fmt.Println("completed premigration 1, took ", preMigration1Time) - fmt.Println("completed premigration 2, took ", preMigration2Time) + fmt.Println("completed premigration, took ", preMigrationTime) fmt.Println("completed round actual (with cache), took ", cachedMigrationTime) } @@ -218,7 +206,7 @@ func getMigrationFuncsForNetwork(nv network.Version) (UpgradeActorsFunc, PreUpgr case network.Version17: return filcns.UpgradeActorsV9, filcns.PreUpgradeActorsV9, checkNv17Invariants, nil case network.Version18: - return filcns.UpgradeActorsV10, filcns.PreUpgradeActorsV10, nil, nil + return filcns.UpgradeActorsV10, filcns.PreUpgradeActorsV10, checkNv18Invariants, nil default: return nil, nil, nil, xerrors.Errorf("migration not implemented for nv%d", nv) } @@ -228,6 +216,40 @@ type UpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.Migrat type PreUpgradeActorsFunc = func(context.Context, *stmgr.StateManager, stmgr.MigrationCache, cid.Cid, abi.ChainEpoch, *types.TipSet) error type CheckInvariantsFunc = func(context.Context, cid.Cid, cid.Cid, blockstore.Blockstore, abi.ChainEpoch) error +func checkNv18Invariants(ctx context.Context, oldStateRootCid cid.Cid, newStateRootCid cid.Cid, bs blockstore.Blockstore, epoch abi.ChainEpoch) error { + actorStore := store.ActorStore(ctx, bs) + startTime := time.Now() + + // Load the new state root. + var newStateRoot types.StateRoot + if err := actorStore.Get(ctx, newStateRootCid, &newStateRoot); err != nil { + return xerrors.Errorf("failed to decode state root: %w", err) + } + + actorCodeCids, err := actors.GetActorCodeIDs(actorstypes.Version10) + if err != nil { + return err + } + newActorTree, err := builtin.LoadTree(actorStore, newStateRoot.Actors) + if err != nil { + return err + } + messages, err := v10.CheckStateInvariants(newActorTree, epoch, actorCodeCids) + if err != nil { + return xerrors.Errorf("checking state invariants: %w", err) + } + + for _, message := range messages.Messages() { + fmt.Println("got the following error: ", message) + } + + fmt.Println("completed invariant checks, took ", time.Since(startTime)) + + return nil +} + +/// NV17 and earlier stuff + func checkNv17Invariants(ctx context.Context, v8StateRootCid cid.Cid, v9StateRootCid cid.Cid, bs blockstore.Blockstore, epoch abi.ChainEpoch) error { actorStore := store.ActorStore(ctx, bs) startTime := time.Now() diff --git a/cmd/lotus-shed/rpc.go b/cmd/lotus-shed/rpc.go index 3be2693583..8ef7991292 100644 --- a/cmd/lotus-shed/rpc.go +++ b/cmd/lotus-shed/rpc.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" "os" @@ -97,7 +96,7 @@ var rpcCmd = &cli.Command{ return err } - rb, err := ioutil.ReadAll(resp.Body) + rb, err := io.ReadAll(resp.Body) if err != nil { return err } diff --git a/cmd/lotus-shed/sectors.go b/cmd/lotus-shed/sectors.go index 52d07f5b69..465b0e7726 100644 --- a/cmd/lotus-shed/sectors.go +++ b/cmd/lotus-shed/sectors.go @@ -18,6 +18,7 @@ import ( "github.com/ipfs/go-cid" "github.com/urfave/cli/v2" "golang.org/x/xerrors" + "gopkg.in/cheggaaa/pb.v1" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" @@ -31,6 +32,11 @@ import ( "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" "github.com/filecoin-project/lotus/lib/parmap" + "github.com/filecoin-project/lotus/node/repo" + "github.com/filecoin-project/lotus/storage/paths" + "github.com/filecoin-project/lotus/storage/sealer/fr32" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var sectorsCmd = &cli.Command{ @@ -42,6 +48,8 @@ var sectorsCmd = &cli.Command{ terminateSectorPenaltyEstimationCmd, visAllocatedSectorsCmd, dumpRLESectorCmd, + sectorReadCmd, + sectorDeleteCmd, }, } @@ -563,3 +571,219 @@ func rleToPng(rleBytes []byte) ([]byte, error) { return buf.Bytes(), nil } + +var sectorReadCmd = &cli.Command{ + Name: "read", + Usage: "read data from a sector into stdout", + ArgsUsage: "[sector num] [padded length] [padded offset]", + Description: `Read data from a sector. + +TIP: to get sectornum/len/offset for a piece you can use 'boostd pieces piece-info [cid]' + +fr32 padding is removed from the output.`, + Action: func(cctx *cli.Context) error { + if cctx.NArg() != 3 { + return xerrors.Errorf("must pass sectornum/len/offset") + } + + sectorNum, err := strconv.ParseUint(cctx.Args().Get(0), 10, 64) + if err != nil { + return xerrors.Errorf("parsing sector number: %w", err) + } + + length, err := strconv.ParseUint(cctx.Args().Get(1), 10, 64) + if err != nil { + return xerrors.Errorf("parsing length: %w", err) + } + + offset, err := strconv.ParseUint(cctx.Args().Get(2), 10, 64) + if err != nil { + return xerrors.Errorf("parsing offset: %w", err) + } + + ctx := lcli.ReqContext(cctx) + api, closer, err := lcli.GetStorageMinerAPI(cctx) + if err != nil { + return err + } + + maddr, err := api.ActorAddress(ctx) + if err != nil { + return xerrors.Errorf("getting miner actor address: %w", err) + } + + mid, err := address.IDFromAddress(maddr) + if err != nil { + return xerrors.Errorf("getting miner id: %w", err) + } + + sid := abi.SectorID{ + Miner: abi.ActorID(mid), + Number: abi.SectorNumber(sectorNum), + } + + si, err := api.SectorsStatus(ctx, sid.Number, false) + if err != nil { + return xerrors.Errorf("getting sector status: %w", err) + } + + sref := storiface.SectorRef{ + ID: sid, + ProofType: si.SealProof, + } + + defer closer() + + // Setup remote sector store + sminfo, err := lcli.GetAPIInfo(cctx, repo.StorageMiner) + if err != nil { + return xerrors.Errorf("could not get api info: %w", err) + } + + localStore, err := paths.NewLocal(ctx, &emptyLocalStorage{}, api, []string{}) + if err != nil { + return err + } + + remote := paths.NewRemote(localStore, api, sminfo.AuthHeader(), 10, + &paths.DefaultPartialFileHandler{}) + + readStarter, err := remote.Reader(ctx, sref, abi.PaddedPieceSize(offset), abi.PaddedPieceSize(length)) + if err != nil { + return xerrors.Errorf("getting reader: %w", err) + } + + rd, err := readStarter(0) + if err != nil { + return xerrors.Errorf("starting reader: %w", err) + } + + upr, err := fr32.NewUnpadReaderBuf(rd, abi.PaddedPieceSize(length), make([]byte, 1<<20)) + if err != nil { + return xerrors.Errorf("creating unpadded reader: %w", err) + } + + l := int64(abi.PaddedPieceSize(length).Unpadded()) + + bar := pb.New64(l) + br := bar.NewProxyReader(upr) + bar.ShowTimeLeft = true + bar.ShowPercent = true + bar.ShowSpeed = true + bar.Units = pb.U_BYTES + bar.Output = os.Stderr + bar.Start() + + _, err = io.CopyN(os.Stdout, br, l) + if err != nil { + return xerrors.Errorf("reading data: %w", err) + } + + return nil + }, +} + +var sectorDeleteCmd = &cli.Command{ + Name: "delete", + Usage: "delete a sector file from sector storage", + Flags: []cli.Flag{ + &cli.BoolFlag{ + Name: "really-do-it", + }, + }, + ArgsUsage: "[sector num] [file type]", + Action: func(cctx *cli.Context) error { + if cctx.NArg() != 2 { + return xerrors.Errorf("must pass sectornum/filetype") + } + + sectorNum, err := strconv.ParseUint(cctx.Args().Get(0), 10, 64) + if err != nil { + return xerrors.Errorf("parsing sector number: %w", err) + } + + var ft storiface.SectorFileType + switch cctx.Args().Get(1) { + case "cache": + ft = storiface.FTCache + case "sealed": + ft = storiface.FTSealed + case "unsealed": + ft = storiface.FTUnsealed + case "update-cache": + ft = storiface.FTUpdateCache + case "update": + ft = storiface.FTUpdate + default: + return xerrors.Errorf("invalid file type") + } + + ctx := lcli.ReqContext(cctx) + api, closer, err := lcli.GetStorageMinerAPI(cctx) + if err != nil { + return err + } + defer closer() + + maddr, err := api.ActorAddress(ctx) + if err != nil { + return xerrors.Errorf("getting miner actor address: %w", err) + } + + mid, err := address.IDFromAddress(maddr) + if err != nil { + return xerrors.Errorf("getting miner id: %w", err) + } + + sid := abi.SectorID{ + Miner: abi.ActorID(mid), + Number: abi.SectorNumber(sectorNum), + } + + // get remote store + sminfo, err := lcli.GetAPIInfo(cctx, repo.StorageMiner) + if err != nil { + return xerrors.Errorf("could not get api info: %w", err) + } + + localStore, err := paths.NewLocal(ctx, &emptyLocalStorage{}, api, []string{}) + if err != nil { + return err + } + + if !cctx.Bool("really-do-it") { + return xerrors.Errorf("pass --really-do-it to actually perform the deletion") + } + + remote := paths.NewRemote(localStore, api, sminfo.AuthHeader(), 10, + &paths.DefaultPartialFileHandler{}) + + err = remote.Remove(ctx, sid, ft, true, nil) + if err != nil { + return xerrors.Errorf("removing sector: %w", err) + } + + return nil + }, +} + +type emptyLocalStorage struct { +} + +func (e *emptyLocalStorage) GetStorage() (storiface.StorageConfig, error) { + return storiface.StorageConfig{}, nil +} + +func (e *emptyLocalStorage) SetStorage(f func(*storiface.StorageConfig)) error { + panic("don't call") +} + +func (e *emptyLocalStorage) Stat(path string) (fsutil.FsStat, error) { + panic("don't call") +} + +func (e *emptyLocalStorage) DiskUsage(path string) (int64, error) { + panic("don't call") +} + +var _ paths.LocalStorage = &emptyLocalStorage{} diff --git a/cmd/lotus-shed/state-stats.go b/cmd/lotus-shed/state-stats.go index 8ec4a0ff43..28fa79778d 100644 --- a/cmd/lotus-shed/state-stats.go +++ b/cmd/lotus-shed/state-stats.go @@ -9,7 +9,7 @@ import ( "sync" "github.com/docker/go-units" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "github.com/ipfs/go-blockservice" "github.com/ipfs/go-cid" offline "github.com/ipfs/go-ipfs-exchange-offline" @@ -50,13 +50,13 @@ type fieldItem struct { type cacheNodeGetter struct { ds format.NodeGetter - cache *lru.TwoQueueCache + cache *lru.TwoQueueCache[cid.Cid, format.Node] } func newCacheNodeGetter(d format.NodeGetter, size int) (*cacheNodeGetter, error) { cng := &cacheNodeGetter{ds: d} - cache, err := lru.New2Q(size) + cache, err := lru.New2Q[cid.Cid, format.Node](size) if err != nil { return nil, err } @@ -68,7 +68,7 @@ func newCacheNodeGetter(d format.NodeGetter, size int) (*cacheNodeGetter, error) func (cng *cacheNodeGetter) Get(ctx context.Context, c cid.Cid) (format.Node, error) { if n, ok := cng.cache.Get(c); ok { - return n.(format.Node), nil + return n, nil } n, err := cng.ds.Get(ctx, c) @@ -308,7 +308,7 @@ to reduce the number of decode operations performed by caching the decoded objec } tsExec := consensus.NewTipSetExecutor(filcns.RewardFunc) - sm, err := stmgr.NewStateManager(cs, tsExec, vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil) + sm, err := stmgr.NewStateManager(cs, tsExec, vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil, mds) if err != nil { return err } diff --git a/cmd/lotus-sim/simulation/node.go b/cmd/lotus-sim/simulation/node.go index 06e837f8f2..9b37da6c8d 100644 --- a/cmd/lotus-sim/simulation/node.go +++ b/cmd/lotus-sim/simulation/node.go @@ -106,7 +106,7 @@ func (nd *Node) LoadSim(ctx context.Context, name string) (*Simulation, error) { if err != nil { return nil, xerrors.Errorf("failed to create upgrade schedule for simulation %s: %w", name, err) } - sim.StateManager, err = stmgr.NewStateManager(nd.Chainstore, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(mock.Verifier), us, nil) + sim.StateManager, err = stmgr.NewStateManager(nd.Chainstore, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(mock.Verifier), us, nil, nd.MetadataDS) if err != nil { return nil, xerrors.Errorf("failed to create state manager for simulation %s: %w", name, err) } @@ -125,7 +125,7 @@ func (nd *Node) CreateSim(ctx context.Context, name string, head *types.TipSet) if err != nil { return nil, err } - sm, err := stmgr.NewStateManager(nd.Chainstore, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(mock.Verifier), filcns.DefaultUpgradeSchedule(), nil) + sm, err := stmgr.NewStateManager(nd.Chainstore, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(mock.Verifier), filcns.DefaultUpgradeSchedule(), nil, nd.MetadataDS) if err != nil { return nil, xerrors.Errorf("creating state manager: %w", err) } diff --git a/cmd/lotus-sim/simulation/simulation.go b/cmd/lotus-sim/simulation/simulation.go index 19ab391dc1..294f4cfbc3 100644 --- a/cmd/lotus-sim/simulation/simulation.go +++ b/cmd/lotus-sim/simulation/simulation.go @@ -201,7 +201,7 @@ func (sim *Simulation) SetUpgradeHeight(nv network.Version, epoch abi.ChainEpoch if err != nil { return err } - sm, err := stmgr.NewStateManager(sim.Node.Chainstore, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(mock.Verifier), newUpgradeSchedule, nil) + sm, err := stmgr.NewStateManager(sim.Node.Chainstore, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(mock.Verifier), newUpgradeSchedule, nil, sim.Node.MetadataDS) if err != nil { return err } diff --git a/cmd/lotus-worker/cli.go b/cmd/lotus-worker/cli.go index b1501fca74..393ece18c8 100644 --- a/cmd/lotus-worker/cli.go +++ b/cmd/lotus-worker/cli.go @@ -1,6 +1,8 @@ package main import ( + "fmt" + "github.com/urfave/cli/v2" "golang.org/x/xerrors" @@ -8,8 +10,9 @@ import ( ) var setCmd = &cli.Command{ - Name: "set", - Usage: "Manage worker settings", + Name: "set", + Usage: "Manage worker settings", + Hidden: true, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "enabled", @@ -18,6 +21,7 @@ var setCmd = &cli.Command{ }, }, Action: func(cctx *cli.Context) error { + fmt.Println("DEPRECATED: This command will be removed in the future") api, closer, err := lcli.GetWorkerAPI(cctx) if err != nil { return err @@ -35,9 +39,11 @@ var setCmd = &cli.Command{ } var waitQuietCmd = &cli.Command{ - Name: "wait-quiet", - Usage: "Block until all running tasks exit", + Name: "wait-quiet", + Usage: "Block until all running tasks exit", + Hidden: true, Action: func(cctx *cli.Context) error { + fmt.Println("DEPRECATED: This command will be removed in the future") api, closer, err := lcli.GetWorkerAPI(cctx) if err != nil { return err diff --git a/cmd/lotus-worker/main.go b/cmd/lotus-worker/main.go index bb7fa94d8f..e0a9312747 100644 --- a/cmd/lotus-worker/main.go +++ b/cmd/lotus-worker/main.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "net" "net/http" "os" @@ -257,7 +256,7 @@ var runCmd = &cli.Command{ &cli.IntFlag{ Name: "post-parallel-reads", Usage: "maximum number of parallel challenge reads (0 = no limit)", - Value: 128, + Value: 32, EnvVars: []string{"LOTUS_WORKER_POST_PARALLEL_READS"}, }, &cli.DurationFlag{ @@ -464,7 +463,7 @@ var runCmd = &cli.Command{ return xerrors.Errorf("marshaling storage config: %w", err) } - if err := ioutil.WriteFile(filepath.Join(lr.Path(), "sectorstore.json"), b, 0644); err != nil { + if err := os.WriteFile(filepath.Join(lr.Path(), "sectorstore.json"), b, 0644); err != nil { return xerrors.Errorf("persisting storage metadata (%s): %w", filepath.Join(lr.Path(), "sectorstore.json"), err) } diff --git a/cmd/lotus-worker/storage.go b/cmd/lotus-worker/storage.go index 6b5994c172..9e4bf1c9ba 100644 --- a/cmd/lotus-worker/storage.go +++ b/cmd/lotus-worker/storage.go @@ -2,7 +2,6 @@ package main import ( "encoding/json" - "io/ioutil" "os" "path/filepath" @@ -121,7 +120,7 @@ var storageAttachCmd = &cli.Command{ return xerrors.Errorf("marshaling storage config: %w", err) } - if err := ioutil.WriteFile(filepath.Join(p, metaFile), b, 0644); err != nil { + if err := os.WriteFile(filepath.Join(p, metaFile), b, 0644); err != nil { return xerrors.Errorf("persisting storage metadata (%s): %w", filepath.Join(p, metaFile), err) } } diff --git a/cmd/lotus/backup.go b/cmd/lotus/backup.go index 4bdd213228..efbac3e2bb 100644 --- a/cmd/lotus/backup.go +++ b/cmd/lotus/backup.go @@ -66,7 +66,7 @@ func restore(cctx *cli.Context, r repo.Repo) error { return } - ff, err := config.FromFile(cf, rcfg) + ff, err := config.FromFile(cf, config.SetDefault(func() (interface{}, error) { return rcfg, nil })) if err != nil { cerr = xerrors.Errorf("loading config: %w", err) return diff --git a/cmd/lotus/config.go b/cmd/lotus/config.go index fcb7e2b08f..4b323bfb22 100644 --- a/cmd/lotus/config.go +++ b/cmd/lotus/config.go @@ -31,7 +31,7 @@ var configDefaultCmd = &cli.Command{ Action: func(cctx *cli.Context) error { c := config.DefaultFullNode() - cb, err := config.ConfigUpdate(c, nil, !cctx.Bool("no-comment")) + cb, err := config.ConfigUpdate(c, nil, config.Commented(!cctx.Bool("no-comment")), config.DefaultKeepUncommented()) if err != nil { return err } @@ -83,7 +83,7 @@ var configUpdateCmd = &cli.Command{ cfgDef := config.DefaultFullNode() - updated, err := config.ConfigUpdate(cfgNode, cfgDef, !cctx.Bool("no-comment")) + updated, err := config.ConfigUpdate(cfgNode, cfgDef, config.Commented(!cctx.Bool("no-comment")), config.DefaultKeepUncommented()) if err != nil { return err } diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index b0f5a4a5ad..a1af1e9d16 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -544,7 +544,7 @@ func ImportChain(ctx context.Context, r repo.Repo, fname string, snapshot bool) } // TODO: We need to supply the actual beacon after v14 - stm, err := stmgr.NewStateManager(cst, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil) + stm, err := stmgr.NewStateManager(cst, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil, mds) if err != nil { return err } diff --git a/conformance/chaos/cbor_gen.go b/conformance/chaos/cbor_gen.go index 2deaaa53f5..5da16e16ff 100644 --- a/conformance/chaos/cbor_gen.go +++ b/conformance/chaos/cbor_gen.go @@ -223,7 +223,7 @@ func (t *CallerValidationArgs) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -712,7 +712,7 @@ func (t *SendReturn) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -812,7 +812,7 @@ func (t *MutateStateArgs) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -907,7 +907,7 @@ func (t *AbortWithArgs) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -1064,7 +1064,7 @@ func (t *InspectRuntimeReturn) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: diff --git a/conformance/corpus_test.go b/conformance/corpus_test.go index adbebbcc73..ec9f9d5164 100644 --- a/conformance/corpus_test.go +++ b/conformance/corpus_test.go @@ -5,7 +5,6 @@ package conformance import ( "encoding/json" - "io/ioutil" "os" "path/filepath" "strings" @@ -107,7 +106,7 @@ func TestConformance(t *testing.T) { // Run a test for each vector. for _, v := range vectors { path := filepath.Join(corpusRoot, v) - raw, err := ioutil.ReadFile(path) + raw, err := os.ReadFile(path) if err != nil { t.Fatalf("failed to read test raw file: %s", path) } diff --git a/conformance/driver.go b/conformance/driver.go index 3a32c76049..2680a7154d 100644 --- a/conformance/driver.go +++ b/conformance/driver.go @@ -108,7 +108,7 @@ func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, params cs = store.NewChainStore(bs, bs, ds, filcns.Weight, nil) tse = consensus.NewTipSetExecutor(filcns.RewardFunc) - sm, err = stmgr.NewStateManager(cs, tse, syscalls, filcns.DefaultUpgradeSchedule(), nil) + sm, err = stmgr.NewStateManager(cs, tse, syscalls, filcns.DefaultUpgradeSchedule(), nil, ds) ) if err != nil { return nil, err diff --git a/conformance/runner.go b/conformance/runner.go index ff738a4a5e..827c10a5cb 100644 --- a/conformance/runner.go +++ b/conformance/runner.go @@ -6,7 +6,6 @@ import ( "context" "encoding/base64" "fmt" - "io/ioutil" "math" "os" "os/exec" @@ -328,7 +327,7 @@ func dumpThreeWayStateDiff(r Reporter, vector *schema.TestVector, bs blockstore. // writeStateToTempCAR writes the provided roots to a temporary CAR that'll be // cleaned up via t.Cleanup(). It returns the full path of the temp file. func writeStateToTempCAR(bs blockstore.Blockstore, roots ...cid.Cid) (string, error) { - tmp, err := ioutil.TempFile("", "lotus-tests-*.car") + tmp, err := os.CreateTemp("", "lotus-tests-*.car") if err != nil { return "", fmt.Errorf("failed to create temp file to dump CAR for diffing: %w", err) } diff --git a/documentation/en/api-v0-methods-miner.md b/documentation/en/api-v0-methods-miner.md index d18be03f5b..1a14993050 100644 --- a/documentation/en/api-v0-methods-miner.md +++ b/documentation/en/api-v0-methods-miner.md @@ -1506,6 +1506,7 @@ Response: ``` ### MarketListRetrievalDeals +MarketListRetrievalDeals is deprecated, returns empty list Perms: read @@ -1515,48 +1516,7 @@ Inputs: `null` Response: ```json [ - { - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "Selector": { - "Raw": "Ynl0ZSBhcnJheQ==" - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "UnsealPrice": "0", - "StoreID": 42, - "ChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "PieceInfo": { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Deals": [ - { - "DealID": 5432, - "SectorID": 9, - "Offset": 1032, - "Length": 1032 - } - ] - }, - "Status": 0, - "Receiver": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "TotalSent": 42, - "FundsReceived": "0", - "Message": "string value", - "CurrentInterval": 42, - "LegacyProtocol": true - } + {} ] ``` diff --git a/documentation/en/api-v0-methods.md b/documentation/en/api-v0-methods.md index fe639b2f3b..b73244fa8f 100644 --- a/documentation/en/api-v0-methods.md +++ b/documentation/en/api-v0-methods.md @@ -2879,7 +2879,7 @@ Response: ], "SizeLimitHigh": 123, "SizeLimitLow": 123, - "ReplaceByFeeRatio": 12.3, + "ReplaceByFeeRatio": 1.23, "PruneCooldown": 60000000000, "GasLimitOverestimation": 12.3 } @@ -3167,7 +3167,7 @@ Inputs: ], "SizeLimitHigh": 123, "SizeLimitLow": 123, - "ReplaceByFeeRatio": 12.3, + "ReplaceByFeeRatio": 1.23, "PruneCooldown": 60000000000, "GasLimitOverestimation": 12.3 } @@ -4866,95 +4866,49 @@ Response: }, "ExecutionTrace": { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": [ { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": null @@ -5142,95 +5096,49 @@ Response: }, "ExecutionTrace": { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": [ { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": null @@ -6574,95 +6482,49 @@ Response: }, "ExecutionTrace": { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": [ { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": null diff --git a/documentation/en/api-v1-unstable-methods.md b/documentation/en/api-v1-unstable-methods.md index 94c0e1cebc..3993aaeb5d 100644 --- a/documentation/en/api-v1-unstable-methods.md +++ b/documentation/en/api-v1-unstable-methods.md @@ -13,6 +13,7 @@ * [ChainCheckBlockstore](#ChainCheckBlockstore) * [ChainDeleteObj](#ChainDeleteObj) * [ChainExport](#ChainExport) + * [ChainExportRangeInternal](#ChainExportRangeInternal) * [ChainGetBlock](#ChainGetBlock) * [ChainGetBlockMessages](#ChainGetBlockMessages) * [ChainGetEvents](#ChainGetEvents) @@ -28,6 +29,7 @@ * [ChainGetTipSetByHeight](#ChainGetTipSetByHeight) * [ChainHasObj](#ChainHasObj) * [ChainHead](#ChainHead) + * [ChainHotGC](#ChainHotGC) * [ChainNotify](#ChainNotify) * [ChainPrune](#ChainPrune) * [ChainPutObj](#ChainPutObj) @@ -68,6 +70,7 @@ * [CreateBackup](#CreateBackup) * [Eth](#Eth) * [EthAccounts](#EthAccounts) + * [EthAddressToFilecoinAddress](#EthAddressToFilecoinAddress) * [EthBlockNumber](#EthBlockNumber) * [EthCall](#EthCall) * [EthChainId](#EthChainId) @@ -88,9 +91,11 @@ * [EthGetTransactionByBlockHashAndIndex](#EthGetTransactionByBlockHashAndIndex) * [EthGetTransactionByBlockNumberAndIndex](#EthGetTransactionByBlockNumberAndIndex) * [EthGetTransactionByHash](#EthGetTransactionByHash) + * [EthGetTransactionByHashLimited](#EthGetTransactionByHashLimited) * [EthGetTransactionCount](#EthGetTransactionCount) * [EthGetTransactionHashByCid](#EthGetTransactionHashByCid) * [EthGetTransactionReceipt](#EthGetTransactionReceipt) + * [EthGetTransactionReceiptLimited](#EthGetTransactionReceiptLimited) * [EthMaxPriorityFeePerGas](#EthMaxPriorityFeePerGas) * [EthNewBlockFilter](#EthNewBlockFilter) * [EthNewFilter](#EthNewFilter) @@ -100,6 +105,8 @@ * [EthSubscribe](#EthSubscribe) * [EthUninstallFilter](#EthUninstallFilter) * [EthUnsubscribe](#EthUnsubscribe) +* [Filecoin](#Filecoin) + * [FilecoinAddressToEthAddress](#FilecoinAddressToEthAddress) * [Gas](#Gas) * [GasEstimateFeeCap](#GasEstimateFeeCap) * [GasEstimateGasLimit](#GasEstimateGasLimit) @@ -486,6 +493,50 @@ Inputs: Response: `"Ynl0ZSBhcnJheQ=="` +### ChainExportRangeInternal +ChainExportRangeInternal triggers the export of a chain +CAR-snapshot directly to disk. It is similar to ChainExport, +except, depending on options, the snapshot can include receipts, +messages and stateroots for the length between the specified head +and tail, thus producing "archival-grade" snapshots that include +all the on-chain data. The header chain is included back to +genesis and these snapshots can be used to initialize Filecoin +nodes. + + +Perms: admin + +Inputs: +```json +[ + [ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + { + "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" + } + ], + [ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + { + "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" + } + ], + { + "WriteBufferSize": 123, + "NumWorkers": 123, + "IncludeMessages": true, + "IncludeReceipts": true, + "IncludeStateRoots": true + } +] +``` + +Response: `{}` + ### ChainGetBlock ChainGetBlock returns the block specified by the given CID. @@ -1040,6 +1091,26 @@ Response: } ``` +### ChainHotGC +ChainHotGC does online (badger) GC on the hot store; only supported if you are using +the splitstore + + +Perms: admin + +Inputs: +```json +[ + { + "Threshold": 12.3, + "Periodic": true, + "Moving": true + } +] +``` + +Response: `{}` + ### ChainNotify ChainNotify returns channel with chain head updates. First message is guaranteed to be of len == 1, and type == 'current'. @@ -1064,7 +1135,7 @@ Response: ``` ### ChainPrune -ChainPrune prunes the stored chain state and garbage collects; only supported if you +ChainPrune forces compaction on cold store and garbage collects; only supported if you are using the splitstore @@ -2276,6 +2347,21 @@ Response: ] ``` +### EthAddressToFilecoinAddress +EthAddressToFilecoinAddress converts an EthAddress into an f410 Filecoin Address + + +Perms: read + +Inputs: +```json +[ + "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031" +] +``` + +Response: `"f01234"` + ### EthBlockNumber EthBlockNumber returns the height of the latest (heaviest) TipSet @@ -2657,7 +2743,7 @@ Response: "accessList": [ "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e" ], - "yParity": "0x0", + "v": "0x0", "r": "0x0", "s": "0x0" } @@ -2696,7 +2782,7 @@ Response: "accessList": [ "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e" ], - "yParity": "0x0", + "v": "0x0", "r": "0x0", "s": "0x0" } @@ -2734,7 +2820,46 @@ Response: "accessList": [ "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e" ], - "yParity": "0x0", + "v": "0x0", + "r": "0x0", + "s": "0x0" +} +``` + +### EthGetTransactionByHashLimited + + +Perms: read + +Inputs: +```json +[ + "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", + 10101 +] +``` + +Response: +```json +{ + "chainId": "0x5", + "nonce": "0x5", + "hash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", + "blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", + "blockNumber": "0x5", + "transactionIndex": "0x5", + "from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", + "to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", + "value": "0x0", + "type": "0x5", + "input": "0x07", + "gas": "0x5", + "maxFeePerGas": "0x0", + "maxPriorityFeePerGas": "0x0", + "accessList": [ + "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e" + ], + "v": "0x0", "r": "0x0", "s": "0x0" } @@ -2818,6 +2943,54 @@ Response: } ``` +### EthGetTransactionReceiptLimited + + +Perms: read + +Inputs: +```json +[ + "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", + 10101 +] +``` + +Response: +```json +{ + "transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", + "transactionIndex": "0x5", + "blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", + "blockNumber": "0x5", + "from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", + "to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", + "root": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", + "status": "0x5", + "contractAddress": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", + "cumulativeGasUsed": "0x5", + "gasUsed": "0x5", + "effectiveGasPrice": "0x0", + "logsBloom": "0x07", + "logs": [ + { + "address": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", + "data": "0x07", + "topics": [ + "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e" + ], + "removed": true, + "logIndex": "0x5", + "transactionIndex": "0x5", + "transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", + "blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", + "blockNumber": "0x5" + } + ], + "type": "0x5" +} +``` + ### EthMaxPriorityFeePerGas @@ -2942,6 +3115,24 @@ Inputs: Response: `true` +## Filecoin + + +### FilecoinAddressToEthAddress +FilecoinAddressToEthAddress converts an f410 or f0 Filecoin Address to an EthAddress + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `"0x5cbeecf99d3fdb3f25e309cc264f240bb0664031"` + ## Gas @@ -4332,7 +4523,7 @@ Response: ], "SizeLimitHigh": 123, "SizeLimitLow": 123, - "ReplaceByFeeRatio": 12.3, + "ReplaceByFeeRatio": 1.23, "PruneCooldown": 60000000000, "GasLimitOverestimation": 12.3 } @@ -4620,7 +4811,7 @@ Inputs: ], "SizeLimitHigh": 123, "SizeLimitLow": 123, - "ReplaceByFeeRatio": 12.3, + "ReplaceByFeeRatio": 1.23, "PruneCooldown": 60000000000, "GasLimitOverestimation": 12.3 } @@ -6652,95 +6843,49 @@ Response: }, "ExecutionTrace": { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": [ { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": null @@ -6928,95 +7073,49 @@ Response: }, "ExecutionTrace": { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": [ { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": null @@ -8443,95 +8542,49 @@ Response: }, "ExecutionTrace": { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": [ { "Msg": { - "Version": 42, - "To": "f01234", "From": "f01234", - "Nonce": 42, + "To": "f01234", "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - } + "ParamsCodec": 42 }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "ReturnCodec": 42 }, - "Error": "string value", - "Duration": 60000000000, "GasCharges": [ { "Name": "string value", - "loc": [ - { - "File": "string value", - "Line": 123, - "Function": "string value" - } - ], "tg": 9, "cg": 9, "sg": 9, - "vtg": 9, - "vcg": 9, - "vsg": 9, - "tt": 60000000000, - "ex": {} + "tt": 60000000000 } ], "Subcalls": null diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index 0e8e17773c..50ee5618ad 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -7,7 +7,7 @@ USAGE: lotus-miner [global options] command [command options] [arguments...] VERSION: - 1.19.1-dev + 1.21.0-rc2 COMMANDS: init Initialize a lotus miner repo @@ -839,7 +839,6 @@ USAGE: COMMANDS: selection Configure acceptance criteria for retrieval deal proposals - list List all active retrieval deals for this miner set-ask Configure the provider's retrieval ask get-ask Get the provider's current retrieval ask configured by the provider in the ask-store using the set-ask CLI command help, h Shows a list of commands or help for one command @@ -908,19 +907,6 @@ OPTIONS: ``` -### lotus-miner retrieval-deals list -``` -NAME: - lotus-miner retrieval-deals list - List all active retrieval deals for this miner - -USAGE: - lotus-miner retrieval-deals list [command options] [arguments...] - -OPTIONS: - --help, -h show help (default: false) - -``` - ### lotus-miner retrieval-deals set-ask ``` NAME: @@ -1717,13 +1703,14 @@ USAGE: lotus-miner sectors list [command options] [arguments...] OPTIONS: - --events, -e display number of events the sector has received (default: false) - --fast, -f don't show on-chain info for better performance (default: false) - --initial-pledge, -p display initial pledge (default: false) - --seal-time, -t display how long it took for the sector to be sealed (default: false) - --show-removed, -r show removed sectors (default: false) - --states value filter sectors by a comma-separated list of states - --unproven, -u only show sectors which aren't in the 'Proving' state (default: false) + --check-parallelism value number of parallel requests to make for checking sector states (default: 300) + --events, -e display number of events the sector has received (default: false) + --fast, -f don't show on-chain info for better performance (default: false) + --initial-pledge, -p display initial pledge (default: false) + --seal-time, -t display how long it took for the sector to be sealed (default: false) + --show-removed, -r show removed sectors (default: false) + --states value filter sectors by a comma-separated list of states + --unproven, -u only show sectors which aren't in the 'Proving' state (default: false) ``` @@ -1888,11 +1875,12 @@ USAGE: lotus-miner sectors extend [command options] OPTIONS: + --drop-claims drop claims for sectors that can be extended, but only by dropping some of their verified power claims (default: false) --exclude value optionally provide a file containing excluding sectors --extension value try to extend selected sectors by this number of epochs, defaults to 540 days (default: 1555200) --from value only consider sectors whose current expiration epoch is in the range of [from, to], defaults to: now + 120 (1 hour) (default: 0) --max-fee value use up to this amount of FIL for one message. pass this flag to avoid message congestion. (default: "0") - --max-sectors value the maximum number of sectors contained in each message message (default: 0) + --max-sectors value the maximum number of sectors contained in each message (default: 0) --new-expiration value try to extend selected sectors to this epoch, ignoring extension (default: 0) --only-cc only extend CC sectors (useful for making sector ready for snap upgrade) (default: false) --really-do-it pass this flag to really extend sectors, otherwise will only print out json representation of parameters (default: false) diff --git a/documentation/en/cli-lotus-worker.md b/documentation/en/cli-lotus-worker.md index 426d64d6ca..33be6055f6 100644 --- a/documentation/en/cli-lotus-worker.md +++ b/documentation/en/cli-lotus-worker.md @@ -7,18 +7,16 @@ USAGE: lotus-worker [global options] command [command options] [arguments...] VERSION: - 1.19.1-dev + 1.21.0-rc2 COMMANDS: - run Start lotus worker - stop Stop a running lotus worker - info Print worker info - storage manage sector storage - set Manage worker settings - wait-quiet Block until all running tasks exit - resources Manage resource table overrides - tasks Manage task processing - help, h Shows a list of commands or help for one command + run Start lotus worker + stop Stop a running lotus worker + info Print worker info + storage manage sector storage + resources Manage resource table overrides + tasks Manage task processing + help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --enable-gpu-proving enable use of GPU for mining operations (default: true) [$LOTUS_WORKER_ENABLE_GPU_PROVING] @@ -47,7 +45,7 @@ OPTIONS: --no-local-storage don't use storageminer repo for sector storage (default: false) [$LOTUS_WORKER_NO_LOCAL_STORAGE] --no-swap don't use swap (default: false) [$LOTUS_WORKER_NO_SWAP] --parallel-fetch-limit value maximum fetch operations to run in parallel (default: 5) [$LOTUS_WORKER_PARALLEL_FETCH_LIMIT] - --post-parallel-reads value maximum number of parallel challenge reads (0 = no limit) (default: 128) [$LOTUS_WORKER_POST_PARALLEL_READS] + --post-parallel-reads value maximum number of parallel challenge reads (0 = no limit) (default: 32) [$LOTUS_WORKER_POST_PARALLEL_READS] --post-read-timeout value time limit for reading PoSt challenges (0 = no limit) (default: 0s) [$LOTUS_WORKER_POST_READ_TIMEOUT] --precommit1 enable precommit1 (default: true) [$LOTUS_WORKER_PRECOMMIT1] --precommit2 enable precommit2 (default: true) [$LOTUS_WORKER_PRECOMMIT2] @@ -154,32 +152,6 @@ OPTIONS: ``` -## lotus-worker set -``` -NAME: - lotus-worker set - Manage worker settings - -USAGE: - lotus-worker set [command options] [arguments...] - -OPTIONS: - --enabled enable/disable new task processing (default: true) - -``` - -## lotus-worker wait-quiet -``` -NAME: - lotus-worker wait-quiet - Block until all running tasks exit - -USAGE: - lotus-worker wait-quiet [command options] [arguments...] - -OPTIONS: - --help, -h show help (default: false) - -``` - ## lotus-worker resources ``` NAME: diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index 309937e4d7..db639322ff 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -7,7 +7,7 @@ USAGE: lotus [global options] command [command options] [arguments...] VERSION: - 1.19.1-dev + 1.21.0-rc2 COMMANDS: daemon Start a lotus daemon process @@ -2157,13 +2157,14 @@ COMMANDS: get Get chain DAG node by path bisect bisect chain for an event export export chain to a car file + export-range export chain to a car file slash-consensus Report consensus fault gas-price Estimate gas prices inspect-usage Inspect block space usage of a given tipset decode decode various types encode encode various types disputer interact with the window post disputer - prune prune the stored chain state and perform garbage collection + prune splitstore gc help, h Shows a list of commands or help for one command OPTIONS: @@ -2338,6 +2339,25 @@ OPTIONS: ``` +### lotus chain export-range +``` +NAME: + lotus chain export-range - export chain to a car file + +USAGE: + lotus chain export-range [command options] [arguments...] + +OPTIONS: + --head value specify tipset to start the export from (higher epoch) (default: "@head") + --messages specify if messages should be include (default: false) + --receipts specify if receipts should be include (default: false) + --stateroots specify if stateroots should be include (default: false) + --tail value specify tipset to end the export at (lower epoch) (default: "@tail") + --workers value specify the number of workers (default: 1) + --write-buffer value specify write buffer size (default: 1048576) + +``` + ### lotus chain slash-consensus ``` NAME: @@ -2492,10 +2512,29 @@ OPTIONS: ### lotus chain prune ``` NAME: - lotus chain prune - prune the stored chain state and perform garbage collection + lotus chain prune - splitstore gc USAGE: - lotus chain prune [command options] [arguments...] + lotus chain prune command [command options] [arguments...] + +COMMANDS: + compact-cold force splitstore compaction on cold store state and run gc + hot run online (badger vlog) garbage collection on hotstore + hot-moving run moving gc on hotstore + help, h Shows a list of commands or help for one command + +OPTIONS: + --help, -h show help (default: false) + +``` + +#### lotus chain prune compact-cold +``` +NAME: + lotus chain prune compact-cold - force splitstore compaction on cold store state and run gc + +USAGE: + lotus chain prune compact-cold [command options] [arguments...] OPTIONS: --moving-gc use moving gc for garbage collecting the coldstore (default: false) @@ -2504,6 +2543,33 @@ OPTIONS: ``` +#### lotus chain prune hot +``` +NAME: + lotus chain prune hot - run online (badger vlog) garbage collection on hotstore + +USAGE: + lotus chain prune hot [command options] [arguments...] + +OPTIONS: + --periodic Run periodic gc over multiple vlogs. Otherwise run gc once (default: false) + --threshold value Threshold of vlog garbage for gc (default: 0.01) + +``` + +#### lotus chain prune hot-moving +``` +NAME: + lotus chain prune hot-moving - run moving gc on hotstore + +USAGE: + lotus chain prune hot-moving [command options] [arguments...] + +OPTIONS: + --help, -h show help (default: false) + +``` + ## lotus log ``` NAME: @@ -2628,6 +2694,7 @@ COMMANDS: stat Print eth/filecoin addrs and code cid call Simulate an eth contract call contract-address Generate contract address from smart contract code + bytecode Write the bytecode of a smart contract to a file help, h Shows a list of commands or help for one command OPTIONS: @@ -2702,6 +2769,19 @@ OPTIONS: ``` +### lotus evm bytecode +``` +NAME: + lotus evm bytecode - Write the bytecode of a smart contract to a file + +USAGE: + lotus evm bytecode [command options] [contract-address] [file-name] + +OPTIONS: + --bin write the bytecode as raw binary and don't hex-encode (default: false) + +``` + ## lotus net ``` NAME: diff --git a/documentation/en/default-lotus-config.toml b/documentation/en/default-lotus-config.toml index 41d7e6acac..4e6cba4a30 100644 --- a/documentation/en/default-lotus-config.toml +++ b/documentation/en/default-lotus-config.toml @@ -191,7 +191,7 @@ [Chainstore] # type: bool # env var: LOTUS_CHAINSTORE_ENABLESPLITSTORE - #EnableSplitstore = false + EnableSplitstore = true [Chainstore.Splitstore] # ColdStoreType specifies the type of the coldstore. @@ -199,7 +199,7 @@ # # type: string # env var: LOTUS_CHAINSTORE_SPLITSTORE_COLDSTORETYPE - #ColdStoreType = "messages" + #ColdStoreType = "discard" # HotStoreType specifies the type of the hotstore. # Only currently supported value is "badger". @@ -230,6 +230,35 @@ # env var: LOTUS_CHAINSTORE_SPLITSTORE_HOTSTOREFULLGCFREQUENCY #HotStoreFullGCFrequency = 20 + # HotStoreMaxSpaceTarget sets a target max disk size for the hotstore. Splitstore GC + # will run moving GC if disk utilization gets within a threshold (150 GB) of the target. + # Splitstore GC will NOT run moving GC if the total size of the move would get + # within 50 GB of the target, and instead will run a more aggressive online GC. + # If both HotStoreFullGCFrequency and HotStoreMaxSpaceTarget are set then splitstore + # GC will trigger moving GC if either configuration condition is met. + # A reasonable minimum is 2x fully GCed hotstore size + 50 G buffer. + # At this minimum size moving GC happens every time, any smaller and moving GC won't + # be able to run. In spring 2023 this minimum is ~550 GB. + # + # type: uint64 + # env var: LOTUS_CHAINSTORE_SPLITSTORE_HOTSTOREMAXSPACETARGET + #HotStoreMaxSpaceTarget = 0 + + # When HotStoreMaxSpaceTarget is set Moving GC will be triggered when total moving size + # exceeds HotstoreMaxSpaceTarget - HotstoreMaxSpaceThreshold + # + # type: uint64 + # env var: LOTUS_CHAINSTORE_SPLITSTORE_HOTSTOREMAXSPACETHRESHOLD + #HotStoreMaxSpaceThreshold = 150000000000 + + # Safety buffer to prevent moving GC from overflowing disk when HotStoreMaxSpaceTarget + # is set. Moving GC will not occur when total moving size exceeds + # HotstoreMaxSpaceTarget - HotstoreMaxSpaceSafetyBuffer + # + # type: uint64 + # env var: LOTUS_CHAINSTORE_SPLITSTORE_HOTSTOREMAXSPACESAFETYBUFFER + #HotstoreMaxSpaceSafetyBuffer = 50000000000 + [Cluster] # EXPERIMENTAL. config to enabled node cluster with raft consensus diff --git a/documentation/en/default-lotus-miner-config.toml b/documentation/en/default-lotus-miner-config.toml index 416531f989..584def6086 100644 --- a/documentation/en/default-lotus-miner-config.toml +++ b/documentation/en/default-lotus-miner-config.toml @@ -352,7 +352,7 @@ # # type: int # env var: LOTUS_PROVING_PARALLELCHECKLIMIT - #ParallelCheckLimit = 128 + #ParallelCheckLimit = 32 # Maximum amount of time a proving pre-check can take for a sector. If the check times out the sector will be skipped # diff --git a/eudico-core/fxmodules/fullnode.go b/eudico-core/fxmodules/fullnode.go index 0134bca480..576920e37e 100644 --- a/eudico-core/fxmodules/fullnode.go +++ b/eudico-core/fxmodules/fullnode.go @@ -177,7 +177,7 @@ func Fullnode(isBootstrap bool, isLite bool, fevmCfg config.FevmConfig) fx.Optio var fullNodeAPIProviders = fx.Provide( messagepool.NewProvider, fx.Annotate(modules.MessagePool, fx.As(new(messagepool.MpoolNonceAPI))), - fx.Annotate(stmgr.NewStateManager, fx.As(new(stmgr.StateManagerAPI))), + fx.Annotate(modules.StateManager, fx.As(new(stmgr.StateManagerAPI))), func( chainModule full.ChainModule, gasModule full.GasModule, diff --git a/eudico-core/genesis/genesis.go b/eudico-core/genesis/genesis.go index 92069abc78..16706ce720 100644 --- a/eudico-core/genesis/genesis.go +++ b/eudico-core/genesis/genesis.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "io" - "io/ioutil" "os" "path/filepath" @@ -52,7 +51,7 @@ func MakeGenesisTemplate(templatePath string, subnetID string) (genesis.Template templatePath = filepath.Join(filepath.Dir(e), defaultTemplateFilePath) } - tmplBytes, err := ioutil.ReadFile(templatePath) + tmplBytes, err := os.ReadFile(templatePath) if err != nil { return genesis.Template{}, xerrors.Errorf("failed to read template %s: %w", templatePath, err) } diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index 4c503e5e22..28e3cd44d9 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit 4c503e5e2291b5d541f89d982d975e7994536a54 +Subproject commit 28e3cd44d91681c074aba362d1e5c954db110ad9 diff --git a/gateway/node.go b/gateway/node.go index 87aa32a19d..b263a75bdc 100644 --- a/gateway/node.go +++ b/gateway/node.go @@ -27,6 +27,7 @@ import ( _ "github.com/filecoin-project/lotus/lib/sigs/secp" "github.com/filecoin-project/lotus/metrics" "github.com/filecoin-project/lotus/node/impl/full" + "github.com/filecoin-project/lotus/node/modules/dtypes" ) const ( @@ -59,18 +60,22 @@ type TargetAPI interface { ChainPutObj(context.Context, blocks.Block) error ChainGetGenesis(context.Context) (*types.TipSet, error) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error) + MpoolGetNonce(ctx context.Context, addr address.Address) (uint64, error) MpoolPushUntrusted(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error) MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error) MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error) MsigGetVestingSchedule(context.Context, address.Address, types.TipSetKey) (api.MsigVesting, error) MsigGetPending(ctx context.Context, addr address.Address, ts types.TipSetKey) ([]*api.MsigTransaction, error) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) + StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*api.InvocResult, error) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error) + StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error) StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error) + StateNetworkName(context.Context) (dtypes.NetworkName, error) StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error) StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) @@ -85,19 +90,22 @@ type TargetAPI interface { StateCirculatingSupply(context.Context, types.TipSetKey) (abi.TokenAmount, error) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) + StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (api.CirculatingSupply, error) WalletBalance(context.Context, address.Address) (types.BigInt, error) + EthAddressToFilecoinAddress(ctx context.Context, ethAddress ethtypes.EthAddress) (address.Address, error) + FilecoinAddressToEthAddress(ctx context.Context, filecoinAddress address.Address) (ethtypes.EthAddress, error) EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error) EthGetBlockTransactionCountByNumber(ctx context.Context, blkNum ethtypes.EthUint64) (ethtypes.EthUint64, error) EthGetBlockTransactionCountByHash(ctx context.Context, blkHash ethtypes.EthHash) (ethtypes.EthUint64, error) EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthHash, fullTxInfo bool) (ethtypes.EthBlock, error) EthGetBlockByNumber(ctx context.Context, blkNum string, fullTxInfo bool) (ethtypes.EthBlock, error) - EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error) + EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error) EthGetTransactionHashByCid(ctx context.Context, cid cid.Cid) (*ethtypes.EthHash, error) EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error) EthGetTransactionCount(ctx context.Context, sender ethtypes.EthAddress, blkOpt string) (ethtypes.EthUint64, error) - EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*api.EthTxReceipt, error) + EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*api.EthTxReceipt, error) EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) EthGetCode(ctx context.Context, address ethtypes.EthAddress, blkOpt string) (ethtypes.EthBytes, error) @@ -186,6 +194,9 @@ func (gw *Node) checkTipset(ts *types.TipSet) error { } func (gw *Node) checkTipsetHeight(ts *types.TipSet, h abi.ChainEpoch) error { + if h > ts.Height() { + return fmt.Errorf("tipset height in future") + } tsBlock := ts.Blocks()[0] heightDelta := time.Duration(uint64(tsBlock.Height-h)*build.BlockDelaySecs) * time.Second timeAtHeight := time.Unix(int64(tsBlock.Timestamp), 0).Add(-heightDelta) diff --git a/gateway/proxy_eth.go b/gateway/proxy_eth.go index 838a9ba3fe..3342875c3f 100644 --- a/gateway/proxy_eth.go +++ b/gateway/proxy_eth.go @@ -21,7 +21,7 @@ import ( ) func (gw *Node) Web3ClientVersion(ctx context.Context) (string, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + if err := gw.limit(ctx, basicRateLimitTokens); err != nil { return "", err } @@ -34,7 +34,7 @@ func (gw *Node) EthAccounts(ctx context.Context) ([]ethtypes.EthAddress, error) } func (gw *Node) EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + if err := gw.limit(ctx, chainRateLimitTokens); err != nil { return 0, err } @@ -80,40 +80,40 @@ func (gw *Node) checkBlkHash(ctx context.Context, blkHash ethtypes.EthHash) erro return gw.checkTipsetKey(ctx, tsk) } -func (gw *Node) checkBlkParam(ctx context.Context, blkParam string) error { +func (gw *Node) checkBlkParam(ctx context.Context, blkParam string, lookback ethtypes.EthUint64) error { if blkParam == "earliest" { // also not supported in node impl return fmt.Errorf("block param \"earliest\" is not supported") } + head, err := gw.target.ChainHead(ctx) + if err != nil { + return err + } + + var num ethtypes.EthUint64 switch blkParam { case "pending", "latest": - // those will be recent enough, so we don't need to check - return nil - default: - var num ethtypes.EthUint64 - err := num.UnmarshalJSON([]byte(`"` + blkParam + `"`)) - if err != nil { - return fmt.Errorf("cannot parse block number: %v", err) + // Head is always ok. + if lookback == 0 { + return nil } - head, err := gw.target.ChainHead(ctx) - if err != nil { - return err + // Can't look beyond 0 anyways. + if lookback > ethtypes.EthUint64(head.Height()) { + break } - if err := gw.checkTipsetHeight(head, abi.ChainEpoch(num)); err != nil { - return err + num = ethtypes.EthUint64(head.Height()) - lookback + default: + if err := num.UnmarshalJSON([]byte(`"` + blkParam + `"`)); err != nil { + return fmt.Errorf("cannot parse block number: %v", err) } - } - return nil + } + return gw.checkTipsetHeight(head, abi.ChainEpoch(num)) } func (gw *Node) EthGetBlockTransactionCountByHash(ctx context.Context, blkHash ethtypes.EthHash) (ethtypes.EthUint64, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { - return 0, err - } - - if err := gw.checkBlkHash(ctx, blkHash); err != nil { + if err := gw.limit(ctx, chainRateLimitTokens); err != nil { return 0, err } @@ -137,7 +137,7 @@ func (gw *Node) EthGetBlockByNumber(ctx context.Context, blkNum string, fullTxIn return ethtypes.EthBlock{}, err } - if err := gw.checkBlkParam(ctx, blkNum); err != nil { + if err := gw.checkBlkParam(ctx, blkNum, 0); err != nil { return ethtypes.EthBlock{}, err } @@ -145,11 +145,21 @@ func (gw *Node) EthGetBlockByNumber(ctx context.Context, blkNum string, fullTxIn } func (gw *Node) EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error) { + return gw.target.EthGetTransactionByHashLimited(ctx, txHash, api.LookbackNoLimit) +} + +func (gw *Node) EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error) { if err := gw.limit(ctx, stateRateLimitTokens); err != nil { return nil, err } + if limit == api.LookbackNoLimit { + limit = gw.stateWaitLookbackLimit + } + if gw.stateWaitLookbackLimit != api.LookbackNoLimit && limit > gw.stateWaitLookbackLimit { + limit = gw.stateWaitLookbackLimit + } - return gw.target.EthGetTransactionByHash(ctx, txHash) + return gw.target.EthGetTransactionByHashLimited(ctx, txHash, limit) } func (gw *Node) EthGetTransactionHashByCid(ctx context.Context, cid cid.Cid) (*ethtypes.EthHash, error) { @@ -161,7 +171,7 @@ func (gw *Node) EthGetTransactionHashByCid(ctx context.Context, cid cid.Cid) (*e } func (gw *Node) EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + if err := gw.limit(ctx, chainRateLimitTokens); err != nil { return nil, err } @@ -173,7 +183,7 @@ func (gw *Node) EthGetTransactionCount(ctx context.Context, sender ethtypes.EthA return 0, err } - if err := gw.checkBlkParam(ctx, blkOpt); err != nil { + if err := gw.checkBlkParam(ctx, blkOpt, 0); err != nil { return 0, err } @@ -181,39 +191,21 @@ func (gw *Node) EthGetTransactionCount(ctx context.Context, sender ethtypes.EthA } func (gw *Node) EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*api.EthTxReceipt, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { - return nil, err - } - - return gw.target.EthGetTransactionReceipt(ctx, txHash) -} - -func (gw *Node) EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { - return ethtypes.EthTx{}, err - } - - if err := gw.checkBlkHash(ctx, blkHash); err != nil { - return ethtypes.EthTx{}, err - } - - return gw.target.EthGetTransactionByBlockHashAndIndex(ctx, blkHash, txIndex) + return gw.EthGetTransactionReceiptLimited(ctx, txHash, api.LookbackNoLimit) } -func (gw *Node) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) { +func (gw *Node) EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*api.EthTxReceipt, error) { if err := gw.limit(ctx, stateRateLimitTokens); err != nil { - return ethtypes.EthTx{}, err + return nil, err } - - head, err := gw.target.ChainHead(ctx) - if err != nil { - return ethtypes.EthTx{}, err + if limit == api.LookbackNoLimit { + limit = gw.stateWaitLookbackLimit } - if err := gw.checkTipsetHeight(head, abi.ChainEpoch(blkNum)); err != nil { - return ethtypes.EthTx{}, err + if gw.stateWaitLookbackLimit != api.LookbackNoLimit && limit > gw.stateWaitLookbackLimit { + limit = gw.stateWaitLookbackLimit } - return gw.target.EthGetTransactionByBlockNumberAndIndex(ctx, blkNum, txIndex) + return gw.target.EthGetTransactionReceiptLimited(ctx, txHash, limit) } func (gw *Node) EthGetCode(ctx context.Context, address ethtypes.EthAddress, blkOpt string) (ethtypes.EthBytes, error) { @@ -221,7 +213,7 @@ func (gw *Node) EthGetCode(ctx context.Context, address ethtypes.EthAddress, blk return nil, err } - if err := gw.checkBlkParam(ctx, blkOpt); err != nil { + if err := gw.checkBlkParam(ctx, blkOpt, 0); err != nil { return nil, err } @@ -233,7 +225,7 @@ func (gw *Node) EthGetStorageAt(ctx context.Context, address ethtypes.EthAddress return nil, err } - if err := gw.checkBlkParam(ctx, blkParam); err != nil { + if err := gw.checkBlkParam(ctx, blkParam, 0); err != nil { return nil, err } @@ -245,7 +237,7 @@ func (gw *Node) EthGetBalance(ctx context.Context, address ethtypes.EthAddress, return ethtypes.EthBigInt(big.Zero()), err } - if err := gw.checkBlkParam(ctx, blkParam); err != nil { + if err := gw.checkBlkParam(ctx, blkParam, 0); err != nil { return ethtypes.EthBigInt(big.Zero()), err } @@ -253,7 +245,7 @@ func (gw *Node) EthGetBalance(ctx context.Context, address ethtypes.EthAddress, } func (gw *Node) EthChainId(ctx context.Context) (ethtypes.EthUint64, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + if err := gw.limit(ctx, basicRateLimitTokens); err != nil { return 0, err } @@ -269,7 +261,7 @@ func (gw *Node) NetVersion(ctx context.Context) (string, error) { } func (gw *Node) NetListening(ctx context.Context) (bool, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + if err := gw.limit(ctx, basicRateLimitTokens); err != nil { return false, err } @@ -285,7 +277,7 @@ func (gw *Node) EthProtocolVersion(ctx context.Context) (ethtypes.EthUint64, err } func (gw *Node) EthGasPrice(ctx context.Context) (ethtypes.EthBigInt, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + if err := gw.limit(ctx, chainRateLimitTokens); err != nil { return ethtypes.EthBigInt(big.Zero()), err } @@ -304,7 +296,7 @@ func (gw *Node) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (ethtype return ethtypes.EthFeeHistory{}, err } - if err := gw.checkBlkParam(ctx, params.NewestBlkNum); err != nil { + if err := gw.checkBlkParam(ctx, params.NewestBlkNum, params.BlkCount); err != nil { return ethtypes.EthFeeHistory{}, err } @@ -316,7 +308,7 @@ func (gw *Node) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (ethtype } func (gw *Node) EthMaxPriorityFeePerGas(ctx context.Context) (ethtypes.EthBigInt, error) { - if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + if err := gw.limit(ctx, chainRateLimitTokens); err != nil { return ethtypes.EthBigInt(big.Zero()), err } @@ -337,7 +329,7 @@ func (gw *Node) EthCall(ctx context.Context, tx ethtypes.EthCall, blkParam strin return nil, err } - if err := gw.checkBlkParam(ctx, blkParam); err != nil { + if err := gw.checkBlkParam(ctx, blkParam, 0); err != nil { return nil, err } @@ -359,12 +351,12 @@ func (gw *Node) EthGetLogs(ctx context.Context, filter *ethtypes.EthFilterSpec) } if filter.FromBlock != nil { - if err := gw.checkBlkParam(ctx, *filter.FromBlock); err != nil { + if err := gw.checkBlkParam(ctx, *filter.FromBlock, 0); err != nil { return nil, err } } if filter.ToBlock != nil { - if err := gw.checkBlkParam(ctx, *filter.ToBlock); err != nil { + if err := gw.checkBlkParam(ctx, *filter.ToBlock, 0); err != nil { return nil, err } } diff --git a/gateway/proxy_fil.go b/gateway/proxy_fil.go index 1f6ee2ccc3..8007e1e7b4 100644 --- a/gateway/proxy_fil.go +++ b/gateway/proxy_fil.go @@ -20,6 +20,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/lib/sigs" + "github.com/filecoin-project/lotus/node/modules/dtypes" ) func (gw *Node) Discover(ctx context.Context) (apitypes.OpenRPCDocument, error) { @@ -187,6 +188,13 @@ func (gw *Node) GasEstimateMessageGas(ctx context.Context, msg *types.Message, s return gw.target.GasEstimateMessageGas(ctx, msg, spec, tsk) } +func (gw *Node) MpoolGetNonce(ctx context.Context, addr address.Address) (uint64, error) { + if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + return 0, err + } + return gw.target.MpoolGetNonce(ctx, addr) +} + func (gw *Node) MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error) { if err := gw.limit(ctx, stateRateLimitTokens); err != nil { return cid.Cid{}, err @@ -209,9 +217,6 @@ func (gw *Node) MsigGetVested(ctx context.Context, addr address.Address, start t if err := gw.limit(ctx, walletRateLimitTokens); err != nil { return types.BigInt{}, err } - if err := gw.checkTipsetKey(ctx, start); err != nil { - return types.NewInt(0), err - } if err := gw.checkTipsetKey(ctx, end); err != nil { return types.NewInt(0), err } @@ -248,6 +253,16 @@ func (gw *Node) StateAccountKey(ctx context.Context, addr address.Address, tsk t return gw.target.StateAccountKey(ctx, addr, tsk) } +func (gw *Node) StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*api.InvocResult, error) { + if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + return nil, err + } + if err := gw.checkTipsetKey(ctx, tsk); err != nil { + return nil, err + } + return gw.target.StateCall(ctx, msg, tsk) +} + func (gw *Node) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error) { if err := gw.limit(ctx, stateRateLimitTokens); err != nil { return api.DealCollateralBounds{}, err @@ -258,6 +273,16 @@ func (gw *Node) StateDealProviderCollateralBounds(ctx context.Context, size abi. return gw.target.StateDealProviderCollateralBounds(ctx, size, verified, tsk) } +func (gw *Node) StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) { + if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + return nil, err + } + if err := gw.checkTipsetKey(ctx, tsk); err != nil { + return nil, err + } + return gw.target.StateDecodeParams(ctx, toAddr, method, params, tsk) +} + func (gw *Node) StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) { if err := gw.limit(ctx, stateRateLimitTokens); err != nil { return nil, err @@ -308,6 +333,13 @@ func (gw *Node) StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, t return gw.target.StateMarketStorageDeal(ctx, dealId, tsk) } +func (gw *Node) StateNetworkName(ctx context.Context) (dtypes.NetworkName, error) { + if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + return *new(dtypes.NetworkName), err + } + return gw.target.StateNetworkName(ctx) +} + func (gw *Node) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) { if err := gw.limit(ctx, stateRateLimitTokens); err != nil { return network.VersionMax, err @@ -457,6 +489,16 @@ func (gw *Node) StateVerifiedClientStatus(ctx context.Context, addr address.Addr return gw.target.StateVerifiedClientStatus(ctx, addr, tsk) } +func (gw *Node) StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) { + if err := gw.limit(ctx, stateRateLimitTokens); err != nil { + return nil, err + } + if err := gw.checkTipsetKey(ctx, tsk); err != nil { + return nil, err + } + return gw.target.StateVerifierStatus(ctx, addr, tsk) +} + func (gw *Node) StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) { if err := gw.limit(ctx, stateRateLimitTokens); err != nil { return api.CirculatingSupply{}, err diff --git a/gen/api/proxygen.go b/gen/api/proxygen.go index 75fbc668c9..fba276372d 100644 --- a/gen/api/proxygen.go +++ b/gen/api/proxygen.go @@ -307,7 +307,8 @@ type {{.Num}}Struct struct { type {{.Num}}Methods struct { {{range .Methods}} - {{.Num}} func({{.NamedParams}}) ({{.Results}}) `+"`"+`{{range .Tags}}{{index . 0}}:"{{index . 1}}"{{end}}`+"`"+` + {{.Num}} func({{.NamedParams}}) ({{.Results}}) `+"`"+`{{$first := true}}{{range .Tags}}{{if $first}}{{$first = false}}{{else}} {{end}}{{index . 0}}:"{{index . 1}}"{{end}}`+"`"+` + {{end}} } diff --git a/gen/bundle/bundle.go b/gen/bundle/bundle.go index d953b99c99..f57ced15b4 100644 --- a/gen/bundle/bundle.go +++ b/gen/bundle/bundle.go @@ -2,6 +2,8 @@ package main import ( "os" + "strconv" + "strings" "text/template" "github.com/filecoin-project/lotus/build" @@ -32,19 +34,49 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet } `)) +func splitOverride(override string) (string, string) { + x := strings.Split(override, "=") + return x[0], x[1] +} + func main() { + // read metadata from the embedded bundle, includes all info except git tags metadata, err := build.ReadEmbeddedBuiltinActorsMetadata() if err != nil { panic(err) } - // TODO: Re-enable this when we can set the tag for ONLY the appropriate version - // https://github.com/filecoin-project/lotus/issues/10185#issuecomment-1422864836 - //if len(os.Args) > 1 { - // for _, m := range metadata { - // m.BundleGitTag = os.Args[1] - // } - //} + // IF args have been provided, extract git tag info from them, otherwise + // rely on previously embedded metadata for git tags. + if len(os.Args) > 1 { + // see ./build/actors/pack.sh + // (optional) expected args are: + // $(GOCC) run ./gen/bundle $(VERSION) $(RELEASE) $(RELEASE_OVERRIDES) + // overrides are in the format network_name=override + gitTag := os.Args[2] + packedActorsVersion, err := strconv.Atoi(os.Args[1][1:]) + if err != nil { + panic(err) + } + + overrides := map[string]string{} + for _, override := range os.Args[3:] { + k, v := splitOverride(override) + overrides[k] = v + } + for _, m := range metadata { + if int(m.Version) == packedActorsVersion { + override, ok := overrides[m.Network] + if ok { + m.BundleGitTag = override + } else { + m.BundleGitTag = gitTag + } + } else { + m.BundleGitTag = getOldGitTagFromEmbeddedMetadata(m) + } + } + } fi, err := os.Create("./build/builtin_actors_gen.go") if err != nil { @@ -57,3 +89,14 @@ func main() { panic(err) } } + +func getOldGitTagFromEmbeddedMetadata(m *build.BuiltinActorsMetadata) string { + for _, v := range build.EmbeddedBuiltinActorsMetadata { + // if we agree on the manifestCid for the previously embedded metadata, use the previously set tag + if m.Version == v.Version && m.Network == v.Network && m.ManifestCid == v.ManifestCid { + return m.BundleGitTag + } + } + + return "" +} diff --git a/gen/inline-gen/main.go b/gen/inline-gen/main.go index d97134cdd3..4e55816f6b 100644 --- a/gen/inline-gen/main.go +++ b/gen/inline-gen/main.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io/fs" - "io/ioutil" "os" "path/filepath" "strings" @@ -19,7 +18,7 @@ const ( ) func main() { - db, err := ioutil.ReadFile(os.Args[2]) + db, err := os.ReadFile(os.Args[2]) if err != nil { panic(err) } @@ -38,7 +37,7 @@ func main() { if filepath.Ext(path) != ".go" { return nil } - fb, err := ioutil.ReadFile(path) + fb, err := os.ReadFile(path) if err != nil { return err } @@ -110,7 +109,7 @@ func main() { if rewrite { fmt.Printf("write %s\n", path) - if err := ioutil.WriteFile(path, []byte(strings.Join(outLines, "\n")), 0664); err != nil { + if err := os.WriteFile(path, []byte(strings.Join(outLines, "\n")), 0664); err != nil { return err } } diff --git a/gen/main.go b/gen/main.go index a3891778a1..0cd3999c38 100644 --- a/gen/main.go +++ b/gen/main.go @@ -11,7 +11,6 @@ import ( "github.com/filecoin-project/lotus/chain/exchange" "github.com/filecoin-project/lotus/chain/market" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/chain/vm" "github.com/filecoin-project/lotus/cmd/lotus-shed/shedgen" "github.com/filecoin-project/lotus/node/hello" "github.com/filecoin-project/lotus/paychmgr" @@ -37,15 +36,11 @@ func main() { types.StateInfo0{}, types.Event{}, types.EventEntry{}, - ) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - err = gen.WriteTupleEncodersToFile("./chain/vm/cbor_gen.go", "vm", - vm.FvmExecutionTrace{}, - vm.FvmGasCharge{}, + // Tracing + types.GasTrace{}, + types.MessageTrace{}, + types.ReturnTrace{}, + types.ExecutionTrace{}, ) if err != nil { fmt.Println(err) diff --git a/go.mod b/go.mod index 91384ae53c..54eeded6a0 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,11 @@ module github.com/filecoin-project/lotus -go 1.18 +go 1.19 retract v1.14.0 // Accidentally force-pushed tag, use v1.14.1+ instead. +retract v1.20.2 // Wrongfully cherry picked PR, use v1.20.2+ instead. + require ( contrib.go.opencensus.io/exporter/prometheus v0.4.0 github.com/BurntSushi/toml v1.1.0 @@ -14,14 +16,14 @@ require ( github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921 github.com/buger/goterm v1.0.3 - github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e + github.com/chzyer/readline v1.5.0 github.com/consensus-shipyard/go-ipc-types v0.1.4 github.com/containerd/cgroups v1.0.4 - github.com/coreos/go-systemd/v22 v22.4.0 + github.com/coreos/go-systemd/v22 v22.5.0 github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e - github.com/dgraph-io/badger/v2 v2.2007.3 + github.com/dgraph-io/badger/v2 v2.2007.4 github.com/docker/go-units v0.5.0 - github.com/drand/drand v1.3.0 + github.com/drand/drand v1.4.9 github.com/drand/kyber v1.1.15 github.com/dustin/go-humanize v1.0.0 github.com/elastic/go-elasticsearch/v7 v7.14.0 @@ -37,16 +39,15 @@ require ( github.com/filecoin-project/go-cbor-util v0.0.1 github.com/filecoin-project/go-commp-utils v0.1.3 github.com/filecoin-project/go-crypto v0.0.1 - github.com/filecoin-project/go-data-transfer v1.15.2 + github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc4 github.com/filecoin-project/go-fil-commcid v0.1.0 github.com/filecoin-project/go-fil-commp-hashhash v0.1.0 - github.com/filecoin-project/go-fil-markets v1.26.0 - github.com/filecoin-project/go-jsonrpc v0.2.1 - github.com/filecoin-project/go-legs v0.4.4 + github.com/filecoin-project/go-fil-markets v1.27.0-rc1 + github.com/filecoin-project/go-jsonrpc v0.2.3 github.com/filecoin-project/go-padreader v0.0.1 github.com/filecoin-project/go-paramfetch v0.0.4 - github.com/filecoin-project/go-state-types v0.10.0-rc2 - github.com/filecoin-project/go-statemachine v1.0.2 + github.com/filecoin-project/go-state-types v0.10.0 + github.com/filecoin-project/go-statemachine v1.0.3 github.com/filecoin-project/go-statestore v0.2.0 github.com/filecoin-project/go-storedcounter v0.1.0 github.com/filecoin-project/mir v0.3.3 @@ -62,7 +63,6 @@ require ( github.com/filecoin-project/test-vectors/schema v0.0.5 github.com/gbrlsnchs/jwt/v3 v3.0.1 github.com/gdamore/tcell/v2 v2.2.0 - github.com/go-kit/kit v0.12.0 github.com/go-openapi/spec v0.19.11 github.com/golang/mock v1.6.0 github.com/google/uuid v1.3.0 @@ -72,63 +72,63 @@ require ( github.com/gregdhill/go-openrpc v0.0.0-20220114144539-ae6f44720487 github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e + github.com/hashicorp/go-hclog v1.3.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/hashicorp/golang-lru v0.5.4 - github.com/hashicorp/raft v1.1.1 + github.com/hashicorp/golang-lru/v2 v2.0.2 + github.com/hashicorp/raft v1.3.10 github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea github.com/icza/backscanner v0.0.0-20210726202459-ac2ffc679f94 github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab github.com/ipfs/bbloom v0.0.4 - github.com/ipfs/go-blockservice v0.4.0 - github.com/ipfs/go-cid v0.3.2 + github.com/ipfs/go-blockservice v0.5.0 + github.com/ipfs/go-cid v0.4.0 github.com/ipfs/go-cidutil v0.1.0 github.com/ipfs/go-datastore v0.6.0 - github.com/ipfs/go-ds-badger2 v0.1.2 + github.com/ipfs/go-ds-badger2 v0.1.3 github.com/ipfs/go-ds-leveldb v0.5.0 github.com/ipfs/go-ds-measure v0.2.0 github.com/ipfs/go-fs-lock v0.0.7 - github.com/ipfs/go-graphsync v0.13.2 + github.com/ipfs/go-graphsync v0.14.3 github.com/ipfs/go-ipfs-blockstore v1.2.0 github.com/ipfs/go-ipfs-blocksutil v0.0.1 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-ds-help v1.1.0 github.com/ipfs/go-ipfs-exchange-interface v0.2.0 github.com/ipfs/go-ipfs-exchange-offline v0.3.0 - github.com/ipfs/go-ipfs-files v0.1.1 - github.com/ipfs/go-ipfs-http-client v0.4.0 + github.com/ipfs/go-ipfs-http-client v0.5.0 github.com/ipfs/go-ipfs-routing v0.3.0 github.com/ipfs/go-ipfs-util v0.0.2 github.com/ipfs/go-ipld-cbor v0.0.6 github.com/ipfs/go-ipld-format v0.4.0 - github.com/ipfs/go-libipfs v0.4.0 + github.com/ipfs/go-libipfs v0.7.0 github.com/ipfs/go-log/v2 v2.5.1 - github.com/ipfs/go-merkledag v0.8.1 + github.com/ipfs/go-merkledag v0.9.0 github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 - github.com/ipfs/go-unixfs v0.4.0 - github.com/ipfs/go-unixfsnode v1.4.0 - github.com/ipfs/interface-go-ipfs-core v0.7.0 - github.com/ipld/go-car v0.4.0 - github.com/ipld/go-car/v2 v2.5.0 + github.com/ipfs/go-unixfs v0.4.3 + github.com/ipfs/go-unixfsnode v1.5.2 + github.com/ipfs/interface-go-ipfs-core v0.11.1 + github.com/ipld/go-car v0.5.0 + github.com/ipld/go-car/v2 v2.7.0 github.com/ipld/go-codec-dagpb v1.5.0 - github.com/ipld/go-ipld-prime v0.18.0 + github.com/ipld/go-ipld-prime v0.20.0 github.com/ipld/go-ipld-selector-text-lite v0.0.1 - github.com/ipni/index-provider v0.10.0 + github.com/ipni/index-provider v0.11.0 + github.com/ipni/storetheindex v0.5.10 github.com/kelseyhightower/envconfig v1.4.0 github.com/koalacxr/quantile v0.0.1 github.com/libp2p/go-buffer-pool v0.1.0 - github.com/libp2p/go-libp2p v0.23.4 + github.com/libp2p/go-libp2p v0.26.2 github.com/libp2p/go-libp2p-consensus v0.0.1 - github.com/libp2p/go-libp2p-core v0.20.1 - github.com/libp2p/go-libp2p-gorpc v0.4.0 - github.com/libp2p/go-libp2p-kad-dht v0.18.0 - github.com/libp2p/go-libp2p-pubsub v0.8.2 - github.com/libp2p/go-libp2p-raft v0.1.8 + github.com/libp2p/go-libp2p-gorpc v0.5.0 + github.com/libp2p/go-libp2p-kad-dht v0.21.0 + github.com/libp2p/go-libp2p-pubsub v0.9.3 + github.com/libp2p/go-libp2p-raft v0.4.0 github.com/libp2p/go-libp2p-record v0.2.0 - github.com/libp2p/go-libp2p-routing-helpers v0.2.3 + github.com/libp2p/go-libp2p-routing-helpers v0.4.0 github.com/libp2p/go-maddr-filter v0.1.0 - github.com/libp2p/go-msgio v0.2.0 - github.com/mattn/go-isatty v0.0.16 + github.com/libp2p/go-msgio v0.3.0 + github.com/mattn/go-isatty v0.0.17 github.com/mattn/go-sqlite3 v1.14.16 github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 github.com/mitchellh/go-homedir v1.1.0 @@ -137,36 +137,38 @@ require ( github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multibase v0.1.1 github.com/multiformats/go-multihash v0.2.1 - github.com/multiformats/go-varint v0.0.6 + github.com/multiformats/go-varint v0.0.7 github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333 - github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e - github.com/prometheus/client_golang v1.13.0 + github.com/polydawn/refmt v0.89.0 + github.com/prometheus/client_golang v1.14.0 github.com/raulk/clock v1.1.0 github.com/raulk/go-watchdog v1.3.0 github.com/stretchr/testify v1.8.1 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/urfave/cli/v2 v2.16.3 github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba - github.com/whyrusleeping/cbor-gen v0.0.0-20221021053955-c138aae13722 + github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa github.com/whyrusleeping/ledger-filecoin-go v0.9.1-0.20201010031517-c3dcc1bddce4 github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 github.com/xeipuuv/gojsonschema v1.2.0 github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 - go.opencensus.io v0.23.0 - go.opentelemetry.io/otel v1.11.1 + github.com/zyedidia/generic v1.2.1 + go.opencensus.io v0.24.0 + go.opentelemetry.io/otel v1.12.0 go.opentelemetry.io/otel/bridge/opencensus v0.33.0 go.opentelemetry.io/otel/exporters/jaeger v1.2.0 go.opentelemetry.io/otel/sdk v1.11.1 - go.uber.org/fx v1.19.2-0.20230112190306-5e90c3828924 - go.uber.org/multierr v1.8.0 - go.uber.org/zap v1.23.0 - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 - golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b + go.uber.org/atomic v1.10.0 + go.uber.org/fx v1.19.2 + go.uber.org/multierr v1.9.0 + go.uber.org/zap v1.24.0 + golang.org/x/crypto v0.5.0 + golang.org/x/exp v0.0.0-20230129154200-a960b3787bd2 golang.org/x/net v0.7.0 - golang.org/x/sync v0.0.0-20220907140024-f12130a52804 + golang.org/x/sync v0.1.0 golang.org/x/sys v0.5.0 golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 - golang.org/x/tools v0.1.12 + golang.org/x/tools v0.3.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 google.golang.org/protobuf v1.28.1 gopkg.in/cheggaaa/pb.v1 v1.0.28 @@ -178,7 +180,6 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/StackExchange/wmi v1.2.1 // indirect - github.com/Stebalien/go-bitfield v0.0.1 // indirect github.com/akavel/rsrc v0.8.0 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/armon/go-metrics v0.3.9 // indirect @@ -187,7 +188,7 @@ require ( github.com/bep/debounce v1.2.1 // indirect github.com/boltdb/bolt v1.3.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cilium/ebpf v0.4.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect @@ -198,7 +199,7 @@ require ( github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect - github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/drand/kyber-bls12381 v0.2.3 // indirect github.com/elastic/go-windows v1.0.0 // indirect github.com/etclabscore/go-jsonschema-walk v0.0.6 // indirect @@ -211,10 +212,9 @@ require ( github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 // indirect github.com/flynn/noise v1.0.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/fxamacker/cbor/v2 v2.4.0 // indirect github.com/gdamore/encoding v1.0.0 // indirect - github.com/go-kit/log v0.2.0 // indirect + github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -225,34 +225,35 @@ require ( github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/gopacket v1.1.19 // indirect - github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1 // indirect + github.com/google/pprof v0.0.0-20221203041831-ce31453925ec // indirect + github.com/hannahhoward/cbor-gen-for v0.0.0-20230214144701-5d17c9d5243c // indirect github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-hclog v0.16.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-msgpack v0.5.5 // indirect + github.com/hashicorp/golang-lru v0.6.0 // indirect github.com/huin/goupnp v1.0.3 // indirect github.com/iancoleman/orderedmap v0.1.0 // indirect - github.com/ipfs/go-bitfield v1.0.0 // indirect + github.com/ipfs/go-bitfield v1.1.0 // indirect github.com/ipfs/go-block-format v0.1.1 // indirect github.com/ipfs/go-filestore v1.2.0 // indirect - github.com/ipfs/go-ipfs-cmds v0.7.0 // indirect + github.com/ipfs/go-ipfs-cmds v0.8.2 // indirect github.com/ipfs/go-ipfs-delay v0.0.1 // indirect + github.com/ipfs/go-ipfs-files v0.3.0 // indirect github.com/ipfs/go-ipfs-posinfo v0.0.1 // indirect - github.com/ipfs/go-ipfs-pq v0.0.2 // indirect + github.com/ipfs/go-ipfs-pq v0.0.3 // indirect github.com/ipfs/go-ipld-legacy v0.1.1 // indirect github.com/ipfs/go-ipns v0.3.0 // indirect github.com/ipfs/go-log v1.0.5 // indirect - github.com/ipfs/go-path v0.3.0 // indirect - github.com/ipfs/go-peertaskqueue v0.8.0 // indirect + github.com/ipfs/go-path v0.3.1 // indirect + github.com/ipfs/go-peertaskqueue v0.8.1 // indirect github.com/ipfs/go-verifcid v0.0.2 // indirect github.com/ipld/go-ipld-adl-hamt v0.0.0-20220616142416-9004dbd839e0 // indirect - github.com/ipni/storetheindex v0.5.3-0.20221203123030-16745cb63f15 // indirect github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c // indirect @@ -263,64 +264,58 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/kilic/bls12-381 v0.1.0 // indirect - github.com/klauspost/compress v1.15.10 // indirect - github.com/klauspost/cpuid/v2 v2.1.1 // indirect + github.com/klauspost/compress v1.15.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.3 // indirect github.com/koron/go-ssdp v0.0.3 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect - github.com/libp2p/go-libp2p-connmgr v0.4.0 // indirect - github.com/libp2p/go-libp2p-gostream v0.5.0 // indirect + github.com/libp2p/go-libp2p-gostream v0.6.0 // indirect github.com/libp2p/go-libp2p-kbucket v0.5.0 // indirect - github.com/libp2p/go-libp2p-noise v0.5.0 // indirect - github.com/libp2p/go-libp2p-peerstore v0.8.0 // indirect - github.com/libp2p/go-libp2p-tls v0.5.0 // indirect github.com/libp2p/go-nat v0.1.0 // indirect - github.com/libp2p/go-netroute v0.2.0 // indirect - github.com/libp2p/go-openssl v0.1.0 // indirect + github.com/libp2p/go-netroute v0.2.1 // indirect github.com/libp2p/go-reuseport v0.2.0 // indirect github.com/libp2p/go-yamux/v3 v3.1.2 // indirect github.com/libp2p/go-yamux/v4 v4.0.0 // indirect - github.com/lucas-clemente/quic-go v0.29.1 // indirect github.com/lucasb-eyer/go-colorful v1.0.3 // indirect github.com/magefile/mage v1.9.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect - github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect - github.com/marten-seemann/qtls-go1-19 v0.1.0 // indirect + github.com/mailru/easyjson v0.7.6 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect - github.com/mattn/go-colorable v0.1.9 // indirect - github.com/mattn/go-pointer v0.0.1 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-runewidth v0.0.10 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/dns v1.1.50 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect github.com/minio/sha256-simd v1.0.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect - github.com/multiformats/go-base36 v0.1.0 // indirect + github.com/multiformats/go-base36 v0.2.0 // indirect github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect - github.com/multiformats/go-multicodec v0.6.0 // indirect - github.com/multiformats/go-multistream v0.3.3 // indirect - github.com/nikkolasg/hexjson v0.0.0-20181101101858-78e39397e00c // indirect + github.com/multiformats/go-multicodec v0.8.0 // indirect + github.com/multiformats/go-multistream v0.4.1 // indirect + github.com/nikkolasg/hexjson v0.1.0 // indirect github.com/nkovacs/streamquote v1.0.0 // indirect - github.com/nxadm/tail v1.4.8 // indirect - github.com/onsi/ginkgo v1.16.5 // indirect + github.com/onsi/ginkgo/v2 v2.5.1 // indirect github.com/opencontainers/runtime-spec v1.0.2 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/prometheus/statsd_exporter v0.21.0 // indirect + github.com/quic-go/qpack v0.4.0 // indirect + github.com/quic-go/qtls-go1-19 v0.2.1 // indirect + github.com/quic-go/qtls-go1-20 v0.1.1 // indirect + github.com/quic-go/quic-go v0.33.0 // indirect + github.com/quic-go/webtransport-go v0.5.2 // indirect github.com/rivo/uniseg v0.1.0 // indirect github.com/rs/cors v1.7.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shirou/gopsutil v2.18.12+incompatible // indirect - github.com/sirupsen/logrus v1.8.1 // indirect - github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/tidwall/gjson v1.14.1 // indirect github.com/tidwall/match v1.1.1 // indirect @@ -328,14 +323,12 @@ require ( github.com/tidwall/tinylru v1.1.0 // indirect github.com/tidwall/wal v1.1.7 // indirect github.com/twmb/murmur3 v1.1.6 // indirect - github.com/uber/jaeger-client-go v2.25.0+incompatible // indirect github.com/ugorji/go/codec v1.2.6 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.0.1 // indirect github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 // indirect github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect - github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect @@ -344,20 +337,19 @@ require ( github.com/zondax/ledger-go v0.12.1 // indirect go.opentelemetry.io/otel/metric v0.33.0 // indirect go.opentelemetry.io/otel/sdk/metric v0.33.0 // indirect - go.opentelemetry.io/otel/trace v1.11.1 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/dig v1.16.0 // indirect + go.opentelemetry.io/otel/trace v1.12.0 // indirect + go.uber.org/dig v1.16.1 // indirect go4.org v0.0.0-20200411211856-f5505b9728dd // indirect - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect + golang.org/x/mod v0.7.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 // indirect google.golang.org/grpc v1.50.1 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect lukechampine.com/blake3 v1.1.7 // indirect + nhooyr.io/websocket v1.8.7 // indirect ) replace github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi diff --git a/go.sum b/go.sum index 3439fde817..5f330ba905 100644 --- a/go.sum +++ b/go.sum @@ -44,7 +44,6 @@ git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGy github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= -github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= @@ -77,7 +76,6 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/Stebalien/go-bitfield v0.0.1 h1:X3kbSSPUaJK60wV2hjOPZwmpljr6VGCqdq4cBLhbQBo= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= @@ -93,7 +91,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= @@ -107,15 +104,10 @@ github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQh github.com/armon/go-metrics v0.3.9 h1:O2sNqxBdvq8Eq5xmzljcYzAORli6RWCvEym4cJf9m18= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.32.11/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= -github.com/benbjohnson/clock v1.0.2/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -129,20 +121,17 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/briandowns/spinner v1.11.1/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= -github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= @@ -156,20 +145,24 @@ github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7 github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ= +github.com/cenkalti/backoff/v4 v4.0.0 h1:6VeaLF9aI+MAUQ95106HwWzYZgJJpZ4stumjj6RFYAU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/chzyer/logex v1.2.0 h1:+eqR0HfOetur4tgnC8ftU5imRnhi4te+BadWS95c5AM= +github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= +github.com/chzyer/readline v1.5.0 h1:lSwwFrbNviGePhkewF1az4oLmcwqCZijQ2/Wi3BGHAI= +github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/chzyer/test v0.0.0-20210722231415-061457976a23 h1:dZ0/VyGgQdVGAss6Ju0dt5P0QltE0SFY5Woh6hbIfiQ= +github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0 h1:QlHdikaxALkqWasW8hAC1mfR0jdmvbfaBdBPFmRSglA= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= @@ -180,8 +173,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -191,7 +182,6 @@ github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkb github.com/consensus-shipyard/go-ipc-types v0.1.4 h1:lNDKpSn54MN9wR4NZhklsGKoIKRzdzrC/KSp0ypa9dI= github.com/consensus-shipyard/go-ipc-types v0.1.4/go.mod h1:oZQ3wFTjxmAQLFZrHkj7pagpNF7Oq+GOy/bpjjgD83A= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= github.com/containerd/cgroups v1.0.4 h1:jN/mbWBEaz+T1pi5OFtnkQ+8qnmEbAr1Oo1FRm5B0dA= github.com/containerd/cgroups v1.0.4/go.mod h1:nLNQtsF7Sl2HxNebu77i1R0oDlhiTG+kO4JTrUzo6IA= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -201,11 +191,9 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.4.0 h1:y9YHcjnjynCd/DVbg5j9L/33jQM3MxJlbj/zWskzfGU= -github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -241,27 +229,27 @@ github.com/dgraph-io/badger v1.6.0-rc1/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhY github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger v1.6.1/go.mod h1:FRmFw3uxvcpa8zG3Rxs0th+hCLIuaQg8HlNV5bjgnuU= github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= -github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= -github.com/dgraph-io/badger/v2 v2.2007.3 h1:Sl9tQWz92WCbVSe8pj04Tkqlm2boW+KAxd+XSs58SQI= github.com/dgraph-io/badger/v2 v2.2007.3/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= +github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= +github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/drand/bls12-381 v0.3.2/go.mod h1:dtcLgPtYT38L3NO6mPDYH0nbpc5tjPassDqiniuAt4Y= -github.com/drand/drand v1.3.0 h1:k/w/PtHzmlU6OmfoAqgirWyrJ4FZH8ESlJrsKF20UkM= -github.com/drand/drand v1.3.0/go.mod h1:D6kAVlxufq1gi71YCGfzN455JrXF4Q272ZJEG975fzo= +github.com/drand/drand v1.4.9 h1:WE8Jf/l+7B/rheCMCLZTp5xk0/a05t+ciwBvORq9jXM= +github.com/drand/drand v1.4.9/go.mod h1:vsmJ/kDoVLv1NC0nFihzBPmIFvMGmYtgJewzRBBRVSc= github.com/drand/kyber v1.0.1-0.20200110225416-8de27ed8c0e2/go.mod h1:UpXoA0Upd1N9l4TvRPHr1qAUBBERj6JQ/mnKI3BPEmw= github.com/drand/kyber v1.0.2/go.mod h1:x6KOpK7avKj0GJ4emhXFP5n7M7W7ChAPmnQh/OL6vRw= github.com/drand/kyber v1.1.4/go.mod h1:9+IgTq7kadePhZg7eRwSD7+bA+bmvqRK+8DtmoV5a3U= -github.com/drand/kyber v1.1.7/go.mod h1:UkHLsI4W6+jT5PvNxmc0cvQAgppjTUpX+XCsN9TXmRo= github.com/drand/kyber v1.1.10/go.mod h1:UkHLsI4W6+jT5PvNxmc0cvQAgppjTUpX+XCsN9TXmRo= github.com/drand/kyber v1.1.15 h1:YNL02FPOA98GmlIhh5FuEJWhz1ZCp6tOUVFN7ujBJPE= github.com/drand/kyber v1.1.15/go.mod h1:tw0l70U6aWCkc4vDr8u/canpOOOiUNJlzsmeElhBfe0= @@ -285,15 +273,12 @@ github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6 github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= -github.com/ema/qdisc v0.0.0-20190904071900-b82c76788043/go.mod h1:ix4kG2zvdUd8kEKSW0ZTr1XLks0epFpI4j745DXxlNE= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etclabscore/go-jsonschema-walk v0.0.6 h1:DrNzoKWKd8f8XB5nFGBY00IcjakRE22OTI12k+2LkyY= @@ -305,6 +290,7 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.8.0/go.mod h1:3l45GVGkyrnYNl9HoIjnp2NnNWvh6hLAqD8yTfGjnw8= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/filecoin-project/dagstore v0.5.2 h1:Nd6oXdnolbbVhpMpkYT5PJHOjQp4OBSntHpMV5pxj3c= github.com/filecoin-project/dagstore v0.5.2/go.mod h1:mdqKzYrRBHf1pRMthYfMv3n37oOw0Tkx7+TxPt240M0= github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= @@ -333,8 +319,8 @@ github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082 github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= github.com/filecoin-project/go-crypto v0.0.1 h1:AcvpSGGCgjaY8y1az6AMfKQWreF/pWO2JJGLl6gCq6o= github.com/filecoin-project/go-crypto v0.0.1/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= -github.com/filecoin-project/go-data-transfer v1.15.2 h1:PzqsFr2Q/onMGKrGh7TtRT0dKsJcVJrioJJnjnKmxlk= -github.com/filecoin-project/go-data-transfer v1.15.2/go.mod h1:qXOJ3IF5dEJQHykXXTwcaRxu17bXAxr+LglXzkL6bZQ= +github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc4 h1:Y5RMvFT4OthsAhDx7xKfkJ5QdiWq9Ox7N46Mi0PF0PE= +github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc4/go.mod h1:1WDoUgWYB2KvogfPTdDmoyBTa9cb9+oGwqKCCipnJeY= github.com/filecoin-project/go-ds-versioning v0.1.2 h1:to4pTadv3IeV1wvgbCbN6Vqd+fu+7tveXgv/rCEZy6w= github.com/filecoin-project/go-ds-versioning v0.1.2/go.mod h1:C9/l9PnB1+mwPa26BBVpCjG/XQCB0yj/q5CK2J8X1I4= github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= @@ -342,8 +328,8 @@ github.com/filecoin-project/go-fil-commcid v0.1.0 h1:3R4ds1A9r6cr8mvZBfMYxTS88Oq github.com/filecoin-project/go-fil-commcid v0.1.0/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-commp-hashhash v0.1.0 h1:imrrpZWEHRnNqqv0tN7LXep5bFEVOVmQWHJvl2mgsGo= github.com/filecoin-project/go-fil-commp-hashhash v0.1.0/go.mod h1:73S8WSEWh9vr0fDJVnKADhfIv/d6dCbAGaAGWbdJEI8= -github.com/filecoin-project/go-fil-markets v1.26.0 h1:uNtt1UAxX2C/Q8tlWD00oF2Zma3CVGxhZmBc2ljYhkk= -github.com/filecoin-project/go-fil-markets v1.26.0/go.mod h1:eOIYHfPwyqc64O1HiapvcelfnrTfU7gLQgBf55IYleQ= +github.com/filecoin-project/go-fil-markets v1.27.0-rc1 h1:SYXKFONg6IaQlmXEqAEaPtb/xX57dZYMkx3LwjsLr7w= +github.com/filecoin-project/go-fil-markets v1.27.0-rc1/go.mod h1:JkW4rU0+LqfO/DLi/wyR58AqxaUdnlSofWeu8un2XLU= github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM= github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24= github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 h1:b3UDemBYN2HNfk3KOXNuxgTTxlWi3xVvbQP0IT38fvM= @@ -351,15 +337,14 @@ github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0/go.mod h1:7aWZdaQ1b16BVoQUYR+ github.com/filecoin-project/go-hamt-ipld/v3 v3.0.1/go.mod h1:gXpNmr3oQx8l3o7qkGyDjJjYSRX7hp/FGOStdqrWyDI= github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 h1:rVVNq0x6RGQIzCo1iiJlGFm9AGIZzeifggxtKMU7zmI= github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0/go.mod h1:bxmzgT8tmeVQA1/gvBwFmYdT8SOFUwB3ovSUfG1Ux0g= -github.com/filecoin-project/go-jsonrpc v0.2.1 h1:xfxkfIAO300sPiV59DnxnCb4sdTtWYlRz/TsP+ByT2E= -github.com/filecoin-project/go-jsonrpc v0.2.1/go.mod h1:jBSvPTl8V1N7gSTuCR4bis8wnQnIjHbRPpROol6iQKM= -github.com/filecoin-project/go-legs v0.4.4 h1:mpMmAOOnamaz0CV9rgeKhEWA8j9kMC+f+UGCGrxKaZo= -github.com/filecoin-project/go-legs v0.4.4/go.mod h1:JQ3hA6xpJdbR8euZ2rO0jkxaMxeidXf0LDnVuqPAe9s= +github.com/filecoin-project/go-jsonrpc v0.2.3 h1:xdixRQfLbD8gt56dpBNKiya9gvI/79nNM13IHKTfm5E= +github.com/filecoin-project/go-jsonrpc v0.2.3/go.mod h1:jBSvPTl8V1N7gSTuCR4bis8wnQnIjHbRPpROol6iQKM= github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20/go.mod h1:mPn+LRRd5gEKNAtc+r3ScpW2JRU/pj4NBKdADYWHiak= github.com/filecoin-project/go-padreader v0.0.1 h1:8h2tVy5HpoNbr2gBRr+WD6zV6VD6XHig+ynSGJg8ZOs= github.com/filecoin-project/go-padreader v0.0.1/go.mod h1:VYVPJqwpsfmtoHnAmPx6MUwmrK6HIcDqZJiuZhtmfLQ= github.com/filecoin-project/go-paramfetch v0.0.4 h1:H+Me8EL8T5+79z/KHYQQcT8NVOzYVqXIi7nhb48tdm8= github.com/filecoin-project/go-paramfetch v0.0.4/go.mod h1:1FH85P8U+DUEmWk1Jkw3Bw7FrwTVUNHk/95PSPG+dts= +github.com/filecoin-project/go-retrieval-types v1.2.0 h1:fz6DauLVP3GRg7UuW7HZ6sE+GTmaUW70DTXBF1r9cK0= github.com/filecoin-project/go-state-types v0.0.0-20200903145444-247639ffa6ad/go.mod h1:IQ0MBPnonv35CJHtWSN3YY1Hz2gkPru1Q9qoaYLxx9I= github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= @@ -367,11 +352,11 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= -github.com/filecoin-project/go-state-types v0.10.0-rc2 h1:nl92h86XridAoy0fjvW+8/8/eI0caVSm0fhAnIvtR64= -github.com/filecoin-project/go-state-types v0.10.0-rc2/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024= +github.com/filecoin-project/go-state-types v0.10.0 h1:vsSThZIaPmOxNGG59+8D/HnlWRtlbdOjduH6ye+v8f0= +github.com/filecoin-project/go-state-types v0.10.0/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= -github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc= -github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= +github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= +github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= github.com/filecoin-project/go-statestore v0.2.0 h1:cRRO0aPLrxKQCZ2UOQbzFGn4WDNdofHZoGPjfNaAo5Q= github.com/filecoin-project/go-statestore v0.2.0/go.mod h1:8sjBYbS35HwPzct7iT4lIXjLlYyPor80aU7t7a/Kspo= @@ -402,7 +387,6 @@ github.com/filecoin-project/specs-actors/v8 v8.0.1/go.mod h1:UYIPg65iPWoFw5NEftR github.com/filecoin-project/test-vectors/schema v0.0.5 h1:w3zHQhzM4pYxJDl21avXjOKBLF8egrvwUwjpT8TquDg= github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= @@ -411,14 +395,10 @@ github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVB github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= -github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fxamacker/cbor/v2 v2.4.0 h1:ri0ArlOR+5XunOP8CRUowT0pSJOwhW098ZCUyskZD88= github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= github.com/gbrlsnchs/jwt/v3 v3.0.1 h1:lbUmgAKpxnClrKloyIwpxm4OuWeDl5wLk52G91ODPw4= @@ -428,8 +408,13 @@ github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo github.com/gdamore/tcell/v2 v2.2.0 h1:vSyEgKwraXPSOkvCk7IwOSyX+Pv3V2cV9CikJMXg4U4= github.com/gdamore/tcell/v2 v2.2.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= +github.com/go-chi/chi v1.5.4 h1:QHdzF2szwjqVV4wmByUnTcsbIg7UGaQ0tPF2t5GcAIs= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -437,11 +422,10 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -471,24 +455,34 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.8/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/swag v0.19.11 h1:RFTu/dlFySpyVvJDfp/7674JY4SDglYWKztbiIGFpmc= github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= github.com/gobuffalo/packr/v2 v2.6.0/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08= -github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.0 h1:zgVt4UpGxcqVOw97aRGxT4svlcmdK35fynLNctY32zI= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -496,11 +490,10 @@ github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc= -github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/gogo/status v1.1.1 h1:DuHXlSFHNKqTQ+/ACf5Vs6r4X/dH2EgIzR9Vr+H65kg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -538,6 +531,7 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -554,8 +548,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= @@ -573,6 +565,8 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20221203041831-ce31453925ec h1:fR20TYVVwhK4O7r7y+McjRYyaTH6/vjwJOajE+XhlzM= +github.com/google/pprof v0.0.0-20221203041831-ce31453925ec/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -589,10 +583,8 @@ github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORR github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk= @@ -607,22 +599,19 @@ github.com/gregdhill/go-openrpc v0.0.0-20220114144539-ae6f44720487 h1:NyaWOSkqFK github.com/gregdhill/go-openrpc v0.0.0-20220114144539-ae6f44720487/go.mod h1:a1eRkbhd3DYpRH2lnuUsVG+QMTI+v0hGnsis8C9hMrA= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 h1:0IKlLyQ3Hs9nDaiK5cSHAGmcQEIC8l2Ts1u6x5Dfrqg= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= -github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1 h1:F9k+7wv5OIk1zcq23QpdiL0hfDuXPjuOmMNaC6fgQ0Q= -github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1/go.mod h1:jvfsLIxk0fY/2BKSQ1xf2406AKA5dwMmKKv0ADcOfN8= +github.com/hannahhoward/cbor-gen-for v0.0.0-20230214144701-5d17c9d5243c h1:iiD+p+U0M6n/FsO6XIZuOgobnNa48FxtyYFfWwLttUQ= +github.com/hannahhoward/cbor-gen-for v0.0.0-20230214144701-5d17c9d5243c/go.mod h1:jvfsLIxk0fY/2BKSQ1xf2406AKA5dwMmKKv0ADcOfN8= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e h1:3YKHER4nmd7b5qy5t0GWDTwSn4OyRgfAXSmo6VnryBY= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e/go.mod h1:I8h3MITA53gN9OnWGCgaMa0JWVRdXthWw4M3CPM54OY= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= @@ -633,8 +622,8 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= -github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.3.0 h1:G0ACM8Z2WilWgPv3Vdzwm3V0BQu/kSmrkVtpe1fy9do= +github.com/hashicorp/go-hclog v1.3.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -642,7 +631,6 @@ github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iP github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= @@ -656,22 +644,23 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= +github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.2 h1:Dwmkdr5Nc/oBiXgJS3CDHNhJtIHkuZ3DZF5twqnfBdU= +github.com/hashicorp/golang-lru/v2 v2.0.2/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/raft v1.1.1 h1:HJr7UE1x/JrJSc9Oy6aDBHtNHUUBHjcQjTgvUVihoZs= -github.com/hashicorp/raft v1.1.1/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= +github.com/hashicorp/raft v1.3.10 h1:LR5QZX1VQd0DFWZfeCwWawyeKfpS/Tm1yjnJIY5X4Tw= +github.com/hashicorp/raft v1.3.10/go.mod h1:J8naEwc6XaaCfts7+28whSeRvCqTd6e20BlCU3LtEO4= github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea h1:xykPFhrBAS2J0VBzVa5e80b5ZtYuNQtgXjN40qBZlD4= github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hodgesds/perf-utils v0.0.8/go.mod h1:F6TfvsbtrF88i++hou29dTXlI2sfsJv+gRZDtmTJkAs= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= -github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -692,13 +681,13 @@ github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/go-bitfield v1.0.0 h1:y/XHm2GEmD9wKngheWNNCNL0pzrWXZwCdQGv1ikXknQ= -github.com/ipfs/go-bitfield v1.0.0/go.mod h1:N/UiujQy+K+ceU1EF5EkVd1TNqevLrCQMIcAEPrdtus= +github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA= +github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= github.com/ipfs/go-bitswap v0.5.1/go.mod h1:P+ckC87ri1xFLvk74NlXdP0Kj9RmWAh4+H78sC6Qopo= github.com/ipfs/go-bitswap v0.6.0/go.mod h1:Hj3ZXdOC5wBJvENtdqsixmzzRukqd8EHLxZLZc3mzRA= -github.com/ipfs/go-bitswap v0.10.2 h1:B81RIwkTnIvSYT1ZCzxjYTeF0Ek88xa9r1AMpTfk+9Q= +github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= @@ -707,8 +696,8 @@ github.com/ipfs/go-block-format v0.1.1/go.mod h1:+McEIT+g52p+zz5xGAABGSOKrzmrdX9 github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= github.com/ipfs/go-blockservice v0.2.1/go.mod h1:k6SiwmgyYgs4M/qt+ww6amPeUH9EISLRBnvUurKJhi8= github.com/ipfs/go-blockservice v0.3.0/go.mod h1:P5ppi8IHDC7O+pA0AlGTF09jruB2h+oP3wVVaZl8sfk= -github.com/ipfs/go-blockservice v0.4.0 h1:7MUijAW5SqdsqEW/EhnNFRJXVF8mGU5aGhZ3CQaCWbY= -github.com/ipfs/go-blockservice v0.4.0/go.mod h1:kRjO3wlGW9mS1aKuiCeGhx9K1DagQ10ACpVO59qgAx4= +github.com/ipfs/go-blockservice v0.5.0 h1:B2mwhhhVQl2ntW2EIpaWPwSCxSuqr5fFA93Ms4bYLEY= +github.com/ipfs/go-blockservice v0.5.0/go.mod h1:W6brZ5k20AehbmERplmERn8o2Ni3ZZubvAxaIUeaT6w= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -720,8 +709,8 @@ github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqg github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.1.0/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o= github.com/ipfs/go-cid v0.2.0/go.mod h1:P+HXFDF4CVhaVayiEb4wkAy7zBHxBwsJyt0Y5U6MLro= -github.com/ipfs/go-cid v0.3.2 h1:OGgOd+JCFM+y1DjWPmVH+2/4POtpDzwcr7VgnB7mZXc= -github.com/ipfs/go-cid v0.3.2/go.mod h1:gQ8pKqT/sUxGY+tIwy1RPpAojYu7jAyCp5Tz1svoupw= +github.com/ipfs/go-cid v0.4.0 h1:a4pdZq0sx6ZSxbCizebnKiMCx/xI/aBBFlB73IgH4rA= +github.com/ipfs/go-cid v0.4.0/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/ipfs/go-cidutil v0.1.0 h1:RW5hO7Vcf16dplUU60Hs0AKDkQAVPVplr7lk97CFL+Q= github.com/ipfs/go-cidutil v0.1.0/go.mod h1:e7OEVBMIv9JaOxt9zaGEmAoSlXW9jdFZ5lP/0PwcfpA= github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= @@ -744,9 +733,8 @@ github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaH github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= github.com/ipfs/go-ds-badger v0.3.0 h1:xREL3V0EH9S219kFFueOYJJTcjgNSZ2HY1iSvN7U1Ro= -github.com/ipfs/go-ds-badger v0.3.0/go.mod h1:1ke6mXNqeV8K3y5Ak2bAA0osoTfmxUdupVCGm4QUIek= -github.com/ipfs/go-ds-badger2 v0.1.2 h1:sQc2q1gaXrv8YFNeUtxil0neuyDf9hnVHfLsi7lpXfE= -github.com/ipfs/go-ds-badger2 v0.1.2/go.mod h1:3FtQmDv6fMubygEfU43bsFelYpIiXX/XEYA54l9eCwg= +github.com/ipfs/go-ds-badger2 v0.1.3 h1:Zo9JicXJ1DmXTN4KOw7oPXkspZ0AWHcAFCP1tQKnegg= +github.com/ipfs/go-ds-badger2 v0.1.3/go.mod h1:TPhhljfrgewjbtuL/tczP8dNrBYwwk+SdPYbms/NO9w= github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= @@ -754,14 +742,13 @@ github.com/ipfs/go-ds-leveldb v0.5.0 h1:s++MEBbD3ZKc9/8/njrn4flZLnCuY9I79v94gBUN github.com/ipfs/go-ds-leveldb v0.5.0/go.mod h1:d3XG9RUDzQ6V4SHi8+Xgj9j1XuEk1z82lquxrVbml/Q= github.com/ipfs/go-ds-measure v0.2.0 h1:sG4goQe0KDTccHMyT45CY1XyUbxe5VwTKpg2LjApYyQ= github.com/ipfs/go-ds-measure v0.2.0/go.mod h1:SEUD/rE2PwRa4IQEC5FuNAmjJCyYObZr9UvVh8V3JxE= -github.com/ipfs/go-fetcher v1.6.1/go.mod h1:27d/xMV8bodjVs9pugh/RCjjK2OZ68UgAMspMdingNo= github.com/ipfs/go-filestore v1.2.0 h1:O2wg7wdibwxkEDcl7xkuQsPvJFRBVgVSsOJ/GP6z3yU= github.com/ipfs/go-filestore v1.2.0/go.mod h1:HLJrCxRXquTeEEpde4lTLMaE/MYJZD7WHLkp9z6+FF8= github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= github.com/ipfs/go-fs-lock v0.0.7 h1:6BR3dajORFrFTkb5EpCUFIAypsoxpGpDSVUdFwzgL9U= github.com/ipfs/go-fs-lock v0.0.7/go.mod h1:Js8ka+FNYmgQRLrRXzU3CB/+Csr1BwrRilEcvYrHhhc= -github.com/ipfs/go-graphsync v0.13.2 h1:+7IjTrdg3+3iwtPXSkLoxvhaByS3+3b9NStMAowFqkw= -github.com/ipfs/go-graphsync v0.13.2/go.mod h1:TO1Y65spARny/t37hkid5xCpQJ6vR7A7VFTEUb0Z6eA= +github.com/ipfs/go-graphsync v0.14.3 h1:IXH9S7AraMQ0J6Fzcl8rqSPqLn+es33bD8OW2KNyU/o= +github.com/ipfs/go-graphsync v0.14.3/go.mod h1:yT0AfjFgicOoWdAlUJ96tQ5AkuGI4r1taIQX/aHbBQo= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.2.1/go.mod h1:jGesd8EtCM3/zPgx+qr0/feTXGUeRai6adgwC+Q+JvE= @@ -773,9 +760,8 @@ github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtL github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= -github.com/ipfs/go-ipfs-cmds v0.7.0 h1:0lEldmB7C83RxIOer38Sv1ob6wIoCAIEOaxiYgcv7wA= -github.com/ipfs/go-ipfs-cmds v0.7.0/go.mod h1:y0bflH6m4g6ary4HniYt98UqbrVnRxmRarzeMdLIUn0= -github.com/ipfs/go-ipfs-config v0.5.3 h1:3GpI/xR9FoJNTjU6YvCMRbYyEi0dBVY5UtlUTcNRlSA= +github.com/ipfs/go-ipfs-cmds v0.8.2 h1:WmehvYWkxch8dTw0bdF51R8lqbyl+3H8e6pIACzT/ds= +github.com/ipfs/go-ipfs-cmds v0.8.2/go.mod h1:/b17Davff0E0Wh/hhXsN1Pgxxbkm26k3PV+G4EDiC/s= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= @@ -794,16 +780,16 @@ github.com/ipfs/go-ipfs-exchange-offline v0.3.0 h1:c/Dg8GDPzixGd0MC8Jh6mjOwU57uY github.com/ipfs/go-ipfs-exchange-offline v0.3.0/go.mod h1:MOdJ9DChbb5u37M1IcbrRB02e++Z7521fMxqCNRrz9s= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.4/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= -github.com/ipfs/go-ipfs-files v0.0.8/go.mod h1:wiN/jSG8FKyk7N0WyctKSvq3ljIa2NNTiZB55kpTdOs= -github.com/ipfs/go-ipfs-files v0.1.1 h1:/MbEowmpLo9PJTEQk16m9rKzUHjeP4KRU9nWJyJO324= -github.com/ipfs/go-ipfs-files v0.1.1/go.mod h1:8xkIrMWH+Y5P7HvJ4Yc5XWwIW2e52dyXUiC0tZyjDbM= -github.com/ipfs/go-ipfs-http-client v0.4.0 h1:LNuVbFoKfCohCmcNImml3byM3PpTxTT7RPrv/UoDFkI= -github.com/ipfs/go-ipfs-http-client v0.4.0/go.mod h1:NXzPUKt/QVCuR74a8angJCGOSLPImNi5LqaTxIep/70= +github.com/ipfs/go-ipfs-files v0.3.0 h1:fallckyc5PYjuMEitPNrjRfpwl7YFt69heCOUhsbGxQ= +github.com/ipfs/go-ipfs-files v0.3.0/go.mod h1:xAUtYMwB+iu/dtf6+muHNSFQCJG2dSiStR2P6sn9tIM= +github.com/ipfs/go-ipfs-http-client v0.5.0 h1:Nisy9655Ru4PQn4+wM+rhzyTBg4ATvqgTq2jPNKrCzE= +github.com/ipfs/go-ipfs-http-client v0.5.0/go.mod h1:RUXNIL5dbEIngUWPXpNQjeFkBuqwwc5NZVD3bdgg5L4= github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs= github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqtlt2a0vILTc1A= github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= -github.com/ipfs/go-ipfs-pq v0.0.2 h1:e1vOOW6MuOwG2lqxcLA+wEn93i/9laCY8sXAw76jFOY= github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= +github.com/ipfs/go-ipfs-pq v0.0.3 h1:YpoHVJB+jzK15mr/xsWC574tyDLkezVrDNeaalQBsTE= +github.com/ipfs/go-ipfs-pq v0.0.3/go.mod h1:btNw5hsHBpRcSSgZtiNm/SLj5gYIZ18AKtv3kERkRb4= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= github.com/ipfs/go-ipfs-routing v0.2.1/go.mod h1:xiNNiwgjmLqPS1cimvAw6EyB9rkVDbiocA4yY+wRNLM= github.com/ipfs/go-ipfs-routing v0.3.0 h1:9W/W3N+g+y4ZDeffSgqhgo7BsBSJwPMcyssET9OWevc= @@ -829,8 +815,8 @@ github.com/ipfs/go-ipld-legacy v0.1.1 h1:BvD8PEuqwBHLTKqlGFTHSwrwFOMkVESEvwIYwR2 github.com/ipfs/go-ipld-legacy v0.1.1/go.mod h1:8AyKFCjgRPsQFf15ZQgDB8Din4DML/fOmKZkkFkrIEg= github.com/ipfs/go-ipns v0.3.0 h1:ai791nTgVo+zTuq2bLvEGmWP1M0A6kGTXUsgv/Yq67A= github.com/ipfs/go-ipns v0.3.0/go.mod h1:3cLT2rbvgPZGkHJoPO1YMJeh6LtkxopCkKFcio/wE24= -github.com/ipfs/go-libipfs v0.4.0 h1:TkUxJGjtPnSzAgkw7VjS0/DBay3MPjmTBa4dGdUQCDE= -github.com/ipfs/go-libipfs v0.4.0/go.mod h1:XsU2cP9jBhDrXoJDe0WxikB8XcVmD3k2MEZvB3dbYu8= +github.com/ipfs/go-libipfs v0.7.0 h1:Mi54WJTODaOL2/ZSm5loi3SwI3jI2OuFWUrQIkJ5cpM= +github.com/ipfs/go-libipfs v0.7.0/go.mod h1:KsIf/03CqhICzyRGyGo68tooiBE2iFbI/rXW7FhAYr0= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.0/go.mod h1:JO7RzlMK6rA+CIxFMLOuB6Wf5b81GDiKElL7UPSIKjA= github.com/ipfs/go-log v1.0.1/go.mod h1:HuWlQttfN6FWNHRhlY5yMk/lW7evQC0HHGOxEwMRR8I= @@ -848,7 +834,6 @@ github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4/go.mod h1:2v2nsGf github.com/ipfs/go-log/v2 v2.1.2/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= github.com/ipfs/go-log/v2 v2.3.0/go.mod h1:QqGoj30OTpnKaG/LKTGTxoP2mmQtjVMEnK72gynbe/g= -github.com/ipfs/go-log/v2 v2.4.0/go.mod h1:nPZnh7Cj7lwS3LpRU5Mwr2ol1c2gXIEXuF6aywqrtmo= github.com/ipfs/go-log/v2 v2.5.0/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= @@ -857,43 +842,39 @@ github.com/ipfs/go-merkledag v0.2.4/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB github.com/ipfs/go-merkledag v0.3.2/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= github.com/ipfs/go-merkledag v0.5.1/go.mod h1:cLMZXx8J08idkp5+id62iVftUQV+HlYJ3PIhDfZsjA4= github.com/ipfs/go-merkledag v0.6.0/go.mod h1:9HSEwRd5sV+lbykiYP+2NC/3o6MZbKNaa4hfNcH5iH0= -github.com/ipfs/go-merkledag v0.8.1 h1:N3yrqSre/ffvdwtHL4MXy0n7XH+VzN8DlzDrJySPa94= -github.com/ipfs/go-merkledag v0.8.1/go.mod h1:uYUlWE34GhbcTjGuUDEcdPzsEtOdnOupL64NgSRjmWI= +github.com/ipfs/go-merkledag v0.9.0 h1:DFC8qZ96Dz1hMT7dtIpcY524eFFDiEWAF8hNJHWW2pk= +github.com/ipfs/go-merkledag v0.9.0/go.mod h1:bPHqkHt5OZ0p1n3iqPeDiw2jIBkjAytRjS3WSBwjq90= github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= github.com/ipfs/go-metrics-prometheus v0.0.2 h1:9i2iljLg12S78OhC6UAiXi176xvQGiZaGVF1CUVdE+s= github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= -github.com/ipfs/go-path v0.3.0 h1:tkjga3MtpXyM5v+3EbRvOHEoo+frwi4oumw5K+KYWyA= -github.com/ipfs/go-path v0.3.0/go.mod h1:NOScsVgxfC/eIw4nz6OiGwK42PjaSJ4Y/ZFPn1Xe07I= +github.com/ipfs/go-path v0.3.1 h1:wkeaCWE/NTuuPGlEkLTsED5UkzfKYZpxaFFPgk8ZVLE= +github.com/ipfs/go-path v0.3.1/go.mod h1:eNLsxJEEMxn/CDzUJ6wuNl+6No6tEUhOZcPKsZsYX0E= github.com/ipfs/go-peertaskqueue v0.1.0/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= github.com/ipfs/go-peertaskqueue v0.7.0/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68ow0Rrb04donIU= -github.com/ipfs/go-peertaskqueue v0.7.1/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68ow0Rrb04donIU= -github.com/ipfs/go-peertaskqueue v0.8.0 h1:JyNO144tfu9bx6Hpo119zvbEL9iQ760FHOiJYsUjqaU= -github.com/ipfs/go-peertaskqueue v0.8.0/go.mod h1:cz8hEnnARq4Du5TGqiWKgMr/BOSQ5XOgMOh1K5YYKKM= +github.com/ipfs/go-peertaskqueue v0.8.1 h1:YhxAs1+wxb5jk7RvS0LHdyiILpNmRIRnZVztekOF0pg= +github.com/ipfs/go-peertaskqueue v0.8.1/go.mod h1:Oxxd3eaK279FxeydSPPVGHzbwVeHjatZ2GA8XD+KbPU= github.com/ipfs/go-unixfs v0.2.2-0.20190827150610-868af2e9e5cb/go.mod h1:IwAAgul1UQIcNZzKPYZWOCijryFBeCV79cNubPzol+k= -github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= -github.com/ipfs/go-unixfs v0.3.1/go.mod h1:h4qfQYzghiIc8ZNFKiLMFWOTzrWIAtzYQ59W/pCFf1o= -github.com/ipfs/go-unixfs v0.4.0 h1:qSyyxfB/OiDdWHYiSbyaqKC7zfSE/TFL0QdwkRjBm20= -github.com/ipfs/go-unixfs v0.4.0/go.mod h1:I7Nqtm06HgOOd+setAoCU6rf/HgVFHE+peeNuOv/5+g= -github.com/ipfs/go-unixfsnode v1.1.2/go.mod h1:5dcE2x03pyjHk4JjamXmunTMzz+VUtqvPwZjIEkfV6s= -github.com/ipfs/go-unixfsnode v1.4.0 h1:9BUxHBXrbNi8mWHc6j+5C580WJqtVw9uoeEKn4tMhwA= -github.com/ipfs/go-unixfsnode v1.4.0/go.mod h1:qc7YFFZ8tABc58p62HnIYbUMwj9chhUuFWmxSokfePo= +github.com/ipfs/go-unixfs v0.4.3 h1:EdDc1sNZNFDUlo4UrVAvvAofVI5EwTnKu8Nv8mgXkWQ= +github.com/ipfs/go-unixfs v0.4.3/go.mod h1:TSG7G1UuT+l4pNj91raXAPkX0BhJi3jST1FDTfQ5QyM= +github.com/ipfs/go-unixfsnode v1.5.2 h1:CvsiTt58W2uR5dD8bqQv+aAY0c1qolmXmSyNbPHYiew= +github.com/ipfs/go-unixfsnode v1.5.2/go.mod h1:NlOebRwYx8lMCNMdhAhEspYPBD3obp7TE0LvBqHY+ks= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= github.com/ipfs/go-verifcid v0.0.2 h1:XPnUv0XmdH+ZIhLGKg6U2vaPaRDXb9urMyNVCE7uvTs= github.com/ipfs/go-verifcid v0.0.2/go.mod h1:40cD9x1y4OWnFXbLNJYRe7MpNvWlMn3LZAG5Wb4xnPU= -github.com/ipfs/interface-go-ipfs-core v0.7.0 h1:7tb+2upz8oCcjIyjo1atdMk+P+u7wPmI+GksBlLE8js= -github.com/ipfs/interface-go-ipfs-core v0.7.0/go.mod h1:lF27E/nnSPbylPqKVXGZghal2hzifs3MmjyiEjnc9FY= +github.com/ipfs/interface-go-ipfs-core v0.11.1 h1:xVW8DKzd230h8bPv+oC2fBjW4PtDGqGtvpX64/aBe48= +github.com/ipfs/interface-go-ipfs-core v0.11.1/go.mod h1:xmnoccUXY7N/Q8AIx0vFqgW926/FAZ8+do/1NTEHKsU= github.com/ipfs/iptb v1.4.0 h1:YFYTrCkLMRwk/35IMyC6+yjoQSHTEcNcefBStLJzgvo= -github.com/ipfs/iptb-plugins v0.3.0 h1:C1rpq1o5lUZtaAOkLIox5akh6ba4uk/3RwWc6ttVxw0= +github.com/ipfs/iptb-plugins v0.5.0 h1:zEMLlWAb531mLpD36KFy/yc0egT6FkBEHQtdERexNao= +github.com/ipfs/kubo v0.18.1 h1:mF8n2toZkWRc1JXs4pGknqoDGJ9NfP+upy/a8OS3oNg= github.com/ipld/go-car v0.1.0/go.mod h1:RCWzaUh2i4mOEkB3W45Vc+9jnS/M6Qay5ooytiBHl3g= -github.com/ipld/go-car v0.4.0 h1:U6W7F1aKF/OJMHovnOVdst2cpQE5GhmHibQkAixgNcQ= -github.com/ipld/go-car v0.4.0/go.mod h1:Uslcn4O9cBKK9wqHm/cLTFacg6RAPv6LZx2mxd2Ypl4= +github.com/ipld/go-car v0.5.0 h1:kcCEa3CvYMs0iE5BzD5sV7O2EwMiCIp3uF8tA6APQT8= +github.com/ipld/go-car v0.5.0/go.mod h1:ppiN5GWpjOZU9PgpAZ9HbZd9ZgSpwPMr48fGRJOWmvE= github.com/ipld/go-car/v2 v2.1.1/go.mod h1:+2Yvf0Z3wzkv7NeI69i8tuZ+ft7jyjPYIWZzeVNeFcI= -github.com/ipld/go-car/v2 v2.5.0 h1:S9h7A6qBAJ+B1M1jIKtau+HPDe30UbM71vsyBzwvRIE= -github.com/ipld/go-car/v2 v2.5.0/go.mod h1:jKjGOqoCj5zn6KjnabD6JbnCsMntqU2hLiU6baZVO3E= +github.com/ipld/go-car/v2 v2.7.0 h1:OFxJl6X6Ii7y7wYX4R+P8q9+vuz4vaY2Y9u1GHzfxbE= +github.com/ipld/go-car/v2 v2.7.0/go.mod h1:qoqfgPnQYcaAYcfphctffdaNWJIWBR2QN4pjuKUtgao= github.com/ipld/go-codec-dagpb v1.2.0/go.mod h1:6nBN7X7h8EOsEejZGqC7tej5drsdBAXbMHyBT+Fne5s= github.com/ipld/go-codec-dagpb v1.3.0/go.mod h1:ga4JTU3abYApDC3pZ00BC2RSvC3qfBb9MSJkMLSwnhA= -github.com/ipld/go-codec-dagpb v1.3.1/go.mod h1:ErNNglIi5KMur/MfFE/svtgQthzVvf+43MrzLbpcIZY= github.com/ipld/go-codec-dagpb v1.5.0 h1:RspDRdsJpLfgCI0ONhTAnbHdySGD4t+LHSPK4X1+R0k= github.com/ipld/go-codec-dagpb v1.5.0/go.mod h1:0yRIutEFD8o1DGVqw4RSHh+BUTlJA9XWldxaaWR/o4g= github.com/ipld/go-ipld-adl-hamt v0.0.0-20220616142416-9004dbd839e0 h1:QAI/Ridj0+foHD6epbxmB4ugxz9B4vmNdYSmQLGa05E= @@ -904,19 +885,17 @@ github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvB github.com/ipld/go-ipld-prime v0.10.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHtEaLglS3ZeV8= github.com/ipld/go-ipld-prime v0.14.0/go.mod h1:9ASQLwUFLptCov6lIYc70GRB4V7UTyLD0IJtrDJe6ZM= -github.com/ipld/go-ipld-prime v0.16.0/go.mod h1:axSCuOCBPqrH+gvXr2w9uAOulJqBPhHPT2PjoiiU1qA= -github.com/ipld/go-ipld-prime v0.17.0/go.mod h1:aYcKm5TIvGfY8P3QBKz/2gKcLxzJ1zDaD+o0bOowhgs= -github.com/ipld/go-ipld-prime v0.18.0 h1:xUk7NUBSWHEXdjiOu2sLXouFJOMs0yoYzeI5RAqhYQo= -github.com/ipld/go-ipld-prime v0.18.0/go.mod h1:735yXW548CKrLwVCYXzqx90p5deRJMVVxM9eJ4Qe+qE= +github.com/ipld/go-ipld-prime v0.20.0 h1:Ud3VwE9ClxpO2LkCYP7vWPc0Fo+dYdYzgxUJZ3uRG4g= +github.com/ipld/go-ipld-prime v0.20.0/go.mod h1:PzqZ/ZR981eKbgdr3y2DJYeD/8bgMawdGVlJDE8kK+M= github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1:gcvzoEDBjwycpXt3LBE061wT9f46szXGHAmj9uoP6fU= -github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73 h1:TsyATB2ZRRQGTwafJdgEUQkmjOExRV0DNokcihZxbnQ= github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73/go.mod h1:2PJ0JgxyB08t0b2WKrcuqI3di0V+5n6RS/LTUJhkoxY= +github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20230102063945-1a409dc236dd h1:gMlw/MhNr2Wtp5RwGdsW23cs+yCuj9k2ON7i9MiJlRo= github.com/ipld/go-ipld-selector-text-lite v0.0.1 h1:lNqFsQpBHc3p5xHob2KvEg/iM5dIFn6iw4L/Hh+kS1Y= github.com/ipld/go-ipld-selector-text-lite v0.0.1/go.mod h1:U2CQmFb+uWzfIEF3I1arrDa5rwtj00PrpiwwCO+k1RM= -github.com/ipni/index-provider v0.10.0 h1:nu8YBxzRopdjwZHsgCUuC4AHpq88VVHJYrbkqUDx7eg= -github.com/ipni/index-provider v0.10.0/go.mod h1:InSXbZp2p/ZhAwiDElG/wzjnA1ea1iJ3hhyiAHrD+Vo= -github.com/ipni/storetheindex v0.5.3-0.20221203123030-16745cb63f15 h1:qJq6QtLk+9nQi3CDBhNfJ1cjZ4pghjCHcQUZ1mWbF0k= -github.com/ipni/storetheindex v0.5.3-0.20221203123030-16745cb63f15/go.mod h1:c/NS640Iu2NrCCIErnUhsUM5KVEyeXymgtNnx6eDwMU= +github.com/ipni/index-provider v0.11.0 h1:q2PdK6JpYB9bzlntfkRYNBjhg4Qtko5+iXRonO88TAg= +github.com/ipni/index-provider v0.11.0/go.mod h1:gB/wN4Mdz4MzikQubjyRRV97iS5BkD4FKB0U/bF/dY4= +github.com/ipni/storetheindex v0.5.10 h1:r97jIZsXPuwQvePJQuStu2a/kn+Zn8X4MAdA0rU2Pu4= +github.com/ipni/storetheindex v0.5.10/go.mod h1:SJKFCnSx4X/4ekQuZvq8pVU/7tmxkEv632Qmgu3m2bQ= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 h1:QG4CGBqCeuBo6aZlGAamSkxWdgWfZGeE49eUOWJPA4c= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= @@ -939,27 +918,23 @@ github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 h1:rp+c0RAYOWj8l6qbCUTSiRLG/iKnW3K3/QfPPuSsBt4= github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.1.1-0.20190114141812-62fb9bc030d1/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= -github.com/jsimonetti/rtnetlink v0.0.0-20190830100107-3784a6c7c552/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= -github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -968,7 +943,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kabukky/httpscerts v0.0.0-20150320125433-617593d7dcb3/go.mod h1:BYpt4ufZiIGv2nXn4gMxnfKV306n3mWXgNu/d2TqdTU= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= @@ -983,17 +957,15 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.10 h1:Ai8UzuomSCDw90e1qNMtb15msBXsNpH6gzkkENQNcJo= -github.com/klauspost/compress v1.15.10/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kElDUEM= +github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= -github.com/klauspost/cpuid/v2 v2.1.1 h1:t0wUqjowdm8ezddV5k0tLWVklVuvLJpoHeb4WBdydm0= -github.com/klauspost/cpuid/v2 v2.1.1/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU= +github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/koalacxr/quantile v0.0.1 h1:wAW+SQ286Erny9wOjVww96t8ws+x5Zj6AKHDULUK+o0= github.com/koalacxr/quantile v0.0.1/go.mod h1:bGN/mCZLZ4lrSDHRQ6Lglj9chowGux8sGUIND+DQeD0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1001,24 +973,24 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= -github.com/koron/go-ssdp v0.0.2/go.mod h1:XoLfkAiA2KeZsYh4DbHxD7h3nR2AZNqVQOa+LJuqPYs= github.com/koron/go-ssdp v0.0.3 h1:JivLMY45N76b4p/vsWGOKewBQu6uf39y8l+AQ7sDKx8= github.com/koron/go-ssdp v0.0.3/go.mod h1:b2MxI6yh02pKrsyNoQUsk4+YNikaGhe4894J+Q5lDvA= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= -github.com/libp2p/go-addr-util v0.1.0/go.mod h1:6I3ZYuFr2O/9D+SoyM0zEw0EF3YkldtTX406BpdQMqw= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= @@ -1028,11 +1000,9 @@ github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0 github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= -github.com/libp2p/go-conn-security-multistream v0.3.0/go.mod h1:EEP47t4fw/bTelVmEzIDqSe69hO/ip52xBEhZMLWAHM= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= -github.com/libp2p/go-flow-metrics v0.0.2/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= @@ -1042,14 +1012,9 @@ github.com/libp2p/go-libp2p v0.6.1/go.mod h1:CTFnWXogryAHjXAKEbOf1OWY+VeAP3lDMZk github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xSU1ivxn0k= github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= -github.com/libp2p/go-libp2p v0.13.0/go.mod h1:pM0beYdACRfHO1WcJlp65WXyG2A6NqYM+t2DTVAJxMo= github.com/libp2p/go-libp2p v0.14.3/go.mod h1:d12V4PdKbpL0T1/gsUNN8DfgMuRPDX8bS2QxCZlwRH0= -github.com/libp2p/go-libp2p v0.14.4/go.mod h1:EIRU0Of4J5S8rkockZM7eJp2S0UrCyi55m2kJVru3rM= -github.com/libp2p/go-libp2p v0.17.0/go.mod h1:Fkin50rsGdv5mm5BshBUtPRZknt9esfmYXBOYcwOTgw= -github.com/libp2p/go-libp2p v0.19.4/go.mod h1:MIt8y481VDhUe4ErWi1a4bvt/CjjFfOq6kZTothWIXY= -github.com/libp2p/go-libp2p v0.23.4 h1:hWi9XHSOVFR1oDWRk7rigfyA4XNMuYL20INNybP9LP8= -github.com/libp2p/go-libp2p v0.23.4/go.mod h1:s9DEa5NLR4g+LZS+md5uGU4emjMWFiqkZr6hBTY8UxI= -github.com/libp2p/go-libp2p-asn-util v0.1.0/go.mod h1:wu+AnM9Ii2KgO5jMmS1rz9dvzTdj8BXqsPR9HR0XB7I= +github.com/libp2p/go-libp2p v0.26.2 h1:eHEoW/696FP7/6DxOvcrKfTD6Bi0DExxiMSZUJxswA0= +github.com/libp2p/go-libp2p v0.26.2/go.mod h1:x75BN32YbwuY0Awm2Uix4d4KOz+/4piInkp4Wr3yOo8= github.com/libp2p/go-libp2p-asn-util v0.2.0 h1:rg3+Os8jbnO5DxkC7K/Utdi+DkY3q/d1/1q+8WeNAsw= github.com/libp2p/go-libp2p-asn-util v0.2.0/go.mod h1:WoaWxbHKBymSN41hWSq/lGKJEca7TNm58+gGJi2WsLI= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= @@ -1057,22 +1022,14 @@ github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/ github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQdNbfzE1C718tcViI= github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= -github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-autonat v0.4.2/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= -github.com/libp2p/go-libp2p-autonat v0.7.0/go.mod h1:uPvPn6J7cN+LCfFwW5tpOYvAz5NvPTc4iBamTV/WDMg= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= -github.com/libp2p/go-libp2p-blankhost v0.3.0/go.mod h1:urPC+7U01nCGgJ3ZsV8jdwTp6Ji9ID0dMTvq+aJ+nZU= github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= -github.com/libp2p/go-libp2p-circuit v0.6.0/go.mod h1:kB8hY+zCpMeScyvFrKrGicRdid6vNXbunKE4rXATZ0M= -github.com/libp2p/go-libp2p-connmgr v0.2.4/go.mod h1:YV0b/RIm8NGPnnNWM7hG9Q38OeQiQfKhHCCs1++ufn0= -github.com/libp2p/go-libp2p-connmgr v0.3.0/go.mod h1:RVoyPjJm0J9Vd1m6qUN2Tn7kJm4rL1Ml20pFsFgPGik= -github.com/libp2p/go-libp2p-connmgr v0.4.0 h1:q/KZUS1iMDIQckMZarMYwhQisJqiFPHAVC1c4DR3hDE= -github.com/libp2p/go-libp2p-connmgr v0.4.0/go.mod h1:exFQQm19PFAx+QuJmBPw4MM58QejzPJRFFFYnNmgi2w= github.com/libp2p/go-libp2p-consensus v0.0.1 h1:jcVbHRZLwTXU9iT/mPi+Lx4/OrIzq3bU1TbZNhYFCV8= github.com/libp2p/go-libp2p-consensus v0.0.1/go.mod h1:+9Wrfhc5QOqWB0gXI0m6ARlkHfdJpcFXmRU0WoHz4Mo= github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= @@ -1082,13 +1039,11 @@ github.com/libp2p/go-libp2p-core v0.0.4/go.mod h1:jyuCQP356gzfCFtRKyvAbNkyeuxb7O github.com/libp2p/go-libp2p-core v0.2.0/go.mod h1:X0eyB0Gy93v0DZtSYbEM7RnMChm9Uv3j7yRXjO77xSI= github.com/libp2p/go-libp2p-core v0.2.2/go.mod h1:8fcwTbsG2B+lTgRJ1ICZtiM5GWCWZVoVrLaDRvIRng0= github.com/libp2p/go-libp2p-core v0.2.4/go.mod h1:STh4fdfa5vDYr0/SzYYeqnt+E6KfEV5VxfIrm0bcI0g= -github.com/libp2p/go-libp2p-core v0.2.5/go.mod h1:6+5zJmKhsf7yHn1RbmYDu08qDUpIUxGdqHuEZckmZOA= github.com/libp2p/go-libp2p-core v0.3.0/go.mod h1:ACp3DmS3/N64c2jDzcV429ukDpicbL6+TrrxANBjPGw= github.com/libp2p/go-libp2p-core v0.3.1/go.mod h1:thvWy0hvaSBhnVBaW37BvzgVV68OUhgJJLAa6almrII= github.com/libp2p/go-libp2p-core v0.4.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= @@ -1099,29 +1054,18 @@ github.com/libp2p/go-libp2p-core v0.8.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJB github.com/libp2p/go-libp2p-core v0.8.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.2/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.5/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.8.6/go.mod h1:dgHr0l0hIKfWpGpqAMbpo19pen9wJfdCGv51mTmdpmM= github.com/libp2p/go-libp2p-core v0.9.0/go.mod h1:ESsbz31oC3C1AvMJoGx26RTuCkNhmkSRCqZ0kQtJ2/8= -github.com/libp2p/go-libp2p-core v0.10.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= -github.com/libp2p/go-libp2p-core v0.11.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= -github.com/libp2p/go-libp2p-core v0.12.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= -github.com/libp2p/go-libp2p-core v0.13.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= -github.com/libp2p/go-libp2p-core v0.14.0/go.mod h1:tLasfcVdTXnixsLB0QYaT1syJOhsbrhG7q6pGrHtBg8= -github.com/libp2p/go-libp2p-core v0.15.1/go.mod h1:agSaboYM4hzB1cWekgVReqV5M4g5M+2eNNejV+1EEhs= -github.com/libp2p/go-libp2p-core v0.20.1 h1:fQz4BJyIFmSZAiTbKV8qoYhEH5Dtv/cVhZbG3Ib/+Cw= -github.com/libp2p/go-libp2p-core v0.20.1/go.mod h1:6zR8H7CvQWgYLsbG4on6oLNSGcyKaYFSEYyDt51+bIY= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g= github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= -github.com/libp2p/go-libp2p-discovery v0.6.0/go.mod h1:/u1voHt0tKIe5oIA1RHBKQLVCWPna2dXmPNHc2zR9S8= -github.com/libp2p/go-libp2p-gorpc v0.4.0 h1:kxHg5C3IuXeOq5FHPGbMHwQzKDlTVeB/NDr0ndc8J/g= -github.com/libp2p/go-libp2p-gorpc v0.4.0/go.mod h1:jux2Mb6BfUE1n58KbVCmWtqvpiZo0DDaKobKInf4s5o= -github.com/libp2p/go-libp2p-gostream v0.3.1/go.mod h1:1V3b+u4Zhaq407UUY9JLCpboaeufAeVQbnvAt12LRsI= -github.com/libp2p/go-libp2p-gostream v0.5.0 h1:niNGTUrFoUDP/8jxMgu97zngMO+UGYBpVpbCKwIJBls= -github.com/libp2p/go-libp2p-gostream v0.5.0/go.mod h1:rXrb0CqfcRRxa7m3RSKORQiKiWgk3IPeXWda66ZXKsA= -github.com/libp2p/go-libp2p-kad-dht v0.18.0 h1:akqO3gPMwixR7qFSFq70ezRun97g5hrA/lBW9jrjUYM= -github.com/libp2p/go-libp2p-kad-dht v0.18.0/go.mod h1:Gb92MYIPm3K2pJLGn8wl0m8wiKDvHrYpg+rOd0GzzPA= +github.com/libp2p/go-libp2p-gorpc v0.5.0 h1:mmxxAPdP3JzpYH4KcDf4csXnqtd1HazLPfdyB2MBRb8= +github.com/libp2p/go-libp2p-gorpc v0.5.0/go.mod h1:GpHuvY3m0YFkd0+inOGo4HDtc4up9OS/mBPXvEpNuRY= +github.com/libp2p/go-libp2p-gostream v0.6.0 h1:QfAiWeQRce6pqnYfmIVWJFXNdDyfiR/qkCnjyaZUPYU= +github.com/libp2p/go-libp2p-gostream v0.6.0/go.mod h1:Nywu0gYZwfj7Jc91PQvbGU8dIpqbQQkjWgDuOrFaRdA= +github.com/libp2p/go-libp2p-kad-dht v0.21.0 h1:J0Yd22VA+sk0CJRGMgtfHvLVIkZDyJ3AJGiljywIw5U= +github.com/libp2p/go-libp2p-kad-dht v0.21.0/go.mod h1:Bhm9diAFmc6qcWAr084bHNL159srVZRKADdp96Qqd1I= github.com/libp2p/go-libp2p-kbucket v0.5.0 h1:g/7tVm8ACHDxH29BGrpsQlnNeu+6OF1A9bno/4/U1oA= github.com/libp2p/go-libp2p-kbucket v0.5.0/go.mod h1:zGzGCpQd78b5BNTDGHNDLaTt9aDK/A02xeZp9QeFC4U= github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= @@ -1131,18 +1075,11 @@ github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= github.com/libp2p/go-libp2p-mplex v0.4.0/go.mod h1:yCyWJE2sc6TBTnFpjvLuEJgTSw/u+MamvzILKdX7asw= github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g= -github.com/libp2p/go-libp2p-mplex v0.5.0/go.mod h1:eLImPJLkj3iG5t5lq68w3Vm5NAQ5BcKwrrb2VmOYb3M= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= github.com/libp2p/go-libp2p-nat v0.0.6/go.mod h1:iV59LVhB3IkFvS6S6sauVTSOrNEANnINbI/fkaLimiw= -github.com/libp2p/go-libp2p-nat v0.1.0/go.mod h1:DQzAG+QbDYjN1/C3B6vXucLtz3u9rEonLVPtZVzQqks= github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= -github.com/libp2p/go-libp2p-noise v0.1.1/go.mod h1:QDFLdKX7nluB7DEnlVPbz7xlLHdwHFA9HiohJRr3vwM= github.com/libp2p/go-libp2p-noise v0.2.0/go.mod h1:IEbYhBBzGyvdLBoxxULL/SGbJARhUeqlO8lVSREYu2Q= -github.com/libp2p/go-libp2p-noise v0.3.0/go.mod h1:JNjHbociDJKHD64KTkzGnzqJ0FEV5gHJa6AB00kbCNQ= -github.com/libp2p/go-libp2p-noise v0.4.0/go.mod h1:BzzY5pyzCYSyJbQy9oD8z5oP2idsafjt4/X42h9DjZU= -github.com/libp2p/go-libp2p-noise v0.5.0 h1:gwJZ/3iH3MRnBrLIyr/YLdCOnmqfJMptlsFFUIc3j0Y= -github.com/libp2p/go-libp2p-noise v0.5.0/go.mod h1:CYYpJ+T4pox1d1J/hhUVxuMf6b2s3c41hFUgS8/yFQw= github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= github.com/libp2p/go-libp2p-peerstore v0.1.0/go.mod h1:2CeHkQsr8svp4fZ+Oi9ykN1HBb6u0MOvdJ7YIsmcwtY= github.com/libp2p/go-libp2p-peerstore v0.1.3/go.mod h1:BJ9sHlm59/80oSkpWgr1MyY1ciXAXV397W6h1GH/uKI= @@ -1151,28 +1088,17 @@ github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRj github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.7/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= -github.com/libp2p/go-libp2p-peerstore v0.4.0/go.mod h1:rDJUFyzEWPpXpEwywkcTYYzDHlwza8riYMaUzaN6hX0= -github.com/libp2p/go-libp2p-peerstore v0.6.0/go.mod h1:DGEmKdXrcYpK9Jha3sS7MhqYdInxJy84bIPtSu65bKc= -github.com/libp2p/go-libp2p-peerstore v0.8.0 h1:bzTG693TA1Ju/zKmUCQzDLSqiJnyRFVwPpuloZ/OZtI= -github.com/libp2p/go-libp2p-peerstore v0.8.0/go.mod h1:9geHWmNA3YDlQBjL/uPEJD6vpDK12aDNlUNHJ6kio/s= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= -github.com/libp2p/go-libp2p-pubsub v0.6.0/go.mod h1:nJv87QM2cU0w45KPR1rZicq+FmFIOD16zmT+ep1nOmg= -github.com/libp2p/go-libp2p-pubsub v0.8.2 h1:QLGUmkgKmwEVxVDYGsqc5t9CykOMY2Y21cXQHjR462I= -github.com/libp2p/go-libp2p-pubsub v0.8.2/go.mod h1:e4kT+DYjzPUYGZeWk4I+oxCSYTXizzXii5LDRRhjKSw= +github.com/libp2p/go-libp2p-pubsub v0.9.3 h1:ihcz9oIBMaCK9kcx+yHWm3mLAFBMAUsM4ux42aikDxo= +github.com/libp2p/go-libp2p-pubsub v0.9.3/go.mod h1:RYA7aM9jIic5VV47WXu4GkcRxRhrdElWf8xtyli+Dzc= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= -github.com/libp2p/go-libp2p-quic-transport v0.13.0/go.mod h1:39/ZWJ1TW/jx1iFkKzzUg00W6tDJh73FC0xYudjr7Hc= -github.com/libp2p/go-libp2p-quic-transport v0.15.2/go.mod h1:wv4uGwjcqe8Mhjj7N/Ic0aKjA+/10UnMlSzLO0yRpYQ= -github.com/libp2p/go-libp2p-quic-transport v0.16.0/go.mod h1:1BXjVMzr+w7EkPfiHkKnwsWjPjtfaNT0q8RS3tGDvEQ= -github.com/libp2p/go-libp2p-quic-transport v0.17.0/go.mod h1:x4pw61P3/GRCcSLypcQJE/Q2+E9f4X+5aRcZLXf20LM= -github.com/libp2p/go-libp2p-raft v0.1.8 h1:Fq0aWHbbhi6WJXf+yaOQeMzV+9UgkbHIIGyaJbH3vpo= -github.com/libp2p/go-libp2p-raft v0.1.8/go.mod h1:+YDisn3uszb7vxshLgKoDdRGs79WSbHRgrOdrYqDPk4= +github.com/libp2p/go-libp2p-raft v0.4.0 h1:2atEs7/FWH35bRiLh8gTejGh5NA9u4eG7BXjpf/B+Z4= +github.com/libp2p/go-libp2p-raft v0.4.0/go.mod h1:qJCYtFBTbip2wngLxFeAb9o52XmAPi2vSIQ4hV7IpSA= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= -github.com/libp2p/go-libp2p-record v0.1.2/go.mod h1:pal0eNcT5nqZaTV7UGhqeGqxFgGdsU/9W//C8dqjQDk= github.com/libp2p/go-libp2p-record v0.2.0 h1:oiNUOCWno2BFuxt3my4i1frNrt7PerzB3queqa1NkQ0= github.com/libp2p/go-libp2p-record v0.2.0/go.mod h1:I+3zMkvvg5m2OcSdoL0KPljyJyvNDFGKX7QdlpYUcwk= -github.com/libp2p/go-libp2p-resource-manager v0.2.1/go.mod h1:K+eCkiapf+ey/LADO4TaMpMTP9/Qde/uLlrnRqV4PLQ= -github.com/libp2p/go-libp2p-routing-helpers v0.2.3 h1:xY61alxJ6PurSi+MXbywZpelvuU4U4p/gPTxjqCqTzY= -github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASoiVgHdi5bjack0N1+AFAdbvBw= +github.com/libp2p/go-libp2p-routing-helpers v0.4.0 h1:b7y4aixQ7AwbqYfcOQ6wTw8DQvuRZeTAA0Od3YYN5yc= +github.com/libp2p/go-libp2p-routing-helpers v0.4.0/go.mod h1:dYEAgkVhqho3/YKxfOEGdFMIcWfAFNlZX8iAIihYA2E= github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= @@ -1182,12 +1108,7 @@ github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaT github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= -github.com/libp2p/go-libp2p-swarm v0.4.0/go.mod h1:XVFcO52VoLoo0eitSxNQWYq4D6sydGOweTOAjJNraCw= github.com/libp2p/go-libp2p-swarm v0.5.0/go.mod h1:sU9i6BoHE0Ve5SKz3y9WfKrh8dUat6JknzUehFx8xW4= -github.com/libp2p/go-libp2p-swarm v0.8.0/go.mod h1:sOMp6dPuqco0r0GHTzfVheVBh6UEL0L1lXUZ5ot2Fvc= -github.com/libp2p/go-libp2p-swarm v0.9.0/go.mod h1:2f8d8uxTJmpeqHF/1ujjdXZp+98nNIbujVOMEZxCbZ8= -github.com/libp2p/go-libp2p-swarm v0.10.0/go.mod h1:71ceMcV6Rg/0rIQ97rsZWMzto1l9LnNquef+efcRbmA= -github.com/libp2p/go-libp2p-swarm v0.10.2/go.mod h1:Pdkq0QU5a+qu+oyqIV3bknMsnzk9lnNyKvB9acJ5aZs= github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= @@ -1196,29 +1117,12 @@ github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eq github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= -github.com/libp2p/go-libp2p-testing v0.4.2/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= -github.com/libp2p/go-libp2p-testing v0.5.0/go.mod h1:QBk8fqIL1XNcno/l3/hhaIEn4aLRijpYOR+zVjjlh+A= -github.com/libp2p/go-libp2p-testing v0.6.0/go.mod h1:QBk8fqIL1XNcno/l3/hhaIEn4aLRijpYOR+zVjjlh+A= -github.com/libp2p/go-libp2p-testing v0.7.0/go.mod h1:OLbdn9DbgdMwv00v+tlp1l3oe2Cl+FAjoWIA2pa0X6E= -github.com/libp2p/go-libp2p-testing v0.9.0/go.mod h1:Td7kbdkWqYTJYQGTwzlgXwaqldraIanyjuRiAbK/XQU= -github.com/libp2p/go-libp2p-testing v0.9.2/go.mod h1:Td7kbdkWqYTJYQGTwzlgXwaqldraIanyjuRiAbK/XQU= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= -github.com/libp2p/go-libp2p-tls v0.3.0/go.mod h1:fwF5X6PWGxm6IDRwF3V8AVCCj/hOd5oFlg+wo2FxJDY= -github.com/libp2p/go-libp2p-tls v0.3.1/go.mod h1:fwF5X6PWGxm6IDRwF3V8AVCCj/hOd5oFlg+wo2FxJDY= -github.com/libp2p/go-libp2p-tls v0.4.1/go.mod h1:EKCixHEysLNDlLUoKxv+3f/Lp90O2EXNjTr0UQDnrIw= -github.com/libp2p/go-libp2p-tls v0.5.0 h1:aRNTeOI8Ljm1r4L2uMGxkMsVnyZoPwaqQqMw23qAsQs= -github.com/libp2p/go-libp2p-tls v0.5.0/go.mod h1:1a4tq0xQSZ0kAkDkZVAppuP3SAIUHcnzi2djJ/2EN4I= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= -github.com/libp2p/go-libp2p-transport-upgrader v0.4.0/go.mod h1:J4ko0ObtZSmgn5BX5AmegP+dK3CSnU2lMCKsSq/EY0s= github.com/libp2p/go-libp2p-transport-upgrader v0.4.2/go.mod h1:NR8ne1VwfreD5VIWIU62Agt/J18ekORFU/j1i2y8zvk= -github.com/libp2p/go-libp2p-transport-upgrader v0.4.3/go.mod h1:bpkldbOWXMrXhpZbSV1mQxTrefOg2Fi+k1ClDSA4ppw= -github.com/libp2p/go-libp2p-transport-upgrader v0.5.0/go.mod h1:Rc+XODlB3yce7dvFV4q/RmyJGsFcCZRkeZMu/Zdg0mo= -github.com/libp2p/go-libp2p-transport-upgrader v0.6.0/go.mod h1:1e07y1ZSZdHo9HPbuU8IztM1Cj+DR5twgycb4pnRzRo= -github.com/libp2p/go-libp2p-transport-upgrader v0.7.0/go.mod h1:GIR2aTRp1J5yjVlkUoFqMkdobfob6RnAwYg/RZPhrzg= -github.com/libp2p/go-libp2p-transport-upgrader v0.7.1/go.mod h1:GIR2aTRp1J5yjVlkUoFqMkdobfob6RnAwYg/RZPhrzg= github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= github.com/libp2p/go-libp2p-yamux v0.2.1/go.mod h1:1FBXiHDk1VyRM1C0aez2bCfHQ4vMZKkAQzZbkSQt5fI= github.com/libp2p/go-libp2p-yamux v0.2.2/go.mod h1:lIohaR0pT6mOt0AZ0L2dFze9hds9Req3OfS+B+dv4qw= @@ -1227,12 +1131,7 @@ github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhL github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= github.com/libp2p/go-libp2p-yamux v0.5.0/go.mod h1:AyR8k5EzyM2QN9Bbdg6X1SkVVuqLwTGf0L4DFq9g6po= -github.com/libp2p/go-libp2p-yamux v0.5.1/go.mod h1:dowuvDu8CRWmr0iqySMiSxK+W0iL5cMVO9S94Y6gkv4= github.com/libp2p/go-libp2p-yamux v0.5.4/go.mod h1:tfrXbyaTqqSU654GTvK3ocnSZL3BuHoeTSqhcel1wsE= -github.com/libp2p/go-libp2p-yamux v0.7.0/go.mod h1:fMyA0CsPfHkIuBU0wjRGrCjTBFiXTXxG0k5M4ETv+08= -github.com/libp2p/go-libp2p-yamux v0.8.0/go.mod h1:yTkPgN2ib8FHyU1ZcVD7aelzyAqXXwEPbyx+aSKm9h8= -github.com/libp2p/go-libp2p-yamux v0.8.1/go.mod h1:rUozF8Jah2dL9LLGyBaBeTQeARdwhefMCTQVQt6QobE= -github.com/libp2p/go-libp2p-yamux v0.9.1/go.mod h1:wRc6wvyxQINFcKe7daL4BeQ02Iyp+wxyC8WCNfngBrA= github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= github.com/libp2p/go-maddr-filter v0.1.0 h1:4ACqZKw8AqiuJfwFGq1CYDFugfXTOos+qQ3DETkhtCE= @@ -1243,14 +1142,12 @@ github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3 github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= -github.com/libp2p/go-mplex v0.4.0/go.mod h1:y26Lx+wNVtMYMaPu300Cbot5LkEZ4tJaNYeHeT9dh6E= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= -github.com/libp2p/go-msgio v0.1.0/go.mod h1:eNlv2vy9V2X/kNldcZ+SShFE++o2Yjxwx6RAYsmgJnE= -github.com/libp2p/go-msgio v0.2.0 h1:W6shmB+FeynDrUVl2dgFQvzfBZcXiyqY4VmpQLu9FqU= -github.com/libp2p/go-msgio v0.2.0/go.mod h1:dBVM1gW3Jk9XqHkU4eKdGvVHdLa51hoGfll6jMJMSlY= +github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= +github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= github.com/libp2p/go-nat v0.0.3/go.mod h1:88nUEt0k0JD45Bk93NIwDqjlhiOwOoV36GchpcVc1yI= github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= @@ -1260,47 +1157,35 @@ github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdm github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.5/go.mod h1:V1SR3AaECRkEQCoFFzYwVYWvYIEtlxx89+O3qcpCl4A= github.com/libp2p/go-netroute v0.1.6/go.mod h1:AqhkMh0VuWmfgtxKPp3Oc1LdU5QSWS7wl0QLhSZqXxQ= -github.com/libp2p/go-netroute v0.2.0 h1:0FpsbsvuSnAhXFnCY0VLFbJOzaK0VnP0r1QT/o4nWRE= -github.com/libp2p/go-netroute v0.2.0/go.mod h1:Vio7LTzZ+6hoT4CMZi5/6CpY3Snzh2vgZhWgxMNwlQI= +github.com/libp2p/go-netroute v0.2.1 h1:V8kVrpD8GK0Riv15/7VN6RbUQ3URNZVosw7H2v9tksU= +github.com/libp2p/go-netroute v0.2.1/go.mod h1:hraioZr0fhBjG0ZRXJJ6Zj2IVEVNx6tDTFQfSmcq7mQ= github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.1.0 h1:LBkKEcUv6vtZIQLVTegAil8jbNpJErQ9AnT+bWV+Ooo= -github.com/libp2p/go-openssl v0.1.0/go.mod h1:OiOxwPpL3n4xlenjx2h7AwSGaFSC/KZvf6gNdOBQMtc= github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= -github.com/libp2p/go-reuseport v0.1.0/go.mod h1:bQVn9hmfcTaoo0c9v5pBhOarsU1eNOBZdaAd2hzXRKU= github.com/libp2p/go-reuseport v0.2.0 h1:18PRvIMlpY6ZK85nIAicSBuXXvrYoSw3dsBAR7zc560= github.com/libp2p/go-reuseport v0.2.0/go.mod h1:bvVho6eLMm6Bz5hmU0LYN3ixd3nPPvtIlaURZZgOY4k= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= github.com/libp2p/go-reuseport-transport v0.0.4/go.mod h1:trPa7r/7TJK/d+0hdBLOCGvpQQVOU74OXbNCIMkufGw= -github.com/libp2p/go-reuseport-transport v0.1.0/go.mod h1:vev0C0uMkzriDY59yFHD9v+ujJvYmDQVLowvAjEOmfw= github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-sockaddr v0.1.0/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-sockaddr v0.1.1/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-stream-muxer v0.0.1/go.mod h1:bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14= github.com/libp2p/go-stream-muxer-multistream v0.2.0/go.mod h1:j9eyPol/LLRqT+GPLSxvimPhNph4sfYfMoDPd7HkzIc= github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= -github.com/libp2p/go-stream-muxer-multistream v0.4.0/go.mod h1:nb+dGViZleRP4XcyHuZSVrJCBl55nRBOMmiSL/dyziw= github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= -github.com/libp2p/go-tcp-transport v0.2.1/go.mod h1:zskiJ70MEfWz2MKxvFB/Pv+tPIB1PpPUrHIWQ8aFw7M= github.com/libp2p/go-tcp-transport v0.2.3/go.mod h1:9dvr03yqrPyYGIEN6Dy5UvdJZjyPFvl1S/igQ5QD1SU= -github.com/libp2p/go-tcp-transport v0.2.4/go.mod h1:9dvr03yqrPyYGIEN6Dy5UvdJZjyPFvl1S/igQ5QD1SU= -github.com/libp2p/go-tcp-transport v0.4.0/go.mod h1:0y52Rwrn4076xdJYu/51/qJIdxz+EWDAOG2S45sV3VI= -github.com/libp2p/go-tcp-transport v0.5.0/go.mod h1:UPPL0DIjQqiWRwVAb+CEQlaAG0rp/mCqJfIhFcLHc4Y= -github.com/libp2p/go-tcp-transport v0.5.1/go.mod h1:UPPL0DIjQqiWRwVAb+CEQlaAG0rp/mCqJfIhFcLHc4Y= github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw7yT74kj3raBFuo= github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM= github.com/libp2p/go-ws-transport v0.3.0/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= github.com/libp2p/go-ws-transport v0.4.0/go.mod h1:EcIEKqf/7GDjth6ksuS/6p7R49V4CBY6/E7R/iyhYUA= -github.com/libp2p/go-ws-transport v0.5.0/go.mod h1:I2juo1dNTbl8BKSBYo98XY85kU2xds1iamArLvl8kNg= -github.com/libp2p/go-ws-transport v0.6.0/go.mod h1:dXqtI9e2JV9FtF1NOtWVZSKXh5zXvnuwPXfj8GPBbYU= github.com/libp2p/go-yamux v1.2.2/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.2.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.0/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= @@ -1309,30 +1194,16 @@ github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZ github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= -github.com/libp2p/go-yamux/v2 v2.3.0/go.mod h1:iTU+lOIn/2h0AgKcL49clNTwfEw+WSfDYrXe05EyKIs= -github.com/libp2p/go-yamux/v3 v3.0.1/go.mod h1:s2LsDhHbh+RfCsQoICSYt58U2f8ijtPANFD8BmE74Bo= -github.com/libp2p/go-yamux/v3 v3.0.2/go.mod h1:s2LsDhHbh+RfCsQoICSYt58U2f8ijtPANFD8BmE74Bo= -github.com/libp2p/go-yamux/v3 v3.1.1/go.mod h1:jeLEQgLXqE2YqX1ilAClIfCMDY+0uXQUKmmb/qp0gT4= github.com/libp2p/go-yamux/v3 v3.1.2 h1:lNEy28MBk1HavUAlzKgShp+F6mn/ea1nDYWftZhFW9Q= github.com/libp2p/go-yamux/v3 v3.1.2/go.mod h1:jeLEQgLXqE2YqX1ilAClIfCMDY+0uXQUKmmb/qp0gT4= github.com/libp2p/go-yamux/v4 v4.0.0 h1:+Y80dV2Yx/kv7Y7JKu0LECyVdMXm1VUoko+VQ9rBfZQ= github.com/libp2p/go-yamux/v4 v4.0.0/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= -github.com/libp2p/zeroconf/v2 v2.1.1/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= -github.com/lucas-clemente/quic-go v0.23.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= -github.com/lucas-clemente/quic-go v0.24.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= -github.com/lucas-clemente/quic-go v0.25.0/go.mod h1:YtzP8bxRVCBlO77yRanE264+fY/T2U9ZlW1AaHOsMOg= -github.com/lucas-clemente/quic-go v0.27.0/go.mod h1:AzgQoPda7N+3IqMMMkywBKggIFo2KT6pfnlrQ2QieeI= -github.com/lucas-clemente/quic-go v0.27.1/go.mod h1:AzgQoPda7N+3IqMMMkywBKggIFo2KT6pfnlrQ2QieeI= -github.com/lucas-clemente/quic-go v0.29.1 h1:Z+WMJ++qMLhvpFkRZA+jl3BTxUjm415YBmWanXB8zP0= -github.com/lucas-clemente/quic-go v0.29.1/go.mod h1:CTcNfLYJS2UuRNB+zcNlgvkjBhxX6Hm3WUxxAQx2mgE= github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/lufia/iostat v1.1.0/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magefile/mage v1.9.0 h1:t3AU2wNwehMCW97vuqQLtw6puppWXHO+O2MHo5a50XE= @@ -1343,69 +1214,46 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/marten-seemann/qpack v0.2.1 h1:jvTsT/HpCn2UZJdP+UUB53FfUUgeOyG5K1ns0OJOGVs= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= -github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= -github.com/marten-seemann/qtls-go1-16 v0.1.4/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= -github.com/marten-seemann/qtls-go1-16 v0.1.5/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= -github.com/marten-seemann/qtls-go1-17 v0.1.0/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= -github.com/marten-seemann/qtls-go1-17 v0.1.1/go.mod h1:C2ekUKcDdz9SDWxec1N/MvcXBpaX9l3Nx67XaR84L5s= -github.com/marten-seemann/qtls-go1-18 v0.1.0-beta.1/go.mod h1:PUhIQk19LoFt2174H4+an8TYvWOGjb/hHwphBeaDHwI= -github.com/marten-seemann/qtls-go1-18 v0.1.1/go.mod h1:mJttiymBAByA49mhlNZZGrH5u1uXYZJ+RW28Py7f4m4= -github.com/marten-seemann/qtls-go1-18 v0.1.2 h1:JH6jmzbduz0ITVQ7ShevK10Av5+jBEKAHMntXmIV7kM= -github.com/marten-seemann/qtls-go1-18 v0.1.2/go.mod h1:mJttiymBAByA49mhlNZZGrH5u1uXYZJ+RW28Py7f4m4= -github.com/marten-seemann/qtls-go1-19 v0.1.0 h1:rLFKD/9mp/uq1SYGYuVZhm83wkmU95pK5df3GufyYYU= -github.com/marten-seemann/qtls-go1-19 v0.1.0/go.mod h1:5HTDWtVudo/WFsHKRNuOhWlbdjrfs5JHrYb0wIJqGpI= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= -github.com/marten-seemann/webtransport-go v0.1.1 h1:TnyKp3pEXcDooTaNn4s9dYpMJ7kMnTp7k5h+SgYP/mc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= -github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/mattn/go-xmlrpc v0.0.3/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mdlayher/genetlink v1.0.0/go.mod h1:0rJ0h4itni50A86M2kHcgS85ttZazNt7a8H2a2cw0Gc= -github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= -github.com/mdlayher/netlink v0.0.0-20190828143259-340058475d09/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= -github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= -github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= -github.com/mdlayher/wifi v0.0.0-20190303161829-b1436901ddee/go.mod h1:Evt/EIne46u9PtQbeTx2NTcqURpr5K4SvKtGmBuDPN8= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= -github.com/miekg/dns v1.1.48/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= @@ -1433,9 +1281,11 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= @@ -1447,8 +1297,9 @@ github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL github.com/multiformats/go-base32 v0.0.4/go.mod h1:jNLFzjPZtp3aIARHbJRZIaPuspdH0J6q39uUM5pnABM= github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= -github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= +github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= +github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= github.com/multiformats/go-multiaddr v0.0.4/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= @@ -1460,9 +1311,6 @@ github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWzmBD8uLLL4bXW0XfGc= github.com/multiformats/go-multiaddr v0.3.3/go.mod h1:lCKNGP1EQ1eZ35Za2wlqnabm9xQkib3fyB+nZXHLag0= -github.com/multiformats/go-multiaddr v0.4.0/go.mod h1:YcpyLH8ZPudLxQlemYBPhSm0/oCXAT8Z4mzFpyoPyRc= -github.com/multiformats/go-multiaddr v0.4.1/go.mod h1:3afI9HfVW8csiF8UZqtpYRiDyew8pRX7qLIGHu9FLuM= -github.com/multiformats/go-multiaddr v0.5.0/go.mod h1:3KAxNkUqLTJ20AAwN4XVX4kZar+bR+gh4zgbfr3SNug= github.com/multiformats/go-multiaddr v0.8.0 h1:aqjksEcqK+iD/Foe1RRFsGZh8+XFiGo7FgUCZlpv3LU= github.com/multiformats/go-multiaddr v0.8.0/go.mod h1:Fs50eBDWvZu+l3/9S6xAE7ZYj6yhxlvaVZjakWN7xRs= github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= @@ -1487,11 +1335,8 @@ github.com/multiformats/go-multibase v0.1.1 h1:3ASCDsuLX8+j4kx58qnJ4YFq/JWTJpCyD github.com/multiformats/go-multibase v0.1.1/go.mod h1:ZEjHE+IsUrgp5mhlEAYjMtZwK1k4haNkcaPg9aoe1a8= github.com/multiformats/go-multicodec v0.3.0/go.mod h1:qGGaQmioCDh+TeFOnxrbU0DaIPw8yFgAZgFG0V7p1qQ= github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ= -github.com/multiformats/go-multicodec v0.3.1-0.20211210143421-a526f306ed2c/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ= -github.com/multiformats/go-multicodec v0.4.1/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ= -github.com/multiformats/go-multicodec v0.5.0/go.mod h1:DiY2HFaEp5EhEXb/iYzVAunmyX/aSFMxq2KMKfWEues= -github.com/multiformats/go-multicodec v0.6.0 h1:KhH2kSuCARyuJraYMFxrNO3DqIaYhOdS039kbhgVwpE= -github.com/multiformats/go-multicodec v0.6.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw= +github.com/multiformats/go-multicodec v0.8.0 h1:evBmgkbSQux+Ds2IgfhkO38Dl2GDtRW8/Rp6YiSHX/Q= +github.com/multiformats/go-multicodec v0.8.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= @@ -1505,17 +1350,16 @@ github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.2/go.mod h1:UIcnm7Zuo8HKG+HkWgfQsGL+/MIEhyTqbODbIUwSXKs= -github.com/multiformats/go-multistream v0.3.0/go.mod h1:ODRoqamLUsETKS9BNcII4gcRsJBU5VAwRIv7O39cEXg= -github.com/multiformats/go-multistream v0.3.3 h1:d5PZpjwRgVlbwfdTDjife7XszfZd8KYWfROYFlGcR8o= -github.com/multiformats/go-multistream v0.3.3/go.mod h1:ODRoqamLUsETKS9BNcII4gcRsJBU5VAwRIv7O39cEXg= +github.com/multiformats/go-multistream v0.4.1 h1:rFy0Iiyn3YT0asivDUIR05leAdwZq3de4741sbiSdfo= +github.com/multiformats/go-multistream v0.4.1/go.mod h1:Mz5eykRVAjJWckE2U78c6xqdtyNUEhKSM0Lwar2p77Q= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= +github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -1528,13 +1372,12 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/ngdinhtoan/glide-cleanup v0.2.0/go.mod h1:UQzsmiDOb8YV3nOsCxK/c9zPpCZVNoHScRE3EO9pVMM= -github.com/nikkolasg/hexjson v0.0.0-20181101101858-78e39397e00c h1:5bFTChQxSKNwy8ALwOebjekYExl9HTT9urdawqC95tA= -github.com/nikkolasg/hexjson v0.0.0-20181101101858-78e39397e00c/go.mod h1:7qN3Y0BvzRUf4LofcoJplQL10lsFDb4PYlePTVwrP28= +github.com/nikkolasg/hexjson v0.1.0 h1:Cgi1MSZVQFoJKYeRpBNEcdF3LB+Zo4fYKsDz7h8uJYQ= +github.com/nikkolasg/hexjson v0.1.0/go.mod h1:fbGbWFZ0FmJMFbpCMtJpwb0tudVxSSZ+Es2TsCg57cA= github.com/nkovacs/streamquote v1.0.0 h1:PmVIV08Zlx2lZK5fFZlMZ04eHcDTIFJCv/5/0twVUow= github.com/nkovacs/streamquote v1.0.0/go.mod h1:BN+NaZ2CmdKqUuTUXUEm9j95B2TRbpOWpxbJYzzgUsc= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -1544,30 +1387,24 @@ github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.5.1 h1:auzK7OI497k6x4OvWq+TKAcpcSAlod0doAH72oIN0Jw= +github.com/onsi/ginkgo/v2 v2.5.1/go.mod h1:63DOGlLAH8+REH8jUGdL3YpCpu7JODesutUjdENfUAc= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.24.0 h1:+0glovB9Jd6z3VR+ScSwQqXVTIfJcGA9UBM8yzQxhqg= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333 h1:CznVS40zms0Dj5he4ERo+fRPtO0qxUk8lA8Xu3ddet0= github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333/go.mod h1:Ag6rSXkHIckQmjFBCweJEEt1mrTPBv8b9W4aU/NQWfI= github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc= -github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df h1:vdYtBU6zvL7v+Tr+0xFM/qhahw/EvY8DMMunZHKH6eE= -github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= +github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e h1:4cPxUYdgaGzZIT5/j0IfqOrrXmq6bG8AwvwisMXpdrg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w= github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= -github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -1603,8 +1440,9 @@ github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXx github.com/polydawn/refmt v0.0.0-20190408063855-01bf1e26dd14/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= -github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e h1:ZOcivgkkFRnjfoTcGsDq3UQYiBmekwLA+qg0OjyB/ls= github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= +github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4= +github.com/polydawn/refmt v0.89.0/go.mod h1:/zvteZs/GwLtCgZ4BL6CBsk9IKIlexP43ObX9AxTqTw= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1613,21 +1451,20 @@ github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1635,16 +1472,12 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289/go.mod h1:FGbBv5OPKjch+jNUJmEQpMZytIdyW0NdBtWFcfSKusc= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1652,18 +1485,25 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/statsd_exporter v0.21.0 h1:hA05Q5RFeIjgwKIYEdFd59xu5Wwaznf33yKI+pyX6T8= github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= +github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= +github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= +github.com/quic-go/qtls-go1-19 v0.2.1 h1:aJcKNMkH5ASEJB9FXNeZCyTEIHU1J7MmHyz1Q1TSG1A= +github.com/quic-go/qtls-go1-19 v0.2.1/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI= +github.com/quic-go/qtls-go1-20 v0.1.1 h1:KbChDlg82d3IHqaj2bn6GfKRj84Per2VGf5XV3wSwQk= +github.com/quic-go/qtls-go1-20 v0.1.1/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM= +github.com/quic-go/quic-go v0.33.0 h1:ItNoTDN/Fm/zBlq769lLJc8ECe9gYaW40veHCCco7y0= +github.com/quic-go/quic-go v0.33.0/go.mod h1:YMuhaAV9/jIu0XclDXwZPAsP/2Kgr5yMYhe9oxhhOFA= +github.com/quic-go/webtransport-go v0.5.2 h1:GA6Bl6oZY+g/flt00Pnu0XtivSD8vukOu3lYhJjnGEk= +github.com/quic-go/webtransport-go v0.5.2/go.mod h1:OhmmgJIzTTqXK5xvtuX0oBpLV2GkLWNDA+UeTGJXErU= github.com/raulk/clock v1.1.0 h1:dpb29+UKMbLqiU/jqIJptgLR1nn23HLgMY0sTCDza5Y= github.com/raulk/clock v1.1.0/go.mod h1:3MpVxdZ/ODBQDxbN+kzshf5OSZwPjtMDx6BBXBmOeY0= -github.com/raulk/go-watchdog v1.2.0/go.mod h1:lzSbAl5sh4rtI8tYHU01BWIDzgzqaQLj6RcA1i4mlqI= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1675,7 +1515,7 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= @@ -1688,9 +1528,7 @@ github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0 github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sercand/kuberesolver v2.1.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ= github.com/sercand/kuberesolver v2.4.0+incompatible h1:WE2OlRf6wjLxHwNkkFLQGaZcVLEXjMjBPjjEU5vksH8= -github.com/sercand/kuberesolver v2.4.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v2.18.12+incompatible h1:1eaJvGomDnH74/5cF4CTmTbLHAriGFsTZppLXDX93OM= github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= @@ -1717,30 +1555,30 @@ github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go. github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= -github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= +github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/assertions v1.13.0 h1:Dx1kYM01xsSqKPno3aqLnrwac2LetPvN23diwyr69Qs= github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= +github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a/go.mod h1:LeFCbQYJ3KJlPs/FvPz2dy1tkpxyeNESVyCNNzRXFR0= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= -github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= @@ -1782,7 +1620,6 @@ github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cb github.com/teivah/onecontext v0.0.0-20200513185103-40f981bfd775 h1:BLNsFR8l/hj/oGjnJXkd4Vi3s4kQD3/3x8HSAE4bzN0= github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= -github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g= github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.1 h1:iymTbGkQBhveq21bEvAQ81I0LEBork8BFe1CUZXdyuo= @@ -1801,24 +1638,19 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1 github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twmb/murmur3 v1.1.6 h1:mqrRot1BRxm+Yct+vavLMou2/iJt0tNVTTC0QoIjaZg= github.com/twmb/murmur3 v1.1.6/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= -github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.23.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= -github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v1.5.1-0.20181102163054-1fc5c315e03c/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= -github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc= +github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= +github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.0.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= -github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/urfave/cli/v2 v2.16.3 h1:gHoFIwpPjoyIMbJp/VFd+/vuD0dAgFK4B6DpEMFJfQk= github.com/urfave/cli/v2 v2.16.3/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -1828,16 +1660,14 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= github.com/warpfork/go-testmark v0.3.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= -github.com/warpfork/go-testmark v0.10.0 h1:E86YlUMYfwIacEsQGlnTvjk1IgYkyTGjPhF0RnwTCmw= -github.com/warpfork/go-testmark v0.10.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= +github.com/warpfork/go-testmark v0.11.0 h1:J6LnV8KpceDvo7spaNU4+DauH2n1x+6RaO2rJrmpQ9U= github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= -github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a h1:G++j5e0OC488te356JvdhaM8YS6nMsjLAYF7JxCv07w= github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= -github.com/weaveworks/common v0.0.0-20200512154658-384f10054ec5 h1:EYxr08r8x6r/5fLEAMMkida1BVgxVXE4LfZv/XV+znU= -github.com/weaveworks/common v0.0.0-20200512154658-384f10054ec5/go.mod h1:c98fKi5B9u8OsKGiWHLRKus6ToQ1Tubeow44ECO1uxY= +github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ= +github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= +github.com/weaveworks/common v0.0.0-20220810113439-c65105d60b18 h1:JN4YR/TNWiZEAHHImrVA2u4DPI+aqPOar23ICUnYZTQ= github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M= -github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA= github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba h1:X4n8JG2e2biEZZXdBKt9HX7DN3bYGFUqljqqy0DqgnY= github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba/go.mod h1:CHQnYnQUEPydYCwuy8lmTHfGmdw9TKrhWV0xLx8l0oM= github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 h1:5HZfQkwe0mIfyDmc1Em5GqlNRzcdtlv4HTNmdpt7XH0= @@ -1856,8 +1686,8 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20200826160007-0b9f6c5fb163/go.mod h1:f github.com/whyrusleeping/cbor-gen v0.0.0-20210118024343-169e9d70c0c2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20210303213153-67a261a1d291/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20220323183124-98fa8256a799/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20221021053955-c138aae13722 h1:0HEhvpGQJ2Gd0ngPW83aduQQuF/V9v13+3zpSrR3lrA= -github.com/whyrusleeping/cbor-gen v0.0.0-20221021053955-c138aae13722/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa h1:EyA027ZAkuaCLoxVX4r1TZMPy1d31fM6hbfQ4OU4I5o= +github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= @@ -1872,8 +1702,6 @@ github.com/whyrusleeping/mdns v0.0.0-20180901202407-ef14215e6b30/go.mod h1:j4l84 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= -github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= -github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= @@ -1895,12 +1723,13 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.12.1 h1:hYRcyznPRJp+5mzF2sazTLP2nGvGjYDD2VzhHhFomLU= github.com/zondax/ledger-go v0.12.1/go.mod h1:KatxXrVDzgWwbssUWsF5+cOJHXPvzQ09YSlzGNuhOEo= +github.com/zyedidia/generic v1.2.1 h1:Zv5KS/N2m0XZZiuLS82qheRG4X1o5gsWreGb0hR7XDc= +github.com/zyedidia/generic v1.2.1/go.mod h1:ly2RBz4mnz1yeuVbQA/VFwGjK3mnHGRj1JuoG336Bis= go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ= @@ -1910,8 +1739,7 @@ go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI go.dedis.ch/protobuf v1.0.11 h1:FTYVIEzY/bfl37lu3pR4lIj+F9Vp1jE8oh91VmxKgLo= go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= -go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1922,12 +1750,13 @@ go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel v1.2.0/go.mod h1:aT17Fk0Z1Nor9e0uisf98LrntPGMnk4frBO9+dkf69I= -go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= -go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= +go.opentelemetry.io/otel v1.12.0 h1:IgfC7kqQrRccIKuB7Cl+SRUmsKbEwSGPr0Eu+/ht1SQ= +go.opentelemetry.io/otel v1.12.0/go.mod h1:geaoz0L0r1BEOR81k7/n9W4TCXYCJ7bPO7K374jQHG0= go.opentelemetry.io/otel/bridge/opencensus v0.33.0 h1:DnSFYr/VxUVwkHL0UoaMcxx74Jugb1HO0B08cYBmi0c= go.opentelemetry.io/otel/bridge/opencensus v0.33.0/go.mod h1:gylOY4P2e7kPYc6T9M8XfQ5+RK4+evGorTOOy+gO4Nc= go.opentelemetry.io/otel/exporters/jaeger v1.2.0 h1:C/5Egj3MJBXRJi22cSl07suqPqtZLnLFmH//OxETUEc= @@ -1944,47 +1773,40 @@ go.opentelemetry.io/otel/sdk/metric v0.33.0 h1:oTqyWfksgKoJmbrs2q7O7ahkJzt+Ipeki go.opentelemetry.io/otel/sdk/metric v0.33.0/go.mod h1:xdypMeA21JBOvjjzDUtD0kzIcHO/SPez+a8HOzJPGp0= go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.opentelemetry.io/otel/trace v1.2.0/go.mod h1:N5FLswTubnxKxOJHM7XZC074qpeEdLy3CgAVsdMucK0= -go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= -go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= +go.opentelemetry.io/otel/trace v1.12.0 h1:p28in++7Kd0r2d8gSt931O57fdjUyWxkVbESuILAeUc= +go.opentelemetry.io/otel/trace v1.12.0/go.mod h1:pHlgBynn6s25qJ2szD+Bv+iwKJttjHSI3lUAyf0GNuQ= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/dig v1.16.0 h1:O48QoUEj4ePocypAIE5jz+SrxVdG/izHM1CZ/Yjrwww= -go.uber.org/dig v1.16.0/go.mod h1:557JTAUZT5bUK0SvCwikmLPPtdQhfvLYtO5tJgQSbnk= -go.uber.org/fx v1.19.2-0.20230112190306-5e90c3828924 h1:zEdVPfgkrAbJVV9srzXqAI18xUOSNl0DzlXrN7LM0BY= -go.uber.org/fx v1.19.2-0.20230112190306-5e90c3828924/go.mod h1:bGK+AEy7XUwTBkqCsK/vDyFF0JJOA6X5KWpNC0e6qTA= +go.uber.org/dig v1.16.1 h1:+alNIBsl0qfY0j6epRubp/9obgtrObRAc5aD+6jbWY8= +go.uber.org/dig v1.16.1/go.mod h1:557JTAUZT5bUK0SvCwikmLPPtdQhfvLYtO5tJgQSbnk= +go.uber.org/fx v1.19.2 h1:SyFgYQFr1Wl0AYstE8vyYIzP4bFz2URrScjwC4cwUvY= +go.uber.org/fx v1.19.2/go.mod h1:43G1VcqSzbIv77y00p1DRAsyZS8WdzuYdhZXmEUkMyQ= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= -go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= go4.org v0.0.0-20200411211856-f5505b9728dd h1:BNJlw5kRTzdmyfh5U8F93HA2OwkP7ZGwA51eJ/0wKOU= go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= @@ -2014,7 +1836,6 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -2026,13 +1847,10 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -2046,8 +1864,8 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20210615023648-acb5c1269671/go.mod h1:DVyR6MI7P4kEQgvZJSj1fQGrWIi2RzIrfYWycwheUAc= golang.org/x/exp v0.0.0-20210714144626-1041f73d31d8/go.mod h1:DVyR6MI7P4kEQgvZJSj1fQGrWIi2RzIrfYWycwheUAc= -golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b h1:SCE/18RnFsLrjydh/R/s5EVvHoZprqEQUuoxK8q2Pc4= -golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/exp v0.0.0-20230129154200-a960b3787bd2 h1:5sPMf9HJXrvBWIamTw+rTST0bZ3Mho2n1p58M0+W99c= +golang.org/x/exp v0.0.0-20230129154200-a960b3787bd2/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -2072,9 +1890,8 @@ golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hM golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2104,9 +1921,7 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190921015927-1a5e07d1ff72/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -2123,7 +1938,6 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201022231255-08b38378de70/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -2132,15 +1946,11 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220418201149-a630d4f3e7a2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -2165,8 +1975,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220907140024-f12130a52804 h1:0SH2R3f1b1VmIMG7BXbEZCBUu2dKmHschSmjqGUrW8A= -golang.org/x/sync v0.0.0-20220907140024-f12130a52804/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2188,13 +1998,11 @@ golang.org/x/sys v0.0.0-20190302025703-b6889370fb10/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190524122548-abf6ff778158/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190526052359-791d8a0f4d09/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2204,19 +2012,16 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190902133755-9109b7679e13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025090151-53bf42e6b339/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2226,7 +2031,6 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2246,8 +2050,6 @@ golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2260,19 +2062,19 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211209171907-798191bca915/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2340,7 +2142,6 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= @@ -2354,20 +2155,17 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.3.0 h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -2398,7 +2196,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -2436,7 +2233,6 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -2461,8 +2257,6 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= @@ -2532,6 +2326,8 @@ howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCU lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= +nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/itests/contracts/Blocktest.hex b/itests/contracts/Blocktest.hex new file mode 100644 index 0000000000..2d477b3ffa --- /dev/null +++ b/itests/contracts/Blocktest.hex @@ -0,0 +1 @@ +608060405234801561001057600080fd5b5061024d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806311dcda5214610067578063188ec356146100715780633e64a6961461008f57806342cbb15c146100ad578063564b81ef146100cb578063bfc6ac54146100e9575b600080fd5b61006f610107565b005b610079610117565b6040516100869190610165565b60405180910390f35b61009761011f565b6040516100a49190610165565b60405180910390f35b6100b5610127565b6040516100c29190610165565b60405180910390f35b6100d361012f565b6040516100e09190610165565b60405180910390f35b6100f1610137565b6040516100fe9190610199565b60405180910390f35b61013a461461011557600080fd5b565b600042905090565b600048905090565b600043905090565b600046905090565b600060014361014691906101e3565b40905090565b6000819050919050565b61015f8161014c565b82525050565b600060208201905061017a6000830184610156565b92915050565b6000819050919050565b61019381610180565b82525050565b60006020820190506101ae600083018461018a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006101ee8261014c565b91506101f98361014c565b9250828203905081811115610211576102106101b4565b5b9291505056fea264697066735822122015a2d5fbebc013a5c3ece3d5bbf98707100b155793f6d340c3df6a736a3f1dfa64736f6c63430008110033 \ No newline at end of file diff --git a/itests/contracts/Blocktest.sol b/itests/contracts/Blocktest.sol new file mode 100644 index 0000000000..3fde0d56b1 --- /dev/null +++ b/itests/contracts/Blocktest.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.17; + +contract BlockTest { + + function testChainID() public view{ + require(block.chainid == 314); + } + + function getBlockhashPrevious() public view returns (bytes32) { + return blockhash(block.number-1); + } + + function getBasefee() public view returns (uint256){ + return block.basefee; + } + + function getBlockNumber() public view returns (uint256){ + return block.number; + } + function getTimestamp() public view returns (uint256){ + return block.timestamp; + } +} diff --git a/itests/contracts/Errors.hex b/itests/contracts/Errors.hex new file mode 100644 index 0000000000..64e4ea6df6 --- /dev/null +++ b/itests/contracts/Errors.hex @@ -0,0 +1 @@ +608060405234801561001057600080fd5b506102de806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630abe88b61461005c57806358d4cbce1461006657806359be8c55146100705780638791bd331461007a578063c6dbcf2e14610084575b600080fd5b61006461008e565b005b61006e61009f565b005b6100786100a4565b005b6100826100df565b005b61008c610111565b005b600061009d5761009c61012a565b5b565b600080fd5b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100d6906101b6565b60405180910390fd5b6040517f09caebf300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006001905060008082610125919061023e565b505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600082825260208201905092915050565b7f6d7920726561736f6e0000000000000000000000000000000000000000000000600082015250565b60006101a0600983610159565b91506101ab8261016a565b602082019050919050565b600060208201905081810360008301526101cf81610193565b9050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610249826101d6565b9150610254836101d6565b925082610264576102636101e0565b5b600160000383147f80000000000000000000000000000000000000000000000000000000000000008314161561029d5761029c61020f565b5b82820590509291505056fea26469706673582212207815355e9e7ced2b8168a953c364e82871c0fe326602bbb9106e6551aea673ed64736f6c63430008120033 \ No newline at end of file diff --git a/itests/contracts/Errors.sol b/itests/contracts/Errors.sol new file mode 100644 index 0000000000..f9bcfbce2d --- /dev/null +++ b/itests/contracts/Errors.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +contract Errors { + error CustomError(); + + function failRevertEmpty() public { + revert(); + } + function failRevertReason() public { + revert("my reason"); + } + function failAssert() public { + assert(false); + } + function failDivZero() public { + int a = 1; + int b = 0; + a / b; + } + function failCustom() public { + revert CustomError(); + } +} diff --git a/itests/contracts/GetDifficulty.hex b/itests/contracts/GetDifficulty.hex new file mode 100644 index 0000000000..6d584b233b --- /dev/null +++ b/itests/contracts/GetDifficulty.hex @@ -0,0 +1 @@ +608060405234801561001057600080fd5b5060b58061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063b6baffe314602d575b600080fd5b60336047565b604051603e91906066565b60405180910390f35b600044905090565b6000819050919050565b606081604f565b82525050565b6000602082019050607960008301846059565b9291505056fea2646970667358221220c113f1abaabaed6a0324d363896b0d15a8bca7b9a540948a5be5b636a12a534f64736f6c63430008110033 \ No newline at end of file diff --git a/itests/contracts/GetDifficulty.sol b/itests/contracts/GetDifficulty.sol new file mode 100644 index 0000000000..155e7cfd1d --- /dev/null +++ b/itests/contracts/GetDifficulty.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.17; + +contract GetDifficulty { + function getDifficulty () public view returns (uint256) { + return block.difficulty; + } +} + diff --git a/itests/contracts/TransparentUpgradeableProxy.hex b/itests/contracts/TransparentUpgradeableProxy.hex new file mode 100644 index 0000000000..d3430beee3 --- /dev/null +++ b/itests/contracts/TransparentUpgradeableProxy.hex @@ -0,0 +1 @@ +608060405234801561001057600080fd5b5061256c806100206000396000f3fe60806040523480156200001157600080fd5b50600436106200003a5760003560e01c806320965255146200003f578063f8a8fd6d1462000061575b600080fd5b620000496200006d565b604051620000589190620002a6565b60405180910390f35b6200006b62000234565b005b6000806040516200007e9062000253565b604051809103906000f0801580156200009b573d6000803e3d6000fd5b509050600081604051620000af9062000261565b620000bb919062000308565b604051809103906000f080158015620000d8573d6000803e3d6000fd5b5090506000604051620000eb906200026f565b604051809103906000f08015801562000108573d6000803e3d6000fd5b5090508173ffffffffffffffffffffffffffffffffffffffff16633659cfe6826040518263ffffffff1660e01b815260040162000146919062000308565b600060405180830381600087803b1580156200016157600080fd5b505af115801562000176573d6000803e3d6000fd5b5050505060006040516200018a906200027d565b604051809103906000f080158015620001a7573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff16633ccc0522846040518263ffffffff1660e01b8152600401620001e5919062000308565b6020604051808303816000875af115801562000205573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022b91906200035b565b94505050505090565b6200023e6200006d565b6000146200025157620002506200038d565b5b565b6103f780620003bd83390190565b61174480620007b483390190565b6103ef8062001ef883390190565b61025080620022e783390190565b6000819050919050565b620002a0816200028b565b82525050565b6000602082019050620002bd600083018462000295565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002f082620002c3565b9050919050565b6200030281620002e3565b82525050565b60006020820190506200031f6000830184620002f7565b92915050565b600080fd5b62000335816200028b565b81146200034157600080fd5b50565b60008151905062000355816200032a565b92915050565b60006020828403121562000374576200037362000325565b5b6000620003848482850162000344565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfe608060405234801561001057600080fd5b506103d7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100455760003560e01c8063209652551461004e578063552410771461006c5780638129fc1c1461008857610046565b5b600180819055005b610056610092565b6040516100639190610218565b60405180910390f35b61008660048036038101906100819190610264565b61009c565b005b6100906100a6565b005b6000600154905090565b8060018190555050565b60008060019054906101000a900460ff161590508080156100d75750600160008054906101000a900460ff1660ff16105b8061010457506100e6306101dc565b1580156101035750600160008054906101000a900460ff1660ff16145b5b610143576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013a90610314565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610180576001600060016101000a81548160ff0219169083151502179055505b80156101d95760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516101d09190610386565b60405180910390a15b50565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000819050919050565b610212816101ff565b82525050565b600060208201905061022d6000830184610209565b92915050565b600080fd5b610241816101ff565b811461024c57600080fd5b50565b60008135905061025e81610238565b92915050565b60006020828403121561027a57610279610233565b5b60006102888482850161024f565b91505092915050565b600082825260208201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b60006102fe602e83610291565b9150610309826102a2565b604082019050919050565b6000602082019050818103600083015261032d816102f1565b9050919050565b6000819050919050565b600060ff82169050919050565b6000819050919050565b600061037061036b61036684610334565b61034b565b61033e565b9050919050565b61038081610355565b82525050565b600060208201905061039b6000830184610377565b9291505056fea2646970667358221220934a8ba055f2e0df7da7dde7999f38a4972809a218a2a064683da10ad547f1fd64736f6c63430008110033608060405260405162001744380380620017448339818101604052810190620000299190620005c7565b80604051806020016040528060008152506200004e828260006200006860201b60201c565b50506200006133620000ab60201b60201c565b50620008fd565b62000079836200010960201b60201c565b600082511180620000875750805b15620000a657620000a483836200016060201b620003361760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000dc6200019660201b60201c565b82604051620000ed9291906200060a565b60405180910390a16200010681620001fa60201b60201c565b50565b6200011a81620002ea60201b60201c565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60606200018e83836040518060600160405280602781526020016200171d60279139620003c060201b60201c565b905092915050565b6000620001d17fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b6200045260201b620003631760201c565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036200026c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200026390620006be565b60405180910390fd5b80620002a67fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b6200045260201b620003631760201c565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b62000300816200045c60201b6200036d1760201c565b62000342576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003399062000756565b60405180910390fd5b806200037c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b6200045260201b620003631760201c565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60606000808573ffffffffffffffffffffffffffffffffffffffff1685604051620003ec9190620007f1565b600060405180830381855af49150503d806000811462000429576040519150601f19603f3d011682016040523d82523d6000602084013e6200042e565b606091505b509150915062000447868383876200047f60201b60201c565b925050509392505050565b6000819050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315620004ef576000835103620004e657620004a3856200045c60201b60201c565b620004e5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620004dc906200085a565b60405180910390fd5b5b82905062000502565b6200050183836200050a60201b60201c565b5b949350505050565b6000825111156200051e5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620005549190620008d9565b60405180910390fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200058f8262000562565b9050919050565b620005a18162000582565b8114620005ad57600080fd5b50565b600081519050620005c18162000596565b92915050565b600060208284031215620005e057620005df6200055d565b5b6000620005f084828501620005b0565b91505092915050565b620006048162000582565b82525050565b6000604082019050620006216000830185620005f9565b620006306020830184620005f9565b9392505050565b600082825260208201905092915050565b7f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000620006a660268362000637565b9150620006b38262000648565b604082019050919050565b60006020820190508181036000830152620006d98162000697565b9050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b60006200073e602d8362000637565b91506200074b82620006e0565b604082019050919050565b6000602082019050818103600083015262000771816200072f565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015620007ae57808201518184015260208101905062000791565b60008484015250505050565b6000620007c78262000778565b620007d3818562000783565b9350620007e58185602086016200078e565b80840191505092915050565b6000620007ff8284620007ba565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b600062000842601d8362000637565b91506200084f826200080a565b602082019050919050565b60006020820190508181036000830152620008758162000833565b9050919050565b600081519050919050565b6000601f19601f8301169050919050565b6000620008a5826200087c565b620008b1818562000637565b9350620008c38185602086016200078e565b620008ce8162000887565b840191505092915050565b60006020820190508181036000830152620008f5818462000898565b905092915050565b610e10806200090d6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100675780634f1ef286146100835780635c60da1b1461009f5780638f283970146100bd578063f851a440146100d95761005d565b3661005d5761005b6100f7565b005b6100656100f7565b005b610081600480360381019061007c9190610916565b610111565b005b61009d600480360381019061009891906109a8565b61017f565b005b6100a761021c565b6040516100b49190610a17565b60405180910390f35b6100d760048036038101906100d29190610916565b61027b565b005b6100e16102d7565b6040516100ee9190610a17565b60405180910390f35b6100ff610390565b61010f61010a61040f565b61041e565b565b610119610444565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036101735761015361049b565b61016e816040518060200160405280600081525060006104aa565b61017c565b61017b6100f7565b5b50565b610187610444565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff160361020e576102098383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060016104aa565b610217565b6102166100f7565b5b505050565b6000610226610444565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff160361026f5761026061049b565b61026861040f565b9050610278565b6102776100f7565b5b90565b610283610444565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036102cb576102bd61049b565b6102c6816104d6565b6102d4565b6102d36100f7565b5b50565b60006102e1610444565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff160361032a5761031b61049b565b610323610444565b9050610333565b6103326100f7565b5b90565b606061035b8383604051806060016040528060278152602001610db460279139610522565b905092915050565b6000819050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b610398610444565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603610405576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103fc90610adb565b60405180910390fd5b61040d6105a8565b565b60006104196105aa565b905090565b3660008037600080366000845af43d6000803e806000811461043f573d6000f35b3d6000fd5b60006104727fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b610363565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600034146104a857600080fd5b565b6104b383610601565b6000825111806104c05750805b156104d1576104cf8383610336565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104ff610444565b8260405161050e929190610afb565b60405180910390a161051f81610650565b50565b60606000808573ffffffffffffffffffffffffffffffffffffffff168560405161054c9190610b95565b600060405180830381855af49150503d8060008114610587576040519150601f19603f3d011682016040523d82523d6000602084013e61058c565b606091505b509150915061059d86838387610730565b925050509392505050565b565b60006105d87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b610363565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61060a816107a5565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036106bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b690610c1e565b60405180910390fd5b806106ec7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b610363565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060831561079257600083510361078a5761074a8561036d565b610789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078090610c8a565b60405180910390fd5b5b82905061079d565b61079c838361085e565b5b949350505050565b6107ae8161036d565b6107ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e490610d1c565b60405180910390fd5b8061081a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b610363565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000825111156108715781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a59190610d91565b60405180910390fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108e3826108b8565b9050919050565b6108f3816108d8565b81146108fe57600080fd5b50565b600081359050610910816108ea565b92915050565b60006020828403121561092c5761092b6108ae565b5b600061093a84828501610901565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261096857610967610943565b5b8235905067ffffffffffffffff81111561098557610984610948565b5b6020830191508360018202830111156109a1576109a061094d565b5b9250929050565b6000806000604084860312156109c1576109c06108ae565b5b60006109cf86828701610901565b935050602084013567ffffffffffffffff8111156109f0576109ef6108b3565b5b6109fc86828701610952565b92509250509250925092565b610a11816108d8565b82525050565b6000602082019050610a2c6000830184610a08565b92915050565b600082825260208201905092915050565b7f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60008201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760208201527f6574000000000000000000000000000000000000000000000000000000000000604082015250565b6000610ac5604283610a32565b9150610ad082610a43565b606082019050919050565b60006020820190508181036000830152610af481610ab8565b9050919050565b6000604082019050610b106000830185610a08565b610b1d6020830184610a08565b9392505050565b600081519050919050565b600081905092915050565b60005b83811015610b58578082015181840152602081019050610b3d565b60008484015250505050565b6000610b6f82610b24565b610b798185610b2f565b9350610b89818560208601610b3a565b80840191505092915050565b6000610ba18284610b64565b915081905092915050565b7f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000610c08602683610a32565b9150610c1382610bac565b604082019050919050565b60006020820190508181036000830152610c3781610bfb565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000610c74601d83610a32565b9150610c7f82610c3e565b602082019050919050565b60006020820190508181036000830152610ca381610c67565b9050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b6000610d06602d83610a32565b9150610d1182610caa565b604082019050919050565b60006020820190508181036000830152610d3581610cf9565b9050919050565b600081519050919050565b6000601f19601f8301169050919050565b6000610d6382610d3c565b610d6d8185610a32565b9350610d7d818560208601610b3a565b610d8681610d47565b840191505092915050565b60006020820190508181036000830152610dab8184610d58565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e09e1af8aa595ace2cac727dfa78b8a1c201fdfb2f2b3364541017dec279304b64736f6c63430008110033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564608060405234801561001057600080fd5b506103cf806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063209652551461004657806355241077146100645780638129fc1c14610080575b600080fd5b61004e61008a565b60405161005b9190610210565b60405180910390f35b61007e6004803603810190610079919061025c565b610094565b005b61008861009e565b005b6000600154905090565b8060018190555050565b60008060019054906101000a900460ff161590508080156100cf5750600160008054906101000a900460ff1660ff16105b806100fc57506100de306101d4565b1580156100fb5750600160008054906101000a900460ff1660ff16145b5b61013b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101329061030c565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610178576001600060016101000a81548160ff0219169083151502179055505b80156101d15760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516101c8919061037e565b60405180910390a15b50565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000819050919050565b61020a816101f7565b82525050565b60006020820190506102256000830184610201565b92915050565b600080fd5b610239816101f7565b811461024457600080fd5b50565b60008135905061025681610230565b92915050565b6000602082840312156102725761027161022b565b5b600061028084828501610247565b91505092915050565b600082825260208201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b60006102f6602e83610289565b91506103018261029a565b604082019050919050565b60006020820190508181036000830152610325816102e9565b9050919050565b6000819050919050565b600060ff82169050919050565b6000819050919050565b600061036861036361035e8461032c565b610343565b610336565b9050919050565b6103788161034d565b82525050565b6000602082019050610393600083018461036f565b9291505056fea2646970667358221220f2a2169e9ff5b35281e8323276adc729174eda42cfb39d55a7943efc6c70485164736f6c63430008110033608060405234801561001057600080fd5b50610230806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633ccc052214610030575b600080fd5b61004a60048036038101906100459190610140565b610060565b6040516100579190610186565b60405180910390f35b6000808290508073ffffffffffffffffffffffffffffffffffffffff1663209652556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d591906101cd565b915050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061010d826100e2565b9050919050565b61011d81610102565b811461012857600080fd5b50565b60008135905061013a81610114565b92915050565b600060208284031215610156576101556100dd565b5b60006101648482850161012b565b91505092915050565b6000819050919050565b6101808161016d565b82525050565b600060208201905061019b6000830184610177565b92915050565b6101aa8161016d565b81146101b557600080fd5b50565b6000815190506101c7816101a1565b92915050565b6000602082840312156101e3576101e26100dd565b5b60006101f1848285016101b8565b9150509291505056fea2646970667358221220b98dab0efb759c0eea90d951be7f01d309e1c04588076d429d10680bddf1351864736f6c63430008110033a264697066735822122024666606126645f287960fe9548cc80d17258ad514d74180c7af0e1ee954bd4364736f6c63430008110033 \ No newline at end of file diff --git a/itests/contracts/TransparentUpgradeableProxy.sol b/itests/contracts/TransparentUpgradeableProxy.sol new file mode 100644 index 0000000000..5bb3d0e5d3 --- /dev/null +++ b/itests/contracts/TransparentUpgradeableProxy.sol @@ -0,0 +1,590 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +abstract contract Initializable { + uint8 private _initialized; + + bool private _initializing; + + event Initialized(uint8 version); + + modifier initializer() { + bool isTopLevelCall = !_initializing; + require( + (isTopLevelCall && _initialized < 1) || + (!Address.isContract(address(this)) && _initialized == 1), + "Initializable: contract is already initialized" + ); + _initialized = 1; + if (isTopLevelCall) { + _initializing = true; + } + _; + if (isTopLevelCall) { + _initializing = false; + emit Initialized(1); + } + } + + modifier reinitializer(uint8 version) { + require( + !_initializing && _initialized < version, + "Initializable: contract is already initialized" + ); + _initialized = version; + _initializing = true; + _; + _initializing = false; + emit Initialized(version); + } + + modifier onlyInitializing() { + require(_initializing, "Initializable: contract is not initializing"); + _; + } + + function _disableInitializers() internal virtual { + require(!_initializing, "Initializable: contract is initializing"); + if (_initialized != type(uint8).max) { + _initialized = type(uint8).max; + emit Initialized(type(uint8).max); + } + } + + function _getInitializedVersion() internal view returns (uint8) { + return _initialized; + } + + function _isInitializing() internal view returns (bool) { + return _initializing; + } +} + +contract Implementation4 is Initializable { + uint256 internal _value; + + function initialize() public initializer {} + + function setValue(uint256 _number) public { + _value = _number; + } + + function getValue() public view returns (uint256) { + return _value; + } + + fallback() external { + _value = 1; + } +} + +contract Implementation2 is Initializable { + uint256 internal _value; + + function initialize() public initializer {} + + function setValue(uint256 _number) public { + _value = _number; + } + + function getValue() public view returns (uint256) { + return _value; + } +} + +abstract contract Proxy { + function _delegate(address implementation) internal virtual { + assembly { + calldatacopy(0, 0, calldatasize()) + + let result := delegatecall( + gas(), + implementation, + 0, + calldatasize(), + 0, + 0 + ) + + returndatacopy(0, 0, returndatasize()) + + switch result + case 0 { + revert(0, returndatasize()) + } + default { + return(0, returndatasize()) + } + } + } + + function _implementation() internal view virtual returns (address); + + function _fallback() internal virtual { + _beforeFallback(); + _delegate(_implementation()); + } + + fallback() external payable virtual { + _fallback(); + } + + receive() external payable virtual { + _fallback(); + } + + function _beforeFallback() internal virtual {} +} + +interface IBeacon { + function implementation() external view returns (address); +} + +interface IERC1822Proxiable { + function proxiableUUID() external view returns (bytes32); +} + +library Address { + function isContract(address account) internal view returns (bool) { + return account.code.length > 0; + } + + function sendValue(address payable recipient, uint256 amount) internal { + require( + address(this).balance >= amount, + "Address: insufficient balance" + ); + + (bool success, ) = recipient.call{value: amount}(""); + require( + success, + "Address: unable to send value, recipient may have reverted" + ); + } + + function functionCall( + address target, + bytes memory data + ) internal returns (bytes memory) { + return + functionCallWithValue( + target, + data, + 0, + "Address: low-level call failed" + ); + } + + function functionCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { + return functionCallWithValue(target, data, 0, errorMessage); + } + + function functionCallWithValue( + address target, + bytes memory data, + uint256 value + ) internal returns (bytes memory) { + return + functionCallWithValue( + target, + data, + value, + "Address: low-level call with value failed" + ); + } + + function functionCallWithValue( + address target, + bytes memory data, + uint256 value, + string memory errorMessage + ) internal returns (bytes memory) { + require( + address(this).balance >= value, + "Address: insufficient balance for call" + ); + (bool success, bytes memory returndata) = target.call{value: value}( + data + ); + return + verifyCallResultFromTarget( + target, + success, + returndata, + errorMessage + ); + } + + function functionStaticCall( + address target, + bytes memory data + ) internal view returns (bytes memory) { + return + functionStaticCall( + target, + data, + "Address: low-level static call failed" + ); + } + + function functionStaticCall( + address target, + bytes memory data, + string memory errorMessage + ) internal view returns (bytes memory) { + (bool success, bytes memory returndata) = target.staticcall(data); + return + verifyCallResultFromTarget( + target, + success, + returndata, + errorMessage + ); + } + + function functionDelegateCall( + address target, + bytes memory data + ) internal returns (bytes memory) { + return + functionDelegateCall( + target, + data, + "Address: low-level delegate call failed" + ); + } + + function functionDelegateCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { + (bool success, bytes memory returndata) = target.delegatecall(data); + return + verifyCallResultFromTarget( + target, + success, + returndata, + errorMessage + ); + } + + function verifyCallResultFromTarget( + address target, + bool success, + bytes memory returndata, + string memory errorMessage + ) internal view returns (bytes memory) { + if (success) { + if (returndata.length == 0) { + require(isContract(target), "Address: call to non-contract"); + } + return returndata; + } else { + _revert(returndata, errorMessage); + } + } + + function verifyCallResult( + bool success, + bytes memory returndata, + string memory errorMessage + ) internal pure returns (bytes memory) { + if (success) { + return returndata; + } else { + _revert(returndata, errorMessage); + } + } + + function _revert( + bytes memory returndata, + string memory errorMessage + ) private pure { + if (returndata.length > 0) { + assembly { + let returndata_size := mload(returndata) + revert(add(32, returndata), returndata_size) + } + } else { + revert(errorMessage); + } + } +} + +library StorageSlot { + struct AddressSlot { + address value; + } + + struct BooleanSlot { + bool value; + } + + struct Bytes32Slot { + bytes32 value; + } + + struct Uint256Slot { + uint256 value; + } + + function getAddressSlot( + bytes32 slot + ) internal pure returns (AddressSlot storage r) { + assembly { + r.slot := slot + } + } + + function getBooleanSlot( + bytes32 slot + ) internal pure returns (BooleanSlot storage r) { + assembly { + r.slot := slot + } + } + + function getBytes32Slot( + bytes32 slot + ) internal pure returns (Bytes32Slot storage r) { + assembly { + r.slot := slot + } + } + + function getUint256Slot( + bytes32 slot + ) internal pure returns (Uint256Slot storage r) { + assembly { + r.slot := slot + } + } +} + +abstract contract ERC1967Upgrade { + bytes32 private constant _ROLLBACK_SLOT = + 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; + + bytes32 internal constant _IMPLEMENTATION_SLOT = + 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; + + event Upgraded(address indexed implementation); + + function _getImplementation() internal view returns (address) { + return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; + } + + function _setImplementation(address newImplementation) private { + require( + Address.isContract(newImplementation), + "ERC1967: new implementation is not a contract" + ); + StorageSlot + .getAddressSlot(_IMPLEMENTATION_SLOT) + .value = newImplementation; + } + + function _upgradeTo(address newImplementation) internal { + _setImplementation(newImplementation); + emit Upgraded(newImplementation); + } + + function _upgradeToAndCall( + address newImplementation, + bytes memory data, + bool forceCall + ) internal { + _upgradeTo(newImplementation); + if (data.length > 0 || forceCall) { + Address.functionDelegateCall(newImplementation, data); + } + } + + function _upgradeToAndCallUUPS( + address newImplementation, + bytes memory data, + bool forceCall + ) internal { + if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) { + _setImplementation(newImplementation); + } else { + try IERC1822Proxiable(newImplementation).proxiableUUID() returns ( + bytes32 slot + ) { + require( + slot == _IMPLEMENTATION_SLOT, + "ERC1967Upgrade: unsupported proxiableUUID" + ); + } catch { + revert("ERC1967Upgrade: new implementation is not UUPS"); + } + _upgradeToAndCall(newImplementation, data, forceCall); + } + } + + bytes32 internal constant _ADMIN_SLOT = + 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; + + event AdminChanged(address previousAdmin, address newAdmin); + + function _getAdmin() internal view returns (address) { + return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; + } + + function _setAdmin(address newAdmin) private { + require( + newAdmin != address(0), + "ERC1967: new admin is the zero address" + ); + StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; + } + + function _changeAdmin(address newAdmin) internal { + emit AdminChanged(_getAdmin(), newAdmin); + _setAdmin(newAdmin); + } + + bytes32 internal constant _BEACON_SLOT = + 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; + + event BeaconUpgraded(address indexed beacon); + + function _getBeacon() internal view returns (address) { + return StorageSlot.getAddressSlot(_BEACON_SLOT).value; + } + + function _setBeacon(address newBeacon) private { + require( + Address.isContract(newBeacon), + "ERC1967: new beacon is not a contract" + ); + require( + Address.isContract(IBeacon(newBeacon).implementation()), + "ERC1967: beacon implementation is not a contract" + ); + StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; + } + + function _upgradeBeaconToAndCall( + address newBeacon, + bytes memory data, + bool forceCall + ) internal { + _setBeacon(newBeacon); + emit BeaconUpgraded(newBeacon); + if (data.length > 0 || forceCall) { + Address.functionDelegateCall( + IBeacon(newBeacon).implementation(), + data + ); + } + } +} + +contract ERC1967Proxy is Proxy, ERC1967Upgrade { + constructor(address _logic, bytes memory _data) payable { + _upgradeToAndCall(_logic, _data, false); + } + + function _implementation() + internal + view + virtual + override + returns (address impl) + { + return ERC1967Upgrade._getImplementation(); + } +} + +contract TransparentUpgradeableProxy is ERC1967Proxy { + constructor(address _logic) payable ERC1967Proxy(_logic, "") { + _changeAdmin(msg.sender); + } + + modifier ifAdmin() { + if (msg.sender == _getAdmin()) { + _; + } else { + _fallback(); + } + } + + function admin() external payable ifAdmin returns (address admin_) { + _requireZeroValue(); + admin_ = _getAdmin(); + } + + function implementation() + external + payable + ifAdmin + returns (address implementation_) + { + _requireZeroValue(); + implementation_ = _implementation(); + } + + function changeAdmin(address newAdmin) external payable virtual ifAdmin { + _requireZeroValue(); + _changeAdmin(newAdmin); + } + + function upgradeTo(address newImplementation) external payable ifAdmin { + _requireZeroValue(); + _upgradeToAndCall(newImplementation, bytes(""), false); + } + + function upgradeToAndCall( + address newImplementation, + bytes calldata data + ) external payable ifAdmin { + _upgradeToAndCall(newImplementation, data, true); + } + + function _admin() internal view virtual returns (address) { + return _getAdmin(); + } + + function _beforeFallback() internal virtual override { + require( + msg.sender != _getAdmin(), + "TransparentUpgradeableProxy: admin cannot fallback to proxy target" + ); + super._beforeFallback(); + } + + function _requireZeroValue() private { + require(msg.value == 0); + } +} + +contract TestHelper { + function getValue(address proxyAddress) public returns (uint256) { + Implementation2 proxyInstance2 = Implementation2(proxyAddress); + return proxyInstance2.getValue(); + } +} + +contract TransparentUpgradeableProxyTestRunner { + function test() public { + assert(0 == getValue()); + } + + function getValue() public returns (uint256) { + Implementation4 instance4 = new Implementation4(); + TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy( + address(instance4) + ); + Implementation2 instance2 = new Implementation2(); + proxy.upgradeTo(address(instance2)); + //use helper because proxy admin can't call getValue() + TestHelper h = new TestHelper(); + return h.getValue(address(proxy)); + } +} diff --git a/itests/contracts/compile.sh b/itests/contracts/compile.sh index 029bff46c8..31bff4b682 100644 --- a/itests/contracts/compile.sh +++ b/itests/contracts/compile.sh @@ -5,7 +5,7 @@ set -o pipefail # to compile all of the .sol files to their corresponding evm binary files stored as .hex # solc outputs to stdout a format that we just want to grab the last line of and then remove the trailing newline on that line -find . -name \*.sol -print0 | +find . -maxdepth 1 -name \*.sol -print0 | xargs -0 -I{} bash -euc -o pipefail 'solc --bin {} |tail -n1 | tr -d "\n" > $(echo {} | sed -e s/.sol$/.hex/)' @@ -17,3 +17,7 @@ for filename in Constructor TestApp ValueSender Create2Factory DeployValueTest; solc --bin $filename.sol | tail -n5|head -n1 | tr -d "\n" > $filename.hex done +for filename in TransparentUpgradeableProxy ; do + echo $filename + solc --bin $filename.sol | tail -n1| tr -d "\n" > $filename.hex +done diff --git a/itests/deals_concurrent_test.go b/itests/deals_concurrent_test.go index 0fee8da01d..a106836bdd 100644 --- a/itests/deals_concurrent_test.go +++ b/itests/deals_concurrent_test.go @@ -11,7 +11,7 @@ import ( provider "github.com/ipni/index-provider" "github.com/stretchr/testify/require" - datatransfer "github.com/filecoin-project/go-data-transfer" + datatransfer "github.com/filecoin-project/go-data-transfer/v2" "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-state-types/abi" diff --git a/itests/deals_partial_retrieval_dm-level_test.go b/itests/deals_partial_retrieval_dm-level_test.go index 246541229e..e3414c1917 100644 --- a/itests/deals_partial_retrieval_dm-level_test.go +++ b/itests/deals_partial_retrieval_dm-level_test.go @@ -5,7 +5,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "testing" "time" @@ -166,7 +165,7 @@ func testDMExportAsFile(ctx context.Context, client *kit.TestFullNode, expDirect func testV0RetrievalAsFile(ctx context.Context, client *kit.TestFullNode, retOrder api0.RetrievalOrder, tempDir string) error { out := tempDir + string(os.PathSeparator) + "exp-test" + retOrder.Root.String() - cv0 := &api0.WrapperV1Full{client.FullNode} //nolint:govet + cv0 := &api0.WrapperV1Full{FullNode: client.FullNode} err := cv0.ClientRetrieve(ctx, retOrder, &api.FileRef{ Path: out, }) @@ -196,7 +195,7 @@ func validateDMUnixFile(r io.Reader) error { } func testDMExportAsCar(ctx context.Context, client *kit.TestFullNode, expDirective api.ExportRef, tempDir string) error { - out, err := ioutil.TempFile(tempDir, "exp-test") + out, err := os.CreateTemp(tempDir, "exp-test") if err != nil { return err } @@ -214,13 +213,13 @@ func testDMExportAsCar(ctx context.Context, client *kit.TestFullNode, expDirecti return validateDMCar(out) } func tesV0RetrievalAsCar(ctx context.Context, client *kit.TestFullNode, retOrder api0.RetrievalOrder, tempDir string) error { - out, err := ioutil.TempFile(tempDir, "exp-test") + out, err := os.CreateTemp(tempDir, "exp-test") if err != nil { return err } defer out.Close() //nolint:errcheck - cv0 := &api0.WrapperV1Full{client.FullNode} //nolint:govet + cv0 := &api0.WrapperV1Full{FullNode: client.FullNode} err = cv0.ClientRetrieve(ctx, retOrder, &api.FileRef{ Path: out.Name(), IsCAR: true, diff --git a/itests/eth_api_test.go b/itests/eth_api_test.go new file mode 100644 index 0000000000..43b4b52667 --- /dev/null +++ b/itests/eth_api_test.go @@ -0,0 +1,126 @@ +package itests + +import ( + "context" + "strconv" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/filecoin-project/go-state-types/builtin" + + "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/chain/types/ethtypes" + "github.com/filecoin-project/lotus/chain/wallet/key" + "github.com/filecoin-project/lotus/itests/kit" +) + +func TestEthAddressToFilecoinAddress(t *testing.T) { + // Disable EthRPC to confirm that this method does NOT need the EthEnableRPC config set to true + client, _, _ := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.DisableEthRPC()) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + secpKey, err := key.GenerateKey(types.KTDelegated) + require.NoError(t, err) + + filecoinKeyAddr, err := client.WalletImport(ctx, &secpKey.KeyInfo) + require.NoError(t, err) + + ethAddr, err := ethtypes.EthAddressFromFilecoinAddress(filecoinKeyAddr) + require.NoError(t, err) + + apiFilAddr, err := client.EthAddressToFilecoinAddress(ctx, ethAddr) + require.NoError(t, err) + + require.Equal(t, filecoinKeyAddr, apiFilAddr) + + filecoinIdArr := builtin.StorageMarketActorAddr + ethAddr, err = ethtypes.EthAddressFromFilecoinAddress(filecoinIdArr) + require.NoError(t, err) + + apiFilAddr, err = client.EthAddressToFilecoinAddress(ctx, ethAddr) + require.NoError(t, err) + + require.Equal(t, filecoinIdArr, apiFilAddr) + +} + +func TestFilecoinAddressToEthAddress(t *testing.T) { + // Disable EthRPC to confirm that this method does NOT need the EthEnableRPC config set to true + client, _, _ := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.DisableEthRPC()) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + secpDelegatedKey, err := key.GenerateKey(types.KTDelegated) + require.NoError(t, err) + + filecoinKeyAddr, err := client.WalletImport(ctx, &secpDelegatedKey.KeyInfo) + require.NoError(t, err) + + ethAddr, err := ethtypes.EthAddressFromFilecoinAddress(filecoinKeyAddr) + require.NoError(t, err) + + apiEthAddr, err := client.FilecoinAddressToEthAddress(ctx, filecoinKeyAddr) + require.NoError(t, err) + + require.Equal(t, ethAddr, apiEthAddr) + + filecoinIdArr := builtin.StorageMarketActorAddr + ethAddr, err = ethtypes.EthAddressFromFilecoinAddress(filecoinIdArr) + require.NoError(t, err) + + apiEthAddr, err = client.FilecoinAddressToEthAddress(ctx, filecoinIdArr) + require.NoError(t, err) + + require.Equal(t, ethAddr, apiEthAddr) + + secpKey, err := key.GenerateKey(types.KTSecp256k1) + require.NoError(t, err) + + filecoinSecpAddr, err := client.WalletImport(ctx, &secpKey.KeyInfo) + require.NoError(t, err) + + _, err = client.FilecoinAddressToEthAddress(ctx, filecoinSecpAddr) + + require.ErrorContains(t, err, ethtypes.ErrInvalidAddress.Error()) +} + +func TestEthGetGenesis(t *testing.T) { + blockTime := 100 * time.Millisecond + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) + ens.InterconnectAll().BeginMining(blockTime) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + ethBlk, err := client.EVM().EthGetBlockByNumber(ctx, "0x0", true) + require.NoError(t, err) + + genesis, err := client.ChainGetGenesis(ctx) + require.NoError(t, err) + + genesisCid, err := genesis.Key().Cid() + require.NoError(t, err) + + genesisHash, err := ethtypes.EthHashFromCid(genesisCid) + require.NoError(t, err) + require.Equal(t, ethBlk.Hash, genesisHash) +} + +func TestNetVersion(t *testing.T) { + blockTime := 100 * time.Millisecond + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) + ens.InterconnectAll().BeginMining(blockTime) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + version, err := client.NetVersion(ctx) + require.NoError(t, err) + require.Equal(t, strconv.Itoa(build.Eip155ChainId), version) +} diff --git a/itests/eth_balance_test.go b/itests/eth_balance_test.go index 3176aefc85..d5f1512271 100644 --- a/itests/eth_balance_test.go +++ b/itests/eth_balance_test.go @@ -2,6 +2,7 @@ package itests import ( "context" + "strconv" "testing" "time" @@ -11,6 +12,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/itests/kit" @@ -95,3 +97,39 @@ func TestEthGetBalanceBuiltinActor(t *testing.T) { require.NoError(t, err) require.Equal(t, ethtypes.EthBigInt{Int: big.NewInt(10).Int}, ebal) } + +func TestEthBalanceCorrectLookup(t *testing.T) { + blockTime := 100 * time.Millisecond + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) + ens.InterconnectAll().BeginMining(blockTime) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + _, ethAddr, filAddr := client.EVM().NewAccount() + + val := int64(100) + + smsg, err := client.MpoolPushMessage(ctx, &types.Message{ + To: filAddr, + From: client.DefaultKey.Address, + Value: abi.NewTokenAmount(val), + }, nil) + require.NoError(t, err) + + ml, err := client.StateWaitMsg(ctx, smsg.Cid(), 3, api.LookbackNoLimit, false) + require.NoError(t, err) + require.True(t, ml.Receipt.ExitCode.IsSuccess()) + + bal, err := client.EVM().EthGetBalance(ctx, ethAddr, strconv.FormatInt(int64(ml.Height-2), 10)) + require.NoError(t, err) + require.Equal(t, int64(0), bal.Int64()) + + bal, err = client.EVM().EthGetBalance(ctx, ethAddr, strconv.FormatInt(int64(ml.Height-1), 10)) + require.NoError(t, err) + require.Equal(t, val, bal.Int64()) + + bal, err = client.EVM().EthGetBalance(ctx, ethAddr, strconv.FormatInt(int64(ml.Height), 10)) + require.NoError(t, err) + require.Equal(t, val, bal.Int64()) +} diff --git a/itests/eth_block_hash_test.go b/itests/eth_block_hash_test.go index ac6506bb25..db21375c58 100644 --- a/itests/eth_block_hash_test.go +++ b/itests/eth_block_hash_test.go @@ -3,6 +3,7 @@ package itests import ( "context" "fmt" + "strings" "testing" "time" @@ -48,13 +49,14 @@ func TestEthBlockHashesCorrect_MultiBlockTipset(t *testing.T) { // let the chain run a little bit longer to minimise the chance of reorgs n2.WaitTillChain(ctx, kit.HeightAtLeast(head.Height()+50)) - head, err = n2.ChainHead(context.Background()) - require.NoError(t, err) - for i := 1; i <= int(head.Height()); i++ { hex := fmt.Sprintf("0x%x", i) ethBlockA, err := n2.EthGetBlockByNumber(ctx, hex, true) + // Cannot use static ErrFullRound error for comparison since it gets reserialized as a JSON RPC error. + if err != nil && strings.Contains(err.Error(), "null round") { + continue + } require.NoError(t, err) ethBlockB, err := n2.EthGetBlockByHash(ctx, ethBlockA.Hash, true) diff --git a/itests/eth_bytecode_test.go b/itests/eth_bytecode_test.go new file mode 100644 index 0000000000..a8a75e83f7 --- /dev/null +++ b/itests/eth_bytecode_test.go @@ -0,0 +1,95 @@ +package itests + +import ( + "context" + "encoding/hex" + "os" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/chain/types/ethtypes" + "github.com/filecoin-project/lotus/itests/kit" +) + +// TestGetCodeAndNonce ensures that GetCode and GetTransactionCount return the correct results for: +// 1. Placeholders. +// 2. Non-existent actors. +// 3. Normal EVM actors. +// 4. Self-destructed EVM actors. +func TestGetCodeAndNonce(t *testing.T) { + kit.QuietMiningLogs() + + blockTime := 100 * time.Millisecond + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) + ens.InterconnectAll().BeginMining(blockTime) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + // Accounts should have empty code, empty nonce. + { + // A random eth address should have no code. + _, ethAddr, filAddr := client.EVM().NewAccount() + bytecode, err := client.EVM().EthGetCode(ctx, ethAddr, "latest") + require.NoError(t, err) + require.Empty(t, bytecode) + + // Nonce should also be zero + nonce, err := client.EVM().EthGetTransactionCount(ctx, ethAddr, "latest") + require.NoError(t, err) + require.Zero(t, nonce) + + // send some funds to the account. + kit.SendFunds(ctx, t, client, filAddr, types.FromFil(10)) + + // The code should still be empty, target is now a placeholder. + bytecode, err = client.EVM().EthGetCode(ctx, ethAddr, "latest") + require.NoError(t, err) + require.Empty(t, bytecode) + + // Nonce should still be zero. + nonce, err = client.EVM().EthGetTransactionCount(ctx, ethAddr, "latest") + require.NoError(t, err) + require.Zero(t, nonce) + } + + // Check contract code. + { + // install a contract + contractHex, err := os.ReadFile("./contracts/SelfDestruct.hex") + require.NoError(t, err) + contract, err := hex.DecodeString(string(contractHex)) + require.NoError(t, err) + createReturn := client.EVM().DeployContract(ctx, client.DefaultKey.Address, contract) + contractAddr := createReturn.EthAddress + contractFilAddr := *createReturn.RobustAddress + + // The newly deployed contract should not be empty. + bytecode, err := client.EVM().EthGetCode(ctx, contractAddr, "latest") + require.NoError(t, err) + require.NotEmpty(t, bytecode) + + // Nonce should be one. + nonce, err := client.EVM().EthGetTransactionCount(ctx, contractAddr, "latest") + require.NoError(t, err) + require.Equal(t, ethtypes.EthUint64(1), nonce) + + // Destroy it. + _, _, err = client.EVM().InvokeContractByFuncName(ctx, client.DefaultKey.Address, contractFilAddr, "destroy()", nil) + require.NoError(t, err) + + // The code should be empty again. + bytecode, err = client.EVM().EthGetCode(ctx, contractAddr, "latest") + require.NoError(t, err) + require.Empty(t, bytecode) + + // Nonce should go back to zero + nonce, err = client.EVM().EthGetTransactionCount(ctx, contractAddr, "latest") + require.NoError(t, err) + require.Zero(t, nonce) + } + +} diff --git a/itests/eth_conformance_test.go b/itests/eth_conformance_test.go index 8a367d6b1d..4d8f5c3ddb 100644 --- a/itests/eth_conformance_test.go +++ b/itests/eth_conformance_test.go @@ -236,14 +236,6 @@ func TestEthOpenRPCConformance(t *testing.T) { skipReason: "earliest block is not supported", }, - { - method: "eth_getBlockByNumber", - variant: "pending", - call: func(a *ethAPIRaw) (json.RawMessage, error) { - return ethapi.EthGetBlockByNumber(context.Background(), "pending", true) - }, - }, - { method: "eth_getBlockByNumber", call: func(a *ethAPIRaw) (json.RawMessage, error) { diff --git a/itests/eth_fee_history_test.go b/itests/eth_fee_history_test.go index 9b256c527f..a792c7f0e9 100644 --- a/itests/eth_fee_history_test.go +++ b/itests/eth_fee_history_test.go @@ -3,18 +3,42 @@ package itests import ( "context" "encoding/json" + "sort" "testing" "time" "github.com/stretchr/testify/require" "github.com/filecoin-project/go-jsonrpc" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/itests/kit" "github.com/filecoin-project/lotus/lib/result" + "github.com/filecoin-project/lotus/node/impl/full" ) +// calculateExpectations calculates the expected number of items to be included in the response +// of eth_feeHistory. It takes care of null rounds by finding the closet tipset with height +// smaller than startHeight, and then looks back at requestAmount of items. It also considers +// scenarios where there are not enough items to look back. +func calculateExpectations(tsHeights []int, requestAmount, startHeight int) (count, oldestHeight int) { + latestIdx := sort.SearchInts(tsHeights, startHeight) + // SearchInts returns the index of the number that's larger than the target if the target + // doesn't exist. However, we're looking for the closet number that's smaller that the target + for tsHeights[latestIdx] > startHeight { + latestIdx-- + } + cnt := requestAmount + oldestIdx := latestIdx - requestAmount + 1 + if oldestIdx < 0 { + cnt = latestIdx + 1 + oldestIdx = 0 + } + return cnt, tsHeights[oldestIdx] +} + func TestEthFeeHistory(t *testing.T) { require := require.New(t) @@ -22,66 +46,150 @@ func TestEthFeeHistory(t *testing.T) { blockTime := 100 * time.Millisecond client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) - ens.InterconnectAll().BeginMining(blockTime) ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - // Wait for the network to create 20 blocks - <-time.After(20 * blockTime) + heads, err := client.ChainNotify(ctx) + require.NoError(err) + + // Save the full view of the tipsets to calculate the answer when there are null rounds + tsHeights := []int{1} + go func() { + for chg := range heads { + for _, c := range chg { + tsHeights = append(tsHeights, int(c.Val.Height())) + } + } + }() + + miner := ens.InterconnectAll().BeginMining(blockTime) + + client.WaitTillChain(ctx, kit.HeightAtLeast(7)) + miner[0].InjectNulls(abi.ChainEpoch(5)) + + // Wait for the network to create at least 20 tipsets + client.WaitTillChain(ctx, kit.HeightAtLeast(20)) + for _, m := range miner { + m.Pause() + } + + ch, err := client.ChainNotify(ctx) + require.NoError(err) + + // Wait for 5 seconds of inactivity + func() { + for { + select { + case <-ch: + continue + case <-time.After(5 * time.Second): + return + } + } + }() + + sort.Ints(tsHeights) + + // because of the deferred execution, the last tipset is not executed yet, + // and the one before the last one is the last executed tipset, + // which corresponds to the "latest" tag in EthGetBlockByNumber + latestBlk := ethtypes.EthUint64(tsHeights[len(tsHeights)-2]) + blk, err := client.EthGetBlockByNumber(ctx, "latest", false) + require.NoError(err) + require.Equal(blk.Number, latestBlk) + + assertHistory := func(history *ethtypes.EthFeeHistory, requestAmount, startHeight int) { + amount, oldest := calculateExpectations(tsHeights, requestAmount, startHeight) + require.Equal(amount+1, len(history.BaseFeePerGas)) + require.Equal(amount, len(history.GasUsedRatio)) + require.Equal(ethtypes.EthUint64(oldest), history.OldestBlock) + } history, err := client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( json.Marshal([]interface{}{5, "0x10"}), ).Assert(require.NoError)) require.NoError(err) - require.Equal(6, len(history.BaseFeePerGas)) - require.Equal(5, len(history.GasUsedRatio)) - require.Equal(ethtypes.EthUint64(16-5+1), history.OldestBlock) + assertHistory(&history, 5, 16) + require.Nil(history.Reward) history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( json.Marshal([]interface{}{"5", "0x10"}), ).Assert(require.NoError)) require.NoError(err) - require.Equal(6, len(history.BaseFeePerGas)) - require.Equal(5, len(history.GasUsedRatio)) - require.Equal(ethtypes.EthUint64(16-5+1), history.OldestBlock) + assertHistory(&history, 5, 16) + require.Nil(history.Reward) + + history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( + json.Marshal([]interface{}{5, "latest"}), + ).Assert(require.NoError)) + require.NoError(err) + assertHistory(&history, 5, int(latestBlk)) + require.Nil(history.Reward) history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( json.Marshal([]interface{}{"0x10", "0x12"}), ).Assert(require.NoError)) require.NoError(err) - require.Equal(17, len(history.BaseFeePerGas)) - require.Equal(16, len(history.GasUsedRatio)) - require.Equal(ethtypes.EthUint64(18-16+1), history.OldestBlock) + assertHistory(&history, 16, 18) + require.Nil(history.Reward) history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( json.Marshal([]interface{}{5, "0x10"}), ).Assert(require.NoError)) require.NoError(err) - require.Equal(6, len(history.BaseFeePerGas)) - require.Equal(5, len(history.GasUsedRatio)) - require.Equal(ethtypes.EthUint64(16-5+1), history.OldestBlock) + assertHistory(&history, 5, 16) + require.Nil(history.Reward) history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( json.Marshal([]interface{}{5, "10"}), ).Assert(require.NoError)) require.NoError(err) - require.Equal(6, len(history.BaseFeePerGas)) - require.Equal(5, len(history.GasUsedRatio)) - require.Equal(ethtypes.EthUint64(10-5+1), history.OldestBlock) + assertHistory(&history, 5, 10) + require.Nil(history.Reward) + // test when the requested number of blocks is longer than chain length history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( - json.Marshal([]interface{}{5, "10", &[]float64{0.25, 0.50, 0.75}}), + json.Marshal([]interface{}{"0x30", "latest"}), ).Assert(require.NoError)) require.NoError(err) - require.Equal(6, len(history.BaseFeePerGas)) - require.Equal(5, len(history.GasUsedRatio)) - require.Equal(ethtypes.EthUint64(10-5+1), history.OldestBlock) + assertHistory(&history, 48, int(latestBlk)) + require.Nil(history.Reward) + + // test when the requested number of blocks is longer than chain length + history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( + json.Marshal([]interface{}{"0x30", "10"}), + ).Assert(require.NoError)) + require.NoError(err) + assertHistory(&history, 48, 10) + require.Nil(history.Reward) + + history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( + json.Marshal([]interface{}{5, "10", &[]float64{25, 50, 75}}), + ).Assert(require.NoError)) + require.NoError(err) + assertHistory(&history, 5, 10) require.NotNil(history.Reward) - require.Equal(0, len(*history.Reward)) + require.Equal(5, len(*history.Reward)) + for _, arr := range *history.Reward { + require.Equal(3, len(arr)) + for _, item := range arr { + require.Equal(ethtypes.EthBigInt(types.NewInt(full.MinGasPremium)), item) + } + } history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( - json.Marshal([]interface{}{1025, "10", &[]float64{0.25, 0.50, 0.75}}), + json.Marshal([]interface{}{1025, "10", &[]float64{25, 50, 75}}), ).Assert(require.NoError)) require.Error(err) + + history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( + json.Marshal([]interface{}{5, "10", &[]float64{75, 50}}), + ).Assert(require.NoError)) + require.Error(err) + + history, err = client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams]( + json.Marshal([]interface{}{5, "10", &[]float64{}}), + ).Assert(require.NoError)) + require.NoError(err) } diff --git a/itests/eth_filter_test.go b/itests/eth_filter_test.go index 9540c5ebea..1104bec134 100644 --- a/itests/eth_filter_test.go +++ b/itests/eth_filter_test.go @@ -136,6 +136,113 @@ func TestEthNewPendingTransactionFilter(t *testing.T) { } } +func TestEthNewPendingTransactionSub(t *testing.T) { + require := require.New(t) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + kit.QuietAllLogsExcept("events", "messagepool") + + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.WithEthRPC()) + ens.InterconnectAll().BeginMining(10 * time.Millisecond) + + // create a new address where to send funds. + addr, err := client.WalletNew(ctx, types.KTBLS) + require.NoError(err) + + // get the existing balance from the default wallet to then split it. + bal, err := client.WalletBalance(ctx, client.DefaultKey.Address) + require.NoError(err) + + // install filter + subId, err := client.EthSubscribe(ctx, res.Wrap[jsonrpc.RawParams](json.Marshal(ethtypes.EthSubscribeParams{EventType: "newPendingTransactions"})).Assert(require.NoError)) + require.NoError(err) + + var subResponses []ethtypes.EthSubscriptionResponse + err = client.EthSubRouter.AddSub(ctx, subId, func(ctx context.Context, resp *ethtypes.EthSubscriptionResponse) error { + subResponses = append(subResponses, *resp) + return nil + }) + require.NoError(err) + + const iterations = 100 + + // we'll send half our balance (saving the other half for gas), + // in `iterations` increments. + toSend := big.Div(bal, big.NewInt(2)) + each := big.Div(toSend, big.NewInt(iterations)) + + waitAllCh := make(chan struct{}) + go func() { + headChangeCh, err := client.ChainNotify(ctx) + require.NoError(err) + <-headChangeCh // skip hccurrent + + defer func() { + close(waitAllCh) + }() + + count := 0 + for { + select { + case <-ctx.Done(): + return + case headChanges := <-headChangeCh: + for _, change := range headChanges { + if change.Type == store.HCApply { + msgs, err := client.ChainGetMessagesInTipset(ctx, change.Val.Key()) + require.NoError(err) + count += len(msgs) + if count == iterations { + return + } + } + } + } + } + }() + + var sms []*types.SignedMessage + for i := 0; i < iterations; i++ { + msg := &types.Message{ + From: client.DefaultKey.Address, + To: addr, + Value: each, + } + + sm, err := client.MpoolPushMessage(ctx, msg, nil) + require.NoError(err) + require.EqualValues(i, sm.Message.Nonce) + + sms = append(sms, sm) + } + + select { + case <-waitAllCh: + case <-ctx.Done(): + t.Errorf("timeout waiting to pack messages") + } + + expected := make(map[string]bool) + for _, sm := range sms { + hash, err := ethtypes.EthHashFromCid(sm.Cid()) + require.NoError(err) + expected[hash.String()] = false + } + + // expect to have seen iteration number of mpool messages + require.Equal(len(subResponses), len(expected), "expected number of filter results to equal number of messages") + + for _, txid := range subResponses { + expected[txid.Result.(string)] = true + } + + for _, found := range expected { + require.True(found) + } +} + func TestEthNewBlockFilter(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() diff --git a/itests/eth_transactions_test.go b/itests/eth_transactions_test.go index 9afeb7bd5f..8d0df04335 100644 --- a/itests/eth_transactions_test.go +++ b/itests/eth_transactions_test.go @@ -14,6 +14,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/itests/kit" @@ -270,6 +271,57 @@ func TestContractInvocation(t *testing.T) { require.EqualValues(t, ethtypes.EthUint64(0x1), receipt.Status) } +func TestGetBlockByNumber(t *testing.T) { + blockTime := 100 * time.Millisecond + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) + + bms := ens.InterconnectAll().BeginMining(blockTime) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + // create a new Ethereum account + _, ethAddr, filAddr := client.EVM().NewAccount() + // send some funds to the f410 address + kit.SendFunds(ctx, t, client, filAddr, types.FromFil(10)) + + latest, err := client.EthBlockNumber(ctx) + require.NoError(t, err) + + // can get the latest block + _, err = client.EthGetBlockByNumber(ctx, latest.Hex(), true) + require.NoError(t, err) + + // fail to get a future block + _, err = client.EthGetBlockByNumber(ctx, (latest + 10000).Hex(), true) + require.Error(t, err) + + // inject 10 null rounds + bms[0].InjectNulls(10) + + // wait until we produce blocks again + tctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + ch, err := client.ChainNotify(tctx) + require.NoError(t, err) + <-ch // current + hc := <-ch // wait for next block + require.Equal(t, store.HCApply, hc[0].Type) + + afterNullHeight := hc[0].Val.Height() + + // Fail when trying to fetch a null round. + _, err = client.EthGetBlockByNumber(ctx, (ethtypes.EthUint64(afterNullHeight - 1)).Hex(), true) + require.Error(t, err) + + // Fetch balance on a null round; should not fail and should return previous balance. + // Should be lower than original balance. + bal, err := client.EthGetBalance(ctx, ethAddr, (ethtypes.EthUint64(afterNullHeight - 1)).Hex()) + require.NoError(t, err) + require.NotEqual(t, big.Zero(), bal) + require.Equal(t, types.FromFil(10).Int, bal.Int) +} + func deployContractTx(ctx context.Context, client *kit.TestFullNode, ethAddr ethtypes.EthAddress, contract []byte) (*ethtypes.EthTxArgs, error) { gaslimit, err := client.EthEstimateGas(ctx, ethtypes.EthCall{ From: ðAddr, diff --git a/itests/fevm_test.go b/itests/fevm_test.go index 2b2a3a6d38..3d61033612 100644 --- a/itests/fevm_test.go +++ b/itests/fevm_test.go @@ -265,6 +265,20 @@ func TestFEVMDelegateCall(t *testing.T) { expectedResultActor, err := hex.DecodeString("0000000000000000000000000000000000000000000000000000000000000000") require.NoError(t, err) require.Equal(t, result, expectedResultActor) + + // The implementation's storage should not have been updated. + actorAddrEth, err := ethtypes.EthAddressFromFilecoinAddress(actorAddr) + require.NoError(t, err) + value, err := client.EVM().EthGetStorageAt(ctx, actorAddrEth, nil, "latest") + require.NoError(t, err) + require.Equal(t, ethtypes.EthBytes(make([]byte, 32)), value) + + // The storage actor's storage _should_ have been updated + storageAddrEth, err := ethtypes.EthAddressFromFilecoinAddress(storageAddr) + require.NoError(t, err) + value, err = client.EVM().EthGetStorageAt(ctx, storageAddrEth, nil, "latest") + require.NoError(t, err) + require.Equal(t, ethtypes.EthBytes(expectedResult), value) } // TestFEVMDelegateCallRevert makes a delegatecall action and then calls revert. @@ -843,3 +857,190 @@ func TestFEVMBareTransferTriggersSmartContractLogic(t *testing.T) { // The receive() function emits one log, that's how we know we hit it. require.Len(t, receipt.Logs, 1) } + +// This test ensures that we can deploy new contracts from a solidity call to `transfer` without +// exceeding the 10M gas limit. +func TestFEVMTestDeployOnTransfer(t *testing.T) { + ctx, cancel, client := kit.SetupFEVMTest(t) + defer cancel() + + fromAddr := client.DefaultKey.Address + t.Log("from - ", fromAddr) + + //create contract A + filenameStorage := "contracts/ValueSender.hex" + fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameStorage) + + //send to some random address. + params := [32]byte{} + params[30] = 0xff + randomAddr, err := ethtypes.CastEthAddress(params[12:]) + value := big.NewInt(100) + entryPoint := kit.CalcFuncSignature("sendEthToB(address)") + require.NoError(t, err) + ret, err := client.EVM().InvokeSolidityWithValue(ctx, fromAddr, contractAddr, entryPoint, params[:], value) + require.NoError(t, err) + require.True(t, ret.Receipt.ExitCode.IsSuccess()) + + balance, err := client.EVM().EthGetBalance(ctx, randomAddr, "latest") + require.NoError(t, err) + require.Equal(t, value.Int, balance.Int) + + filAddr, err := randomAddr.ToFilecoinAddress() + require.NoError(t, err) + client.AssertActorType(ctx, filAddr, manifest.PlaceholderKey) +} + +func TestFEVMProxyUpgradeable(t *testing.T) { + ctx, cancel, client := kit.SetupFEVMTest(t) + defer cancel() + + //install transparently upgradeable proxy + proxyFilename := "contracts/TransparentUpgradeableProxy.hex" + fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, proxyFilename) + + _, _, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "test()", []byte{}) + require.NoError(t, err) +} + +func TestFEVMGetBlockDifficulty(t *testing.T) { + ctx, cancel, client := kit.SetupFEVMTest(t) + defer cancel() + + //install contract + filenameActor := "contracts/GetDifficulty.hex" + fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor) + + ret, _, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getDifficulty()", []byte{}) + require.NoError(t, err) + require.Equal(t, len(ret), 32) +} + +func TestFEVMTestCorrectChainID(t *testing.T) { + ctx, cancel, client := kit.SetupFEVMTest(t) + defer cancel() + + //install contract + filenameActor := "contracts/Blocktest.hex" + fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor) + + //run test + _, _, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "testChainID()", []byte{}) + require.NoError(t, err) +} + +func TestFEVMGetChainPropertiesBlockTimestamp(t *testing.T) { + ctx, cancel, client := kit.SetupFEVMTest(t) + defer cancel() + + //install contract + filenameActor := "contracts/Blocktest.hex" + fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor) + + // block number check + ret, wait, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getTimestamp()", []byte{}) + require.NoError(t, err) + + timestampFromSolidity, err := decodeOutputToUint64(ret) + require.NoError(t, err) + + ethBlock := client.EVM().GetEthBlockFromWait(ctx, wait) + + require.Equal(t, ethBlock.Timestamp, ethtypes.EthUint64(timestampFromSolidity)) +} + +func TestFEVMGetChainPropertiesBlockNumber(t *testing.T) { + ctx, cancel, client := kit.SetupFEVMTest(t) + defer cancel() + + //install contract + filenameActor := "contracts/Blocktest.hex" + fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor) + + // block number check + ret, wait, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getBlockNumber()", []byte{}) + require.NoError(t, err) + + blockHeightFromSolidity, err := decodeOutputToUint64(ret) + require.NoError(t, err) + + ethBlock := client.EVM().GetEthBlockFromWait(ctx, wait) + + require.Equal(t, ethBlock.Number, ethtypes.EthUint64(blockHeightFromSolidity)) +} + +func TestFEVMGetChainPropertiesBlockHash(t *testing.T) { + ctx, cancel, client := kit.SetupFEVMTest(t) + defer cancel() + + //install contract + filenameActor := "contracts/Blocktest.hex" + fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor) + + //block hash check + ret, wait, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getBlockhashPrevious()", []byte{}) + expectedBlockHash := hex.EncodeToString(ret) + require.NoError(t, err) + + ethBlock := client.EVM().GetEthBlockFromWait(ctx, wait) + //in solidity we get the parent block hash because the current block hash doesnt exist at that execution context yet + //so we compare the parent hash here in the test + require.Equal(t, "0x"+expectedBlockHash, ethBlock.ParentHash.String()) +} + +func TestFEVMGetChainPropertiesBaseFee(t *testing.T) { + ctx, cancel, client := kit.SetupFEVMTest(t) + defer cancel() + + //install contract + filenameActor := "contracts/Blocktest.hex" + fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor) + + ret, wait, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getBasefee()", []byte{}) + require.NoError(t, err) + baseFeeRet, err := decodeOutputToUint64(ret) + require.NoError(t, err) + + ethBlock := client.EVM().GetEthBlockFromWait(ctx, wait) + + require.Equal(t, ethBlock.BaseFeePerGas, ethtypes.EthBigInt(big.NewInt(int64(baseFeeRet)))) +} + +func TestFEVMErrorParsing(t *testing.T) { + ctx, cancel, client := kit.SetupFEVMTest(t) + defer cancel() + + e := client.EVM() + + _, contractAddr := e.DeployContractFromFilename(ctx, "contracts/Errors.hex") + contractAddrEth, err := ethtypes.EthAddressFromFilecoinAddress(contractAddr) + require.NoError(t, err) + customError := ethtypes.EthBytes(kit.CalcFuncSignature("CustomError()")).String() + for sig, expected := range map[string]string{ + "failRevertEmpty()": "none", + "failRevertReason()": "Error(my reason)", + "failAssert()": "Assert()", + "failDivZero()": "DivideByZero()", + "failCustom()": customError, + } { + sig := sig + expected := fmt.Sprintf("exit 33, revert reason: %s, vm error", expected) + t.Run(sig, func(t *testing.T) { + entryPoint := kit.CalcFuncSignature(sig) + t.Run("EthCall", func(t *testing.T) { + _, err := e.EthCall(ctx, ethtypes.EthCall{ + To: &contractAddrEth, + Data: entryPoint, + }, "latest") + require.ErrorContains(t, err, expected) + }) + t.Run("EthEstimateGas", func(t *testing.T) { + _, err := e.EthEstimateGas(ctx, ethtypes.EthCall{ + To: &contractAddrEth, + Data: entryPoint, + }) + require.ErrorContains(t, err, expected) + }) + }) + } +} diff --git a/itests/ipc_test.go b/itests/ipc_test.go index ef060f64af..005315755c 100644 --- a/itests/ipc_test.go +++ b/itests/ipc_test.go @@ -71,6 +71,7 @@ func TestIPCAccessors(t *testing.T) { actorAddr, err := api.IPCAddSubnetActor(ctx, src, params) require.NoError(t, err) sn, err := sdk.NewSubnetIDFromString("/root/" + actorAddr.String()) + require.NoError(t, err) JoinSubnet(t, ctx, api, src, actorAddr) c, err := abi.CidBuilder.Sum([]byte("genesis")) diff --git a/itests/kit/blockminer.go b/itests/kit/blockminer.go index 9dd83ee470..4cd0cc671c 100644 --- a/itests/kit/blockminer.go +++ b/itests/kit/blockminer.go @@ -192,12 +192,15 @@ func (bm *BlockMiner) MineBlocksMustPost(ctx context.Context, blocktime time.Dur reportSuccessFn := func(success bool, epoch abi.ChainEpoch, err error) { // if api shuts down before mining, we may get an error which we should probably just ignore // (fixing it will require rewriting most of the mining loop) - if err != nil && !strings.Contains(err.Error(), "websocket connection closed") && !api.ErrorIsIn(err, []error{new(jsonrpc.RPCConnectionError)}) { + if err != nil && ctx.Err() == nil && !strings.Contains(err.Error(), "websocket connection closed") && !api.ErrorIsIn(err, []error{new(jsonrpc.RPCConnectionError)}) { require.NoError(bm.t, err) } target = epoch - wait <- success + select { + case wait <- success: + case <-ctx.Done(): + } } var success bool diff --git a/itests/kit/client.go b/itests/kit/client.go index f29fecfebb..134b6b1ceb 100644 --- a/itests/kit/client.go +++ b/itests/kit/client.go @@ -3,7 +3,6 @@ package kit import ( "context" "fmt" - "io/ioutil" "math/rand" "os" "path/filepath" @@ -110,7 +109,7 @@ func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode *TestFullNode) // Retrieve the first file from the Miner // client retrieve - tmpdir, err := ioutil.TempDir(os.TempDir(), "test-cli-client") + tmpdir, err := os.MkdirTemp(os.TempDir(), "test-cli-client") require.NoError(t, err) path := filepath.Join(tmpdir, "outfile.dat") @@ -144,13 +143,13 @@ func createRandomFile(rseed, size int) ([]byte, string, error) { data := make([]byte, size) rand.New(rand.NewSource(int64(rseed))).Read(data) - dir, err := ioutil.TempDir(os.TempDir(), "test-make-deal-") + dir, err := os.MkdirTemp(os.TempDir(), "test-make-deal-") if err != nil { return nil, "", err } path := filepath.Join(dir, "sourcefile.dat") - err = ioutil.WriteFile(path, data, 0644) + err = os.WriteFile(path, data, 0644) if err != nil { return nil, "", err } diff --git a/itests/kit/deals.go b/itests/kit/deals.go index 1f3a7dfb59..39b7857d75 100644 --- a/itests/kit/deals.go +++ b/itests/kit/deals.go @@ -10,8 +10,8 @@ import ( "time" "github.com/ipfs/go-cid" - files "github.com/ipfs/go-ipfs-files" ipld "github.com/ipfs/go-ipld-format" + "github.com/ipfs/go-libipfs/files" dag "github.com/ipfs/go-merkledag" dstest "github.com/ipfs/go-merkledag/test" unixfile "github.com/ipfs/go-unixfs/file" diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index 961e2b0a51..42764d273d 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -6,13 +6,17 @@ import ( "crypto/rand" "encoding/binary" "fmt" - "io/ioutil" "net" "net/http" + "os" + "os/signal" "sync" + "syscall" "testing" "time" + ipctypes "github.com/consensus-shipyard/go-ipc-types/sdk" + "github.com/consensus-shipyard/go-ipc-types/validator" "github.com/google/uuid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" @@ -24,9 +28,6 @@ import ( "golang.org/x/sync/errgroup" "golang.org/x/xerrors" - ipctypes "github.com/consensus-shipyard/go-ipc-types/sdk" - "github.com/consensus-shipyard/go-ipc-types/validator" - "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/go-state-types/abi" @@ -35,6 +36,10 @@ import ( "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/go-statestore" + mapi "github.com/filecoin-project/mir" + miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" + power3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/power" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v1api" "github.com/filecoin-project/lotus/build" @@ -70,9 +75,6 @@ import ( sectorstorage "github.com/filecoin-project/lotus/storage/sealer" "github.com/filecoin-project/lotus/storage/sealer/mock" "github.com/filecoin-project/lotus/storage/sealer/storiface" - mapi "github.com/filecoin-project/mir" - miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" - power3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/power" ) func init() { @@ -247,7 +249,7 @@ func (n *Ensemble) MinerEnroll(minerNode *TestMiner, full *TestFullNode, opts .. peerId, err := peer.IDFromPrivateKey(privkey) require.NoError(n.t, err) - tdir, err := ioutil.TempDir("", "preseal-memgen") + tdir, err := os.MkdirTemp("", "preseal-memgen") require.NoError(n.t, err) minerCnt := len(n.inactive.miners) + len(n.active.miners) @@ -349,6 +351,8 @@ func (n *Ensemble) Worker(minerNode *TestMiner, worker *TestWorker, opts ...Node MinerNode: minerNode, RemoteListener: rl, options: options, + + Stop: func(ctx context.Context) error { return nil }, } n.inactive.workers = append(n.inactive.workers, worker) @@ -368,6 +372,13 @@ func (n *Ensemble) Start() *Ensemble { n.mn = mocknet.New() } + go func() { + sigCh := make(chan os.Signal) + signal.Notify(sigCh, syscall.SIGINT) + <-sigCh + os.Exit(1) + }() + // --------------------- // FULL NODES // --------------------- @@ -478,8 +489,6 @@ func (n *Ensemble) Start() *Ensemble { return stopErr } - node.MonitorShutdown(shutdownChan, node.ShutdownHandler{Component: "node", StopFunc: stopFunc}) - // Are we hitting this node through its RPC? if full.options.rpc { withRPC, rpcCloser := fullRpc(n.t, full) @@ -488,6 +497,7 @@ func (n *Ensemble) Start() *Ensemble { rpcShutdownOnce.Do(rpcCloser) return stop(ctx) } + n.t.Cleanup(func() { rpcShutdownOnce.Do(rpcCloser) }) } diff --git a/itests/kit/evm.go b/itests/kit/evm.go index 216a7f1f3c..c8904ab15c 100644 --- a/itests/kit/evm.go +++ b/itests/kit/evm.go @@ -64,7 +64,7 @@ func (e *EVM) DeployContractWithValue(ctx context.Context, sender address.Addres require.NoError(err) e.t.Log("waiting for message to execute") - wait, err := e.StateWaitMsg(ctx, smsg.Cid(), 0, 0, false) + wait, err := e.StateWaitMsg(ctx, smsg.Cid(), 3, 0, false) require.NoError(err) require.True(wait.Receipt.ExitCode.IsSuccess(), "contract installation failed") @@ -104,6 +104,10 @@ func (e *EVM) DeployContractFromFilename(ctx context.Context, binFilename string } func (e *EVM) InvokeSolidity(ctx context.Context, sender address.Address, target address.Address, selector []byte, inputData []byte) (*api.MsgLookup, error) { + return e.InvokeSolidityWithValue(ctx, sender, target, selector, inputData, big.Zero()) +} + +func (e *EVM) InvokeSolidityWithValue(ctx context.Context, sender address.Address, target address.Address, selector []byte, inputData []byte, value big.Int) (*api.MsgLookup, error) { params := append(selector, inputData...) var buffer bytes.Buffer err := cbg.WriteByteArray(&buffer, params) @@ -115,7 +119,7 @@ func (e *EVM) InvokeSolidity(ctx context.Context, sender address.Address, target msg := &types.Message{ To: target, From: sender, - Value: big.Zero(), + Value: value, Method: builtintypes.MethodsEVM.InvokeContract, GasLimit: build.BlockGasLimit, // note: we hardcode block gas limit due to slightly broken gas estimation - https://github.com/filecoin-project/lotus/issues/10041 Params: params, @@ -128,7 +132,7 @@ func (e *EVM) InvokeSolidity(ctx context.Context, sender address.Address, target } e.t.Log("waiting for message to execute") - wait, err := e.StateWaitMsg(ctx, smsg.Cid(), 0, 0, false) + wait, err := e.StateWaitMsg(ctx, smsg.Cid(), 3, 0, false) if err != nil { return nil, err } @@ -247,6 +251,22 @@ func (e *EVM) ComputeContractAddress(deployer ethtypes.EthAddress, nonce uint64) return *(*ethtypes.EthAddress)(hasher.Sum(nil)[12:]) } +// return eth block from a wait return +// this necessarily goes back one parent in the chain because wait is one block ahead of execution +func (e *EVM) GetEthBlockFromWait(ctx context.Context, wait *api.MsgLookup) ethtypes.EthBlock { + c, err := wait.TipSet.Cid() + require.NoError(e.t, err) + hash, err := ethtypes.EthHashFromCid(c) + require.NoError(e.t, err) + + ethBlockParent, err := e.EthGetBlockByHash(ctx, hash, true) + require.NoError(e.t, err) + ethBlock, err := e.EthGetBlockByHash(ctx, ethBlockParent.ParentHash, true) + require.NoError(e.t, err) + + return ethBlock +} + func (e *EVM) InvokeContractByFuncName(ctx context.Context, fromAddr address.Address, idAddr address.Address, funcSignature string, inputData []byte) ([]byte, *api.MsgLookup, error) { entryPoint := CalcFuncSignature(funcSignature) wait, err := e.InvokeSolidity(ctx, fromAddr, idAddr, entryPoint, inputData) diff --git a/itests/kit/files.go b/itests/kit/files.go index 3fa8a5f4d1..dbf7d2cd78 100644 --- a/itests/kit/files.go +++ b/itests/kit/files.go @@ -17,8 +17,8 @@ import ( bstore "github.com/ipfs/go-ipfs-blockstore" chunk "github.com/ipfs/go-ipfs-chunker" offline "github.com/ipfs/go-ipfs-exchange-offline" - files "github.com/ipfs/go-ipfs-files" ipldformat "github.com/ipfs/go-ipld-format" + "github.com/ipfs/go-libipfs/files" "github.com/ipfs/go-merkledag" "github.com/ipfs/go-unixfs/importer/balanced" ihelper "github.com/ipfs/go-unixfs/importer/helpers" diff --git a/itests/kit/mir_tools.go b/itests/kit/mir_tools.go index 50dfd28c36..c3a8a44c30 100644 --- a/itests/kit/mir_tools.go +++ b/itests/kit/mir_tools.go @@ -17,6 +17,7 @@ import ( "golang.org/x/sync/errgroup" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/lotus/api/v1api" "github.com/filecoin-project/lotus/chain/consensus/mir" "github.com/filecoin-project/lotus/chain/consensus/mir/membership" diff --git a/itests/kit/mir_validator.go b/itests/kit/mir_validator.go index 4c417576ae..02d9f007df 100644 --- a/itests/kit/mir_validator.go +++ b/itests/kit/mir_validator.go @@ -11,12 +11,13 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/chain/consensus/mir" - "github.com/filecoin-project/lotus/chain/consensus/mir/db" - "github.com/filecoin-project/lotus/chain/consensus/mir/membership" mirlibp2pnet "github.com/filecoin-project/mir/pkg/net" mirlibp2p "github.com/filecoin-project/mir/pkg/net/libp2p" mirtypes "github.com/filecoin-project/mir/pkg/types" + + "github.com/filecoin-project/lotus/chain/consensus/mir" + "github.com/filecoin-project/lotus/chain/consensus/mir/db" + "github.com/filecoin-project/lotus/chain/consensus/mir/membership" ) type MirConfig struct { diff --git a/itests/kit/node_full.go b/itests/kit/node_full.go index 6ad8ade2ff..bd9fd3a6a2 100644 --- a/itests/kit/node_full.go +++ b/itests/kit/node_full.go @@ -181,6 +181,38 @@ func (f *TestFullNode) ExpectSend(ctx context.Context, from, to address.Address, return nil } +// ChainPredicate encapsulates a chain condition. +type ChainPredicate func(set *types.TipSet) bool + +// HeightAtLeast returns a ChainPredicate that is satisfied when the chain +// height is equal or higher to the target. +func HeightAtLeast(target abi.ChainEpoch) ChainPredicate { + return func(ts *types.TipSet) bool { + return ts.Height() >= target + } +} + +// BlocksMinedByAll returns a ChainPredicate that is satisfied when we observe a +// tipset including blocks from all the specified miners, in no particular order. +func BlocksMinedByAll(miner ...address.Address) ChainPredicate { + return func(ts *types.TipSet) bool { + seen := make([]bool, len(miner)) + var done int + for _, b := range ts.Blocks() { + for i, m := range miner { + if b.Miner != m || seen[i] { + continue + } + seen[i] = true + if done++; done == len(miner) { + return true + } + } + } + return false + } +} + func (f *TestFullNode) IsSyncedWith(ctx context.Context, from abi.ChainEpoch, nodes ...*TestFullNode) (abi.ChainEpoch, error) { if len(nodes) < 1 { return 0, fmt.Errorf("no checked nodes") @@ -281,35 +313,3 @@ func (f *TestFullNode) waitForTipSet(ctx context.Context, height abi.ChainEpoch, } } } - -// ChainPredicate encapsulates a chain condition. -type ChainPredicate func(set *types.TipSet) bool - -// HeightAtLeast returns a ChainPredicate that is satisfied when the chain -// height is equal or higher to the target. -func HeightAtLeast(target abi.ChainEpoch) ChainPredicate { - return func(ts *types.TipSet) bool { - return ts.Height() >= target - } -} - -// BlocksMinedByAll returns a ChainPredicate that is satisfied when we observe a -// tipset including blocks from all the specified miners, in no particular order. -func BlocksMinedByAll(miner ...address.Address) ChainPredicate { - return func(ts *types.TipSet) bool { - seen := make([]bool, len(miner)) - var done int - for _, b := range ts.Blocks() { - for i, m := range miner { - if b.Miner != m || seen[i] { - continue - } - seen[i] = true - if done++; done == len(miner) { - return true - } - } - } - return false - } -} diff --git a/itests/kit/node_miner.go b/itests/kit/node_miner.go index a5f3d5acac..4b81c9df0b 100644 --- a/itests/kit/node_miner.go +++ b/itests/kit/node_miner.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "net" "os" "path/filepath" @@ -21,6 +20,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/wallet/key" @@ -203,7 +203,7 @@ func (tm *TestMiner) AddStorage(ctx context.Context, t *testing.T, conf func(*st b, err := json.MarshalIndent(cfg, "", " ") require.NoError(t, err) - err = ioutil.WriteFile(filepath.Join(p, metaFile), b, 0644) + err = os.WriteFile(filepath.Join(p, metaFile), b, 0644) require.NoError(t, err) err = tm.StorageAddLocal(ctx, p) diff --git a/itests/kit/node_validator.go b/itests/kit/node_validator.go index 338bd08d25..73d5e6df5f 100644 --- a/itests/kit/node_validator.go +++ b/itests/kit/node_validator.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/require" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/lotus/chain/consensus/mir/db" "github.com/filecoin-project/lotus/chain/types" ) diff --git a/itests/kit/node_worker.go b/itests/kit/node_worker.go index ac200fb0fb..3674763ed8 100644 --- a/itests/kit/node_worker.go +++ b/itests/kit/node_worker.go @@ -3,7 +3,6 @@ package kit import ( "context" "encoding/json" - "io/ioutil" "net" "net/http" "os" @@ -67,7 +66,7 @@ func (tm *TestWorker) AddStorage(ctx context.Context, t *testing.T, conf func(*s b, err := json.MarshalIndent(cfg, "", " ") require.NoError(t, err) - err = ioutil.WriteFile(filepath.Join(p, metaFile), b, 0644) + err = os.WriteFile(filepath.Join(p, metaFile), b, 0644) require.NoError(t, err) err = tm.StorageAddLocal(ctx, p) diff --git a/itests/kit/rpc.go b/itests/kit/rpc.go index 5d40ac3e96..6b63eb1ebf 100644 --- a/itests/kit/rpc.go +++ b/itests/kit/rpc.go @@ -96,6 +96,12 @@ func workerRpc(t *testing.T, m *TestWorker) *TestWorker { require.NoError(t, err) t.Cleanup(stop) + m.Stop = func(ctx context.Context) error { + srv.Close() + srv.CloseClientConnections() + return nil + } + m.ListenAddr, m.Worker = maddr, cl return m } diff --git a/itests/mir_test.go b/itests/mir_test.go index 828f8e778a..d86a650783 100644 --- a/itests/mir_test.go +++ b/itests/mir_test.go @@ -16,13 +16,13 @@ import ( "testing" "time" + "github.com/consensus-shipyard/go-ipc-types/validator" "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" "golang.org/x/sync/errgroup" - "github.com/consensus-shipyard/go-ipc-types/validator" - "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/lotus/chain/consensus/mir" mb "github.com/filecoin-project/lotus/chain/consensus/mir/membership" "github.com/filecoin-project/lotus/chain/types" @@ -1018,7 +1018,7 @@ func TestMirBasic_AllNodesMiningWithMessaging(t *testing.T) { err = kit.AdvanceChain(ctx, TestedBlockNumber, nodes...) require.NoError(t, err) - from, err = nodes[0].IsSyncedWith(ctx, from, nodes[1:]...) + _, err = nodes[0].IsSyncedWith(ctx, from, nodes[1:]...) require.NoError(t, err) for _, id := range cids { diff --git a/itests/net_test.go b/itests/net_test.go index 43524a51bf..2ee8f60b9c 100644 --- a/itests/net_test.go +++ b/itests/net_test.go @@ -21,7 +21,7 @@ func TestNetConn(t *testing.T) { firstNode, secondNode, _, _ := kit.EnsembleTwoOne(t) - //stm: @NETWORK_COMMON_ID_001 + // stm: @NETWORK_COMMON_ID_001 secondNodeID, err := secondNode.ID(ctx) require.NoError(t, err) @@ -31,21 +31,21 @@ func TestNetConn(t *testing.T) { t.Errorf("node should be not connected to peers. %s", err.Error()) } - //stm: @NETWORK_COMMON_ADDRS_LISTEN_001 + // stm: @NETWORK_COMMON_ADDRS_LISTEN_001 addrInfo, err := secondNode.NetAddrsListen(ctx) require.NoError(t, err) - //stm: @NETWORK_COMMON_CONNECT_001 + // stm: @NETWORK_COMMON_CONNECT_001 err = firstNode.NetConnect(ctx, addrInfo) if err != nil { t.Errorf("nodes failed to connect. %s", err.Error()) } - //stm: @NETWORK_COMMON_PEER_INFO_001 + // stm: @NETWORK_COMMON_PEER_INFO_001 netPeerInfo, err := firstNode.NetPeerInfo(ctx, secondNodeID) require.NoError(t, err) - //stm: @NETWORK_COMMON_AGENT_VERSION_001 + // stm: @NETWORK_COMMON_AGENT_VERSION_001 agent, err := firstNode.NetAgentVersion(ctx, secondNodeID) require.NoError(t, err) @@ -53,7 +53,7 @@ func TestNetConn(t *testing.T) { t.Errorf("agents not matching. %s", err.Error()) } - //stm: @NETWORK_COMMON_FIND_PEER_001 + // stm: @NETWORK_COMMON_FIND_PEER_001 secondNodePeer, err := firstNode.NetFindPeer(ctx, secondNodeID) require.NoError(t, err) @@ -67,12 +67,12 @@ func TestNetConn(t *testing.T) { t.Errorf("peer does not have connected state") } - //stm: @NETWORK_COMMON_PEERS_001 + // stm: @NETWORK_COMMON_PEERS_001 addrs, err := firstNode.NetPeers(ctx) require.NoError(t, err) require.NotEqual(t, 0, len(addrs)) - //stm: @NETWORK_COMMON_DISCONNECT_001 + // stm: @NETWORK_COMMON_DISCONNECT_001 err = firstNode.NetDisconnect(ctx, secondNodeID) if err != nil { t.Errorf("nodes failed to disconnect. %s", err.Error()) @@ -84,7 +84,7 @@ func TestNetConn(t *testing.T) { t.Errorf("peer should have disconnected") } - //stm: @NETWORK_COMMON_PEERS_001 + // stm: @NETWORK_COMMON_PEERS_001 addrs, err = firstNode.NetPeers(ctx) require.NoError(t, err) @@ -120,13 +120,13 @@ func TestNetStat(t *testing.T) { } } - //stm: @NETWORK_COMMON_STAT_001 + // stm: @NETWORK_COMMON_STAT_001 t.Run("all", withScope(t, "all")) - //stm: @NETWORK_COMMON_STAT_002 + // stm: @NETWORK_COMMON_STAT_002 t.Run("system", withScope(t, "system")) - //stm: @NETWORK_COMMON_STAT_003 + // stm: @NETWORK_COMMON_STAT_003 t.Run("transient", withScope(t, "transient")) - //stm: @NETWORK_COMMON_STAT_004 + // stm: @NETWORK_COMMON_STAT_004 t.Run("peer", withScope(t, fmt.Sprintf("peer:%s", sId))) } @@ -145,11 +145,11 @@ func TestNetLimit(t *testing.T) { } } - //stm: @NETWORK_COMMON_LIMIT_001 + // stm: @NETWORK_COMMON_LIMIT_001 t.Run("system", withScope(t, "system")) - //stm: @NETWORK_COMMON_LIMIT_002 + // stm: @NETWORK_COMMON_LIMIT_002 t.Run("transient", withScope(t, "transient")) - //stm: @NETWORK_COMMON_LIMIT_003 + // stm: @NETWORK_COMMON_LIMIT_003 t.Run("peer", withScope(t, fmt.Sprintf("peer:%s", sId))) } @@ -158,7 +158,7 @@ func TestNetBlockPeer(t *testing.T) { firstNode, secondNode, _, _ := kit.EnsembleTwoOne(t) - //stm: @NETWORK_COMMON_ID_001 + // stm: @NETWORK_COMMON_ID_001 firstAddrInfo, _ := firstNode.NetAddrsListen(ctx) firstNodeID, err := firstNode.ID(ctx) require.NoError(t, err) @@ -170,11 +170,11 @@ func TestNetBlockPeer(t *testing.T) { require.NoError(t, err, "failed to determine connectedness") require.NotEqual(t, connectedness, network.Connected, "shouldn't already be connected") - //stm: @NETWORK_COMMON_BLOCK_ADD_001 + // stm: @NETWORK_COMMON_BLOCK_ADD_001 err = firstNode.NetBlockAdd(ctx, api.NetBlockList{Peers: []peer.ID{secondNodeID}}) require.NoError(t, err) - //stm: @NETWORK_COMMON_BLOCK_LIST_001 + // stm: @NETWORK_COMMON_BLOCK_LIST_001 list, err := firstNode.NetBlockList(ctx) require.NoError(t, err) @@ -182,16 +182,22 @@ func TestNetBlockPeer(t *testing.T) { t.Errorf("blocked peer not in blocked peer list") } - require.Error(t, secondNode.NetConnect(ctx, firstAddrInfo), "shouldn't be able to connect to second node") - connectedness, err = secondNode.NetConnectedness(ctx, firstAddrInfo.ID) + err = secondNode.NetConnect(ctx, firstAddrInfo) + // With early muxer selection, we'll only learn that the handshake failed + // when we do something with the connection, for example when we open a stream. + if err == nil { + _, err = secondNode.NetPing(context.Background(), firstAddrInfo.ID) + } + require.Error(t, err, "shouldn't be able to connect to second node") + connectedness, err = firstNode.NetConnectedness(ctx, secondNodeID) require.NoError(t, err, "failed to determine connectedness") require.NotEqual(t, connectedness, network.Connected) - //stm: @NETWORK_COMMON_BLOCK_REMOVE_001 + // stm: @NETWORK_COMMON_BLOCK_REMOVE_001 err = firstNode.NetBlockRemove(ctx, api.NetBlockList{Peers: []peer.ID{secondNodeID}}) require.NoError(t, err) - //stm: @NETWORK_COMMON_BLOCK_LIST_001 + // stm: @NETWORK_COMMON_BLOCK_LIST_001 list, err = firstNode.NetBlockList(ctx) require.NoError(t, err) @@ -210,7 +216,7 @@ func TestNetBlockIPAddr(t *testing.T) { firstNode, secondNode, _, _ := kit.EnsembleTwoOne(t) - //stm: @NETWORK_COMMON_ADDRS_LISTEN_001 + // stm: @NETWORK_COMMON_ADDRS_LISTEN_001 firstAddrInfo, _ := firstNode.NetAddrsListen(ctx) secondAddrInfo, _ := secondNode.NetAddrsListen(ctx) @@ -229,11 +235,11 @@ func TestNetBlockIPAddr(t *testing.T) { require.NoError(t, err, "failed to determine connectedness") require.NotEqual(t, connectedness, network.Connected, "shouldn't already be connected") - //stm: @NETWORK_COMMON_BLOCK_ADD_001 + // stm: @NETWORK_COMMON_BLOCK_ADD_001 require.NoError(t, firstNode.NetBlockAdd(ctx, api.NetBlockList{ IPAddrs: secondNodeIPs}), "failed to add blocked IPs") - //stm: @NETWORK_COMMON_BLOCK_LIST_001 + // stm: @NETWORK_COMMON_BLOCK_LIST_001 list, err := firstNode.NetBlockList(ctx) require.NoError(t, err) @@ -255,11 +261,11 @@ func TestNetBlockIPAddr(t *testing.T) { require.NoError(t, err, "failed to determine connectedness") require.NotEqual(t, connectedness, network.Connected) - //stm: @NETWORK_COMMON_BLOCK_REMOVE_001 + // stm: @NETWORK_COMMON_BLOCK_REMOVE_001 err = firstNode.NetBlockRemove(ctx, api.NetBlockList{IPAddrs: secondNodeIPs}) require.NoError(t, err) - //stm: @NETWORK_COMMON_BLOCK_LIST_001 + // stm: @NETWORK_COMMON_BLOCK_LIST_001 list, err = firstNode.NetBlockList(ctx) require.NoError(t, err) @@ -274,7 +280,7 @@ func TestNetBlockIPAddr(t *testing.T) { } func getConnState(ctx context.Context, t *testing.T, node *kit.TestFullNode, peer peer.ID) network.Connectedness { - //stm: @NETWORK_COMMON_CONNECTEDNESS_001 + // stm: @NETWORK_COMMON_CONNECTEDNESS_001 connState, err := node.NetConnectedness(ctx, peer) require.NoError(t, err) diff --git a/itests/specs/eth_openrpc.json b/itests/specs/eth_openrpc.json index ed13614e99..0f354b5c75 100644 --- a/itests/specs/eth_openrpc.json +++ b/itests/specs/eth_openrpc.json @@ -178,7 +178,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -253,8 +253,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." @@ -285,7 +285,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -354,8 +354,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." @@ -649,7 +649,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -724,8 +724,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." @@ -756,7 +756,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -825,8 +825,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." @@ -1794,9 +1794,9 @@ "result": { "name": "Filter Identifier", "schema": { - "title": "hex encoded unsigned integer", + "title": "32 byte hex value", "type": "string", - "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + "pattern": "^0x[0-9a-f]{64}$" } } }, @@ -1807,9 +1807,9 @@ "result": { "name": "Filter Identifier", "schema": { - "title": "hex encoded unsigned integer", + "title": "32 byte hex value", "type": "string", - "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + "pattern": "^0x[0-9a-f]{64}$" } } }, @@ -1820,9 +1820,9 @@ "result": { "name": "Filter Identifier", "schema": { - "title": "hex encoded unsigned integer", + "title": "32 byte hex value", "type": "string", - "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + "pattern": "^0x[0-9a-f]{64}$" } } }, @@ -1833,9 +1833,9 @@ { "name": "Filter Identifier", "schema": { - "title": "hex encoded unsigned integer", + "title": "32 byte hex value", "type": "string", - "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + "pattern": "^0x[0-9a-f]{64}$" } } ], @@ -1853,9 +1853,9 @@ { "name": "Filter Identifier", "schema": { - "title": "hex encoded unsigned integer", + "title": "32 byte hex value", "type": "string", - "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + "pattern": "^0x[0-9a-f]{64}$" } } ], @@ -1954,9 +1954,9 @@ { "name": "Filter Identifier", "schema": { - "title": "hex encoded unsigned integer", + "title": "32 byte hex value", "type": "string", - "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$" + "pattern": "^0x[0-9a-f]{64}$" } } ], @@ -3009,7 +3009,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -3084,8 +3084,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." @@ -3116,7 +3116,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -3185,8 +3185,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." @@ -3359,7 +3359,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -3434,8 +3434,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." @@ -3466,7 +3466,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -3535,8 +3535,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." @@ -3726,7 +3726,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -3801,8 +3801,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." @@ -3833,7 +3833,7 @@ "s", "type", "value", - "yParity" + "v" ], "properties": { "type": { @@ -3902,8 +3902,8 @@ "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "Chain ID that this transaction is valid on." }, - "yParity": { - "title": "yParity", + "v": { + "title": "v", "type": "string", "pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$", "description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature." diff --git a/itests/worker_test.go b/itests/worker_test.go index b002660f1a..4e845afe8e 100644 --- a/itests/worker_test.go +++ b/itests/worker_test.go @@ -366,7 +366,7 @@ func TestWindowPostWorkerManualPoSt(t *testing.T) { sectors := 2 * 48 * 2 - client, miner, _, ens := kit.EnsembleWorker(t, + client, miner, _, _ := kit.EnsembleWorker(t, kit.PresealSectors(sectors), // 2 sectors per partition, 2 partitions in all 48 deadlines kit.LatestActorsAt(-1), kit.ThroughRPC(), @@ -378,17 +378,8 @@ func TestWindowPostWorkerManualPoSt(t *testing.T) { di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) - bm := ens.InterconnectAll().BeginMiningMustPost(2 * time.Millisecond)[0] - di = di.NextNotElapsed() - t.Log("Running one proving period") - waitUntil := di.Open + di.WPoStChallengeWindow*2 - 2 - client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil)) - - t.Log("Waiting for post message") - bm.Stop() - tryDl := func(dl uint64) { p, err := miner.ComputeWindowPoSt(ctx, dl, types.EmptyTSK) require.NoError(t, err) @@ -398,10 +389,48 @@ func TestWindowPostWorkerManualPoSt(t *testing.T) { tryDl(0) tryDl(40) tryDl(di.Index + 4) +} - lastPending, err := client.MpoolPending(ctx, types.EmptyTSK) +func TestWindowPostWorkerDisconnected(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + _ = logging.SetLogLevel("storageminer", "INFO") + + sectors := 2 * 48 * 2 + + _, miner, badWorker, ens := kit.EnsembleWorker(t, + kit.PresealSectors(sectors), // 2 sectors per partition, 2 partitions in all 48 deadlines + kit.LatestActorsAt(-1), + kit.ThroughRPC(), + kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTGenerateWindowPoSt})) + + var goodWorker kit.TestWorker + ens.Worker(miner, &goodWorker, kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTGenerateWindowPoSt}), kit.ThroughRPC()).Start() + + // wait for all workers + require.Eventually(t, func() bool { + w, err := miner.WorkerStats(ctx) + require.NoError(t, err) + return len(w) == 3 // 2 post + 1 miner-builtin + }, 10*time.Second, 100*time.Millisecond) + + tryDl := func(dl uint64) { + p, err := miner.ComputeWindowPoSt(ctx, dl, types.EmptyTSK) + require.NoError(t, err) + require.Len(t, p, 1) + require.Equal(t, dl, p[0].Deadline) + } + tryDl(0) // this will run on the not-yet-bad badWorker + + err := badWorker.Stop(ctx) require.NoError(t, err) - require.Len(t, lastPending, 0) + + tryDl(10) // will fail on the badWorker, then should retry on the goodWorker + + time.Sleep(15 * time.Second) + + tryDl(40) // after HeartbeatInterval, the badWorker should be marked as disabled } func TestSchedulerRemoveRequest(t *testing.T) { diff --git a/lib/backupds/backupds_test.go b/lib/backupds/backupds_test.go index b76799bfbb..8909a5f3bb 100644 --- a/lib/backupds/backupds_test.go +++ b/lib/backupds/backupds_test.go @@ -5,7 +5,6 @@ import ( "bytes" "context" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -77,7 +76,7 @@ func TestLogRestore(t *testing.T) { require.NoError(t, err) require.Equal(t, 1, len(fls)) - bf, err := ioutil.ReadFile(filepath.Join(logdir, fls[0].Name())) + bf, err := os.ReadFile(filepath.Join(logdir, fls[0].Name())) require.NoError(t, err) ds2 := datastore.NewMapDatastore() diff --git a/lib/consensus/raft/config.go b/lib/consensus/raft/config.go index 81bdb7fdc9..bdd82c1081 100644 --- a/lib/consensus/raft/config.go +++ b/lib/consensus/raft/config.go @@ -1,7 +1,7 @@ package consensus import ( - "io/ioutil" + "io" "path/filepath" "time" @@ -69,7 +69,7 @@ func DefaultClusterRaftConfig() *ClusterRaftConfig { cfg.RaftConfig.LocalID = "will_be_set_automatically" // Set up logging - cfg.RaftConfig.LogOutput = ioutil.Discard + cfg.RaftConfig.LogOutput = io.Discard return &cfg } @@ -91,7 +91,7 @@ func NewClusterRaftConfig(userRaftConfig *config.UserRaftConfig) *ClusterRaftCon cfg.RaftConfig.LocalID = "will_be_set_automatically" // Set up logging - cfg.RaftConfig.LogOutput = ioutil.Discard + cfg.RaftConfig.LogOutput = io.Discard return &cfg diff --git a/lib/consensus/raft/raft.go b/lib/consensus/raft/raft.go index 9cfd41a4ae..8ff93caf27 100644 --- a/lib/consensus/raft/raft.go +++ b/lib/consensus/raft/raft.go @@ -8,6 +8,7 @@ import ( "path/filepath" "time" + "github.com/hashicorp/go-hclog" hraft "github.com/hashicorp/raft" raftboltdb "github.com/hashicorp/raft-boltdb" "github.com/ipfs/go-log/v2" @@ -156,7 +157,7 @@ func (rw *raftWrapper) makeStores() error { snapstore, err := hraft.NewFileSnapshotStoreWithLogger( df, RaftMaxSnapshots, - zap.NewStdLog(log.Logger("raft-snapshot").SugaredLogger.Desugar()), + hclog.FromStandardLogger(zap.NewStdLog(log.Logger("raft-snapshot").SugaredLogger.Desugar()), hclog.DefaultOptions), ) if err != nil { return err diff --git a/lib/rpcenc/reader.go b/lib/rpcenc/reader.go index 64dcc4b497..2dd64473e7 100644 --- a/lib/rpcenc/reader.go +++ b/lib/rpcenc/reader.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net/http" "net/url" "path" @@ -158,7 +157,7 @@ func ReaderParamEncoder(addr string) jsonrpc.Option { } if resp.StatusCode != http.StatusOK { - b, _ := ioutil.ReadAll(resp.Body) + b, _ := io.ReadAll(resp.Body) log.Errorf("sending reader param (%s): non-200 status: %s, msg: '%s'", u.String(), resp.Status, string(b)) return } @@ -182,7 +181,7 @@ func ReaderParamEncoder(addr string) jsonrpc.Option { defer resp.Body.Close() //nolint if resp.StatusCode != http.StatusOK { - b, _ := ioutil.ReadAll(resp.Body) + b, _ := io.ReadAll(resp.Body) log.Errorf("sending reader param (%s): non-200 status: %s, msg: '%s'", u.String(), resp.Status, string(b)) return } @@ -221,7 +220,7 @@ type RpcReader struct { res chan readRes beginOnce *sync.Once - closeOnce sync.Once + closeOnce *sync.Once } var ErrHasBody = errors.New("RPCReader has body, either already read from or from a client with no redirect support") @@ -265,6 +264,7 @@ func (w *RpcReader) beginPost() { w.postBody = nr.postBody w.res = nr.res w.beginOnce = nr.beginOnce + w.closeOnce = nr.closeOnce } } @@ -355,6 +355,7 @@ func ReaderParamDecoder() (http.HandlerFunc, jsonrpc.ServerOption) { res: make(chan readRes), next: ch, beginOnce: &sync.Once{}, + closeOnce: &sync.Once{}, } switch req.Method { diff --git a/lib/rpcenc/reader_test.go b/lib/rpcenc/reader_test.go index da436068f1..3a554a0ca1 100644 --- a/lib/rpcenc/reader_test.go +++ b/lib/rpcenc/reader_test.go @@ -3,8 +3,8 @@ package rpcenc import ( "context" + "fmt" "io" - "io/ioutil" "net/http/httptest" "strings" "sync" @@ -77,7 +77,12 @@ func (h *ReaderHandler) CloseReader(ctx context.Context, r io.Reader) error { } func (h *ReaderHandler) ReadAll(ctx context.Context, r io.Reader) ([]byte, error) { - return ioutil.ReadAll(r) + b, err := io.ReadAll(r) + if err != nil { + return nil, xerrors.Errorf("readall: %w", err) + } + + return b, nil } func (h *ReaderHandler) ReadNullLen(ctx context.Context, r io.Reader) (int64, error) { @@ -219,9 +224,15 @@ func TestReaderRedirect(t *testing.T) { } func TestReaderRedirectDrop(t *testing.T) { + for i := 0; i < 10; i++ { + t.Run(fmt.Sprintf("test %d", i), testReaderRedirectDrop) + } +} + +func testReaderRedirectDrop(t *testing.T) { // lower timeout so that the dangling connection between client and reader is dropped quickly // after the test. Otherwise httptest.Close is blocked. - Timeout = 200 * time.Millisecond + Timeout = 90 * time.Millisecond var allClient struct { ReadAll func(ctx context.Context, r io.Reader) ([]byte, error) @@ -294,6 +305,8 @@ func TestReaderRedirectDrop(t *testing.T) { done.Wait() + fmt.Println("---------------------") + // Redir client drops before subcall done.Add(1) @@ -322,5 +335,9 @@ func TestReaderRedirectDrop(t *testing.T) { // wait for subcall to finish <-contCh - require.ErrorContains(t, allServerHandler.subErr, "decoding params for 'ReaderHandler.ReadAll' (param: 0; custom decoder): context canceled") + estr := allServerHandler.subErr.Error() + + require.True(t, + strings.Contains(estr, "decoding params for 'ReaderHandler.ReadAll' (param: 0; custom decoder): context canceled") || + strings.Contains(estr, "readall: unexpected EOF"), "unexpected error: %s", estr) } diff --git a/lib/unixfs/filestore.go b/lib/unixfs/filestore.go index 3a3da418d6..0a0b61c4ca 100644 --- a/lib/unixfs/filestore.go +++ b/lib/unixfs/filestore.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "github.com/ipfs/go-blockservice" @@ -13,8 +12,8 @@ import ( bstore "github.com/ipfs/go-ipfs-blockstore" chunker "github.com/ipfs/go-ipfs-chunker" offline "github.com/ipfs/go-ipfs-exchange-offline" - files "github.com/ipfs/go-ipfs-files" ipld "github.com/ipfs/go-ipld-format" + "github.com/ipfs/go-libipfs/files" "github.com/ipfs/go-merkledag" "github.com/ipfs/go-unixfs/importer/balanced" ihelper "github.com/ipfs/go-unixfs/importer/helpers" @@ -68,7 +67,7 @@ func CreateFilestore(ctx context.Context, srcPath string, dstPath string) (cid.C return cid.Undef, xerrors.Errorf("failed to create reader path file: %w", err) } - f, err := ioutil.TempFile("", "") + f, err := os.CreateTemp("", "") if err != nil { return cid.Undef, xerrors.Errorf("failed to create temp file: %w", err) } diff --git a/lib/unixfs/filestore_test.go b/lib/unixfs/filestore_test.go index 9fe6c228af..67d380701b 100644 --- a/lib/unixfs/filestore_test.go +++ b/lib/unixfs/filestore_test.go @@ -5,7 +5,6 @@ import ( "bytes" "context" "io" - "io/ioutil" "os" "strings" "testing" @@ -13,7 +12,7 @@ import ( "github.com/ipfs/go-blockservice" "github.com/ipfs/go-cid" offline "github.com/ipfs/go-ipfs-exchange-offline" - files "github.com/ipfs/go-ipfs-files" + "github.com/ipfs/go-libipfs/files" "github.com/ipfs/go-merkledag" unixfile "github.com/ipfs/go-unixfs/file" carv2 "github.com/ipld/go-car/v2" @@ -25,7 +24,7 @@ import ( // This test uses a full "dense" CARv2, and not a filestore (positional mapping). func TestRoundtripUnixFS_Dense(t *testing.T) { - //stm: @CLIENT_DATA_IMPORT_002 + // stm: @CLIENT_DATA_IMPORT_002 ctx := context.Background() inputPath, inputContents := genInputFile(t) @@ -67,14 +66,14 @@ func TestRoundtripUnixFS_Dense(t *testing.T) { // ensure contents of the initial input file and the output file are identical. fo, err := os.Open(tmpOutput) require.NoError(t, err) - bz2, err := ioutil.ReadAll(fo) + bz2, err := io.ReadAll(fo) require.NoError(t, err) require.NoError(t, fo.Close()) require.Equal(t, inputContents, bz2) } func TestRoundtripUnixFS_Filestore(t *testing.T) { - //stm: @CLIENT_DATA_IMPORT_001 + // stm: @CLIENT_DATA_IMPORT_001 ctx := context.Background() inputPath, inputContents := genInputFile(t) @@ -107,7 +106,7 @@ func TestRoundtripUnixFS_Filestore(t *testing.T) { // ensure contents of the initial input file and the output file are identical. fo, err := os.Open(tmpOutput) require.NoError(t, err) - bz2, err := ioutil.ReadAll(fo) + bz2, err := io.ReadAll(fo) require.NoError(t, err) require.NoError(t, fo.Close()) require.Equal(t, inputContents, bz2) diff --git a/markets/dagstore/mount_test.go b/markets/dagstore/mount_test.go index e044603d4f..d415f8d885 100644 --- a/markets/dagstore/mount_test.go +++ b/markets/dagstore/mount_test.go @@ -4,7 +4,6 @@ package dagstore import ( "context" "io" - "io/ioutil" "net/url" "strings" "testing" @@ -39,7 +38,7 @@ func TestLotusMount(t *testing.T) { io.ReaderAt io.Seeker }{ - ReadCloser: ioutil.NopCloser(strings.NewReader("testing")), + ReadCloser: io.NopCloser(strings.NewReader("testing")), ReaderAt: nil, Seeker: nil, } @@ -48,7 +47,7 @@ func TestLotusMount(t *testing.T) { io.ReaderAt io.Seeker }{ - ReadCloser: ioutil.NopCloser(strings.NewReader("testing")), + ReadCloser: io.NopCloser(strings.NewReader("testing")), ReaderAt: nil, Seeker: nil, } @@ -66,7 +65,7 @@ func TestLotusMount(t *testing.T) { rd, err := mnt.Fetch(context.Background()) require.NoError(t, err) - bz, err := ioutil.ReadAll(rd) + bz, err := io.ReadAll(rd) require.NoError(t, err) require.NoError(t, rd.Close()) require.Equal(t, []byte("testing"), bz) @@ -85,7 +84,7 @@ func TestLotusMount(t *testing.T) { // fetching on this mount should get us back the same data. rd, err = mnt2.Fetch(context.Background()) require.NoError(t, err) - bz, err = ioutil.ReadAll(rd) + bz, err = io.ReadAll(rd) require.NoError(t, err) require.NoError(t, rd.Close()) require.Equal(t, []byte("testing"), bz) diff --git a/markets/loggers/loggers.go b/markets/loggers/loggers.go index f522fb6ab5..e066c98439 100644 --- a/markets/loggers/loggers.go +++ b/markets/loggers/loggers.go @@ -3,7 +3,7 @@ package marketevents import ( logging "github.com/ipfs/go-log/v2" - datatransfer "github.com/filecoin-project/go-data-transfer" + 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" diff --git a/metrics/metrics.go b/metrics/metrics.go index 149195faff..ca638ac273 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -775,9 +775,10 @@ func SinceInMilliseconds(startTime time.Time) float64 { // Timer is a function stopwatch, calling it starts the timer, // calling the returned function will record the duration. -func Timer(ctx context.Context, m *stats.Float64Measure) func() { +func Timer(ctx context.Context, m *stats.Float64Measure) func() time.Duration { start := time.Now() - return func() { + return func() time.Duration { stats.Record(ctx, m.M(SinceInMilliseconds(start))) + return time.Since(start) } } diff --git a/miner/miner.go b/miner/miner.go index af3b8819b4..4b0134aba7 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -10,7 +10,7 @@ import ( "sync" "time" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" logging "github.com/ipfs/go-log/v2" "go.opencensus.io/trace" "golang.org/x/xerrors" @@ -62,7 +62,7 @@ func randTimeOffset(width time.Duration) time.Duration { // NewMiner instantiates a miner with a concrete WinningPoStProver and a miner // address (which can be different from the worker's address). func NewMiner(api v1api.FullNode, epp gen.WinningPoStProver, addr address.Address, sf *slashfilter.SlashFilter, j journal.Journal) *Miner { - arc, err := lru.NewARC(10000) + arc, err := lru.NewARC[abi.ChainEpoch, bool](10000) if err != nil { panic(err) } @@ -123,7 +123,7 @@ type Miner struct { // minedBlockHeights is a safeguard that caches the last heights we mined. // It is consulted before publishing a newly mined block, for a sanity check // intended to avoid slashings in case of a bug. - minedBlockHeights *lru.ARCCache + minedBlockHeights *lru.ARCCache[abi.ChainEpoch, bool] evtTypes [1]journal.EventType journal journal.Journal @@ -354,13 +354,12 @@ minerLoop: } } - blkKey := fmt.Sprintf("%d", b.Header.Height) - if _, ok := m.minedBlockHeights.Get(blkKey); ok { + if _, ok := m.minedBlockHeights.Get(b.Header.Height); ok { log.Warnw("Created a block at the same height as another block we've created", "height", b.Header.Height, "miner", b.Header.Miner, "parents", b.Header.Parents) continue } - m.minedBlockHeights.Add(blkKey, true) + m.minedBlockHeights.Add(b.Header.Height, true) if err := m.api.SyncSubmitBlock(ctx, b); err != nil { log.Errorf("failed to submit newly mined block: %+v", err) diff --git a/miner/testminer.go b/miner/testminer.go index 7f29a7ae02..deda89f420 100644 --- a/miner/testminer.go +++ b/miner/testminer.go @@ -3,7 +3,7 @@ package miner import ( "context" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" ds "github.com/ipfs/go-datastore" "github.com/filecoin-project/go-address" @@ -22,7 +22,7 @@ type MineReq struct { func NewTestMiner(nextCh <-chan MineReq, addr address.Address) func(v1api.FullNode, gen.WinningPoStProver) *Miner { return func(api v1api.FullNode, epp gen.WinningPoStProver) *Miner { - arc, err := lru.NewARC(10000) + arc, err := lru.NewARC[abi.ChainEpoch, bool](10000) if err != nil { panic(err) } diff --git a/node/config/cfgdocgen/gen.go b/node/config/cfgdocgen/gen.go index 5133501523..577e85f9da 100644 --- a/node/config/cfgdocgen/gen.go +++ b/node/config/cfgdocgen/gen.go @@ -2,14 +2,13 @@ package main import ( "fmt" - "io/ioutil" "os" "sort" "strings" ) func run() error { - tfb, err := ioutil.ReadFile("./node/config/types.go") + tfb, err := os.ReadFile("./node/config/types.go") if err != nil { return err } diff --git a/node/config/def.go b/node/config/def.go index 9a24449baa..2617ec5ba2 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -89,13 +89,15 @@ func DefaultFullNode() *FullNode { SimultaneousTransfersForRetrieval: DefaultSimultaneousTransfers, }, Chainstore: Chainstore{ - EnableSplitstore: false, + EnableSplitstore: true, Splitstore: Splitstore{ - ColdStoreType: "messages", + ColdStoreType: "discard", HotStoreType: "badger", MarkSetType: "badger", - HotStoreFullGCFrequency: 20, + HotStoreFullGCFrequency: 20, + HotStoreMaxSpaceThreshold: 150_000_000_000, + HotstoreMaxSpaceSafetyBuffer: 50_000_000_000, }, }, Cluster: *DefaultUserRaftConfig(), @@ -154,7 +156,7 @@ func DefaultStorageMiner() *StorageMiner { }, Proving: ProvingConfig{ - ParallelCheckLimit: 128, + ParallelCheckLimit: 32, PartitionCheckTimeout: Duration(20 * time.Minute), SingleCheckTimeout: Duration(10 * time.Minute), }, diff --git a/node/config/doc_gen.go b/node/config/doc_gen.go index 8b79bed4fe..c620847084 100644 --- a/node/config/doc_gen.go +++ b/node/config/doc_gen.go @@ -1286,6 +1286,35 @@ the compaction boundary; default is 0.`, A value of 0 disables, while a value 1 will do full GC in every compaction. Default is 20 (about once a week).`, }, + { + Name: "HotStoreMaxSpaceTarget", + Type: "uint64", + + Comment: `HotStoreMaxSpaceTarget sets a target max disk size for the hotstore. Splitstore GC +will run moving GC if disk utilization gets within a threshold (150 GB) of the target. +Splitstore GC will NOT run moving GC if the total size of the move would get +within 50 GB of the target, and instead will run a more aggressive online GC. +If both HotStoreFullGCFrequency and HotStoreMaxSpaceTarget are set then splitstore +GC will trigger moving GC if either configuration condition is met. +A reasonable minimum is 2x fully GCed hotstore size + 50 G buffer. +At this minimum size moving GC happens every time, any smaller and moving GC won't +be able to run. In spring 2023 this minimum is ~550 GB.`, + }, + { + Name: "HotStoreMaxSpaceThreshold", + Type: "uint64", + + Comment: `When HotStoreMaxSpaceTarget is set Moving GC will be triggered when total moving size +exceeds HotstoreMaxSpaceTarget - HotstoreMaxSpaceThreshold`, + }, + { + Name: "HotstoreMaxSpaceSafetyBuffer", + Type: "uint64", + + Comment: `Safety buffer to prevent moving GC from overflowing disk when HotStoreMaxSpaceTarget +is set. Moving GC will not occur when total moving size exceeds +HotstoreMaxSpaceTarget - HotstoreMaxSpaceSafetyBuffer`, + }, }, "StorageMiner": []DocField{ { diff --git a/node/config/load.go b/node/config/load.go index 6f5731ea1a..9133509120 100644 --- a/node/config/load.go +++ b/node/config/load.go @@ -17,17 +17,46 @@ import ( // FromFile loads config from a specified file overriding defaults specified in // the def parameter. If file does not exist or is empty defaults are assumed. -func FromFile(path string, def interface{}) (interface{}, error) { +func FromFile(path string, opts ...LoadCfgOpt) (interface{}, error) { + var loadOpts cfgLoadOpts + var err error + for _, opt := range opts { + if err = opt(&loadOpts); err != nil { + return nil, xerrors.Errorf("failed to apply load cfg option: %w", err) + } + } + var def interface{} + if loadOpts.defaultCfg != nil { + def, err = loadOpts.defaultCfg() + if err != nil { + return nil, xerrors.Errorf("no config found") + } + } + // check for loadability file, err := os.Open(path) switch { case os.IsNotExist(err): + if loadOpts.canFallbackOnDefault != nil { + if err := loadOpts.canFallbackOnDefault(); err != nil { + return nil, err + } + } return def, nil case err != nil: return nil, err } - - defer file.Close() //nolint:errcheck // The file is RO - return FromReader(file, def) + defer file.Close() //nolint:errcheck,staticcheck // The file is RO + cfgBs, err := io.ReadAll(file) + if err != nil { + return nil, xerrors.Errorf("failed to read config for validation checks %w", err) + } + buf := bytes.NewBuffer(cfgBs) + if loadOpts.validate != nil { + if err := loadOpts.validate(buf.String()); err != nil { + return nil, xerrors.Errorf("config failed validation: %w", err) + } + } + return FromReader(buf, def) } // FromReader loads config from a reader instance. @@ -46,7 +75,88 @@ func FromReader(reader io.Reader, def interface{}) (interface{}, error) { return cfg, nil } -func ConfigUpdate(cfgCur, cfgDef interface{}, comment bool) ([]byte, error) { +type cfgLoadOpts struct { + defaultCfg func() (interface{}, error) + canFallbackOnDefault func() error + validate func(string) error +} + +type LoadCfgOpt func(opts *cfgLoadOpts) error + +func SetDefault(f func() (interface{}, error)) LoadCfgOpt { + return func(opts *cfgLoadOpts) error { + opts.defaultCfg = f + return nil + } +} + +func SetCanFallbackOnDefault(f func() error) LoadCfgOpt { + return func(opts *cfgLoadOpts) error { + opts.canFallbackOnDefault = f + return nil + } +} + +func SetValidate(f func(string) error) LoadCfgOpt { + return func(opts *cfgLoadOpts) error { + opts.validate = f + return nil + } +} + +func NoDefaultForSplitstoreTransition() error { + return xerrors.Errorf("FullNode config not found and fallback to default disallowed while we transition to splitstore discard default. Use `lotus config default` to set this repo up with a default config. Be sure to set `EnableSplitstore` to `false` if you are running a full archive node") +} + +// Match the EnableSplitstore field +func MatchEnableSplitstoreField(s string) bool { + enableSplitstoreRx := regexp.MustCompile(`(?m)^\s*EnableSplitstore\s*=`) + return enableSplitstoreRx.MatchString(s) +} + +func ValidateSplitstoreSet(cfgRaw string) error { + if !MatchEnableSplitstoreField(cfgRaw) { + return xerrors.Errorf("Config does not contain explicit set of EnableSplitstore field, refusing to load. Please explicitly set EnableSplitstore. Set it to false if you are running a full archival node") + } + return nil +} + +type cfgUpdateOpts struct { + comment bool + keepUncommented func(string) bool +} + +// UpdateCfgOpt is a functional option for updating the config +type UpdateCfgOpt func(opts *cfgUpdateOpts) error + +// KeepUncommented sets a function for matching default valeus that should remain uncommented during +// a config update that comments out default values. +func KeepUncommented(f func(string) bool) UpdateCfgOpt { + return func(opts *cfgUpdateOpts) error { + opts.keepUncommented = f + return nil + } +} + +func Commented(commented bool) UpdateCfgOpt { + return func(opts *cfgUpdateOpts) error { + opts.comment = commented + return nil + } +} + +func DefaultKeepUncommented() UpdateCfgOpt { + return KeepUncommented(MatchEnableSplitstoreField) +} + +// ConfigUpdate takes in a config and a default config and optionally comments out default values +func ConfigUpdate(cfgCur, cfgDef interface{}, opts ...UpdateCfgOpt) ([]byte, error) { + var updateOpts cfgUpdateOpts + for _, opt := range opts { + if err := opt(&updateOpts); err != nil { + return nil, xerrors.Errorf("failed to apply update cfg option to ConfigUpdate's config: %w", err) + } + } var nodeStr, defStr string if cfgDef != nil { buf := new(bytes.Buffer) @@ -68,7 +178,7 @@ func ConfigUpdate(cfgCur, cfgDef interface{}, comment bool) ([]byte, error) { nodeStr = buf.String() } - if comment { + if updateOpts.comment { // create a map of default lines, so we can comment those out later defLines := strings.Split(defStr, "\n") defaults := map[string]struct{}{} @@ -130,8 +240,10 @@ func ConfigUpdate(cfgCur, cfgDef interface{}, comment bool) ([]byte, error) { } } - // if there is the same line in the default config, comment it out it output - if _, found := defaults[strings.TrimSpace(nodeLines[i])]; (cfgDef == nil || found) && len(line) > 0 { + // filter lines from options + optsFilter := updateOpts.keepUncommented != nil && updateOpts.keepUncommented(line) + // if there is the same line in the default config, comment it out in output + if _, found := defaults[strings.TrimSpace(nodeLines[i])]; (cfgDef == nil || found) && len(line) > 0 && !optsFilter { line = pad + "#" + line[len(pad):] } outLines = append(outLines, line) @@ -159,5 +271,5 @@ func ConfigUpdate(cfgCur, cfgDef interface{}, comment bool) ([]byte, error) { } func ConfigComment(t interface{}) ([]byte, error) { - return ConfigUpdate(t, nil, true) + return ConfigUpdate(t, nil, Commented(true), DefaultKeepUncommented()) } diff --git a/node/config/load_test.go b/node/config/load_test.go index 17e185be26..e17660c19f 100644 --- a/node/config/load_test.go +++ b/node/config/load_test.go @@ -3,7 +3,6 @@ package config import ( "bytes" - "io/ioutil" "os" "testing" "time" @@ -11,19 +10,21 @@ import ( "github.com/stretchr/testify/assert" ) +func fullNodeDefault() (interface{}, error) { return DefaultFullNode(), nil } + func TestDecodeNothing(t *testing.T) { //stm: @NODE_CONFIG_LOAD_FILE_002 assert := assert.New(t) { - cfg, err := FromFile(os.DevNull, DefaultFullNode()) + cfg, err := FromFile(os.DevNull, SetDefault(fullNodeDefault)) assert.Nil(err, "error should be nil") assert.Equal(DefaultFullNode(), cfg, "config from empty file should be the same as default") } { - cfg, err := FromFile("./does-not-exist.toml", DefaultFullNode()) + cfg, err := FromFile("./does-not-exist.toml", SetDefault(fullNodeDefault)) assert.Nil(err, "error should be nil") assert.Equal(DefaultFullNode(), cfg, "config from not exisiting file should be the same as default") @@ -48,7 +49,7 @@ func TestParitalConfig(t *testing.T) { } { - f, err := ioutil.TempFile("", "config-*.toml") + f, err := os.CreateTemp("", "config-*.toml") fname := f.Name() assert.NoError(err, "tmp file shold not error") @@ -58,9 +59,82 @@ func TestParitalConfig(t *testing.T) { assert.NoError(err, "closing tmp file should not error") defer os.Remove(fname) //nolint:errcheck - cfg, err := FromFile(fname, DefaultFullNode()) + cfg, err := FromFile(fname, SetDefault(fullNodeDefault)) assert.Nil(err, "error should be nil") assert.Equal(expected, cfg, "config from reader should contain changes") } } + +func TestValidateSplitstoreSet(t *testing.T) { + cfgSet := ` + EnableSplitstore = false + ` + assert.NoError(t, ValidateSplitstoreSet(cfgSet)) + cfgSloppySet := ` + EnableSplitstore = true + ` + assert.NoError(t, ValidateSplitstoreSet(cfgSloppySet)) + + // Missing altogether + cfgMissing := ` + [Chainstore] + # type: bool + # env var: LOTUS_CHAINSTORE_ENABLESPLITSTORE + # oops its mising + + [Chainstore.Splitstore] + ColdStoreType = "discard" + ` + err := ValidateSplitstoreSet(cfgMissing) + assert.Error(t, err) + cfgCommentedOut := ` + # EnableSplitstore = false + ` + err = ValidateSplitstoreSet(cfgCommentedOut) + assert.Error(t, err) +} + +// Default config keeps EnableSplitstore field uncommented +func TestKeepEnableSplitstoreUncommented(t *testing.T) { + cfgStr, err := ConfigComment(DefaultFullNode()) + assert.NoError(t, err) + assert.True(t, MatchEnableSplitstoreField(string(cfgStr))) + + cfgStrFromDef, err := ConfigUpdate(DefaultFullNode(), DefaultFullNode(), Commented(true), DefaultKeepUncommented()) + assert.NoError(t, err) + assert.True(t, MatchEnableSplitstoreField(string(cfgStrFromDef))) +} + +// Loading a config with commented EnableSplitstore fails when setting validator +func TestValidateConfigSetsEnableSplitstore(t *testing.T) { + cfgCommentedOutEnableSS, err := ConfigUpdate(DefaultFullNode(), DefaultFullNode(), Commented(true)) + assert.NoError(t, err) + // assert that this config comments out EnableSplitstore + assert.False(t, MatchEnableSplitstoreField(string(cfgCommentedOutEnableSS))) + + // write config with commented out EnableSplitstore to file + f, err := os.CreateTemp("", "config.toml") + fname := f.Name() + assert.NoError(t, err) + defer func() { + err = f.Close() + assert.NoError(t, err) + os.Remove(fname) //nolint:errcheck + }() + _, err = f.WriteString(string(cfgCommentedOutEnableSS)) + assert.NoError(t, err) + + _, err = FromFile(fname, SetDefault(fullNodeDefault), SetValidate(ValidateSplitstoreSet)) + assert.Error(t, err) +} + +// Loading without a config file and a default fails if the default fallback is disabled +func TestFailToFallbackToDefault(t *testing.T) { + dir, err := os.MkdirTemp("", "dirWithNoFiles") + assert.NoError(t, err) + defer assert.NoError(t, os.RemoveAll(dir)) + nonExistantFileName := dir + "/notarealfile" + _, err = FromFile(nonExistantFileName, SetDefault(fullNodeDefault), SetCanFallbackOnDefault(NoDefaultForSplitstoreTransition)) + assert.Error(t, err) +} diff --git a/node/config/storage.go b/node/config/storage.go index 2c9d880f92..dfe067840a 100644 --- a/node/config/storage.go +++ b/node/config/storage.go @@ -3,7 +3,6 @@ package config import ( "encoding/json" "io" - "io/ioutil" "os" "golang.org/x/xerrors" @@ -43,7 +42,7 @@ func WriteStorageFile(path string, config storiface.StorageConfig) error { return xerrors.Errorf("marshaling storage config: %w", err) } - if err := ioutil.WriteFile(path, b, 0644); err != nil { + if err := os.WriteFile(path, b, 0644); err != nil { return xerrors.Errorf("persisting storage config (%s): %w", path, err) } diff --git a/node/config/types.go b/node/config/types.go index 690e8caee1..5b952d35e4 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -601,6 +601,25 @@ type Splitstore struct { // A value of 0 disables, while a value 1 will do full GC in every compaction. // Default is 20 (about once a week). HotStoreFullGCFrequency uint64 + // HotStoreMaxSpaceTarget sets a target max disk size for the hotstore. Splitstore GC + // will run moving GC if disk utilization gets within a threshold (150 GB) of the target. + // Splitstore GC will NOT run moving GC if the total size of the move would get + // within 50 GB of the target, and instead will run a more aggressive online GC. + // If both HotStoreFullGCFrequency and HotStoreMaxSpaceTarget are set then splitstore + // GC will trigger moving GC if either configuration condition is met. + // A reasonable minimum is 2x fully GCed hotstore size + 50 G buffer. + // At this minimum size moving GC happens every time, any smaller and moving GC won't + // be able to run. In spring 2023 this minimum is ~550 GB. + HotStoreMaxSpaceTarget uint64 + + // When HotStoreMaxSpaceTarget is set Moving GC will be triggered when total moving size + // exceeds HotstoreMaxSpaceTarget - HotstoreMaxSpaceThreshold + HotStoreMaxSpaceThreshold uint64 + + // Safety buffer to prevent moving GC from overflowing disk when HotStoreMaxSpaceTarget + // is set. Moving GC will not occur when total moving size exceeds + // HotstoreMaxSpaceTarget - HotstoreMaxSpaceSafetyBuffer + HotstoreMaxSpaceSafetyBuffer uint64 } // // Full Node diff --git a/node/hello/cbor_gen.go b/node/hello/cbor_gen.go index 68c82e2bbe..5b0697f556 100644 --- a/node/hello/cbor_gen.go +++ b/node/hello/cbor_gen.go @@ -8,10 +8,11 @@ import ( "math" "sort" - abi "github.com/filecoin-project/go-state-types/abi" cid "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" + + abi "github.com/filecoin-project/go-state-types/abi" ) var _ = xerrors.Errorf @@ -139,7 +140,7 @@ func (t *HelloMessage) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -249,7 +250,7 @@ func (t *LatencyMessage) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: @@ -274,7 +275,7 @@ func (t *LatencyMessage) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: diff --git a/node/impl/client/client.go b/node/impl/client/client.go index fef4d91e37..e45d537e27 100644 --- a/node/impl/client/client.go +++ b/node/impl/client/client.go @@ -17,8 +17,8 @@ import ( "github.com/ipfs/go-cid" bstore "github.com/ipfs/go-ipfs-blockstore" offline "github.com/ipfs/go-ipfs-exchange-offline" - files "github.com/ipfs/go-ipfs-files" format "github.com/ipfs/go-ipld-format" + "github.com/ipfs/go-libipfs/files" logging "github.com/ipfs/go-log/v2" "github.com/ipfs/go-merkledag" unixfile "github.com/ipfs/go-unixfs/file" @@ -44,7 +44,7 @@ import ( "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/go-commp-utils/writer" - datatransfer "github.com/filecoin-project/go-data-transfer" + datatransfer "github.com/filecoin-project/go-data-transfer/v2" "github.com/filecoin-project/go-fil-markets/discovery" rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/storagemarket" @@ -1302,8 +1302,8 @@ func (a *API) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Addre return nil, err } for _, s := range ps { - if strings.HasPrefix(s, dealProtoPrefix) { - res.DealProtocols = append(res.DealProtocols, s) + if strings.HasPrefix(string(s), dealProtoPrefix) { + res.DealProtocols = append(res.DealProtocols, string(s)) } } sort.Strings(res.DealProtocols) diff --git a/node/impl/client/client_test.go b/node/impl/client/client_test.go index 7c96897c5b..032fef55a4 100644 --- a/node/impl/client/client_test.go +++ b/node/impl/client/client_test.go @@ -5,7 +5,7 @@ import ( "bytes" "context" "embed" - "io/ioutil" + "os" "path/filepath" "strings" "testing" @@ -16,7 +16,7 @@ import ( dssync "github.com/ipfs/go-datastore/sync" blockstore "github.com/ipfs/go-ipfs-blockstore" offline "github.com/ipfs/go-ipfs-exchange-offline" - files "github.com/ipfs/go-ipfs-files" + "github.com/ipfs/go-libipfs/files" "github.com/ipfs/go-merkledag" unixfile "github.com/ipfs/go-unixfs/file" "github.com/ipld/go-car" @@ -32,7 +32,7 @@ import ( var testdata embed.FS func TestImportLocal(t *testing.T) { - //stm: @CLIENT_STORAGE_DEALS_IMPORT_LOCAL_001, @CLIENT_RETRIEVAL_FIND_001 + // stm: @CLIENT_STORAGE_DEALS_IMPORT_LOCAL_001, @CLIENT_RETRIEVAL_FIND_001 ds := dssync.MutexWrap(datastore.NewMapDatastore()) dir := t.TempDir() im := imports.NewManager(ds, dir) @@ -46,7 +46,7 @@ func TestImportLocal(t *testing.T) { b, err := testdata.ReadFile("testdata/payload.txt") require.NoError(t, err) - //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 + // stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 root, err := a.ClientImportLocal(ctx, bytes.NewReader(b)) require.NoError(t, err) require.NotEqual(t, cid.Undef, root) @@ -59,7 +59,7 @@ func TestImportLocal(t *testing.T) { require.Equal(t, root, *it.Root) require.True(t, strings.HasPrefix(it.CARPath, dir)) - //stm: @CLIENT_DATA_HAS_LOCAL_001 + // stm: @CLIENT_DATA_HAS_LOCAL_001 local, err := a.ClientHasLocal(ctx, root) require.NoError(t, err) require.True(t, local) @@ -77,7 +77,7 @@ func TestImportLocal(t *testing.T) { }) require.NoError(t, err) - outBytes, err := ioutil.ReadFile(out1) + outBytes, err := os.ReadFile(out1) require.NoError(t, err) require.Equal(t, b, outBytes) @@ -128,7 +128,7 @@ func TestImportLocal(t *testing.T) { err = files.WriteTo(file, exportedPath) require.NoError(t, err) - exportedBytes, err := ioutil.ReadFile(exportedPath) + exportedBytes, err := os.ReadFile(exportedPath) require.NoError(t, err) // compare original file to recreated unixfs file. diff --git a/node/impl/full/chain.go b/node/impl/full/chain.go index 17444ca58c..d0f36ce488 100644 --- a/node/impl/full/chain.go +++ b/node/impl/full/chain.go @@ -5,11 +5,15 @@ import ( "bytes" "context" "encoding/json" + "fmt" "io" "math" + "os" + "path/filepath" "strconv" "strings" "sync" + "time" "github.com/ipfs/go-blockservice" "github.com/ipfs/go-cid" @@ -38,6 +42,7 @@ import ( "github.com/filecoin-project/lotus/lib/oldpath" "github.com/filecoin-project/lotus/lib/oldpath/oldresolver" "github.com/filecoin-project/lotus/node/modules/dtypes" + "github.com/filecoin-project/lotus/node/repo" ) var log = logging.Logger("fullnode") @@ -89,6 +94,8 @@ type ChainAPI struct { // BaseBlockstore is the underlying blockstore BaseBlockstore dtypes.BaseBlockstore + + Repo repo.LockedRepo } func (m *ChainModule) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, error) { @@ -186,25 +193,14 @@ func (a *ChainAPI) ChainGetParentReceipts(ctx context.Context, bcid cid.Cid) ([] return nil, nil } - // TODO: need to get the number of messages better than this - pts, err := a.Chain.LoadTipSet(ctx, types.NewTipSetKey(b.Parents...)) - if err != nil { - return nil, err - } - - cm, err := a.Chain.MessagesForTipset(ctx, pts) + receipts, err := a.Chain.ReadReceipts(ctx, b.ParentMessageReceipts) if err != nil { return nil, err } - var out []*types.MessageReceipt - for i := 0; i < len(cm); i++ { - r, err := a.Chain.GetParentReceipt(ctx, b, i) - if err != nil { - return nil, err - } - - out = append(out, r) + out := make([]*types.MessageReceipt, len(receipts)) + for i := range receipts { + out[i] = &receipts[i] } return out, nil @@ -589,6 +585,54 @@ func (m *ChainModule) ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.M return cm.VMMessage(), nil } +func (a ChainAPI) ChainExportRangeInternal(ctx context.Context, head, tail types.TipSetKey, cfg api.ChainExportConfig) error { + headTs, err := a.Chain.GetTipSetFromKey(ctx, head) + if err != nil { + return xerrors.Errorf("loading tipset %s: %w", head, err) + } + tailTs, err := a.Chain.GetTipSetFromKey(ctx, tail) + if err != nil { + return xerrors.Errorf("loading tipset %s: %w", tail, err) + } + if headTs.Height() < tailTs.Height() { + return xerrors.Errorf("Height of head-tipset (%d) must be greater or equal to the height of the tail-tipset (%d)", headTs.Height(), tailTs.Height()) + } + + fileName := filepath.Join(a.Repo.Path(), fmt.Sprintf("snapshot_%d_%d_%d.car", tailTs.Height(), headTs.Height(), time.Now().Unix())) + if err != nil { + return err + } + + f, err := os.Create(fileName) + if err != nil { + return err + } + + log.Infow("Exporting chain range", "path", fileName) + // buffer writes to the chain export file. + bw := bufio.NewWriterSize(f, cfg.WriteBufferSize) + + defer func() { + if err := bw.Flush(); err != nil { + log.Errorw("failed to flush buffer", "error", err) + } + if err := f.Close(); err != nil { + log.Errorw("failed to close file", "error", err) + } + }() + + if err := a.Chain.ExportRange(ctx, + bw, + headTs, tailTs, + cfg.IncludeMessages, cfg.IncludeReceipts, cfg.IncludeStateRoots, + cfg.NumWorkers, + ); err != nil { + return fmt.Errorf("exporting chain range: %w", err) + } + + return nil +} + func (a *ChainAPI) ChainExport(ctx context.Context, nroots abi.ChainEpoch, skipoldmsgs bool, tsk types.TipSetKey) (<-chan []byte, error) { ts, err := a.Chain.GetTipSetFromKey(ctx, tsk) if err != nil { @@ -693,3 +737,14 @@ func (a *ChainAPI) ChainPrune(ctx context.Context, opts api.PruneOpts) error { return pruner.PruneChain(opts) } + +func (a *ChainAPI) ChainHotGC(ctx context.Context, opts api.HotGCOpts) error { + pruner, ok := a.BaseBlockstore.(interface { + GCHotStore(api.HotGCOpts) error + }) + if !ok { + return xerrors.Errorf("base blockstore does not support hot GC (%T)", a.BaseBlockstore) + } + + return pruner.GCHotStore(opts) +} diff --git a/node/impl/full/dummy.go b/node/impl/full/dummy.go index 9abe00321c..a4a125d6f9 100644 --- a/node/impl/full/dummy.go +++ b/node/impl/full/dummy.go @@ -6,7 +6,9 @@ import ( "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-jsonrpc" + "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/types/ethtypes" @@ -16,6 +18,10 @@ var ErrModuleDisabled = errors.New("module disabled, enable with Fevm.EnableEthR type EthModuleDummy struct{} +func (e *EthModuleDummy) EthAddressToFilecoinAddress(ctx context.Context, ethAddress ethtypes.EthAddress) (address.Address, error) { + return address.Undef, ErrModuleDisabled +} + func (e *EthModuleDummy) EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error) { return nil, ErrModuleDisabled } @@ -52,6 +58,10 @@ func (e *EthModuleDummy) EthGetTransactionByHash(ctx context.Context, txHash *et return nil, ErrModuleDisabled } +func (e *EthModuleDummy) EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error) { + return nil, ErrModuleDisabled +} + func (e *EthModuleDummy) EthGetTransactionCount(ctx context.Context, sender ethtypes.EthAddress, blkOpt string) (ethtypes.EthUint64, error) { return 0, ErrModuleDisabled } @@ -60,6 +70,10 @@ func (e *EthModuleDummy) EthGetTransactionReceipt(ctx context.Context, txHash et return nil, ErrModuleDisabled } +func (e *EthModuleDummy) EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*api.EthTxReceipt, error) { + return nil, ErrModuleDisabled +} + func (e *EthModuleDummy) EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) { return ethtypes.EthTx{}, ErrModuleDisabled } diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index 8401d7d51f..e2c39ed878 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "fmt" + "os" + "sort" "strconv" "sync" "time" @@ -13,6 +15,7 @@ import ( "github.com/google/uuid" "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" + "github.com/zyedidia/generic/queue" "go.uber.org/fx" "golang.org/x/xerrors" @@ -30,6 +33,7 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors" builtinactors "github.com/filecoin-project/lotus/chain/actors/builtin" + builtinevm "github.com/filecoin-project/lotus/chain/actors/builtin/evm" "github.com/filecoin-project/lotus/chain/ethhashlookup" "github.com/filecoin-project/lotus/chain/events/filter" "github.com/filecoin-project/lotus/chain/messagepool" @@ -37,9 +41,12 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" + "github.com/filecoin-project/lotus/chain/vm" "github.com/filecoin-project/lotus/node/modules/dtypes" ) +var ErrUnsupported = errors.New("unsupported method") + type EthModuleAPI interface { EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error) EthAccounts(ctx context.Context) ([]ethtypes.EthAddress, error) @@ -48,12 +55,12 @@ type EthModuleAPI interface { EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthHash, fullTxInfo bool) (ethtypes.EthBlock, error) EthGetBlockByNumber(ctx context.Context, blkNum string, fullTxInfo bool) (ethtypes.EthBlock, error) EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error) + EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error) EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error) EthGetTransactionHashByCid(ctx context.Context, cid cid.Cid) (*ethtypes.EthHash, error) EthGetTransactionCount(ctx context.Context, sender ethtypes.EthAddress, blkOpt string) (ethtypes.EthUint64, error) EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*api.EthTxReceipt, error) - EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) - EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) + EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*api.EthTxReceipt, error) EthGetCode(ctx context.Context, address ethtypes.EthAddress, blkOpt string) (ethtypes.EthBytes, error) EthGetStorageAt(ctx context.Context, address ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error) EthGetBalance(ctx context.Context, address ethtypes.EthAddress, blkParam string) (ethtypes.EthBigInt, error) @@ -151,6 +158,8 @@ type EthAPI struct { EthEventAPI } +var ErrNullRound = errors.New("requested epoch was a null round") + func (a *EthModule) StateNetworkName(ctx context.Context) (dtypes.NetworkName, error) { return stmgr.GetNetworkName(ctx, a.StateManager, a.Chain.GetHeaviestTipSet().ParentState()) } @@ -180,6 +189,14 @@ func (a *EthModule) EthAccounts(context.Context) ([]ethtypes.EthAddress, error) return []ethtypes.EthAddress{}, nil } +func (a *EthAPI) EthAddressToFilecoinAddress(ctx context.Context, ethAddress ethtypes.EthAddress) (address.Address, error) { + return ethAddress.ToFilecoinAddress() +} + +func (a *EthAPI) FilecoinAddressToEthAddress(ctx context.Context, filecoinAddress address.Address) (ethtypes.EthAddress, error) { + return ethtypes.EthAddressFromFilecoinAddress(filecoinAddress) +} + func (a *EthModule) countTipsetMsgs(ctx context.Context, ts *types.TipSet) (int, error) { blkMsgs, err := a.Chain.BlockMsgsForTipset(ctx, ts) if err != nil { @@ -221,7 +238,7 @@ func (a *EthModule) EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthH return newEthBlockFromFilecoinTipSet(ctx, ts, fullTxInfo, a.Chain, a.StateAPI) } -func (a *EthModule) parseBlkParam(ctx context.Context, blkParam string) (tipset *types.TipSet, err error) { +func (a *EthModule) parseBlkParam(ctx context.Context, blkParam string, strict bool) (tipset *types.TipSet, err error) { if blkParam == "earliest" { return nil, fmt.Errorf("block param \"earliest\" is not supported") } @@ -242,16 +259,22 @@ func (a *EthModule) parseBlkParam(ctx context.Context, blkParam string) (tipset if err != nil { return nil, fmt.Errorf("cannot parse block number: %v", err) } - ts, err := a.Chain.GetTipsetByHeight(ctx, abi.ChainEpoch(num), nil, false) + if abi.ChainEpoch(num) > head.Height()-1 { + return nil, fmt.Errorf("requested a future epoch (beyond 'latest')") + } + ts, err := a.ChainAPI.ChainGetTipSetByHeight(ctx, abi.ChainEpoch(num), head.Key()) if err != nil { return nil, fmt.Errorf("cannot get tipset at height: %v", num) } + if strict && ts.Height() != abi.ChainEpoch(num) { + return nil, ErrNullRound + } return ts, nil } } func (a *EthModule) EthGetBlockByNumber(ctx context.Context, blkParam string, fullTxInfo bool) (ethtypes.EthBlock, error) { - ts, err := a.parseBlkParam(ctx, blkParam) + ts, err := a.parseBlkParam(ctx, blkParam, true) if err != nil { return ethtypes.EthBlock{}, err } @@ -259,6 +282,11 @@ func (a *EthModule) EthGetBlockByNumber(ctx context.Context, blkParam string, fu } func (a *EthModule) EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error) { + return a.EthGetTransactionByHashLimited(ctx, txHash, api.LookbackNoLimit) + +} + +func (a *EthModule) EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error) { // Ethereum's behavior is to return null when the txHash is invalid, so we use nil to check if txHash is valid if txHash == nil { return nil, nil @@ -275,7 +303,7 @@ func (a *EthModule) EthGetTransactionByHash(ctx context.Context, txHash *ethtype } // first, try to get the cid from mined transactions - msgLookup, err := a.StateAPI.StateSearchMsg(ctx, types.EmptyTSK, c, api.LookbackNoLimit, true) + msgLookup, err := a.StateAPI.StateSearchMsg(ctx, types.EmptyTSK, c, limit, true) if err == nil && msgLookup != nil { tx, err := newEthTxFromMessageLookup(ctx, msgLookup, -1, a.Chain, a.StateAPI) if err == nil { @@ -325,13 +353,13 @@ func (a *EthModule) EthGetMessageCidByTransactionHash(ctx context.Context, txHas c = txHash.ToCid() } - _, err = a.StateAPI.Chain.GetSignedMessage(ctx, c) + _, err = a.Chain.GetSignedMessage(ctx, c) if err == nil { // This is an Eth Tx, Secp message, Or BLS message in the mpool return &c, nil } - _, err = a.StateAPI.Chain.GetMessage(ctx, c) + _, err = a.Chain.GetMessage(ctx, c) if err == nil { // This is a BLS message return &c, nil @@ -357,11 +385,31 @@ func (a *EthModule) EthGetTransactionCount(ctx context.Context, sender ethtypes. return ethtypes.EthUint64(0), nil } - ts, err := a.parseBlkParam(ctx, blkParam) + ts, err := a.parseBlkParam(ctx, blkParam, false) if err != nil { return ethtypes.EthUint64(0), xerrors.Errorf("cannot parse block param: %s", blkParam) } + // First, handle the case where the "sender" is an EVM actor. + if actor, err := a.StateManager.LoadActor(ctx, addr, ts); err != nil { + if xerrors.Is(err, types.ErrActorNotFound) { + return 0, nil + } + return 0, xerrors.Errorf("failed to lookup contract %s: %w", sender, err) + } else if builtinactors.IsEvmActor(actor.Code) { + evmState, err := builtinevm.Load(a.Chain.ActorStore(ctx), actor) + if err != nil { + return 0, xerrors.Errorf("failed to load evm state: %w", err) + } + if alive, err := evmState.IsAlive(); err != nil { + return 0, err + } else if !alive { + return 0, nil + } + nonce, err := evmState.Nonce() + return ethtypes.EthUint64(nonce), err + } + nonce, err := a.Mpool.GetNonce(ctx, addr, ts.Key()) if err != nil { return ethtypes.EthUint64(0), nil @@ -370,6 +418,10 @@ func (a *EthModule) EthGetTransactionCount(ctx context.Context, sender ethtypes. } func (a *EthModule) EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*api.EthTxReceipt, error) { + return a.EthGetTransactionReceiptLimited(ctx, txHash, api.LookbackNoLimit) +} + +func (a *EthModule) EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*api.EthTxReceipt, error) { c, err := a.EthTxHashManager.TransactionHashLookup.GetCidFromHash(txHash) if err != nil { log.Debug("could not find transaction hash %s in lookup table", txHash.String()) @@ -380,7 +432,7 @@ func (a *EthModule) EthGetTransactionReceipt(ctx context.Context, txHash ethtype c = txHash.ToCid() } - msgLookup, err := a.StateAPI.StateSearchMsg(ctx, types.EmptyTSK, c, api.LookbackNoLimit, true) + msgLookup, err := a.StateAPI.StateSearchMsg(ctx, types.EmptyTSK, c, limit, true) if err != nil || msgLookup == nil { return nil, nil } @@ -390,20 +442,15 @@ func (a *EthModule) EthGetTransactionReceipt(ctx context.Context, txHash ethtype return nil, nil } - replay, err := a.StateAPI.StateReplay(ctx, types.EmptyTSK, c) - if err != nil { - return nil, nil - } - var events []types.Event - if rct := replay.MsgRct; rct != nil && rct.EventsRoot != nil { + if rct := msgLookup.Receipt; rct.EventsRoot != nil { events, err = a.ChainAPI.ChainGetEvents(ctx, *rct.EventsRoot) if err != nil { return nil, nil } } - receipt, err := newEthTxReceipt(ctx, tx, msgLookup, replay, events, a.StateAPI) + receipt, err := newEthTxReceipt(ctx, tx, msgLookup, events, a.Chain, a.StateAPI) if err != nil { return nil, nil } @@ -411,12 +458,12 @@ func (a *EthModule) EthGetTransactionReceipt(ctx context.Context, txHash ethtype return &receipt, nil } -func (a *EthModule) EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) { - return ethtypes.EthTx{}, nil +func (a *EthAPI) EthGetTransactionByBlockHashAndIndex(context.Context, ethtypes.EthHash, ethtypes.EthUint64) (ethtypes.EthTx, error) { + return ethtypes.EthTx{}, ErrUnsupported } -func (a *EthModule) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) { - return ethtypes.EthTx{}, nil +func (a *EthAPI) EthGetTransactionByBlockNumberAndIndex(context.Context, ethtypes.EthUint64, ethtypes.EthUint64) (ethtypes.EthTx, error) { + return ethtypes.EthTx{}, ErrUnsupported } // EthGetCode returns string value of the compiled bytecode @@ -426,13 +473,32 @@ func (a *EthModule) EthGetCode(ctx context.Context, ethAddr ethtypes.EthAddress, return nil, xerrors.Errorf("cannot get Filecoin address: %w", err) } - // use the system actor as the caller - from, err := address.NewIDAddress(0) + ts, err := a.parseBlkParam(ctx, blkParam, false) if err != nil { - return nil, fmt.Errorf("failed to construct system sender address: %w", err) + return nil, xerrors.Errorf("cannot parse block param: %s", blkParam) + } + + // StateManager.Call will panic if there is no parent + if ts.Height() == 0 { + return nil, xerrors.Errorf("block param must not specify genesis block") } + + actor, err := a.StateManager.LoadActor(ctx, to, ts) + if err != nil { + if xerrors.Is(err, types.ErrActorNotFound) { + return nil, nil + } + return nil, xerrors.Errorf("failed to lookup contract %s: %w", ethAddr, err) + } + + // Not a contract. We could try to distinguish between accounts and "native" contracts here, + // but it's not worth it. + if !builtinactors.IsEvmActor(actor.Code) { + return nil, nil + } + msg := &types.Message{ - From: from, + From: builtinactors.SystemActorAddr, To: to, Value: big.Zero(), Method: builtintypes.MethodsEVM.GetBytecode, @@ -442,16 +508,6 @@ func (a *EthModule) EthGetCode(ctx context.Context, ethAddr ethtypes.EthAddress, GasPremium: big.Zero(), } - ts, err := a.parseBlkParam(ctx, blkParam) - if err != nil { - return nil, xerrors.Errorf("cannot parse block param: %s", blkParam) - } - - // StateManager.Call will panic if there is no parent - if ts.Height() == 0 { - return nil, xerrors.Errorf("block param must not specify genesis block") - } - // Try calling until we find a height with no migration. var res *api.InvocResult for { @@ -466,9 +522,7 @@ func (a *EthModule) EthGetCode(ctx context.Context, ethAddr ethtypes.EthAddress, } if err != nil { - // if the call resulted in error, this is not an EVM smart contract; - // return no bytecode. - return nil, nil + return nil, xerrors.Errorf("failed to call GetBytecode: %w", err) } if res.MsgRct == nil { @@ -476,15 +530,20 @@ func (a *EthModule) EthGetCode(ctx context.Context, ethAddr ethtypes.EthAddress, } if res.MsgRct.ExitCode.IsError() { - return nil, xerrors.Errorf("message execution failed: exit %s, reason: %s", res.MsgRct.ExitCode, res.Error) + return nil, xerrors.Errorf("GetBytecode failed: %s", res.Error) } - var bytecodeCid cbg.CborCid - if err := bytecodeCid.UnmarshalCBOR(bytes.NewReader(res.MsgRct.Return)); err != nil { + var getBytecodeReturn evm.GetBytecodeReturn + if err := getBytecodeReturn.UnmarshalCBOR(bytes.NewReader(res.MsgRct.Return)); err != nil { return nil, fmt.Errorf("failed to decode EVM bytecode CID: %w", err) } - blk, err := a.Chain.StateBlockstore().Get(ctx, cid.Cid(bytecodeCid)) + // The contract has selfdestructed, so the code is "empty". + if getBytecodeReturn.Cid == nil { + return nil, nil + } + + blk, err := a.Chain.StateBlockstore().Get(ctx, *getBytecodeReturn.Cid) if err != nil { return nil, fmt.Errorf("failed to get EVM bytecode: %w", err) } @@ -493,13 +552,18 @@ func (a *EthModule) EthGetCode(ctx context.Context, ethAddr ethtypes.EthAddress, } func (a *EthModule) EthGetStorageAt(ctx context.Context, ethAddr ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error) { + ts, err := a.parseBlkParam(ctx, blkParam, false) + if err != nil { + return nil, xerrors.Errorf("cannot parse block param: %s", blkParam) + } + l := len(position) if l > 32 { return nil, fmt.Errorf("supplied storage key is too long") } // pad with zero bytes if smaller than 32 bytes - position = append(make([]byte, 32-l, 32-l), position...) + position = append(make([]byte, 32-l, 32), position...) to, err := ethAddr.ToFilecoinAddress() if err != nil { @@ -512,8 +576,20 @@ func (a *EthModule) EthGetStorageAt(ctx context.Context, ethAddr ethtypes.EthAdd return nil, fmt.Errorf("failed to construct system sender address: %w", err) } + actor, err := a.StateManager.LoadActor(ctx, to, ts) + if err != nil { + if xerrors.Is(err, types.ErrActorNotFound) { + return ethtypes.EthBytes(make([]byte, 32)), nil + } + return nil, xerrors.Errorf("failed to lookup contract %s: %w", ethAddr, err) + } + + if !builtinactors.IsEvmActor(actor.Code) { + return ethtypes.EthBytes(make([]byte, 32)), nil + } + params, err := actors.SerializeParams(&evm.GetStorageAtParams{ - StorageKey: position, + StorageKey: *(*[32]byte)(position), }) if err != nil { return nil, fmt.Errorf("failed to serialize parameters: %w", err) @@ -530,8 +606,6 @@ func (a *EthModule) EthGetStorageAt(ctx context.Context, ethAddr ethtypes.EthAdd GasPremium: big.Zero(), } - ts := a.Chain.GetHeaviestTipSet() - // Try calling until we find a height with no migration. var res *api.InvocResult for { @@ -550,10 +624,22 @@ func (a *EthModule) EthGetStorageAt(ctx context.Context, ethAddr ethtypes.EthAdd } if res.MsgRct == nil { - return nil, fmt.Errorf("no message receipt") + return nil, xerrors.Errorf("no message receipt") } - return res.MsgRct.Return, nil + if res.MsgRct.ExitCode.IsError() { + return nil, xerrors.Errorf("failed to lookup storage slot: %s", res.Error) + } + + var ret abi.CborBytes + if err := ret.UnmarshalCBOR(bytes.NewReader(res.MsgRct.Return)); err != nil { + return nil, xerrors.Errorf("failed to unmarshal storage slot: %w", err) + } + + // pad with zero bytes if smaller than 32 bytes + ret = append(make([]byte, 32-len(ret), 32), ret...) + + return ethtypes.EthBytes(ret), nil } func (a *EthModule) EthGetBalance(ctx context.Context, address ethtypes.EthAddress, blkParam string) (ethtypes.EthBigInt, error) { @@ -562,12 +648,17 @@ func (a *EthModule) EthGetBalance(ctx context.Context, address ethtypes.EthAddre return ethtypes.EthBigInt{}, err } - ts, err := a.parseBlkParam(ctx, blkParam) + ts, err := a.parseBlkParam(ctx, blkParam, false) if err != nil { return ethtypes.EthBigInt{}, xerrors.Errorf("cannot parse block param: %s", blkParam) } - actor, err := a.StateGetActor(ctx, filAddr, ts.Key()) + st, _, err := a.StateManager.TipSetState(ctx, ts) + if err != nil { + return ethtypes.EthBigInt{}, xerrors.Errorf("failed to compute tipset state: %w", err) + } + + actor, err := a.StateManager.LoadActorRaw(ctx, filAddr, st) if xerrors.Is(err, types.ErrActorNotFound) { return ethtypes.EthBigIntZero, nil } else if err != nil { @@ -589,36 +680,61 @@ func (a *EthModule) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (eth if params.BlkCount > 1024 { return ethtypes.EthFeeHistory{}, fmt.Errorf("block count should be smaller than 1024") } + rewardPercentiles := make([]float64, 0) + if params.RewardPercentiles != nil { + rewardPercentiles = append(rewardPercentiles, *params.RewardPercentiles...) + } + for i, rp := range rewardPercentiles { + if rp < 0 || rp > 100 { + return ethtypes.EthFeeHistory{}, fmt.Errorf("invalid reward percentile: %f should be between 0 and 100", rp) + } + if i > 0 && rp < rewardPercentiles[i-1] { + return ethtypes.EthFeeHistory{}, fmt.Errorf("invalid reward percentile: %f should be larger than %f", rp, rewardPercentiles[i-1]) + } + } - ts, err := a.parseBlkParam(ctx, params.NewestBlkNum) + ts, err := a.parseBlkParam(ctx, params.NewestBlkNum, false) if err != nil { return ethtypes.EthFeeHistory{}, fmt.Errorf("bad block parameter %s: %s", params.NewestBlkNum, err) } - // Deal with the case that the chain is shorter than the number of requested blocks. - oldestBlkHeight := uint64(1) - if abi.ChainEpoch(params.BlkCount) <= ts.Height() { - oldestBlkHeight = uint64(ts.Height()) - uint64(params.BlkCount) + 1 - } - - // NOTE: baseFeePerGas should include the next block after the newest of the returned range, - // because the next base fee can be inferred from the messages in the newest block. - // However, this is NOT the case in Filecoin due to deferred execution, so the best - // we can do is duplicate the last value. - baseFeeArray := []ethtypes.EthBigInt{ethtypes.EthBigInt(ts.Blocks()[0].ParentBaseFee)} - gasUsedRatioArray := []float64{} + var ( + basefee = ts.Blocks()[0].ParentBaseFee + oldestBlkHeight = uint64(1) + + // NOTE: baseFeePerGas should include the next block after the newest of the returned range, + // because the next base fee can be inferred from the messages in the newest block. + // However, this is NOT the case in Filecoin due to deferred execution, so the best + // we can do is duplicate the last value. + baseFeeArray = []ethtypes.EthBigInt{ethtypes.EthBigInt(basefee)} + rewardsArray = make([][]ethtypes.EthBigInt, 0) + gasUsedRatioArray = []float64{} + blocksIncluded int + ) - for ts.Height() >= abi.ChainEpoch(oldestBlkHeight) { - // Unfortunately we need to rebuild the full message view so we can - // totalize gas used in the tipset. - block, err := newEthBlockFromFilecoinTipSet(ctx, ts, false, a.Chain, a.StateAPI) + for blocksIncluded < int(params.BlkCount) && ts.Height() > 0 { + msgs, rcpts, err := messagesAndReceipts(ctx, ts, a.Chain, a.StateAPI) if err != nil { - return ethtypes.EthFeeHistory{}, fmt.Errorf("cannot create eth block: %v", err) + return ethtypes.EthFeeHistory{}, xerrors.Errorf("failed to retrieve messages and receipts for height %d: %w", ts.Height(), err) + } + + txGasRewards := gasRewardSorter{} + for i, msg := range msgs { + effectivePremium := msg.VMMessage().EffectiveGasPremium(basefee) + txGasRewards = append(txGasRewards, gasRewardTuple{ + premium: effectivePremium, + gasUsed: rcpts[i].GasUsed, + }) } - // both arrays should be reversed at the end - baseFeeArray = append(baseFeeArray, ethtypes.EthBigInt(ts.Blocks()[0].ParentBaseFee)) - gasUsedRatioArray = append(gasUsedRatioArray, float64(block.GasUsed)/float64(build.BlockGasLimit)) + rewards, totalGasUsed := calculateRewardsAndGasUsed(rewardPercentiles, txGasRewards) + + // arrays should be reversed at the end + baseFeeArray = append(baseFeeArray, ethtypes.EthBigInt(basefee)) + gasUsedRatioArray = append(gasUsedRatioArray, float64(totalGasUsed)/float64(build.BlockGasLimit)) + rewardsArray = append(rewardsArray, rewards) + oldestBlkHeight = uint64(ts.Height()) + blocksIncluded++ parentTsKey := ts.Parents() ts, err = a.Chain.LoadTipSet(ctx, parentTsKey) @@ -634,6 +750,9 @@ func (a *EthModule) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (eth for i, j := 0, len(gasUsedRatioArray)-1; i < j; i, j = i+1, j-1 { gasUsedRatioArray[i], gasUsedRatioArray[j] = gasUsedRatioArray[j], gasUsedRatioArray[i] } + for i, j := 0, len(rewardsArray)-1; i < j; i, j = i+1, j-1 { + rewardsArray[i], rewardsArray[j] = rewardsArray[j], rewardsArray[i] + } ret := ethtypes.EthFeeHistory{ OldestBlock: ethtypes.EthUint64(oldestBlkHeight), @@ -641,24 +760,13 @@ func (a *EthModule) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (eth GasUsedRatio: gasUsedRatioArray, } if params.RewardPercentiles != nil { - // TODO: Populate reward percentiles - // https://github.com/filecoin-project/lotus/issues/10236 - // We need to calculate the requested percentiles of effective gas premium - // based on the newest block (I presume it's the newest, we need to dig in - // as it's underspecified). Effective means we're clamped at the gas_fee_cap - base_fee. - reward := make([][]ethtypes.EthBigInt, 0) - ret.Reward = &reward + ret.Reward = &rewardsArray } return ret, nil } -func (a *EthModule) NetVersion(ctx context.Context) (string, error) { - // Note that networkId is not encoded in hex - nv, err := a.StateNetworkVersion(ctx, types.EmptyTSK) - if err != nil { - return "", err - } - return strconv.FormatUint(uint64(nv), 10), nil +func (a *EthModule) NetVersion(_ context.Context) (string, error) { + return strconv.FormatInt(build.Eip155ChainId, 10), nil } func (a *EthModule) NetListening(ctx context.Context) (bool, error) { @@ -739,18 +847,20 @@ func (a *EthModule) ethCallToFilecoinMessage(ctx context.Context, tx ethtypes.Et } var params []byte - var to address.Address - var method abi.MethodNum - if tx.To == nil { - // this is a contract creation - to = builtintypes.EthereumAddressManagerActorAddr - + if len(tx.Data) > 0 { initcode := abi.CborBytes(tx.Data) params2, err := actors.SerializeParams(&initcode) if err != nil { - return nil, fmt.Errorf("failed to serialize Create params: %w", err) + return nil, fmt.Errorf("failed to serialize params: %w", err) } params = params2 + } + + var to address.Address + var method abi.MethodNum + if tx.To == nil { + // this is a contract creation + to = builtintypes.EthereumAddressManagerActorAddr method = builtintypes.MethodsEAM.CreateExternal } else { addr, err := tx.To.ToFilecoinAddress() @@ -758,15 +868,6 @@ func (a *EthModule) ethCallToFilecoinMessage(ctx context.Context, tx ethtypes.Et return nil, xerrors.Errorf("cannot get Filecoin address: %w", err) } to = addr - - if len(tx.Data) > 0 { - var buf bytes.Buffer - if err := cbg.WriteByteArray(&buf, tx.Data); err != nil { - return nil, fmt.Errorf("failed to encode tx input into a cbor byte-string") - } - params = buf.Bytes() - } - method = builtintypes.MethodsEVM.InvokeContract } @@ -788,9 +889,14 @@ func (a *EthModule) applyMessage(ctx context.Context, msg *types.Message, tsk ty return nil, xerrors.Errorf("cannot get tipset: %w", err) } + applyTsMessages := true + if os.Getenv("LOTUS_SKIP_APPLY_TS_MESSAGE_CALL_WITH_GAS") == "1" { + applyTsMessages = false + } + // Try calling until we find a height with no migration. for { - res, err = a.StateManager.CallWithGas(ctx, msg, []types.ChainMsg{}, ts) + res, err = a.StateManager.CallWithGas(ctx, msg, []types.ChainMsg{}, ts, applyTsMessages) if err != stmgr.ErrExpensiveFork { break } @@ -803,7 +909,8 @@ func (a *EthModule) applyMessage(ctx context.Context, msg *types.Message, tsk ty return nil, xerrors.Errorf("CallWithGas failed: %w", err) } if res.MsgRct.ExitCode.IsError() { - return nil, xerrors.Errorf("message execution failed: exit %s, msg receipt: %s, reason: %s", res.MsgRct.ExitCode, res.MsgRct.Return, res.Error) + reason := parseEthRevert(res.MsgRct.Return) + return nil, xerrors.Errorf("message execution failed: exit %s, revert reason: %s, vm error: %s", res.MsgRct.ExitCode, reason, res.Error) } return res, nil } @@ -819,14 +926,24 @@ func (a *EthModule) EthEstimateGas(ctx context.Context, tx ethtypes.EthCall) (et msg.GasLimit = 0 ts := a.Chain.GetHeaviestTipSet() - msg, err = a.GasAPI.GasEstimateMessageGas(ctx, msg, nil, ts.Key()) - if err != nil { + gassedMsg, err := a.GasAPI.GasEstimateMessageGas(ctx, msg, nil, ts.Key()) + if err != nil { + // On failure, GasEstimateMessageGas doesn't actually return the invocation result, + // it just returns an error. That means we can't get the revert reason. + // + // So we re-execute the message with EthCall (well, applyMessage which contains the + // guts of EthCall). This will give us an ethereum specific error with revert + // information. + msg.GasLimit = build.BlockGasLimit + if _, err2 := a.applyMessage(ctx, msg, ts.Key()); err2 != nil { + err = err2 + } return ethtypes.EthUint64(0), xerrors.Errorf("failed to estimate gas: %w", err) } - expectedGas, err := ethGasSearch(ctx, a.Chain, a.Stmgr, a.Mpool, msg, ts) + expectedGas, err := ethGasSearch(ctx, a.Chain, a.Stmgr, a.Mpool, gassedMsg, ts) if err != nil { - log.Errorw("expected gas", "err", err) + return 0, xerrors.Errorf("gas search failed: %w", err) } return ethtypes.EthUint64(expectedGas), nil @@ -848,10 +965,15 @@ func gasSearch( high := msg.GasLimit low := msg.GasLimit + applyTsMessages := true + if os.Getenv("LOTUS_SKIP_APPLY_TS_MESSAGE_CALL_WITH_GAS") == "1" { + applyTsMessages = false + } + canSucceed := func(limit int64) (bool, error) { msg.GasLimit = limit - res, err := smgr.CallWithGas(ctx, &msg, priorMsgs, ts) + res, err := smgr.CallWithGas(ctx, &msg, priorMsgs, ts, applyTsMessages) if err != nil { return false, xerrors.Errorf("CallWithGas failed: %w", err) } @@ -957,14 +1079,14 @@ func (a *EthModule) EthCall(ctx context.Context, tx ethtypes.EthCall, blkParam s return nil, xerrors.Errorf("failed to convert ethcall to filecoin message: %w", err) } - ts, err := a.parseBlkParam(ctx, blkParam) + ts, err := a.parseBlkParam(ctx, blkParam, false) if err != nil { return nil, xerrors.Errorf("cannot parse block param: %s", blkParam) } invokeResult, err := a.applyMessage(ctx, msg, ts.Key()) if err != nil { - return nil, xerrors.Errorf("failed to apply message: %w", err) + return nil, err } if msg.To == builtintypes.EthereumAddressManagerActorAddr { @@ -1234,8 +1356,9 @@ func (e *EthEvent) uninstallFilter(ctx context.Context, f filter.Filter) error { } const ( - EthSubscribeEventTypeHeads = "newHeads" - EthSubscribeEventTypeLogs = "logs" + EthSubscribeEventTypeHeads = "newHeads" + EthSubscribeEventTypeLogs = "logs" + EthSubscribeEventTypePendingTransactions = "newPendingTransactions" ) func (e *EthEvent) EthSubscribe(ctx context.Context, p jsonrpc.RawParams) (ethtypes.EthSubscriptionID, error) { @@ -1253,7 +1376,7 @@ func (e *EthEvent) EthSubscribe(ctx context.Context, p jsonrpc.RawParams) (ethty return ethtypes.EthSubscriptionID{}, xerrors.Errorf("connection doesn't support callbacks") } - sub, err := e.SubManager.StartSubscription(e.SubscribtionCtx, ethCb.EthSubscription) + sub, err := e.SubManager.StartSubscription(e.SubscribtionCtx, ethCb.EthSubscription, e.uninstallFilter) if err != nil { return ethtypes.EthSubscriptionID{}, err } @@ -1297,6 +1420,15 @@ func (e *EthEvent) EthSubscribe(ctx context.Context, p jsonrpc.RawParams) (ethty _, _ = e.EthUnsubscribe(ctx, sub.id) return ethtypes.EthSubscriptionID{}, err } + sub.addFilter(ctx, f) + case EthSubscribeEventTypePendingTransactions: + f, err := e.MemPoolFilterManager.Install(ctx) + if err != nil { + // clean up any previous filters added and stop the sub + _, _ = e.EthUnsubscribe(ctx, sub.id) + return ethtypes.EthSubscriptionID{}, err + } + sub.addFilter(ctx, f) default: return ethtypes.EthSubscriptionID{}, xerrors.Errorf("unsupported event type: %s", params.EventType) @@ -1310,18 +1442,11 @@ func (e *EthEvent) EthUnsubscribe(ctx context.Context, id ethtypes.EthSubscripti return false, api.ErrNotSupported } - filters, err := e.SubManager.StopSubscription(ctx, id) + err := e.SubManager.StopSubscription(ctx, id) if err != nil { return false, nil } - for _, f := range filters { - if err := e.uninstallFilter(ctx, f); err != nil { - // this will leave the filter a zombie, collecting events up to the maximum allowed - log.Warnf("failed to remove filter when unsubscribing: %v", err) - } - } - return true, nil } @@ -1507,7 +1632,7 @@ type EthSubscriptionManager struct { subs map[ethtypes.EthSubscriptionID]*ethSubscription } -func (e *EthSubscriptionManager) StartSubscription(ctx context.Context, out ethSubscriptionCallback) (*ethSubscription, error) { // nolint +func (e *EthSubscriptionManager) StartSubscription(ctx context.Context, out ethSubscriptionCallback, dropFilter func(context.Context, filter.Filter) error) (*ethSubscription, error) { // nolint rawid, err := uuid.NewRandom() if err != nil { return nil, xerrors.Errorf("new uuid: %w", err) @@ -1518,13 +1643,17 @@ func (e *EthSubscriptionManager) StartSubscription(ctx context.Context, out ethS ctx, quit := context.WithCancel(ctx) sub := ðSubscription{ - Chain: e.Chain, - StateAPI: e.StateAPI, - ChainAPI: e.ChainAPI, - id: id, - in: make(chan interface{}, 200), - out: out, - quit: quit, + Chain: e.Chain, + StateAPI: e.StateAPI, + ChainAPI: e.ChainAPI, + uninstallFilter: dropFilter, + id: id, + in: make(chan interface{}, 200), + out: out, + quit: quit, + + toSend: queue.New[[]byte](), + sendCond: make(chan struct{}, 1), } e.mu.Lock() @@ -1535,37 +1664,46 @@ func (e *EthSubscriptionManager) StartSubscription(ctx context.Context, out ethS e.mu.Unlock() go sub.start(ctx) + go sub.startOut(ctx) return sub, nil } -func (e *EthSubscriptionManager) StopSubscription(ctx context.Context, id ethtypes.EthSubscriptionID) ([]filter.Filter, error) { +func (e *EthSubscriptionManager) StopSubscription(ctx context.Context, id ethtypes.EthSubscriptionID) error { e.mu.Lock() defer e.mu.Unlock() sub, ok := e.subs[id] if !ok { - return nil, xerrors.Errorf("subscription not found") + return xerrors.Errorf("subscription not found") } sub.stop() delete(e.subs, id) - return sub.filters, nil + return nil } type ethSubscriptionCallback func(context.Context, jsonrpc.RawParams) error +const maxSendQueue = 20000 + type ethSubscription struct { - Chain *store.ChainStore - StateAPI StateAPI - ChainAPI ChainAPI - id ethtypes.EthSubscriptionID - in chan interface{} - out ethSubscriptionCallback + Chain *store.ChainStore + StateAPI StateAPI + ChainAPI ChainAPI + uninstallFilter func(context.Context, filter.Filter) error + id ethtypes.EthSubscriptionID + in chan interface{} + out ethSubscriptionCallback mu sync.Mutex filters []filter.Filter quit func() + + sendLk sync.Mutex + sendQueueLen int + toSend *queue.Queue[[]byte] + sendCond chan struct{} } func (e *ethSubscription) addFilter(ctx context.Context, f filter.Filter) { @@ -1576,6 +1714,36 @@ func (e *ethSubscription) addFilter(ctx context.Context, f filter.Filter) { e.filters = append(e.filters, f) } +// sendOut processes the final subscription queue. It's here in case the subscriber +// is slow, and we need to buffer the messages. +func (e *ethSubscription) startOut(ctx context.Context) { + for { + select { + case <-ctx.Done(): + return + case <-e.sendCond: + e.sendLk.Lock() + + for !e.toSend.Empty() { + front := e.toSend.Dequeue() + e.sendQueueLen-- + + e.sendLk.Unlock() + + if err := e.out(ctx, front); err != nil { + log.Warnw("error sending subscription response, killing subscription", "sub", e.id, "error", err) + e.stop() + return + } + + e.sendLk.Lock() + } + + e.sendLk.Unlock() + } + } +} + func (e *ethSubscription) send(ctx context.Context, v interface{}) { resp := ethtypes.EthSubscriptionResponse{ SubscriptionID: e.id, @@ -1588,10 +1756,22 @@ func (e *ethSubscription) send(ctx context.Context, v interface{}) { return } - if err := e.out(ctx, outParam); err != nil { - log.Warnw("sending subscription response", "sub", e.id, "error", err) + e.sendLk.Lock() + defer e.sendLk.Unlock() + + e.toSend.Enqueue(outParam) + + e.sendQueueLen++ + if e.sendQueueLen > maxSendQueue { + log.Warnw("subscription send queue full, killing subscription", "sub", e.id) + e.stop() return } + + select { + case e.sendCond <- struct{}{}: + default: // already signalled, and we're holding the lock so we know that the event will be processed + } } func (e *ethSubscription) start(ctx context.Context) { @@ -1617,6 +1797,15 @@ func (e *ethSubscription) start(ctx context.Context) { } e.send(ctx, ev) + case *types.SignedMessage: // mpool txid + evs, err := ethFilterResultFromMessages([]*types.SignedMessage{vt}, e.StateAPI) + if err != nil { + continue + } + + for _, r := range evs.Results { + e.send(ctx, r) + } default: log.Warnf("unexpected subscription value type: %T", vt) } @@ -1626,20 +1815,28 @@ func (e *ethSubscription) start(ctx context.Context) { func (e *ethSubscription) stop() { e.mu.Lock() - defer e.mu.Unlock() + if e.quit == nil { + e.mu.Unlock() + return + } if e.quit != nil { e.quit() e.quit = nil + e.mu.Unlock() + + for _, f := range e.filters { + // note: the context in actually unused in uninstallFilter + if err := e.uninstallFilter(context.TODO(), f); err != nil { + // this will leave the filter a zombie, collecting events up to the maximum allowed + log.Warnf("failed to remove filter when unsubscribing: %v", err) + } + } } } func newEthBlockFromFilecoinTipSet(ctx context.Context, ts *types.TipSet, fullTxInfo bool, cs *store.ChainStore, sa StateAPI) (ethtypes.EthBlock, error) { - parent, err := cs.LoadTipSet(ctx, ts.Parents()) - if err != nil { - return ethtypes.EthBlock{}, err - } - parentKeyCid, err := parent.Key().Cid() + parentKeyCid, err := ts.Parents().Cid() if err != nil { return ethtypes.EthBlock{}, err } @@ -1648,6 +1845,8 @@ func newEthBlockFromFilecoinTipSet(ctx context.Context, ts *types.TipSet, fullTx return ethtypes.EthBlock{}, err } + bn := ethtypes.EthUint64(ts.Height()) + blkCid, err := ts.Key().Cid() if err != nil { return ethtypes.EthBlock{}, err @@ -1657,27 +1856,42 @@ func newEthBlockFromFilecoinTipSet(ctx context.Context, ts *types.TipSet, fullTx return ethtypes.EthBlock{}, err } - msgs, err := cs.MessagesForTipset(ctx, ts) + msgs, rcpts, err := messagesAndReceipts(ctx, ts, cs, sa) if err != nil { - return ethtypes.EthBlock{}, xerrors.Errorf("error loading messages for tipset: %v: %w", ts, err) + return ethtypes.EthBlock{}, xerrors.Errorf("failed to retrieve messages and receipts: %w", err) } block := ethtypes.NewEthBlock(len(msgs) > 0) - // this seems to be a very expensive way to get gasUsed of the block. may need to find an efficient way to do it gasUsed := int64(0) - for txIdx, msg := range msgs { - msgLookup, err := sa.StateSearchMsg(ctx, types.EmptyTSK, msg.Cid(), api.LookbackNoLimit, false) - if err != nil || msgLookup == nil { - return ethtypes.EthBlock{}, nil + for i, msg := range msgs { + rcpt := rcpts[i] + ti := ethtypes.EthUint64(i) + gasUsed += rcpt.GasUsed + var smsg *types.SignedMessage + switch msg := msg.(type) { + case *types.SignedMessage: + smsg = msg + case *types.Message: + smsg = &types.SignedMessage{ + Message: *msg, + Signature: crypto.Signature{ + Type: crypto.SigTypeBLS, + }, + } + default: + return ethtypes.EthBlock{}, xerrors.Errorf("failed to get signed msg %s: %w", msg.Cid(), err) } - gasUsed += msgLookup.Receipt.GasUsed - - tx, err := newEthTxFromMessageLookup(ctx, msgLookup, txIdx, cs, sa) + tx, err := newEthTxFromSignedMessage(ctx, smsg, sa) if err != nil { - return ethtypes.EthBlock{}, nil + return ethtypes.EthBlock{}, xerrors.Errorf("failed to convert msg to ethTx: %w", err) } + tx.ChainID = ethtypes.EthUint64(build.Eip155ChainId) + tx.BlockHash = &blkHash + tx.BlockNumber = &bn + tx.TransactionIndex = &ti + if fullTxInfo { block.Transactions = append(block.Transactions, tx) } else { @@ -1686,7 +1900,7 @@ func newEthBlockFromFilecoinTipSet(ctx context.Context, ts *types.TipSet, fullTx } block.Hash = blkHash - block.Number = ethtypes.EthUint64(ts.Height()) + block.Number = bn block.ParentHash = parentBlkHash block.Timestamp = ethtypes.EthUint64(ts.Blocks()[0].Timestamp) block.BaseFeePerGas = ethtypes.EthBigInt{Int: ts.Blocks()[0].ParentBaseFee.Int} @@ -1694,6 +1908,29 @@ func newEthBlockFromFilecoinTipSet(ctx context.Context, ts *types.TipSet, fullTx return block, nil } +func messagesAndReceipts(ctx context.Context, ts *types.TipSet, cs *store.ChainStore, sa StateAPI) ([]types.ChainMsg, []types.MessageReceipt, error) { + msgs, err := cs.MessagesForTipset(ctx, ts) + if err != nil { + return nil, nil, xerrors.Errorf("error loading messages for tipset: %v: %w", ts, err) + } + + _, rcptRoot, err := sa.StateManager.TipSetState(ctx, ts) + if err != nil { + return nil, nil, xerrors.Errorf("failed to compute state: %w", err) + } + + rcpts, err := cs.ReadReceipts(ctx, rcptRoot) + if err != nil { + return nil, nil, xerrors.Errorf("error loading receipts for tipset: %v: %w", ts, err) + } + + if len(msgs) != len(rcpts) { + return nil, nil, xerrors.Errorf("receipts and message array lengths didn't match for tipset: %v: %w", ts, err) + } + + return msgs, rcpts, nil +} + // lookupEthAddress makes its best effort at finding the Ethereum address for a // Filecoin address. It does the following: // @@ -1867,20 +2104,9 @@ func newEthTxFromMessageLookup(ctx context.Context, msgLookup *api.MsgLookup, tx return ethtypes.EthTx{}, err } - smsg, err := cs.GetSignedMessage(ctx, msgLookup.Message) + smsg, err := getSignedMessage(ctx, cs, msgLookup.Message) if err != nil { - // We couldn't find the signed message, it might be a BLS message, so search for a regular message. - msg, err := cs.GetMessage(ctx, msgLookup.Message) - if err != nil { - return ethtypes.EthTx{}, err - } - smsg = &types.SignedMessage{ - Message: *msg, - Signature: crypto.Signature{ - Type: crypto.SigTypeBLS, - Data: nil, - }, - } + return ethtypes.EthTx{}, xerrors.Errorf("failed to get signed msg: %w", err) } tx, err := newEthTxFromSignedMessage(ctx, smsg, sa) @@ -1900,7 +2126,7 @@ func newEthTxFromMessageLookup(ctx context.Context, msgLookup *api.MsgLookup, tx return tx, nil } -func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLookup, replay *api.InvocResult, events []types.Event, sa StateAPI) (api.EthTxReceipt, error) { +func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLookup, events []types.Event, cs *store.ChainStore, sa StateAPI) (api.EthTxReceipt, error) { var ( transactionIndex ethtypes.EthUint64 blockHash ethtypes.EthHash @@ -1931,8 +2157,7 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook if lookup.Receipt.ExitCode.IsSuccess() { receipt.Status = 1 - } - if lookup.Receipt.ExitCode.IsError() { + } else { receipt.Status = 0 } @@ -1941,7 +2166,20 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook // TODO: handle CumulativeGasUsed receipt.CumulativeGasUsed = ethtypes.EmptyEthInt - effectiveGasPrice := big.Div(replay.GasCost.TotalCost, big.NewInt(lookup.Receipt.GasUsed)) + // TODO: avoid loading the tipset twice (once here, once when we convert the message to a txn) + ts, err := cs.GetTipSetFromKey(ctx, lookup.TipSet) + if err != nil { + return api.EthTxReceipt{}, xerrors.Errorf("failed to lookup tipset %s when constructing the eth txn receipt: %w", lookup.TipSet, err) + } + + baseFee := ts.Blocks()[0].ParentBaseFee + gasOutputs := vm.ComputeGasOutputs(lookup.Receipt.GasUsed, int64(tx.Gas), baseFee, big.Int(tx.MaxFeePerGas), big.Int(tx.MaxPriorityFeePerGas), true) + totalSpent := big.Sum(gasOutputs.BaseFeeBurn, gasOutputs.MinerTip, gasOutputs.OverEstimationBurn) + + effectiveGasPrice := big.Zero() + if lookup.Receipt.GasUsed > 0 { + effectiveGasPrice = big.Div(totalSpent, big.NewInt(lookup.Receipt.GasUsed)) + } receipt.EffectiveGasPrice = ethtypes.EthBigInt(effectiveGasPrice) if receipt.To == nil && lookup.Receipt.ExitCode.IsSuccess() { @@ -2069,11 +2307,13 @@ func (m *EthTxHashManager) ProcessSignedMessage(ctx context.Context, msg *types. ethTx, err := newEthTxFromSignedMessage(ctx, msg, m.StateAPI) if err != nil { log.Errorf("error converting filecoin message to eth tx: %s", err) + return } err = m.TransactionHashLookup.UpsertHash(ethTx.Hash, msg.Cid()) if err != nil { log.Errorf("error inserting tx mapping to db: %s", err) + return } } @@ -2123,3 +2363,148 @@ func parseEthTopics(topics ethtypes.EthTopicSpec) (map[string][][]byte, error) { } return keys, nil } + +const errorFunctionSelector = "\x08\xc3\x79\xa0" // Error(string) +const panicFunctionSelector = "\x4e\x48\x7b\x71" // Panic(uint256) +// Eth ABI (solidity) panic codes. +var panicErrorCodes map[uint64]string = map[uint64]string{ + 0x00: "Panic()", + 0x01: "Assert()", + 0x11: "ArithmeticOverflow()", + 0x12: "DivideByZero()", + 0x21: "InvalidEnumVariant()", + 0x22: "InvalidStorageArray()", + 0x31: "PopEmptyArray()", + 0x32: "ArrayIndexOutOfBounds()", + 0x41: "OutOfMemory()", + 0x51: "CalledUninitializedFunction()", +} + +// Parse an ABI encoded revert reason. This reason should be encoded as if it were the parameters to +// an `Error(string)` function call. +// +// See https://docs.soliditylang.org/en/latest/control-structures.html#panic-via-assert-and-error-via-require +func parseEthRevert(ret []byte) string { + if len(ret) == 0 { + return "none" + } + var cbytes abi.CborBytes + if err := cbytes.UnmarshalCBOR(bytes.NewReader(ret)); err != nil { + return "ERROR: revert reason is not cbor encoded bytes" + } + if len(cbytes) == 0 { + return "none" + } + // If it's not long enough to contain an ABI encoded response, return immediately. + if len(cbytes) < 4+32 { + return ethtypes.EthBytes(cbytes).String() + } + switch string(cbytes[:4]) { + case panicFunctionSelector: + cbytes := cbytes[4 : 4+32] + // Read the and check the code. + code, err := ethtypes.EthUint64FromBytes(cbytes) + if err != nil { + // If it's too big, just return the raw value. + codeInt := big.PositiveFromUnsignedBytes(cbytes) + return fmt.Sprintf("Panic(%s)", ethtypes.EthBigInt(codeInt).String()) + } + if s, ok := panicErrorCodes[uint64(code)]; ok { + return s + } + return fmt.Sprintf("Panic(0x%x)", code) + case errorFunctionSelector: + cbytes := cbytes[4:] + cbytesLen := ethtypes.EthUint64(len(cbytes)) + // Read the and check the offset. + offset, err := ethtypes.EthUint64FromBytes(cbytes[:32]) + if err != nil { + break + } + if cbytesLen < offset { + break + } + + // Read and check the length. + if cbytesLen-offset < 32 { + break + } + start := offset + 32 + length, err := ethtypes.EthUint64FromBytes(cbytes[offset : offset+32]) + if err != nil { + break + } + if cbytesLen-start < length { + break + } + // Slice the error message. + return fmt.Sprintf("Error(%s)", cbytes[start:start+length]) + } + return ethtypes.EthBytes(cbytes).String() +} + +func calculateRewardsAndGasUsed(rewardPercentiles []float64, txGasRewards gasRewardSorter) ([]ethtypes.EthBigInt, int64) { + var gasUsedTotal int64 + for _, tx := range txGasRewards { + gasUsedTotal += tx.gasUsed + } + + rewards := make([]ethtypes.EthBigInt, len(rewardPercentiles)) + for i := range rewards { + rewards[i] = ethtypes.EthBigInt(types.NewInt(MinGasPremium)) + } + + if len(txGasRewards) == 0 { + return rewards, gasUsedTotal + } + + sort.Stable(txGasRewards) + + var idx int + var sum int64 + for i, percentile := range rewardPercentiles { + threshold := int64(float64(gasUsedTotal) * percentile / 100) + for sum < threshold && idx < len(txGasRewards)-1 { + sum += txGasRewards[idx].gasUsed + idx++ + } + rewards[i] = ethtypes.EthBigInt(txGasRewards[idx].premium) + } + + return rewards, gasUsedTotal +} + +func getSignedMessage(ctx context.Context, cs *store.ChainStore, msgCid cid.Cid) (*types.SignedMessage, error) { + smsg, err := cs.GetSignedMessage(ctx, msgCid) + if err != nil { + // We couldn't find the signed message, it might be a BLS message, so search for a regular message. + msg, err := cs.GetMessage(ctx, msgCid) + if err != nil { + return nil, xerrors.Errorf("failed to find msg %s: %w", msgCid, err) + } + smsg = &types.SignedMessage{ + Message: *msg, + Signature: crypto.Signature{ + Type: crypto.SigTypeBLS, + }, + } + } + + return smsg, nil +} + +type gasRewardTuple struct { + gasUsed int64 + premium abi.TokenAmount +} + +// sorted in ascending order +type gasRewardSorter []gasRewardTuple + +func (g gasRewardSorter) Len() int { return len(g) } +func (g gasRewardSorter) Swap(i, j int) { + g[i], g[j] = g[j], g[i] +} +func (g gasRewardSorter) Less(i, j int) bool { + return g[i].premium.Int.Cmp(g[j].premium.Int) == -1 +} diff --git a/node/impl/full/eth_test.go b/node/impl/full/eth_test.go index 027becf34c..87c0852fbd 100644 --- a/node/impl/full/eth_test.go +++ b/node/impl/full/eth_test.go @@ -6,6 +6,8 @@ import ( "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" ) @@ -100,3 +102,62 @@ func TestEthLogFromEvent(t *testing.T) { require.Len(t, topics, 1) require.Equal(t, topics[0], ethtypes.EthHash{}) } + +func TestReward(t *testing.T) { + baseFee := big.NewInt(100) + testcases := []struct { + maxFeePerGas, maxPriorityFeePerGas big.Int + answer big.Int + }{ + {maxFeePerGas: big.NewInt(600), maxPriorityFeePerGas: big.NewInt(200), answer: big.NewInt(200)}, + {maxFeePerGas: big.NewInt(600), maxPriorityFeePerGas: big.NewInt(300), answer: big.NewInt(300)}, + {maxFeePerGas: big.NewInt(600), maxPriorityFeePerGas: big.NewInt(500), answer: big.NewInt(500)}, + {maxFeePerGas: big.NewInt(600), maxPriorityFeePerGas: big.NewInt(600), answer: big.NewInt(500)}, + {maxFeePerGas: big.NewInt(600), maxPriorityFeePerGas: big.NewInt(1000), answer: big.NewInt(500)}, + {maxFeePerGas: big.NewInt(50), maxPriorityFeePerGas: big.NewInt(200), answer: big.NewInt(-50)}, + } + for _, tc := range testcases { + msg := &types.Message{GasFeeCap: tc.maxFeePerGas, GasPremium: tc.maxPriorityFeePerGas} + reward := msg.EffectiveGasPremium(baseFee) + require.Equal(t, 0, reward.Int.Cmp(tc.answer.Int), reward, tc.answer) + } +} + +func TestRewardPercentiles(t *testing.T) { + testcases := []struct { + percentiles []float64 + txGasRewards gasRewardSorter + answer []int64 + }{ + { + percentiles: []float64{25, 50, 75}, + txGasRewards: []gasRewardTuple{}, + answer: []int64{MinGasPremium, MinGasPremium, MinGasPremium}, + }, + { + percentiles: []float64{25, 50, 75, 100}, + txGasRewards: []gasRewardTuple{ + {gasUsed: int64(0), premium: big.NewInt(300)}, + {gasUsed: int64(100), premium: big.NewInt(200)}, + {gasUsed: int64(350), premium: big.NewInt(100)}, + {gasUsed: int64(500), premium: big.NewInt(600)}, + {gasUsed: int64(300), premium: big.NewInt(700)}, + }, + answer: []int64{200, 700, 700, 700}, + }, + } + for _, tc := range testcases { + rewards, totalGasUsed := calculateRewardsAndGasUsed(tc.percentiles, tc.txGasRewards) + var gasUsed int64 + for _, tx := range tc.txGasRewards { + gasUsed += tx.gasUsed + } + ans := []ethtypes.EthBigInt{} + for _, bi := range tc.answer { + ans = append(ans, ethtypes.EthBigInt(big.NewInt(bi))) + } + require.Equal(t, totalGasUsed, gasUsed) + require.Equal(t, len(ans), len(tc.percentiles)) + require.Equal(t, ans, rewards) + } +} diff --git a/node/impl/full/gas.go b/node/impl/full/gas.go index 4688bfc7c0..4ff943f36e 100644 --- a/node/impl/full/gas.go +++ b/node/impl/full/gas.go @@ -4,9 +4,10 @@ import ( "context" "math" "math/rand" + "os" "sort" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "go.uber.org/fx" "golang.org/x/xerrors" @@ -61,7 +62,7 @@ type GasAPI struct { func NewGasPriceCache() *GasPriceCache { // 50 because we usually won't access more than 40 - c, err := lru.New2Q(50) + c, err := lru.New2Q[types.TipSetKey, []GasMeta](50) if err != nil { // err only if parameter is bad panic(err) @@ -73,7 +74,7 @@ func NewGasPriceCache() *GasPriceCache { } type GasPriceCache struct { - c *lru.TwoQueueCache + c *lru.TwoQueueCache[types.TipSetKey, []GasMeta] } type GasMeta struct { @@ -84,7 +85,7 @@ type GasMeta struct { func (g *GasPriceCache) GetTSGasStats(ctx context.Context, cstore *store.ChainStore, ts *types.TipSet) ([]GasMeta, error) { i, has := g.c.Get(ts.Key()) if has { - return i.([]GasMeta), nil + return i, nil } var prices []GasMeta @@ -276,10 +277,15 @@ func gasEstimateCallWithGas( priorMsgs = append(priorMsgs, m) } + applyTsMessages := true + if os.Getenv("LOTUS_SKIP_APPLY_TS_MESSAGE_CALL_WITH_GAS") == "1" { + applyTsMessages = false + } + // Try calling until we find a height with no migration. var res *api.InvocResult for { - res, err = smgr.CallWithGas(ctx, &msg, priorMsgs, ts) + res, err = smgr.CallWithGas(ctx, &msg, priorMsgs, ts, applyTsMessages) if err != stmgr.ErrExpensiveFork { break } @@ -327,10 +333,15 @@ func gasEstimateGasLimit( transitionalMulti := 1.0 // Overestimate gas around the upgrade - if ts.Height() <= build.UpgradeSkyrHeight && (build.UpgradeSkyrHeight-ts.Height() <= 20) { - transitionalMulti = 2.0 - + if ts.Height() <= build.UpgradeHyggeHeight && (build.UpgradeHyggeHeight-ts.Height() <= 20) { func() { + + // Bare transfers get about 3x more expensive: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0057.md#product-considerations + if msgIn.Method == builtin.MethodSend { + transitionalMulti = 3.0 + return + } + st, err := smgr.ParentState(ts) if err != nil { return @@ -342,26 +353,27 @@ func gasEstimateGasLimit( if lbuiltin.IsStorageMinerActor(act.Code) { switch msgIn.Method { - case 5: - transitionalMulti = 3.954 + case 3: + transitionalMulti = 1.92 + case 4: + transitionalMulti = 1.72 case 6: - transitionalMulti = 4.095 + transitionalMulti = 1.06 case 7: - // skip, stay at 2.0 - // transitionalMulti = 1.289 - case 11: - transitionalMulti = 17.8758 + transitionalMulti = 1.2 case 16: - transitionalMulti = 2.1704 - case 25: - transitionalMulti = 3.1177 + transitionalMulti = 1.19 + case 18: + transitionalMulti = 1.73 + case 23: + transitionalMulti = 1.73 case 26: - transitionalMulti = 2.3322 + transitionalMulti = 1.15 + case 27: + transitionalMulti = 1.18 default: } } - - // skip storage market, 80th percentie for everything ~1.9, leave it at 2.0 }() } ret = (ret * int64(transitionalMulti*1024)) >> 10 @@ -406,5 +418,7 @@ func (m *GasModule) GasEstimateMessageGas(ctx context.Context, msg *types.Messag msg.GasFeeCap = feeCap } + messagepool.CapGasFee(m.GetMaxFee, msg, spec) + return msg, nil } diff --git a/node/impl/net/net.go b/node/impl/net/net.go index c2ccbac0a5..271c56ea53 100644 --- a/node/impl/net/net.go +++ b/node/impl/net/net.go @@ -91,8 +91,12 @@ func (a *NetAPI) NetPeerInfo(_ context.Context, p peer.ID) (*api.ExtendedPeerInf protocols, err := a.Host.Peerstore().GetProtocols(p) if err == nil { - sort.Strings(protocols) - info.Protocols = protocols + protocolStrings := make([]string, 0, len(protocols)) + for _, protocol := range protocols { + protocolStrings = append(protocolStrings, string(protocol)) + } + sort.Strings(protocolStrings) + info.Protocols = protocolStrings } if cm := a.Host.ConnManager().GetTagInfo(p); cm != nil { diff --git a/node/impl/storminer.go b/node/impl/storminer.go index 56aa7afded..44ef7ee6a3 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -25,8 +25,8 @@ import ( "github.com/filecoin-project/dagstore/shard" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer" - gst "github.com/filecoin-project/go-data-transfer/transport/graphsync" + datatransfer "github.com/filecoin-project/go-data-transfer/v2" + gst "github.com/filecoin-project/go-data-transfer/v2/transport/graphsync" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/storagemarket" @@ -539,20 +539,8 @@ func (sm *StorageMinerAPI) MarketListDeals(ctx context.Context) ([]*api.MarketDe return sm.listDeals(ctx) } -func (sm *StorageMinerAPI) MarketListRetrievalDeals(ctx context.Context) ([]retrievalmarket.ProviderDealState, error) { - var out []retrievalmarket.ProviderDealState - deals := sm.RetrievalProvider.ListDeals() - - for _, deal := range deals { - if deal.ChannelID != nil { - if deal.ChannelID.Initiator == "" || deal.ChannelID.Responder == "" { - deal.ChannelID = nil // don't try to push unparsable peer IDs over jsonrpc - } - } - out = append(out, deal) - } - - return out, nil +func (sm *StorageMinerAPI) MarketListRetrievalDeals(ctx context.Context) ([]struct{}, error) { + return []struct{}{}, nil } func (sm *StorageMinerAPI) MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) { diff --git a/node/modules/blockstore.go b/node/modules/blockstore.go index 90b7b6183b..f96fd0db49 100644 --- a/node/modules/blockstore.go +++ b/node/modules/blockstore.go @@ -82,11 +82,14 @@ func SplitBlockstore(cfg *config.Chainstore) func(lc fx.Lifecycle, r repo.Locked } cfg := &splitstore.Config{ - MarkSetType: cfg.Splitstore.MarkSetType, - DiscardColdBlocks: cfg.Splitstore.ColdStoreType == "discard", - UniversalColdBlocks: cfg.Splitstore.ColdStoreType == "universal", - HotStoreMessageRetention: cfg.Splitstore.HotStoreMessageRetention, - HotStoreFullGCFrequency: cfg.Splitstore.HotStoreFullGCFrequency, + MarkSetType: cfg.Splitstore.MarkSetType, + DiscardColdBlocks: cfg.Splitstore.ColdStoreType == "discard", + UniversalColdBlocks: cfg.Splitstore.ColdStoreType == "universal", + HotStoreMessageRetention: cfg.Splitstore.HotStoreMessageRetention, + HotStoreFullGCFrequency: cfg.Splitstore.HotStoreFullGCFrequency, + HotstoreMaxSpaceTarget: cfg.Splitstore.HotStoreMaxSpaceTarget, + HotstoreMaxSpaceThreshold: cfg.Splitstore.HotStoreMaxSpaceThreshold, + HotstoreMaxSpaceSafetyBuffer: cfg.Splitstore.HotstoreMaxSpaceSafetyBuffer, } ss, err := splitstore.Open(path, ds, hot, cold, cfg) if err != nil { diff --git a/node/modules/chain.go b/node/modules/chain.go index b47bf2de55..3896eb691b 100644 --- a/node/modules/chain.go +++ b/node/modules/chain.go @@ -123,7 +123,7 @@ func NetworkName(mctx helpers.MetricsCtx, ctx := helpers.LifecycleCtx(mctx, lc) - sm, err := stmgr.NewStateManager(cs, tsexec, syscalls, us, nil) + sm, err := stmgr.NewStateManager(cs, tsexec, syscalls, us, nil, nil) if err != nil { return "", err } diff --git a/node/modules/client.go b/node/modules/client.go index 69f8db559b..9d8eef4217 100644 --- a/node/modules/client.go +++ b/node/modules/client.go @@ -13,10 +13,10 @@ import ( "go.uber.org/fx" "golang.org/x/xerrors" - "github.com/filecoin-project/go-data-transfer/channelmonitor" - dtimpl "github.com/filecoin-project/go-data-transfer/impl" - dtnet "github.com/filecoin-project/go-data-transfer/network" - dtgstransport "github.com/filecoin-project/go-data-transfer/transport/graphsync" + "github.com/filecoin-project/go-data-transfer/v2/channelmonitor" + dtimpl "github.com/filecoin-project/go-data-transfer/v2/impl" + dtnet "github.com/filecoin-project/go-data-transfer/v2/network" + dtgstransport "github.com/filecoin-project/go-data-transfer/v2/transport/graphsync" "github.com/filecoin-project/go-fil-markets/discovery" discoveryimpl "github.com/filecoin-project/go-fil-markets/discovery/impl" "github.com/filecoin-project/go-fil-markets/retrievalmarket" @@ -24,7 +24,6 @@ import ( rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" "github.com/filecoin-project/go-fil-markets/storagemarket" storageimpl "github.com/filecoin-project/go-fil-markets/storagemarket/impl" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" "github.com/filecoin-project/go-state-types/abi" @@ -95,15 +94,6 @@ func ClientBlockstore() dtypes.ClientBlockstore { return blockstore.WrapIDStore(blockstore.FromDatastore(datastore.NewMapDatastore())) } -// RegisterClientValidator is an initialization hook that registers the client -// request validator with the data transfer module as the validator for -// StorageDataTransferVoucher types -func RegisterClientValidator(crv dtypes.ClientRequestValidator, dtm dtypes.ClientDataTransfer) { - if err := dtm.RegisterVoucherType(&requestvalidation.StorageDataTransferVoucher{}, (*requestvalidation.UnifiedRequestValidator)(crv)); err != nil { - panic(err) - } -} - // NewClientGraphsyncDataTransfer returns a data transfer manager that just // uses the clients's Client DAG service for transfers func NewClientGraphsyncDataTransfer(lc fx.Lifecycle, h host.Host, gs dtypes.Graphsync, ds dtypes.MetadataDS, r repo.LockedRepo) (dtypes.ClientDataTransfer, error) { diff --git a/node/modules/core.go b/node/modules/core.go index f6fc96a86f..9a5bff5ac6 100644 --- a/node/modules/core.go +++ b/node/modules/core.go @@ -5,7 +5,6 @@ import ( "crypto/rand" "errors" "io" - "io/ioutil" "os" "path/filepath" "time" @@ -147,7 +146,7 @@ func APISecret(keystore types.KeyStore, lr repo.LockedRepo) (*dtypes.APIAlg, err if errors.Is(err, types.ErrKeyInfoNotFound) { log.Warn("Generating new API secret") - sk, err := ioutil.ReadAll(io.LimitReader(rand.Reader, 32)) + sk, err := io.ReadAll(io.LimitReader(rand.Reader, 32)) if err != nil { return nil, err } diff --git a/node/modules/dtypes/storage.go b/node/modules/dtypes/storage.go index 993ede55fc..182d9db5ef 100644 --- a/node/modules/dtypes/storage.go +++ b/node/modules/dtypes/storage.go @@ -6,8 +6,8 @@ import ( "github.com/ipfs/go-graphsync" exchange "github.com/ipfs/go-ipfs-exchange-interface" - datatransfer "github.com/filecoin-project/go-data-transfer" - dtnet "github.com/filecoin-project/go-data-transfer/network" + datatransfer "github.com/filecoin-project/go-data-transfer/v2" + dtnet "github.com/filecoin-project/go-data-transfer/v2/network" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" "github.com/filecoin-project/go-statestore" diff --git a/node/modules/lp2p/rcmgr.go b/node/modules/lp2p/rcmgr.go index fd904ad5e7..0035ed05bc 100644 --- a/node/modules/lp2p/rcmgr.go +++ b/node/modules/lp2p/rcmgr.go @@ -7,6 +7,7 @@ import ( "math/bits" "os" "path/filepath" + "sync" logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p" @@ -14,10 +15,9 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager" - "github.com/libp2p/go-libp2p/p2p/host/resource-manager/obs" rcmgrObs "github.com/libp2p/go-libp2p/p2p/host/resource-manager/obs" + "github.com/prometheus/client_golang/prometheus" "go.opencensus.io/stats" - "go.opencensus.io/stats/view" "go.opencensus.io/tag" "go.uber.org/fx" @@ -25,6 +25,8 @@ import ( "github.com/filecoin-project/lotus/node/repo" ) +var rcmgrMetricsOnce sync.Once + func ResourceManager(connMgrHi uint) func(lc fx.Lifecycle, repo repo.LockedRepo) (network.ResourceManager, error) { return func(lc fx.Lifecycle, repo repo.LockedRepo) (network.ResourceManager, error) { isFullNode := repo.RepoType().Type() == "FullNode" @@ -32,7 +34,7 @@ func ResourceManager(connMgrHi uint) func(lc fx.Lifecycle, repo repo.LockedRepo) if (isFullNode && envvar == "0") || // only set NullResourceManager if envvar is explicitly "0" (!isFullNode && envvar != "1") { // set NullResourceManager *unless* envvar is explicitly "1" log.Info("libp2p resource manager is disabled") - return network.NullResourceManager, nil + return &network.NullResourceManager{}, nil } log.Info("libp2p resource manager is enabled") @@ -52,37 +54,41 @@ func ResourceManager(connMgrHi uint) func(lc fx.Lifecycle, repo repo.LockedRepo) // For every extra 1GB of memory we have available, increase our limit by 1GiB defaultLimits.SystemLimitIncrease.Memory = 1 << 30 defaultLimitConfig := defaultLimits.AutoScale() - if defaultLimitConfig.System.Memory > 4<<30 { + + changes := rcmgr.PartialLimitConfig{} + + if defaultLimitConfig.ToPartialLimitConfig().System.Memory > 4<<30 { // Cap our memory limit - defaultLimitConfig.System.Memory = 4 << 30 + changes.System.Memory = 4 << 30 } maxconns := int(connMgrHi) - if 2*maxconns > defaultLimitConfig.System.ConnsInbound { + if rcmgr.LimitVal(2*maxconns) > defaultLimitConfig.ToPartialLimitConfig().System.ConnsInbound { // adjust conns to 2x to allow for two conns per peer (TCP+QUIC) - defaultLimitConfig.System.ConnsInbound = logScale(2 * maxconns) - defaultLimitConfig.System.ConnsOutbound = logScale(2 * maxconns) - defaultLimitConfig.System.Conns = logScale(4 * maxconns) + changes.System.ConnsInbound = rcmgr.LimitVal(logScale(2 * maxconns)) + changes.System.ConnsOutbound = rcmgr.LimitVal(logScale(2 * maxconns)) + changes.System.Conns = rcmgr.LimitVal(logScale(4 * maxconns)) - defaultLimitConfig.System.StreamsInbound = logScale(16 * maxconns) - defaultLimitConfig.System.StreamsOutbound = logScale(64 * maxconns) - defaultLimitConfig.System.Streams = logScale(64 * maxconns) + changes.System.StreamsInbound = rcmgr.LimitVal(logScale(16 * maxconns)) + changes.System.StreamsOutbound = rcmgr.LimitVal(logScale(64 * maxconns)) + changes.System.Streams = rcmgr.LimitVal(logScale(64 * maxconns)) - if 2*maxconns > defaultLimitConfig.System.FD { - defaultLimitConfig.System.FD = logScale(2 * maxconns) + if rcmgr.LimitVal(2*maxconns) > defaultLimitConfig.ToPartialLimitConfig().System.FD { + changes.System.FD = rcmgr.LimitVal(logScale(2 * maxconns)) } - defaultLimitConfig.ServiceDefault.StreamsInbound = logScale(8 * maxconns) - defaultLimitConfig.ServiceDefault.StreamsOutbound = logScale(32 * maxconns) - defaultLimitConfig.ServiceDefault.Streams = logScale(32 * maxconns) + changes.ServiceDefault.StreamsInbound = rcmgr.LimitVal(logScale(8 * maxconns)) + changes.ServiceDefault.StreamsOutbound = rcmgr.LimitVal(logScale(32 * maxconns)) + changes.ServiceDefault.Streams = rcmgr.LimitVal(logScale(32 * maxconns)) - defaultLimitConfig.ProtocolDefault.StreamsInbound = logScale(8 * maxconns) - defaultLimitConfig.ProtocolDefault.StreamsOutbound = logScale(32 * maxconns) - defaultLimitConfig.ProtocolDefault.Streams = logScale(32 * maxconns) + changes.ProtocolDefault.StreamsInbound = rcmgr.LimitVal(logScale(8 * maxconns)) + changes.ProtocolDefault.StreamsOutbound = rcmgr.LimitVal(logScale(32 * maxconns)) + changes.ProtocolDefault.Streams = rcmgr.LimitVal(logScale(32 * maxconns)) log.Info("adjusted default resource manager limits") } + changedLimitConfig := changes.Build(defaultLimitConfig) // initialize var limiter rcmgr.Limiter var opts []rcmgr.Option @@ -95,13 +101,13 @@ func ResourceManager(connMgrHi uint) func(lc fx.Lifecycle, repo repo.LockedRepo) switch { case err == nil: defer limitsIn.Close() //nolint:errcheck - limiter, err = rcmgr.NewLimiterFromJSON(limitsIn, defaultLimitConfig) + limiter, err = rcmgr.NewLimiterFromJSON(limitsIn, changedLimitConfig) if err != nil { return nil, fmt.Errorf("error parsing limit file: %w", err) } case errors.Is(err, os.ErrNotExist): - limiter = rcmgr.NewFixedLimiter(defaultLimitConfig) + limiter = rcmgr.NewFixedLimiter(changedLimitConfig) default: return nil, err @@ -111,10 +117,10 @@ func ResourceManager(connMgrHi uint) func(lc fx.Lifecycle, repo repo.LockedRepo) if err != nil { return nil, fmt.Errorf("error creating resource manager stats reporter: %w", err) } - err = view.Register(obs.DefaultViews...) - if err != nil { - return nil, fmt.Errorf("error registering rcmgr metrics: %w", err) - } + + rcmgrMetricsOnce.Do(func() { + rcmgrObs.MustRegisterWith(prometheus.DefaultRegisterer) + }) // Metrics opts = append(opts, rcmgr.WithMetrics(rcmgrMetrics{}), rcmgr.WithTraceReporter(str)) diff --git a/node/modules/services.go b/node/modules/services.go index 254aeac7cd..832077fca7 100644 --- a/node/modules/services.go +++ b/node/modules/services.go @@ -12,6 +12,7 @@ import ( "github.com/libp2p/go-libp2p/core/event" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" "github.com/libp2p/go-libp2p/p2p/host/eventbus" "go.uber.org/fx" "golang.org/x/xerrors" @@ -85,7 +86,7 @@ func RunHello(mctx helpers.MetricsCtx, lc fx.Lifecycle, h host.Host, svc *hello. return nil } -func protosContains(protos []string, search string) bool { +func protosContains(protos []protocol.ID, search protocol.ID) bool { for _, p := range protos { if p == search { return true diff --git a/node/modules/stmgr.go b/node/modules/stmgr.go index dd3d90f108..b8f6f47766 100644 --- a/node/modules/stmgr.go +++ b/node/modules/stmgr.go @@ -7,10 +7,11 @@ import ( "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/vm" + "github.com/filecoin-project/lotus/node/modules/dtypes" ) -func StateManager(lc fx.Lifecycle, cs *store.ChainStore, exec stmgr.Executor, sys vm.SyscallBuilder, us stmgr.UpgradeSchedule, b beacon.Schedule) (*stmgr.StateManager, error) { - sm, err := stmgr.NewStateManager(cs, exec, sys, us, b) +func StateManager(lc fx.Lifecycle, cs *store.ChainStore, exec stmgr.Executor, sys vm.SyscallBuilder, us stmgr.UpgradeSchedule, b beacon.Schedule, metadataDs dtypes.MetadataDS) (*stmgr.StateManager, error) { + sm, err := stmgr.NewStateManager(cs, exec, sys, us, b, metadataDs) if err != nil { return nil, err } diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index 7f6ccf60a9..4e4e2dde10 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -25,9 +25,9 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - dtimpl "github.com/filecoin-project/go-data-transfer/impl" - dtnet "github.com/filecoin-project/go-data-transfer/network" - dtgstransport "github.com/filecoin-project/go-data-transfer/transport/graphsync" + dtimpl "github.com/filecoin-project/go-data-transfer/v2/impl" + dtnet "github.com/filecoin-project/go-data-transfer/v2/network" + dtgstransport "github.com/filecoin-project/go-data-transfer/v2/transport/graphsync" piecefilestore "github.com/filecoin-project/go-fil-markets/filestore" piecestoreimpl "github.com/filecoin-project/go-fil-markets/piecestore/impl" "github.com/filecoin-project/go-fil-markets/retrievalmarket" diff --git a/node/modules/storageminer_idxprov.go b/node/modules/storageminer_idxprov.go index dc4e608780..3f9a6a9898 100644 --- a/node/modules/storageminer_idxprov.go +++ b/node/modules/storageminer_idxprov.go @@ -41,10 +41,15 @@ func IndexProvider(cfg config.IndexProviderConfig) func(params IdxProv, marketHo } ipds := namespace.Wrap(args.Datastore, datastore.NewKey("/index-provider")) + addrs := marketHost.Addrs() + addrsString := make([]string, 0, len(addrs)) + for _, addr := range addrs { + addrsString = append(addrsString, addr.String()) + } var opts = []engine.Option{ engine.WithDatastore(ipds), engine.WithHost(marketHost), - engine.WithRetrievalAddrs(marketHost.Addrs()...), + engine.WithRetrievalAddrs(addrsString...), engine.WithEntriesCacheCapacity(cfg.EntriesCacheCapacity), engine.WithChainedEntries(cfg.EntriesChunkSize), engine.WithTopicName(topicName), diff --git a/node/modules/testing/genesis.go b/node/modules/testing/genesis.go index 7218e1fc15..77359898e3 100644 --- a/node/modules/testing/genesis.go +++ b/node/modules/testing/genesis.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "github.com/ipfs/go-blockservice" @@ -60,7 +59,7 @@ func MakeGenesis(outFile, genesisTemplate string) func(bs dtypes.ChainBlockstore return nil, err } - fdata, err := ioutil.ReadFile(genesisTemplate) + fdata, err := os.ReadFile(genesisTemplate) if err != nil { return nil, xerrors.Errorf("reading preseals json: %w", err) } diff --git a/node/repo/fsrepo.go b/node/repo/fsrepo.go index 3012daaca7..03ddd2d6ce 100644 --- a/node/repo/fsrepo.go +++ b/node/repo/fsrepo.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -329,7 +328,7 @@ func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error) { } defer f.Close() //nolint: errcheck // Read only op - data, err := ioutil.ReadAll(f) + data, err := io.ReadAll(f) if err != nil { return nil, xerrors.Errorf("failed to read %q: %w", p, err) } @@ -354,7 +353,7 @@ func (fsr *FsRepo) APIToken() ([]byte, error) { } defer f.Close() //nolint: errcheck // Read only op - tb, err := ioutil.ReadAll(f) + tb, err := io.ReadAll(f) if err != nil { return nil, err } @@ -545,7 +544,15 @@ func (fsr *fsLockedRepo) Config() (interface{}, error) { } func (fsr *fsLockedRepo) loadConfigFromDisk() (interface{}, error) { - return config.FromFile(fsr.configPath, fsr.repoType.Config()) + var opts []config.LoadCfgOpt + if fsr.repoType == FullNode { + opts = append(opts, config.SetCanFallbackOnDefault(config.NoDefaultForSplitstoreTransition)) + opts = append(opts, config.SetValidate(config.ValidateSplitstoreSet)) + } + opts = append(opts, config.SetDefault(func() (interface{}, error) { + return fsr.repoType.Config(), nil + })) + return config.FromFile(fsr.configPath, opts...) } func (fsr *fsLockedRepo) SetConfig(c func(interface{})) error { @@ -574,7 +581,7 @@ func (fsr *fsLockedRepo) SetConfig(c func(interface{})) error { } // write buffer of TOML bytes to config file - err = ioutil.WriteFile(fsr.configPath, buf.Bytes(), 0644) + err = os.WriteFile(fsr.configPath, buf.Bytes(), 0644) if err != nil { return err } @@ -627,14 +634,14 @@ func (fsr *fsLockedRepo) SetAPIEndpoint(ma multiaddr.Multiaddr) error { if err := fsr.stillValid(); err != nil { return err } - return ioutil.WriteFile(fsr.join(fsAPI), []byte(ma.String()), 0644) + return os.WriteFile(fsr.join(fsAPI), []byte(ma.String()), 0644) } func (fsr *fsLockedRepo) SetAPIToken(token []byte) error { if err := fsr.stillValid(); err != nil { return err } - return ioutil.WriteFile(fsr.join(fsAPIToken), token, 0600) + return os.WriteFile(fsr.join(fsAPIToken), token, 0600) } func (fsr *fsLockedRepo) KeyStore() (types.KeyStore, error) { @@ -703,7 +710,7 @@ func (fsr *fsLockedRepo) Get(name string) (types.KeyInfo, error) { } defer file.Close() //nolint: errcheck // read only op - data, err := ioutil.ReadAll(file) + data, err := io.ReadAll(file) if err != nil { return types.KeyInfo{}, xerrors.Errorf("reading key '%s': %w", name, err) } @@ -752,7 +759,7 @@ func (fsr *fsLockedRepo) put(rawName string, info types.KeyInfo, retries int) er return xerrors.Errorf("encoding key '%s': %w", name, err) } - err = ioutil.WriteFile(keyPath, keyData, 0600) + err = os.WriteFile(keyPath, keyData, 0600) if err != nil { return xerrors.Errorf("writing key '%s': %w", name, err) } diff --git a/node/repo/memrepo.go b/node/repo/memrepo.go index 7817776a98..6a4b416e20 100644 --- a/node/repo/memrepo.go +++ b/node/repo/memrepo.go @@ -3,7 +3,6 @@ package repo import ( "context" "encoding/json" - "io/ioutil" "os" "path/filepath" "sync" @@ -103,7 +102,7 @@ func (lmem *lockedMemRepo) Path() string { return lmem.mem.tempDir } - t, err := ioutil.TempDir(os.TempDir(), "lotus-memrepo-temp-") + t, err := os.MkdirTemp(os.TempDir(), "lotus-memrepo-temp-") if err != nil { panic(err) // only used in tests, probably fine } @@ -142,7 +141,7 @@ func (lmem *lockedMemRepo) initSectorStore(t string) { panic(err) } - if err := ioutil.WriteFile(filepath.Join(t, "sectorstore.json"), b, 0644); err != nil { + if err := os.WriteFile(filepath.Join(t, "sectorstore.json"), b, 0644); err != nil { panic(err) } } diff --git a/paychmgr/cbor_gen.go b/paychmgr/cbor_gen.go index 78a55488ea..b3880aa106 100644 --- a/paychmgr/cbor_gen.go +++ b/paychmgr/cbor_gen.go @@ -33,22 +33,6 @@ func (t *VoucherInfo) MarshalCBOR(w io.Writer) error { return err } - // t.Voucher (paych.SignedVoucher) (struct) - if len("Voucher") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Voucher\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Voucher"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("Voucher")); err != nil { - return err - } - - if err := t.Voucher.MarshalCBOR(cw); err != nil { - return err - } - // t.Proof ([]uint8) (slice) if len("Proof") > cbg.MaxLength { return xerrors.Errorf("Value in field \"Proof\" was too long") @@ -73,6 +57,22 @@ func (t *VoucherInfo) MarshalCBOR(w io.Writer) error { return err } + // t.Voucher (paych.SignedVoucher) (struct) + if len("Voucher") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Voucher\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Voucher"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("Voucher")); err != nil { + return err + } + + if err := t.Voucher.MarshalCBOR(cw); err != nil { + return err + } + // t.Submitted (bool) (bool) if len("Submitted") > cbg.MaxLength { return xerrors.Errorf("Value in field \"Submitted\" was too long") @@ -129,27 +129,7 @@ func (t *VoucherInfo) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.Voucher (paych.SignedVoucher) (struct) - case "Voucher": - - { - - b, err := cr.ReadByte() - if err != nil { - return err - } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - t.Voucher = new(paych.SignedVoucher) - if err := t.Voucher.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.Voucher pointer: %w", err) - } - } - - } - // t.Proof ([]uint8) (slice) + // t.Proof ([]uint8) (slice) case "Proof": maj, extra, err = cr.ReadHeader() @@ -171,6 +151,26 @@ func (t *VoucherInfo) UnmarshalCBOR(r io.Reader) (err error) { if _, err := io.ReadFull(cr, t.Proof[:]); err != nil { return err } + // t.Voucher (paych.SignedVoucher) (struct) + case "Voucher": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Voucher = new(paych.SignedVoucher) + if err := t.Voucher.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Voucher pointer: %w", err) + } + } + + } // t.Submitted (bool) (bool) case "Submitted": @@ -210,26 +210,35 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error { return err } - // t.ChannelID (string) (string) - if len("ChannelID") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"ChannelID\" was too long") + // t.Amount (big.Int) (struct) + if len("Amount") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Amount\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ChannelID"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Amount"))); err != nil { return err } - if _, err := io.WriteString(w, string("ChannelID")); err != nil { + if _, err := io.WriteString(w, string("Amount")); err != nil { return err } - if len(t.ChannelID) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.ChannelID was too long") + if err := t.Amount.MarshalCBOR(cw); err != nil { + return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil { + // t.Target (address.Address) (struct) + if len("Target") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Target\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Target"))); err != nil { return err } - if _, err := io.WriteString(w, string(t.ChannelID)); err != nil { + if _, err := io.WriteString(w, string("Target")); err != nil { + return err + } + + if err := t.Target.MarshalCBOR(cw); err != nil { return err } @@ -265,35 +274,35 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error { return err } - // t.Target (address.Address) (struct) - if len("Target") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Target\" was too long") + // t.NextLane (uint64) (uint64) + if len("NextLane") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"NextLane\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Target"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("NextLane"))); err != nil { return err } - if _, err := io.WriteString(w, string("Target")); err != nil { + if _, err := io.WriteString(w, string("NextLane")); err != nil { return err } - if err := t.Target.MarshalCBOR(cw); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.NextLane)); err != nil { return err } - // t.Direction (uint64) (uint64) - if len("Direction") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Direction\" was too long") + // t.Settling (bool) (bool) + if len("Settling") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Settling\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Direction"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Settling"))); err != nil { return err } - if _, err := io.WriteString(w, string("Direction")); err != nil { + if _, err := io.WriteString(w, string("Settling")); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Direction)); err != nil { + if err := cbg.WriteBool(w, t.Settling); err != nil { return err } @@ -322,68 +331,87 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error { } } - // t.NextLane (uint64) (uint64) - if len("NextLane") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"NextLane\" was too long") + // t.ChannelID (string) (string) + if len("ChannelID") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"ChannelID\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("NextLane"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ChannelID"))); err != nil { return err } - if _, err := io.WriteString(w, string("NextLane")); err != nil { + if _, err := io.WriteString(w, string("ChannelID")); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.NextLane)); err != nil { + if len(t.ChannelID) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.ChannelID was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil { + return err + } + if _, err := io.WriteString(w, string(t.ChannelID)); err != nil { return err } - // t.Amount (big.Int) (struct) - if len("Amount") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Amount\" was too long") + // t.CreateMsg (cid.Cid) (struct) + if len("CreateMsg") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"CreateMsg\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Amount"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CreateMsg"))); err != nil { return err } - if _, err := io.WriteString(w, string("Amount")); err != nil { + if _, err := io.WriteString(w, string("CreateMsg")); err != nil { return err } - if err := t.Amount.MarshalCBOR(cw); err != nil { - return err + if t.CreateMsg == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if err := cbg.WriteCid(cw, *t.CreateMsg); err != nil { + return xerrors.Errorf("failed to write cid field t.CreateMsg: %w", err) + } } - // t.AvailableAmount (big.Int) (struct) - if len("AvailableAmount") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"AvailableAmount\" was too long") + // t.Direction (uint64) (uint64) + if len("Direction") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Direction\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("AvailableAmount"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Direction"))); err != nil { return err } - if _, err := io.WriteString(w, string("AvailableAmount")); err != nil { + if _, err := io.WriteString(w, string("Direction")); err != nil { return err } - if err := t.AvailableAmount.MarshalCBOR(cw); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Direction)); err != nil { return err } - // t.PendingAvailableAmount (big.Int) (struct) - if len("PendingAvailableAmount") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"PendingAvailableAmount\" was too long") + // t.AddFundsMsg (cid.Cid) (struct) + if len("AddFundsMsg") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"AddFundsMsg\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PendingAvailableAmount"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("AddFundsMsg"))); err != nil { return err } - if _, err := io.WriteString(w, string("PendingAvailableAmount")); err != nil { + if _, err := io.WriteString(w, string("AddFundsMsg")); err != nil { return err } - if err := t.PendingAvailableAmount.MarshalCBOR(cw); err != nil { - return err + if t.AddFundsMsg == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if err := cbg.WriteCid(cw, *t.AddFundsMsg); err != nil { + return xerrors.Errorf("failed to write cid field t.AddFundsMsg: %w", err) + } } // t.PendingAmount (big.Int) (struct) @@ -402,63 +430,35 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error { return err } - // t.CreateMsg (cid.Cid) (struct) - if len("CreateMsg") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"CreateMsg\" was too long") + // t.AvailableAmount (big.Int) (struct) + if len("AvailableAmount") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"AvailableAmount\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CreateMsg"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("AvailableAmount"))); err != nil { return err } - if _, err := io.WriteString(w, string("CreateMsg")); err != nil { + if _, err := io.WriteString(w, string("AvailableAmount")); err != nil { return err } - if t.CreateMsg == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if err := cbg.WriteCid(cw, *t.CreateMsg); err != nil { - return xerrors.Errorf("failed to write cid field t.CreateMsg: %w", err) - } - } - - // t.AddFundsMsg (cid.Cid) (struct) - if len("AddFundsMsg") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"AddFundsMsg\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("AddFundsMsg"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("AddFundsMsg")); err != nil { + if err := t.AvailableAmount.MarshalCBOR(cw); err != nil { return err } - if t.AddFundsMsg == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if err := cbg.WriteCid(cw, *t.AddFundsMsg); err != nil { - return xerrors.Errorf("failed to write cid field t.AddFundsMsg: %w", err) - } - } - - // t.Settling (bool) (bool) - if len("Settling") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Settling\" was too long") + // t.PendingAvailableAmount (big.Int) (struct) + if len("PendingAvailableAmount") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"PendingAvailableAmount\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Settling"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PendingAvailableAmount"))); err != nil { return err } - if _, err := io.WriteString(w, string("Settling")); err != nil { + if _, err := io.WriteString(w, string("PendingAvailableAmount")); err != nil { return err } - if err := cbg.WriteBool(w, t.Settling); err != nil { + if err := t.PendingAvailableAmount.MarshalCBOR(cw); err != nil { return err } return nil @@ -502,16 +502,25 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.ChannelID (string) (string) - case "ChannelID": + // t.Amount (big.Int) (struct) + case "Amount": { - sval, err := cbg.ReadString(cr) - if err != nil { - return err + + if err := t.Amount.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Amount: %w", err) + } + + } + // t.Target (address.Address) (struct) + case "Target": + + { + + if err := t.Target.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Target: %w", err) } - t.ChannelID = string(sval) } // t.Channel (address.Address) (struct) case "Channel": @@ -543,18 +552,8 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) { } } - // t.Target (address.Address) (struct) - case "Target": - - { - - if err := t.Target.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.Target: %w", err) - } - - } - // t.Direction (uint64) (uint64) - case "Direction": + // t.NextLane (uint64) (uint64) + case "NextLane": { @@ -565,9 +564,27 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) { if maj != cbg.MajUnsignedInt { return fmt.Errorf("wrong type for uint64 field") } - t.Direction = uint64(extra) + t.NextLane = uint64(extra) } + // t.Settling (bool) (bool) + case "Settling": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajOther { + return fmt.Errorf("booleans must be major type 7") + } + switch extra { + case 20: + t.Settling = false + case 21: + t.Settling = true + default: + return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) + } // t.Vouchers ([]*paychmgr.VoucherInfo) (slice) case "Vouchers": @@ -598,60 +615,16 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) { t.Vouchers[i] = &v } - // t.NextLane (uint64) (uint64) - case "NextLane": + // t.ChannelID (string) (string) + case "ChannelID": { - - maj, extra, err = cr.ReadHeader() + sval, err := cbg.ReadString(cr) if err != nil { return err } - if maj != cbg.MajUnsignedInt { - return fmt.Errorf("wrong type for uint64 field") - } - t.NextLane = uint64(extra) - - } - // t.Amount (big.Int) (struct) - case "Amount": - - { - - if err := t.Amount.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.Amount: %w", err) - } - - } - // t.AvailableAmount (big.Int) (struct) - case "AvailableAmount": - - { - - if err := t.AvailableAmount.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.AvailableAmount: %w", err) - } - - } - // t.PendingAvailableAmount (big.Int) (struct) - case "PendingAvailableAmount": - - { - - if err := t.PendingAvailableAmount.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.PendingAvailableAmount: %w", err) - } - - } - // t.PendingAmount (big.Int) (struct) - case "PendingAmount": - - { - - if err := t.PendingAmount.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.PendingAmount: %w", err) - } + t.ChannelID = string(sval) } // t.CreateMsg (cid.Cid) (struct) case "CreateMsg": @@ -675,6 +648,21 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) { t.CreateMsg = &c } + } + // t.Direction (uint64) (uint64) + case "Direction": + + { + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajUnsignedInt { + return fmt.Errorf("wrong type for uint64 field") + } + t.Direction = uint64(extra) + } // t.AddFundsMsg (cid.Cid) (struct) case "AddFundsMsg": @@ -699,23 +687,35 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) { } } - // t.Settling (bool) (bool) - case "Settling": + // t.PendingAmount (big.Int) (struct) + case "PendingAmount": + + { + + if err := t.PendingAmount.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.PendingAmount: %w", err) + } - maj, extra, err = cr.ReadHeader() - if err != nil { - return err } - if maj != cbg.MajOther { - return fmt.Errorf("booleans must be major type 7") + // t.AvailableAmount (big.Int) (struct) + case "AvailableAmount": + + { + + if err := t.AvailableAmount.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.AvailableAmount: %w", err) + } + } - switch extra { - case 20: - t.Settling = false - case 21: - t.Settling = true - default: - return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) + // t.PendingAvailableAmount (big.Int) (struct) + case "PendingAvailableAmount": + + { + + if err := t.PendingAvailableAmount.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.PendingAvailableAmount: %w", err) + } + } default: @@ -738,26 +738,26 @@ func (t *MsgInfo) MarshalCBOR(w io.Writer) error { return err } - // t.ChannelID (string) (string) - if len("ChannelID") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"ChannelID\" was too long") + // t.Err (string) (string) + if len("Err") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Err\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ChannelID"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Err"))); err != nil { return err } - if _, err := io.WriteString(w, string("ChannelID")); err != nil { + if _, err := io.WriteString(w, string("Err")); err != nil { return err } - if len(t.ChannelID) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.ChannelID was too long") + if len(t.Err) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.Err was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Err))); err != nil { return err } - if _, err := io.WriteString(w, string(t.ChannelID)); err != nil { + if _, err := io.WriteString(w, string(t.Err)); err != nil { return err } @@ -793,26 +793,26 @@ func (t *MsgInfo) MarshalCBOR(w io.Writer) error { return err } - // t.Err (string) (string) - if len("Err") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Err\" was too long") + // t.ChannelID (string) (string) + if len("ChannelID") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"ChannelID\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Err"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ChannelID"))); err != nil { return err } - if _, err := io.WriteString(w, string("Err")); err != nil { + if _, err := io.WriteString(w, string("ChannelID")); err != nil { return err } - if len(t.Err) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.Err was too long") + if len(t.ChannelID) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.ChannelID was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Err))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Err)); err != nil { + if _, err := io.WriteString(w, string(t.ChannelID)); err != nil { return err } return nil @@ -856,8 +856,8 @@ func (t *MsgInfo) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.ChannelID (string) (string) - case "ChannelID": + // t.Err (string) (string) + case "Err": { sval, err := cbg.ReadString(cr) @@ -865,7 +865,7 @@ func (t *MsgInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.ChannelID = string(sval) + t.Err = string(sval) } // t.MsgCid (cid.Cid) (struct) case "MsgCid": @@ -898,8 +898,8 @@ func (t *MsgInfo) UnmarshalCBOR(r io.Reader) (err error) { default: return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) } - // t.Err (string) (string) - case "Err": + // t.ChannelID (string) (string) + case "ChannelID": { sval, err := cbg.ReadString(cr) @@ -907,7 +907,7 @@ func (t *MsgInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Err = string(sval) + t.ChannelID = string(sval) } default: diff --git a/storage/paths/http_handler_test.go b/storage/paths/http_handler_test.go index b03fd20ee4..4987936dd6 100644 --- a/storage/paths/http_handler_test.go +++ b/storage/paths/http_handler_test.go @@ -2,7 +2,7 @@ package paths_test import ( "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "os" @@ -378,7 +378,7 @@ func TestRemoteGetSector(t *testing.T) { if !tc.isDir { // create file - tempFile, err := ioutil.TempFile("", "TestRemoteGetSector-") + tempFile, err := os.CreateTemp("", "TestRemoteGetSector-") require.NoError(t, err) defer func() { @@ -390,7 +390,7 @@ func TestRemoteGetSector(t *testing.T) { path = tempFile.Name() } else { // create dir with a file - tempFile2, err := ioutil.TempFile("", "TestRemoteGetSector-") + tempFile2, err := os.CreateTemp("", "TestRemoteGetSector-") require.NoError(t, err) defer func() { _ = os.Remove(tempFile2.Name()) @@ -435,7 +435,7 @@ func TestRemoteGetSector(t *testing.T) { _ = resp.Body.Close() }() - bz, err := ioutil.ReadAll(resp.Body) + bz, err := io.ReadAll(resp.Body) require.NoError(t, err) // assert expected status code diff --git a/storage/paths/local.go b/storage/paths/local.go index 2182f24ef4..a866f5bbe5 100644 --- a/storage/paths/local.go +++ b/storage/paths/local.go @@ -3,7 +3,6 @@ package paths import ( "context" "encoding/json" - "io/ioutil" "math/bits" "math/rand" "os" @@ -151,7 +150,7 @@ func (st *Local) OpenPath(ctx context.Context, p string) error { st.localLk.Lock() defer st.localLk.Unlock() - mb, err := ioutil.ReadFile(filepath.Join(p, MetaFile)) + mb, err := os.ReadFile(filepath.Join(p, MetaFile)) if err != nil { return xerrors.Errorf("reading storage metadata for %s: %w", p, err) } @@ -247,7 +246,7 @@ func (st *Local) Redeclare(ctx context.Context, filterId *storiface.ID, dropMiss defer st.localLk.Unlock() for id, p := range st.paths { - mb, err := ioutil.ReadFile(filepath.Join(p.local, MetaFile)) + mb, err := os.ReadFile(filepath.Join(p.local, MetaFile)) if err != nil { return xerrors.Errorf("reading storage metadata for %s: %w", p.local, err) } diff --git a/storage/paths/local_test.go b/storage/paths/local_test.go index 6b9f4a5451..bfa138ff6f 100644 --- a/storage/paths/local_test.go +++ b/storage/paths/local_test.go @@ -3,7 +3,6 @@ package paths import ( "context" "encoding/json" - "io/ioutil" "os" "path/filepath" "testing" @@ -63,7 +62,7 @@ func (t *TestingLocalStorage) init(subpath string) error { return err } - if err := ioutil.WriteFile(metaFile, mb, 0644); err != nil { + if err := os.WriteFile(metaFile, mb, 0644); err != nil { return err } diff --git a/storage/paths/localstorage_cached.go b/storage/paths/localstorage_cached.go index cac0a44b66..af43d16967 100644 --- a/storage/paths/localstorage_cached.go +++ b/storage/paths/localstorage_cached.go @@ -4,7 +4,7 @@ import ( "sync" "time" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "github.com/filecoin-project/lotus/storage/sealer/fsutil" "github.com/filecoin-project/lotus/storage/sealer/storiface" @@ -17,13 +17,13 @@ type cachedLocalStorage struct { base LocalStorage statLk sync.Mutex - stats *lru.Cache // path -> statEntry - pathDUs *lru.Cache // path -> *diskUsageEntry + stats *lru.Cache[string, statEntry] + pathDUs *lru.Cache[string, *diskUsageEntry] } func newCachedLocalStorage(ls LocalStorage) *cachedLocalStorage { - statCache, _ := lru.New(1024) - duCache, _ := lru.New(1024) + statCache, _ := lru.New[string, statEntry](1024) + duCache, _ := lru.New[string, *diskUsageEntry](1024) return &cachedLocalStorage{ base: ls, @@ -60,8 +60,8 @@ func (c *cachedLocalStorage) Stat(path string) (fsutil.FsStat, error) { c.statLk.Lock() defer c.statLk.Unlock() - if v, ok := c.stats.Get(path); ok && time.Now().Sub(v.(statEntry).time) < StatTimeout { - return v.(statEntry).stat, nil + if v, ok := c.stats.Get(path); ok && time.Now().Sub(v.time) < StatTimeout { + return v.stat, nil } // if we don't, get the stat @@ -83,7 +83,7 @@ func (c *cachedLocalStorage) DiskUsage(path string) (int64, error) { var entry *diskUsageEntry if v, ok := c.pathDUs.Get(path); ok { - entry = v.(*diskUsageEntry) + entry = v // if we have recent cached entry, use that if time.Now().Sub(entry.last.time) < StatTimeout { diff --git a/storage/paths/remote.go b/storage/paths/remote.go index 06d1080b3a..852936153b 100644 --- a/storage/paths/remote.go +++ b/storage/paths/remote.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "math/bits" "net/http" "net/url" @@ -412,7 +411,7 @@ func (r *Remote) FsStat(ctx context.Context, id storiface.ID) (fsutil.FsStat, er case 404: return fsutil.FsStat{}, errPathNotFound case 500: - b, err := ioutil.ReadAll(resp.Body) + b, err := io.ReadAll(resp.Body) if err != nil { return fsutil.FsStat{}, xerrors.Errorf("fsstat: got http 500, then failed to read the error: %w", err) } @@ -768,7 +767,7 @@ func (r *Remote) GenerateSingleVanillaProof(ctx context.Context, minerID abi.Act log.Debugw("reading vanilla proof from remote not-found response", "url", url, "store", info.ID) continue } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return nil, xerrors.Errorf("resp.Body ReadAll: %w", err) } @@ -780,7 +779,7 @@ func (r *Remote) GenerateSingleVanillaProof(ctx context.Context, minerID abi.Act return nil, xerrors.Errorf("non-200 code from %s: '%s'", url, strings.TrimSpace(string(body))) } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { if err := resp.Body.Close(); err != nil { log.Error("response close: ", err) diff --git a/storage/paths/remote_test.go b/storage/paths/remote_test.go index 2d7fe2c73d..41d5e8a17a 100644 --- a/storage/paths/remote_test.go +++ b/storage/paths/remote_test.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/http/httptest" "os" @@ -48,7 +47,7 @@ func createTestStorage(t *testing.T, p string, seal bool, att ...*paths.Local) s b, err := json.MarshalIndent(cfg, "", " ") require.NoError(t, err) - require.NoError(t, ioutil.WriteFile(filepath.Join(p, metaFile), b, 0644)) + require.NoError(t, os.WriteFile(filepath.Join(p, metaFile), b, 0644)) for _, s := range att { require.NoError(t, s.OpenPath(context.Background(), p)) @@ -130,7 +129,7 @@ func TestMoveShared(t *testing.T) { data := make([]byte, 2032) data[1] = 54 - require.NoError(t, ioutil.WriteFile(sp.Sealed, data, 0666)) + require.NoError(t, os.WriteFile(sp.Sealed, data, 0666)) fmt.Println("write to ", sp.Sealed) require.NoError(t, index.StorageDeclareSector(ctx, storiface.ID(sid.Sealed), s1ref.ID, storiface.FTSealed, true)) @@ -145,7 +144,7 @@ func TestMoveShared(t *testing.T) { require.Equal(t, id1, storiface.ID(sid.Sealed)) fmt.Println("read from ", sp.Sealed) - read, err := ioutil.ReadFile(sp.Sealed) + read, err := os.ReadFile(sp.Sealed) require.NoError(t, err) require.EqualValues(t, data, read) } @@ -357,7 +356,7 @@ func TestReader(t *testing.T) { mockCheckAllocation(pf, offset, size, emptyPartialFile, true, nil) - f, err := ioutil.TempFile("", "TestReader-") + f, err := os.CreateTemp("", "TestReader-") require.NoError(t, err) _, err = f.Write(bz) require.NoError(t, err) @@ -502,7 +501,7 @@ func TestReader(t *testing.T) { require.NoError(t, os.Remove(f.Name())) } - bz, err := ioutil.ReadAll(rd) + bz, err := io.ReadAll(rd) require.NoError(t, err) require.Equal(t, tc.expectedSectorBytes, bz) } diff --git a/storage/pipeline/cbor_gen.go b/storage/pipeline/cbor_gen.go index 88dac5d642..d14611c6a3 100644 --- a/storage/pipeline/cbor_gen.go +++ b/storage/pipeline/cbor_gen.go @@ -35,87 +35,120 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error { return err } - // t.State (sealing.SectorState) (string) - if len("State") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"State\" was too long") + // t.Log ([]sealing.Log) (slice) + if len("Log") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Log\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("State"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Log"))); err != nil { return err } - if _, err := io.WriteString(w, string("State")); err != nil { + if _, err := io.WriteString(w, string("Log")); err != nil { return err } - if len(t.State) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.State was too long") + if len(t.Log) > cbg.MaxLength { + return xerrors.Errorf("Slice value in field t.Log was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.State))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Log))); err != nil { return err } - if _, err := io.WriteString(w, string(t.State)); err != nil { - return err + for _, v := range t.Log { + if err := v.MarshalCBOR(cw); err != nil { + return err + } } - // t.SectorNumber (abi.SectorNumber) (uint64) - if len("SectorNumber") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"SectorNumber\" was too long") + // t.CommD (cid.Cid) (struct) + if len("CommD") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"CommD\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SectorNumber"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CommD"))); err != nil { return err } - if _, err := io.WriteString(w, string("SectorNumber")); err != nil { + if _, err := io.WriteString(w, string("CommD")); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SectorNumber)); err != nil { - return err + if t.CommD == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if err := cbg.WriteCid(cw, *t.CommD); err != nil { + return xerrors.Errorf("failed to write cid field t.CommD: %w", err) + } } - // t.SectorType (abi.RegisteredSealProof) (int64) - if len("SectorType") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"SectorType\" was too long") + // t.CommR (cid.Cid) (struct) + if len("CommR") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"CommR\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SectorType"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CommR"))); err != nil { return err } - if _, err := io.WriteString(w, string("SectorType")); err != nil { + if _, err := io.WriteString(w, string("CommR")); err != nil { return err } - if t.SectorType >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SectorType)); err != nil { + if t.CommR == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.SectorType-1)); err != nil { - return err + if err := cbg.WriteCid(cw, *t.CommR); err != nil { + return xerrors.Errorf("failed to write cid field t.CommR: %w", err) } } - // t.CreationTime (int64) (int64) - if len("CreationTime") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"CreationTime\" was too long") + // t.Proof ([]uint8) (slice) + if len("Proof") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Proof\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CreationTime"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Proof"))); err != nil { return err } - if _, err := io.WriteString(w, string("CreationTime")); err != nil { + if _, err := io.WriteString(w, string("Proof")); err != nil { return err } - if t.CreationTime >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.CreationTime)); err != nil { - return err - } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.CreationTime-1)); err != nil { - return err - } + if len(t.Proof) > cbg.ByteArrayMaxLen { + return xerrors.Errorf("Byte array in field t.Proof was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.Proof))); err != nil { + return err + } + + if _, err := cw.Write(t.Proof[:]); err != nil { + return err + } + + // t.State (sealing.SectorState) (string) + if len("State") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"State\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("State"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("State")); err != nil { + return err + } + + if len(t.State) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.State was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.State))); err != nil { + return err + } + if _, err := io.WriteString(w, string(t.State)); err != nil { + return err } // t.Pieces ([]api.SectorPiece) (slice) @@ -143,257 +176,286 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error { } } - // t.TicketValue (abi.SealRandomness) (slice) - if len("TicketValue") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"TicketValue\" was too long") + // t.Return (sealing.ReturnState) (string) + if len("Return") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Return\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("TicketValue"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Return"))); err != nil { return err } - if _, err := io.WriteString(w, string("TicketValue")); err != nil { + if _, err := io.WriteString(w, string("Return")); err != nil { return err } - if len(t.TicketValue) > cbg.ByteArrayMaxLen { - return xerrors.Errorf("Byte array in field t.TicketValue was too long") + if len(t.Return) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.Return was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.TicketValue))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Return))); err != nil { return err } - - if _, err := cw.Write(t.TicketValue[:]); err != nil { + if _, err := io.WriteString(w, string(t.Return)); err != nil { return err } - // t.TicketEpoch (abi.ChainEpoch) (int64) - if len("TicketEpoch") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"TicketEpoch\" was too long") + // t.LastErr (string) (string) + if len("LastErr") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"LastErr\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("TicketEpoch"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("LastErr"))); err != nil { return err } - if _, err := io.WriteString(w, string("TicketEpoch")); err != nil { + if _, err := io.WriteString(w, string("LastErr")); err != nil { return err } - if t.TicketEpoch >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.TicketEpoch)); err != nil { - return err - } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.TicketEpoch-1)); err != nil { - return err - } - } - - // t.PreCommit1Out (storiface.PreCommit1Out) (slice) - if len("PreCommit1Out") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"PreCommit1Out\" was too long") + if len(t.LastErr) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.LastErr was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommit1Out"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.LastErr))); err != nil { return err } - if _, err := io.WriteString(w, string("PreCommit1Out")); err != nil { + if _, err := io.WriteString(w, string(t.LastErr)); err != nil { return err } - if len(t.PreCommit1Out) > cbg.ByteArrayMaxLen { - return xerrors.Errorf("Byte array in field t.PreCommit1Out was too long") + // t.CCPieces ([]api.SectorPiece) (slice) + if len("CCPieces") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"CCPieces\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.PreCommit1Out))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CCPieces"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("CCPieces")); err != nil { return err } - if _, err := cw.Write(t.PreCommit1Out[:]); err != nil { + if len(t.CCPieces) > cbg.MaxLength { + return xerrors.Errorf("Slice value in field t.CCPieces was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.CCPieces))); err != nil { return err } + for _, v := range t.CCPieces { + if err := v.MarshalCBOR(cw); err != nil { + return err + } + } - // t.CommD (cid.Cid) (struct) - if len("CommD") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"CommD\" was too long") + // t.CCUpdate (bool) (bool) + if len("CCUpdate") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"CCUpdate\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CommD"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CCUpdate"))); err != nil { return err } - if _, err := io.WriteString(w, string("CommD")); err != nil { + if _, err := io.WriteString(w, string("CCUpdate")); err != nil { return err } - if t.CommD == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if err := cbg.WriteCid(cw, *t.CommD); err != nil { - return xerrors.Errorf("failed to write cid field t.CommD: %w", err) - } + if err := cbg.WriteBool(w, t.CCUpdate); err != nil { + return err } - // t.CommR (cid.Cid) (struct) - if len("CommR") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"CommR\" was too long") + // t.SeedEpoch (abi.ChainEpoch) (int64) + if len("SeedEpoch") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"SeedEpoch\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CommR"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SeedEpoch"))); err != nil { return err } - if _, err := io.WriteString(w, string("CommR")); err != nil { + if _, err := io.WriteString(w, string("SeedEpoch")); err != nil { return err } - if t.CommR == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { + if t.SeedEpoch >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SeedEpoch)); err != nil { return err } } else { - if err := cbg.WriteCid(cw, *t.CommR); err != nil { - return xerrors.Errorf("failed to write cid field t.CommR: %w", err) + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.SeedEpoch-1)); err != nil { + return err } } - // t.Proof ([]uint8) (slice) - if len("Proof") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Proof\" was too long") + // t.SeedValue (abi.InteractiveSealRandomness) (slice) + if len("SeedValue") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"SeedValue\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Proof"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SeedValue"))); err != nil { return err } - if _, err := io.WriteString(w, string("Proof")); err != nil { + if _, err := io.WriteString(w, string("SeedValue")); err != nil { return err } - if len(t.Proof) > cbg.ByteArrayMaxLen { - return xerrors.Errorf("Byte array in field t.Proof was too long") + if len(t.SeedValue) > cbg.ByteArrayMaxLen { + return xerrors.Errorf("Byte array in field t.SeedValue was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.Proof))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.SeedValue))); err != nil { return err } - if _, err := cw.Write(t.Proof[:]); err != nil { + if _, err := cw.Write(t.SeedValue[:]); err != nil { return err } - // t.PreCommitDeposit (big.Int) (struct) - if len("PreCommitDeposit") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"PreCommitDeposit\" was too long") + // t.SectorType (abi.RegisteredSealProof) (int64) + if len("SectorType") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"SectorType\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommitDeposit"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SectorType"))); err != nil { return err } - if _, err := io.WriteString(w, string("PreCommitDeposit")); err != nil { + if _, err := io.WriteString(w, string("SectorType")); err != nil { return err } - if err := t.PreCommitDeposit.MarshalCBOR(cw); err != nil { - return err + if t.SectorType >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SectorType)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.SectorType-1)); err != nil { + return err + } } - // t.PreCommitMessage (cid.Cid) (struct) - if len("PreCommitMessage") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"PreCommitMessage\" was too long") + // t.TicketEpoch (abi.ChainEpoch) (int64) + if len("TicketEpoch") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"TicketEpoch\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommitMessage"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("TicketEpoch"))); err != nil { return err } - if _, err := io.WriteString(w, string("PreCommitMessage")); err != nil { + if _, err := io.WriteString(w, string("TicketEpoch")); err != nil { return err } - if t.PreCommitMessage == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { + if t.TicketEpoch >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.TicketEpoch)); err != nil { return err } } else { - if err := cbg.WriteCid(cw, *t.PreCommitMessage); err != nil { - return xerrors.Errorf("failed to write cid field t.PreCommitMessage: %w", err) + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.TicketEpoch-1)); err != nil { + return err } } - // t.PreCommitTipSet (types.TipSetKey) (struct) - if len("PreCommitTipSet") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"PreCommitTipSet\" was too long") + // t.TicketValue (abi.SealRandomness) (slice) + if len("TicketValue") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"TicketValue\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommitTipSet"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("TicketValue"))); err != nil { return err } - if _, err := io.WriteString(w, string("PreCommitTipSet")); err != nil { + if _, err := io.WriteString(w, string("TicketValue")); err != nil { return err } - if err := t.PreCommitTipSet.MarshalCBOR(cw); err != nil { + if len(t.TicketValue) > cbg.ByteArrayMaxLen { + return xerrors.Errorf("Byte array in field t.TicketValue was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.TicketValue))); err != nil { return err } - // t.PreCommit2Fails (uint64) (uint64) - if len("PreCommit2Fails") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"PreCommit2Fails\" was too long") + if _, err := cw.Write(t.TicketValue[:]); err != nil { + return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommit2Fails"))); err != nil { + // t.CreationTime (int64) (int64) + if len("CreationTime") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"CreationTime\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CreationTime"))); err != nil { return err } - if _, err := io.WriteString(w, string("PreCommit2Fails")); err != nil { + if _, err := io.WriteString(w, string("CreationTime")); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.PreCommit2Fails)); err != nil { - return err + if t.CreationTime >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.CreationTime)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.CreationTime-1)); err != nil { + return err + } } - // t.SeedValue (abi.InteractiveSealRandomness) (slice) - if len("SeedValue") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"SeedValue\" was too long") + // t.SectorNumber (abi.SectorNumber) (uint64) + if len("SectorNumber") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"SectorNumber\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SeedValue"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SectorNumber"))); err != nil { return err } - if _, err := io.WriteString(w, string("SeedValue")); err != nil { + if _, err := io.WriteString(w, string("SectorNumber")); err != nil { return err } - if len(t.SeedValue) > cbg.ByteArrayMaxLen { - return xerrors.Errorf("Byte array in field t.SeedValue was too long") + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SectorNumber)); err != nil { + return err } - if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.SeedValue))); err != nil { - return err + // t.TerminatedAt (abi.ChainEpoch) (int64) + if len("TerminatedAt") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"TerminatedAt\" was too long") } - if _, err := cw.Write(t.SeedValue[:]); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("TerminatedAt"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("TerminatedAt")); err != nil { return err } - // t.SeedEpoch (abi.ChainEpoch) (int64) - if len("SeedEpoch") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"SeedEpoch\" was too long") + if t.TerminatedAt >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.TerminatedAt)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.TerminatedAt-1)); err != nil { + return err + } } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SeedEpoch"))); err != nil { + // t.UpdateSealed (cid.Cid) (struct) + if len("UpdateSealed") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"UpdateSealed\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("UpdateSealed"))); err != nil { return err } - if _, err := io.WriteString(w, string("SeedEpoch")); err != nil { + if _, err := io.WriteString(w, string("UpdateSealed")); err != nil { return err } - if t.SeedEpoch >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SeedEpoch)); err != nil { + if t.UpdateSealed == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.SeedEpoch-1)); err != nil { - return err + if err := cbg.WriteCid(cw, *t.UpdateSealed); err != nil { + return xerrors.Errorf("failed to write cid field t.UpdateSealed: %w", err) } } @@ -435,66 +497,49 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error { return err } - // t.CCUpdate (bool) (bool) - if len("CCUpdate") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"CCUpdate\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CCUpdate"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("CCUpdate")); err != nil { - return err - } - - if err := cbg.WriteBool(w, t.CCUpdate); err != nil { - return err - } - - // t.CCPieces ([]api.SectorPiece) (slice) - if len("CCPieces") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"CCPieces\" was too long") + // t.PreCommit1Out (storiface.PreCommit1Out) (slice) + if len("PreCommit1Out") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"PreCommit1Out\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("CCPieces"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommit1Out"))); err != nil { return err } - if _, err := io.WriteString(w, string("CCPieces")); err != nil { + if _, err := io.WriteString(w, string("PreCommit1Out")); err != nil { return err } - if len(t.CCPieces) > cbg.MaxLength { - return xerrors.Errorf("Slice value in field t.CCPieces was too long") + if len(t.PreCommit1Out) > cbg.ByteArrayMaxLen { + return xerrors.Errorf("Byte array in field t.PreCommit1Out was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.CCPieces))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.PreCommit1Out))); err != nil { return err } - for _, v := range t.CCPieces { - if err := v.MarshalCBOR(cw); err != nil { - return err - } + + if _, err := cw.Write(t.PreCommit1Out[:]); err != nil { + return err } - // t.UpdateSealed (cid.Cid) (struct) - if len("UpdateSealed") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"UpdateSealed\" was too long") + // t.FaultReportMsg (cid.Cid) (struct) + if len("FaultReportMsg") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"FaultReportMsg\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("UpdateSealed"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("FaultReportMsg"))); err != nil { return err } - if _, err := io.WriteString(w, string("UpdateSealed")); err != nil { + if _, err := io.WriteString(w, string("FaultReportMsg")); err != nil { return err } - if t.UpdateSealed == nil { + if t.FaultReportMsg == nil { if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { - if err := cbg.WriteCid(cw, *t.UpdateSealed); err != nil { - return xerrors.Errorf("failed to write cid field t.UpdateSealed: %w", err) + if err := cbg.WriteCid(cw, *t.FaultReportMsg); err != nil { + return xerrors.Errorf("failed to write cid field t.FaultReportMsg: %w", err) } } @@ -520,94 +565,105 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error { } } - // t.ReplicaUpdateProof (storiface.ReplicaUpdateProof) (slice) - if len("ReplicaUpdateProof") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"ReplicaUpdateProof\" was too long") + // t.PreCommit2Fails (uint64) (uint64) + if len("PreCommit2Fails") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"PreCommit2Fails\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ReplicaUpdateProof"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommit2Fails"))); err != nil { return err } - if _, err := io.WriteString(w, string("ReplicaUpdateProof")); err != nil { + if _, err := io.WriteString(w, string("PreCommit2Fails")); err != nil { return err } - if len(t.ReplicaUpdateProof) > cbg.ByteArrayMaxLen { - return xerrors.Errorf("Byte array in field t.ReplicaUpdateProof was too long") + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.PreCommit2Fails)); err != nil { + return err } - if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.ReplicaUpdateProof))); err != nil { + // t.PreCommitTipSet (types.TipSetKey) (struct) + if len("PreCommitTipSet") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"PreCommitTipSet\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommitTipSet"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("PreCommitTipSet")); err != nil { return err } - if _, err := cw.Write(t.ReplicaUpdateProof[:]); err != nil { + if err := t.PreCommitTipSet.MarshalCBOR(cw); err != nil { return err } - // t.ReplicaUpdateMessage (cid.Cid) (struct) - if len("ReplicaUpdateMessage") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"ReplicaUpdateMessage\" was too long") + // t.RemoteDataCache (storiface.SectorLocation) (struct) + if len("RemoteDataCache") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"RemoteDataCache\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ReplicaUpdateMessage"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteDataCache"))); err != nil { return err } - if _, err := io.WriteString(w, string("ReplicaUpdateMessage")); err != nil { + if _, err := io.WriteString(w, string("RemoteDataCache")); err != nil { return err } - if t.ReplicaUpdateMessage == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if err := cbg.WriteCid(cw, *t.ReplicaUpdateMessage); err != nil { - return xerrors.Errorf("failed to write cid field t.ReplicaUpdateMessage: %w", err) - } + if err := t.RemoteDataCache.MarshalCBOR(cw); err != nil { + return err } - // t.FaultReportMsg (cid.Cid) (struct) - if len("FaultReportMsg") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"FaultReportMsg\" was too long") + // t.PreCommitDeposit (big.Int) (struct) + if len("PreCommitDeposit") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"PreCommitDeposit\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("FaultReportMsg"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommitDeposit"))); err != nil { return err } - if _, err := io.WriteString(w, string("FaultReportMsg")); err != nil { + if _, err := io.WriteString(w, string("PreCommitDeposit")); err != nil { return err } - if t.FaultReportMsg == nil { + if err := t.PreCommitDeposit.MarshalCBOR(cw); err != nil { + return err + } + + // t.PreCommitMessage (cid.Cid) (struct) + if len("PreCommitMessage") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"PreCommitMessage\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommitMessage"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("PreCommitMessage")); err != nil { + return err + } + + if t.PreCommitMessage == nil { if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { - if err := cbg.WriteCid(cw, *t.FaultReportMsg); err != nil { - return xerrors.Errorf("failed to write cid field t.FaultReportMsg: %w", err) + if err := cbg.WriteCid(cw, *t.PreCommitMessage); err != nil { + return xerrors.Errorf("failed to write cid field t.PreCommitMessage: %w", err) } } - // t.Return (sealing.ReturnState) (string) - if len("Return") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Return\" was too long") + // t.RemoteDataSealed (storiface.SectorLocation) (struct) + if len("RemoteDataSealed") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"RemoteDataSealed\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Return"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteDataSealed"))); err != nil { return err } - if _, err := io.WriteString(w, string("Return")); err != nil { + if _, err := io.WriteString(w, string("RemoteDataSealed")); err != nil { return err } - if len(t.Return) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.Return was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Return))); err != nil { - return err - } - if _, err := io.WriteString(w, string(t.Return)); err != nil { + if err := t.RemoteDataSealed.MarshalCBOR(cw); err != nil { return err } @@ -633,28 +689,6 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error { } } - // t.TerminatedAt (abi.ChainEpoch) (int64) - if len("TerminatedAt") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"TerminatedAt\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("TerminatedAt"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("TerminatedAt")); err != nil { - return err - } - - if t.TerminatedAt >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.TerminatedAt)); err != nil { - return err - } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.TerminatedAt-1)); err != nil { - return err - } - } - // t.RemoteDataUnsealed (storiface.SectorLocation) (struct) if len("RemoteDataUnsealed") > cbg.MaxLength { return xerrors.Errorf("Value in field \"RemoteDataUnsealed\" was too long") @@ -671,169 +705,135 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error { return err } - // t.RemoteDataSealed (storiface.SectorLocation) (struct) - if len("RemoteDataSealed") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"RemoteDataSealed\" was too long") + // t.ReplicaUpdateProof (storiface.ReplicaUpdateProof) (slice) + if len("ReplicaUpdateProof") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"ReplicaUpdateProof\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteDataSealed"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("RemoteDataSealed")); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ReplicaUpdateProof"))); err != nil { return err } - - if err := t.RemoteDataSealed.MarshalCBOR(cw); err != nil { + if _, err := io.WriteString(w, string("ReplicaUpdateProof")); err != nil { return err } - // t.RemoteDataCache (storiface.SectorLocation) (struct) - if len("RemoteDataCache") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"RemoteDataCache\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteDataCache"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("RemoteDataCache")); err != nil { - return err + if len(t.ReplicaUpdateProof) > cbg.ByteArrayMaxLen { + return xerrors.Errorf("Byte array in field t.ReplicaUpdateProof was too long") } - if err := t.RemoteDataCache.MarshalCBOR(cw); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.ReplicaUpdateProof))); err != nil { return err } - // t.RemoteCommit1Endpoint (string) (string) - if len("RemoteCommit1Endpoint") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"RemoteCommit1Endpoint\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteCommit1Endpoint"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("RemoteCommit1Endpoint")); err != nil { + if _, err := cw.Write(t.ReplicaUpdateProof[:]); err != nil { return err } - if len(t.RemoteCommit1Endpoint) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.RemoteCommit1Endpoint was too long") + // t.RemoteDataFinalized (bool) (bool) + if len("RemoteDataFinalized") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"RemoteDataFinalized\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RemoteCommit1Endpoint))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteDataFinalized"))); err != nil { return err } - if _, err := io.WriteString(w, string(t.RemoteCommit1Endpoint)); err != nil { + if _, err := io.WriteString(w, string("RemoteDataFinalized")); err != nil { return err } - // t.RemoteCommit2Endpoint (string) (string) - if len("RemoteCommit2Endpoint") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"RemoteCommit2Endpoint\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteCommit2Endpoint"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("RemoteCommit2Endpoint")); err != nil { + if err := cbg.WriteBool(w, t.RemoteDataFinalized); err != nil { return err } - if len(t.RemoteCommit2Endpoint) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.RemoteCommit2Endpoint was too long") + // t.ReplicaUpdateMessage (cid.Cid) (struct) + if len("ReplicaUpdateMessage") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"ReplicaUpdateMessage\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RemoteCommit2Endpoint))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ReplicaUpdateMessage"))); err != nil { return err } - if _, err := io.WriteString(w, string(t.RemoteCommit2Endpoint)); err != nil { + if _, err := io.WriteString(w, string("ReplicaUpdateMessage")); err != nil { return err } - // t.RemoteSealingDoneEndpoint (string) (string) - if len("RemoteSealingDoneEndpoint") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"RemoteSealingDoneEndpoint\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteSealingDoneEndpoint"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("RemoteSealingDoneEndpoint")); err != nil { - return err + if t.ReplicaUpdateMessage == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if err := cbg.WriteCid(cw, *t.ReplicaUpdateMessage); err != nil { + return xerrors.Errorf("failed to write cid field t.ReplicaUpdateMessage: %w", err) + } } - if len(t.RemoteSealingDoneEndpoint) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.RemoteSealingDoneEndpoint was too long") + // t.RemoteCommit1Endpoint (string) (string) + if len("RemoteCommit1Endpoint") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"RemoteCommit1Endpoint\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RemoteSealingDoneEndpoint))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteCommit1Endpoint"))); err != nil { return err } - if _, err := io.WriteString(w, string(t.RemoteSealingDoneEndpoint)); err != nil { + if _, err := io.WriteString(w, string("RemoteCommit1Endpoint")); err != nil { return err } - // t.RemoteDataFinalized (bool) (bool) - if len("RemoteDataFinalized") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"RemoteDataFinalized\" was too long") + if len(t.RemoteCommit1Endpoint) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.RemoteCommit1Endpoint was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteDataFinalized"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("RemoteDataFinalized")); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RemoteCommit1Endpoint))); err != nil { return err } - - if err := cbg.WriteBool(w, t.RemoteDataFinalized); err != nil { + if _, err := io.WriteString(w, string(t.RemoteCommit1Endpoint)); err != nil { return err } - // t.LastErr (string) (string) - if len("LastErr") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"LastErr\" was too long") + // t.RemoteCommit2Endpoint (string) (string) + if len("RemoteCommit2Endpoint") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"RemoteCommit2Endpoint\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("LastErr"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteCommit2Endpoint"))); err != nil { return err } - if _, err := io.WriteString(w, string("LastErr")); err != nil { + if _, err := io.WriteString(w, string("RemoteCommit2Endpoint")); err != nil { return err } - if len(t.LastErr) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.LastErr was too long") + if len(t.RemoteCommit2Endpoint) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.RemoteCommit2Endpoint was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.LastErr))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RemoteCommit2Endpoint))); err != nil { return err } - if _, err := io.WriteString(w, string(t.LastErr)); err != nil { + if _, err := io.WriteString(w, string(t.RemoteCommit2Endpoint)); err != nil { return err } - // t.Log ([]sealing.Log) (slice) - if len("Log") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Log\" was too long") + // t.RemoteSealingDoneEndpoint (string) (string) + if len("RemoteSealingDoneEndpoint") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"RemoteSealingDoneEndpoint\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Log"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RemoteSealingDoneEndpoint"))); err != nil { return err } - if _, err := io.WriteString(w, string("Log")); err != nil { + if _, err := io.WriteString(w, string("RemoteSealingDoneEndpoint")); err != nil { return err } - if len(t.Log) > cbg.MaxLength { - return xerrors.Errorf("Slice value in field t.Log was too long") + if len(t.RemoteSealingDoneEndpoint) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.RemoteSealingDoneEndpoint was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Log))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RemoteSealingDoneEndpoint))); err != nil { return err } - for _, v := range t.Log { - if err := v.MarshalCBOR(cw); err != nil { - return err - } + if _, err := io.WriteString(w, string(t.RemoteSealingDoneEndpoint)); err != nil { + return err } return nil } @@ -876,83 +876,114 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.State (sealing.SectorState) (string) - case "State": + // t.Log ([]sealing.Log) (slice) + case "Log": - { - sval, err := cbg.ReadString(cr) - if err != nil { + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > cbg.MaxLength { + return fmt.Errorf("t.Log: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.Log = make([]Log, extra) + } + + for i := 0; i < int(extra); i++ { + + var v Log + if err := v.UnmarshalCBOR(cr); err != nil { return err } - t.State = SectorState(sval) + t.Log[i] = v } - // t.SectorNumber (abi.SectorNumber) (uint64) - case "SectorNumber": + + // t.CommD (cid.Cid) (struct) + case "CommD": { - maj, extra, err = cr.ReadHeader() + b, err := cr.ReadByte() if err != nil { return err } - if maj != cbg.MajUnsignedInt { - return fmt.Errorf("wrong type for uint64 field") + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.CommD: %w", err) + } + + t.CommD = &c } - t.SectorNumber = abi.SectorNumber(extra) } - // t.SectorType (abi.RegisteredSealProof) (int64) - case "SectorType": + // t.CommR (cid.Cid) (struct) + case "CommR": + { - maj, extra, err := cr.ReadHeader() - var extraI int64 + + b, err := cr.ReadByte() if err != nil { return err } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.CommR: %w", err) } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) + + t.CommR = &c } - t.SectorType = abi.RegisteredSealProof(extraI) } - // t.CreationTime (int64) (int64) - case "CreationTime": + // t.Proof ([]uint8) (slice) + case "Proof": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > cbg.ByteArrayMaxLen { + return fmt.Errorf("t.Proof: byte array too large (%d)", extra) + } + if maj != cbg.MajByteString { + return fmt.Errorf("expected byte array") + } + + if extra > 0 { + t.Proof = make([]uint8, extra) + } + + if _, err := io.ReadFull(cr, t.Proof[:]); err != nil { + return err + } + // t.State (sealing.SectorState) (string) + case "State": + { - maj, extra, err := cr.ReadHeader() - var extraI int64 + sval, err := cbg.ReadString(cr) if err != nil { return err } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") - } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") - } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) - } - t.CreationTime = int64(extraI) + t.State = SectorState(sval) } // t.Pieces ([]api.SectorPiece) (slice) case "Pieces": @@ -984,30 +1015,78 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { t.Pieces[i] = v } - // t.TicketValue (abi.SealRandomness) (slice) - case "TicketValue": + // t.Return (sealing.ReturnState) (string) + case "Return": + + { + sval, err := cbg.ReadString(cr) + if err != nil { + return err + } + + t.Return = ReturnState(sval) + } + // t.LastErr (string) (string) + case "LastErr": + + { + sval, err := cbg.ReadString(cr) + if err != nil { + return err + } + + t.LastErr = string(sval) + } + // t.CCPieces ([]api.SectorPiece) (slice) + case "CCPieces": maj, extra, err = cr.ReadHeader() if err != nil { return err } - if extra > cbg.ByteArrayMaxLen { - return fmt.Errorf("t.TicketValue: byte array too large (%d)", extra) + if extra > cbg.MaxLength { + return fmt.Errorf("t.CCPieces: array too large (%d)", extra) } - if maj != cbg.MajByteString { - return fmt.Errorf("expected byte array") + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") } if extra > 0 { - t.TicketValue = make([]uint8, extra) + t.CCPieces = make([]api.SectorPiece, extra) } - if _, err := io.ReadFull(cr, t.TicketValue[:]); err != nil { + for i := 0; i < int(extra); i++ { + + var v api.SectorPiece + if err := v.UnmarshalCBOR(cr); err != nil { + return err + } + + t.CCPieces[i] = v + } + + // t.CCUpdate (bool) (bool) + case "CCUpdate": + + maj, extra, err = cr.ReadHeader() + if err != nil { return err } - // t.TicketEpoch (abi.ChainEpoch) (int64) - case "TicketEpoch": + if maj != cbg.MajOther { + return fmt.Errorf("booleans must be major type 7") + } + switch extra { + case 20: + t.CCUpdate = false + case 21: + t.CCUpdate = true + default: + return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) + } + // t.SeedEpoch (abi.ChainEpoch) (int64) + case "SeedEpoch": { maj, extra, err := cr.ReadHeader() var extraI int64 @@ -1023,17 +1102,17 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: return fmt.Errorf("wrong type for int64 field: %d", maj) } - t.TicketEpoch = abi.ChainEpoch(extraI) + t.SeedEpoch = abi.ChainEpoch(extraI) } - // t.PreCommit1Out (storiface.PreCommit1Out) (slice) - case "PreCommit1Out": + // t.SeedValue (abi.InteractiveSealRandomness) (slice) + case "SeedValue": maj, extra, err = cr.ReadHeader() if err != nil { @@ -1041,67 +1120,73 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.ByteArrayMaxLen { - return fmt.Errorf("t.PreCommit1Out: byte array too large (%d)", extra) + return fmt.Errorf("t.SeedValue: byte array too large (%d)", extra) } if maj != cbg.MajByteString { return fmt.Errorf("expected byte array") } if extra > 0 { - t.PreCommit1Out = make([]uint8, extra) + t.SeedValue = make([]uint8, extra) } - if _, err := io.ReadFull(cr, t.PreCommit1Out[:]); err != nil { + if _, err := io.ReadFull(cr, t.SeedValue[:]); err != nil { return err } - // t.CommD (cid.Cid) (struct) - case "CommD": - + // t.SectorType (abi.RegisteredSealProof) (int64) + case "SectorType": { - - b, err := cr.ReadByte() + maj, extra, err := cr.ReadHeader() + var extraI int64 if err != nil { return err } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") } - - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("failed to read cid field t.CommD: %w", err) + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") } - - t.CommD = &c + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) } + t.SectorType = abi.RegisteredSealProof(extraI) } - // t.CommR (cid.Cid) (struct) - case "CommR": - + // t.TicketEpoch (abi.ChainEpoch) (int64) + case "TicketEpoch": { - - b, err := cr.ReadByte() + maj, extra, err := cr.ReadHeader() + var extraI int64 if err != nil { return err } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") } - - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("failed to read cid field t.CommR: %w", err) + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") } - - t.CommR = &c + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) } + t.TicketEpoch = abi.ChainEpoch(extraI) } - // t.Proof ([]uint8) (slice) - case "Proof": + // t.TicketValue (abi.SealRandomness) (slice) + case "TicketValue": maj, extra, err = cr.ReadHeader() if err != nil { @@ -1109,64 +1194,47 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.ByteArrayMaxLen { - return fmt.Errorf("t.Proof: byte array too large (%d)", extra) + return fmt.Errorf("t.TicketValue: byte array too large (%d)", extra) } if maj != cbg.MajByteString { return fmt.Errorf("expected byte array") } if extra > 0 { - t.Proof = make([]uint8, extra) + t.TicketValue = make([]uint8, extra) } - if _, err := io.ReadFull(cr, t.Proof[:]); err != nil { + if _, err := io.ReadFull(cr, t.TicketValue[:]); err != nil { return err } - // t.PreCommitDeposit (big.Int) (struct) - case "PreCommitDeposit": - - { - - if err := t.PreCommitDeposit.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.PreCommitDeposit: %w", err) - } - - } - // t.PreCommitMessage (cid.Cid) (struct) - case "PreCommitMessage": - + // t.CreationTime (int64) (int64) + case "CreationTime": { - - b, err := cr.ReadByte() + maj, extra, err := cr.ReadHeader() + var extraI int64 if err != nil { return err } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") } - - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("failed to read cid field t.PreCommitMessage: %w", err) + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") } - - t.PreCommitMessage = &c - } - - } - // t.PreCommitTipSet (types.TipSetKey) (struct) - case "PreCommitTipSet": - - { - - if err := t.PreCommitTipSet.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.PreCommitTipSet: %w", err) + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) } + t.CreationTime = int64(extraI) } - // t.PreCommit2Fails (uint64) (uint64) - case "PreCommit2Fails": + // t.SectorNumber (abi.SectorNumber) (uint64) + case "SectorNumber": { @@ -1177,33 +1245,11 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { if maj != cbg.MajUnsignedInt { return fmt.Errorf("wrong type for uint64 field") } - t.PreCommit2Fails = uint64(extra) - - } - // t.SeedValue (abi.InteractiveSealRandomness) (slice) - case "SeedValue": - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - - if extra > cbg.ByteArrayMaxLen { - return fmt.Errorf("t.SeedValue: byte array too large (%d)", extra) - } - if maj != cbg.MajByteString { - return fmt.Errorf("expected byte array") - } - - if extra > 0 { - t.SeedValue = make([]uint8, extra) - } + t.SectorNumber = abi.SectorNumber(extra) - if _, err := io.ReadFull(cr, t.SeedValue[:]); err != nil { - return err } - // t.SeedEpoch (abi.ChainEpoch) (int64) - case "SeedEpoch": + // t.TerminatedAt (abi.ChainEpoch) (int64) + case "TerminatedAt": { maj, extra, err := cr.ReadHeader() var extraI int64 @@ -1219,14 +1265,37 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { case cbg.MajNegativeInt: extraI = int64(extra) if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") + return fmt.Errorf("int64 negative overflow") } extraI = -1 - extraI default: return fmt.Errorf("wrong type for int64 field: %d", maj) } - t.SeedEpoch = abi.ChainEpoch(extraI) + t.TerminatedAt = abi.ChainEpoch(extraI) + } + // t.UpdateSealed (cid.Cid) (struct) + case "UpdateSealed": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.UpdateSealed: %w", err) + } + + t.UpdateSealed = &c + } + } // t.CommitMessage (cid.Cid) (struct) case "CommitMessage": @@ -1266,56 +1335,30 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { t.InvalidProofs = uint64(extra) } - // t.CCUpdate (bool) (bool) - case "CCUpdate": - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - if maj != cbg.MajOther { - return fmt.Errorf("booleans must be major type 7") - } - switch extra { - case 20: - t.CCUpdate = false - case 21: - t.CCUpdate = true - default: - return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) - } - // t.CCPieces ([]api.SectorPiece) (slice) - case "CCPieces": + // t.PreCommit1Out (storiface.PreCommit1Out) (slice) + case "PreCommit1Out": maj, extra, err = cr.ReadHeader() if err != nil { return err } - if extra > cbg.MaxLength { - return fmt.Errorf("t.CCPieces: array too large (%d)", extra) + if extra > cbg.ByteArrayMaxLen { + return fmt.Errorf("t.PreCommit1Out: byte array too large (%d)", extra) } - - if maj != cbg.MajArray { - return fmt.Errorf("expected cbor array") + if maj != cbg.MajByteString { + return fmt.Errorf("expected byte array") } if extra > 0 { - t.CCPieces = make([]api.SectorPiece, extra) + t.PreCommit1Out = make([]uint8, extra) } - for i := 0; i < int(extra); i++ { - - var v api.SectorPiece - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } - - t.CCPieces[i] = v + if _, err := io.ReadFull(cr, t.PreCommit1Out[:]); err != nil { + return err } - - // t.UpdateSealed (cid.Cid) (struct) - case "UpdateSealed": + // t.FaultReportMsg (cid.Cid) (struct) + case "FaultReportMsg": { @@ -1330,10 +1373,10 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { c, err := cbg.ReadCid(cr) if err != nil { - return xerrors.Errorf("failed to read cid field t.UpdateSealed: %w", err) + return xerrors.Errorf("failed to read cid field t.FaultReportMsg: %w", err) } - t.UpdateSealed = &c + t.FaultReportMsg = &c } } @@ -1360,30 +1403,33 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { } } - // t.ReplicaUpdateProof (storiface.ReplicaUpdateProof) (slice) - case "ReplicaUpdateProof": + // t.PreCommit2Fails (uint64) (uint64) + case "PreCommit2Fails": - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } + { - if extra > cbg.ByteArrayMaxLen { - return fmt.Errorf("t.ReplicaUpdateProof: byte array too large (%d)", extra) - } - if maj != cbg.MajByteString { - return fmt.Errorf("expected byte array") - } + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajUnsignedInt { + return fmt.Errorf("wrong type for uint64 field") + } + t.PreCommit2Fails = uint64(extra) - if extra > 0 { - t.ReplicaUpdateProof = make([]uint8, extra) } + // t.PreCommitTipSet (types.TipSetKey) (struct) + case "PreCommitTipSet": + + { + + if err := t.PreCommitTipSet.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.PreCommitTipSet: %w", err) + } - if _, err := io.ReadFull(cr, t.ReplicaUpdateProof[:]); err != nil { - return err } - // t.ReplicaUpdateMessage (cid.Cid) (struct) - case "ReplicaUpdateMessage": + // t.RemoteDataCache (storiface.SectorLocation) (struct) + case "RemoteDataCache": { @@ -1395,18 +1441,25 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { if err := cr.UnreadByte(); err != nil { return err } - - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("failed to read cid field t.ReplicaUpdateMessage: %w", err) + t.RemoteDataCache = new(storiface.SectorLocation) + if err := t.RemoteDataCache.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.RemoteDataCache pointer: %w", err) } + } - t.ReplicaUpdateMessage = &c + } + // t.PreCommitDeposit (big.Int) (struct) + case "PreCommitDeposit": + + { + + if err := t.PreCommitDeposit.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.PreCommitDeposit: %w", err) } } - // t.FaultReportMsg (cid.Cid) (struct) - case "FaultReportMsg": + // t.PreCommitMessage (cid.Cid) (struct) + case "PreCommitMessage": { @@ -1421,23 +1474,32 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { c, err := cbg.ReadCid(cr) if err != nil { - return xerrors.Errorf("failed to read cid field t.FaultReportMsg: %w", err) + return xerrors.Errorf("failed to read cid field t.PreCommitMessage: %w", err) } - t.FaultReportMsg = &c + t.PreCommitMessage = &c } } - // t.Return (sealing.ReturnState) (string) - case "Return": + // t.RemoteDataSealed (storiface.SectorLocation) (struct) + case "RemoteDataSealed": { - sval, err := cbg.ReadString(cr) + + b, err := cr.ReadByte() if err != nil { return err } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.RemoteDataSealed = new(storiface.SectorLocation) + if err := t.RemoteDataSealed.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.RemoteDataSealed pointer: %w", err) + } + } - t.Return = ReturnState(sval) } // t.TerminateMessage (cid.Cid) (struct) case "TerminateMessage": @@ -1462,32 +1524,6 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { } } - // t.TerminatedAt (abi.ChainEpoch) (int64) - case "TerminatedAt": - { - maj, extra, err := cr.ReadHeader() - var extraI int64 - if err != nil { - return err - } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") - } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") - } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) - } - - t.TerminatedAt = abi.ChainEpoch(extraI) - } // t.RemoteDataUnsealed (storiface.SectorLocation) (struct) case "RemoteDataUnsealed": @@ -1508,28 +1544,48 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { } } - // t.RemoteDataSealed (storiface.SectorLocation) (struct) - case "RemoteDataSealed": + // t.ReplicaUpdateProof (storiface.ReplicaUpdateProof) (slice) + case "ReplicaUpdateProof": - { + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } - b, err := cr.ReadByte() - if err != nil { - return err - } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - t.RemoteDataSealed = new(storiface.SectorLocation) - if err := t.RemoteDataSealed.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.RemoteDataSealed pointer: %w", err) - } - } + if extra > cbg.ByteArrayMaxLen { + return fmt.Errorf("t.ReplicaUpdateProof: byte array too large (%d)", extra) + } + if maj != cbg.MajByteString { + return fmt.Errorf("expected byte array") + } + + if extra > 0 { + t.ReplicaUpdateProof = make([]uint8, extra) + } + if _, err := io.ReadFull(cr, t.ReplicaUpdateProof[:]); err != nil { + return err } - // t.RemoteDataCache (storiface.SectorLocation) (struct) - case "RemoteDataCache": + // t.RemoteDataFinalized (bool) (bool) + case "RemoteDataFinalized": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajOther { + return fmt.Errorf("booleans must be major type 7") + } + switch extra { + case 20: + t.RemoteDataFinalized = false + case 21: + t.RemoteDataFinalized = true + default: + return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) + } + // t.ReplicaUpdateMessage (cid.Cid) (struct) + case "ReplicaUpdateMessage": { @@ -1541,10 +1597,13 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { if err := cr.UnreadByte(); err != nil { return err } - t.RemoteDataCache = new(storiface.SectorLocation) - if err := t.RemoteDataCache.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.RemoteDataCache pointer: %w", err) + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.ReplicaUpdateMessage: %w", err) } + + t.ReplicaUpdateMessage = &c } } @@ -1581,64 +1640,6 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) { t.RemoteSealingDoneEndpoint = string(sval) } - // t.RemoteDataFinalized (bool) (bool) - case "RemoteDataFinalized": - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - if maj != cbg.MajOther { - return fmt.Errorf("booleans must be major type 7") - } - switch extra { - case 20: - t.RemoteDataFinalized = false - case 21: - t.RemoteDataFinalized = true - default: - return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) - } - // t.LastErr (string) (string) - case "LastErr": - - { - sval, err := cbg.ReadString(cr) - if err != nil { - return err - } - - t.LastErr = string(sval) - } - // t.Log ([]sealing.Log) (slice) - case "Log": - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - - if extra > cbg.MaxLength { - return fmt.Errorf("t.Log: array too large (%d)", extra) - } - - if maj != cbg.MajArray { - return fmt.Errorf("expected cbor array") - } - - if extra > 0 { - t.Log = make([]Log, extra) - } - - for i := 0; i < int(extra); i++ { - - var v Log - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } - - t.Log[i] = v - } default: // Field doesn't exist on this type, so ignore it @@ -1660,19 +1661,26 @@ func (t *Log) MarshalCBOR(w io.Writer) error { return err } - // t.Timestamp (uint64) (uint64) - if len("Timestamp") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Timestamp\" was too long") + // t.Kind (string) (string) + if len("Kind") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Kind\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Timestamp"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Kind"))); err != nil { return err } - if _, err := io.WriteString(w, string("Timestamp")); err != nil { + if _, err := io.WriteString(w, string("Kind")); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Timestamp)); err != nil { + if len(t.Kind) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.Kind was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Kind))); err != nil { + return err + } + if _, err := io.WriteString(w, string(t.Kind)); err != nil { return err } @@ -1722,28 +1730,22 @@ func (t *Log) MarshalCBOR(w io.Writer) error { return err } - // t.Kind (string) (string) - if len("Kind") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Kind\" was too long") + // t.Timestamp (uint64) (uint64) + if len("Timestamp") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Timestamp\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Kind"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Timestamp"))); err != nil { return err } - if _, err := io.WriteString(w, string("Kind")); err != nil { + if _, err := io.WriteString(w, string("Timestamp")); err != nil { return err } - if len(t.Kind) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.Kind was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Kind))); err != nil { - return err - } - if _, err := io.WriteString(w, string(t.Kind)); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Timestamp)); err != nil { return err } + return nil } @@ -1785,20 +1787,16 @@ func (t *Log) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.Timestamp (uint64) (uint64) - case "Timestamp": + // t.Kind (string) (string) + case "Kind": { - - maj, extra, err = cr.ReadHeader() + sval, err := cbg.ReadString(cr) if err != nil { return err } - if maj != cbg.MajUnsignedInt { - return fmt.Errorf("wrong type for uint64 field") - } - t.Timestamp = uint64(extra) + t.Kind = string(sval) } // t.Trace (string) (string) case "Trace": @@ -1822,16 +1820,20 @@ func (t *Log) UnmarshalCBOR(r io.Reader) (err error) { t.Message = string(sval) } - // t.Kind (string) (string) - case "Kind": + // t.Timestamp (uint64) (uint64) + case "Timestamp": { - sval, err := cbg.ReadString(cr) + + maj, extra, err = cr.ReadHeader() if err != nil { return err } + if maj != cbg.MajUnsignedInt { + return fmt.Errorf("wrong type for uint64 field") + } + t.Timestamp = uint64(extra) - t.Kind = string(sval) } default: diff --git a/storage/pipeline/fsm.go b/storage/pipeline/fsm.go index 25fd6fcef4..8ae18a9fdb 100644 --- a/storage/pipeline/fsm.go +++ b/storage/pipeline/fsm.go @@ -6,8 +6,10 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "net/http" + "os" "reflect" "time" @@ -19,9 +21,15 @@ import ( "github.com/filecoin-project/lotus/api" ) +var errSectorRemoved = errors.New("sector removed") + func (m *Sealing) Plan(events []statemachine.Event, user interface{}) (interface{}, uint64, error) { next, processed, err := m.plan(events, user.(*SectorInfo)) if err != nil || next == nil { + if err == errSectorRemoved && os.Getenv("LOTUS_KEEP_REMOVED_FSM_ACTIVE") != "1" { + return nil, processed, statemachine.ErrTerminated + } + l := Log{ Timestamp: uint64(time.Now().Unix()), Message: fmt.Sprintf("state machine error: %s", err), @@ -601,7 +609,7 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta case Removing: return m.handleRemoving, processed, nil case Removed: - return nil, processed, nil + return nil, processed, errSectorRemoved case RemoveFailed: return m.handleRemoveFailed, processed, nil @@ -615,13 +623,14 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta // Fatal errors case UndefinedSectorState: log.Error("sector update with undefined state!") + return nil, processed, xerrors.Errorf("sector update with undefined state") case FailedUnrecoverable: log.Errorf("sector %d failed unrecoverably", state.SectorNumber) + return nil, processed, xerrors.Errorf("sector %d failed unrecoverably", state.SectorNumber) default: log.Errorf("unexpected sector update state: %s", state.State) + return nil, processed, xerrors.Errorf("unexpected sector update state: %s", state.State) } - - return nil, processed, nil } func (m *Sealing) onUpdateSector(ctx context.Context, state *SectorInfo) error { diff --git a/storage/sealer/cbor_gen.go b/storage/sealer/cbor_gen.go index 48bf0146a4..4fa7fd9804 100644 --- a/storage/sealer/cbor_gen.go +++ b/storage/sealer/cbor_gen.go @@ -48,29 +48,6 @@ func (t *Call) MarshalCBOR(w io.Writer) error { return err } - // t.RetType (sealer.ReturnType) (string) - if len("RetType") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"RetType\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RetType"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("RetType")); err != nil { - return err - } - - if len(t.RetType) > cbg.MaxLength { - return xerrors.Errorf("Value in field t.RetType was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RetType))); err != nil { - return err - } - if _, err := io.WriteString(w, string(t.RetType)); err != nil { - return err - } - // t.State (sealer.CallState) (uint64) if len("State") > cbg.MaxLength { return xerrors.Errorf("Value in field \"State\" was too long") @@ -102,6 +79,29 @@ func (t *Call) MarshalCBOR(w io.Writer) error { if err := t.Result.MarshalCBOR(cw); err != nil { return err } + + // t.RetType (sealer.ReturnType) (string) + if len("RetType") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"RetType\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("RetType"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("RetType")); err != nil { + return err + } + + if len(t.RetType) > cbg.MaxLength { + return xerrors.Errorf("Value in field t.RetType was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RetType))); err != nil { + return err + } + if _, err := io.WriteString(w, string(t.RetType)); err != nil { + return err + } return nil } @@ -153,17 +153,6 @@ func (t *Call) UnmarshalCBOR(r io.Reader) (err error) { } } - // t.RetType (sealer.ReturnType) (string) - case "RetType": - - { - sval, err := cbg.ReadString(cr) - if err != nil { - return err - } - - t.RetType = ReturnType(sval) - } // t.State (sealer.CallState) (uint64) case "State": @@ -199,6 +188,17 @@ func (t *Call) UnmarshalCBOR(r io.Reader) (err error) { } } + // t.RetType (sealer.ReturnType) (string) + case "RetType": + + { + sval, err := cbg.ReadString(cr) + if err != nil { + return err + } + + t.RetType = ReturnType(sval) + } default: // Field doesn't exist on this type, so ignore it @@ -259,20 +259,26 @@ func (t *WorkState) MarshalCBOR(w io.Writer) error { return err } - // t.WorkerCall (storiface.CallID) (struct) - if len("WorkerCall") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"WorkerCall\" was too long") + // t.StartTime (int64) (int64) + if len("StartTime") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"StartTime\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("WorkerCall"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartTime"))); err != nil { return err } - if _, err := io.WriteString(w, string("WorkerCall")); err != nil { + if _, err := io.WriteString(w, string("StartTime")); err != nil { return err } - if err := t.WorkerCall.MarshalCBOR(cw); err != nil { - return err + if t.StartTime >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartTime)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartTime-1)); err != nil { + return err + } } // t.WorkError (string) (string) @@ -298,6 +304,22 @@ func (t *WorkState) MarshalCBOR(w io.Writer) error { return err } + // t.WorkerCall (storiface.CallID) (struct) + if len("WorkerCall") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"WorkerCall\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("WorkerCall"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("WorkerCall")); err != nil { + return err + } + + if err := t.WorkerCall.MarshalCBOR(cw); err != nil { + return err + } + // t.WorkerHostname (string) (string) if len("WorkerHostname") > cbg.MaxLength { return xerrors.Errorf("Value in field \"WorkerHostname\" was too long") @@ -320,28 +342,6 @@ func (t *WorkState) MarshalCBOR(w io.Writer) error { if _, err := io.WriteString(w, string(t.WorkerHostname)); err != nil { return err } - - // t.StartTime (int64) (int64) - if len("StartTime") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"StartTime\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartTime"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("StartTime")); err != nil { - return err - } - - if t.StartTime >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartTime)); err != nil { - return err - } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartTime-1)); err != nil { - return err - } - } return nil } @@ -404,15 +404,31 @@ func (t *WorkState) UnmarshalCBOR(r io.Reader) (err error) { t.Status = WorkStatus(sval) } - // t.WorkerCall (storiface.CallID) (struct) - case "WorkerCall": - + // t.StartTime (int64) (int64) + case "StartTime": { - - if err := t.WorkerCall.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.WorkerCall: %w", err) + maj, extra, err := cr.ReadHeader() + var extraI int64 + if err != nil { + return err + } + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) } + t.StartTime = int64(extraI) } // t.WorkError (string) (string) case "WorkError": @@ -425,42 +441,26 @@ func (t *WorkState) UnmarshalCBOR(r io.Reader) (err error) { t.WorkError = string(sval) } - // t.WorkerHostname (string) (string) - case "WorkerHostname": + // t.WorkerCall (storiface.CallID) (struct) + case "WorkerCall": { - sval, err := cbg.ReadString(cr) - if err != nil { - return err + + if err := t.WorkerCall.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.WorkerCall: %w", err) } - t.WorkerHostname = string(sval) } - // t.StartTime (int64) (int64) - case "StartTime": + // t.WorkerHostname (string) (string) + case "WorkerHostname": + { - maj, extra, err := cr.ReadHeader() - var extraI int64 + sval, err := cbg.ReadString(cr) if err != nil { return err } - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") - } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative oveflow") - } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) - } - t.StartTime = int64(extraI) + t.WorkerHostname = string(sval) } default: diff --git a/storage/sealer/ffiwrapper/sealer_cgo.go b/storage/sealer/ffiwrapper/sealer_cgo.go index e9ce5746ed..871012d0be 100644 --- a/storage/sealer/ffiwrapper/sealer_cgo.go +++ b/storage/sealer/ffiwrapper/sealer_cgo.go @@ -11,7 +11,6 @@ import ( "encoding/base64" "encoding/json" "io" - "io/ioutil" "math/bits" "os" "path/filepath" @@ -1095,7 +1094,7 @@ func (sb *Sealer) FinalizeSectorInto(ctx context.Context, sector storiface.Secto } defer done() - files, err := ioutil.ReadDir(paths.Cache) + files, err := os.ReadDir(paths.Cache) if err != nil { return err } diff --git a/storage/sealer/ffiwrapper/sealer_test.go b/storage/sealer/ffiwrapper/sealer_test.go index dd0c1e1845..34dea3b1b8 100644 --- a/storage/sealer/ffiwrapper/sealer_test.go +++ b/storage/sealer/ffiwrapper/sealer_test.go @@ -5,7 +5,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "math/rand" "os" "path/filepath" @@ -130,7 +129,7 @@ func (s *seal) unseal(t *testing.T, sb *Sealer, sp *basicfs.Provider, si storifa t.Fatal(err) } - expect, _ := ioutil.ReadAll(data(si.ID.Number, 1016)) + expect, _ := io.ReadAll(data(si.ID.Number, 1016)) if !bytes.Equal(b.Bytes(), expect) { t.Fatal("read wrong bytes") } @@ -160,7 +159,7 @@ func (s *seal) unseal(t *testing.T, sb *Sealer, sp *basicfs.Provider, si storifa t.Fatal(err) } - expect, _ = ioutil.ReadAll(data(si.ID.Number, 1016)) + expect, _ = io.ReadAll(data(si.ID.Number, 1016)) require.Equal(t, expect, b.Bytes()) b.Reset() @@ -240,12 +239,12 @@ func corrupt(t *testing.T, sealer *Sealer, id storiface.SectorRef) { } func getGrothParamFileAndVerifyingKeys(s abi.SectorSize) { - dat, err := ioutil.ReadFile("../../../build/proof-params/parameters.json") + dat, err := os.ReadFile("../../../build/proof-params/parameters.json") if err != nil { panic(err) } - datSrs, err := ioutil.ReadFile("../../../build/proof-params/srs-inner-product.json") + datSrs, err := os.ReadFile("../../../build/proof-params/srs-inner-product.json") if err != nil { panic(err) } @@ -281,7 +280,7 @@ func TestSealAndVerify(t *testing.T) { getGrothParamFileAndVerifyingKeys(sectorSize) - cdir, err := ioutil.TempDir("", "sbtest-c-") + cdir, err := os.MkdirTemp("", "sbtest-c-") if err != nil { t.Fatal(err) } @@ -352,7 +351,7 @@ func TestSealPoStNoCommit(t *testing.T) { getGrothParamFileAndVerifyingKeys(sectorSize) - dir, err := ioutil.TempDir("", "sbtest") + dir, err := os.MkdirTemp("", "sbtest") if err != nil { t.Fatal(err) } @@ -416,7 +415,7 @@ func TestSealAndVerify3(t *testing.T) { getGrothParamFileAndVerifyingKeys(sectorSize) - dir, err := ioutil.TempDir("", "sbtest") + dir, err := os.MkdirTemp("", "sbtest") if err != nil { t.Fatal(err) } @@ -494,7 +493,7 @@ func TestSealAndVerifyAggregate(t *testing.T) { getGrothParamFileAndVerifyingKeys(sectorSize) - cdir, err := ioutil.TempDir("", "sbtest-c-") + cdir, err := os.MkdirTemp("", "sbtest-c-") if err != nil { t.Fatal(err) } @@ -576,7 +575,7 @@ func BenchmarkWriteWithAlignment(b *testing.B) { for i := 0; i < b.N; i++ { b.StopTimer() rf, w, _ := commpffi.ToReadableFile(bytes.NewReader(bytes.Repeat([]byte{0xff, 0}, int(bt/2))), int64(bt)) - tf, _ := ioutil.TempFile("/tmp/", "scrb-") + tf, _ := os.CreateTemp("/tmp/", "scrb-") b.StartTimer() ffi.WriteWithAlignment(abi.RegisteredSealProof_StackedDrg2KiBV1, rf, bt, tf, nil) // nolint:errcheck @@ -735,7 +734,7 @@ func TestGenerateUnsealedCID(t *testing.T) { func TestAddPiece512M(t *testing.T) { sz := abi.PaddedPieceSize(512 << 20).Unpadded() - cdir, err := ioutil.TempDir("", "sbtest-c-") + cdir, err := os.MkdirTemp("", "sbtest-c-") if err != nil { t.Fatal(err) } @@ -779,7 +778,7 @@ func BenchmarkAddPiece512M(b *testing.B) { sz := abi.PaddedPieceSize(512 << 20).Unpadded() b.SetBytes(int64(sz)) - cdir, err := ioutil.TempDir("", "sbtest-c-") + cdir, err := os.MkdirTemp("", "sbtest-c-") if err != nil { b.Fatal(err) } @@ -821,7 +820,7 @@ func BenchmarkAddPiece512M(b *testing.B) { func TestAddPiece512MPadded(t *testing.T) { sz := abi.PaddedPieceSize(512 << 20).Unpadded() - cdir, err := ioutil.TempDir("", "sbtest-c-") + cdir, err := os.MkdirTemp("", "sbtest-c-") if err != nil { t.Fatal(err) } @@ -890,7 +889,7 @@ func TestMulticoreSDR(t *testing.T) { getGrothParamFileAndVerifyingKeys(sectorSize) - dir, err := ioutil.TempDir("", "sbtest") + dir, err := os.MkdirTemp("", "sbtest") if err != nil { t.Fatal(err) } @@ -995,7 +994,7 @@ func TestPoStChallengeAssumptions(t *testing.T) { func TestDCAPCloses(t *testing.T) { sz := abi.PaddedPieceSize(2 << 10).Unpadded() - cdir, err := ioutil.TempDir("", "sbtest-c-") + cdir, err := os.MkdirTemp("", "sbtest-c-") if err != nil { t.Fatal(err) } diff --git a/storage/sealer/fr32/fr32_ffi_cmp_test.go b/storage/sealer/fr32/fr32_ffi_cmp_test.go index 7dece47232..32afa470eb 100644 --- a/storage/sealer/fr32/fr32_ffi_cmp_test.go +++ b/storage/sealer/fr32/fr32_ffi_cmp_test.go @@ -3,7 +3,6 @@ package fr32_test import ( "bytes" "io" - "io/ioutil" "os" "testing" @@ -17,7 +16,7 @@ import ( ) func TestWriteTwoPcs(t *testing.T) { - tf, _ := ioutil.TempFile("/tmp/", "scrb-") + tf, _ := os.CreateTemp("/tmp/", "scrb-") paddedSize := abi.PaddedPieceSize(16 << 20) n := 2 @@ -43,7 +42,7 @@ func TestWriteTwoPcs(t *testing.T) { panic(err) } - ffiBytes, err := ioutil.ReadAll(tf) + ffiBytes, err := io.ReadAll(tf) if err != nil { panic(err) } diff --git a/storage/sealer/fr32/fr32_test.go b/storage/sealer/fr32/fr32_test.go index f9150e550c..437fa4e43c 100644 --- a/storage/sealer/fr32/fr32_test.go +++ b/storage/sealer/fr32/fr32_test.go @@ -3,7 +3,6 @@ package fr32_test import ( "bytes" "io" - "io/ioutil" "math/rand" "os" "testing" @@ -19,7 +18,7 @@ import ( func padFFI(buf []byte) []byte { rf, w, _ := commpffi.ToReadableFile(bytes.NewReader(buf), int64(len(buf))) - tf, _ := ioutil.TempFile("/tmp/", "scrb-") + tf, _ := os.CreateTemp("/tmp/", "scrb-") _, _, _, err := ffi.WriteWithAlignment(abi.RegisteredSealProof_StackedDrg32GiBV1, rf, abi.UnpaddedPieceSize(len(buf)), tf, nil) if err != nil { @@ -33,7 +32,7 @@ func padFFI(buf []byte) []byte { panic(err) } - padded, err := ioutil.ReadAll(tf) + padded, err := io.ReadAll(tf) if err != nil { panic(err) } diff --git a/storage/sealer/fr32/readers_test.go b/storage/sealer/fr32/readers_test.go index 21a5cd9cd8..f84b9d67a2 100644 --- a/storage/sealer/fr32/readers_test.go +++ b/storage/sealer/fr32/readers_test.go @@ -3,7 +3,7 @@ package fr32_test import ( "bufio" "bytes" - "io/ioutil" + "io" "testing" "github.com/stretchr/testify/require" @@ -27,7 +27,7 @@ func TestUnpadReader(t *testing.T) { } // using bufio reader to make sure reads are big enough for the padreader - it can't handle small reads right now - readered, err := ioutil.ReadAll(bufio.NewReaderSize(r, 512)) + readered, err := io.ReadAll(bufio.NewReaderSize(r, 512)) if err != nil { t.Fatal(err) } diff --git a/storage/sealer/manager.go b/storage/sealer/manager.go index 336664ca81..db5f9a589b 100644 --- a/storage/sealer/manager.go +++ b/storage/sealer/manager.go @@ -289,14 +289,20 @@ func (m *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request) { m.remoteHnd.ServeHTTP(w, r) } -func schedNop(context.Context, Worker) error { - return nil +var schedNop = PrepareAction{ + Action: func(ctx context.Context, w Worker) error { + return nil + }, + PrepType: sealtasks.TTNoop, } -func (m *Manager) schedFetch(sector storiface.SectorRef, ft storiface.SectorFileType, ptype storiface.PathType, am storiface.AcquireMode) func(context.Context, Worker) error { - return func(ctx context.Context, worker Worker) error { - _, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, ft, ptype, am)) - return err +func (m *Manager) schedFetch(sector storiface.SectorRef, ft storiface.SectorFileType, ptype storiface.PathType, am storiface.AcquireMode) PrepareAction { + return PrepareAction{ + Action: func(ctx context.Context, worker Worker) error { + _, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, ft, ptype, am)) + return err + }, + PrepType: sealtasks.TTFetch, } } @@ -315,16 +321,19 @@ func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storiface.Secto // if the selected worker does NOT have the sealed files for the sector, instruct it to fetch it from a worker that has them and // put it in the sealing scratch space. - sealFetch := func(ctx context.Context, worker Worker) error { - log.Debugf("copy sealed/cache sector data for sector %d", sector.ID) - _, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy)) - _, err2 := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTUpdate|storiface.FTUpdateCache, storiface.PathSealing, storiface.AcquireCopy)) - - if err != nil && err2 != nil { - return xerrors.Errorf("cannot unseal piece. error fetching sealed data: %w. error fetching replica data: %w", err, err2) - } + sealFetch := PrepareAction{ + Action: func(ctx context.Context, worker Worker) error { + log.Debugf("copy sealed/cache sector data for sector %d", sector.ID) + _, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy)) + _, err2 := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTUpdate|storiface.FTUpdateCache, storiface.PathSealing, storiface.AcquireCopy)) + + if err != nil && err2 != nil { + return xerrors.Errorf("cannot unseal piece. error fetching sealed data: %w. error fetching replica data: %w", err, err2) + } - return nil + return nil + }, + PrepType: sealtasks.TTFetch, } if unsealed == nil { diff --git a/storage/sealer/manager_post.go b/storage/sealer/manager_post.go index 29748c8eda..40552722ce 100644 --- a/storage/sealer/manager_post.go +++ b/storage/sealer/manager_post.go @@ -196,7 +196,7 @@ func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, s skipped = append(skipped, sk...) if err != nil { - retErr = multierr.Append(retErr, xerrors.Errorf("partitionCount:%d err:%+v", partIdx, err)) + retErr = multierr.Append(retErr, xerrors.Errorf("partitionIndex:%d err:%+v", partIdx, err)) } flk.Unlock() } diff --git a/storage/sealer/manager_test.go b/storage/sealer/manager_test.go index a44f69a898..cdc135916f 100644 --- a/storage/sealer/manager_test.go +++ b/storage/sealer/manager_test.go @@ -7,7 +7,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -46,7 +45,7 @@ func (t testStorage) DiskUsage(path string) (int64, error) { } func newTestStorage(t *testing.T) *testStorage { - tp, err := ioutil.TempDir(os.TempDir(), "sealer-test-") + tp, err := os.MkdirTemp(os.TempDir(), "sealer-test-") require.NoError(t, err) { @@ -58,7 +57,7 @@ func newTestStorage(t *testing.T) *testStorage { }, "", " ") require.NoError(t, err) - err = ioutil.WriteFile(filepath.Join(tp, "sectorstore.json"), b, 0644) + err = os.WriteFile(filepath.Join(tp, "sectorstore.json"), b, 0644) require.NoError(t, err) } diff --git a/storage/sealer/mock/mock.go b/storage/sealer/mock/mock.go index 6e88b86a58..ab973b3b41 100644 --- a/storage/sealer/mock/mock.go +++ b/storage/sealer/mock/mock.go @@ -6,7 +6,6 @@ import ( "crypto/sha256" "fmt" "io" - "io/ioutil" "math/rand" "sync" @@ -461,7 +460,7 @@ func (mgr *SectorMgr) ReadPiece(ctx context.Context, sector storiface.SectorRef, io.Seeker io.ReaderAt }{ - ReadCloser: ioutil.NopCloser(br), + ReadCloser: io.NopCloser(br), Seeker: br, ReaderAt: br, }, false, nil diff --git a/storage/sealer/piece_provider_test.go b/storage/sealer/piece_provider_test.go index ea2866e5d2..4cbc79a93e 100644 --- a/storage/sealer/piece_provider_test.go +++ b/storage/sealer/piece_provider_test.go @@ -3,7 +3,7 @@ package sealer import ( "bytes" "context" - "io/ioutil" + "io" "math/rand" "net" "net/http" @@ -346,7 +346,7 @@ func (p *pieceProviderTestHarness) readPiece(t *testing.T, offset storiface.Unpa defer func() { _ = rd.Close() }() // Make sure the input matches the output - readData, err := ioutil.ReadAll(rd) + readData, err := io.ReadAll(rd) require.NoError(t, err) require.Equal(t, expectedBytes, readData) } diff --git a/storage/sealer/sched.go b/storage/sealer/sched.go index c2b7d6a2d6..c0ac11bcf9 100644 --- a/storage/sealer/sched.go +++ b/storage/sealer/sched.go @@ -42,6 +42,10 @@ func WithPriority(ctx context.Context, priority int) context.Context { const mib = 1 << 20 type WorkerAction func(ctx context.Context, w Worker) error +type PrepareAction struct { + Action WorkerAction + PrepType sealtasks.TaskType +} type SchedWorker interface { TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) @@ -130,7 +134,7 @@ type WorkerRequest struct { Sel WorkerSelector SchedId uuid.UUID - prepare WorkerAction + prepare PrepareAction work WorkerAction start time.Time @@ -157,7 +161,15 @@ func newScheduler(ctx context.Context, assigner string) (*Scheduler, error) { case "", "utilization": a = NewLowestUtilizationAssigner() case "spread": - a = NewSpreadAssigner() + a = NewSpreadAssigner(false) + case "experiment-spread-qcount": + a = NewSpreadAssigner(true) + case "experiment-spread-tasks": + a = NewSpreadTasksAssigner(false) + case "experiment-spread-tasks-qcount": + a = NewSpreadTasksAssigner(true) + case "experiment-random": + a = NewRandomAssigner() default: return nil, xerrors.Errorf("unknown assigner '%s'", assigner) } @@ -189,7 +201,7 @@ func newScheduler(ctx context.Context, assigner string) (*Scheduler, error) { }, nil } -func (sh *Scheduler) Schedule(ctx context.Context, sector storiface.SectorRef, taskType sealtasks.TaskType, sel WorkerSelector, prepare WorkerAction, work WorkerAction) error { +func (sh *Scheduler) Schedule(ctx context.Context, sector storiface.SectorRef, taskType sealtasks.TaskType, sel WorkerSelector, prepare PrepareAction, work WorkerAction) error { ret := make(chan workerResponse) select { @@ -239,6 +251,13 @@ func (r *WorkerRequest) SealTask() sealtasks.SealTaskType { } } +func (r *WorkerRequest) PrepSealTask() sealtasks.SealTaskType { + return sealtasks.SealTaskType{ + TaskType: r.prepare.PrepType, + RegisteredSealProof: r.Sector.ProofType, + } +} + type SchedDiagRequestInfo struct { Sector abi.SectorID TaskType sealtasks.TaskType diff --git a/storage/sealer/sched_assigner_common.go b/storage/sealer/sched_assigner_common.go index bf92dbf15b..d676d410df 100644 --- a/storage/sealer/sched_assigner_common.go +++ b/storage/sealer/sched_assigner_common.go @@ -58,7 +58,7 @@ func (a *AssignerCommon) TrySched(sh *Scheduler) { windows := make([]SchedWindow, windowsLen) for i := range windows { - windows[i].Allocated = *NewActiveResources() + windows[i].Allocated = *NewActiveResources(newTaskCounter()) } acceptableWindows := make([][]int, queueLen) // QueueIndex -> []OpenWindowIndex diff --git a/storage/sealer/sched_assigner_darts.go b/storage/sealer/sched_assigner_darts.go new file mode 100644 index 0000000000..e28b70e78a --- /dev/null +++ b/storage/sealer/sched_assigner_darts.go @@ -0,0 +1,88 @@ +package sealer + +import ( + "math/rand" + + "github.com/filecoin-project/lotus/storage/sealer/storiface" +) + +func NewRandomAssigner() Assigner { + return &AssignerCommon{ + WindowSel: RandomWS, + } +} + +func RandomWS(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int { + scheduled := 0 + rmQueue := make([]int, 0, queueLen) + + for sqi := 0; sqi < queueLen; sqi++ { + task := (*sh.SchedQueue)[sqi] + + //bestAssigned := math.MaxInt // smaller = better + + type choice struct { + selectedWindow int + needRes storiface.Resources + info storiface.WorkerInfo + bestWid storiface.WorkerID + } + choices := make([]choice, 0, len(acceptableWindows[task.IndexHeap])) + + for i, wnd := range acceptableWindows[task.IndexHeap] { + wid := sh.OpenWindows[wnd].Worker + w := sh.Workers[wid] + + res := w.Info.Resources.ResourceSpec(task.Sector.ProofType, task.TaskType) + + log.Debugf("SCHED try assign sqi:%d sector %d to window %d (awi:%d)", sqi, task.Sector.ID.Number, wnd, i) + + if !windows[wnd].Allocated.CanHandleRequest(task.SealTask(), res, wid, "schedAssign", w.Info) { + continue + } + + choices = append(choices, choice{ + selectedWindow: wnd, + needRes: res, + info: w.Info, + bestWid: wid, + }) + + } + + if len(choices) == 0 { + // all windows full + continue + } + + // chose randomly + randIndex := rand.Intn(len(choices)) + selectedWindow := choices[randIndex].selectedWindow + needRes := choices[randIndex].needRes + info := choices[randIndex].info + bestWid := choices[randIndex].bestWid + + log.Debugw("SCHED ASSIGNED", + "assigner", "darts", + "sqi", sqi, + "sector", task.Sector.ID.Number, + "task", task.TaskType, + "window", selectedWindow, + "worker", bestWid, + "choices", len(choices)) + + windows[selectedWindow].Allocated.Add(task.SealTask(), info.Resources, needRes) + windows[selectedWindow].Todo = append(windows[selectedWindow].Todo, task) + + rmQueue = append(rmQueue, sqi) + scheduled++ + } + + if len(rmQueue) > 0 { + for i := len(rmQueue) - 1; i >= 0; i-- { + sh.SchedQueue.Remove(rmQueue[i]) + } + } + + return scheduled +} diff --git a/storage/sealer/sched_assigner_spread.go b/storage/sealer/sched_assigner_spread.go index f00d24d82b..0a62b7406a 100644 --- a/storage/sealer/sched_assigner_spread.go +++ b/storage/sealer/sched_assigner_spread.go @@ -6,76 +6,84 @@ import ( "github.com/filecoin-project/lotus/storage/sealer/storiface" ) -func NewSpreadAssigner() Assigner { +func NewSpreadAssigner(queued bool) Assigner { return &AssignerCommon{ - WindowSel: SpreadWS, + WindowSel: SpreadWS(queued), } } -func SpreadWS(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int { - scheduled := 0 - rmQueue := make([]int, 0, queueLen) - workerAssigned := map[storiface.WorkerID]int{} - - for sqi := 0; sqi < queueLen; sqi++ { - task := (*sh.SchedQueue)[sqi] - - selectedWindow := -1 - var needRes storiface.Resources - var info storiface.WorkerInfo - var bestWid storiface.WorkerID - bestAssigned := math.MaxInt // smaller = better - - for i, wnd := range acceptableWindows[task.IndexHeap] { - wid := sh.OpenWindows[wnd].Worker - w := sh.Workers[wid] - - res := w.Info.Resources.ResourceSpec(task.Sector.ProofType, task.TaskType) - - log.Debugf("SCHED try assign sqi:%d sector %d to window %d (awi:%d)", sqi, task.Sector.ID.Number, wnd, i) - - if !windows[wnd].Allocated.CanHandleRequest(task.SealTask(), res, wid, "schedAssign", w.Info) { - continue +func SpreadWS(queued bool) func(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int { + return func(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int { + scheduled := 0 + rmQueue := make([]int, 0, queueLen) + workerAssigned := map[storiface.WorkerID]int{} + + for sqi := 0; sqi < queueLen; sqi++ { + task := (*sh.SchedQueue)[sqi] + + selectedWindow := -1 + var needRes storiface.Resources + var info storiface.WorkerInfo + var bestWid storiface.WorkerID + bestAssigned := math.MaxInt // smaller = better + + for i, wnd := range acceptableWindows[task.IndexHeap] { + wid := sh.OpenWindows[wnd].Worker + w := sh.Workers[wid] + + res := w.Info.Resources.ResourceSpec(task.Sector.ProofType, task.TaskType) + + log.Debugf("SCHED try assign sqi:%d sector %d to window %d (awi:%d)", sqi, task.Sector.ID.Number, wnd, i) + + if !windows[wnd].Allocated.CanHandleRequest(task.SealTask(), res, wid, "schedAssign", w.Info) { + continue + } + + wu, found := workerAssigned[wid] + if !found && queued { + wu = w.TaskCounts() + workerAssigned[wid] = wu + } + if wu >= bestAssigned { + continue + } + + info = w.Info + needRes = res + bestWid = wid + selectedWindow = wnd + bestAssigned = wu } - wu, _ := workerAssigned[wid] - if wu >= bestAssigned { + if selectedWindow < 0 { + // all windows full continue } - info = w.Info - needRes = res - bestWid = wid - selectedWindow = wnd - bestAssigned = wu + log.Debugw("SCHED ASSIGNED", + "assigner", "spread", + "spread-queued", queued, + "sqi", sqi, + "sector", task.Sector.ID.Number, + "task", task.TaskType, + "window", selectedWindow, + "worker", bestWid, + "assigned", bestAssigned) + + workerAssigned[bestWid]++ + windows[selectedWindow].Allocated.Add(task.SealTask(), info.Resources, needRes) + windows[selectedWindow].Todo = append(windows[selectedWindow].Todo, task) + + rmQueue = append(rmQueue, sqi) + scheduled++ } - if selectedWindow < 0 { - // all windows full - continue + if len(rmQueue) > 0 { + for i := len(rmQueue) - 1; i >= 0; i-- { + sh.SchedQueue.Remove(rmQueue[i]) + } } - log.Debugw("SCHED ASSIGNED", - "sqi", sqi, - "sector", task.Sector.ID.Number, - "task", task.TaskType, - "window", selectedWindow, - "worker", bestWid, - "assigned", bestAssigned) - - workerAssigned[bestWid]++ - windows[selectedWindow].Allocated.Add(task.SealTask(), info.Resources, needRes) - windows[selectedWindow].Todo = append(windows[selectedWindow].Todo, task) - - rmQueue = append(rmQueue, sqi) - scheduled++ + return scheduled } - - if len(rmQueue) > 0 { - for i := len(rmQueue) - 1; i >= 0; i-- { - sh.SchedQueue.Remove(rmQueue[i]) - } - } - - return scheduled } diff --git a/storage/sealer/sched_assigner_spread_tasks.go b/storage/sealer/sched_assigner_spread_tasks.go new file mode 100644 index 0000000000..09cf980460 --- /dev/null +++ b/storage/sealer/sched_assigner_spread_tasks.go @@ -0,0 +1,98 @@ +package sealer + +import ( + "math" + + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/storiface" +) + +func NewSpreadTasksAssigner(queued bool) Assigner { + return &AssignerCommon{ + WindowSel: SpreadTasksWS(queued), + } +} + +type widTask struct { + wid storiface.WorkerID + tt sealtasks.TaskType +} + +func SpreadTasksWS(queued bool) func(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int { + return func(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int { + scheduled := 0 + rmQueue := make([]int, 0, queueLen) + workerAssigned := map[widTask]int{} + + for sqi := 0; sqi < queueLen; sqi++ { + task := (*sh.SchedQueue)[sqi] + + selectedWindow := -1 + var needRes storiface.Resources + var info storiface.WorkerInfo + var bestWid widTask + bestAssigned := math.MaxInt // smaller = better + + for i, wnd := range acceptableWindows[task.IndexHeap] { + wid := sh.OpenWindows[wnd].Worker + w := sh.Workers[wid] + + res := w.Info.Resources.ResourceSpec(task.Sector.ProofType, task.TaskType) + + log.Debugf("SCHED try assign sqi:%d sector %d to window %d (awi:%d)", sqi, task.Sector.ID.Number, wnd, i) + + if !windows[wnd].Allocated.CanHandleRequest(task.SealTask(), res, wid, "schedAssign", w.Info) { + continue + } + + wt := widTask{wid: wid, tt: task.TaskType} + + wu, found := workerAssigned[wt] + if !found && queued { + st := task.SealTask() + wu = w.TaskCount(&st) + workerAssigned[wt] = wu + } + if wu >= bestAssigned { + continue + } + + info = w.Info + needRes = res + bestWid = wt + selectedWindow = wnd + bestAssigned = wu + } + + if selectedWindow < 0 { + // all windows full + continue + } + + log.Debugw("SCHED ASSIGNED", + "assigner", "spread-tasks", + "spread-queued", queued, + "sqi", sqi, + "sector", task.Sector.ID.Number, + "task", task.TaskType, + "window", selectedWindow, + "worker", bestWid, + "assigned", bestAssigned) + + workerAssigned[bestWid]++ + windows[selectedWindow].Allocated.Add(task.SealTask(), info.Resources, needRes) + windows[selectedWindow].Todo = append(windows[selectedWindow].Todo, task) + + rmQueue = append(rmQueue, sqi) + scheduled++ + } + + if len(rmQueue) > 0 { + for i := len(rmQueue) - 1; i >= 0; i-- { + sh.SchedQueue.Remove(rmQueue[i]) + } + } + + return scheduled + } +} diff --git a/storage/sealer/sched_assigner_utilization.go b/storage/sealer/sched_assigner_utilization.go index 2d051d0007..1e75d904a2 100644 --- a/storage/sealer/sched_assigner_utilization.go +++ b/storage/sealer/sched_assigner_utilization.go @@ -74,6 +74,7 @@ func LowestUtilizationWS(sh *Scheduler, queueLen int, acceptableWindows [][]int, } log.Debugw("SCHED ASSIGNED", + "assigner", "util", "sqi", sqi, "sector", task.Sector.ID.Number, "task", task.TaskType, diff --git a/storage/sealer/sched_post.go b/storage/sealer/sched_post.go index 1055227d81..0e0c397688 100644 --- a/storage/sealer/sched_post.go +++ b/storage/sealer/sched_post.go @@ -2,12 +2,15 @@ package sealer import ( "context" + "errors" "math/rand" "sync" "time" + "github.com/hashicorp/go-multierror" "golang.org/x/xerrors" + "github.com/filecoin-project/go-jsonrpc" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/storage/paths" @@ -102,15 +105,31 @@ func (ps *poStScheduler) Schedule(ctx context.Context, primary bool, spt abi.Reg } }() - selected := candidates[0] - worker := ps.workers[selected.id] + var rpcErrs error - return worker.active.withResources(selected.id, worker.Info, ps.postType.SealTask(spt), selected.res, &ps.lk, func() error { - ps.lk.Unlock() - defer ps.lk.Lock() + for i, selected := range candidates { + worker := ps.workers[selected.id] - return work(ctx, worker.workerRpc) - }) + err := worker.active.withResources(selected.id, worker.Info, ps.postType.SealTask(spt), selected.res, &ps.lk, func() error { + ps.lk.Unlock() + defer ps.lk.Lock() + + return work(ctx, worker.workerRpc) + }) + if err == nil { + return nil + } + + // if the error is RPCConnectionError, try another worker, if not, return the error + if !errors.As(err, new(*jsonrpc.RPCConnectionError)) { + return err + } + + log.Warnw("worker RPC connection error, will retry with another candidate if possible", "error", err, "worker", selected.id, "candidate", i, "candidates", len(candidates)) + rpcErrs = multierror.Append(rpcErrs, err) + } + + return xerrors.Errorf("got RPC errors from all workers: %w", rpcErrs) } type candidateWorker struct { @@ -124,6 +143,11 @@ func (ps *poStScheduler) readyWorkers(spt abi.RegisteredSealProof) (bool, []cand for wid, wr := range ps.workers { needRes := wr.Info.Resources.ResourceSpec(spt, ps.postType) + if !wr.Enabled { + log.Debugf("sched: not scheduling on PoSt-worker %s, worker disabled", wid) + continue + } + if !wr.active.CanHandleRequest(ps.postType.SealTask(spt), needRes, wid, "post-readyWorkers", wr.Info) { continue } diff --git a/storage/sealer/sched_resources.go b/storage/sealer/sched_resources.go index 487e294a22..597f36dbee 100644 --- a/storage/sealer/sched_resources.go +++ b/storage/sealer/sched_resources.go @@ -13,18 +13,68 @@ type ActiveResources struct { gpuUsed float64 cpuUse uint64 - taskCounters map[sealtasks.SealTaskType]int + taskCounters *taskCounter cond *sync.Cond waiting int } -func NewActiveResources() *ActiveResources { - return &ActiveResources{ +type taskCounter struct { + taskCounters map[sealtasks.SealTaskType]int + + // this lock is technically redundant, as ActiveResources is always accessed + // with the worker lock, but let's not panic if we ever change that + lk sync.Mutex +} + +func newTaskCounter() *taskCounter { + return &taskCounter{ taskCounters: map[sealtasks.SealTaskType]int{}, } } +func (tc *taskCounter) Add(tt sealtasks.SealTaskType) { + tc.lk.Lock() + defer tc.lk.Unlock() + tc.taskCounters[tt]++ +} + +func (tc *taskCounter) Free(tt sealtasks.SealTaskType) { + tc.lk.Lock() + defer tc.lk.Unlock() + tc.taskCounters[tt]-- +} + +func (tc *taskCounter) Get(tt sealtasks.SealTaskType) int { + tc.lk.Lock() + defer tc.lk.Unlock() + return tc.taskCounters[tt] +} + +func (tc *taskCounter) Sum() int { + tc.lk.Lock() + defer tc.lk.Unlock() + sum := 0 + for _, v := range tc.taskCounters { + sum += v + } + return sum +} + +func (tc *taskCounter) ForEach(cb func(tt sealtasks.SealTaskType, count int)) { + tc.lk.Lock() + defer tc.lk.Unlock() + for tt, count := range tc.taskCounters { + cb(tt, count) + } +} + +func NewActiveResources(tc *taskCounter) *ActiveResources { + return &ActiveResources{ + taskCounters: tc, + } +} + func (a *ActiveResources) withResources(id storiface.WorkerID, wr storiface.WorkerInfo, tt sealtasks.SealTaskType, r storiface.Resources, locker sync.Locker, cb func() error) error { for !a.CanHandleRequest(tt, r, id, "withResources", wr) { if a.cond == nil { @@ -59,7 +109,7 @@ func (a *ActiveResources) Add(tt sealtasks.SealTaskType, wr storiface.WorkerReso a.cpuUse += r.Threads(wr.CPUs, len(wr.GPUs)) a.memUsedMin += r.MinMemory a.memUsedMax += r.MaxMemory - a.taskCounters[tt]++ + a.taskCounters.Add(tt) return a.utilization(wr) - startUtil } @@ -71,7 +121,7 @@ func (a *ActiveResources) Free(tt sealtasks.SealTaskType, wr storiface.WorkerRes a.cpuUse -= r.Threads(wr.CPUs, len(wr.GPUs)) a.memUsedMin -= r.MinMemory a.memUsedMax -= r.MaxMemory - a.taskCounters[tt]-- + a.taskCounters.Free(tt) if a.cond != nil { a.cond.Broadcast() @@ -82,8 +132,8 @@ func (a *ActiveResources) Free(tt sealtasks.SealTaskType, wr storiface.WorkerRes // handle the request. func (a *ActiveResources) CanHandleRequest(tt sealtasks.SealTaskType, needRes storiface.Resources, wid storiface.WorkerID, caller string, info storiface.WorkerInfo) bool { if needRes.MaxConcurrent > 0 { - if a.taskCounters[tt] >= needRes.MaxConcurrent { - log.Debugf("sched: not scheduling on worker %s for %s; at task limit tt=%s, curcount=%d", wid, caller, tt, a.taskCounters[tt]) + if a.taskCounters.Get(tt) >= needRes.MaxConcurrent { + log.Debugf("sched: not scheduling on worker %s for %s; at task limit tt=%s, curcount=%d", wid, caller, tt, a.taskCounters.Get(tt)) return false } } @@ -170,6 +220,15 @@ func (a *ActiveResources) utilization(wr storiface.WorkerResources) float64 { // return max } +func (a *ActiveResources) taskCount(tt *sealtasks.SealTaskType) int { + // nil means all tasks + if tt == nil { + return a.taskCounters.Sum() + } + + return a.taskCounters.Get(*tt) +} + func (wh *WorkerHandle) Utilization() float64 { wh.lk.Lock() u := wh.active.utilization(wh.Info.Resources) @@ -183,3 +242,31 @@ func (wh *WorkerHandle) Utilization() float64 { return u } + +func (wh *WorkerHandle) TaskCounts() int { + wh.lk.Lock() + u := wh.active.taskCount(nil) + u += wh.preparing.taskCount(nil) + wh.lk.Unlock() + wh.wndLk.Lock() + for _, window := range wh.activeWindows { + u += window.Allocated.taskCount(nil) + } + wh.wndLk.Unlock() + + return u +} + +func (wh *WorkerHandle) TaskCount(tt *sealtasks.SealTaskType) int { + wh.lk.Lock() + u := wh.active.taskCount(tt) + u += wh.preparing.taskCount(tt) + wh.lk.Unlock() + wh.wndLk.Lock() + for _, window := range wh.activeWindows { + u += window.Allocated.taskCount(tt) + } + wh.wndLk.Unlock() + + return u +} diff --git a/storage/sealer/sched_test.go b/storage/sealer/sched_test.go index 2eed1ce738..07731e934c 100644 --- a/storage/sealer/sched_test.go +++ b/storage/sealer/sched_test.go @@ -288,25 +288,30 @@ func TestSched(t *testing.T) { ProofType: spt, } - err := sched.Schedule(ctx, sectorRef, taskType, sel, func(ctx context.Context, w Worker) error { - wi, err := w.Info(ctx) - require.NoError(t, err) + prep := PrepareAction{ + Action: func(ctx context.Context, w Worker) error { + wi, err := w.Info(ctx) + require.NoError(t, err) - require.Equal(t, expectWorker, wi.Hostname) + require.Equal(t, expectWorker, wi.Hostname) - log.Info("IN ", taskName) + log.Info("IN ", taskName) - for { - _, ok := <-done - if !ok { - break + for { + _, ok := <-done + if !ok { + break + } } - } - log.Info("OUT ", taskName) + log.Info("OUT ", taskName) - return nil - }, noopAction) + return nil + }, + PrepType: taskType, + } + + err := sched.Schedule(ctx, sectorRef, taskType, sel, prep, noopAction) if err != context.Canceled { require.NoError(t, err, fmt.Sprint(l, l2)) } @@ -639,8 +644,8 @@ func BenchmarkTrySched(b *testing.B) { Resources: decentWorkerResources, }, Enabled: true, - preparing: NewActiveResources(), - active: NewActiveResources(), + preparing: NewActiveResources(newTaskCounter()), + active: NewActiveResources(newTaskCounter()), } for i := 0; i < windows; i++ { @@ -685,7 +690,7 @@ func TestWindowCompact(t *testing.T) { for _, windowTasks := range start { window := &SchedWindow{ - Allocated: *NewActiveResources(), + Allocated: *NewActiveResources(newTaskCounter()), } for _, task := range windowTasks { @@ -708,7 +713,7 @@ func TestWindowCompact(t *testing.T) { require.Equal(t, len(start)-len(expect), -sw.windowsRequested) for wi, tasks := range expect { - expectRes := NewActiveResources() + expectRes := NewActiveResources(newTaskCounter()) for ti, task := range tasks { require.Equal(t, task, wh.activeWindows[wi].Todo[ti].TaskType, "%d, %d", wi, ti) diff --git a/storage/sealer/sched_worker.go b/storage/sealer/sched_worker.go index e6e1f62da0..b6efc851ac 100644 --- a/storage/sealer/sched_worker.go +++ b/storage/sealer/sched_worker.go @@ -30,12 +30,14 @@ func newWorkerHandle(ctx context.Context, w Worker) (*WorkerHandle, error) { return nil, xerrors.Errorf("getting worker info: %w", err) } + tc := newTaskCounter() + worker := &WorkerHandle{ workerRpc: w, Info: info, - preparing: NewActiveResources(), - active: NewActiveResources(), + preparing: NewActiveResources(tc), + active: NewActiveResources(tc), Enabled: true, closingMgr: make(chan struct{}), @@ -352,8 +354,8 @@ assignLoop: worker.lk.Lock() for t, todo := range firstWindow.Todo { - needRes := worker.Info.Resources.ResourceSpec(todo.Sector.ProofType, todo.TaskType) - if worker.preparing.CanHandleRequest(todo.SealTask(), needRes, sw.wid, "startPreparing", worker.Info) { + needResPrep := worker.Info.Resources.PrepResourceSpec(todo.Sector.ProofType, todo.TaskType, todo.prepare.PrepType) + if worker.preparing.CanHandleRequest(todo.PrepSealTask(), needResPrep, sw.wid, "startPreparing", worker.Info) { tidx = t break } @@ -452,20 +454,21 @@ func (sw *schedWorker) startProcessingTask(req *WorkerRequest) error { w, sh := sw.worker, sw.sched needRes := w.Info.Resources.ResourceSpec(req.Sector.ProofType, req.TaskType) + needResPrep := w.Info.Resources.PrepResourceSpec(req.Sector.ProofType, req.TaskType, req.prepare.PrepType) w.lk.Lock() - w.preparing.Add(req.SealTask(), w.Info.Resources, needRes) + w.preparing.Add(req.PrepSealTask(), w.Info.Resources, needResPrep) w.lk.Unlock() go func() { // first run the prepare step (e.g. fetching sector data from other worker) tw := sh.workTracker.worker(sw.wid, w.Info, w.workerRpc) tw.start() - err := req.prepare(req.Ctx, tw) + err := req.prepare.Action(req.Ctx, tw) w.lk.Lock() if err != nil { - w.preparing.Free(req.SealTask(), w.Info.Resources, needRes) + w.preparing.Free(req.PrepSealTask(), w.Info.Resources, needResPrep) w.lk.Unlock() select { @@ -495,7 +498,7 @@ func (sw *schedWorker) startProcessingTask(req *WorkerRequest) error { // wait (if needed) for resources in the 'active' window err = w.active.withResources(sw.wid, w.Info, req.SealTask(), needRes, &w.lk, func() error { - w.preparing.Free(req.SealTask(), w.Info.Resources, needRes) + w.preparing.Free(req.PrepSealTask(), w.Info.Resources, needResPrep) w.lk.Unlock() defer w.lk.Lock() // we MUST return locked from this function diff --git a/storage/sealer/sealtasks/task.go b/storage/sealer/sealtasks/task.go index bbf33b159a..2e134f3d38 100644 --- a/storage/sealer/sealtasks/task.go +++ b/storage/sealer/sealtasks/task.go @@ -36,6 +36,8 @@ const ( TTGenerateWindowPoSt TaskType = "post/v0/windowproof" TTGenerateWinningPoSt TaskType = "post/v0/winningproof" + + TTNoop TaskType = "" ) var order = map[TaskType]int{ diff --git a/storage/sealer/stats.go b/storage/sealer/stats.go index f34109d78c..90b6287c36 100644 --- a/storage/sealer/stats.go +++ b/storage/sealer/stats.go @@ -43,9 +43,9 @@ func (m *Manager) WorkerStats(ctx context.Context) map[uuid.UUID]storiface.Worke TaskCounts: map[string]int{}, } - for tt, count := range handle.active.taskCounters { + handle.active.taskCounters.ForEach(func(tt sealtasks.SealTaskType, count int) { out[uuid.UUID(id)].TaskCounts[tt.String()] = count - } + }) handle.lk.Unlock() } diff --git a/storage/sealer/storiface/cbor_gen.go b/storage/sealer/storiface/cbor_gen.go index 73a299dec7..2f82da3e6e 100644 --- a/storage/sealer/storiface/cbor_gen.go +++ b/storage/sealer/storiface/cbor_gen.go @@ -30,22 +30,6 @@ func (t *CallID) MarshalCBOR(w io.Writer) error { return err } - // t.Sector (abi.SectorID) (struct) - if len("Sector") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Sector\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Sector"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("Sector")); err != nil { - return err - } - - if err := t.Sector.MarshalCBOR(cw); err != nil { - return err - } - // t.ID (uuid.UUID) (array) if len("ID") > cbg.MaxLength { return xerrors.Errorf("Value in field \"ID\" was too long") @@ -69,6 +53,22 @@ func (t *CallID) MarshalCBOR(w io.Writer) error { if _, err := cw.Write(t.ID[:]); err != nil { return err } + + // t.Sector (abi.SectorID) (struct) + if len("Sector") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Sector\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Sector"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("Sector")); err != nil { + return err + } + + if err := t.Sector.MarshalCBOR(cw); err != nil { + return err + } return nil } @@ -110,17 +110,7 @@ func (t *CallID) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.Sector (abi.SectorID) (struct) - case "Sector": - - { - - if err := t.Sector.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.Sector: %w", err) - } - - } - // t.ID (uuid.UUID) (array) + // t.ID (uuid.UUID) (array) case "ID": maj, extra, err = cr.ReadHeader() @@ -144,6 +134,16 @@ func (t *CallID) UnmarshalCBOR(r io.Reader) (err error) { if _, err := io.ReadFull(cr, t.ID[:]); err != nil { return err } + // t.Sector (abi.SectorID) (struct) + case "Sector": + + { + + if err := t.Sector.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Sector: %w", err) + } + + } default: // Field doesn't exist on this type, so ignore it @@ -294,22 +294,6 @@ func (t *SectorLocation) MarshalCBOR(w io.Writer) error { return err } - // t.Local (bool) (bool) - if len("Local") > cbg.MaxLength { - return xerrors.Errorf("Value in field \"Local\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Local"))); err != nil { - return err - } - if _, err := io.WriteString(w, string("Local")); err != nil { - return err - } - - if err := cbg.WriteBool(w, t.Local); err != nil { - return err - } - // t.URL (string) (string) if len("URL") > cbg.MaxLength { return xerrors.Errorf("Value in field \"URL\" was too long") @@ -333,6 +317,22 @@ func (t *SectorLocation) MarshalCBOR(w io.Writer) error { return err } + // t.Local (bool) (bool) + if len("Local") > cbg.MaxLength { + return xerrors.Errorf("Value in field \"Local\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Local"))); err != nil { + return err + } + if _, err := io.WriteString(w, string("Local")); err != nil { + return err + } + + if err := cbg.WriteBool(w, t.Local); err != nil { + return err + } + // t.Headers ([]storiface.SecDataHttpHeader) (slice) if len("Headers") > cbg.MaxLength { return xerrors.Errorf("Value in field \"Headers\" was too long") @@ -398,7 +398,18 @@ func (t *SectorLocation) UnmarshalCBOR(r io.Reader) (err error) { } switch name { - // t.Local (bool) (bool) + // t.URL (string) (string) + case "URL": + + { + sval, err := cbg.ReadString(cr) + if err != nil { + return err + } + + t.URL = string(sval) + } + // t.Local (bool) (bool) case "Local": maj, extra, err = cr.ReadHeader() @@ -416,17 +427,6 @@ func (t *SectorLocation) UnmarshalCBOR(r io.Reader) (err error) { default: return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) } - // t.URL (string) (string) - case "URL": - - { - sval, err := cbg.ReadString(cr) - if err != nil { - return err - } - - t.URL = string(sval) - } // t.Headers ([]storiface.SecDataHttpHeader) (slice) case "Headers": diff --git a/storage/sealer/storiface/worker.go b/storage/sealer/storiface/worker.go index 3cbf9f737f..2badad2923 100644 --- a/storage/sealer/storiface/worker.go +++ b/storage/sealer/storiface/worker.go @@ -65,6 +65,20 @@ func (wr WorkerResources) ResourceSpec(spt abi.RegisteredSealProof, tt sealtasks return res } +// PrepResourceSpec is like ResourceSpec, but meant for use limiting parallel preparing +// tasks. +func (wr WorkerResources) PrepResourceSpec(spt abi.RegisteredSealProof, tt, prepTT sealtasks.TaskType) Resources { + res := wr.ResourceSpec(spt, tt) + + if prepTT != tt && prepTT != sealtasks.TTNoop { + prepRes := wr.ResourceSpec(spt, prepTT) + res.MaxConcurrent = prepRes.MaxConcurrent + } + + // otherwise, use the default resource table + return res +} + type WorkerStats struct { Info WorkerInfo Tasks []sealtasks.TaskType diff --git a/tools/stats/ipldstore/ipldstore.go b/tools/stats/ipldstore/ipldstore.go index e172d2af2d..2b96fb0cd1 100644 --- a/tools/stats/ipldstore/ipldstore.go +++ b/tools/stats/ipldstore/ipldstore.go @@ -5,7 +5,7 @@ import ( "context" "fmt" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" "go.opencensus.io/stats" @@ -16,7 +16,7 @@ import ( type ApiIpldStore struct { ctx context.Context api apiIpldStoreApi - cache *lru.TwoQueueCache + cache *lru.TwoQueueCache[cid.Cid, []byte] cacheSize int } @@ -31,7 +31,7 @@ func NewApiIpldStore(ctx context.Context, api apiIpldStoreApi, cacheSize int) (* cacheSize: cacheSize, } - cache, err := lru.New2Q(store.cacheSize) + cache, err := lru.New2Q[cid.Cid, []byte](store.cacheSize) if err != nil { return nil, err } @@ -64,7 +64,7 @@ func (ht *ApiIpldStore) Get(ctx context.Context, c cid.Cid, out interface{}) err if a, ok := ht.cache.Get(c); ok { stats.Record(ctx, metrics.IpldStoreCacheHit.M(1)) - raw = a.([]byte) + raw = a } else { bs, err := ht.read(ctx, c) if err != nil { diff --git a/tools/stats/points/collect.go b/tools/stats/points/collect.go index 98c124b2db..8b86695742 100644 --- a/tools/stats/points/collect.go +++ b/tools/stats/points/collect.go @@ -8,7 +8,7 @@ import ( "strings" "time" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" client "github.com/influxdata/influxdb1-client/v2" "github.com/ipfs/go-cid" "go.opencensus.io/stats" @@ -41,11 +41,11 @@ type ChainPointCollector struct { ctx context.Context api LotusApi store adt.Store - actorDigestCache *lru.TwoQueueCache + actorDigestCache *lru.TwoQueueCache[address.Address, string] } func NewChainPointCollector(ctx context.Context, store adt.Store, api LotusApi) (*ChainPointCollector, error) { - actorDigestCache, err := lru.New2Q(2 << 15) + actorDigestCache, err := lru.New2Q[address.Address, string](2 << 15) if err != nil { return nil, err } @@ -62,7 +62,7 @@ func NewChainPointCollector(ctx context.Context, store adt.Store, api LotusApi) func (c *ChainPointCollector) actorDigest(ctx context.Context, addr address.Address, tipset *types.TipSet) (string, error) { if code, ok := c.actorDigestCache.Get(addr); ok { - return code.(string), nil + return code, nil } actor, err := c.api.StateGetActor(ctx, addr, tipset.Key())